|
|
|
@ -149,14 +149,25 @@
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div style="margin-bottom: 10px" class="flex-c-sb"> |
|
|
|
|
<el-button type="text" class="pointer" @click="handleRemoveWaybill"> |
|
|
|
|
<el-icon><CaretLeft /></el-icon> |
|
|
|
|
移除调度池 |
|
|
|
|
</el-button> |
|
|
|
|
<div> |
|
|
|
|
<el-button type="text" class="pointer" @click="handleRemoveWaybill"> |
|
|
|
|
<el-icon><CaretLeft /></el-icon> |
|
|
|
|
移除调度池 |
|
|
|
|
</el-button> |
|
|
|
|
|
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
icon="Edit" |
|
|
|
|
v-if="details.finalNodeIdArr.length > 1" |
|
|
|
|
@click="handleEditNode" |
|
|
|
|
> |
|
|
|
|
修改节点 |
|
|
|
|
</el-button> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<!-- 控件 --> |
|
|
|
|
<div class="avue-crud__right"> |
|
|
|
|
<el-button icon="el-icon-refresh" @click="searchChange" circle></el-button> |
|
|
|
|
<el-button icon="el-icon-refresh" @click="handleRefresh" circle></el-button> |
|
|
|
|
<el-button icon="Operation" @click="showdrawer(true, 2)" circle></el-button> |
|
|
|
|
<el-button icon="el-icon-search" @click="searchHide" circle></el-button> |
|
|
|
|
</div> |
|
|
|
@ -200,6 +211,7 @@
|
|
|
|
|
type="primary" |
|
|
|
|
class="submitBtn" |
|
|
|
|
icon="el-icon-circle-check" |
|
|
|
|
:loading="details.loadingObj.submitLoading" |
|
|
|
|
@click="handleEditZeroSubmit" |
|
|
|
|
>提 交</el-button |
|
|
|
|
> |
|
|
|
@ -211,7 +223,7 @@
|
|
|
|
|
:align-center="true" |
|
|
|
|
> |
|
|
|
|
<el-form-item label-width="100px" label="选择节点"> |
|
|
|
|
<el-select v-model="details.chooseNodeId" class="m-2" placeholder="Select"> |
|
|
|
|
<el-select v-model="details.finalNodeId" class="m-2" placeholder="选择节点"> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in details.finalNodeIdArr" |
|
|
|
|
:key="item.warehouseId" |
|
|
|
@ -223,8 +235,8 @@
|
|
|
|
|
|
|
|
|
|
<template #footer> |
|
|
|
|
<div class="flex-c-c"> |
|
|
|
|
<el-button @click="dialogVisible = false">取消</el-button> |
|
|
|
|
<el-button type="primary" @click="submitClient"> 确定(修改客户) </el-button> |
|
|
|
|
<el-button @click="details.showPopUpObj.editNodeIdDialogVisible = false">取消</el-button> |
|
|
|
|
<el-button type="primary" @click="handleChooseNode"> 确定(选择节点) </el-button> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
</el-dialog> |
|
|
|
@ -256,10 +268,15 @@ import {
|
|
|
|
|
import { downloadXls } from '@/utils/util'; |
|
|
|
|
import { oldColumnList, newColumnList } from '@/option/distribution/zeroAdditionalRecording'; |
|
|
|
|
import { ElMessage } from 'element-plus'; |
|
|
|
|
import { useRoute } from 'vue-router'; |
|
|
|
|
import { useRoute, useRouter } from 'vue-router'; |
|
|
|
|
import { useStore } from 'vuex'; |
|
|
|
|
|
|
|
|
|
// 路由实例 |
|
|
|
|
const $route = useRoute(); |
|
|
|
|
const $router = useRouter(); |
|
|
|
|
|
|
|
|
|
// 实例化仓库 |
|
|
|
|
const $store = useStore(); |
|
|
|
|
|
|
|
|
|
const details = reactive<any>({ |
|
|
|
|
/** 是否开启搜索 */ |
|
|
|
@ -305,7 +322,7 @@ const details = reactive<any>({
|
|
|
|
|
oldColumnList, |
|
|
|
|
newColumnList, |
|
|
|
|
/** 订单池数据 */ |
|
|
|
|
oldData: [{}], |
|
|
|
|
oldData: [], |
|
|
|
|
/** 调度池数据 */ |
|
|
|
|
newData: [], |
|
|
|
|
/** 页面loading */ |
|
|
|
@ -313,6 +330,8 @@ const details = reactive<any>({
|
|
|
|
|
/** 列表加载loading */ |
|
|
|
|
list: false, |
|
|
|
|
newListLoading: false, |
|
|
|
|
/** 提交按钮 */ |
|
|
|
|
submitLoading: false, |
|
|
|
|
}, |
|
|
|
|
/** 订单池列表复选框选中的数据 */ |
|
|
|
|
oldSelectionList: [], |
|
|
|
@ -353,11 +372,14 @@ const details = reactive<any>({
|
|
|
|
|
finalNodeIdArr: [], |
|
|
|
|
/** 运单Id */ |
|
|
|
|
loadId: '', |
|
|
|
|
/** 弹出层 */ |
|
|
|
|
showPopUpObj: { |
|
|
|
|
editNodeIdDialogVisible: true, |
|
|
|
|
editNodeIdDialogVisible: false, |
|
|
|
|
}, |
|
|
|
|
/** 选择的Id */ |
|
|
|
|
chooseNodeId: '', |
|
|
|
|
finalNodeId: '', |
|
|
|
|
/** 确认框的事件类型 add -- 新增 edit -- 修改 */ |
|
|
|
|
confirmType: 'add', |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
const { |
|
|
|
@ -587,26 +609,33 @@ const setnewcolum = (newarr, headarr, type) => {
|
|
|
|
|
const handleAddWaybill = () => { |
|
|
|
|
if (details.oldSelectionList.length === 0) return ElMessage.error('最少选择一条数据'); |
|
|
|
|
|
|
|
|
|
for (let item of details.oldSelectionList) { |
|
|
|
|
console.log('item.stockNum :>> ', item.stockNum); |
|
|
|
|
item.loadingNum = Number(item.stockNum || 0); |
|
|
|
|
details.newData.push(item); |
|
|
|
|
} |
|
|
|
|
// 有多个后续节点 |
|
|
|
|
if (details.finalNodeIdArr.length > 1) { |
|
|
|
|
details.confirmType = 'add'; |
|
|
|
|
|
|
|
|
|
details.orderCodeList = [ |
|
|
|
|
...new Set([...details.orderCodeList, ...details.oldSelectionList.map(val => val.orderCode)]), |
|
|
|
|
]; |
|
|
|
|
details.showPopUpObj.editNodeIdDialogVisible = true; |
|
|
|
|
} else { |
|
|
|
|
const _item = details.finalNodeIdArr[0]; |
|
|
|
|
|
|
|
|
|
details.page.pageNum = 1; |
|
|
|
|
onLoad(); |
|
|
|
|
for (let item of details.oldSelectionList) { |
|
|
|
|
item.finalNodeId = _item.warehouseId; |
|
|
|
|
item.warehouseName = _item.warehouseName; |
|
|
|
|
item.loadingNum = Number(item.stockNum || 0); |
|
|
|
|
details.newData.push(item); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
details.orderCodeList = [ |
|
|
|
|
...new Set([...details.orderCodeList, ...details.oldSelectionList.map(val => val.orderCode)]), |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
details.page.pageNum = 1; |
|
|
|
|
onLoad(); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 移除运单 */ |
|
|
|
|
const handleRemoveWaybill = () => { |
|
|
|
|
if (details.newSelectionList.length === 0) return ElMessage.warning('最少选择一条运单'); |
|
|
|
|
for (const iterator of details.newSelectionList) { |
|
|
|
|
console.log('111 :>> ', 111); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
details.newData = details.newData.filter((val, index) => { |
|
|
|
|
const _flag = !details.newSelectionList.includes(val); |
|
|
|
@ -623,29 +652,114 @@ const handleRemoveWaybill = () => {
|
|
|
|
|
onLoad(); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 清空调度池 */ |
|
|
|
|
const handleRefresh = () => { |
|
|
|
|
details.newData = []; |
|
|
|
|
details.newSelectionList = []; |
|
|
|
|
details.orderCodeList = []; |
|
|
|
|
details.page.pageNum = 1; |
|
|
|
|
onLoad(); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 开启修改零担补录节点弹窗 */ |
|
|
|
|
const handleEditNode = () => { |
|
|
|
|
if (details.finalNodeIdArr.length <= 1) return ElMessage.error('后续节点数小于2个'); |
|
|
|
|
|
|
|
|
|
if (details.newSelectionList.length === 0) return ElMessage.warning('最少选择一条数据'); |
|
|
|
|
|
|
|
|
|
details.confirmType = 'edit'; |
|
|
|
|
|
|
|
|
|
details.showPopUpObj.editNodeIdDialogVisible = true; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 新增提交 */ |
|
|
|
|
const handleAdd = (warehouseName, finalNodeId) => { |
|
|
|
|
for (let item of details.oldSelectionList) { |
|
|
|
|
item.finalNodeId = details.finalNodeId; |
|
|
|
|
item.warehouseName = warehouseName; |
|
|
|
|
item.loadingNum = Number(item.stockNum || 0); |
|
|
|
|
details.newData.push(item); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
details.orderCodeList = [ |
|
|
|
|
...new Set([...details.orderCodeList, ...details.oldSelectionList.map(val => val.orderCode)]), |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
details.page.pageNum = 1; |
|
|
|
|
onLoad(); |
|
|
|
|
|
|
|
|
|
details.showPopUpObj.editNodeIdDialogVisible = false; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const handleEdit = (warehouseName, finalNodeId) => { |
|
|
|
|
for (const iterator of details.newSelectionList) { |
|
|
|
|
iterator.finalNodeId = finalNodeId; |
|
|
|
|
iterator.warehouseName = warehouseName; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
details.showPopUpObj.editNodeIdDialogVisible = false; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 修改零担补录节点 */ |
|
|
|
|
const handleChooseNode = () => { |
|
|
|
|
if (!details.finalNodeId) return ElMessage.error('请选择节点'); |
|
|
|
|
|
|
|
|
|
const _finalNodeId = details.finalNodeId; |
|
|
|
|
|
|
|
|
|
// 获取节点名称 |
|
|
|
|
const _warehouseName = details.finalNodeIdArr.find( |
|
|
|
|
val => val.warehouseId === _finalNodeId |
|
|
|
|
).warehouseName; |
|
|
|
|
|
|
|
|
|
details.confirmType === 'add' |
|
|
|
|
? handleAdd(_warehouseName, _finalNodeId) |
|
|
|
|
: handleEdit(_warehouseName, _finalNodeId); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 返回上一页 */ |
|
|
|
|
const back = () => { |
|
|
|
|
$router.back(); |
|
|
|
|
|
|
|
|
|
$store.commit('DEL_TAG'); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 零担补录提交 */ |
|
|
|
|
const handleEditZeroSubmit = () => { |
|
|
|
|
if (details.newData.length === 0) return ElMessage.error('请选择运单'); |
|
|
|
|
|
|
|
|
|
// const _data = details.newData.filter(val => { |
|
|
|
|
// return val.loadingNum > 0; |
|
|
|
|
// }); |
|
|
|
|
|
|
|
|
|
const submitData = { |
|
|
|
|
loadId: details.loadId, |
|
|
|
|
zeroSuppleList: [], |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
for (const iterator of details.newData) { |
|
|
|
|
submitData.zeroSuppleList.push({ |
|
|
|
|
orderCode: iterator.orderCode, |
|
|
|
|
waybillNo: iterator.waybillNo, |
|
|
|
|
enterNum: iterator.stockNum, |
|
|
|
|
finalNodeId: iterator.nodeId, |
|
|
|
|
const handleEditZeroSubmit = async () => { |
|
|
|
|
try { |
|
|
|
|
// 开启提交loading |
|
|
|
|
details.loadingObj.submitLoading = true; |
|
|
|
|
|
|
|
|
|
if (details.newData.length === 0) return ElMessage.error('请选择运单'); |
|
|
|
|
|
|
|
|
|
const _data = details.newData.filter(val => { |
|
|
|
|
return val.loadingNum > 0; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
console.log('_data :>> ', _data); |
|
|
|
|
const submitData = { |
|
|
|
|
loadId: details.loadId, |
|
|
|
|
zeroSuppleList: [], |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
for (const iterator of details.newData) { |
|
|
|
|
submitData.zeroSuppleList.push({ |
|
|
|
|
orderCode: iterator.orderCode, |
|
|
|
|
waybillNo: iterator.waybillNo, |
|
|
|
|
enterNum: iterator.loadingNum, |
|
|
|
|
finalNodeId: iterator.finalNodeId, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
console.log('submitData :>> ', submitData); |
|
|
|
|
const res = await postAddZeroSupple(submitData); |
|
|
|
|
|
|
|
|
|
const { code } = res.data; |
|
|
|
|
if (code !== 200) return; |
|
|
|
|
} catch (error) { |
|
|
|
|
console.log('error :>> ', error); |
|
|
|
|
} finally { |
|
|
|
|
// 关闭提交loading |
|
|
|
|
details.loadingObj.submitLoading = false; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
@ -743,4 +857,8 @@ const handleEditZeroSubmit = () => {
|
|
|
|
|
:deep(.el-input-number__increase) { |
|
|
|
|
zoom: 0.8; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.el-select { |
|
|
|
|
width: 100%; |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|