diff --git a/src/views/emis/emisWaybillProblemInfo/problemEntry.vue b/src/views/emis/emisWaybillProblemInfo/problemEntry.vue index 754c31b8..4afa29d4 100644 --- a/src/views/emis/emisWaybillProblemInfo/problemEntry.vue +++ b/src/views/emis/emisWaybillProblemInfo/problemEntry.vue @@ -5,9 +5,9 @@ - 扫描单号 + {{$t('扫描单号')}} - + @@ -16,16 +16,25 @@ - + + + + + + {{$t('问题类型')}} + + + {{$t('问题原因')}} + - - - 登记 - - -
-
+ + 登记 +
- - - - + + + + + - + {{ parseTime(scope.row.scanDate) }} + - - + + - + + + - +
- @@ -156,7 +164,6 @@ - - @@ -188,7 +194,6 @@ import { addEmisWaybillProblemInfo,listEmisWaybillProblemInfo } from "@/api/emis import { doScan } from "@/api/emis/emisTmsScanRecord"; import { listEmisWaybill } from "@/api/emis/emisWaybill"; // import { getWaybillDetail } from "@/api/emis/emisWaybill"; - import EmisSiteSimplePicker from '@/views/emis/EmisBaseTools/EmisSiteSimplePicker.vue'; import ProblemTypePicker from '@/views/emis/EmisBaseTools/ProblemTypePicker.vue'; @@ -215,6 +220,8 @@ export default { // 问题件表格数据 emisWaybillList: [], + notifySiteDataSource:[], + title: "", open: false, titleBatch:"", @@ -224,10 +231,9 @@ export default { problemType:null, openForm: false, titleForm: "", - + tempRecord:{}, titleEmisWaybillProblemInfo: "", openEmisWaybillProblemInfo: false, - // 显示编辑框更多 moreInputVisible: false, @@ -284,12 +290,17 @@ export default { }, onScanSiteSelect(item){ if(!item){ - this.form.modifyNotifySite = null; - this.form.modifyNotifySiteName = null; + this.form.notifySiteCode = null; + this.form.notifySiteName = null; return; } - this.form.notifySite=item && item.siteCode; - this.form.notifySiteName=item && item.siteName; + // this.form.notifySiteCode=item.notifySiteCode; + this.notifySiteDataSource.forEach(nItem => { + if(nItem.notifySiteCode == item){ + this.form.notifySiteName=nItem.notifySiteName; + return; + } + }) }, onproblemTypeSelect(item){ // debugger; @@ -314,15 +325,18 @@ export default { this.form.modifyNotifySiteName=item && item.siteName; }, handleBatchRegister(){ - if(this.form.notifySite==null || this.form.notifySite==''){ - this.$message.error("请选择通知网点"); - return; - } - + // if(this.form.notifySite==null || this.form.notifySite==''){ + // this.$message.error("请选择通知网点"); + // return; + // } if(this.form.problemType==null || this.form.problemType==''){ this.$message.error("请选择问题类型"); return; } + if(this.form.remark==null || this.form.remark==''){ + this.$message.error("请填写问题原因"); + return; + } this.formBatch = { billCode: null, } @@ -342,26 +356,9 @@ export default { this.$message.error("输入单号后回车"); return; } - // if(this.form.notifySite==null || this.form.notifySite==''){ - // this.$message.error("请选择通知网点"); - // return; - // } - - // if(this.form.problemType==null || this.form.problemType==''){ - // this.$message.error("请选择问题类型"); - // return; - // } - - // if(this.dataMap[this.form.billCode]){ - // this.$message.error("重复登记"); - // this.playNoticeTone(1); - // return; - // } - this.getWaybill(this.form.billCode) - }, - getWaybill(billCode){ + // this.getWaybill(this.form.billCode) this.loading = true; - listEmisWaybill({billCode:billCode}).then(response => { + listEmisWaybill({billCode:this.form.billCode}).then(response => { this.loading = false; let scanDate = new Date(); if(response.code != 200){ @@ -371,73 +368,150 @@ export default { let rows = response.rows; if(!rows || rows.length == 0){ this.$message.error("未查到单号"); + this.form.billCode=null; return; } - for (let index = 0; index < rows.length; index++) { - let rsItem = rows[index]; + if(rows.length>0) { + let rsItem = rows[0]; console.log(rsItem); - let record =Object.assign({}, rsItem) - record.notifySite = this.form.notifySite; - record.notifySiteName = this.form.notifySiteName; - record.scanSiteCode=this.form.scanSiteCode; - record.scanSite=this.form.scanSite; - record.scanDate=scanDate; - record.problemType=this.form.problemType; - record.scanMan=this.form.scanMan; - record.scanManCode=this.form.scanManCode; - record.picUrl=this.form.picUrl; - record.remark=this.form.remark; - record.dataFrom="PC"; - this.emisWaybillList.push(record); - this.dataMap[this.form.billCode]=record; + this.tempRecord =Object.assign({}, rsItem) + // tempRecord.notifySite = tempRecord.sendSiteCode; + // tempRecord.notifySiteName = tempRecord.sendSiteName; + this.tempRecord.scanSiteCode=this.form.scanSiteCode; + this.tempRecord.scanSite=this.form.scanSite; + this.tempRecord.scanDate=scanDate; + this.tempRecord.scanMan=this.form.scanMan; + this.tempRecord.scanManCode=this.form.scanManCode; + this.tempRecord.dataFrom="PC"; + this.notifySiteDataSource=[ + { + notifySiteCode:this.tempRecord.sendSiteCode, + notifySiteName:this.tempRecord.sendSiteName, + }, + { + notifySiteCode:this.tempRecord.dispatchUnderlingSiteCode, + notifySiteName:this.tempRecord.dispatchUnderlingSiteName, + } + ] + // this.billInputDisabled = true; + // this.emisWaybillList.push(tempRecord); + // this.dataMap[this.form.billCode]=tempRecord; } - this.form.billCode=null; + // this.form.billCode=null; }) }, + handleRegister(){ + if(this.form.notifySiteCode==null || this.form.notifySiteCode==''){ + this.$message.error("请选择通知网点"); + return; + } + if(this.form.problemType==null || this.form.problemType==''){ + this.$message.error("请选择问题类型"); + return; + } + if(this.form.remark==null || this.form.remark==''){ + this.$message.error("请填写问题原因"); + return; + } + this.tempRecord.notifySiteCode = this.form.notifySiteCode; + this.tempRecord.notifySiteName = this.form.notifySiteName; + this.tempRecord.problemTypeName=this.form.problemType; + this.tempRecord.problemType = this.form.problemType; + this.tempRecord.problemId = this.form.problemId; + this.tempRecord.remark = this.form.remark; + this.tempRecord.picUrl=this.form.picUrl; + this.emisWaybillList.push(this.tempRecord); + this.dataMap[this.form.billCode]=this.tempRecord; + + //清理数据 + this.form.notifySiteCode=""; + this.form.notifySiteName=""; + this.tempRecord=null; + this.form.billCode=null; + this.notifySiteDataSource=[]; + console.log(this.emisWaybillList) + }, + // getWaybill(billCode){ + // this.loading = true; + // listEmisWaybill({billCode:billCode}).then(response => { + // this.loading = false; + // let scanDate = new Date(); + // if(response.code != 200){ + // this.$message.error(response.msg); + // return; + // } + // let rows = response.rows; + // if(!rows || rows.length == 0){ + // this.$message.error("未查到单号"); + // return; + // } + // for (let index = 0; index < rows.length; index++) { + // let rsItem = rows[index]; + // console.log(rsItem); + // let record =Object.assign({}, rsItem) + // record.notifySiteCode = recs; + // record.notifySiteName = record.sendSiteName; + // record.scanSiteCode=this.form.scanSiteCode; + // record.scanSite=this.form.scanSite; + // record.scanDate=scanDate; + // record.problemType=this.form.problemType; + // record.problemId=this.form.problemId; + // record.scanMan=this.form.scanMan; + // record.scanManCode=this.form.scanManCode; + // record.picUrl=this.form.picUrl; + // record.remark=this.form.remark; + // record.dataFrom="PC"; + // this.emisWaybillList.push(record); + // this.dataMap[this.form.billCode]=record; + // } + // this.form.billCode=null; + // }) + // }, handleUpload(){ let scanData=[]; - let problemInfoList=[]; + // let problemInfoList=[]; this.emisWaybillList.forEach(item=>{ + // item.currentStatus="已上传"; if(this.ids.indexOf(item.id) > -1){ scanData.push( { billCode:item.billCode, - problemType:item.problemType, - notifySite:item.notifySite, + problemType:item.problemId, + notifySite:item.notifySiteCode, picUrl:item.picUrl, remark:item.remark, scanWeight:item.scanWeight, scanDate:item.scanDate } ) - problemInfoList.push({ - billCode: item.billCode, - problemType: item.problemType, - problemTitle: null, - problemCause: item.remark, - sendSite: item.sendSiteName, - sendSiteCode: item.sendSiteCode, - registerManCode: item.registerManCode, - registerManDept: null, - registerSiteCode: item.registerSiteCode, - registerDate: item.registerDate, - registerSaveDate: null, - dataFrom: item.dataFrom, - status: null,//item.waybillStatus,//????????是否正确 - isSendSiteRegister: null, - // blReversion: false,//????????是否正确 - blReversion: null, - reversionStr: null, - reversionMan: null, - reversionManCode: null, - reversionDate: null, - blCheckok: null, - blSee: null, - filePath: item.picUrl, - modifySiteCode: null, - delFlag: item.delFlag,//????????是否正确 - remark: item.remark,//????????是否正确 - }) + // problemInfoList.push({ + // billCode: item.billCode, + // problemType: item.problemType, + // problemTitle: null, + // problemCause: item.remark, + // sendSite: item.sendSiteName, + // sendSiteCode: item.sendSiteCode, + // registerManCode: item.registerManCode, + // registerManDept: null, + // registerSiteCode: item.registerSiteCode, + // registerDate: item.registerDate, + // registerSaveDate: null, + // dataFrom: item.dataFrom, + // status: null,//item.waybillStatus,//????????是否正确 + // isSendSiteRegister: null, + // // blReversion: false,//????????是否正确 + // blReversion: null, + // reversionStr: null, + // reversionMan: null, + // reversionManCode: null, + // reversionDate: null, + // blCheckok: null, + // blSee: null, + // filePath: item.picUrl, + // modifySiteCode: null, + // delFlag: item.delFlag,//????????是否正确 + // remark: item.remark,//????????是否正确 + // }) } }); @@ -447,6 +521,8 @@ export default { scanData:scanData }; + let newList = []; + doScan(scanProblemInfo).then(response => { let scanRstItem = response.data.scanResult[0]; console.log(scanRstItem); @@ -454,28 +530,33 @@ export default { this.$modal.msgError(scanRstItem.message); return; } - + this.emisWaybillList.forEach(item=>{ + if(this.ids.indexOf(item.id) > -1){ + item.currentStatus="已上传"; + } + newList.push(item); + }) + this.emisWaybillList = newList; this.$modal.msgSuccess(scanRstItem.message); }); - problemInfoList.forEach(item => { - addEmisWaybillProblemInfo(item).then(response => { - // debugger; - if(response.code != "200"){ - this.$modal.msgError(response.msg); - return; - } - this.$modal.msgSuccess(response.msg); - }) - }) + // problemInfoList.forEach(item => { + // addEmisWaybillProblemInfo(item).then(response => { + // // debugger; + // if(response.code != "200"){ + // this.$modal.msgError(response.msg); + // return; + // } + // this.$modal.msgSuccess(response.msg); + // }) + // }) }, /** 提交按钮 */ submitForm() { let newList = []; - debugger for(let i = 0; i< this.emisWaybillList.length;i++){ let waybill = {...this.emisWaybillList[i]}; if(this.ids.indexOf(waybill.id) > -1){ - waybill.notifySite=this.form.modifyNotifySite; + waybill.notifySiteCode=this.form.modifyNotifySite; waybill.notifySiteName=this.form.modifyNotifySiteName; newList.push(waybill); }else{ @@ -485,22 +566,58 @@ export default { this.emisWaybillList = newList; this.open = false; }, - submitFormBatch(){ + async submitFormBatch(){ if(this.formBatch.billCode==null || this.formBatch.billCode==''){ this.$message.error("输入单号后回车"); return; } let bcList=this.formBatch.billCode.split(/[;\;\,\,\n]/)||[]; - bcList.forEach(code => { - // if(this.dataMap[code]){ - // this.$message.error("重复登记:"+code); - // this.playNoticeTone(1); - // return; - // } - this.getWaybill(code) - }); + // bcList.forEach(code => { + // this.getWaybill(code) + // }); + this.loading = true; + for(let bc=0;bc + \ No newline at end of file