Browse Source

新增车辆配载导出,修复表格宽度设置保存,优化三方显示

dev-xx
qb 5 months ago
parent
commit
4d307d3744
  1. 12
      src/api/distribution/VehicleArrivalManagement.js
  2. 12
      src/api/distribution/VehicleStowage.js
  3. 23
      src/components/MyPrint/MyPrint.vue
  4. 6
      src/components/tablecmt/tablecmt.vue
  5. 3
      src/utils/print.js
  6. 17
      src/views/distribution/artery/TripartiteTransfer.vue
  7. 80
      src/views/distribution/artery/VehicleArrivalManagement.vue
  8. 79
      src/views/distribution/artery/VehicleStowage.vue
  9. 2
      src/views/distribution/artery/abnormalList.vue
  10. 41
      src/views/distribution/inventory/distributionStockArticleDetails.vue

12
src/api/distribution/VehicleArrivalManagement.js

@ -81,4 +81,14 @@ export const postFindLinePhoto = data => {
});
};
// /logpm-trunkline/carsLoad/unloadByLoadId
/**
* 到车数据导出
*/
export const postExportCarsPageList = data => {
return request({
url: '/api/logpm-trunkline/carsLoad/exportCarsPageList',
method: 'post',
data,
responseType: 'blob',
});
};

12
src/api/distribution/VehicleStowage.js

@ -158,3 +158,15 @@ export const postFindWarehouseUnloadReport = data => {
data,
});
};
/**
* 车辆配载数据导出
*/
export const postExportLoadCarsPageList = data => {
return request({
url: '/api/logpm-trunkline/carsLoad/exportLoadCarsPageList',
method: 'post',
data,
responseType: 'blob',
});
};

23
src/components/MyPrint/MyPrint.vue

@ -19,7 +19,7 @@
</template>
<script setup lang="ts">
import { defineProps, computed, ref } from 'vue';
import { defineProps, computed, ref, nextTick } from 'vue';
import print from '@/utils/print';
import { ElMessage, ElMessageBox } from 'element-plus';
import { getObjType } from '@/utils/util';
@ -52,8 +52,8 @@ const props = defineProps({
},
type: {
type: String,
default: 'deliveryPrint'
}
default: 'deliveryPrint',
},
});
const $emit = defineEmits(['update:modelValue']);
@ -152,9 +152,20 @@ const handleExport = () => {
const printTemplate = () => {
if (props.printFn) return props.printFn();
const printNode = document.querySelectorAll('.printCode > div > div');
console.log('printNode :>> ', printNode);
print(printNode, props.type);
const nodeArr = document.querySelectorAll('.printSmallText');
for (let i = 0; i < nodeArr.length; i++) {
const val = nodeArr[i];
val.style.fontSize = '0.5rem';
val.style.lineHeight = '0.7rem';
}
const timer = setTimeout(() => {
const printNode = document.querySelectorAll('.printCode > div > div');
console.log('printNode :>> ', printNode);
print(printNode, props.type);
clearTimeout(timer);
}, 500);
};
</script>

6
src/components/tablecmt/tablecmt.vue

@ -222,6 +222,7 @@ import {
import type { PropType } from 'vue';
import { computeNumber } from '@/utils/util.js';
import { useRoute } from 'vue-router';
import { postSaveTableSeting } from '@/api/basic/table';
const $route = useRoute();
@ -735,7 +736,10 @@ const handleWidthChange = (newWidth, oldWidth, column, event) => {
console.log('props.columnListName :>> ', props.columnListName);
functions.setStorage($route.fullPath + (props.columnListName || 'columnList'), props.columnList);
postSaveTableSeting({
tableKey: $route.path + props.columnListName,
tableSetCongig: JSON.stringify(props.columnList),
});
};
defineExpose({ handleCheckSelect, handleClearSelect });

3
src/utils/print.js

@ -25,7 +25,8 @@ const handleDeliveryPrint = (LODOP, templateData) => {
// LODOP.SET_PRINT_STYLE('FontColor', '#000000');
// // 设置打印整宽且不变形
LODOP.SET_PRINT_MODE('PRINT_PAGE_PERCENT', '100%');
LODOP.SET_PRINT_PAGESIZE(1, 2160, 1396.5, '');
// LODOP.SET_PRINT_PAGESIZE(1, 2160, 1396.5, '');
LODOP.SET_PRINT_PAGESIZE(1, 240 + 'mm', 139.7 + 'mm', '');
// // 设置打印后自动关闭
LODOP.SET_PRINT_MODE('AUTO_CLOSE_PREWINDOW', 1);

17
src/views/distribution/artery/TripartiteTransfer.vue

@ -184,6 +184,11 @@
@btnCheck="btnsc"
@selectCheck="selectsc"
@selection="selectionChange"
:tableRowClassName="
row => {
if (row.loadStatus === '10') return 'err_row';
}
"
>
<template #default="slotProps">
<template v-if="slotProps.scope.column.label === '中转批次号'">
@ -1595,4 +1600,16 @@ const handleExportTruckLoadingDetail = () => {
max-height: 85vh;
}
}
:deep(.el-table tr) {
&.err_row {
.tabculconte,
.el-tooltip,
.el-button--text,
.el-text {
// color: #e54b4b !important;
color: #f00 !important;
}
}
}
</style>

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

@ -174,6 +174,9 @@
>
卸车报告
</el-button>
<!-- 导出 -->
<el-button type="primary" icon="Download" @click="handleExport"> </el-button>
</div>
<!-- 头部右侧按钮模块 -->
<div class="avue-crud__right">
@ -670,6 +673,7 @@ import {
postloadCancelArriveCarByLoadId,
postUnloadByLoadId,
postUnloadByLoadIdBefore,
postExportCarsPageList,
} from '@/api/distribution/VehicleArrivalManagement';
import {
postStartCarByLoadId,
@ -915,28 +919,34 @@ const onLoad = debounce(async (params = {}) => {
// loading
details.loadingObj.list = true;
const submitData = { ...details.query, ...params };
const { startArr, createTimeArr, arriveTimeArr } = details.query;
//
if (getObjType(startArr) === 'array' && startArr.length > 0) {
params.startDate = startArr[0];
params.endDate = startArr[1];
submitData.startDate = startArr[0];
submitData.endDate = startArr[1];
}
//
if (getObjType(arriveTimeArr) === 'array' && arriveTimeArr.length > 0) {
params.arriveTimeStartStr = arriveTimeArr[0];
params.arriveTimeEndStr = arriveTimeArr[1];
submitData.arriveTimeStartStr = arriveTimeArr[0];
submitData.arriveTimeEndStr = arriveTimeArr[1];
}
//
if (getObjType(createTimeArr) === 'array' && createTimeArr.length > 0) {
params.createTimeStartStr = createTimeArr[0];
params.createTimeEndStr = createTimeArr[1];
submitData.createTimeStartStr = createTimeArr[0];
submitData.createTimeEndStr = createTimeArr[1];
}
delete submitData.startArr;
delete submitData.createTimeArr;
delete submitData.arriveTimeArr;
//
const res = await postloadArriveCarsPageList(details.page, { ...details.query, ...params });
const res = await postloadArriveCarsPageList(details.page, submitData);
const { code, data } = res.data;
if (code !== 200) return;
details.data = data.records;
@ -1685,6 +1695,62 @@ const handleExportTruckLoadingDetail = () => {
/** 配载图片显示 */
const handleShowVehicleImgs = async ({ row }) => {};
/** 导出 */
const handleExport = () => {
ElMessageBox.confirm('确定导出吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(async () => {
try {
details.loadingObj.pageLoading = true;
const submitData = { ...details.query };
const { startArr, createTimeArr, arriveTimeArr } = details.query;
//
if (getObjType(startArr) === 'array' && startArr.length > 0) {
submitData.startDate = startArr[0];
submitData.endDate = startArr[1];
}
//
if (getObjType(arriveTimeArr) === 'array' && arriveTimeArr.length > 0) {
submitData.arriveTimeStartStr = arriveTimeArr[0];
submitData.arriveTimeEndStr = arriveTimeArr[1];
}
//
if (getObjType(createTimeArr) === 'array' && createTimeArr.length > 0) {
submitData.createTimeStartStr = createTimeArr[0];
submitData.createTimeEndStr = createTimeArr[1];
}
delete submitData.startArr;
delete submitData.createTimeArr;
delete submitData.arriveTimeArr;
if (details.selectionList.length > 0)
submitData.ids = details.selectionList.map(val => val.id).join(',');
const res = await postExportCarsPageList(submitData);
console.log('res :>> ', res);
const { status, data } = res;
if (status !== 200) return ElMessage.error({ message: '导出失败' });
console.log('data :>> ', data);
downloadXls(data, `到车管理数据 - ${dateNow()}.xlsx`);
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.pageLoading = false;
}
});
};
</script>
<style scoped lang="scss">

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

@ -155,6 +155,9 @@
<!-- <el-button type="primary" icon="el-icon-document" @click="handleComparativeStatement">
对比报表
</el-button> -->
<!-- 导出 -->
<el-button type="primary" icon="Download" @click="handleExport"> </el-button>
</div>
<!-- 头部右侧按钮模块 -->
<div class="avue-crud__right">
@ -635,6 +638,7 @@ import {
postRemoveCarsLoadScan,
postManualLoadingloadId,
postFindLoadingListData,
postExportLoadCarsPageList,
} from '@/api/distribution/VehicleStowage';
import { getListName } from '@/api/basicdata/basicdataVehicle';
import { useStore } from 'vuex';
@ -839,28 +843,33 @@ const onLoad = debounce(async (params = {}) => {
try {
// loading
details.loadingObj.list = true;
const submitData = { ...details.query, ...params };
const { startArr, createTimeArr, arriveTimeArr } = details.query;
//
if (getObjType(startArr) === 'array' && startArr.length > 0) {
params.startDate = startArr[0];
params.endDate = startArr[1];
submitData.startDate = startArr[0];
submitData.endDate = startArr[1];
}
//
if (getObjType(arriveTimeArr) === 'array' && arriveTimeArr.length > 0) {
params.arriveTimeStartStr = arriveTimeArr[0];
params.arriveTimeEndStr = arriveTimeArr[1];
submitData.arriveTimeStartStr = arriveTimeArr[0];
submitData.arriveTimeEndStr = arriveTimeArr[1];
}
//
if (getObjType(createTimeArr) === 'array' && createTimeArr.length > 0) {
params.createTimeStartStr = createTimeArr[0];
params.createTimeEndStr = createTimeArr[1];
submitData.createTimeStartStr = createTimeArr[0];
submitData.createTimeEndStr = createTimeArr[1];
}
delete submitData.startArr;
delete submitData.createTimeArr;
delete submitData.arriveTimeArr;
//
const res = await postloadCarsPageList(details.page, { ...details.query, ...params });
const res = await postloadCarsPageList(details.page, submitData);
const { code, data } = res.data;
if (code !== 200) return;
details.data = data.records;
@ -1555,6 +1564,62 @@ const handleShowVehicleImgs = async ({ row }) => {
},
});
};
/** 导出 */
const handleExport = () => {
ElMessageBox.confirm('确定导出吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(async () => {
try {
details.loadingObj.pageLoading = true;
const submitData = { ...details.query };
const { startArr, createTimeArr, arriveTimeArr } = details.query;
//
if (getObjType(startArr) === 'array' && startArr.length > 0) {
submitData.startDate = startArr[0];
submitData.endDate = startArr[1];
}
//
if (getObjType(arriveTimeArr) === 'array' && arriveTimeArr.length > 0) {
submitData.arriveTimeStartStr = arriveTimeArr[0];
submitData.arriveTimeEndStr = arriveTimeArr[1];
}
//
if (getObjType(createTimeArr) === 'array' && createTimeArr.length > 0) {
submitData.createTimeStartStr = createTimeArr[0];
submitData.createTimeEndStr = createTimeArr[1];
}
delete submitData.startArr;
delete submitData.createTimeArr;
delete submitData.arriveTimeArr;
if (details.selectionList.length > 0)
submitData.ids = details.selectionList.map(val => val.id).join(',');
const res = await postExportLoadCarsPageList(submitData);
console.log('res :>> ', res);
const { status, data } = res;
if (status !== 200) return ElMessage.error({ message: '导出失败' });
console.log('data :>> ', data);
downloadXls(data, `车辆配载数据 - ${dateNow()}.xlsx`);
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.pageLoading = false;
}
});
};
</script>
<style scoped lang="scss">

2
src/views/distribution/artery/abnormalList.vue

@ -560,6 +560,8 @@ const handleAbnormal = (dealType, title) => {
const handleBatchAbnormarl = () => {
if (details.selectionList.length === 0) return ElMessage.warning('请选择需要处理的异常数据');
if (details.selectionList.length > 30) return ElMessage.warning('最大数暂时支持30条')
const _abnormalType = details.selectionList[0].abnormalType;
for (let i = 0; i < details.selectionList.length; i++) {

41
src/views/distribution/inventory/distributionStockArticleDetails.vue

@ -276,7 +276,12 @@
</el-form-item>
<el-form-item label="物料单位" prop="orderCode">
<!-- <el-input v-model="formMaterial.unit" placeholder="请输入物料单位"/>-->
<el-select v-model="formMaterial.materialUnit" clearable placeholder="请选择单位" disabled>
<el-select
v-model="formMaterial.materialUnit"
clearable
placeholder="请选择单位"
disabled
>
<el-option
v-for="item in logpmUnit"
:key="item.dictKey"
@ -287,7 +292,7 @@
</el-select>
</el-form-item>
<el-form-item label="SKU" prop="mallName">
<el-input v-model="formMaterial.sku" placeholder="请输入SKU" disabled/>
<el-input v-model="formMaterial.sku" placeholder="请输入SKU" disabled />
</el-form-item>
<el-form-item label="规格">
<el-input
@ -334,7 +339,7 @@
</template>
</el-dialog>
<el-dialog title="二维码" :visible.sync="dialogVisible" width="780px" v-model="dialogVisible">
<!-- <el-dialog title="二维码" :visible.sync="dialogVisible" width="780px" v-model="dialogVisible">
<div class="print_QRCode">
<div v-html="html"></div>
</div>
@ -342,9 +347,11 @@
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" icon="Printer" @click="printTemplate"> </el-button>
</span>
</el-dialog>
</el-dialog> -->
</div>
<MyPrint :html="html" v-model="dialogVisible" title="二维码" type="titlePrint" />
<el-dialog v-model="waybillrecipient" title="修改运单收货人">
<el-form
v-loading="loadingwaybillrecipient"
@ -425,6 +432,7 @@ import dayjs from 'dayjs';
import print from '@/utils/print';
import { ElMessage } from 'element-plus';
import { hanleTextLineFeed, handleClearTableQuery } from '@/utils/util';
import MyPrint from '@/components/MyPrint/MyPrint.vue';
export default {
name: '/distribution/inventory/distributionStockArticleDetails',
data() {
@ -505,7 +513,7 @@ export default {
loadingObj: {
pageLoading: false,
tableLoading: false,
packtableLoading:false,
packtableLoading: false,
},
pageId: '',
};
@ -523,10 +531,10 @@ export default {
this.page.currentPage = 1;
this.pageId = this.$route.query.id;
this.onLoad(this.page);
console.log(this.$route.query,'this.$route.query');
if(this.$route.query.isZero ==1){
console.log(this.$route.query, 'this.$route.query');
if (this.$route.query.isZero == 1) {
this.onLoadOwn(this.page);
}else{
} else {
this.package();
}
}
@ -637,7 +645,7 @@ export default {
} else {
this.queryPage[row.prop] = index;
}
this.package()
this.package();
},
timesc(index, row) {
console.log(index, row);
@ -648,12 +656,12 @@ export default {
if (!index) {
delete this.queryPage[row.prop];
}
this.package()
this.package();
},
inputsc(index, row) {
this.queryPage[row.prop] = index;
if (!index) delete this.queryPage[row.prop];
this.package()
this.package();
},
printTemplate() {
const orderNodeList = document.querySelectorAll('.print_QRCode>div>div');
@ -973,8 +981,8 @@ export default {
handleClearTableQuery(zerocolumnList);
this.onLoadOwn();
},
packsearchChange(){
this.package()
packsearchChange() {
this.package();
},
searchReset() {
this.query = {};
@ -1236,11 +1244,11 @@ export default {
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
this.package()
this.package();
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
this.package()
this.package();
},
onLoad(page, params = {}) {
try {
@ -1301,7 +1309,7 @@ export default {
current: this.page.currentPage,
size: this.page.pageSize,
stockArticleId: this.$route.query.id,
... this.queryPage,
...this.queryPage,
};
let _res = await getPackageList(_data);
console.log(_res, '包件信息');
@ -1315,7 +1323,6 @@ export default {
item.materialCodeMaintainStatus = item.materialId ? '已维护' : '未维护';
}
this.page.total = data.total;
} catch (e) {
console.log(e, 'error');
} finally {

Loading…
Cancel
Save