|
|
|
@ -229,7 +229,7 @@
|
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<!-- 表格 --> |
|
|
|
|
<tablecmt |
|
|
|
|
<!-- <tablecmt |
|
|
|
|
ref="oldColumnListNode" |
|
|
|
|
:columnList="details.columnList" |
|
|
|
|
:tableData="details.oldData" |
|
|
|
@ -244,9 +244,46 @@
|
|
|
|
|
<el-text @click="handleGoWaybillDetails(slotProps.scope)"> |
|
|
|
|
{{ slotProps.scope.row.waybillNo }} |
|
|
|
|
</el-text> |
|
|
|
|
</template></template |
|
|
|
|
</template> |
|
|
|
|
</template> |
|
|
|
|
</tablecmt> --> |
|
|
|
|
|
|
|
|
|
<div class="flex"> |
|
|
|
|
<el-tabs |
|
|
|
|
v-model="details.type" |
|
|
|
|
tab-position="left" |
|
|
|
|
style="height: 100%; width: fit-content; flex: none" |
|
|
|
|
@tab-click="() => inputsc('', { prop: 'aaa' })" |
|
|
|
|
class="demo-tabs" |
|
|
|
|
> |
|
|
|
|
</tablecmt> |
|
|
|
|
<el-tab-pane label="实际数据" name="real"></el-tab-pane> |
|
|
|
|
<el-tab-pane label="计划数据" name="plan"></el-tab-pane> |
|
|
|
|
</el-tabs> |
|
|
|
|
|
|
|
|
|
<div class="overflow"> |
|
|
|
|
<!-- 表格 --> |
|
|
|
|
<tablecmt |
|
|
|
|
class="w100" |
|
|
|
|
ref="oldColumnListNode" |
|
|
|
|
:columnList="details.columnList" |
|
|
|
|
:tableData="details.renderData" |
|
|
|
|
:loading="loadingObj.oldListLoading" |
|
|
|
|
@inputTxt="inputsc" |
|
|
|
|
@timeCheck="timesc" |
|
|
|
|
@selectCheck="selectsc" |
|
|
|
|
@selection="selectionChange" |
|
|
|
|
:arraySpanMethod="row => arraySpanMethod(row)" |
|
|
|
|
> |
|
|
|
|
<template #default="slotProps"> |
|
|
|
|
<template v-if="slotProps.scope.column.label === '运单号'"> |
|
|
|
|
<el-text @click="() => handleGoWayBillDetail(slotProps.scope)">{{ |
|
|
|
|
slotProps.scope.row.waybillNo |
|
|
|
|
}}</el-text> |
|
|
|
|
</template> |
|
|
|
|
</template> |
|
|
|
|
</tablecmt> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</el-tab-pane> |
|
|
|
|
|
|
|
|
|
<el-tab-pane label="操 作 日 志" name="tab2"> |
|
|
|
@ -306,23 +343,36 @@ import dayjs from 'dayjs';
|
|
|
|
|
import { mapGetters } from 'vuex'; |
|
|
|
|
/** 获取字典 */ |
|
|
|
|
import { getDictionaryBiz } from '@/api/system/dict'; |
|
|
|
|
import { downloadXls, computeNumber, setNodeHeight, debounce, deepClone } from '@/utils/util'; |
|
|
|
|
import { |
|
|
|
|
downloadXls, |
|
|
|
|
computeNumber, |
|
|
|
|
setNodeHeight, |
|
|
|
|
debounce, |
|
|
|
|
deepClone, |
|
|
|
|
handleClearTableQuery, |
|
|
|
|
handleInputQuery, |
|
|
|
|
handleSelectQuery, |
|
|
|
|
handleTimeQuery, |
|
|
|
|
handleFilterData, |
|
|
|
|
} from '@/utils/util'; |
|
|
|
|
import { columnList } from '@/option/distribution/addVehicleStowage'; |
|
|
|
|
import { |
|
|
|
|
postloadFindLoadInitData, |
|
|
|
|
postFindWarehouseListByName, |
|
|
|
|
postFindCarListByName, |
|
|
|
|
postFindDriverListByName, |
|
|
|
|
postFindCarrierByName, |
|
|
|
|
postFindUseOrderList, |
|
|
|
|
postSelectEditDetailByLoadId, |
|
|
|
|
} from '@/api/distribution/AddVehicleStowage'; |
|
|
|
|
import { postCarsLoadDetailInfo } from '@/api/distribution/VehicleStowageDetails.js'; |
|
|
|
|
import { postSaveNewTripartiteTransfer } from '@/api/distribution/addTripartiteTransfer.js'; |
|
|
|
|
import { postFindCarsLoadLogs } from '@/api/distribution/VehicleStowageDetails.js'; |
|
|
|
|
import type { FormInstance, FormRules } from 'element-plus'; |
|
|
|
|
import { useRouter, useRoute } from 'vue-router'; |
|
|
|
|
import { useStore } from 'vuex'; |
|
|
|
|
import { ElMessage } from 'element-plus'; |
|
|
|
|
|
|
|
|
|
/** 被合并的列 */ |
|
|
|
|
const mergeColumn = []; |
|
|
|
|
// 获取需要被合并的列 |
|
|
|
|
columnList.map(val => { |
|
|
|
|
if (val.isColumnMerge) mergeColumn.push(val.prop); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// 获取vuex仓库 |
|
|
|
|
const $store = useStore(); |
|
|
|
@ -380,7 +430,10 @@ const details = reactive<any>({
|
|
|
|
|
/** 运单池 */ |
|
|
|
|
columnList: deepClone(columnList), |
|
|
|
|
/** 列表数据 */ |
|
|
|
|
oldData: [], |
|
|
|
|
oldData: [], // 实际数据 |
|
|
|
|
planData: [], // 计划数据 |
|
|
|
|
/** 列表数据显示类型 -- 实际 | 计划 */ |
|
|
|
|
type: 'real' as 'real' | 'plan', |
|
|
|
|
/** 渲染数据 */ |
|
|
|
|
renderData: [], |
|
|
|
|
rules: { |
|
|
|
@ -564,25 +617,46 @@ const onLoad = debounce(async () => {
|
|
|
|
|
delete details.form.carrierTime; |
|
|
|
|
delete details.form.receivingTime; |
|
|
|
|
|
|
|
|
|
// data1.carsLoadWaybillInfoList.forEach(val => { |
|
|
|
|
// details.oldData.push( |
|
|
|
|
// ...val.carsLoadOrderInfoList.map((item, index) => { |
|
|
|
|
// item = { ...val, ...item }; |
|
|
|
|
// const _planArr: any = { ...val, ...item }; |
|
|
|
|
// delete item.carsLoadOrderInfoList; |
|
|
|
|
// delete item.carsLoadOrderInfoListPlan; |
|
|
|
|
|
|
|
|
|
// if (index === 0) item.mergeColumnIndex = val.carsLoadOrderInfoList.length; |
|
|
|
|
// else { |
|
|
|
|
// item.mergeColumnIndex = 0; |
|
|
|
|
// for (let value of mergeColumn) { |
|
|
|
|
// item[value] = ''; |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
// return item; |
|
|
|
|
// }) |
|
|
|
|
// ); |
|
|
|
|
// }); |
|
|
|
|
|
|
|
|
|
data1.carsLoadWaybillInfoList.forEach(val => { |
|
|
|
|
details.oldData.push( |
|
|
|
|
...val.carsLoadOrderInfoList.map((item, index) => { |
|
|
|
|
item = { ...val, ...item }; |
|
|
|
|
const _planArr: any = { ...val, ...item }; |
|
|
|
|
delete item.carsLoadOrderInfoList; |
|
|
|
|
delete item.carsLoadOrderInfoListPlan; |
|
|
|
|
return item; |
|
|
|
|
}) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
if (index === 0) item.mergeColumnIndex = val.carsLoadOrderInfoList.length; |
|
|
|
|
else { |
|
|
|
|
item.mergeColumnIndex = 0; |
|
|
|
|
for (let value of mergeColumn) { |
|
|
|
|
item[value] = ''; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
details.planData.push( |
|
|
|
|
...val.carsLoadOrderInfoListPlan.map((item, index) => { |
|
|
|
|
item = { ...val, ...item }; |
|
|
|
|
delete item.carsLoadOrderInfoList; |
|
|
|
|
delete item.carsLoadOrderInfoListPlan; |
|
|
|
|
return item; |
|
|
|
|
}) |
|
|
|
|
); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// await initOriginWarehouseOrder(); |
|
|
|
|
} catch (error) { |
|
|
|
|
console.log('error :>> ', error); |
|
|
|
@ -620,10 +694,12 @@ const searchChange = () => {
|
|
|
|
|
|
|
|
|
|
/** 清空表单 */ |
|
|
|
|
const searchReset = () => { |
|
|
|
|
details.query = {}; |
|
|
|
|
for (const key in details.query) { |
|
|
|
|
details.query[key] = {}; |
|
|
|
|
} |
|
|
|
|
details.stockupDate = []; |
|
|
|
|
details.page.pageNum = 1; |
|
|
|
|
onLoad(); |
|
|
|
|
handleClearTableQuery(details.columnList); |
|
|
|
|
handleData(); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// 清空复选框 |
|
|
|
@ -661,89 +737,83 @@ const remoteMethodDriver = async val => {
|
|
|
|
|
details.driverListByName = data; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 表格表头输入框搜索 */ |
|
|
|
|
const inputsc = (index, row) => { |
|
|
|
|
details.query[row.prop] = index; |
|
|
|
|
if (!index && index !== 0) delete details.query[row.prop]; |
|
|
|
|
onLoad(); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 表格表头时间选择 */ |
|
|
|
|
const timesc = (index, row) => { |
|
|
|
|
console.log(index, row); |
|
|
|
|
if (!!index) { |
|
|
|
|
index = dayjs(index).format('YYYY-MM-DD'); |
|
|
|
|
} |
|
|
|
|
details.query[row.prop] = index; |
|
|
|
|
if (!index) { |
|
|
|
|
delete details.query[row.prop]; |
|
|
|
|
/** 处理合并 */ |
|
|
|
|
const handleMerge = (startIndex: number, endIndex: number, data: {}) => { |
|
|
|
|
for (let index = startIndex; index < endIndex; index++) { |
|
|
|
|
const value = data[index]; |
|
|
|
|
|
|
|
|
|
if (index === startIndex) value.mergeColumnIndex = endIndex - startIndex; |
|
|
|
|
else { |
|
|
|
|
value.mergeColumnIndex = 0; |
|
|
|
|
for (let key of mergeColumn) { |
|
|
|
|
value[key] = ''; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
onLoad(); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 表格表头下拉框选择 */ |
|
|
|
|
const selectsc = (index, row) => { |
|
|
|
|
details.query[row.prop] = index; |
|
|
|
|
if (!index && index !== 0) delete details.query[row.prop]; |
|
|
|
|
if (row.prop === 'certificateTypeName') { |
|
|
|
|
details.query['certificateType'] = index; |
|
|
|
|
if (!index) delete details.query['certificateType']; |
|
|
|
|
/** 处理数据 */ |
|
|
|
|
const handleData = async () => { |
|
|
|
|
await nextTick(); |
|
|
|
|
|
|
|
|
|
const nowData = details.type === 'real' ? details.oldData : details.planData; |
|
|
|
|
|
|
|
|
|
// 深拷贝筛选后的数据 |
|
|
|
|
let _data = deepClone(handleFilterData(nowData, [], details.query)); |
|
|
|
|
|
|
|
|
|
console.log('_data :>> ', _data); |
|
|
|
|
|
|
|
|
|
if (_data.length === 0) return (details.renderData = []); |
|
|
|
|
|
|
|
|
|
// 合并起始索引 |
|
|
|
|
let mergeStartIndex = 0; |
|
|
|
|
// 比对值 |
|
|
|
|
let comparisonValue = _data[0].waybillNo; |
|
|
|
|
|
|
|
|
|
_data[0].mergeColumnIndex = 1; |
|
|
|
|
|
|
|
|
|
for (let index = 0; index < _data.length; index++) { |
|
|
|
|
const value = _data[index]; |
|
|
|
|
|
|
|
|
|
// 比对运单号是否相同 |
|
|
|
|
if (value.waybillNo !== comparisonValue) { |
|
|
|
|
// if (index === 1) mergeStartIndex = 1; |
|
|
|
|
comparisonValue = value.waybillNo; |
|
|
|
|
handleMerge(mergeStartIndex, index, _data); |
|
|
|
|
mergeStartIndex = index; |
|
|
|
|
// 最后一位特殊处理 |
|
|
|
|
} else if (index === _data.length - 1) handleMerge(mergeStartIndex, index + 1, _data); |
|
|
|
|
} |
|
|
|
|
onLoad(); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 表格表头复选框选择 */ |
|
|
|
|
const selectionChange = (list: any) => { |
|
|
|
|
details.selectionList = list; |
|
|
|
|
details.renderData = _data; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 表格表头输入框搜索 */ |
|
|
|
|
const newInputsc = (index, row) => { |
|
|
|
|
details.newQuery[row.prop] = index; |
|
|
|
|
onLoad(); |
|
|
|
|
const inputsc = (value, row) => { |
|
|
|
|
handleInputQuery(value, row, details.query.inputQuery, true); |
|
|
|
|
|
|
|
|
|
handleData(); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 表格表头时间选择 */ |
|
|
|
|
const newTimesc = (index, row) => { |
|
|
|
|
console.log(index, row); |
|
|
|
|
if (!!index) { |
|
|
|
|
index = dayjs(index).format('YYYY-MM-DD'); |
|
|
|
|
} |
|
|
|
|
details.newQuery[row.prop] = index; |
|
|
|
|
if (!index) { |
|
|
|
|
delete details.newQuery[row.prop]; |
|
|
|
|
} |
|
|
|
|
onLoad(); |
|
|
|
|
}; |
|
|
|
|
const timesc = (index, row) => { |
|
|
|
|
handleTimeQuery(index, row, details.query.timeQuery); |
|
|
|
|
|
|
|
|
|
/** 表格表头输入框搜索 */ |
|
|
|
|
const newBtnsc = () => {}; |
|
|
|
|
handleData(); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 表格表头下拉框选择 */ |
|
|
|
|
const newSelectsc = (index, row) => { |
|
|
|
|
details.newQuery[row.prop] = index; |
|
|
|
|
if (!index) delete details.newQuery[row.prop]; |
|
|
|
|
if (row.prop === 'certificateTypeName') { |
|
|
|
|
details.newQuery['certificateType'] = index; |
|
|
|
|
if (!index) delete details.newQuery['certificateType']; |
|
|
|
|
} |
|
|
|
|
onLoad(); |
|
|
|
|
}; |
|
|
|
|
const selectsc = (index, row) => { |
|
|
|
|
handleSelectQuery(index, row, details.query.selectQuery); |
|
|
|
|
|
|
|
|
|
/** 表格表头复选框选择 */ |
|
|
|
|
const newSelectionChange = (list: any) => { |
|
|
|
|
details.newSelectionList = list; |
|
|
|
|
handleData(); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 每页数量改变执行的回调 */ |
|
|
|
|
const sizeChange = (pageSize: number) => { |
|
|
|
|
details.page.pageSize = pageSize; |
|
|
|
|
onLoad(); |
|
|
|
|
/** 表格表头复选框选择 */ |
|
|
|
|
const selectionChange = (list: any) => { |
|
|
|
|
details.selectionList = list; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 页码改变执行的回调 */ |
|
|
|
|
const currentChange = () => {}; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 设置列表 -- 固定函数 |
|
|
|
|
* 弹窗的勾选回调,用于更改头部数组 |
|
|
|
@ -762,9 +832,6 @@ const setnewcolum = (newarr, headarr, type) => {
|
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 选择承运商 */ |
|
|
|
|
const carrierNameChange = () => {}; |
|
|
|
|
|
|
|
|
|
/** 司机改变时 */ |
|
|
|
|
const handleNameChange = () => { |
|
|
|
|
const findValue = form.value.driverName; |
|
|
|
@ -806,9 +873,19 @@ const handleCheckTab = e => {
|
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 查看运单 */ |
|
|
|
|
const handleGoWaybillDetails = ({ row }) => { |
|
|
|
|
console.log('row :>> ', row); |
|
|
|
|
/** 合并行 */ |
|
|
|
|
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]; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 跳转到运单详情 */ |
|
|
|
|
const handleGoWayBillDetail = ({ row }) => { |
|
|
|
|
if (row.waybillNo === '————') return ElMessage.warning('暂无运单号'); |
|
|
|
|
|
|
|
|
|
$router.push({ |
|
|
|
|
path: '/distribution/inventory/BookingNote', |
|
|
|
|
query: { |
|
|
|
@ -820,12 +897,6 @@ const handleGoWaybillDetails = ({ row }) => {
|
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 关闭页面 */ |
|
|
|
|
const back = () => { |
|
|
|
|
$store.commit('DEL_TAG_CURRENT'); |
|
|
|
|
$router.push({ path: '/distribution/artery/TripartiteTransfer' }); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
watch($route, () => { |
|
|
|
|
if ($route.path !== '/distribution/artery/TripartiteTransferDetails') return; |
|
|
|
|
onLoad(); |
|
|
|
@ -925,4 +996,8 @@ watch($route, () => {
|
|
|
|
|
background-color: #fff; |
|
|
|
|
color: #000 !important; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.overflow { |
|
|
|
|
overflow: hidden; |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|