|
@@ -1,6 +1,6 @@
|
|
<template>
|
|
<template>
|
|
<div class="app-container">
|
|
<div class="app-container">
|
|
-
|
|
|
|
|
|
+
|
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
<el-form-item label="客户编码" prop="customerCode">
|
|
<el-form-item label="客户编码" prop="customerCode">
|
|
<el-input
|
|
<el-input
|
|
@@ -55,10 +55,10 @@
|
|
/>
|
|
/>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="客户类型" prop="customerType">
|
|
|
|
- <el-select style="width:220px" multiple filterable v-model="ctsTypeArr" placeholder="请选择客户类型" clearable size="small">
|
|
|
|
|
|
+ <el-form-item label="客户类型" prop="customerLevel">
|
|
|
|
+ <el-select style="width:220px" filterable v-model="queryParams.customerLevel" placeholder="请选择客户类型" clearable size="small">
|
|
<el-option
|
|
<el-option
|
|
- v-for="item in typeOptions"
|
|
|
|
|
|
+ v-for="item in customerLevelOptions"
|
|
:key="item.dictValue"
|
|
:key="item.dictValue"
|
|
:label="item.dictLabel"
|
|
:label="item.dictLabel"
|
|
:value="item.dictValue"
|
|
:value="item.dictValue"
|
|
@@ -75,7 +75,7 @@
|
|
/>
|
|
/>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
-
|
|
|
|
|
|
+
|
|
<!-- <el-form-item label="是否认领" prop="isReceive">
|
|
<!-- <el-form-item label="是否认领" prop="isReceive">
|
|
<el-select v-model="queryParams.isReceive" placeholder="请选择是否认领" clearable size="small">
|
|
<el-select v-model="queryParams.isReceive" placeholder="请选择是否认领" clearable size="small">
|
|
<el-option
|
|
<el-option
|
|
@@ -163,7 +163,7 @@
|
|
v-hasPermi="['crm:customer:editScource']"
|
|
v-hasPermi="['crm:customer:editScource']"
|
|
>修改客户来源</el-button>
|
|
>修改客户来源</el-button>
|
|
</el-col>
|
|
</el-col>
|
|
-
|
|
|
|
|
|
+
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
<el-button
|
|
type="success"
|
|
type="success"
|
|
@@ -229,9 +229,9 @@
|
|
<el-tag prop="visitStatus" v-for="(item, index) in visitStatusOptions" v-if="scope.row.visitStatus==item.dictValue">{{item.dictLabel}}</el-tag>
|
|
<el-tag prop="visitStatus" v-for="(item, index) in visitStatusOptions" v-if="scope.row.visitStatus==item.dictValue">{{item.dictLabel}}</el-tag>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="客户类型" width="200" align="center" prop="customerType">
|
|
|
|
|
|
+ <el-table-column label="客户类型" width="200" align="center" prop="customerLevel">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-tag prop="status" v-for="(item, index) in typeOptions" v-if="scope.row.customerType==item.dictValue">{{item.dictLabel}}</el-tag>
|
|
|
|
|
|
+ <el-tag v-for="(item, index) in customerLevelOptions" v-if="scope.row.customerLevel===item.dictValue">{{item.dictLabel}}</el-tag>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="标签" align="center" prop="tags" />
|
|
<el-table-column label="标签" align="center" prop="tags" />
|
|
@@ -275,10 +275,17 @@
|
|
@click="handleAssign(scope.row)"
|
|
@click="handleAssign(scope.row)"
|
|
v-hasPermi="['crm:customer:assign']"
|
|
v-hasPermi="['crm:customer:assign']"
|
|
>分配客户</el-button> -->
|
|
>分配客户</el-button> -->
|
|
|
|
+ <el-button
|
|
|
|
+ size="mini"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="el-icon-mouse"
|
|
|
|
+ @click="handleSwitchToTop(scope.row)"
|
|
|
|
+ v-hasPermi="['crm:customer:switchToTop']"
|
|
|
|
+ >{{ scope.row.isTop === 1 ? '取消置顶' : '置顶' }}</el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
-
|
|
|
|
|
|
+
|
|
<pagination
|
|
<pagination
|
|
v-show="total>0"
|
|
v-show="total>0"
|
|
:total="total"
|
|
:total="total"
|
|
@@ -293,15 +300,15 @@
|
|
<customer-details ref="customerDetails" />
|
|
<customer-details ref="customerDetails" />
|
|
</el-drawer>
|
|
</el-drawer>
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
<el-dialog :title="addSms.title" :visible.sync="addSms.open" width="1000px" append-to-body>
|
|
<el-dialog :title="addSms.title" :visible.sync="addSms.open" width="1000px" append-to-body>
|
|
<add-batch-sms ref="sms" @close="closeSms()"></add-batch-sms>
|
|
<add-batch-sms ref="sms" @close="closeSms()"></add-batch-sms>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
<el-dialog :title="source.title" :visible.sync="source.open" width="1000px" append-to-body>
|
|
<el-dialog :title="source.title" :visible.sync="source.open" width="1000px" append-to-body>
|
|
<edit-source ref="editSource" @close="closeSource()"></edit-source>
|
|
<edit-source ref="editSource" @close="closeSource()"></edit-source>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
-
|
|
|
|
|
|
+
|
|
<el-dialog :title="customerSource.title" :visible.sync="customerSource.open" width="1000px" append-to-body>
|
|
<el-dialog :title="customerSource.title" :visible.sync="customerSource.open" width="1000px" append-to-body>
|
|
<customer-source ref="customerSource" @close="closeSource()"></customer-source>
|
|
<customer-source ref="customerSource" @close="closeSource()"></customer-source>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
@@ -336,8 +343,19 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-
|
|
|
|
-import { assignToUser,recover,receive,getCustomerList ,addCustomer,updateCustomer,getCustomerDetails,exportCustomer,importVisitTemplate } from "@/api/crm/customer";
|
|
|
|
|
|
+
|
|
|
|
+import {
|
|
|
|
+ assignToUser,
|
|
|
|
+ recover,
|
|
|
|
+ receive,
|
|
|
|
+ getCustomerList,
|
|
|
|
+ addCustomer,
|
|
|
|
+ updateCustomer,
|
|
|
|
+ getCustomerDetails,
|
|
|
|
+ exportCustomer,
|
|
|
|
+ importVisitTemplate,
|
|
|
|
+ switchToTop
|
|
|
|
+} from "@/api/crm/customer";
|
|
import { getToken } from "@/utils/auth";
|
|
import { getToken } from "@/utils/auth";
|
|
import customerDetails from '../components/customerDetails.vue';
|
|
import customerDetails from '../components/customerDetails.vue';
|
|
import {getCitys} from "@/api/store/city";
|
|
import {getCitys} from "@/api/store/city";
|
|
@@ -349,6 +367,7 @@ import editSource from '../components/editSource.vue';
|
|
import customerSource from '../components/customerSource.vue';
|
|
import customerSource from '../components/customerSource.vue';
|
|
import customerAssignList from '../components/customerAssignList.vue';
|
|
import customerAssignList from '../components/customerAssignList.vue';
|
|
import assignUser from '../components/assignUser.vue';
|
|
import assignUser from '../components/assignUser.vue';
|
|
|
|
+import {customerLevelOptions} from "@/api/crm/customerLevel";
|
|
export default {
|
|
export default {
|
|
name: "Customer",
|
|
name: "Customer",
|
|
components: {assignUser,customerAssignList,addBatchSms,editSource, customerDetails,Treeselect,customerSource },
|
|
components: {assignUser,customerAssignList,addBatchSms,editSource, customerDetails,Treeselect,customerSource },
|
|
@@ -466,6 +485,7 @@ export default {
|
|
tags: null,
|
|
tags: null,
|
|
tagList:[],
|
|
tagList:[],
|
|
visitStatus:null,
|
|
visitStatus:null,
|
|
|
|
+ customerLevel: null,
|
|
},
|
|
},
|
|
// 表单参数
|
|
// 表单参数
|
|
form: {
|
|
form: {
|
|
@@ -487,7 +507,8 @@ export default {
|
|
source: [
|
|
source: [
|
|
{ required: true, message: "客户来源不能为空", trigger: "blur" }
|
|
{ required: true, message: "客户来源不能为空", trigger: "blur" }
|
|
],
|
|
],
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ customerLevelOptions: []
|
|
};
|
|
};
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
@@ -525,12 +546,18 @@ export default {
|
|
this.getDicts("crm_customer_tag").then((response) => {
|
|
this.getDicts("crm_customer_tag").then((response) => {
|
|
this.tagsOptions = response.data;
|
|
this.tagsOptions = response.data;
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+
|
|
this.getTreeselect();
|
|
this.getTreeselect();
|
|
this.getCitys();
|
|
this.getCitys();
|
|
this.getList();
|
|
this.getList();
|
|
|
|
+ this.getCustomerLevelOptions()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ getCustomerLevelOptions(){
|
|
|
|
+ customerLevelOptions().then((response) => {
|
|
|
|
+ this.customerLevelOptions = response.data;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
handleShow(row){
|
|
handleShow(row){
|
|
this.show.open=true;
|
|
this.show.open=true;
|
|
var that=this;
|
|
var that=this;
|
|
@@ -555,7 +582,7 @@ export default {
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
that.$refs.customerSource.getData();
|
|
that.$refs.customerSource.getData();
|
|
}, 200);
|
|
}, 200);
|
|
-
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
closeCustomerSource(){
|
|
closeCustomerSource(){
|
|
this.customerSource.open=false;
|
|
this.customerSource.open=false;
|
|
@@ -571,7 +598,7 @@ export default {
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
that.$refs.editSource.handleEdit(that.ids);
|
|
that.$refs.editSource.handleEdit(that.ids);
|
|
}, 200);
|
|
}, 200);
|
|
-
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
closeSource(){
|
|
closeSource(){
|
|
this.source.open=false;
|
|
this.source.open=false;
|
|
@@ -637,6 +664,15 @@ export default {
|
|
this.msgSuccess("操作成功");
|
|
this.msgSuccess("操作成功");
|
|
}).catch(function() {});
|
|
}).catch(function() {});
|
|
},
|
|
},
|
|
|
|
+ handleSwitchToTop(row) {
|
|
|
|
+ switchToTop(row.customerId).then(response => {
|
|
|
|
+ const {code} = response
|
|
|
|
+ if (code === 200) {
|
|
|
|
+ this.msgSuccess(row.isTop === 0 ? "已置顶" : "已取消置顶");
|
|
|
|
+ this.getList();
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
getTreeselect() {
|
|
getTreeselect() {
|
|
treeselect().then((response) => {
|
|
treeselect().then((response) => {
|
|
this.deptOptions = response.data;
|
|
this.deptOptions = response.data;
|
|
@@ -689,7 +725,7 @@ export default {
|
|
else{
|
|
else{
|
|
this.queryParams.source=null
|
|
this.queryParams.source=null
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
if(this.tagIds.length>0){
|
|
if(this.tagIds.length>0){
|
|
this.queryParams.tags=this.tagIds.toString();
|
|
this.queryParams.tags=this.tagIds.toString();
|
|
}
|
|
}
|
|
@@ -760,8 +796,8 @@ export default {
|
|
this.single = selection.length!==1
|
|
this.single = selection.length!==1
|
|
this.multiple = !selection.length
|
|
this.multiple = !selection.length
|
|
},
|
|
},
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
/** 新增按钮操作 */
|
|
/** 新增按钮操作 */
|
|
handleAdd() {
|
|
handleAdd() {
|
|
this.reset();
|
|
this.reset();
|