Browse Source

完善客户管理

master
yunuo970428 2 years ago
parent
commit
35f3127c4d
  1. 2
      supervise-crm-ui/src/api/Common/dictcommons.js
  2. 34
      supervise-crm-ui/src/api/portal/areaPicker.js
  3. 272
      supervise-crm-ui/src/views/customermanagement/customermanagement.vue
  4. 612
      supervise-crm-ui/src/views/customermanagement/customermanagementAdd.vue
  5. 140
      supervise-crm-ui/src/views/customermanagement/customermanagementInfo.vue

2
supervise-crm-ui/src/api/Common/dictcommons.js

@ -47,7 +47,7 @@ export function fetchDetailsByUseOrgSid(data) {
// 获取下拉框
export function typeValues(data) {
return request({
url: '/portal/v1/dictcommons/typeValues',
url: '/portal/v1/dictcommon/typeValues',
method: 'get',
params: data
})

34
supervise-crm-ui/src/api/portal/areaPicker.js

@ -0,0 +1,34 @@
import request from '@/utils/request'
// 获取省/portal/v1/regions/getProvince
export function getProvince(data) {
return request({
url: '/portal/v1/regions/getProvince',data,
method: 'get',
params:data,
})
}
// 根据省sid获取该省的所有市
export function getCity(data) {
return request({
url: '/portal/v1/regions/getCity',
params:data,
method: 'get',
})
}
// 根据市sid获取该市的所有县区
export function getCounty(data) {
return request({
url: '/portal/v1/regions/getCounty',
method: 'get',
params:data,
})
}
// // 区域列表(省市县均可用)
// export function selectsList(data) {
// return request({
// url: '/portal/v1/regions/selectsList', data,
// method: 'post',
// headers: { 'Content-Type': 'application/json' }
// })
// }

272
supervise-crm-ui/src/views/customermanagement/customermanagement.vue

@ -16,15 +16,14 @@
</el-form-item>
<el-form-item label="客户类型" :label-width="formLabelWidth" class="diaForm">
<el-radio-group v-model="customerTypeList.customerType">
<el-radio v-for="item in merType" :key="item.dictKey" :label="item.dictValue"
@change="customerTypeChange">{{ item.dictValue }}
<el-radio v-for="item in merType" :key="item.dictKey" :label="item.dictValue" @change="customerTypeChange">{{ item.dictValue }}
</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button class="el-button-sure" type="primary" @click="handleOpen()"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
<el-button class="el-button-sure" type="primary" @click="handleOpen()">确定</el-button>
<el-button @click="dialogVisible = false">关闭</el-button>
</span>
</el-dialog>
<div class="main-content">
@ -63,7 +62,7 @@
<div class="listtop">
<div class="tit">客户信息列表</div>
<!-- 翻页分页 -->
<pageye v-show="listQuery.total>0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
<pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
</div>
<div class="">
<el-table :key="tableKey" v-loading="listLoading" :data="list" border fit highlight-current-row style="width: 100%;" @selection-change="handleSelectionChange">
@ -107,18 +106,17 @@
</el-table>
</div>
<div class="pages">
<pagination v-show="listQuery.total > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
</div>
</div>
</div>
<div></div>
<customermanagementAdd v-show="viewState ==2 || viewState ==3" ref="addAndUpdate" @handleReturn="handleReturn"/>
<customermanagementInfo v-show="viewState ==4" ref="Info" @handleReturn="handleReturn"/>
<customermanagementAdd v-show="viewState ==2 || viewState ==3" ref="divAdd" @handleReturn="resetState" @reloadlist="getList"/>
<customermanagementInfo v-show="viewState ==4" ref="divInfo" @handleReturn="resetState"/>
</div>
</template>
<script>
import {deleteBySids, pagerList} from '@/api/customermanagement/customermanagement'
import { deleteBySids, pagerList } from '@/api/customermanagement/customermanagement'
import { typeValues } from '@/api/Common/dictcommons'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
@ -168,33 +166,24 @@ export default {
btnLabel: '关闭'
}
],
upLevel: '0',
dialogVisible: false, //
formLabelWidth: '110px',
customerTypeList: {
visitWay: '', //
visitWayKey: '',
customerType: '', //
customerTypeKey: '',//
psid:''
customerTypeKey: '', //
psid: ''
},
visitWay_list: [],
merType: [],
induslevel: [],
isSearchShow: false,
searchxianshitit: '显示查询条件',
// -----------
tableKey: 0,
kehusid: '',
list: [],
sids: [],
names: [],
row:[],
YongHuid: [],
merType: [],
induslevel: [],
sourceLisst: [],
merClass: [],
edOrgSid: [],
ncySid: [],
FormLoading: false,
listLoading: false,
listQuery: {
@ -209,15 +198,13 @@ export default {
remindEndtDay: '',
staffSid: window.sessionStorage.getItem('staffSid')
},
total: 1
total: 0
},
temp: {}, //
viewState: 1
// ------------------------------------
}
},
mounted() {
this.$refs["btnbar"].setButtonList(this.btnList)
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
//
@ -264,17 +251,12 @@ export default {
var pageindex = index + 1 + pagestart
return pageindex
},
//
getList() {
this.listLoading = true
pagerList(this.listQuery).then((response) => {
this.listLoading = false
if (
response.code === '200' &&
response.data &&
response.data.total > 0
) {
if (response.success) {
this.list = response.data.records
this.listQuery.total = response.data.total
} else {
@ -292,7 +274,8 @@ export default {
handleFilter() {
this.listQuery = {
current: 1,
size: 20,
size: 10,
total: 0,
params: {
customerTypeKey: '',
levelKey: '',
@ -307,22 +290,20 @@ export default {
},
//
toAdd() {
// this.dialogVisible = true
this.viewState = 2
this.$refs['addAndUpdate'].openCreate()
this.dialogVisible = true
},
handleOpen() {
if (this.customerTypeList.visitWay !== '' && this.customerTypeList.customerType !== '') {
this.dialogVisible = false
const customerTypeList = this.customerTypeList
this.viewState = 2
this.$refs['addAndUpdate'].openCreate(customerTypeList)
this.$refs['divAdd'].openCreate(customerTypeList)
this.customerTypeList = {
visitWay: '',
visitWayKey: '',
customerType: '',
customerTypeKey: '',
psid:'',
psid: ''
}
} else {
this.$message({
@ -331,214 +312,82 @@ export default {
})
}
},
// ()
handleCheliang(row) {
this.viewState = 6
this.$refs['openCheXu'].cheLiang(row.sid, this.upLevel, row.name, '01')
},
//
handleJiLu(row) {
this.viewState = 5
this.$refs.Newpage.newpage(row.sid, row.name, '02')
},
//
handleSelectionChange(row) {
const aa = []
const bb = []
const cc = []
this.row = row
console.log('112233', row)
row.forEach((element) => {
aa.push(element.sid)
})
row.forEach((element) => {
bb.push(element.name, element.mobile)
})
this.sids = aa
row.forEach((element) => {
cc.push(element.name)
})
this.names = cc
console.log('勾选记录', this.sids)
},
//
toEdit() {
if (this.sids.length === 1) {
this.dialogStatus = 'update'
this.viewState = 3
this.$refs['addAndUpdate'].openUpdate(this.sids[0])
} else if (this.sids.length > 1) {
this.$notify({
title: '提示',
message: '不能选中多个修改!',
type: 'info',
duration: 2000
})
} else {
this.$notify({
title: '提示',
message: '没有选择信息!!',
type: 'error',
duration: 2000
})
if (this.sids.length === 0) {
this.$message({ showClose: true, type: 'error', message: '请选择一条记录进行编辑操作' })
return
}
},
//
toGenjin() {
if (this.sids.length === 1) {
this.dialogStatus = 'update'
this.viewState = 5
this.$refs['Newpage'].newpage(this.sids[0], this.names[0], '01')
} else if (this.sids.length > 1) {
this.$notify({
title: '提示',
message: '不能选中多个客户!!',
type: 'info',
duration: 2000
})
} else {
this.$notify({
title: '提示',
message: '请选择客户!!',
type: 'error',
duration: 2000
})
this.$message({ showClose: true, type: 'error', message: '请选择一条记录进行编辑操作' })
return
}
},
//
toZiliao() {
if (this.sids.length === 1) {
this.dialogStatus = 'update'
this.viewState = 7
this.$refs.openZiliao.newpage(this.sids[0], this.names[0])
} else if (this.sids.length > 1) {
this.$notify({
title: '提示',
message: '不能选中多个客户!!',
type: 'info',
duration: 2000
})
} else {
this.$notify({
title: '提示',
message: '请选择客户!!',
type: 'error',
duration: 2000
})
return
this.viewState = 3
this.$refs['divAdd'].openUpdate(this.sids[0])
}
},
//
handleCheck(row) {
this.viewState = 4
this.$refs['Info'].openInfo(row.sid)
this.$refs['divInfo'].openInfo(row.sid)
},
// ID
doDel() {
if (this.sids.length) {
if (this.sids.length === 0) {
this.$message({ showClose: true, type: 'error', message: '请选择至少一条记录进行删除操作' })
return
}
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteBySids(this.sids).then((response) => {
if (response.code === '200') {
this.$notify({
title: '提示',
message: '删除成功',
type: 'success',
duration: 2000
})
if (response.success) {
this.$message({ showClose: true, type: 'success', message: '删除成功' })
this.getList()
} else {
this.$notify({
title: '删除失败',
message: response.msg,
type: 'error'
})
this.$message({ showClose: true, type: 'error', message: '删除失败' })
}
})
} else {
this.$notify({
title: '提示',
message: '没有选择信息!',
type: 'error',
duration: 2000
})
return
}
},
//
doImport(){
},
//
export() {
// basefinbankExportExcel(this.sids).then((res) => {
// const blob = new Blob([res], {
// type: 'application/vnd.ms-excel',
// })
// const objectUrl = URL.createObjectURL(blob)
// window.location.href = objectUrl
// })
},
//
AddUpdateReturn() {
this.viewState = 1
},
handleReturn() {
resetState() {
this.viewState = 1
this.getList()
},
//
genjinfanhui() {
this.viewState = 1
this.getList()
},
cheliangxuqiu() {
this.viewState = 1
this.getList()
},
//
kehudanganziliao() {
this.viewState = 1
this.getList()
},
// -------------------------------------------------------------
//
getShuJUZiDian() {
// typeValues({
// type: 'customerType'
// }).then((res) => {
// if (res.code === '200') {
// this.merType = res.data
// }
// })
// typeValues({
// type: 'customerSource'
// }).then((res) => {
// if (res.code === '200') {
// this.sourceLisst = res.data
// }
// })
// typeValues({
// type: 'customerLevel'
// }).then((res) => {
// if (res.code === '200') {
// this.induslevel = res.data
// }
// })
// typeValues({
// type: 'visitWay'
// }).then((res) => {
// if (res.code === '200') {
// this.visitWay_list = res.data
// }
// })
typeValues({ type: 'customerType' }).then((res) => {
if (res.success) {
this.merType = res.data
}
})
typeValues({ type: 'customerLevel' }).then((res) => {
if (res.success) {
this.induslevel = res.data
}
})
typeValues({ type: 'visitWay' }).then((res) => {
if (res.success) {
this.visitWay_list = res.data
}
})
},
//
customerTypeChange(val) {
const choosetItem = this.merType.filter((item) => item.dictValue == val)
const choosetItem = this.merType.filter((item) => item.dictValue === val)
this.customerTypeList.customerTypeKey = choosetItem[0].dictKey
this.customerTypeList.psid = choosetItem[0].sid
console.log('name:', this.customerTypeList.customerType, 'key:', this.customerTypeList.customerTypeKey,'sid',this.customerTypeList.psid)
},
//
getVisitWay(value) {
@ -556,19 +405,14 @@ export default {
this.customerTypeList.visitWay = bb.name
this.customerTypeList.visitWayKey = bb.vaule
},
doClose(){
this.$store.dispatch('tagsView/delView', this.$route);
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
}
}
}
</script>
<style scoped>
/* .listcon {
height: calc(100vh - 520px);
overflow-y: auto;
overflow-x: hidden;
} */
.diaForm {
margin-bottom: 8px;
}

612
supervise-crm-ui/src/views/customermanagement/customermanagementAdd.vue

@ -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 !== '-') {
// 0102
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;

140
supervise-crm-ui/src/views/customermanagement/customermanagementInfo.vue

@ -255,100 +255,6 @@
</el-form>
</el-collapse-item>
</el-collapse>
<!--运营情况-->
<el-collapse v-model="activeNames">
<el-collapse-item title="运营情况" name="3">
<el-form ref="datufrom" :model="templooke" label-position="top" label-width="190px" class="formadd03">
<el-row>
<el-col :span="4" class="trightb">
<el-form-item>
<span slot="label">承运货物类型</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item>
<el-input v-model="templooke.consignmentType" :readonly="true" class="addinputw" clearable/>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item>
<span slot="label">承运货物</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item>
<el-input v-model="templooke.consignment" :readonly="true" class="addinputw" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item>
<span slot="label">运输路线</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item>
<el-input v-model="templooke.hallway_state" :readonly="true" class="addinputw" clearable/>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item>
<span slot="label">购车状态</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item>
<div class="yihang">
<el-checkbox-group v-if="aseType.length > 0" v-model="aseTypeBox">
<el-checkbox disabled v-for="item in aseType" :key="item.divtkey" :label="item.divtkey">{{ item.dictValue }}</el-checkbox>
</el-checkbox-group>
<div class="mw">
<el-input v-model="templooke.purchase_num" :readonly="true" class="addinputw" clearable/>
</div>
</div>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item>
<span slot="label">现有车辆</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item>
<el-input v-model="templooke.existing_vehicles" :readonly="true" class="addinputw" clearable/>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item>
<span slot="label">现有车辆品牌</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item>
<el-input v-model="templooke.existing_vehiclesBrand" :readonly="true" class="addinputw" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item>
<span slot="label">备注</span>
</el-form-item>
</el-col>
<el-col :span="20">
<el-form-item>
<el-input v-model="templooke.remarks" :readonly="true" class="addinputw" clearable/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-collapse-item>
</el-collapse>
</el-form>
</div>
</div>
@ -356,48 +262,25 @@
</template>
<script>
import { getPcCustomerInfoBySid } from '@/api/customermanagement/customermanagement'
export default {
name: 'CustomerManagementInfo',
data() {
return {
aseTypeBox: [],
activeNames: ['1'],
aseType: [
{
dictValue: '首次购车',
divtkey: 0
},
{
dictValue: '续购',
divtkey: 1
}
],
stateId: 0,
temp: {}, //
templooke: {}
temp: {} //
}
},
methods: {
//
openInfo(sid) {
this.stateId = sid
if (this.stateId !== '0') {
getPcCustomerInfoBySid(this.stateId).then((response) => {
getPcCustomerInfoBySid(sid).then((response) => {
if (response.code === '200') {
this.$refs['dataForm'].clearValidate()
this.temp = response.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
}
})
}
},
//
handleReturn() {
@ -407,27 +290,10 @@ export default {
}
</script>
<style scoped>
.yulan {
text-align: right;
margin-top: 15px;
}
.trightb {
text-align: right;
}
.hang {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
padding: 20px 10px;
}
.addinputwduan {
width: 80px;
margin: 0 5px;
}
/deep/ .el-collapse-item__header {
height:40px;
padding: 10px;

Loading…
Cancel
Save