dev
张同海 2 years ago
parent 0537f4fa4a
commit 68ed2fcd73

@ -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
})
}

@ -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"
>
<vxe-column type="checkbox" width="60"></vxe-column>
<vxe-column field="name" title="联系人" :edit-render="{}">
<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>
</vxe-column>
<vxe-column field="email" title="邮箱">
<vxe-column field="email" title="邮箱" :edit-render="{}">
<template #edit="{ row }">
<vxe-input v-model="row.email" type="text"></vxe-input>
</template>
</vxe-column>
<vxe-column field="tel" title="电话">
<vxe-column field="tel" title="电话" :edit-render="{}">
<template #edit="{ row }">
<vxe-input v-model="row.tel" type="text"></vxe-input>
</template>
</vxe-column>
<vxe-column field="remark" title="备注">
<vxe-column field="remark" title="备注" :edit-render="{}">
<template #edit="{ row }">
<vxe-input v-model="row.remark" type="text"></vxe-input>
</template>
</vxe-column>
<vxe-column field="roleCode" title="角色">
<vxe-column field="roleCode" title="角色" :edit-render="{}">
<template #edit="{ row }">
<vxe-input v-model="row.roleCode" type="text"></vxe-input>
</template>
@ -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 (
<a-checkbox
value={row['BC']}
on-change={(val) => {
on-change={val => {
console.log(val)
}}
/>
)
},
}
},
{
field: 'col6',
@ -518,12 +534,12 @@ export default {
return (
<a-checkbox
value={row['col6']}
on-change={(val) => {
on-change={val => {
console.log(val)
}}
/>
)
},
}
},
{
field: 'col7',
@ -534,17 +550,18 @@ export default {
return (
<a-checkbox
value={row['col7']}
on-change={(val) => {
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
},
},
}
}
}
</script>
<style lang="less">

Loading…
Cancel
Save