md
This commit is contained in:
parent
5a950e40db
commit
7aa3bac278
@ -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) {
|
||||
return request({
|
||||
|
||||
@ -155,7 +155,7 @@
|
||||
<el-table-column label="运输方式" align="center" prop="transType" width="80" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@ -1,26 +1,6 @@
|
||||
<template>
|
||||
<XdPageContainer class="app-container">
|
||||
<div slot="pageHeader"></div>
|
||||
<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="pageHeader">
|
||||
<div slot="toolbar">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
@ -47,6 +27,27 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
</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 :label="$t('状态')" align="center" prop="uploadStatus" min-width="80" :show-overflow-tooltip="true" >
|
||||
@ -64,16 +65,31 @@
|
||||
</template>
|
||||
</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="startSiteName" 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="supplierName" min-width="180" />
|
||||
<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-row :gutter="0">
|
||||
@ -114,15 +130,21 @@
|
||||
</template>
|
||||
|
||||
<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 { formatSearchStr,deepClone } from '@/utils/index'
|
||||
import XLSX from 'xlsx'
|
||||
import {parseExcelTime } from "@/utils/custom";
|
||||
import { forEach } from "lodash";
|
||||
|
||||
export default {
|
||||
name: "BatchImportTransPlanRule",
|
||||
name: "BatchImportCostFee",
|
||||
|
||||
components: {
|
||||
},
|
||||
@ -150,6 +172,9 @@ export default {
|
||||
selectionList:[],
|
||||
selectionIndexList: [],
|
||||
|
||||
// 动态费用列表
|
||||
dynamicCol:[],
|
||||
|
||||
form:{},
|
||||
rules:{},
|
||||
|
||||
@ -160,7 +185,7 @@ export default {
|
||||
fileList:[],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
lineCode: null,
|
||||
lineCode: null,
|
||||
productType: null,
|
||||
startSiteCode: null,
|
||||
nextSiteCode: null,
|
||||
@ -221,6 +246,7 @@ export default {
|
||||
return false
|
||||
},
|
||||
readerData(rawFile) {
|
||||
const that=this;
|
||||
return new Promise((resolve, reject) => {
|
||||
const reader = new FileReader()
|
||||
reader.onload = e => {
|
||||
@ -238,6 +264,17 @@ export default {
|
||||
|
||||
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);
|
||||
|
||||
resolve()
|
||||
@ -275,19 +312,33 @@ export default {
|
||||
const element = results[index]
|
||||
// tst
|
||||
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={
|
||||
lineName: element['线路名称'],
|
||||
productTypeName: element['产品名称'],
|
||||
startSiteName: element['起始网点'],
|
||||
nextSiteName: element['下一网点'],
|
||||
manager: element['线路负责人'],
|
||||
supplierName: element['供应商名称'],
|
||||
startDate: parseExcelTime(element['生效时间'],false),
|
||||
endDate: parseExcelTime(element['失效时间'],false),
|
||||
remark: element['备注'],
|
||||
uploadStatus: 0,
|
||||
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);
|
||||
|
||||
}
|
||||
@ -308,8 +359,93 @@ export default {
|
||||
if(this.selectionList&&this.selectionList.length>0){
|
||||
for(let i=0;i<this.selectionList.length;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;
|
||||
if(rstData.result=='success'){
|
||||
orderItem.uploadStatus=1;
|
||||
|
||||
@ -137,6 +137,16 @@
|
||||
v-hasPermi="['emis:emisTmsCostFee:export']"
|
||||
>导出</el-button>
|
||||
</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>
|
||||
</div>
|
||||
|
||||
@ -342,6 +352,15 @@ export default {
|
||||
this.openForm = true;
|
||||
this.titleForm = "修改成本";
|
||||
},
|
||||
handleBatchImport(){
|
||||
this.$router.push({
|
||||
path: '/CostMgnt/BatchImportCostFee',
|
||||
query: {
|
||||
action: "batchImport",
|
||||
'_t':(new Date()).getTime()
|
||||
}
|
||||
});
|
||||
},
|
||||
handleView(row) {
|
||||
this.id=row.id;
|
||||
this.titleView="查看";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user