|
|
|
@ -23,7 +23,7 @@
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<!-- 控件 --> |
|
|
|
|
<div> |
|
|
|
|
<div v-if="Number(details.pageType) === 1"> |
|
|
|
|
<!-- 删除节点 --> |
|
|
|
|
<el-button icon="Delete" v-if="index !== 0" @click="handleDelNode(index)" /> |
|
|
|
|
<!-- 新增节点 --> |
|
|
|
@ -47,7 +47,7 @@
|
|
|
|
|
@change="val => destinationWarehouseNameChange(val, index)" |
|
|
|
|
:remote-method="remoteMethod" |
|
|
|
|
:loading="details.loadingObj.loading" |
|
|
|
|
:disabled="index === 0" |
|
|
|
|
:disabled="Number(details.pageType) !== 1 || index === 0" |
|
|
|
|
> |
|
|
|
|
<el-option |
|
|
|
|
v-for="val in details.options" |
|
|
|
@ -135,7 +135,11 @@
|
|
|
|
|
<!-- 装车方式 --> |
|
|
|
|
<div class="form_row_item"> |
|
|
|
|
<el-form-item inline label="装车方式" prop="loadingType"> |
|
|
|
|
<el-radio-group v-model="form.loadingType" class="ml-4"> |
|
|
|
|
<el-radio-group |
|
|
|
|
v-model="form.loadingType" |
|
|
|
|
:disabled="Number(details.pageType) !== 1" |
|
|
|
|
class="ml-4" |
|
|
|
|
> |
|
|
|
|
<el-radio label="1" size="large">手动装车(后台)</el-radio> |
|
|
|
|
<el-radio label="2" size="large">扫描装车</el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
@ -225,7 +229,10 @@
|
|
|
|
|
:precision="2" |
|
|
|
|
:min="0" |
|
|
|
|
:step="1" |
|
|
|
|
:disabled="slotProps.scope.row.blackList.includes(slotProps.scope.column.property)" |
|
|
|
|
:disabled=" |
|
|
|
|
Number(details.pageType) === 2 || |
|
|
|
|
slotProps.scope.row.blackList.includes(slotProps.scope.column.property) |
|
|
|
|
" |
|
|
|
|
@input="handleComputedNum" |
|
|
|
|
v-model="slotProps.scope.row[slotProps.scope.column.property]" |
|
|
|
|
/> |
|
|
|
@ -324,6 +331,10 @@
|
|
|
|
|
</tablecmt> |
|
|
|
|
|
|
|
|
|
<div class="avue-crud__pagination flex-c-sb" style="width: 100%"> |
|
|
|
|
<div class="total_row" style="margin-top: 0"> |
|
|
|
|
选中: {{ details.selectionList.length }} |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<!-- 分页模块 --> |
|
|
|
|
<el-pagination |
|
|
|
|
style="zoom: 0.9" |
|
|
|
@ -413,6 +424,8 @@
|
|
|
|
|
<el-button icon="el-icon-search" @click="searchHide" circle></el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<!-- 列表 --> |
|
|
|
|
<tablecmt |
|
|
|
|
class="columnList" |
|
|
|
|
ref="newColumnListNode" |
|
|
|
@ -423,10 +436,8 @@
|
|
|
|
|
> |
|
|
|
|
<template #default="slotProps"> |
|
|
|
|
<template v-if="slotProps.scope.column.label === '计划数'"> |
|
|
|
|
<!-- <el-text size="small" text @click="handleEditplanNum(slotProps.scope)">{{ |
|
|
|
|
slotProps.scope.row.planNum |
|
|
|
|
}}</el-text> --> |
|
|
|
|
<el-input-number |
|
|
|
|
v-if="Number(details.pageType) === 1" |
|
|
|
|
v-model="slotProps.scope.row.planNum" |
|
|
|
|
controls-position="right" |
|
|
|
|
:precision="0" |
|
|
|
@ -434,9 +445,22 @@
|
|
|
|
|
:max="slotProps.scope.row.stockNum" |
|
|
|
|
:step="1" |
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
<el-text |
|
|
|
|
size="small" |
|
|
|
|
v-else |
|
|
|
|
text |
|
|
|
|
@click="handleEditplanNum(slotProps.scope, item)" |
|
|
|
|
>{{ slotProps.scope.row.planNum }}</el-text |
|
|
|
|
> |
|
|
|
|
</template> |
|
|
|
|
</template> |
|
|
|
|
</tablecmt> |
|
|
|
|
|
|
|
|
|
<div class="total_row"> |
|
|
|
|
<span> 选中: {{ item.selectionList.length }} 条 </span> |
|
|
|
|
<span> 共 {{ item.lineCarsOrderList.length }} 条 </span> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
</div> |
|
|
|
@ -445,6 +469,8 @@
|
|
|
|
|
<!-- 页面底部占位 --> |
|
|
|
|
<div class="footer"></div> |
|
|
|
|
<div class="button-container"> |
|
|
|
|
<el-button class="submitButton" @click="back"> 关闭 </el-button> |
|
|
|
|
|
|
|
|
|
<el-button |
|
|
|
|
class="submitButton" |
|
|
|
|
icon="Promotion" |
|
|
|
@ -454,14 +480,58 @@
|
|
|
|
|
> |
|
|
|
|
提交 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button class="submitButton" icon="Close" type="primary" @click="back"> 关闭 </el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</basic-container> |
|
|
|
|
|
|
|
|
|
<!-- 包内产品 --> |
|
|
|
|
<el-dialog |
|
|
|
|
title="修改计划数量" |
|
|
|
|
v-model="details.popUpShow.editPlanNumberVisited" |
|
|
|
|
width="40%" |
|
|
|
|
append-to-body |
|
|
|
|
class="packageDetailColumnListVisited" |
|
|
|
|
> |
|
|
|
|
<div class="edit_title">订单号: {{ details.editInfo.orderCode }}</div> |
|
|
|
|
<div class="flex-c-sb edit_row"> |
|
|
|
|
<div class="flex1"> |
|
|
|
|
<span>当前在库数</span> |
|
|
|
|
{{ details.editInfo.stockNum }} |
|
|
|
|
</div> |
|
|
|
|
<div class="flex1"> |
|
|
|
|
<span>已装车数量</span> |
|
|
|
|
{{ details.editInfo.realNum }} |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<el-form> |
|
|
|
|
<el-form-item label="计划数量:" label-width="100px"> |
|
|
|
|
<el-input-number |
|
|
|
|
controls-position="right" |
|
|
|
|
:min="0" |
|
|
|
|
:precision="0" |
|
|
|
|
:max="details.editInfo.stockNum" |
|
|
|
|
class="editInput" |
|
|
|
|
v-model="details.editInfo.enterPlanNum" |
|
|
|
|
style="flex: 1; text-align: left !important" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
<div class="flex-c-c"> |
|
|
|
|
<el-button>取消</el-button> |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
:loading="btnLoadingObj.editPlanNumBtn" |
|
|
|
|
icon="Promotion" |
|
|
|
|
@click="handleSubmitEdit" |
|
|
|
|
> |
|
|
|
|
提交 |
|
|
|
|
</el-button> |
|
|
|
|
</div> |
|
|
|
|
</el-dialog> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
|
import { ref, reactive, toRefs, computed, onMounted, nextTick } from 'vue'; |
|
|
|
|
import { ref, reactive, toRefs, computed, onMounted, nextTick, onActivated, watch } from 'vue'; |
|
|
|
|
import functions from '@/utils/functions'; |
|
|
|
|
import dayjs from 'dayjs'; |
|
|
|
|
import { mapGetters } from 'vuex'; |
|
|
|
@ -480,6 +550,12 @@ import {
|
|
|
|
|
postFindCarListByName, |
|
|
|
|
postFindDriverListByName, |
|
|
|
|
postSaveNew, |
|
|
|
|
postSelectEditDetailByLoadId, |
|
|
|
|
postFindUseOrderList, |
|
|
|
|
postRemoveCarsOrderByCarsOrderId, |
|
|
|
|
postUpdatePlanNumByCarsOrderId, |
|
|
|
|
postAddOrderToFinalNodeId, |
|
|
|
|
postUpdateCarsLoadBasicData, |
|
|
|
|
} from '@/api/distribution/AddVehicleStowage'; |
|
|
|
|
import { useRouter, useRoute } from 'vue-router'; |
|
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus'; |
|
|
|
@ -576,29 +652,16 @@ const details = reactive<any>({
|
|
|
|
|
}, |
|
|
|
|
/** 弹出层显示 */ |
|
|
|
|
popUpShow: { |
|
|
|
|
/** 装车详情 */ |
|
|
|
|
truckLoadingDetailVisited: false, |
|
|
|
|
/** 零担补录 */ |
|
|
|
|
zeroAdditionalRecordingVisited: false, |
|
|
|
|
/** 对比报表 */ |
|
|
|
|
comparativeStatementPopUp: false, |
|
|
|
|
/** 修改计划数量 */ |
|
|
|
|
editPlanNumberVisited: false, |
|
|
|
|
}, |
|
|
|
|
/** 列表Dom节点 */ |
|
|
|
|
listNode: '', |
|
|
|
|
form: { loadingType: '2' }, |
|
|
|
|
/** 零担补录信息 */ |
|
|
|
|
zeroAdditionalRecordingInfo: { |
|
|
|
|
oldPage: { |
|
|
|
|
pageSize: 30, |
|
|
|
|
pageNum: 1, |
|
|
|
|
total: 0, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
/** 全屏 */ |
|
|
|
|
fullscreenObj: { |
|
|
|
|
/** 装车明细 */ |
|
|
|
|
truckLoadingDetailPopUp: false, |
|
|
|
|
comparativeStatementPopUp: false, |
|
|
|
|
}, |
|
|
|
|
/** 匹配 */ |
|
|
|
|
rules: { |
|
|
|
@ -644,24 +707,25 @@ const details = reactive<any>({
|
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
/** 页面信息 */ |
|
|
|
|
pageInfo: {}, |
|
|
|
|
pageInfo: { |
|
|
|
|
startWarehouseInfo: {}, |
|
|
|
|
}, |
|
|
|
|
/** 目的仓 */ |
|
|
|
|
options: [], |
|
|
|
|
/** 车牌号 */ |
|
|
|
|
carListByName: [], |
|
|
|
|
/** 司机 */ |
|
|
|
|
driverListByName: [], |
|
|
|
|
/** 当前页面类型 -- 1: 新增; 2: 编辑; 3: 零担补录 */ |
|
|
|
|
/** 当前页面类型 -- 1: 新增; 2: 编辑; 3: 节点费用 */ |
|
|
|
|
pageType: 1, |
|
|
|
|
/** 编辑&节点费用下的loadId */ |
|
|
|
|
loadId: '', |
|
|
|
|
/** 编辑模式下当前仓的位置索引 */ |
|
|
|
|
warehouseIndex: computed(() => { |
|
|
|
|
if (Number(details.pageType) === 1) return 0; |
|
|
|
|
else if (Number(details.pageType) === 2) return 0; |
|
|
|
|
}), |
|
|
|
|
warehouseIndex: 0, |
|
|
|
|
/** 步骤条激活位置 */ |
|
|
|
|
active: computed(() => { |
|
|
|
|
if (Number(details.pageType) === 1) return details.nodeInfoData.length; |
|
|
|
|
else if (Number(details.pageType) === 2) return 0; |
|
|
|
|
else if (Number(details.pageType) === 2) return details.warehouseIndex; |
|
|
|
|
}), |
|
|
|
|
/** 被选中的orderCode组成的list */ |
|
|
|
|
orderCodeList: [], |
|
|
|
@ -672,6 +736,8 @@ const details = reactive<any>({
|
|
|
|
|
const btnLoadingObj = reactive({ |
|
|
|
|
/** 提交按钮 */ |
|
|
|
|
submitBtn: false, |
|
|
|
|
/** 修改计划数量 */ |
|
|
|
|
editPlanNumBtn: false, |
|
|
|
|
}); |
|
|
|
|
const { |
|
|
|
|
search, |
|
|
|
@ -758,28 +824,122 @@ const handleEditForbidden = (_arr: []) => {
|
|
|
|
|
return [_firstChild, ..._otherList]; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 请求运单数据 */ |
|
|
|
|
const initOriginWarehouseOrder = async (params = {}) => { |
|
|
|
|
try { |
|
|
|
|
details.loadingObj.oldListLoading = true; |
|
|
|
|
const submitData = { |
|
|
|
|
...details.page, |
|
|
|
|
loadId: details.pageInfo.startWarehouseInfo.warehouseId, |
|
|
|
|
orderCodes: details.orderCodeList, |
|
|
|
|
...details.query, |
|
|
|
|
...params, |
|
|
|
|
}; |
|
|
|
|
if (submitData.orderCodes.length === 0) delete submitData.orderCodes; |
|
|
|
|
const res = await postFindAllOrderList(submitData); |
|
|
|
|
console.log('res :>> ', res); |
|
|
|
|
const { code, data } = res.data; |
|
|
|
|
if (code !== 200) return; |
|
|
|
|
details.data = data.records; |
|
|
|
|
details.page.total = data.total; |
|
|
|
|
} catch (error) { |
|
|
|
|
console.log('error :>> ', error); |
|
|
|
|
} finally { |
|
|
|
|
details.loadingObj.oldListLoading = false; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 请求添加在调度池中的数据 */ |
|
|
|
|
const initDispatchOrder = async item => { |
|
|
|
|
try { |
|
|
|
|
// 开启列表加载动画 |
|
|
|
|
item.loading = true; |
|
|
|
|
const submitData = { |
|
|
|
|
loadId: details.loadId, |
|
|
|
|
finalNodeId: item.nodeId, |
|
|
|
|
}; |
|
|
|
|
const res = await postFindUseOrderList(submitData); |
|
|
|
|
const { code, data } = res.data; |
|
|
|
|
if (code !== 200) return; |
|
|
|
|
item.lineCarsOrderList = data; |
|
|
|
|
} catch (error) { |
|
|
|
|
} finally { |
|
|
|
|
// 关闭列表加载动画 |
|
|
|
|
item.loading = false; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 请求页面数据 */ |
|
|
|
|
const onLoad = async () => { |
|
|
|
|
const res = await postloadFindLoadInitData(); |
|
|
|
|
const { code, data } = res.data; |
|
|
|
|
if (code !== 200) return; |
|
|
|
|
details.pageInfo = data; |
|
|
|
|
console.log('data.startWarehouseInfo.nodeName :>> ', data.startWarehouseInfo.nodeName); |
|
|
|
|
details.nodeInfoData = [ |
|
|
|
|
{ |
|
|
|
|
nodeName: data.startWarehouseInfo.warehouseName, |
|
|
|
|
nodeId: data.startWarehouseInfo.warehouseId, |
|
|
|
|
linkMan: data.startWarehouseInfo.linkMan, |
|
|
|
|
linkPhone: data.startWarehouseInfo.linkMobile, |
|
|
|
|
linkAddress: data.startWarehouseInfo.linkAddress, |
|
|
|
|
}, |
|
|
|
|
]; |
|
|
|
|
details.nodeInfoData = handleEditForbidden(details.nodeInfoData); |
|
|
|
|
console.log('details.nodeInfoData :>> ', details.nodeInfoData); |
|
|
|
|
details.form.startWarehouseName = data.startWarehouseInfo.warehouseName; |
|
|
|
|
details.form.startWarehouseId = data.startWarehouseInfo.warehouseId; |
|
|
|
|
// 获取当前页面的信息 |
|
|
|
|
details.loadId = $route.query.loadId; |
|
|
|
|
details.pageType = $route.query.type; |
|
|
|
|
|
|
|
|
|
// 新增 |
|
|
|
|
if (Number(details.pageType) === 1) { |
|
|
|
|
details.form = {}; |
|
|
|
|
const res = await postloadFindLoadInitData(); |
|
|
|
|
const { code, data } = res.data; |
|
|
|
|
if (code !== 200) return; |
|
|
|
|
details.pageInfo = data; |
|
|
|
|
console.log('data.startWarehouseInfo.nodeName :>> ', data.startWarehouseInfo.nodeName); |
|
|
|
|
details.nodeInfoData = [ |
|
|
|
|
{ |
|
|
|
|
nodeName: data.startWarehouseInfo.warehouseName, |
|
|
|
|
nodeId: data.startWarehouseInfo.warehouseId, |
|
|
|
|
linkMan: data.startWarehouseInfo.linkMan, |
|
|
|
|
linkPhone: data.startWarehouseInfo.linkMobile, |
|
|
|
|
linkAddress: data.startWarehouseInfo.linkAddress, |
|
|
|
|
}, |
|
|
|
|
]; |
|
|
|
|
details.nodeInfoData = handleEditForbidden(details.nodeInfoData); |
|
|
|
|
console.log('details.nodeInfoData :>> ', details.nodeInfoData); |
|
|
|
|
details.form.startWarehouseName = data.startWarehouseInfo.warehouseName; |
|
|
|
|
details.form.startWarehouseId = data.startWarehouseInfo.warehouseId; |
|
|
|
|
} |
|
|
|
|
// 编辑 |
|
|
|
|
else if (Number(details.pageType) === 2) { |
|
|
|
|
console.log('222 :>> ', 222); |
|
|
|
|
const res = await postSelectEditDetailByLoadId({ loadId: details.loadId }); |
|
|
|
|
console.log('res :>> ', res); |
|
|
|
|
const { code, data } = res.data; |
|
|
|
|
details.nodeInfoData = handleEditForbidden( |
|
|
|
|
data.allCarsLineList.map((val, index) => { |
|
|
|
|
if (val.nodeName === data.warehouseName) { |
|
|
|
|
// 显示当前节点 |
|
|
|
|
details.warehouseIndex = index; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 筛选 |
|
|
|
|
val.query = {}; |
|
|
|
|
// 复选框 |
|
|
|
|
val.selectionList = []; |
|
|
|
|
// 参数 |
|
|
|
|
val.lineCarsOrderList = []; |
|
|
|
|
val.filterData = []; |
|
|
|
|
val.loading = false; |
|
|
|
|
val.selectionChange = (list, index) => { |
|
|
|
|
details.nodeInfoData[index].selectionList = list; |
|
|
|
|
console.log('list :>> ', list); |
|
|
|
|
}; |
|
|
|
|
initDispatchOrder(val); |
|
|
|
|
return val; |
|
|
|
|
}) |
|
|
|
|
); |
|
|
|
|
details.form = data.carsLoadEntity; |
|
|
|
|
details.pageInfo.loadType = data.loadType; |
|
|
|
|
details.pageInfo.chargeType = data.chargeType; |
|
|
|
|
details.pageInfo.startWarehouseInfo.warehouseId = data.carsLoadEntity.startWarehouseId; |
|
|
|
|
details.pageInfo.startWarehouseInfo.warehouseName = data.carsLoadEntity.startWarehouseName; |
|
|
|
|
// 请求节点 |
|
|
|
|
initOriginWarehouseOrder(); |
|
|
|
|
|
|
|
|
|
// 设置页面列表高度 |
|
|
|
|
setTabelHeight(); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// 初始化调用 |
|
|
|
|
onLoad(); |
|
|
|
|
|
|
|
|
|
/** 查询仓库 */ |
|
|
|
@ -802,31 +962,6 @@ const destinationWarehouseNameChange = (val, index) => {
|
|
|
|
|
details.nodeInfoData[index].linkAddress = _value.linkAddress; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 请求运单数据 */ |
|
|
|
|
const initOriginWarehouseOrder = async (params = {}) => { |
|
|
|
|
try { |
|
|
|
|
details.loadingObj.oldListLoading = true; |
|
|
|
|
const submitData = { |
|
|
|
|
...details.page, |
|
|
|
|
loadId: details.pageInfo.startWarehouseInfo.warehouseId, |
|
|
|
|
orderCodes: details.orderCodeList, |
|
|
|
|
...details.query, |
|
|
|
|
...params, |
|
|
|
|
}; |
|
|
|
|
if (submitData.orderCodes.length === 0) delete submitData.orderCodes; |
|
|
|
|
const res = await postFindAllOrderList(submitData); |
|
|
|
|
console.log('res :>> ', res); |
|
|
|
|
const { code, data } = res.data; |
|
|
|
|
if (code !== 200) return; |
|
|
|
|
details.data = data.records; |
|
|
|
|
details.page.total = data.total; |
|
|
|
|
} catch (error) { |
|
|
|
|
console.log('error :>> ', error); |
|
|
|
|
} finally { |
|
|
|
|
details.loadingObj.oldListLoading = false; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 搜索 */ |
|
|
|
|
const searchChange = () => { |
|
|
|
|
initOriginWarehouseOrder(); |
|
|
|
@ -925,32 +1060,6 @@ const beforeClose = done => {
|
|
|
|
|
details.view = false; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 是否开启床车明细全屏 |
|
|
|
|
* @params(_type) 开启或关闭 |
|
|
|
|
*/ |
|
|
|
|
const handleFullScrean = (_type: 'open' | 'close', _name: string) => { |
|
|
|
|
let _node = ''; |
|
|
|
|
if (_name) _node = document.querySelectorAll(`.${_name} .maboxhi`); |
|
|
|
|
console.log('_node :>> ', _node); |
|
|
|
|
|
|
|
|
|
switch (_name) { |
|
|
|
|
case 'comparativeStatementPopUp': |
|
|
|
|
details.fullscreenObj.comparativeStatementPopUp = |
|
|
|
|
!details.fullscreenObj.comparativeStatementPopUp; |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
default: |
|
|
|
|
details.fullscreenObj[_name] = !details.fullscreenObj[_name]; |
|
|
|
|
if (_type === 'close') { |
|
|
|
|
if (_node) setNodeHeight(_node, '500px'); |
|
|
|
|
} else { |
|
|
|
|
if (_node) setNodeHeight(_node); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 司机改变时 1: 主驾 2: 副驾 */ |
|
|
|
|
const handleNameChange = (type: number) => { |
|
|
|
|
const findValue = type === 1 ? form.value.driverName : form.value.name; |
|
|
|
@ -997,6 +1106,7 @@ const handleComputedNum = () => {
|
|
|
|
|
const _key = nodeInfokeys[index]; |
|
|
|
|
// 检测是否为数字 |
|
|
|
|
if (!isNumer(item[_key])) item[_key] = 0; |
|
|
|
|
else item[_key] = Number(item[_key]); |
|
|
|
|
_totalNum = computeNumber(_totalNum, '+', item[_key]).result; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1048,7 +1158,7 @@ const handleDelNode = (index: number) => {
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 加入调度池 */ |
|
|
|
|
const handleAddWaybill = (index: number) => { |
|
|
|
|
const handleAddWaybill = async (index: number) => { |
|
|
|
|
const _node = details.nodeInfoData[index]; |
|
|
|
|
if (!_node.nodeName || !_node.nodeId) { |
|
|
|
|
return ElMessage({ |
|
|
|
@ -1058,51 +1168,96 @@ const handleAddWaybill = (index: number) => {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
console.log('_node :>> ', _node); |
|
|
|
|
// 新增 |
|
|
|
|
if (Number(details.pageType) === 1) { |
|
|
|
|
for (let item of details.selectionList) { |
|
|
|
|
item.planNum = item.stockNum; |
|
|
|
|
item.loadingNum = 0; |
|
|
|
|
_node.lineCarsOrderList.push(item); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for (let item of details.selectionList) { |
|
|
|
|
item.planNum = item.stockNum; |
|
|
|
|
item.loadingNum = 0; |
|
|
|
|
_node.lineCarsOrderList.push(item); |
|
|
|
|
details.orderCodeList = [ |
|
|
|
|
...new Set([ |
|
|
|
|
...details.orderCodeList, |
|
|
|
|
...details.selectionList.map(val => val.orderCode + ',' + val.waybillNo), |
|
|
|
|
]), |
|
|
|
|
]; |
|
|
|
|
console.log('details.orderCodeList :>> ', details.orderCodeList); |
|
|
|
|
|
|
|
|
|
const orderCodes = details.selectionList.map(val => val.orderCode); |
|
|
|
|
clearSelectionList(); |
|
|
|
|
details.page.pageNum = 1; |
|
|
|
|
initOriginWarehouseOrder(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
details.orderCodeList = [ |
|
|
|
|
...new Set([ |
|
|
|
|
...details.orderCodeList, |
|
|
|
|
...details.selectionList.map(val => val.orderCode + ',' + val.waybillNo), |
|
|
|
|
]), |
|
|
|
|
]; |
|
|
|
|
console.log('details.orderCodeList :>> ', details.orderCodeList); |
|
|
|
|
|
|
|
|
|
const orderCodes = details.selectionList.map(val => val.orderCode); |
|
|
|
|
clearSelectionList(); |
|
|
|
|
details.page.pageNum = 1; |
|
|
|
|
initOriginWarehouseOrder(); |
|
|
|
|
// 修改 |
|
|
|
|
else if (Number(details.pageType) === 2) { |
|
|
|
|
console.log('_node :>> ', _node); |
|
|
|
|
const submitData = { |
|
|
|
|
loadId: details.loadId, |
|
|
|
|
carsOrderList: details.selectionList.map(val => { |
|
|
|
|
return { |
|
|
|
|
nodeId: details.pageInfo.startWarehouseInfo.warehouseId, |
|
|
|
|
nodeName: details.pageInfo.startWarehouseInfo.warehouseName, |
|
|
|
|
orderCode: val.orderCode, |
|
|
|
|
waybillNo: val.waybillNo, |
|
|
|
|
totalNum: val.stockNum, |
|
|
|
|
planNum: val.stockNum, |
|
|
|
|
type: 1, |
|
|
|
|
finalNodeId: _node.nodeId, |
|
|
|
|
}; |
|
|
|
|
}), |
|
|
|
|
}; |
|
|
|
|
const res = await postAddOrderToFinalNodeId(submitData); |
|
|
|
|
const { code, data } = res.data; |
|
|
|
|
if (code !== 200) return; |
|
|
|
|
ElMessage.success('移除成功'); |
|
|
|
|
initDispatchOrder(_node); |
|
|
|
|
initOriginWarehouseOrder(); |
|
|
|
|
} |
|
|
|
|
// postAddOrderToFinalNodeId |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 移除调度池 */ |
|
|
|
|
const handleRemoveWaybill = (index: number) => { |
|
|
|
|
const handleRemoveWaybill = async (index: number) => { |
|
|
|
|
const _node = details.nodeInfoData[index]; |
|
|
|
|
console.log('details.nodeInfoData[index] :>> ', details.nodeInfoData[index]); |
|
|
|
|
if (!_node.nodeName || !_node.nodeId) { |
|
|
|
|
return ElMessage({ |
|
|
|
|
type: 'warning', |
|
|
|
|
message: '未选择目的仓或目的仓信息异常', |
|
|
|
|
// 新增 |
|
|
|
|
if (Number(details.pageType) === 1) { |
|
|
|
|
if (!_node.nodeName || !_node.nodeId) { |
|
|
|
|
return ElMessage({ |
|
|
|
|
type: 'warning', |
|
|
|
|
message: '未选择目的仓或目的仓信息异常', |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
console.log('_node :>> ', _node); |
|
|
|
|
// 将被选中的数据筛选出去 |
|
|
|
|
_node.lineCarsOrderList = _node.lineCarsOrderList.filter((val, index) => { |
|
|
|
|
const _flag = !_node.selectionList.includes(val); |
|
|
|
|
if (!_flag) { |
|
|
|
|
const _code = val.orderCode + ',' + val.waybillNo; |
|
|
|
|
const _index = details.orderCodeList.indexOf(_code); |
|
|
|
|
// 删除映射的订单号+运单号 |
|
|
|
|
details.orderCodeList.splice(_index, 1); |
|
|
|
|
} |
|
|
|
|
return _flag; |
|
|
|
|
}); |
|
|
|
|
clearSelectionList(); |
|
|
|
|
initOriginWarehouseOrder(); |
|
|
|
|
} |
|
|
|
|
// 修改 |
|
|
|
|
else if (Number(details.pageType) === 2) { |
|
|
|
|
console.log('_node :>> ', _node); |
|
|
|
|
const submitData = { |
|
|
|
|
carsOrderId: _node.selectionList.map(val => val.carsOrderId).join(','), |
|
|
|
|
}; |
|
|
|
|
const res = await postRemoveCarsOrderByCarsOrderId(submitData); |
|
|
|
|
const { code, data } = res.data; |
|
|
|
|
if (code !== 200) return; |
|
|
|
|
ElMessage.success('移除成功'); |
|
|
|
|
initDispatchOrder(_node); |
|
|
|
|
initOriginWarehouseOrder(); |
|
|
|
|
} |
|
|
|
|
console.log('_node :>> ', _node); |
|
|
|
|
// 将被选中的数据筛选出去 |
|
|
|
|
_node.lineCarsOrderList = _node.lineCarsOrderList.filter((val, index) => { |
|
|
|
|
const _flag = !_node.selectionList.includes(val); |
|
|
|
|
if (!_flag) { |
|
|
|
|
const _code = val.orderCode + ',' + val.waybillNo; |
|
|
|
|
const _index = details.orderCodeList.indexOf(_code); |
|
|
|
|
// 删除映射的订单号+运单号 |
|
|
|
|
details.orderCodeList.splice(_index, 1); |
|
|
|
|
} |
|
|
|
|
return _flag; |
|
|
|
|
}); |
|
|
|
|
clearSelectionList(); |
|
|
|
|
initOriginWarehouseOrder(); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 查询司机信息 */ |
|
|
|
@ -1128,7 +1283,39 @@ const remoteMethodCar = async val => {
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 修改计划数 */ |
|
|
|
|
const handleEditplanNum = row => {}; |
|
|
|
|
const handleEditplanNum = ({ row }, item) => { |
|
|
|
|
console.log('row :>> ', row); |
|
|
|
|
details.editInfo = row; |
|
|
|
|
details.editInfo.enterPlanNum = Number(row.planNum); |
|
|
|
|
details.editInfo.item = item; |
|
|
|
|
|
|
|
|
|
console.log('details.editInfo :>> ', details.editInfo); |
|
|
|
|
details.popUpShow.editPlanNumberVisited = true; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 提交修改计划数量 */ |
|
|
|
|
const handleSubmitEdit = async () => { |
|
|
|
|
try { |
|
|
|
|
btnLoadingObj.editPlanNumBtn = true; |
|
|
|
|
|
|
|
|
|
const submitData = { |
|
|
|
|
carsOrderId: details.editInfo.carsOrderId, |
|
|
|
|
planNum: details.editInfo.enterPlanNum, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const res = await postUpdatePlanNumByCarsOrderId(submitData); |
|
|
|
|
const { code } = res.data; |
|
|
|
|
if (code !== 200) return; |
|
|
|
|
ElMessage.success('修改成功'); |
|
|
|
|
initDispatchOrder(details.editInfo.item); |
|
|
|
|
details.popUpShow.editPlanNumberVisited = false; |
|
|
|
|
} catch (error) { |
|
|
|
|
console.log('error :>> ', error); |
|
|
|
|
} finally { |
|
|
|
|
// 关闭按钮loading |
|
|
|
|
btnLoadingObj.editPlanNumBtn = false; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 关闭页面 */ |
|
|
|
|
const back = () => { |
|
|
|
@ -1136,6 +1323,107 @@ const back = () => {
|
|
|
|
|
$router.back('-1'); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 新增提交 */ |
|
|
|
|
const addSubmit = async () => { |
|
|
|
|
try { |
|
|
|
|
btnLoadingObj.submitBtn = true; |
|
|
|
|
const _warehouseIds = []; |
|
|
|
|
const _warehouseNames = []; |
|
|
|
|
const _flag = details.nodeInfoData.every((value, index) => { |
|
|
|
|
_warehouseNames.push(value.nodeName); |
|
|
|
|
if (index === 0) return true; |
|
|
|
|
_warehouseIds.push(value.nodeId); |
|
|
|
|
|
|
|
|
|
return value.nodeName && value.nodeId; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
if (!_flag) { |
|
|
|
|
return ElMessage({ |
|
|
|
|
type: 'warning', |
|
|
|
|
message: '节点信息有误', |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const submitData = { |
|
|
|
|
...form.value, |
|
|
|
|
carsLoadLineList: JSON.parse(JSON.stringify(details.nodeInfoData)), |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// 目的仓 |
|
|
|
|
submitData.endWarehouseIds = _warehouseIds.join(','); |
|
|
|
|
submitData.endWarehouseNames = _warehouseNames.slice(1).join(','); |
|
|
|
|
submitData.carsLineName = _warehouseNames.join('->'); |
|
|
|
|
|
|
|
|
|
let _lineCarsOrderList = []; |
|
|
|
|
submitData.carsLoadLineList.forEach((val, i) => { |
|
|
|
|
val.nodeType = '1'; |
|
|
|
|
val.sort = i + 1; |
|
|
|
|
delete val.blackList; |
|
|
|
|
if (i === 0) return; |
|
|
|
|
// 删除无用数据 |
|
|
|
|
delete val.query; |
|
|
|
|
delete val.selectionList; |
|
|
|
|
delete val.loading; |
|
|
|
|
delete val.data; |
|
|
|
|
delete val.filterData; |
|
|
|
|
|
|
|
|
|
_lineCarsOrderList = [ |
|
|
|
|
..._lineCarsOrderList, |
|
|
|
|
...val.lineCarsOrderList.map(value => { |
|
|
|
|
value.nodeId = submitData.startWarehouseId; |
|
|
|
|
value.nodeName = submitData.startWarehouseName; |
|
|
|
|
value.finalNodeId = val.nodeId; |
|
|
|
|
value.totalNum = 20; |
|
|
|
|
return value; |
|
|
|
|
}), |
|
|
|
|
]; |
|
|
|
|
delete val.lineCarsOrderList; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
submitData.carsLoadLineList[0].lineCarsOrderList = _lineCarsOrderList; |
|
|
|
|
|
|
|
|
|
console.log('submitData :>> ', submitData); |
|
|
|
|
const res = await postSaveNew(submitData); |
|
|
|
|
const { code, msg } = res.data; |
|
|
|
|
if (code !== 200) return; |
|
|
|
|
ElMessage({ |
|
|
|
|
message: msg, |
|
|
|
|
type: 'success', |
|
|
|
|
}); |
|
|
|
|
back(); |
|
|
|
|
console.log('res :>> ', res); |
|
|
|
|
} catch (error) { |
|
|
|
|
} finally { |
|
|
|
|
btnLoadingObj.submitBtn = false; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 修改提交 */ |
|
|
|
|
const editSubmit = async () => { |
|
|
|
|
try { |
|
|
|
|
btnLoadingObj.submitBtn = false; |
|
|
|
|
|
|
|
|
|
const submitData = { loadId: details.loadId, ...details.form }; |
|
|
|
|
|
|
|
|
|
console.log('details.form :>> ', details.form); |
|
|
|
|
|
|
|
|
|
console.log('submitData :>> ', submitData); |
|
|
|
|
const res = await postUpdateCarsLoadBasicData(submitData); |
|
|
|
|
const { code, msg } = res.data; |
|
|
|
|
if (code !== 200) return; |
|
|
|
|
ElMessage({ |
|
|
|
|
message: msg, |
|
|
|
|
type: 'success', |
|
|
|
|
}); |
|
|
|
|
back(); |
|
|
|
|
// console.log('res :>> ', res); |
|
|
|
|
} catch (error) { |
|
|
|
|
console.log('error :>> ', error); |
|
|
|
|
} finally { |
|
|
|
|
btnLoadingObj.submitBtn = false; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 提交 */ |
|
|
|
|
const handleSubmit = (formEl: FormInstance | undefined) => { |
|
|
|
|
if (btnLoadingObj.submitBtn) return; |
|
|
|
@ -1143,82 +1431,19 @@ const handleSubmit = (formEl: FormInstance | undefined) => {
|
|
|
|
|
console.log('111 :>> ', 111); |
|
|
|
|
formEl.validate(async (valid, fields) => { |
|
|
|
|
if (valid) { |
|
|
|
|
try { |
|
|
|
|
btnLoadingObj.submitBtn = true; |
|
|
|
|
const _warehouseIds = []; |
|
|
|
|
const _warehouseNames = []; |
|
|
|
|
const _flag = details.nodeInfoData.every((value, index) => { |
|
|
|
|
_warehouseNames.push(value.nodeName); |
|
|
|
|
if (index === 0) return true; |
|
|
|
|
_warehouseIds.push(value.nodeId); |
|
|
|
|
|
|
|
|
|
return value.nodeName && value.nodeId; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
if (!_flag) { |
|
|
|
|
return ElMessage({ |
|
|
|
|
type: 'warning', |
|
|
|
|
message: '节点信息有误', |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const submitData = { |
|
|
|
|
...form.value, |
|
|
|
|
carsLoadLineList: JSON.parse(JSON.stringify(details.nodeInfoData)), |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// 目的仓 |
|
|
|
|
submitData.endWarehouseIds = _warehouseIds.join(','); |
|
|
|
|
submitData.endWarehouseNames = _warehouseNames.slice(1).join(','); |
|
|
|
|
submitData.carsLineName = _warehouseNames.join('->'); |
|
|
|
|
|
|
|
|
|
let _lineCarsOrderList = []; |
|
|
|
|
submitData.carsLoadLineList.forEach((val, i) => { |
|
|
|
|
val.nodeType = '1'; |
|
|
|
|
val.sort = i + 1; |
|
|
|
|
delete val.blackList; |
|
|
|
|
if (i === 0) return; |
|
|
|
|
// 删除无用数据 |
|
|
|
|
delete val.query; |
|
|
|
|
delete val.selectionList; |
|
|
|
|
delete val.loading; |
|
|
|
|
delete val.data; |
|
|
|
|
delete val.filterData; |
|
|
|
|
|
|
|
|
|
_lineCarsOrderList = [ |
|
|
|
|
..._lineCarsOrderList, |
|
|
|
|
...val.lineCarsOrderList.map(value => { |
|
|
|
|
value.nodeId = submitData.startWarehouseId; |
|
|
|
|
value.nodeName = submitData.startWarehouseName; |
|
|
|
|
value.finalNodeId = val.nodeId; |
|
|
|
|
value.totalNum = 20; |
|
|
|
|
return value; |
|
|
|
|
}), |
|
|
|
|
]; |
|
|
|
|
delete val.lineCarsOrderList; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
submitData.carsLoadLineList[0].lineCarsOrderList = _lineCarsOrderList; |
|
|
|
|
|
|
|
|
|
console.log('submitData :>> ', submitData); |
|
|
|
|
const res = await postSaveNew(submitData); |
|
|
|
|
const { code, msg } = res.data; |
|
|
|
|
if (code !== 200) return; |
|
|
|
|
ElMessage({ |
|
|
|
|
message: msg, |
|
|
|
|
type: 'success', |
|
|
|
|
}); |
|
|
|
|
back(); |
|
|
|
|
console.log('res :>> ', res); |
|
|
|
|
} catch (error) { |
|
|
|
|
} finally { |
|
|
|
|
btnLoadingObj.submitBtn = false; |
|
|
|
|
} |
|
|
|
|
// 新增提交 |
|
|
|
|
if (Number(details.pageType) === 1) addSubmit(); |
|
|
|
|
// 修改提交 |
|
|
|
|
else if (Number(details.pageType) === 2) editSubmit(); |
|
|
|
|
} else { |
|
|
|
|
console.log('error submit!', fields); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
watch($route, () => { |
|
|
|
|
onLoad(); |
|
|
|
|
}); |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
|
@ -1317,6 +1542,19 @@ const handleSubmit = (formEl: FormInstance | undefined) => {
|
|
|
|
|
--el-color-success: #1a3061; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
:deep(.el-step__title.is-process) { |
|
|
|
|
font-weight: bold; |
|
|
|
|
--el-text-color-primary: #60df54; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
:deep(.el-step__head.is-process) { |
|
|
|
|
--el-text-color-primary: #60df54; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
:deep(.el-step__title.is-process .count_icon) { |
|
|
|
|
background: #60df54; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.count_icon { |
|
|
|
|
--width: 25px; |
|
|
|
|
margin-right: 20px; |
|
|
|
@ -1383,4 +1621,30 @@ const handleSubmit = (formEl: FormInstance | undefined) => {
|
|
|
|
|
) { |
|
|
|
|
--el-color-danger: #f00; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 修改数字输入框 |
|
|
|
|
:deep(.editInput .el-input__inner) { |
|
|
|
|
text-align: left !important; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 修改弹窗内样式 |
|
|
|
|
.edit_title { |
|
|
|
|
font-size: 18px; |
|
|
|
|
font-weight: bold; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.edit_row { |
|
|
|
|
margin: 20px 0; |
|
|
|
|
|
|
|
|
|
.flex1 { |
|
|
|
|
flex: 1; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 统计行 |
|
|
|
|
.total_row { |
|
|
|
|
margin-top: 5px; |
|
|
|
|
zoom: 0.9; |
|
|
|
|
color: var(--el-color-primary); |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|