diff --git a/src/components/ActionBar/index.vue b/src/components/ActionBar/index.vue index a4702530..adc3c56a 100644 --- a/src/components/ActionBar/index.vue +++ b/src/components/ActionBar/index.vue @@ -261,6 +261,13 @@ type: String, default: null, }, + // 没有数据源的数据(需要传入打印的数据) + printData: { + type: Array, + default: () => { + return [] + } + }, // 新建 create: { type: Function, @@ -312,7 +319,7 @@ const saveFlag = ref(false) const copyFlag = ref(false) const openPrint = () => { - dsPrint.value.init() + dsPrint.value.init(props.printData) } // 复制 const copyHandle = async () => { diff --git a/src/components/CostEntry/actionBar.vue b/src/components/CostEntry/actionBar.vue index d10f3c5f..c8bd0b27 100644 --- a/src/components/CostEntry/actionBar.vue +++ b/src/components/CostEntry/actionBar.vue @@ -178,6 +178,7 @@ import HColSet from '/@/components/HColSet/index.vue' import { ApplyDeletion, GetPrintInfo, ApplyBusinessAudit, Withdraw, WithdrawBusiness } from './api' import { useModal } from '/@/components/Modal' + import { clearCopyRow } from './components/hooks' // 打印组件 import DsPrint from '/@/components/Print/index.vue' const [registerModal, { openModal }] = useModal() @@ -243,16 +244,7 @@ if (needCopy.length == 0) return createMessage.warning('请勾选要复制的费用!') needCopy.forEach(item => { item.selected = false - const deepCopyRow = JSON.parse(JSON.stringify(item)) - deepCopyRow.id = '' - deepCopyRow.feeStatus = 1 - deepCopyRow.feeStatusText = '录入状态' - deepCopyRow.settlementAmount = null - deepCopyRow.orderInvoiceAmount = null - deepCopyRow.invoiceAmountRest = null - deepCopyRow.invoiceAmount = null - deepCopyRow.auditOperator = null - deepCopyRow.auditDate = null + const deepCopyRow = clearCopyRow(JSON.parse(JSON.stringify(item))) props.data.push(deepCopyRow) }) } diff --git a/src/components/CostEntry/components/hooks.js b/src/components/CostEntry/components/hooks.js new file mode 100644 index 00000000..739e8ec2 --- /dev/null +++ b/src/components/CostEntry/components/hooks.js @@ -0,0 +1,26 @@ +/* + * @Desc: + * @Author: lijj + * @Date: 2024-11-05 14:29:20 + */ +// 复制数据,清空指定字段 +export function clearCopyRow(obj) { + obj.id = null + obj.feeStatus = 1 + obj.feeStatusText = '录入状态' + obj.settlementAmount = null + obj.orderInvoiceAmount = null + obj.invoiceAmountRest = null + obj.invoiceAmount = null + obj.auditOperator = null + obj.auditDate = null + obj.createByName = null + obj.createTime = null + obj.createBy = null + obj.debitNo = null + obj.updateTime = null + obj.updateByName = null + obj.updateBy = null + return obj +} + \ No newline at end of file diff --git a/src/components/CostEntry/feeTable.vue b/src/components/CostEntry/feeTable.vue index e646398b..8fc3395d 100644 --- a/src/components/CostEntry/feeTable.vue +++ b/src/components/CostEntry/feeTable.vue @@ -64,6 +64,8 @@ // 结算对象下拉数据 import { GetSupplierAndClientListByCode } from '/@/api/common' import { useMessage } from '/@/hooks/web/useMessage' + // 通过复制清除指定字段数据 + import { clearCopyRow } from './components/hooks' // 引入字典接口 import { getDictOption } from '/@/utils/dictUtil' // handsontable hooks @@ -72,6 +74,7 @@ import { GetFeeCurrencyExchangeList } from '/@/views/fee/exchangeRate/api' import { updateColumns } from '/@/hooks/web/common' import { useAppStore } from '/@/store/modules/app' +import { Item } from 'ant-design-vue/lib/menu' const appStore = useAppStore() const { createMessage } = useMessage() defineComponent({ @@ -261,9 +264,10 @@ visible: true, source: async (query, process) => { if (unitDict.value && unitDict.value.length) { - const dict = unitDict.value.map((item) => { + let dict = unitDict.value.map((item) => { return item.label }) + dict = Array.from(new Set(dict)) process(dict) } }, @@ -612,7 +616,9 @@ if (props?.details?.ctnInfo && props?.details?.ctnInfo?.length) { list.value[changes[0][0]]['unitText'] = props.details.ctnInfo[0].ctn list.value[changes[0][0]]['unit'] = props.details.ctnInfo[0].ctnCode - list.value[changes[0][0]]['quantity'] = props.details.ctnInfo[0].ctnNum + GetUnitSelectInfo({ code: list.value[changes[0][0]]['unitText'], businessId: props.id, businessType: props.type }).then(res => { + list.value[changes[0][0]]['quantity'] = res.data.quantity + }) } } else if (dict.defaultUnit == 'CNTR') { // 如果是箱,带出箱种类的数量 @@ -633,7 +639,12 @@ list.value[changes[0][0]]['quantity'] = res.data.quantity }) } else { - list.value[changes[0][0]]['quantity'] = 0 + if (list.value[changes[0][0]]['unit'] == 'Bill') { + // 需要默认带出数量是1的单位(票) + list.value[changes[0][0]]['quantity'] = 1 + } else { + list.value[changes[0][0]]['quantity'] = 0 + } } } // 根据客户类别带出相应的费用对象 @@ -914,9 +925,7 @@ if (v === 1) { let flag = false selectData.forEach((item) => { - item.id = '' - item.feeStatus = 1 - item.feeStatusText = '录入状态' + item = clearCopyRow(Item) if (props.tbType == 'receive') { item.feeType = 2 } else { @@ -965,9 +974,7 @@ } else { // 全部插入 selectData.forEach((item) => { - item.id = '' - item.feeStatus = 1 - item.feeStatusText = '录入状态' + item = clearCopyRow(Item) item.selected = false if (props.tbType == 'receive') { item.feeType = 2 diff --git a/src/components/Print/index.vue b/src/components/Print/index.vue index ad6dd4fe..7dc35bf6 100644 --- a/src/components/Print/index.vue +++ b/src/components/Print/index.vue @@ -130,7 +130,7 @@ const init = (v) => { printData.value = v visible.value = true - if (v) { + if (v && v.length) { // 储存选中的ids ids.value = v.map((item) => { return item.id @@ -149,17 +149,17 @@ ConditionalList: [ { Key: 1, - Value: { FieldName: 'carrierId', FieldValue: props.cid, ConditionalType: 0 }, + Value: { FieldName: 'carrierId', FieldValue: props.cid, ConditionalType: 0 } }, { Key: 1, - Value: { FieldName: 'carrierId', FieldValue: 0, ConditionalType: 11 }, - }, - ], - }, - }, - ], - }, + Value: { FieldName: 'carrierId', FieldValue: 0, ConditionalType: 11 } + } + ] + } + } + ] + } ] // if (temCodes.length) { // const ConditionalList = { @@ -264,6 +264,7 @@ }) }) } else { + console.log(item) if (item.isUseDataSource) { const userStore = useUserStore() const postData = { diff --git a/src/views/operation/paidApply/detail/index.vue b/src/views/operation/paidApply/detail/index.vue index 5568d961..76d5b997 100644 --- a/src/views/operation/paidApply/detail/index.vue +++ b/src/views/operation/paidApply/detail/index.vue @@ -10,12 +10,12 @@ diff --git a/src/views/operation/seaexport/detail/components/ladingInfo.tsx b/src/views/operation/seaexport/detail/components/ladingInfo.tsx index 147ded97..b15822ee 100644 --- a/src/views/operation/seaexport/detail/components/ladingInfo.tsx +++ b/src/views/operation/seaexport/detail/components/ladingInfo.tsx @@ -664,15 +664,13 @@ export const formSchema3: FormSchema[] = [ label: '总件数', field: 'pkgs', component: 'Input', - colProps: { span: 12 }, - dynamicDisabled: true, + colProps: { span: 12 } }, { label: '包装', field: 'kindPkgsName', component: 'Input', - colProps: { span: 12 }, - dynamicDisabled: true, + colProps: { span: 12 } }, { label: '', diff --git a/src/views/operation/seaexport/detail/index.vue b/src/views/operation/seaexport/detail/index.vue index 93e1b706..ffc1f296 100644 --- a/src/views/operation/seaexport/detail/index.vue +++ b/src/views/operation/seaexport/detail/index.vue @@ -455,7 +455,6 @@ res.data.stlDate = res.data.stlDate.split(' ')[0] } bookingDetails.value = res.data - console.log(bookingDetails.value) // 如果是审批页面切状态是已审单弹出选择现舱非现舱 inPageLoading.value = false }) @@ -567,6 +566,18 @@ } } } + // 获取右侧勾选中的服务项目的code,拼接成字符串传给后台 + let serviceItem = '' + const seriveItems = RefrightContent.value.bookingServiceItem + if (seriveItems && seriveItems.length) { + const sitems = seriveItems.filter(item => { + return item.isYield == true + }) + const codes = sitems.map(item => { + return item.projectCode + }) + serviceItem = String(codes) + } // 提交的post数据 const postData = { ...baseinfoForm, @@ -577,7 +588,10 @@ ...customerForm, ...noteForm, ediInfo: ediFrom, - ctnInfo + ctnInfo, + soRemark: ediFrom.soRemark, + closeDocRemark: ediFrom.closeDocRemark, + serviceItem } // 处理截港截单时间 if (postData.closingDate && postData.closingDate.length == 13) { @@ -998,6 +1012,7 @@ Withdraw(postData).then(res => { if (res.succeeded) { createMessage.success('撤销成功!') + RefrightContent.value.getStatusServiceList(1, null) } init() }) @@ -1026,10 +1041,10 @@ businessType: '1', taskTypeName: type || route.query.status } - completeTask(type, true) + await completeTask(type, true) if (type) postData['hasCabin'] = true loading.value = true - await CreateTask(postData).then(res => { + CreateTask(postData).then(res => { loading.value = false if (!b) createMessage.success(res.message) }).catch(() => { @@ -1181,12 +1196,16 @@ if (res.data) { // 是最后一个审批人,若果此票是现舱,弹窗选择现舱弹窗 const shippingSpaceType = RefbasicInfo.value.formData.shippingSpaceType - if (shippingSpaceType == 'xc') { + if (shippingSpaceType == 'xc' && route.query.status == 'WAIT_ORDER_AUDIT') { // 选择现舱 sspace.value.init() } else { - // 非现舱直接审核通过 - seaExportTaskAudit(remark, true) + // 非现舱直接审核通过 (如果是审单,需要自动订舱) + if (route.query.status == 'WAIT_ORDER_AUDIT') { + seaExportTaskAudit(remark, true) + } else { + seaExportTaskAudit(remark, false) + } } } else { // 不是最后一个审批人,直接审核 @@ -1231,36 +1250,41 @@ return createMessage.warning('请填写订舱编号或主提单号!') } } - if (status == 'ORDER_AUDIT_REJECTED') { - SubmitAudit({ - businessId: id.value, - businessType: 1, - taskTypeName: 'WAIT_ORDER_AUDIT' - }).then(res => { - tabStore.closeTabByKey(fullPath, router) - }) - } else if (status == 'WAIT_SI_REJECT') { - SubmitAudit({ - businessId: id.value, - businessType: 1, - taskTypeName: 'WAIT_SI' - }).then(res => { - tabStore.closeTabByKey(fullPath, router) - }) - } else { - const postData = { - businessId: id.value, - businessType: 1, - taskTypeName: type || status, - taskStatus: 2, - autoCreateNext: true + return new Promise((resolve) => { + if (status == 'ORDER_AUDIT_REJECTED') { + SubmitAudit({ + businessId: id.value, + businessType: 1, + taskTypeName: 'WAIT_ORDER_AUDIT' + }).then(res => { + resolve(res) + tabStore.closeTabByKey(fullPath, router) + }) + } else if (status == 'WAIT_SI_REJECT') { + SubmitAudit({ + businessId: id.value, + businessType: 1, + taskTypeName: 'WAIT_SI' + }).then(res => { + resolve(res) + tabStore.closeTabByKey(fullPath, router) + }) + } else { + const postData = { + businessId: id.value, + businessType: 1, + taskTypeName: type || status, + taskStatus: 2, + autoCreateNext: true + } + if (type) postData.autoCreateNext = false + SetTaskStatus(postData).then(res => { + if (!b) createMessage.success('操作成功!') + resolve(res) + tabStore.closeTabByKey(fullPath, router) + }) } - if (type) postData.autoCreateNext = false - SetTaskStatus(postData).then(res => { - if (!b) createMessage.success('操作成功!') - tabStore.closeTabByKey(fullPath, router) - }) - } + }) } watch( () => copyFlag, diff --git a/src/views/operation/seaexport/detail/modules/cargoInfo.vue b/src/views/operation/seaexport/detail/modules/cargoInfo.vue index 04f4e177..377b2151 100644 --- a/src/views/operation/seaexport/detail/modules/cargoInfo.vue +++ b/src/views/operation/seaexport/detail/modules/cargoInfo.vue @@ -227,7 +227,7 @@ const data = getFieldsValue2() console.log(data) let gData = [{}] - if (data.ctnGoodsInfo.length != 0) gData = data.ctnGoodsInfo + if (data?.ctnGoodsInfo?.length != 0) gData = data.ctnGoodsInfo ctnGoodsInfo.value = gData } const handleOk = () => { diff --git a/src/views/operation/seaexport/detail/modules/ediMore.vue b/src/views/operation/seaexport/detail/modules/ediMore.vue index 02fea7a4..c23f90f1 100644 --- a/src/views/operation/seaexport/detail/modules/ediMore.vue +++ b/src/views/operation/seaexport/detail/modules/ediMore.vue @@ -46,7 +46,11 @@ () => props.details, (nval) => { if (nval.ediInfo) { - setFieldsValue(nval.ediInfo) + setFieldsValue({ + ...nval.ediInfo, + soRemark: props.details.soRemark, + closeDocRemark: props.details.closeDocRemark + }) } } ) @@ -73,7 +77,9 @@ }) }) setFieldsValue({ - ...props.details.ediInfo + ...props.details.ediInfo, + soRemark: props.details.soRemark, + closeDocRemark: props.details.closeDocRemark }) }) defineExpose({ diff --git a/src/views/operation/seaexport/detail/modules/operationArea.vue b/src/views/operation/seaexport/detail/modules/operationArea.vue index f5956382..55e95e52 100644 --- a/src/views/operation/seaexport/detail/modules/operationArea.vue +++ b/src/views/operation/seaexport/detail/modules/operationArea.vue @@ -1490,11 +1490,9 @@ ]) // 退舱按钮 const returnCabin = () => { - // 未订舱或者已开船,不可退舱 - const etd = props.details.etd - const now = new Date() - if (!props?.details?.isBooking || new Date(etd) < now) { - return createMessage.warning('未订舱或已开船不可退舱!') + // 未订舱不可退舱 + if (!props?.details?.isBooking) { + return createMessage.warning('该订单暂未订舱!') } returnCabinFlag.value = true } diff --git a/src/views/operation/seaexport/detail/modules/rightContent.vue b/src/views/operation/seaexport/detail/modules/rightContent.vue index 5d0aa2f3..0f4a5e3a 100644 --- a/src/views/operation/seaexport/detail/modules/rightContent.vue +++ b/src/views/operation/seaexport/detail/modules/rightContent.vue @@ -1116,7 +1116,9 @@ init, open, flag, - cancelGoodsStatus + cancelGoodsStatus, + getStatusServiceList, + bookingServiceItem })