diff --git a/src/views/wms/wmsShippingBill/edit.vue b/src/views/wms/wmsShippingBill/edit.vue index 5c39806..86dadf8 100644 --- a/src/views/wms/wmsShippingBill/edit.vue +++ b/src/views/wms/wmsShippingBill/edit.vue @@ -89,7 +89,7 @@ - + @@ -198,8 +198,8 @@ @@ -377,7 +377,16 @@ 重置 - + + @@ -640,6 +649,7 @@ const projectSelectRef = ref>(); // 合同选择 const selectedContractName = ref(''); const selectedSapOrderCode = ref(''); // SAP订单号(来自合同) +const contractTableRef = ref(); const contractDialog = reactive({ visible: false }); const contractLoading = ref(false); const contractList = ref([]); @@ -884,6 +894,24 @@ const resetContractQuery = () => { const handleContractRowClick = (row: ContractInfoVO) => { selectedContract.value = row; + // 同步选中状态到选择框 + if (contractTableRef.value) { + contractTableRef.value.clearSelection(); + contractTableRef.value.toggleRowSelection(row, true); + } +}; + +/** 合同选择框点击事件 - 实现单选 */ +const handleContractSelect = (selection: any[], row: any) => { + if (contractTableRef.value) { + contractTableRef.value.clearSelection(); + if (selection.length > 0) { + contractTableRef.value.toggleRowSelection(row, true); + selectedContract.value = row; + } else { + selectedContract.value = null; + } + } }; const submitContractSelect = () => { @@ -1090,6 +1118,23 @@ const handleWarehouseChange = (warehouseId: any) => { } }; +/** 发货类型变化 - 联动需到货确认标识 */ +const handleShippingTypeChange = (val: any) => { + if (val === '1') { + form.value.needArrivalConfirm = '1'; + } else if (val === '2' || val === '3') { + form.value.needArrivalConfirm = '0'; + } +}; + +/** 监听发货类型,确保逻辑一致性 */ +watch( + () => form.value.shippingType, + (val) => { + handleShippingTypeChange(val); + } +); + /** 物料来源切换 */ const handleMaterialSourceChange = () => { // 切换物料来源时,可以选择是否清空已选物料 diff --git a/src/views/wms/wmsShippingBill/index.vue b/src/views/wms/wmsShippingBill/index.vue index 6db4537..fd5519b 100644 --- a/src/views/wms/wmsShippingBill/index.vue +++ b/src/views/wms/wmsShippingBill/index.vue @@ -109,12 +109,12 @@ @@ -329,8 +329,8 @@ const router = useRouter(); const { proxy } = getCurrentInstance() as ComponentInternalInstance; // 字典定义 -const { shipping_mode, shipping_bill_status, shipping_type, need_arrival_confirm, is_all_receiving } = toRefs( - proxy?.useDict('shipping_mode', 'shipping_bill_status', 'shipping_type', 'need_arrival_confirm', 'is_all_receiving') +const { shipping_mode, shipping_type, need_arrival_confirm, is_all_receiving, out_stock_bill_status } = toRefs( + proxy?.useDict('shipping_mode', 'shipping_type', 'need_arrival_confirm', 'is_all_receiving', 'out_stock_bill_status') ); const wmsShippingBillList = ref([]);