Browse Source

完善客户管理

master
yunuo970428 10 months ago
parent
commit
377b3968da
  1. 8
      yxt-as-ui/src/api/client/customermanagement.js
  2. 6
      yxt-as-ui/src/router/index.js
  3. 134
      yxt-as-ui/src/views/client/customermanagement/customermanagement.vue
  4. 113
      yxt-as-ui/src/views/client/customermanagement/relation/person.vue
  5. 5
      yxt-as-ui/src/views/client/customermanagement/relation/vehicle.vue
  6. 11
      yxt-as-ui/src/views/client/customermanagement/relation/vehicleAdd.vue

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

@ -44,7 +44,7 @@ export default {
// 定点企业禁用
disableState: function(data) {
return request({
url: '/crm/v1/crmcustomerorg/disableState',
url: '/crm/v1/crmcustomertemp/disableState',
method: 'post',
data: data,
headers: { 'Content-Type': 'application/json' }
@ -53,7 +53,7 @@ export default {
// 定点企业启用
enable: function(data) {
return request({
url: '/crm/v1/crmcustomerorg/enable',
url: '/crm/v1/crmcustomertemp/enable',
method: 'post',
data: data,
headers: { 'Content-Type': 'application/json' }
@ -103,7 +103,7 @@ export default {
// 对接人列表
personList: function(params) {
return request({
url: '/as/v1/ascustomerperson/personList',
url: '/crm/v1/crmmaintenanceenterpriseperson/personList',
method: 'get',
params: params
})
@ -111,7 +111,7 @@ export default {
// 删除对接人信息
delPersonBySids: function(data) {
return request({
url: '/as/v1/ascustomerperson/delBySids',
url: '/crm/v1/crmmaintenanceenterpriseperson/delBySids',
method: 'DELETE',
data: data,
headers: { 'Content-Type': 'application/json' }

6
yxt-as-ui/src/router/index.js

@ -431,6 +431,12 @@ export const constantRoutes = [{
name: 'CustomerManagement',
meta: { title: '客户管理', noCache: true }
},
{
path: '/filing/maintenanceEnterprise',
component: () => import('@/views/client/filing/maintenanceEnterprise.vue'),
name: 'MaintenanceEnterprise',
meta: { title: '定点企业备案', noCache: true }
},
{
path: '/customerunit/customerunit',
component: () => import('@/views/client/customerunit/customerunit.vue'),

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

@ -58,6 +58,18 @@
<el-table-column prop="weixin" label="微信号" align="center" width="120" />
<el-table-column prop="level" label="客户级别" align="center" width="120" />
<el-table-column prop="remind_day" label="提醒日期" align="center" width="120" />
<el-table-column prop="isDesignatedEnterprise" label="是否为定点企业" align="center" width="150" />
<el-table-column prop="filingIndate" label="备案有效期" align="center" width="120" />
<el-table-column prop="isEnable" label="使用状态" align="center" width="120">
<template slot-scope="scope">
<span>{{ scope.row.isEnable == '1' ? '已启用' : scope.row.isEnable == '0' ? '禁用' : '' }}</span>
</template>
</el-table-column>
<el-table-column label="对接人" align="center" width="120">
<template slot-scope="scope">
<span class="bluezi" @click="lookPerson(scope.row)">{{ scope.row.personCount }}</span>
</template>
</el-table-column>
<el-table-column label="车辆" align="center" width="100">
<template slot-scope="scope">
<span class="bluezi" @click="lookCar(scope.row)">{{ scope.row.vehCount }}</span>
@ -82,6 +94,10 @@
<vehicle v-show="viewState == 5" ref="divVehicle" @doback="resetState" />
<!-- 添加车辆 -->
<vehicleAdd v-show="viewState == 6" ref="divAddVehicle" @doback="resetState" @reloadlist="getList" />
<!-- 定点企业备案 -->
<maintenanceEnterpriseAdd v-show="viewState == 7" ref="divAddFiling" @doback="resetState" @reloadlist="getList" />
<!-- 对接人信息 -->
<person v-show="viewState == 8" ref="divPerson" @doback="resetState" />
<!-- 客户登记 -->
<el-dialog :visible.sync="dialogVisible" width="30%">
<el-form ref="form_obj" v-model="formobj" class="formaddcopy02">
@ -121,6 +137,8 @@ import customermanagementAdd from './customermanagementAdd'
import customermanagementInfo from './customermanagementInfo'
import vehicle from './relation/vehicle'
import vehicleAdd from './relation/vehicleAdd'
import maintenanceEnterpriseAdd from '../filing/maintenanceEnterpriseAdd'
import person from './relation/person'
import { typeValues } from '@/api/Common/dictcommons'
export default {
@ -132,12 +150,35 @@ export default {
customermanagementAdd,
customermanagementInfo,
vehicle,
vehicleAdd
vehicleAdd,
maintenanceEnterpriseAdd,
person
},
data() {
return {
btndisabled: false,
btnList: [
{
type: 'primary',
size: 'small',
icon: '',
btnKey: 'toFiling',
btnLabel: '定点企业备案'
},
{
type: 'primary',
size: 'small',
icon: '',
btnKey: 'toForbidden',
btnLabel: '禁用'
},
{
type: 'primary',
size: 'small',
icon: '',
btnKey: 'toEnable',
btnLabel: '启用'
},
{
type: 'primary',
size: 'small',
@ -187,6 +228,7 @@ export default {
tableKey: 0,
list: [],
sids: [], // SIDs
multipleSelection: [],
merType: [],
induslevel: [],
visitWay_list: [],
@ -263,6 +305,15 @@ export default {
btnHandle(btnKey) {
console.log('XXXXXXXXXXXXXXX ' + btnKey)
switch (btnKey) {
case 'toFiling':
this.toFiling()
break
case 'toForbidden':
this.toForbidden()
break
case 'toEnable':
this.toEnable()
break
case 'toAdd':
this.toAdd()
break
@ -288,6 +339,7 @@ export default {
// sid
handleSelectionChange(row) {
const aa = []
this.multipleSelection = row
row.forEach(element => {
aa.push(element.sid)
})
@ -341,6 +393,78 @@ export default {
}
this.getList()
},
toFiling() {
if (this.sids.length === 1) {
for (var i = 0; i < this.multipleSelection.length; i++) {
if (this.multipleSelection[i].isDesignatedEnterprise === '1' || !this.multipleSelection[i].isFilingIndate) {
this.$message({ showClose: true, type: 'error', message: '因该条记录中是否为定点企业为是且备案有效期仍在有效期内,需要进行补充备案操作' })
return
}
}
this.viewState = 7
this.$refs['divAddFiling'].dataInit(this.sids[0])
} else {
this.$message({ showClose: true, type: 'error', message: '请选择一条记录进行操作' })
}
},
toForbidden() {
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(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.disableState(this.sids).then(resp => {
if (resp.success) {
this.$message({ type: 'success', message: resp.msg, showClose: true })
}
this.getList()
loading.close()
}).catch(e => {
loading.close()
})
}).catch(() => {
})
},
toEnable() {
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(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.enable(this.sids).then(resp => {
if (resp.success) {
this.$message({ type: 'success', message: resp.msg, showClose: true })
}
this.getList()
loading.close()
}).catch(e => {
loading.close()
})
}).catch(() => {
})
},
toAdd() {
this.dialogVisible = true
this.formobj = {
@ -387,6 +511,10 @@ export default {
},
addVehicle() {
if (this.sids.length === 1) {
if (this.multipleSelection[0].isDesignatedEnterprise === '1' || !this.multipleSelection[0].isFilingIndate) {
this.$message({ showClose: true, type: 'error', message: '因该条记录中是否为定点企业为是且备案有效期仍在有效期内,需要进行补充备案操作' })
return
}
this.viewState = 6
this.$refs['divAddVehicle'].showAdd(this.sids[0])
} else {
@ -397,6 +525,10 @@ export default {
this.viewState = 5
this.$refs['divVehicle'].showInfo(row)
},
lookPerson(row) {
this.viewState = 8
this.$refs['divPerson'].showInfo(row)
},
doExport() {},
//
doDel() {

113
yxt-as-ui/src/views/client/customermanagement/relation/person.vue

@ -0,0 +1,113 @@
<template>
<div class="app-container">
<div v-show="viewState == 1">
<div class="tab-header webtop">
<div>{{ viewTitle }}</div>
<div>
<el-button type="danger" size="small" @click="handleDelete()">删除</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
</div>
<div class="listconadd">
<el-form ref="form_obj" :model="formobj" class="formaddcopy02">
<div class="title ">车辆列表</div>
<el-table :key="tableKey" :data="formobj.list" :index="index" border style="width: 100%" @selection-change="handleSelectionChange">
<el-table-column type="selection" align="center" width="50"/>
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column prop="name" label="姓名" align="center" width="120" />
<el-table-column prop="mobile" label="手机号" align="center" width="130" />
<el-table-column prop="remarks" label="备注" align="center" min-width="200" />
</el-table>
</el-form>
</div>
</div>
</div>
</template>
<script>
import req from '@/api/client/customermanagement'
export default {
name: 'Person',
data() {
return {
viewTitle: '',
viewState: 1,
tableKey: 1,
index: 0,
sids: [],
formobj: {
sid: '',
list: []
}
}
},
methods: {
showInfo(row) {
this.viewTitle = '对接人信息'
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
this.formobj.sid = row.sid
req.personList({ sid: row.sid }).then((res) => {
if (res.success) {
this.formobj.list = res.data
}
})
},
// sid
handleSelectionChange(row) {
const aa = []
row.forEach(element => {
aa.push(element.customerVehSid)
})
this.sids = aa
},
handleDelete() {
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(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.delPersonBySids(this.sids).then((resp) => {
if (resp.success) {
this.$message({ type: 'success', message: resp.msg, showClose: true })
}
this.reload()
loading.close()
}).catch(e => {
loading.close()
})
}).catch(() => {
})
},
reload() {
req.personList({ sid: this.formobj.sid }).then((res) => {
if (res.success) {
this.formobj.list = res.data
}
})
},
handleReturn() {
this.formobj = {
sid: '',
list: []
}
this.$emit('doback')
}
}
}
</script>
<style scoped></style>

5
yxt-as-ui/src/views/client/customermanagement/relation/vehicle.vue

@ -49,6 +49,7 @@ export default {
},
data() {
return {
isDesignatedEnterprise: false,
viewTitle: '',
viewState: 1,
submitdisabled: false,
@ -68,6 +69,7 @@ export default {
this.$refs['form_obj'].clearValidate()
})
this.formobj.sid = row.sid
this.isDesignatedEnterprise = row.isDesignatedEnterprise
req.vehList({ sid: row.sid }).then((res) => {
if (res.success) {
this.formobj.list = res.data
@ -85,7 +87,7 @@ export default {
handleEdit() {
if (this.sids.length === 1) {
this.viewState = 2
this.$refs['divAdd'].showEdit(this.sids[0])
this.$refs['divAdd'].showEdit(this.sids[0], this.isDesignatedEnterprise)
} else {
this.$message({ showClose: true, type: 'error', message: '请选择一条记录进行操作' })
}
@ -138,6 +140,7 @@ export default {
sid: '',
list: []
}
this.isDesignatedEnterprise = false
this.submitdisabled = false
this.$emit('doback')
}

11
yxt-as-ui/src/views/client/customermanagement/relation/vehicleAdd.vue

@ -14,17 +14,17 @@
<el-row style="border-top: 1px solid #e0e3eb">
<el-col :span="12">
<div class="span-sty"><span class="icon">*</span>车牌号</div>
<el-form-item prop="vehMark"><el-input class="addinputInfo" style="width: 40%" v-model="formobj.vehMark" clearable placeholder="" /></el-form-item>
<el-form-item prop="vehMark"><el-input class="addinputInfo" :disabled="isDesignatedEnterprise" style="width: 40%" v-model="formobj.vehMark" clearable placeholder="" /></el-form-item>
</el-col>
<el-col :span="12">
<div class="span-sty"><span class="icon">*</span>车架号</div>
<el-form-item prop="vinNo"><el-input class="addinputInfo" style="width: 40%" v-model="formobj.vinNo" clearable placeholder="" /></el-form-item>
<el-form-item prop="vinNo"><el-input class="addinputInfo" :disabled="isDesignatedEnterprise" style="width: 40%" v-model="formobj.vinNo" clearable placeholder="" /></el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<div class="span-sty">发动机号</div>
<el-form-item><el-input class="addinputInfo" style="width: 40%" v-model="formobj.engineNo" clearable placeholder="" /></el-form-item>
<el-form-item><el-input class="addinputInfo" style="width: 40%" :disabled="isDesignatedEnterprise" v-model="formobj.engineNo" clearable placeholder="" /></el-form-item>
</el-col>
<el-col :span="12">
<div class="span-sty">车型</div>
@ -160,6 +160,7 @@ export default {
viewTitle: '',
viewState: 1,
submitdisabled: false,
isDesignatedEnterprise: false, //
formobj: {
customerVehSid: '',
customerSid: '',
@ -205,11 +206,12 @@ export default {
})
this.formobj.customerSid = sid
},
showEdit(sid) {
showEdit(sid, isDesignatedEnterprise) {
this.viewTitle = '【编辑】车辆'
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
this.isDesignatedEnterprise = isDesignatedEnterprise
req.details(sid).then((res) => {
if (res.success) {
this.formobj = res.data
@ -285,6 +287,7 @@ export default {
carRemarks: '',
byRemarks: ''
}
this.isDesignatedEnterprise = false
this.submitdisabled = false
this.$emit('doback')
},

Loading…
Cancel
Save