From 19c1d7287797a522f1e2cd05520c8752986cc0d4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=A0=E5=90=8C=E6=B5=B7?= <963808678@qq.com>
Date: Thu, 24 Nov 2022 12:32:14 +0800
Subject: [PATCH] 11/24
---
.env.development | 8 +-
.../detail/modules/basicInfo.vue | 58 +++++++++---
.../detail/modules/operationArea.vue | 90 +++++++++----------
3 files changed, 95 insertions(+), 61 deletions(-)
diff --git a/.env.development b/.env.development
index c5c6fc9..21e8923 100644
--- a/.env.development
+++ b/.env.development
@@ -1,7 +1,7 @@
NODE_ENV=development
VUE_APP_PREVIEW=true
-//VUE_APP_API_BASE_URL=http://60.209.125.238:25805
-//VUE_APP_SOCKET_BASE_URL=http://60.209.125.238:25805
+VUE_APP_API_BASE_URL=http://60.209.125.238:25805
+VUE_APP_SOCKET_BASE_URL=http://60.209.125.238:25805
-VUE_APP_API_BASE_URL=http://127.0.0.1:5000
-VUE_APP_SOCKET_BASE_URL=http://127.0.0.1:5000
\ No newline at end of file
+//VUE_APP_API_BASE_URL=http://127.0.0.1:5000
+//VUE_APP_SOCKET_BASE_URL=http://127.0.0.1:5000
\ No newline at end of file
diff --git a/src/views/main/BookingLedger/detail/modules/basicInfo.vue b/src/views/main/BookingLedger/detail/modules/basicInfo.vue
index dc2c60d..2949d35 100644
--- a/src/views/main/BookingLedger/detail/modules/basicInfo.vue
+++ b/src/views/main/BookingLedger/detail/modules/basicInfo.vue
@@ -742,22 +742,37 @@ export default {
// ---------- 新增 ----------
async insertEvent(row) {
const $table = this.$refs.xTable
- const record = {
- sex: '1',
- date12: '2021-01-01'
- }
+ const record = {}
const { row: newRow } = await $table.insertAt(record, row)
await $table.setActiveCell(newRow, 'name')
},
// ---------- 保存 ----------
saveEvent() {
- // const $table = this.$refs.xTable
- // const { insertRecords, removeRecords, updateRecords } = $table.getRecordset()
- // console.log(
- // `insertRecords=${insertRecords.length} removeRecords=${removeRecords.length} updateRecords=${updateRecords.length}`
- // )
- console.log(this.tableData)
- BookingOrderContactSavebatch(this.tableData).then(res => {
+ const $table = this.$refs.xTable
+ const { fullData } = $table.getTableData()
+ fullData.forEach(item => {
+ item.WroleCode = ''
+ if (item.roleCode) {
+ item.roleCode.forEach(e => {
+ this.ContactType.forEach(item2 => {
+ if (e == item2.name) {
+ if (item.WroleCode) {
+ item.WroleCode = `${item.WroleCode}[${item2.code}]`
+ } else {
+ item.WroleCode = `[${item2.code}]`
+ }
+ }
+ })
+ })
+ }
+ })
+ let data = JSON.parse(JSON.stringify(fullData))
+ data.forEach(item => {
+ // if (item.WroleCode) {
+ item.roleCode = item.WroleCode
+ // }
+ })
+ BookingOrderContactSavebatch(data).then(res => {
console.log(res)
})
},
@@ -1004,12 +1019,31 @@ export default {
if (this.details.customerid) {
this.customerType = type
this.customerVisible = true
- console.log(this.details)
+
DjyCustomerdetail({ id: this.details.customerid }).then(res => {
console.log(res.data.contacts)
this.customerContactsData = res.data.contacts
})
BookingOrderContactPage({ id: this.details.customerid, pageSize: 999 }).then(res => {
+ res.data.rows.forEach(item => {
+ let WroleCode = []
+ if (item.roleCode) {
+ item.roleCode.split(']').forEach(e => {
+ if (e) {
+ e.split('[').forEach(i => {
+ if (i) {
+ this.ContactType.forEach(item2 => {
+ if (item2.code == i) {
+ WroleCode.push(item2.name)
+ }
+ })
+ }
+ })
+ }
+ })
+ }
+ item.roleCode = WroleCode
+ })
this.tableData = res.data.rows
})
} else {
diff --git a/src/views/main/BookingLedger/detail/modules/operationArea.vue b/src/views/main/BookingLedger/detail/modules/operationArea.vue
index a165b8b..4c87f8f 100644
--- a/src/views/main/BookingLedger/detail/modules/operationArea.vue
+++ b/src/views/main/BookingLedger/detail/modules/operationArea.vue
@@ -101,7 +101,7 @@
关闭
保存EDI文件
- 上传EDT
+ 上传EDI
@@ -419,7 +419,7 @@ import {
SampleBillPdf,
TxxpLink,
ExcuteRulesOceanBooking,
- BookingOrderPrint,
+ BookingOrderPrint
} from '@/api/modular/main/BookingLedger'
export default {
@@ -428,8 +428,8 @@ export default {
type: Object,
default: () => {
return {}
- },
- },
+ }
+ }
},
data() {
return {
@@ -444,14 +444,14 @@ export default {
useForwarderCode: false,
forwarderCode: '',
forwarderName: '',
- fileRole: '',
+ fileRole: 9,
sendType: 'B',
- send: false,
+ send: false
},
radioStyle: {
display: 'block',
height: '30px',
- lineHeight: '30px',
+ lineHeight: '30px'
},
// 放舱表单
initCabinFrom: {
@@ -465,15 +465,15 @@ export default {
orderUrl: {
urlTxxp: '',
urlVgm: '',
- urlVgmSi: '',
+ urlVgmSi: ''
},
- remark: '',
+ remark: ''
},
// 样单
hsaBillPdf: false,
billPdf: '',
billPdfTip: '',
- templateType: [],
+ templateType: []
}
},
mounted() {
@@ -486,14 +486,14 @@ export default {
// ========== 订舱打印 ==========
FnCilckTemplateType(type) {
BookingOrderPrint({ type, bookingId: this.id })
- .then((res) => {
+ .then(res => {
if (res.success) {
this.$message.success('打印成功')
} else {
this.$message.error(res.message)
}
})
- .catch((err) => {
+ .catch(err => {
console.log(err)
})
},
@@ -551,7 +551,7 @@ export default {
this.bookingModelFrom.send = type === 'send'
this.bookingModelFrom.orderNo = this.details.mblno
SendBookingOrClosingEDI(this.bookingModelFrom)
- .then((res) => {
+ .then(res => {
// 未完成
if (res.success) {
this.$message.success(`${type === 'send' ? '发送' : '保存'}成功`)
@@ -560,7 +560,7 @@ export default {
this.$message.error(res.message)
}
})
- .catch((err) => {
+ .catch(err => {
console.log(err)
})
},
@@ -573,9 +573,9 @@ export default {
useForwarderCode: false,
forwarderCode: '',
forwarderName: '',
- fileRole: '',
+ fileRole: 9,
sendType: 'B',
- send: false,
+ send: false
}
},
// vgm / 下货纸
@@ -583,9 +583,9 @@ export default {
let content = null
const _this = this
if (type === 'vgm') {
- content = (h) =>
确认发送VGM吗?
+ content = h => 确认发送VGM吗?
} else if (type === 'paper') {
- content = (h) => 确认发送下货纸吗?
+ content = h => 确认发送下货纸吗?
}
this.$confirm({
title: '温馨提示',
@@ -601,34 +601,34 @@ export default {
onCancel() {
console.log('Cancel')
},
- class: 'test',
+ class: 'test'
})
},
sendXHZ() {
SendXHZ(this.id)
- .then((res) => {
+ .then(res => {
if (res.success) {
this.$message.success(`下货纸发送成功`)
} else {
this.$message.error(res.message)
}
})
- .catch((err) => {
+ .catch(err => {
console.log(err)
})
},
vgmSend() {
VgmSend(this.id)
- .then((res) => {
+ .then(res => {
if (res.success) {
this.$message.success(`VGM发送成功`)
} else {
this.$message.error(res.message)
}
})
- .catch((err) => {
+ .catch(err => {
console.log(err)
})
},
@@ -636,7 +636,7 @@ export default {
// 获取放舱信息
getLetterYard() {
LetterYard(this.id)
- .then((res) => {
+ .then(res => {
console.log('== 放舱信息 ==', res.data)
if (res.success) {
this.initCabinFrom = res.data
@@ -644,7 +644,7 @@ export default {
this.$message.error(res.message)
}
})
- .catch((err) => {
+ .catch(err => {
console.log(err)
})
},
@@ -652,7 +652,7 @@ export default {
// 获取样单信息
getSampleBill() {
SampleBill(this.id)
- .then((res) => {
+ .then(res => {
console.log('== 样单信息 ==', res.data)
if (res.success) {
this.initCabinFrom = res.data
@@ -660,7 +660,7 @@ export default {
this.$message.error(res.message)
}
})
- .catch((err) => {
+ .catch(err => {
console.log(err)
})
},
@@ -668,7 +668,7 @@ export default {
// 获取VGM信息
getVgmLink() {
VgmLink(this.id)
- .then((res) => {
+ .then(res => {
console.log('== VGM信息 ==', res.data)
if (res.success) {
// this.initCabinFrom = res.data
@@ -676,14 +676,14 @@ export default {
this.$message.error(res.message)
}
})
- .catch((err) => {
+ .catch(err => {
console.log(err)
})
},
sampleBillPdf() {
SampleBillPdf(this.id)
- .then((res) => {
+ .then(res => {
if (res.success) {
this.hsaBillPdf = true
this.billPdf = res.data.description
@@ -692,7 +692,7 @@ export default {
this.billPdfTip = res.message
}
})
- .catch((err) => {
+ .catch(err => {
console.log(err)
})
},
@@ -767,12 +767,12 @@ export default {
...{
closeDocTime: this.details.closedocdate,
closingTime: this.details.closingdate,
- vgmTime: this.details.closevgmdate,
- },
+ vgmTime: this.details.closevgmdate
+ }
}
}
SaveBookingLetteryard(this.initCabinFrom)
- .then((res) => {
+ .then(res => {
if (res.success) {
this.$message.success('保存成功')
// this.initCabinFrom = res.data
@@ -780,7 +780,7 @@ export default {
this.$message.error(res.message)
}
})
- .catch((err) => {
+ .catch(err => {
console.log(err)
})
},
@@ -788,14 +788,14 @@ export default {
// 保存 / 发送 样单
saveBookingSampleBill() {
SaveBookingSampleBill(this.initCabinFrom)
- .then((res) => {
+ .then(res => {
if (res.success) {
this.$message.success('保存成功')
} else {
this.$message.error(res.message)
}
})
- .catch((err) => {
+ .catch(err => {
console.log(err)
})
},
@@ -803,21 +803,21 @@ export default {
// 发送放舱
sendLetterYard() {
SendLetterYard(this.id)
- .then((res) => {
+ .then(res => {
if (res.success) {
this.$message.success('发送成功')
} else {
this.$message.error(res.message)
}
})
- .catch((err) => {
+ .catch(err => {
console.log(err)
})
},
TxxpLink() {
TxxpLink(this.id)
- .then((res) => {
+ .then(res => {
if (res.success) {
console.log(res.data)
this.copyFun(res.data)
@@ -825,25 +825,25 @@ export default {
this.$message.error(res.message)
}
})
- .catch((err) => {
+ .catch(err => {
console.log(err)
})
},
checkFun() {
ExcuteRulesOceanBooking(this.id)
- .then((res) => {
+ .then(res => {
if (res.success) {
this.$emit('rules', res.data.rows)
} else {
this.$message.error(res.message)
}
})
- .catch((err) => {
+ .catch(err => {
console.log(err)
})
- },
- },
+ }
+ }
}