lilu 2 years ago
commit abc7fdbca1

@ -462,3 +462,14 @@ export function BookingOrderPrint(parameter) {
params: parameter params: parameter
}) })
} }
/**
* 获取客户
* @params Name
*/
export function DjyCustomerdetail(parameter) {
return axios({
url: '/DjyCustomer/detail',
method: 'get',
params: parameter
})
}

@ -359,32 +359,47 @@
show-overflow show-overflow
keep-source keep-source
ref="xTable" ref="xTable"
max-height="400"
:data="tableData" :data="tableData"
:edit-config="{ trigger: 'click', mode: 'cell', icon: 'vxe-icon-edit', showStatus: true }" :edit-config="{ trigger: 'click', mode: 'cell', icon: 'vxe-icon-edit', showStatus: true }"
:height="500"
> >
<vxe-column type="checkbox" width="60"></vxe-column> <vxe-column type="checkbox" width="60"></vxe-column>
<vxe-column field="name" title="联系人" :edit-render="{}"> <vxe-column field="name" title="联系人" :edit-render="{}">
<template #edit="{ row }"> <template #edit="{ row }">
<vxe-input v-model="row.name" type="text"></vxe-input> <vxe-select
v-model="row.name"
@change="
e => {
handleChange(e, row)
}
"
placeholder="选择联系人"
>
<vxe-option
v-for="item in customerContactsData"
:key="item.id"
:value="item.name"
:label="item.name"
></vxe-option>
</vxe-select>
</template> </template>
</vxe-column> </vxe-column>
<vxe-column field="email" title="邮箱"> <vxe-column field="email" title="邮箱" :edit-render="{}">
<template #edit="{ row }"> <template #edit="{ row }">
<vxe-input v-model="row.email" type="text"></vxe-input> <vxe-input v-model="row.email" type="text"></vxe-input>
</template> </template>
</vxe-column> </vxe-column>
<vxe-column field="tel" title="电话"> <vxe-column field="tel" title="电话" :edit-render="{}">
<template #edit="{ row }"> <template #edit="{ row }">
<vxe-input v-model="row.tel" type="text"></vxe-input> <vxe-input v-model="row.tel" type="text"></vxe-input>
</template> </template>
</vxe-column> </vxe-column>
<vxe-column field="remark" title="备注"> <vxe-column field="remark" title="备注" :edit-render="{}">
<template #edit="{ row }"> <template #edit="{ row }">
<vxe-input v-model="row.remark" type="text"></vxe-input> <vxe-input v-model="row.remark" type="text"></vxe-input>
</template> </template>
</vxe-column> </vxe-column>
<vxe-column field="roleCode" title="角色"> <vxe-column field="roleCode" title="角色" :edit-render="{}">
<template #edit="{ row }"> <template #edit="{ row }">
<vxe-input v-model="row.roleCode" type="text"></vxe-input> <vxe-input v-model="row.roleCode" type="text"></vxe-input>
</template> </template>
@ -407,25 +422,26 @@ import {
GetVessellist, GetVessellist,
GetSysUserPage, GetSysUserPage,
GetForwarderlist, GetForwarderlist,
DjyCustomerdetail
} from '@/api/modular/main/BookingLedger' } from '@/api/modular/main/BookingLedger'
export default { export default {
name: 'BookingDetail', name: 'BookingDetail',
components: { components: {
XCard, XCard,
AutoComplete, AutoComplete
}, },
props: { props: {
details: { details: {
type: Object, type: Object,
default: () => { default: () => {
return {} return {}
}, }
}, },
ishd: { ishd: {
type: Boolean, type: Boolean,
default: false, default: false
}, }
}, },
data() { data() {
return { return {
@ -433,12 +449,12 @@ export default {
labelCol: { labelCol: {
xs: { span: 24 }, xs: { span: 24 },
sm: { span: 8 }, sm: { span: 8 },
md: { span: 10 }, md: { span: 10 }
}, },
wrapperCol: { wrapperCol: {
xs: { span: 24 }, xs: { span: 24 },
sm: { span: 15 }, sm: { span: 15 },
md: { span: 13 }, md: { span: 13 }
}, },
form: this.$form.createForm(this), form: this.$form.createForm(this),
dataSource: ['Burns Bay Road', 'Downing Street', 'Wall Street'], dataSource: ['Burns Bay Road', 'Downing Street', 'Wall Street'],
@ -459,14 +475,14 @@ export default {
customerModelconfirm: false, customerModelconfirm: false,
rowStyleOption: { rowStyleOption: {
clickHighlight: false, clickHighlight: false,
hoverHighlight: false, hoverHighlight: false
}, },
cellAutofillOption: true, cellAutofillOption: true,
editOption: { editOption: {
// cell value change // cell value change
cellValueChange: ({ row, column }) => { cellValueChange: ({ row, column }) => {
console.log('编辑', row, column) console.log('编辑', row, column)
}, }
}, },
checkboxOption: { checkboxOption: {
hideSelectAll: false, hideSelectAll: false,
@ -477,7 +493,7 @@ export default {
// //
selectedAllChange: ({ isSelected, selectedRowKeys }) => { selectedAllChange: ({ isSelected, selectedRowKeys }) => {
console.log('全选', isSelected, selectedRowKeys) console.log('全选', isSelected, selectedRowKeys)
}, }
}, },
columns: [ columns: [
{ {
@ -487,7 +503,7 @@ export default {
title: '', title: '',
width: 50, width: 50,
operationColumn: true, operationColumn: true,
align: 'center', align: 'center'
}, },
{ field: 'col1', key: 'col1', title: '联系人', edit: true }, { field: 'col1', key: 'col1', title: '联系人', edit: true },
{ field: 'col2', key: 'col2', title: '邮箱', edit: true }, { field: 'col2', key: 'col2', title: '邮箱', edit: true },
@ -502,12 +518,12 @@ export default {
return ( return (
<a-checkbox <a-checkbox
value={row['BC']} value={row['BC']}
on-change={(val) => { on-change={val => {
console.log(val) console.log(val)
}} }}
/> />
) )
}, }
}, },
{ {
field: 'col6', field: 'col6',
@ -518,12 +534,12 @@ export default {
return ( return (
<a-checkbox <a-checkbox
value={row['col6']} value={row['col6']}
on-change={(val) => { on-change={val => {
console.log(val) console.log(val)
}} }}
/> />
) )
}, }
}, },
{ {
field: 'col7', field: 'col7',
@ -534,17 +550,18 @@ export default {
return ( return (
<a-checkbox <a-checkbox
value={row['col7']} value={row['col7']}
on-change={(val) => { on-change={val => {
console.log(val) console.log(val)
}} }}
/> />
) )
}, }
}, }
], ],
tableData: [], tableData: [],
etdWeek: '', etdWeek: '',
// / - end // / - end
customerContactsData: []
} }
}, },
computed: { computed: {
@ -693,7 +710,7 @@ export default {
} else { } else {
return [] return []
} }
}, }
}, },
watch: { watch: {
details: { details: {
@ -701,11 +718,11 @@ export default {
// console.log('', nval) // console.log('', nval)
this.$emit('changeDetail', { this.$emit('changeDetail', {
detail: nval, detail: nval,
type: 'baseInfo', type: 'baseInfo'
}) })
}, },
deep: true, deep: true
}, }
}, },
created() { created() {
this.init() this.init()
@ -730,6 +747,16 @@ export default {
`insertRecords=${insertRecords.length} removeRecords=${removeRecords.length} updateRecords=${updateRecords.length}` `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() { init() {
// this.getCustomer() // this.getCustomer()
@ -749,10 +776,11 @@ export default {
// - start // - start
getDjyCustomerpage(name = '', type, key) { getDjyCustomerpage(name = '', type, key) {
DjyCustomerpage({ DjyCustomerpage({
SearchValue: name, // SearchValue: name,
PropString: key, // PropString: key,
FullName: name
}) })
.then((res) => { .then(res => {
if (res.code === 200) { if (res.code === 200) {
// this.customerData = res.data.rows // this.customerData = res.data.rows
this[`${type}Data`] = res.data.rows this[`${type}Data`] = res.data.rows
@ -760,7 +788,7 @@ export default {
this.$forceUpdate() this.$forceUpdate()
} }
}) })
.catch((err) => { .catch(err => {
console.log(err) console.log(err)
}) })
}, },
@ -787,15 +815,15 @@ export default {
// - start // - start
getCarrier(name = '') { getCarrier(name = '') {
GetCarrierlist({ GetCarrierlist({
CnName: name, CnName: name
}) })
.then((res) => { .then(res => {
if (res.code === 200) { if (res.code === 200) {
this.carrierData = res.data this.carrierData = res.data
this.$forceUpdate() this.$forceUpdate()
} }
}) })
.catch((err) => { .catch(err => {
console.log(err) console.log(err)
}) })
}, },
@ -812,15 +840,15 @@ export default {
// - start // - start
getForwarderlist(name = '') { getForwarderlist(name = '') {
GetForwarderlist({ GetForwarderlist({
Name: name, Name: name
}) })
.then((res) => { .then(res => {
if (res.code === 200) { if (res.code === 200) {
this.shipagencyData = res.data this.shipagencyData = res.data
this.$forceUpdate() this.$forceUpdate()
} }
}) })
.catch((err) => { .catch(err => {
console.log(err) console.log(err)
}) })
}, },
@ -836,15 +864,15 @@ export default {
// - start // - start
getVessel(name = '') { getVessel(name = '') {
GetVessellist({ GetVessellist({
Name: name, Name: name
}) })
.then((res) => { .then(res => {
if (res.code === 200) { if (res.code === 200) {
this.vesselData = res.data this.vesselData = res.data
this.$forceUpdate() this.$forceUpdate()
} }
}) })
.catch((err) => { .catch(err => {
console.log(err) console.log(err)
}) })
}, },
@ -889,9 +917,9 @@ export default {
// - start // - start
getUserList(name = '', type) { getUserList(name = '', type) {
GetSysUserPage({ GetSysUserPage({
name: name, name: name
}) })
.then((res) => { .then(res => {
if (res.success) { if (res.success) {
if (type === 'sale') { if (type === 'sale') {
this.saleUserList = res.data this.saleUserList = res.data
@ -904,7 +932,7 @@ export default {
} }
} }
}) })
.catch((err) => { .catch(err => {
console.log(err) console.log(err)
}) })
}, },
@ -957,8 +985,17 @@ export default {
this.$router.push({ name: 'CustomerInformationManagementAdd' }) this.$router.push({ name: 'CustomerInformationManagementAdd' })
localStorage.setItem('CustomerInformationManagementAdd', 'new') localStorage.setItem('CustomerInformationManagementAdd', 'new')
} else { } else {
if (this.details.customerid) {
this.customerType = type this.customerType = type
this.customerVisible = true 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() { handleModelSubmit() {
@ -997,8 +1034,8 @@ export default {
xdata = xdata.slice(0, 4) + '0' + xdata.slice(4) xdata = xdata.slice(0, 4) + '0' + xdata.slice(4)
} }
return xdata return xdata
}, }
}, }
} }
</script> </script>
<style lang="less"> <style lang="less">

Loading…
Cancel
Save