frame-financialTax-yjl-1204
sunzehua 2 weeks ago
commit 1c14c773d4

@ -14,7 +14,7 @@ VITE_PUBLIC_PATH = /
# Please note that no line breaks
# VITE_PROXY = [["/basic-api","http://60.209.125.238"],["/upload","http://localhost:3300/upload"]]
# VITE_PROXY=[["/api","http://60.209.125.238:3008"],["/stage-api","https://www.666cxf.com/stage-api"]] # 开发 测试环境
VITE_PROXY=[["/api","http://60.209.125.238:3008"],["/stage-api","https://www.666cxf.com/stage-api"]] # 开发 测试环境
VITE_PROXY=[["/api","http://118.190.144.189:3008"],["/stage-api","https://www.666cxf.com/stage-api"]] # 开发 测试环境
# Delete console
VITE_DROP_CONSOLE = false

@ -17,6 +17,7 @@
;(() => {
var htmlRoot = document.getElementById('htmlRoot')
var theme = window.localStorage.getItem('__APP__DARK__MODE__')
console.log(theme)
if (htmlRoot && theme) {
htmlRoot.setAttribute('data-theme', theme)
theme = htmlRoot = null
@ -25,11 +26,11 @@
</script>
<div id="app">
<style>
html[data-theme='dark'] .app-loading {
html[data-theme='black'] .app-loading {
background-color: #2c344a;
}
html[data-theme='dark'] .app-loading .app-loading-title {
html[data-theme='black'] .app-loading .app-loading-title {
color: rgb(255 255 255 / 85%);
}

@ -36,7 +36,7 @@
"@ant-design/colors": "^6.0.0",
"@ant-design/icons-vue": "^6.1.0",
"@element-plus/icons-vue": "^2.3.1",
"@handsontable/vue3": "^14.5.0",
"@handsontable/vue3": "^14.6.1",
"@iconify/iconify": "^2.2.1",
"@logicflow/core": "^1.1.13",
"@logicflow/extension": "^1.1.13",
@ -56,7 +56,7 @@
"echarts": "^5.3.2",
"element-plus": "^2.3.12",
"exceljs": "^4.3.0",
"handsontable": "^14.5.0",
"handsontable": "^14.6.1",
"intro.js": "^5.1.0",
"lodash": "^4.17.21",
"lodash-es": "^4.17.21",

@ -56,6 +56,8 @@
baseHandler(1, '#275ECC')
}
setDarkMode(v)
const htmlRoot = document.getElementById('htmlRoot')
htmlRoot.setAttribute('data-theme', v)
}
)
// function toggleDarkMode() {

@ -601,7 +601,7 @@
return changes[0][3].includes(item.name)
})
if (item) dict = item[0]
console.log(dict)
if (!dict?.id) return
list.value[changes[0][0]]['feeName'] = changes[0][3].split('-')[1]
list.value[changes[0][0]]['feeId'] = dict['id']
list.value[changes[0][0]]['feeEnName'] = dict['enName']
@ -728,7 +728,7 @@
return changes[0][3].includes(item.name)
})
if (item) dict = item[0]
console.log(dict)
if (!dict?.value) return false
list.value[changes[0][0]]['unit'] = dict?.value
if (changes[0][3].indexOf('-') > -1) {
changes[0][3] = changes[0][3].split('-')[0]
@ -1117,7 +1117,7 @@
exchangeRateList = res.data
})
}
const editKeyCode = [33, 34, 35, 36, 37, 38, 39, 40, 46, 16 ,17, 18]
const editKeyCode = [37, 38, 39, 40, 9]
//
const add = () => {
const hot = hotTb.value.hotInstance
@ -1136,6 +1136,14 @@
hot.addHook('afterOnCellMouseDown', function (event, coords, TD) {})
//
hot.addHook('beforeKeyDown', function (event) {
//
// if (editKeyCode.includes(event.keyCode)) {
// if (hot.getActiveEditor()?.beginEditing) {
// setTimeout(() => {
// hot.getActiveEditor().beginEditing()
// }, 50)
// }
// }
// 'Enter'
if (event.key === 'ArrowDown') {
if (hot.getSelected()[0][0] == list.value.length - 1 && !hot.getActiveEditor()?._opened) {
@ -1175,27 +1183,7 @@
}
//
if (props.isShowBtn) init()
//
// document.addEventListener('keyup', handKeyUp, false)
// document.addEventListener('mousedown', handKeyDown, false)
})
// const handKeyUp = (event) => {
// if (editKeyCode.indexOf(event.keyCode) > -1) {
// console.log(222)
// hotTb.value.hotInstance.removeHook('afterSelectionEnd', afterSelect)
// } else {
// console.log(666)
// hotTb.value.hotInstance.addHook('afterSelectionEnd', afterSelect)
// }
// }
// const handKeyDown = (event) => {
// console.log(333)
// hotTb.value.hotInstance.removeHook('afterSelectionEnd', afterSelect)
// }
// const afterSelect = () => {
// console.log(555)
// hotTb.value.hotInstance.getActiveEditor().beginEditing()
// }
})
//
const updateCol = (list) => {
hotTb.value.hotInstance.updateSettings({

@ -1,3 +1,8 @@
/*
* @Desc:
* @Author: lijj
* @Date: 2024-05-13 09:06:51
*/
import { SizeEnum } from '/@/enums/sizeEnum'
export interface LoadingProps {
@ -6,5 +11,5 @@ export interface LoadingProps {
absolute: boolean
loading: boolean
background: string
theme: 'dark' | 'light'
theme: 'dark' | 'light' | 'black' | 'blue' | 'white'
}

@ -1,13 +1,19 @@
/*
* @Desc:
* @Author: lijj
* @Date: 2024-07-17 08:39:50
*/
/**
*
* @param darkModeVal
* @param themeMode (), ,
*/
export const getTheme = (
darkModeVal: 'light' | 'dark' | string,
darkModeVal: 'light' | 'dark' | 'black' | 'blue' | 'white' | string,
themeMode: 'default' | 'content' | 'code' = 'default',
) => {
const isDark = darkModeVal === 'dark'
console.log(darkModeVal)
const isDark = darkModeVal === 'black'
switch (themeMode) {
case 'default':
return isDark ? 'dark' : 'classic'

@ -1,3 +1,8 @@
/*
* @Desc:
* @Author: lijj
* @Date: 2024-05-13 09:06:51
*/
import type { Menu } from '/@/router/types'
import type { PropType } from 'vue'
@ -26,7 +31,7 @@ export const basicProps = {
},
theme: {
type: String as PropType<MenuTheme>,
default: ThemeEnum.DARK,
default: ThemeEnum.BLACK,
},
inlineCollapsed: propTypes.bool,
mixSider: propTypes.bool,
@ -44,7 +49,7 @@ export const itemProps = {
default: {},
},
level: propTypes.number,
theme: propTypes.oneOf(['dark', 'light']),
theme: propTypes.oneOf(['dark', 'light', 'black', 'blue', 'white']),
showTitle: propTypes.bool,
isHorizontal: propTypes.bool,
}

@ -52,13 +52,15 @@
@cell-click="clickVxeRow"
@sort-change="sortChangeEvent"
@resizable-change="resizableChangeEvent"
@radio-change="rowChange"
@checkbox-change="rowChange"
>
<template #empty>
<div>
<img src="../../../assets/images/nodata.png" />
</div>
</template>
<vxe-column type="checkbox" fixed="left" width="40"></vxe-column>
<vxe-column :type="getBindValues?.rowSelection?.type" fixed="left" width="40"></vxe-column>
<vxe-column v-if="numberCol !== false" type="seq" title="序号" width="50"></vxe-column>
<template
v-for="(item, index) in getBindValues.columns"
@ -184,7 +186,8 @@ export default defineComponent({
'edit-change',
'expanded-rows-change',
'change',
'columns-change'
'columns-change',
'row-change'
],
setup(props, { attrs, emit, slots, expose }) {
const tableElRef = ref(null)
@ -524,6 +527,10 @@ export default defineComponent({
// fetch()
// }
// }
// vxetable
const rowChange = (data) => {
emit('row-change', data)
}
return {
vxeSetId,
formRef,
@ -556,7 +563,8 @@ export default defineComponent({
resizeColumn,
reload,
updateCol,
numberCol
numberCol,
rowChange
}
},
})

@ -103,7 +103,7 @@ export const basicProps = {
resizeHeightOffset: propTypes.number.def(0),
rowSelection: {
type: Object as PropType<TableRowSelection | null>,
default: null,
default: { type: 'checkbox' },
},
title: {
type: [String, Function] as PropType<string | ((data: Recordable) => string)>,

@ -201,6 +201,9 @@
}
// handsontable 全选checkbox
.handsontable {
.area::before {
background-color: #ffffff;
}
>img {
position: absolute;
top: 50%;

@ -2,7 +2,7 @@
background-color: @component-background !important;
}
html[data-theme='light'] {
html[data-theme='white'] {
.text-secondary {
color: rgb(0 0 0 / 45%);
}
@ -27,7 +27,7 @@ html[data-theme='light'] {
}
}
[data-theme='dark'] {
[data-theme='balck'] {
.text-secondary {
color: #8b949e;
}

@ -11,7 +11,7 @@ import { useRootSetting } from '/@/hooks/setting/useRootSetting'
export function useECharts(
elRef: Ref<HTMLDivElement>,
theme: 'light' | 'dark' | 'default' = 'default',
theme: 'light' | 'dark' | 'black' | 'blue' | 'white' | 'default' = 'default',
) {
const { getDarkMode: getSysDarkMode } = useRootSetting()

@ -1,203 +1,105 @@
@prefix-cls: ~'@{namespace}-multiple-tabs';
html[data-theme='dark'] {
html[data-theme='black'] {
.@{prefix-cls} {
.ant-tabs-tab {
border-bottom: 1px solid @border-color-base;
background: rgba(255, 255, 255, 0.15)!important;
border: transparent;
.ml-1, svg {
color: #ffffff;
}
}
.ant-tabs-tab-active {
background: #ffffff!important;
.ml-1 {
color: #2A303C!important;
font-weight: 400;
}
html[data-theme='light'] {
.@{prefix-cls} {
.ant-tabs-tab:not(.ant-tabs-tab-active) {
// border: 1px solid #d9d9d9 !important;
}
}
}
.@{prefix-cls} {
z-index: 10;
height: @multiple-height + 2;
line-height: @multiple-height + 2;
background-color: transparent;
// border-bottom: 1px solid @border-color-base;
.ant-tabs-small {
height: @multiple-height;
}
.ant-tabs-top > .ant-tabs-nav::before, .ant-tabs-bottom > .ant-tabs-nav::before, .ant-tabs-top > div > .ant-tabs-nav::before, .ant-tabs-bottom > div > .ant-tabs-nav::before {
border-bottom: none;
}
.ant-tabs-nav-more {
background-color: #f5f5f5!important;
width: 30px;
border-radius: 2px;
margin-left: 8px;
svg {
position: absolute;
top: 3px;
left: 3px;
font-size: 26px;
color: #7A8798;
color: #2A303C;
}
}
.ant-tabs.ant-tabs-card {
.ant-tabs-nav {
padding-top: 2px;
height: @multiple-height;
margin: 0;
background-color: transparent;
border: 0;
box-shadow: none;
.ant-tabs-nav-container {
height: @multiple-height;
padding-top: 2px;
}
.ant-tabs-tab {
max-width: 160px;
height: calc(@multiple-height - 2px);
padding-right: 12px;
line-height: calc(@multiple-height - 4px);
color: @text-color-base;
background-color: @multiple-bg;
transition: none;
border-radius: 2px;
border: none;
&:hover {
.ant-tabs-tab-remove {
opacity: 1;
}
}
.ant-tabs-tab-remove {
width: 8px;
height: 28px;
font-size: 12px;
color: inherit;
opacity: 1;
transition: none;
margin-left: 0px;
margin-right: -4px;
&:hover {
svg {
width: 0.8em;
}
}
html[data-theme='white'] {
.@{prefix-cls} {
.ant-tabs-tab {
background: #EDF2F7;
border: transparent;
.ml-1 {
color: #879AAB;
}
// > div {
// display: flex;
// justify-content: center;
// align-items: center;
// }
svg {
fill: @text-color-base;
color: #879AAB;
}
}
.ant-tabs-tab:not(.ant-tabs-tab-active) {
&:hover {
color: @primary-color;
}
}
.ant-tabs-tab-active {
position: relative;
padding-left: 18px;
background: @primary-color;
border: 0;
transition: none;
span {
color: @white !important;
}
.ant-tabs-tab-remove {
opacity: 1;
background: #275ECC!important;
.ml-1 {
color: #ffffff!important;
font-weight: 400;
}
svg {
width: 0.7em;
fill: @white;
color: #ffffff;
}
}
}
}
.ant-tabs-nav > div:nth-child(1) {
padding: 0;
margin-left: 20px;
html[data-theme='blue'] {
.@{prefix-cls} {
.ant-tabs-tab {
// margin-right: 3px !important;
background: rgba(255, 255, 255, 0.15)!important;
border: transparent;
.ml-1, svg {
color: #ffffff;
}
}
.ant-tabs-tab-active {
background: #ffffff!important;
.ml-1 {
color: #275ECC!important;
font-weight: 400;
}
.ant-tabs-tab:not(.ant-tabs-tab-active) {
.anticon-close {
font-size: 12px;
svg {
width: 0.6em;
}
color: #275ECC;
}
}
.ant-dropdown-trigger {
display: inline-flex;
}
&--hide-close {
.ant-tabs-tab-remove {
opacity: 0 !important;
}
}
&-content {
&__extra-quick,
&__extra-redo,
&__extra-fold {
display: inline-block;
width: 36px;
height: @multiple-height;
line-height: @multiple-height;
color: @text-color-secondary;
text-align: center;
cursor: pointer;
// border-left: 1px solid @border-color-base;
&:hover {
color: @text-color-base;
.@{prefix-cls} {
.ant-tabs-nav {
margin: 0;
padding-left: 20px;
}
span[role='img'] {
transform: rotate(90deg);
.ant-tabs-tab, .ant-tabs-nav-more, .ant-tabs-tab-btn, .vben-multiple-tabs-content__info {
.ml-1 {
margin: 0;
}
line-height: 30px;
height: 30px;
}
&__extra-redo {
span[role='img'] {
transform: rotate(0deg);
.ant-tabs-tab {
border-radius: 5px!important;
}
.ant-tabs-top > .ant-tabs-nav::before, .ant-tabs-bottom > .ant-tabs-nav::before, .ant-tabs-top > div > .ant-tabs-nav::before, .ant-tabs-bottom > div > .ant-tabs-nav::before {
border-bottom: none;
}
z-index: 10;
&__info {
display: inline-block;
width: 100%;
height: @multiple-height - 2;
padding-left: 0;
margin-left: -10px;
font-size: 12px;
cursor: pointer;
user-select: none;
span {
margin-left: 7px;
margin-right: 10px;
}
.ant-tabs-nav-more {
background-color: #f5f5f5!important;
width: 30px;
border-radius: 2px;
margin-left: 8px;
svg {
position: absolute;
top: 3px;
left: 3px;
font-size: 26px;
color: #7A8798;
}
}
}

@ -196,4 +196,9 @@
</script>
<style lang="less">
@import './index.less';
html[data-theme='light'] {
.ant-tabs-tab {
background: red!important;
}
}
</style>

@ -1,3 +1,8 @@
/*
* @Desc:
* @Author: lijj
* @Date: 2024-05-13 09:06:51
*/
import { darkCssIsReady, loadDarkThemeCss } from 'vite-plugin-theme/es/client'
import { addClass, hasClass, removeClass } from '/@/utils/domUtils'
@ -11,14 +16,13 @@ export async function updateDarkTheme(mode: string | null = 'light') {
if (import.meta.env.PROD && !darkCssIsReady) {
await loadDarkThemeCss()
}
htmlRoot.setAttribute('data-theme', 'dark')
if (!hasDarkClass) {
addClass(htmlRoot, 'dark')
}
} else {
htmlRoot.setAttribute('data-theme', 'light')
if (hasDarkClass) {
removeClass(htmlRoot, 'dark')
}
}
htmlRoot.setAttribute('data-theme', mode)
}

@ -152,7 +152,6 @@
setModalProps({ confirmLoading: false, loading: true })
isUpdate.value = !!data?.isUpdate
await init()
console.log(unref(isUpdate), 11111111111111111)
if (unref(isUpdate)) {
rowId.value = data.record.id

@ -195,7 +195,6 @@
formLoading.value = true
isUpdate.value = !!data?.isUpdate
await init()
console.log(unref(isUpdate), 11111111111111111)
if (unref(isUpdate)) {
rowId.value = data.record.id

@ -84,7 +84,8 @@
</div>
<Divider v-if="id" type="horizontal" />
<!-- 联系人信息 -->
<ContactList v-if="id" :id="id" :data="bookingDetails.orderContactList" @getBaseInfo="getBaseInfo"></ContactList>
<!-- <ContactList v-if="id" :id="id" :data="bookingDetails.orderContactList" @getBaseInfo="getBaseInfo"></ContactList> -->
<ContactList ref="contactList" :data="bookingDetails"></ContactList>
<Divider type="horizontal" />
<!-- 备注信息 -->
<noteInfo ref="RefNoteInfo" :details="bookingDetails" @transfData="transfData"></noteInfo>
@ -360,6 +361,7 @@
//
OtherInfo.value.updateSchema(content)
RefbasicInfo.value.updateSchema(content)
RefbasicInfo.value.updateContractNo()
RefmailingInfo.value.updateSchemaL(content)
RefmailingInfo.value.updateSchemaR(content)
//
@ -493,6 +495,7 @@
})
}
}
const contactList = ref(null)
//
const save = async (task) => {
//
@ -578,6 +581,11 @@
})
serviceItem = String(codes)
}
//
if (baseinfoForm.contractNo) {
baseinfoForm.contractNo = baseinfoForm.contractNo.replace(/^\s+|\s+$/g, '')
console.log(baseinfoForm.contractNo)
}
// post
const postData = {
...baseinfoForm,
@ -589,6 +597,7 @@
...noteForm,
ediInfo: ediFrom,
ctnInfo,
orderContacts: contactList.value.getDataSource(),
soRemark: ediFrom.soRemark,
closeDocRemark: ediFrom.closeDocRemark,
serviceItem
@ -932,6 +941,7 @@
}
//
const submit = async () => {
await save(null)
//
const data = bookingDetails.value
if (data.customerName) {
@ -949,8 +959,6 @@
if (p.length == 0) {
return createMessage.warning('请完善国内发货人联系人信息!')
}
console.log(data.orderContactList)
console.log(p)
}
if (data.forwarder) {
const p = data.orderContactList.filter(item => {
@ -1143,11 +1151,11 @@
RefmailingInfo.value.$data.userHasLine = !!bookingDetails.value.lineName
}
}
//
const getBaseInfo = () => {
const data = RefbasicInfo.value.getFieldsValue()
emitter.emit('sendBaseInfo', data)
}
// //
// const getBaseInfo = () => {
// const data = RefbasicInfo.value.getFieldsValue()
// emitter.emit('sendBaseInfo', data)
// }
function changeTab(e) {
tabActiveKey.value = e
// setTimeout(() => {

@ -141,3 +141,12 @@ export function BatchDelTruckCtns(parameter) {
data: parameter,
})
}
// 一键放舱邮件发送
export function OneKeySendLetterYard(parameter) {
return request({
url: '/opApi/OpBusinessYard/OneKeySendLetterYard',
method: 'post',
data: parameter,
})
}

@ -49,7 +49,7 @@
//
import EmailModal from '/@/components/EmailModal/index.vue'
import { formSchema, historyColumns } from './OpBusinessYardColumns'
import { EditOpBusinessYard, GetOpBusinessYardInfo, BatchDelOpBusinessYard, GetYardHistoryList } from './LetterApi'
import { EditOpBusinessYard, GetOpBusinessYardInfo, BatchDelOpBusinessYard, GetYardHistoryList, OneKeySendLetterYard } from './LetterApi'
import { useMessage } from '/@/hooks/web/useMessage'
import { useUserStore } from '/@/store/modules/user'
import { propTypes } from '/@/utils/propTypes'
@ -193,8 +193,11 @@
}
//
const sendEmail = () => {
console.log(props)
//
emailModal.value.init([], props.businessId)
OneKeySendLetterYard({ bookingId: props.businessId?.id }).then(res => {
console.log(res)
})
}
defineExpose({
setFieldsValue

@ -1,157 +0,0 @@
<template>
<BasicModal
v-bind="$attrs"
:use-wrapper="true"
:title="getTitle"
width="50%"
class="person-modal"
:zIndex="1211"
@register="registerModal"
@ok="handleSave"
>
<!-- 包装表单 -->
<BasicForm @register="registerForm" @linkageForm="linkageForm" >
</BasicForm>
<!--右下角按钮-->
<template #footer>
<a-button
:loading="loading"
style="margin-right: 0.8rem"
@click="closeModal"
>
取消
</a-button>
<a-button
type="primary"
:loading="loading"
@click="handleSave(true)"
>
保存
</a-button>
</template>
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, unref, onMounted } from 'vue'
//
import { BasicModal, useModalInner } from '/@/components/Modal'
import { BasicForm, useForm } from '/@/components/Form/index'
import { getDictOption } from '/@/utils/dictUtil'
//
// import { ApiEdit } from '/@/views/baseinfo/infoclient/menu2/api'
import emitter from '/@/utils/Bus'
//
import { personFormSchema } from './baseInfo'
//
import { EditBusinessOrderContact, GetBusinessOrderContactInfo } from '/@/views/operation/seaexport/api/BookingLedger'
//
import { useMessage } from '/@/hooks/web/useMessage'
// Emits
const emit = defineEmits(['success', 'register', 'getBaseInfo'])
const isUpdate = ref(true)
// loading
const loading = ref(false)
const rowId = ref('')
const { createMessage } = useMessage()
const [registerForm, { resetFields, setFieldsValue, validate, updateSchema, getFieldsValue }] =
useForm({
labelWidth: 100,
schemas: personFormSchema,
showActionButtonGroup: false
})
// id
const id = ref()
const [registerModal, { setModalProps, closeModal, updateFormField }] = useModalInner(async (data) => {
resetFields()
setModalProps({ confirmLoading: false, loading: true })
isUpdate.value = !!data?.isUpdate
id.value = data.id
if (unref(isUpdate)) {
setModalProps({ confirmLoading: true });
updateFormField(updateSchema)
rowId.value = data.record.id
const res: API.DataResult = await GetBusinessOrderContactInfo({ id: unref(rowId) })
console.log(res)
if (res.succeeded) {
setFieldsValue({
...res.data,
id: res.data.id
})
}
} else {
//
const arr = await getDictOption('infoclient-ArrclientTag')
if (data.companyType) {
const res = arr.filter(item => {
return item.label == data.companyType
})
if (res && res.length) {
setFieldsValue({ customerType: res[0].value })
}
}
}
setModalProps({ loading: false })
})
let changeType = ''
//
const linkageForm = (item) => {
if (item.key == 'customerType') {
changeType = item.value
emit('getBaseInfo', item.value)
}
}
const getTitle = computed(() => (!unref(isUpdate) ? '新增' : '编辑'))
//
const personChange = (e, obj) => {
setFieldsValue({
customerContactId: e,
name: obj.label
})
}
async function handleSave(exit) {
try {
const values = await validate()
if (!values.mobile && !values.tel) return createMessage.warning('请填写电话或者手机!')
values['businessId'] = id.value
if (getFieldsValue().id) {
values['id'] = getFieldsValue().id
}
loading.value = true
setModalProps({ confirmLoading: true, loading: true })
const res: API.DataResult = await EditBusinessOrderContact(values)
loading.value = false
if (res.succeeded) {
createMessage.success(res.message)
emit('success', values)
}
exit && closeModal()
} finally {
setModalProps({ confirmLoading: false, loading: false })
}
}
onMounted(() => {
emitter.on('sendBaseInfo', (v) => {
if (changeType == 'controller') {
setFieldsValue({
customerName: v.customerName || null,
customerId: v.customerId || null
})
} else if (changeType == 'booking') {
setFieldsValue({
customerId: v.forwarderId,
customerName: v.forwarder
})
} else if (changeType == 'shippercn') {
setFieldsValue({
customerName: v.shipperCn,
customerId: v.shipperCnId
})
} else {
setFieldsValue({
customerName: null,
customerId: null
})
}
})
})
</script>

File diff suppressed because it is too large Load Diff

@ -144,14 +144,13 @@
<script lang="ts" setup>
import { BasicForm, useForm } from '/@/components/Form/index'
import { basicInfoFormSchema, basicInfoFormAllSchema } from './baseInfo.tsx'
import { ref, watch, onMounted, reactive, getCurrentInstance } from 'vue'
import { ref, watch, onMounted, reactive, nextTick } from 'vue'
import { useMessage } from '/@/hooks/web/useMessage'
import emitter from '/@/utils/Bus'
const { createMessage } = useMessage()
import { useRoute } from 'vue-router'
import { Divider } from 'ant-design-vue'
import { useUserStore } from '/@/store/modules/user'
import { mode } from 'crypto-js'
const userStore = useUserStore()
const route = useRoute()
//
@ -211,6 +210,7 @@ import { mode } from 'crypto-js'
let contractNoFlag = true
//
const toggleCNo = (model) => {
console.log(model)
if (model.contractNo) {
if (model.contractId) {
//
@ -218,12 +218,19 @@ import { mode } from 'crypto-js'
{ field: 'contractId', show: false },
{ field: 'contractNo', show: true }
])
setFieldsValue({
contractId: null,
contractNo: null
})
} else {
//
updateSchema([
{ field: 'contractId', show: true },
{ field: 'contractNo', show: false }
])
setFieldsValue({
contractNo: null
})
}
} else {
//
@ -279,12 +286,15 @@ import { mode } from 'crypto-js'
emitter.emit('seaAddNotes', item.value)
} else if (item.key == 'customerName') {
//
if (!props?.details?.id) return
// if (!props?.details?.id) return
//
emitter.emit('customerBack', item.value)
} else if (item.key == 'carrier') {
//
emits('changeClear')
} else if (item.key == 'contact') {
//
emitter.emit('contactPerson', item.data)
}
}
watch(
@ -295,14 +305,16 @@ import { mode } from 'crypto-js'
formData.shippingSpaceType = v.shippingSpaceType
formData.bookingType = v.bookingType
formData.issuingWay = v.issuingWay
},
)
const updateContractNo = () => {
if (props.details.contractNo && !props.details.contractId) {
updateSchema([
{ field: 'contractId', show: false },
{ field: 'contractNo', show: true }
])
}
},
)
}
onMounted(() => {
// if (source.value != 'edit') {
// basicInfoFormSchema.forEach(item => {
@ -331,6 +343,7 @@ import { mode } from 'crypto-js'
updateSchema,
validate,
formData,
updateContractNo
})
</script>
<style lang="less">

@ -719,6 +719,10 @@
</script>
<style lang="less">
.ds-goods-info {
.ant-input-number-group-addon {
font-size: 12px;
color: #FF8D1A;
}
.ant-input-number-handler-wrap {
display: none;
}

@ -3,6 +3,8 @@
<BasicTable
class="ds-table-detail sea-contact"
@register="registerTable"
@row-click="editRow"
:dataSource="data.orderContactList"
>
<template #tableTitle>
<div class="flex">
@ -26,35 +28,27 @@
</div>
</div>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
icon: 'clarity:note-edit-line',
tooltip: '编辑',
onClick: handleEdit.bind(null, record)
},
]"
/>
</template>
</template>
</BasicTable>
<PersonModal @register="registerModal" @success="handleSuccess" @getBaseInfo="getBaseInfo" />
<!-- <PersonModal @register="registerModal" @success="handleSuccess" @getBaseInfo="getBaseInfo" /> -->
</a-spin>
</template>
<script lang="ts" setup>
import { ref, watch, onMounted } from 'vue'
import { ref, watch, onMounted, onUnmounted, unref } from 'vue'
import emitter from '/@/utils/Bus'
import { personColumns } from './baseInfo.tsx'
import { BasicTable, useTable, TableAction } from '/@/components/Table'
import { GetBusinessOrderContactList, BatchDelBusinessOrderContact } from '/@/views/operation/seaexport/api/BookingLedger'
//
import {
GetClientListByCode
} from '/@/api/common'
import {
GetOrderContactListByClientId
} from '/@/views/operation/seaexport/api/BookingLedger'
import { BasicTable, useTable } from '/@/components/Table'
import { BatchDelBusinessOrderContact } from '/@/views/operation/seaexport/api/BookingLedger'
import { useMessage } from '/@/hooks/web/useMessage'
import { useModal } from '/@/components/Modal'
import { formatParams } from '/@/hooks/web/common'
import PersonModal from './PersonModal.vue'
const [registerModal, { openModal }] = useModal()
// import { useModal } from '/@/components/Modal'
import { getDictOption } from '/@/utils/dictUtil'
// const [registerModal, { openModal }] = useModal()
const { createMessage } = useMessage()
const emit = defineEmits(['getBaseInfo'])
// loading
@ -63,39 +57,193 @@
id: { type: String },
//
data: {
type: Array,
default: () => {
return []
}
type: Object,
default: {}
}
})
watch(
() => props.data,
(v) => {
reload()
}
)
const flag = ref(true)
//
const [registerTable, { reload, getForm, getSelectRows, insertTableDataRecord }] = useTable({
api: async (p) => {
if (flag.value) {
flag.value = false
return new Promise((resolve) => {
resolve({ data: props.data })
//
const customTypeDict = ref([])
const personList = ref([])
getDictOption('infoclient-ArrclientTag').then((data) => {
customTypeDict.value = data
console.log(customTypeDict.value)
})
//
const [registerTable, { reload, getDataSource, getSelectRows, insertTableDataRecord, setTableData, deleteSelectRowByKey }] = useTable({
columns: [
{
dataIndex: 'customerType',
title: '客户类别',
width: 120,
editRow: true,
editComponent: 'Select',
editComponentProps: ({ record }) => {
return {
options: customTypeDict.value,
showSearch: true,
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
onChange: (v, obj) => {
if (obj) {
record.customerTypeName = obj.label
} else {
const res: API.DataResult = await GetBusinessOrderContactList(p)
return new Promise((resolve) => {
resolve({ data: [...res.data] })
//
record.customerTypeName = ''
}
record.customerContactId = ''
record.name = ''
record.email = ''
record.tel = ''
// formActionType ? formActionType.linkageForm({ key: 'customerType', value: v }) : null
},
}
}
},
{
dataIndex: 'customerTypeName',
title: '',
ifShow: false
},
{
dataIndex: 'customerName',
title: '客户名称',
width: 140,
editRow: true,
editComponent: 'ApiSelect',
editComponentProps: ({ record }) => {
return {
api: GetClientListByCode,
params: { code: record.customerType },
labelField: 'pinYinCode',
valueField: 'shortName',
showName: 'shortName',
resultField: 'data',
immediate: false,
onChange: (e, obj) => {
if (e && obj) {
record.customerId = obj.id
record.name = null
record.customerContactId = null
record.email = ''
record.tel = ''
}
if (!e && !obj) {
record.customerId = ''
}
setTimeout(() => {
if (e && record.customerId) {
//
GetOrderContactListByClientId({ id: record.customerId }).then((res) => {
personList.value = res.data.map((item) => {
return {
label: item.name,
value: item.name,
id: item.id,
email: item.email,
mobile: item.mobile,
tel: item.tel
}
})
})
}
}, 50)
if (e == null) {
personList.value = []
}
}
}
}
},
{
dataIndex: 'customerId',
title: '客户名称',
ifShow: false
},
{
dataIndex: 'businessId',
title: '',
ifShow: false
},
{
dataIndex: 'businessType',
title: '',
ifShow: false
},
{
dataIndex: 'customerId',
title: '客户名称',
ifShow: false
},
{
dataIndex: 'name',
title: '联系人',
width: 90,
editRow: true,
editComponent: 'Select',
editComponentProps: ({ record }) => {
return {
options: personList.value,
mode: 'SECRET_COMBOBOX_MODE_DO_NOT_USE',
allowClear: true,
showSearch: true,
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
onChange: (v, obj) => {
if (v && obj) {
record.customerContactId = obj.id
record.email = obj.email
record.tel = obj.tel
record.mobile = obj.mobile
}
if (!v && (!obj || obj == {})) {
record.customerContactId = null
record.email = null
record.mobile = null
record.tel = null
}
}
}
}
},
{
dataIndex: 'customerContactId',
title: '',
ifShow: false
},
beforeFetch: (p) => {
p['businessId'] = props.id
return formatParams(p)
{
dataIndex: 'email',
title: '邮箱',
width: 150,
editRow: true,
},
columns: personColumns,
// {
// dataIndex: 'tel',
// title: '',
// sorter: true,
// width: 120,
// editRow: true,
// },
{
dataIndex: 'mobile',
title: '手机',
width: 120,
editRow: true,
},
{
dataIndex: 'job',
title: '职位',
editRow: true,
width: 80,
},
// {
// dataIndex: 'note',
// title: '',
// sorter: true,
// width: 220,
// },
],
isTreeTable: false,
pagination: false,
striped: true,
@ -107,14 +255,29 @@
type: 'checkbox'
},
immediate: false,
canResize: false,
actionColumn: {
width: 60,
title: '操作',
dataIndex: 'action',
fixed: 'right',
}
canResize: false
})
// if (changeType == 'controller') {
// setFieldsValue({
// customerName: v.customerName || null,
// customerId: v.customerId || null
// })
// } else if (changeType == 'booking') {
// setFieldsValue({
// customerId: v.forwarderId,
// customerName: v.forwarder
// })
// } else if (changeType == 'shippercn') {
// setFieldsValue({
// customerName: v.shipperCn,
// customerId: v.shipperCnId
// })
// } else {
// setFieldsValue({
// customerName: null,
// customerId: null
// })
// }
function handleSuccess() {
reload()
}
@ -123,18 +286,11 @@
}
//
const create = () => {
openModal(true, {
isUpdate: false,
id: props.id
})
insertTableDataRecord({})
}
//
function handleEdit(record) {
openModal(true, {
record,
isUpdate: true,
id: props.id
})
function editRow(record) {
record.onEdit?.(true)
}
//
const del = () => {
@ -145,23 +301,81 @@
return false
}
const removeArr = select.map((item) => {
return item.id
return item.key
})
loading.value = true
BatchDelBusinessOrderContact({ ids: removeArr }).then(res => {
loading.value = false
reload()
createMessage.success('删除成功!')
}).catch(() => {
loading.value = false
removeArr.forEach(itme => {
deleteSelectRowByKey(itme)
})
// loading.value = true
// BatchDelBusinessOrderContact({ ids: removeArr }).then(res => {
// loading.value = false
// reload()
// createMessage.success('')
// }).catch(() => {
// loading.value = false
// })
}
onMounted(() => {
reload()
//
emitter.on('customerBack', (v) => {
const list = getDataSource()
const newList = list.filter(item => {
//
return item.customerType !== "controller"
})
const newObj = {
customerType: 'controller',
customerTypeName: '委托单位',
businessType: 1,
businessId: props.data?.id,
customerName: v?.showName,
customerId: v?.id,
customerContactId: v?.clientContact?.id,
name: v?.clientContact?.name,
email: v?.clientContact?.email,
tel: v?.clientContact?.tel,
job: v?.clientContact?.jobs[0],
}
newList.push(newObj)
setTableData(newList)
})
//
emitter.on('contactPerson', (v) => {
const list = getDataSource()
const newList = list.filter(item => {
//
return item.customerType !== v?.key
})
let label = null
unref(customTypeDict).forEach(item => {
if (v?.key == item?.value) {
label = item.label
}
})
const newObj = {
customerType: v?.key,
customerTypeName: label,
businessType: 1,
businessId: props.data?.id,
customerName: v?.showName,
customerId: v?.id,
customerContactId: v?.clientContact?.id,
name: v?.clientContact?.name,
email: v?.clientContact?.email,
tel: v?.clientContact?.tel,
job: v?.clientContact?.jobs[0]
}
newList.push(newObj)
setTableData(newList)
})
})
onUnmounted(() => {
emitter.off('customerBack')
emitter.off('contactPerson')
})
defineExpose({
getDataSource
})
// onUnmounted(() => {
// emitter.off('customerBack')
// })
</script>
<style lang="less">

@ -365,6 +365,7 @@
width: 120,
data: 'kindPkgsName',
type: 'dropdown',
visibleRows: 10,
// (process)
source: async (query, process) => {
const res = (await GetPackageSelectList({ queryKey: query }))?.data

@ -175,6 +175,9 @@
const linkageForm = (item) => {
if (item.key === 'operatorName') {
emitter.emit('setEdiForm' , item.value)
} else if (item.key === 'contact') {
//
emitter.emit('contactPerson' , item.data)
}
}
defineExpose({

@ -1257,10 +1257,10 @@
"resolved" "https://registry.npmjs.org/@handsontable/pikaday/-/pikaday-1.0.0.tgz"
"version" "1.0.0"
"@handsontable/vue3@^14.5.0":
"integrity" "sha512-0CZMD4bV2lD4Qc/NIZfedboZNXCa4vJdFdZqvge6Lc2JSrJm6QldCDZvwBWXpD5IBEIRY1S1LRlmoNJThQbuEA=="
"resolved" "https://registry.npmjs.org/@handsontable/vue3/-/vue3-14.5.0.tgz"
"version" "14.5.0"
"@handsontable/vue3@^14.6.1":
"integrity" "sha512-Mxt7eM4Q3aGK2qidf3oBLVrdBWtdYgO1+3p+bdt2Pf9TFN8HiS/nv7m8eHYpBBQ9xfaYsCKv0wRI6nCN0vFEHw=="
"resolved" "https://registry.npmjs.org/@handsontable/vue3/-/vue3-14.6.1.tgz"
"version" "14.6.1"
"@humanwhocodes/config-array@^0.11.14":
"integrity" "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg=="
@ -5773,10 +5773,10 @@
optionalDependencies:
"uglify-js" "^3.1.4"
"handsontable@^14.5.0", "handsontable@>=14.0.0":
"integrity" "sha512-fxCjDZS4z2LFwrmHXqtEKIcfrPxoD8+5AmX7r3pEYp2rjIhmtYKA45DFQ/3PP8PYvSFW8BGR58ZaKecMpGfJXg=="
"resolved" "https://registry.npmjs.org/handsontable/-/handsontable-14.5.0.tgz"
"version" "14.5.0"
"handsontable@^14.6.1", "handsontable@>=14.0.0":
"integrity" "sha512-uPvGTkV9dgndwRhSjlJpBzSLW7o7LX18GE70HbaBlcaNKUCEEXhzJ7WGlaw6X8rQZqShIB1HAC+h/t98odqVQQ=="
"resolved" "https://registry.npmjs.org/handsontable/-/handsontable-14.6.1.tgz"
"version" "14.6.1"
dependencies:
"@handsontable/pikaday" "^1.0.0"
"@types/pikaday" "1.7.4"

Loading…
Cancel
Save