|
|
|
@ -20,7 +20,7 @@
|
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="分摊方式"> |
|
|
|
|
<el-select |
|
|
|
|
readonly |
|
|
|
|
disabled |
|
|
|
|
:teleported="false" |
|
|
|
|
v-model="form.chargeType" |
|
|
|
|
class="m-2" |
|
|
|
@ -37,7 +37,7 @@
|
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="直发商家"> |
|
|
|
|
<el-select |
|
|
|
|
readonly |
|
|
|
|
disabled |
|
|
|
|
:teleported="false" |
|
|
|
|
v-model="form.payMethod" |
|
|
|
|
class="m-2" |
|
|
|
@ -54,7 +54,7 @@
|
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="装车方式"> |
|
|
|
|
<el-select |
|
|
|
|
readonly |
|
|
|
|
disabled |
|
|
|
|
:teleported="false" |
|
|
|
|
v-model="form.loadingType" |
|
|
|
|
class="m-2" |
|
|
|
@ -180,33 +180,9 @@
|
|
|
|
|
@timeCheck="timesc" |
|
|
|
|
@selectCheck="selectsc" |
|
|
|
|
@selection="selectionChange" |
|
|
|
|
:arraySpanMethod=" |
|
|
|
|
row => { |
|
|
|
|
console.log('row :>> ', row); |
|
|
|
|
if (row.columnIndex === 0) { |
|
|
|
|
if (row.rowIndex === 0) return [2, 1]; |
|
|
|
|
else if (row.rowIndex === 1) return [0, 0]; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
" |
|
|
|
|
:arraySpanMethod="row => arraySpanMethod(row)" |
|
|
|
|
> |
|
|
|
|
</tablecmt> |
|
|
|
|
<!-- 分页模块 --> |
|
|
|
|
<div class="avue-crud__pagination flex-c-sb" style="width: 100%"> |
|
|
|
|
<el-pagination |
|
|
|
|
style="zoom: 0.9" |
|
|
|
|
align="right" |
|
|
|
|
background |
|
|
|
|
@size-change="sizeChange" |
|
|
|
|
@current-change="currentChange" |
|
|
|
|
:current-page="oldPage.pageNum" |
|
|
|
|
:page-sizes="[30, 50, 80, 120]" |
|
|
|
|
:page-size="oldPage.pageSize" |
|
|
|
|
layout="total, sizes, prev, pager, next, jumper" |
|
|
|
|
:total="oldPage.total" |
|
|
|
|
> |
|
|
|
|
</el-pagination> |
|
|
|
|
</div> |
|
|
|
|
</el-tab-pane> |
|
|
|
|
|
|
|
|
|
<el-tab-pane label="日 志 跟 踪" name="tab2"> |
|
|
|
@ -355,11 +331,18 @@ import {
|
|
|
|
|
postSelectEditDetailByLoadId, |
|
|
|
|
} from '@/api/distribution/AddVehicleStowage'; |
|
|
|
|
import { postCarsLoadDetailInfo } from '@/api/distribution/VehicleStowageDetails.js'; |
|
|
|
|
import { postSaveNewTripartiteTransfer } from '@/api/distribution/addTripartiteTransfer.js'; |
|
|
|
|
import type { FormInstance, FormRules } from 'element-plus'; |
|
|
|
|
import { useRouter, useRoute } from 'vue-router'; |
|
|
|
|
import { useStore } from 'vuex'; |
|
|
|
|
|
|
|
|
|
/** 被合并的列 */ |
|
|
|
|
const mergeColumn = []; |
|
|
|
|
// 获取需要被合并的列 |
|
|
|
|
detailsColumnList.map(val => { |
|
|
|
|
if (val.isColumnMerge) mergeColumn.push(val.prop); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
console.log('mergeColumn :>> ', mergeColumn); |
|
|
|
|
|
|
|
|
|
// 获取节点信息列表, 除开节点名称 |
|
|
|
|
const nodeInfokeys = nodeInfoColumnList.slice(1).map(val => val.prop); |
|
|
|
|
|
|
|
|
@ -641,93 +624,82 @@ onMounted(() => {
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
/** 设置节点费用禁用 */ |
|
|
|
|
const handleEditForbidden = (_arr: any[]) => { |
|
|
|
|
if (_arr.length === 0) return; |
|
|
|
|
|
|
|
|
|
// 获取第一项 (第一项和后续项禁用项不同, 分开设置) |
|
|
|
|
const _firstChild = _arr[0]; |
|
|
|
|
_firstChild.blackList = ['unloadCost', 'unloadOtherCost']; |
|
|
|
|
|
|
|
|
|
const _otherList = _arr.slice(1); |
|
|
|
|
|
|
|
|
|
// 其它项的白名单 |
|
|
|
|
const _otherwhiteList = ['tollFee', 'reachTransportCost']; |
|
|
|
|
// 通过白名单筛选出黑名单 |
|
|
|
|
const _otherBlackList = nodeInfokeys.filter(val => _otherwhiteList.indexOf(val) === -1); |
|
|
|
|
// 设置其他项的黑名单; |
|
|
|
|
for (let item of _otherList) { |
|
|
|
|
item.blackList = _otherBlackList; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return [_firstChild, ..._otherList]; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 请求页面数据 */ |
|
|
|
|
const onLoad = async () => { |
|
|
|
|
// const res = postCarsLoadDetailInfo({ loadId: $route.query.loadId }); |
|
|
|
|
// console.log('res :>> ', res); |
|
|
|
|
// const res = await postloadFindLoadInitData(); |
|
|
|
|
// 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.endWarehouseName = data.startWarehouseInfo.warehouseName; |
|
|
|
|
// details.form.endWarehouseId = data.startWarehouseInfo.warehouseId; |
|
|
|
|
|
|
|
|
|
// initOriginWarehouseOrder(); |
|
|
|
|
details.loadId = $route.query.loadId; |
|
|
|
|
const res = await postSelectEditDetailByLoadId({ loadId: details.loadId }); |
|
|
|
|
console.log('res :>> ', res); |
|
|
|
|
const { code, data } = res.data; |
|
|
|
|
details.nodeInfoData = data.allCarsLineList; |
|
|
|
|
|
|
|
|
|
details.form = data.carsLoadEntity; |
|
|
|
|
details.form.driverNameAndMobile = details.form.driverName + '/' + details.form.driverMobile; |
|
|
|
|
|
|
|
|
|
details.pageInfo.loadType = data.loadType; |
|
|
|
|
details.pageInfo.chargeType = data.chargeType; |
|
|
|
|
|
|
|
|
|
details.pageInfo.startWarehouseInfo.warehouseId = data.carsLoadEntity.startWarehouseId; |
|
|
|
|
details.pageInfo.startWarehouseInfo.warehouseName = data.carsLoadEntity.startWarehouseName; |
|
|
|
|
// 请求节点 |
|
|
|
|
if (Number(details.pageType) === 2) initOriginWarehouseOrder(); |
|
|
|
|
|
|
|
|
|
// 设置页面列表高度 |
|
|
|
|
setTabelHeight(); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
onLoad(); |
|
|
|
|
|
|
|
|
|
/** 请求运单数据 */ |
|
|
|
|
const initOriginWarehouseOrder = async (params = {}) => { |
|
|
|
|
try { |
|
|
|
|
details.loadingObj.oldListLoading = true; |
|
|
|
|
const submitData = { |
|
|
|
|
...details.page, |
|
|
|
|
loadId: details.pageInfo.startWarehouseInfo.warehouseId, |
|
|
|
|
orderCodes: details.orderCodeList, |
|
|
|
|
loadId: details.loadId, |
|
|
|
|
...details.query, |
|
|
|
|
...params, |
|
|
|
|
}; |
|
|
|
|
if (submitData.orderCodes.length === 0) delete submitData.orderCodes; |
|
|
|
|
const res = await postFindAllOrderList(submitData); |
|
|
|
|
|
|
|
|
|
const res = await postCarsLoadDetailInfo(submitData); |
|
|
|
|
console.log('res :>> ', res); |
|
|
|
|
const { code, data } = res.data; |
|
|
|
|
if (code !== 200) return; |
|
|
|
|
details.oldData = data.records; |
|
|
|
|
|
|
|
|
|
details.nodeInfoData = data.carsLoadLineList; |
|
|
|
|
details.oldData = []; |
|
|
|
|
data.carsLoadWaybillInfoList.forEach(val => { |
|
|
|
|
details.oldData.push( |
|
|
|
|
...val.carsLoadOrderInfoList.map((item, index) => { |
|
|
|
|
item = { ...item, ...val }; |
|
|
|
|
delete item.carsLoadOrderInfoList; |
|
|
|
|
if (index === 0) item.mergeColumnIndex = val.carsLoadOrderInfoList.length; |
|
|
|
|
else { |
|
|
|
|
item.mergeColumnIndex = 0; |
|
|
|
|
for (let value of mergeColumn) { |
|
|
|
|
item[value] = ''; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return item; |
|
|
|
|
}) |
|
|
|
|
); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
details.form = data; |
|
|
|
|
details.form.driverNameAndMobile = details.form.driverName + '/' + details.form.driverMobile; |
|
|
|
|
details.form.assistantNameAndMobile = |
|
|
|
|
details.form.assistantName + '/' + details.form.assistantMobile; |
|
|
|
|
|
|
|
|
|
details.page.total = data.total; |
|
|
|
|
} catch (error) { |
|
|
|
|
console.log('error :>> ', error); |
|
|
|
|
} finally { |
|
|
|
|
// 等待列表渲染完成 |
|
|
|
|
await nextTick(); |
|
|
|
|
details.loadingObj.oldListLoading = false; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 请求页面数据 */ |
|
|
|
|
const onLoad = async () => { |
|
|
|
|
details.loadId = $route.query.loadId; |
|
|
|
|
// 请求页面数据 |
|
|
|
|
initOriginWarehouseOrder(); |
|
|
|
|
|
|
|
|
|
// 请求下拉数据 |
|
|
|
|
postSelectEditDetailByLoadId({ loadId: details.loadId }).then(res => { |
|
|
|
|
const { code, data } = res.data; |
|
|
|
|
|
|
|
|
|
if (code !== 200) return; |
|
|
|
|
|
|
|
|
|
details.pageInfo.loadType = data.loadType; |
|
|
|
|
details.pageInfo.chargeType = data.chargeType; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// details.pageInfo.startWarehouseInfo.warehouseId = data.carsLoadEntity.startWarehouseId; |
|
|
|
|
// details.pageInfo.startWarehouseInfo.warehouseName = data.carsLoadEntity.startWarehouseName; |
|
|
|
|
// 请求节点 |
|
|
|
|
|
|
|
|
|
// 设置页面列表高度 |
|
|
|
|
setTabelHeight(); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
onLoad(); |
|
|
|
|
|
|
|
|
|
/** 搜索 */ |
|
|
|
|
const searchChange = () => { |
|
|
|
|
initOriginWarehouseOrder(); |
|
|
|
@ -741,12 +713,6 @@ const searchReset = () => {
|
|
|
|
|
initOriginWarehouseOrder(); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// 清空复选框 |
|
|
|
|
const clearSelectionList = () => { |
|
|
|
|
details.selectionList = []; |
|
|
|
|
oldColumnListNode.value.handleCheckSelect([]); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 展开列表控件 */ |
|
|
|
|
const showdrawer = (_flag?: boolean, _type?: number) => { |
|
|
|
|
switch (_type) { |
|
|
|
@ -766,26 +732,6 @@ const searchHide = async () => {
|
|
|
|
|
// setNodeHeight(details.listNode); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 远程搜索承运商 */ |
|
|
|
|
const remoteMethod = value => { |
|
|
|
|
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 remoteMethodDriver = async val => { |
|
|
|
|
const res = await postFindDriverListByName({ driverName: val }); |
|
|
|
|
console.log('res :>> ', res); |
|
|
|
|
const { code, data } = res.data; |
|
|
|
|
if (code !== 200) return; |
|
|
|
|
details.driverListByName = data; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 表格表头输入框搜索 */ |
|
|
|
|
const inputsc = (index, row) => { |
|
|
|
|
details.query[row.prop] = index; |
|
|
|
@ -821,17 +767,6 @@ const selectionChange = (list: any) => {
|
|
|
|
|
details.selectionList = list; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 每页数量改变执行的回调 */ |
|
|
|
|
const sizeChange = (pageSize: number) => { |
|
|
|
|
details.page.pageSize = pageSize; |
|
|
|
|
initOriginWarehouseOrder(); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 页码改变执行的回调 */ |
|
|
|
|
const currentChange = (pageNum: number) => { |
|
|
|
|
initOriginWarehouseOrder(); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 设置列表 -- 固定函数 |
|
|
|
|
* 弹窗的勾选回调,用于更改头部数组 |
|
|
|
@ -863,11 +798,12 @@ const handleNameChange = () => {
|
|
|
|
|
form.value.driverMobile = _value.driverPhone; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const arraySpanMethod = (row, column, rowIndex, columnIndex) => { |
|
|
|
|
console.log('row :>> ', row); |
|
|
|
|
console.log('column :>> ', column); |
|
|
|
|
console.log('rowIndex :>> ', rowIndex); |
|
|
|
|
console.log('columnIndex :>> ', columnIndex); |
|
|
|
|
const arraySpanMethod = (row: any) => { |
|
|
|
|
const { column } = row; |
|
|
|
|
if (mergeColumn.indexOf(column.property) !== -1) { |
|
|
|
|
if (row.row.mergeColumnIndex !== 0) return [row.row.mergeColumnIndex, 1]; |
|
|
|
|
else return [0, 0]; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 关闭页面 */ |
|
|
|
|