From 1e9337741a000e6b2311caf48d42a9c3027716e6 Mon Sep 17 00:00:00 2001 From: qb <1191961160@qq.com> Date: Thu, 14 Nov 2024 14:58:36 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=BF=90=E5=8D=95=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E9=A1=B5=E6=96=B0=E5=A2=9E=E8=AE=A2=E5=8D=95=E5=8C=85=E4=BB=B6?= =?UTF-8?q?=E6=98=8E=E7=BB=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/util.js | 2 +- .../distribution/inventory/BookingNote.vue | 132 +++++++++++++++++- 2 files changed, 126 insertions(+), 8 deletions(-) diff --git a/src/utils/util.js b/src/utils/util.js index 337b3784..17c35515 100644 --- a/src/utils/util.js +++ b/src/utils/util.js @@ -823,7 +823,7 @@ export const handleInputQuery = (value, col, query, isRegExp = false, isStart = return; } - const _value = isRegExp ? new RegExp(isStart ? '^' : '' + value) : value; + const _value = isRegExp ? new RegExp((isStart ? '^' : '') + value) : value; query[col.prop] = _value; }; diff --git a/src/views/distribution/inventory/BookingNote.vue b/src/views/distribution/inventory/BookingNote.vue index f66b4607..1a74d540 100644 --- a/src/views/distribution/inventory/BookingNote.vue +++ b/src/views/distribution/inventory/BookingNote.vue @@ -1077,6 +1077,60 @@ > + + + + + + + @@ -1147,6 +1201,8 @@ import { handleSelectQuery, deepClone, ChecksWhetherTheWarehouseIsSelected, + handleFilterData, + setNodeHeight, } from '@/utils/util'; import { columnList } from '@/option/distribution/VehicleStowage'; import { @@ -1160,16 +1216,13 @@ import { postFindWaybillDetail, postCheckWaybill, postCancleCheckWaybill, + postFindAdvanceDetailListByWaybillId, } from '@/api/distribution/CreateOrder.js'; import { postPrintBatch } from '@/api/waybill/WaybillOrderList.js'; import { getLazyTreeAll } from '@/api/base/region'; -import { - postWarehouseFindWaybillInfo, - postFindWaybillLog, - postFindWaybillReturnList, - postFindWaybillCarsLoadInfo, - postFindWaybillTransferInfo, -} from '@/api/distribution/BookingNote.js'; +import { postFindWaybillLog, postFindWaybillReturnList } from '@/api/distribution/BookingNote.js'; +import { packageColumnList } from '@/option/waybill/TemporaryStorageList'; + import { useStore } from 'vuex'; import { ElMessageBox, ElMessage } from 'element-plus'; @@ -1186,6 +1239,8 @@ const $router = useRouter(); const $route = useRoute(); const $store = useStore(); +const tableOrderPackgeNodeRef = ref(); + const details = reactive({ /** 表格表头 */ WaybillTrackingColumnList: deepClone(WaybillTrackingColumnList), @@ -1263,6 +1318,8 @@ const details = reactive({ /** 配载信息loading */ stowageLoading: false, pageLoading: false, + /** 订单包件明细 */ + orderPackageLoading: false, }, /** 列表复选框选中的数据 */ selectionList: [], @@ -1291,6 +1348,20 @@ const details = reactive({ /** 打印html */ html: '', regionOptione: [], + /** 订单包件信息 */ + orderPackageOption: { + /** 表头 */ + columnList: deepClone(packageColumnList), + /** 原始数据 */ + data: [], + /** 渲染数据 */ + renderData: [], + /** 筛选条件 */ + query: { + inputQuery: {}, + selectQuery: {}, + }, + }, }); const info = ref({}); @@ -1556,6 +1627,45 @@ const handleFindInfo = async type => { } }; +/** 订单包件明细 */ +const initOrderPackage = async () => { + try { + details.loadingObj.orderPackageLoading = true; + + const res = await postFindAdvanceDetailListByWaybillId({ waybillId: details.pageInfo.id }); + + const { data } = res.data; + + details.orderPackageOption.data = getObjType(data) === 'array' ? data : []; + + for (let i = 0; i < details.orderPackageOption.data.length; i++) { + const element = details.orderPackageOption.data[i]; + + element.MaintenanceOrNot = element.incomeCategoryName && element.costCategoryId ? '是' : '否'; + + // 收入结算 + element.incomeCategoryName = element.incomeCategoryName || '其它'; + element.incomeCategory = element.incomeCategoryName || '其它'; + element.incomeCategoryId = element.incomeCategoryId || ''; + + // 成本结算 + element.costCategoryName = element.costCategoryName || '其它'; + element.costCategory = element.costCategoryName || '其它'; + element.costCategoryId = element.costCategoryId || ''; + } + + details.orderPackageOption.renderData = handleFilterData( + details.orderPackageOption.data, + [], + details.orderPackageOption.query + ); + } catch (error) { + console.log('error :>> ', error); + } finally { + details.loadingObj.orderPackageLoading = false; + } +}; + const handleTabClick = e => { console.log('e :>> ', e); const { name } = e.props; @@ -1585,6 +1695,13 @@ const handleTabClick = e => { details.data = []; break; + case 'tab8': + initOrderPackage(); + nextTick(() => { + setNodeHeight(tableOrderPackgeNodeRef.value.$el); + }); + break; + default: break; } @@ -1861,6 +1978,7 @@ const handlePrint = async () => { watch( () => $route.query, () => { + details.activeTab = 'tab1'; onLoad(); }, { immediate: true } From dc11aa9b86699ea9f3ae34e8270d07615736a804 Mon Sep 17 00:00:00 2001 From: qb <1191961160@qq.com> Date: Thu, 14 Nov 2024 15:02:19 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=94=B6=E5=85=A5?= =?UTF-8?q?=E5=93=81=E7=B1=BB=E6=98=AF=E5=90=A6=E7=BB=B4=E6=8A=A4=E7=9A=84?= =?UTF-8?q?=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../distribution/inventory/BookingNote.vue | 2 +- .../distribution/inventory/CreateOrder.vue | 22 ++++++++----------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/views/distribution/inventory/BookingNote.vue b/src/views/distribution/inventory/BookingNote.vue index 1a74d540..4e3a5b52 100644 --- a/src/views/distribution/inventory/BookingNote.vue +++ b/src/views/distribution/inventory/BookingNote.vue @@ -1641,7 +1641,7 @@ const initOrderPackage = async () => { for (let i = 0; i < details.orderPackageOption.data.length; i++) { const element = details.orderPackageOption.data[i]; - element.MaintenanceOrNot = element.incomeCategoryName && element.costCategoryId ? '是' : '否'; + element.MaintenanceOrNot = element.incomeCategoryId ? '是' : '否'; // 收入结算 element.incomeCategoryName = element.incomeCategoryName || '其它'; diff --git a/src/views/distribution/inventory/CreateOrder.vue b/src/views/distribution/inventory/CreateOrder.vue index f3c03a6b..30008fbd 100644 --- a/src/views/distribution/inventory/CreateOrder.vue +++ b/src/views/distribution/inventory/CreateOrder.vue @@ -1188,10 +1188,9 @@ slotProps.scope.row.costCategory = _item.goodsName || '其它'; // 维护状态 - slotProps.scope.row.MaintenanceOrNot = - slotProps.scope.row.incomeCategoryId && slotProps.scope.row.costCategoryId - ? '是' - : '否'; + slotProps.scope.row.MaintenanceOrNot = slotProps.scope.row.incomeCategoryId + ? '是' + : '否'; } " :remote-method="handleFindGoodsByName" @@ -1228,10 +1227,9 @@ slotProps.scope.row.incomeCategory = _item.goodsName || '其它'; // 维护状态 - slotProps.scope.row.MaintenanceOrNot = - slotProps.scope.row.incomeCategoryId && slotProps.scope.row.costCategoryId - ? '是' - : '否'; + slotProps.scope.row.MaintenanceOrNot = slotProps.scope.row.incomeCategoryId + ? '是' + : '否'; } " :remote-method="handleFindGoodsByName" @@ -2219,8 +2217,7 @@ const onLoad = async (idsArr = []) => { for (let i = 0; i < details.package.data.length; i++) { const element = details.package.data[i]; - element.MaintenanceOrNot = - element.incomeCategoryName && element.costCategoryId ? '是' : '否'; + element.MaintenanceOrNot = element.incomeCategoryId ? '是' : '否'; // 收入结算 element.confirmIncomeCategoryName = element.incomeCategoryName || '其它'; @@ -2394,8 +2391,7 @@ const onEditLoad = async () => { for (let i = 0; i < details.package.data.length; i++) { const element = details.package.data[i]; - element.MaintenanceOrNot = - element.incomeCategoryName && element.costCategoryId ? '是' : '否'; + element.MaintenanceOrNot = element.incomeCategoryId ? '是' : '否'; // 收入结算 element.confirmIncomeCategoryName = element.incomeCategoryName || '其它'; @@ -4679,7 +4675,7 @@ const handleBatchEdit = () => { value.incomeCategoryName = details.package.incomeCategoryName || '其它'; value.incomeCategory = details.package.incomeCategoryName || '其它'; - value.MaintenanceOrNot = value.incomeCategoryId && value.costCategoryId ? '是' : '否'; + value.MaintenanceOrNot = value.incomeCategoryId ? '是' : '否'; } }) .catch(() => {