Browse Source

干线新增成本分摊

dev-xx
qb 1 year ago
parent
commit
d538273edf
  1. 22
      src/api/distribution/VehicleStowageDetails.js
  2. 2
      src/option/distribution/VehicleStowage.js
  3. 22
      src/option/waybill/TemporaryStorageList.js
  4. 17
      src/utils/print.js
  5. 12
      src/views/distribution/artery/VehicleArrivalManagement.vue
  6. 146
      src/views/distribution/artery/VehicleStowageDetails.vue
  7. 2
      src/views/distribution/artery/directGoMarket.vue
  8. 6
      src/views/distribution/artery/truckLoadingDetails.vue

22
src/api/distribution/VehicleStowageDetails.js

@ -65,3 +65,25 @@ export const postFindFinanceList = data => {
data,
});
};
/**
* 查询是否存在异常数据
*/
export const postFindCostShareBefore = data => {
return request({
url: '/api/logpm-trunkline/carsLoad/findCostShareBefore',
method: 'post',
data,
});
};
/**
* 成本分摊
*/
export const postCostShareByLoadId = data => {
return request({
url: '/api/logpm-trunkline/carsLoad/costShareByLoadId',
method: 'post',
data,
});
};

2
src/option/distribution/VehicleStowage.js

@ -774,7 +774,7 @@ export const packageColumnList = [
head: false,
},
{
prop: 'scanCode',
prop: 'orderPackageCode',
label: '包条码',
width: '130',
type: 2,

22
src/option/waybill/TemporaryStorageList.js

@ -85,6 +85,17 @@ export const columnList = [
fixed: false,
sortable: true,
},
{
prop: 'totalNum',
label: '数量',
type: 1,
values: '',
width: '130',
checkarr: [],
fixed: false,
sortable: true,
isshowSummary: true,
},
{
prop: 'senderFactory',
label: '发货单位',
@ -165,17 +176,6 @@ export const columnList = [
fixed: false,
sortable: true,
},
{
prop: 'totalNum',
label: '数量',
type: 1,
values: '',
width: '130',
checkarr: [],
fixed: false,
sortable: true,
isshowSummary: true,
},
{
prop: 'trainNumber',
label: '客户车次',

17
src/utils/print.js

@ -1,5 +1,5 @@
import { getLodop } from '@/utils/LodopFuncs';
import hwyPrintNew from '@/utils/print/index';
import hwyPrintNew from '@/utils/print/index';
/**
* 根据传入的元素列表进行打印
* @param nodeList 元素节点列表
@ -7,23 +7,23 @@ import hwyPrintNew from '@/utils/print/index';
const print = nodeList => {
// 直接调用时使用默认节点列表
if (!nodeList) nodeList = document.querySelectorAll('.el-dialog__body>div>div>div');
// 初始化打印实例
let LODOP = getLodop();
// 当列表内没有元素时, 退出函数
if (nodeList.length === 0) return;
LODOP.PRINT_INITA(1, 1, 900, 660, '测试预览功能');
LODOP.SET_PRINT_MODE('WINDOW_DEFPRINTER', 'Godex G500');
LODOP.SET_PRINT_STYLEA(0, 'TextNeatRow', true); //允许标点溢出,且英文单词拆开
// LODOP.SET_PRINT_STYLE('FontColor', '#000000');
// // 设置打印整宽且不变形
LODOP.SET_PRINT_MODE('PRINT_PAGE_PERCENT', 'Auto-Width');
// // 设置打印后自动关闭
LODOP.SET_PRINT_MODE('AUTO_CLOSE_PREWINDOW', 1);
// 循环列表内元素并打印
nodeList.forEach(orderNode => {
console.log(orderNode, 'orderNode');
let templateData = orderNode.innerHTML;
@ -35,20 +35,17 @@ const print = nodeList => {
// LODOP.PREVIEW(); //预览(预览打印无脚标)
};
const newPrint = nodeName =>{
if(nodeName) return hwyPrintNew(nodeName)
const newPrint = nodeName => {
if (nodeName) return hwyPrintNew(nodeName);
// const nodeList = document.querySelectorAll('.el-dialog__body>div>div>div')
// for (const iterator of nodeList) {
// //$Print(iterator)
// console.log(iterator, 'iterator');
// }
hwyPrintNew('.el-dialog__body>div>div>div');
}
};
export default print;

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

@ -195,7 +195,13 @@
>编辑</el-text
>
<el-dropdown>
<el-dropdown
v-if="
Mydata.id === slotProps.scope.row.nowWarehouseId &&
Number(slotProps.scope.row.loadingType) === 1 &&
Number(slotProps.scope.row.loadStatus) === 20
"
>
<span class="el-dropdown-link">
<el-text>
更多 <el-icon class="el-icon--right"><arrow-down /></el-icon
@ -203,7 +209,7 @@
</span>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item v-if="Mydata.id === slotProps.scope.row.nowWarehouseId">
<!-- <el-dropdown-item v-if="Mydata.id === slotProps.scope.row.nowWarehouseId">
<el-text @click="handleNodeCost(slotProps.scope)"> 节点费用 </el-text>
</el-dropdown-item>
@ -217,7 +223,7 @@
<el-text @click="handleDirectGoMarketDetails(slotProps.scope)">
签收详情
</el-text>
</el-dropdown-item>
</el-dropdown-item> -->
<el-dropdown-item
v-if="

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

@ -161,7 +161,7 @@
<!-- 控件 -->
<div style="margin-bottom: 10px" class="flex-c-sb">
<div>
<el-button type="primary" icon="Promotion" @click="searchReset()">
<el-button type="primary" icon="Promotion" @click="handleCostApportionments">
成本分摊确认
</el-button>
</div>
@ -308,9 +308,8 @@
</div>
</basic-container>
<!-- 打印二维码 -->
<!-- 添加运输合同图片 -->
<el-dialog
class="el-dialog-QRCode"
title="添加运输合同图片"
:visible.sync="details.popUpShow.addImgVisible"
width="780px"
@ -332,6 +331,35 @@
</span>
</el-dialog>
<!-- 处理异常数据 -->
<el-dialog
title="异常数据"
width="70vw"
v-model="details.popUpShow.abnormalVisible"
:align-center="true"
>
<div class="flex">
<el-button type="primary" icon="Delete" @click="handleBatchDelete"> </el-button>
</div>
<tablecmt
class="abnormalTableRef mt10"
style="height: 60vh"
:columnList="details.abnormalColumn"
:tableData="details.abnormalData"
:loading="loadingObj.abnormalLoading"
ref="abnormalTableRef"
@selection="list => (details.abnormalSelectionList = list)"
:isShowRefresh="false"
>
<template #default="slotProps"> </template>
</tablecmt>
<div class="flex-c-c mt10">
<el-button @click="details.popUpShow.abnormalVisible = false"> </el-button>
<el-button type="primary" @click="handleSubmitAbnormal">成本分摊</el-button>
</div>
</el-dialog>
<edittablehead
@setcolum="setnewcolum"
@closce="showdrawer"
@ -340,7 +368,7 @@
>
</edittablehead>
</template>
<!-- activeTab: 'tab1' -->
<script setup lang="ts">
import { ref, reactive, toRefs, computed, onMounted, nextTick, watch } from 'vue';
import functions from '@/utils/functions';
@ -348,8 +376,10 @@ import dayjs from 'dayjs';
import { mapGetters } from 'vuex';
/** 获取字典 */
import { getDictionaryBiz } from '@/api/system/dict';
import { downloadXls, computeNumber, setNodeHeight, debounce } from '@/utils/util';
import { downloadXls, computeNumber, setNodeHeight, debounce, deepClone } from '@/utils/util';
import { detailsColumnList, nodeInfoColumnList } from '@/option/distribution/addVehicleStowage';
import { detailsColumnList as abnormalColumn } from '@/option/distribution/TripartiteTransfer';
import { getToken } from '@/utils/auth';
import {
@ -358,10 +388,13 @@ import {
postFindContractList,
postAddContractByLoadId,
postFindFinanceList,
postFindCostShareBefore,
postCostShareByLoadId,
} from '@/api/distribution/VehicleStowageDetails.js';
import { postRemoveCarsLoadScan } from '@/api/distribution/truckLoadingDetails';
import { useRouter, useRoute } from 'vue-router';
import { useStore } from 'vuex';
import { ElMessage } from 'element-plus';
import { ElMessage, ElMessageBox } from 'element-plus';
/** 被合并的列 */
const mergeColumn = [];
@ -385,6 +418,8 @@ const ruleFormRef = ref();
//
const oldColumnListNode = ref();
const abnormalTableRef = ref();
//
const nodeInfoRef = ref();
@ -444,6 +479,8 @@ const details = reactive<any>({
oldListLoading: false,
/** 页面loading */
pageLoading: false,
/** 异常列表 */
abnormalLoading: false,
},
/** 列表复选框选中的数据 */
selectionList: [],
@ -451,12 +488,10 @@ const details = reactive<any>({
drawerShow: false,
/** 弹出层显示 */
popUpShow: {
/** 装车详情 */
truckLoadingDetailVisited: false,
/** 零担补录 */
transferVisited: false,
/** 运输图片添加弹窗 */
addImgVisible: false,
/** 异常数据处理 */
abnormalVisible: false,
},
/** 列表Dom节点 */
listNode: '',
@ -500,6 +535,12 @@ const details = reactive<any>({
carriageContractList: [],
/** 上传图片list */
updateImgList: [],
/** 异常数据 */
abnormalData: [],
/** 异常列表表头 */
abnormalColumn: deepClone(abnormalColumn),
/** 异常被选中数据 */
abnormalSelectionList: [],
});
const {
@ -903,6 +944,91 @@ const back = () => {
$router.push({ path: '/distribution/artery/TripartiteTransfer' });
};
/** 成本分摊 */
const handleCostApportionments = async () => {
ElMessageBox.confirm('确定要进行费用分摊吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(async () => {
try {
details.loadingObj.pageLoading = true;
const submitData = {
loadId: $route.query.loadId,
};
const res = await postFindCostShareBefore(submitData);
const { code, data, msg } = res.data;
if (code !== 200) return;
// ,
if (data.noDataLoadScanList.length === 0) {
const response = await postCostShareByLoadId(submitData);
const { code, data, msg } = response.data;
if (code !== 200) return;
ElMessage.success(msg);
} else {
// ,
details.popUpShow.abnormalVisible = true;
details.abnormalData = data.noDataLoadScanList;
await nextTick();
setNodeHeight(abnormalTableRef.value.$el, '60vh');
setTabelHeight();
}
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.pageLoading = false;
}
});
};
const handleSubmitAbnormal = () => {
if (details.abnormalData.length === 0)
return ElMessage.warning('还存在异常数据, 请先处理完异常数据');
handleCostApportionments();
};
/** 异常数据批量删除 */
const handleBatchDelete = () => {
if (details.abnormalSelectionList.length === 0) return ElMessage.warning('请选择要删除的数据');
ElMessageBox.confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(async () => {
try {
details.loadingObj.abnormalLoading = true;
const res = await postRemoveCarsLoadScan({
carsLoadScanIds: details.abnormalSelectionList.map(val => val.id).join(','),
});
if (res.data.code !== 200) return;
ElMessage.success(res.data.msg);
const submitData = {
loadId: $route.query.loadId,
};
const response = await postFindCostShareBefore(submitData);
const { code, data } = response.data;
if (code !== 200) return;
details.abnormalData = data.noDataLoadScanList;
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.abnormalLoading = false;
}
});
};
watch(
() => $route.query,
() => {

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

@ -315,7 +315,7 @@ const initNewData = debounce(async function (params = {}) {
details.loadingObj.newListLoading = true;
const submitData = {
...details.newPage,
...details.oldQuery,
...details.newQuery,
loadId: details.pageInfo.loadId,
...params,
};

6
src/views/distribution/artery/truckLoadingDetails.vue

@ -182,8 +182,8 @@
</div>
<span slot="footer" class="dialog-footer flex-c-c mt10">
<!-- <el-button type="primary" @click="ddd"> </el-button>-->
<el-button type="primary" @click="printTemplate"> </el-button>
<el-button @click="details.popUpShow.QRCodeVisible = false"> </el-button>
<el-button @click="details.popUpShow.QRCodeVisible = false"> </el-button>
<el-button type="primary" icon="Printer" @click="printTemplate"> </el-button>
</span>
</el-dialog>
@ -1075,7 +1075,7 @@ const handleBatchBarcode = async () => {
/** 打印包条码 */
const printTemplate = () => {
const orderNodeList = document.querySelectorAll('.el-dialog-QRCode .el-dialog__body>div>div>div');
const orderNodeList = document.querySelectorAll('.el-dialog-QRCode-container>div>div');
print(orderNodeList);
};

Loading…
Cancel
Save