diff --git a/src/store/getters.js b/src/store/getters.js index a442f3e..05122e0 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -36,6 +36,7 @@ const getters = { countryList: state => state.booking.countryList, saveFlag: state => state.booking.saveFlag, firstFlag: state => state.user.firstFlag, + topDown: state => state.booking.topDown, dpTreeList: state => state.booking.dpTreeList, inBookingDetailsSave: state => state.booking.inBookingDetailsSave, kdAddData: state => state.KD.kdAddData diff --git a/src/store/modules/booking.js b/src/store/modules/booking.js index 053b6e4..2b469de 100644 --- a/src/store/modules/booking.js +++ b/src/store/modules/booking.js @@ -20,7 +20,8 @@ const booking = { copyPages: { number: 0, path: '' }, yardList: [], saveNeedNumber: '', - deleteId:'', + deleteId: '', + topDown: false, saveFlag: false, packageList: [], issuetypeList: [], @@ -115,7 +116,11 @@ const booking = { }, SET_SAVENEEDCar: (state, id) => { state.saveNeedCar = id + }, + SET_SAVETOPDOWN: (state, bool) => { + state.topDown = bool } + }, actions: { diff --git a/src/views/main/BookingLedger/detail/index.vue b/src/views/main/BookingLedger/detail/index.vue index 7a881ac..9c5ed65 100644 --- a/src/views/main/BookingLedger/detail/index.vue +++ b/src/views/main/BookingLedger/detail/index.vue @@ -18,6 +18,7 @@ :scrollTop="scrollTop" @refresh="refreshPage" @save="saveFun" + @ocrUpflie="ocrUpflie" @rules="getRules" @changePage="changePageFun" @copy="copyBookingFun" @@ -111,6 +112,7 @@ :details="bookingDetails" :excuteRules="excuteRules" :excuteRulesType="excuteRulesType" + @fileNewUpadte="fileNewUpadte" @changeAtd="changeAtd" @changeDetail="changeDetailFun" @handleComplete="handleComplete" @@ -280,6 +282,7 @@ const initDetail = { scaccode: '', itncode: '', iscontainersoc: 0, + tempFiles: [], bookingEDIExt: { weiTuoFang: '', ediAttn: '', @@ -445,7 +448,8 @@ export default { 'packageList', 'issuetypeList', 'blfrtList', - 'inBookingDetailsSave' + 'inBookingDetailsSave', + 'topDown' ]) }, created() { @@ -739,6 +743,10 @@ export default { this.bookingDetails = { ...JSON.parse(JSON.stringify(initDetail)), ...copyData } } else { this.bookingDetails = $data.bookingDetails + console.log(this.topDown) + if (this.topDown) { + this.getDetail() + } this.getRightAll() } setTimeout(() => { @@ -918,7 +926,7 @@ export default { if (item.Carrier) { if (this.bookingDetails.carrierid == item.Carrier) { Fn(item) - } + } // else { // item.code = '' // Fn(item) @@ -1078,9 +1086,11 @@ export default { .then(res => { this.$message.destroy() this.setDeatilsFun(res, false) + this.$store.commit('SET_SAVETOPDOWN', false) }) .catch(err => { console.log(err) + this.$store.commit('SET_SAVETOPDOWN', false) }) }, @@ -1089,7 +1099,10 @@ export default { res.data.bookingEDIExt = bookingEDIExt } if (res.data.cargoid == 'R') { - this.cargoRules['description'][0].required = true + this.cargoRules['goodsname'][0].required = true + } + if (res.data.cargoid != 'R') { + this.cargoRules['goodsname'][0].required = false } if (res.data.ctnInputs.length > 0) { res.data.ctnInputs.map((item, index) => { @@ -1188,7 +1201,18 @@ export default { }, 1200) this.$forceUpdate() }, - + ocrUpflie(file) { + this.bookingDetails.tempFiles.push({ + tempPathName: file + }) + }, + fileNewUpadte(file) { + this.bookingDetails.tempFiles.push({ + tempPathName: file.tempPathName, + typeCode: file.TypeCode, + typeName: file.TypeName + }) + }, getRightAll() { GetAllData({ bookingId: this.$route.query.id @@ -1559,6 +1583,7 @@ export default { const $data = this.needSavePages delete $data[this.$route.fullPath] this.setNeedSavePages($data) + this.$store.commit('SET_SAVETOPDOWN', true) this.$router.replace({ name: 'BookingDetail', query: { id: prevId, type: prevType, mblno: this.bookingList[prevId].mblno, noOpenTab: true } @@ -1573,6 +1598,7 @@ export default { const $data = this.needSavePages delete $data[this.$route.fullPath] this.setNeedSavePages($data) + this.$store.commit('SET_SAVETOPDOWN', true) this.$router.replace({ name: 'BookingDetail', query: { id: nextId, type: nextType, mblno: this.bookingList[nextId].mblno, noOpenTab: true } diff --git a/src/views/main/BookingLedger/detail/modules/cargoInfo.vue b/src/views/main/BookingLedger/detail/modules/cargoInfo.vue index 415b290..3a64d76 100644 --- a/src/views/main/BookingLedger/detail/modules/cargoInfo.vue +++ b/src/views/main/BookingLedger/detail/modules/cargoInfo.vue @@ -41,7 +41,7 @@
-
@@ -50,8 +50,8 @@ @click="handleOpen(2)" style="cursor: pointer;" class="copy-btn iconfont icon-bianji">
-
-
+
--> +
@@ -819,9 +820,9 @@ export default { } else if (type === 'cargoid') { this.details.cargoid = res.code || '' if (res.code == 'R') { - this.rules['description'][0].required = true + this.rules['goodsname'][0].required = true } else { - this.rules['description'][0].required = false + this.rules['goodsname'][0].required = false } } else if (['kindpkgs'].includes(type)) { this.details.kindpkgs = res['name'] || '' diff --git a/src/views/main/BookingLedger/detail/modules/operationArea.vue b/src/views/main/BookingLedger/detail/modules/operationArea.vue index edf2355..6b9eb65 100644 --- a/src/views/main/BookingLedger/detail/modules/operationArea.vue +++ b/src/views/main/BookingLedger/detail/modules/operationArea.vue @@ -1353,11 +1353,25 @@ export default { formData.append('file', file.file) // formData.append('bookingId', this.id) const type = file.file.type - 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` })) - }) + let id = this.id + if (this.$route.query.isCopy) { + id = 0 + } + if (!this.id) { + id = 0 + } + BookingOrderOcrUpFile({ data: formData, parameter: { bookingId: id } }).then(res => { + if (res.success) { + this.fileName = res.data.ocrFileName + if (id == 0) { + this.$emit('ocrUpflie', res.data.uploadFileName) + } + BookingOrderOcrGetImg({ fileName: this.fileName, scale: this.scale }).then(res => { + this.imgSrc = window.URL.createObjectURL(new Blob([res], { type: `${type};chartset=UTF-8` })) + }) + } else { + this.$message.error(res.message) + } }) }, ShowOCR() { @@ -2064,5 +2078,4 @@ export default { diff --git a/src/views/main/BookingLedger/detail/modules/rightContent.vue b/src/views/main/BookingLedger/detail/modules/rightContent.vue index 224d72b..5d9f1eb 100644 --- a/src/views/main/BookingLedger/detail/modules/rightContent.vue +++ b/src/views/main/BookingLedger/detail/modules/rightContent.vue @@ -788,10 +788,10 @@ export default { } }, addFile() { - if (!this.id) { - this.$message.error('请先保存主单') - return false - } + // if (!this.id) { + // this.$message.error('请先保存主单') + // return false + // } this.fileModelvisible = true }, fileModelCancel() { @@ -829,9 +829,16 @@ export default { this.$message.error('请选择附件类型') return false } + let id = this.id + if (this.$route.query.isCopy) { + id = 0 + } + if (!this.id) { + id = 0 + } const formData = new FormData() formData.append('file', upFileList[0]) - formData.append('BookingId', this.id) + formData.append('BookingId', id) formData.append('TypeCode', attachCode) formData.append('TypeName', attachName) this.uploading = true @@ -839,7 +846,16 @@ export default { .then(res => { if (res.success) { this.$message.success('上传成功') - this.$emit('upDateRight') + if (id != 0) { + this.$emit('upDateRight') + } + if (id == 0) { + this.$emit('fileNewUpadte', { + tempPathName: res.data, + TypeCode: attachCode, + TypeName: attachName + }) + } } else { this.$message.error(res.message) } diff --git a/src/views/main/BookingLedger/detail/modules/rightContentTest.vue b/src/views/main/BookingLedger/detail/modules/rightContentTest.vue index 9c75381..adddfc4 100644 --- a/src/views/main/BookingLedger/detail/modules/rightContentTest.vue +++ b/src/views/main/BookingLedger/detail/modules/rightContentTest.vue @@ -130,8 +130,11 @@
-
- +
+
{{ serive.showName }}
-
+
-
-
- +
+ + +
-
{{ serive.showName }}
+
{{ serive.showName }}
-
+
-
+
@@ -1243,11 +1253,13 @@ export default { padding: 2px; position: relative; cursor: pointer; + align-items: flex-start; + margin-top: 5px; &:hover { .goods-content { - border: 1px dashed rgb(19, 194, 194); - background-color: rgb(237, 251, 251); + // border: 1px dashed rgb(19, 194, 194); + // background-color: rgb(237, 251, 251); } .box-edit { @@ -1256,27 +1268,34 @@ export default { } .goods-content { - display: flex; + // display: flex; border: 1px dashed white; - font-size: 12px; + font-size: 14px; font-weight: bold; - &.active{ - color: rgb(22, 119, 255); + + &.active { + color: rgb(48,172,214); } } - + .serve-icon{ + font-size:22px; + display: block; + margin: 0 auto; + margin-bottom: 5px; + } .round { - width: 15px; - height: 15px; - line-height: 11px; + width: 22px; + height: 22px; + line-height: 15px; border-radius: 50%; - margin-right: 3px; - font-size: 12px; + // margin-right: 3px; + margin: 0 auto; + font-size: 15px; text-align: center; - border: 1px solid rgb(146, 146, 146); - + border: 2px solid rgb(146, 146, 146); + margin-bottom: 5px; &.active { - border: 1px solid rgb(22, 119, 255); + border: 1px solid rgb(48,172,214); } } @@ -1284,25 +1303,33 @@ export default { width: 17px; height: 17px; border-radius: 0 3px 0 0; - background: #c9c9c9; + // background: #c9c9c9; display: none; position: absolute; - right: -1px; + left: 0px; top: -1px; text-align: center; line-height: 17px; } } -.box-line{ - height: 1px; - width: 10px; - background: rgb(179, 175, 175); - margin-left: 3px; - &.active { - border: 1px solid rgb(22, 119, 255); - } - } - .isBr{ - width: 100%; +.showName{ + width: 48px; + font-size: 12px; + text-align: center; +} +.box-line { + height: 1px; + width: 10px; + background: rgb(179, 175, 175); + // margin-left: 3px; + margin-top: 10px; + + &.active { + border: 1px solid rgb(48,172,214); } +} + +.isBr { + width: 100%; +}