Commit 9ef133d8 authored by qinj's avatar qinj

代理商审批列表页

parent 7ef66d90
...@@ -8,7 +8,11 @@ export const customer = { ...@@ -8,7 +8,11 @@ export const customer = {
updateUrl: '/customer/update', updateUrl: '/customer/update',
deleteUrl: '/customer/delete', deleteUrl: '/customer/delete',
} }
//查询省级供应商待审批列表
export const province = {
searchUrl: '/customer/searchProcessCustomer',
}
// 查询全部代理商数据 // 查询全部代理商数据
export function getAllData(data) { export function getAllData(data) {
return request({ return request({
...@@ -25,6 +29,14 @@ export function customerCreate(data) { ...@@ -25,6 +29,14 @@ export function customerCreate(data) {
data data
}) })
} }
// 签约产品组
export function searchProduct(data) {
return request({
method: 'post',
url: '/commonSession/searchAll',
data
})
}
// // 客户发布记录 // // 客户发布记录
// export const releaseRecord = { // export const releaseRecord = {
// createUrl: '/releaserecord/create', // createUrl: '/releaserecord/create',
...@@ -73,13 +85,6 @@ export function customerCreate(data) { ...@@ -73,13 +85,6 @@ export function customerCreate(data) {
// }) // })
// } // }
// // 一级分类
// export function fetchFirstLevelClassification() {
// return request({
// method: 'post',
// url: '/levelClassification/searchAllOne'
// })
// }
// // 二级分类 // // 二级分类
// export function fetchSecondLevelClassification(data) { // export function fetchSecondLevelClassification(data) {
......
...@@ -185,7 +185,8 @@ export default { ...@@ -185,7 +185,8 @@ export default {
takeEffect: '生效', takeEffect: '生效',
invalid: '失效', invalid: '失效',
baseInfo: '基础信息', baseInfo: '基础信息',
viewAttachments: '查看附件' viewAttachments: '查看附件',
approve:'审批'
}, },
example: { example: {
warning: '创建和编辑页面是不能被 keep-alive 缓存的,因为keep-alive 的 include 目前不支持根据路由来缓存,所以目前都是基于 component name 来进行缓存的。如果你想类似的实现缓存效果,可以使用 localStorage 等浏览器缓存方案。或者不要使用 keep-alive 的 include,直接缓存所有页面。详情见' warning: '创建和编辑页面是不能被 keep-alive 缓存的,因为keep-alive 的 include 目前不支持根据路由来缓存,所以目前都是基于 component name 来进行缓存的。如果你想类似的实现缓存效果,可以使用 localStorage 等浏览器缓存方案。或者不要使用 keep-alive 的 include,直接缓存所有页面。详情见'
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
</ul> </ul>
</li> </li>
<!-- 消息三小列表 --> <!-- 消息三小列表 -->
<li <!-- <li
v-for="route in topRoutes.slice(-1)" v-for="route in topRoutes.slice(-1)"
:key="route.meta.title" :key="route.meta.title"
class="nav-item" class="nav-item"
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
/> />
<span>{{ route.meta.topTitle }}</span> <span>{{ route.meta.topTitle }}</span>
<el-badge :value="2" class="item" /> <el-badge :value="2" class="item" />
</li> </li> -->
</ul> </ul>
<!-- <div class="Mymessage"> <!-- <div class="Mymessage">
<router-link to="/message/index"> <router-link to="/message/index">
......
import dictionary from '@/api/dictionary' import i18n from '@/lang'
import { customer } from '@/api/customers' import { province,searchProduct } from '@/api/customers'
// 潜在客户主列表配置
const tableConfig = { const tableConfig = {
url: customer.searchUrl, url: province.searchUrl,
initialParams: {
roleCode: 'BUP002'
},
defaultColumns: { defaultColumns: {
minWidth: 120, minWidth: 120,
showOverflowTooltip: true, showOverflowTooltip: true,
align: 'center' align: 'center'
}, },
columns: { searchColums:{
Name: { Name: {
label: '客户名称', label: '公司名称',
showInSearch: true,
type: 'input', type: 'input',
fixed: 'left',
renderItem: (h, scope, listeners) => { renderItem: (h, scope, listeners) => {
return h( return h('el-button', {
'el-button',
{
on: { on: {
click: (e) => listeners.handleCheck(scope.row) click: (e) => listeners.handleDetails(scope.row)
}, },
props: { props: {
type: 'text' type: 'text'
} }
}, scope.row.ID)
}
}, },
scope.row.Name) ExtProductGroup_SDK: {
label: '签约产品组',
showInSearch: true,
type: 'select',
fixed: 'left',
isOptions:'true',
options: async data => {
const res = await searchProduct({code:'ExtProductGroup_SDK',module:'Customer'})
var result = res.map(item => {
return {
text: item.content,
value: item.keyword
}
})
return result
}, },
showInSearch: true
}, },
Ext_CustomerType_KUT: {
label: '客户类型',
type: 'select',
value: 'Ext_CustomerType_KUTText',
showInSearch: true,
options: dictionary.customerType
}, },
Ext_CustomerStatus_KUT: { columns: {
label: '客户状态', ExtCustomerID_SDK: {
type: 'select', label: '代理商编码',
value: 'Ext_CustomerStatus_KUTText', type: 'input'
showInSearch: true,
options: dictionary.customerStatus
}, },
Ext_CustomerMainContactName_KUT: { Name: {
label: '联系人', label: '公司名称',
type: 'input' type: 'input'
}, },
Ext_CustomerMainContactPhone_KUT: { ExtCorporateName_SDK: {
label: '手机号码', label: '法定人代表',
type: 'input' type: 'input'
}, },
Ext_CustomerFollowUpDate_KUT: { ExtSocialUnifiedCreditCode_SDK: {
label: '最后跟进', label: '统一社会信用代码',
type: 'input' type: 'input'
}, },
Ext_CustomerForm_KUT: {
label: '来源', CreationOn: {
value: 'Ext_CustomerForm_KUTText', label: '注册时间',
type: 'input' type: 'input'
}, },
// Ext_QuoteOppotunity_KUT: {
// type: 'input',
// label: '代理商类型',
// showInSearch: true
// },
handle: { handle: {
label: '操作', label: '操作',
hideInFilter: true,
fixed: 'right', fixed: 'right',
minWidth: 100,
hideInFilter: true,
renderItem: (h, scope, listeners) => { renderItem: (h, scope, listeners) => {
return h('div', {}, [ return h('div', [
h( h('el-button', {
'el-button',
{
on: {
click: (e) => listeners.handleEdit(scope.row)
},
class: 'el-icon-edit',
props: {
type: 'text'
}
},
'编辑'),
scope.row.Ext_CustomerStatus_KUTText === '草稿' && h(
'el-button',
{
on: { on: {
click: (e) => listeners.handleDelete(scope.row) click: (e) => listeners.handleEdit(scope.row, 'approve')
}, },
class: 'el-icon-delete',
props: { props: {
type: 'text' type: 'text',
label:'审批'
} }
}, }, i18n.t('table.approve')),
'删除') // h('el-button', {
// on: {
// click: (e) => listeners.handleTakeEffect(scope.row, 'takeEffect')
// },
// props: {
// icon: 'el-icon-circle-check',
// type: 'text'
// }
// }, i18n.t('table.takeEffect')),
// h('el-button', {
// on: {
// click: (e) => listeners.handleInvalid(scope.row, 'invalid')
// },
// props: {
// icon: 'el-icon-circle-check',
// type: 'text'
// }
// }, i18n.t('table.invalid'))
]) ])
} }
} }
} }
} }
// 注销客户弹框配置 export default tableConfig
const CancellationFormConfig = {
title: '注销原因',
createUrl: customer.updateUrl,
labelPosition: 'left',
submitBtnText: '确定',
span: 22,
formDesc: {
Ext_CustomerStatus_KUT: {
type: 'input',
label: '客户状态',
default: '131',
vif: false,
layout: 24
},
Ext_CustomerCancellationReasons_KUT: {
type: 'textarea',
label: '注销原因',
layout: 24
}
}
}
// 激活客户弹框配置
const ActivationFormConfig = {
title: '激活原因',
createUrl: customer.updateUrl,
labelPosition: 'left',
submitBtnText: '确定',
span: 22,
formDesc: {
Ext_CustomerStatus_KUT: {
type: 'input',
label: '客户状态',
default: '111',
vif: false,
layout: 24
},
Ext_CustomerActivationReasons_KUT: {
type: 'textarea',
label: '激活原因',
layout: 24
}
}
}
// 移入资源池弹框配置
const ResourcePoolFormConfig = {
title: '移入资源池',
createUrl: customer.toPoolUrl,
labelPosition: 'left',
submitBtnText: '确定',
span: 22,
formDesc: {
Ext_CustomerActivationReasons_KUT: {
type: 'textarea',
label: '移入资源池原因',
layout: 24
}
}
}
export default {
tableConfig,
ActivationFormConfig,
CancellationFormConfig,
ResourcePoolFormConfig
}
<template> <template>
<div class="app-container"> <div class="app-container">
<ele-search <ele-search
:columns="tableConfig.columns" :columns="tableConfig.searchColums"
@handleSearch="handleSearch" @handleSearch="handleSearch"
@handleReset="handleReset" @handleReset="handleReset"
@handleFilter="handleFilter"
/> />
<div class="table-container"> <div class="table-container">
<TableBtns>
<template v-slot:left>
<el-dropdown
style="margin-right: 10px;"
@command="handleAdd"
>
<el-button
type="primary"
icon="el-icon-plus"
>
添加
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="1">创建个人客户</el-dropdown-item>
<el-dropdown-item :command="2">创建企业客户</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button
plain
icon="el-icon-refresh"
@click="handleShowDialog(config.followTask)"
>分配</el-button>
<el-button
plain
icon="el-icon-user"
@click="handleShowDialog(config.resourcePool)"
>转资源池</el-button>
<el-button
plain
icon="el-icon-document"
@click="handleShowDialog(config.supervise)"
>
督办
</el-button>
<export-btn
:expand-params="expandParams"
config-code="customer"
/>
</template>
</TableBtns>
<ele-table <ele-table
ref="eleTable" ref="eleTable"
v-bind="tableConfig" v-bind="tableConfig"
:expand-params="expandParams" :expand-params="expandParams"
:listeners="tableListeners" :listeners="tableListeners"
@handleSelectionChange="handleSelectionChange"
/>
<!-- 弹框部分 -->
<ele-form-dialog
:title="dialogTitle"
:form-data="formData"
:request-fn="handleSave"
:visible.sync="dialogFormVisible"
v-bind="formConfig"
:loading="loading"
/> />
</div> </div>
</div> </div>
...@@ -71,125 +22,33 @@ ...@@ -71,125 +22,33 @@
<script> <script>
import constant from './constant' import constant from './constant'
import tableMixin from '@/mixins/table' import tableMixin from '@/mixins/table'
import followTask from '../important-customers/components/record-info/components/follow-task/constant'
import supervise from '../important-customers/components/record-info/components/supervise/constant'
import { customer } from '@/api/customers'
export default { export default {
mixins: [tableMixin], mixins: [tableMixin],
inject: ['reload'],
data() { data() {
return { return {
expandParams: {}, // 筛选条件 expandParams: {}, // 筛选条件
tableListeners: {}, // 事件监听对象,供ele-table内部调用 tableListeners: {}, // 事件监听对象,供ele-table内部调用
tableConfig: constant.tableConfig, tableConfig: constant
enterpriseUrl: '/customers/enterprise',
individualUrl: '/customers/individual',
enterpriseDetailUrl: '/customers/enterprise-detail',
individualDetailUrl: '/customers/individual-detail',
selection: [],
config: {
followTask,
supervise,
resourcePool: constant.ResourcePoolFormConfig
},
dialogTitle: '',
dialogFormVisible: false,
formData: {},
formConfig: {
formDesc: {}
},
loading: false
} }
}, },
created() { created() {
this.tableListeners = { this.tableListeners = {
handleCheck: this.handleCheck, // handleDetails: this.handleDetails, // 添加
handleEdit: this.handleEdit, // handleTakeEffect: this.handleTakeEffect, // 生效
handleDelete: this.handleDelete handleEdit: this.handleEdit, // 编辑
// handleInvalid: this.handleInvalid // 失效
} }
}, },
methods: { methods: {
handleAdd(type) { // 编辑
if (type === 1) { handleEdit(val) {
this.$router.push({ path: this.individualUrl }) this.$router.push({ path: '/customersAdd',query:{id:val.ObjectID} })
} else {
this.$router.push({ path: this.enterpriseUrl })
}
},
handleCheck(row) {
if (row.Ext_CustomerType_KUT === '121') {
this.$router.push({
path: this.individualDetailUrl,
query: { objectID: row.ObjectID }
})
} else if (row.Ext_CustomerType_KUT === '131') {
this.$router.push({
path: this.enterpriseDetailUrl,
query: { objectID: row.ObjectID }
})
}
},
handleEdit(row) {
if (row.Ext_CustomerType_KUT === '121') {
this.$router.push({
path: this.individualUrl,
query: { objectID: row.ObjectID }
})
} else if (row.Ext_CustomerType_KUT === '131') {
this.$router.push({
path: this.enterpriseUrl,
query: { objectID: row.ObjectID }
})
}
}, },
handleSelectionChange(selection) {
console.log(selection)
this.selection = selection
},
handleShowDialog(obj) {
if (this.selection.length === 0) {
this.$message.warning('请先选择一个客户')
return
}
this.dialogTitle = obj.title ? obj.title : '添加' + obj.tableConfig.tableTitle
this.postUrl = obj.createUrl
this.formData = {
objectID: this.selection[0].ObjectID,
roleCode: this.selection[0].roleCode
}
this.formConfig = obj.formConfig || obj
this.dialogFormVisible = true
},
handleSave(data) {
this.loading = true
data = this.$translateToC4CData(data)
this.$request(this.postUrl, [data]).then(res => {
this.loading = false
this.dialogFormVisible = false
}).catch(() => {
this.loading = false
})
},
handleDelete(row) {
this.$confirm('此操作将删除该客户, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const data = {
objectID: row.ObjectID,
ext_CustomerStatus_KUT: '191'
}
this.$request(customer.updateUrl, data).then(res => {
this.$message.success('删除成功')
this.handleSearch()
})
})
}
} }
} }
</script> </script>
<style lang="scss" scoped> <style>
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment