From e63492cfa910f8c15ff147cfe9bb9e9d782660b6 Mon Sep 17 00:00:00 2001 From: sunzehua Date: Thu, 11 May 2023 15:32:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .prettierrc | 3 +- .../detail/modules/goodsTable.vue | 51 +++++++------ .../detail/modules/mailingInfo.vue | 7 +- .../BookingLedger/detail/modules/preOrder.vue | 72 +++++++++++-------- 4 files changed, 79 insertions(+), 54 deletions(-) diff --git a/.prettierrc b/.prettierrc index cbe842a..c39f3b8 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,6 @@ { "printWidth": 120, "semi": false, - "singleQuote": true + "singleQuote": true, + "trailingComma": "none" } diff --git a/src/views/main/BookingLedger/detail/modules/goodsTable.vue b/src/views/main/BookingLedger/detail/modules/goodsTable.vue index 2c9d577..b827fd4 100644 --- a/src/views/main/BookingLedger/detail/modules/goodsTable.vue +++ b/src/views/main/BookingLedger/detail/modules/goodsTable.vue @@ -35,7 +35,7 @@ :table-data="tableData" borderY ref="tableRef" - style="min-width:970;" + style="min-width: 970" :cell-autofill-option="cellAutofillOption" :editOption="editOption" :rowKeyFieldName="rowKeyName" @@ -71,7 +71,7 @@ >
{ + on-change={(val) => { // console.log('== 箱型内部监听change ==') if (val !== undefined) { const data = this.ctnallList[val] @@ -192,11 +192,11 @@ export default { this.tableData[rowIndex].ctncode = '' } }} - on-focus={val => { + on-focus={(val) => { // console.log('== 箱型内部监听focus ==') this.ctnallViewIndex = rowIndex }} - on-blur={val => { + on-blur={(val) => { // 箱信息 下拉框自动弹出部分 - 测试中 // console.log('== 箱型内部监听blur ==', this.ctnallViewIndex, rowIndex) this.ctnallViewIndex = null @@ -303,7 +303,7 @@ export default { filter-option={this.filterOption} style="width: 120px" class="kindpkgsView" - on-change={val => { + on-change={(val) => { if (val !== undefined) { const data = this.packageList[val] this.tableData[rowIndex].kindpkgs = data.name @@ -346,11 +346,11 @@ export default { val: row['kindpkgs'] }) }} - on-focus={val => { + on-focus={(val) => { this.kindpkgsViewIndex = rowIndex // console.log('=获取焦点=', rowIndex, this.kindpkgsViewIndex) }} - on-blur={val => { + on-blur={(val) => { // 箱信息 下拉框自动弹出部分 - 测试中 this.kindpkgsViewIndex = null // console.log('=失去焦点=', rowIndex, this.kindpkgsViewIndex) @@ -364,7 +364,7 @@ export default { // this.setCellSelection(rowIndex, 'kgs') // }, 200) }} - on-input={val => { + on-input={(val) => { // console.log('== input - 修改内容==', val) }} > @@ -442,7 +442,7 @@ export default { value={row['weightype']} option-filter-prop="children" style="width: 80px" - on-change={val => { + on-change={(val) => { this.tableData[rowIndex].weightype = val row['weightype'] = val if (row['weightype'] === '累加') { @@ -602,7 +602,7 @@ export default { value={row['kindpkgs']} option-filter-prop="children" style="width: 120px" - on-change={val => { + on-change={(val) => { const data = this.packageList[val] row['kindpkgs'] = data.name this.childTableData[rowIndex].kindpkgs = data.name @@ -1075,10 +1075,10 @@ export default { if (nval) { const editDom = document.getElementsByClassName('ve-table-edit-input')[0] // console.log('窗扣生成', editDom) - editDom.addEventListener('focus', e => { + editDom.addEventListener('focus', (e) => { // console.log('== 当前是否允许编辑 ==', this.cellSelectionOption.enable) // if (!this.cellSelectionOption.enable) { return false } - document.onkeydown = event => { + document.onkeydown = (event) => { // 临时功能 - start if (event.key === 'Backspace' && this.ctnallViewIndex !== null) { const val = document @@ -1449,10 +1449,10 @@ export default { bookingId: this.id, isWeb: false }) - .then(res => { + .then((res) => { if (res.success) { let type = true - this.tableData.forEach(item => { + this.tableData.forEach((item) => { if (item.sealno || item.cntrno) { this.$message.error('请清空所有箱封号后再引入') type = false @@ -1527,7 +1527,7 @@ export default { } this.sealnoLoading = false }) - .catch(err => { + .catch((err) => { console.log(err) this.sealnoLoading = false }) @@ -1542,18 +1542,24 @@ export default { bookingId: this.id, isWeb: false }) - .then(res => { + .then((res) => { if (res.success) { const data = JSON.parse(res.data) const addTable = [] const cntrnoArr = [] + let kindpkgsOld = '' this.tableData.map((item, index) => { + console.log(item.kindpkgs) if (!item.cntrno) { // delete this.tableData[index] this.tableData.splice(index, 1) } else { cntrnoArr.push(item.cntrno) } + console.log(item.kindpkgs) + if (item.kindpkgs !== '') { + kindpkgsOld = item.kindpkgs + } }) const lastNum = this.tableData.length > 0 ? Number(this.tableData[this.tableData.length - 1].rowKey) + 1 : 0 data.map((item, index) => { @@ -1565,7 +1571,7 @@ export default { cntrno: item.CNTRNO, sealno: item.SEALNO, pkgs: item.PKGS, - kindpkgs: item.KINDPKGS, + kindpkgs: kindpkgsOld || item.KINDPKGS, kgs: item.KGS, cbm: item.CBM, tareweight: item.TAREWEIGHT, @@ -1581,7 +1587,7 @@ export default { cntrno: item.CNTRNO, sealno: item.SEALNO, pkgs: item.PKGS, - kindpkgs: item.KINDPKGS, + kindpkgs: kindpkgsOld || item.KINDPKGS, kgs: item.KGS, cbm: item.CBM, tareweight: item.TAREWEIGHT, @@ -1594,13 +1600,14 @@ export default { }) this.tableData = [...this.tableData, ...addTable] + console.log(this.tableData) this.$forceUpdate() } else { this.$message.error(res.message) } this.YarnLoading = false }) - .catch(err => { + .catch((err) => { console.log(err) this.YarnLoading = false }) @@ -1695,7 +1702,7 @@ export default { bookingId: this.id, isWeb: false }) - .then(res => { + .then((res) => { if (res.success) { const data = JSON.parse(res.data) const addTable = [] @@ -1757,7 +1764,7 @@ export default { } this.WeightLoading = false }) - .catch(err => { + .catch((err) => { console.log(err) this.WeightLoading = false }) diff --git a/src/views/main/BookingLedger/detail/modules/mailingInfo.vue b/src/views/main/BookingLedger/detail/modules/mailingInfo.vue index fdc779f..b83688a 100644 --- a/src/views/main/BookingLedger/detail/modules/mailingInfo.vue +++ b/src/views/main/BookingLedger/detail/modules/mailingInfo.vue @@ -963,7 +963,7 @@ export default { }, wait) }, checkbasic() { - this.$refs.mailingFrom.validate(valid => { + this.$refs.mailingFrom.validate((valid) => { if (valid) { return true } else { @@ -1008,14 +1008,14 @@ export default { content: this.modelContent, remark: '' }) - .then(res => { + .then((res) => { if (res.success) { this.$message.success('保存成功') this.handleModelCancel() this.$forceUpdate() } }) - .catch(err => { + .catch((err) => { console.log(err) }) }, @@ -1317,6 +1317,7 @@ export default { val += k } this.details[type] = val + console.log(this.details.shipper.split('\n')) this.$forceUpdate() }, inputChange({ type, value }) { diff --git a/src/views/main/BookingLedger/detail/modules/preOrder.vue b/src/views/main/BookingLedger/detail/modules/preOrder.vue index 371c792..5c3aab0 100644 --- a/src/views/main/BookingLedger/detail/modules/preOrder.vue +++ b/src/views/main/BookingLedger/detail/modules/preOrder.vue @@ -94,7 +94,7 @@ - + @@ -1120,7 +1120,7 @@ :showLabel="['name', 'showCode']" :openSearch="false" @change="getSelectViewRes" - style="width:200px;" + style="width: 200px" >
@@ -1440,7 +1440,7 @@ export default { allow-clear={true} style="width: 120px" filter-option={this.filterOption} - on-change={val => { + on-change={(val) => { // console.log('== 箱型内部监听change ==') if (val !== undefined) { const data = this.ctnallList[val] @@ -1454,13 +1454,13 @@ export default { // this.orderDetails.ediCtn[rowIndex].ctncode = '' } }} - on-focus={val => { + on-focus={(val) => { // this.ctnallViewIndex = rowIndex }} - on-blur={val => { + on-blur={(val) => { // this.ctnallViewIndex = null }} - on-inputKeydown={val => { + on-inputKeydown={(val) => { if (val.key == 'Backspace') { setTimeout(() => { val.target.value = val.target.value.slice(0, -1) @@ -1549,7 +1549,7 @@ export default { filter-option={this.filterOption} style="width: 120px" class="pre-kindpkgsView" - on-change={val => { + on-change={(val) => { if (val !== undefined) { const data = this.packageList[val] this.orderDetails.ediCtn[rowIndex].kindpkgs = data.name @@ -1589,13 +1589,13 @@ export default { } this.orderDetails.kindpkgs = row['kindpkgs'] }} - on-focus={val => { + on-focus={(val) => { this.kindpkgsViewIndex = rowIndex }} - on-blur={val => { + on-blur={(val) => { this.kindpkgsViewIndex = null }} - on-inputKeydown={val => { + on-inputKeydown={(val) => { if (val.key == 'Backspace') { setTimeout(() => { val.target.value = val.target.value.slice(0, -1) @@ -1912,14 +1912,14 @@ export default { country: this.orderDetails[`${this.modelType}countryName`], tel: this.orderDetails[`${this.modelType}tel`] }) - .then(res => { + .then((res) => { if (res.success) { this.$message.success('保存成功') this.handleModelCancel() this.$forceUpdate() } }) - .catch(err => { + .catch((err) => { console.log(err) }) }, @@ -1943,7 +1943,7 @@ export default { total(type) { let Rdata = 0 if (this.orderDetails.ediCtn) { - this.orderDetails.ediCtn.forEach(item => { + this.orderDetails.ediCtn.forEach((item) => { Rdata = parseFloat(Rdata) + parseFloat(item[type]) || 0 }) } @@ -1995,7 +1995,7 @@ export default { getPageESeaeEdi({ bookingId: this.id }) - .then(res => { + .then((res) => { if (!res.success) { this.$message.error(res.message) } @@ -2014,7 +2014,7 @@ export default { } this.preOrderLoad = true }) - .catch(err => { + .catch((err) => { console.log(err) }) }, @@ -2089,7 +2089,7 @@ export default { } console.log(type, 'type') if (isHBL || type == 'enter') { - $details.ctnInputs.forEach(item => { + $details.ctnInputs.forEach((item) => { $data.ediCtn.push({ ctnall: item.ctnall, cntrno: item.cntrno, @@ -2105,7 +2105,7 @@ export default { if (isHBL && type != 'enter') { console.log('复制主单信息') console.log(this.orderList, this.orderDetails) - this.orderList.forEach(item => { + this.orderList.forEach((item) => { if (!item.isHBL) { $data.shippername = item.shippername $data.shipperaddR1 = item.shipperaddR1 @@ -2126,7 +2126,7 @@ export default { $data.forwarder = item.forwarder $data.carrier = item.carrier $data.ediCtn = item.ediCtn - $data.ediCtn.forEach(e => { + $data.ediCtn.forEach((e) => { delete e.id }) } @@ -2144,12 +2144,28 @@ export default { // }) // } if ($data.portdischargeid) { - GetPortlist({ KeyWord: $data.portdischargeid }).then(res => { + GetPortlist({ KeyWord: $data.portdischargeid }).then((res) => { console.log(res.data[0], 'res.data[0]') $data.consigneecountry = res.data[0].countryCode $data.consigneecountryName = `${res.data[0].countryCode}/${res.data[0].cnName}` }) } + if ($details.shipper) { + const newArr = $details.shipper.split('\n') + $data.shippername = newArr[0] + $data.shipperaddR1 = newArr[0] + } + if ($details.consignee) { + const newArr = $details.consignee.split('\n') + $data.consigneename = newArr[0] + $data.consigneeaddR1 = newArr[0] + } + if ($details.notifyparty) { + const newArr = $details.notifyparty.split('\n') + $data.notifypartyname = newArr[0] + $data.notifypartyaddR1 = newArr[0] + } + // if ($data.placedeliveryid) { // $data.consigneecountry = 'CN' // $data.consigneecountryName = '中国' @@ -2196,7 +2212,7 @@ export default { } const query = this.$qs.stringify({ Ids: removeArr.toString() }, { arrayFormat: 'repeat' }) seaeEdiDelete(query) - .then(res => { + .then((res) => { if (res.success) { this.removeFun() } else { @@ -2204,7 +2220,7 @@ export default { this.removeFun(tempArr) } }) - .catch(err => { + .catch((err) => { console.log(err) }) }, @@ -2284,7 +2300,7 @@ export default { console.log('== 即将发送单号 ==', sendArr) const query = this.$qs.stringify({ Ids: sendArr.toString() }, { arrayFormat: 'repeat' }) seaeEdiCustEDI(query) - .then(res => { + .then((res) => { if (res.success) { this.$message.success('发送成功') this.selectArr.map((item, index) => { @@ -2294,7 +2310,7 @@ export default { this.$message.error(res.message) } }) - .catch(err => { + .catch((err) => { console.log(err) }) }, @@ -2575,7 +2591,7 @@ export default { delete item.rowKey }) seaeEdiSave($data) - .then(res => { + .then((res) => { if (res.success) { this.$message.success('保存成功') res.data[0].ediCtn.map((item, index) => { @@ -2589,7 +2605,7 @@ export default { this.selectArr = [] } }) - .catch(err => { + .catch((err) => { console.log(err) }) }, @@ -2670,7 +2686,7 @@ export default { { arrayFormat: 'repeat' } ) seaeEdiCustEDI(query) - .then(res => { + .then((res) => { this.sendLoading = false if (res.success) { let tip = '' @@ -2696,7 +2712,7 @@ export default { this.$message.error(res.message) } }) - .catch(err => { + .catch((err) => { this.sendLoading = false console.log(err) })