md
This commit is contained in:
parent
7aa3bac278
commit
7690e522bc
@ -27,9 +27,11 @@
|
|||||||
<el-button type="primary" size="mini" style="padding:2px 10px" @click="confirmOk">确定</el-button>
|
<el-button type="primary" size="mini" style="padding:2px 10px" @click="confirmOk">确定</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-option v-for="item in optionItems.filter(el=> !svalue.includes(el.code) )" :key="item.id" :label="item.name" :value="item.code">
|
<el-option v-for="item in optionItems" :key="item.id" :label="item.name" :value="item.code">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
||||||
|
<!-- .filter(el=> !svalue.includes(el.code) ) -->
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -68,19 +70,32 @@ watch: {
|
|||||||
console.log("=watch==>",this.value);
|
console.log("=watch==>",this.value);
|
||||||
if(this.value) {
|
if(this.value) {
|
||||||
this.svalue = this.value.split(',');
|
this.svalue = this.value.split(',');
|
||||||
|
this.queryData(null,this.value,this.value);
|
||||||
|
}else{
|
||||||
|
this.svalue=[];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
console.log("=mounted==>",this.value);
|
console.log("=mounted==>",this.value);
|
||||||
|
if(this.value) {
|
||||||
|
this.svalue = this.value.split(',');
|
||||||
|
this.queryData(null,this.value,this.value);
|
||||||
|
}else{
|
||||||
|
this.svalue=[];
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
mounted(){
|
mounted(){
|
||||||
console.log("=mounted==>",this.value);
|
console.log("=mounted==>",this.value);
|
||||||
if(this.value) {
|
if(this.value) {
|
||||||
this.svalue = this.value.split(',');
|
this.svalue = this.value.split(',');
|
||||||
}
|
|
||||||
this.queryData(null,this.value,this.value);
|
this.queryData(null,this.value,this.value);
|
||||||
|
}else{
|
||||||
|
this.svalue=[];
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
confirmOk(){
|
confirmOk(){
|
||||||
@ -115,7 +130,6 @@ methods: {
|
|||||||
this.$emit('onChange',selCodeStr)
|
this.$emit('onChange',selCodeStr)
|
||||||
},
|
},
|
||||||
queryData(val,key,sortCodeStr) {
|
queryData(val,key,sortCodeStr) {
|
||||||
|
|
||||||
let queryParams={
|
let queryParams={
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 50,
|
pageSize: 50,
|
||||||
@ -123,17 +137,9 @@ methods: {
|
|||||||
name:val,
|
name:val,
|
||||||
sortCodeStr:sortCodeStr
|
sortCodeStr:sortCodeStr
|
||||||
}
|
}
|
||||||
|
// console.log("queryData--queryParams:",queryParams)
|
||||||
console.log("queryData--queryParams:",queryParams)
|
|
||||||
|
|
||||||
listSimpleEmisSupplier(queryParams).then(response => {
|
listSimpleEmisSupplier(queryParams).then(response => {
|
||||||
this.optionItems=response.rows
|
this.optionItems=response.rows
|
||||||
// this.optionItems.forEach(item => {
|
|
||||||
// if(!(item.code in this.itemMap)){
|
|
||||||
// this.itemMap[item.code]=item;
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
reverseArrow(flag) {
|
reverseArrow(flag) {
|
||||||
|
|||||||
@ -123,8 +123,6 @@
|
|||||||
this.dispatch('ElFormItem', 'el.form.change', [this.svalue]);
|
this.dispatch('ElFormItem', 'el.form.change', [this.svalue]);
|
||||||
},
|
},
|
||||||
queryData() {
|
queryData() {
|
||||||
|
|
||||||
|
|
||||||
if(!this.transLineCode ){
|
if(!this.transLineCode ){
|
||||||
|
|
||||||
if(this.isFistInit && !this.value){
|
if(this.isFistInit && !this.value){
|
||||||
|
|||||||
@ -52,9 +52,9 @@
|
|||||||
<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" >
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag v-if="scope.row.uploadStatus==1" type="success">上传成功</el-tag>
|
<el-tag v-if="scope.row.uploadStatus==1" type="success">成功</el-tag>
|
||||||
<el-tag v-if="scope.row.uploadStatus==0" type="info">待上传</el-tag>
|
<el-tag v-if="scope.row.uploadStatus==0" type="info">待处理</el-tag>
|
||||||
<el-tag v-if="scope.row.uploadStatus==-1" type="danger">上传异常</el-tag>
|
<el-tag v-if="scope.row.uploadStatus==-1" type="danger">异常</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :label="$t('异常信息')" align="center" prop="errorInfo" min-width="300" :show-overflow-tooltip="true" >
|
<el-table-column :label="$t('异常信息')" align="center" prop="errorInfo" min-width="300" :show-overflow-tooltip="true" >
|
||||||
@ -79,7 +79,6 @@
|
|||||||
<!-- <el-table-column v-for="(item, index) in dynamicCol" :key="index" :label="item.label" :prop="item.prop">
|
<!-- <el-table-column v-for="(item, index) in dynamicCol" :key="index" :label="item.label" :prop="item.prop">
|
||||||
</el-table-column> -->
|
</el-table-column> -->
|
||||||
|
|
||||||
|
|
||||||
<!-- <el-table-column :label="$t('线路名称')" align="center" prop="lineName" min-width="120" />
|
<!-- <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" />
|
||||||
@ -148,8 +147,7 @@ export default {
|
|||||||
|
|
||||||
components: {
|
components: {
|
||||||
},
|
},
|
||||||
dicts: [
|
dicts: ['emis_cost_fee_type'],
|
||||||
],
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
resetRefreshId:null,
|
resetRefreshId:null,
|
||||||
@ -172,6 +170,8 @@ export default {
|
|||||||
selectionList:[],
|
selectionList:[],
|
||||||
selectionIndexList: [],
|
selectionIndexList: [],
|
||||||
|
|
||||||
|
feeItemMap:new Map(),
|
||||||
|
|
||||||
// 动态费用列表
|
// 动态费用列表
|
||||||
dynamicCol:[],
|
dynamicCol:[],
|
||||||
|
|
||||||
@ -201,6 +201,8 @@ export default {
|
|||||||
if(this.$store.getters.ownerSiteCode!='88888'){
|
if(this.$store.getters.ownerSiteCode!='88888'){
|
||||||
this.queryParams.sendSiteCode=this.$store.getters.ownerSiteCode;
|
this.queryParams.sendSiteCode=this.$store.getters.ownerSiteCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
||||||
@ -262,8 +264,9 @@ export default {
|
|||||||
// const header = this.getHeaderRow(worksheet) // 标题
|
// const header = this.getHeaderRow(worksheet) // 标题
|
||||||
const results = XLSX.utils.sheet_to_json(worksheet)
|
const results = XLSX.utils.sheet_to_json(worksheet)
|
||||||
|
|
||||||
console.log(results);
|
// console.log(results);
|
||||||
|
|
||||||
|
// 标题头
|
||||||
that.dynamicCol=[];
|
that.dynamicCol=[];
|
||||||
for (var key in results[0]) {
|
for (var key in results[0]) {
|
||||||
that.dynamicCol.push(
|
that.dynamicCol.push(
|
||||||
@ -274,8 +277,16 @@ export default {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("===>dynamicCol=>",that.dynamicCol);
|
// 转换费用类型
|
||||||
this.batchImportData(results);
|
that.feeItemMap=new Map();;
|
||||||
|
for(let i=0;i<that.dict.type.emis_cost_fee_type.length;i++){
|
||||||
|
let item=that.dict.type.emis_cost_fee_type[i];
|
||||||
|
that.feeItemMap[""+item.label+""]=item.value;
|
||||||
|
}
|
||||||
|
// console.log("===>feeItemMap=>",that.feeItemMap);
|
||||||
|
// console.log("===>dynamicCol=>",that.dynamicCol);
|
||||||
|
that.batchImportData(results);
|
||||||
|
|
||||||
|
|
||||||
resolve()
|
resolve()
|
||||||
}
|
}
|
||||||
@ -298,6 +309,7 @@ export default {
|
|||||||
return headers
|
return headers
|
||||||
},
|
},
|
||||||
async batchImportData(results) {
|
async batchImportData(results) {
|
||||||
|
const that=this;
|
||||||
const _index = 1
|
const _index = 1
|
||||||
let loadingInstance = this.$loading({
|
let loadingInstance = this.$loading({
|
||||||
text: '正在解析 ' + _index + ' 数据...'
|
text: '正在解析 ' + _index + ' 数据...'
|
||||||
@ -313,32 +325,73 @@ export default {
|
|||||||
// 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={
|
||||||
uploadStatus: 0,
|
uploadStatus: 0,
|
||||||
errorInfo:'',
|
errorInfo:'',
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.log("===kkkk=>item=>",item)
|
// console.log("===kkkk=>item=>",item)
|
||||||
|
let feeItemList=[];
|
||||||
|
let feeItemPrice=new Map();
|
||||||
|
let errorInfo='';
|
||||||
|
let batchNo=element['批次号'];
|
||||||
|
|
||||||
for (const key in element) {
|
for (const key in element) {
|
||||||
if (element.hasOwnProperty(key)) { // 可选:过滤继承的属性
|
if (element.hasOwnProperty(key)) {
|
||||||
console.log(`${key}: ${element[key]}`);
|
// console.log(`${key}: ${element[key]}`);
|
||||||
this.$set(orderData,key,element[key]) ;
|
this.$set(orderData,key,element[key]) ;
|
||||||
|
// 解析费用数据
|
||||||
|
if(key!='批次号'&&key!='账期'&&key!='备注'){
|
||||||
|
// 获取费用编码
|
||||||
|
// 单价特殊处理
|
||||||
|
let indexPos=key.indexOf("单价");
|
||||||
|
// console.log("===key=indexPos=>",key,indexPos);
|
||||||
|
|
||||||
|
if(indexPos !== -1 ){
|
||||||
|
let feeTypeStr=key.substring(0,indexPos)+"费";
|
||||||
|
// console.log("===feeTypeStr=>",feeTypeStr)
|
||||||
|
if(!(feeTypeStr in that.feeItemMap) ){
|
||||||
|
orderData.uploadStatus=-1;
|
||||||
|
errorInfo=errorInfo+''+key+',';
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
let feeTypeCode=that.feeItemMap[key]
|
||||||
|
feeItemPrice[feeTypeCode]=element[key];
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(!(key in that.feeItemMap) ){
|
||||||
|
orderData.uploadStatus=-1;
|
||||||
|
errorInfo=errorInfo+''+key+',';
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
let feeItem={
|
||||||
|
feeType:that.feeItemMap[key],
|
||||||
|
price:null,
|
||||||
|
fee:element[key],
|
||||||
|
currency:'CNY'
|
||||||
|
}
|
||||||
|
feeItemList.push(feeItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("===orderData=>",orderData)
|
if(orderData.uploadStatus==-1){
|
||||||
|
orderData.errorInfo="费用类型:["+errorInfo+"]未配置";
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
// 循环处理费用单价
|
||||||
|
for(let i=0;i<feeItemList.length;i++){
|
||||||
|
let item=feeItemList[i];
|
||||||
|
item.price=feeItemPrice[item.feeType];
|
||||||
|
}
|
||||||
|
this.$set(orderData,"feeItemList",feeItemList) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// console.log("===orderData=>",orderData)
|
||||||
this.tmpDataList.push(orderData);
|
this.tmpDataList.push(orderData);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -369,6 +422,7 @@ export default {
|
|||||||
transSignNo: null,
|
transSignNo: null,
|
||||||
supplierCode: null,
|
supplierCode: null,
|
||||||
supplierName: null,
|
supplierName: null,
|
||||||
|
billMonth:null,
|
||||||
sendPlace: null,
|
sendPlace: null,
|
||||||
destPlace: null,
|
destPlace: null,
|
||||||
costFee: null,
|
costFee: null,
|
||||||
@ -396,19 +450,29 @@ export default {
|
|||||||
};
|
};
|
||||||
|
|
||||||
submitOrderForm.batchNo=orderItem['批次号'];
|
submitOrderForm.batchNo=orderItem['批次号'];
|
||||||
|
submitOrderForm.billMonth=orderItem['账期'];
|
||||||
|
submitOrderForm.remark=orderItem['备注'];
|
||||||
|
submitOrderForm.splitType="1";
|
||||||
|
|
||||||
// this.$set(submitOrderForm,'batchNo',orderItem['批次号']);
|
// this.$set(submitOrderForm,'batchNo',orderItem['批次号']);
|
||||||
|
|
||||||
try{
|
try{
|
||||||
|
let batchNo=orderItem['批次号'];
|
||||||
// 获取批次信息
|
// 获取批次信息
|
||||||
let qParam = {
|
let qParam = {
|
||||||
pageNum:1,
|
pageNum:1,
|
||||||
pageSize:1,
|
pageSize:1,
|
||||||
batchNo:orderItem['批次号'],
|
batchNo:batchNo,
|
||||||
};
|
};
|
||||||
let resBatch=await listEmisTmsSiteBatch(qParam);
|
let resBatch=await listEmisTmsSiteBatch(qParam);
|
||||||
if(resBatch&&resBatch.code==200){
|
if(resBatch&&resBatch.code==200){
|
||||||
|
|
||||||
|
if(resBatch.rows.length!=1){
|
||||||
|
orderItem.uploadStatus=-1;
|
||||||
|
orderItem.errorInfo='批次号不存在';
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
let batchItem=resBatch.rows[0];
|
let batchItem=resBatch.rows[0];
|
||||||
submitOrderForm.realTotalWeight=batchItem.transWeight;
|
submitOrderForm.realTotalWeight=batchItem.transWeight;
|
||||||
submitOrderForm.realPieceNumber=batchItem.packNum;
|
submitOrderForm.realPieceNumber=batchItem.packNum;
|
||||||
@ -421,16 +485,45 @@ export default {
|
|||||||
submitOrderForm.tradeDate= this.parseTime(batchItem.etd);
|
submitOrderForm.tradeDate= this.parseTime(batchItem.etd);
|
||||||
submitOrderForm.costName=batchItem.batchName;
|
submitOrderForm.costName=batchItem.batchName;
|
||||||
// this.form.costFee=item.startSiteName;
|
// this.form.costFee=item.startSiteName;
|
||||||
submitOrderFormsendPieceSum=batchItem.totalWaybillQty;
|
submitOrderForm.sendPieceSum=batchItem.totalWaybillQty;
|
||||||
submitOrderForm.pieceNumber=batchItem.pieceNumber;
|
submitOrderForm.pieceNumber=batchItem.pieceNumber;
|
||||||
submitOrderForm.totalWeight=batchItem.totalWeight;
|
submitOrderForm.totalWeight=batchItem.totalWeight;
|
||||||
submitOrderForm.totalVolume=batchItem.totalVolume;
|
submitOrderForm.totalVolume=batchItem.totalVolume;
|
||||||
|
|
||||||
|
|
||||||
// 获取供应商
|
// 获取供应商
|
||||||
|
let spParams={
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 1,
|
||||||
|
code:batchItem.supplierCode
|
||||||
|
}
|
||||||
|
let respSp=await listSimpleEmisSupplier(spParams);
|
||||||
|
if(respSp&&respSp.code==200){
|
||||||
|
if(respSp.rows.length==0){
|
||||||
|
orderItem.uploadStatus=-1;
|
||||||
|
orderItem.errorInfo='批次对应供应商不存在';
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
orderItem.uploadStatus=-1;
|
||||||
|
orderItem.errorInfo='获取供应商失败';
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 费用类型
|
||||||
|
this.$set(submitOrderForm,"feeItemList",orderItem.feeItemList) ;
|
||||||
|
|
||||||
// 转化费用类型
|
// 获取批次关联运单号
|
||||||
|
let billRelList=[];
|
||||||
|
let resBill=await listEmisTmsSiteBatchDtl({batchNo: batchNo});
|
||||||
|
if(resBill.code==200){
|
||||||
|
if(resBill.rows&&resBill.rows.length>0){
|
||||||
|
resBill.rows.forEach(itemWaybill=>{
|
||||||
|
let relItem={...itemWaybill};
|
||||||
|
billRelList.push(relItem);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.$set(submitOrderForm,"billRelList",billRelList)
|
||||||
|
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
@ -440,6 +533,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}catch(e){
|
}catch(e){
|
||||||
|
console.log("===>e===>",e);
|
||||||
orderItem.uploadStatus=-1;
|
orderItem.uploadStatus=-1;
|
||||||
orderItem.errorInfo='数据异常';
|
orderItem.errorInfo='数据异常';
|
||||||
continue;
|
continue;
|
||||||
@ -475,8 +569,6 @@ export default {
|
|||||||
|
|
||||||
this.openUploadForm = false;
|
this.openUploadForm = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
|
|||||||
@ -525,6 +525,7 @@ export default {
|
|||||||
async onSelecTmsBatch(item){
|
async onSelecTmsBatch(item){
|
||||||
|
|
||||||
// 基础信息
|
// 基础信息
|
||||||
|
this.form.batchNo=item.batchNo;
|
||||||
this.form.realTotalWeight=item.transWeight;
|
this.form.realTotalWeight=item.transWeight;
|
||||||
this.form.realPieceNumber=item.packNum;
|
this.form.realPieceNumber=item.packNum;
|
||||||
this.form.transType=item.transType;
|
this.form.transType=item.transType;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user