|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="280"
|
|
|
:options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
|
|
|
- :operation="operation">
|
|
|
+ :operation="operation()">
|
|
|
<!-- :exportList="exportList" -->
|
|
|
<div slot="moreSearch">
|
|
|
<el-radio-group v-model="examineStatus" size="mini" @change="changeType">
|
|
@@ -56,9 +56,10 @@ import TemplatePage from '@/components/template/template-page-1.vue'
|
|
|
import import_mixin from '@/components/template/import_mixin.js'
|
|
|
import { required, mobileRequired, mobile } from '@/components/template/rules_verify.js'
|
|
|
import { memberListService2,memberPageExport, getMemberDetail, memberAudit, memberInner, memberInsideInner, getWebsit } from "@/api/distributorManagement";
|
|
|
+import operation_mixin from '@/components/template/operation_mixin.js'
|
|
|
export default {
|
|
|
components: { TemplatePage },
|
|
|
- mixins: [import_mixin],
|
|
|
+ mixins: [import_mixin,operation_mixin],
|
|
|
data() {
|
|
|
return {
|
|
|
// 事件组合
|
|
@@ -218,75 +219,87 @@ export default {
|
|
|
selectionChange(data) {
|
|
|
this.recordSelected = data
|
|
|
},
|
|
|
- // 表格操作列
|
|
|
- operation(h, { row, index, column }) {
|
|
|
- return (
|
|
|
- <div class='operation-btns'>
|
|
|
- {row.examineStatus == 'WAIT' ? <el-button type="text" onClick={() => {
|
|
|
- this.workerForm.userId = row.userId
|
|
|
- getMemberDetail({ userId: row.userId }).then(res => {
|
|
|
- Object.assign(this.formData, res.data)
|
|
|
- this.formDialogType = 0
|
|
|
- this.openForm()
|
|
|
- })
|
|
|
- }}>审核</el-button> : null}
|
|
|
- <el-button type="text" onClick={() => {
|
|
|
- getMemberDetail({ userId: row.userId }).then(res => {
|
|
|
- Object.assign(this.formData, res.data)
|
|
|
- this.formDialogType = 1
|
|
|
- this.openForm()
|
|
|
- })
|
|
|
- }}>详情</el-button>
|
|
|
- {row.examineStatus != 'WAIT' ?<el-button type="text" onClick={() => {
|
|
|
- this.workerForm.userId = row.userId
|
|
|
- getWebsit({type: 'C'}).then(res => {
|
|
|
- this.websitList = res.data
|
|
|
- this.dialogVisible = true
|
|
|
- })
|
|
|
- }}>设为工程师</el-button>:null}
|
|
|
-
|
|
|
- {row.examineStatus != 'WAIT' ?<el-button type="text" onClick={() => {
|
|
|
- this.$confirm('请确认是否设为客户, 是否继续?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- memberInner({
|
|
|
- type: 'GENERAL',
|
|
|
- userIds: row.userId
|
|
|
- }).then(res => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.$message({ type: 'success', message: '设为客户成功!' })
|
|
|
- this.$refs.pageRef.refreshList()
|
|
|
- } else {
|
|
|
- this.$message.error(res.msg);
|
|
|
- }
|
|
|
- })
|
|
|
- });
|
|
|
- }}>设为客户</el-button>:null}
|
|
|
-
|
|
|
- <el-button type="text" onClick={() => {
|
|
|
- this.$confirm(`请确认是否${row.innerr?'取消':'设为'}内部分销员, 是否继续?`, '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- memberInsideInner({
|
|
|
- innerr: !row.innerr,
|
|
|
- userIds: row.userId
|
|
|
- }).then(res => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.$message({ type: 'success', message: (row.innerr?'取消':'设为')+ '内部分销员成功!' })
|
|
|
- this.$refs.pageRef.refreshList()
|
|
|
- } else {
|
|
|
- this.$message.error(res.msg);
|
|
|
- }
|
|
|
- })
|
|
|
- });
|
|
|
- }}>{ (row.innerr?'取消':'设为')+'内部分销员'}</el-button>
|
|
|
- </div>
|
|
|
- )
|
|
|
- },
|
|
|
+ // 表格操作列
|
|
|
+ operation() {
|
|
|
+ return this.operationBtn({
|
|
|
+ detail: {
|
|
|
+ btnType: 'text',
|
|
|
+ click: ({ row, index, column }) => {
|
|
|
+ getMemberDetail({ userId: row.userId }).then(res => {
|
|
|
+ Object.assign(this.formData, res.data)
|
|
|
+ this.formDialogType = 1
|
|
|
+ this.openForm()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ examine: {
|
|
|
+ btnType: 'text',
|
|
|
+ conditions: ({ row, index, column }) => {
|
|
|
+ return row.examineStatus == 'WAIT'
|
|
|
+ },
|
|
|
+ click: ({ row, index, column }) => {
|
|
|
+ getMemberDetail({ userId: row.userId }).then(res => {
|
|
|
+ Object.assign(this.formData, res.data)
|
|
|
+ this.formDialogType = 0
|
|
|
+ this.openForm()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ setWorker: {
|
|
|
+ btnType: 'text',
|
|
|
+ prompt: '请确认是否设为工程师?',
|
|
|
+ conditions: ({ row, index, column }) => {
|
|
|
+ return row.examineStatus != 'WAIT'
|
|
|
+ },
|
|
|
+ click: ({ row, index, column }) => {
|
|
|
+ this.workerForm.userId = row.userId
|
|
|
+ getWebsit({type: 'C'}).then(res => {
|
|
|
+ this.websitList = res.data
|
|
|
+ this.dialogVisible = true
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ setCustomer: {
|
|
|
+ btnType: 'text',
|
|
|
+ prompt: '请确认是否设为客户?',
|
|
|
+ click: ({ row, index, column }) => {
|
|
|
+ memberInner({
|
|
|
+ type: 'GENERAL',
|
|
|
+ userIds: row.userId
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message({ type: 'success', message: '设为客户成功!' })
|
|
|
+ this.$refs.pageRef.refreshList()
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ setService: {
|
|
|
+ name: ({ row, index, column }) => {
|
|
|
+ return `${row.innerr?'取消':'设为'}内部分销员`
|
|
|
+ },
|
|
|
+ btnType: 'text',
|
|
|
+ prompt: ({ row, index, column }) => {
|
|
|
+ return `请确认是否${row.innerr?'取消':'设为'}内部分销员?`
|
|
|
+ },
|
|
|
+ click: ({ row, index, column }) => {
|
|
|
+ memberInsideInner({
|
|
|
+ innerr: !row.innerr,
|
|
|
+ userIds: row.userId
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message({ type: 'success', message: (row.innerr?'取消':'设为')+ '内部分销员成功!' })
|
|
|
+ this.$refs.pageRef.refreshList()
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ })
|
|
|
+ },
|
|
|
addData() {
|
|
|
this.formDialogType = 0
|
|
|
this.openForm()
|