|
@@ -156,9 +156,14 @@
|
|
<el-tag prop="source" v-for="(item, index) in sourceOptions" v-if="scope.row.source==item.dictValue">{{item.dictLabel}}</el-tag>
|
|
<el-tag prop="source" v-for="(item, index) in sourceOptions" v-if="scope.row.source==item.dictValue">{{item.dictLabel}}</el-tag>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
+ <el-table-column label="客户等级" align="center">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-tag v-for="item in customerLevelOptions" v-if="scope.row.customerLevel === item.dictValue">{{item.dictLabel}}</el-tag>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
<el-table-column label="流量来源" align="center" prop="trafficSource" />
|
|
<el-table-column label="流量来源" align="center" prop="trafficSource" />
|
|
<el-table-column label="备注" align="center" prop="remark" />
|
|
<el-table-column label="备注" align="center" prop="remark" />
|
|
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
|
|
+ <el-table-column label="操作" width="200" align="center" class-name="small-padding fixed-width">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-button
|
|
<el-button
|
|
size="mini"
|
|
size="mini"
|
|
@@ -181,6 +186,13 @@
|
|
@click="handleDelete(scope.row)"
|
|
@click="handleDelete(scope.row)"
|
|
v-hasPermi="['crm:customer:removeLine']"
|
|
v-hasPermi="['crm:customer:removeLine']"
|
|
>删除</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>
|
|
@@ -231,6 +243,16 @@
|
|
/>
|
|
/>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+ <el-form-item label="客户级别">
|
|
|
|
+ <el-select v-model="form.customerLevel" placeholder="请选择客户级别" clearable size="small">
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in customerLevelOptions"
|
|
|
|
+ :key="item.dictValue"
|
|
|
|
+ :label="item.dictLabel"
|
|
|
|
+ :value="item.dictValue"
|
|
|
|
+ />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
<el-form-item label="标签" prop="tags">
|
|
<el-form-item label="标签" prop="tags">
|
|
<el-tag
|
|
<el-tag
|
|
:key="tag"
|
|
:key="tag"
|
|
@@ -285,6 +307,12 @@
|
|
<el-form-item label="备注" prop="remark">
|
|
<el-form-item label="备注" prop="remark">
|
|
<el-input type="textarea" :rows="2" v-model="form.remark" placeholder="请输入备注" />
|
|
<el-input type="textarea" :rows="2" v-model="form.remark" placeholder="请输入备注" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+ <el-form-item label="是否置顶">
|
|
|
|
+ <el-radio-group v-model="form.isTop">
|
|
|
|
+ <el-radio :label="0" >否</el-radio>
|
|
|
|
+ <el-radio :label="1" >是</el-radio>
|
|
|
|
+ </el-radio-group>
|
|
|
|
+ </el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
@@ -329,7 +357,17 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { assignCustomer,importLineTemplate,listLineCustomer, getLineCustomer, delLineCustomer, addLineCustomer, updateLineCustomer, exportLineCustomer } from "@/api/crm/customer";
|
|
|
|
|
|
+import {
|
|
|
|
+ assignCustomer,
|
|
|
|
+ importLineTemplate,
|
|
|
|
+ listLineCustomer,
|
|
|
|
+ getLineCustomer,
|
|
|
|
+ delLineCustomer,
|
|
|
|
+ addLineCustomer,
|
|
|
|
+ updateLineCustomer,
|
|
|
|
+ exportLineCustomer,
|
|
|
|
+ switchToTop
|
|
|
|
+} from "@/api/crm/customer";
|
|
import {getCitys} from "@/api/store/city";
|
|
import {getCitys} from "@/api/store/city";
|
|
import { getToken } from "@/utils/auth";
|
|
import { getToken } from "@/utils/auth";
|
|
import { isAdmin } from "@/api/system/user";
|
|
import { isAdmin } from "@/api/system/user";
|
|
@@ -337,6 +375,7 @@ import editCustomerSource from '../components/editCustomerSource.vue';
|
|
|
|
|
|
import customerAssignList from '../components/customerAssignList.vue';
|
|
import customerAssignList from '../components/customerAssignList.vue';
|
|
import assignCompany from '../components/assignCompany.vue';
|
|
import assignCompany from '../components/assignCompany.vue';
|
|
|
|
+import {customerLevelOption} from "@/api/crm/customerLevel";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "Customer",
|
|
name: "Customer",
|
|
@@ -453,6 +492,8 @@ export default {
|
|
province:null,
|
|
province:null,
|
|
city:null,
|
|
city:null,
|
|
district:null,
|
|
district:null,
|
|
|
|
+ customerLevel: null,
|
|
|
|
+ isTop: 0
|
|
},
|
|
},
|
|
// 表单校验
|
|
// 表单校验
|
|
rules: {
|
|
rules: {
|
|
@@ -462,7 +503,8 @@ export default {
|
|
source: [
|
|
source: [
|
|
{ required: true, message: "客户来源不能为空", trigger: "blur" }
|
|
{ required: true, message: "客户来源不能为空", trigger: "blur" }
|
|
],
|
|
],
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ customerLevelOptions: []
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -483,6 +525,7 @@ export default {
|
|
|
|
|
|
this.getCitys();
|
|
this.getCitys();
|
|
this.getList();
|
|
this.getList();
|
|
|
|
+ this.getCustomerLevelOption()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
handleEditSource(){
|
|
handleEditSource(){
|
|
@@ -602,7 +645,9 @@ export default {
|
|
companyId: null,
|
|
companyId: null,
|
|
isLine: null,
|
|
isLine: null,
|
|
source: null,
|
|
source: null,
|
|
- tags: null
|
|
|
|
|
|
+ tags: null,
|
|
|
|
+ customerLevel: null,
|
|
|
|
+ isTop: 0
|
|
};
|
|
};
|
|
this.tags=[];
|
|
this.tags=[];
|
|
this.cityIds=[];
|
|
this.cityIds=[];
|
|
@@ -739,6 +784,14 @@ export default {
|
|
this.msgSuccess("删除成功");
|
|
this.msgSuccess("删除成功");
|
|
}).catch(function() {});
|
|
}).catch(function() {});
|
|
},
|
|
},
|
|
|
|
+ handleSwitchToTop(row) {
|
|
|
|
+ switchToTop(row.customerId).then(response => {
|
|
|
|
+ if (response.code === 200) {
|
|
|
|
+ this.msgSuccess(row.isTop === 0 ? "置顶成功" : "已取消置顶");
|
|
|
|
+ this.getList();
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
/** 导出按钮操作 */
|
|
/** 导出按钮操作 */
|
|
handleExport() {
|
|
handleExport() {
|
|
const queryParams = this.queryParams;
|
|
const queryParams = this.queryParams;
|
|
@@ -779,7 +832,12 @@ export default {
|
|
// 提交上传文件
|
|
// 提交上传文件
|
|
submitFileForm() {
|
|
submitFileForm() {
|
|
this.$refs.upload.submit();
|
|
this.$refs.upload.submit();
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ getCustomerLevelOption() {
|
|
|
|
+ customerLevelOption().then(response => {
|
|
|
|
+ this.customerLevelOptions = response.data;
|
|
|
|
+ })
|
|
|
|
+ },
|
|
}
|
|
}
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|