zm^2
戴余标 2 years ago
parent 2a38e78d19
commit 3f6376ff46

@ -18,7 +18,8 @@ const app = {
remindReceivablesPlan: 0, remindReceivablesPlan: 0,
endContract: 0, endContract: 0,
totalNum: 0 totalNum: 0
} },
crmCustomerNumForC: 0
}, },
mutations: { mutations: {
@ -54,7 +55,7 @@ const app = {
reject(error) reject(error)
}) })
crmCustomerNumForC().then(res => { crmCustomerNumForC().then(res => {
console.log(res.data) commit('SET_CUSTOMERNUM', res.data)
}).catch(() => {}) }).catch(() => {})
}) })
} }

@ -250,7 +250,11 @@ const permission = {
messageItem.children[0].meta.num = num messageItem.children[0].meta.num = num
Vue.set(state.crmRouters, 1, messageItem) Vue.set(state.crmRouters, 1, messageItem)
}, },
SET_CUSTOMERNUM: (state, num) => {
const messageItem = state.crmRouters[3]
messageItem.children[0].meta.num = num
Vue.set(state.crmRouters, 3, messageItem)
},
SET_GROUPSLIST: (state, data) => { SET_GROUPSLIST: (state, data) => {
state.groupsList = data state.groupsList = data
} }

@ -1,107 +1,58 @@
<template> <template>
<create-view <create-view :loading="loading" :body-style="{ height: '100%' }">
:loading="loading" <flexbox direction="column" align="stretch" class="pool-add-container">
:body-style="{ height: '100%'}">
<flexbox
direction="column"
align="stretch"
class="pool-add-container">
<flexbox class="pool-add-header"> <flexbox class="pool-add-header">
<div style="flex:1;font-size:17px;color:#333;font-weight: bold;">{{ title }}</div> <div style="flex:1;font-size:17px;color:#333;font-weight: bold;">{{ title }}</div>
<i <i class="el-icon-close close" @click="hidenView" />
class="el-icon-close close"
@click="hidenView" />
</flexbox> </flexbox>
<div class="pool-add-content"> <div class="pool-add-content">
<create-sections <create-sections v-if="baseFrom" title="基本信息">
v-if="baseFrom" <flexbox style="margin-top: 8px;" direction="column" align="stretch">
title="基本信息"> <el-form ref="ruleForm" :model="baseFrom" :rules="baseRules" label-position="top" class="pool-add-items">
<flexbox <el-form-item prop="pool_name" class="pool-add-item pool-add-item__left">
style="margin-top: 8px;" <div slot="label" style="display: inline-block;">
direction="column"
align="stretch">
<el-form
ref="ruleForm"
:model="baseFrom"
:rules="baseRules"
label-position="top"
class="pool-add-items">
<el-form-item
prop="pool_name"
class="pool-add-item pool-add-item__left">
<div
slot="label"
style="display: inline-block;">
<div class="xr-form-label"> <div class="xr-form-label">
公海名称 公海名称
</div> </div>
</div> </div>
<el-input v-model="baseFrom.pool_name" :maxlength="100" /> <el-input v-model="baseFrom.pool_name" :maxlength="100" />
</el-form-item> </el-form-item>
<el-form-item <el-form-item prop="adminUsers" class="pool-add-item pool-add-item__right">
prop="adminUsers" <div slot="label" style="display: inline-block;">
class="pool-add-item pool-add-item__right">
<div
slot="label"
style="display: inline-block;">
<div class="xr-form-label"> <div class="xr-form-label">
公海管理员<el-tooltip 公海管理员<el-tooltip content="客户公海管理员可对客户公海客户进行领取、分配、删除、导出等操作" effect="dark" placement="top">
content="客户公海管理员可对客户公海客户进行领取、分配、删除、导出等操作" <i class="wk wk-help wk-help-tips" />
effect="dark"
placement="top">
<i class="wk wk-help wk-help-tips"/>
</el-tooltip> </el-tooltip>
</div> </div>
</div> </div>
<xh-user-cell <xh-user-cell :radio="false" :value="baseFrom.adminUsers" @value-change="userChange" />
:radio="false"
:value="baseFrom.adminUsers"
@value-change="userChange" />
</el-form-item> </el-form-item>
<el-form-item <el-form-item prop="memberUsers" class="pool-add-item pool-add-item__left">
prop="memberUsers" <div slot="label" style="display: inline-block;">
class="pool-add-item pool-add-item__left">
<div
slot="label"
style="display: inline-block;">
<div class="xr-form-label"> <div class="xr-form-label">
公海成员<el-tooltip 公海成员<el-tooltip content="客户公海规则对客户公海成员生效(超级管理员除外),客户公海成员可查看以及领取公海客户" effect="dark" placement="top">
content="客户公海规则对客户公海成员生效(超级管理员除外),客户公海成员可查看以及领取公海客户" <i class="wk wk-help wk-help-tips" />
effect="dark"
placement="top">
<i class="wk wk-help wk-help-tips"/>
</el-tooltip> </el-tooltip>
</div> </div>
</div> </div>
<xh-struc-user-cell <xh-struc-user-cell :value="baseFrom.memberUsers" @value-change="strcUserChange" />
:value="baseFrom.memberUsers"
@value-change="strcUserChange" />
</el-form-item> </el-form-item>
</el-form> </el-form>
</flexbox> </flexbox>
</create-sections> </create-sections>
<create-sections <create-sections v-if="recycleRuleData" title="规则设置">
v-if="recycleRuleData" <flexbox class="row" align="stretch">
title="规则设置"> <div class="row-label">客户类型</div>
<flexbox
class="row"
align="stretch">
<div class="row-label">客户类型列表</div>
<div class="row-content"> <div class="row-content">
<el-select <el-select
v-model="baseFrom.customerTypes"> v-model="baseFrom.customer_type" multiple filterable allow-create default-first-option
<el-option placeholder="请选择客户类型" class="customer_select">
v-for="itemOption in customerTypes" <el-option v-for="item in options" :key="item.index" :label="item.index" :value="item" />
:key="itemOption.value"
:label="itemOption.name"
:value="itemOption.value"/>
</el-select> </el-select>
</div> </div>
</flexbox> </flexbox>
<flexbox <flexbox class="row" align="stretch">
class="row"
align="stretch">
<div class="row-label">前负责人领取规则</div> <div class="row-label">前负责人领取规则</div>
<div class="row-content"> <div class="row-content">
<el-radio-group v-model="baseFrom.before_owner_conf"> <el-radio-group v-model="baseFrom.before_owner_conf">
@ -116,9 +67,7 @@
</div> </div>
</flexbox> </flexbox>
<flexbox <flexbox class="row" align="stretch">
class="row"
align="stretch">
<div class="row-label">领取频率规则</div> <div class="row-label">领取频率规则</div>
<div class="row-content"> <div class="row-content">
<el-radio-group v-model="baseFrom.receive_conf"> <el-radio-group v-model="baseFrom.receive_conf">
@ -133,9 +82,7 @@
</div> </div>
</flexbox> </flexbox>
<flexbox <flexbox class="row" align="stretch">
class="row"
align="stretch">
<div class="row-label">提醒规则</div> <div class="row-label">提醒规则</div>
<div class="row-content"> <div class="row-content">
<el-radio-group v-model="baseFrom.remind_conf"> <el-radio-group v-model="baseFrom.remind_conf">
@ -150,9 +97,7 @@
</div> </div>
</flexbox> </flexbox>
<flexbox <flexbox class="row" align="stretch">
class="row"
align="stretch">
<div class="row-label">收回规则</div> <div class="row-label">收回规则</div>
<div class="row-content"> <div class="row-content">
<el-radio-group v-model="baseFrom.recycle_conf"> <el-radio-group v-model="baseFrom.recycle_conf">
@ -164,32 +109,21 @@
<template v-if="baseFrom.recycle_conf == 1"> <template v-if="baseFrom.recycle_conf == 1">
<recycle-rule <recycle-rule
v-for="(item, index) in recycleRuleData" v-for="(item, index) in recycleRuleData" :key="index" :data="item"
:key="index" :level-customer="levelCustomerName" :true-label="index + 1" :is-edit="isEdit" />
:data="item"
:level-customer="levelCustomerName"
:true-label="index + 1"
:is-edit="isEdit"
/>
</template> </template>
<flexbox <flexbox class="row" align="stretch">
class="row"
align="stretch">
<div class="row-label">公海字段设置</div> <div class="row-label">公海字段设置</div>
<div class="row-content"> <div class="row-content">
<div class="field-set"> <div class="field-set">
<div class="field-set__name"> <div class="field-set__name">
选择公海字段 选择公海字段
</div> </div>
<flexbox <flexbox wrap="wrap">
wrap="wrap">
<el-checkbox <el-checkbox
v-for="(item, index) in customerPoolFields" v-for="(item, index) in customerPoolFields" :key="index"
:key="index" v-model="item.is_hidden" :true-label="0" :false-label="1">{{ item.name }}</el-checkbox>
v-model="item.is_hidden"
:true-label="0"
:false-label="1">{{ item.name }}</el-checkbox>
</flexbox> </flexbox>
</div> </div>
</div> </div>
@ -198,13 +132,8 @@
</div> </div>
<div class="handle-bar"> <div class="handle-bar">
<el-button <el-button class="handle-button" @click.native="hidenView">取消</el-button>
class="handle-button" <el-button v-debounce="saveClick" class="handle-button" type="primary"></el-button>
@click.native="hidenView">取消</el-button>
<el-button
v-debounce="saveClick"
class="handle-button"
type="primary">保存</el-button>
</div> </div>
</flexbox> </flexbox>
</create-view> </create-view>
@ -264,6 +193,7 @@ export default {
} }
return { return {
options: [],
loading: false, loading: false,
baseFrom: null, baseFrom: null,
baseRules: { baseRules: {
@ -280,7 +210,6 @@ export default {
recycleRuleData: null, recycleRuleData: null,
levelCustomerName: [], // levelCustomerName: [], //
customerPoolFields: [], customerPoolFields: [],
customerTypes: [], //
requestFields: { requestFields: {
before_owner_day: '前负责人限制领取天数需大于0', before_owner_day: '前负责人限制领取天数需大于0',
receive_count: '领取频率限制个数需大于0', receive_count: '领取频率限制个数需大于0',
@ -313,17 +242,17 @@ export default {
this.getCustomerTypes() this.getCustomerTypes()
}, },
beforeDestroy() {}, beforeDestroy() { },
methods: { methods: {
getLevelCustomerData() { getLevelCustomerData() {
crmCustomerPoolQueryLevelAPI().then(res => { crmCustomerPoolQueryLevelAPI().then(res => {
this.levelCustomerName = res.data || [] this.levelCustomerName = res.data || []
}).catch(() => {}) }).catch(() => { })
}, },
getCustomerTypes() { getCustomerTypes() {
crmCustomerType().then(res => { crmCustomerType().then(res => {
this.customerTypes = res.data || [] this.options = res.data || []
}).catch(() => {}) }).catch(() => { })
}, },
/** /**
* 编辑操作 * 编辑操作
@ -353,7 +282,6 @@ export default {
users: data.user_info, users: data.user_info,
strucs: data.department_info strucs: data.department_info
}, },
customerTypes: data.crm_customer_type,//
before_owner_conf: data.before_owner_conf, // 0 1 before_owner_conf: data.before_owner_conf, // 0 1
before_owner_day: data.before_owner_day, before_owner_day: data.before_owner_day,
receive_conf: data.receive_conf, // 0 1 receive_conf: data.receive_conf, // 0 1
@ -416,7 +344,6 @@ export default {
users: [], users: [],
strucs: [] strucs: []
}, },
customerTypes: [],
before_owner_conf: 0, // 0 1 before_owner_conf: 0, // 0 1
before_owner_day: '', before_owner_day: '',
receive_conf: 0, // 0 1 receive_conf: 0, // 0 1
@ -573,7 +500,6 @@ export default {
*/ */
getRequestParams() { getRequestParams() {
const params = {} const params = {}
for (const key in this.baseFrom) { for (const key in this.baseFrom) {
if (!this.requestFieldsVerify(key)) { if (!this.requestFieldsVerify(key)) {
this.$message.error(this.requestFields[key]) this.$message.error(this.requestFields[key])
@ -594,6 +520,11 @@ export default {
params.department_ids = adminStrucs.map(item => { params.department_ids = adminStrucs.map(item => {
return item.id return item.id
}).join(',') }).join(',')
} else if (key == 'customer_type') {
params.customer_type = this.baseFrom.customer_type.map(item => {
return item
}).join(',')
console.log(params.customer_type)
} else { } else {
params[key] = this.baseFrom[key] params[key] = this.baseFrom[key]
} }
@ -688,6 +619,7 @@ export default {
margin-bottom: 20px; margin-bottom: 20px;
padding: 0 10px; padding: 0 10px;
flex-shrink: 0; flex-shrink: 0;
.close { .close {
display: block; display: block;
font-size: 24px; font-size: 24px;
@ -696,6 +628,7 @@ export default {
padding: 10px; padding: 10px;
cursor: pointer; cursor: pointer;
} }
.close:hover { .close:hover {
color: $xr-color-primary; color: $xr-color-primary;
} }
@ -734,9 +667,11 @@ export default {
flex-shrink: 0; flex-shrink: 0;
// overflow: hidden; // overflow: hidden;
padding-bottom: 10px; padding-bottom: 10px;
&__left { &__left {
padding-right: 25px; padding-right: 25px;
} }
&__right { &__right {
padding-left: 25px; padding-left: 25px;
} }
@ -747,6 +682,7 @@ export default {
font-size: 12px; font-size: 12px;
word-wrap: break-word; word-wrap: break-word;
word-break: break-all; word-break: break-all;
.wk-help { .wk-help {
margin-left: 5px; margin-left: 5px;
} }
@ -757,6 +693,7 @@ export default {
padding: 8px 15px 0; padding: 8px 15px 0;
font-size: 13px; font-size: 13px;
color: #333; color: #333;
&-label { &-label {
width: 120px; width: 120px;
margin-top: 10px; margin-top: 10px;
@ -766,12 +703,14 @@ export default {
&-content { &-content {
flex: 1; flex: 1;
margin-left: 20px; margin-left: 20px;
.el-radio-group { .el-radio-group {
margin: 8px 0; margin: 8px 0;
} }
.xr-input { .xr-input {
margin-bottom: 8px; margin-bottom: 8px;
.el-input { .el-input {
width: 80px; width: 80px;
margin: 0 8px; margin: 0 8px;
@ -803,9 +742,12 @@ export default {
margin-bottom: 8px; margin-bottom: 8px;
} }
} }
.customer_select{
width: 50%;
}
.handle-bar { .handle-bar {
position: relative; position: relative;
.handle-button { .handle-button {
float: right; float: right;
margin-top: 5px; margin-top: 5px;

@ -142,7 +142,6 @@ export default {
} }
}, },
mounted() { mounted() {
console.log('aaaaaa' + this.items[0].num)
this.buttonCollapse = this.collapse this.buttonCollapse = this.collapse
}, },
methods: { methods: {

Loading…
Cancel
Save