diff --git a/src/api/distribution/directGoMarket.js b/src/api/distribution/directGoMarket.js new file mode 100644 index 00000000..d2ef5b98 --- /dev/null +++ b/src/api/distribution/directGoMarket.js @@ -0,0 +1,100 @@ +import request from '@/axios'; + +/** + * 查询当前节点添加的订单不包含直发商家列表 + */ +export const psotFindWaybillOrderListNoIsToMall = data => { + return request({ + url: '/api/logpm-trunkline/carsLoad/findWaybillOrderListNoIsToMall', + method: 'post', + data, + }); +}; + +/** + * 查询当前节点添加的订单包含直发商家列表 + */ +export const postFindWaybillOrderListToMall = data => { + return request({ + url: '/api/logpm-trunkline/carsLoad/findWaybillOrderListToMall', + method: 'post', + data, + }); +}; + +/** + * 修改运单订单的直发商家 + */ +export const getUpdateWaybillOrderIsCustemer = data => { + return request({ + url: '/api/logpm-trunkline/carsLoad/updateWaybillOrderIsCustemer', + method: 'post', + data, + }); +}; + +/** + * 查询签收单列表 + */ +export const postFindSignOrderList = data => { + return request({ + url: '/api/logpm-trunkline/carsLoad/findSignOrderList', + method: 'post', + data, + }); +}; + +/** + * 查询签收单详情列表 + */ +export const postFindSignOrderDetailList = data => { + return request({ + url: '/api/logpm-trunkline/carsLoad/findSignOrderDetailList', + method: 'post', + data, + }); +}; + +/** + * 批量签收 + */ +export const postBatchSign = data => { + return request({ + url: '/api/logpm-trunkline/carsLoad/batchSign', + method: 'post', + data, + }); +}; + +/** + * 更新签收单归属仓库 + */ +export const postUpdateBelongToWarehouseBySignOrderId = data => { + return request({ + url: '/api/logpm-trunkline/carsLoad/updateBelongToWarehouseBySignOrderId', + method: 'post', + data, + }); +}; + +/** + * 零担签收 + */ +export const postSignPackage = data => { + return request({ + url: '/api/logpm-trunkline/carsLoad/signPackage', + method: 'post', + data, + }); +}; + +/** + * 包件签收 + */ +export const postSignZero = data => { + return request({ + url: '/api/logpm-trunkline/carsLoad/signZero', + method: 'post', + data, + }); +}; diff --git a/src/api/distribution/truckLoadingDetails.js b/src/api/distribution/truckLoadingDetails.js index 19d69738..d78f473c 100644 --- a/src/api/distribution/truckLoadingDetails.js +++ b/src/api/distribution/truckLoadingDetails.js @@ -21,3 +21,36 @@ export const postBatchUnload = (data = {}) => { data, }); }; + +/** + * 三方中转包件卸车 + */ +export const postTransferUnloadPackage = (data = {}) => { + return request({ + url: '/api/logpm-trunkline/api/tripartiteTransfer/transferUnloadPackage', + method: 'post', + data, + }); +}; + +/** + * 三方中转零担卸车 + */ +export const postTransferUnloadZero = (data = {}) => { + return request({ + url: '/api/logpm-trunkline/api/tripartiteTransfer/transferUnloadZero', + method: 'post', + data, + }); +}; + +/** + * 三方中转批量卸车 + */ +export const postBatchTransferUnload = (data = {}) => { + return request({ + url: '/api/logpm-trunkline/api/tripartiteTransfer/batchTransferUnload', + method: 'post', + data, + }); +}; diff --git a/src/components/tablecmt/tablecmt.vue b/src/components/tablecmt/tablecmt.vue index f6bf7b76..f111c687 100644 --- a/src/components/tablecmt/tablecmt.vue +++ b/src/components/tablecmt/tablecmt.vue @@ -53,7 +53,6 @@ clearable :placeholder="`请选择${column.label}`" @change="selectchange($event, column)" - @clear="selectclear($event, column)" > diff --git a/src/option/distribution/TripartiteTransfer.js b/src/option/distribution/TripartiteTransfer.js index 2614b8ce..66075a18 100644 --- a/src/option/distribution/TripartiteTransfer.js +++ b/src/option/distribution/TripartiteTransfer.js @@ -545,7 +545,7 @@ export const detailsColumnList = [ values: '', width: '200', checkarr: [], - fixed: true, + fixed: 'right', sortable: true, }, ]; diff --git a/src/option/distribution/directGoMarketDetails.js b/src/option/distribution/directGoMarketDetails.js new file mode 100644 index 00000000..d924ab1b --- /dev/null +++ b/src/option/distribution/directGoMarketDetails.js @@ -0,0 +1,306 @@ +/** 签收列表 */ +export const columnList = [ + { + prop: '', + label: '复选框', + type: 0, + width: 55, + fixed: true, + }, + { + prop: '', + label: '序号', + type: 12, + values: '', + width: 55, + fixed: true, + }, + { + prop: 'carsNo', + label: '车次号', + type: 2, + values: '', + width: '150', + checkarr: [], + fixed: false, + sortable: true, + head: false, + }, + { + prop: 'loadSignCode', + label: '签收号', + type: 2, + values: '', + width: '150', + checkarr: [], + fixed: false, + sortable: true, + head: false, + }, + { + prop: 'belongToWarehouseName', + label: '归属仓库', + type: 2, + values: '', + width: '180', + checkarr: [], + fixed: false, + sortable: true, + }, + { + prop: 'mallName', + label: '商场名称', + type: 2, + values: '', + width: '180', + checkarr: [], + fixed: false, + sortable: true, + }, + { + prop: 'mallPerson', + label: '商场联系人', + type: 2, + values: '', + width: '130', + checkarr: [], + fixed: false, + sortable: true, + }, + { + prop: 'mallMobile', + label: '商场电话', + type: 2, + values: '', + width: '130', + checkarr: [], + fixed: false, + sortable: true, + }, + { + prop: 'mallAddress', + label: '商场地址', + type: 2, + values: '', + width: '130', + checkarr: [], + fixed: false, + sortable: true, + }, + { + prop: 'planNum', + label: '计划数', + type: 1, + values: '', + width: '130', + checkarr: [], + fixed: false, + sortable: true, + }, + { + prop: 'loadingNum', + label: '装车数', + type: 1, + values: '', + width: '130', + checkarr: [], + fixed: false, + sortable: true, + }, + { + prop: 'signNum', + label: '签收数', + type: 1, + values: '', + width: '130', + checkarr: [], + fixed: false, + sortable: true, + }, + { + prop: 'signStatusName', + label: '签收状态', + type: 3, + values: '', + width: '130', + checkarr: [], + fixed: false, + sortable: true, + }, + { + prop: 'createUserName', + label: '操作', + type: 6, + values: '', + width: '200', + checkarr: [], + fixed: 'right', + sortable: false, + }, +]; + +/** 装车详情列表 */ +export const detailsColumnList = [ + { + prop: '', + label: '复选框', + type: 0, + width: 55, + fixed: true, + }, + { + prop: '', + label: '序号', + type: 12, + values: '', + width: 55, + fixed: true, + }, + { + prop: 'carsNo', + label: '车次号', + type: 1, + values: '', + width: '150', + checkarr: [], + fixed: false, + sortable: true, + head: false, + }, + { + prop: 'orderCode', + label: '订单号', + type: 1, + values: '', + width: '150', + checkarr: [], + fixed: false, + sortable: true, + head: false, + }, + { + prop: 'waybillNo', + label: '运单号', + type: 1, + values: '', + width: '150', + checkarr: [], + fixed: false, + sortable: true, + head: false, + }, + { + prop: 'scanCode', + label: '包条码/产品名称', + type: 1, + values: '', + width: '200', + checkarr: [], + fixed: true, + sortable: true, + }, + { + prop: 'warehouseName', + label: '仓库', + type: 1, + values: '', + width: '150', + checkarr: [], + fixed: false, + sortable: true, + head: false, + }, + { + prop: 'mallName', + label: '商场名称', + type: 2, + values: '', + width: '150', + checkarr: [], + fixed: false, + sortable: true, + head: false, + }, + { + prop: 'mallPerson', + label: '商场联系人', + type: 2, + values: '', + width: '150', + checkarr: [], + fixed: false, + sortable: true, + head: false, + }, + { + prop: 'mallMobile', + label: '商场电话', + type: 2, + values: '', + width: '150', + checkarr: [], + fixed: false, + sortable: true, + head: false, + }, + { + prop: 'scanStatusName', + label: '装卸状态', + type: 3, + values: '', + width: '130', + checkarr: [], + fixed: false, + sortable: true, + }, + { + prop: 'typeName', + label: '类型', + type: 3, + values: '', + width: '130', + checkarr: [], + fixed: false, + sortable: true, + }, + { + prop: 'num', + label: '数量', + type: 1, + values: '', + width: '130', + checkarr: [], + fixed: false, + sortable: true, + }, + { + prop: 'unLoadNum', + label: '卸车数', + type: 1, + values: '', + width: '130', + checkarr: [], + fixed: false, + sortable: true, + }, + { + prop: 'remark', + label: '备注', + type: 1, + values: '', + width: '130', + checkarr: [], + fixed: false, + sortable: true, + }, + { + prop: '', + label: '操作', + type: 6, + values: '', + width: '200', + checkarr: [], + fixed: 'right', + sortable: true, + }, +]; diff --git a/src/router/views/index.js b/src/router/views/index.js index 61ee401f..69e66219 100644 --- a/src/router/views/index.js +++ b/src/router/views/index.js @@ -245,6 +245,26 @@ export default [ /* webpackChunkName: "views" */ '@/views/distribution/artery/VehicleStowageDetails.vue' ), }, + { + path: 'directGoMarket', + name: '配置直发商家', + meta: { + i18n: 'data', + }, + component: () => + import(/* webpackChunkName: "views" */ '@/views/distribution/artery/directGoMarket.vue'), + }, + { + path: 'directGoMarketDetails', + name: '签收详情', + meta: { + i18n: 'data', + }, + component: () => + import( + /* webpackChunkName: "views" */ '@/views/distribution/artery/directGoMarketDetails.vue' + ), + }, { path: 'handleLoadingDestination', name: '配置装车目的地', diff --git a/src/views/authority/role.vue b/src/views/authority/role.vue index 85c3b28d..651fd218 100644 --- a/src/views/authority/role.vue +++ b/src/views/authority/role.vue @@ -265,10 +265,34 @@ export default { }); }, submit() { - const menuList = this.$refs.treeMenu.getCheckedKeys(); - const appMenuList = this.$refs.treeAppMenu.getCheckedKeys(); - const dataScopeList = this.$refs.treeDataScope.getCheckedKeys(); - const apiScopeList = this.$refs.treeApiScope.getCheckedKeys(); + const menuList = [ + ...new Set([ + ...this.$refs.treeMenu.getCheckedKeys(), + ...this.$refs.treeMenu.getHalfCheckedKeys(), + ]), + ]; + + const appMenuList = [ + ...new Set([ + ...this.$refs.treeAppMenu.getCheckedKeys(), + ...this.$refs.treeAppMenu.getHalfCheckedKeys(), + ]), + ]; + + const dataScopeList = [ + ...new Set([ + ...this.$refs.treeDataScope.getCheckedKeys(), + ...this.$refs.treeDataScope.getHalfCheckedKeys(), + ]), + ]; + + const apiScopeList = [ + ...new Set([ + ...this.$refs.treeApiScope.getCheckedKeys(), + ...this.$refs.treeApiScope.getHalfCheckedKeys(), + ]), + ]; + grant(this.idsArray, menuList, dataScopeList, apiScopeList, appMenuList).then(() => { this.box = false; this.$message({ @@ -351,6 +375,20 @@ export default { } done(); }, + // 递归删除带有子项的Id + handleRemove(child, checkIdArr) { + for (const iterator of child) { + if ( + iterator.children && + Object.prototype.toString.call(iterator.children) === '[object Array]' + ) { + const _index = checkIdArr.indexOf(iterator.id); + if (_index !== -1) checkIdArr.splice(_index, 1); + + this.handleRemove(iterator.children, checkIdArr); + } + } + }, handleRole() { if (this.selectionList.length !== 1) { this.$message.warning('只能选择一条数据'); @@ -367,9 +405,17 @@ export default { this.apiScopeGrantList = res.data.data.apiScope; getRole(this.ids).then(res => { this.menuTreeObj = res.data.data.menu; + this.handleRemove(this.menuGrantList, this.menuTreeObj); + this.appMenuTreeObj = res.data.data.appMenu; + this.handleRemove(this.appMenuGrantList, this.appMenuTreeObj); + this.dataScopeTreeObj = res.data.data.dataScope; + this.handleRemove(this.dataScopeGrantList, this.dataScopeTreeObj); + this.apiScopeTreeObj = res.data.data.apiScope; + this.handleRemove(this.apiScopeGrantList, this.apiScopeTreeObj); + this.box = true; }); }); @@ -417,21 +463,21 @@ export default { }; - \ No newline at end of file + diff --git a/src/views/distribution/artery/VehicleStowage.vue b/src/views/distribution/artery/VehicleStowage.vue index ce7c8fe0..293be10b 100644 --- a/src/views/distribution/artery/VehicleStowage.vue +++ b/src/views/distribution/artery/VehicleStowage.vue @@ -161,27 +161,46 @@ @@ -355,11 +374,12 @@ import { postRemoveCarsLoadScan, } from '@/api/distribution/VehicleStowage'; import { useStore } from 'vuex'; -import { useRouter } from 'vue-router'; +import { useRouter, useRoute } from 'vue-router'; import { ElMessage, ElMessageBox } from 'element-plus'; // 获取路由实例 const $router = useRouter(); +const $route = useRoute(); const $store = useStore(); @@ -831,6 +851,30 @@ const handleNodeCost = ({ row }) => { }); }; +/** 配置直发商家弹窗显示 */ +const handleDirectGoMarketVesited = ({ row }) => { + $router.push({ + path: '/distribution/artery/directGoMarket', + query: { + loadId: row.id, + name: row.carsNo + '--' + '配置直发商家', + backPath: $route.fullPath, + }, + }); +}; + +/** 直发商家签收详情 */ +const handleDirectGoMarketDetails = ({ row }) => { + $router.push({ + path: '/distribution/artery/directGoMarketDetails', + query: { + loadId: row.id, + name: row.carsNo + '--' + '签收详情', + backPath: $route.fullPath, + }, + }); +}; + /** 前往配载详情 */ const handleGoWaybill = ({ row }) => { console.log('row :>> ', row); @@ -905,7 +949,7 @@ const handleStartCar = async () => { }; /** 开启弹窗 */ -const handleOpenConfiguration = (type: 'one' | 'batch', data) => { +const handleOpenConfiguration = (type: 'one' | 'batch', data = {} as any) => { if (type === 'batch' && details.packageSelectedData.length === 0) return ElMessage.warning('最少选择一条数据'); details.modifyData = type === 'one' ? [data.row] : details.packageSelectedData; @@ -1148,4 +1192,14 @@ const handleCancelCarsLoad = () => { .w100 { width: 100%; } + +.handleControl { + :deep(.el-button) { + font-size: 0.8rem; + } + + :deep(.el-button + .el-button) { + margin-left: 5px; + } +} diff --git a/src/views/distribution/artery/addTripartiteTransfer.vue b/src/views/distribution/artery/addTripartiteTransfer.vue index 5c2f7e2a..a8d7ce17 100644 --- a/src/views/distribution/artery/addTripartiteTransfer.vue +++ b/src/views/distribution/artery/addTripartiteTransfer.vue @@ -935,7 +935,7 @@ const handleSubmit = (formEl: FormInstance | undefined) => { try { const submitData = { ...form.value, - carsLoadLineList: [ + addCarsLoadLineList: [ { nodeType: '1', nodeName: details.pageInfo.startWarehouseInfo.warehouseName, @@ -945,15 +945,17 @@ const handleSubmit = (formEl: FormInstance | undefined) => { linkMobile: details.pageInfo.startWarehouseInfo.linkMobile, sort: '1', - lineCarsOrderList: JSON.parse(JSON.stringify(details.newData)).map(value => { + addList: JSON.parse(JSON.stringify(details.newData)).map(value => { value.nodeId = details.pageInfo.startWarehouseInfo.warehouseId; value.nodeName = details.pageInfo.startWarehouseInfo.warehouseName; value.finalNodeId = details.pageInfo.startWarehouseInfo.warehouseId; value.totalNum = 20; return value; }), + removeList: [], }, ], + removeCarsLoadLineList: [], }; submitData.customerType = submitData.customerType.join(','); diff --git a/src/views/distribution/artery/directGoMarket.vue b/src/views/distribution/artery/directGoMarket.vue new file mode 100644 index 00000000..800782b7 --- /dev/null +++ b/src/views/distribution/artery/directGoMarket.vue @@ -0,0 +1,672 @@ + + + + + diff --git a/src/views/distribution/artery/directGoMarketDetails.vue b/src/views/distribution/artery/directGoMarketDetails.vue new file mode 100644 index 00000000..635c3a60 --- /dev/null +++ b/src/views/distribution/artery/directGoMarketDetails.vue @@ -0,0 +1,1023 @@ + + + + + diff --git a/src/views/distribution/artery/truckLoadingDetails.vue b/src/views/distribution/artery/truckLoadingDetails.vue index bcafc11c..5152698f 100644 --- a/src/views/distribution/artery/truckLoadingDetails.vue +++ b/src/views/distribution/artery/truckLoadingDetails.vue @@ -57,7 +57,7 @@ 中转批量签收 - 删除 + 批量卸车 @@ -89,24 +89,32 @@ @btnCheck="btnsc" @selectCheck="selectsc" @selection="selectionChange" + :tableRowClassName=" + (row, index) => { + if (row.loadingAbnormal || row.unloadAbnormal) return 'Abnormal'; + else return ''; + } + " > @@ -175,7 +183,13 @@ import { mapGetters } from 'vuex'; import { ElMessage, ElMessageBox } from 'element-plus'; import type { Action } from 'element-plus'; import { getMyCurrentWarehouse } from '@/api/work/work'; -import { postLoadingDetail, postBatchUnload } from '@/api/distribution/truckLoadingDetails'; +import { + postLoadingDetail, + postBatchUnload, + postTransferUnloadPackage, + postTransferUnloadZero, + postBatchTransferUnload, +} from '@/api/distribution/truckLoadingDetails'; /** 获取字典 */ import { getDictionaryBiz } from '@/api/system/dict'; import { downloadXls } from '@/utils/util'; @@ -440,7 +454,7 @@ const onLoad = async (params = {}) => { /** 搜索 */ const searchChange = () => { - onLoad(details.page); + onLoad(); }; /** 清空表单 */ @@ -448,7 +462,7 @@ const searchReset = () => { details.query = {}; details.stockupDate = []; details.page.pageNum = 1; - onLoad(details.page); + onLoad(); }; /** 展开列表控件 */ @@ -491,7 +505,7 @@ const searchHide = () => { /** 表格表头输入框搜索 */ const inputsc = (index, row) => { details.query[row.prop] = index; - onLoad(details.page); + onLoad(); }; /** 表格表头时间选择 */ @@ -504,7 +518,7 @@ const timesc = (index, row) => { if (!index) { delete details.query[row.prop]; } - onLoad(details.page); + onLoad(); }; /** 表格表头输入框搜索 */ @@ -518,7 +532,7 @@ const selectsc = (index, row) => { details.query['certificateType'] = index; if (!index) delete details.query['certificateType']; } - onLoad(details.page); + onLoad(); }; /** 表格表头复选框选择 */ @@ -529,11 +543,14 @@ const selectionChange = (list: any) => { /** 每页数量改变执行的回调 */ const sizeChange = (pageSize: number) => { details.page.pageSize = pageSize; - onLoad(details.page); + onLoad(); }; /** 页码改变执行的回调 */ -const currentChange = () => {}; +const currentChange = pageNum => { + details.page.pageNum = pageNum; + onLoad(); +}; /** * 设置列表 -- 固定函数 @@ -602,52 +619,149 @@ const handleBatchUnLoad = async () => { if (details.selectionList.length === 0) return ElMessage.warning('请选择需要卸车的数据'); - const myWarehouseData = await getMyCurrentWarehouse(); + if (details.pageInfo.type !== 'TripartiteTransfer') { + const myWarehouseData = await getMyCurrentWarehouse(); - if (!myWarehouseData) return ElMessage.warning('请先选择一个仓库'); + if (!myWarehouseData) return ElMessage.warning('请先选择一个仓库'); + + // 当前登录人的仓库Id + const myWarehouseId = myWarehouseData.warehouseId; + + // 包件列表 + const _orderArr = []; + // 零担列表 + const _zeroArr = []; + + // 是否含有异常 + let isHaveAbnormalData = false; + + for (const iterator of details.selectionList) { + if (Number(iterator.scanStatus) === 1) { + // 包件 + if (Number(iterator.type) === 1) { + _orderArr.push({ orderPackageCode: iterator.scanCode }); + } else { + _zeroArr.push({ + waybillNo: iterator.waybillNo, + enterNum: iterator.num, + orderCode: iterator.orderCode, + }); + } - // 当前登录人的仓库Id - const myWarehouseId = myWarehouseData.warehouseId; - - // 包件列表 - const _orderArr = []; - // 零担列表 - const _zeroArr = []; - - // 是否含有异常 - let isHaveAbnormalData = false; - - for (const iterator of details.selectionList) { - if (Number(iterator.scanStatus) === 1) { - // 包件 - if (Number(iterator.type) === 1) { - _orderArr.push({ orderPackageCode: iterator.scanCode }); - } else { - _zeroArr.push({ - waybillNo: iterator.waybillNo, - enterNum: iterator.num, - orderCode: iterator.orderCode, - }); + // 不重复判断是否有异常 + if (!isHaveAbnormalData) { + isHaveAbnormalData = iterator.warehouseId === myWarehouseId; + } } + } + + if ([..._zeroArr, ..._orderArr].length === 0) return ElMessage.warning('没有符合要求的数据'); + + // 判断是否含有异常 + if (isHaveAbnormalData) { + const submitData = { + loadId: details.pageInfo.loadId, + unloadPackageList: _orderArr, + unloadZeroList: _zeroArr, + }; - // 不重复判断是否有异常 - if (!isHaveAbnormalData) { - isHaveAbnormalData = iterator.warehouseId === myWarehouseId; + const res = await postBatchUnload(submitData); + const { code } = res.data; + + if (code !== 200) return; + ElMessage.success('卸车成功'); + onLoad(); + return; + } + + ElMessageBox.confirm('包含已卸车数据或计划不在本节点卸车的数据', '异常提交', { + confirmButtonText: '提交包含不在本节点数据', + cancelButtonText: '仅提交装车数据', + type: 'warning', + center: true, + distinguishCancelAndClose: true, + }) + // 异常提交 + .then(async () => { + try { + details.loadingObj.pageLoading = true; + + const submitData = { + loadId: details.pageInfo.loadId, + unloadPackageList: _orderArr, + unloadZeroList: _zeroArr, + }; + + const res = await postBatchUnload(submitData); + const { code } = res.data; + + if (code !== 200) return; + ElMessage.success('卸车成功'); + onLoad(); + } catch (error) { + console.log('error :>> ', error); + } finally { + details.loadingObj.pageLoading = false; + } + }) + // 仅去除已装车和已签收数据 + .catch(async (action: Action) => { + if (action !== 'cancel') return; + + try { + details.loadingObj.pageLoading = true; + + const submitData = { + loadId: details.pageInfo.loadId, + unloadPackageList: _orderArr.filter(val => val.warehouseId === myWarehouseId), + unloadZeroList: _zeroArr.filter(val => val.warehouseId === myWarehouseId), + }; + + const res = await postBatchUnload(submitData); + const { code } = res.data; + + if (code !== 200) return; + ElMessage.success('卸车成功'); + onLoad(); + } catch (error) { + console.log('error :>> ', error); + } finally { + details.loadingObj.pageLoading = false; + } + }); + } else { + // 三方中转 + + // 包件列表 + const _orderArr = []; + // 零担列表 + const _zeroArr = []; + + for (const iterator of details.selectionList) { + if (Number(iterator.scanStatus) === 1) { + // 包件 + if (Number(iterator.type) === 1) { + _orderArr.push({ orderPackageCode: iterator.scanCode }); + } else { + _zeroArr.push({ + waybillNo: iterator.waybillNo, + enterNum: iterator.num, + orderCode: iterator.orderCode, + }); + } } } - } - if ([..._zeroArr, ..._orderArr].length === 0) return ElMessage.warning('没有符合要求的数据'); + if ([..._zeroArr, ..._orderArr].length === 0) return ElMessage.warning('没有符合要求的数据'); - // 判断是否含有异常 - if (isHaveAbnormalData) { + // 判断是否含有异常 const submitData = { loadId: details.pageInfo.loadId, unloadPackageList: _orderArr, unloadZeroList: _zeroArr, }; - const res = await postBatchUnload(submitData); + const res = await postBatchTransferUnload(submitData); const { code } = res.data; if (code !== 200) return; @@ -655,62 +769,6 @@ const handleBatchUnLoad = async () => { onLoad(); return; } - - ElMessageBox.confirm('包含已卸车数据或计划不在本节点卸车的数据', '异常提交', { - confirmButtonText: '提交包含不在本节点数据', - cancelButtonText: '仅提交装车数据', - type: 'warning', - center: true, - distinguishCancelAndClose: true, - }) - // 异常提交 - .then(async () => { - try { - details.loadingObj.pageLoading = true; - - const submitData = { - loadId: details.pageInfo.loadId, - unloadPackageList: _orderArr, - unloadZeroList: _zeroArr, - }; - - const res = await postBatchUnload(submitData); - const { code } = res.data; - - if (code !== 200) return; - ElMessage.success('卸车成功'); - onLoad(); - } catch (error) { - console.log('error :>> ', error); - } finally { - details.loadingObj.pageLoading = false; - } - }) - // 仅去除已装车和已签收数据 - .catch(async (action: Action) => { - if (action !== 'cancel') return; - - try { - details.loadingObj.pageLoading = true; - - const submitData = { - loadId: details.pageInfo.loadId, - unloadPackageList: _orderArr.filter(val => val.warehouseId === myWarehouseId), - unloadZeroList: _zeroArr.filter(val => val.warehouseId === myWarehouseId), - }; - - const res = await postBatchUnload(submitData); - const { code } = res.data; - - if (code !== 200) return; - ElMessage.success('卸车成功'); - onLoad(); - } catch (error) { - console.log('error :>> ', error); - } finally { - details.loadingObj.pageLoading = false; - } - }); } catch (error) { console.log('error :>> ', error); } finally { @@ -723,57 +781,71 @@ const handleOrderUnLoad = async ({ row }) => { try { details.loadingObj.pageLoading = true; - const myWarehouseData = await getMyCurrentWarehouse(); - if (!myWarehouseData) return ElMessage.warning('请先选择一个仓库'); + if (details.pageInfo.type !== 'TripartiteTransfer') { + const myWarehouseData = await getMyCurrentWarehouse(); + if (!myWarehouseData) return ElMessage.warning('请先选择一个仓库'); - // 当前登录人的仓库Id - const myWarehouseId = myWarehouseData.warehouseId; + // 当前登录人的仓库Id + const myWarehouseId = myWarehouseData.warehouseId; - if (row.warehouseId !== myWarehouseId) - return ( - ElMessageBox.confirm('包含已卸车数据或计划不在本节点卸车的数据', '异常提交', { - confirmButtonText: '提交包含不在本节点数据', - cancelButtonText: '取消', - type: 'warning', - center: true, - }) - // 异常提交 - .then(async () => { - try { - details.loadingObj.pageLoading = true; - - const submitData = { - loadId: details.pageInfo.loadId, - unloadPackageList: [{ orderPackageCode: row.scanCode }], - unloadZeroList: [], - }; - - const res = await postBatchUnload(submitData); - const { code } = res.data; - - if (code !== 200) return; - ElMessage.success('卸车成功'); - onLoad(); - } catch (error) { - console.log('error :>> ', error); - } finally { - details.loadingObj.pageLoading = false; - } + if (row.warehouseId !== myWarehouseId) + return ( + ElMessageBox.confirm('包含已卸车数据或计划不在本节点卸车的数据', '异常提交', { + confirmButtonText: '提交包含不在本节点数据', + cancelButtonText: '取消', + type: 'warning', + center: true, }) - ); + // 异常提交 + .then(async () => { + try { + details.loadingObj.pageLoading = true; + + const submitData = { + loadId: details.pageInfo.loadId, + unloadPackageList: [{ orderPackageCode: row.scanCode }], + unloadZeroList: [], + }; + + const res = await postBatchUnload(submitData); + const { code } = res.data; + + if (code !== 200) return; + ElMessage.success('卸车成功'); + onLoad(); + } catch (error) { + console.log('error :>> ', error); + } finally { + details.loadingObj.pageLoading = false; + } + }) + ); + const submitData = { + loadId: details.pageInfo.loadId, + unloadPackageList: [{ orderPackageCode: row.scanCode }], + unloadZeroList: [], + }; - const submitData = { - loadId: details.pageInfo.loadId, - unloadPackageList: [{ orderPackageCode: row.scanCode }], - unloadZeroList: [], - }; + const res = await postBatchUnload(submitData); + const { code } = res.data; - const res = await postBatchUnload(submitData); - const { code } = res.data; + if (code !== 200) return; + ElMessage.success('卸车成功'); + onLoad(); + } else { + // 三方中转 + const submitData = { + loadId: details.pageInfo.loadId, + orderPackageCode: row.scanCode, + }; - if (code !== 200) return; - ElMessage.success('卸车成功'); - onLoad(); + const res = await postTransferUnloadPackage(submitData); + const { code } = res.data; + + if (code !== 200) return; + ElMessage.success('卸车成功'); + onLoad(); + } } catch (error) { console.log('error :>> ', error); } finally { @@ -783,11 +855,13 @@ const handleOrderUnLoad = async ({ row }) => { /** 卸车 -- 零担 */ const handleZeroUnLoad = async ({ row }) => { - const myWarehouseData = await getMyCurrentWarehouse(); - if (!myWarehouseData) return ElMessage.warning('请先选择一个仓库'); + if (details.pageInfo.type !== 'TripartiteTransfer') { + const myWarehouseData = await getMyCurrentWarehouse(); + if (!myWarehouseData) return ElMessage.warning('请先选择一个仓库'); - if (myWarehouseData.warehouseId !== row.warehouseId) - return ElMessage.warning('未在目的仓, 无法卸车'); + if (myWarehouseData.warehouseId !== row.warehouseId) + return ElMessage.warning('未在目的仓, 无法卸车'); + } details.zeroItem = { ...row }; details.zeroItem.enterNum = row.num; @@ -800,19 +874,32 @@ const handleZeroUnLoadSubmit = async () => { details.popUpShow.transferVisited = false; details.loadingObj.pageLoading = true; - const submitData = { - loadId: details.pageInfo.loadId, - unloadPackageList: [], - unloadZeroList: [ - { - waybillNo: details.zeroItem.waybillNo, - enterNum: details.zeroItem.num, - orderCode: details.zeroItem.orderCode, - }, - ], - }; - - const res = await postBatchUnload(submitData); + let res = {}; + + if (details.pageInfo.type !== 'TripartiteTransfer') { + const submitData = { + loadId: details.pageInfo.loadId, + unloadPackageList: [], + unloadZeroList: [ + { + waybillNo: details.zeroItem.waybillNo, + enterNum: details.zeroItem.num, + orderCode: details.zeroItem.orderCode, + }, + ], + }; + + res = await postBatchUnload(submitData); + } else { + const submitData = { + loadId: details.pageInfo.loadId, + waybillNo: details.zeroItem.waybillNo, + enterNum: details.zeroItem.num, + orderCode: details.zeroItem.orderCode, + }; + + res = await postTransferUnloadZero(submitData); + } const { code } = res.data; if (code !== 200) return; @@ -919,4 +1006,24 @@ watch( .transferPopUp :deep(.el-textarea) { width: 500px; } + +:deep(.el-table tr) { + &.Abnormal { + background: #dc2e2e; + + .tabculconte, + .el-tooltip, + .el-button--text { + color: #fff !important; + } + } + + &.hover-row { + .tabculconte, + .el-tooltip, + .el-button--text { + color: var(--el-color-primary) !important; + } + } +} diff --git a/src/views/waybill/TemporaryStorageList.vue b/src/views/waybill/TemporaryStorageList.vue index 3100598e..dd3971e7 100644 --- a/src/views/waybill/TemporaryStorageList.vue +++ b/src/views/waybill/TemporaryStorageList.vue @@ -113,7 +113,7 @@