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

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

@ -119,6 +119,8 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
<el-row>
<el-col :span="24"> <el-col :span="24">
<div class="span-sty">客户类型</div> <div class="span-sty">客户类型</div>
<el-form-item> <el-form-item>
@ -128,6 +130,12 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </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> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleConfirm()"> </el-button> <el-button type="primary" @click="handleConfirm()"> </el-button>
@ -277,7 +285,11 @@ export default {
visitWayKey: '', visitWayKey: '',
customerType: '', // customerType: '', //
customerTypeKey: '', customerTypeKey: '',
psid: '' psid: '',
vinNo: '',
userSid: '',
orgPath: '',
useOrgSid: ''
} }
} }
}, },
@ -491,7 +503,11 @@ export default {
visitWayKey: '', visitWayKey: '',
customerType: '', // customerType: '', //
customerTypeKey: '', customerTypeKey: '',
psid: '' psid: '',
vinNo: '',
userSid: '',
orgPath: '',
useOrgSid: ''
} }
}, },
visitWayChange(value) { visitWayChange(value) {
@ -509,8 +525,15 @@ export default {
}, },
handleConfirm() { handleConfirm() {
if (this.formobj.customerType !== '' && this.formobj.visitWay !== '') { 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.dialogVisible = false
this.viewState = 2 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) this.$refs['divAdd'].showAdd(this.formobj)
} else { } else {
this.$message({ showClose: true, message: '请填写联络方式和客户类型', type: 'warning' }) this.$message({ showClose: true, message: '请填写联络方式和客户类型', type: 'warning' })

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

@ -288,16 +288,27 @@ export default {
this.$refs['form_obj'].clearValidate() this.$refs['form_obj'].clearValidate()
}) })
this.init() this.init()
req.customerInit(value).then((res) => {
if (res.success) {
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.isOnRemind = '否'
this.formobj.isOnRemindKey = '0' 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 === '个人') { if (this.formobj.customerType === '个人') {
this.formobj.certificateType = '身份证' this.formobj.certificateType = '身份证'
this.formobj.certificateTypeKey = '01' this.formobj.certificateTypeKey = '01'
@ -305,9 +316,7 @@ export default {
this.formobj.certificateType = '营业执照' this.formobj.certificateType = '营业执照'
this.formobj.certificateTypeKey = '02' this.formobj.certificateTypeKey = '02'
} }
typeValues({ psid: value.psid, type: 'customerClass' }).then((res) => { }
if (res.success) {
this.customerClass_list = res.data
} }
}) })
}, },

Loading…
Cancel
Save