|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
<template> |
|
|
|
|
<basic-container> |
|
|
|
|
<basic-container v-loading="details.loadingObj.submitLoading"> |
|
|
|
|
<div class="avue-crud"> |
|
|
|
|
<!-- 标题 基础信息 --> |
|
|
|
|
<el-divider content-position="left"> |
|
|
|
@ -28,7 +28,7 @@
|
|
|
|
|
reserve-keyword |
|
|
|
|
placeholder="中转承运商" |
|
|
|
|
@change="carrierNameChange" |
|
|
|
|
:remote-method="remoteMethod" |
|
|
|
|
:remote-method="value => debounce(remoteMethod(value), 500)" |
|
|
|
|
:loading="details.loadingObj.carrierName" |
|
|
|
|
> |
|
|
|
|
<el-option |
|
|
|
@ -63,7 +63,7 @@
|
|
|
|
|
</el-select> --> |
|
|
|
|
<el-input v-model="form.operator" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="送货方式"> |
|
|
|
|
<el-form-item label="送货方式" prop="deliveryType"> |
|
|
|
|
<el-select |
|
|
|
|
:teleported="false" |
|
|
|
|
v-model="form.deliveryType" |
|
|
|
@ -79,7 +79,7 @@
|
|
|
|
|
/> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="付款方式"> |
|
|
|
|
<el-form-item label="付款方式" prop="payMethod"> |
|
|
|
|
<el-select |
|
|
|
|
:teleported="false" |
|
|
|
|
v-model="form.payMethod" |
|
|
|
@ -95,7 +95,7 @@
|
|
|
|
|
/> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="运费分摊方式"> |
|
|
|
|
<el-form-item label="运费分摊方式" prop="chargeType"> |
|
|
|
|
<el-select |
|
|
|
|
:teleported="false" |
|
|
|
|
v-model="form.chargeType" |
|
|
|
@ -111,7 +111,7 @@
|
|
|
|
|
/> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="送货司机"> |
|
|
|
|
<el-form-item label="送货司机" prop="driverName"> |
|
|
|
|
<el-select |
|
|
|
|
v-model="form.driverName" |
|
|
|
|
filterable |
|
|
|
@ -148,7 +148,7 @@
|
|
|
|
|
/> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="是否结算"> |
|
|
|
|
<el-form-item label="是否结算" prop="isSettlement"> |
|
|
|
|
<el-select |
|
|
|
|
:teleported="false" |
|
|
|
|
v-model="form.isSettlement" |
|
|
|
@ -164,7 +164,7 @@
|
|
|
|
|
/> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="代收贷款"> |
|
|
|
|
<el-form-item label="代收贷款" prop="replacePrice"> |
|
|
|
|
<el-input-number |
|
|
|
|
placeholder="代收贷款" |
|
|
|
|
v-model="form.replacePrice" |
|
|
|
@ -184,6 +184,7 @@
|
|
|
|
|
placeholder="承运时间" |
|
|
|
|
size="default" |
|
|
|
|
:teleported="false" |
|
|
|
|
value-format="YYYY-MM-DD" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="客户收货时间" prop="receivingTimeStr"> |
|
|
|
@ -193,6 +194,7 @@
|
|
|
|
|
placeholder="客户收货时间" |
|
|
|
|
size="default" |
|
|
|
|
:teleported="false" |
|
|
|
|
value-format="YYYY-MM-DD" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="运费" prop="countTransportCost"> |
|
|
|
@ -205,7 +207,7 @@
|
|
|
|
|
controls-position="right" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="司机结算费"> |
|
|
|
|
<el-form-item label="司机结算费" prop="settlementValue"> |
|
|
|
|
<el-input-number |
|
|
|
|
v-model="form.settlementValue" |
|
|
|
|
:precision="2" |
|
|
|
@ -235,37 +237,39 @@
|
|
|
|
|
<!-- 列表模块 --> |
|
|
|
|
<div style="width: 49%"> |
|
|
|
|
<div class="add_row_title">运单池</div> |
|
|
|
|
<div v-if="!search"> |
|
|
|
|
<el-form :inline="true" label-width="80px" :model="details.oldQuery" class="el-fr-d"> |
|
|
|
|
<div class="fo-fl"> |
|
|
|
|
<el-form-item label="备注" class="el-times"> |
|
|
|
|
<el-input></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
<el-form-item label="托盘码" class="el-times"> |
|
|
|
|
<el-input></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
<el-form-item class="el-times"> |
|
|
|
|
<el-date-picker |
|
|
|
|
v-model="stockupDate" |
|
|
|
|
type="daterange" |
|
|
|
|
unlink-panels |
|
|
|
|
range-separator="-" |
|
|
|
|
start-placeholder="开单日期" |
|
|
|
|
end-placeholder="开单日期" |
|
|
|
|
:shortcuts="shortcuts" |
|
|
|
|
clearable |
|
|
|
|
:teleported="false" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-button type="primary" icon="el-icon-search" @click="searchReset()" |
|
|
|
|
>搜 索</el-button |
|
|
|
|
> |
|
|
|
|
<el-button icon="el-icon-delete" @click="searchReset()">重置</el-button> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
|
<div v-h5uShow="!search"> |
|
|
|
|
<el-form |
|
|
|
|
:inline="true" |
|
|
|
|
label-width="80px" |
|
|
|
|
:model="details.oldQuery" |
|
|
|
|
class="header_search" |
|
|
|
|
> |
|
|
|
|
<el-form-item label="备注"> |
|
|
|
|
<el-input></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
<el-form-item label="托盘码"> |
|
|
|
|
<el-input></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
<el-form-item> |
|
|
|
|
<el-date-picker |
|
|
|
|
v-model="stockupDate" |
|
|
|
|
type="daterange" |
|
|
|
|
unlink-panels |
|
|
|
|
range-separator="-" |
|
|
|
|
start-placeholder="开单日期" |
|
|
|
|
end-placeholder="开单日期" |
|
|
|
|
:shortcuts="shortcuts" |
|
|
|
|
clearable |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-button type="primary" icon="el-icon-search" @click="searchReset()" |
|
|
|
|
>搜 索</el-button |
|
|
|
|
> |
|
|
|
|
<el-button icon="el-icon-delete" @click="searchReset()">重置</el-button> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
@ -273,7 +277,7 @@
|
|
|
|
|
<div style="margin-bottom: 10px" class="flex-c-sb"> |
|
|
|
|
<div class="avue-crud__right"> |
|
|
|
|
<el-button icon="el-icon-refresh" @click="searchChange" circle></el-button> |
|
|
|
|
<el-button icon="Operation" @click="showdrawer(true, 1)" circle></el-button> |
|
|
|
|
<el-button icon="Operation" @click="showdrawer(true, '1')" circle></el-button> |
|
|
|
|
<el-button icon="el-icon-search" @click="searchHide" circle></el-button> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
@ -314,35 +318,38 @@
|
|
|
|
|
<!-- 列表模块 --> |
|
|
|
|
<div style="width: 49%"> |
|
|
|
|
<div class="add_row_title">调度池</div> |
|
|
|
|
<div v-if="!search"> |
|
|
|
|
<el-form :inline="true" label-width="80px" :model="details.newQuery" class="el-fr-d"> |
|
|
|
|
<div class="fo-fl"> |
|
|
|
|
<el-form-item label="备注" class="el-times"> |
|
|
|
|
<el-input></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
<el-form-item label="托盘码" class="el-times"> |
|
|
|
|
<el-input></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item class="el-times"> |
|
|
|
|
<el-date-picker |
|
|
|
|
v-model="stockupDate" |
|
|
|
|
type="daterange" |
|
|
|
|
unlink-panels |
|
|
|
|
range-separator="-" |
|
|
|
|
start-placeholder="开单日期" |
|
|
|
|
end-placeholder="开单日期" |
|
|
|
|
:shortcuts="shortcuts" |
|
|
|
|
clearable |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-button type="primary" icon="el-icon-search" @click="searchReset()" |
|
|
|
|
>搜 索</el-button |
|
|
|
|
> |
|
|
|
|
<el-button icon="el-icon-delete" @click="searchReset()">重置</el-button> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
|
<div v-h5uShow="!search"> |
|
|
|
|
<el-form |
|
|
|
|
:inline="true" |
|
|
|
|
label-width="80px" |
|
|
|
|
:model="details.newQuery" |
|
|
|
|
class="header_search" |
|
|
|
|
> |
|
|
|
|
<el-form-item label="备注"> |
|
|
|
|
<el-input></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
<el-form-item label="托盘码"> |
|
|
|
|
<el-input></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-date-picker |
|
|
|
|
v-model="stockupDate" |
|
|
|
|
type="daterange" |
|
|
|
|
unlink-panels |
|
|
|
|
range-separator="-" |
|
|
|
|
start-placeholder="开单日期" |
|
|
|
|
end-placeholder="开单日期" |
|
|
|
|
:shortcuts="shortcuts" |
|
|
|
|
clearable |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-button type="primary" icon="el-icon-search" @click="searchReset()" |
|
|
|
|
>搜 索</el-button |
|
|
|
|
> |
|
|
|
|
<el-button icon="el-icon-delete" @click="searchReset()">重置</el-button> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
@ -419,13 +426,13 @@
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
|
import { ref, reactive, toRefs, computed, onMounted, nextTick } from 'vue'; |
|
|
|
|
import { ref, reactive, toRefs, computed, onMounted, nextTick, watch } from 'vue'; |
|
|
|
|
import functions from '@/utils/functions'; |
|
|
|
|
import dayjs from 'dayjs'; |
|
|
|
|
import { mapGetters } from 'vuex'; |
|
|
|
|
/** 获取字典 */ |
|
|
|
|
import { getDictionaryBiz } from '@/api/system/dict'; |
|
|
|
|
import { downloadXls, computeNumber, setNodeHeight, getWinHight, debounce } from '@/utils/util'; |
|
|
|
|
import { downloadXls, computeNumber, setNodeHeight, debounce } from '@/utils/util'; |
|
|
|
|
import { columnList, newColumnList } from '@/option/distribution/addVehicleStowage'; |
|
|
|
|
import { |
|
|
|
|
postloadFindLoadInitData, |
|
|
|
@ -434,11 +441,16 @@ import {
|
|
|
|
|
postFindCarListByName, |
|
|
|
|
postFindDriverListByName, |
|
|
|
|
postFindCarrierByName, |
|
|
|
|
postFindUseOrderList, |
|
|
|
|
} from '@/api/distribution/AddVehicleStowage'; |
|
|
|
|
import { postSaveNewTripartiteTransfer } from '@/api/distribution/addTripartiteTransfer.js'; |
|
|
|
|
import { postSelectEditDetailByLoadId } from '@/api/distribution/AddVehicleStowage'; |
|
|
|
|
import { |
|
|
|
|
postSaveNewTripartiteTransfer, |
|
|
|
|
postUpdateTripartiteTransfer, |
|
|
|
|
} from '@/api/distribution/addTripartiteTransfer.js'; |
|
|
|
|
import type { FormInstance, FormRules } from 'element-plus'; |
|
|
|
|
import { ElMessage } from 'element-plus'; |
|
|
|
|
import { useRouter } from 'vue-router'; |
|
|
|
|
import { useRouter, useRoute } from 'vue-router'; |
|
|
|
|
import { useStore } from 'vuex'; |
|
|
|
|
|
|
|
|
|
// 获取vuex仓库 |
|
|
|
@ -446,6 +458,7 @@ const $store = useStore();
|
|
|
|
|
|
|
|
|
|
// 获取路由实例 |
|
|
|
|
const $router = useRouter(); |
|
|
|
|
const $route = useRoute(); |
|
|
|
|
|
|
|
|
|
// 表单实例 |
|
|
|
|
const ruleFormRef = ref(); |
|
|
|
@ -499,6 +512,7 @@ const details = reactive<any>({
|
|
|
|
|
newColumnList, |
|
|
|
|
/** 列表数据 */ |
|
|
|
|
newData: [], |
|
|
|
|
newRenderData: [], |
|
|
|
|
oldData: [], |
|
|
|
|
rules: { |
|
|
|
|
/** 中转承运商 */ |
|
|
|
@ -593,8 +607,6 @@ const details = reactive<any>({
|
|
|
|
|
/** 零担补录 */ |
|
|
|
|
transferVisited: false, |
|
|
|
|
}, |
|
|
|
|
/** 列表Dom节点 */ |
|
|
|
|
listNode: '', |
|
|
|
|
form: { |
|
|
|
|
customerType: '', |
|
|
|
|
}, |
|
|
|
@ -608,6 +620,8 @@ const details = reactive<any>({
|
|
|
|
|
driverListByName: [], |
|
|
|
|
/** 被选中在调度池的订单列表 */ |
|
|
|
|
orderCodeList: [], |
|
|
|
|
/** 修改时, 已存在调度池中的运单数据 */ |
|
|
|
|
MappingData: [], |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
const { |
|
|
|
@ -629,34 +643,124 @@ const {
|
|
|
|
|
const permission = computed(() => mapGetters(['permission', 'tagWel', 'tagList'])); |
|
|
|
|
console.log('permission :>> ', permission); |
|
|
|
|
|
|
|
|
|
onMounted(() => { |
|
|
|
|
const timer = setTimeout(() => { |
|
|
|
|
details.listNode = document.querySelector('.maboxhi'); |
|
|
|
|
details.listNode.style.transition = 'all .5s ease-out'; |
|
|
|
|
console.log('details.listNode :>> ', details.listNode); |
|
|
|
|
clearTimeout(timer); |
|
|
|
|
}, 100); |
|
|
|
|
onMounted(async () => { |
|
|
|
|
await nextTick(); |
|
|
|
|
setNodeHeight(document.querySelectorAll('.maboxhi'), '50vh', true); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
/** 请求页面数据 */ |
|
|
|
|
const onLoad = async () => { |
|
|
|
|
const res = await postloadFindLoadInitData(); |
|
|
|
|
|
|
|
|
|
details.form = {}; |
|
|
|
|
await nextTick(); |
|
|
|
|
ruleFormRef.value.resetFields(); |
|
|
|
|
|
|
|
|
|
const { code, data } = res.data; |
|
|
|
|
if (code !== 200) return; |
|
|
|
|
details.pageInfo = data; |
|
|
|
|
details.customerType = data.customerType; |
|
|
|
|
console.log('data :>> ', data); |
|
|
|
|
details.form.startWarehouseName = data.startWarehouseInfo.warehouseName; |
|
|
|
|
details.form.startWarehouseId = data.startWarehouseInfo.warehouseId; |
|
|
|
|
details.form.endWarehouseNames = data.startWarehouseInfo.warehouseName; |
|
|
|
|
details.form.endWarehouseIds = data.startWarehouseInfo.warehouseId; |
|
|
|
|
details.form.carsLineName = data.startWarehouseInfo.warehouseName; |
|
|
|
|
|
|
|
|
|
return await initOriginWarehouseOrder(); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const onLoadEidt = async () => { |
|
|
|
|
// 获取表单信息 |
|
|
|
|
const promiseAll = await Promise.all([ |
|
|
|
|
// 获取下拉列表 |
|
|
|
|
postloadFindLoadInitData(), |
|
|
|
|
// 获取表单数据 |
|
|
|
|
postSelectEditDetailByLoadId({ loadId: $route.query.loadId }), |
|
|
|
|
]); |
|
|
|
|
|
|
|
|
|
console.log('promiseAll :>> ', promiseAll); |
|
|
|
|
|
|
|
|
|
const [ |
|
|
|
|
{ |
|
|
|
|
data: { code, data }, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
data: { code: code1, data: data1 }, |
|
|
|
|
}, |
|
|
|
|
] = promiseAll; |
|
|
|
|
|
|
|
|
|
console.log('code :>> ', code); |
|
|
|
|
console.log('code1 :>> ', code1); |
|
|
|
|
|
|
|
|
|
if (code !== 200 && code1 !== 200) return; |
|
|
|
|
|
|
|
|
|
details.pageInfo = data; |
|
|
|
|
details.customerType = data.customerType; |
|
|
|
|
console.log('data :>> ', data); |
|
|
|
|
|
|
|
|
|
details.form = data1.carsLoadEntity; |
|
|
|
|
details.form.customerType = data1.carsLoadEntity.customerType.split(','); |
|
|
|
|
|
|
|
|
|
details.form.startWarehouseName = data.startWarehouseInfo.warehouseName; |
|
|
|
|
details.form.startWarehouseId = data.startWarehouseInfo.warehouseId; |
|
|
|
|
details.form.endWarehouseNames = data.startWarehouseInfo.warehouseName; |
|
|
|
|
details.form.endWarehouseIds = data.startWarehouseInfo.warehouseId; |
|
|
|
|
details.form.carsLineName = data.startWarehouseInfo.warehouseName; |
|
|
|
|
details.form.carrierTimeStr = details.form.carrierTime; |
|
|
|
|
details.form.receivingTimeStr = details.form.receivingTime; |
|
|
|
|
|
|
|
|
|
initOriginWarehouseOrder(); |
|
|
|
|
delete details.form.carrierTime; |
|
|
|
|
delete details.form.receivingTime; |
|
|
|
|
|
|
|
|
|
// 获取调度池数据 |
|
|
|
|
await initDispatchOrder(); |
|
|
|
|
|
|
|
|
|
// 获取运单池数据 |
|
|
|
|
return await initOriginWarehouseOrder(); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const initPageInfo = async () => { |
|
|
|
|
details.loadingObj.submitLoading = true; |
|
|
|
|
try { |
|
|
|
|
const { type } = $route.query; |
|
|
|
|
if (type === 'add') await onLoad(); |
|
|
|
|
else if (type === 'edit') await onLoadEidt(); |
|
|
|
|
} catch (error) { |
|
|
|
|
console.log('error :>> ', error); |
|
|
|
|
} finally { |
|
|
|
|
details.loadingObj.submitLoading = false; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 请求添加在调度池中的数据 */ |
|
|
|
|
const initDispatchOrder = async () => { |
|
|
|
|
// 开启列表加载动画 |
|
|
|
|
const submitData = { |
|
|
|
|
loadId: $route.query.loadId, |
|
|
|
|
finalNodeId: details.form.startWarehouseId, |
|
|
|
|
}; |
|
|
|
|
const res = await postFindUseOrderList(submitData); |
|
|
|
|
const { code, data } = res.data; |
|
|
|
|
if (code !== 200) return; |
|
|
|
|
details.newData = data; |
|
|
|
|
details.newRenderData = data; |
|
|
|
|
details.MappingData = JSON.parse(JSON.stringify(data)); |
|
|
|
|
|
|
|
|
|
details.orderCodeList = []; |
|
|
|
|
|
|
|
|
|
details.orderCodeList = [ |
|
|
|
|
...new Set([...details.orderCodeList, ...data.map(val => val.orderCode + ',' + val.waybillNo)]), |
|
|
|
|
]; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
onLoad(); |
|
|
|
|
watch( |
|
|
|
|
$route, |
|
|
|
|
() => { |
|
|
|
|
initPageInfo(); |
|
|
|
|
}, |
|
|
|
|
{ immediate: true } |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
/** 请求运单数据 */ |
|
|
|
|
const initOriginWarehouseOrder = async (params = {}) => { |
|
|
|
@ -722,20 +826,20 @@ const showdrawer = (_flag?: boolean, _type?: string) => {
|
|
|
|
|
const searchHide = async () => { |
|
|
|
|
details.search = !details.search; |
|
|
|
|
await nextTick(); |
|
|
|
|
setNodeHeight(details.listNode); |
|
|
|
|
setNodeHeight(document.querySelectorAll('.maboxhi'), '50vh', true); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 远程搜索承运商 */ |
|
|
|
|
const remoteMethod = value => { |
|
|
|
|
const remoteMethod = async value => { |
|
|
|
|
try { |
|
|
|
|
console.log('value :>> ', value); |
|
|
|
|
details.loadingObj.carrierName = true; |
|
|
|
|
// if (!value) return; |
|
|
|
|
const res = debounce(async () => { |
|
|
|
|
const res = await postFindCarrierByName({ carrierName: value }); |
|
|
|
|
const { code, data } = res.data; |
|
|
|
|
if (code !== 200) return; |
|
|
|
|
details.carrierNameOptions = data; |
|
|
|
|
}, 500); |
|
|
|
|
|
|
|
|
|
const res = await postFindCarrierByName({ carrierName: value }); |
|
|
|
|
const { code, data } = res.data; |
|
|
|
|
if (code !== 200) return; |
|
|
|
|
details.carrierNameOptions = data; |
|
|
|
|
} catch (error) { |
|
|
|
|
} finally { |
|
|
|
|
details.loadingObj.carrierName = false; |
|
|
|
@ -923,6 +1027,119 @@ const back = () => {
|
|
|
|
|
$router.push({ path: '/distribution/artery/TripartiteTransfer' }); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const addSubmit = async () => { |
|
|
|
|
const submitData = { |
|
|
|
|
...form.value, |
|
|
|
|
addCarsLoadLineList: [ |
|
|
|
|
{ |
|
|
|
|
nodeType: '1', |
|
|
|
|
nodeName: details.pageInfo.startWarehouseInfo.warehouseName, |
|
|
|
|
nodeId: details.pageInfo.startWarehouseInfo.warehouseId, |
|
|
|
|
linkAddress: details.pageInfo.startWarehouseInfo.linkAddress, |
|
|
|
|
linkMan: details.pageInfo.startWarehouseInfo.linkMan, |
|
|
|
|
linkMobile: details.pageInfo.startWarehouseInfo.linkMobile, |
|
|
|
|
sort: '1', |
|
|
|
|
|
|
|
|
|
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(','); |
|
|
|
|
|
|
|
|
|
if (submitData.carrierTimeStr) |
|
|
|
|
submitData.carrierTimeStr = dayjs(submitData.carrierTimeStr).format('YYYY-MM-DD'); |
|
|
|
|
if (submitData.receivingTimeStr) |
|
|
|
|
submitData.receivingTimeStr = dayjs(submitData.receivingTimeStr).format('YYYY-MM-DD'); |
|
|
|
|
console.log('submitData :>> ', submitData); |
|
|
|
|
|
|
|
|
|
const res = await postSaveNewTripartiteTransfer(submitData); |
|
|
|
|
const { code, msg } = res.data; |
|
|
|
|
if (code !== 200) return; |
|
|
|
|
ElMessage({ |
|
|
|
|
message: msg, |
|
|
|
|
type: 'success', |
|
|
|
|
}); |
|
|
|
|
back(); |
|
|
|
|
console.log('res :>> ', res); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const editSubmit = async () => { |
|
|
|
|
const submitData = { |
|
|
|
|
...form.value, |
|
|
|
|
addCarsLoadLineList: [ |
|
|
|
|
{ |
|
|
|
|
nodeType: '1', |
|
|
|
|
nodeName: details.pageInfo.startWarehouseInfo.warehouseName, |
|
|
|
|
nodeId: details.pageInfo.startWarehouseInfo.warehouseId, |
|
|
|
|
linkAddress: details.pageInfo.startWarehouseInfo.linkAddress, |
|
|
|
|
linkMan: details.pageInfo.startWarehouseInfo.linkMan, |
|
|
|
|
linkMobile: details.pageInfo.startWarehouseInfo.linkMobile, |
|
|
|
|
sort: '1', |
|
|
|
|
|
|
|
|
|
addList: [], |
|
|
|
|
removeList: [], |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
removeCarsLoadLineList: [], |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const _deepCloneArr = JSON.parse(JSON.stringify(details.MappingData)); |
|
|
|
|
|
|
|
|
|
for (const iterator of details.newData) { |
|
|
|
|
// 查看该运单是否已被添加在调度池 updateType 1: 编辑 2: 新增 |
|
|
|
|
if (iterator.carsOrderId) { |
|
|
|
|
for (let index = 0; index < _deepCloneArr.length; index++) { |
|
|
|
|
const element = _deepCloneArr[index]; |
|
|
|
|
|
|
|
|
|
if (element.carsOrderId === iterator.carsOrderId) { |
|
|
|
|
if (element.planNum !== iterator.planNum) { |
|
|
|
|
iterator.updateType = 1; |
|
|
|
|
submitData.addCarsLoadLineList[0].addList.push(iterator); |
|
|
|
|
} |
|
|
|
|
_deepCloneArr.splice(index, 1); |
|
|
|
|
// 退出循环 |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
iterator.nodeId = details.pageInfo.startWarehouseInfo.warehouseId; |
|
|
|
|
iterator.nodeName = details.pageInfo.startWarehouseInfo.warehouseName; |
|
|
|
|
iterator.finalNodeId = details.pageInfo.startWarehouseInfo.warehouseId; |
|
|
|
|
iterator.updateType = 2; |
|
|
|
|
iterator.totalNum = 20; |
|
|
|
|
submitData.addCarsLoadLineList[0].addList.push(iterator); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
submitData.addCarsLoadLineList[0].removeList = _deepCloneArr; |
|
|
|
|
|
|
|
|
|
for (const iterator of submitData.addCarsLoadLineList[0].removeList) { |
|
|
|
|
iterator.id = iterator.carsOrderId; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
submitData.customerType = submitData.customerType.join(','); |
|
|
|
|
|
|
|
|
|
console.log('submitData :>> ', submitData); |
|
|
|
|
|
|
|
|
|
const res = await postUpdateTripartiteTransfer(submitData); |
|
|
|
|
const { code, msg } = res.data; |
|
|
|
|
if (code !== 200) return; |
|
|
|
|
ElMessage({ |
|
|
|
|
message: msg, |
|
|
|
|
type: 'success', |
|
|
|
|
}); |
|
|
|
|
back(); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 提交 */ |
|
|
|
|
const handleSubmit = (formEl: FormInstance | undefined) => { |
|
|
|
|
if (!formEl) return; |
|
|
|
@ -933,48 +1150,8 @@ const handleSubmit = (formEl: FormInstance | undefined) => {
|
|
|
|
|
details.loadingObj.submitLoading = true; |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
const submitData = { |
|
|
|
|
...form.value, |
|
|
|
|
addCarsLoadLineList: [ |
|
|
|
|
{ |
|
|
|
|
nodeType: '1', |
|
|
|
|
nodeName: details.pageInfo.startWarehouseInfo.warehouseName, |
|
|
|
|
nodeId: details.pageInfo.startWarehouseInfo.warehouseId, |
|
|
|
|
linkAddress: details.pageInfo.startWarehouseInfo.linkAddress, |
|
|
|
|
linkMan: details.pageInfo.startWarehouseInfo.linkMan, |
|
|
|
|
linkMobile: details.pageInfo.startWarehouseInfo.linkMobile, |
|
|
|
|
sort: '1', |
|
|
|
|
|
|
|
|
|
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(','); |
|
|
|
|
|
|
|
|
|
if (submitData.carrierTimeStr) |
|
|
|
|
submitData.carrierTimeStr = dayjs(submitData.carrierTimeStr).format('YYYY-MM-DD'); |
|
|
|
|
if (submitData.receivingTimeStr) |
|
|
|
|
submitData.receivingTimeStr = dayjs(submitData.receivingTimeStr).format('YYYY-MM-DD'); |
|
|
|
|
console.log('submitData :>> ', submitData); |
|
|
|
|
|
|
|
|
|
const res = await postSaveNewTripartiteTransfer(submitData); |
|
|
|
|
const { code, msg } = res.data; |
|
|
|
|
if (code !== 200) return; |
|
|
|
|
ElMessage({ |
|
|
|
|
message: msg, |
|
|
|
|
type: 'success', |
|
|
|
|
}); |
|
|
|
|
back(); |
|
|
|
|
console.log('res :>> ', res); |
|
|
|
|
if ($route.query.type === 'add') await addSubmit(); |
|
|
|
|
else if ($route.query.type === 'edit') await editSubmit(); |
|
|
|
|
} catch (error) { |
|
|
|
|
console.log('error :>> ', error); |
|
|
|
|
} finally { |
|
|
|
@ -1140,4 +1317,8 @@ const handleSubmit = (formEl: FormInstance | undefined) => {
|
|
|
|
|
) { |
|
|
|
|
--el-color-danger: #f00; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.header_search > div { |
|
|
|
|
width: 40%; |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|