Browse Source

完善客户管理

master
yunuo970428 7 months ago
parent
commit
6e2f56c8cd
  1. 29
      yxt-as-ui/src/api/client/customermanagement.js
  2. 27
      yxt-as-ui/src/views/client/customermanagement/customermanagement.vue
  3. 47
      yxt-as-ui/src/views/client/customermanagement/customermanagementAdd.vue

29
yxt-as-ui/src/api/client/customermanagement.js

@ -4,22 +4,31 @@ export default {
// 查询分页列表
listPage: function(params) {
return request({
url: '/crm/v1/crmcustomertemp/asListPage',
url: '/yxtcrm/apiadmin/v1/crmcustomer/asListPage',
method: 'post',
data: params,
headers: { 'Content-Type': 'application/json' }
})
},
// 初始化
customerInit: function(data) {
return request({
url: '/yxtcrm/apiadmin/v1/crmcustomer/customerInit',
method: 'post',
data: data,
headers: { 'Content-Type': 'application/json' }
})
},
// 回显
fetchDetailsBySid: function(data) {
return request({
url: '/crm/v1/crmcustomertemp/fetchSid/' + data,
url: '/yxtcrm/apiadmin/v1/crmcustomer/fetchSid/' + data,
method: 'get'
})
},
save: function(data) {
return request({
url: '/crm/v1/crmcustomertemp/save',
url: '/yxtcrm/apiadmin/v1/crmcustomer/save',
method: 'post',
data: data,
headers: { 'Content-Type': 'application/json' }
@ -27,7 +36,7 @@ export default {
},
update: function(data) {
return request({
url: '/crm/v1/crmcustomertemp/update/' + data.sid,
url: '/yxtcrm/apiadmin/v1/crmcustomer/update/' + data.sid,
method: 'post',
data: data,
headers: { 'Content-Type': 'application/json' }
@ -44,7 +53,7 @@ export default {
// 定点企业禁用
disableState: function(data) {
return request({
url: '/crm/v1/crmcustomertemp/disableState',
url: '/yxtcrm/apiadmin/v1/crmcustomer/disableState',
method: 'post',
data: data,
headers: { 'Content-Type': 'application/json' }
@ -53,7 +62,7 @@ export default {
// 定点企业启用
enable: function(data) {
return request({
url: '/crm/v1/crmcustomertemp/enable',
url: '/yxtcrm/apiadmin/v1/crmcustomer/enable',
method: 'post',
data: data,
headers: { 'Content-Type': 'application/json' }
@ -61,7 +70,7 @@ export default {
},
deleteBySids: function(data) {
return request({
url: '/crm/v1/crmcustomertemp/del/',
url: '/yxtcrm/apiadmin/v1/crmcustomer/del/',
method: 'DELETE',
data: data,
headers: { 'Content-Type': 'application/json' }
@ -121,7 +130,7 @@ export default {
// 对接人列表
getListByCustomerSid: function(params) {
return request({
url: '/crm/v1/crmdockingpeople/getListByCustomerSid',
url: '/yxtcrm/v1/crmdockingpeople/getListByCustomerSid',
method: 'get',
params: params
})
@ -129,7 +138,7 @@ export default {
// 禁用对接人信息
disableStateByPerson: function(data) {
return request({
url: '/crm/v1/crmdockingpeople/disableState',
url: '/yxtcrm/v1/crmdockingpeople/disableState',
method: 'DELETE',
data: data,
headers: { 'Content-Type': 'application/json' }
@ -138,7 +147,7 @@ export default {
// 启用对接人信息
enableByPerson: function(data) {
return request({
url: '/crm/v1/crmdockingpeople/enable',
url: '/yxtcrm/v1/crmdockingpeople/enable',
method: 'DELETE',
data: data,
headers: { 'Content-Type': 'application/json' }

27
yxt-as-ui/src/views/client/customermanagement/customermanagement.vue

@ -119,6 +119,8 @@
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="span-sty">客户类型</div>
<el-form-item>
@ -128,6 +130,12 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="span-sty">车架号</div>
<el-form-item><el-input class="addinputInfo" style="width: 40%" v-model="formobj.vinNo" clearable placeholder="" /></el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleConfirm()"> </el-button>
@ -277,7 +285,11 @@ export default {
visitWayKey: '',
customerType: '', //
customerTypeKey: '',
psid: ''
psid: '',
vinNo: '',
userSid: '',
orgPath: '',
useOrgSid: ''
}
}
},
@ -491,7 +503,11 @@ export default {
visitWayKey: '',
customerType: '', //
customerTypeKey: '',
psid: ''
psid: '',
vinNo: '',
userSid: '',
orgPath: '',
useOrgSid: ''
}
},
visitWayChange(value) {
@ -509,8 +525,15 @@ export default {
},
handleConfirm() {
if (this.formobj.customerType !== '' && this.formobj.visitWay !== '') {
if (this.formobj.vinNo !== '' && this.formobj.vinNo.length !== 8 && this.formobj.vinNo.length !== 17) {
this.$message({ showClose: true, message: '请检查车架号的长度为8位或17位', type: 'error' })
return
}
this.dialogVisible = false
this.viewState = 2
this.formobj.userSid = window.sessionStorage.getItem('userSid')
this.formobj.orgPath = window.sessionStorage.getItem('defaultOrgPath')
this.formobj.useOrgSid = window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage.getItem('defaultOrgPath').lastIndexOf('/') + 1)
this.$refs['divAdd'].showAdd(this.formobj)
} else {
this.$message({ showClose: true, message: '请填写联络方式和客户类型', type: 'warning' })

47
yxt-as-ui/src/views/client/customermanagement/customermanagementAdd.vue

@ -288,26 +288,35 @@ export default {
this.$refs['form_obj'].clearValidate()
})
this.init()
this.formobj.isOnRemind = '否'
this.formobj.isOnRemindKey = '0'
this.formobj.customerType = value.customerType
this.formobj.customerTypeKey = value.customerTypeKey
this.formobj.visitWay = value.visitWay
this.formobj.visitWayKey = value.visitWayKey
this.formobj.userSid = window.sessionStorage.getItem('userSid')
this.formobj.orgPath = window.sessionStorage.getItem('defaultOrgPath')
this.formobj.useOrgSid = window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage.getItem('defaultOrgPath').lastIndexOf('/') + 1)
if (this.formobj.customerType === '个人') {
this.formobj.certificateType = '身份证'
this.formobj.certificateTypeKey = '01'
} else {
this.formobj.certificateType = '营业执照'
this.formobj.certificateTypeKey = '02'
}
typeValues({ psid: value.psid, type: 'customerClass' }).then((res) => {
req.customerInit(value).then((res) => {
if (res.success) {
this.customerClass_list = res.data
this.formobj = res.data
typeValues({ type: 'customerType' }).then((resp) => {
if (resp.success) {
this.customerType_list = resp.data
this.customerType_list.forEach((e) => {
if (e.dictValue === this.formobj.customerType) {
typeValues({ psid: e.sid, type: 'customerClass' }).then((respsone) => {
if (respsone.success) {
this.customerClass_list = respsone.data
}
})
}
})
}
})
//
if (res.data.vehState !== '0') {
this.formobj.isOnRemind = '否'
this.formobj.isOnRemindKey = '0'
if (this.formobj.customerType === '个人') {
this.formobj.certificateType = '身份证'
this.formobj.certificateTypeKey = '01'
} else {
this.formobj.certificateType = '营业执照'
this.formobj.certificateTypeKey = '02'
}
}
}
})
},

Loading…
Cancel
Save