Commit 42c087ab authored by dragondean@qq.com's avatar dragondean@qq.com

Merge remote-tracking branch 'origin/pre-release' into pre-release

parents 41520827 a2a784e5
......@@ -60,6 +60,7 @@
<script>
import {createCustomer} from '@/api/ecw/customer'
import {DICT_TYPE} from "@/utils/dict";
import {listServiceUser} from "@/api/system/user"
import { getCountryListAll } from '@/api/ecw/country'
import {getCustomerContactsSelect} from '@/api/ecw/customerContacts'
......@@ -74,7 +75,7 @@ export default {
data(){
return {
show: true,
DICT_TYPE,
// 表单参数
form: {
customerContacts:[{isDefault: 1}]
......
......@@ -10,7 +10,7 @@
<script>
export default {
name: 'AppMain',
name: "AppMain",
computed: {
cachedViews() {
return this.$store.state.tagsView.cachedViews
......@@ -31,7 +31,7 @@ export default {
overflow: hidden;
}
.fixed-header+.app-main {
.fixed-header + .app-main {
padding-top: 50px;
}
......@@ -41,7 +41,7 @@ export default {
min-height: calc(100vh - 84px);
}
.fixed-header+.app-main {
.fixed-header + .app-main {
padding-top: 84px;
}
}
......
<template>
<div style="display: inline-block">
<span @click="visible = true"> <slot></slot></span>
<el-dialog title="更多联系人" :visible.sync="visible">
<span @click="visible = true"> <slot></slot></span>
<el-dialog title="更多联系人" :visible.sync="visible" append-to-body>
<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/>
......
......@@ -6,8 +6,10 @@
<el-col :span="12">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>{{$t('保留客户')}}</span>
<el-button type="success" size="small" style="float: right" @click="selectCustomer(1)">{{$t('请选择')}}</el-button>
<span>{{ $t('保留客户') }}</span>
<el-button type="success" size="small" style="float: right" @click="selectCustomer(1)">
{{ $t('请选择') }}
</el-button>
</div>
<el-form-item :label="$t('客户编号')+':'">
{{ retainCustomer.number }}
......@@ -29,8 +31,10 @@
<el-col :span="12">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>{{$t('​被合并客户-非主客户')}}</span>
<el-button type="success" size="small" style="float: right" @click="selectCustomer(2)">{{$t('请选择')}}</el-button>
<span>{{ $t('​被合并客户-非主客户') }}</span>
<el-button type="success" size="small" style="float: right" @click="selectCustomer(2)">
{{ $t('请选择') }}
</el-button>
</div>
<el-form-item :label="$t('客户编号')+':'">
{{ mergeCustomer.number }}
......@@ -52,12 +56,13 @@
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleSubmit">{{$t('确 定')}}</el-button>
<el-button @click="dialogVisible = false">{{$t('取 消')}}</el-button>
<el-button type="primary" @click="handleSubmit">{{ $t('确 定') }}</el-button>
<el-button @click="dialogVisible = false">{{ $t('取 消') }}</el-button>
</div>
</el-dialog>
<el-dialog append-to-body :title="$t('选择客户')" :visible.sync="customerDialogVisible" :close-on-click-modal="false" width="80%">
<el-dialog append-to-body :title="$t('选择客户')" :visible.sync="customerDialogVisible"
:close-on-click-modal="false" width="80%">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="100px">
<el-form-item :label="$t('客户编号')" prop="number">
<el-input
......@@ -104,14 +109,16 @@
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{
$t("搜索")
}}</el-button>
$t("搜索")
}}
</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{
$t("重置")
}}</el-button>
$t("重置")
}}
</el-button>
</el-form-item>
</el-form>
<el-table :data="list" v-loading="loading" border size="mini">
<el-table :data="list" v-loading="loading" border size="mini">
<el-table-column align="center" width="80">
<template slot-scope="{row}">
<el-radio v-model="customerId" :label="row.id">&nbsp;</el-radio>
......@@ -119,7 +126,8 @@
</el-table-column>
<el-table-column :label="$t('客户编号')" align="center">
<template slot-scope="{ row }">
<el-link type="primary" @click.native="$router.push('/customer/query/' + row.id)">{{ row.number }}</el-link>
<!-- <el-link type="primary" @click.native="$router.push('/customer/query/' + row.id)">{{ row.number }}</el-link>-->
{{ row.number }}
</template>
</el-table-column>
<el-table-column :label="$t('客户名称')" align="center">
......@@ -136,31 +144,33 @@
></el-table-column>
<el-table-column :label="$t('主联系方式')" prop="defaultContactPhone">
<template v-slot="{ row }">
+{{ row.defaultContactPhone }} <br />
+{{ row.defaultContactPhone }} <br/>
<contacts :id="row.id">
<el-button type="text">更多</el-button>
</contacts>
</template>
</el-table-column>
<el-table-column :label="$t('客户类别')" align="center">
<template slot-scope="scope">
<dict-tag
:type="DICT_TYPE.CUSTOMER_TYPE"
:value="scope.row.type"
/>
<template slot-scope="{ row }">
{{ getDictDatas2(DICT_TYPE.CUSTOMER_TYPE, (row.type||'').split(',')).map(e => isChinese ? e.label : e.labelEn).join(', ')}}
<!-- <dict-tag-->
<!-- :type="DICT_TYPE.CUSTOMER_TYPE"-->
<!-- :value="scope.row.type"-->
<!-- />-->
</template>
</el-table-column>
<el-table-column :label="$t('角色')" align="center">
<template slot-scope="{ row }">
{{ getDictDatas2(DICT_TYPE.CUSTOMER_ROLE, (row.roles||'').split(',')).map(e => isChinese ? e.label : e.labelEn).join(', ')}}
<!-- <dict-tag-->
<!-- :type="DICT_TYPE.CUSTOMER_ROLE"-->
<!-- :value="scope.row.roles"-->
<!-- />-->
{{ getDictDatas2(DICT_TYPE.CUSTOMER_ROLE, (row.roles || '').split(',')).map(e => isChinese ? e.label : e.labelEn).join(', ') }}
<!-- <dict-tag-->
<!-- :type="DICT_TYPE.CUSTOMER_ROLE"-->
<!-- :value="scope.row.roles"-->
<!-- />-->
</template>
</el-table-column>
<el-table-column :label="$t('客户经理')" align="center" prop="customerServiceName"></el-table-column>
<el-table-column :label="$t('国籍')" align="center" prop="country" :formatter="countryFormatter"></el-table-column>
<el-table-column :label="$t('国籍')" align="center" prop="country"
:formatter="countryFormatter"></el-table-column>
<el-table-column :label="$t('出货渠道')" align="center">
<template slot-scope="{ row }">
{{ channel(row.transportType) }}
......@@ -208,7 +218,7 @@
</el-table-column>
<el-table-column :label="$t('入公海时间')" align="center" width="160">
<template v-slot="{ row }">
{{ parseTime( row.enterOpenSeaTime ? row.enterOpenSeaTime : row.estimateEnterOpenSeaTime)}}
{{ parseTime(row.enterOpenSeaTime ? row.enterOpenSeaTime : row.estimateEnterOpenSeaTime) }}
</template>
</el-table-column>
<el-table-column :label="$t('入仓确认')" align="center">
......@@ -247,7 +257,7 @@
/>
</template>
</el-table-column>
<el-table-column :label="$t('创建人')" prop="createUsername" align="center">
<el-table-column :label="$t('创建人')" prop="createUsername" align="center">
</el-table-column>
<el-table-column :label="$t('创建时间')" align="center" width="160">
<template slot-scope="scope">
......@@ -262,20 +272,21 @@
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList" />
@pagination="getList"/>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="confirm">{{$t('确 定')}}</el-button>
<el-button type="primary" @click="confirm">{{ $t('确 定') }}</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { getCustomerPage, customerMergeCus } from "@/api/ecw/customer"
import { getDictDatas, DICT_TYPE, getDictDatas2 } from "@/utils/dict"
import {getCustomerPage, customerMergeCus} from "@/api/ecw/customer"
import {getDictDatas, DICT_TYPE, getDictDatas2} from "@/utils/dict"
import Contacts from "./contacts.vue";
import Template from "@/views/cms/template/index.vue";
import {getProductTypeList} from "@/api/ecw/productType";
export default {
name: "CustomerMerge",
components: {
......@@ -328,9 +339,9 @@ export default {
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("")
.filter((i) => (val.split(",") || []).includes(i.value))
.map((i) => (this.isChinese ? i.label : i.labelEn))
.join("")
: "";
};
},
......@@ -386,7 +397,7 @@ export default {
return (id) => {
if (id) {
let strName = ''
for(const item of this.customerSelectFn) {
for (const item of this.customerSelectFn) {
if (item.id == id) {
strName = item.name
break
......@@ -401,9 +412,6 @@ export default {
},
created() {
this.getList();
getProductTypeList().then((r) => {
this.productTypeList = r.data;
});
},
methods: {
init() {
......@@ -413,7 +421,12 @@ export default {
selectCustomer(type) {
this.type = type
this.customerId = null
this.queryParams = {
pageNo: 1,
pageSize: 10
}
this.customerDialogVisible = true
this.getList();
},
handleSubmit() {
if (!this.retainCustomer.id) {
......@@ -439,7 +452,7 @@ export default {
const h = this.$createElement;
this.$msgbox({
title: '注意事项',
message: h('div', { class: 'stips' }, [
message: h('div', {class: 'stips'}, [
h('p', null, '1. 保留客户和非主客户,不能在两个不同的客户经理名下,请先确认两个客户在同一个客户经理名下'),
h('p', null, '2. 被合并客户,提交后会直接删除'),
h('p', null, '3. 合并后,非主客户的联系人,跟进记录,报价单,订单,客户投诉,品牌授权都迁移到保留客户中,其他信息不会迁移,如需要维护非主客户的客户档案信息到保留客户中,请先维护好再操作'),
......
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
label-width="130px"
>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="130px">
<el-form-item :label="$t('客户编号')" prop="number">
<el-input
v-model.trim="queryParams.number"
:placeholder="$t('请输入客户编号')"
clearable
@keyup.enter.native="handleQuery"
@input="queryParams.number=queryParams.number.replace(/\s+/g, '')"
/>
<el-input v-model.trim="queryParams.number" :placeholder="$t('请输入客户编号')" clearable @keyup.enter.native="handleQuery" @input="queryParams.number = queryParams.number.replace(/\s+/g, '')" />
</el-form-item>
<el-form-item :label="$t('客户名称')" prop="name">
<el-input
v-model.trim="queryParams.name"
:placeholder="$t('请输入客户名称')"
clearable
@keyup.enter.native="handleQuery"
@input="queryParams.name=queryParams.name.replace(/\s+/g, '')"
/>
<el-input v-model.trim="queryParams.name" :placeholder="$t('请输入客户名称')" clearable @keyup.enter.native="handleQuery" @input="queryParams.name = queryParams.name.replace(/\s+/g, '')" />
</el-form-item>
<!--
<el-form-item :label="$t('客户等级')" prop="level">
......@@ -45,181 +27,65 @@
</el-form-item>
-->
<el-form-item :label="$t('区号')">
<el-select
v-model="queryParams.areaCode"
:placeholder="$t('请选择区号')"
>
<el-option
v-for="(item, index) in countryList"
:key="index"
:label="
item.nameShort +
(isChinese ? item.nameZh : item.nameEn) +
' +' +
item.tel
"
:value="item.tel"
/>
<el-select v-model="queryParams.areaCode" :placeholder="$t('请选择区号')">
<el-option v-for="(item, index) in countryList" :key="index" :label="item.nameShort + (isChinese ? item.nameZh : item.nameEn) + ' +' + item.tel" :value="item.tel" />
</el-select>
</el-form-item>
<el-form-item :label="$t('联系方式')">
<el-input
:placeholder="$t('请输入联系方式')"
v-model.trim="queryParams.defaultContactPhone"
@input="queryParams.defaultContactPhone=queryParams.defaultContactPhone.replace(/\s+/g, '')"
></el-input>
<el-input :placeholder="$t('请输入联系方式')" v-model.trim="queryParams.defaultContactPhone" @input="queryParams.defaultContactPhone = queryParams.defaultContactPhone.replace(/\s+/g, '')"></el-input>
</el-form-item>
<el-form-item :label="$t('部门')" v-if="path != '/customer/department-customers'">
<el-select v-model="queryParams.deptIds" :placeholder="$t('请选择部门')">
<el-option v-for="item in deptList" :key="item.id" :label="item.name" :value="item.id"/>
<el-option v-for="item in deptList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item :label="$t('客户经理')" prop="customerService">
<el-select
multiple
clearable
v-model="queryParams.customerService"
:placeholder="$t('请选择客户经理')"
size="small"
@change="handleQuery"
>
<el-option
v-for="dict in customerServiceList"
:key="dict.id"
:label="dict.nickname"
:value="dict.id"
/>
<el-select multiple clearable v-model="queryParams.customerService" :placeholder="$t('请选择客户经理')" size="small" @change="handleQuery">
<el-option v-for="dict in customerServiceList" :key="dict.id" :label="dict.nickname" :value="dict.id" />
</el-select>
</el-form-item>
<el-form-item :label="$t('客户来源')" prop="source">
<el-select
multiple
clearable
v-model="queryParams.source"
:placeholder="$t('请选择客户来源')"
size="small"
@change="handleQuery"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_SOURCE)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="dict.value"
/>
<el-select multiple clearable v-model="queryParams.source" :placeholder="$t('请选择客户来源')" size="small" @change="handleQuery">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_SOURCE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item :label="$t('客户类别')" prop="level">
<dict-selector
multiple
clearable
:type="DICT_TYPE.CUSTOMER_TYPE"
v-model="queryParams.type"
@change="handleQuery"
></dict-selector>
<dict-selector multiple clearable :type="DICT_TYPE.CUSTOMER_TYPE" v-model="queryParams.type" @change="handleQuery"></dict-selector>
</el-form-item>
<el-form-item :label="$t('角色')">
<dict-selector
multiple
clearable
:type="DICT_TYPE.CUSTOMER_ROLE"
v-model="queryParams.role"
formatter="number"
@change="handleQuery"
:placeholder="$t('请选择')"
></dict-selector>
<dict-selector multiple clearable :type="DICT_TYPE.CUSTOMER_ROLE" v-model="queryParams.role" formatter="number" @change="handleQuery" :placeholder="$t('请选择')"></dict-selector>
</el-form-item>
<el-form-item :label="$t('客户状态')" prop="status">
<el-select
multiple
clearable
v-model="queryParams.status"
:placeholder="$t('请选择客户状态')"
size="small"
@change="handleQuery"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_STATUS)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="dict.value"
/>
<el-select multiple clearable v-model="queryParams.status" :placeholder="$t('请选择客户状态')" size="small" @change="handleQuery">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_STATUS)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item :label="$t('国籍')" prop="country">
<el-select
multiple
clearable
v-model="queryParams.country"
:placeholder="$t('请选择')"
@change="handleQuery"
>
<el-option
v-for="dict in countryList"
:key="dict.id"
:label="isChinese ? dict.nameZh : dict.nameEn"
:value="parseInt(dict.id)"
/>
<el-select multiple clearable v-model="queryParams.country" :placeholder="$t('请选择')" @change="handleQuery">
<el-option v-for="dict in countryList" :key="dict.id" :label="isChinese ? dict.nameZh : dict.nameEn" :value="parseInt(dict.id)" />
</el-select>
</el-form-item>
<el-form-item :label="$t('出货渠道')">
<dict-selector
multiple
clearable
:type="DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE"
v-model="queryParams.transportType"
formatter="number"
@change="handleQuery"
></dict-selector>
<dict-selector multiple clearable :type="DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE" v-model="queryParams.transportType" formatter="number" @change="handleQuery"></dict-selector>
</el-form-item>
<el-form-item :label="$t('业务国家')" v-show="showSearch">
<el-select
multiple
clearable
v-model="queryParams.busiCountryIds"
:placeholder="$t('请选择')"
@change="handleQuery"
>
<el-option
v-for="dict in countryList"
:key="dict.id"
:label="isChinese ? dict.nameZh : dict.nameEn"
:value="parseInt(dict.id)"
/>
<el-select multiple clearable v-model="queryParams.busiCountryIds" :placeholder="$t('请选择')" @change="handleQuery">
<el-option v-for="dict in countryList" :key="dict.id" :label="isChinese ? dict.nameZh : dict.nameEn" :value="parseInt(dict.id)" />
</el-select>
</el-form-item>
<el-form-item :label="$t('常用提货网点')" v-show="showSearch">
<el-select multiple v-model="queryParams.pickupPoints">
<el-option
v-for="item in getNodeLists"
:key="item.id"
:value="item.id"
:label="isChinese ? item.titleZh : item.titleEn"
></el-option>
<el-option v-for="item in getNodeLists" :key="item.id" :value="item.id" :label="isChinese ? item.titleZh : item.titleEn"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('创建人')" v-show="showSearch">
<el-select v-model="queryParams.founder">
<el-option
v-for="item in allSimplList"
:key="item.id"
:label="item.nickname"
:value="item.id"
>
</el-option>
<el-option v-for="item in allSimplList" :key="item.id" :label="item.nickname" :value="item.id"> </el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('创建时间')" v-show="showSearch">
<el-date-picker
type="datetimerange"
clearable
v-model="dateRangeCreateTime"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
:start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')"
/>
<el-date-picker type="datetimerange" clearable v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" />
</el-form-item>
<!--
<el-form-item :label="$t('信用等级')" prop="department">
......@@ -275,16 +141,7 @@
</el-form-item>
-->
<el-form-item :label="$t('入公海时间')" v-show="showSearch">
<el-date-picker
type="datetimerange"
clearable
v-model="enterOpenSeaTime"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
:start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')"
/>
<el-date-picker type="datetimerange" clearable v-model="enterOpenSeaTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" />
</el-form-item>
<el-form-item :label="$t('业绩类型')" v-show="showSearch">
<el-select clearable v-model="queryParams.isNew">
......@@ -293,104 +150,37 @@
</el-select>
</el-form-item>
<el-form-item :label="$t('年度发货量')" v-show="showSearch">
<el-input
v-model.trim="weightYearly.value"
:placeholder="$t('请输入数字')"
clearable
@keyup.enter.native="handleQuery"
@input="weightYearly.value=weightYearly.value.replace(/\s+/g, '')"
>
<el-input v-model.trim="weightYearly.value" :placeholder="$t('请输入数字')" clearable @keyup.enter.native="handleQuery" @input="weightYearly.value = weightYearly.value.replace(/\s+/g, '')">
<template slot="prepend">
<dict-selector
:type="DICT_TYPE.CUSTOMER_QUERY_NUMBER_FIELD"
defaultable
v-model="weightYearly.key"
class="w-50"
/>
<dict-selector :type="DICT_TYPE.CUSTOMER_QUERY_NUMBER_FIELD" defaultable v-model="weightYearly.key" class="w-50" />
</template>
</el-input>
</el-form-item>
<el-form-item :label="$t('商品类别')" v-show="showSearch">
<el-select
@change="handleSelectProductType"
multiple
v-model="queryParams.productTypes"
:placeholder="$t('请选择')"
>
<el-option
:label="item.titleZh"
:value="item.id"
v-for="item in productTypeList"
:key="item.id"
/>
<el-select @change="handleSelectProductType" multiple v-model="queryParams.productTypes" :placeholder="$t('请选择')">
<el-option :label="item.titleZh" :value="item.id" v-for="item in productTypeList" :key="item.id" />
</el-select>
</el-form-item>
<el-form-item :label="$t('商品名称')" v-show="showSearch">
<el-select
multiple
filterable
clearable
v-model="queryParams.productIds"
:placeholder="$t('请选择商品名称')"
>
<el-option
:label="item.titleZh"
:value="parseInt(item.id)"
v-for="item in productList"
:key="item.id"
/>
<el-select multiple filterable clearable v-model="queryParams.productIds" :placeholder="$t('请选择商品名称')">
<el-option :label="item.titleZh" :value="parseInt(item.id)" v-for="item in productList" :key="item.id" />
</el-select>
</el-form-item>
<el-form-item :label="$t('主要竞争对手')" v-show="showSearch">
<el-select
clearable
multiple
v-model="queryParams.competitorIds"
:placeholder="$t('请选择')"
@change="handleQuery"
>
<el-option
v-for="item in competitorList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
<el-select clearable multiple v-model="queryParams.competitorIds" :placeholder="$t('请选择')" @change="handleQuery">
<el-option v-for="item in competitorList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item :label="$t('年度发货次数')" v-show="showSearch">
<el-input
v-model.trim="numYearly.value"
:placeholder="$t('请输入数字')"
clearable
@keyup.enter.native="handleQuery"
@input="numYearly.value=numYearly.value.replace(/\s+/g, '')"
>
<el-input v-model.trim="numYearly.value" :placeholder="$t('请输入数字')" clearable @keyup.enter.native="handleQuery" @input="numYearly.value = numYearly.value.replace(/\s+/g, '')">
<template slot="prepend">
<dict-selector
:type="DICT_TYPE.CUSTOMER_QUERY_NUMBER_FIELD"
defaultable
v-model="numYearly.key"
class="w-50"
/>
<dict-selector :type="DICT_TYPE.CUSTOMER_QUERY_NUMBER_FIELD" defaultable v-model="numYearly.key" class="w-50" />
</template>
</el-input>
</el-form-item>
<el-form-item :label="$t('推介人')" v-show="showSearch">
<el-select
clearable
remote
:remote-method="remoteMethod"
v-model="queryParams.promoter"
:placeholder="$t('请输入推介人')"
filterable
>
<el-option
v-for="item in customerSelectFn"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
<el-form-item :label="$t('推介人')" v-show="showSearch">
<el-select clearable remote :remote-method="remoteMethod" v-model="queryParams.promoter" :placeholder="$t('请输入推介人')" filterable>
<el-option v-for="item in customerSelectFn" :key="item.id" :label="item.name" :value="item.id"> </el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('入仓确认')" v-show="showSearch">
......@@ -409,131 +199,44 @@
<el-switch v-model="queryParams.isShowTidanPrice" />
</el-form-item>
<el-form-item :label="$t('归属时间')" v-show="showSearch">
<el-date-picker
type="datetimerange"
clearable
v-model="customerServiceConfirmedTime"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
:start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')"
/>
<el-date-picker type="datetimerange" clearable v-model="customerServiceConfirmedTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" />
</el-form-item>
<el-form-item :label="$t('首次成交时间')" v-show="showSearch">
<el-date-picker
type="datetimerange"
clearable
v-model="firstDealTime"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
:start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')"
/>
<el-date-picker type="datetimerange" clearable v-model="firstDealTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" />
</el-form-item>
<el-form-item :label="$t('获取方式')" v-show="showSearch">
<el-select
v-model="queryParams.getMethod"
multiple
:placeholder="$t('请选择')"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_GET_METHOD)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
<el-select v-model="queryParams.getMethod" multiple :placeholder="$t('请选择')">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_GET_METHOD)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
</el-select>
</el-form-item>
<el-form-item :label="$t('创建入口')" v-show="showSearch">
<el-select
v-model="queryParams.createFroms"
multiple
:placeholder="$t('请选择')"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_FROM)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
<el-select v-model="queryParams.createFroms" multiple :placeholder="$t('请选择')">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_FROM)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
</el-select>
</el-form-item>
<el-form-item :label="$t('结算方式')" v-show="showSearch">
<el-select
v-model="queryParams.balances"
multiple
:placeholder="$t('请选择结算方式')"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_BALANCE)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
<el-select v-model="queryParams.balances" multiple :placeholder="$t('请选择结算方式')">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_BALANCE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{
$t("搜索")
}}</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{
$t("重置")
}}</el-button>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{ $t("搜索") }}</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{ $t("重置") }}</el-button>
</el-form-item>
</el-form>
<!-- 操作工具栏 -->
<div
v-if="path === '/customer/customer'"
style="color: red; margin-bottom: 5px"
>
注意:创建的客户需接收
</div>
<div v-if="path === '/customer/customer'" style="color: red; margin-bottom: 5px">注意:创建的客户需接收</div>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<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-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">
<el-button
:disabled="selectCustomerList.length === 0"
type="primary"
size="mini"
@click="transferShow = true"
v-hasPermi="[selectAuthorityFn('ecw:customer:batch-transfer')]"
>{{ $t("批量移交") }}</el-button
>
<el-button :disabled="selectCustomerList.length === 0" type="primary" size="mini" @click="transferShow = true" v-hasPermi="[selectAuthorityFn('ecw:customer:batch-transfer')]">{{ $t("批量移交") }}</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
:loading="exportLoading"
v-hasPermi="[selectAuthorityFn('ecw:customer:export')]"
>{{ $t("导出") }}</el-button
>
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading" v-hasPermi="[selectAuthorityFn('ecw:customer:export')]">{{ $t("导出") }}</el-button>
</el-col>
<el-col :span="1.5">
<!-- <el-button :disabled="!selectCustomerList.length" @click="setChangeCustomerAir(true)" v-if="$route.path === '/customer/customer'" type="primary" plain size="mini" :loading="exportLoading"-->
......@@ -544,68 +247,22 @@
<!-- 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-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:fcl-mistake']"
:disabled="!selectCustomerList.length"
@click="setFullContainerLoad(false)"
v-if="$route.path === '/customer/customer'"
type="primary"
plain
size="mini"
:loading="exportLoading"
>{{ $t("设置海运非整柜客户") }}</el-button
>
<el-button v-hasPermi="['ecw:customer:fcl-mistake']" :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="[selectAuthorityFn('ecw:customer:create-potential')]"
v-if="path === '/customer/customer'"
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAddPotential"
>{{ $t("新增潜在客户") }}</el-button
>
<el-button v-has-permi="[selectAuthorityFn('ecw:customer:create-potential')]" v-if="path === '/customer/customer'" type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddPotential">{{ $t("新增潜在客户") }}</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleMergeCus"
v-has-permi="[selectAuthorityFn('ecw:customer:merge')]"
v-if="path === '/customer/customer'"
>{{ $t("合并客户") }}</el-button
>
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleMergeCus" v-has-permi="[selectAuthorityFn('ecw:customer:merge')]" v-if="path === '/customer/customer'">{{ $t("合并客户") }}</el-button>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table
ref="multipleTable"
v-loading="loading"
:data="list"
@selection-change="handleSelectionChange"
>
<el-table ref="multipleTable" v-loading="loading" :data="list" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" fixed></el-table-column>
<el-table-column :label="$t('客户编号')" align="center" fixed>
<template v-slot="{ row }">
......@@ -631,10 +288,7 @@
<el-table-column :label="$t('信用等级')" :prop="isChinese ? 'creditLevelNameZh' : 'creditLevelNameEn'"></el-table-column>
-->
<el-table-column
:label="$t('主联系人')"
prop="defaultContactName"
></el-table-column>
<el-table-column :label="$t('主联系人')" prop="defaultContactName"></el-table-column>
<el-table-column :label="$t('主联系方式')" prop="defaultContactPhone">
<template v-slot="{ row }">
+{{ row.defaultContactPhone }} <br />
......@@ -644,21 +298,30 @@
</template>
</el-table-column>
<el-table-column :label="$t('客户类别')" align="center" prop="status">
<template slot-scope="scope">
<dict-tag
:type="DICT_TYPE.CUSTOMER_TYPE"
:value="scope.row.type"
/>
<template slot-scope="{ row }">
{{
getDictDatas2(DICT_TYPE.CUSTOMER_TYPE, (row.type || "").split(","))
.map((e) => (isChinese ? e.label : e.labelEn))
.join(", ")
}}
<!-- <dict-tag-->
<!-- :type="DICT_TYPE.CUSTOMER_TYPE"-->
<!-- :value="scope.row.type"-->
<!-- />-->
</template>
</el-table-column>
<el-table-column :label="$t('角色')" align="center" prop="status">
<template slot-scope="{ row }">
{{ getDictDatas2(DICT_TYPE.CUSTOMER_ROLE, (row.roles||'').split(',')).map(e => isChinese ? e.label : e.labelEn).join(', ')}}
<!-- {{ getCustomerRoles(row.roles) }}-->
<!-- <dict-tag-->
<!-- :type="DICT_TYPE.CUSTOMER_ROLE"-->
<!-- :value="scope.row.roles"-->
<!-- />-->
{{
getDictDatas2(DICT_TYPE.CUSTOMER_ROLE, (row.roles || "").split(","))
.map((e) => (isChinese ? e.label : e.labelEn))
.join(", ")
}}
<!-- {{ getCustomerRoles(row.roles) }}-->
<!-- <dict-tag-->
<!-- :type="DICT_TYPE.CUSTOMER_ROLE"-->
<!-- :value="scope.row.roles"-->
<!-- />-->
</template>
</el-table-column>
<el-table-column :label="$t('客户经理')" align="center" prop="customerServiceName"></el-table-column>
......@@ -670,10 +333,7 @@
</el-table-column>
<el-table-column :label="$t('客户来源')">
<template slot-scope="scope">
<dict-tag
:type="DICT_TYPE.CUSTOMER_SOURCE"
:value="scope.row.source"
/>
<dict-tag :type="DICT_TYPE.CUSTOMER_SOURCE" :value="scope.row.source" />
</template>
</el-table-column>
<el-table-column :label="$t('业务国家')">
......@@ -696,8 +356,7 @@
{{ getProductTypeNames(row.productType) }}
</template>
</el-table-column>
<el-table-column :label="$t('主要竞争对手')" prop="competitorNames">
</el-table-column>
<el-table-column :label="$t('主要竞争对手')" prop="competitorNames"> </el-table-column>
<el-table-column :label="$t('年度发货次数')" align="center">
<template slot-scope="{ row }">
{{ row.numYearly }}
......@@ -710,13 +369,13 @@
</el-table-column>
<el-table-column :label="$t('入公海时间')" align="center" width="160">
<template v-slot="{ row }">
{{ parseTime( row.enterOpenSeaTime ? row.enterOpenSeaTime : row.estimateEnterOpenSeaTime)}}
{{ parseTime(row.enterOpenSeaTime ? row.enterOpenSeaTime : row.estimateEnterOpenSeaTime) }}
</template>
</el-table-column>
<el-table-column :label="$t('入仓确认')" align="center">
<template slot-scope="scope">
<el-tag type="success" v-if="scope.row.arrivalConfirm == 1">{{ $t('') }}</el-tag>
<el-tag type="info" v-else>{{ $t('') }}</el-tag>
<el-tag type="success" v-if="scope.row.arrivalConfirm == 1">{{ $t("") }}</el-tag>
<el-tag type="info" v-else>{{ $t("") }}</el-tag>
</template>
</el-table-column>
<el-table-column :label="$t('控货无收货人')" align="center">
......@@ -741,14 +400,10 @@
</el-table-column>
<el-table-column :label="$t('获取方式')" align="center">
<template slot-scope="scope">
<dict-tag
:type="DICT_TYPE.CUSTOMER_GET_METHOD"
:value="scope.row.getMethod"
/>
<dict-tag :type="DICT_TYPE.CUSTOMER_GET_METHOD" :value="scope.row.getMethod" />
</template>
</el-table-column>
<el-table-column :label="$t('创建人')" prop="createUsername" align="center">
</el-table-column>
<el-table-column :label="$t('创建人')" prop="createUsername" align="center"> </el-table-column>
<el-table-column :label="$t('创建时间')" align="center" width="160">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
......@@ -756,75 +411,20 @@
</el-table-column>
<el-table-column :label="$t('最后更新时间')" align="center" width="160">
<template slot-scope="scope">
<span >{{ parseTime(scope.row.updateTime) }}</span>
<span>{{ parseTime(scope.row.updateTime) }}</span>
</template>
</el-table-column>
<el-table-column width="200px" :label="$t('操作')" align="center" fixed="right">
<template slot-scope="scope">
<!-- <el-button size="mini" type="text" v-show="'development' === env && scope.row.isInOpenSea" @click="seasPond(scope.row)"-->
<!-- v-hasPermi="['ecw:customer:query']">{{$t('掉入公海池')}}</el-button>-->
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row)"
v-hasPermi="[selectAuthorityFn('ecw:customer:index-query')]"
>{{ $t("查看") }}</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="[selectAuthorityFn('ecw:customer:update')]"
>{{ $t("修改") }}</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="[selectAuthorityFn('ecw:customer:delete')]"
>{{ $t("删除") }}</el-button
>
<el-button
size="mini"
v-has-permi="[selectAuthorityFn('ecw:customer:follow-up')]"
type="text"
icon="el-icon-collection"
@click="followUp(scope.row)"
>{{ $t("跟进") }}</el-button
>
<el-button
size="mini"
v-has-permi="[selectAuthorityFn('ecw:customer:customer-complaint')]"
type="text"
icon="el-icon-user"
@click="complaint(scope.row)"
>{{ $t("客诉") }}</el-button
>
<el-button
:disabled="scope.row.isInOpenSea"
v-has-permi="[selectAuthorityFn('ecw:customer:postpone')]"
size="mini"
type="text"
icon="el-icon-user"
@click="delay(scope.row)"
>{{ $t("延期") }}</el-button
>
<el-button
v-has-permi="['ecw:customer:treat-recovery']"
v-if="
scope.row.customerService !== null &&
scope.row.customerServiceAssignedTime !== null &&
!scope.row.isCustomerServiceConfirmed &&
!scope.row.isInOpenSea &&
path === '/customer/customer'
"
size="mini"
type="text"
@click="recovery(scope.row)"
>
<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)" v-hasPermi="[selectAuthorityFn('ecw:customer:index-query')]">{{ $t("查看") }}</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="[selectAuthorityFn('ecw:customer:update')]">{{ $t("修改") }}</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="[selectAuthorityFn('ecw:customer:delete')]">{{ $t("删除") }}</el-button>
<el-button size="mini" v-has-permi="[selectAuthorityFn('ecw:customer:follow-up')]" type="text" icon="el-icon-collection" @click="followUp(scope.row)">{{ $t("跟进") }}</el-button>
<el-button size="mini" v-has-permi="[selectAuthorityFn('ecw:customer:customer-complaint')]" type="text" icon="el-icon-user" @click="complaint(scope.row)">{{ $t("客诉") }}</el-button>
<el-button :disabled="scope.row.isInOpenSea" v-has-permi="[selectAuthorityFn('ecw:customer:postpone')]" size="mini" type="text" icon="el-icon-user" @click="delay(scope.row)">{{ $t("延期") }}</el-button>
<el-button v-has-permi="['ecw:customer:treat-recovery']" v-if="scope.row.customerService !== null && scope.row.customerServiceAssignedTime !== null && !scope.row.isCustomerServiceConfirmed && !scope.row.isInOpenSea && path === '/customer/customer'" size="mini" type="text" @click="recovery(scope.row)">
{{ $t("回收客户") }}
</el-button>
<el-button
......@@ -833,107 +433,54 @@
size="mini"
type="text"
@click="
dialogVisible = true;
customData = scope.row;
currentisNew = scope.row.isNew;
dialogVisible = true
customData = scope.row
currentisNew = scope.row.isNew
"
>
{{ $t("业绩类型") }}
</el-button>
<!--lanbm 2024-05-23 添加报价按钮逻辑控制-->
<el-button
v-has-permi="[selectAuthorityFn('ecw:customer:treat-quoted-price')]"
size="mini"
type="text"
icon="el-icon-user"
@click="quote(scope.row)"
>{{ $t("报价") }}</el-button
>
<el-button
v-has-permi="['ecw:customer:setting']"
size="mini"
type="text"
icon="el-icon-user"
@click="handleSetting(scope.row)"
>{{ $t("设置") }}</el-button
>
<el-button v-has-permi="[selectAuthorityFn('ecw:customer:treat-quoted-price')]" size="mini" type="text" icon="el-icon-user" @click="quote(scope.row)">{{ $t("报价") }}</el-button>
<el-button v-has-permi="['ecw:customer:setting']" size="mini" type="text" icon="el-icon-user" @click="handleSetting(scope.row)">{{ $t("设置") }}</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" @pagination="getList" />
<!-- 对话框(添加 / 修改) -->
<el-dialog
:title="title"
:visible.sync="open"
width="90%"
append-to-body
:close-on-click-modal="false"
>
<el-dialog :title="title" :visible.sync="open" width="90%" append-to-body :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="150px">
<el-row :gutter="10">
<el-col :span="12">
<el-form-item :label="$t('客户名称')" prop="name">
<el-input
v-model="form.name"
:placeholder="$t('请输入客户名称')"
/>
<el-input v-model="form.name" :placeholder="$t('请输入客户名称')" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('国家')" prop="country">
<el-select v-model="form.country" :placeholder="$t('请选择国家')">
<el-option
v-for="dict in getDictDatas(DICT_TYPE.COUNTRY)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
<el-option v-for="dict in getDictDatas(DICT_TYPE.COUNTRY)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('客户等级')" prop="level">
<el-select
v-model="form.level"
:placeholder="$t('请选择客户等级')"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_LEVEL)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
<el-select v-model="form.level" :placeholder="$t('请选择客户等级')">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_LEVEL)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('联系地址')" prop="address">
<el-input
v-model="form.address"
:placeholder="$t('请输入联系地址')"
/>
<el-input v-model="form.address" :placeholder="$t('请输入联系地址')" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('客户类别')" prop="type">
<el-select
v-model="form.type"
:placeholder="$t('请选择客户类别')"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_TYPE)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="dict.value"
/>
<el-select v-model="form.type" :placeholder="$t('请选择客户类别')">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_TYPE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="dict.value" />
</el-select>
</el-form-item>
</el-col>
......@@ -947,54 +494,31 @@
<!-- </el-col>-->
<el-col :span="12">
<el-form-item :label="$t('常用提货网点')" prop="pickupPoint">
<el-select
v-model="form.pickupPoint"
:placeholder="$t('请输入常用提货网点')"
>
<el-option
v-for="node in nodeList"
:key="node.value"
:label="node.label"
:value="node.value"
/>
<el-select v-model="form.pickupPoint" :placeholder="$t('请输入常用提货网点')">
<el-option v-for="node in nodeList" :key="node.value" :label="node.label" :value="node.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('公司名称')" prop="company">
<el-input
v-model="form.company"
:placeholder="$t('请输入公司名称')"
/>
<el-input v-model="form.company" :placeholder="$t('请输入公司名称')" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('客户生日')" prop="birthday">
<el-date-picker
v-model="form.birthday"
type="date"
value-format="timestamp"
:placeholder="$t('请输入客户生日')"
>
</el-date-picker>
<el-date-picker v-model="form.birthday" type="date" value-format="timestamp" :placeholder="$t('请输入客户生日')"> </el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('主营类别')" prop="productType">
<el-row :gutter="10">
<el-col :span="11">
<el-select
v-model="form.productType"
:placeholder="$t('请选择产品类别')"
>
<el-select v-model="form.productType" :placeholder="$t('请选择产品类别')">
<!-- <el-option :label="$t('请选择字典生成')" value="" />-->
</el-select>
</el-col>
<el-col :span="11">
<el-select
v-model="form.productType"
:placeholder="$t('请选择主营类别')"
>
<el-select v-model="form.productType" :placeholder="$t('请选择主营类别')">
<!-- <el-option :label="$t('请选择字典生成')" value="" />-->
</el-select>
</el-col>
......@@ -1003,46 +527,22 @@
</el-col>
<el-col :span="12">
<el-form-item :label="$t('客户来源')" prop="source">
<el-select
v-model="form.source"
:placeholder="$t('请选择客户来源')"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_SOURCE)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
<el-select v-model="form.source" :placeholder="$t('请选择客户来源')">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_SOURCE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('结算方式')" prop="balance">
<el-select
v-model="form.balance"
:placeholder="$t('请选择结算方式')"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_BALANCE)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
<el-select v-model="form.balance" :placeholder="$t('请选择结算方式')">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_BALANCE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('客户经理')" prop="customerService">
<el-select
v-model="form.customerService"
:placeholder="$t('请选择客户经理')"
>
<el-option
v-for="dict in customerServiceList"
:key="dict.id"
:label="dict.nickname"
:value="dict.id"
/>
<el-select v-model="form.customerService" :placeholder="$t('请选择客户经理')">
<el-option v-for="dict in customerServiceList" :key="dict.id" :label="dict.nickname" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
......@@ -1053,84 +553,47 @@
</el-col>
<el-col :span="12">
<el-form-item :label="$t('客户状态')" prop="status">
<el-select
v-model="form.status"
:placeholder="$t('请选择客户状态')"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_STATUS)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
<el-select v-model="form.status" :placeholder="$t('请选择客户状态')">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_STATUS)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('推介人')" prop="promoter">
<el-input
v-model="form.promoter"
:placeholder="$t('请输入推介人')"
/>
<el-input v-model="form.promoter" :placeholder="$t('请输入推介人')" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('创建人')" prop="founder">
<el-input
v-model="form.founder"
:placeholder="$t('请输入创建人')"
/>
<el-input v-model="form.founder" :placeholder="$t('请输入创建人')" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('创建时间')" prop="founder">
<el-date-picker
v-model="form.createTime"
type="datetime"
value-format="timestamp"
:placeholder="$t('选择创建时间')"
>
</el-date-picker>
<el-date-picker v-model="form.createTime" type="datetime" value-format="timestamp" :placeholder="$t('选择创建时间')"> </el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('备注')" prop="remarks">
<el-input
v-model="form.remarks"
:placeholder="$t('请输入备注')"
/>
<el-input v-model="form.remarks" :placeholder="$t('请输入备注')" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item :label="$t('到仓确认')" prop="arrivalConfirm">
<el-switch
v-model="form.arrivalConfirm"
:active-value="0"
:inactive-value="1"
/>
<el-switch v-model="form.arrivalConfirm" :active-value="0" :inactive-value="1" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item :label="$t('重货标准(CBM)')" prop="weightUnit">
<el-input
v-model="form.weightUnit"
:placeholder="$t('请输入重货标准(CBM)')"
/>
<el-input v-model="form.weightUnit" :placeholder="$t('请输入重货标准(CBM)')" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item :label="$t('指定线路')" prop="line">
<el-switch v-model="showLine"></el-switch>
<el-table
v-show="showLine"
border
:data="form.customerLines"
style="width: 500px"
>
<el-table-column prop="departureId" :label="$t('始发地')">
</el-table-column>
<el-table-column prop="objectiveId" :label="$t('目的地')">
</el-table-column>
<el-table v-show="showLine" border :data="form.customerLines" style="width: 500px">
<el-table-column prop="departureId" :label="$t('始发地')"> </el-table-column>
<el-table-column prop="objectiveId" :label="$t('目的地')"> </el-table-column>
</el-table>
</el-form-item>
</el-col>
......@@ -1139,131 +602,67 @@
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>{{ $t("联系人") }}</span>
<el-button
style="float: right"
size="small"
type="primary"
@click="form.customerContacts.push({ department: undefined })"
>+</el-button
>
<el-button style="float: right" size="small" type="primary" @click="form.customerContacts.push({ department: undefined })">+</el-button>
</div>
<el-table :data="form.customerContacts" style="width: 100%">
<el-table-column prop="department" :label="$t('部门')" width="">
<template v-slot="{ row, column, $index }">
<el-input
v-model="row.department"
:placeholder="$t('请输入部门')"
size="mini"
/>
<el-input v-model="row.department" :placeholder="$t('请输入部门')" size="mini" />
</template>
</el-table-column>
<el-table-column prop="position" :label="$t('职位')" width="">
<template v-slot="{ row }">
<el-input
v-model="row.position"
:placeholder="$t('请输入职位')"
size="mini"
/>
<el-input v-model="row.position" :placeholder="$t('请输入职位')" size="mini" />
</template>
</el-table-column>
<el-table-column prop="name" :label="$t('联系人')">
<template v-slot:header
>{{ $t("联系人") }}<span style="color: #ff0000">*</span>
</template>
<template v-slot:header>{{ $t("联系人") }}<span style="color: #ff0000">*</span> </template>
<template v-slot="{ row }">
<el-input
v-model="row.name"
:placeholder="$t('请输入联系人')"
size="mini"
/>
<el-input v-model="row.name" :placeholder="$t('请输入联系人')" size="mini" />
</template>
</el-table-column>
<el-table-column prop="areaCode" :label="$t('区号')">
<template v-slot:header
>{{ $t("区号") }}<span style="color: #ff0000">*</span>
</template>
<template v-slot:header>{{ $t("区号") }}<span style="color: #ff0000">*</span> </template>
<template v-slot="{ row }">
<el-select
v-model="row.areaCode"
:placeholder="$t('请选择区号')"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.AREA_CODE)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
<el-select v-model="row.areaCode" :placeholder="$t('请选择区号')">
<el-option v-for="dict in getDictDatas(DICT_TYPE.AREA_CODE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
</el-select>
</template>
</el-table-column>
<el-table-column prop="phoneNew" :label="$t('联系方式')">
<template v-slot:header
>{{ $t("联系方式") }}<span style="color: #ff0000">*</span>
</template>
<template v-slot:header>{{ $t("联系方式") }}<span style="color: #ff0000">*</span> </template>
<template v-slot="{ row }">
<el-input
v-model="row.phoneNew"
:placeholder="$t('请输入联系方式')"
size="mini"
/>
<el-input v-model="row.phoneNew" :placeholder="$t('请输入联系方式')" size="mini" />
</template>
</el-table-column>
<el-table-column prop="" :label="$t('关联账号')"> </el-table-column>
<el-table-column prop="social" :label="$t('社交软件')">
<template v-slot="{ row }">
<el-select
v-model="row.social"
:placeholder="$t('请选择社交软件')"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.SOCIAL)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
<el-select v-model="row.social" :placeholder="$t('请选择社交软件')">
<el-option v-for="dict in getDictDatas(DICT_TYPE.SOCIAL)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
</el-select>
</template>
</el-table-column>
<el-table-column prop="socialNumber" :label="$t('社交软件号码')">
<template v-slot="{ row }">
<el-input
v-model="row.socialNumber"
:placeholder="$t('请输入社交软件号码')"
size="mini"
/>
<el-input v-model="row.socialNumber" :placeholder="$t('请输入社交软件号码')" size="mini" />
</template>
</el-table-column>
<el-table-column prop="email" :label="$t('邮箱')">
<template v-slot="{ row }">
<el-input
v-model="row.email"
:placeholder="$t('请输入邮箱')"
size="mini"
/>
<el-input v-model="row.email" :placeholder="$t('请输入邮箱')" size="mini" />
</template>
</el-table-column>
<el-table-column prop="isDefault" :label="$t('设为默认')">
<template v-slot="{ row }">
<el-select
v-model="row.isDefault"
:placeholder="$t('设为默认')"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.IS_DEFAULT)"
:key="dict.value"
:label="dict.label"
:value="parseInt(dict.isDefault)"
/>
<el-select v-model="row.isDefault" :placeholder="$t('设为默认')">
<el-option v-for="dict in getDictDatas(DICT_TYPE.IS_DEFAULT)" :key="dict.value" :label="dict.label" :value="parseInt(dict.isDefault)" />
</el-select>
</template>
</el-table-column>
<el-table-column prop="name" :label="$t('操作')">
<template v-slot="{ row, column, $index }">
<el-button
type="danger"
@click="form.customerContacts.splice($index, 1)"
>{{ $t("删除") }}</el-button
>
<el-button type="danger" @click="form.customerContacts.splice($index, 1)">{{ $t("删除") }}</el-button>
</template>
</el-table-column>
</el-table>
......@@ -1272,18 +671,12 @@
<el-row :gutter="10" style="margin-top: 15px">
<el-col :span="12">
<el-form-item :label="$t('发票抬头')" prop="invoiceTitle">
<el-input
v-model="form.invoiceTitle"
:placeholder="$t('请输入发票抬头')"
/>
<el-input v-model="form.invoiceTitle" :placeholder="$t('请输入发票抬头')" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('纳税人识别号')" prop="licenseNumber">
<el-input
v-model="form.licenseNumber"
:placeholder="$t('请输入纳税人识别号')"
/>
<el-input v-model="form.licenseNumber" :placeholder="$t('请输入纳税人识别号')" />
</el-form-item>
</el-col>
<el-col :span="12">
......@@ -1293,86 +686,42 @@
</el-col>
<el-col :span="12">
<el-form-item :label="$t('账户')" prop="bankNumber">
<el-input
v-model="form.bankNumber"
:placeholder="$t('请输入账户')"
/>
<el-input v-model="form.bankNumber" :placeholder="$t('请输入账户')" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('项目')" prop="project">
<el-input
v-model="form.project"
:placeholder="$t('请输入项目')"
/>
<el-input v-model="form.project" :placeholder="$t('请输入项目')" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('开票地址')" prop="billingAddress">
<el-input
v-model="form.billingAddress"
:placeholder="$t('请输入开票地址')"
/>
<el-input v-model="form.billingAddress" :placeholder="$t('请输入开票地址')" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('开票电话')" prop="billingTell">
<el-input
v-model="form.billingTell"
:placeholder="$t('请输入开票电话')"
/>
<el-input v-model="form.billingTell" :placeholder="$t('请输入开票电话')" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('税率')" prop="taxRate">
<el-input
v-model="form.taxRate"
:placeholder="$t('请输入税率')"
/>
<el-input v-model="form.taxRate" :placeholder="$t('请输入税率')" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">{{
$t("确 定")
}}</el-button>
<el-button type="primary" @click="submitForm">{{ $t("确 定") }}</el-button>
<el-button @click="cancel">{{ $t("取 消") }}</el-button>
</div>
</el-dialog>
<customer-follow-list
:customer-id="customerId"
:id="customerId"
:customer-service="customerService"
:customer-number="customerNumber"
ref="CustomerFollowList"
v-if="customerFollowVisible"
></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>
<customer-setting
ref="customerSetting"
@refresh="getList"
></customer-setting>
<customer-merge
ref="customerMerge"
@refresh="getList"
:countryList="countryList"
:getNodeLists="getNodeLists"
:productTypeList="getNodeLists"
:customerSelectFn="customerSelectFn"
v-if="customerMergeVisible"
></customer-merge>
<customer-follow-list :customer-id="customerId" :id="customerId" :customer-service="customerService" :customer-number="customerNumber" ref="CustomerFollowList" v-if="customerFollowVisible"></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>
<customer-setting ref="customerSetting" @refresh="getList"></customer-setting>
<customer-merge ref="customerMerge" @refresh="getList" :countryList="countryList" :getNodeLists="getNodeLists" :productTypeList="getNodeLists" :customerSelectFn="customerSelectFn" v-if="customerMergeVisible"></customer-merge>
<!--业绩类型 -->
<el-dialog title="业绩类型" :visible.sync="dialogVisible" width="30%">
<div>
......@@ -1389,58 +738,36 @@
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button
:disabled="customData.isNew === currentisNew"
type="primary"
@click="modifyCustomer"
>修改</el-button
>
<el-button :disabled="customData.isNew === currentisNew" type="primary" @click="modifyCustomer">修改</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import {
createCustomer,
updateCustomer,
deleteCustomer,
getCustomer,
getCustomerPage,
exportCustomerExcel,
testEnterToOpenSea,
getCustomerDeptPage,
changeCustomerAir,
getPotential,
setChangeCustomerFcl,
potentialExportExcel,
deptExportExcel,
recycleUnconfirmedCustomer,
updatecustomerToOld,
competitorListAll
} from "@/api/ecw/customer";
import {getDictDatas, DICT_TYPE, getDictDatas2} from "@/utils/dict";
import { CommonStatusEnum } from "@/utils/constants";
import { uploadFile } from "@/api/infra/file";
import upload from "@/components/ImageUpload";
import { getNodeList } from "@/api/ecw/node";
import CustomerFollowList from "./components/customerFollow";
import customerComplaints from "@/components/customerComplaints";
import { listServiceUser, getUserProfile, listAllSimpl } from "@/api/system/user";
import { getCountryListAll } from "@/api/ecw/country";
import { getCreditPage } from "@/api/customer/credit";
import { customerExportExcel, changeCustomerDefaultPay, changeCustomerNoConsignee, changeCustomerDefaultBilling } from "@/api/ecw/customer";
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";
import CustomerSetting from "./components/customerSetting.vue";
import CustomerMerge from "./components/customerMerge.vue";
import AreaCodeSelector from "@/components/AreaCodeSelector/index.vue";
import { getCustomerSelect } from "@/api/ecw/customer";
import { getProductTypeList } from "@/api/ecw/productType";
import { getProductList } from "@/api/ecw/product";
import { listMySimpleDepts } from "@/api/system/dept";
import { createCustomer, updateCustomer, deleteCustomer, getCustomer, getCustomerPage, exportCustomerExcel, testEnterToOpenSea, getCustomerDeptPage, changeCustomerAir, getPotential, setChangeCustomerFcl, potentialExportExcel, deptExportExcel, recycleUnconfirmedCustomer, updatecustomerToOld, competitorListAll } from "@/api/ecw/customer"
import { getDictDatas, DICT_TYPE, getDictDatas2 } from "@/utils/dict"
import { CommonStatusEnum } from "@/utils/constants"
import { uploadFile } from "@/api/infra/file"
import upload from "@/components/ImageUpload"
import { getNodeList } from "@/api/ecw/node"
import CustomerFollowList from "./components/customerFollow"
import customerComplaints from "@/components/customerComplaints"
import { listServiceUser, getUserProfile, listAllSimpl } from "@/api/system/user"
import { getCountryListAll } from "@/api/ecw/country"
import { getCreditPage } from "@/api/customer/credit"
import { customerExportExcel, changeCustomerDefaultPay, changeCustomerNoConsignee, changeCustomerDefaultBilling } from "@/api/ecw/customer"
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"
import CustomerSetting from "./components/customerSetting.vue"
import CustomerMerge from "./components/customerMerge.vue"
import AreaCodeSelector from "@/components/AreaCodeSelector/index.vue"
import { getCustomerSelect } from "@/api/ecw/customer"
import { getProductTypeList } from "@/api/ecw/productType"
import { getProductList } from "@/api/ecw/product"
import { listMySimpleDepts } from "@/api/system/dept"
export default {
name: "EcwCustomerIndex",
components: {
......@@ -1479,7 +806,7 @@ export default {
// 查询参数
queryParams: {
pageNo: 1,
pageSize: 10,
pageSize: 10
/*number: null,
name: null,
level: null,
......@@ -1503,55 +830,53 @@ export default {
{
required: true,
message: this.$t("客户名称不能为空"),
trigger: "blur",
},
],
country: [
{ required: true, message: this.$t("国家不能为空"), trigger: "blur" },
trigger: "blur"
}
],
country: [{ required: true, message: this.$t("国家不能为空"), trigger: "blur" }],
level: [
{
required: true,
message: this.$t("客户等级不能为空"),
trigger: "blur",
},
trigger: "blur"
}
],
type: [
{
required: true,
message: this.$t("客户类别不能为空"),
trigger: "blur",
},
trigger: "blur"
}
],
// createTime: [{ required: true, message: this.$t("创建时间不能为空"), trigger: "blur" }],
source: [
{
required: true,
message: this.$t("客户来源不能为空"),
trigger: "blur",
},
trigger: "blur"
}
],
customerService: [
{
required: true,
message: this.$t("客户经理不能为空"),
trigger: "blur",
},
trigger: "blur"
}
],
status: [
{
required: true,
message: this.$t("客户状态不能为空"),
trigger: "blur",
},
trigger: "blur"
}
],
founder: [
{
required: true,
message: this.$t("创建人不能为空"),
trigger: "blur",
},
],
trigger: "blur"
}
]
},
// 网点
nodeList: [],
......@@ -1579,21 +904,21 @@ export default {
allSimplList: [],
weightYearly: {
key: "eqNumberKey",
value: "",
value: ""
},
numYearly: {
key: "eqNumberKey",
value: "",
value: ""
},
productTypeList: [],
productList: [],
competitorList: [],
deptList: [],
};
deptList: []
}
},
computed: {
path() {
return this.$route.path;
return this.$route.path
},
channel() {
return (val) => {
......@@ -1602,43 +927,41 @@ export default {
.filter((i) => (val.split(",") || []).includes(i.value))
.map((i) => (this.isChinese ? i.label : i.labelEn))
.join("")
: "";
};
: ""
}
},
isChinese() {
return this.$i18n.locale === "zh_CN";
return this.$i18n.locale === "zh_CN"
},
authorityFn() {
let i = "";
let i = ""
switch (this.$route.path) {
case "/customer/department-customers":
i = "dep-";
break;
i = "dep-"
break
case "/customer/potential":
i = "pot-";
break;
i = "pot-"
break
}
return i;
return i
},
selectAuthorityFn() {
return (val) => {
let t = val.split(":");
t[t.length - 1] = this.authorityFn + t[t.length - 1];
console.log(t.join(":"));
return t.join(":");
};
let t = val.split(":")
t[t.length - 1] = this.authorityFn + t[t.length - 1]
console.log(t.join(":"))
return t.join(":")
}
},
customerSelectFn() {
if (this.recommended.length > 0) {
let i = this.customerSelect.find(
(item) => item.id === this.recommended[0].id
);
let i = this.customerSelect.find((item) => item.id === this.recommended[0].id)
if (!i) {
this.customerSelect.push(this.recommended[0]);
this.customerSelect.push(this.recommended[0])
}
return this.customerSelect;
return this.customerSelect
} else {
return this.customerSelect;
return this.customerSelect
}
},
combinedQueryParams() {
......@@ -1660,64 +983,64 @@ export default {
queryParams.endFirstDealTime = this.firstDealTime[1]
}
if (this.weightYearly.value) {
let key = 'eqWeightYearly'
if (this.weightYearly.key == 'leNumberKey') {
key = 'leWeightYearly'
} else if (this.weightYearly.key == 'geNumberKey') {
key = 'geWeightYearly'
let key = "eqWeightYearly"
if (this.weightYearly.key == "leNumberKey") {
key = "leWeightYearly"
} else if (this.weightYearly.key == "geNumberKey") {
key = "geWeightYearly"
}
queryParams[key] = this.weightYearly.value;
queryParams[key] = this.weightYearly.value
}
if (this.numYearly.value) {
let key = 'eqNumYearly'
if (this.numYearly.key == 'leNumberKey') {
key = 'leNumYearly'
} else if (this.numYearly.key == 'geNumberKey') {
key = 'geNumYearly'
let key = "eqNumYearly"
if (this.numYearly.key == "leNumberKey") {
key = "leNumYearly"
} else if (this.numYearly.key == "geNumberKey") {
key = "geNumYearly"
}
queryParams[key] = this.numYearly.value;
queryParams[key] = this.numYearly.value
}
return queryParams;
},
return queryParams
}
},
watch: {
selectCustomerList(val) {
if (val.length === 0) {
this.getList();
this.$refs.multipleTable.clearSelection();
this.getList()
this.$refs.multipleTable.clearSelection()
}
},
}
},
created() {
getCreditPage({ page: 1, rows: 999 }).then((r) => {
this.creditList = r.data.list;
});
this.getList();
this.creditList = r.data.list
})
this.getList()
listServiceUser().then((r) => {
this.customerServiceList = r.data;
});
this.customerServiceList = r.data
})
getCountryListAll().then((r) => {
this.countryList = r.data;
});
this.countryList = r.data
})
//获取用户id信息 lanbm 2024-05-23 add
getUserProfile().then((res) => {
this.userId = res.data.id;
});
this.getCustomerSelect();
this.userId = res.data.id
})
this.getCustomerSelect()
getNodeList().then((r) => {
this.getNodeLists = r.data;
});
this.getNodeLists = r.data
})
listAllSimpl().then((r) => {
this.allSimplList = r.data;
});
this.allSimplList = r.data
})
getProductTypeList().then((r) => {
this.productTypeList = r.data;
});
this.productTypeList = r.data
})
competitorListAll().then((r) => {
this.competitorList = r.data;
this.competitorList = r.data
})
listMySimpleDepts().then(response => {
listMySimpleDepts().then((response) => {
this.deptList = response.data
})
},
......@@ -1727,112 +1050,106 @@ export default {
})
},
activated() {
this.getList();
this.getList()
},
methods: {
//合并客户
handleMergeCus() {
this.customerMergeVisible = true
this.$nextTick(_ => {
this.$refs['customerMerge'].init()
this.$refs['customerMerge'].dialogVisible = true
this.$nextTick((_) => {
this.$refs["customerMerge"].init()
this.$refs["customerMerge"].dialogVisible = true
})
},
recovery(row) {
this.$confirm(this.$t("是否要回收当前{name}", row), "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
type: "warning"
})
.then(() => {
recycleUnconfirmedCustomer({ customerId: row.id }).then((r) => {
this.$message.success(this.$t("回收成功。"));
this.getList();
});
this.$message.success(this.$t("回收成功。"))
this.getList()
})
})
.catch(() => {
this.$message.info(this.$t("已取消"));
});
this.$message.info(this.$t("已取消"))
})
},
// 设置整柜
setFullContainerLoad(isFcl) {
setChangeCustomerFcl({
customerIdList: this.selectCustomerList,
isFcl,
isFcl
}).then((r) => {
if (r.code === 0) {
this.$message.success(
isFcl ? "设置客户为海运整柜成功!" : "设置客户为非海运整柜成功!"
);
this.selectCustomerList = [];
this.getList();
this.$message.success(isFcl ? "设置客户为海运整柜成功!" : "设置客户为非海运整柜成功!")
this.selectCustomerList = []
this.getList()
}
});
})
},
// 设置空运客户
setChangeCustomerAir(isAir) {
changeCustomerAir({
customerIdList: this.selectCustomerList,
isAir,
isAir
}).then((r) => {
console.log(r);
console.log(r)
if (r.code === 0) {
this.$message.success(
isAir ? "设为空运客户成功!" : "设为非空运客户成功!"
);
this.selectCustomerList = [];
this.getList();
this.$message.success(isAir ? "设为空运客户成功!" : "设为非空运客户成功!")
this.selectCustomerList = []
this.getList()
}
});
})
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
this.open = false
this.reset()
},
complaint(row) {
this.customerId = row.id;
this.customerId = row.id
this.$nextTick(() => {
this.$refs.customerComplaints.handleAdd();
});
this.$refs.customerComplaints.handleAdd()
})
},
countryFormatter(row, column, cellValue) {
const country = this.countryList.find((e) => e.id === cellValue);
return this.isChinese ? country?.nameZh : country?.nameEn;
const country = this.countryList.find((e) => e.id === cellValue)
return this.isChinese ? country?.nameZh : country?.nameEn
},
delay(row) {
this.$router.push({ path: "/customer/delay", query: { id: row.id } });
this.$router.push({ path: "/customer/delay", query: { id: row.id } })
},
followUp(row) {
this.customerId = row.id
this.customerService = row.customerService
this.customerNumber = row.number
this.customerFollowVisible = true
this.$nextTick(_ => {
this.$nextTick((_) => {
// this.$refs.CustomerFollowList.customerFollow.dialogVisible = true;
this.$refs['CustomerFollowList'].init()
this.$refs['CustomerFollowList'].handleAdd()
this.$refs["CustomerFollowList"].init()
this.$refs["CustomerFollowList"].handleAdd()
})
},
//报价
quote(row) {
//lanbm 2024-05-23 添加报价是判断客户所属客户经理,不是就不能报价
if (row.customerService != this.userId) {
this.$message.error(this.$t("此客户属于其他客户经理名下的客户。"));
return;
this.$message.error(this.$t("此客户属于其他客户经理名下的客户。"))
return
}
//this.$router.push({path:'/offer/create',query:{id:row.id}})
this.$router
.push({ path: "/offer/create", query: { customer: row, type: 1 } })
.then({
//this.$refs.push({path:'/customer-contacts/select',query:{pageNo:1,pageSize:10,searchKey:row.defaultContactPhone}})
});
this.$router.push({ path: "/offer/create", query: { customerId: row.id, customerType: row.type, type: 1 } }).then({
//this.$refs.push({path:'/customer-contacts/select',query:{pageNo:1,pageSize:10,searchKey:row.defaultContactPhone}})
})
},
/** 查询列表 */
getList() {
this.loading = true;
this.loading = true
// 处理查询参数}
let params = { ...this.queryParams, ...this.combinedQueryParams };
let params = { ...this.queryParams, ...this.combinedQueryParams }
/*this.addBeginAndEndTime(
params,
this.dateRangeCreateTime,
......@@ -1842,32 +1159,30 @@ export default {
// 执行查询
switch (this.$route.path) {
case "/customer/customer":
getCustomerPage(params).then(this.setData);
break;
getCustomerPage(params).then(this.setData)
break
case "/customer/department-customers":
getCustomerDeptPage(params).then(this.setData);
break;
getCustomerDeptPage(params).then(this.setData)
break
case "/customer/potential":
getPotential(params).then(this.setData);
break;
getPotential(params).then(this.setData)
break
}
},
remoteMethod(val) {
this.getCustomerSelect(val);
this.getCustomerSelect(val)
},
getCustomerSelect(val = "") {
getCustomerSelect({ pageNo: 1, pageSize: 30, searchKey: val }).then(
(res) => {
this.customerSelect = res.data.list;
}
);
getCustomerSelect({ pageNo: 1, pageSize: 30, searchKey: val }).then((res) => {
this.customerSelect = res.data.list
})
},
handleSelectProductType(val) {
if (val && val.length >= 1) {
this.queryParams.productIds = []
getProductList({ typeIds: val }).then((r) => {
this.productList = r.data
});
})
} else {
this.queryParams.productIds = []
this.productList = []
......@@ -1875,50 +1190,48 @@ export default {
},
/** 新增按钮操作 */
handleAdd() {
this.$router.push("/customer/add-edit/0");
this.$router.push("/customer/add-edit/0")
// this.reset();
// this.open = true;
// this.title = this.$t("添加客户");
},
// 新增潜在客户
handleAddPotential() {
this.$refs.potentialCustom.dialogTableVisible = true;
this.$refs.potentialCustom.dialogTableVisible = true
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
const name = row.name;
const number = row.number;
const id = row.id
const name = row.name
const number = row.number
this.$modal
.confirm(
this.$t('是否确认删除客户编号为"') + number + this.$t('"的数据项?')
)
.confirm(this.$t('是否确认删除客户编号为"') + number + this.$t('"的数据项?'))
.then(function () {
return deleteCustomer(id);
return deleteCustomer(id)
})
.then(() => {
this.getList();
this.$modal.msgSuccess(this.$t("删除成功"));
this.getList()
this.$modal.msgSuccess(this.$t("删除成功"))
})
.catch(() => {});
.catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
let func = null;
let title = "";
let func = null
let title = ""
switch (this.$route.path) {
case "/customer/customer":
func = customerExportExcel;
title = "是否确认导出所有客户数据项?";
break;
func = customerExportExcel
title = "是否确认导出所有客户数据项?"
break
case "/customer/department-customers":
func = deptExportExcel;
title = "是否确认导出部门客户数据项?";
break;
func = deptExportExcel
title = "是否确认导出部门客户数据项?"
break
case "/customer/potential":
func = potentialExportExcel;
title = "是否确认导出潜在客户数据项?";
break;
func = potentialExportExcel
title = "是否确认导出潜在客户数据项?"
break
}
// // 执行导出
......@@ -1926,25 +1239,23 @@ export default {
.confirm(this.$t(title))
.then(() => {
func().then((r) => {
this.$message.success(
this.$t("已加入导出队列,请稍后在下载日志中下载")
);
});
this.$message.success(this.$t("已加入导出队列,请稍后在下载日志中下载"))
})
})
.catch(() => {});
.catch(() => {})
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
this.queryParams.pageNo = 1
this.getList()
},
handleSelectionChange(val) {
this.selectCustomerList = val.map((i) => i.id);
this.selectCustomerList = val.map((i) => i.id)
},
/** 修改按钮操作 */
handleUpdate(row) {
console.log(row.id);
this.$router.push("/customer/add-edit/" + row.id);
console.log(row.id)
this.$router.push("/customer/add-edit/" + row.id)
// this.reset();
// const id = row.id;
// getCustomer(id).then(response => {
......@@ -1955,7 +1266,7 @@ export default {
},
/** 查看按钮操作 */
handleView(row) {
this.$router.push("/customer/query/" + row.id);
this.$router.push("/customer/query/" + row.id)
},
/** 表单重置 */
reset() {
......@@ -1994,39 +1305,39 @@ export default {
taxRate: undefined,
remarks: undefined,
arrivalConfirm: undefined,
weightUnit: undefined,
};
this.resetForm("form");
weightUnit: undefined
}
this.resetForm("form")
},
/** 重置按钮操作 */
resetQuery() {
this.dateRangeCreateTime = [];
this.dateRangeCreateTime = []
this.enterOpenSeaTime = []
this.customerServiceConfirmedTime = []
this.firstDealTime = []
this.resetForm("queryForm");
this.resetForm("queryForm")
this.queryParams = {
pageNo: 1,
pageSize: 10,
};
this.weightYearly.value = "";
this.numYearly.value = "";
this.handleQuery();
pageSize: 10
}
this.weightYearly.value = ""
this.numYearly.value = ""
this.handleQuery()
},
/** 调入公海池测试用 */
seasPond(row) {
testEnterToOpenSea(row.id).then((r) => {
if (r.code === 0) {
this.$t("调入公海池成功!");
this.getList();
this.$t("调入公海池成功!")
this.getList()
}
});
})
},
setData(response) {
console.log(response, "response");
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
console.log(response, "response")
this.list = response.data.list
this.total = response.data.total
this.loading = false
},
/** 提交按钮 */
submitForm() {
......@@ -2037,48 +1348,44 @@ export default {
// 修改的提交
if (this.form.id != null) {
updateCustomer(this.form).then((response) => {
this.$modal.msgSuccess(this.$t("修改成功"));
this.open = false;
this.getList();
});
return;
this.$modal.msgSuccess(this.$t("修改成功"))
this.open = false
this.getList()
})
return
}
// 添加的提交
createCustomer(this.form).then((response) => {
this.$modal.msgSuccess(this.$t("新增成功"));
this.open = false;
this.getList();
});
});
this.$modal.msgSuccess(this.$t("新增成功"))
this.open = false
this.getList()
})
})
},
// 修改客户类型
modifyCustomer() {
this.$confirm(
this.$t("修改业绩类型后,将会影响客户新订单业绩计算,请问确定吗?"),
this.$t("提示"),
{
confirmButtonText: this.$t("确定"),
cancelButtonText: this.$t("取消"),
type: "warning",
}
)
this.$confirm(this.$t("修改业绩类型后,将会影响客户新订单业绩计算,请问确定吗?"), this.$t("提示"), {
confirmButtonText: this.$t("确定"),
cancelButtonText: this.$t("取消"),
type: "warning"
})
.then(() => {
updatecustomerToOld({
customerId: this.customData.id,
isNew: this.currentisNew,
isNew: this.currentisNew
}).then((r) => {
this.$message.success(this.$t("修改成功"));
this.dialogVisible = false;
this.getList();
});
this.$message.success(this.$t("修改成功"))
this.dialogVisible = false
this.getList()
})
})
.catch(() => {});
.catch(() => {})
},
setDefaultPay() {
changeCustomerDefaultPay({
customerIdList: this.selectCustomerList,
defaultPay: true
}).then(_ => {
}).then((_) => {
this.$message.success(this.$t("操作成功"))
this.getList()
})
......@@ -2087,7 +1394,7 @@ export default {
changeCustomerNoConsignee({
customerIdList: this.selectCustomerList,
noConsigee: true
}).then(_ => {
}).then((_) => {
this.$message.success(this.$t("操作成功"))
this.getList()
})
......@@ -2096,77 +1403,77 @@ export default {
changeCustomerDefaultBilling({
customerIdList: this.selectCustomerList,
defaultBilling: true
}).then(_ => {
}).then((_) => {
this.$message.success(this.$t("操作成功"))
this.getList()
})
},
handleSetting(row) {
this.$refs['customerSetting'].dialogVisible = true
this.$nextTick(_ => {
this.$refs['customerSetting'].init(row.id)
this.$refs["customerSetting"].dialogVisible = true
this.$nextTick((_) => {
this.$refs["customerSetting"].init(row.id)
})
},
getBusiCountryNames(ids) {
if (ids) {
const idsArr = ids.split(',')
const idsArr = ids.split(",")
const strArr = []
this.countryList.forEach(item => {
this.countryList.forEach((item) => {
if (idsArr.includes(item.id.toString())) {
strArr.push(this.isChinese ? item.nameZh : item.nameEn)
}
})
return strArr.length > 0 ? strArr.join(',') : null
return strArr.length > 0 ? strArr.join(",") : null
} else {
return null
}
},
getPickupPointNames(ids) {
if (ids) {
const idsArr = ids.split(',')
const idsArr = ids.split(",")
const strArr = []
this.getNodeLists.forEach(item => {
this.getNodeLists.forEach((item) => {
if (idsArr.includes(item.id.toString())) {
strArr.push(this.isChinese ? item.titleZh : item.titleEn)
}
})
return strArr.length > 0 ? strArr.join(',') : null
return strArr.length > 0 ? strArr.join(",") : null
} else {
return null
}
},
getCustomerRoles(ids) {
if (ids) {
const idsArr = ids.split(',')
const idsArr = ids.split(",")
const strArr = []
DICT_TYPE.CUSTOMER_ROLE.forEach(item => {
DICT_TYPE.CUSTOMER_ROLE.forEach((item) => {
if (idsArr.includes(item.value.toString())) {
strArr.push(this.isChinese ? item.label : item.labelEn)
}
})
return strArr.length > 0 ? strArr.join(',') : null
return strArr.length > 0 ? strArr.join(",") : null
} else {
return null
}
},
getProductTypeNames(ids) {
if (ids) {
const idsArr = ids.toString().split(',')
const idsArr = ids.toString().split(",")
const strArr = []
this.productTypeList.forEach(item => {
this.productTypeList.forEach((item) => {
if (idsArr.includes(item.id.toString())) {
strArr.push(this.isChinese ? item.titleZh : item.titleEn)
}
})
return strArr.length > 0 ? strArr.join(',') : null
return strArr.length > 0 ? strArr.join(",") : null
} else {
return null
}
},
getPromoterName(id) {
if (id) {
let strName = ''
for(const item of this.customerSelectFn) {
let strName = ""
for (const item of this.customerSelectFn) {
if (item.id == id) {
strName = item.name
break
......@@ -2177,6 +1484,6 @@ export default {
return null
}
}
},
};
}
}
</script>
......@@ -40,7 +40,7 @@
clearable
v-model.number="queryParams.memberMobile"
:placeholder="$t('请输入会员电话')"/>
</el-col>
</el-col>
</el-form-item>
<el-form-item :label="$t('会员编号')" prop="number">
<el-input
......@@ -101,7 +101,8 @@
</el-table-column>
<el-table-column :label="$t('客户类别')" align="center" prop="sourse">
<template v-slot="{row}">
<dict-tag :value="row.type" :type="DICT_TYPE.CUSTOMER_TYPE" />
{{ getDictDatas2(DICT_TYPE.CUSTOMER_TYPE, (row.type||'').split(',')).map(e => isChinese ? e.label : e.labelEn).join(', ')}}
<!-- <dict-tag :value="row.type" :type="DICT_TYPE.CUSTOMER_TYPE" />-->
</template>
</el-table-column>
<el-table-column :label="$t('创建时间')" align="center" prop="createTime" width="180">
......@@ -130,16 +131,18 @@
<script>
import {updateCustomer, getCustomer,
getCustomerPage, exportCustomerExcel } from "@/api/ecw/indirectCustomer";
import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import { getDictDatas, DICT_TYPE, getDictDatas2 } from '@/utils/dict';
import {listServiceUser} from "@/api/system/user";
import {exportCustomerComplaintExcel} from "@/api/ecw/customerComplaint";
import {indirectCustomerExportExcel} from "@/api/ecw/customer";
import AreaCodeSelector from "@/components/AreaCodeSelector/index.vue";
import Template from "@/views/cms/template/index.vue";
export default {
name: "EcwCustomerIndirectcustomer",
components: {
Template,
AreaCodeSelector
},
activated() {
......@@ -149,6 +152,7 @@ export default {
return {
exportLoading:false,
getDictDatas,
getDictDatas2,
DICT_TYPE,
// 遮罩层
loading: true,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -454,11 +454,12 @@
</template>
</el-table-column>
<el-table-column :label="$t('客户类别')" align="center" prop="status">
<template slot-scope="scope">
<dict-tag
:type="DICT_TYPE.CUSTOMER_TYPE"
:value="scope.row.type"
/>
<template slot-scope="{ row }">
{{ getDictDatas2(DICT_TYPE.CUSTOMER_TYPE, (row.type||'').split(',')).map(e => isChinese ? e.label : e.labelEn).join(', ')}}
<!-- <dict-tag-->
<!-- :type="DICT_TYPE.CUSTOMER_TYPE"-->
<!-- :value="scope.row.type"-->
<!-- />-->
</template>
</el-table-column>
<el-table-column :label="$t('角色')" align="center" prop="status">
......
......@@ -451,11 +451,12 @@
</template>
</el-table-column>
<el-table-column :label="$t('客户类别')" align="center" prop="status">
<template slot-scope="scope">
<dict-tag
:type="DICT_TYPE.CUSTOMER_TYPE"
:value="scope.row.type"
/>
<template slot-scope="{ row }">
{{ getDictDatas2(DICT_TYPE.CUSTOMER_TYPE, (row.type||'').split(',')).map(e => isChinese ? e.label : e.labelEn).join(', ')}}
<!-- <dict-tag-->
<!-- :type="DICT_TYPE.CUSTOMER_TYPE"-->
<!-- :value="scope.row.type"-->
<!-- />-->
</template>
</el-table-column>
<el-table-column :label="$t('角色')" align="center" prop="status">
......
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
label-width="130px"
>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="130px">
<el-form-item :label="$t('客户编号')" prop="number">
<el-input
v-model.trim="queryParams.number"
:placeholder="$t('请输入客户编号')"
clearable
@keyup.enter.native="handleQuery"
@input="queryParams.number=queryParams.number.replace(/\s+/g, '')"
/>
<el-input v-model.trim="queryParams.number" :placeholder="$t('请输入客户编号')" clearable @keyup.enter.native="handleQuery" @input="queryParams.number = queryParams.number.replace(/\s+/g, '')" />
</el-form-item>
<el-form-item :label="$t('客户名称')" prop="name">
<el-input
v-model.trim="queryParams.name"
:placeholder="$t('请输入客户名称')"
clearable
@keyup.enter.native="handleQuery"
@input="queryParams.name=queryParams.name.replace(/\s+/g, '')"
/>
<el-input v-model.trim="queryParams.name" :placeholder="$t('请输入客户名称')" clearable @keyup.enter.native="handleQuery" @input="queryParams.name = queryParams.name.replace(/\s+/g, '')" />
</el-form-item>
<el-form-item :label="$t('区号')">
<el-select
v-model="queryParams.areaCode"
:placeholder="$t('请选择区号')"
>
<el-option
v-for="(item, index) in countryList"
:key="index"
:label="
item.nameShort +
(isChinese ? item.nameZh : item.nameEn) +
' +' +
item.tel
"
:value="item.tel"
/>
<el-select v-model="queryParams.areaCode" :placeholder="$t('请选择区号')">
<el-option v-for="(item, index) in countryList" :key="index" :label="item.nameShort + (isChinese ? item.nameZh : item.nameEn) + ' +' + item.tel" :value="item.tel" />
</el-select>
</el-form-item>
<el-form-item :label="$t('联系方式')">
<el-input
:placeholder="$t('请输入联系方式')"
v-model.trim="queryParams.defaultContactPhone"
@input="queryParams.defaultContactPhone=queryParams.defaultContactPhone.replace(/\s+/g, '')"
></el-input>
<el-input :placeholder="$t('请输入联系方式')" v-model.trim="queryParams.defaultContactPhone" @input="queryParams.defaultContactPhone = queryParams.defaultContactPhone.replace(/\s+/g, '')"></el-input>
</el-form-item>
<!--
<el-form-item :label="$t('客户经理')" prop="customerService">
......@@ -72,146 +36,50 @@
</el-form-item>
-->
<el-form-item :label="$t('客户来源')" prop="source">
<el-select
multiple
clearable
v-model="queryParams.source"
:placeholder="$t('请选择客户来源')"
size="small"
@change="handleQuery"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_SOURCE)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="dict.value"
/>
<el-select multiple clearable v-model="queryParams.source" :placeholder="$t('请选择客户来源')" size="small" @change="handleQuery">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_SOURCE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item :label="$t('客户类别')" prop="level">
<dict-selector
multiple
clearable
:type="DICT_TYPE.CUSTOMER_TYPE"
v-model="queryParams.type"
@change="handleQuery"
></dict-selector>
<dict-selector multiple clearable :type="DICT_TYPE.CUSTOMER_TYPE" v-model="queryParams.type" @change="handleQuery"></dict-selector>
</el-form-item>
<el-form-item :label="$t('角色')">
<dict-selector
multiple
clearable
:type="DICT_TYPE.CUSTOMER_ROLE"
v-model="queryParams.role"
formatter="number"
@change="handleQuery"
:placeholder="$t('请选择')"
></dict-selector>
<dict-selector multiple clearable :type="DICT_TYPE.CUSTOMER_ROLE" v-model="queryParams.role" formatter="number" @change="handleQuery" :placeholder="$t('请选择')"></dict-selector>
</el-form-item>
<el-form-item :label="$t('客户状态')" prop="status">
<el-select
multiple
clearable
v-model="queryParams.status"
:placeholder="$t('请选择客户状态')"
size="small"
@change="handleQuery"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_STATUS)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="dict.value"
/>
<el-select multiple clearable v-model="queryParams.status" :placeholder="$t('请选择客户状态')" size="small" @change="handleQuery">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_STATUS)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item :label="$t('国籍')" prop="country">
<el-select
multiple
clearable
v-model="queryParams.country"
:placeholder="$t('请选择')"
@change="handleQuery"
>
<el-option
v-for="dict in countryList"
:key="dict.id"
:label="isChinese ? dict.nameZh : dict.nameEn"
:value="parseInt(dict.id)"
/>
<el-select multiple clearable v-model="queryParams.country" :placeholder="$t('请选择')" @change="handleQuery">
<el-option v-for="dict in countryList" :key="dict.id" :label="isChinese ? dict.nameZh : dict.nameEn" :value="parseInt(dict.id)" />
</el-select>
</el-form-item>
<el-form-item :label="$t('出货渠道')">
<dict-selector
multiple
clearable
:type="DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE"
v-model="queryParams.transportType"
formatter="number"
@change="handleQuery"
></dict-selector>
<dict-selector multiple clearable :type="DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE" v-model="queryParams.transportType" formatter="number" @change="handleQuery"></dict-selector>
</el-form-item>
<el-form-item :label="$t('业务国家')" v-show="showSearch">
<el-select
multiple
clearable
v-model="queryParams.busiCountryIds"
:placeholder="$t('请选择')"
@change="handleQuery"
>
<el-option
v-for="dict in countryList"
:key="dict.id"
:label="isChinese ? dict.nameZh : dict.nameEn"
:value="parseInt(dict.id)"
/>
<el-select multiple clearable v-model="queryParams.busiCountryIds" :placeholder="$t('请选择')" @change="handleQuery">
<el-option v-for="dict in countryList" :key="dict.id" :label="isChinese ? dict.nameZh : dict.nameEn" :value="parseInt(dict.id)" />
</el-select>
</el-form-item>
<el-form-item :label="$t('常用提货网点')" v-show="showSearch">
<el-select multiple v-model="queryParams.pickupPoints">
<el-option
v-for="item in getNodeLists"
:key="item.id"
:value="item.id"
:label="isChinese ? item.titleZh : item.titleEn"
></el-option>
<el-option v-for="item in getNodeLists" :key="item.id" :value="item.id" :label="isChinese ? item.titleZh : item.titleEn"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('创建人')" v-show="showSearch">
<el-select v-model="queryParams.founder">
<el-option
v-for="item in allSimplList"
:key="item.id"
:label="item.nickname"
:value="item.id"
>
</el-option>
<el-option v-for="item in allSimplList" :key="item.id" :label="item.nickname" :value="item.id"> </el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('创建时间')" v-show="showSearch">
<el-date-picker
type="datetimerange"
clearable
v-model="dateRangeCreateTime"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
:start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')"
/>
<el-date-picker type="datetimerange" clearable v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" />
</el-form-item>
<el-form-item :label="$t('入公海时间')" v-show="showSearch">
<el-date-picker
type="datetimerange"
clearable
v-model="enterOpenSeaTime"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
:start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')"
/>
<el-date-picker type="datetimerange" clearable v-model="enterOpenSeaTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" />
</el-form-item>
<el-form-item :label="$t('业绩类型')" v-show="showSearch">
<el-select clearable v-model="queryParams.isNew">
......@@ -220,104 +88,37 @@
</el-select>
</el-form-item>
<el-form-item :label="$t('年度发货量')" v-show="showSearch">
<el-input
v-model.trim="weightYearly.value"
:placeholder="$t('请输入数字')"
clearable
@keyup.enter.native="handleQuery"
@input="weightYearly.value=weightYearly.value.replace(/\s+/g, '')"
>
<el-input v-model.trim="weightYearly.value" :placeholder="$t('请输入数字')" clearable @keyup.enter.native="handleQuery" @input="weightYearly.value = weightYearly.value.replace(/\s+/g, '')">
<template slot="prepend">
<dict-selector
:type="DICT_TYPE.CUSTOMER_QUERY_NUMBER_FIELD"
defaultable
v-model="weightYearly.key"
class="w-50"
/>
<dict-selector :type="DICT_TYPE.CUSTOMER_QUERY_NUMBER_FIELD" defaultable v-model="weightYearly.key" class="w-50" />
</template>
</el-input>
</el-form-item>
<el-form-item :label="$t('商品类别')" v-show="showSearch">
<el-select
@change="handleSelectProductType"
multiple
v-model="queryParams.productTypes"
:placeholder="$t('请选择')"
>
<el-option
:label="item.titleZh"
:value="item.id"
v-for="item in productTypeList"
:key="item.id"
/>
<el-select @change="handleSelectProductType" multiple v-model="queryParams.productTypes" :placeholder="$t('请选择')">
<el-option :label="item.titleZh" :value="item.id" v-for="item in productTypeList" :key="item.id" />
</el-select>
</el-form-item>
<el-form-item :label="$t('商品名称')" v-show="showSearch">
<el-select
multiple
filterable
clearable
v-model="queryParams.productIds"
:placeholder="$t('请选择商品名称')"
>
<el-option
:label="item.titleZh"
:value="parseInt(item.id)"
v-for="item in productList"
:key="item.id"
/>
<el-select multiple filterable clearable v-model="queryParams.productIds" :placeholder="$t('请选择商品名称')">
<el-option :label="item.titleZh" :value="parseInt(item.id)" v-for="item in productList" :key="item.id" />
</el-select>
</el-form-item>
<el-form-item :label="$t('主要竞争对手')" v-show="showSearch">
<el-select
clearable
multiple
v-model="queryParams.competitorIds"
:placeholder="$t('请选择')"
@change="handleQuery"
>
<el-option
v-for="item in competitorList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
<el-select clearable multiple v-model="queryParams.competitorIds" :placeholder="$t('请选择')" @change="handleQuery">
<el-option v-for="item in competitorList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item :label="$t('年度发货次数')" v-show="showSearch">
<el-input
v-model.trim="numYearly.value"
:placeholder="$t('请输入数字')"
clearable
@keyup.enter.native="handleQuery"
@input="numYearly.value=numYearly.value.replace(/\s+/g, '')"
>
<el-input v-model.trim="numYearly.value" :placeholder="$t('请输入数字')" clearable @keyup.enter.native="handleQuery" @input="numYearly.value = numYearly.value.replace(/\s+/g, '')">
<template slot="prepend">
<dict-selector
:type="DICT_TYPE.CUSTOMER_QUERY_NUMBER_FIELD"
defaultable
v-model="numYearly.key"
class="w-50"
/>
<dict-selector :type="DICT_TYPE.CUSTOMER_QUERY_NUMBER_FIELD" defaultable v-model="numYearly.key" class="w-50" />
</template>
</el-input>
</el-form-item>
<el-form-item :label="$t('推介人')" v-show="showSearch">
<el-select
clearable
remote
:remote-method="remoteMethod"
v-model="queryParams.promoter"
:placeholder="$t('请输入推介人')"
filterable
>
<el-option
v-for="item in customerSelectFn"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
<el-select clearable remote :remote-method="remoteMethod" v-model="queryParams.promoter" :placeholder="$t('请输入推介人')" filterable>
<el-option v-for="item in customerSelectFn" :key="item.id" :label="item.name" :value="item.id"> </el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('入仓确认')" v-show="showSearch">
......@@ -336,119 +137,45 @@
<el-switch v-model="queryParams.isShowTidanPrice" />
</el-form-item>
<el-form-item :label="$t('归属时间')" v-show="showSearch">
<el-date-picker
type="datetimerange"
clearable
v-model="customerServiceConfirmedTime"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
:start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')"
/>
<el-date-picker type="datetimerange" clearable v-model="customerServiceConfirmedTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" />
</el-form-item>
<el-form-item :label="$t('首次成交时间')" v-show="showSearch">
<el-date-picker
type="datetimerange"
clearable
v-model="firstDealTime"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
:start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')"
/>
<el-date-picker type="datetimerange" clearable v-model="firstDealTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" />
</el-form-item>
<el-form-item :label="$t('获取方式')" v-show="showSearch">
<el-select
v-model="queryParams.getMethod"
multiple
:placeholder="$t('请选择')"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_GET_METHOD)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
<el-select v-model="queryParams.getMethod" multiple :placeholder="$t('请选择')">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_GET_METHOD)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
</el-select>
</el-form-item>
<el-form-item :label="$t('创建入口')" v-show="showSearch">
<el-select
v-model="queryParams.createFroms"
multiple
:placeholder="$t('请选择')"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_FROM)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
<el-select v-model="queryParams.createFroms" multiple :placeholder="$t('请选择')">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_FROM)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
</el-select>
</el-form-item>
<el-form-item :label="$t('结算方式')" v-show="showSearch">
<el-select
v-model="queryParams.balances"
multiple
:placeholder="$t('请选择结算方式')"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_BALANCE)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
<el-select v-model="queryParams.balances" multiple :placeholder="$t('请选择结算方式')">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_BALANCE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{
$t("搜索")
}}</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{
$t("重置")
}}</el-button>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{ $t("搜索") }}</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{ $t("重置") }}</el-button>
</el-form-item>
</el-form>
<!-- 操作工具栏 -->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['ecw:customer:my-create']"
>{{ $t("新增") }}</el-button
>
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['ecw:customer:my-create']">{{ $t("新增") }}</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['ecw:customer:my-export']"
>{{ $t("导出") }}</el-button
>
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading" v-hasPermi="['ecw:customer:my-export']">{{ $t("导出") }}</el-button>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table
ref="multipleTable"
v-loading="loading"
:data="list"
@selection-change="handleSelectionChange"
>
<el-table ref="multipleTable" v-loading="loading" :data="list" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" fixed></el-table-column>
<el-table-column :label="$t('客户编号')" align="center" fixed>
<template v-slot="{ row }">
......@@ -489,16 +216,10 @@
-->
<el-table-column :label="$t('客户状态')" align="center" prop="status">
<template slot-scope="scope">
<dict-tag
:type="DICT_TYPE.CUSTOMER_STATUS"
:value="scope.row.status"
/>
<dict-tag :type="DICT_TYPE.CUSTOMER_STATUS" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column
:label="$t('主联系人')"
prop="defaultContactName"
></el-table-column>
<el-table-column :label="$t('主联系人')" prop="defaultContactName"></el-table-column>
<el-table-column :label="$t('主联系方式')" prop="defaultContactPhone">
<template v-slot="{ row }">
+{{ row.defaultContactPhone }} <br />
......@@ -508,20 +229,29 @@
</template>
</el-table-column>
<el-table-column :label="$t('客户类别')" align="center" prop="status">
<template slot-scope="scope">
<dict-tag
:type="DICT_TYPE.CUSTOMER_TYPE"
:value="scope.row.type"
/>
<template slot-scope="{ row }">
{{
getDictDatas2(DICT_TYPE.CUSTOMER_TYPE, (row.type || "").split(","))
.map((e) => (isChinese ? e.label : e.labelEn))
.join(", ")
}}
<!-- <dict-tag-->
<!-- :type="DICT_TYPE.CUSTOMER_TYPE"-->
<!-- :value="scope.row.type"-->
<!-- />-->
</template>
</el-table-column>
<el-table-column :label="$t('角色')" align="center" prop="status">
<template slot-scope="{ row }">
{{ getDictDatas2(DICT_TYPE.CUSTOMER_ROLE, (row.roles||'').split(',')).map(e => isChinese ? e.label : e.labelEn).join(', ')}}
<!-- <dict-tag-->
<!-- :type="DICT_TYPE.CUSTOMER_ROLE"-->
<!-- :value="scope.row.roles"-->
<!-- />-->
{{
getDictDatas2(DICT_TYPE.CUSTOMER_ROLE, (row.roles || "").split(","))
.map((e) => (isChinese ? e.label : e.labelEn))
.join(", ")
}}
<!-- <dict-tag-->
<!-- :type="DICT_TYPE.CUSTOMER_ROLE"-->
<!-- :value="scope.row.roles"-->
<!-- />-->
</template>
</el-table-column>
<el-table-column :label="$t('客户经理')" align="center" prop="customerServiceName"></el-table-column>
......@@ -533,10 +263,7 @@
</el-table-column>
<el-table-column :label="$t('客户来源')">
<template slot-scope="scope">
<dict-tag
:type="DICT_TYPE.CUSTOMER_SOURCE"
:value="scope.row.source"
/>
<dict-tag :type="DICT_TYPE.CUSTOMER_SOURCE" :value="scope.row.source" />
</template>
</el-table-column>
<el-table-column :label="$t('业务国家')">
......@@ -559,8 +286,7 @@
{{ getProductTypeNames(row.productType) }}
</template>
</el-table-column>
<el-table-column :label="$t('主要竞争对手')" prop="competitorNames">
</el-table-column>
<el-table-column :label="$t('主要竞争对手')" prop="competitorNames"> </el-table-column>
<el-table-column :label="$t('年度发货次数')" align="center">
<template slot-scope="{ row }">
{{ row.numYearly }}
......@@ -573,13 +299,13 @@
</el-table-column>
<el-table-column :label="$t('入公海时间')" align="center" width="160">
<template v-slot="{ row }">
{{ parseTime( row.enterOpenSeaTime ? row.enterOpenSeaTime : row.estimateEnterOpenSeaTime)}}
{{ parseTime(row.enterOpenSeaTime ? row.enterOpenSeaTime : row.estimateEnterOpenSeaTime) }}
</template>
</el-table-column>
<el-table-column :label="$t('入仓确认')" align="center">
<template slot-scope="scope">
<el-tag type="success" v-if="scope.row.arrivalConfirm == 1">{{ $t('') }}</el-tag>
<el-tag type="info" v-else>{{ $t('') }}</el-tag>
<el-tag type="success" v-if="scope.row.arrivalConfirm == 1">{{ $t("") }}</el-tag>
<el-tag type="info" v-else>{{ $t("") }}</el-tag>
</template>
</el-table-column>
<el-table-column :label="$t('控货无收货人')" align="center">
......@@ -604,14 +330,10 @@
</el-table-column>
<el-table-column :label="$t('获取方式')" align="center">
<template slot-scope="scope">
<dict-tag
:type="DICT_TYPE.CUSTOMER_GET_METHOD"
:value="scope.row.getMethod"
/>
<dict-tag :type="DICT_TYPE.CUSTOMER_GET_METHOD" :value="scope.row.getMethod" />
</template>
</el-table-column>
<el-table-column :label="$t('创建人')" prop="createUsername" align="center">
</el-table-column>
<el-table-column :label="$t('创建人')" prop="createUsername" align="center"> </el-table-column>
<el-table-column :label="$t('创建时间')" align="center" width="160">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
......@@ -619,143 +341,52 @@
</el-table-column>
<el-table-column :label="$t('最后更新时间')" align="center" width="160">
<template slot-scope="scope">
<span >{{ parseTime(scope.row.updateTime) }}</span>
<span>{{ parseTime(scope.row.updateTime) }}</span>
</template>
</el-table-column>
<el-table-column
width="200px"
:label="$t('操作')"
align="center"
fixed="right"
class-name="small-padding fixed-width"
>
<el-table-column width="200px" :label="$t('操作')" align="center" fixed="right" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row)"
v-hasPermi="['ecw:customer:my-query']"
>{{ $t("查看") }}</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['ecw:customer:my-update']"
>{{ $t("修改") }}</el-button
>
<el-button
size="mini"
v-hasPermi="['ecw:customer:my-follow-up']"
type="text"
icon="el-icon-collection"
@click="followUp(scope.row)"
>{{ $t("跟进") }}</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-user"
v-hasPermi="['ecw:customer:my-customer-complaint']"
@click="complaint(scope.row)"
>{{ $t("客诉") }}</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['ecw:customer:my-delete']"
>{{ $t("删除") }}</el-button
>
<el-button
v-has-permi="['ecw:customer:my-postpone']"
:disabled="scope.row.isInOpenSea"
size="mini"
type="text"
icon="el-icon-user"
@click="delay(scope.row)"
>{{ $t("延期") }}</el-button
>
<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)" v-hasPermi="['ecw:customer:my-query']">{{ $t("查看") }}</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['ecw:customer:my-update']">{{ $t("修改") }}</el-button>
<el-button size="mini" v-has-permi="['ecw:customer:my-follow-up']" type="text" icon="el-icon-collection" @click="followUp(scope.row)">{{ $t("跟进") }}</el-button>
<el-button size="mini" type="text" icon="el-icon-user" v-hasPermi="['ecw:customer:my-customer-complaint']" @click="complaint(scope.row)">{{ $t("客诉") }}</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['ecw:customer:my-delete']">{{ $t("删除") }}</el-button>
<el-button v-has-permi="['ecw:customer:my-postpone']" :disabled="scope.row.isInOpenSea" size="mini" type="text" icon="el-icon-user" @click="delay(scope.row)">{{ $t("延期") }}</el-button>
<!--lanbm 2024-05-26 添加的报价功能按钮,取消了权限控制-->
<el-button
size="mini"
type="text"
icon="el-icon-user"
@click="quote(scope.row)"
>{{ $t("报价") }}</el-button
>
<el-button
v-has-permi="['ecw:customer:setting']"
size="mini"
type="text"
icon="el-icon-user"
@click="handleSetting(scope.row)"
>{{ $t("设置") }}</el-button
>
<el-button size="mini" type="text" icon="el-icon-user" @click="quote(scope.row)">{{ $t("报价") }}</el-button>
<el-button v-has-permi="['ecw:customer:setting']" size="mini" type="text" icon="el-icon-user" @click="handleSetting(scope.row)">{{ $t("设置") }}</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<customer-follow-list
ref="customerFollowList"
:customer-id="customerId"
:id="customerId"
:customer-service="customerService"
v-if="customerFollowVisible"
></customer-follow-list>
<customer-complaints
ref="customerComplaint"
:customer-id.sync="customerId"
></customer-complaints>
<transfer-customer
:show.sync="show"
:customer-ids.sync="selectCustomerList"
></transfer-customer>
<customer-setting
ref="customerSetting"
@refresh="getList"
></customer-setting>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" @pagination="getList" />
<customer-follow-list :customer-id="customerId" :id="customerId" :customer-service="customerService" :customer-number="customerNumber" ref="CustomerFollowList" v-if="customerFollowVisible"></customer-follow-list>
<customer-complaints ref="customerComplaint" :customer-id.sync="customerId"></customer-complaints>
<transfer-customer :show.sync="show" :customer-ids.sync="selectCustomerList"></transfer-customer>
<customer-setting ref="customerSetting" @refresh="getList"></customer-setting>
</div>
</template>
<script>
import {
createCustomer,
updateCustomer,
deleteCustomer,
getMyCustomerService,
mineExporteExcel,
mineExportExcel,
competitorListAll
} from "@/api/ecw/customer";
import { getDictDatas, DICT_TYPE, getDictDatas2 } from "@/utils/dict";
import upload from "@/components/ImageUpload";
import customerFollowList from "../customer/components/customerFollow";
import customerComplaints from "@/components/customerComplaints";
import { listServiceUser, getUserProfile, listAllSimpl} from "@/api/system/user";
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 Contacts from "@/views/ecw/customer/components/contacts.vue";
import CustomerSetting from "../customer/components/customerSetting.vue";
import AreaCodeSelector from "@/components/AreaCodeSelector/index.vue";
import { getNodeList } from "@/api/ecw/node";
import { getCustomerSelect, changeCustomerDefaultPay, changeCustomerNoConsignee, changeCustomerDefaultBilling } from "@/api/ecw/customer";
import { getProductTypeList } from "@/api/ecw/productType";
import { getProductList } from "@/api/ecw/product";
import { createCustomer, updateCustomer, deleteCustomer, getMyCustomerService, mineExporteExcel, mineExportExcel, competitorListAll } from "@/api/ecw/customer"
import { getDictDatas, DICT_TYPE, getDictDatas2 } from "@/utils/dict"
import upload from "@/components/ImageUpload"
import customerFollowList from "../customer/components/customerFollow"
import customerComplaints from "@/components/customerComplaints"
import { listServiceUser, getUserProfile, listAllSimpl } from "@/api/system/user"
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 Contacts from "@/views/ecw/customer/components/contacts.vue"
import CustomerSetting from "../customer/components/customerSetting.vue"
import AreaCodeSelector from "@/components/AreaCodeSelector/index.vue"
import { getNodeList } from "@/api/ecw/node"
import { getCustomerSelect, changeCustomerDefaultPay, changeCustomerNoConsignee, changeCustomerDefaultBilling } from "@/api/ecw/customer"
import { getProductTypeList } from "@/api/ecw/productType"
import { getProductList } from "@/api/ecw/product"
export default {
name: "EcwMycustomerserviceIndex",
name: "EcwMyCustomerServiceIndex",
components: {
Contacts,
Template,
......@@ -768,7 +399,7 @@ export default {
},
computed: {
isChinese() {
return this.$i18n.locale === "zh_CN";
return this.$i18n.locale === "zh_CN"
},
channel() {
return (val) => {
......@@ -777,20 +408,18 @@ export default {
.filter((i) => (val.split(",") || []).includes(i.value))
.map((i) => (this.isChinese ? i.label : i.labelEn))
.join("")
: "";
};
: ""
}
},
customerSelectFn() {
if (this.recommended.length > 0) {
let i = this.customerSelect.find(
(item) => item.id === this.recommended[0].id
);
let i = this.customerSelect.find((item) => item.id === this.recommended[0].id)
if (!i) {
this.customerSelect.push(this.recommended[0]);
this.customerSelect.push(this.recommended[0])
}
return this.customerSelect;
return this.customerSelect
} else {
return this.customerSelect;
return this.customerSelect
}
},
combinedQueryParams() {
......@@ -812,26 +441,26 @@ export default {
queryParams.endFirstDealTime = this.firstDealTime[1]
}
if (this.weightYearly.value) {
let key = 'eqWeightYearly'
if (this.weightYearly.key == 'leNumberKey') {
key = 'leWeightYearly'
} else if (this.weightYearly.key == 'geNumberKey') {
key = 'geWeightYearly'
let key = "eqWeightYearly"
if (this.weightYearly.key == "leNumberKey") {
key = "leWeightYearly"
} else if (this.weightYearly.key == "geNumberKey") {
key = "geWeightYearly"
}
queryParams[key] = this.weightYearly.value;
queryParams[key] = this.weightYearly.value
}
if (this.numYearly.value) {
let key = 'eqNumYearly'
if (this.numYearly.key == 'leNumberKey') {
key = 'leNumYearly'
} else if (this.numYearly.key == 'geNumberKey') {
key = 'geNumYearly'
let key = "eqNumYearly"
if (this.numYearly.key == "leNumberKey") {
key = "leNumYearly"
} else if (this.numYearly.key == "geNumberKey") {
key = "geNumYearly"
}
queryParams[key] = this.numYearly.value;
queryParams[key] = this.numYearly.value
}
return queryParams;
},
return queryParams
}
},
data() {
return {
......@@ -860,7 +489,7 @@ export default {
// 查询参数
queryParams: {
pageNo: 1,
pageSize: 10,
pageSize: 10
/*number: null,
name: null,
level: null,
......@@ -884,48 +513,46 @@ export default {
{
required: true,
message: this.$t("客户名称不能为空"),
trigger: "blur",
},
],
country: [
{ required: true, message: this.$t("国家不能为空"), trigger: "blur" },
trigger: "blur"
}
],
country: [{ required: true, message: this.$t("国家不能为空"), trigger: "blur" }],
level: [
{
required: true,
message: this.$t("客户等级不能为空"),
trigger: "blur",
},
trigger: "blur"
}
],
type: [
{
required: true,
message: this.$t("客户类别不能为空"),
trigger: "blur",
},
trigger: "blur"
}
],
// createTime: [{ required: true, message: this.$t("创建时间不能为空"), trigger: "blur" }],
source: [
{
required: true,
message: this.$t("客户来源不能为空"),
trigger: "blur",
},
trigger: "blur"
}
],
status: [
{
required: true,
message: this.$t("客户状态不能为空"),
trigger: "blur",
},
trigger: "blur"
}
],
founder: [
{
required: true,
message: this.$t("创建人不能为空"),
trigger: "blur",
},
],
trigger: "blur"
}
]
},
// 网点
nodeList: [],
......@@ -933,7 +560,7 @@ export default {
customerId: undefined,
selectCustomerList: [],
//lanbm 2024-05-26 添加参数
userId:undefined,
userId: undefined,
customerService: undefined,
customerNumber: undefined,
customerFollowVisible: false,
......@@ -946,52 +573,52 @@ export default {
allSimplList: [],
weightYearly: {
key: "eqNumberKey",
value: "",
value: ""
},
numYearly: {
key: "eqNumberKey",
value: "",
value: ""
},
productTypeList: [],
productList: [],
competitorList: [],
deptList: [],
};
deptList: []
}
},
activated() {
this.getList();
this.getList()
},
created() {
this.getList();
this.getList()
// getNodeList().then(r => {
// this.nodeList = r.data
// })
getCreditPage({ page: 1, rows: 999 }).then((r) => {
this.creditList = r.data.list;
});
this.creditList = r.data.list
})
listServiceUser().then((r) => {
this.customerServiceList = r.data;
});
this.customerServiceList = r.data
})
getCountryListAll().then((r) => {
this.countryList = r.data;
});
this.countryList = r.data
})
//获取用户id信息 lanbm 2024-05-23 add
getUserProfile().then((res) => {
this.userId = res.data.id;
});
this.getCustomerSelect();
this.userId = res.data.id
})
this.getCustomerSelect()
getNodeList().then((r) => {
this.getNodeLists = r.data;
});
this.getNodeLists = r.data
})
listAllSimpl().then((r) => {
this.allSimplList = r.data;
});
this.allSimplList = r.data
})
getProductTypeList().then((r) => {
this.productTypeList = r.data;
});
this.productTypeList = r.data
})
competitorListAll().then((r) => {
this.competitorList = r.data;
this.competitorList = r.data
})
},
updated() {
......@@ -1001,49 +628,42 @@ export default {
},
methods: {
handleSelectionChange(val) {
this.selectCustomerList = val.map((i) => i.id);
this.selectCustomerList = val.map((i) => i.id)
},
delay(row) {
this.$router.push({ path: "/customer/delay", query: { id: row.id } });
this.$router.push({ path: "/customer/delay", query: { id: row.id } })
},
countryFormatter(row, column, cellValue) {
const country = this.countryList.find((e) => e.id === cellValue);
return this.isChinese ? country?.nameZh : country?.nameEn;
const country = this.countryList.find((e) => e.id === cellValue)
return this.isChinese ? country?.nameZh : country?.nameEn
},
/** 查询列表 */
getList() {
this.loading = true;
this.loading = true
// 处理查询参数
let params = { ...this.queryParams, ...this.combinedQueryParams };
this.addBeginAndEndTime(
params,
this.dateRangeCreateTime,
"createTime",
false
);
let params = { ...this.queryParams, ...this.combinedQueryParams }
this.addBeginAndEndTime(params, this.dateRangeCreateTime, "createTime", false)
// 执行查询
getMyCustomerService(params).then((response) => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
this.list = response.data.list
this.total = response.data.total
this.loading = false
})
},
remoteMethod(val) {
this.getCustomerSelect(val);
this.getCustomerSelect(val)
},
getCustomerSelect(val = "") {
getCustomerSelect({ pageNo: 1, pageSize: 30, searchKey: val }).then(
(res) => {
this.customerSelect = res.data.list;
}
);
getCustomerSelect({ pageNo: 1, pageSize: 30, searchKey: val }).then((res) => {
this.customerSelect = res.data.list
})
},
handleSelectProductType(val) {
if (val && val.length >= 1) {
this.queryParams.productIds = []
getProductList({ typeIds: val }).then((r) => {
this.productList = r.data
});
})
} else {
this.queryParams.productIds = []
this.productList = []
......@@ -1051,8 +671,8 @@ export default {
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
this.open = false
this.reset()
},
/** 表单重置 */
reset() {
......@@ -1091,47 +711,47 @@ export default {
taxRate: undefined,
remarks: undefined,
arrivalConfirm: undefined,
weightUnit: undefined,
};
this.resetForm("form");
weightUnit: undefined
}
this.resetForm("form")
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
this.queryParams.pageNo = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.dateRangeCreateTime = [];
this.dateRangeCreateTime = []
this.enterOpenSeaTime = []
this.customerServiceConfirmedTime = []
this.firstDealTime = []
this.resetForm("queryForm");
this.resetForm("queryForm")
this.queryParams = {
pageNo: 1,
pageSize: 10,
};
this.weightYearly.value = "";
this.numYearly.value = "";
this.handleQuery();
pageSize: 10
}
this.weightYearly.value = ""
this.numYearly.value = ""
this.handleQuery()
},
/** 新增按钮操作 */
handleAdd() {
this.$router.push({
path: "/customer/add-edit/0",
query: { isCustomerServiceConfirmed: true },
});
query: { isCustomerServiceConfirmed: true }
})
// this.reset();
// this.open = true;
// this.title = this.$t("添加客户");
},
/** 查看按钮操作 */
handleView(row) {
this.$router.push("/customer/query/" + row.id);
this.$router.push("/customer/query/" + row.id)
},
/** 修改按钮操作 */
handleUpdate(row) {
this.$router.push("/customer/add-edit/" + row.id);
this.$router.push("/customer/add-edit/" + row.id)
// this.reset();
// const id = row.id;
// getCustomer(id).then(response => {
......@@ -1145,23 +765,22 @@ export default {
//lanbm 2024-05-26 添加的报价功能按钮
// 添加报价是判断客户所属客户经理,不是就不能报价
if (row.customerService != this.userId) {
this.$message.error(this.$t("此客户属于其他客户经理名下的客户。"));
return;
this.$message.error(this.$t("此客户属于其他客户经理名下的客户。"))
return
}
//this.$router.push({path:'/offer/create',query:{id:row.id}})
this.$router
.push({ path: "/offer/create", query: { customer: row, type: 1 } })
.then({
//this.$refs.push({path:'/customer-contacts/select',query:{pageNo:1,pageSize:10,searchKey:row.defaultContactPhone}})
});
this.$router.push({ path: "/offer/create", query: { customerId: row.id, customerType: row.type, type: 1 } }).then({
//this.$refs.push({path:'/customer-contacts/select',query:{pageNo:1,pageSize:10,searchKey:row.defaultContactPhone}})
})
},
selectAuthorityFn() {
return (val) => {
let t = val.split(":");
t[t.length - 1] = this.authorityFn + t[t.length - 1];
let t = val.split(":")
t[t.length - 1] = this.authorityFn + t[t.length - 1]
//console.log(t.join(":"));
return t.join(":");
};
return t.join(":")
}
},
/** 提交按钮 */
submitForm() {
......@@ -1172,37 +791,33 @@ export default {
// 修改的提交
if (this.form.id != null) {
updateCustomer(this.form).then((response) => {
this.$modal.msgSuccess(this.$t("修改成功"));
this.open = false;
this.getList();
});
return;
this.$modal.msgSuccess(this.$t("修改成功"))
this.open = false
this.getList()
})
return
}
// 添加的提交
createCustomer(this.form).then((response) => {
this.$modal.msgSuccess(this.$t("新增成功"));
this.open = false;
this.getList();
});
});
this.$modal.msgSuccess(this.$t("新增成功"))
this.open = false
this.getList()
})
})
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
const id = row.id
this.$modal
.confirm(
this.$t('是否确认删除客户编号为"') +
row.number +
this.$t('"的数据项?')
)
.confirm(this.$t('是否确认删除客户编号为"') + row.number + this.$t('"的数据项?'))
.then(function () {
return deleteCustomer(id);
return deleteCustomer(id)
})
.then(() => {
this.getList();
this.$modal.msgSuccess(this.$t("删除成功"));
this.getList()
this.$modal.msgSuccess(this.$t("删除成功"))
})
.catch(() => {});
.catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
......@@ -1216,82 +831,80 @@ export default {
.confirm(this.$t("是否确认导出我的客户数据项?"))
.then(() => {
mineExportExcel().then(() => {
this.$message.success(
this.$t("已加入导出队列,请稍后在下载日志中下载")
);
});
this.$message.success(this.$t("已加入导出队列,请稍后在下载日志中下载"))
})
})
.catch(() => {});
.catch(() => {})
},
followUp(row) {
this.customerId = row.id;
// this.$refs["customerFollowList"].customerFollow.dialogVisible = true;
this.customerService = row.customerService;
this.customerNumber = row.number;
this.customerId = row.id
this.customerService = row.customerService
this.customerNumber = row.number
this.customerFollowVisible = true
this.$nextTick(_ => {
this.$refs['customerFollowList'].init()
this.$refs['customerFollowList'].handleAdd()
this.$nextTick((_) => {
// this.$refs.CustomerFollowList.customerFollow.dialogVisible = true;
this.$refs["CustomerFollowList"].init()
this.$refs["CustomerFollowList"].handleAdd()
})
},
complaint(row) {
this.customerId = row.id;
this.customerId = row.id
this.$nextTick(() => {
this.$refs["customerComplaint"].handleAdd();
});
this.$refs["customerComplaint"].handleAdd()
})
},
handleSetting(row) {
this.$refs['customerSetting'].dialogVisible = true
this.$nextTick(_ => {
this.$refs['customerSetting'].init(row.id)
this.$refs["customerSetting"].dialogVisible = true
this.$nextTick((_) => {
this.$refs["customerSetting"].init(row.id)
})
},
getBusiCountryNames(ids) {
if (ids) {
const idsArr = ids.split(',')
const idsArr = ids.split(",")
const strArr = []
this.countryList.forEach(item => {
this.countryList.forEach((item) => {
if (idsArr.includes(item.id.toString())) {
strArr.push(this.isChinese ? item.nameZh : item.nameEn)
}
})
return strArr.length > 0 ? strArr.join(',') : null
return strArr.length > 0 ? strArr.join(",") : null
} else {
return null
}
},
getPickupPointNames(ids) {
if (ids) {
const idsArr = ids.split(',')
const idsArr = ids.split(",")
const strArr = []
this.getNodeLists.forEach(item => {
this.getNodeLists.forEach((item) => {
if (idsArr.includes(item.id.toString())) {
strArr.push(this.isChinese ? item.titleZh : item.titleEn)
}
})
return strArr.length > 0 ? strArr.join(',') : null
return strArr.length > 0 ? strArr.join(",") : null
} else {
return null
}
},
getProductTypeNames(ids) {
if (ids) {
const idsArr = ids.toString().split(',')
const idsArr = ids.toString().split(",")
const strArr = []
this.productTypeList.forEach(item => {
this.productTypeList.forEach((item) => {
if (idsArr.includes(item.id.toString())) {
strArr.push(this.isChinese ? item.titleZh : item.titleEn)
}
})
return strArr.length > 0 ? strArr.join(',') : null
return strArr.length > 0 ? strArr.join(",") : null
} else {
return null
}
},
getPromoterName(id) {
if (id) {
let strName = ''
for(const item of this.customerSelectFn) {
let strName = ""
for (const item of this.customerSelectFn) {
if (item.id == id) {
strName = item.name
break
......@@ -1306,10 +919,10 @@ export default {
watch: {
selectCustomerList(val) {
if (val.length === 0) {
this.getList();
this.$refs.multipleTable.clearSelection();
this.getList()
this.$refs.multipleTable.clearSelection()
}
},
},
};
}
}
}
</script>
......@@ -503,11 +503,12 @@
</template>
</el-table-column>
<el-table-column :label="$t('客户类别')" align="center" prop="status">
<template slot-scope="scope">
<dict-tag
:type="DICT_TYPE.CUSTOMER_TYPE"
:value="scope.row.type"
/>
<template slot-scope="{ row }">
{{ getDictDatas2(DICT_TYPE.CUSTOMER_TYPE, (row.type||'').split(',')).map(e => isChinese ? e.label : e.labelEn).join(', ')}}
<!-- <dict-tag-->
<!-- :type="DICT_TYPE.CUSTOMER_TYPE"-->
<!-- :value="scope.row.type"-->
<!-- />-->
</template>
</el-table-column>
<el-table-column :label="$t('角色')" align="center" prop="status">
......
<template>
<div class="app-container">
<el-form
ref="form"
:model="form"
:rules="rules"
label-width="120px"
inline
:validate-on-rule-change="false"
>
<el-form ref="form" :model="form" :rules="rules" label-width="120px" inline :validate-on-rule-change="false">
<el-card>
<div slot="header" class="card-title">
{{
$route.path.indexOf("create") > -1
? $t("新建报价单")
: $t("编辑报价单")
}}
{{ $route.path.indexOf("create") > -1 ? $t("新建报价单") : $t("编辑报价单") }}
</div>
<el-form-item :label="$t('所属人')" prop="relation">
<!-- <el-radio-group v-model="form.relation" > -->
......@@ -26,59 +15,28 @@
<div class="form-section">
<el-form-item :label="$t('发货人')" prop="consignorId">
<div class="contact">
<el-input
v-model="form.consignorName"
id="defaultContactName"
:placeholder="$t('选择或新建')"
disabled
style="width: 120px"
/>
<el-input v-model="form.consignorName" id="defaultContactName" :placeholder="$t('选择或新建')" disabled style="width: 120px" />
<img
src="@/assets/svg/contacts.svg"
class="phonebook"
@click="contactChooseType = 'consignor'"
/>
<img
src="@/assets/svg/contact_create.svg"
class="phonebook"
@click="quickCreateType = '0'"
/>
<img src="@/assets/svg/contacts.svg" class="phonebook" @click="contactChooseType = 'consignor'" />
<img src="@/assets/svg/contact_create.svg" class="phonebook" @click="quickCreateType = '0'" />
</div>
</el-form-item>
<el-form-item :label="$t('发货人电话')" prop="consignorPhone">
<!-- <area-code-selector v-model="form.consignorCountryCode" class="w-200 mr-10" disabled /> -->
<el-input
id="defaultContactPhone"
:value="`${
form.consignorCountryCode ? '+' + form.consignorCountryCode : ''
} ${form.consignorPhone || ''}`"
class="w-200"
disabled
/>
<el-input id="defaultContactPhone" :value="`${form.consignorCountryCode ? '+' + form.consignorCountryCode : ''} ${form.consignorPhone || ''}`" class="w-200" disabled />
<!-- <el-input v-if="$route.query.type==1 && form.relation==1" v-model="$route.query.customer.defaultContactPhone" class="w-200" disabled/>
<el-input v-else :value="`${form.consignorCountryCode ? '+' + form.consignorCountryCode : ''} ${form.consignorPhone || ''}`" class="w-200" disabled/> -->
</el-form-item>
<el-form-item :label="$t('发货人公司')" prop="consignorCompany">
<!-- 修改从客户列表按钮进来的 -->
<el-input
v-model="form.consignorCompany"
id="company"
disabled
class="w-200"
/>
<el-input v-model="form.consignorCompany" id="company" disabled class="w-200" />
<!-- <el-input v-if="$route.query.type==1 && form.relation==1" v-model="$route.query.customer.company" disabled class="w-200"/>
<el-input v-else v-model="form.consignorCompany" disabled class="w-200"/> -->
</el-form-item>
<el-form-item label="Email" prop="consignorEmail">
<el-input
v-model="form.consignorEmail"
id="defaultEmail"
disabled
class="w-200"
/>
<el-input v-model="form.consignorEmail" id="defaultEmail" disabled class="w-200" />
<!-- <el-input v-if="$route.query.type==1 && form.relation==1" v-model="$route.query.customer.defaultEmail" disabled class="w-200"/>
<el-input v-else v-model="form.consigneeEmail" disabled class="w-200"/> -->
</el-form-item>
......@@ -87,54 +45,23 @@
<el-form-item :label="$t('收货人')" prop="consigneeId">
<div class="contact">
<!-- <el-input v-model="form.consigneeName" :placeholder="$t('请选择或新建')" :disabled="true" style="width:120px"/> -->
<el-input
v-model="form.consigneeName"
id="defaultContactName2"
:placeholder="$t('请选择或新建')"
:disabled="true"
style="width: 120px"
/>
<el-input v-model="form.consigneeName" id="defaultContactName2" :placeholder="$t('请选择或新建')" :disabled="true" style="width: 120px" />
<img
src="@/assets/svg/contacts.svg"
class="phonebook"
@click="contactChooseType = 'consignee'"
/>
<img
src="@/assets/svg/contact_create.svg"
class="phonebook"
@click="quickCreateType = '1'"
/>
<img src="@/assets/svg/contacts.svg" class="phonebook" @click="contactChooseType = 'consignee'" />
<img src="@/assets/svg/contact_create.svg" class="phonebook" @click="quickCreateType = '1'" />
</div>
</el-form-item>
<el-form-item :label="$t('收货人电话')" prop="consigneePhone">
<!-- <area-code-selector v-model="form.consigneeCountryCode" class="w-200 mr-10" disabled/> -->
<el-input
id="defaultContactPhone2"
:value="`${
form.consigneeCountryCode ? '+' + form.consigneeCountryCode : ''
} ${form.consigneePhone || ''}`"
disabled
class="w-200"
/>
<el-input id="defaultContactPhone2" :value="`${form.consigneeCountryCode ? '+' + form.consigneeCountryCode : ''} ${form.consigneePhone || ''}`" disabled class="w-200" />
</el-form-item>
<el-form-item :label="$t('收货人公司')" prop="consigneeCompany">
<el-input
id="company2"
v-model="form.consigneeCompany"
:disabled="true"
class="w-200"
/>
<el-input id="company2" v-model="form.consigneeCompany" :disabled="true" class="w-200" />
<!-- <el-input v-if="$route.query.type==1 && form.relation==2" v-model="$route.query.customer.company" disabled class="w-200"/>
<el-input v-else v-model="form.consignorCompany" disabled class="w-200"/> -->
</el-form-item>
<el-form-item label="Email" prop="consigneeEmail">
<el-input
id="defaultEmail2"
v-model="form.consigneeEmail"
:disabled="true"
class="w-200"
/>
<el-input id="defaultEmail2" v-model="form.consigneeEmail" :disabled="true" class="w-200" />
<!-- <el-input v-if="$route.query.type==1 && form.relation==2" v-model="$route.query.customer.defaultEmail" disabled class="w-200"/>
<el-input v-else v-model="form.consigneeEmail" disabled class="w-200"/> -->
</el-form-item>
......@@ -175,147 +102,58 @@
</el-descriptions> -->
</el-card>
<el-card class="mt-10">
<div slot="header" class="card-title">{{$t("运输")}}</div>
<div slot="header" class="card-title">{{ $t("运输") }}</div>
<div class="form-section">
<el-form-item :label="$t('运输方式')" prop="transportId">
<dict-selector
:type="DICT_TYPE.ECW_TRANSPORT_TYPE"
v-model="form.transportId"
class="w-200"
/>
<dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model="form.transportId" class="w-200" />
</el-form-item>
</div>
<div class="form-section">
<el-form-item :label="$t('始发城市')" prop="departureId">
<el-select
v-model="form.departureId"
:placeholder="$t('请选择始发地')"
class="w-200"
>
<el-option
v-for="item in exportCityList"
:label="$l(item, 'title')"
:value="item.id"
:key="item.id"
></el-option>
<el-select v-model="form.departureId" :placeholder="$t('请选择始发地')" class="w-200">
<el-option v-for="item in exportCityList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('目的国')" prop="destCountryId">
<el-select
v-model="form.destCountryId"
:placeholder="$t('请选择目的国')"
class="w-200"
>
<el-option
v-for="item in AddressProvince"
:key="item.guojia"
:label="item.guojiaName"
:value="item.guojia"
/>
<el-select v-model="form.destCountryId" :placeholder="$t('请选择目的国')" class="w-200">
<el-option v-for="item in AddressProvince" :key="item.guojia" :label="item.guojiaName" :value="item.guojia" />
</el-select>
</el-form-item>
<el-form-item :label="$t('目的城市')" prop="objectiveId">
<el-select
v-model="form.objectiveId"
:placeholder="$t('请选择目的地')"
class="w-200"
>
<el-option
v-for="item in AddressCity"
:key="item.shi"
:label="item.shiName"
:value="item.shi"
/>
<el-select v-model="form.objectiveId" :placeholder="$t('请选择目的地')" class="w-200">
<el-option v-for="item in AddressCity" :key="item.shi" :label="item.shiName" :value="item.shi" />
</el-select>
</el-form-item>
</div>
<div class="form-section">
<el-form-item :label="$t('选择线路')" prop="lineId">
<!-- <el-input :value="getRouterNameById(form.lineId)" readonly :placeholder="$t('请在右侧选择线路')"></el-input> -->
<el-input
:value="
selectedRouter
? $l(selectedRouter, 'startTitle') +
' > ' +
$l(selectedRouter, 'destTitle')
: ''
"
disabled
:placeholder="$t('请在右侧选择线路')"
class="w-200"
></el-input>
<el-input :value="selectedRouter ? $l(selectedRouter, 'startTitle') + ' > ' + $l(selectedRouter, 'destTitle') : ''" disabled :placeholder="$t('请在右侧选择线路')" class="w-200"></el-input>
</el-form-item>
<select
size="5"
v-model="form.lineId"
style="
min-width: 300px;
border: 1px solid #dcdfe6;
border-radius: 4px;
"
>
<select size="5" v-model="form.lineId" style="min-width: 300px; border: 1px solid #dcdfe6; border-radius: 4px">
<template v-for="item in routerList">
<option :value="item.id" :key="item.id">
{{ $l(item, "startTitle") }} >> {{ $l(item, "destTitle") }}
</option>
<option :value="item.id" :key="item.id">{{ $l(item, "startTitle") }} >> {{ $l(item, "destTitle") }}</option>
</template>
</select>
</div>
<div class="form-section">
<el-form-item
:label="$t('出货渠道')"
v-if="
getDictData(DICT_TYPE.ECW_TRANSPORT_TYPE, form.transportId)
.cssClass == 'channel'
"
prop="channelId"
>
<selector
:disabled="
getDictData(DICT_TYPE.ECW_TRANSPORT_TYPE, form.transportId)
.cssClass != 'channel'
"
v-model="form.channelId"
:options="channelList"
value-field="channelId"
:label-field="$l('name')"
class="w-200"
></selector>
<el-form-item :label="$t('出货渠道')" v-if="getDictData(DICT_TYPE.ECW_TRANSPORT_TYPE, form.transportId).cssClass == 'channel'" prop="channelId">
<selector :disabled="getDictData(DICT_TYPE.ECW_TRANSPORT_TYPE, form.transportId).cssClass != 'channel'" v-model="form.channelId" :options="channelList" value-field="channelId" :label-field="$l('name')" class="w-200"></selector>
</el-form-item>
</div>
<div class="form-section">
<el-form-item
:label="$t('增值服务')"
v-if="
routeOtherServices.indexOf('1') > -1 ||
routeOtherServices.indexOf('4') > -1
"
>
<el-checkbox-group v-model="form.type">
<el-checkbox
label="1"
v-if="routeOtherServices.indexOf('1') > -1"
>{{ $t("集运服务") }}</el-checkbox
>
<el-checkbox
label="2"
v-if="routeOtherServices.indexOf('4') > -1"
>{{ $t("海外仓") }}</el-checkbox
>
</el-checkbox-group>
</el-form-item>
<el-form-item :label="$t('增值服务')" v-if="routeOtherServices.indexOf('1') > -1 || routeOtherServices.indexOf('4') > -1">
<el-checkbox-group v-model="form.type">
<el-checkbox label="1" v-if="routeOtherServices.indexOf('1') > -1">{{ $t("集运服务") }}</el-checkbox>
<el-checkbox label="2" v-if="routeOtherServices.indexOf('4') > -1">{{ $t("海外仓") }}</el-checkbox>
</el-checkbox-group>
</el-form-item>
</div>
</el-card>
<el-card class="mt-10">
<div slot="header" class="card-title">
<div class="card-name">{{ $t("商品") }}</div>
<el-button
type="primary"
size="mini"
icon="el-icon-plus"
@click="addProduct()"
:disabled="!canAddProduct"
></el-button>
<el-button type="primary" size="mini" icon="el-icon-plus" @click="addProduct()" :disabled="!canAddProduct"></el-button>
</div>
<el-table :data="form.prodCreateReqVOList" border class="product-list">
<el-table-column :label="$t('序号')" width="60px" fixed>
......@@ -324,9 +162,7 @@
</template>
</el-table-column>
<el-table-column :label="$t('中文品名')" width="160px">
<template slot="header" slot-scope="scope">
{{ $t("中文品名") }} <span class="red">*</span>
</template>
<template slot="header" slot-scope="scope"> {{ $t("中文品名") }} <span class="red">*</span> </template>
<template slot-scope="scope">
<el-form-item
label=""
......@@ -334,35 +170,22 @@
:rules="{
required: true,
message: $t('请选择产品'),
trigger: 'blur',
trigger: 'blur'
}"
class="mb-0 mr-0"
>
<product-selector
v-model="scope.row.prodId"
@change="onProductChange(scope.row, $event)"
:disabled="!canAddProduct"
/>
<product-selector v-model="scope.row.prodId" @change="onProductChange(scope.row, $event)" :disabled="!canAddProduct" />
</el-form-item>
</template>
</el-table-column>
<el-table-column :label="$t('英文品名')" width="160px">
<template slot="header" slot-scope="scope">
{{ $t("英文品名") }} <span class="red">*</span>
</template>
<template slot="header" slot-scope="scope"> {{ $t("英文品名") }} <span class="red">*</span> </template>
<template slot-scope="{ row }">
<product-selector
lang="En"
v-model="row.prodId"
@change="onProductChange(row, $event)"
:disabled="!canAddProduct"
/>
<product-selector lang="En" v-model="row.prodId" @change="onProductChange(row, $event)" :disabled="!canAddProduct" />
</template>
</el-table-column>
<el-table-column width="100px">
<template slot="header" slot-scope="scope">
{{ $t("品牌") }} <span class="red">*</span>
</template>
<template slot="header" slot-scope="scope"> {{ $t("品牌") }} <span class="red">*</span> </template>
<template slot-scope="scope">
<el-form-item
label=""
......@@ -370,78 +193,44 @@
:rules="{
required: true,
message: $t('请选择品牌'),
trigger: 'blur',
trigger: 'blur'
}"
class="mb-0 mr-0"
>
<dict-selector
v-model="scope.row.brand"
:type="DICT_TYPE.ECW_IS_BRAND"
defaultable
@input="calculationPrice"
:disabled="!canAddProduct"
/>
<dict-selector v-model="scope.row.brand" :type="DICT_TYPE.ECW_IS_BRAND" defaultable @input="calculationPrice" :disabled="!canAddProduct" />
</el-form-item>
</template>
</el-table-column>
<el-table-column :label="$t('件数')" width="90px">
<template slot="header" slot-scope="scope">
{{ $t("件数") }} <span class="red">*</span>
</template>
<template slot="header" slot-scope="scope"> {{ $t("件数") }} <span class="red">*</span> </template>
<template slot-scope="{ row }">
<el-input
v-model.number="row.num"
@input="calculationPrice"
:disabled="!canAddProduct"
/>
<el-input v-model.number="row.num" @input="calculationPrice" :disabled="!canAddProduct" />
</template>
</el-table-column>
<el-table-column :label="$t('包装单位')" width="100px">
<template slot="header" slot-scope="scope">
{{ $t("包装单位") }} <span class="red">*</span>
</template>
<template slot="header" slot-scope="scope"> {{ $t("包装单位") }} <span class="red">*</span> </template>
<template slot-scope="{ row }">
<dict-selector
v-model="row.unit"
:type="DICT_TYPE.ECW_PACKAGING_TYPE"
defaultable
@input="calculationPrice"
:disabled="!canAddProduct"
/>
<dict-selector v-model="row.unit" :type="DICT_TYPE.ECW_PACKAGING_TYPE" defaultable @input="calculationPrice" :disabled="!canAddProduct" />
</template>
</el-table-column>
<el-table-column :label="$t('数量') + '(个)'">
<template slot-scope="{ row }">
<el-input
v-model="row.quantity"
@input="calculationPrice"
:disabled="!canAddProduct"
/>
<el-input v-model="row.quantity" @input="calculationPrice" :disabled="!canAddProduct" />
</template>
</el-table-column>
<el-table-column :label="$t('总体积') + '(m³)'" width="100px">
<template slot-scope="{ row }">
<el-input
v-model="row.volume"
@input="calculationPrice"
:disabled="!canAddProduct"
/>
<el-input v-model="row.volume" @input="calculationPrice" :disabled="!canAddProduct" />
</template>
</el-table-column>
<el-table-column :label="$t('总重量') + '(kg)'" width="100px">
<template slot-scope="{ row }">
<el-input
v-model="row.weight"
@input="calculationPrice"
:disabled="!canAddProduct"
/>
<el-input v-model="row.weight" @input="calculationPrice" :disabled="!canAddProduct" />
</template>
</el-table-column>
<el-table-column :label="$t('总货值') + '(RMB)'" width="120px">
<template slot="header" slot-scope="scope">
{{ $t("总货值") }}(RMB) <span class="red">*</span>
</template>
<template slot="header" slot-scope="scope"> {{ $t("总货值") }}(RMB) <span class="red">*</span> </template>
<template slot-scope="scope">
<el-form-item
label=""
......@@ -451,57 +240,34 @@
}"
class="mb-0 mr-0"
>
<el-input
v-model="scope.row.worth"
@input="calculationPrice"
:disabled="!canAddProduct"
/>
<el-input v-model="scope.row.worth" @input="calculationPrice" :disabled="!canAddProduct" />
</el-form-item>
</template>
</el-table-column>
<el-table-column :label="$t('商品特性')" width="250px">
<template slot-scope="{ row }">
<el-checkbox-group
v-model="row.prodAttrArr"
@change="onProductAttrChange(row, $event)"
:disabled="!canAddProduct"
>
<el-checkbox
v-for="item in productAttrList"
:label="item.id"
:key="item.id"
>{{ $l(item, "attrName") }}</el-checkbox
>
<el-checkbox-group v-model="row.prodAttrArr" @change="onProductAttrChange(row, $event)" :disabled="!canAddProduct">
<el-checkbox v-for="item in productAttrList" :label="item.id" :key="item.id">{{ $l(item, "attrName") }}</el-checkbox>
</el-checkbox-group>
</template>
</el-table-column>
<el-table-column :label="$t('运费')" width="200px">
<template slot-scope="{ row }">
<template v-if="row.fee && row.fee.charging == 1">
<template v-if="!row.fee.oneFreight">{{
$t("未报价")
}}</template>
<template v-if="!row.fee.oneFreight">{{ $t("未报价") }}</template>
<template v-else>
{{ $t("全包价") }}{{ row.fee.oneFreight }}
{{ currencyMap[row.fee.freightCurrency] }} /
{{ $t("全包价") }}{{ row.fee.oneFreight }} {{ currencyMap[row.fee.freightCurrency] }} /
{{ unitMap[row.fee.freightVolume] }}
</template>
</template>
<template
v-else-if="
!row.fee || (!row.fee.oneFreight && !row.fee.oneClearanceFee)
"
>{{ $t("未报价") }}</template
>
<template v-else-if="!row.fee || (!row.fee.oneFreight && !row.fee.oneClearanceFee)">{{ $t("未报价") }}</template>
<template v-else-if="row.fee">
<div>
{{ $t("运费") }}{{ row.fee.oneFreight }}
{{ currencyMap[row.fee.freightCurrency] }} /
{{ $t("运费") }}{{ row.fee.oneFreight }} {{ currencyMap[row.fee.freightCurrency] }} /
{{ unitMap[row.fee.freightVolume] }}
</div>
<div>
{{ $t("清关费") }}{{ row.fee.oneClearanceFee }}
{{ currencyMap[row.fee.clearanceFeeCurrency] }} /
{{ $t("清关费") }}{{ row.fee.oneClearanceFee }} {{ currencyMap[row.fee.clearanceFeeCurrency] }} /
{{ unitMap[row.fee.clearanceFeeVolume] }}
</div>
</template>
......@@ -509,49 +275,25 @@
</el-table-column>
<el-table-column :label="$t('是否预付')">
<template slot-scope="{ row }">
<dict-tag
v-if="row.fee"
:type="DICT_TYPE.ECW_PAY_ADVANCE"
:value="row.fee.isPayAdvance"
/>
<dict-tag v-if="row.fee" :type="DICT_TYPE.ECW_PAY_ADVANCE" :value="row.fee.isPayAdvance" />
</template>
</el-table-column>
<el-table-column :label="$t('商品链接')" width="200px" align="center">
<template slot-scope="{ row }">
<el-link
type="primary"
:href="row.link"
target="_blank"
style="display: block"
>{{ row.link }}</el-link
>
<el-button
type="primary"
size="mini"
@click="setLink(row)"
:disabled="!canAddProduct"
>
<el-link type="primary" :href="row.link" target="_blank" style="display: block">{{ row.link }}</el-link>
<el-button type="primary" size="mini" @click="setLink(row)" :disabled="!canAddProduct">
{{ row.link ? $t("编辑商品链接") : $t("添加商品链接") }}
</el-button>
</template>
</el-table-column>
<el-table-column :label="$t('快递单号')" width="100px">
<template slot-scope="{ row }">
<el-input
v-model="row.expressNo"
placeholder=""
:disabled="!canAddProduct"
/>
<el-input v-model="row.expressNo" placeholder="" :disabled="!canAddProduct" />
</template>
</el-table-column>
<el-table-column :label="$t('操作')" width="180px" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
type="danger"
@click="delProduct(scope.$index)"
>{{ $t("删除") }}</el-button
>
<el-button size="mini" type="danger" @click="delProduct(scope.$index)">{{ $t("删除") }}</el-button>
</template>
</el-table-column>
</el-table>
......@@ -563,19 +305,13 @@
<el-descriptions-item :label="$t('总件数')">
{{ sum.totalNum.toFixed() || 0 }}
</el-descriptions-item>
<el-descriptions-item :label="$t('总体积')">
{{ sum.totalVolume.toFixed() || 0 }}m³
</el-descriptions-item>
<el-descriptions-item :label="$t('总重量')">
{{ sum.totalWeight.toFixed() || 0 }}kg
</el-descriptions-item>
<el-descriptions-item :label="$t('总体积')"> {{ sum.totalVolume.toFixed() || 0 }}m³ </el-descriptions-item>
<el-descriptions-item :label="$t('总重量')"> {{ sum.totalWeight.toFixed() || 0 }}kg </el-descriptions-item>
<el-descriptions-item :label="$t('总数量')">
{{ sum.totalQuatity.toFixed() || 0 }}
</el-descriptions-item>
<el-descriptions-item :label="$t('总货值') + '(RMB)'">
{{ sum.totalWorth.toFixed() || 0 }}{{ $t("元") }}
</el-descriptions-item>
<el-descriptions-item :label="$t('总货值') + '(RMB)'"> {{ sum.totalWorth.toFixed() || 0 }}{{ $t("元") }} </el-descriptions-item>
</el-descriptions>
</el-card>
......@@ -585,47 +321,26 @@
<el-descriptions :column="5" border>
<el-descriptions-item :label="$t('保价费')">
{{ fee.insuranceFee || 0 }}
{{
selectedRouter
? currencyMap[selectedRouter.currencyUnit || 1]
: ""
}}
{{ selectedRouter ? currencyMap[selectedRouter.currencyUnit || 1] : "" }}
</el-descriptions-item>
<el-descriptions-item :label="$t('总运费')">
<template v-for="item in freightFeeList">
<div :key="item.currencyId">
{{ item.amount || 0 }}{{ currencyMap[item.currencyId] }}
</div>
<div :key="item.currencyId">{{ item.amount || 0 }}{{ currencyMap[item.currencyId] }}</div>
</template>
</el-descriptions-item>
<!--代收货款,只有非控货订单、并且线路开通了代收货款后,才显示是否代收货款选项-->
<el-descriptions-item :label="$t('总清关费')">
<template v-for="item in clearanceFeeList">
<div :key="item.currencyId">
{{ item.amount || 0 }}{{ currencyMap[item.currencyId] }}
</div>
<div :key="item.currencyId">{{ item.amount || 0 }}{{ currencyMap[item.currencyId] }}</div>
</template>
</el-descriptions-item>
<el-descriptions-item :label="$t('其他费用')">
<el-input
v-model="form.otherFee"
placeholder=""
class="w-100 mr-10"
></el-input>
<selector
v-model="form.otherFeeCurrencyId"
:options="currencyList"
:label-field="$l('title')"
value-field="id"
defaultable
class="w-100"
/>
<el-input v-model="form.otherFee" placeholder="" class="w-100 mr-10"></el-input>
<selector v-model="form.otherFeeCurrencyId" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable class="w-100" />
</el-descriptions-item>
<el-descriptions-item :label="$t('原价')" :span="2">
<template v-for="item in originalFeeList">
<div :key="item.currencyId">
{{ item.amount || 0 }}{{ currencyMap[item.currencyId] }}
</div>
<div :key="item.currencyId">{{ item.amount || 0 }}{{ currencyMap[item.currencyId] }}</div>
</template>
</el-descriptions-item>
</el-descriptions>
......@@ -633,11 +348,7 @@
<div class="card-title" style="padding: 20px 0">
{{ $t("优惠信息") }}
</div>
<el-table
:data="couponList"
:show-header="false"
:empty-text="$t('暂无优惠')"
>
<el-table :data="couponList" :show-header="false" :empty-text="$t('暂无优惠')">
<el-table-column label="">
<template slot-scope="scope">
{{ scope.$index + 1 }}.
......@@ -661,32 +372,18 @@
</template>
</el-table-column>
<el-table-column label="">
<template slot-scope="{ row }">
{{ $t("有效期至") }}{{
row.endTime ? row.endTime : $t("永久有效")
}}
</template>
<template slot-scope="{ row }"> {{ $t("有效期至") }}{{ row.endTime ? row.endTime : $t("永久有效") }} </template>
</el-table-column>
</el-table>
<el-descriptions :column="1" class="mt-20">
<el-descriptions-item
:label="$t('优惠费用')"
v-if="couponTotalAmountList && couponTotalAmountList.length"
>
<div
v-for="(item, discountIndex) in couponTotalAmountList"
:key="discountIndex"
>
{{ item.totalAmount }} {{ currencyMap[item.currencyId] }}
</div>
<el-descriptions-item :label="$t('优惠费用')" v-if="couponTotalAmountList && couponTotalAmountList.length">
<div v-for="(item, discountIndex) in couponTotalAmountList" :key="discountIndex">{{ item.totalAmount }} {{ currencyMap[item.currencyId] }}</div>
</el-descriptions-item>
<el-descriptions-item :label="$t('预计费用')" :span="1">
<div>
<template v-for="item in estimatedCosts">
<div :key="item.currencyId">
{{ item.amount || 0 }}{{ currencyMap[item.currencyId] }}
</div>
<div :key="item.currencyId">{{ item.amount || 0 }}{{ currencyMap[item.currencyId] }}</div>
</template>
</div>
</el-descriptions-item>
......@@ -697,54 +394,25 @@
<div class="card-title" slot="header">{{ $t("通用") }}</div>
<div class="form-section">
<el-form-item :label="$t('唛头')" prop="marks">
<el-input
v-model="form.marks"
placeholder=""
class="w-200"
></el-input>
<el-input v-model="form.marks" placeholder="" class="w-200"></el-input>
</el-form-item>
<el-form-item :label="$t('报关方式')" prop="customsType">
<dict-selector
:type="DICT_TYPE.ECW_CUSTOMS_TYPE"
v-model="form.customsType"
form-type="radio"
defaultable
/>
<dict-selector :type="DICT_TYPE.ECW_CUSTOMS_TYPE" v-model="form.customsType" form-type="radio" defaultable />
</el-form-item>
</div>
<div class="form-section">
<el-form-item :label="$t('预计结束时间')" prop="stopTime">
<!-- <el-date-picker v-model="form.stopTime" value-format="yyyy-MM-dd HH:mm:ss" class="w-200"></el-date-picker> -->
<el-date-picker
v-model="form.stopTime"
value-format="yyyy-MM-dd"
class="w-200"
:picker-options="stopDate"
></el-date-picker>
<el-date-picker v-model="form.stopTime" value-format="yyyy-MM-dd" class="w-200" :picker-options="stopDate"></el-date-picker>
</el-form-item>
<el-form-item :label="$t('是否控货')" prop="control">
<dict-selector
:type="DICT_TYPE.INFRA_BOOLEAN_STRING"
formatter="bool"
v-model="form.control"
form-type="radio"
/>
<dict-selector :type="DICT_TYPE.INFRA_BOOLEAN_STRING" formatter="bool" v-model="form.control" form-type="radio" />
</el-form-item>
</div>
<div class="form-section">
<el-form-item :label="$t('竞争对手')" prop="competitor">
<el-select
clearable
v-model="form.competitor"
:placeholder="$t('请选择')"
class="w-200"
>
<el-option
v-for="item in competitorList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
<el-select clearable v-model="form.competitor" :placeholder="$t('请选择')" class="w-200">
<el-option v-for="item in competitorList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item :label="$t('重要程度')" prop="importance">
......@@ -754,106 +422,57 @@
<div class="form-section">
<el-form-item :label="$t('价格有效时间')" prop="startTime">
<!-- <el-date-picker v-model="form.startTime" placeholder="" value-format="yyyy-MM-dd HH:mm:ss" class="w-200"></el-date-picker> -->
<el-date-picker
v-model="form.startTime"
placeholder=""
value-format="yyyy-MM-dd"
class="w-200"
:picker-options="startDate"
></el-date-picker>
<el-date-picker v-model="form.startTime" placeholder="" value-format="yyyy-MM-dd" class="w-200" :picker-options="startDate"></el-date-picker>
</el-form-item>
<el-form-item label="" prop="endTime">
<!-- <el-date-picker v-model="form.endTime" placeholder="" value-format="yyyy-MM-dd HH:mm:ss" class="w-200"></el-date-picker> -->
<el-date-picker
v-model="form.endTime"
placeholder=""
value-format="yyyy-MM-dd"
class="w-200"
:picker-options="endDate"
></el-date-picker>
<el-date-picker v-model="form.endTime" placeholder="" value-format="yyyy-MM-dd" class="w-200" :picker-options="endDate"></el-date-picker>
</el-form-item>
<el-form-item :label="$t('交货方式')">
<!--
接口要求数据为整数,所以增加trade_type类型的字典,用1234代码以下不同类型
FOB(离岸价),CIF(到岸价),CNF(成本加运费),EXW(出厂价)
-->
<dict-selector
:type="DICT_TYPE.ECW_TRADE_TYPE"
fomtter="number"
v-model="form.tradeType"
class="w-200"
/>
<dict-selector :type="DICT_TYPE.ECW_TRADE_TYPE" fomtter="number" v-model="form.tradeType" class="w-200" />
</el-form-item>
<el-form-item :label="$t('交货地址')">
<el-input
v-model="form.tradeAdress"
:placeholder="$t('港口或地点')"
></el-input>
<el-input v-model="form.tradeAdress" :placeholder="$t('港口或地点')"></el-input>
</el-form-item>
</div>
<div class="form-section">
<el-form-item :label="$t('备注')" :span="2">
<el-input
v-model="form.remarks"
type="textarea"
placeholder=""
style="width: 500px; height: 100px"
></el-input>
<el-input v-model="form.remarks" type="textarea" placeholder="" style="width: 500px; height: 100px"></el-input>
</el-form-item>
</div>
</el-card>
<el-card class="mt-10" v-if="transport">
<div class="card-title" slot="header">{{ $t('其他') }}</div>
<div class="card-title" slot="header">{{ $t("其他") }}</div>
<!-- <el-form-item :label="$t('快递单号')">
<el-input v-model="form.number" :placeholder="$t('请输入购买商品的快递单号')"></el-input>
</el-form-item> -->
<el-form-item :label="$t('特殊要求')">
<dict-selector
v-model="form.transportVO.packageTypeArr"
form-type="checkbox"
:type="DICT_TYPE.ORDER_SPECIAL_NEEDS"
multiple
/>
<dict-selector v-model="form.transportVO.packageTypeArr" form-type="checkbox" :type="DICT_TYPE.ORDER_SPECIAL_NEEDS" multiple />
</el-form-item>
<br />
<el-form-item :label="$t('特殊要求备注')">
<el-input v-model="form.transportVO.packageRemarks"></el-input>
</el-form-item>
<br />
<el-form-item
:label="$t('是否双清')"
v-if="[2, 3, 4].indexOf(+form.transportId) > -1"
>
<dict-selector
v-model="form.transportVO.doubleClear"
form-type="radio"
:type="DICT_TYPE.ECW_DOUBLE_CLEAR"
/>
<el-form-item :label="$t('是否双清')" v-if="[2, 3, 4].indexOf(+form.transportId) > -1">
<dict-selector v-model="form.transportVO.doubleClear" form-type="radio" :type="DICT_TYPE.ECW_DOUBLE_CLEAR" />
</el-form-item>
<el-form-item
:label="$t('航空公司')"
v-if="[3, 4].indexOf(+form.transportId) > -1"
>
<el-form-item :label="$t('航空公司')" v-if="[3, 4].indexOf(+form.transportId) > -1">
<!--待查询备选数据-->
<!-- <el-select placeholder="" v-model="form.airlineCompany">
</el-select> -->
<supplier-selector
v-model="form.transportVO.airlineCompany"
companyType="10"
/>
<supplier-selector v-model="form.transportVO.airlineCompany" companyType="10" />
</el-form-item>
<el-form-item
:label="$t('船公司')"
v-if="[2].indexOf(+form.transportId) > -1"
>
<el-form-item :label="$t('船公司')" v-if="[2].indexOf(+form.transportId) > -1">
<!-- <el-select placeholder="" v-model="form.shippingCompany">
</el-select> -->
<supplier-selector
v-model="form.transportVO.shippingCompany"
companyType="9"
/>
<supplier-selector v-model="form.transportVO.shippingCompany" companyType="9" />
</el-form-item>
<!--
<div class="form-section">
......@@ -874,7 +493,7 @@
>
<el-input v-model="form.transportVO.remarks"></el-input>
</el-form-item>
<el-form-item
:label="$t('是否拆包')"
v-if="[3, 4].indexOf(+form.transportId) > -1"
......@@ -904,71 +523,51 @@
}}</span>
</el-form-item>
-->
</el-card>
<el-form-item label="" class="mt-20">
<!-- 非草稿状态显示为编辑按钮 -->
<el-button
v-if="form.offerId && form.status != 2"
type="primary"
@click="submitForm(2)"
>{{ $t("编辑") }}</el-button
>
<el-button v-if="form.offerId && form.status != 2" type="primary" @click="submitForm(2)">{{ $t("编辑") }}</el-button>
<template v-else>
<el-button type="primary" @click="submitForm(2)">{{
$t("保存草稿")
}}</el-button>
<el-button type="primary" @click="submitForm(2)">{{ $t("保存草稿") }}</el-button>
<!-- 草稿 -->
<el-button type="primary" @click="submitForm(3)">{{
$t("确认报价")
}}</el-button>
<el-button type="primary" @click="submitForm(3)">{{ $t("确认报价") }}</el-button>
<!-- 需求确认 -->
</template>
<el-button @click="$store.dispatch('tagsView/delCurrentView')">{{
$t("取消")
}}</el-button>
<el-button @click="$store.dispatch('tagsView/delCurrentView')">{{ $t("取消") }}</el-button>
</el-form-item>
</el-form>
<choose-contact-dialog
v-if="!!contactChooseType"
:type="1"
@choose="onContactChoose"
@close="contactChooseType = null"
/>
<quick-create-customer
v-if="quickCreateType"
:type="quickCreateType"
@success="onContactChoose"
@close="quickCreateType = null"
/>
<choose-contact-dialog v-if="!!contactChooseType" :type="1" @choose="onContactChoose" @close="contactChooseType = null" />
<quick-create-customer v-if="quickCreateType" :type="quickCreateType" @success="onContactChoose" @close="quickCreateType = null" />
</div>
</template>
<script>
import { createOffer, updateOffer, getOffer } from "@/api/ecw/offer";
import ProductSelector from "@/components/ProductSelector";
import { getProductAttrList } from "@/api/ecw/productAttr";
import { getChannelList } from "@/api/ecw/channel";
import Selector from "@/components/Selector";
import { openedRouterList as getOpenedRouterList } from "@/api/ecw/warehouse";
import { getTradeCityList } from "@/api/ecw/region";
import { getDictData } from "@/utils/dict";
import { getCurrencyList } from "@/api/ecw/currency";
import { getUnitList } from "@/api/ecw/unit";
import { calculationPrice } from "@/api/ecw/product";
import SupplierSelector from "@/components/SupplierSelector";
import ChooseContactDialog from "@/components/ChooseContactDialog";
import QuickCreateCustomer from "@/components/QuickCreateCustomer";
import { getCustomerContactsSelect } from "@/api/ecw/customerContacts";
import Decimal from "decimal.js";
import getQuote from "@/views/ecw/customer/index.vue";
import { getRegionList } from '@/api/ecw/order';
import { competitorListAll } from "@/api/ecw/customer";
import { createOffer, updateOffer, getOffer } from "@/api/ecw/offer"
import ProductSelector from "@/components/ProductSelector"
import { getProductAttrList } from "@/api/ecw/productAttr"
import { getChannelList } from "@/api/ecw/channel"
import Selector from "@/components/Selector"
import { openedRouterList as getOpenedRouterList } from "@/api/ecw/warehouse"
import { getTradeCityList } from "@/api/ecw/region"
import { getDictData } from "@/utils/dict"
import { getCurrencyList } from "@/api/ecw/currency"
import { getUnitList } from "@/api/ecw/unit"
import { calculationPrice } from "@/api/ecw/product"
import SupplierSelector from "@/components/SupplierSelector"
import ChooseContactDialog from "@/components/ChooseContactDialog"
import QuickCreateCustomer from "@/components/QuickCreateCustomer"
import { getCustomerContactsSelect } from "@/api/ecw/customerContacts"
import Decimal from "decimal.js"
import getQuote from "@/views/ecw/customer/index.vue"
import { getRegionList } from "@/api/ecw/order"
import { competitorListAll } from "@/api/ecw/customer"
import { getCustomerContactsListByCustomer } from "@/api/ecw/customerContacts"
import { parse } from "querystring"
window.Decimal = Decimal;
window.Decimal = Decimal
const createDefaultForm = () => {
return {
sendstatus: 0,
......@@ -976,9 +575,9 @@ const createDefaultForm = () => {
control: false,
isCargoControl: false,
prodCreateReqVOList: [],
transportVO: {},
};
};
transportVO: {}
}
}
export default {
name: "EcwOfferEdit",
components: {
......@@ -986,14 +585,14 @@ export default {
Selector,
SupplierSelector,
ChooseContactDialog,
QuickCreateCustomer,
QuickCreateCustomer
},
data() {
return {
// 遮罩层
form: {
relation: 1, // CustomerLevel 的初始值
},
// form: {
// relation: 1, // CustomerLevel 的初始值
// },
type: this.$route.query.type,
contacts: null,
contactsList: [],
......@@ -1011,7 +610,10 @@ export default {
// couponList: [],
fee: {}, // 费用
// 表单参数
form: { ...createDefaultForm() },
form: {
relation: null,
...createDefaultForm()
},
// 表单校验
labelStyle: "width:120px",
......@@ -1024,14 +626,14 @@ export default {
//预计结束时间,用于日历框校验
stopDate: {
disabledDate: (time) => {
return Date.now() - 8.64e7 >= time.getTime(); // 加- 8.64e7则表示包当天
},
return Date.now() - 8.64e7 >= time.getTime() // 加- 8.64e7则表示包当天
}
},
//有效起始时间
startDate: {
disabledDate: (time) => {
return Date.now() - 8.64e7 >= time.getTime(); // 加- 8.64e7则表示包当天
},
return Date.now() - 8.64e7 >= time.getTime() // 加- 8.64e7则表示包当天
}
},
//有效结束时间
endDate: {
......@@ -1039,84 +641,86 @@ export default {
if (this.form.startTime) {
return (
//限制日期范围
new Date(this.form.startTime).getTime() - 8.64e7 >=
time.getTime() ||
time.getTime() >= new Date().setDate(new Date().getDate() + 30)
);
new Date(this.form.startTime).getTime() - 8.64e7 >= time.getTime() || time.getTime() >= new Date().setDate(new Date().getDate() + 30)
)
} else {
// 加- 8.64e7则表示包当天
return (
Date.now() - 8.64e7 >= time.getTime() ||
time.getTime() >= new Date().setDate(new Date().getDate() + 30)
);
return Date.now() - 8.64e7 >= time.getTime() || time.getTime() >= new Date().setDate(new Date().getDate() + 30)
}
},
}
},
AddressProvince: [],
AddressCity: [],
competitorList: []
};
}
},
computed: {
computedStandard() {
if (this.$route.query.type == 1) {
// 使用计算属性动态设置 'Standard' 的值
switch (this.form.relation) {
case 1:
if (this.$route.query.customer.defaultContactName != null) {
this.form.consignorName =
this.$route.query.customer.defaultContactName;
this.form.consigneeName = "";
this.form.consignorId =
this.$route.query.customer.defaultContactId;
}
if (this.$route.query.customer.company != null) {
this.form.consignorCompany = this.$route.query.customer.company;
this.form.consigneeCompany = "";
}
if (this.$route.query.customer.defaultContactPhone != null) {
this.form.consignorPhone =
this.$route.query.customer.defaultContactPhone;
this.form.consigneePhone = "";
this.form.consigeeCountryCode = "";
}
if (this.$route.query.customer.defaultEmail != null) {
this.form.consignorEmail =
this.$route.query.customer.defaultEmail;
this.form.consigneeEmail = "";
}
return;
// computedStandard() {
// let customer = JSON.parse(this.$route.query.customer)
case 2:
if (this.$route.query.customer.defaultContactName != null) {
this.form.consignorName = "";
this.form.consigneeName =
this.$route.query.customer.defaultContactName;
this.form.consigneeId =
this.$route.query.customer.defaultContactId;
}
if (this.$route.query.customer.company != null) {
this.form.consignorCompany = "";
this.form.consigneeCompany = this.$route.query.customer.company;
}
if (this.$route.query.customer.defaultContactPhone != null) {
this.form.consignorPhone = "";
this.form.consignorCountryCode = "";
this.form.consigneePhone =
this.$route.query.customer.defaultContactPhone;
}
if (this.$route.query.customer.defaultEmail != null) {
this.form.consignorEmail = "";
this.form.consigneeEmail =
this.$route.query.customer.defaultEmail;
}
return;
// console.log(customer, "zs")
default:
return "";
}
}
},
// if (this.$route.query.type == 1) {
// // 使用计算属性动态设置 'Standard' 的值
// const type = customer.type
// if (type) {
// // 客户类型不为空时
// const types = type.split(",")
// if (types.includes("0")) {
// this.form.relation = 1
// } else {
// this.form.relation = 2
// }
// }
// switch (this.form.relation) {
// case 1:
// if (customer.defaultContactName != null) {
// this.form.consignorName = customer.defaultContactName
// this.form.consigneeName = ""
// this.form.consignorId = customer.defaultContactId
// }
// if (customer.company != null) {
// this.form.consignorCompany = customer.company
// this.form.consigneeCompany = ""
// }
// if (customer.defaultContactPhone != null) {
// this.form.consignorPhone = customer.defaultContactPhone
// this.form.consigorCountryCode = customer.defaultCountryCode
// this.form.consigneePhone = ""
// this.form.consigeeCountryCode = ""
// }
// if (customer.defaultEmail != null) {
// this.form.consignorEmail = customer.defaultEmail
// this.form.consigneeEmail = ""
// }
// return
// case 2:
// if (customer.defaultContactName != null) {
// this.form.consignorName = ""
// this.form.consigneeName = customer.defaultContactName
// this.form.consigneeId = customer.defaultContactId
// }
// if (customer.company != null) {
// this.form.consignorCompany = ""
// this.form.consigneeCompany = customer.company
// }
// if (customer.defaultContactPhone != null) {
// this.form.consignorPhone = ""
// this.form.consignorCountryCode = ""
// this.form.consigneePhone = customer.defaultContactPhone
// }
// if (customer.defaultEmail != null) {
// this.form.consignorEmail = ""
// this.form.consigneeEmail = customer.defaultEmail
// }
// return
// default:
// return ""
// }
// }
// },
rules() {
let rules = {
......@@ -1124,22 +728,18 @@ export default {
{
validator: (rule, value, callback) => {
if (value && !/[a-zA-Z]/.test(value.charAt(0))) {
return callback(new Error(this.$t("唛头必须以字母开头")));
return callback(new Error(this.$t("唛头必须以字母开头")))
}
callback();
callback()
},
trigger: "blur",
},
trigger: "blur"
}
],
lineId: [{ required: true, message: this.$t("请选择线路") }],
/* consignorId: [{ required: true, message: this.$t("发货人不能为空"),}],
consigneeId: [{ required: true, message: this.$t("收货人不能为空")}], */
startTime: [
{ required: true, message: this.$t("有效期开始时间不能为空") },
],
endTime: [
{ required: true, message: this.$t("有效期结束时间不能为空") },
],
startTime: [{ required: true, message: this.$t("有效期开始时间不能为空") }],
endTime: [{ required: true, message: this.$t("有效期结束时间不能为空") }],
transportId: [{ required: true, message: this.$t("选择运输方式") }],
channelId: [{ required: true, message: this.$t("选择出货渠道") }],
stopTime: [{ required: true, message: this.$t("不能为空") }],
......@@ -1147,13 +747,11 @@ export default {
control: [{ required: true, message: this.$t("请选择是否控货") }],
importance: [
{ required: true, message: this.$t("请选择重要程度") },
{ type: "number", min: 1, message: this.$t("请选择重要程度") },
],
};
{ type: "number", min: 1, message: this.$t("请选择重要程度") }
]
}
if (this.form.relation == 1) {
rules.consignorId = [
{ required: true, message: this.$t("发货人不能为空") },
];
rules.consignorId = [{ required: true, message: this.$t("发货人不能为空") }]
// if(this.$route.query.type ==1){
// if(this.$route.query.customer.defaultContactName==null){
// rules.consignorId = [{ required: true, message: this.$t("发货人不能为空")}]
......@@ -1170,63 +768,58 @@ export default {
// }
}
if (this.form.relation == 2) {
rules.consigneeId = [
{ required: true, message: this.$t("收货人不能为空") },
];
rules.consigneeId = [{ required: true, message: this.$t("收货人不能为空") }]
}
return rules;
return rules
},
exportCityList() {
return this.tradeCityList.filter((item) => item.type == 2);
return this.tradeCityList.filter((item) => item.type == 2)
},
importCityList() {
return this.tradeCityList.filter((item) => item.type == 1);
return this.tradeCityList.filter((item) => item.type == 1)
},
getDictData() {
return (type, value) => getDictData(type, value) || {};
return (type, value) => getDictData(type, value) || {}
},
// 根据线路id显示线路名称
getRouterNameById() {
return (routerId) => {
let router = this.routerList.find((item) => item.id == routerId);
let router = this.routerList.find((item) => item.id == routerId)
if (router) {
return router.startTitleZh + " > " + router.destTitleZh;
return router.startTitleZh + " > " + router.destTitleZh
}
return "-";
};
return "-"
}
},
// 根据渠道id显示渠道名
getChannelNameById() {
return (channelId) => {
return this.channelList.find((item) => item.channelId == channelId)
?.nameZh;
};
return this.channelList.find((item) => item.channelId == channelId)?.nameZh
}
},
// 当前运输方式
transport() {
return this.transportList.find(
(item) => item.value == this.form.transportId
);
return this.transportList.find((item) => item.value == this.form.transportId)
},
selectedRouter() {
// otherService 1 送货上门,2非控货订单代收货款
if (!this.form.lineId) return null;
return this.routerList.find((item) => item.id == this.form.lineId);
if (!this.form.lineId) return null
return this.routerList.find((item) => item.id == this.form.lineId)
},
currencyMap() {
let map = {};
let map = {}
this.currencyList.forEach((item) => {
map[item.id] = this.$l(item, "title");
});
return map;
map[item.id] = this.$l(item, "title")
})
return map
},
unitMap() {
let map = {};
let map = {}
this.unitList.forEach((item) => {
map[item.id] = this.$l(item, "title");
});
return map;
map[item.id] = this.$l(item, "title")
})
return map
},
sum() {
let sum = {
......@@ -1234,24 +827,24 @@ export default {
totalVolume: new Decimal(0),
totalWeight: new Decimal(0),
totalWorth: new Decimal(0),
totalQuatity: new Decimal(0),
};
totalQuatity: new Decimal(0)
}
this.form.prodCreateReqVOList.forEach((item) => {
sum.totalNum = sum.totalNum.plus(item.num || 0);
sum.totalVolume = sum.totalVolume.plus(item.volume || 0);
sum.totalWeight = sum.totalWeight.plus(item.weight || 0);
sum.totalWorth = sum.totalWorth.plus(item.worth || 0);
sum.totalQuatity = sum.totalQuatity.plus(item.quantity || 0);
});
return sum;
sum.totalNum = sum.totalNum.plus(item.num || 0)
sum.totalVolume = sum.totalVolume.plus(item.volume || 0)
sum.totalWeight = sum.totalWeight.plus(item.weight || 0)
sum.totalWorth = sum.totalWorth.plus(item.worth || 0)
sum.totalQuatity = sum.totalQuatity.plus(item.quantity || 0)
})
return sum
},
// 总有优惠金额
couponList() {
let arr = [];
let arr = []
this.couponAvailableGroupDtoList.forEach((item) => {
if (item.couponAvailableDtoList && item.couponAvailableDtoList.length) {
// 只取第一个
let it = item.couponAvailableDtoList[0];
let it = item.couponAvailableDtoList[0]
arr.push({
prodId: item.prodId,
type: it.type,
......@@ -1260,137 +853,173 @@ export default {
endTime: it.endTime,
reduceTotalAmount: it.reduceTotalAmount,
reduceAmount: it.reduceAmount,
reduceCurrencyId: it.reduceCurrencyId,
});
reduceCurrencyId: it.reduceCurrencyId
})
}
});
return arr;
})
return arr
},
// 计算返回的费用清单
feeDtoList() {
return this.fee.feeDtoList || [];
return this.fee.feeDtoList || []
},
// 清关费
clearanceFeeList() {
return this.feeDtoList.filter((item) => item.feeType == 2);
return this.feeDtoList.filter((item) => item.feeType == 2)
},
// 运费
freightFeeList() {
return this.feeDtoList.filter((item) => item.feeType == 1);
return this.feeDtoList.filter((item) => item.feeType == 1)
},
// 原价(清关费 + 运费)
originalFeeList() {
let arr = [];
let arr = []
this.clearanceFeeList.forEach((item) => {
let it = {
src: this.$t("清关费"),
currencyId: item.currencyId,
amount: Decimal(item.amount),
};
let freight = this.freightFeeList.find(
(fee) => fee.currencyId == item.currencyId
);
amount: Decimal(item.amount)
}
let freight = this.freightFeeList.find((fee) => fee.currencyId == item.currencyId)
if (freight) {
it.amount = it.amount.plus(freight.amount);
it.amount = it.amount.plus(freight.amount)
}
arr.push(it);
});
arr.push(it)
})
// 判断是否有运费单位不在清关费里的
this.freightFeeList.forEach((item) => {
if (!arr.find((arrItem) => arrItem.currencyId == item.currencyId)) {
arr.push({
src: this.$t("未计算的运费"),
currencyId: item.currencyId,
amount: Decimal(item.amount),
});
amount: Decimal(item.amount)
})
}
});
return arr;
})
return arr
},
// 预计费用(原价 - 优惠金额 + 其他费用 + 保价费)
estimatedCosts() {
let arr = [];
let arr = []
this.originalFeeList.forEach((item) => {
let it = {
currencyId: item.currencyId,
amount: Decimal(item.amount),
};
let coupon = this.couponList.find(
(coupon) => coupon.reduceCurrencyId == item.currencyId
);
amount: Decimal(item.amount)
}
let coupon = this.couponList.find((coupon) => coupon.reduceCurrencyId == item.currencyId)
if (coupon) {
it.amount = it.amount.minus(coupon.reduceTotalAmount);
it.amount = it.amount.minus(coupon.reduceTotalAmount)
}
arr.push(it);
});
arr.push(it)
})
// 累加保价费
const insuranceFeeIndex = arr.findIndex(
(item) => item.currencyId == this.insuranceFeeCurrency
);
const insuranceFeeIndex = arr.findIndex((item) => item.currencyId == this.insuranceFeeCurrency)
if (insuranceFeeIndex > -1) {
arr[insuranceFeeIndex].amount = arr[insuranceFeeIndex].amount.plus(
this.fee.insuranceFee || 0
);
arr[insuranceFeeIndex].amount = arr[insuranceFeeIndex].amount.plus(this.fee.insuranceFee || 0)
} else {
arr.push({
currencyId: this.insuranceFeeCurrency,
amount: Decimal(this.fee.insuranceFee || 0),
});
amount: Decimal(this.fee.insuranceFee || 0)
})
}
// 累加其他费用
const otherFeeIndex = arr.findIndex(
(item) => item.currencyId == this.form.otherFeeCurrencyId
);
const otherFeeIndex = arr.findIndex((item) => item.currencyId == this.form.otherFeeCurrencyId)
if (otherFeeIndex > -1) {
arr[otherFeeIndex].amount = arr[otherFeeIndex].amount.plus(
this.form.otherFee || 0
);
arr[otherFeeIndex].amount = arr[otherFeeIndex].amount.plus(this.form.otherFee || 0)
} else {
if (this.form.otherFee > 0) {
arr.push({
currencyId: this.form.otherFeeCurrencyId,
amount: Decimal(this.form.otherFee || 0),
});
amount: Decimal(this.form.otherFee || 0)
})
}
}
return arr;
return arr
},
// 路线开通的服务
routeOtherServices() {
if (!this.selectedRouter || !this.selectedRouter.otherService) return [];
return this.selectedRouter.otherService.split(",");
if (!this.selectedRouter || !this.selectedRouter.otherService) return []
return this.selectedRouter.otherService.split(",")
},
// 保价费单位(路线里设置,默认美元)
insuranceFeeCurrency() {
return this.selectedRouter?.currencyUnit || 1;
return this.selectedRouter?.currencyUnit || 1
},
// 是否可以添加商品
canAddProduct() {
if (!this.form.lineId) {
return false;
return false
}
// 如果是海空联运或者空运专线则必须选择渠道
if (
this.transport &&
this.transport.cssClass == "channel" &&
!this.form.channelId
) {
return false;
if (this.transport && this.transport.cssClass == "channel" && !this.form.channelId) {
return false
}
return true;
},
return true
}
},
watch: {
"form.relation": function (newVal) {
this.form.standard = this.computedStandard;
// this.form.standard = this.computedStandard
if (this.$route.query.type == 1) {
let customer = this.customer
console.log(customer, "zs")
switch (this.form.relation) {
case 1:
if (customer.name != null) {
this.form.consignorName = customer.name
this.form.consigneeName = ""
this.form.consignorId = customer.customerContactsId
}
if (customer.company != null) {
this.form.consignorCompany = customer.company
this.form.consigneeCompany = ""
}
if (customer.phoneNew != null) {
this.form.consignorPhone = customer.phoneNew
this.form.consignorCountryCode = customer.areaCode
this.form.consigneePhone = ""
this.form.consigneeCountryCode = ""
}
if (customer.email != null) {
this.form.consignorEmail = customer.email
this.form.consigneeEmail = ""
}
return
case 2:
if (customer.name != null) {
this.form.consignorName = ""
this.form.consigneeName = customer.name
this.form.consigneeId = customer.customerContactsId
}
if (customer.company != null) {
this.form.consignorCompany = ""
this.form.consigneeCompany = customer.company
}
if (customer.phoneNew != null) {
this.form.consignorPhone = ""
this.form.consignorCountryCode = ""
this.form.consigneePhone = customer.phoneNew
this.form.consigneeCountryCode = customer.areaCode
}
if (customer.email != null) {
this.form.consignorEmail = ""
this.form.consigneeEmail = customer.email
}
return
default:
return ""
}
}
},
// 始发地
"form.departureId"() {
this.getOpenedRouterList();
this.getOpenedRouterList()
},
"form.destCountryId"(destCountryId) {
if (destCountryId != null) {
......@@ -1405,9 +1034,9 @@ export default {
},
// 目的地
async "form.objectiveId"() {
await this.$nextTick();
await this.getChannelList();
this.getOpenedRouterList();
await this.$nextTick()
await this.getChannelList()
this.getOpenedRouterList()
},
"form.transportId"(transportId, oldTransportId) {
// 海空联运默认数据
......@@ -1420,117 +1049,117 @@ export default {
isUnpack: false,
isSingleTicketTransport: false,
packageTypeArr: [],
packageType: "",
packageType: ""
})
);
)
}
this.getOpenedRouterList();
this.getOpenedRouterList()
// 更换运输方式之后,之前选择的路线会失效,需要重新选择
if (
oldTransportId &&
oldTransportId != transportId &&
transportId != this.selectedRouter?.transportType
) {
console.log(
"重置路线",
oldTransportId,
transportId,
this.selectedRouter?.transportType
);
this.$set(this.form, "lineId", undefined);
if (oldTransportId && oldTransportId != transportId && transportId != this.selectedRouter?.transportType) {
console.log("重置路线", oldTransportId, transportId, this.selectedRouter?.transportType)
this.$set(this.form, "lineId", undefined)
}
},
async "form.channelId"() {
await this.getTradeCity();
this.getOpenedRouterList();
this.calculationPrice("form.channelId");
await this.getTradeCity()
this.getOpenedRouterList()
this.calculationPrice("form.channelId")
},
async "form.lineId"(lineId) {
let router = this.routerList.find((item) => item.id == lineId);
let router = this.routerList.find((item) => item.id == lineId)
if (router) {
this.$set(this.form, "departureId", router.startCityId);
this.$set(this.form, "destCountryId", router.destCountryId);
this.$set(this.form, "objectiveId", router.destCityId);
this.$set(this.form, "departureId", router.startCityId)
this.$set(this.form, "destCountryId", router.destCountryId)
this.$set(this.form, "objectiveId", router.destCityId)
}
await this.$nextTick();
await this.getChannelList();
await this.getTradeCity();
await this.calculationPrice("form.lineId");
await this.$nextTick()
await this.getChannelList()
await this.getTradeCity()
await this.calculationPrice("form.lineId")
},
"form.transportVO.packageTypeArr"(val) {
this.$set(this.form.transportVO, "packageType", (val || []).join(","));
this.$set(this.form.transportVO, "packageType", (val || []).join(","))
},
// 选择的路线变化后,需要判断是否开通了对应的服务,如果没开通需要取消对应的服务选择
selectedRouter(val) {
if (!val) return;
["1", "4"].forEach((service) => {
if (
this.routeOtherServices.indexOf(service) < 0 &&
this.form.type.indexOf(service) > -1
) {
if (!val) return
;["1", "4"].forEach((service) => {
if (this.routeOtherServices.indexOf(service) < 0 && this.form.type.indexOf(service) > -1) {
this.form.type.splice(
this.form.type.findIndex((item) => item == service),
1
);
)
}
});
},
})
}
},
activated() {
if (this.form.offerId != this.$route.query.id) {
this.getOffer();
this.getOffer()
}
},
async created() {
await this.getChannelList();
await this.getTradeCity();
getProductAttrList().then((res) => (this.productAttrList = res.data));
getCurrencyList().then((res) => (this.currencyList = res.data));
getUnitList().then((res) => (this.unitList = res.data));
this.transportList = this.getDictDatas(this.DICT_TYPE.ECW_TRANSPORT_TYPE);
await this.getChannelList()
await this.getTradeCity()
getProductAttrList().then((res) => (this.productAttrList = res.data))
getCurrencyList().then((res) => (this.currencyList = res.data))
getUnitList().then((res) => (this.unitList = res.data))
this.transportList = this.getDictDatas(this.DICT_TYPE.ECW_TRANSPORT_TYPE)
getRegionList(1, 1).then((res) => (this.AddressProvince = res.data))
getRegionList(4, 4).then((res) => (this.AddressCity = res.data))
competitorListAll().then((res) => (this.competitorList = res.data))
if (this.$route.query.id) {
this.getOffer();
this.getOffer()
} else {
// alert(this.$route.query.customer.defaultContactPhone)
this.addProduct();
this.addProduct()
}
if (this.$route.query.type == 1) {
let res = await getCustomerContactsListByCustomer({ customerId: parseInt(this.$route.query.customerId || 0) })
this.customer = res.data.find((item) => item.isDefault)
if (this.$route.query.customerType) {
// 客户类型不为空时
const types = this.$route.query.customerType.split(",")
if (types.includes("0")) {
this.form.relation = 1
} else {
this.form.relation = 2
}
}
} else {
this.form.relation = 1
}
},
methods: {
async getChannelList() {
let query = {
cityId: this.form.objectiveId,
lineId: this.form.lineId,
};
this.channelList = (await getChannelList(query)).data || [];
lineId: this.form.lineId
}
this.channelList = (await getChannelList(query)).data || []
},
async getTradeCity() {
let query = {};
let query = {}
if (this.form.channelId) {
query.channelId = this.form.channelId;
query.channelId = this.form.channelId
}
this.tradeCityList = (await getTradeCityList(query)).data || [];
this.tradeCityList = (await getTradeCityList(query)).data || []
},
getOffer() {
//加了是否从全部客户列表中报价按钮进来的判断
if (this.$route.query !== 1) {
getOffer(this.$route.query.id).then((res) => {
let formData = res.data;
formData.type = formData.type
? formData.type.split(",").filter((item) => item != "")
: [];
formData.prodCreateReqVOList = [];
let formData = res.data
formData.type = formData.type ? formData.type.split(",").filter((item) => item != "") : []
formData.prodCreateReqVOList = []
if (formData.transportVO && formData.transportVO.packageType) {
formData.transportVO.packageTypeArr =
formData.transportVO.packageType
.split(",")
.filter((item) => item && item != "");
formData.transportVO.packageTypeArr = formData.transportVO.packageType.split(",").filter((item) => item && item != "")
}
if (res.data.offerProdRespVOList) {
res.data.offerProdRespVOList.forEach((item) => {
......@@ -1554,61 +1183,40 @@ export default {
.split(",")
.filter((item) => item != "")
.map((item) => +item)
: [],
});
});
: []
})
})
}
this.$set(this, "form", formData);
this.$set(this, "form", formData)
// 接口只返回了发货人和收货人ID,还需要调用接口获取详细信息回显
getCustomerContactsSelect({
ids: [res.data.consigneeId, res.data.consignorId].join(","),
ids: [res.data.consigneeId, res.data.consignorId].join(",")
}).then(({ data }) => {
this.contactChooseType = "consignee";
this.onContactChoose(
data.list.find(
(item) => item.customerContactsId == res.data.consigneeId
)
);
this.contactChooseType = "consignor";
this.onContactChoose(
data.list.find(
(item) => item.customerContactsId == res.data.consignorId
)
);
});
});
this.contactChooseType = "consignee"
this.onContactChoose(data.list.find((item) => item.customerContactsId == res.data.consigneeId))
this.contactChooseType = "consignor"
this.onContactChoose(data.list.find((item) => item.customerContactsId == res.data.consignorId))
})
})
}
},
onContactChoose(contact) {
if (!contact) return;
if (!this.contactChooseType && !this.quickCreateType) return;
if (!contact) return
if (!this.contactChooseType && !this.quickCreateType) return
if (!this.contactChooseType && this.quickCreateType) {
this.contactChooseType =
this.quickCreateType == 0 ? "consignor" : "consignee";
this.contactChooseType = this.quickCreateType == 0 ? "consignor" : "consignee"
}
this.$set(this.form, this.contactChooseType + "Company", contact.company);
this.$set(
this.form,
this.contactChooseType + "Id",
contact.customerContactsId
);
this.$set(
this.form,
this.contactChooseType + "CountryCode",
contact.areaCode
);
this.$set(this.form, this.contactChooseType + "Email", contact.email);
this.$set(this.form, this.contactChooseType + "Company", contact.company)
this.$set(this.form, this.contactChooseType + "Id", contact.customerContactsId)
this.$set(this.form, this.contactChooseType + "CountryCode", contact.areaCode)
this.$set(this.form, this.contactChooseType + "Email", contact.email)
// this.$set(this.form, this.contactChooseType + 'Id', contact.customerId)
this.$set(
this.form,
this.contactChooseType + "Name",
contact.contactsName
);
this.$set(this.form, this.contactChooseType + "Phone", contact.phoneNew);
this.contactChooseType = null;
this.quickCreateType = null;
this.$set(this.form, this.contactChooseType + "Name", contact.contactsName)
this.$set(this.form, this.contactChooseType + "Phone", contact.phoneNew)
this.contactChooseType = null
this.quickCreateType = null
},
onProductChange(row, product) {
// row.goodsType = product ? product.typeId : null
......@@ -1617,28 +1225,28 @@ export default {
: product.attrId
.split(",")
.filter((item) => item !== "")
.map((item) => +item);
.map((item) => +item)
if (product) {
this.$set(this.productNames, product.id, {
titleZh: product.titleZh,
titleEn: product.titleEn,
});
titleEn: product.titleEn
})
}
this.calculationPrice("onProductChange");
this.calculationPrice("onProductChange")
},
/* onLineChange(row){
this.calculationPrice()
// this.updateEnabledTransports()
}, */
onChannelChange(row) {
this.calculationPrice("onChannelChange");
this.calculationPrice("onChannelChange")
},
onProductAttrChange(row, attr) {
this.calculationPrice("onProductAttrChange");
this.calculationPrice("onProductAttrChange")
},
addProduct(data) {
this.form.prodCreateReqVOList.push(data || { prodAttrArr: [] });
this.form.prodCreateReqVOList.push(data || { prodAttrArr: [] })
},
// 计算商品运费
/* getProductFee(row){
......@@ -1652,212 +1260,188 @@ export default {
}, */
// 获取路线
getOpenedRouterList() {
let params = {};
let params = {}
if (this.form.departureId) {
params.startCityId = this.form.departureId;
params.startCityId = this.form.departureId
}
if (this.form.objectiveId) {
params.destCityId = this.form.objectiveId;
params.destCityId = this.form.objectiveId
}
if (this.form.transportId) {
params.transportType = this.form.transportId;
params.transportType = this.form.transportId
}
if (this.form.channelId) {
params.channelId = this.form.channelId;
params.channelId = this.form.channelId
}
// 如果没有任何条件,不请求接口
if (
!params.startCityId &&
!params.destCityId &&
!params.transportType &&
!params.channelId
)
return false;
getOpenedRouterList(params).then((res) => (this.routerList = res.data));
if (!params.startCityId && !params.destCityId && !params.transportType && !params.channelId) return false
getOpenedRouterList(params).then((res) => (this.routerList = res.data))
},
// 计算体积
calcVolume(row) {
if (!row.boxGauge || !row.num) return false;
if (!row.boxGauge || !row.num) return false
try {
row.volume = (eval(row.boxGauge) * row.num).toFixed(2);
row.volume = (eval(row.boxGauge) * row.num).toFixed(2)
} catch (e) {
row.volume = "";
row.volume = ""
}
},
// 删除一条产品
delProduct(index) {
this.$confirm(this.$t("确定删除此条内容么?")).then((res) => {
this.form.prodCreateReqVOList.splice(index, 1);
});
this.form.prodCreateReqVOList.splice(index, 1)
})
},
/** 提交按钮 */
submitForm(status) {
this.$refs["form"].validate((valid, errors) => {
if (!valid) {
return this.$showFormValidateErrors(errors);
return this.$showFormValidateErrors(errors)
}
this.form.prodCreateReqVOList.map((item) => {
item.prodAttrIds = item.prodAttrArr.join(",");
item.lineId = this.form.lineId;
item.channelId = this.form.channelId;
item.transportId = this.form.transportId;
});
item.prodAttrIds = item.prodAttrArr.join(",")
item.lineId = this.form.lineId
item.channelId = this.form.channelId
item.transportId = this.form.transportId
})
if (this.form.transportVO?.packageTypeArr) {
this.form.transportVO.packageType =
this.form.transportVO.packageTypeArr.join(",");
this.form.transportVO.packageType = this.form.transportVO.packageTypeArr.join(",")
}
let endTime = new Date(this.form.endTime);
let startTime = new Date(this.form.startTime);
let endTime = new Date(this.form.endTime)
let startTime = new Date(this.form.startTime)
if (endTime.getTime() < startTime.getTime()) {
return this.$message.error(
this.$t("价格有效结束时间不能小于开始时间")
);
return this.$message.error(this.$t("价格有效结束时间不能小于开始时间"))
}
let time2 = new Date().setDate(new Date().getDate() + 30);
let time2 = new Date().setDate(new Date().getDate() + 30)
if (endTime > time2) {
return this.$message.error(
this.$t("价格有效结束时间不能超过当前时间30天")
);
return this.$message.error(this.$t("价格有效结束时间不能超过当前时间30天"))
}
// 修改的提交
if (this.form.offerId != null) {
let data = Object.assign({}, this.form, {
// transportUpdateReqVOList: this.transportList.filter(item => item._enabled),
prodUpdateReqVOList: this.getProductListWithDefaultValue(),
});
prodUpdateReqVOList: this.getProductListWithDefaultValue()
})
if (data.status < 3) {
data.status = status;
data.status = status
}
updateOffer(data).then((response) => {
this.$modal.msgSuccess(this.$t("修改成功"));
this.$redirect("index");
});
return;
this.$modal.msgSuccess(this.$t("修改成功"))
this.$redirect("index")
})
return
}
let data = null;
let data = null
if (this.$route.query.type == 1) {
console.log(JSON.stringify(this.contactsList));
console.log(JSON.stringify(this.contactsList))
data = Object.assign({}, this.form, {
prodCreateReqVOList: this.getProductListWithDefaultValue(),
consignorId: this.$route.query.customer.defaultContactId,
status,
});
consignorId: this.customer.defaultContactId,
status
})
// data.consignorId = contacts.customerContactsId
} else {
data = Object.assign({}, this.form, {
prodCreateReqVOList: this.getProductListWithDefaultValue(),
status,
});
status
})
}
// 添加的提交
createOffer(data).then((response) => {
// 重置表单内容
this.$set(this, "form", { ...createDefaultForm() });
this.routerList = [];
this.$set(this, "form", { ...createDefaultForm() })
this.routerList = []
this.$nextTick(() => {
console.log("清理表单校验和路线");
this.addProduct();
this.$refs.form.clearValidate();
});
this.$modal.msgSuccess(this.$t("新增成功"));
this.$redirect("index");
});
});
console.log("清理表单校验和路线")
this.addProduct()
this.$refs.form.clearValidate()
})
this.$modal.msgSuccess(this.$t("新增成功"))
this.$redirect("index")
})
})
},
setLink(row) {
this.$prompt(this.$t("请输入商品链接"), { inputValue: row.link }).then(
({ value }) => {
this.$set(row, "link", value);
}
);
this.$prompt(this.$t("请输入商品链接"), { inputValue: row.link }).then(({ value }) => {
this.$set(row, "link", value)
})
},
// 计算商品运费
calculationPrice(tag) {
let calcable = true;
if (!this.form.prodCreateReqVOList.length) return;
let calcable = true
if (!this.form.prodCreateReqVOList.length) return
this.form.prodCreateReqVOList.forEach((item) => {
if (!item.prodId) {
console.log("产品未选择", item);
calcable = false;
console.log("产品未选择", item)
calcable = false
}
item.brandType = item.brand;
});
item.brandType = item.brand
})
if (this.calculating || !calcable) {
console.log("不满足费用计算条件,清空已获取的费用信息");
console.log("不满足费用计算条件,清空已获取的费用信息")
this.form.prodCreateReqVOList.forEach((item) => {
delete item.fee;
});
this.fee = {};
return false;
delete item.fee
})
this.fee = {}
return false
}
this.calculating = true;
this.calculating = true
console.log("calculationPrice");
console.log("calculationPrice")
calculationPrice({
lineId: this.form.lineId,
transportId: this.form.transportId,
channelId:
[3, 4].indexOf(this.form.transportId) > -1
? this.form.channelId
: undefined,
channelId: [3, 4].indexOf(this.form.transportId) > -1 ? this.form.channelId : undefined,
prodConditionParamList: this.getProductListWithDefaultValue(),
consigneeCustomerContactsId: this.form.consigneeCustomerContactsId,
consignorCustomerContactsId: this.form.consignorCustomerContactsId,
customsType: this.form.customsType,
isCargoControl: this.form.control,
orderType: this.form.orderType,
orderType: this.form.orderType
})
.then((res) => {
this.$set(this, "fee", res.data.costDto);
this.$set(this, "fee", res.data.costDto)
if (res.data.availableDto) {
this.$set(
this,
"couponTotalAmountList",
res.data.availableDto.couponTotalAmountList
);
this.$set(
this,
"couponAvailableGroupDtoList",
res.data.availableDto.couponAvailableGroupDtoList
);
this.$set(this, "couponTotalAmountList", res.data.availableDto.couponTotalAmountList)
this.$set(this, "couponAvailableGroupDtoList", res.data.availableDto.couponAvailableGroupDtoList)
}
this.form.prodCreateReqVOList.map((item, index) => {
this.$set(item, "fee", res.data.prodCostDtoList[index] || null);
});
this.$set(item, "fee", res.data.prodCostDtoList[index] || null)
})
})
.finally(() => {
this.calculating = false;
});
this.calculating = false
})
},
// 体积。件数,数量,重量为选填,但是接口确实必填,所以生成一个副本并赋予默认值
getProductListWithDefaultValue() {
let arr = [];
let arr = []
this.form.prodCreateReqVOList.forEach((item) => {
let tmp = { ...item };
tmp.prodAttrIds = tmp.prodAttrArr.join(",");
if (!tmp.volume) tmp.volume = 0;
if (!tmp.weight) tmp.weight = 0;
if (!tmp.quantity) tmp.quantity = 0;
if (!tmp.num) tmp.num = 0;
if (!tmp.worth) tmp.worth = 0;
arr.push(tmp);
});
return arr;
},
},
};
let tmp = { ...item }
tmp.prodAttrIds = tmp.prodAttrArr.join(",")
if (!tmp.volume) tmp.volume = 0
if (!tmp.weight) tmp.weight = 0
if (!tmp.quantity) tmp.quantity = 0
if (!tmp.num) tmp.num = 0
if (!tmp.worth) tmp.worth = 0
arr.push(tmp)
})
return arr
}
}
}
</script>
<style lang="scss" scoped>
.card-title {
......
......@@ -1625,7 +1625,7 @@ export default {
for(const i in this.form.orderItemVOList){
const item = this.form.orderItemVOList[i]
if(!item.prodId){
return this.$message.error(this.$t(`第{index}行未选择商品`, i+1))
return this.$message.error(this.$t(`第${Number(i) + 1}行未选择商品`, i+1))
}
}
......
......@@ -397,10 +397,11 @@
/>
</div>
</template>
<script>
//国家列表接口
import { getCountryListAll } from "@/api/ecw/country";
import { DICT_TYPE, getDictDatas, getDictDatas2 } from '@/utils/dict'
import UserSelector from "@/components/UserSelector";
import { listServiceUser2 } from "@/api/system/user";
import Treeselect from "@riophae/vue-treeselect";
......@@ -482,6 +483,9 @@ export default {
return {
// 遮罩层
loading: true,
getDictDatas2,
getDictDatas,
DICT_TYPE,
// 导出遮罩层
exportLoading: false,
// 显示搜索条件
......@@ -849,4 +853,3 @@ export default {
},
};
</script>
\ No newline at end of file
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