|
|
@ -2,8 +2,7 @@ |
|
|
|
<div class="app-container"> |
|
|
|
<div> |
|
|
|
<div class="tab-header webtop"> |
|
|
|
<div v-if="stateId === '0'">【新增】客户信息</div> |
|
|
|
<div v-else>【修改】客户信息</div> |
|
|
|
<div>{{ viewTitle }}</div> |
|
|
|
<div> |
|
|
|
<el-button type="primary" size="small" icon="" @click="handleJUBuCun()">保存</el-button> |
|
|
|
<el-button type="info" size="small" icon="el-icon-close" @click="handleReturn()">关闭</el-button> |
|
|
@ -101,7 +100,7 @@ |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item prop="level"> |
|
|
|
<el-select v-model="temp.level" class="addinputw" placeholder="请选择客户级别" style="width:50%" @change="getJiBie"> |
|
|
|
<el-option v-for="(item, index) in induslevel" :key="index.dictKey" :label="item.dictValue" :value="item.dictKey"/> |
|
|
|
<el-option v-for="item in induslevel" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
@ -125,10 +124,7 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item> |
|
|
|
<el-date-picker v-model="temp.remind_day" type="date" style="width:50%" |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
placeholder="选择日期" |
|
|
|
:picker-options="pickerOptions"> |
|
|
|
<el-date-picker v-model="temp.remind_day" type="date" style="width:50%" value-format="yyyy-MM-dd" placeholder="选择日期" :picker-options="pickerOptions"> |
|
|
|
</el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
@ -154,9 +150,7 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item> |
|
|
|
<!-- <el-date-picker v-model="temp.endDate" style="width:50%" type="date" format="yyyy-MM-dd" class="addinputw" value-format="yyyy-MM-dd" placeholder="请选择"/>--> |
|
|
|
<el-date-picker v-model="temp.birthday" style="width:50%" type="date" format="yyyy-MM-dd" |
|
|
|
class="addinputw" value-format="yyyy-MM-dd" placeholder="请选择"/> |
|
|
|
<el-date-picker v-model="temp.birthday" style="width:50%" type="date" format="yyyy-MM-dd" class="addinputw" value-format="yyyy-MM-dd" placeholder="请选择"/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" class="trightb"> |
|
|
@ -179,9 +173,6 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item> |
|
|
|
<!-- <el-select v-model="temp.certificateType" class="addinputw" placeholder="请选择证件类型" @change="getZhengJian"> |
|
|
|
<el-option v-for="(item, index) in cateType" :key="index.dictKey" :label="item.dictValue" :value="item.dictKey"/> |
|
|
|
</el-select> --> |
|
|
|
<el-input v-model="temp.certificateType" style="width:50%" maxlength="20" :readonly="true" class="addinputw" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
@ -192,9 +183,7 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item prop="idnumber"> |
|
|
|
<el-input v-model="temp.idnumber" style="width:50%" maxlength="18" placeholder="请输入证件号码" |
|
|
|
class="addinputw" clearable |
|
|
|
@keyup.native="temp.idnumber = oninput(temp.idnumber)"/> |
|
|
|
<el-input v-model="temp.idnumber" style="width:50%" maxlength="18" placeholder="请输入证件号码" class="addinputw" clearable @keyup.native="UpNumber"/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
@ -216,8 +205,7 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item prop="e_mail"> |
|
|
|
<el-input v-model="temp.e_mail" maxlength="20" style="width:50%" placeholder="请输入电子邮箱" |
|
|
|
class="addinputw" clearable/> |
|
|
|
<el-input v-model="temp.e_mail" maxlength="20" style="width:50%" placeholder="请输入电子邮箱" class="addinputw" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
@ -252,7 +240,7 @@ |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item> |
|
|
|
<el-select v-model="temp.source" class="addinputw" style="width:50%" placeholder="请选择客户来源" @change="getKeHuLaiYUan"> |
|
|
|
<el-option v-for="(item, index) in sourceLisst" :key="index.dictKey" :label="item.dictValue" :value="item.dictKey"/> |
|
|
|
<el-option v-for="item in sourceLisst" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
@ -264,7 +252,7 @@ |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item> |
|
|
|
<el-select v-model="temp.customerClass" style="width:50%" class="addinputw" placeholder="请选择客户分类" @change="getFenLei"> |
|
|
|
<el-option v-for="(item, index) in merClass" :key="index.dictKey" :label="item.dictValue" :value="item.dictKey"/> |
|
|
|
<el-option v-for="item in merClass" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
@ -300,13 +288,12 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import {getStorage} from '@/utils/auth' |
|
|
|
import Pagination from '@/components/pagination' |
|
|
|
import pageye from '@/components/pagination/pageye' |
|
|
|
import { getPcCustomerInfoBySid, savePcCustomerInfo, updatePcCustomerInfo } from '@/api/customermanagement/customermanagement' |
|
|
|
import { getCity, getCounty, getProvince } from '@/api/portal/areaPicker' // 省市区 |
|
|
|
import { typeValues } from '@/api/Common/dictcommons' |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'CustomerManagementAdd', |
|
|
|
components: {Pagination, pageye}, |
|
|
|
data() { |
|
|
|
var checkSubmit = (rule, value, callback) => { |
|
|
|
const Submit = |
|
|
@ -318,39 +305,19 @@ export default { |
|
|
|
callback() |
|
|
|
} |
|
|
|
callback() |
|
|
|
// if (Submit.test(value)) { |
|
|
|
// return callback() |
|
|
|
// } |
|
|
|
// callback(new Error('请输入手机号')) |
|
|
|
} |
|
|
|
var validatePass2 = (rule, value, callback) => { |
|
|
|
const WeiXin = /^[a-zA-Z][a-zA-Z\d_-]{5,19}$/; |
|
|
|
const phone = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/; |
|
|
|
const WeiXin = /^[a-zA-Z][a-zA-Z\d_-]{5,19}$/ |
|
|
|
const phone = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/ |
|
|
|
if (value) { |
|
|
|
// 如果没有通过验证!! |
|
|
|
if (!WeiXin.test(value) && !phone.test(value)) { |
|
|
|
callback(new Error("请输入正确的微信号码")); |
|
|
|
callback(new Error('请输入正确的微信号码')) |
|
|
|
} |
|
|
|
callback(); |
|
|
|
callback() |
|
|
|
} else { |
|
|
|
callback(); |
|
|
|
} |
|
|
|
}; |
|
|
|
var identitycard = (rules, value, callback) => { |
|
|
|
const card = |
|
|
|
/[^0-9.]/ |
|
|
|
// /^[1-9]\d{5}(18|19|20|(3\d))\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/ |
|
|
|
if (value) { |
|
|
|
if (!card.test(value)) { |
|
|
|
callback(new Error('请输入身份证号码')) |
|
|
|
} |
|
|
|
callback() |
|
|
|
} |
|
|
|
callback() |
|
|
|
// if (card.test(value)) { |
|
|
|
// return callback() |
|
|
|
// } |
|
|
|
// callback(new Error('请输入身份证号码')) |
|
|
|
} |
|
|
|
var validateE_mail = (rules, value, callback) => { |
|
|
|
const mail = |
|
|
@ -362,153 +329,50 @@ export default { |
|
|
|
callback() |
|
|
|
} |
|
|
|
callback() |
|
|
|
// if (card.test(value)) { |
|
|
|
// return callback() |
|
|
|
// } |
|
|
|
// callback(new Error('请输入身份证号码')) |
|
|
|
} |
|
|
|
return { |
|
|
|
viewTitle: '', |
|
|
|
// 限制日期不可选择当天之前的 |
|
|
|
pickerOptions: { |
|
|
|
disabledDate(time) { |
|
|
|
let oneDay = 60 * 60 * 24 * 1000; |
|
|
|
return time.getTime() < Date.now() - oneDay; |
|
|
|
}, |
|
|
|
return time.getTime() < Date.now() - oneDay |
|
|
|
} |
|
|
|
}, |
|
|
|
editState: false, |
|
|
|
isOnRemind: '是', |
|
|
|
// ---见证材料 |
|
|
|
list1: [], |
|
|
|
list2: [], |
|
|
|
list3: [], |
|
|
|
province: [], |
|
|
|
city: [], |
|
|
|
county: [], |
|
|
|
inputProvinceList: [], |
|
|
|
inputCityList: [], |
|
|
|
inputCountyList: [], |
|
|
|
list: [], |
|
|
|
activeNames: ['1'], |
|
|
|
// --按钮菜单------- |
|
|
|
customerClass: 'customerClass', |
|
|
|
merClass: [], |
|
|
|
customerSource: 'customerSource', |
|
|
|
sourceLisst: [], |
|
|
|
customerLevel: 'customerLevel', |
|
|
|
induslevel: [], |
|
|
|
visitWay: 'visitWay', |
|
|
|
industway: [], |
|
|
|
documenttype: 'documenttype', |
|
|
|
cateType: [], |
|
|
|
customerType: 'customerType', |
|
|
|
merType: [], |
|
|
|
ncySid: [], |
|
|
|
edOrgSid: [], |
|
|
|
consignmentType: 'consignmentType', |
|
|
|
signmentT: [], |
|
|
|
consignment: 'consignment', |
|
|
|
consign: [], |
|
|
|
industrytype: 'industrytype', |
|
|
|
industry_type: [], |
|
|
|
customerType_list: [], |
|
|
|
sex_list: [], |
|
|
|
aseTypeBox: [], |
|
|
|
aseType: [ |
|
|
|
{ |
|
|
|
dictValue: '首次购车', |
|
|
|
divtkey: 0 |
|
|
|
}, |
|
|
|
{ |
|
|
|
dictValue: '续购', |
|
|
|
divtkey: 1 |
|
|
|
}, |
|
|
|
], |
|
|
|
Customeryou: '', |
|
|
|
checkin: '', //登记状态 |
|
|
|
kehusid: '', |
|
|
|
YongHuid: [], |
|
|
|
stateId: 0, |
|
|
|
FormLoading: false, |
|
|
|
listLoading: false, |
|
|
|
tempdaat: {}, |
|
|
|
crmVisitAppendixDtoList: [], |
|
|
|
temp: { |
|
|
|
crmBusinessDto: {}, |
|
|
|
crmVisitAppendixDtoList: [], |
|
|
|
customerType: '', // 客户类型 |
|
|
|
visitWay: '', // 见面方式 |
|
|
|
visitWayKey: '', |
|
|
|
userSid: '', |
|
|
|
orgSid: '' |
|
|
|
}, // 添加和修改 |
|
|
|
templooke: {}, |
|
|
|
tempmore: {}, |
|
|
|
textMap: { |
|
|
|
update: '修改', |
|
|
|
create: '创建', |
|
|
|
}, |
|
|
|
dialogFormVisible: false, |
|
|
|
client: '', |
|
|
|
clientphone: '', |
|
|
|
sids: [], |
|
|
|
listQuery: { |
|
|
|
current: 1, |
|
|
|
size: 20, |
|
|
|
params: { |
|
|
|
distributorName: '' |
|
|
|
} |
|
|
|
}, |
|
|
|
clientSid: '', |
|
|
|
rules: { |
|
|
|
name: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: '请填写客户名称', |
|
|
|
trigger: 'blur' |
|
|
|
} |
|
|
|
], |
|
|
|
address: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: '请填写客户地址', |
|
|
|
trigger: 'blur' |
|
|
|
} |
|
|
|
], |
|
|
|
mobile: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
validator: checkSubmit, |
|
|
|
trigger: 'blur', |
|
|
|
}, |
|
|
|
], |
|
|
|
weixin: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
validator: validatePass2, |
|
|
|
trigger: 'blur', |
|
|
|
}, |
|
|
|
], |
|
|
|
// idnumber: [ |
|
|
|
// { |
|
|
|
// required: true, |
|
|
|
// // validator: identitycard, |
|
|
|
// trigger: 'blur', |
|
|
|
// }, |
|
|
|
// ], |
|
|
|
e_mail: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
validator: validateE_mail, |
|
|
|
trigger: 'blur', |
|
|
|
}, |
|
|
|
], |
|
|
|
emergencyMobile: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
validator: checkSubmit, |
|
|
|
trigger: 'blur', |
|
|
|
}, |
|
|
|
], |
|
|
|
name: [{ required: true, message: '请填写客户名称', trigger: 'blur' }], |
|
|
|
address: [{ required: true, message: '请填写客户地址', trigger: 'blur' }], |
|
|
|
mobile: [{ required: true, validator: checkSubmit, trigger: 'blur' }], |
|
|
|
weixin: [{ required: true, validator: validatePass2, trigger: 'blur' }], |
|
|
|
e_mail: [{ required: true, validator: validateE_mail, trigger: 'blur' }], |
|
|
|
emergencyMobile: [{ required: true, validator: checkSubmit, trigger: 'blur' }] |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
@ -516,42 +380,30 @@ export default { |
|
|
|
// 初始化变量 |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
oninput(val, limit = 0) { |
|
|
|
val = val.replace(/[^\d.]/g, '') //保留数字 |
|
|
|
val = val.replace(/^00/, '0.') //开头不能有两个0 |
|
|
|
// val = val.replace('.', '$#$').replace(/\./g, '').replace('$#$', '.'); //只保留一个小数点 |
|
|
|
// /^0\d+/.test(val) ? val = val.slice(1) : '' //两位以上数字开头不能为0 |
|
|
|
// const str = '^(\\d+)\\.(\\d{' + limit + '}).*$' |
|
|
|
// const reg = new RegExp(str) |
|
|
|
// if (limit === 0) { |
|
|
|
// // 不需要小数点 |
|
|
|
// val = val.replace(reg, '$1') |
|
|
|
// } else { |
|
|
|
// // 通过正则保留小数点后指定的位数 |
|
|
|
// val = val.replace(reg, '$1.$2') |
|
|
|
// } |
|
|
|
return val |
|
|
|
UpNumber(e) { |
|
|
|
e.target.value = e.target.value.replace(/[^\d]/g, '') // 清除“数字”和“.”"-"以外的字符 |
|
|
|
e.target.value = e.target.value.replace(/^00/, '0') // 开头不能有两个0 |
|
|
|
if (e.target.value.indexOf('.') < 0 && e.target.value !== '' && e.target.value !== '-') { |
|
|
|
// 以上已经过滤,此处控制的是如果没有小数点,首位不能为类似于 01、02的金额 |
|
|
|
console.log(e.target.value) |
|
|
|
e.target.value = parseFloat(e.target.value) |
|
|
|
} |
|
|
|
}, |
|
|
|
// 初始 |
|
|
|
init() { |
|
|
|
this.getShuJUZiDian() |
|
|
|
this.postHuoquyonghu() |
|
|
|
this.huoquSheng() // 获取省 |
|
|
|
}, |
|
|
|
// 修改回显 |
|
|
|
openUpdate(sid) { |
|
|
|
this.clientSid = sid |
|
|
|
this.stateId = sid |
|
|
|
this.viewTitle = '【编辑】客户信息' |
|
|
|
this.isOnRemind = '否' |
|
|
|
this.editState = true |
|
|
|
if (this.stateId !== '0') { |
|
|
|
getPcCustomerInfoBySid(this.stateId).then((response) => { |
|
|
|
console.log(response.data) |
|
|
|
if (response.code === '200') { |
|
|
|
// this.$refs['dataForm'].clearValidate() |
|
|
|
getPcCustomerInfoBySid(sid).then((response) => { |
|
|
|
if (response.success) { |
|
|
|
this.temp = response.data |
|
|
|
if (this.temp.birthday == 'NaN-NaN-NaN NaN:NaN:NaN'){ |
|
|
|
this.temp.birthday = '' |
|
|
|
} |
|
|
|
this.temp.userSid = window.sessionStorage.getItem('userSid') |
|
|
|
if (this.temp.customerType !== '') { |
|
|
|
if (this.temp.customerType === '个人') { |
|
|
|
this.temp.certificateType = '身份证' |
|
|
@ -560,38 +412,18 @@ export default { |
|
|
|
this.temp.certificateType = '营业执照' |
|
|
|
this.temp.certificateTypeKey = '02' |
|
|
|
} |
|
|
|
typeValues({type: 'customerType'}).then((res) => { |
|
|
|
if (res.code === '200') { |
|
|
|
this.customerType_list = res.data |
|
|
|
this.customerType_list.forEach((e) => { |
|
|
|
if (e.dictValue == this.temp.customerType) { |
|
|
|
typeValues({psid: e.sid, type: this.customerClass}).then((res) => { |
|
|
|
if (res.code === '200') { |
|
|
|
this.merClass = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
getPcBusinessInfoBySid(this.stateId).then((response) => { |
|
|
|
if (response.code === '200') { |
|
|
|
this.templooke = response.data |
|
|
|
const Arry = [] |
|
|
|
Arry.push(parseInt(response.data.purchase_time)) |
|
|
|
this.aseTypeBox = Arry |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
this.init() |
|
|
|
this.huoquSheng() //获取省 |
|
|
|
}, |
|
|
|
// 新增 |
|
|
|
openCreate(customerTypeList) { |
|
|
|
this.resetTemp() |
|
|
|
this.viewTitle = '【新增】客户信息' |
|
|
|
this.temp.userSid = window.sessionStorage.getItem('userSid') |
|
|
|
this.temp.staffSid = window.sessionStorage.getItem('staffSid') |
|
|
|
this.temp.customerType = customerTypeList.customerType |
|
|
|
this.temp.customerTypeKey = customerTypeList.customerTypeKey |
|
|
|
this.temp.visitWay = customerTypeList.visitWay |
|
|
@ -606,96 +438,38 @@ export default { |
|
|
|
this.temp.certificateType = '营业执照' |
|
|
|
this.temp.certificateTypeKey = '02' |
|
|
|
} |
|
|
|
typeValues({psid: customerTypeList.psid, type: this.customerClass}).then((res) => { |
|
|
|
if (res.code === '200') { |
|
|
|
typeValues({ psid: customerTypeList.psid, type: 'customerClass' }).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.merClass = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
this.init() |
|
|
|
this.huoquSheng() //获取省 |
|
|
|
}, |
|
|
|
// 下拉卡框 数据字典 |
|
|
|
getShuJUZiDian() { |
|
|
|
typeValues({ type: this.documenttype }).then((res) => { |
|
|
|
if (res.code === '200') { |
|
|
|
this.cateType = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
typeValues({ type: this.customerType }).then((res) => { |
|
|
|
if (res.code === '200') { |
|
|
|
this.merType = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
// |
|
|
|
typeValues({ type: this.customerSource }).then((res) => { |
|
|
|
if (res.code === '200') { |
|
|
|
if (res.success) { |
|
|
|
this.sourceLisst = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
// |
|
|
|
typeValues({ type: this.customerLevel }).then((res) => { |
|
|
|
if (res.code === '200') { |
|
|
|
if (res.success) { |
|
|
|
this.induslevel = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
// |
|
|
|
typeValues({ type: this.visitWay }).then((res) => { |
|
|
|
if (res.code === '200') { |
|
|
|
this.industway = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
// |
|
|
|
typeValues({ type: this.industrytype }).then((res) => { |
|
|
|
if (res.code === '200') { |
|
|
|
this.industry_type = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
// |
|
|
|
typeValues({ type: this.consignmentType }).then((res) => { |
|
|
|
if (res.code === '200') { |
|
|
|
this.signmentT = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
// |
|
|
|
typeValues({ type: this.consignment }).then((res) => { |
|
|
|
if (res.code === '200') { |
|
|
|
this.consign = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
// |
|
|
|
typeValues({ type: 'sex' }).then((res) => { |
|
|
|
if (res.code === '200') { |
|
|
|
if (res.success) { |
|
|
|
this.sex_list = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// // 客户分类 |
|
|
|
// getKeHufenlei(kehusid) { |
|
|
|
// typeValues({psid: kehusid, type: this.customerClass}).then((res) => { |
|
|
|
// console.log('9988888', res) |
|
|
|
// if (res.code === '200') { |
|
|
|
// this.merClass = res.data |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// }, |
|
|
|
// 挂靠单位 |
|
|
|
// getGuaKao() { |
|
|
|
// namesDown({ name: this.temp.affiliatedOrgSid }).then((response) => { |
|
|
|
// if (response.code === '200') { |
|
|
|
// this.edOrgSid = response.data |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// }, |
|
|
|
// -------------------------获取省市县方法------------------------- |
|
|
|
huoquSheng() { |
|
|
|
console.log(123456) |
|
|
|
getProvince().then((res) => { |
|
|
|
console.log('11111省:', res) |
|
|
|
if (res.code === '200') { |
|
|
|
if (res.success) { |
|
|
|
this.inputProvinceList = res.data |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
getShen(value) { |
|
|
@ -718,8 +492,7 @@ export default { |
|
|
|
sid: sid1 |
|
|
|
} |
|
|
|
getCity(sid).then((res) => { |
|
|
|
console.log('2222市', res) |
|
|
|
if (res.code === '200') { |
|
|
|
if (res.success) { |
|
|
|
this.inputCityList = res.data |
|
|
|
} |
|
|
|
}) |
|
|
@ -743,8 +516,7 @@ export default { |
|
|
|
sid: sid1 |
|
|
|
} |
|
|
|
getCounty(sid).then((res) => { |
|
|
|
console.log('333县', res) |
|
|
|
if (res.code === '200') { |
|
|
|
if (res.success) { |
|
|
|
this.inputCountyList = res.data |
|
|
|
} |
|
|
|
}) |
|
|
@ -761,13 +533,11 @@ export default { |
|
|
|
} |
|
|
|
}) |
|
|
|
this.temp.county = bb.name |
|
|
|
// this.temp.address=this.temp.province+this.temp.city+this.temp.county |
|
|
|
// this.deCode.push(bb.districtCode) |
|
|
|
console.log('6666677777777', this.deCode) |
|
|
|
}, |
|
|
|
// ----------------------------------方法-------------------- |
|
|
|
// 组件返回 |
|
|
|
handleReturn() { |
|
|
|
handleReturn(isreload) { |
|
|
|
if (isreload === 'true') this.$emit('reloadlist') |
|
|
|
this.isOnRemind = '是' |
|
|
|
this.editState = false |
|
|
|
this.activeNames = ['1'] |
|
|
@ -776,99 +546,38 @@ export default { |
|
|
|
// 添加前数据初始化 |
|
|
|
resetTemp() { |
|
|
|
this.temp = {} |
|
|
|
this.templooke = {} |
|
|
|
this.aseTypeBox = [] |
|
|
|
this.list1 = [] |
|
|
|
}, |
|
|
|
// 获取用户信息 |
|
|
|
postHuoquyonghu() { |
|
|
|
var token = getStorage() |
|
|
|
loginDetails(token).then((response) => { |
|
|
|
if (response.code === '200') { |
|
|
|
this.YongHuid = response.data |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
findselect(list, value) { |
|
|
|
var item = null |
|
|
|
for (var i = 0; i < list.length; i++) { |
|
|
|
if (list[i].divtkey === value) { |
|
|
|
item = list[i] |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
return item |
|
|
|
}, |
|
|
|
// 首次 续购 |
|
|
|
changexuanze() { |
|
|
|
this.aseTypeBox = [this.aseTypeBox[this.aseTypeBox.length - 1]] |
|
|
|
var item = this.findselect(this.aseType, this.aseTypeBox[0]) |
|
|
|
this.templooke.purchase_time = item.divtkey |
|
|
|
}, |
|
|
|
// 保存客户运营数据 |
|
|
|
handleJUBuCun() { |
|
|
|
this.$refs['dataForm'].validate((valid) => { |
|
|
|
if (this.templooke.purchase_time == '0') { |
|
|
|
this.templooke.purchase_num = '' |
|
|
|
} |
|
|
|
if (valid) { |
|
|
|
this.FormLoading = true |
|
|
|
if (this.temp.sex !== '') { |
|
|
|
this.sex_list.forEach((e) => { |
|
|
|
if (e.dictValue == this.temp.sex) { |
|
|
|
if (e.dictValue === this.temp.sex) { |
|
|
|
this.temp.sexKey = e.dictKey |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
if (this.temp.isOnRemind !== '' && this.temp.isOnRemind == '是') { |
|
|
|
if (this.temp.isOnRemind !== '' && this.temp.isOnRemind === '是') { |
|
|
|
this.temp.isOnRemindkey = 1 |
|
|
|
} else { |
|
|
|
this.temp.isOnRemindkey = 0 |
|
|
|
} |
|
|
|
if (this.temp.customerType !== '') { |
|
|
|
let bb = '' |
|
|
|
this.merType.forEach((e) => { |
|
|
|
if (e.dictValue == this.temp.customerType) { |
|
|
|
bb = { |
|
|
|
type: 'customerType', |
|
|
|
name: e.dictValue, |
|
|
|
value: e.dictKey, |
|
|
|
sid: e.sid, |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
this.temp.customerTypeKey = bb.value |
|
|
|
} |
|
|
|
if (!this.temp.birthday) { |
|
|
|
this.temp.birthday = '' |
|
|
|
} |
|
|
|
if (this.temp.customerType == '企业' && this.temp.name.length < 5) { |
|
|
|
if (this.temp.customerType === '企业' && this.temp.name.length < 5) { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '因客户类型为企业,客户名称的长度应不少于5个汉字' }) |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.stateId === '0') { |
|
|
|
this.temp.dto1 = this.templooke // this.templooke这个是运营的数据源 |
|
|
|
this.temp.userSid = this.YongHuid.sid |
|
|
|
this.temp.staffSid = this.YongHuid.staffSid |
|
|
|
this.temp.orgSid = this.YongHuid.organizationSid |
|
|
|
this.temp.crmBusinessDto = this.templooke |
|
|
|
this.getUrl() |
|
|
|
this.temp.crmVisitAppendixDtoList = this.crmVisitAppendixDtoList |
|
|
|
savePcCustomerInfo(this.temp).then((response) => { |
|
|
|
this.FormLoading = false |
|
|
|
if (response.code === '200') { |
|
|
|
// this.clientSid = response.data |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '添加成功', |
|
|
|
type: 'success', |
|
|
|
duration: 2000 |
|
|
|
}) |
|
|
|
this.templooke = {} |
|
|
|
if (response.success) { |
|
|
|
this.$message({ showClose: true, type: 'success', message: '保存成功' }) |
|
|
|
this.activeNames = ['1'] |
|
|
|
this.list1 = [] |
|
|
|
this.$emit('handleReturn') |
|
|
|
this.handleReturn('true') |
|
|
|
} else if (response.code === '511' || response.code === '513') { |
|
|
|
this.FormLoading = false |
|
|
|
this.dialogFormVisible = true |
|
|
@ -880,30 +589,14 @@ export default { |
|
|
|
|
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.temp.crmBusinessDto = this.templooke // this.templooke这个是运营的数据源 |
|
|
|
this.temp.userSid = this.YongHuid.sid |
|
|
|
this.temp.staffSid = this.YongHuid.staffSid |
|
|
|
this.temp.orgSid = this.YongHuid.organizationSid |
|
|
|
updatePcCustomerInfo(this.temp).then((response) => { |
|
|
|
this.FormLoading = false |
|
|
|
if (response.code === '200') { |
|
|
|
// this.clientSid = response.data |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '修改成功', |
|
|
|
type: 'success', |
|
|
|
duration: 2000, |
|
|
|
}) |
|
|
|
this.templooke = {} |
|
|
|
if (response.success) { |
|
|
|
this.$message({ showClose: true, type: 'success', message: '保存成功' }) |
|
|
|
this.activeNames = ['1'] |
|
|
|
this.$emit('handleReturn') |
|
|
|
this.handleReturn('true') |
|
|
|
} else { |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '修改失败', |
|
|
|
type: 'error', |
|
|
|
duration: 2000, |
|
|
|
}) |
|
|
|
this.$message({ showClose: true, type: 'error', message: '保存失败' }) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
@ -924,185 +617,23 @@ export default { |
|
|
|
this.dialogFormVisible = false |
|
|
|
return |
|
|
|
}, |
|
|
|
// 中介单位 |
|
|
|
// getZhongJie() { |
|
|
|
// getPcDistributorList().then((response) => { |
|
|
|
// if (response.code === '200') { |
|
|
|
// this.ncySid = response.data |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// }, |
|
|
|
// 中介单位处理 |
|
|
|
// getZongjieDanwei(value) { |
|
|
|
// let bb = null |
|
|
|
// this.ncySid.forEach((e) => { |
|
|
|
// if (e.sid == value) { |
|
|
|
// bb = { |
|
|
|
// name: e.distributorName, |
|
|
|
// } |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// this.temp.agencyName = bb.name |
|
|
|
// }, |
|
|
|
// --------------------------------------------------------------------------------- |
|
|
|
// ---------------------------数据字典的处理------------------------------------------------------ |
|
|
|
// --------------------------------------------------------------------------------- |
|
|
|
// 证件类型 |
|
|
|
getZhengJian(value) { |
|
|
|
let bb = null |
|
|
|
this.cateType.forEach((e) => { |
|
|
|
if (e.dictKey == value) { |
|
|
|
bb = { |
|
|
|
type: 'documenttype', |
|
|
|
name: e.dictValue, |
|
|
|
vaule: e.dictKey, |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
this.temp.certificateType = bb.name |
|
|
|
this.temp.certificateTypeKey = bb.vaule |
|
|
|
}, |
|
|
|
// 客户类型 |
|
|
|
// getKeHu(value) { |
|
|
|
// let bb = null |
|
|
|
// this.merType.forEach((e) => { |
|
|
|
// if (e.dictKey == value) { |
|
|
|
// bb = { |
|
|
|
// type: 'customerType', |
|
|
|
// name: e.dictValue, |
|
|
|
// vaule: e.dictKey, |
|
|
|
// sid: e.sid, |
|
|
|
// } |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// this.temp.customerType = bb.name |
|
|
|
// console.log('value值', this.temp.customerType) |
|
|
|
// this.temp.customerTypeKey = bb.vaule |
|
|
|
// console.log('key值', this.temp.customerTypeKey) |
|
|
|
// this.kehusid = bb.sid |
|
|
|
// console.log('sid值', this.kehusid) |
|
|
|
// this.getKeHufenlei(this.kehusid) |
|
|
|
// }, |
|
|
|
// 客户分类 |
|
|
|
getFenLei(value) { |
|
|
|
let bb = null |
|
|
|
this.merClass.forEach((e) => { |
|
|
|
if (e.dictKey == value) { |
|
|
|
bb = { |
|
|
|
type: 'customerClass', |
|
|
|
name: e.dictValue, |
|
|
|
vaule: e.dictKey |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
this.temp.customerClass = bb.name |
|
|
|
this.temp.customerClassKey = bb.vaule |
|
|
|
const choose = this.merClass.filter((item) => item.dictKey === value) |
|
|
|
this.temp.customerClass = choose[0].dictValue |
|
|
|
this.temp.customerClassKey = choose[0].dictKey |
|
|
|
}, |
|
|
|
// 客户来源 |
|
|
|
getKeHuLaiYUan(value) { |
|
|
|
let bb = null |
|
|
|
this.sourceLisst.forEach((e) => { |
|
|
|
if (e.dictKey == value) { |
|
|
|
bb = { |
|
|
|
type: 'customerSource', |
|
|
|
name: e.dictValue, |
|
|
|
vaule: e.dictKey |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
this.temp.source = bb.name |
|
|
|
this.temp.sourceKey = bb.vaule |
|
|
|
const choose = this.sourceLisst.filter((item) => item.dictKey === value) |
|
|
|
this.temp.source = choose[0].dictValue |
|
|
|
this.temp.sourceKey = choose[0].dictKey |
|
|
|
}, |
|
|
|
// 客户级别 |
|
|
|
getJiBie(value) { |
|
|
|
let bb = null |
|
|
|
this.induslevel.forEach((e) => { |
|
|
|
if (e.dictKey == value) { |
|
|
|
bb = { |
|
|
|
type: 'customerLevel', |
|
|
|
name: e.dictValue, |
|
|
|
vaule: e.dictKey |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
this.temp.level = bb.name |
|
|
|
this.temp.levelKey = bb.vaule |
|
|
|
}, |
|
|
|
// 来访 |
|
|
|
getLaiFang(value) { |
|
|
|
let bb = null |
|
|
|
this.industway.forEach((e) => { |
|
|
|
if (e.dictKey == value) { |
|
|
|
bb = { |
|
|
|
type: 'visitWay', |
|
|
|
name: e.dictValue, |
|
|
|
vaule: e.dictKey |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
this.temp.visit_way = bb.name |
|
|
|
this.temp.visit_way_key = bb.vaule |
|
|
|
}, |
|
|
|
// 客户行业 |
|
|
|
getHangYe(value) { |
|
|
|
let bb = null |
|
|
|
this.industry_type.forEach((e) => { |
|
|
|
if (e.dictKey == value) { |
|
|
|
bb = { |
|
|
|
type: 'industrytype', |
|
|
|
name: e.dictValue, |
|
|
|
vaule: e.dictKey |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
this.templooke.customer_industry_type = bb.name |
|
|
|
this.templooke.customer_industry_type_key = bb.vaule |
|
|
|
}, |
|
|
|
// 货物类别 |
|
|
|
getHuoWuLeiXing(value) { |
|
|
|
let bb = null |
|
|
|
this.signmentT.forEach((e) => { |
|
|
|
if (e.dictKey == value) { |
|
|
|
bb = { |
|
|
|
type: 'consignmentType', |
|
|
|
name: e.dictValue, |
|
|
|
vaule: e.dictKey |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
this.templooke.consignmentType = bb.name |
|
|
|
this.templooke.consignmentTypeKey = bb.vaule |
|
|
|
}, |
|
|
|
// 货物 |
|
|
|
getHuoWu(value) { |
|
|
|
let bb = null |
|
|
|
this.consign.forEach((e) => { |
|
|
|
if (e.dictKey == value) { |
|
|
|
bb = { |
|
|
|
type: 'consignment', |
|
|
|
name: e.dictValue, |
|
|
|
vaule: e.dictKey |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
this.templooke.consignment = bb.name |
|
|
|
this.templooke.consignmentKey = bb.vaule |
|
|
|
}, |
|
|
|
getUrl() { |
|
|
|
for (var i = 0; i < this.list1.length; i++) { |
|
|
|
var namese = this.list1[i].name |
|
|
|
var nameArr = namese.split('.') |
|
|
|
this.crmVisitAppendixDtoList.push({ |
|
|
|
// attachType: '0001', |
|
|
|
fileName: this.list1[i].name, |
|
|
|
filePath: this.list1[i].url, |
|
|
|
fileSize: this.list1[i].size, |
|
|
|
// linkSid: this.temp.customerSid, |
|
|
|
createBySid: this.YongHuid.sid, |
|
|
|
fileType: nameArr[nameArr.length - 1], |
|
|
|
}) |
|
|
|
console.log('11223344', this.crmVisitAppendixDtoList) |
|
|
|
} |
|
|
|
const choose = this.induslevel.filter((item) => item.dictKey === value) |
|
|
|
this.temp.level = choose[0].dictValue |
|
|
|
this.temp.levelKey = choose[0].dictKey |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -1112,11 +643,6 @@ export default { |
|
|
|
text-align: right; |
|
|
|
} |
|
|
|
|
|
|
|
.addinputwduan { |
|
|
|
width: 80px; |
|
|
|
margin: 0 5px; |
|
|
|
} |
|
|
|
|
|
|
|
/deep/ .el-collapse-item__header { |
|
|
|
height: 40px; |
|
|
|
padding: 10px; |
|
|
|