Commit 2d37233c authored by dcy's avatar dcy

公海池列表

parent 738c3c88
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="客户编号" prop="number"> <el-form-item label="客户编号" prop="number">
<el-input v-model="queryParams.number" placeholder="请输入客户编号" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.number" placeholder="请输入客户编号" clearable @keyup.enter.native="handleQuery"/>
</el-form-item> </el-form-item>
...@@ -16,10 +16,7 @@ ...@@ -16,10 +16,7 @@
:key="dict.value" :label="dict.label" :value="dict.value"/> :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="联系方式" prop="name"> <el-form-item label="客户来源" prop="source">
<el-input v-model="queryParams.name" placeholder="请输入客户名称" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="客户类别" prop="source">
<el-select v-model="queryParams.source" placeholder="请选择客户来源" clearable size="small"> <el-select v-model="queryParams.source" placeholder="请选择客户来源" clearable size="small">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_SOURCE)" <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_SOURCE)"
:key="dict.value" :label="dict.label" :value="dict.value"/> :key="dict.value" :label="dict.label" :value="dict.value"/>
...@@ -31,37 +28,19 @@ ...@@ -31,37 +28,19 @@
:key="dict.value" :label="dict.label" :value="dict.value"/> :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="客服来源" prop="customerService">
<el-select v-model="queryParams.customerService" placeholder="请选择跟进客服" clearable size="small">
<el-option v-for="dict in getDictDatas(DICT_TYPE.COMMON_STATUS)"
:key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item label="国家" prop="customerService">
<el-select v-model="queryParams.customerService" placeholder="请选择跟进客服" clearable size="small">
<el-option v-for="dict in getDictDatas(DICT_TYPE.COMMON_STATUS)"
:key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item label="客户状态" prop="status"> <el-form-item label="客户状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择客户状态" clearable size="small"> <el-select v-model="queryParams.status" placeholder="请选择客户状态" clearable size="small">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_STATUS)" <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_STATUS)"
:key="dict.value" :label="dict.label" :value="dict.value"/> :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="订单角色" prop="department"> <el-form-item label="部门" prop="department">
<el-input v-model="queryParams.department" placeholder="请输入部门" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.department" placeholder="请输入部门" clearable @keyup.enter.native="handleQuery"/>
</el-form-item> </el-form-item>
<el-form-item label="创建时间"> <el-form-item label="创建时间">
<el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd" <el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" /> type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
</el-form-item> </el-form-item>
<el-form-item label="是否出货" prop="department">
<el-input v-model="queryParams.department" placeholder="请输入部门" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="信用等级" prop="department">
<el-input v-model="queryParams.department" placeholder="请输入部门" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
...@@ -90,39 +69,47 @@ ...@@ -90,39 +69,47 @@
<dict-tag :type="DICT_TYPE.CUSTOMER_LEVEL" :value="scope.row.level" /> <dict-tag :type="DICT_TYPE.CUSTOMER_LEVEL" :value="scope.row.level" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="信用等级" align="center" prop="country"> <el-table-column label="国家" align="center" prop="country">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.CUSTOMER_LEVEL" :value="scope.row.country" />
</template>
</el-table-column>
<el-table-column label="客户状态" align="center" prop="customerService">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.customerService" /> <dict-tag :type="DICT_TYPE.COUNTRY" :value="scope.row.country" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="主联系人" align="center" prop="defaultContactName"> <el-table-column label="跟进客服" align="center" prop="customerService" :formatter="customerServiceFn">
</el-table-column> </el-table-column>
<el-table-column label="主联系方式" align="center" prop="defaultContactPhone" /> <el-table-column label="客户状态" align="center" prop="status">
<el-table-column label="常用运输方式" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :type="DICT_TYPE.CUSTOMER_STATUS" :value="scope.row.status" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime"> <el-table-column label="部门" align="center" prop="department" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
{{parseTime(scope.row.customerService)}} <span>{{ parseTime(scope.row.createTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="最后跟进客服" align="center" prop="customerService">
</el-table-column>
<el-table-column label="国家" align="center" prop="country">
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">捞取</el-button> <el-button size="mini" type="text" icon="el-icon-folder-add" @click="distribution(scope.row)">移交</el-button>
<el-button size="mini" type="text" icon="el-icon-discover" @click="handleDelete(scope.row)">移交</el-button> <el-button size="mini" type="text" icon="el-icon-crop">捞取</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 移交 -->
<el-dialog
center
title="客服"
:visible.sync="transferShow"
width="30%">
<div style="width: 100%;min-height: 100px">
<el-radio-group v-model="service">
<el-radio style="margin: 5px;" v-for="(item,index) in customerServiceList" :key="index" :label="item.id">{{item.nickname}}</el-radio>
</el-radio-group>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="transferShow = false">取 消</el-button>
<el-button type="primary" @click="transferFn">确 定</el-button>
</span>
</el-dialog>
<!-- 分页组件 --> <!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/> @pagination="getList"/>
...@@ -130,18 +117,14 @@ ...@@ -130,18 +117,14 @@
</template> </template>
<script> <script>
import { createCustomer, updateCustomer, getCustomer, import { createCustomer, updateCustomer, deleteCustomer,handOverCustomer,getPublicList,exportCustomerExcel } from "@/api/ecw/customer";
getCustomerPage, exportCustomerExcel, getPublicList,handOverCustomer } from "@/api/ecw/customer";
import { getDictDatas, DICT_TYPE } from '@/utils/dict'; import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import {CommonStatusEnum} from '@/utils/constants' import upload from '@/components/ImageUpload'
import { uploadFile } from "@/api/infra/file"; import {listServiceUser} from "@/api/system/user";
import Template from "@/views/cms/template";
export default { export default {
name: "oceanCustomer", name: "customerToBeAssigned",
components: { components: {
Template upload
}, },
data() { data() {
return { return {
...@@ -162,6 +145,7 @@ export default { ...@@ -162,6 +145,7 @@ export default {
// 是否显示弹出层 // 是否显示弹出层
open: false, open: false,
dateRangeCreateTime: [], dateRangeCreateTime: [],
customerServiceList:[],
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
...@@ -179,12 +163,32 @@ export default { ...@@ -179,12 +163,32 @@ export default {
// 表单校验 // 表单校验
rules: { rules: {
name: [{ required: true, message: "客户名称不能为空", trigger: "blur" }], name: [{ required: true, message: "客户名称不能为空", trigger: "blur" }],
weightUnit: [{ required: true, message: "重货标准(CBM)不能为空", trigger: "blur" }], country: [{ required: true, message: "国家不能为空", trigger: "blur" }],
} level: [{ required: true, message: "客户等级不能为空", trigger: "blur" }],
type: [{ required: true, message: "客户类别不能为空", trigger: "blur" }],
// createTime: [{ required: true, message: "创建时间不能为空", trigger: "blur" }],
source: [{ required: true, message: "客户来源不能为空", trigger: "blur" }],
customerService: [{ required: true, message: "跟进客服不能为空", trigger: "blur" }],
status: [{ required: true, message: "客户状态不能为空", trigger: "blur" }],
founder: [{ required: true, message: "创建人不能为空", trigger: "blur" }],
},
// 网点
nodeList: [],
showLine: false,
service:undefined,//客服
transferData:undefined,//移交数据
transferShow:false,
}; };
}, },
created() { created() {
this.getList(); this.getList();
listServiceUser().then(r=>{
console.log(r,'客服');
this.customerServiceList = r.data;
})
// getNodeList().then(r => {
// this.nodeList = r.data
// })
}, },
methods: { methods: {
/** 查询列表 */ /** 查询列表 */
...@@ -208,17 +212,41 @@ export default { ...@@ -208,17 +212,41 @@ export default {
/** 表单重置 */ /** 表单重置 */
reset() { reset() {
this.form = { this.form = {
beginCreateTime:undefined,//开始创建时间 id: undefined,
endCreateTime:undefined,// 结束创建时间 number: undefined,
customerService:undefined,//跟进客服 name: undefined,
defaultContactName:undefined,//主联系人 level: undefined,
defaultContactPhone:undefined,// 主联系电话 country: undefined,
department:undefined,//部门 type: undefined,
level:undefined,//客户等级 agentId: undefined,
name:undefined,// 客户名称 company: undefined,
number:undefined,//客户编号 address: undefined,
source:undefined,//客户来源 productType: undefined,
status:undefined,//客户状态 productId: undefined,
pickupPoint: undefined,
memberId: undefined,
birthday: undefined,
balance: undefined,
source: undefined,
picture: undefined,
customerService: undefined,
customerContacts: [],
customerLines: [],
promoter: undefined,
status: undefined,
founder: undefined,
department: undefined,
invoiceTitle: undefined,
licenseNumber: undefined,
bank: undefined,
bankNumber: undefined,
project: undefined,
billingAddress: undefined,
billingTell: undefined,
taxRate: undefined,
remarks: undefined,
arrivalConfirm: undefined,
weightUnit: undefined,
}; };
this.resetForm("form"); this.resetForm("form");
}, },
...@@ -236,22 +264,30 @@ export default { ...@@ -236,22 +264,30 @@ export default {
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.$router.push('/customer/edit/0') this.$router.push('/customer/edit/0')
// this.reset();
// this.open = true;
// this.title = "添加客户";
},
/** 查看按钮操作 */
handleView(row) {
this.$router.push('/customer/query/' + row.id)
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.$router.push('/customer/edit/' + row.id)
const id = row.id; // this.reset();
getCustomer(id).then(response => { // const id = row.id;
this.form = response.data; // getCustomer(id).then(response => {
this.open = true; // this.form = { ...this.form, ...response.data };
this.title = "修改客户"; // this.open = true;
}); // this.title = "修改客户";
// });
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (!valid) { if (!valid) {
return; // return;
} }
// 修改的提交 // 修改的提交
if (this.form.id != null) { if (this.form.id != null) {
...@@ -270,11 +306,11 @@ export default { ...@@ -270,11 +306,11 @@ export default {
}); });
}); });
}, },
/** 删除按钮操作 */ /** 移交按钮操作 */
handleDelete(row) { handleDelete(row) {
const id = row.id; const id = row.id;
this.$modal.confirm('是否确认移交客户编号为"' + id + '"的数据项?').then(function() { this.$modal.confirm('是否确认删除客户编号为"' + id + '"的数据项?').then(function() {
return handOverCustomer(id); return deleteCustomer(id);
}).then(() => { }).then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
...@@ -295,7 +331,36 @@ export default { ...@@ -295,7 +331,36 @@ export default {
this.$download.excel(response, '${table.classComment}.xls'); this.$download.excel(response, '${table.classComment}.xls');
this.exportLoading = false; this.exportLoading = false;
}).catch(() => {}); }).catch(() => {});
},
//分配客服
distribution(row){
this.transferData = row;
this.transferShow =true;
},
customerServiceFn(val){
if(this.customerServiceList.length > 0){
let index =this.customerServiceList.findIndex(item => item.id === val.customerService);
return index !== -1 ? this.customerServiceList[index]?.nickname :''
}else {
return ''
} }
},
transferFn(){
if(!this.service){
return this.$message.warning('请选择跟进客服!');
}
handOverCustomer({
customerServiceId:this.service,
customerId:this.transferData.id
}).then(r=>{
if(r.code === 0){
this.transferShow = false;
this.service = '';
this.getList();
this.$message.success('移交成功!');
}
})
},
} }
}; };
</script> </script>
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