diff --git a/src/views/bookingcabin/CabinInventory/columns.tsx b/src/views/bookingcabin/CabinInventory/columns.tsx index 851de597..32c031d7 100644 --- a/src/views/bookingcabin/CabinInventory/columns.tsx +++ b/src/views/bookingcabin/CabinInventory/columns.tsx @@ -2,7 +2,7 @@ import { ref } from 'vue' import { BasicColumn, FormSchema } from '/@/components/Table' import { GetCarrierlist, GetClientPortSelectList } from '/@/views/operation/seaexport/api/BookingLedger' -import { GetCtnSelectList } from '/@/api/common' +import { GetCtnSelectList,GetCarrierSelectList } from '/@/api/common' import { getDictOption } from '/@/utils/dictUtil' import { useOptionsStore } from '/@/store/modules/options' @@ -77,14 +77,12 @@ export const searchFormSchema: FormSchema[] = [ colProps: { span: 4 }, componentProps: () => { return { - api: GetCarrierlist, - immediate: false, - labelField: 'shortName', - valueField: 'id', + api: GetCarrierSelectList, + labelField: 'pinYinCode', + showName: 'cnName', + valueField: 'cnName', resultField: 'data', - filterOption: (input: string, option: any) => { - return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 - }, + immediate: false, } }, }, diff --git a/src/views/bookingcabin/CabinManagement/columns.tsx b/src/views/bookingcabin/CabinManagement/columns.tsx index 6ea24922..4548f368 100644 --- a/src/views/bookingcabin/CabinManagement/columns.tsx +++ b/src/views/bookingcabin/CabinManagement/columns.tsx @@ -4,7 +4,7 @@ import { useOptionsStore } from '/@/store/modules/options' import { SlotFlags } from '@vue/shared' import { getOptions } from '/@/hooks/dict' import { BookingLabelList, GetSlotUseToConfig } from './api' -import { GetClientListByCode, GetControllerClientList } from '/@/api/common' +import { GetClientListByCode, GetControllerClientList,GetCarrierSelectList } from '/@/api/common' const optionsStore = useOptionsStore() import { GetCarrierlist, @@ -158,7 +158,7 @@ export const searchFormSchema: FormSchema[] = [ colProps: { span: 4 }, }, { - field: 'CARRIER', + field: 'carrier', label: '船公司', component: 'ApiSelect', required: false, @@ -166,11 +166,10 @@ export const searchFormSchema: FormSchema[] = [ colProps: { span: 4 }, componentProps: ({ formModel }) => { return { - api: GetClientListByCode, - params: { code: 'carrier' }, + api: GetCarrierSelectList, labelField: 'pinYinCode', - showName: 'shortName', - valueField: 'shortName', + showName: 'ediCode', + valueField: 'ediCode', resultField: 'data', immediate: false, } @@ -861,11 +860,10 @@ export const detialForm: FormSchema[] = [ colProps: { span: 4 }, componentProps: ({ formModel }) => { return { - api: GetClientListByCode, - params: { code: 'carrier' }, + api: GetCarrierSelectList, labelField: 'pinYinCode', - showName: 'shortName', - valueField: 'shortName', + showName: 'cnName', + valueField: 'cnName', resultField: 'data', immediate: false, onChange: (e, obj) => { diff --git a/src/views/bookingcabin/ContractnoList/columns.tsx b/src/views/bookingcabin/ContractnoList/columns.tsx index aba2c3d4..e910df67 100644 --- a/src/views/bookingcabin/ContractnoList/columns.tsx +++ b/src/views/bookingcabin/ContractnoList/columns.tsx @@ -9,7 +9,7 @@ import { GetClientListByCode } from '/@/api/common' // 字典 import { getDictOption } from '/@/utils/dictUtil' import { getOptions } from '/@/hooks/dict' -import { GetCtnSelectList } from '/@/api/common' +import { GetCtnSelectList,GetCarrierSelectList } from '/@/api/common' const FnblType = ref([]) const FncargoId = ref([]) getDictOption('bl_type').then((res) => { @@ -44,11 +44,10 @@ export const searchFormSchema: FormSchema[] = [ colProps: { span: 5 }, componentProps: () => { return { - api: GetClientListByCode, - params: { code: 'carrier' }, + api: GetCarrierSelectList, labelField: 'pinYinCode', - showName: 'shortName', - valueField: 'shortName', + showName: 'cnName', + valueField: 'cnName', resultField: 'data', immediate: false, } @@ -154,11 +153,10 @@ export const formSchema: FormSchema[] = [ colProps: { span: 4 }, componentProps: ({ formModel }) => { return { - api: GetClientListByCode, - params: { code: 'carrier' }, + api: GetCarrierSelectList, labelField: 'pinYinCode', - showName: 'shortName', - valueField: 'shortName', + showName: 'cnName', + valueField: 'cnName', resultField: 'data', immediate: false, onChange: (e, obj) => { diff --git a/src/views/bookingcabin/cabinBooking/columns.tsx b/src/views/bookingcabin/cabinBooking/columns.tsx index 2ee20eab..7be8a54c 100644 --- a/src/views/bookingcabin/cabinBooking/columns.tsx +++ b/src/views/bookingcabin/cabinBooking/columns.tsx @@ -6,7 +6,7 @@ import { } from '/@/views/operation/seaexport/api/BookingLedger' // 字典 import { getDictOption } from '/@/utils/dictUtil' -import { GetClientListByCode } from '/@/api/common' +import { GetClientListByCode,GetCarrierSelectList } from '/@/api/common' const FnblType = ref([]) const FncargoId = ref([]) getDictOption('bl_type').then(res => { @@ -230,11 +230,10 @@ export const searchFormSchema: FormSchema[] = [ colProps: { span: 4 }, componentProps: () => { return { - api: GetClientListByCode, - params: { code: 'carrier' }, + api: GetCarrierSelectList, labelField: 'pinYinCode', - showName: 'shortName', - valueField: 'shortName', + showName: 'cnName', + valueField: 'cnName', resultField: 'data', immediate: false, } diff --git a/src/views/operation/seaexport/detail/modules/preOrder.vue b/src/views/operation/seaexport/detail/modules/preOrder.vue index 86af06cf..568463d1 100644 --- a/src/views/operation/seaexport/detail/modules/preOrder.vue +++ b/src/views/operation/seaexport/detail/modules/preOrder.vue @@ -123,7 +123,7 @@ - +
合计: @@ -271,7 +271,7 @@ watch(() => ctnList.value, (val) => { onMounted(() => { }) function initTable() { - const hot = hotmain.value.hotInstance + const hot = hotpreOrder.value.hotInstance hot.addHook('beforeKeyDown', function (event) { if (event.key === 'ArrowDown') { if (hot.getSelected()[0][0] == ctnList.value.length - 1 && !hot.getActiveEditor()?._opened) { @@ -353,6 +353,7 @@ function FngetPageESeaeEdi() { if (!res.data) { res.data = [] } + // 有数据直接回显 if (res.data.length > 0) { res.data.map((item, index) => { item.checked = false @@ -369,7 +370,7 @@ function FngetPageESeaeEdi() { setFieldsValueMail(item) setFieldsValueYard(item) ctnList.value = item.ctnInfo ? item.ctnInfo : [] - hotmain.value.hotInstance.loadData(ctnList.value) + hotpreOrder.value.hotInstance.loadData(ctnList.value) editIndex.value = index } }) @@ -377,14 +378,15 @@ function FngetPageESeaeEdi() { console.log(orderList.value); } else { //处理接口没数据的情况 - props.details.id = '0' - props.details.isPart = false + const propsDetail = JSON.parse(JSON.stringify(props.details)) + propsDetail.id = '0' + propsDetail.isPart = false //处理基础信息 - setFieldsValueBase(props.details) - // 拆分主单的收发通 发货人国家默认是中国 通知人和收货人为卸货港的国家 - const arr = props.details.shipperContent ? props.details.shipperContent.split('\n') : [] - const arr1 = props.details.consigneeContent ? props.details.consigneeContent.split('\n') : [] - const arr2 = props.details.notifyPartyContent ? props.details.notifyPartyContent.split('\n') : [] + setFieldsValueBase(propsDetail) + //拆分主单的收发通 发货人国家默认是中国 通知人和收货人为卸货港的国家 + const arr = propsDetail.shipperContent ? propsDetail.shipperContent.split('\n') : [] + const arr1 = propsDetail.consigneeContent ? propsDetail.consigneeContent.split('\n') : [] + const arr2 = propsDetail.notifyPartyContent ? propsDetail.notifyPartyContent.split('\n') : [] setFieldsValueMail({ shipperName: arr[0], shipperAddress: arr[1], @@ -395,7 +397,7 @@ function FngetPageESeaeEdi() { shipperCountryName: '中国(CHINA)', shipperCountry: 'CN' }) - GetClientPortInfoByCode({ queryKey: props.details.dischargePortCode }).then(res => { + GetClientPortInfoByCode({ queryKey: propsDetail.dischargePortCode }).then(res => { const arr = localStorage.getItem('ds-country') ? JSON.parse(localStorage.getItem('ds-country')) : [] if (res.data) { arr.forEach(item => { @@ -410,25 +412,25 @@ function FngetPageESeaeEdi() { }) } }) - // 处理货物信息 - if (!props.details.cargoId) { - props.details.cargoId = 'S' + //处理货物信息 + if (!propsDetail.cargoId) { + propsDetail.cargoId = 'S' } - RefcargoInfo.value.preOrderInit(props.details) + RefcargoInfo.value.preOrderInit(propsDetail) // 处理场站 setFieldsValueYard({ - yardId: props.details.yardId, - yard: props.details.yard + yardId: propsDetail.yardId, + yard: propsDetail.yard }) // 处理箱信息 - ctnList.value = props.details.ctnInfo ? props.details.ctnInfo : [] + ctnList.value = propsDetail.ctnInfo ? propsDetail.ctnInfo : [] ctnList.value.forEach(item => { delete item.id }) - hotmain.value.hotInstance.loadData(ctnList.value) - console.log(props.details,111111); - const data = JSON.parse(JSON.stringify(props.details)) - data.mblno = props.details.mblno + hotpreOrder.value.hotInstance.loadData(ctnList.value) + console.log(propsDetail,111111); + const data = JSON.parse(JSON.stringify(propsDetail)) + data.mblno = propsDetail.mblno data.isPart = false data.checked = false orderList.value[0] = data @@ -536,7 +538,7 @@ function calcCtnInfo(mblData, hblList) { setFieldsValueMail(mblData) setFieldsValueYard(mblData) ctnList.value = mblData.ctnInfo ? mblData.ctnInfo : [] - hotmain.value.hotInstance.loadData(ctnList.value) + hotpreOrder.value.hotInstance.loadData(ctnList.value) mblData.isPart = true orderList.value.push({ checked: true, isPart: true, ...mblData }) editIndex.value = orderList.value.length - 1 @@ -624,7 +626,7 @@ function delboxLine() { ctnList.value.splice(i, 1) } } - hotmain.value.hotInstance.loadData(ctnList.value) + hotpreOrder.value.hotInstance.loadData(ctnList.value) } function copyboxLine() { const arr = [] as any @@ -639,7 +641,7 @@ function copyboxLine() { } if (arr.length == 1) { ctnList.value.push(JSON.parse(JSON.stringify(arr[0]))) - hotmain.value.hotInstance.loadData(ctnList.value) + hotpreOrder.value.hotInstance.loadData(ctnList.value) } console.log(arr); } @@ -716,7 +718,7 @@ function editOrder(index) { notifyPartyId: '', }) ctnList.value = data.ctnInfo ? data.ctnInfo : [] - hotmain.value.hotInstance.loadData(ctnList.value) + hotpreOrder.value.hotInstance.loadData(ctnList.value) } @@ -724,7 +726,7 @@ function editOrder(index) { const list = ref([]) const ctnDict = ref([]) const kindPkgsDict = ref([]) -const hotmain = ref(null) as any +const hotpreOrder = ref(null) as any const mainPkgs = ref([]) as any const totalPkgs = ref(0) const totalKgs = ref(0) @@ -817,7 +819,7 @@ const settings = { // 如果通过复制或者填写校验出现错误,清空输入框 afterValidate: function (isValid, value, row, prop, source) { if (!isValid) { - hotmain.value.hotInstance.setDataAtRowProp(row, prop, '') + hotpreOrder.value.hotInstance.setDataAtRowProp(row, prop, '') } }, columns: columns, diff --git a/src/views/taskmanage/columns.tsx b/src/views/taskmanage/columns.tsx index 1d2c9fe1..aa10e24f 100644 --- a/src/views/taskmanage/columns.tsx +++ b/src/views/taskmanage/columns.tsx @@ -2,7 +2,7 @@ import { ref, onMounted } from 'vue' import { BasicColumn, FormSchema } from '/@/components/Table' import { GetTaskPlatEnumDict } from './api' -import { GetClientListByCode } from '/@/api/common' +import { GetClientListByCode,GetCarrierSelectList } from '/@/api/common' export const searchFormSchema: FormSchema[] = [ { @@ -290,11 +290,10 @@ export const fileForm: FormSchema[] = [ colProps: { span: 24 }, componentProps: ({ formModel }) => { return { - api: GetClientListByCode, - params: { code: 'carrier' }, + api: GetCarrierSelectList, labelField: 'pinYinCode', - showName: 'shortName', - valueField: 'shortName', + showName: 'ediCode', + valueField: 'ediCode', resultField: 'data', immediate: false, onChange: (e, obj) => { @@ -311,6 +310,7 @@ export const fileForm: FormSchema[] = [ }, }, + ]