Commit d99cd16d authored by 我在何方's avatar 我在何方

Merge branch 'release2.2new' of...

Merge branch 'release2.2new' of http://gitlab.jdshangmen.com/jiedao-app/jiedao-app-operator into release2.2new
parents 783679aa 2ef6eeb3
import request from '@/utils/request'
import query from "@/views/ecw/customer/query";
import * as url from "url";
import {methods} from "vue2-ace-editor";
// 创建客户
export function createCustomer(data) {
......@@ -26,7 +27,14 @@ export function updateCustomer(data) {
data: data
})
}
// 新建潜在客户
export function createPotential(data){
return request({
url:'/ecw/customer/create-potential',
method:'post',
data
})
}
// 删除客户
export function deleteCustomer(id) {
return request({
......@@ -72,6 +80,14 @@ export function getCustomerSelect(query) {
params: query
})
}
// 潜在客户
export function getPotential(query){
return request({
url:'/ecw/customer/get-potential',
method:'get',
params:query
})
}
// 根据客户id集合获得客户详情列表
export function getCustomerList(query) {
......@@ -175,7 +191,20 @@ export function handOverCustomer(data) {
data: data,
})
}
export function handoverApproval(data) {
return request({
url: '/ecw/customer/handover/approval',
method: 'post',
data: data,
})
}
export function handoverApprovalDetails(params){
return request({
url:'/ecw/customer/handover/approval',
method:'get',
params
})
}
// 公海池客户
export function getPublicList(query) {
return request({
......@@ -381,6 +410,14 @@ export function changeCustomerAir(data){
})
}
// 设置整柜
export function setChangeCustomerFcl(data){
return request({
url:'/ecw/customer/change-customer-fcl',
method:'put',
data
})
}
//获得客户日志
export function getCustomerOperatelogPage(params){
return request({
......
......@@ -403,6 +403,24 @@ export default {
split_revoke:{
component: () => import("@/views/ecw/order/components/SplitRevokeDetail"),
id: this.processInstance.businessKey
},
// 不可出渠道异常审核
// not_shiping_channel:{
// component: () => import('@/views/ecw/order/components/NotShipingChannel'),
// id: this.processInstance.businessKey,
// path: this.processInstance.processDefinition?.formCustomViewPath
// },
// 出货批量加价审核
// box_batch_markup:{
// component: () => import('@/views/ecw/box/components/batchMakeUpDetail.vue'),
// processId: this.processInstance.businessKey,
// type: this.processInstance.processDefinition?.formCustomViewPath
// },
// 可获移交详情
customer_handover_details:{
component: () => import('@/views/ecw/customer/components/customer-handover-details.vue'),
processId: this.processInstance.businessKey,
type: this.processInstance.processDefinition?.formCustomViewPath
}
}
console.log('formCustomViewPath', this.processInstance.processDefinition.formCustomViewPath.trim())
......
<template>
<div>
<el-dialog :title="$t('新建潜在客户信息')" :visible.sync="dialogTableVisible">
<el-form ref="form" :rules="rules" :model="form" label-width="100px" style="padding: 0 20px;">
<el-form-item prop="name" :label="$t('客户姓名')">
<el-input v-model="form.name" :placeholder="$t('请输入客户姓名')"></el-input>
</el-form-item>
<el-form-item required :label="$t('联系方式')" >
<el-row :gutter="20">
<el-col :span="4" >
<el-form-item prop="customerContacts[0].areaCode" >
<area-code-selector v-model="form.customerContacts['0'].areaCode" />
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item prop="customerContacts[0].phoneNew">
<el-input style="width:100%;" v-model="form.customerContacts[0].phoneNew" maxlength="11" :placeholder="$t('请输入联系方式')" />
</el-form-item>
</el-col>
</el-row>
</el-form-item>
<el-form-item prop="source" :label="$t('客户来源')">
<el-select v-model="form.source" :placeholder="$t('请选择客户来源')">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_SOURCE)"
:key="dict.value" :label="dict.label" :value="parseInt(dict.value)" />
</el-select>
</el-form-item>
<el-form-item :label="$t('客户类别')" prop="type" >
<dict-selector v-model="form.type" :type="DICT_TYPE.CUSTOMER_TYPE" form-type="checkbox" multiple ></dict-selector>
</el-form-item>
<el-form-item :label="$t('客户经理')" >
<el-select v-model="form.customerService" :placeholder="$t('请选择客户经理')">
<el-option v-for="item in serviceUserList"
:key="item.id" :label="item.nickname" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item :label="$t('公司名称')">
<el-input v-model="form.company" ></el-input>
</el-form-item>
<el-form-item :label="$t('公司英文名称')">
<el-input v-model="form.companyEn" ></el-input>
</el-form-item>
<el-form-item :label="$t('主营类别')" prop="productType">
<el-row :gutter="10">
<el-col :span="11">
<el-select v-model="form.productType" style="width: 100%" @change="getProductListFn" :placeholder="$t('请选择产品类别')" >
<el-option :label="item.titleZh" :value="item.id" v-for="(item) in productTypeList" :key="item.id"/>
</el-select>
</el-col>
<el-col :span="11">
<el-select v-model="form.productId" style="width: 100%" :placeholder="$t('请选择')">
<el-option :label="item.titleZh" :value="parseInt(item.id)" v-for="(item) in productList" :key="item.id"/>
</el-select>
</el-col>
</el-row>
</el-form-item>
<el-form-item :label="$t('询盘信息')" >
<el-input
v-model="form.inquiry"
type="textarea"
:rows="3"
:placeholder="$t('请输入内容')">
</el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogTableVisible = false">{{$t('取 消')}}</el-button>
<el-button type="primary" @click="submit">{{$t('确 定')}}</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
import AreaCodeSelector from "@/components/AreaCodeSelector/index.vue";
import {listServiceUser} from "@/api/system/user";
import {getProductTypeList} from "@/api/ecw/productType";
import {getProductList} from "@/api/ecw/product";
import {createPotential} from "@/api/ecw/customer";
export default {
name: "addPotentialCustom",
methods: {
getDictDatas,
getProductListFn(val){
getProductList({typeId:val}).then(r => {
this.productList = r.data
})
},
reset(){
this.form = {
name:undefined,
customerContacts:[{areaCode:undefined,phoneNew:undefined,name:undefined,isDefault: 1}],
source:undefined,
type:[],
customerService:undefined,
company:undefined,
companyEn:undefined,
inquiry:undefined,
productType:undefined,
productId:undefined,
}
},
submit(){
this.$refs.form.validate((valId)=>{
if (valId){
let p = {...this.form}
p.type = p.type.join(',')
p.customerContacts[0].name = p.name + p.customerContacts[0].phoneNew
createPotential(p).then(r => {
if(r.code === 0){
this.$emit('change');
this.dialogTableVisible = false;
this.$message(this.$t('创建成功'));
}
})
}
})
},
},
components: {AreaCodeSelector},
created() {
this.reset()
listServiceUser().then(r => {
this.serviceUserList = r.data
})
getProductTypeList().then(r => {
this.productTypeList = r.data
})
},
computed: {
DICT_TYPE() {
return DICT_TYPE
},
rules(){
return {
name:{ required:true,message:this.$t('请输入名称'),target:'blur' },
customerContacts:[{areaCode:{required:true,message:this.$t('请输入区号。'),target:'blur'},phoneNew:{required:true,message:this.$t('请输入电话号码。'),target:'blur'} },],
type:{ type:'array', message:this.$t('请输入客户类别。'), required:true, target:['blur','change']},
source:{message:this.$t('前请输入客户来源'),required:true,target:'change',type:'number'}
}
}
},
data(){
return {
dialogTableVisible:false,
serviceUserList:[],
productTypeList:[],
productList:[],
form:{}
}
},
}
</script>
<style scoped>
</style>
<template>
<div style="display: inline-block">
<span @click="visible = true"> <slot></slot></span>
<el-dialog title="更多联系人" :visible.sync="visible">
<div v-if="info">
<div style="text-align: center;margin-bottom: 20px;" v-for="(item, index) in info" :key="index">
联系人{{index + 1}}{{$l(item, 'name')}} &ensp;&ensp;&ensp; 联系方式{{index + 1}}:+{{item.areaCode}} {{item.phoneNew}}<br/>
邮箱:{{item.email}}
</div>
</div>
<div v-else>
暂无数据
</div>
</el-dialog>
</div>
</template>
<script>
import {getCustomerContacts, getCustomerContactsListByCustomer} from "@/api/ecw/customerContacts";
export default {
name: "contacts",
props:{
id:[Number]
},
data(){
return {
visible:false,
info:null,
}
},
methods:{
getCustomerContactsFn() {
getCustomerContactsListByCustomer({customerId: this.id}).then(r => {
console.log(r,'rrr')
this.info = r.data
})
}
},
watch:{
visible(val){
if(val){
this.getCustomerContactsFn()
}
}
}
}
</script>
<style scoped>
</style>
<template>
<div>
<div v-for="(item, index) in info.customerHandoverDetailDtoList">
<router-link :to="'/customer/query/' + item.customerId"><div style="color: blue"> 客户编号{{index + 1}}{{item.customerNumber}} 客户名称{{index + 1}}{{item.customerName}} </div></router-link>
<div>就客户经理{{index + 1}}{{item.oldCustomerServiceName || '-'}} <span v-if="item.oldCustomerServiceDeptName">{{item.oldCustomerServiceDeptName}}</span></div>
</div>
<div>新客户经理:{{info.newCustomerServiceName || '-'}} <span v-if="info.newCustomerServiceDeptName">{{info.newCustomerServiceDeptName}}</span> </div>
<div>
申请理由:{{info.reason}}
</div>
</div>
</template>
<script>
import { handoverApprovalDetails} from "@/api/ecw/customer";
export default {
name: "customer-handover-details",
props: {
processId: {
type: [Number, String],
},
type: String,
},
data(){
return {
info:{
customerHandoverDetailDtoList:[]
}
}
},
mounted() {
this.handoverApprovalFn()
},
methods:{
handoverApprovalFn(){
handoverApprovalDetails({approvalId:this.processId}).then(r =>{
this.info =r.data
})
}
}
}
</script>
<style scoped>
</style>
......@@ -45,7 +45,7 @@
<el-form-item :label="$t('出货渠道')" prop="transportType">
<!-- <dict-selector :type="DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE" form-type="checkbox" multiple v-model="form.transportType"></dict-selector>-->
<el-checkbox-group v-model="form.transportType">
<el-checkbox v-for="item in getDictDatas(DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE)" :key="item.value" :label="item.value" :disabled="item.value == 4">{{item.label}}</el-checkbox>
<el-checkbox v-for="item in getDictDatas(DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE)" :key="item.value" :label="item.value" :disabled="[3,4].includes(+item.value)">{{item.label}}</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-col>
......@@ -193,7 +193,11 @@
<el-switch v-model="form.isShowTidanPrice"></el-switch>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('询盘信息')">
<el-input show-word-limit v-model="form.inquiry" :rows="3" type="textarea" :maxlength="500"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item :label="$t('到仓确认')" prop="arrivalConfirm">
<el-switch v-model="form.arrivalConfirm" :active-value="1" :inactive-value="0" />
......@@ -358,12 +362,17 @@
</template>
</el-table-column>
<el-table-column
width="260px"
prop="email"
:label="$t('邮箱')"
>
<template v-slot="{row}">
<el-form-item label="">
<el-input v-model="row.email" :placeholder="$t('请输入邮箱')" size="mini"/>
<el-form-item v-for="(item, index) in row.email" :key="index" label="">
<div style="display: flex;align-items: center;">
<el-input v-model="row.email[index]" :placeholder="$t('请输入邮箱')" size="mini"/>
<el-button @click="deleteEmail(row.email,index)" v-if="row.email.length !== 1" style="height:25px;margin-left: 5px" type="danger" size="mini">删除</el-button>
<el-button @click="addEmail(row.email)" style="height: 25px;margin-left: 5px" v-if="index === row.email.length -1 && row.email.length < 5" size="mini" type="primary">添加</el-button>
</div>
</el-form-item>
</template>
</el-table-column>
......@@ -592,6 +601,13 @@ export default {
this.getCustomer(this.customerId).then(() => {
getCustomerContactsListByCustomer({customerId: customerId}).then(r => {
this.form.customerContacts = r.data
this.form.customerContacts.forEach(item => {
if(item.email){
item.email = item.email.split(',')
}else {
item.email = [""]
}
})
})
if(this.form.promoter){
getCustomerList({ids:this.form.promoter}).then(r => {
......@@ -706,6 +722,12 @@ export default {
},
methods: {
addEmail(row){
row.push('')
},
deleteEmail(row, index){
row.splice(index, 1)
},
change(val){
this.form.productId = '';
this.getProductListFn(val);
......@@ -839,7 +861,10 @@ export default {
}
this.updateCustomerLines()
const form = {...this.form, type: this.form.type?.join(','), transportType: (this.form.transportType || [])?.join(','), taxRate: Number(this.form.taxRate)}
form.customerContacts = JSON.parse(JSON.stringify(this.form.customerContacts))
form.customerContacts.forEach(e =>{
e.email = [...e.email].join(',')
})
// 检查路线是否启用了但是没选择目的仓
let errors = 0
form.customerLines.forEach(line => {
......@@ -893,6 +918,7 @@ export default {
/** 表单重置 */
reset() {
this.form = {
inquiry:undefined,
id: undefined,
number: undefined,
name: undefined,
......@@ -971,7 +997,7 @@ export default {
"areaCode": "",
// "customerId": 0,q
"department": "",
"email": "",
"email": [''],
"isDefault": this.form.customerContacts.length === 0 ? 1 : 0,
"name": "",
"phoneNew": "",
......
......@@ -68,7 +68,8 @@
<!-- 操作工具栏 -->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
<el-button v-if="path === '/customer/potential'" type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddPotential">{{$t('新增潜在客户')}}</el-button>
<el-button v-else type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="[ selectAuthorityFn('ecw:customer:create')]">{{$t('新增')}}</el-button>
</el-col>
<el-col :span="1.5" >
......@@ -87,6 +88,16 @@
<el-button :disabled="!selectCustomerList.length" @click="setChangeCustomerAir(false)" v-if="$route.path === '/customer/customer'" type="primary" plain size="mini" :loading="exportLoading"
v-hasPermi="['ecw:customer:transport']">{{$t('设为非空运客户')}}</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['ecw:customer:fcl']" :disabled="!selectCustomerList.length" @click="setFullContainerLoad(true)" v-if="$route.path === '/customer/customer'" type="primary" plain size="mini" :loading="exportLoading">{{$t('设置海运整柜客户')}}</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['ecw:customer:create-potential']" :disabled="!selectCustomerList.length" @click="setFullContainerLoad(false)" v-if="$route.path === '/customer/customer'" type="primary" plain size="mini" :loading="exportLoading"
>{{$t('设置海运非整柜客户')}}</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-has-permi="['ecw:customer:fcl-mistake']" v-if="path === '/customer/customer'" type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddPotential">{{$t('新增潜在客户')}}</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
......@@ -124,7 +135,10 @@
<el-table-column :label="$t('主联系人')" prop="defaultContactName"></el-table-column>
<el-table-column :label="$t('主联系方式')" prop="defaultContactPhone">
<template v-slot="{row}">
+{{row.defaultContactPhone}}
+{{row.defaultContactPhone}} <br/>
<contacts :id="row.id" >
<el-button v-if="$route.path === '/customer/customer'" type="text">更多</el-button>
</contacts>
</template>
</el-table-column>
<el-table-column :label="$t('创建时间')" align="center" prop="createTime" width="180">
......@@ -512,13 +526,24 @@
<customer-follow-list :customer-id="customerId" :id="customerId" ref="CustomerFollowList"></customer-follow-list>
<customer-complaints :customer-id="customerId" ref="customerComplaints"></customer-complaints>
<transfer-customer :show.sync="transferShow" :customer-ids.sync="selectCustomerList"></transfer-customer>
<add-potential-custom ref="potentialCustom" @change="getList" ></add-potential-custom>
</div>
</template>
<script>
import {
createCustomer, updateCustomer, deleteCustomer, getCustomer,
getCustomerPage, exportCustomerExcel, testEnterToOpenSea, getCustomerDeptPage, changeCustomerAir
createCustomer,
updateCustomer,
deleteCustomer,
getCustomer,
getCustomerPage,
exportCustomerExcel,
testEnterToOpenSea,
getCustomerDeptPage,
changeCustomerAir,
getPotential,
setChangeCustomerFcl
} from "@/api/ecw/customer";
import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import {CommonStatusEnum} from '@/utils/constants'
......@@ -533,10 +558,14 @@ import { getCountryListAll } from '@/api/ecw/country'
import {getCreditPage} from "@/api/customer/credit";
import transferCustomer from "@/views/ecw/customer/transferCustomer";
import Template from "@/views/cms/template/index.vue";
import AddPotentialCustom from "@/views/ecw/customer/addPotentialCustom.vue";
import Contacts from "@/views/ecw/customer/components/contacts.vue";
export default {
name: "EcwCustomerIndex",
components: {
Contacts,
AddPotentialCustom,
Template,
upload,
CustomerFollowList,
......@@ -604,6 +633,9 @@ export default {
};
},
computed:{
path(){
return this.$route.path
},
channel(){
return (val)=>{
return !!val ? this.getDictDatas(this.DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE).filter(i => (val.split(',') || []).includes(i.value)).map(i => this.isChinese ? i.label : i.labelEn ).join('') :''
......@@ -642,9 +674,6 @@ export default {
this.creditList = r.data.list
})
this.getList();
// getNodeList().then(r => {
// this.nodeList = r.data
// })
listServiceUser().then(r=>{
this.customerServiceList = r.data;
})
......@@ -656,6 +685,19 @@ export default {
this.getList();
},
methods: {
// 设置整柜
setFullContainerLoad(isFcl){
setChangeCustomerFcl({
"customerIdList": this.selectCustomerList,
isFcl
}).then(r =>{
if(r.code === 0){
this.$message.success(isFcl ? '设置客户为海运整柜成功!' : '设置客户为非海运整柜成功!')
this.selectCustomerList = []
this.getList()
}
})
},
// 设置空运客户
setChangeCustomerAir(isAir){
changeCustomerAir({
......@@ -709,6 +751,9 @@ export default {
case '/customer/department-customers':
getCustomerDeptPage(params).then(this.setData);
break;
case '/customer/potential':
getPotential(params).then(this.setData)
break;
}
},
......@@ -719,6 +764,10 @@ export default {
// this.open = true;
// this.title = this.$t("添加客户");
},
// 新增潜在客户
handleAddPotential(){
this.$refs.potentialCustom.dialogTableVisible = true;
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
......
......@@ -2,12 +2,17 @@
<el-dialog
center
:title="$t('客服')"
:visible.sync="show"
:visible="show"
@close="close"
width="30%">
<div style="width: 100%;min-height: 200px;text-align: center">
<el-select filterable v-model="service">
<el-option v-for="(item,index) in customerServiceList" :key="index" :label="item.nickname" :value="item.id"></el-option>
<el-option v-for="(item,index) in customerServiceList" :key="index" :label="item.deptName ? item.nickname + `(${item.deptName})` : item.nickname " :value="item.id"></el-option>
</el-select>
<div style="display: flex;margin-top: 20px;">
<label style="width:100px;" >申请理由</label>
<el-input v-model="textarea" type="textarea"></el-input>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="$emit('update:show',false)" >{{$t('取 消')}}</el-button>
......@@ -18,7 +23,7 @@
<script>
import {listServiceUser} from "@/api/system/user";
import {handOverCustomer} from "@/api/ecw/customer";
import {handoverApproval, handOverCustomer} from "@/api/ecw/customer";
export default {
name: "transferCustomer",
......@@ -37,6 +42,7 @@ export default {
},
computed:{
getCustomerIds(){
console.log(this.customerIds,'this.customerIds')
if(this.customerIds instanceof Array) return this.customerIds
else return this.customerIds.split(',')
}
......@@ -45,6 +51,7 @@ export default {
return {
customerServiceList:[],
service:'',
textarea:''
}
},
methods:{
......@@ -52,17 +59,26 @@ export default {
if(!this.service){
return this.$message.warning(this.$t('请选择客户经理!'));
}
handOverCustomer({
handoverApproval({
customerServiceId:this.service,
customerIdList:this.getCustomerIds
customerIdList:this.getCustomerIds,
reason:this.textarea
}).then(r=>{
if(r.code === 0){
this.$emit('update:show',false)
this.$emit('update:customerIds',[])
this. service = '';
this.textarea = '';
this.$message.success(this.$t('用户批量转移成功!'))
}
})
},
close(){
this. service = '';
this.textarea = '';
this.$emit('update:show',false)
},
}
}
</script>
......
......@@ -344,7 +344,7 @@
<el-button @click="cancelHandOver">{{$t('取 消')}}</el-button>
</div>
</el-dialog>
<transfer-customer :show.sync="openHandOver" :customer-ids.sync="handOverForm.customerIdList"></transfer-customer>
</div>
</template>
......@@ -363,6 +363,7 @@ import {CommonStatusEnum} from '@/utils/constants'
import {handOverCustomer} from "../../../api/ecw/customer";
import {getCountryListAll} from "@/api/ecw/country";
import {getCreditPage} from "@/api/customer/credit";
import transferCustomer from "@/views/ecw/customer/transferCustomer.vue";
......@@ -380,6 +381,7 @@ export default {
},
},
components: {
transferCustomer
},
data() {
return {
......@@ -570,8 +572,9 @@ export default {
},
/** 修改按钮操作 */
handOver(row) {
this.resetHandOverForm();
// this.resetHandOverForm();
this.openHandOver = true;
this.handOverForm.customerIdList = [row.id];
},
......
......@@ -411,9 +411,10 @@ export default {
},
//分配客服
distribution(row){
this.service = row.customerService;
this.transferData = row;
this.transferShow =true;
// this.service = row.customerService;
// this.transferData = row;
this.selectCustomerList = [row.id]
this.batchTransferShow =true;
},
transferFn(){
if(!this.service){
......
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