Commit 9ef133d8 authored by qinj's avatar qinj

代理商审批列表页

parent 7ef66d90
......@@ -8,7 +8,11 @@ export const customer = {
updateUrl: '/customer/update',
deleteUrl: '/customer/delete',
}
//查询省级供应商待审批列表
export const province = {
searchUrl: '/customer/searchProcessCustomer',
}
// 查询全部代理商数据
export function getAllData(data) {
return request({
......@@ -25,6 +29,14 @@ export function customerCreate(data) {
data
})
}
// 签约产品组
export function searchProduct(data) {
return request({
method: 'post',
url: '/commonSession/searchAll',
data
})
}
// // 客户发布记录
// export const releaseRecord = {
// createUrl: '/releaserecord/create',
......@@ -73,13 +85,6 @@ export function customerCreate(data) {
// })
// }
// // 一级分类
// export function fetchFirstLevelClassification() {
// return request({
// method: 'post',
// url: '/levelClassification/searchAllOne'
// })
// }
// // 二级分类
// export function fetchSecondLevelClassification(data) {
......
......@@ -185,7 +185,8 @@ export default {
takeEffect: '生效',
invalid: '失效',
baseInfo: '基础信息',
viewAttachments: '查看附件'
viewAttachments: '查看附件',
approve:'审批'
},
example: {
warning: '创建和编辑页面是不能被 keep-alive 缓存的,因为keep-alive 的 include 目前不支持根据路由来缓存,所以目前都是基于 component name 来进行缓存的。如果你想类似的实现缓存效果,可以使用 localStorage 等浏览器缓存方案。或者不要使用 keep-alive 的 include,直接缓存所有页面。详情见'
......
......@@ -55,7 +55,7 @@
</ul>
</li>
<!-- 消息三小列表 -->
<li
<!-- <li
v-for="route in topRoutes.slice(-1)"
:key="route.meta.title"
class="nav-item"
......@@ -72,7 +72,7 @@
/>
<span>{{ route.meta.topTitle }}</span>
<el-badge :value="2" class="item" />
</li>
</li> -->
</ul>
<!-- <div class="Mymessage">
<router-link to="/message/index">
......
import dictionary from '@/api/dictionary'
import { customer } from '@/api/customers'
import i18n from '@/lang'
import { province,searchProduct } from '@/api/customers'
// 潜在客户主列表配置
const tableConfig = {
url: customer.searchUrl,
initialParams: {
roleCode: 'BUP002'
},
url: province.searchUrl,
defaultColumns: {
minWidth: 120,
showOverflowTooltip: true,
align: 'center'
},
columns: {
searchColums:{
Name: {
label: '客户名称',
label: '公司名称',
showInSearch: true,
type: 'input',
fixed: 'left',
renderItem: (h, scope, listeners) => {
return h(
'el-button',
{
return h('el-button', {
on: {
click: (e) => listeners.handleCheck(scope.row)
click: (e) => listeners.handleDetails(scope.row)
},
props: {
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: {
label: '客户状态',
type: 'select',
value: 'Ext_CustomerStatus_KUTText',
showInSearch: true,
options: dictionary.customerStatus
columns: {
ExtCustomerID_SDK: {
label: '代理商编码',
type: 'input'
},
Ext_CustomerMainContactName_KUT: {
label: '联系人',
Name: {
label: '公司名称',
type: 'input'
},
Ext_CustomerMainContactPhone_KUT: {
label: '手机号码',
ExtCorporateName_SDK: {
label: '法定人代表',
type: 'input'
},
Ext_CustomerFollowUpDate_KUT: {
label: '最后跟进',
ExtSocialUnifiedCreditCode_SDK: {
label: '统一社会信用代码',
type: 'input'
},
Ext_CustomerForm_KUT: {
label: '来源',
value: 'Ext_CustomerForm_KUTText',
CreationOn: {
label: '注册时间',
type: 'input'
},
// Ext_QuoteOppotunity_KUT: {
// type: 'input',
// label: '代理商类型',
// showInSearch: true
// },
handle: {
label: '操作',
hideInFilter: true,
fixed: 'right',
minWidth: 100,
hideInFilter: true,
renderItem: (h, scope, listeners) => {
return h('div', {}, [
h(
'el-button',
{
on: {
click: (e) => listeners.handleEdit(scope.row)
},
class: 'el-icon-edit',
props: {
type: 'text'
}
},
'编辑'),
scope.row.Ext_CustomerStatus_KUTText === '草稿' && h(
'el-button',
{
return h('div', [
h('el-button', {
on: {
click: (e) => listeners.handleDelete(scope.row)
click: (e) => listeners.handleEdit(scope.row, 'approve')
},
class: 'el-icon-delete',
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'))
])
}
}
}
}
// 注销客户弹框配置
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
}
export default tableConfig
<template>
<div class="app-container">
<ele-search
:columns="tableConfig.columns"
:columns="tableConfig.searchColums"
@handleSearch="handleSearch"
@handleReset="handleReset"
@handleFilter="handleFilter"
/>
<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
ref="eleTable"
v-bind="tableConfig"
:expand-params="expandParams"
: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>
......@@ -71,125 +22,33 @@
<script>
import constant from './constant'
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 {
mixins: [tableMixin],
inject: ['reload'],
data() {
return {
expandParams: {}, // 筛选条件
tableListeners: {}, // 事件监听对象,供ele-table内部调用
tableConfig: constant.tableConfig,
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
tableConfig: constant
}
},
created() {
this.tableListeners = {
handleCheck: this.handleCheck,
handleEdit: this.handleEdit,
handleDelete: this.handleDelete
// handleDetails: this.handleDetails, // 添加
// handleTakeEffect: this.handleTakeEffect, // 生效
handleEdit: this.handleEdit, // 编辑
// handleInvalid: this.handleInvalid // 失效
}
},
methods: {
handleAdd(type) {
if (type === 1) {
this.$router.push({ path: this.individualUrl })
} 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 }
})
}
// 编辑
handleEdit(val) {
this.$router.push({ path: '/customersAdd',query:{id:val.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>
<style lang="scss" scoped>
<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