szh_zidingyibiaoti
张同海 2 years ago
parent 169e053588
commit 2ce1ad08a3

@ -405,7 +405,11 @@
<!-- v-show="goodStatusShow" -->
<div
class="goods-hovers-list"
:class="[{ 'hide-goods-hover': !goodStatusShow }, {'seat-top': goodStatusSeat === 'top'}, {'seat-bottom': goodStatusSeat === 'bottom'}]"
:class="[
{ 'hide-goods-hover': !goodStatusShow },
{ 'seat-top': goodStatusSeat === 'top' },
{ 'seat-bottom': goodStatusSeat === 'bottom' }
]"
:style="{ top: `${goodStatusScreenY}px`, left: `${goodStatusScreenX}px` }"
>
<div class="title">货运动态</div>
@ -1003,6 +1007,7 @@ export default {
break
}
})
if (Object.keys($data).includes('booking_list_cond')) {
this.setFormData($data.booking_list_cond, false, true)
} else {
@ -1127,7 +1132,10 @@ export default {
}
}
})
if (!isReset && !isInit) {
// if (!isReset && !isInit) {
// this.getList(this.formRes)
// }
if (!isReset) {
this.getList(this.formRes)
}
const len = this.formData.length % 4
@ -1630,7 +1638,7 @@ export default {
this.goodStatusScreenX = e.pageX - 139
}
console.log('== 距离 ==', e.pageY, window.innerHeight - 350)
if (e.pageY > (window.innerHeight - 340)) {
if (e.pageY > window.innerHeight - 340) {
this.goodStatusScreenY = e.pageY - 370 - 10
this.goodStatusSeat = 'top'
} else {
@ -2580,7 +2588,7 @@ export default {
transition: 0.5s all;
display: block;
opacity: 1;
&.seat-top{
&.seat-top {
&::before {
display: none;
// content: '';
@ -2608,7 +2616,7 @@ export default {
left: 50%;
margin-left: -16px;
}
.title {
height: 30px;
line-height: 30px;

@ -0,0 +1,556 @@
<template>
<!-- <a-modal
title="新增客户信息"
:width="1100"
:visible="visible"
:confirmLoading="confirmLoading"
@ok="handleSubmit"
@cancel="handleCancel"
> -->
<!-- <a-spin :spinning="confirmLoading"> -->
<a-form :form="form" class="CsForm">
<a-row type="flex" justify="end" :gutter="16">
<a-col :span="2" v-if="!id">
<a-button type="primary" @click="handleSubmit('New')">
保存并新增
</a-button>
</a-col>
<a-col :span="1">
<a-button type="primary" @click="handleSubmit">
{{ this.id ? '修改' : '保存' }}
</a-button>
</a-col>
</a-row>
<a-row>
<p class="CsFormTitle">
<span><i class="iconfont icon-shiyongwendang"></i>基本信息</span>
</p>
<a-col :span="6">
<a-form-item label="助记码" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input v-decorator="['codeName', { rules: [{ required: true, message: '' }] }]" />
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="简称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input v-decorator="['shortName', { rules: [{ required: true, message: '' }] }]" />
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="全称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input v-decorator="['fullName']" />
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="负责人" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input v-decorator="['chief']" />
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="6">
<a-form-item label="电话" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input v-decorator="['tel']" />
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="邮箱" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input v-decorator="['email']" />
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="QQ" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input v-decorator="['qq']" />
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="网址" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input v-decorator="['webUrl']" />
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="6">
<a-form-item label="省份" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input v-decorator="['province']" />
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="城市" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input v-decorator="['city']" />
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="地址" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input v-decorator="['addr']" />
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="6">
<a-form-item label="客户属性" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-select
mode="multiple"
v-decorator="['WpropString', { rules: [{ required: true, message: '请选择客户属性!' }] }]"
>
<a-select-option v-for="item in propStringData" :key="item.id" :value="item.code">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="服务项目" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-select mode="multiple" v-decorator="['WserviceItem']">
<a-select-option v-for="item in bookingServiceItem" :key="item.id" :value="item.code">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-form-item label="英文全名" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-input v-decorator="['fullNameEN']" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="英文地址" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-input v-decorator="['addrEN']" />
</a-form-item>
</a-col>
</a-row>
<!-- :style="{ marginLeft: '36px', marginRight: '33px' }" -->
<a-row>
<a-col :span="18">
<a-form-item label="提单信息" :labelCol="labelCol4" :wrapperCol="wrapperCol4" has-feedback>
<a-textarea v-decorator="['tidaninfo']" :auto-size="{ minRows: 3, maxRows: 5 }" />
</a-form-item>
</a-col>
</a-row>
<a-row class="from-box3">
<a-col :span="6">
<a-form-item class="from-label" label="销售人员" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-select :showSearch="true" :filterOption="filterOption" v-decorator="['saleid']" @focus="getUserList">
<a-select-option v-for="item in saleUserList" :key="item.id" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item class="from-label" label="操作人员" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-select :showSearch="true" :filterOption="filterOption" v-decorator="['opid']" @focus="getUserList">
<a-select-option v-for="item in saleUserList" :key="item.id" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item class="from-label" label="单证人员" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-select :showSearch="true" :filterOption="filterOption" v-decorator="['docid']" @focus="getUserList">
<a-select-option v-for="item in saleUserList" :key="item.id" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item class="from-label" label="客服人员" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-select
:showSearch="true"
:filterOption="filterOption"
v-decorator="['custserviceid']"
@focus="getUserList"
>
<a-select-option v-for="item in saleUserList" :key="item.id" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
<p class="CsFormTitle">
<span><i class="iconfont icon-tuandui"></i>联系人信息</span>
</p>
<vxe-toolbar>
<template #buttons>
<vxe-button icon="vxe-icon-square-plus" @click="insertEvent()"></vxe-button>
<vxe-button @click="removeCheckboxRow()"></vxe-button>
</template>
</vxe-toolbar>
<vxe-table
ref="xTable"
border
resizable
show-overflow
:data="ContactsData"
:edit-config="{ trigger: 'click', mode: 'row' }"
>
<vxe-column type="checkbox" width="60"></vxe-column>
<vxe-column type="seq" width="60"></vxe-column>
<vxe-column field="roleCode" title="岗位" :edit-render="{}">
<template #default="{ row }">
<span>{{ formatRole(row.roleCode) }}</span>
</template>
<template #edit="{ row }">
<vxe-select v-model="row.roleCode" transfer>
<vxe-option v-for="item in TypeData" :key="item.code" :value="item.code" :label="item.name"></vxe-option>
</vxe-select>
</template>
</vxe-column>
<vxe-column field="name" title="姓名" :edit-render="{}">
<template #edit="{ row }">
<vxe-input v-model="row.name" type="text"></vxe-input>
</template>
</vxe-column>
<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="电话" :edit-render="{}">
<template #edit="{ row }">
<vxe-input v-model="row.tel" type="text"></vxe-input>
</template>
</vxe-column>
<vxe-column field="qq" title="QQ" :edit-render="{}">
<template #edit="{ row }">
<vxe-input v-model="row.qq" type="text" transfer></vxe-input>
</template>
</vxe-column>
<vxe-column field="remark" title="备注" :edit-render="{}">
<template #edit="{ row }">
<vxe-input v-model="row.remark" type="text" transfer></vxe-input>
</template>
</vxe-column>
</vxe-table>
<p class="CsFormTitle" :style="{ marginTop: '10px' }">
<span><i class="iconfont icon-icon_xinyong_xianxing_jijin-217"></i>财务信息</span>
</p>
<a-row>
<a-col :span="12">
<a-form-item label="发票抬头" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-input v-decorator="['invTitle']" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="纳税人识别号" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-input v-decorator="['taxNO']" />
</a-form-item>
</a-col>
<a-col :span="18">
<a-form-item label="发票地址电话" :labelCol="labelCol3" :wrapperCol="wrapperCol3" has-feedback>
<a-input v-decorator="['invAddrTel']" />
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-form-item label="人民币开户行" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-input v-decorator="['rmbBank']" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="人民币账号" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-input v-decorator="['rmbAccount']" />
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-form-item label="美元开户行" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-input v-decorator="['usdBank']" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="美元账号" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-input v-decorator="['usdAccount']" />
</a-form-item>
</a-col>
</a-row>
</a-form>
<!-- </a-spin>
</a-modal> -->
</template>
<script>
import { DjyCustomerAdd, DjyCustomerEdit } from '@/api/modular/main/CustomerInformationManagement'
import { GetSysUserPage } from '@/api/modular/main/BookingLedger'
export default {
data() {
return {
sexList: [
{ label: '', value: '' },
{ label: '男', value: '1' },
{ label: '女', value: '0' }
],
labelCol: {
xs: { span: 24 },
sm: { span: 6 }
},
labelCol2: {
xs: { span: 24 },
sm: { span: 3 }
},
labelCol3: {
xs: { span: 24 },
sm: { span: 2 }
},
labelCol4: {
xs: { span: 24 },
sm: { span: 2 }
},
wrapperCol: {
xs: { span: 25 },
sm: { span: 16 }
},
wrapperCol2: {
xs: { span: 25 },
sm: { span: 20 }
},
wrapperCol3: {
xs: { span: 25 },
sm: { span: 22 }
},
wrapperCol4: {
xs: { span: 25 },
sm: { span: 22 }
},
typeData: [],
visible: false,
confirmLoading: false,
form: this.$form.createForm(this),
ContactsData: [],
TypeData: [],
propStringData: [],
id: '',
saleUserList: [],
bookingServiceItem: []
}
},
watch: {
$route() {
let type = localStorage.getItem('CustomerInformationManagementAdd')
if (type == 'new') {
localStorage.setItem('CustomerInformationManagementAdd', 'old')
this.form.resetFields()
this.id = ''
}
}
},
mounted() {
this.TypeData = this.$options.filters['dictData']('djy_cust_contact_role')
this.propStringData = this.$options.filters['dictData']('djy_cust_prop')
this.bookingServiceItem = this.$options.filters['dictData']('booking_service_item')
},
methods: {
getUserList(name = '', type) {
GetSysUserPage({
name: name
})
.then(res => {
if (res.success) {
this.saleUserList = res.data
}
})
.catch(err => {
console.log(err)
})
},
filterOption(value, option) {
return option.componentOptions.children[0].text.indexOf(value) >= 0
},
removeCheckboxRow() {
this.$refs.xTable.selection.forEach(item => {
this.ContactsData.forEach((item2, index2) => {
if (item.WebKey == item2.WebKey) {
this.ContactsData.splice(index2, 1)
}
})
})
},
insertEvent() {
this.ContactsData.push({
WebKey: this.ContactsData.length ? this.ContactsData[this.ContactsData.length - 1].WebKey + 1 : 1,
roleName: '',
name: '',
tel: '',
email: '',
qq: '',
remark: ''
})
},
formatRole(value) {
let RData = ''
if (value) {
this.TypeData.forEach(item => {
if (item.code == value) {
RData = item.name
}
})
}
return RData
},
//
add(record) {
this.visible = true
this.typeData = []
},
/**
* 提交表单
*/
handleSubmit(WebType) {
const {
form: { validateFields }
} = this
this.confirmLoading = true
validateFields((errors, values) => {
if (!errors) {
for (const key in values) {
if (typeof values[key] === 'object' && !(values[key] === null)) {
values[key] = JSON.stringify(values[key])
}
}
let propString = ''
if (values.WpropString) {
values.WpropString.split('["')[1]
.split('"]')[0]
.split('","')
.forEach(item2 => {
propString == '' ? (propString = `[${item2}]`) : (propString = `${propString}[${item2}]`)
})
}
let serviceItem = ''
if (values.WserviceItem) {
values.WserviceItem.split('["')[1]
.split('"]')[0]
.split('","')
.forEach(item2 => {
serviceItem == '' ? (serviceItem = `[${item2}]`) : (serviceItem = `${serviceItem}[${item2}]`)
})
}
let Arr = ['sale', 'op', 'doc', 'custservice']
GetSysUserPage()
.then(res => {
if (res.success) {
let saleUserList = res.data
Arr.forEach(item => {
if (values[`${item}id`]) {
saleUserList.forEach(i => {
if (i.id == values[`${item}id`]) {
values[item] = i.name
}
})
}
})
if (this.id) {
DjyCustomerEdit({
id: this.id,
...values,
propString: propString,
serviceItem: serviceItem,
contacts: this.ContactsData
})
.then(res => {
if (res.success) {
this.$message.success('修改成功')
this.confirmLoading = false
this.$emit('ok', values)
} else {
this.$message.error(`修改失败,${res.message}`)
}
})
.finally(res => {
this.confirmLoading = false
})
} else {
DjyCustomerAdd({
...values,
propString: propString,
serviceItem: serviceItem,
contacts: this.ContactsData
})
.then(res => {
if (res.success) {
this.$message.success('新增成功')
this.confirmLoading = false
this.$emit('ok', values)
if (WebType == 'New') {
this.form.resetFields()
this.ContactsData = []
} else {
this.id = res.data
}
} else {
this.$message.error(`新增失败,${res.message}`)
}
})
.finally(res => {
this.confirmLoading = false
})
}
}
})
.catch(err => {
console.log(err)
})
} else {
this.confirmLoading = false
}
})
},
handleCancel() {
this.form.resetFields()
this.visible = false
}
}
}
</script>
<style scoped lang="less">
.CsForm {
background: #fff;
padding: 25px;
height: 760px;
overflow-y: auto !important;
}
.CsForm .ant-form-item {
margin-bottom: 10px;
}
.CsFormTitle {
border-bottom: 1px solid #d9d9d9;
padding-bottom: 5px;
font-weight: bold;
color: #333;
margin-bottom: 25px;
}
.CsFormTitle > span {
font-weight: bolder;
padding: 0.25rem 0.5rem 0 0.5rem;
/* border: 1px solid #c9c9c9; */
}
.CsFormTitle span i {
margin-right: 7px;
}
.from-label {
margin-bottom: 0;
overflow: hidden;
}
.customer-box {
display: flex;
.customer-input {
flex: 1;
}
.customer-btn {
display: inline-block;
padding: 0 4px;
color: @primary-color;
cursor: pointer;
margin-top: -3px;
}
}
</style>

@ -0,0 +1,561 @@
<template>
<!-- <a-modal
title="新增客户信息"
:width="1100"
:visible="visible"
:confirmLoading="confirmLoading"
@ok="handleSubmit"
@cancel="handleCancel"
> -->
<!-- <a-spin :spinning="confirmLoading"> -->
<a-form :form="form" class="CsForm">
<a-row type="flex" justify="end">
<a-col :span="1">
<a-button type="primary" @click="handleSubmit" :loading="SaveLoading">
保存
</a-button>
</a-col>
</a-row>
<a-row>
<p class="CsFormTitle">
<span><i class="iconfont icon-shiyongwendang"></i>基本信息</span>
</p>
<a-col :span="6">
<a-form-item label="助记码" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input v-decorator="['codeName', { rules: [{ required: true, message: '' }] }]" />
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="简称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input v-decorator="['shortName', { rules: [{ required: true, message: '' }] }]" />
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="全称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input v-decorator="['fullName']" />
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="负责人" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input v-decorator="['chief']" />
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="6">
<a-form-item label="电话" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input v-decorator="['tel']" />
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="邮箱" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input v-decorator="['email']" />
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="QQ" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input v-decorator="['qq']" />
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="网址" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input v-decorator="['webUrl']" />
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="6">
<a-form-item label="省份" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input v-decorator="['province']" />
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="城市" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input v-decorator="['city']" />
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="地址" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input v-decorator="['addr']" />
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="6">
<a-form-item label="客户属性" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-select
mode="multiple"
v-decorator="['WpropString', { rules: [{ required: true, message: '请选择客户属性!' }] }]"
>
<a-select-option v-for="item in propStringData" :key="item.id" :value="item.code">{{
item.name
}}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="服务项目" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-select mode="multiple" v-decorator="['WserviceItem']">
<a-select-option v-for="item in bookingServiceItem" :key="item.id" :value="item.code">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-form-item label="英文全名" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-input v-decorator="['fullNameEN']" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="英文地址" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-input v-decorator="['addrEN']" />
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="18">
<a-form-item label="提单信息" :labelCol="labelCol3" :wrapperCol="wrapperCol3" has-feedback>
<a-textarea v-decorator="['tidaninfo']" :auto-size="{ minRows: 3, maxRows: 5 }" />
</a-form-item>
</a-col>
</a-row>
<a-row class="from-box3">
<a-col :span="6">
<a-form-item class="from-label" label="销售人员" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-select :showSearch="true" :filterOption="filterOption" v-decorator="['saleid']" @focus="getUserList">
<a-select-option v-for="item in saleUserList" :key="item.id" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item class="from-label" label="操作人员" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-select :showSearch="true" :filterOption="filterOption" v-decorator="['opid']" @focus="getUserList">
<a-select-option v-for="item in saleUserList" :key="item.id" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item class="from-label" label="单证人员" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-select :showSearch="true" :filterOption="filterOption" v-decorator="['docid']" @focus="getUserList">
<a-select-option v-for="item in saleUserList" :key="item.id" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item class="from-label" label="客服人员" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-select
:showSearch="true"
:filterOption="filterOption"
v-decorator="['custserviceid']"
@focus="getUserList"
>
<a-select-option v-for="item in saleUserList" :key="item.id" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
<p class="CsFormTitle">
<span><i class="iconfont icon-tuandui"></i>联系人信息</span>
</p>
<vxe-toolbar>
<template #buttons>
<vxe-button icon="vxe-icon-square-plus" @click="insertEvent()"></vxe-button>
<vxe-button @click="removeCheckboxRow()"></vxe-button>
</template>
</vxe-toolbar>
<vxe-table
ref="xTable"
border
resizable
show-overflow
:data="ContactsData"
:edit-config="{ trigger: 'click', mode: 'cell' }"
>
<vxe-column type="checkbox" width="60"></vxe-column>
<vxe-column type="seq" width="60"></vxe-column>
<vxe-column field="roleCode" title="岗位" :edit-render="{}">
<template #default="{ row }">
<span>{{ formatRole(row.roleCode) }}</span>
</template>
<template #edit="{ row }">
<vxe-select v-model="row.roleCode" transfer>
<vxe-option v-for="item in TypeData" :key="item.code" :value="item.code" :label="item.name"></vxe-option>
</vxe-select>
</template>
</vxe-column>
<vxe-column field="name" title="姓名" :edit-render="{}">
<template #edit="{ row }">
<vxe-input v-model="row.name" type="text"></vxe-input>
</template>
</vxe-column>
<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="电话" :edit-render="{}">
<template #edit="{ row }">
<vxe-input v-model="row.tel" type="text"></vxe-input>
</template>
</vxe-column>
<vxe-column field="qq" title="QQ" :edit-render="{}">
<template #edit="{ row }">
<vxe-input v-model="row.qq" type="text" transfer></vxe-input>
</template>
</vxe-column>
<vxe-column field="remark" title="备注" :edit-render="{}">
<template #edit="{ row }">
<vxe-input v-model="row.remark" type="text" transfer></vxe-input>
</template>
</vxe-column>
</vxe-table>
<p class="CsFormTitle" :style="{ marginTop: '10px' }">
<span><i class="iconfont icon-icon_xinyong_xianxing_jijin-217"></i>财务信息</span>
</p>
<a-row>
<a-col :span="12">
<a-form-item label="发票抬头" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-input v-decorator="['invTitle']" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="纳税人识别号" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-input v-decorator="['taxNO']" />
</a-form-item>
</a-col>
<a-col :span="18">
<a-form-item label="发票地址电话" :labelCol="labelCol3" :wrapperCol="wrapperCol3" has-feedback>
<a-input v-decorator="['invAddrTel']" />
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-form-item label="人民币开户行" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-input v-decorator="['rmbBank']" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="人民币账号" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-input v-decorator="['rmbAccount']" />
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-form-item label="美元开户行" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-input v-decorator="['usdBank']" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="美元账号" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-input v-decorator="['usdAccount']" />
</a-form-item>
</a-col>
</a-row>
</a-form>
<!-- </a-spin>
</a-modal> -->
</template>
<script>
import { DjyCustomerEdit, DjyCustomerDetail } from '@/api/modular/main/CustomerInformationManagement'
import { GetSysUserPage } from '@/api/modular/main/BookingLedger'
export default {
data() {
return {
sexList: [
{ label: '', value: '' },
{ label: '男', value: '1' },
{ label: '女', value: '0' }
],
labelCol: {
xs: { span: 24 },
sm: { span: 6 }
},
labelCol2: {
xs: { span: 24 },
sm: { span: 3 }
},
labelCol3: {
xs: { span: 24 },
sm: { span: 2 }
},
wrapperCol: {
xs: { span: 25 },
sm: { span: 16 }
},
wrapperCol2: {
xs: { span: 25 },
sm: { span: 20 }
},
wrapperCol3: {
xs: { span: 25 },
sm: { span: 22 }
},
visible: false,
confirmLoading: false,
form: this.$form.createForm(this),
ContactsData: [],
Data: {},
TypeData: [],
propStringData: [],
saleUserList: [],
bookingServiceItem: [],
SaveLoading: false
}
},
watch: {
$route() {
this.init()
}
},
mounted() {
this.init()
},
methods: {
init() {
this.bookingServiceItem = this.$options.filters['dictData']('booking_service_item')
DjyCustomerDetail({ id: this.$route.query.id }).then(res => {
if (res.data) {
this.Data = res.data
let WpropString = []
if (res.data.propString) {
res.data.propString.split(']').forEach(item => {
if (item.split('[')[1]) {
WpropString.push(item.split('[')[1])
}
})
}
let WserviceItem = []
if (res.data.serviceItem) {
res.data.serviceItem.split(']').forEach(item => {
if (item.split('[')[1]) {
WserviceItem.push(item.split('[')[1])
}
})
}
res.data.contacts.forEach((item, index) => {
item.WebKey = index + 1
})
// ID
let UserArr = ['saleid', 'opid', 'docid', 'custserviceid']
UserArr.forEach(item => {
if (res.data[item]) {
res.data[item] = parseInt(res.data[item])
} else {
res.data[item] = null
}
})
this.ContactsData = res.data.contacts
if (WserviceItem.length) {
this.form.setFieldsValue({
...res.data,
WserviceItem
})
} else {
this.form.setFieldsValue({
...res.data,
WserviceItem: []
})
}
if (WpropString.length) {
this.form.setFieldsValue({
...res.data,
WpropString
})
} else {
this.form.setFieldsValue({
...res.data
})
}
}
})
this.TypeData = this.$options.filters['dictData']('djy_cust_contact_role')
this.propStringData = this.$options.filters['dictData']('djy_cust_prop')
this.getUserList()
},
getUserList(name = '', type) {
GetSysUserPage({
name: name
})
.then(res => {
if (res.success) {
this.saleUserList = res.data
}
})
.catch(err => {
console.log(err)
})
},
filterOption(value, option) {
return option.componentOptions.children[0].text.indexOf(value) >= 0
},
removeCheckboxRow() {
this.$refs.xTable.selection.forEach(item => {
this.ContactsData.forEach((item2, index2) => {
if (item.WebKey == item2.WebKey) {
this.ContactsData.splice(index2, 1)
}
})
})
},
insertEvent() {
this.ContactsData.push({
WebKey: this.ContactsData.length ? this.ContactsData[this.ContactsData.length - 1].WebKey + 1 : 1,
roleName: '',
name: '',
tel: '',
email: '',
qq: '',
remark: ''
})
},
formatRole(value) {
let RData = ''
if (value) {
this.TypeData.forEach(item => {
if (item.code == value) {
RData = item.name
}
})
}
return RData
},
formatSex(value) {
if (value === '1') {
return '男'
}
if (value === '0') {
return '女'
}
return ''
},
formatMultiSex(values) {
if (values) {
return values.map(val => this.formatSex(val)).join(',')
}
return ''
},
//
add(record) {
this.visible = true
},
/**
* 提交表单
*/
handleSubmit() {
const {
form: { validateFields }
} = this
this.confirmLoading = true
validateFields((errors, values) => {
if (!errors) {
this.SaveLoading = true
for (const key in values) {
if (typeof values[key] === 'object' && !(values[key] === null)) {
values[key] = JSON.stringify(values[key])
}
}
let propString = ''
if (values.WpropString) {
values.WpropString.split('["')[1]
.split('"]')[0]
.split('","')
.forEach(item2 => {
propString == '' ? (propString = `[${item2}]`) : (propString = `${propString}[${item2}]`)
})
}
let serviceItem = ''
if (values.WserviceItem && values.WserviceItem != '[]') {
values.WserviceItem.split('["')[1]
.split('"]')[0]
.split('","')
.forEach(item2 => {
serviceItem == '' ? (serviceItem = `[${item2}]`) : (serviceItem = `${serviceItem}[${item2}]`)
})
}
let Arr = ['sale', 'op', 'doc', 'custservice']
GetSysUserPage()
.then(res => {
this.SaveLoading = false
if (res.success) {
let saleUserList = res.data
Arr.forEach(item => {
if (values[`${item}id`]) {
saleUserList.forEach(i => {
if (i.id == values[`${item}id`]) {
values[item] = i.name
}
})
}
})
DjyCustomerEdit({
...this.Data,
...values,
propString: propString,
serviceItem: serviceItem,
contacts: this.ContactsData
})
.then(res => {
if (res.success) {
this.$message.success('编辑成功')
this.confirmLoading = false
this.$emit('ok', values)
} else {
this.$message.error(`编辑失败,${res.message}`)
}
})
.finally(res => {
this.confirmLoading = false
})
}
})
.catch(err => {
this.SaveLoading = false
console.log(err)
})
} else {
this.confirmLoading = false
}
})
}
// handleCancel() {
// this.form.resetFields()
// this.visible = false
// }
}
}
</script>
<style scoped>
.CsForm {
background: #fff;
padding: 25px;
height: 760px;
overflow-y: auto !important;
}
.CsFormTitle {
border-bottom: 1px solid #c9c9c9;
}
.CsFormTitle > span {
padding: 0.25rem 0.5rem 0 0.5rem;
font-weight: bolder;
/* border: 1px solid #c9c9c9; */
}
.CsFormTitle span i {
margin-right: 7px;
}
</style>

@ -0,0 +1,590 @@
<template>
<div class="CsMain">
<!-- <a-tabs class="CsMainTable" v-model="activeKey" hide-add type="editable-card" @edit="onEdit"> -->
<!-- <a-tab-pane v-for="pane in panes" :key="pane.key" :tab="pane.title" :closable="pane.key == 0 ? false : true"> -->
<!-- <div v-if="pane.title == '客户信息'"> -->
<a-card :bordered="false" :bodyStyle="tstyle">
<div class="table-page-search-wrapper" :class="advanced ? 'Open' : 'Close'">
<a-form layout="inline">
<a-row :gutter="48">
<a-col :md="18">
<a-row :gutter="48">
<a-col :md="8" :sm="24" v-for="item in ColumnsQuery" :key="`${item.dataIndex}1`" v-show="item.checked">
<a-form-item :label="item.title">
<a-input v-model="queryParam[item.dataIndex]" allow-clear />
</a-form-item>
</a-col>
</a-row>
</a-col>
<a-col :md="4" :sm="24">
<span class="table-page-search-submitButtons">
<a-button
type="primary"
@click="
() => {
queryParam.pageNo = 1
FnGetData()
}
"
>查询</a-button
>
<a-button style="margin-left: 8px" @click="init"></a-button>
<a v-if="ColumnsQueryL > 3" @click="toggleAdvanced" style="margin-left: 8px">
{{ advanced ? '收起' : '展开' }}
<a-icon :type="advanced ? 'up' : 'down'" />
</a>
</span>
</a-col>
<a-col :md="2" :sm="24" class="SetFlex">
<a-popover placement="bottom" v-model="setVisible" trigger="click">
<template #content>
<columnSetting :columns="ColumnsQuery" @columnChange="columnChange"></columnSetting>
</template>
<span class="tab-btn"> <a-icon type="setting" :style="{ fontSize: '16px' }" /> 设置 </span>
</a-popover>
</a-col>
</a-row>
</a-form>
</div>
</a-card>
<a-card :bordered="false">
<vxe-toolbar>
<template #buttons>
<div class="nav-box">
<div class="nav" @click="TabsAdd"><i class="iconfont icon-jiahao2fill"></i>提交派车</div>
<div class="nav" @click="TabsAdd"><i class="iconfont icon-jiahao2fill"></i>撤销派车</div>
</div>
</template>
<template #tools>
<div class="right">
<a-popover placement="bottom" v-model="setVisible1" trigger="click">
<template #content>
<columnSetting :columns="TableColumns" @columnChange="columnChange1"></columnSetting>
</template>
<span class="tab-btn"> <a-icon type="setting" :style="{ fontSize: '16px' }" /> 设置 </span>
</a-popover>
</div>
</template>
</vxe-toolbar>
<vxe-table
:column-config="{ resizable: true }"
@cell-dblclick="cellDBLClickEvent"
:data="loadData"
stripe
resizable
round
:loading="loading"
empty-text="没有更多数据了!"
v-if="!TableType"
>
<vxe-column type="seq" width="40" fixed="left"></vxe-column>
<vxe-column
v-for="item in TableColumns"
:key="`${item.dataIndex}3`"
:field="item.dataIndex"
:min-width="item.width"
:title="item.title"
:align="item.align"
v-if="item.checked"
>
</vxe-column>
<vxe-column title="操作" fixed="right" width="120" align="center">
<template #default="{ row }">
<vxe-button type="text" @click="TabsEdit(row)">
<a-icon type="form" :style="{ color: '#13c2c2' }" />
</vxe-button>
<a-popconfirm
title="请确认删除?"
ok-text="是"
cancel-text="否"
@confirm="
e => {
confirm(e, row)
}
"
>
<vxe-button type="text">
<a-icon type="delete" :style="{ color: '#13c2c2' }" />
</vxe-button>
</a-popconfirm>
</template>
</vxe-column>
</vxe-table>
<vxe-pager
:loading="loading"
:current-page="queryParam.currentPage"
:page-size="queryParam.pageSize"
:total="queryParam.totalResult"
:layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
@page-change="handlePageChange"
>
</vxe-pager>
</a-card>
<!-- </div> -->
<!-- <add-form ref="addForm" v-if="pane.title == ''" @ok="handleOk" /> -->
<!-- <edit-form ref="editForm" v-if="pane.title == ''" :RowData="pane.row" @ok="handleOk" /> -->
<!-- <addForm ></addForm> -->
<!-- </a-tab-pane>
</a-tabs> -->
</div>
</template>
<script>
import {
DjyCustomerGet,
DjyCustomerPage,
DjyCustomerDelete,
DjyUserConfigAdd
} from '@/api/modular/main/CustomerInformationManagement'
// import addForm from './addForm.vue'
// import editForm from './editForm.vue'
const addForm = () => import('./addForm.vue')
const editForm = () => import('./editForm.vue')
import columnSetting from '@/components/tableColumnSetting'
const columns = [
{
title: '派车单号',
align: 'center',
width: '90',
dataIndex: 'codeName'
},
{
title: '任务流水号',
align: 'center',
width: '120',
dataIndex: 'shortName'
},
{
title: '状态',
align: 'center',
width: '180',
dataIndex: 'fullName'
},
{
title: '车队',
align: 'center',
width: '90',
dataIndex: 'chief'
},
{
title: '工厂',
align: 'center',
width: '200',
dataIndex: 'email'
},
{
title: '截港日期',
align: 'center',
width: '180',
dataIndex: 'qq'
},
{
title: '指定到厂时间',
align: 'center',
width: '180',
dataIndex: 'webUrl'
},
{
title: '提箱日期',
align: 'center',
width: '60',
dataIndex: 'province'
}
]
export default {
components: {
addForm,
editForm,
columnSetting
},
data() {
const panes = [
{ title: '客户信息', key: 0 }
// { title: 'Tab 2', content: 'Content of Tab 2', key: '2' }
]
return {
activeKey: 0,
panes,
// /
TableType: false,
advanced: false,
loading: false,
setVisible: false,
setVisible1: false,
queryParam: {
currentPage: 1,
pageSize: 10,
totalResult: 1
},
ColumnsQuery: [],
TableColumns: [],
tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' },
// Promise
loadData: [],
ColumnsQueryL: 0
}
},
created() {},
watch: {
// $route(to, form) {
// if (to.path == '/CustomerInformationManagement') {
// this.init()
// }
// }
},
mounted() {
this.init()
},
methods: {
FnRpropString(data) {
let propString = ''
if (data.propString) {
data.propString.split(']').forEach(item => {
if (item.split('[')[1]) {
propString == ''
? (propString = `${item.split('[')[1]}`)
: (propString = `${propString},${item.split('[')[1]}`)
}
})
}
return propString
},
cellDBLClickEvent({ row }) {
this.TabsEdit(row)
},
onEdit(targetKey, action) {
this[action](targetKey)
},
remove(targetKey) {
let activeKey = this.activeKey
let lastIndex
this.panes.forEach((pane, i) => {
if (pane.key === targetKey) {
if (i) {
activeKey = this.panes[i - 1].key
} else {
activeKey = 0
}
}
})
const panes = this.panes.filter(pane => pane.key !== targetKey)
// if (panes.length && activeKey === targetKey) {
// if (lastIndex >= 0) {
// activeKey = panes[lastIndex].key
// } else {
// activeKey = panes[0].key
// }
// }
this.panes = panes
this.activeKey = activeKey
},
TabsEdit(row) {
this.$router.push({ name: 'CustomerInformationManagementEdit', query: { id: row.id } })
// this.$refs.editForm[0].edit(row)
// let activeKey = this.panes.length + 1
// this.panes.push({
// title: '',
// key: activeKey,
// row: row
// })
// this.activeKey = activeKey
},
TabsAdd() {
this.$router.push({ name: 'CustomerInformationManagementAdd' })
localStorage.setItem('CustomerInformationManagementAdd', 'new')
},
columnChange(data) {
this.ColumnsQuery = [...data]
let Data = []
data.forEach(item => {
if (item.checked) {
Data.push(item.dataIndex)
}
})
this.ColumnsQueryL = Data.length
DjyUserConfigAdd({
type: 'pai_che',
configJson: JSON.stringify(Data)
}).then(res => {
console.log(res)
})
},
columnChange1(data) {
this.TableType = true
this.TableColumns = data
this.$nextTick(() => {
this.TableType = false
})
let Data = []
data.forEach(item => {
if (item.checked) {
Data.push(item.dataIndex)
}
})
DjyUserConfigAdd({
type: 'customer_column_config',
configJson: JSON.stringify(Data)
}).then(res => {
console.log(res)
})
},
toggleAdvanced() {
this.advanced = !this.advanced
},
init() {
Object.assign(this.$data, this.$options.data())
columns.forEach(item => {
item.checked = true
})
columns.forEach(item => {
this.ColumnsQuery.push({ ...item, checked: true })
})
DjyCustomerGet({ type: 'customer_column_config' }).then(res => {
if (res.data && JSON.parse(res.data.configJson).length) {
columns.forEach(item => {
item.checked = false
})
let Arr = []
JSON.parse(res.data.configJson).forEach(item => {
columns.forEach(item2 => {
if (item2.dataIndex == item) {
item2.checked = true
Arr.push(item2)
}
})
})
columns.forEach(item => {
let type = true
Arr.forEach(item2 => {
if (item.dataIndex == item2.dataIndex) {
type = false
}
})
if (type) {
Arr.push(item)
}
})
this.TableColumns = Arr
} else {
this.TableColumns = columns
}
this.FnGetData()
this.$forceUpdate()
})
DjyCustomerGet({ type: 'pai_che' }).then(res => {
if (res.data) {
this.ColumnsQueryL = JSON.parse(res.data.configJson).length
if (JSON.parse(res.data.configJson).length) {
this.ColumnsQuery = []
columns.forEach(item => {
this.ColumnsQuery.push({ ...item, checked: false })
})
let Arr = []
JSON.parse(res.data.configJson).forEach(item => {
this.ColumnsQuery.forEach(item2 => {
if (item == item2.dataIndex) {
item2.checked = true
Arr.push(item2)
}
})
})
this.ColumnsQuery.forEach(item => {
let type = true
Arr.forEach(item2 => {
if (item.dataIndex == item2.dataIndex) {
type = false
}
})
if (type) {
Arr.push(item)
}
})
this.ColumnsQuery = Arr
}
}
this.$forceUpdate()
})
},
handlePageChange({ currentPage, pageSize }) {
this.queryParam.pageNo = currentPage
this.queryParam.pageSize = pageSize
this.FnGetData()
},
FnGetData() {
this.loading = true
DjyCustomerPage(this.queryParam).then(res => {
this.loadData = res.data.rows
this.loading = false
this.queryParam.currentPage = res.data.pageNo
this.queryParam.pageSize = res.data.pageSize
this.queryParam.totalResult = res.data.totalRows
})
},
/**
* 查询参数组装
*/
switchingDate() {
const obj = JSON.parse(JSON.stringify(this.queryParam))
return obj
},
confirm(e, data) {
this.DjyCustomerDelete(data)
},
DjyCustomerDelete(record) {
DjyCustomerDelete(record).then(res => {
if (res.success) {
this.$message.success('删除成功')
this.FnGetData()
} else {
this.$message.error(`删除失败,${res.message}`)
}
})
},
handleOk() {
this.FnGetData()
}
}
}
</script>
<style lang="less" scoped>
/deep/ .ant-card-body {
padding-top: 10px !important;
}
</style>
<style lang="less">
.table-operator {
margin-bottom: 18px;
}
button {
margin-right: 8px;
}
.Open {
}
.Close {
height: 45px;
overflow: hidden;
}
.SetFlex {
display: flex;
justify-content: flex-end;
}
.CsMain {
// margin-top: -24px;
// margin-left: -9px;
width: 100% !important;
}
.CsMainTable {
width: 100%;
}
.CsMainTable > .ant-tabs-bar {
margin-bottom: 1px !important;
}
.vxe-table--render-default .vxe-body--row.row--stripe {
background: #f5f9fe;
}
.nav-box {
padding: 0 10px;
.nav {
display: inline-block;
margin-right: 8px;
cursor: pointer;
border: 1px solid rgba(255, 255, 255, 0);
padding: 0 10px;
height: 28px;
line-height: 26px;
.iconfont {
margin-right: 6px;
}
&:hover {
border: 1px solid rgba(255, 255, 255, 0);
border-radius: 4px;
}
&:nth-of-type(1) {
.iconfont {
color: #1d8aff;
}
&:hover {
background: #fff;
box-shadow: 0 0 10px #eee;
}
}
&:nth-of-type(2) {
.iconfont {
color: #865ef8;
}
&:hover {
background: #fff;
box-shadow: 0 0 10px #eee;
}
}
&:nth-of-type(3) {
.iconfont {
color: #ff9702;
}
&:hover {
background: #fff;
box-shadow: 0 0 10px #eee;
}
}
&:nth-of-type(4) {
.iconfont {
color: #1d8aff;
}
&:hover {
background: #fff;
box-shadow: 0 0 10px #eee;
}
}
&:nth-of-type(5) {
.iconfont {
color: #ff1062;
}
&:hover {
background: #fff;
box-shadow: 0 0 10px #eee;
}
}
&:nth-of-type(6) {
.iconfont {
color: #1ebeca;
}
&:hover {
background: #fff;
box-shadow: 0 0 10px #eee;
}
}
&:nth-of-type(7) {
.iconfont {
color: #82c93d;
}
&:hover {
background: #fff;
box-shadow: 0 0 10px #eee;
}
}
&:nth-of-type(8) {
.iconfont {
color: #1d8aff;
}
&:hover {
background: #fff;
box-shadow: 0 0 10px #eee;
}
}
}
}
</style>
Loading…
Cancel
Save