From 68ed2fcd739a48cf21aa33b151e71e94f1662a24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=90=8C=E6=B5=B7?= <963808678@qq.com> Date: Wed, 23 Nov 2022 17:25:38 +0800 Subject: [PATCH] 11/23 --- src/api/modular/main/BookingLedger.js | 11 ++ .../detail/modules/basicInfo.vue | 131 +++++++++++------- 2 files changed, 95 insertions(+), 47 deletions(-) diff --git a/src/api/modular/main/BookingLedger.js b/src/api/modular/main/BookingLedger.js index e494510..3be08d2 100644 --- a/src/api/modular/main/BookingLedger.js +++ b/src/api/modular/main/BookingLedger.js @@ -462,3 +462,14 @@ export function BookingOrderPrint(parameter) { params: parameter }) } +/** + * 获取客户 + * @params Name + */ +export function DjyCustomerdetail(parameter) { + return axios({ + url: '/DjyCustomer/detail', + method: 'get', + params: parameter + }) +} diff --git a/src/views/main/BookingLedger/detail/modules/basicInfo.vue b/src/views/main/BookingLedger/detail/modules/basicInfo.vue index a59a5b4..858e23f 100644 --- a/src/views/main/BookingLedger/detail/modules/basicInfo.vue +++ b/src/views/main/BookingLedger/detail/modules/basicInfo.vue @@ -359,32 +359,47 @@ show-overflow keep-source ref="xTable" - max-height="400" :data="tableData" :edit-config="{ trigger: 'click', mode: 'cell', icon: 'vxe-icon-edit', showStatus: true }" + :height="500" > - + - + - + - + @@ -407,25 +422,26 @@ import { GetVessellist, GetSysUserPage, GetForwarderlist, + DjyCustomerdetail } from '@/api/modular/main/BookingLedger' export default { name: 'BookingDetail', components: { XCard, - AutoComplete, + AutoComplete }, props: { details: { type: Object, default: () => { return {} - }, + } }, ishd: { type: Boolean, - default: false, - }, + default: false + } }, data() { return { @@ -433,12 +449,12 @@ export default { labelCol: { xs: { span: 24 }, sm: { span: 8 }, - md: { span: 10 }, + md: { span: 10 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 15 }, - md: { span: 13 }, + md: { span: 13 } }, form: this.$form.createForm(this), dataSource: ['Burns Bay Road', 'Downing Street', 'Wall Street'], @@ -459,14 +475,14 @@ export default { customerModelconfirm: false, rowStyleOption: { clickHighlight: false, - hoverHighlight: false, + hoverHighlight: false }, cellAutofillOption: true, editOption: { // cell value change cellValueChange: ({ row, column }) => { console.log('编辑', row, column) - }, + } }, checkboxOption: { hideSelectAll: false, @@ -477,7 +493,7 @@ export default { // 全选改变事件 selectedAllChange: ({ isSelected, selectedRowKeys }) => { console.log('全选', isSelected, selectedRowKeys) - }, + } }, columns: [ { @@ -487,7 +503,7 @@ export default { title: '', width: 50, operationColumn: true, - align: 'center', + align: 'center' }, { field: 'col1', key: 'col1', title: '联系人', edit: true }, { field: 'col2', key: 'col2', title: '邮箱', edit: true }, @@ -502,12 +518,12 @@ export default { return ( { + on-change={val => { console.log(val) }} /> ) - }, + } }, { field: 'col6', @@ -518,12 +534,12 @@ export default { return ( { + on-change={val => { console.log(val) }} /> ) - }, + } }, { field: 'col7', @@ -534,17 +550,18 @@ export default { return ( { + on-change={val => { console.log(val) }} /> ) - }, - }, + } + } ], tableData: [], etdWeek: '', // 选择客户 / 关系人弹窗 - end + customerContactsData: [] } }, computed: { @@ -693,7 +710,7 @@ export default { } else { return [] } - }, + } }, watch: { details: { @@ -701,11 +718,11 @@ export default { // console.log('数据改变', nval) this.$emit('changeDetail', { detail: nval, - type: 'baseInfo', + type: 'baseInfo' }) }, - deep: true, - }, + deep: true + } }, created() { this.init() @@ -730,6 +747,16 @@ export default { `insertRecords=${insertRecords.length} removeRecords=${removeRecords.length} updateRecords=${updateRecords.length}` ) }, + // ---------- Change联系人 ---------- + handleChange(e, data) { + this.customerContactsData.forEach(item => { + if (item.name == e.value) { + data.email = item.email + data.tel = item.email + data.remark = item.email + } + }) + }, // ============================== init() { // this.getCustomer() @@ -749,10 +776,11 @@ export default { // 客户 - start getDjyCustomerpage(name = '', type, key) { DjyCustomerpage({ - SearchValue: name, - PropString: key, + // SearchValue: name, + // PropString: key, + FullName: name }) - .then((res) => { + .then(res => { if (res.code === 200) { // this.customerData = res.data.rows this[`${type}Data`] = res.data.rows @@ -760,7 +788,7 @@ export default { this.$forceUpdate() } }) - .catch((err) => { + .catch(err => { console.log(err) }) }, @@ -787,15 +815,15 @@ export default { // 船公司 - start getCarrier(name = '') { GetCarrierlist({ - CnName: name, + CnName: name }) - .then((res) => { + .then(res => { if (res.code === 200) { this.carrierData = res.data this.$forceUpdate() } }) - .catch((err) => { + .catch(err => { console.log(err) }) }, @@ -812,15 +840,15 @@ export default { // 船代 - start getForwarderlist(name = '') { GetForwarderlist({ - Name: name, + Name: name }) - .then((res) => { + .then(res => { if (res.code === 200) { this.shipagencyData = res.data this.$forceUpdate() } }) - .catch((err) => { + .catch(err => { console.log(err) }) }, @@ -836,15 +864,15 @@ export default { // 船名 - start getVessel(name = '') { GetVessellist({ - Name: name, + Name: name }) - .then((res) => { + .then(res => { if (res.code === 200) { this.vesselData = res.data this.$forceUpdate() } }) - .catch((err) => { + .catch(err => { console.log(err) }) }, @@ -889,9 +917,9 @@ export default { // 团队成员 - start getUserList(name = '', type) { GetSysUserPage({ - name: name, + name: name }) - .then((res) => { + .then(res => { if (res.success) { if (type === 'sale') { this.saleUserList = res.data @@ -904,7 +932,7 @@ export default { } } }) - .catch((err) => { + .catch(err => { console.log(err) }) }, @@ -957,8 +985,17 @@ export default { this.$router.push({ name: 'CustomerInformationManagementAdd' }) localStorage.setItem('CustomerInformationManagementAdd', 'new') } else { - this.customerType = type - this.customerVisible = true + 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 + }) + } else { + this.$message.warning('请先选择客户!') + } } }, handleModelSubmit() { @@ -997,8 +1034,8 @@ export default { xdata = xdata.slice(0, 4) + '0' + xdata.slice(4) } return xdata - }, - }, + } + } }