diff --git a/src/api/modular/main/BookingLedger.js b/src/api/modular/main/BookingLedger.js index 74657bc..9089b76 100644 --- a/src/api/modular/main/BookingLedger.js +++ b/src/api/modular/main/BookingLedger.js @@ -315,7 +315,7 @@ export function SendBookingOrClosingEDI(parameter) { /** * 下载订舱、截单EDI */ - export function DownloadBookingOrClosingEDI(parameter) { +export function DownloadBookingOrClosingEDI(parameter) { return axios({ url: '/BookingOrder/DownloadBookingOrClosingEDI', method: 'get', @@ -544,11 +544,12 @@ export function BookingOrderDownload(parameter) { } // 上传ocr文件 -export function BookingOrderOcrUpFile(parameter) { +export function BookingOrderOcrUpFile(data) { return axios({ url: '/BookingOrder/OcrUpFile', method: 'post', - data: parameter + data: data.data, + params: data.parameter }) } diff --git a/src/views/main/BookingLedger/detail/index.vue b/src/views/main/BookingLedger/detail/index.vue index 5fb7936..cd54ad0 100644 --- a/src/views/main/BookingLedger/detail/index.vue +++ b/src/views/main/BookingLedger/detail/index.vue @@ -39,15 +39,15 @@ - + - + @@ -110,108 +110,108 @@ import { import { mapActions, mapGetters } from 'vuex' import { string } from 'clipboard' const initDetail = { - id: 0, - parentId: 0, - // 基本信息 - customername: '', - customerid: '', - carrier: '', - carrierid: '', - forwarder: '', - pono: '', - mblno: '', - hblno: '', - bookingno: '', - contractno: '', - vessel: '', - voyno: '', - voynoinner: '', - lanecode: '', - etd: '', - atd: '', - lanename: '', - shipagency: '', - sale: '', - op: '', - doc: '', - custservice: '', - // 收发通信息 - shipper: '', - consignee: '', - notifyparty: '', - yard: '', - customser: '', - trucker: '', - agentid: '', - eta: '', - closingdate: '', - closedocdate: '', - closevgmdate: '', - portload: '', - portloadid: '', - transport: '', - transportid: '', - portdischarge: '', - portdischargeid: '', - destination: '', - destinationid: '', - placedelivery: '', - placedeliveryid: '', - placereceipt: '', - placereceiptid: '', - pkgs: 0, - kindpkgs: '', - kgs: 0, - cbm: 0, - // 货物信息 - marks: '', - cargoid: '', - hscode: '', - description: '', - totalno: '', - // 签单信息 - issuetype: '', - issuedate: '', - issueplace: '', - issueplaceid: '', - nobill: 'THREE', - copynobilll: 'THREE', - prepardat: '', - payableat: '', - blfrt: '', - thirdpayaddr: '', - service: 'CY-CY', - reeferf: '', - tempset: '', - tempid: '', - tempmin: '', - tempmax: '', - humidity: '', - dclass: '', - dunno: '', - dpage: '', - dlabel: '', - linkman: '', - // 备注信息 - soremark: '', - siremark: '', - // 箱型 - ctnInputs: [], - // edi补充信息 (edi联系人等暂无字段) - weituo: '', - freightpayer: '', - scaccode: '', - itncode: '', - iscontainersoc: 0, - bookingEDIExt: { - weiTuoFang: '', - ediAttn: '', - ediAttnTel: '', - ediAttnMail: '' - }, - // 分单信息未添加 - hbList: [] - } + id: 0, + parentId: 0, + // 基本信息 + customername: '', + customerid: '', + carrier: '', + carrierid: '', + forwarder: '', + pono: '', + mblno: '', + hblno: '', + bookingno: '', + contractno: '', + vessel: '', + voyno: '', + voynoinner: '', + lanecode: '', + etd: '', + atd: '', + lanename: '', + shipagency: '', + sale: '', + op: '', + doc: '', + custservice: '', + // 收发通信息 + shipper: '', + consignee: '', + notifyparty: '', + yard: '', + customser: '', + trucker: '', + agentid: '', + eta: '', + closingdate: '', + closedocdate: '', + closevgmdate: '', + portload: '', + portloadid: '', + transport: '', + transportid: '', + portdischarge: '', + portdischargeid: '', + destination: '', + destinationid: '', + placedelivery: '', + placedeliveryid: '', + placereceipt: '', + placereceiptid: '', + pkgs: 0, + kindpkgs: '', + kgs: 0, + cbm: 0, + // 货物信息 + marks: '', + cargoid: '', + hscode: '', + description: '', + totalno: '', + // 签单信息 + issuetype: '', + issuedate: '', + issueplace: '', + issueplaceid: '', + nobill: 'THREE', + copynobilll: 'THREE', + prepardat: '', + payableat: '', + blfrt: '', + thirdpayaddr: '', + service: 'CY-CY', + reeferf: '', + tempset: '', + tempid: '', + tempmin: '', + tempmax: '', + humidity: '', + dclass: '', + dunno: '', + dpage: '', + dlabel: '', + linkman: '', + // 备注信息 + soremark: '', + siremark: '', + // 箱型 + ctnInputs: [], + // edi补充信息 (edi联系人等暂无字段) + weituo: '', + freightpayer: '', + scaccode: '', + itncode: '', + iscontainersoc: 0, + bookingEDIExt: { + weiTuoFang: '', + ediAttn: '', + ediAttnTel: '', + ediAttnMail: '' + }, + // 分单信息未添加 + hbList: [] +} export default { name: 'BookingDetail', inject: ['reload'], @@ -275,9 +275,13 @@ export default { this.init() }, mounted() { - window.addEventListener('scroll', () => { - this.scrollTop = document.getElementById('app').scrollTop - }, true) + window.addEventListener( + 'scroll', + () => { + this.scrollTop = document.getElementById('app').scrollTop + }, + true + ) }, beforeRouteUpdate(to, from, next) { // console.log('fromId:', from.query.id, '| toId:', to.query.id) @@ -369,7 +373,7 @@ export default { next() setTimeout(() => { this.inChildLoading = false - }, 2000); + }, 2000) }, beforeRouteEnter(to, from, next) { next(vm => { @@ -379,10 +383,14 @@ export default { methods: { ...mapActions(['setNeedSavePages']), getRouterHis() { - console.log('Router 2.3 === beforeRouteEnter - getRouterHis ===', Object.keys(this.historyData), this.$route.query.id) + console.log( + 'Router 2.3 === beforeRouteEnter - getRouterHis ===', + Object.keys(this.historyData), + this.$route.query.id + ) this.inChildLoading = true const newId = this.$route.query.id - if (Object.keys(this.historyData).includes(`copy-${newId}`) && this.$route.query.isCopy === 'true') { + if (Object.keys(this.historyData).includes(`copy-${newId}`) && this.$route.query.isCopy === 'true') { this.id = this.$route.query.id const $data = JSON.parse(JSON.stringify(this.historyData[`copy-${newId}`])) this.bookingDetails = $data.bookingDetails @@ -477,8 +485,8 @@ export default { } this.inPageLoading = true this.inChildLoading = true - this.$message.loading({ content: '加载中...' }); - console.log('4.1 == 获取详情 ==', this.id) + this.$message.loading({ content: '加载中...' }) + // console.log('4.1 == 获取详情 ==', this.id) BookingOrderGet({ id: this.id }) @@ -505,14 +513,14 @@ export default { // 初始化箱型 累加 称重总重 if (res.data.ctnInputs.length > 0) { res.data.ctnInputs.map((item, index) => { - if (item.weightype === '累加') { - item.weighkgs = this.calc(Number(item['kgs']), Number(item['tareweight']), '+') - } + if (item.weightype === '累加') { + item.weighkgs = this.calc(Number(item['kgs']), Number(item['tareweight']), '+') + } }) } this.$set(this, 'bookingDetails', res.data) setTimeout(() => { - console.log(' 1. === 主单获取信息更新 ===') + // console.log(' 1. === 主单获取信息更新 ===') this.inChildLoading = false this.checkSaveFun({ type: 'details', hasChange: false }) }, 1500) @@ -527,25 +535,24 @@ export default { const { detail, type } = data // console.log('对比更新内容', this.ifCompare(this.bookingDetails, detail), !this.inChildLoading, this.ifCompare(this.bookingDetails, detail) && !this.inChildLoading) if (this.ifCompare(this.bookingDetails, detail) && !this.inChildLoading) { - console.log('2. == 这里子组件进行了更新 == ', type) + // console.log('2. == 这里子组件进行了更新 == ', type) this.checkSaveFun({ type: 'details', hasChange: true }) } this.bookingDetails = detail }, ifCompare(object1, object2) { - var o1keys = Object.keys(object1); - var o2keys = Object.keys(object2); - if (o2keys.length !== o1keys.length) return false; + var o1keys = Object.keys(object1) + var o2keys = Object.keys(object2) + if (o2keys.length !== o1keys.length) return false for (let i = 0; i <= o1keys.length - 1; i++) { - let key = o1keys[i]; - if (!o2keys.includes(key)) return false; - if (object2[key] !== object1[key]) return false; + let key = o1keys[i] + if (!o2keys.includes(key)) return false + if (object2[key] !== object1[key]) return false } - return true; + return true }, - bookingOrderUpdate() { if (!this.bookingDetails.mblno) { this.$message.error('请输入提单号') @@ -566,13 +573,18 @@ export default { // console.log('1.2 == 保存成功 - 刷新路由 ==', this.id) this.$router.replace({ name: 'BookingDetail', - query: { id: this.id, type: this.bookingDetails.carrierid, noOpenTab: true, mblno: this.bookingDetails.mblno } + query: { + id: this.id, + type: this.bookingDetails.carrierid, + noOpenTab: true, + mblno: this.bookingDetails.mblno + } }) } // this.init() this.$forceUpdate() } else { - if (typeof (res.message) === 'string') { + if (typeof res.message === 'string') { this.$message.error(res.message) } else { this.$message.error('保存失败') @@ -599,11 +611,16 @@ export default { this.$message.success('保存成功') this.$router.replace({ name: 'BookingDetail', - query: { id: res.data, type: this.bookingDetails.carrierid, noOpenTab: true, mblno: this.bookingDetails.mblno } + query: { + id: res.data, + type: this.bookingDetails.carrierid, + noOpenTab: true, + mblno: this.bookingDetails.mblno + } }) this.$forceUpdate() } else { - if (typeof (res.message) === 'string') { + if (typeof res.message === 'string') { this.$message.error(res.message) } else { this.$message.error('保存失败') @@ -642,7 +659,10 @@ export default { changePageFun(type) { const _this = this const key = this.$route.fullPath - if (Object.keys(this.needSavePages).includes(key) && (this.needSavePages[key].details || this.needSavePages[key].hbList)) { + if ( + Object.keys(this.needSavePages).includes(key) && + (this.needSavePages[key].details || this.needSavePages[key].hbList) + ) { // console.log('== 切换上一票下一票 - biu 弹窗出现 ==') this.$confirm({ title: '请确认无未保存数据!', @@ -659,7 +679,7 @@ export default { this.changePage(type) } }, - changePage (type) { + changePage(type) { const nowId = this.$route.query.id const arr = Object.keys(this.bookingList) const index = arr.indexOf(nowId.toString()) @@ -720,18 +740,18 @@ export default { this.tabActiveKey = '2' this.Showtabs = true }, - changeHBFun (data) { + changeHBFun(data) { const arr = data.map((item, index) => { return item.isNoSave }) - console.log('3. === 分单更新 ===') + // console.log('3. === 分单更新 ===') if (arr.includes(true)) { this.checkSaveFun({ type: 'hbList', hasChange: true }) } else { this.checkSaveFun({ type: 'hbList', hasChange: false }) } }, - checkSaveFun (data) { + checkSaveFun(data) { // if (this.inPageLoading) { // return false // } @@ -746,19 +766,19 @@ export default { const key = this.$route.fullPath this.$set(lastPages, key, $data) this.setNeedSavePages(lastPages) - console.log('== vuex 配置更新信息 ==', this.needSavePages) + // console.log('== vuex 配置更新信息 ==', this.needSavePages) }, calc(num1, num2, calcStr) { - var str1; // 转换为字符串的数字 - var str2; - var ws1 = 0; // ws1,ws2 用来存储传入的num的小数点后的数字的位数 - var ws2 = 0; // 赋默认值,解决当整数和小数运算时倍数计算错误导致的结果误差 - var bigger; // bigger和smaller用于加,减,除法找出小的那个数字,给后面补0,解决位数不对从而造成的计算错误的问题;乘法需要将结果除两个数字的倍数之和 - var smaller; // 例如:加减除法中1.001 + 2.03 ,如果不给2.03进行补0,最后会变成1001+203,数字错位导致结果错误;乘法中1.12*1.1会放大为112*11,所以结果需要除以1000才会是正确的结果,112*11/1000=1.232 - var zeroCount; // 需要补充0的个数 - var isExistDot1; // 传入的数字是否存在小数点 - var isExistDot2; - var sum; + var str1 // 转换为字符串的数字 + var str2 + var ws1 = 0 // ws1,ws2 用来存储传入的num的小数点后的数字的位数 + var ws2 = 0 // 赋默认值,解决当整数和小数运算时倍数计算错误导致的结果误差 + var bigger // bigger和smaller用于加,减,除法找出小的那个数字,给后面补0,解决位数不对从而造成的计算错误的问题;乘法需要将结果除两个数字的倍数之和 + var smaller // 例如:加减除法中1.001 + 2.03 ,如果不给2.03进行补0,最后会变成1001+203,数字错位导致结果错误;乘法中1.12*1.1会放大为112*11,所以结果需要除以1000才会是正确的结果,112*11/1000=1.232 + var zeroCount // 需要补充0的个数 + var isExistDot1 // 传入的数字是否存在小数点 + var isExistDot2 + var sum var beishu = 1 // 将数字转换为字符串 str1 = num1.toString() @@ -912,47 +932,47 @@ export default { // // padding-top: 4px !important; // background: #f99 !important; // } -.ant-input-affix-wrapper .ant-input:not(:last-child){ +.ant-input-affix-wrapper .ant-input:not(:last-child) { height: 28px !important; // margin-top: 4px !important; // background: #9f9 !important; } -.ant-select-selection{ +.ant-select-selection { height: 28px !important; // margin-top: 4px !important; // background: #f00 !important; } -.ant-input:placeholder-shown{ +.ant-input:placeholder-shown { height: 28px !important; // margin-top: 4px !important; // background: #99f !important; } -.ant-calendar-picker-input.ant-input{ +.ant-calendar-picker-input.ant-input { height: 28px !important; // margin-top: 4px !important; } -.ant-form-item-label{ +.ant-form-item-label { // line-height: 30px !important; // border: 1px solid #f00; } -.ant-form-item-control-wrapper{ +.ant-form-item-control-wrapper { // border: 1px solid #f99; // height: 30px; // vertical-align: top; // padding: 0; } -.left-box{ +.left-box { // padding-top: 60px; } -.normal-nav{ - transition: .5s all; +.normal-nav { + transition: 0.5s all; } -.fixed-nav{ +.fixed-nav { position: fixed; top: 56px; - box-shadow:0px 15px 10px -15px #ccc; + box-shadow: 0px 15px 10px -15px #ccc; z-index: 999; - background:#fff; - transition: .5s all; + background: #fff; + transition: 0.5s all; } diff --git a/src/views/main/BookingLedger/detail/modules/operationArea.vue b/src/views/main/BookingLedger/detail/modules/operationArea.vue index f83e400..a5c6794 100644 --- a/src/views/main/BookingLedger/detail/modules/operationArea.vue +++ b/src/views/main/BookingLedger/detail/modules/operationArea.vue @@ -639,6 +639,27 @@ export default { methods: { // ========== OCR ========== FnClickCvBox(data) { + // let Arr = ['pkgs', 'cbm', 'kgs', 'portdischarge', 'destination', 'kindpkgs'] + // let Type = false + // Arr.forEach(item => { + // if (data.code == item) { + // Type = true + // } + // }) + // if (Type) { + // if (data.code == 'pkgs' || data.code == 'cbm' || data.code == 'kgs') { + // this.details[data.code] = parseInt(this.Rdata) + // } else { + // this.details[data.code] = this.Rdata + // } + // } else { + // this.details[data.code] = this.details[data.code] + this.Rdata + // } + console.log(data) + console.log(data.code) + console.log(this.details) + console.log(this.details[data.code]) + console.log(this.Rdata) this.details[data.code] = this.details[data.code] + this.Rdata this.CvBoxType = false this.BCvData.forEach((item, index) => { @@ -710,10 +731,10 @@ export default { uploadFile(file) { const formData = new FormData() formData.append('file', file.file) - formData.append('bookingId', this.id) + // formData.append('bookingId', this.id) const type = file.file.type console.log(type) - BookingOrderOcrUpFile(formData).then(res => { + BookingOrderOcrUpFile({ data: formData, parameter: { bookingId: this.id } }).then(res => { this.fileName = res.data BookingOrderOcrGetImg({ fileName: this.fileName, scale: this.scale }).then(res => { this.imgSrc = window.URL.createObjectURL(new Blob([res], { type: `${type};chartset=UTF-8` })) @@ -1235,16 +1256,16 @@ export default { }) .then(res => { this.downLoadLoading = false - this.pdfUrl = window.URL.createObjectURL(new Blob([res], { type: 'application/pdf;charset=utf-8' })) - const fname = '放舱打印' // 下载文件的名字 - const link = document.createElement('a') - link.href = this.pdfUrl - link.setAttribute('download', fname) - document.body.appendChild(link) - link.click() - if (res.message) { - this.$message.error(res.message) - } + this.pdfUrl = window.URL.createObjectURL(new Blob([res], { type: 'application/pdf;charset=utf-8' })) + const fname = '放舱打印' // 下载文件的名字 + const link = document.createElement('a') + link.href = this.pdfUrl + link.setAttribute('download', fname) + document.body.appendChild(link) + link.click() + if (res.message) { + this.$message.error(res.message) + } }) .catch(() => { this.downLoadLoading = false