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">
<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
......@@ -105,10 +110,12 @@
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{
$t("搜索")
}}</el-button>
}}
</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{
$t("重置")
}}</el-button>
}}
</el-button>
</el-form-item>
</el-form>
<el-table :data="list" v-loading="loading" border size="mini">
......@@ -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">
......@@ -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: {
......@@ -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-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.$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("提示"),
{
this.$confirm(this.$t("修改业绩类型后,将会影响客户新订单业绩计算,请问确定吗?"), this.$t("提示"), {
confirmButtonText: this.$t("确定"),
cancelButtonText: this.$t("取消"),
type: "warning",
}
)
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>
......@@ -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,
......
<template>
<div>
<el-row type="flex" style="margin-top: 15px;margin-bottom: 15px" justify="center">
<el-row type="flex" style="margin-top: 15px; margin-bottom: 15px" justify="center">
<el-col :xs="24" :sm="24" :md="24" :lg="20" :xl="16">
<div style="display: flex;justify-content: space-between;align-items: flex-end;">
<h2>{{$t('查看')}}</h2>
<div style="display: flex; justify-content: space-between; align-items: flex-end">
<h2>{{ $t("查看") }}</h2>
<div>
<el-button type="primary" size="small" v-has-permi="['ecw:customer:query-edit']" @click="$router.push('/customer/add-edit/' + id)">{{$t('编辑')}}</el-button>
<el-button v-has-permi="['ecw:customer:query-quoted-price']" @click="$router.push('/offer/create')" type="primary" size="small">{{$t('报价')}}</el-button>
<el-button v-has-permi="['ecw:customer:query-follow-up']" type="primary" size="small" @click="customerFollowFn('follow')">{{$t('跟进')}}</el-button>
<el-button v-has-permi="['ecw:customer:query-customer-complaint']" type="primary" size="small" @click="customerFollowFn('complain')">{{$t('客诉')}}</el-button>
<el-button v-has-permi="['ecw:customer:query-delete']" type="danger" size="small" @click="deleteCustomerFn()">{{$t('删除')}}</el-button>
<el-button type="primary" size="small" v-has-permi="['ecw:customer:query-edit']" @click="$router.push('/customer/add-edit/' + id)">{{ $t("编辑") }} </el-button>
<el-button v-has-permi="['ecw:customer:query-quoted-price']" @click="quote" type="primary" size="small">
{{ $t("报价") }}
</el-button>
<el-button v-has-permi="['ecw:customer:query-follow-up']" type="primary" size="small" @click="customerFollowFn('follow')">{{ $t("跟进") }} </el-button>
<el-button v-has-permi="['ecw:customer:query-customer-complaint']" type="primary" size="small" @click="customerFollowFn('complain')">{{ $t("客诉") }} </el-button>
<el-button v-has-permi="['ecw:customer:query-delete']" type="danger" size="small" @click="deleteCustomerFn()">{{ $t("删除") }} </el-button>
</div>
</div>
<el-card style="margin-top: 15px;">
<el-card style="margin-top: 15px">
<el-descriptions :title="$t('基本')" :column="3" border>
<template slot="extra">
<el-button type="primary" size="small" @click="showMore = !showMore">{{showMore ? $t('隐藏') : $t('更多')}}</el-button>
<el-button type="primary" size="small" @click="showMore = !showMore">
{{ showMore ? $t("隐藏") : $t("更多") }}
</el-button>
</template>
<el-descriptions-item :label="$t('客户编号')">{{ customer.number }}</el-descriptions-item>
<el-descriptions-item :label="$t('客户名称')"><span style="white-space: pre-wrap;">{{ customer.name}}</span></el-descriptions-item>
<el-descriptions-item :label="$t('国籍')">{{$l(customer,'countryName')}}</el-descriptions-item>
<el-descriptions-item :label="$t('客户来源')">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_SOURCE, customer.source) }}</el-descriptions-item>
<el-descriptions-item :label="$t('客户状态')">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_STATUS, customer.status) }}</el-descriptions-item>
<el-descriptions-item :label="$t('客户经理')">{{customer.customerServiceName }}</el-descriptions-item>
<el-descriptions-item :label="$t('客户名称')"
><span style="white-space: pre-wrap">{{ customer.name }}</span></el-descriptions-item
>
<el-descriptions-item :label="$t('国籍')">{{ $l(customer, "countryName") }}</el-descriptions-item>
<el-descriptions-item :label="$t('客户来源')">
{{ getDictDataLabel(DICT_TYPE.CUSTOMER_SOURCE, customer.source) }}
</el-descriptions-item>
<el-descriptions-item :label="$t('客户状态')">
{{ getDictDataLabel(DICT_TYPE.CUSTOMER_STATUS, customer.status) }}
</el-descriptions-item>
<el-descriptions-item :label="$t('客户经理')">{{ customer.customerServiceName }}</el-descriptions-item>
<el-descriptions-item :label="$t('询盘信息')">{{ customer.inquiry }}</el-descriptions-item>
<el-descriptions-item :label="$t('备注')">{{ customer.remarks }}</el-descriptions-item>
<el-descriptions-item :label="$t('图片')">
<image-display :picture-urls="customer.picture ? customer.picture.split(',') : []" >
<el-button type="text" > 查看图片</el-button>
<image-display :picture-urls="customer.picture ? customer.picture.split(',') : []">
<el-button type="text"> 查看图片</el-button>
</image-display>
</el-descriptions-item>
<template v-if="showMore">
<el-descriptions-item :label="$t('客户等级')">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_LEVEL, customer.level) }}</el-descriptions-item>
<el-descriptions-item :label="$t('客户等级')">
{{ getDictDataLabel(DICT_TYPE.CUSTOMER_LEVEL, customer.level) }}
</el-descriptions-item>
<el-descriptions-item :label="$t('推介人')">{{ customer.promoterName }}</el-descriptions-item>
<el-descriptions-item :label="$t('客户生日')">{{ parseTime(customer.birthday, '{y}-{m}-{d}') }}</el-descriptions-item>
<el-descriptions-item :label="$t('业绩类型')">{{ customer.isNew ?$t('新客户') : $t('老客户') }}</el-descriptions-item>
<el-descriptions-item :label="$t('客户生日')">{{ parseTime(customer.birthday, "{y}-{m}-{d}") }} </el-descriptions-item>
<el-descriptions-item :label="$t('业绩类型')">{{ customer.isNew ? $t("新客户") : $t("老客户") }} </el-descriptions-item>
<el-descriptions-item :label="$t('资源类型')">
<dict-tag :type="DICT_TYPE.ECW_CUSTOMER_RESOURCE_TYPE" :value="customer.resourceType"></dict-tag>
</el-descriptions-item>
<el-descriptions-item :label="$t('客户英文名称')">{{customer.nameEn }}</el-descriptions-item>
<el-descriptions-item :label="$t('客户英文名称')">{{ customer.nameEn }}</el-descriptions-item>
<el-descriptions-item :label="$t('联系地址')">{{ customer.address }}</el-descriptions-item>
<el-descriptions-item :label="$t('首次成交时间')">{{ customer.firstDealTime }}</el-descriptions-item>
<el-descriptions-item :label="$t('掉入公海时间')">{{ customer.estimateEnterOpenSeaTime || customer.enterOpenSeaTime }}</el-descriptions-item>
<el-descriptions-item :label="$t('获取方式')">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_GET_METHOD, customer.getMethod) }}</el-descriptions-item>
<el-descriptions-item :label="$t('创建入口')">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_FROM, customer.createFrom) }}</el-descriptions-item>
<el-descriptions-item :label="$t('掉入公海时间')">
{{ customer.estimateEnterOpenSeaTime || customer.enterOpenSeaTime }}
</el-descriptions-item>
<el-descriptions-item :label="$t('获取方式')">
{{ getDictDataLabel(DICT_TYPE.CUSTOMER_GET_METHOD, customer.getMethod) }}
</el-descriptions-item>
<el-descriptions-item :label="$t('创建入口')">
{{ getDictDataLabel(DICT_TYPE.CUSTOMER_FROM, customer.createFrom) }}
</el-descriptions-item>
<el-descriptions-item :label="$t('捞取时间')">{{ customer.catchTime }}</el-descriptions-item>
<el-descriptions-item :label="$t('归属时间')">{{ customer.customerServiceConfirmedTime }}</el-descriptions-item>
<el-descriptions-item :label="$t('归属时间')">{{ customer.customerServiceConfirmedTime }} </el-descriptions-item>
<el-descriptions-item :label="$t('创建人')">{{ customer.founderName }}</el-descriptions-item>
<el-descriptions-item :label="$t('创建时间')">{{ parseTime(customer.createTime) }}</el-descriptions-item>
<el-descriptions-item :label="$t('最后更新人')">{{ customer.updaterName }}</el-descriptions-item>
......@@ -58,62 +76,18 @@
<el-tabs v-model="activeName" style="margin-top: 15px" type="border-card">
<el-tab-pane name="contact" :label="$t('联系人')">
<el-table
:data="customerContacts"
style="width: 100%"
border
>
<el-table-column
prop="department"
:label="$t('部门')"
>
</el-table-column>
<el-table-column
prop="position"
:label="$t('职位')"
>
</el-table-column>
<el-table-column
prop="name"
:label="$t('联系人')"
>
</el-table-column>
<el-table-column
prop="nameEn"
:label="$t('联系人英文名称')"
>
</el-table-column>
<el-table-column
prop="phoneNew"
:label="$t('联系方式')"
>
<template v-slot="{row}">
+{{ row.areaCode}} {{row.phoneNew}}
</template>
</el-table-column>
<el-table-column
prop="userid"
:label="$t('关联账号')"
:formatter="userIdFormatter"
>
</el-table-column>
<el-table-column
prop="social"
:label="$t('社交软件')"
:formatter="(row, column, cellValue) => getDictDataLabel(DICT_TYPE.SOCIAL, cellValue)"
>
</el-table-column>
<el-table-column
prop="socialNumber"
:label="$t('社交软件号码')"
>
</el-table-column>
<el-table-column
prop="email"
:label="$t('邮箱')"
>
<el-table :data="customerContacts" style="width: 100%" border>
<el-table-column prop="department" :label="$t('部门')"> </el-table-column>
<el-table-column prop="position" :label="$t('职位')"> </el-table-column>
<el-table-column prop="name" :label="$t('联系人')"> </el-table-column>
<el-table-column prop="nameEn" :label="$t('联系人英文名称')"> </el-table-column>
<el-table-column prop="phoneNew" :label="$t('联系方式')">
<template v-slot="{ row }"> +{{ row.areaCode }} {{ row.phoneNew }} </template>
</el-table-column>
<el-table-column prop="userid" :label="$t('关联账号')" :formatter="userIdFormatter"> </el-table-column>
<el-table-column prop="social" :label="$t('社交软件')" :formatter="(row, column, cellValue) => getDictDataLabel(DICT_TYPE.SOCIAL, cellValue)"> </el-table-column>
<el-table-column prop="socialNumber" :label="$t('社交软件号码')"> </el-table-column>
<el-table-column prop="email" :label="$t('邮箱')"> </el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane name="order" :label="$t('订单')">
......@@ -124,117 +98,71 @@
<dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model="queryParams.transportId" formatter="number" />
</el-form-item>
<el-form-item :label="$t('订单状态:')">
<dict-selector :type="DICT_TYPE.ORDER_STATUS" v-model="queryParams.status"/>
<dict-selector :type="DICT_TYPE.ORDER_STATUS" v-model="queryParams.status" />
</el-form-item>
<el-form-item :label="$t('报关方式:')">
<dict-selector
:type="DICT_TYPE.ECW_CUSTOMS_TYPE"
v-model="queryParams.customsTypes"
multiple
/>
<dict-selector :type="DICT_TYPE.ECW_CUSTOMS_TYPE" v-model="queryParams.customsTypes" multiple />
</el-form-item>
<el-form-item :label="$t('控货')">
<dict-selector
:type="DICT_TYPE.INFRA_BOOLEAN_STRING"
v-model="queryParams.isCargoControl"
/>
<dict-selector :type="DICT_TYPE.INFRA_BOOLEAN_STRING" v-model="queryParams.isCargoControl" />
</el-form-item>
<el-form-item :label="$t('入仓时间:')">
<el-date-picker v-model="rucangtime"
@change="changeDate"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetimerange"
range-separator="-"
:start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" />
<el-date-picker v-model="rucangtime" @change="changeDate" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="datetimerange" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" />
</el-form-item>
<el-form-item :label="$t('目的国')" prop="destCountryId">
<el-select
v-model="destCountryId"
multiple
:placeholder="$t('请选择目的国')"
clearable
@change="handleQuery"
>
<el-option
v-for="item in AddressProvince"
:key="item.guojia"
:label="item.guojiaName"
:value="item.guojia"
></el-option>
<el-select v-model="destCountryId" multiple :placeholder="$t('请选择目的国')" clearable @change="handleQuery">
<el-option v-for="item in AddressProvince" :key="item.guojia" :label="item.guojiaName" :value="item.guojia"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('目的城市')" prop="objectiveId">
<el-select
v-model="objectiveId"
multiple
:placeholder="$t('请选择目的城市')"
style="width: 200px"
clearable
@change="handleQuery"
>
<el-option
v-for="item in AddressCity"
:key="item.shi"
:label="item.shiName"
:value="item.shi"
></el-option>
<el-select v-model="objectiveId" multiple :placeholder="$t('请选择目的城市')" style="width: 200px" clearable @change="handleQuery">
<el-option v-for="item in AddressCity" :key="item.shi" :label="item.shiName" :value="item.shi"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('目的仓')" prop="destWarehouseId">
<el-select
v-model="destWarehouseId"
multiple
:placeholder="$t('请选择目的仓')"
style="width: 200px"
clearable
@change="handleQuery"
>
<el-option
v-for="item in AddressTown"
:key="item.id"
:label="item.titleZh"
:value="item.id"
></el-option>
<el-select v-model="destWarehouseId" multiple :placeholder="$t('请选择目的仓')" style="width: 200px" clearable @change="handleQuery">
<el-option v-for="item in AddressTown" :key="item.id" :label="item.titleZh" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="getorderList">{{$t('搜索')}}</el-button>
<el-button type="primary" @click="handleOrderReset">{{$t('重置')}}</el-button>
<el-button type="primary" @click="getorderList">{{ $t("搜索") }}</el-button>
<el-button type="primary" @click="handleOrderReset">{{ $t("重置") }}</el-button>
</el-form-item>
</el-form>
</div>
<el-descriptions :column="2">
<el-descriptions-item :label="$t('海空联运/海运拼柜/海运整柜/专线空运')">{{orderStatisticsObj.hklyTotal || 0}}/{{orderStatisticsObj.hypgTotal || 0 }}/{{orderStatisticsObj.hyzgTotal || 0}}/{{orderStatisticsObj.zxkyTotal || 0}}</el-descriptions-item>
<el-descriptions-item :label="$t('最后交易日期')">{{orderStatisticsObj.lastBusinessDate}}</el-descriptions-item>
<el-descriptions-item :label="$t('全部订单/控货订单')">{{orderStatisticsObj.allOrderTotal || 0}}/{{orderStatisticsObj.controlOrderTotal || 0}}</el-descriptions-item>
<el-descriptions-item :label="$t('最后交易单号')">{{orderStatisticsObj.lastBusinessOrderNo}}</el-descriptions-item>
<el-descriptions-item :label="$t('报价/下单/入仓')">{{orderStatisticsObj.offerOrderTotal || 0}}/{{orderStatisticsObj.pickOrderTotal || 0}}/{{orderStatisticsObj.wareHousingTotal || 0}}</el-descriptions-item>
<el-descriptions-item :label="$t('储存量')">{{orderStatisticsObj.stock || 0}}</el-descriptions-item>
<el-descriptions-item :label="$t('已出货订单')">{{orderStatisticsObj.shipmentTotal || 0}}</el-descriptions-item>
<el-descriptions-item :label="$t('海空联运/海运拼柜/海运整柜/专线空运')"> {{ orderStatisticsObj.hklyTotal || 0 }}/{{ orderStatisticsObj.hypgTotal || 0 }}/{{ orderStatisticsObj.hyzgTotal || 0 }}/{{ orderStatisticsObj.zxkyTotal || 0 }} </el-descriptions-item>
<el-descriptions-item :label="$t('最后交易日期')">{{ orderStatisticsObj.lastBusinessDate }} </el-descriptions-item>
<el-descriptions-item :label="$t('全部订单/控货订单')"> {{ orderStatisticsObj.allOrderTotal || 0 }}/{{ orderStatisticsObj.controlOrderTotal || 0 }} </el-descriptions-item>
<el-descriptions-item :label="$t('最后交易单号')">{{ orderStatisticsObj.lastBusinessOrderNo }} </el-descriptions-item>
<el-descriptions-item :label="$t('报价/下单/入仓')"> {{ orderStatisticsObj.offerOrderTotal || 0 }}/{{ orderStatisticsObj.pickOrderTotal || 0 }}/{{ orderStatisticsObj.wareHousingTotal || 0 }} </el-descriptions-item>
<el-descriptions-item :label="$t('储存量')">{{ orderStatisticsObj.stock || 0 }}</el-descriptions-item>
<el-descriptions-item :label="$t('已出货订单')">{{ orderStatisticsObj.shipmentTotal || 0 }} </el-descriptions-item>
</el-descriptions>
<el-table :data="orderList">
<el-table-column :label="$t('订单编号')" width="120px" align="center">
<template slot-scope="{row}">
<el-link type="primary" @click.native="$router.push('/order/detail?orderId=' + row.orderId)">{{row.orderNo}}</el-link>
<template slot-scope="{ row }">
<el-link type="primary" @click.native="$router.push('/order/detail?orderId=' + row.orderId)">
{{ row.orderNo }}
</el-link>
</template>
</el-table-column>
<el-table-column :label="$t('报价单号')" align="center" width="120px">
<template slot-scope="{row}">
<el-link type="primary" @click.native="$router.push('/offer/detail?offerId=' + row.offerId)">{{row.offerNo}}</el-link>
<template slot-scope="{ row }">
<el-link type="primary" @click.native="$router.push('/offer/detail?offerId=' + row.offerId)">
{{ row.offerNo }}
</el-link>
</template>
</el-table-column>
<el-table-column :label="$t('唛头')" align="center" prop="marks" />
<el-table-column :label="$t('总箱数/入仓箱数')" align="center" prop="sumNum">
<template slot-scope="{row}">
{{row.totalNum}}{{$t('')}}/{{row.sumNum}}{{$t('')}}
</template>
<template slot-scope="{ row }"> {{ row.totalNum }}{{ $t("") }}/{{ row.sumNum }}{{ $t("") }} </template>
</el-table-column>
<el-table-column :label="$t('体积/重量')" align="center" prop="sumWeight">
<template slot-scope="{row}">
<template slot-scope="{ row }">
<!--入仓前是填单数据,入仓后是入仓数据-->
<!-- <template v-if="row.inWarehouseState <= 1">{{row.costVO.totalVolume}}m³ /{{row.costVO.totalWeight}}Kg</template>-->
<!-- <template v-else>{{row.sumVolume}}m³ /{{row.sumWeight}}Kg</template>-->
<!-- <template v-if="row.inWarehouseState <= 1">{{row.costVO.totalVolume}}m³ /{{row.costVO.totalWeight}}Kg</template>-->
<!-- <template v-else>{{row.sumVolume}}m³ /{{row.sumWeight}}Kg</template>-->
<component
:is="row.orderType == 2 ? 'el-tooltip' : 'div'"
class="item"
......@@ -242,51 +170,53 @@
color: row.orderType == 2 ? 'red' : null
}"
effect="dark"
:content="(row.wvolume||0)+'m³'"
placement="bottom">
<div v-if="row.sumNum > 0">{{row.sumVolume}}m³ /{{row.sumWeight}}Kg</div>
<div v-else>{{row.costVO.totalVolume}}m³ /{{row.costVO.totalWeight}}Kg</div>
:content="(row.wvolume || 0) + 'm³'"
placement="bottom"
>
<div v-if="row.sumNum > 0">{{ row.sumVolume }}m³ /{{ row.sumWeight }}Kg</div>
<div v-else>{{ row.costVO.totalVolume }}m³ /{{ row.costVO.totalWeight }}Kg</div>
</component>
</template>
</el-table-column>
<el-table-column :label="$t('始发仓')" align="center" prop="startWarehouseName">
<template slot-scope="{row}">
{{row.startWarehouseName}}
<span style="color:red" v-if="row.isExternalWarehouse">({{$t('外部仓')}})</span>
<template slot-scope="{ row }">
{{ row.startWarehouseName }}
<span style="color: red" v-if="row.isExternalWarehouse">({{ $t("外部仓") }})</span>
</template>
</el-table-column>
<el-table-column :label="$t('运输方式/目的地')" align="center" prop="transportId">
<template slot-scope="{row}">
<dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="row.transportId" /> / {{row.objectiveName}}
<template slot-scope="{ row }">
<dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="row.transportId" />
/ {{ row.objectiveName }}
</template>
</el-table-column>
<el-table-column :label="$t('控货')" align="center" prop="transportId">
<template slot-scope="{row}">
<template slot-scope="{ row }">
<dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="row.isCargoControl" />
</template>
</el-table-column>
<el-table-column :label="$t('订单状态')" align="center" prop="statusMsg">
<!-- <template slot-scope="scope">-->
<!-- <dict-tag :type="DICT_TYPE.ORDER_STATUS" :value="scope.row.status" />-->
<!-- </template>-->
<!-- <template slot-scope="scope">-->
<!-- <dict-tag :type="DICT_TYPE.ORDER_STATUS" :value="scope.row.status" />-->
<!-- </template>-->
</el-table-column>
<el-table-column :label="$t('创建时间')" align="center" prop="createTime" />
<el-table-column :label="$t('入仓时间')">
<template v-slot="{row}">
{{parseTime(row.rucangTime)}}
<template v-slot="{ row }">
{{ parseTime(row.rucangTime) }}
</template>
</el-table-column>
<el-table-column :label="$t('装柜/出仓时间')" align="center" prop="loadTime" />
<el-table-column :label="$t('卸柜/到仓时间')" align="center" prop="unloadTime" />
<el-table-column :label="$t('提货率')" align="center">
<template v-slot="{row}">
{{row.pickNum | deliveryRate(row.sumNum)}}
<template v-slot="{ row }">
{{ row.pickNum | deliveryRate(row.sumNum) }}
</template>
</el-table-column>
<el-table-column :label="$t('客户经理')" align="center" prop="customerServiceName" />
<el-table-column :label="$t('业绩归属客户方')" align="center" prop="customerName" />
</el-table>
<pagination @pagination="getorderList" :page.sync="queryParams.page" :limit.sync="queryParams.rows" :total="orderTotal" ></pagination>
<pagination @pagination="getorderList" :page.sync="queryParams.page" :limit.sync="queryParams.rows" :total="orderTotal"></pagination>
</el-card>
</el-tab-pane>
<el-tab-pane name="quote" :label="$t('报价')">
......@@ -294,83 +224,36 @@
<div slot="header" class="clearfix">
<el-form :inline="true" size="small">
<el-form-item :label="$t('目的国')" prop="destCountryId">
<el-select
v-model="destCountryId"
multiple
:placeholder="$t('请选择目的国')"
clearable
@change="handleQuery"
>
<el-option
v-for="item in AddressProvince"
:key="item.guojia"
:label="item.guojiaName"
:value="item.guojia"
></el-option>
<el-select v-model="destCountryId" multiple :placeholder="$t('请选择目的国')" clearable @change="handleQuery">
<el-option v-for="item in AddressProvince" :key="item.guojia" :label="item.guojiaName" :value="item.guojia"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('目的城市')" prop="objectiveId">
<el-select
v-model="objectiveId"
multiple
:placeholder="$t('请选择目的城市')"
style="width: 200px"
clearable
@change="handleQuery"
>
<el-option
v-for="item in AddressCity"
:key="item.shi"
:label="item.shiName"
:value="item.shi"
></el-option>
<el-select v-model="objectiveId" multiple :placeholder="$t('请选择目的城市')" style="width: 200px" clearable @change="handleQuery">
<el-option v-for="item in AddressCity" :key="item.shi" :label="item.shiName" :value="item.shi"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('目的仓')" prop="destWarehouseId">
<el-select
v-model="destWarehouseId"
multiple
:placeholder="$t('请选择目的仓')"
style="width: 200px"
clearable
@change="handleQuery"
>
<el-option
v-for="item in AddressTown"
:key="item.id"
:label="item.titleZh"
:value="item.id"
></el-option>
<el-select v-model="destWarehouseId" multiple :placeholder="$t('请选择目的仓')" style="width: 200px" clearable @change="handleQuery">
<el-option v-for="item in AddressTown" :key="item.id" :label="item.titleZh" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="getInfoListOfferPage">{{$t('搜索')}}</el-button>
<el-button type="primary" @click="handleOfferReset">{{$t('重置')}}</el-button>
<el-button type="primary" @click="getInfoListOfferPage">{{ $t("搜索") }}</el-button>
<el-button type="primary" @click="handleOfferReset">{{ $t("重置") }}</el-button>
</el-form-item>
</el-form>
</div>
<el-table
:data="infoListOfferList"
style="width: 100%"
>
<el-table-column
type="index"
:label="$t('序号')"
>
</el-table-column>
<el-table-column
:label="$t('报价单号')"
width="160px"
>
<template slot-scope="{row}">
<el-link type="primary" @click.native="$router.push('/offer/detail?offerId=' + row.offerId)">{{row.number}}</el-link>
<el-table :data="infoListOfferList" style="width: 100%">
<el-table-column type="index" :label="$t('序号')"> </el-table-column>
<el-table-column :label="$t('报价单号')" width="160px">
<template slot-scope="{ row }">
<el-link type="primary" @click.native="$router.push('/offer/detail?offerId=' + row.offerId)">
{{ row.number }}
</el-link>
</template>
</el-table-column>
<el-table-column
prop="orderNo"
:label="$t('订单号')"
>
</el-table-column>
<el-table-column prop="orderNo" :label="$t('订单号')"> </el-table-column>
<!--
<el-table-column
prop="consignorName"
......@@ -381,82 +264,42 @@
</template>
</el-table-column>
-->
<el-table-column
prop="relationName"
:label="$t('联系人')"
>
<el-table-column prop="relationName" :label="$t('联系人')"> </el-table-column>
<el-table-column :label="$t('联系方式')">
<template v-slot="{ row }"> +{{ row.relationAreaCode }}{{ row.relationPhone }} </template>
</el-table-column>
<el-table-column
:label="$t('联系方式')"
>
<template v-slot="{row}">
+{{ row.relationAreaCode }}{{ row.relationPhone }}
<el-table-column :label="$t('始发仓')">
<template v-slot="{ row }">
{{ getWarehouse(row.startWarehouseId) }}
</template>
</el-table-column>
<el-table-column
:label="$t('始发仓')"
>
<template v-slot="{row}">
{{getWarehouse(row.startWarehouseId)}}
<el-table-column :label="$t('运输方式/目的地')">
<template slot-scope="{ row }">
<dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="row.transportType" />
/ {{ row.objectiveName }}
</template>
</el-table-column>
<el-table-column
:label="$t('运输方式/目的地')"
>
<template slot-scope="{row}">
<dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="row.transportType" /> / {{row.objectiveName}}
<el-table-column :label="$t('销售阶段')">
<template v-slot="{ row }">
{{ STATUS[row.status] }}
</template>
</el-table-column>
<el-table-column
:label="$t('销售阶段')"
>
<template v-slot="{row}">
{{STATUS[row.status]}}
</template>
</el-table-column>
<el-table-column
:label="$t('预计销售额')"
>
<template slot-scope="{row}" v-if="row.estCostVO">
<el-table-column :label="$t('预计销售额')">
<template slot-scope="{ row }" v-if="row.estCostVO">
<div class="" v-for="(item, feeIndex) in row.estCostVO.feeDtoList" :key="feeIndex">
<dict-tag :type="DICT_TYPE.ECW_COST_FEE_TYPE" :value="item.feeType" />
{{item.amount}} {{currencyMap[item.currencyId]}}
{{ item.amount }} {{ currencyMap[item.currencyId] }}
</div>
</template>
</el-table-column>
<el-table-column
prop="stopTime"
:label="$t('预计结束时间')"
>
</el-table-column>
<el-table-column
prop="businessManagerName"
:label="$t('负责人')"
>
</el-table-column>
<el-table-column
prop="importance"
:label="$t('重要程度')"
>
</el-table-column>
<el-table-column
prop="importance"
:label="$t('报价有效期')"
>
<template v-slot="{row}">
{{ row.startTime }} - {{ row.endTime }}
</template>
</el-table-column>
<el-table-column
prop="businessManagerName"
:label="$t('客户经理')"
>
</el-table-column>
<el-table-column
prop="createTime"
:label="$t('创建时间')"
>
<el-table-column prop="stopTime" :label="$t('预计结束时间')"> </el-table-column>
<el-table-column prop="businessManagerName" :label="$t('负责人')"> </el-table-column>
<el-table-column prop="importance" :label="$t('重要程度')"> </el-table-column>
<el-table-column prop="importance" :label="$t('报价有效期')">
<template v-slot="{ row }"> {{ row.startTime }} - {{ row.endTime }} </template>
</el-table-column>
<el-table-column prop="businessManagerName" :label="$t('客户经理')"> </el-table-column>
<el-table-column prop="createTime" :label="$t('创建时间')"> </el-table-column>
<el-table-column :label="$t('操作')" align="center" fixed="right" class-name="small-padding fixed-width">
<template slot-scope="scope">
<!--
......@@ -472,20 +315,22 @@
<el-dropdown>
<el-button icon="el-icon-plus" circle type="primary"></el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="$router.push('/offer/detail?offerId=' + scope.row.offerId)" v-hasPermi="['ecw:offer:show']">{{$t('详情')}}</el-dropdown-item>
<el-dropdown-item @click.native="$router.push('/offer/edit?id=' + scope.row.offerId)" v-if="[1,2,3,7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:update']">{{$t('编辑')}}</el-dropdown-item>
<el-dropdown-item @click.native="$router.push('/offer/logList?offerId=' + scope.row.offerId)" v-if="[1,3,7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:loglist']">{{$t('跟进')}}</el-dropdown-item>
<el-dropdown-item @click.native="$router.push(`/offer/result?offerId=${scope.row.offerId}&number=${scope.row.number}`)" v-if="[3,7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:result']">{{$t('结果')}}</el-dropdown-item>
<el-dropdown-item @click.native="$router.push('/offer/special?offerId=' + scope.row.offerId)" v-if="[1,3,7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:discount','ecw:offer:commission']">{{$t('特价')}}</el-dropdown-item>
<el-dropdown-item @click.native="cancel(scope.row.offerId)" v-if="[1,3,7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:cancel']">{{$t('取消')}}</el-dropdown-item>
<el-dropdown-item @click.native="recovery(scope.row.offerId)" v-if="[0].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:recovery']">{{$t('恢复')}}</el-dropdown-item>
<el-dropdown-item @click.native="deleteOffer(scope.row.offerId)" v-if="[0,1,2,3,4,5,6,7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:delete']">{{$t('删除')}}</el-dropdown-item>
<el-dropdown-item @click.native="$router.push('/offer/detail?offerId=' + scope.row.offerId)" v-hasPermi="['ecw:offer:show']">{{ $t("详情") }} </el-dropdown-item>
<el-dropdown-item @click.native="$router.push('/offer/edit?id=' + scope.row.offerId)" v-if="[1, 2, 3, 7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:update']">{{ $t("编辑") }} </el-dropdown-item>
<el-dropdown-item @click.native="$router.push('/offer/logList?offerId=' + scope.row.offerId)" v-if="[1, 3, 7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:loglist']">{{ $t("跟进") }} </el-dropdown-item>
<el-dropdown-item @click.native="$router.push(`/offer/result?offerId=${scope.row.offerId}&number=${scope.row.number}`)" v-if="[3, 7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:result']">{{ $t("结果") }} </el-dropdown-item>
<el-dropdown-item @click.native="$router.push('/offer/special?offerId=' + scope.row.offerId)" v-if="[1, 3, 7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:discount', 'ecw:offer:commission']">{{ $t("特价") }} </el-dropdown-item>
<el-dropdown-item @click.native="cancel(scope.row.offerId)" v-if="[1, 3, 7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:cancel']">{{ $t("取消") }} </el-dropdown-item>
<el-dropdown-item @click.native="recovery(scope.row.offerId)" v-if="[0].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:recovery']">
{{ $t("恢复") }}
</el-dropdown-item>
<el-dropdown-item @click.native="deleteOffer(scope.row.offerId)" v-if="[0, 1, 2, 3, 4, 5, 6, 7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:delete']">{{ $t("删除") }} </el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<pagination @pagination="getInfoListOfferPage" :page.sync="infoListOfferFrom.pageNo" :limit.sync="infoListOfferFrom.pageSize" :total="infoListOfferTotal" ></pagination>
<pagination @pagination="getInfoListOfferPage" :page.sync="infoListOfferFrom.pageNo" :limit.sync="infoListOfferFrom.pageSize" :total="infoListOfferTotal"></pagination>
</el-card>
</el-tab-pane>
<el-tab-pane name="follow" :label="$t('跟进')">
......@@ -493,18 +338,22 @@
<div slot="header" class="clearfix">
<el-form size="small" :inline="true" label-width="100px">
<el-form-item :label="$t('跟进类型')">
<dict-selector clearable :type="DICT_TYPE.CUSTOMER_FOLLOWUP_TYPE" v-model="followForm.followType" @change="handleQuery"></dict-selector>
<el-select clearable multiple v-model="followForm.followTypes" :placeholder="$t('请选择')" size="small" @change="handleQuery">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_FOLLOWUP_TYPE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item :label="$t('跟进方式')">
<dict-selector clearable :type="DICT_TYPE.CUSTOMER_FOLLOWUP_METHOD" v-model="followForm.followMethod" @change="handleQuery"></dict-selector>
<el-select clearable multiple v-model="followForm.followMethods" :placeholder="$t('请选择')" size="small" @change="handleQuery">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_FOLLOWUP_METHOD)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item :label="$t('跟进结果')">
<el-select clearable v-model="followForm.resultType" :placeholder="$t('请选择')" size="small" @change="handleQuery">
<el-select clearable multiple v-model="followForm.resultTypes" :placeholder="$t('请选择')" size="small" @change="handleQuery">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_FOLLOWUP_RESULT_TYPE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item :label="$t('跟进状态')">
<el-select clearable v-model="followForm.status" :placeholder="$t('请选择')" size="small" @change="handleQuery">
<el-select clearable multiple v-model="followForm.statuses" :placeholder="$t('请选择')" size="small" @change="handleQuery">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_FOLLOWUP_STATUS)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="dict.value" />
</el-select>
</el-form-item>
......@@ -517,21 +366,28 @@
</el-form-item>
-->
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="getCustomerFollowList">{{
$t("搜索")
}}</el-button>
<el-button type="primary" @click="()=>{
followForm = { pageNo:1,pageSize:10}; getCustomerFollowList();
}">{{$t('重置')}}</el-button>
<el-button type="success" @click="customerFollowFn('follow')" v-hasPermi="['ecw:customer:follow-create']">{{$t('新增')}}</el-button>
<el-button type="warning" @click="handleExport" v-hasPermi="['ecw:customer:follow-export']">{{$t('导出')}}</el-button>
<el-button type="primary" icon="el-icon-search" @click="getCustomerFollowList">{{ $t("搜索") }} </el-button>
<el-button
type="primary"
@click="
() => {
followForm = { pageNo: 1, pageSize: 10 }
getCustomerFollowList()
}
"
>{{ $t("重置") }}
</el-button>
<el-button type="success" @click="customerFollowFn('follow')" v-hasPermi="['ecw:customer:follow-create']">{{ $t("新增") }} </el-button>
<el-button type="warning" @click="handleExport" v-hasPermi="['ecw:customer:follow-export']">
{{ $t("导出") }}
</el-button>
</el-form-item>
</el-form>
</div>
<el-table :data="customerFollowList" style="width: 100%">
<el-table-column prop="number" :label="$t('编号')" width="120">
<template slot-scope="scope">
<a href="javascript:void(0)" @click="handleCustomerFollowLink(scope.row)" class="link-type">{{scope.row.number}}</a>
<a href="javascript:void(0)" @click="handleCustomerFollowLink(scope.row)" class="link-type">{{ scope.row.number }}</a>
</template>
</el-table-column>
<el-table-column prop="followType" :label="$t('跟进类型')" :formatter="(row, column, cellValue) => getDictDataLabel(DICT_TYPE.CUSTOMER_FOLLOWUP_TYPE, cellValue)"></el-table-column>
......@@ -571,8 +427,8 @@
</el-table-column>
<el-table-column width="150px" :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-edit" @click="handleCustomerFollow(scope.row, scope.row.status === 0)" v-hasPermi="['ecw:customer:follow-update']">{{ $t("编辑") }}</el-button>
<el-button size="mini" type="text" icon="el-icon-collection" @click="handleCustomerFollow(scope.row, true)" v-has-permi="['ecw:customer:follow-add-plan']">{{ $t("增加计划") }}</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleCustomerFollow(scope.row, scope.row.status === 0)" v-hasPermi="['ecw:customer:follow-update']">{{ $t("编辑") }} </el-button>
<el-button size="mini" type="text" icon="el-icon-collection" @click="handleCustomerFollow(scope.row, true)" v-has-permi="['ecw:customer:follow-add-plan']">{{ $t("增加计划") }} </el-button>
</template>
</el-table-column>
</el-table>
......@@ -588,95 +444,98 @@
<el-table-column :label="$t('账单')" prop="receiptNo"></el-table-column>
<el-table-column :label="$t('订单号')" prop="orderNo"></el-table-column>
<el-table-column :label="$t('箱数')" prop="num"></el-table-column>
<el-table-column :label="$t('方数')" prop="volume" ></el-table-column>
<el-table-column :label="$t('重量')" prop="weight" ></el-table-column>
<el-table-column :label="$t('方数')" prop="volume"></el-table-column>
<el-table-column :label="$t('重量')" prop="weight"></el-table-column>
<el-table-column :label="$t('类型')">
<template v-slot="{row}">
<template v-slot="{ row }">
<dict-tag :type="DICT_TYPE.PAYMENT_TYPE" :value="row.collectionType" />
</template>
</el-table-column>
<el-table-column :label="$t('费用类型')">
<template v-slot="{row}">
<template v-slot="{ row }">
<dict-tag :type="DICT_TYPE.FEE_TYPE" :value="row.feeType" />
</template>
</el-table-column>
<el-table-column :label="$t('金额')" prop="totalAmount">
</el-table-column>
<el-table-column :label="$t('金额')" prop="totalAmount"> </el-table-column>
<el-table-column :label="$t('已核销比例')" prop="writeOffScale"></el-table-column>
<el-table-column :label="$t('实收日期')">
<template v-slot="{row}">
{{parseTime(row.writeOffAt)}}
<template v-slot="{ row }">
{{ parseTime(row.writeOffAt) }}
</template>
</el-table-column>
<el-table-column :label="$t('业务员')" prop="salesmanName"></el-table-column>
</el-table>
<pagination v-show="infoListReceiptList.length" :total="infoListReceiptTotal" :page.sync="infoListReceiptFrom.pageNo" :limit.sync="infoListReceiptFrom.pageSize"
@pagination="infoListReceiptFn"/>
<pagination v-show="infoListReceiptList.length" :total="infoListReceiptTotal" :page.sync="infoListReceiptFrom.pageNo" :limit.sync="infoListReceiptFrom.pageSize" @pagination="infoListReceiptFn" />
</el-tab-pane>
<el-tab-pane name="empower" :label="$t('品牌授权')">
<el-table border style="width:100%" :data="brandAuthorizationList">
<el-table border style="width: 100%" :data="brandAuthorizationList">
<el-table-column type="index" :prop="$t('序号')"></el-table-column>
<el-table-column :label="$t('中文标题')" prop="titleZh" ></el-table-column>
<el-table-column :label="$t('中文标题')" prop="titleZh"></el-table-column>
<el-table-column prop="titleEn" :label="$t('英文标题')"></el-table-column>
<el-table-column :label="$t('有无备案')">
<template v-slot="{row}">
<template v-slot="{ row }">
<dict-tag :type="DICT_TYPE.BRAND_REG_TYPE" :value="row.filing" />
</template>
</el-table-column>
<el-table-column :label="$t('授权开始')">
<template v-slot="{row}">
{{parseTime(row.startTime)}}
<template v-slot="{ row }">
{{ parseTime(row.startTime) }}
</template>
</el-table-column>
<el-table-column :label="$t('授权结束')">
<template v-slot="{row}">
{{parseTime(row.endTime)}}
<template v-slot="{ row }">
{{ parseTime(row.endTime) }}
</template>
</el-table-column>
<el-table-column :label="$t('授权证明')">
<template v-slot="{row}">
<template v-slot="{ row }">
<div v-if="!!row.fileUrl && row.fileUrl.length > 0">
<span v-for="(item, index) in (row.fileUrl||'').split(',')">
<a :href="item" target="_blank">{{$t('附件')}}{{ index + 1 }}</a>,
<span v-for="(item, index) in (row.fileUrl || '').split(',')">
<a :href="item" target="_blank">{{ $t("附件") }}{{ index + 1 }}</a
>,
</span>
</div>
</template>
</el-table-column>
<el-table-column
prop="feeScale"
:formatter="(row) => getDictDataLabel(DICT_TYPE.BRAND_CUSTOMER_CHARGING_MODEL, row.feeScale)"
:label="$t('收费标准')">
</el-table-column>
<el-table-column
prop="createUsername"
:label="$t('添加人')">
</el-table-column>
<el-table-column prop="feeScale" :formatter="(row) => getDictDataLabel(DICT_TYPE.BRAND_CUSTOMER_CHARGING_MODEL, row.feeScale)" :label="$t('收费标准')"> </el-table-column>
<el-table-column prop="createUsername" :label="$t('添加人')"> </el-table-column>
<el-table-column :label="$t('创建时间')">
<template v-slot="{row}">
{{parseTime(row.createTime)}}
<template v-slot="{ row }">
{{ parseTime(row.createTime) }}
</template>
</el-table-column>
</el-table>
<pagination v-show="brandAuthorizationTotal.length" :total="brandAuthorizationTotal" :page.sync="brandAuthorizationFrom.pageNo" :limit.sync="brandAuthorizationFrom.pageSize"
@pagination="getBrankByCustomerList"/>
<pagination v-show="brandAuthorizationTotal.length" :total="brandAuthorizationTotal" :page.sync="brandAuthorizationFrom.pageNo" :limit.sync="brandAuthorizationFrom.pageSize" @pagination="getBrankByCustomerList" />
</el-tab-pane>
<el-tab-pane name="deliver" :label="$t('发货评估')">
<el-descriptions :column="2">
<el-descriptions-item :label="$t('客户类别')">
{{ getDictDatas2(DICT_TYPE.CUSTOMER_TYPE, (customer.type||'').split(',')).map(e => isChinese ? e.label : e.labelEn).join(', ')}}
{{
getDictDatas2(DICT_TYPE.CUSTOMER_TYPE, (customer.type || "").split(","))
.map((e) => (isChinese ? e.label : e.labelEn))
.join(", ")
}}
</el-descriptions-item>
<el-descriptions-item :label="$t('角色')">
{{ getDictDatas2(DICT_TYPE.CUSTOMER_ROLE, (customer.roles||'').split(',')).map(e => isChinese ? e.label : e.labelEn).join(', ')}}
{{
getDictDatas2(DICT_TYPE.CUSTOMER_ROLE, (customer.roles || "").split(","))
.map((e) => (isChinese ? e.label : e.labelEn))
.join(", ")
}}
</el-descriptions-item>
<el-descriptions-item :label="$t('出货渠道')">
{{ getDictDatas2(DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE, (customer.transportType||'').split(',')).map(e => isChinese ? e.label : e.labelEn).join(', ') }}
{{
getDictDatas2(DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE, (customer.transportType || "").split(","))
.map((e) => (isChinese ? e.label : e.labelEn))
.join(", ")
}}
<!-- <dict-tag v-if="customer.transportType" v-for="item in (customer.transportType || '').split(',')" :type="DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE" :value="item"></dict-tag>-->
</el-descriptions-item>
<el-descriptions-item :label="$t('常提货网点')">{{ $l(customer,'pickupPointName') }}</el-descriptions-item>
<el-descriptions-item :label="$t('常提货网点')">{{ $l(customer, "pickupPointName") }} </el-descriptions-item>
<el-descriptions-item :label="$t('业务国家')">
{{ isChinese ? customer.busiCountryNameZh : customer.busiCountryNameEn}}
{{ isChinese ? customer.busiCountryNameZh : customer.busiCountryNameEn }}
</el-descriptions-item>
<el-descriptions-item :label="$t('主营类别')">{{ $l(customer,'productTypeName') }}</el-descriptions-item>
<el-descriptions-item :label="$t('主营类别')">{{ $l(customer, "productTypeName") }}</el-descriptions-item>
<el-descriptions-item :label="$t('年度发货量')">{{ customer.weightYearly }}</el-descriptions-item>
<el-descriptions-item :label="$t('主要竞争对手')">{{ customer.competitorNames }}</el-descriptions-item>
<el-descriptions-item :label="$t('年度发货次数')">{{ customer.numYearly }}</el-descriptions-item>
......@@ -684,18 +543,24 @@
</el-tab-pane>
<el-tab-pane name="financial" :label="$t('财务资料')">
<el-card class="box-card">
<div slot="header">{{$t('公司信息')}}</div>
<div slot="header">{{ $t("公司信息") }}</div>
<el-descriptions :column="2">
<el-descriptions-item :label="$t('公司名称')">{{ customer.company }}</el-descriptions-item>
<el-descriptions-item :label="$t('公司英文名称')">{{ customer.companyEn }}</el-descriptions-item>
<el-descriptions-item v-if="permissions.includes('ecw:customer:query-card')" :label="$t('身份证号码')">{{ customer.carNo }}</el-descriptions-item>
<el-descriptions-item v-if="permissions.includes('ecw:customer:query-card')" :label="$t('身份证姓名')">{{ customer.carName }}</el-descriptions-item>
<el-descriptions-item :label="$t('结算方式')">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_BALANCE, customer.balance) }}</el-descriptions-item>
<el-descriptions-item v-if="permissions.includes('ecw:customer:query-card')" :label="$t('身份证号码')">
{{ customer.carNo }}
</el-descriptions-item>
<el-descriptions-item v-if="permissions.includes('ecw:customer:query-card')" :label="$t('身份证姓名')">
{{ customer.carName }}
</el-descriptions-item>
<el-descriptions-item :label="$t('结算方式')">
{{ getDictDataLabel(DICT_TYPE.CUSTOMER_BALANCE, customer.balance) }}
</el-descriptions-item>
<el-descriptions-item :label="$t('付款人姓名')">{{ customer.payerName }}</el-descriptions-item>
</el-descriptions>
</el-card>
<el-card class="box-card" style="margin-top: 15px;">
<div slot="header">{{$t('开票信息')}}</div>
<el-card class="box-card" style="margin-top: 15px">
<div slot="header">{{ $t("开票信息") }}</div>
<el-descriptions :column="2">
<el-descriptions-item :label="$t('发票抬头')">{{ customer.invoiceTitle }}</el-descriptions-item>
<el-descriptions-item :label="$t('纳税人识别号')">{{ customer.licenseNumber }}</el-descriptions-item>
......@@ -707,27 +572,32 @@
<el-descriptions-item :label="$t('税率')">{{ customer.taxRate }}</el-descriptions-item>
</el-descriptions>
</el-card>
<el-card style="margin-top: 15px;">
<div slot="header">{{$t('银行账户')}}</div>
<el-card style="margin-top: 15px">
<div slot="header">{{ $t("银行账户") }}</div>
<el-table :data="customer.customerBankBackVOList" border>
<el-table-column :label="$t('编号')" type="index"></el-table-column>
<el-table-column :label="$t('账户名称')" prop="accountName"></el-table-column>
<el-table-column :label="$t('币别')">
<template v-slot="{row}">
{{$l(currecyList.find(i => row.currency == i.id),'title')}}
<template v-slot="{ row }">
{{
$l(
currecyList.find((i) => row.currency == i.id),
"title"
)
}}
</template>
</el-table-column>
<el-table-column :label="$t('银行名称')" prop="bankName"></el-table-column>
<el-table-column :label="$t('银行账户')" prop="bankAccount"></el-table-column>
<el-table-column :label="$t('银行代码')" prop="bankCode"></el-table-column>
<el-table-column :label="$t('账户类型')">
<template v-slot="{row}">
{{Number(row.accountType) === 1 ? $t('公账') : $t('私账')}}
<template v-slot="{ row }">
{{ Number(row.accountType) === 1 ? $t("公账") : $t("私账") }}
</template>
</el-table-column>
<el-table-column :label="$t('状态')">
<template v-slot="{row}">
{{row.status ? $t('正常') : $t('停用')}}
<template v-slot="{ row }">
{{ row.status ? $t("正常") : $t("停用") }}
</template>
</el-table-column>
<el-table-column :label="$t('银行地址')" prop="bankAddress"></el-table-column>
......@@ -743,8 +613,10 @@
<el-descriptions-item :label="$t('到仓确认')">
<el-switch v-model="customer.arrivalConfirm" :active-value="1" :inactive-value="0" disabled />
</el-descriptions-item>
<el-descriptions-item :label="$t('重货标准')">{{ customer.weightUnit ? `${customer.weightUnit}kg/cbm` : '' }}</el-descriptions-item>
<el-descriptions-item :label="$t('泡货标准')">{{ customer.lightUnit ? `${customer.lightUnit}kg/cbm` : ''}}</el-descriptions-item>
<el-descriptions-item :label="$t('重货标准')">{{ customer.weightUnit ? `${customer.weightUnit}kg/cbm` : "" }} </el-descriptions-item>
<el-descriptions-item :label="$t('泡货标准')">
{{ customer.lightUnit ? `${customer.lightUnit}kg/cbm` : "" }}
</el-descriptions-item>
<el-descriptions-item :label="$t('控货无收货人')">
<el-switch v-model="customer.noConsignee" disabled />
</el-descriptions-item>
......@@ -759,20 +631,20 @@
<el-tab-pane name="credit" :label="$t('信用日志')">
<el-card class="box-card">
<div slot="header" class="clearfix">
<el-button style="float: right;" type="primary" @click="dialogVisible = true" >{{$t('添加信用日志')}}</el-button>
<el-button style="float: right" type="primary" @click="dialogVisible = true">{{ $t("添加信用日志") }} </el-button>
<el-descriptions :column="5" border>
<el-descriptions-item v-for="(item,index) in creditScoreStatisticObj" :key="index" :label="creditScoreCalculation(item.type)">{{item.score}}</el-descriptions-item>
<el-descriptions-item v-for="(item, index) in creditScoreStatisticObj" :key="index" :label="creditScoreCalculation(item.type)">{{ item.score }} </el-descriptions-item>
</el-descriptions>
</div>
<el-table :data="customerCreditLogList">
<el-table-column :label="$t('序号')" type="index"></el-table-column>
<el-table-column :label="$t('规则名称')">
<template v-slot="{row}">
{{ isChinese ? row.name : row.nameEn}}
<template v-slot="{ row }">
{{ isChinese ? row.name : row.nameEn }}
</template>
</el-table-column>
<el-table-column prop="type" :label="$t('规则分类')">
<template v-slot="{row}">
<template v-slot="{ row }">
<dict-tag :type="DICT_TYPE.CUSTOMER_CREDIT_RULE_TYPE" :value="row.type" />
</template>
</el-table-column>
......@@ -780,12 +652,12 @@
<el-table-column prop="remark" :label="$t('备注')"></el-table-column>
<el-table-column :label="$t('添加人')" prop="createName"></el-table-column>
<el-table-column :label="$t('时间')">
<template v-slot="{row}">
{{parseTime(row.createTime)}}
<template v-slot="{ row }">
{{ parseTime(row.createTime) }}
</template>
</el-table-column>
</el-table>
<pagination @pagination="creditLogPage" :page.sync="customerCreditLogFrom.pageNo" :limit.sync="customerCreditLogFrom.pageSize" :total="customerCreditLogFrom.total" ></pagination>
<pagination @pagination="creditLogPage" :page.sync="customerCreditLogFrom.pageNo" :limit.sync="customerCreditLogFrom.pageSize" :total="customerCreditLogFrom.total"></pagination>
</el-card>
</el-tab-pane>
<el-tab-pane name="grade" :label="$t('等级日志')">
......@@ -793,49 +665,43 @@
<el-table-column :label="$t('序号')" type="index"></el-table-column>
<el-table-column :label="$t('规则名称')" prop="name"></el-table-column>
<el-table-column :label="$t('规则分类')" prop="type">
<template v-slot="{row}">
<template v-slot="{ row }">
<dict-tag :type="DICT_TYPE.CUSTOMER_LEVEL_RULE_TYPE" :value="row.type" />
</template>
</el-table-column>
<el-table-column :label="$t('规则得分')" prop="score"></el-table-column>
<el-table-column :label="$t('备注')" prop="remark"></el-table-column>
<el-table-column :label="$t('时间')">
<template v-slot="{row}">
{{parseTime(row.createTime)}}
<template v-slot="{ row }">
{{ parseTime(row.createTime) }}
</template>
</el-table-column>
</el-table>
<pagination @pagination="getCustomerGrade" :page.sync="getCustomerGradeFrom.pageNo" :limit.sync="getCustomerGradeFrom.pageSize" :total="getCustomerGradeFrom.total" ></pagination>
<pagination @pagination="getCustomerGrade" :page.sync="getCustomerGradeFrom.pageNo" :limit.sync="getCustomerGradeFrom.pageSize" :total="getCustomerGradeFrom.total"></pagination>
</el-tab-pane>
<el-tab-pane name="operationLog" v-if="checkPermi(['customer:operate-log:query'])" :label="$t('操作日志')" >
<el-tab-pane name="operationLog" v-if="checkPermi(['customer:operate-log:query'])" :label="$t('操作日志')">
<customer-log :customerId="id" v-if="'operationLog' === activeName"></customer-log>
</el-tab-pane>
</el-tabs>
</el-col>
</el-row>
<el-dialog
:visible.sync="dialogVisible"
width="30%"
>
<h1 slot="title">
{{$t('给客户')}}{{customer.name}}{{$t('添加信用日志')}}
</h1>
<el-dialog :visible.sync="dialogVisible" width="30%">
<h1 slot="title">{{ $t("给客户") }}{{ customer.name }}{{ $t("添加信用日志") }}</h1>
<el-form label-width="100">
<el-form-item :label="$t('客户编号:')">{{customer.number}}</el-form-item>
<el-form-item :label="$t('客户编号:')">{{ customer.number }}</el-form-item>
<el-form-item :label="$t('信用类别')">
<el-select v-model="creditFrom.ruleId">
<el-option v-for="(item,index) in creditTypeList" :key="index" :value="item.id" :label="isChinese ? item.name : item.nameEn"></el-option>
<el-option v-for="(item, index) in creditTypeList" :key="index" :value="item.id" :label="isChinese ? item.name : item.nameEn"></el-option>
</el-select>
</el-form-item>
<el-form-item v-if="creditTypeList.length > 0" :label="$t('信用分')">{{(creditTypeList.find(r=>creditFrom.ruleId === r.id) || {}).score }}{{$t('')}}</el-form-item>
<el-form-item v-if="creditTypeList.length > 0" :label="$t('信用分')"> {{ (creditTypeList.find((r) => creditFrom.ruleId === r.id) || {}).score }}{{ $t("") }} </el-form-item>
<el-form-item :label="$t('备注')">
<el-input type="textarea" v-model="creditFrom.remark"> </el-input>
<el-input type="textarea" v-model="creditFrom.remark"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="submit">{{$t('提交')}}</el-button>
<el-button @click="dialogVisible = false" >{{$t('取消')}}</el-button>
<el-button @click="submit">{{ $t("提交") }}</el-button>
<el-button @click="dialogVisible = false">{{ $t("取消") }}</el-button>
</div>
</el-dialog>
......@@ -844,44 +710,31 @@
</template>
<script>
import {
getCustomer,
getCustomerSelect,
getBrankByCustomer,
levelLogPage,
customerCreditLogPage,
infoListOrderPage,
orderStatistics,
creditLogCreate,
creditScoreStatistic,
infoListReceiptPage, memberUserList, deleteCustomer,
} from '@/api/ecw/customer'
import { getOfferPage as infoListOfferPage } from '@/api/ecw/offer'
import { DICT_TYPE, getDictDataLabel, getDictDatas2 } from '@/utils/dict'
import { getProductTypeList } from '@/api/ecw/productType'
import { getNodeList } from '@/api/ecw/node'
import { getCustomer, getCustomerSelect, getBrankByCustomer, levelLogPage, customerCreditLogPage, infoListOrderPage, orderStatistics, creditLogCreate, creditScoreStatistic, infoListReceiptPage, memberUserList, deleteCustomer } from "@/api/ecw/customer"
import { getOfferPage as infoListOfferPage } from "@/api/ecw/offer"
import { DICT_TYPE, getDictDataLabel, getDictDatas2 } from "@/utils/dict"
import { getProductTypeList } from "@/api/ecw/productType"
import { getNodeList } from "@/api/ecw/node"
import CustomerFollow from "./components/customerFollow"
import { parseTime } from '@/utils/ruoyi'
import CustomerComplaint from '@/views/ecw/customerComplaint'
import { listServiceUser } from '@/api/system/user'
import { getCustomerContactsListByCustomer } from '@/api/ecw/customerContacts'
import {getOrderPage, getRegionList} from "@/api/ecw/order";
import Template from "@/views/cms/template";
import {getCreditRulePage} from "@/api/customer/creditRule";
import {getCountry} from "@/api/ecw/country"
import {getCurrencyList} from "@/api/ecw/currency";
import customerLog from "@/views/ecw/customer/customerLog.vue";
import {checkPermi} from "@/utils/permission";
import ImageDisplay from "@/views/ecw/order/components/imageDisplay.vue";
import { getListTree } from "@/api/ecw/region";
import { getWarehouseList } from "@/api/ecw/warehouse";
import { deleteOffer, cancel, recovery } from "@/api/ecw/offer";
import {
getCustomerFollowList,
exportCustomerFollow
} from "@/api/ecw/customerFollow"
import { parseTime } from "@/utils/ruoyi"
import CustomerComplaint from "@/views/ecw/customerComplaint"
import { listServiceUser, getUserProfile } from "@/api/system/user"
import { getCustomerContactsListByCustomer } from "@/api/ecw/customerContacts"
import { getOrderPage, getRegionList } from "@/api/ecw/order"
import Template from "@/views/cms/template"
import { getCreditRulePage } from "@/api/customer/creditRule"
import { getCountry } from "@/api/ecw/country"
import { getCurrencyList } from "@/api/ecw/currency"
import customerLog from "@/views/ecw/customer/customerLog.vue"
import { checkPermi } from "@/utils/permission"
import ImageDisplay from "@/views/ecw/order/components/imageDisplay.vue"
import { getListTree } from "@/api/ecw/region"
import { getWarehouseList } from "@/api/ecw/warehouse"
import { deleteOffer, cancel, recovery } from "@/api/ecw/offer"
import { getCustomerFollowList, exportCustomerFollow } from "@/api/ecw/customerFollow"
export default {
name: 'query',
name: "query",
components: {
ImageDisplay,
Template,
......@@ -891,30 +744,39 @@ export default {
},
created() {
// 获取币种
getCurrencyList().then(response => {
this.currecyList = response.data;
getCurrencyList().then((response) => {
this.currecyList = response.data
})
//获取信用类型
getCreditRulePage({page:1,rows:999,type:2}).then(r => {
getCreditRulePage({ page: 1, rows: 999, type: 2 }).then((r) => {
this.creditTypeList = r.data.list
})
// getNodeList().then(r => {
// this.nodeList = r.data
// })
getCustomer(this.id).then(response => {
getCustomer(this.id).then((response) => {
this.customer = { ...this.customer, ...response.data }
console.log( this.customer,'this.customer')
console.log(this.customer, "this.customer")
getCustomerContactsListByCustomer({customerId: this.id}).then(r => {
getCustomerContactsListByCustomer({ customerId: this.id }).then((r) => {
this.customerContacts = r.data
let list = this.customerContacts.filter(r => r.userid)
if(list.length > 0){
memberUserList({ids:list.map(i=>i.userid).join(',')}).then(r => {
if (this.customerContacts.length > 0) {
const contacts = this.customerContacts.findIndex((contacts) => contacts.isDefault === 1)
if (contacts.isDefault === 1) {
this.customer.defaultContactName = this.isChinese ? contacts.nameZh : contacts.nameEn
this.customer.defaultContactId = contacts.id
this.customer.defaultContactPhone = contacts.phoneNew
this.customer.defaultCountryCode = contacts.areaCode
this.customer.defaultEmail = contacts.email
}
let list = this.customerContacts.filter((r) => r.userid)
if (list.length > 0) {
memberUserList({ ids: list.map((i) => i.userid).join(",") }).then((r) => {
this.memberList = r.data
})
}
}
})
})
// getCustomerSelect({pageSize:1000,pageNo:1}).then(r => {
......@@ -924,49 +786,49 @@ export default {
// this.getBrankByCustomerList()//品牌授权
// this.getCustomerGrade()
// this.creditLogPage()//等级日志
this.getorderList()//订单
this.getorderList() //订单
// this.getInfoListOfferPage()//报价
this.getOrderStatistics()//数据
this.getOrderStatistics() //数据
// this.creditScoreStatisticFn() //信用日志
// this.infoListReceiptFn()//账单
this.getData();
this.getData()
this.getWarehouseList()
this.getUserProfile()
},
watch:{
activeName(val){
watch: {
activeName(val) {
switch (val) {
case 'order':
this.destCountryId = ''
this.destWarehouseId = ''
this.objectiveId = ''
this.getorderList()//订单
case "order":
this.destCountryId = ""
this.destWarehouseId = ""
this.objectiveId = ""
this.getorderList() //订单
break
case 'quote':
this.destCountryId = ''
this.destWarehouseId = ''
this.objectiveId = ''
this.getInfoListOfferPage()//报价
case "quote":
this.destCountryId = ""
this.destWarehouseId = ""
this.objectiveId = ""
this.getInfoListOfferPage() //报价
break
case 'follow':
case "follow":
this.getCustomerFollowList()
case 'bill':
this.infoListReceiptFn()//账单
case "bill":
this.infoListReceiptFn() //账单
break
case 'data':
this.getOrderStatistics()//数据
case "data":
this.getOrderStatistics() //数据
break
case 'empower':
this.getBrankByCustomerList()//品牌授权
case "empower":
this.getBrankByCustomerList() //品牌授权
break
case 'credit':
case "credit":
this.creditScoreStatisticFn() //信用日志
this.creditLogPage()
break
case 'grade':
case "grade":
this.getCustomerGrade()
//等级日志
break
}
},
destCountryId: {
......@@ -974,88 +836,63 @@ export default {
deep: true, //深度监听
handler() {
//每当值省份值改变时其下地区值进行清空
this.AddressCity = [];
this.AddressTown = [];
this.objectiveId = "";
this.destWarehouseId = "";
this.AddressCity = []
this.AddressTown = []
this.objectiveId = ""
this.destWarehouseId = ""
if (this.destCountryId == "") {
this.getAddressCity()
this.getAddressTown()
} else if (
this.destCountryId != "" &&
this.objectiveId == "" &&
this.destWarehouseId == ""
) {
} else if (this.destCountryId != "" && this.objectiveId == "" && this.destWarehouseId == "") {
this.findByprovinceCode()
this.getAddressTown()
}
},
}
},
objectiveId: {
deep: true, //深度监听
handler() {
this.AddressTown = [];
this.destWarehouseId = "";
this.AddressTown = []
this.destWarehouseId = ""
this.findBycityCode()
if (
this.objectiveId != "" &&
this.destCountryId != "" &&
this.destWarehouseId == ""
) {
if (this.objectiveId != "" && this.destCountryId != "" && this.destWarehouseId == "") {
//获取当前城市值id,获取该城市下区域
} else if (
this.destCountryId == "" &&
this.objectiveId == "" &&
this.destWarehouseId == ""
) {
} else if (this.destCountryId == "" && this.objectiveId == "" && this.destWarehouseId == "") {
this.getAddressTown()
} else if (
this.destCountryId != "" &&
this.objectiveId == "" &&
this.destWarehouseId == ""
) {
} else if (this.destCountryId != "" && this.objectiveId == "" && this.destWarehouseId == "") {
this.findByprovinceCode()
this.getAddressTown()
}
},
}
},
destWarehouseId: {
deep: true, //深度监听
handler() {
if (
this.objectiveId != "" &&
this.destCountryId != "" &&
this.destWarehouseId == ""
) {
if (this.objectiveId != "" && this.destCountryId != "" && this.destWarehouseId == "") {
//获取当前城市值id,获取该城市下区域
this.findBycityCode()
} else if (
this.destCountryId != "" &&
this.objectiveId == "" &&
this.destWarehouseId == ""
) {
} else if (this.destCountryId != "" && this.objectiveId == "" && this.destWarehouseId == "") {
this.getAddressTown()
}
},
},
}
}
},
data() {
return {
activeName:'order',
currecyList:[],
STATUS:{
0:this.$t('取消报价'),
1:this.$t('特价审批中'),
2:this.$t('需求确认'),
3:this.$t('跟进中'),
4:this.$t('赢单'),
5:this.$t('输单'),
6:this.$t('报价完成'),
7:this.$t('跟进中')
activeName: "order",
currecyList: [],
STATUS: {
0: this.$t("取消报价"),
1: this.$t("特价审批中"),
2: this.$t("需求确认"),
3: this.$t("跟进中"),
4: this.$t("赢单"),
5: this.$t("输单"),
6: this.$t("报价完成"),
7: this.$t("跟进中")
},
dialogVisible:false,
dialogVisible: false,
DICT_TYPE,
getDictDataLabel,
getDictDatas2,
......@@ -1066,6 +903,7 @@ export default {
serviceUserList: [],
customerContacts: [],
memberList: [],
relation: 1,
customer: {
id: undefined,
number: undefined,
......@@ -1103,48 +941,48 @@ export default {
weightUnit: undefined,
createTime: undefined
},
brandAuthorizationFrom:{
pageNo:1,
pageSize:10,
brandAuthorizationFrom: {
pageNo: 1,
pageSize: 10
},
brandAuthorizationList:[],
brandAuthorizationTotal:0,
getCustomerGradeFrom:{
pageNo:1,
pageSize:10,
total:0
brandAuthorizationList: [],
brandAuthorizationTotal: 0,
getCustomerGradeFrom: {
pageNo: 1,
pageSize: 10,
total: 0
},
getCustomerGradeList:[],
customerCreditLogFrom:{
pageNo:1,
pageSize:10,
total:0
getCustomerGradeList: [],
customerCreditLogFrom: {
pageNo: 1,
pageSize: 10,
total: 0
},
customerCreditLogList:[],
rucangtime:[],
queryParams:{
rows:10,
page:1
customerCreditLogList: [],
rucangtime: [],
queryParams: {
rows: 10,
page: 1
},
orderList:[],
orderTotal:0,
infoListOfferFrom:{
pageNo:1,
pageSize:10,
orderList: [],
orderTotal: 0,
infoListOfferFrom: {
pageNo: 1,
pageSize: 10
},
infoListOfferTotal:0,
infoListOfferList:[],
orderStatisticsObj:{},
creditTypeList:[],
creditFrom:{},//添加信用 日志
creditScoreStatisticObj:[],
infoListReceiptList:[],
infoListReceiptFrom:{
pageNo:1,
pageSize:10,
infoListOfferTotal: 0,
infoListOfferList: [],
orderStatisticsObj: {},
creditTypeList: [],
creditFrom: {}, //添加信用 日志
creditScoreStatisticObj: [],
infoListReceiptList: [],
infoListReceiptFrom: {
pageNo: 1,
pageSize: 10
},
infoListReceiptTotal:0,
country: '',
infoListReceiptTotal: 0,
country: "",
showMore: true,
AddressCity: [],
AddressProvince: [],
......@@ -1162,21 +1000,22 @@ export default {
customerFollowTotal: 0,
customerFollowList: [],
currencyList: [],
userId: undefined
}
},
computed: {
permissions(){
permissions() {
return this.$store.state.user.permissions
},
customerId(){
return this.$route.params.customerId;
customerId() {
return this.$route.params.customerId
},
isChinese(){
return this.$i18n.locale === 'zh_CN'
isChinese() {
return this.$i18n.locale === "zh_CN"
},
pickupPoint(){
const pickupPoint = this.nodeList.find(p => p.id === parseInt(this.customer.pickupPoint))
return pickupPoint ? pickupPoint.titleZh : ''
pickupPoint() {
const pickupPoint = this.nodeList.find((p) => p.id === parseInt(this.customer.pickupPoint))
return pickupPoint ? pickupPoint.titleZh : ""
},
// promoter() {
// return this.customerSelect.find(e => e.id === this.customer.promoter)?.name || ''
......@@ -1185,117 +1024,134 @@ export default {
id() {
return parseInt(this.$route.params.customerId)
},
creditScoreCalculation(){
return (val)=>{
if(val === 'all'){
return this.$t('信用分')
}else{
if(this.isChinese) return (this.getDictDatas(DICT_TYPE.CUSTOMER_CREDIT_RULE_TYPE).find(i => i.value === val)||{}).label
else return (this.getDictDatas(DICT_TYPE.CUSTOMER_CREDIT_RULE_TYPE).find(i => i.value === val)||{}).labelEn
creditScoreCalculation() {
return (val) => {
if (val === "all") {
return this.$t("信用分")
} else {
if (this.isChinese) return (this.getDictDatas(DICT_TYPE.CUSTOMER_CREDIT_RULE_TYPE).find((i) => i.value === val) || {}).label
else return (this.getDictDatas(DICT_TYPE.CUSTOMER_CREDIT_RULE_TYPE).find((i) => i.value === val) || {}).labelEn
}
}
},
currencyMap(){
currencyMap() {
let map = {}
this.currencyList.forEach(item => {
map[item.id] = this.$l(item, 'title')
this.currencyList.forEach((item) => {
map[item.id] = this.$l(item, "title")
})
return map
},
}
},
filters: {
deliveryRate(pickNum, sumNum) {
if (pickNum == 0 || sumNum == 0) {
return 0
} else if (pickNum && sumNum) {
return Math.round(pickNum / sumNum * 10000) / 100 + "%"
return Math.round((pickNum / sumNum) * 10000) / 100 + "%"
}
return null
}
},
methods:{
customerFollowFn(val){
methods: {
getUserProfile() {
getUserProfile().then((res) => {
this.userId = res.data.id
})
},
customerFollowFn(val) {
this.activeName = val
this.$nextTick(()=>{
if(val === 'follow'){
this.$nextTick(() => {
if (val === "follow") {
this.customerFollowVisible = true
this.$nextTick(_ => {
this.$refs['customerFollow'].handleAdd()
this.$nextTick((_) => {
this.$refs["customerFollow"].handleAdd()
})
} else {
this.$refs['customerComplaint'].handleAdd()
this.$refs["customerComplaint"].handleAdd()
}
})
},
quote() {
const row = this.customer
if (row.customerService != this.userId) {
this.$message.error(this.$t("此客户属于其他客户经理名下的客户。"))
return
}
this.$router.push({ path: "/offer/create", query: { customerId: row.id, customerType: row.type, type: 1 } })
},
handleCustomerFollow(row, flag) {
this.customerFollowVisible = true
this.$nextTick(_ => {
this.$refs['customerFollow'].handleUpdate(row, flag)
this.$nextTick((_) => {
this.$refs["customerFollow"].handleUpdate(row, flag)
})
},
handleCustomerFollowLink(row) {
this.customerFollowVisible = true
this.$nextTick(_ => {
this.$refs['customerFollow'].handleView(row)
this.$nextTick((_) => {
this.$refs["customerFollow"].handleView(row)
})
},
checkPermi,
userIdFormatter(row, column, cellValue){
const member = this.memberList.find(e => e.id === cellValue)
userIdFormatter(row, column, cellValue) {
const member = this.memberList.find((e) => e.id === cellValue)
if (member) {
return member.nickname + '(' + member.mobile + ')'
return member.nickname + "(" + member.mobile + ")"
} else {
return ''
return ""
}
},
changeDate(val){
if(val){
this.queryParams.beginRucangTime = val[0];
this.queryParams. endRucangTime = val[1];
}else {
this.queryParams.beginRucangTime = undefined;
this.queryParams.endRucangTime = undefined;
changeDate(val) {
if (val) {
this.queryParams.beginRucangTime = val[0]
this.queryParams.endRucangTime = val[1]
} else {
this.queryParams.beginRucangTime = undefined
this.queryParams.endRucangTime = undefined
}
},
//品牌授权
getBrankByCustomerList(){
getBrankByCustomer({...this.brandAuthorizationFrom,customerId:this.id}).then(r => {this.brandAuthorizationList = r.data.list; this.brandAuthorizationTotal = r.data.total})
getBrankByCustomerList() {
getBrankByCustomer({ ...this.brandAuthorizationFrom, customerId: this.id }).then((r) => {
this.brandAuthorizationList = r.data.list
this.brandAuthorizationTotal = r.data.total
})
},
// 信用等级日志
getCustomerGrade(){
levelLogPage({...this.getCustomerGradeFrom,customerId:this.id,total:undefined}).then(r => {
if(r.code === 0){
this.getCustomerGradeList = r.data.list;
this.getCustomerGradeFrom.total = r.data.total;
getCustomerGrade() {
levelLogPage({ ...this.getCustomerGradeFrom, customerId: this.id, total: undefined }).then((r) => {
if (r.code === 0) {
this.getCustomerGradeList = r.data.list
this.getCustomerGradeFrom.total = r.data.total
}
})
},
// 信用日志
creditLogPage(){
customerCreditLogPage({...this.customerCreditLogFrom,customerId:this.id}).then(r => {
if(r.code === 0){
this.customerCreditLogList = r.data.list;
this.customerCreditLogFrom.total = r.data.total;
creditLogPage() {
customerCreditLogPage({ ...this.customerCreditLogFrom, customerId: this.id }).then((r) => {
if (r.code === 0) {
this.customerCreditLogList = r.data.list
this.customerCreditLogFrom.total = r.data.total
}
})
},
//订单
getorderList(){
getorderList() {
let queryParams = {}
//目的国
if (this.destCountryId != null && this.destCountryId != "") {
queryParams.destCountryIds = this.destCountryId;
queryParams.destCountryIds = this.destCountryId
}
//目的城市
if (this.objectiveId != null && this.objectiveId != "") {
queryParams.objectiveIds = this.objectiveId;
queryParams.objectiveIds = this.objectiveId
}
//目的仓
if (this.destWarehouseId != null && this.destWarehouseId != "") {
queryParams.destWarehouseIds = this.destWarehouseId;
queryParams.destWarehouseIds = this.destWarehouseId
}
infoListOrderPage({customerDetailId:this.id,...this.queryParams,...queryParams}).then(r => {
if(r.code === 0){
infoListOrderPage({ customerDetailId: this.id, ...this.queryParams, ...queryParams }).then((r) => {
if (r.code === 0) {
this.orderList = r.data.list
this.orderTotal = r.data.total
}
......@@ -1305,102 +1161,99 @@ export default {
this.destCountryId = null
this.objectiveId = null
this.destWarehouseId = null
this.queryParams = { rows:10,page:1};
this.queryParams = { rows: 10, page: 1 }
this.getorderList()
this.rucangtime = [];
this.rucangtime = []
},
// 客户报价
getInfoListOfferPage(){
getInfoListOfferPage() {
let queryParams = {}
//目的国
if (this.destCountryId != null && this.destCountryId != "") {
queryParams.destCountryIds = this.destCountryId;
queryParams.destCountryIds = this.destCountryId
}
//目的城市
if (this.objectiveId != null && this.objectiveId != "") {
queryParams.destCountryIds = this.objectiveId;
queryParams.destCountryIds = this.objectiveId
}
//目的仓
if (this.destWarehouseId != null && this.destWarehouseId != "") {
queryParams.destWarehouseIds = this.destWarehouseId;
queryParams.destWarehouseIds = this.destWarehouseId
}
infoListOfferPage({...this.infoListOfferFrom,customerId:this.id,...queryParams}).then(r => {
this.infoListOfferList = r.data.list;
this.infoListOfferTotal = r.data.total;
infoListOfferPage({ ...this.infoListOfferFrom, customerId: this.id, ...queryParams }).then((r) => {
this.infoListOfferList = r.data.list
this.infoListOfferTotal = r.data.total
})
},
handleOfferReset() {
this.destCountryId = null
this.objectiveId = null
this.destWarehouseId = null
this.infoListOfferFrom = { pageNo:1,pageSize:10};
this.infoListOfferFrom = { pageNo: 1, pageSize: 10 }
this.getInfoListOfferPage()
},
getCustomerFollowList() {
getCustomerFollowList({
...this.followForm,
customerId: this.customerId
}).then(r => {
this.customerFollowList = r.data.list;
this.customerFollowTotal = r.data.total;
}).then((r) => {
this.customerFollowList = r.data.list
this.customerFollowTotal = r.data.total
})
},
/** 跟进记录导出按钮操作 */
handleExport() {
// 执行导出
this.$modal.confirm(this.$t('是否确认导出客户跟进记录数据项?')).then(() => {
this.$modal.confirm(this.$t("是否确认导出客户跟进记录数据项?")).then(() => {
exportCustomerFollow({
...this.followForm,
customerId: this.customerId
}).then((r) => {
this.$message.success(
this.$t("已加入导出队列,请稍后在下载日志中下载")
);
});
this.$message.success(this.$t("已加入导出队列,请稍后在下载日志中下载"))
})
})
},
// 数据
getOrderStatistics(){
orderStatistics({customerId:this.id}).then(r => {
if(r.code === 0){
getOrderStatistics() {
orderStatistics({ customerId: this.id }).then((r) => {
if (r.code === 0) {
this.orderStatisticsObj = r.data
}
})
},
submit(){
creditLogCreate({customerId:this.id,...this.creditFrom}).then(r => {
if(r.code === 0){
this.creditLogPage();
this.creditFrom = {};
submit() {
creditLogCreate({ customerId: this.id, ...this.creditFrom }).then((r) => {
if (r.code === 0) {
this.creditLogPage()
this.creditFrom = {}
this.creditScoreStatisticFn()
this.dialogVisible = false;
this.dialogVisible = false
}
})
},
//获得信用客户统计
creditScoreStatisticFn(){
creditScoreStatistic({customerId:this.id}).then(r => {
if(r.code === 0) this.creditScoreStatisticObj = r.data
creditScoreStatisticFn() {
creditScoreStatistic({ customerId: this.id }).then((r) => {
if (r.code === 0) this.creditScoreStatisticObj = r.data
})
},
// 获取账单数据
infoListReceiptFn(){
infoListReceiptPage({...this.infoListReceiptFrom,customerId:this.id}).then(r => {
if(r.code === 0){
this.infoListReceiptList = r.data.list;
this.infoListReceiptTotal = r.data.total;
infoListReceiptFn() {
infoListReceiptPage({ ...this.infoListReceiptFrom, customerId: this.id }).then((r) => {
if (r.code === 0) {
this.infoListReceiptList = r.data.list
this.infoListReceiptTotal = r.data.total
}
})
},
deleteCustomerFn(){
this.$confirm(`${this.$t('是否要删除当前客户')}《${this.customer.name}》?`, `${this.$t('提示')}`, {
confirmButtonText: this.$t('确定'),
cancelButtonText: this.$t('取消'),
type: 'warning'
deleteCustomerFn() {
this.$confirm(`${this.$t("是否要删除当前客户")}《${this.customer.name}》?`, `${this.$t("提示")}`, {
confirmButtonText: this.$t("确定"),
cancelButtonText: this.$t("取消"),
type: "warning"
}).then(() => {
deleteCustomer(this.customerId).then(r => {
this.$modal.msgSuccess(this.$t('删除成功'));
deleteCustomer(this.customerId).then((r) => {
this.$modal.msgSuccess(this.$t("删除成功"))
this.$router.back()
})
})
......@@ -1409,7 +1262,7 @@ export default {
//获取当前省份值id,获取该省份下城市 destCountryId provinceCode
if (this.destCountryId != null && this.destCountryId != "") {
getRegionList(2, this.destCountryId).then(({ data }) => {
this.AddressCity = data;
this.AddressCity = data
})
}
},
......@@ -1417,7 +1270,7 @@ export default {
//获取当前城市值id,获取该城市下区域
if (this.objectiveId != null && this.objectiveId != "") {
getRegionList(3, this.objectiveId).then(({ data }) => {
this.AddressTown = data;
this.AddressTown = data
})
}
},
......@@ -1428,62 +1281,66 @@ export default {
},
getAddressProvince() {
getRegionList(1, 1).then(({ data }) => {
this.AddressProvince = data;
this.AddressProvince = data
})
},
getAddressCity() {
getRegionList(4, 4).then(({ data }) => {
this.AddressCity = data;
this.AddressCity = data
})
},
getAddressTown() {
getRegionList(5, 5).then(({ data }) => {
this.AddressTown = data;
this.AddressTown = data
})
},
/** 搜索按钮操作 */
handleQuery() {
if (this.activeName == 'order') {
if (this.activeName == "order") {
this.queryParams.page = 1
this.getorderList()
} else if (this.activeName == 'quote') {
} else if (this.activeName == "quote") {
this.infoListOfferFrom.pageNo = 1
this.getInfoListOfferPage()
} else if (this.activeName == "follow") {
this.followForm.pageNo = 1
this.getCustomerFollowList()
}
},
getWarehouseList() {
getWarehouseList().then((res) => {
this.warehouseList = res.data;
this.warehouseList = res.data
})
},
getWarehouse(id) {
let warehouseName = ''
for(const item of this.warehouseList) {
if(item.id == id){
warehouseName = this.$i18n.locale=='zh_CN'?item.titleZh:item.titleEn
let warehouseName = ""
for (const item of this.warehouseList) {
if (item.id == id) {
warehouseName = this.$i18n.locale == "zh_CN" ? item.titleZh : item.titleEn
break
}
}
return warehouseName
},
cancel(id){
this.doAction(this.$t('确定要取消此报价单么?'), cancel, id);
cancel(id) {
this.doAction(this.$t("确定要取消此报价单么?"), cancel, id)
},
recovery(id){
this.doAction(this.$t('确定要恢复此报价单么?'), recovery, id);
recovery(id) {
this.doAction(this.$t("确定要恢复此报价单么?"), recovery, id)
},
deleteOffer(id){
this.doAction(this.$t('确定要删除此报价单么?'), deleteOffer, id);
deleteOffer(id) {
this.doAction(this.$t("确定要删除此报价单么?"), deleteOffer, id)
},
doAction(tips, action, id){
this.$confirm(tips).then(res => {
doAction(tips, action, id) {
this.$confirm(tips)
.then((res) => {
return action(id)
})
.then(() => {
this.$message.success('操作成功')
this.$message.success("操作成功")
this.handleQuery()
})
},
}
}
}
</script>
......@@ -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.$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,133 +102,50 @@
</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-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 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>
......@@ -309,13 +153,7 @@
<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">
......@@ -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();
},
trigger: "blur",
callback()
},
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;
}
return true;
},
if (this.transport && this.transport.cssClass == "channel" && !this.form.channelId) {
return false
}
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))
}
}
......
......@@ -401,6 +401,7 @@
<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