This commit is contained in:
linfso 2025-06-17 11:20:33 +08:00
parent 5a950e40db
commit 7aa3bac278
4 changed files with 203 additions and 38 deletions

View File

@ -26,6 +26,16 @@ export function addEmisTmsCostFee(data) {
}) })
} }
// 草稿下单
export function draftSubmitTmsCostFee(data) {
return request({
url: '/emis/emisTmsCostFee/draftSubmitTmsCostFee',
method: 'post',
data: data
})
}
// 重新计算运单利润 // 重新计算运单利润
export function reCalcSplitCostFee(costNo) { export function reCalcSplitCostFee(costNo) {
return request({ return request({

View File

@ -155,7 +155,7 @@
<el-table-column label="运输方式" align="center" prop="transType" width="80" :show-overflow-tooltip="true"> <el-table-column label="运输方式" align="center" prop="transType" width="80" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<div style="display: inline-flex;"> <div style="display: inline-flex;">
<dict-tag v-if="scope.row.feeItemRel&&scope.row.transType!=''" :options="dict.type.emis_biz_shipping_method" :value="scope.row.transType.split(',')" :isNeedListClass="false" sepChar=","/> <dict-tag v-if="scope.row.transType&&scope.row.transType!=''" :options="dict.type.emis_biz_shipping_method" :value="scope.row.transType.split(',')" :isNeedListClass="false" sepChar=","/>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>

View File

@ -1,26 +1,6 @@
<template> <template>
<XdPageContainer class="app-container"> <XdPageContainer class="app-container">
<div slot="pageHeader"></div> <div slot="pageHeader">
<XdTable
slot="pageContent"
slot-scope="slotProps"
:height="(slotProps.contentHeight)+'px'"
storageName="BatchImportCostFee_main1"
ref="multipleTable"
:row-class-name="tableRowClassName"
v-loading="loading"
border
size="mini"
:data="orderList"
:showSearch.sync="showSearch"
:queryParams="queryParams"
:total="total"
@queryTable="getList"
@selection-change="handleSelectionChange"
@sort-change="handleSortChange"
>
<div slot="toolbar"> <div slot="toolbar">
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
@ -47,6 +27,27 @@
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
</div>
<el-table
slot="pageContent"
slot-scope="slotProps"
:height="(slotProps.contentHeight)+'px'"
storageName="BatchImportCostFee_main1"
ref="multipleTable"
:row-class-name="tableRowClassName"
v-loading="loading"
border
size="mini"
:data="orderList"
:showSearch.sync="showSearch"
:queryParams="queryParams"
:total="total"
@queryTable="getList"
@selection-change="handleSelectionChange"
@sort-change="handleSortChange"
>
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column :label="$t('状态')" align="center" prop="uploadStatus" min-width="80" :show-overflow-tooltip="true" > <el-table-column :label="$t('状态')" align="center" prop="uploadStatus" min-width="80" :show-overflow-tooltip="true" >
@ -64,16 +65,31 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('线路名称')" align="center" prop="lineName" min-width="120" />
<el-table-column
v-for="item in dynamicCol"
:key="item.prop"
align="center"
:prop="item.prop"
min-width="100"
:show-overflow-tooltip="true"
:label="item.label"
/>
<!-- <el-table-column v-for="(item, index) in dynamicCol" :key="index" :label="item.label" :prop="item.prop">
</el-table-column> -->
<!-- <el-table-column :label="$t('线路名称')" align="center" prop="lineName" min-width="120" />
<el-table-column :label="$t('产品名称')" align="center" prop="productTypeName" min-width="200" /> <el-table-column :label="$t('产品名称')" align="center" prop="productTypeName" min-width="200" />
<el-table-column :label="$t('起始网点')" align="center" prop="startSiteName" min-width="100" /> <el-table-column :label="$t('起始网点')" align="center" prop="startSiteName" min-width="100" />
<el-table-column :label="$t('下一网点')" align="center" prop="nextSiteName" min-width="100" /> <el-table-column :label="$t('下一网点')" align="center" prop="nextSiteName" min-width="100" />
<el-table-column :label="$t('节点负责人')" align="center" prop="manager" min-width="100" /> <el-table-column :label="$t('节点负责人')" align="center" prop="manager" min-width="100" />
<el-table-column :label="$t('供应商')" align="center" prop="supplierName" min-width="180" /> <el-table-column :label="$t('供应商')" align="center" prop="supplierName" min-width="180" />
<el-table-column :label="$t('生效时间')" align="center" prop="startDate" min-width="100" /> <el-table-column :label="$t('生效时间')" align="center" prop="startDate" min-width="100" />
<el-table-column :label="$t('失效时间')" align="center" prop="endDate" min-width="100" /> <el-table-column :label="$t('失效时间')" align="center" prop="endDate" min-width="100" /> -->
</XdTable> </el-table>
<el-dialog title="上传文件" :visible.sync="openUploadForm" width="50%" v-dialogDrag :destroy-on-close="true" :close-on-click-modal="false" append-to-body> <el-dialog title="上传文件" :visible.sync="openUploadForm" width="50%" v-dialogDrag :destroy-on-close="true" :close-on-click-modal="false" append-to-body>
<el-row :gutter="0"> <el-row :gutter="0">
@ -114,15 +130,21 @@
</template> </template>
<script> <script>
import { draftSubmitRule } from "@/api/emis/emisTransPlanRule"; import { draftSubmitTmsCostFee } from "@/api/emis/emisTmsCostFee";
import { listEmisTmsCostFee, getEmisTmsCostFee, delEmisTmsCostFee, addEmisTmsCostFee, updateEmisTmsCostFee } from "@/api/emis/emisTmsCostFee";
import {listEmisSettleSubBill} from "@/api/emis/emisSettleSubBill";
import { listEmisTmsSiteBatchDtl} from "@/api/emis/emisTmsSiteBatchDtl";
import { listEmisTmsSiteBatch} from "@/api/emis/emisTmsSiteBatch";
import { listSimpleEmisSupplier } from "@/api/emis/emisSupplier";
import {timeDiffTime,timeFormat} from '@/utils/dateUtils' import {timeDiffTime,timeFormat} from '@/utils/dateUtils'
import { formatSearchStr,deepClone } from '@/utils/index' import { formatSearchStr,deepClone } from '@/utils/index'
import XLSX from 'xlsx' import XLSX from 'xlsx'
import {parseExcelTime } from "@/utils/custom"; import {parseExcelTime } from "@/utils/custom";
import { forEach } from "lodash";
export default { export default {
name: "BatchImportTransPlanRule", name: "BatchImportCostFee",
components: { components: {
}, },
@ -150,6 +172,9 @@ export default {
selectionList:[], selectionList:[],
selectionIndexList: [], selectionIndexList: [],
// 动态费用列表
dynamicCol:[],
form:{}, form:{},
rules:{}, rules:{},
@ -160,7 +185,7 @@ export default {
fileList:[], fileList:[],
// 查询参数 // 查询参数
queryParams: { queryParams: {
lineCode: null, lineCode: null,
productType: null, productType: null,
startSiteCode: null, startSiteCode: null,
nextSiteCode: null, nextSiteCode: null,
@ -221,6 +246,7 @@ export default {
return false return false
}, },
readerData(rawFile) { readerData(rawFile) {
const that=this;
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const reader = new FileReader() const reader = new FileReader()
reader.onload = e => { reader.onload = e => {
@ -238,6 +264,17 @@ export default {
console.log(results); console.log(results);
that.dynamicCol=[];
for (var key in results[0]) {
that.dynamicCol.push(
{
label:key,
prop:key
}
);
}
console.log("===>dynamicCol=>",that.dynamicCol);
this.batchImportData(results); this.batchImportData(results);
resolve() resolve()
@ -275,19 +312,33 @@ export default {
const element = results[index] const element = results[index]
// tst // tst
let rowIndex=element['__rowNum__'] let rowIndex=element['__rowNum__']
// lineName: element['线路名称'],
// productTypeName: element['产品名称'],
// startSiteName: element['起始网点'],
// nextSiteName: element['下一网点'],
// manager: element['线路负责人'],
// supplierName: element['供应商名称'],
// startDate: parseExcelTime(element['生效时间'],false),
// endDate: parseExcelTime(element['失效时间'],false),
// remark: element['备注'],
let orderData={ let orderData={
lineName: element['线路名称'],
productTypeName: element['产品名称'],
startSiteName: element['起始网点'],
nextSiteName: element['下一网点'],
manager: element['线路负责人'],
supplierName: element['供应商名称'],
startDate: parseExcelTime(element['生效时间'],false),
endDate: parseExcelTime(element['失效时间'],false),
remark: element['备注'],
uploadStatus: 0, uploadStatus: 0,
errorInfo:'', errorInfo:'',
} }
// console.log("===kkkk=>item=>",item)
for (const key in element) {
if (element.hasOwnProperty(key)) { // 可选:过滤继承的属性
console.log(`${key}: ${element[key]}`);
this.$set(orderData,key,element[key]) ;
}
}
console.log("===orderData=>",orderData)
this.tmpDataList.push(orderData); this.tmpDataList.push(orderData);
} }
@ -308,8 +359,93 @@ export default {
if(this.selectionList&&this.selectionList.length>0){ if(this.selectionList&&this.selectionList.length>0){
for(let i=0;i<this.selectionList.length;i++){ for(let i=0;i<this.selectionList.length;i++){
let orderItem=this.selectionList[i]; let orderItem=this.selectionList[i];
let res=await draftSubmitRule(orderItem)
// 数据转化为标准提交格式
let submitOrderForm={
batchNo:null,
feeType: null,
splitType: null,
transType: null,
transSignNo: null,
supplierCode: null,
supplierName: null,
sendPlace: null,
destPlace: null,
costFee: null,
tradeDate: null,
sendPieceSum: null,
pieceNumber: null,
totalWeight: null,
totalVolume: null,
blConfirmCenter: null,
realPieceNumber: null,
realTotalWeight: null,
realTotalVolume: null,
confirmCenterDate: null,
confirmCenterNote: null,
confirmCenterManCode: null,
confirmCenterCode: null,
blConfirmSite: null,
confirmSiteDate: null,
confirmSiteManCode: null,
confirmSiteNote: null,
confirmSiteCode: null,
remark: null,
billRelList:null,
feeItemList:[],
};
submitOrderForm.batchNo=orderItem['批次号'];
// this.$set(submitOrderForm,'batchNo',orderItem['批次号']);
try{
// 获取批次信息
let qParam = {
pageNum:1,
pageSize:1,
batchNo:orderItem['批次号'],
};
let resBatch=await listEmisTmsSiteBatch(qParam);
if(resBatch&&resBatch.code==200){
let batchItem=resBatch.rows[0];
submitOrderForm.realTotalWeight=batchItem.transWeight;
submitOrderForm.realPieceNumber=batchItem.packNum;
submitOrderForm.transType=batchItem.transType;
submitOrderForm.transSignNo=batchItem.carNo;
submitOrderForm.sendPlace=batchItem.startSiteName;
submitOrderForm.destPlace=batchItem.nextSiteName;
submitOrderForm.supplierCode=batchItem.supplierCode;
submitOrderForm.supplierName=batchItem.supplierName;
submitOrderForm.tradeDate= this.parseTime(batchItem.etd);
submitOrderForm.costName=batchItem.batchName;
// this.form.costFee=item.startSiteName;
submitOrderFormsendPieceSum=batchItem.totalWaybillQty;
submitOrderForm.pieceNumber=batchItem.pieceNumber;
submitOrderForm.totalWeight=batchItem.totalWeight;
submitOrderForm.totalVolume=batchItem.totalVolume;
// 获取供应商
// 转化费用类型
}else{
orderItem.uploadStatus=-1;
orderItem.errorInfo='批次号不存在';
continue;
}
}catch(e){
orderItem.uploadStatus=-1;
orderItem.errorInfo='数据异常';
continue;
}
let res=await draftSubmitTmsCostFee(submitOrderForm)
let rstData=res.data; let rstData=res.data;
if(rstData.result=='success'){ if(rstData.result=='success'){
orderItem.uploadStatus=1; orderItem.uploadStatus=1;

View File

@ -137,6 +137,16 @@
v-hasPermi="['emis:emisTmsCostFee:export']" v-hasPermi="['emis:emisTmsCostFee:export']"
>导出</el-button> >导出</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
size="mini"
@click="handleBatchImport"
v-hasPermi="['emis:emisTmsCostFee:add']"
>批量导入成本</el-button>
</el-col>
</el-row> </el-row>
</div> </div>
@ -342,6 +352,15 @@ export default {
this.openForm = true; this.openForm = true;
this.titleForm = "修改成本"; this.titleForm = "修改成本";
}, },
handleBatchImport(){
this.$router.push({
path: '/CostMgnt/BatchImportCostFee',
query: {
action: "batchImport",
'_t':(new Date()).getTime()
}
});
},
handleView(row) { handleView(row) {
this.id=row.id; this.id=row.id;
this.titleView="查看"; this.titleView="查看";