Browse Source

修复部分bug,修复列表合并,新增三方显示计划数据

dev-xx
qb 10 months ago
parent
commit
4704f33a0c
  1. 11
      src/option/distribution/addVehicleStowage.js
  2. 30
      src/option/distribution/directGoMarketDetails.js
  3. 9
      src/utils/util.js
  4. 271
      src/views/distribution/artery/TripartiteTransferDetails.vue
  5. 5
      src/views/distribution/artery/VehicleArrivalManagement.vue
  6. 7
      src/views/distribution/artery/VehicleStowage.vue
  7. 185
      src/views/distribution/artery/VehicleStowageDetails.vue
  8. 4
      src/views/distribution/artery/directGoMarketDetails.vue

11
src/option/distribution/addVehicleStowage.js

@ -838,6 +838,17 @@ export const detailsColumnList = [
isshowSummary: true,
sortable: true,
},
{
prop: 'createTime',
label: '开单时间',
type: 2,
values: '',
width: '130',
checkarr: [],
fixed: false,
isshowSummary: true,
sortable: true,
},
// {
// prop: 'totalNum',
// label: '开单单价',

30
src/option/distribution/directGoMarketDetails.js

@ -283,6 +283,36 @@ export const detailsColumnList = [
fixed: false,
sortable: true,
},
{
prop: 'signUserName',
label: '签收人',
type: 1,
values: '',
width: '130',
checkarr: [],
fixed: false,
sortable: true,
},
{
prop: 'signTime',
label: '签收时间',
type: 1,
values: '',
width: '130',
checkarr: [],
fixed: false,
sortable: true,
},
{
prop: 'unloadTime',
label: '卸车时间',
type: 1,
values: '',
width: '130',
checkarr: [],
fixed: false,
sortable: true,
},
{
prop: 'remark',
label: '备注',

9
src/utils/util.js

@ -835,7 +835,9 @@ export const handleFilterData = (data, renderData, { inputQuery, selectQuery, ti
// 筛选输入框
for (const key in inputQuery) {
if (!_flag) break;
if (!inputQuery[key].test(element[key])) {
const inputValue = inputQuery[key];
if (getObjType(inputValue) !== 'regExp') continue;
if (!inputValue.test(element[key])) {
_flag = false;
break;
}
@ -868,6 +870,9 @@ export const handleFilterData = (data, renderData, { inputQuery, selectQuery, ti
} else if (type === 'array') {
_startTime = Date.parse(value[0]);
_endTime = Date.parse(value[1]) + 1000 * 60 * 60 * 24 - 1;
} else if (type === 'date') {
_startTime = Date.parse(value);
_endTime = Date.parse(value) + 1000 * 60 * 60 * 24 - 1;
} else continue;
const _time = Date.parse(element[key.replace('Arr', '')]);
@ -881,5 +886,5 @@ export const handleFilterData = (data, renderData, { inputQuery, selectQuery, ti
if (_flag) newData.push(element);
}
renderData.value = newData;
return (renderData.value = newData);
};

271
src/views/distribution/artery/TripartiteTransferDetails.vue

@ -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>

5
src/views/distribution/artery/VehicleArrivalManagement.vue

@ -87,9 +87,10 @@
<el-button type="primary" icon="el-icon-delete" @click="handleUnloadByLoadId(1)">
中途到达卸车
</el-button>
<el-button type="primary" icon="el-icon-delete" @click="handleShowComparativeStatement()">
<!-- 对比报表 -->
<!-- <el-button type="primary" icon="el-icon-delete" @click="handleShowComparativeStatement()">
对比报表
</el-button>
</el-button> -->
<el-button type="primary" icon="el-icon-document" @click="handleUnloadByLoadId(2)">
终点到达卸车
</el-button>

7
src/views/distribution/artery/VehicleStowage.vue

@ -77,9 +77,10 @@
<el-button type="primary" icon="el-icon-delete" @click="handleCancelCarsLoad"
>取消配载</el-button
>
<el-button type="primary" icon="el-icon-document" @click="handleComparativeStatement"
>对比报表</el-button
>
<!-- 对比报表 -->
<!-- <el-button type="primary" icon="el-icon-document" @click="handleComparativeStatement">
对比报表
</el-button> -->
</div>
<!-- 头部右侧按钮模块 -->
<div class="avue-crud__right">

185
src/views/distribution/artery/VehicleStowageDetails.vue

@ -149,7 +149,7 @@
>
<el-form-item class="el-times" label="开单时间">
<el-date-picker
v-model="stockupDate"
v-model="details.query.timeQuery.createTime"
type="daterange"
unlink-panels
range-separator="-"
@ -161,10 +161,10 @@
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="searchReset()"
<el-button type="primary" icon="el-icon-search" @click="handleData"
> </el-button
>
<el-button icon="el-icon-delete" @click="searchReset()">重置</el-button>
<el-button icon="el-icon-delete" @click="searchReset">重置</el-button>
</el-form-item>
</el-form>
</div>
@ -396,7 +396,6 @@
</el-dialog>
<edittablehead
@setcolum="setnewcolum"
@closce="showdrawer"
:drawerShow="drawerShow"
:columnList="details.detailsColumnList"
@ -412,7 +411,18 @@ 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 { detailsColumnList, nodeInfoColumnList } from '@/option/distribution/addVehicleStowage';
import { detailsColumnList as abnormalColumn } from '@/option/distribution/TripartiteTransfer';
@ -465,7 +475,14 @@ const details = reactive<any>({
/** 是否开启搜索 */
search: true,
/** 表格搜索条件 */
query: {},
query: {
/** 输入框搜索 */
inputQuery: {},
/** 下拉框搜索 */
selectQuery: {},
/** 时间搜索 */
timeQuery: {},
},
/** 时间快捷选择设置 */
shortcuts: [
{
@ -638,14 +655,6 @@ const initOriginWarehouseOrder = async (params = {}) => {
item = { ...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;
})
);
@ -655,14 +664,6 @@ const initOriginWarehouseOrder = async (params = {}) => {
item = { ...val, ...item };
delete item.carsLoadOrderInfoList;
delete item.carsLoadOrderInfoListPlan;
// if (index === 0) item.mergeColumnIndex = val.carsLoadOrderInfoListPlan.length;
// else {
// item.mergeColumnIndex = 0;
// for (let value of mergeColumn) {
// item[value] = '';
// }
// }
return item;
})
);
@ -673,7 +674,9 @@ const initOriginWarehouseOrder = async (params = {}) => {
details.form = data;
details.form.driverNameAndMobile = details.form.driverName + '/' + details.form.driverMobile;
details.form.assistantNameAndMobile =
details.form.assistantName + '/' + details.form.assistantMobile;
details.form.assistantName && details.form.assistantMobile
? details.form.assistantName + '/' + details.form.assistantMobile
: '';
} catch (error) {
console.log('error :>> ', error);
} finally {
@ -766,9 +769,12 @@ const searchChange = () => {
/** 清空表单 */
const searchReset = () => {
details.query = {};
for (const key in details.query) {
details.query[key] = {};
}
details.stockupDate = [];
initOriginWarehouseOrder();
handleClearTableQuery(details.detailsColumnList);
handleData();
};
/** 展开列表控件 */
@ -786,14 +792,9 @@ const showdrawer = (_flag?: boolean, _type?: number) => {
/** 是否开启搜索区 */
const searchHide = async () => {
details.search = !details.search;
// await nextTick();
// setNodeHeight(details.listNode);
};
const handleMerge = (startIndex: number, endIndex: number, data: {}) => {
console.log('startIndex :>> ', startIndex);
console.log('endIndex :>> ', endIndex);
for (let index = startIndex; index < endIndex; index++) {
const value = data[index];
@ -805,97 +806,63 @@ const handleMerge = (startIndex: number, endIndex: number, data: {}) => {
}
}
}
console.log('data :>> ', data);
};
let timer;
/** 表格表头输入框搜索 */
const inputsc = async (value, row) => {
details.loadingObj.oldListLoading = true;
/** 处理数据 */
const handleData = async () => {
await nextTick();
try {
//
const reg = new RegExp('^' + value);
details.query[row.prop] = reg;
const nowData = details.type === 'real' ? details.oldData : details.planData;
const nowData = details.type === 'real' ? details.oldData : details.planData;
//
let _data = deepClone(handleFilterData(nowData, [], details.query));
if (value === '') delete details.query[row.prop];
console.log('_data :>> ', _data);
let _data = [];
if (_data.length === 0) return (details.renderData = []);
if (Object.keys(details.query).length === 0) _data = deepClone(nowData);
// ,
else
_data = deepClone(
nowData.filter(value => {
let _flag = true;
for (let key in details.query) {
if (!details.query[key].test(value[key])) _flag = false;
if (!_flag) break;
}
//
let mergeStartIndex = 0;
//
let comparisonValue = _data[0].waybillNo;
return _flag;
})
);
_data[0].mergeColumnIndex = 1;
//
let mergeStartIndex = 0;
//
let comparisonValue = _data[0].waybillNo;
for (let index = 0; index < _data.length; index++) {
const value = _data[index];
_data[0].mergeColumnIndex = 1;
//
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);
}
for (let index = 0; index < _data.length; index++) {
const value = _data[index];
details.renderData = _data;
};
//
if (value.waybillNo !== comparisonValue) {
if (index === 1) mergeStartIndex = 1;
comparisonValue = value.waybillNo;
handleMerge(mergeStartIndex, index + 1, _data);
mergeStartIndex = index + 1;
//
} else if (index === _data.length - 1) handleMerge(mergeStartIndex, index + 1, _data);
}
/** 表格表头输入框搜索 */
const inputsc = (value, row) => {
handleInputQuery(value, row, details.query.inputQuery, true);
details.renderData = _data;
} catch (error) {
console.log('error :>> ', error);
} finally {
timer = setTimeout(() => {
details.loadingObj.oldListLoading = false;
clearTimeout(timer);
timer = null;
}, 500);
}
handleData();
};
/** 表格表头时间选择 */
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];
}
initOriginWarehouseOrder();
handleTimeQuery(index, row, details.query.timeQuery);
handleData();
};
/** 表格表头下拉框选择 */
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'];
}
initOriginWarehouseOrder();
handleSelectQuery(index, row, details.query.selectQuery);
handleData();
};
/** 表格表头复选框选择 */
@ -903,28 +870,8 @@ const selectionChange = (list: any) => {
details.selectionList = list;
};
/**
* 设置列表 -- 固定函数
* 弹窗的勾选回调用于更改头部数组
* 固定搭配只需要更换 columnList
* */
const setnewcolum = (newarr, headarr, type) => {
if (type == 1) {
details.detailsColumnList = newarr;
functions.setStorage(window.location.pathname + 'checkList', headarr);
} else if (type == 2) {
details.detailsColumnList = newarr;
functions.setStorage(window.location.pathname + 'flexList', headarr);
} else if (type == 3) {
details.detailsColumnList = newarr;
functions.setStorage(window.location.pathname + 'sortlist', headarr);
}
};
/** 合并行 */
const arraySpanMethod = (row: any) => {
// if (details.type === 'plan') return;
const { column } = row;
if (mergeColumn.indexOf(column.property) !== -1) {
if (row.row.mergeColumnIndex !== 0) return [row.row.mergeColumnIndex, 1];

4
src/views/distribution/artery/directGoMarketDetails.vue

@ -722,7 +722,7 @@ const sizeChange = (pageSize: number, type) => {
//
case 2:
details.detailsInfo.page.pageSize = pageSize;
onLoadDetails(details.page);
onLoadDetails();
break;
//
@ -739,7 +739,7 @@ const currentChange = (pageNum: number, type) => {
//
case 2:
details.detailsInfo.page.pageNum = pageNum;
onLoadDetails(details.page);
onLoadDetails();
break;
//

Loading…
Cancel
Save