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 @@ ...@@ -60,6 +60,7 @@
<script> <script>
import {createCustomer} from '@/api/ecw/customer' import {createCustomer} from '@/api/ecw/customer'
import {DICT_TYPE} from "@/utils/dict";
import {listServiceUser} from "@/api/system/user" import {listServiceUser} from "@/api/system/user"
import { getCountryListAll } from '@/api/ecw/country' import { getCountryListAll } from '@/api/ecw/country'
import {getCustomerContactsSelect} from '@/api/ecw/customerContacts' import {getCustomerContactsSelect} from '@/api/ecw/customerContacts'
...@@ -74,7 +75,7 @@ export default { ...@@ -74,7 +75,7 @@ export default {
data(){ data(){
return { return {
show: true, show: true,
DICT_TYPE,
// 表单参数 // 表单参数
form: { form: {
customerContacts:[{isDefault: 1}] customerContacts:[{isDefault: 1}]
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<script> <script>
export default { export default {
name: 'AppMain', name: "AppMain",
computed: { computed: {
cachedViews() { cachedViews() {
return this.$store.state.tagsView.cachedViews return this.$store.state.tagsView.cachedViews
...@@ -31,7 +31,7 @@ export default { ...@@ -31,7 +31,7 @@ export default {
overflow: hidden; overflow: hidden;
} }
.fixed-header+.app-main { .fixed-header + .app-main {
padding-top: 50px; padding-top: 50px;
} }
...@@ -41,7 +41,7 @@ export default { ...@@ -41,7 +41,7 @@ export default {
min-height: calc(100vh - 84px); min-height: calc(100vh - 84px);
} }
.fixed-header+.app-main { .fixed-header + .app-main {
padding-top: 84px; padding-top: 84px;
} }
} }
......
<template> <template>
<div style="display: inline-block"> <div style="display: inline-block">
<span @click="visible = true"> <slot></slot></span> <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 v-if="info">
<div style="text-align: center;margin-bottom: 20px;" v-for="(item, index) in info" :key="index"> <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/> 联系人{{index + 1}}{{$l(item, 'name')}} &ensp;&ensp;&ensp; 联系方式{{index + 1}}:+{{item.areaCode}} {{item.phoneNew}}<br/>
......
...@@ -6,8 +6,10 @@ ...@@ -6,8 +6,10 @@
<el-col :span="12"> <el-col :span="12">
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>{{$t('保留客户')}}</span> <span>{{ $t('保留客户') }}</span>
<el-button type="success" size="small" style="float: right" @click="selectCustomer(1)">{{$t('请选择')}}</el-button> <el-button type="success" size="small" style="float: right" @click="selectCustomer(1)">
{{ $t('请选择') }}
</el-button>
</div> </div>
<el-form-item :label="$t('客户编号')+':'"> <el-form-item :label="$t('客户编号')+':'">
{{ retainCustomer.number }} {{ retainCustomer.number }}
...@@ -29,8 +31,10 @@ ...@@ -29,8 +31,10 @@
<el-col :span="12"> <el-col :span="12">
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>{{$t('​被合并客户-非主客户')}}</span> <span>{{ $t('​被合并客户-非主客户') }}</span>
<el-button type="success" size="small" style="float: right" @click="selectCustomer(2)">{{$t('请选择')}}</el-button> <el-button type="success" size="small" style="float: right" @click="selectCustomer(2)">
{{ $t('请选择') }}
</el-button>
</div> </div>
<el-form-item :label="$t('客户编号')+':'"> <el-form-item :label="$t('客户编号')+':'">
{{ mergeCustomer.number }} {{ mergeCustomer.number }}
...@@ -52,12 +56,13 @@ ...@@ -52,12 +56,13 @@
</el-row> </el-row>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleSubmit">{{$t('确 定')}}</el-button> <el-button type="primary" @click="handleSubmit">{{ $t('确 定') }}</el-button>
<el-button @click="dialogVisible = false">{{$t('取 消')}}</el-button> <el-button @click="dialogVisible = false">{{ $t('取 消') }}</el-button>
</div> </div>
</el-dialog> </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 :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="100px">
<el-form-item :label="$t('客户编号')" prop="number"> <el-form-item :label="$t('客户编号')" prop="number">
<el-input <el-input
...@@ -105,10 +110,12 @@ ...@@ -105,10 +110,12 @@
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{ <el-button type="primary" icon="el-icon-search" @click="handleQuery">{{
$t("搜索") $t("搜索")
}}</el-button> }}
</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{ <el-button icon="el-icon-refresh" @click="resetQuery">{{
$t("重置") $t("重置")
}}</el-button> }}
</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table :data="list" v-loading="loading" border size="mini"> <el-table :data="list" v-loading="loading" border size="mini">
...@@ -119,7 +126,8 @@ ...@@ -119,7 +126,8 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('客户编号')" align="center"> <el-table-column :label="$t('客户编号')" align="center">
<template slot-scope="{ row }"> <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> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('客户名称')" align="center"> <el-table-column :label="$t('客户名称')" align="center">
...@@ -136,31 +144,33 @@ ...@@ -136,31 +144,33 @@
></el-table-column> ></el-table-column>
<el-table-column :label="$t('主联系方式')" prop="defaultContactPhone"> <el-table-column :label="$t('主联系方式')" prop="defaultContactPhone">
<template v-slot="{ row }"> <template v-slot="{ row }">
+{{ row.defaultContactPhone }} <br /> +{{ row.defaultContactPhone }} <br/>
<contacts :id="row.id"> <contacts :id="row.id">
<el-button type="text">更多</el-button> <el-button type="text">更多</el-button>
</contacts> </contacts>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('客户类别')" align="center"> <el-table-column :label="$t('客户类别')" align="center">
<template slot-scope="scope"> <template slot-scope="{ row }">
<dict-tag {{ getDictDatas2(DICT_TYPE.CUSTOMER_TYPE, (row.type||'').split(',')).map(e => isChinese ? e.label : e.labelEn).join(', ')}}
:type="DICT_TYPE.CUSTOMER_TYPE" <!-- <dict-tag-->
:value="scope.row.type" <!-- :type="DICT_TYPE.CUSTOMER_TYPE"-->
/> <!-- :value="scope.row.type"-->
<!-- />-->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('角色')" align="center"> <el-table-column :label="$t('角色')" align="center">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
{{ getDictDatas2(DICT_TYPE.CUSTOMER_ROLE, (row.roles||'').split(',')).map(e => isChinese ? e.label : e.labelEn).join(', ')}} {{ getDictDatas2(DICT_TYPE.CUSTOMER_ROLE, (row.roles || '').split(',')).map(e => isChinese ? e.label : e.labelEn).join(', ') }}
<!-- <dict-tag--> <!-- <dict-tag-->
<!-- :type="DICT_TYPE.CUSTOMER_ROLE"--> <!-- :type="DICT_TYPE.CUSTOMER_ROLE"-->
<!-- :value="scope.row.roles"--> <!-- :value="scope.row.roles"-->
<!-- />--> <!-- />-->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('客户经理')" align="center" prop="customerServiceName"></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"> <el-table-column :label="$t('出货渠道')" align="center">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
{{ channel(row.transportType) }} {{ channel(row.transportType) }}
...@@ -208,7 +218,7 @@ ...@@ -208,7 +218,7 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('入公海时间')" align="center" width="160"> <el-table-column :label="$t('入公海时间')" align="center" width="160">
<template v-slot="{ row }"> <template v-slot="{ row }">
{{ parseTime( row.enterOpenSeaTime ? row.enterOpenSeaTime : row.estimateEnterOpenSeaTime)}} {{ parseTime(row.enterOpenSeaTime ? row.enterOpenSeaTime : row.estimateEnterOpenSeaTime) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('入仓确认')" align="center"> <el-table-column :label="$t('入仓确认')" align="center">
...@@ -262,20 +272,21 @@ ...@@ -262,20 +272,21 @@
</el-table> </el-table>
<!-- 分页组件 --> <!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList" /> @pagination="getList"/>
<div slot="footer" class="dialog-footer"> <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> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { getCustomerPage, customerMergeCus } from "@/api/ecw/customer" import {getCustomerPage, customerMergeCus} from "@/api/ecw/customer"
import { getDictDatas, DICT_TYPE, getDictDatas2 } from "@/utils/dict" import {getDictDatas, DICT_TYPE, getDictDatas2} from "@/utils/dict"
import Contacts from "./contacts.vue"; import Contacts from "./contacts.vue";
import Template from "@/views/cms/template/index.vue"; import Template from "@/views/cms/template/index.vue";
import {getProductTypeList} from "@/api/ecw/productType"; import {getProductTypeList} from "@/api/ecw/productType";
export default { export default {
name: "CustomerMerge", name: "CustomerMerge",
components: { components: {
...@@ -386,7 +397,7 @@ export default { ...@@ -386,7 +397,7 @@ export default {
return (id) => { return (id) => {
if (id) { if (id) {
let strName = '' let strName = ''
for(const item of this.customerSelectFn) { for (const item of this.customerSelectFn) {
if (item.id == id) { if (item.id == id) {
strName = item.name strName = item.name
break break
...@@ -401,9 +412,6 @@ export default { ...@@ -401,9 +412,6 @@ export default {
}, },
created() { created() {
this.getList(); this.getList();
getProductTypeList().then((r) => {
this.productTypeList = r.data;
});
}, },
methods: { methods: {
init() { init() {
...@@ -413,7 +421,12 @@ export default { ...@@ -413,7 +421,12 @@ export default {
selectCustomer(type) { selectCustomer(type) {
this.type = type this.type = type
this.customerId = null this.customerId = null
this.queryParams = {
pageNo: 1,
pageSize: 10
}
this.customerDialogVisible = true this.customerDialogVisible = true
this.getList();
}, },
handleSubmit() { handleSubmit() {
if (!this.retainCustomer.id) { if (!this.retainCustomer.id) {
...@@ -439,7 +452,7 @@ export default { ...@@ -439,7 +452,7 @@ export default {
const h = this.$createElement; const h = this.$createElement;
this.$msgbox({ this.$msgbox({
title: '注意事项', title: '注意事项',
message: h('div', { class: 'stips' }, [ message: h('div', {class: 'stips'}, [
h('p', null, '1. 保留客户和非主客户,不能在两个不同的客户经理名下,请先确认两个客户在同一个客户经理名下'), h('p', null, '1. 保留客户和非主客户,不能在两个不同的客户经理名下,请先确认两个客户在同一个客户经理名下'),
h('p', null, '2. 被合并客户,提交后会直接删除'), h('p', null, '2. 被合并客户,提交后会直接删除'),
h('p', null, '3. 合并后,非主客户的联系人,跟进记录,报价单,订单,客户投诉,品牌授权都迁移到保留客户中,其他信息不会迁移,如需要维护非主客户的客户档案信息到保留客户中,请先维护好再操作'), h('p', null, '3. 合并后,非主客户的联系人,跟进记录,报价单,订单,客户投诉,品牌授权都迁移到保留客户中,其他信息不会迁移,如需要维护非主客户的客户档案信息到保留客户中,请先维护好再操作'),
......
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="130px">
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
label-width="130px"
>
<el-form-item :label="$t('客户编号')" prop="number"> <el-form-item :label="$t('客户编号')" prop="number">
<el-input <el-input v-model.trim="queryParams.number" :placeholder="$t('请输入客户编号')" clearable @keyup.enter.native="handleQuery" @input="queryParams.number = queryParams.number.replace(/\s+/g, '')" />
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>
<el-form-item :label="$t('客户名称')" prop="name"> <el-form-item :label="$t('客户名称')" prop="name">
<el-input <el-input v-model.trim="queryParams.name" :placeholder="$t('请输入客户名称')" clearable @keyup.enter.native="handleQuery" @input="queryParams.name = queryParams.name.replace(/\s+/g, '')" />
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>
<!-- <!--
<el-form-item :label="$t('客户等级')" prop="level"> <el-form-item :label="$t('客户等级')" prop="level">
...@@ -45,181 +27,65 @@ ...@@ -45,181 +27,65 @@
</el-form-item> </el-form-item>
--> -->
<el-form-item :label="$t('区号')"> <el-form-item :label="$t('区号')">
<el-select <el-select v-model="queryParams.areaCode" :placeholder="$t('请选择区号')">
v-model="queryParams.areaCode" <el-option v-for="(item, index) in countryList" :key="index" :label="item.nameShort + (isChinese ? item.nameZh : item.nameEn) + ' +' + item.tel" :value="item.tel" />
: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-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('联系方式')"> <el-form-item :label="$t('联系方式')">
<el-input <el-input :placeholder="$t('请输入联系方式')" v-model.trim="queryParams.defaultContactPhone" @input="queryParams.defaultContactPhone = queryParams.defaultContactPhone.replace(/\s+/g, '')"></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>
<el-form-item :label="$t('部门')" v-if="path != '/customer/department-customers'"> <el-form-item :label="$t('部门')" v-if="path != '/customer/department-customers'">
<el-select v-model="queryParams.deptIds" :placeholder="$t('请选择部门')"> <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-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('客户经理')" prop="customerService"> <el-form-item :label="$t('客户经理')" prop="customerService">
<el-select <el-select multiple clearable v-model="queryParams.customerService" :placeholder="$t('请选择客户经理')" size="small" @change="handleQuery">
multiple <el-option v-for="dict in customerServiceList" :key="dict.id" :label="dict.nickname" :value="dict.id" />
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-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('客户来源')" prop="source"> <el-form-item :label="$t('客户来源')" prop="source">
<el-select <el-select multiple clearable v-model="queryParams.source" :placeholder="$t('请选择客户来源')" size="small" @change="handleQuery">
multiple <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_SOURCE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="dict.value" />
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-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('客户类别')" prop="level"> <el-form-item :label="$t('客户类别')" prop="level">
<dict-selector <dict-selector multiple clearable :type="DICT_TYPE.CUSTOMER_TYPE" v-model="queryParams.type" @change="handleQuery"></dict-selector>
multiple
clearable
:type="DICT_TYPE.CUSTOMER_TYPE"
v-model="queryParams.type"
@change="handleQuery"
></dict-selector>
</el-form-item> </el-form-item>
<el-form-item :label="$t('角色')"> <el-form-item :label="$t('角色')">
<dict-selector <dict-selector multiple clearable :type="DICT_TYPE.CUSTOMER_ROLE" v-model="queryParams.role" formatter="number" @change="handleQuery" :placeholder="$t('请选择')"></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>
<el-form-item :label="$t('客户状态')" prop="status"> <el-form-item :label="$t('客户状态')" prop="status">
<el-select <el-select multiple clearable v-model="queryParams.status" :placeholder="$t('请选择客户状态')" size="small" @change="handleQuery">
multiple <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_STATUS)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="dict.value" />
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-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('国籍')" prop="country"> <el-form-item :label="$t('国籍')" prop="country">
<el-select <el-select multiple clearable v-model="queryParams.country" :placeholder="$t('请选择')" @change="handleQuery">
multiple <el-option v-for="dict in countryList" :key="dict.id" :label="isChinese ? dict.nameZh : dict.nameEn" :value="parseInt(dict.id)" />
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-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('出货渠道')"> <el-form-item :label="$t('出货渠道')">
<dict-selector <dict-selector multiple clearable :type="DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE" v-model="queryParams.transportType" formatter="number" @change="handleQuery"></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>
<el-form-item :label="$t('业务国家')" v-show="showSearch"> <el-form-item :label="$t('业务国家')" v-show="showSearch">
<el-select <el-select multiple clearable v-model="queryParams.busiCountryIds" :placeholder="$t('请选择')" @change="handleQuery">
multiple <el-option v-for="dict in countryList" :key="dict.id" :label="isChinese ? dict.nameZh : dict.nameEn" :value="parseInt(dict.id)" />
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-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('常用提货网点')" v-show="showSearch"> <el-form-item :label="$t('常用提货网点')" v-show="showSearch">
<el-select multiple v-model="queryParams.pickupPoints"> <el-select multiple v-model="queryParams.pickupPoints">
<el-option <el-option v-for="item in getNodeLists" :key="item.id" :value="item.id" :label="isChinese ? item.titleZh : item.titleEn"></el-option>
v-for="item in getNodeLists"
:key="item.id"
:value="item.id"
:label="isChinese ? item.titleZh : item.titleEn"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('创建人')" v-show="showSearch"> <el-form-item :label="$t('创建人')" v-show="showSearch">
<el-select v-model="queryParams.founder"> <el-select v-model="queryParams.founder">
<el-option <el-option v-for="item in allSimplList" :key="item.id" :label="item.nickname" :value="item.id"> </el-option>
v-for="item in allSimplList"
:key="item.id"
:label="item.nickname"
:value="item.id"
>
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('创建时间')" v-show="showSearch"> <el-form-item :label="$t('创建时间')" v-show="showSearch">
<el-date-picker <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('结束日期')" />
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>
<!-- <!--
<el-form-item :label="$t('信用等级')" prop="department"> <el-form-item :label="$t('信用等级')" prop="department">
...@@ -275,16 +141,7 @@ ...@@ -275,16 +141,7 @@
</el-form-item> </el-form-item>
--> -->
<el-form-item :label="$t('入公海时间')" v-show="showSearch"> <el-form-item :label="$t('入公海时间')" v-show="showSearch">
<el-date-picker <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('结束日期')" />
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>
<el-form-item :label="$t('业绩类型')" v-show="showSearch"> <el-form-item :label="$t('业绩类型')" v-show="showSearch">
<el-select clearable v-model="queryParams.isNew"> <el-select clearable v-model="queryParams.isNew">
...@@ -293,104 +150,37 @@ ...@@ -293,104 +150,37 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('年度发货量')" v-show="showSearch"> <el-form-item :label="$t('年度发货量')" v-show="showSearch">
<el-input <el-input v-model.trim="weightYearly.value" :placeholder="$t('请输入数字')" clearable @keyup.enter.native="handleQuery" @input="weightYearly.value = weightYearly.value.replace(/\s+/g, '')">
v-model.trim="weightYearly.value"
:placeholder="$t('请输入数字')"
clearable
@keyup.enter.native="handleQuery"
@input="weightYearly.value=weightYearly.value.replace(/\s+/g, '')"
>
<template slot="prepend"> <template slot="prepend">
<dict-selector <dict-selector :type="DICT_TYPE.CUSTOMER_QUERY_NUMBER_FIELD" defaultable v-model="weightYearly.key" class="w-50" />
:type="DICT_TYPE.CUSTOMER_QUERY_NUMBER_FIELD"
defaultable
v-model="weightYearly.key"
class="w-50"
/>
</template> </template>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('商品类别')" v-show="showSearch"> <el-form-item :label="$t('商品类别')" v-show="showSearch">
<el-select <el-select @change="handleSelectProductType" multiple v-model="queryParams.productTypes" :placeholder="$t('请选择')">
@change="handleSelectProductType" <el-option :label="item.titleZh" :value="item.id" v-for="item in productTypeList" :key="item.id" />
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-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('商品名称')" v-show="showSearch"> <el-form-item :label="$t('商品名称')" v-show="showSearch">
<el-select <el-select multiple filterable clearable v-model="queryParams.productIds" :placeholder="$t('请选择商品名称')">
multiple <el-option :label="item.titleZh" :value="parseInt(item.id)" v-for="item in productList" :key="item.id" />
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-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('主要竞争对手')" v-show="showSearch"> <el-form-item :label="$t('主要竞争对手')" v-show="showSearch">
<el-select <el-select clearable multiple v-model="queryParams.competitorIds" :placeholder="$t('请选择')" @change="handleQuery">
clearable <el-option v-for="item in competitorList" :key="item.id" :label="item.name" :value="item.id" />
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-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('年度发货次数')" v-show="showSearch"> <el-form-item :label="$t('年度发货次数')" v-show="showSearch">
<el-input <el-input v-model.trim="numYearly.value" :placeholder="$t('请输入数字')" clearable @keyup.enter.native="handleQuery" @input="numYearly.value = numYearly.value.replace(/\s+/g, '')">
v-model.trim="numYearly.value"
:placeholder="$t('请输入数字')"
clearable
@keyup.enter.native="handleQuery"
@input="numYearly.value=numYearly.value.replace(/\s+/g, '')"
>
<template slot="prepend"> <template slot="prepend">
<dict-selector <dict-selector :type="DICT_TYPE.CUSTOMER_QUERY_NUMBER_FIELD" defaultable v-model="numYearly.key" class="w-50" />
:type="DICT_TYPE.CUSTOMER_QUERY_NUMBER_FIELD"
defaultable
v-model="numYearly.key"
class="w-50"
/>
</template> </template>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('推介人')" v-show="showSearch"> <el-form-item :label="$t('推介人')" v-show="showSearch">
<el-select <el-select clearable remote :remote-method="remoteMethod" v-model="queryParams.promoter" :placeholder="$t('请输入推介人')" filterable>
clearable <el-option v-for="item in customerSelectFn" :key="item.id" :label="item.name" :value="item.id"> </el-option>
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-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('入仓确认')" v-show="showSearch"> <el-form-item :label="$t('入仓确认')" v-show="showSearch">
...@@ -409,131 +199,44 @@ ...@@ -409,131 +199,44 @@
<el-switch v-model="queryParams.isShowTidanPrice" /> <el-switch v-model="queryParams.isShowTidanPrice" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('归属时间')" v-show="showSearch"> <el-form-item :label="$t('归属时间')" v-show="showSearch">
<el-date-picker <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('结束日期')" />
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>
<el-form-item :label="$t('首次成交时间')" v-show="showSearch"> <el-form-item :label="$t('首次成交时间')" v-show="showSearch">
<el-date-picker <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('结束日期')" />
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>
<el-form-item :label="$t('获取方式')" v-show="showSearch"> <el-form-item :label="$t('获取方式')" v-show="showSearch">
<el-select <el-select v-model="queryParams.getMethod" multiple :placeholder="$t('请选择')">
v-model="queryParams.getMethod" <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)" />
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-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('创建入口')" v-show="showSearch"> <el-form-item :label="$t('创建入口')" v-show="showSearch">
<el-select <el-select v-model="queryParams.createFroms" multiple :placeholder="$t('请选择')">
v-model="queryParams.createFroms" <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_FROM)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
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-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('结算方式')" v-show="showSearch"> <el-form-item :label="$t('结算方式')" v-show="showSearch">
<el-select <el-select v-model="queryParams.balances" multiple :placeholder="$t('请选择结算方式')">
v-model="queryParams.balances" <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_BALANCE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
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-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{ <el-button type="primary" icon="el-icon-search" @click="handleQuery">{{ $t("搜索") }}</el-button>
$t("搜索") <el-button icon="el-icon-refresh" @click="resetQuery">{{ $t("重置") }}</el-button>
}}</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{
$t("重置")
}}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- 操作工具栏 --> <!-- 操作工具栏 -->
<div <div v-if="path === '/customer/customer'" style="color: red; margin-bottom: 5px">注意:创建的客户需接收</div>
v-if="path === '/customer/customer'"
style="color: red; margin-bottom: 5px"
>
注意:创建的客户需接收
</div>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button v-if="path === '/customer/potential'" type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddPotential">{{ $t("新增潜在客户") }}</el-button>
v-if="path === '/customer/potential'" <el-button v-else type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="[selectAuthorityFn('ecw:customer:create')]">{{ $t("新增") }} </el-button>
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>
<el-col :span="1.5"> <el-col :span="1.5">
<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>
: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>
<el-col :span="1.5"> <el-col :span="1.5">
<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>
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>
<el-col :span="1.5"> <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"--> <!-- <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 @@ ...@@ -544,68 +247,22 @@
<!-- v-hasPermi="['ecw:customer:transport']">{{$t('设为非空运客户')}}</el-button>--> <!-- v-hasPermi="['ecw:customer:transport']">{{$t('设为非空运客户')}}</el-button>-->
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<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>
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>
<el-col :span="1.5"> <el-col :span="1.5">
<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>
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>
<el-col :span="1.5"> <el-col :span="1.5">
<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>
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>
<el-col :span="1.5"> <el-col :span="1.5">
<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>
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> </el-col>
<right-toolbar <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row> </el-row>
<!-- 列表 --> <!-- 列表 -->
<el-table <el-table ref="multipleTable" v-loading="loading" :data="list" @selection-change="handleSelectionChange">
ref="multipleTable"
v-loading="loading"
:data="list"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" fixed></el-table-column> <el-table-column type="selection" width="55" fixed></el-table-column>
<el-table-column :label="$t('客户编号')" align="center" fixed> <el-table-column :label="$t('客户编号')" align="center" fixed>
<template v-slot="{ row }"> <template v-slot="{ row }">
...@@ -631,10 +288,7 @@ ...@@ -631,10 +288,7 @@
<el-table-column :label="$t('信用等级')" :prop="isChinese ? 'creditLevelNameZh' : 'creditLevelNameEn'"></el-table-column> <el-table-column :label="$t('信用等级')" :prop="isChinese ? 'creditLevelNameZh' : 'creditLevelNameEn'"></el-table-column>
--> -->
<el-table-column <el-table-column :label="$t('主联系人')" prop="defaultContactName"></el-table-column>
:label="$t('主联系人')"
prop="defaultContactName"
></el-table-column>
<el-table-column :label="$t('主联系方式')" prop="defaultContactPhone"> <el-table-column :label="$t('主联系方式')" prop="defaultContactPhone">
<template v-slot="{ row }"> <template v-slot="{ row }">
+{{ row.defaultContactPhone }} <br /> +{{ row.defaultContactPhone }} <br />
...@@ -644,21 +298,30 @@ ...@@ -644,21 +298,30 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('客户类别')" align="center" prop="status"> <el-table-column :label="$t('客户类别')" align="center" prop="status">
<template slot-scope="scope"> <template slot-scope="{ row }">
<dict-tag {{
:type="DICT_TYPE.CUSTOMER_TYPE" getDictDatas2(DICT_TYPE.CUSTOMER_TYPE, (row.type || "").split(","))
:value="scope.row.type" .map((e) => (isChinese ? e.label : e.labelEn))
/> .join(", ")
}}
<!-- <dict-tag-->
<!-- :type="DICT_TYPE.CUSTOMER_TYPE"-->
<!-- :value="scope.row.type"-->
<!-- />-->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('角色')" align="center" prop="status"> <el-table-column :label="$t('角色')" align="center" prop="status">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
{{ getDictDatas2(DICT_TYPE.CUSTOMER_ROLE, (row.roles||'').split(',')).map(e => isChinese ? e.label : e.labelEn).join(', ')}} {{
<!-- {{ getCustomerRoles(row.roles) }}--> getDictDatas2(DICT_TYPE.CUSTOMER_ROLE, (row.roles || "").split(","))
<!-- <dict-tag--> .map((e) => (isChinese ? e.label : e.labelEn))
<!-- :type="DICT_TYPE.CUSTOMER_ROLE"--> .join(", ")
<!-- :value="scope.row.roles"--> }}
<!-- />--> <!-- {{ getCustomerRoles(row.roles) }}-->
<!-- <dict-tag-->
<!-- :type="DICT_TYPE.CUSTOMER_ROLE"-->
<!-- :value="scope.row.roles"-->
<!-- />-->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('客户经理')" align="center" prop="customerServiceName"></el-table-column> <el-table-column :label="$t('客户经理')" align="center" prop="customerServiceName"></el-table-column>
...@@ -670,10 +333,7 @@ ...@@ -670,10 +333,7 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('客户来源')"> <el-table-column :label="$t('客户来源')">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag <dict-tag :type="DICT_TYPE.CUSTOMER_SOURCE" :value="scope.row.source" />
:type="DICT_TYPE.CUSTOMER_SOURCE"
:value="scope.row.source"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('业务国家')"> <el-table-column :label="$t('业务国家')">
...@@ -696,8 +356,7 @@ ...@@ -696,8 +356,7 @@
{{ getProductTypeNames(row.productType) }} {{ getProductTypeNames(row.productType) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('主要竞争对手')" prop="competitorNames"> <el-table-column :label="$t('主要竞争对手')" prop="competitorNames"> </el-table-column>
</el-table-column>
<el-table-column :label="$t('年度发货次数')" align="center"> <el-table-column :label="$t('年度发货次数')" align="center">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
{{ row.numYearly }} {{ row.numYearly }}
...@@ -710,13 +369,13 @@ ...@@ -710,13 +369,13 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('入公海时间')" align="center" width="160"> <el-table-column :label="$t('入公海时间')" align="center" width="160">
<template v-slot="{ row }"> <template v-slot="{ row }">
{{ parseTime( row.enterOpenSeaTime ? row.enterOpenSeaTime : row.estimateEnterOpenSeaTime)}} {{ parseTime(row.enterOpenSeaTime ? row.enterOpenSeaTime : row.estimateEnterOpenSeaTime) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('入仓确认')" align="center"> <el-table-column :label="$t('入仓确认')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag type="success" v-if="scope.row.arrivalConfirm == 1">{{ $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> <el-tag type="info" v-else>{{ $t("") }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('控货无收货人')" align="center"> <el-table-column :label="$t('控货无收货人')" align="center">
...@@ -741,14 +400,10 @@ ...@@ -741,14 +400,10 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('获取方式')" align="center"> <el-table-column :label="$t('获取方式')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag <dict-tag :type="DICT_TYPE.CUSTOMER_GET_METHOD" :value="scope.row.getMethod" />
:type="DICT_TYPE.CUSTOMER_GET_METHOD"
:value="scope.row.getMethod"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('创建人')" prop="createUsername" align="center"> <el-table-column :label="$t('创建人')" prop="createUsername" align="center"> </el-table-column>
</el-table-column>
<el-table-column :label="$t('创建时间')" align="center" width="160"> <el-table-column :label="$t('创建时间')" align="center" width="160">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ parseTime(scope.row.createTime) }}</span>
...@@ -756,75 +411,20 @@ ...@@ -756,75 +411,20 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('最后更新时间')" align="center" width="160"> <el-table-column :label="$t('最后更新时间')" align="center" width="160">
<template slot-scope="scope"> <template slot-scope="scope">
<span >{{ parseTime(scope.row.updateTime) }}</span> <span>{{ parseTime(scope.row.updateTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="200px" :label="$t('操作')" align="center" fixed="right"> <el-table-column width="200px" :label="$t('操作')" align="center" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-button size="mini" type="text" v-show="'development' === env && scope.row.isInOpenSea" @click="seasPond(scope.row)"--> <!-- <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>--> <!-- v-hasPermi="['ecw:customer:query']">{{$t('掉入公海池')}}</el-button>-->
<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>
size="mini" <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="[selectAuthorityFn('ecw:customer:update')]">{{ $t("修改") }}</el-button>
type="text" <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="[selectAuthorityFn('ecw:customer:delete')]">{{ $t("删除") }}</el-button>
icon="el-icon-view" <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>
@click="handleView(scope.row)" <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>
v-hasPermi="[selectAuthorityFn('ecw:customer:index-query')]" <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>
>{{ $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-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("回收客户") }} {{ $t("回收客户") }}
</el-button> </el-button>
<el-button <el-button
...@@ -833,107 +433,54 @@ ...@@ -833,107 +433,54 @@
size="mini" size="mini"
type="text" type="text"
@click=" @click="
dialogVisible = true; dialogVisible = true
customData = scope.row; customData = scope.row
currentisNew = scope.row.isNew; currentisNew = scope.row.isNew
" "
> >
{{ $t("业绩类型") }} {{ $t("业绩类型") }}
</el-button> </el-button>
<!--lanbm 2024-05-23 添加报价按钮逻辑控制--> <!--lanbm 2024-05-23 添加报价按钮逻辑控制-->
<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>
v-has-permi="[selectAuthorityFn('ecw:customer:treat-quoted-price')]" <el-button v-has-permi="['ecw:customer:setting']" size="mini" type="text" icon="el-icon-user" @click="handleSetting(scope.row)">{{ $t("设置") }}</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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 分页组件 --> <!-- 分页组件 -->
<pagination <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" @pagination="getList" />
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 对话框(添加 / 修改) --> <!-- 对话框(添加 / 修改) -->
<el-dialog <el-dialog :title="title" :visible.sync="open" width="90%" append-to-body :close-on-click-modal="false">
: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-form ref="form" :model="form" :rules="rules" label-width="150px">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('客户名称')" prop="name"> <el-form-item :label="$t('客户名称')" prop="name">
<el-input <el-input v-model="form.name" :placeholder="$t('请输入客户名称')" />
v-model="form.name"
:placeholder="$t('请输入客户名称')"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('国家')" prop="country"> <el-form-item :label="$t('国家')" prop="country">
<el-select v-model="form.country" :placeholder="$t('请选择国家')"> <el-select v-model="form.country" :placeholder="$t('请选择国家')">
<el-option <el-option v-for="dict in getDictDatas(DICT_TYPE.COUNTRY)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
v-for="dict in getDictDatas(DICT_TYPE.COUNTRY)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('客户等级')" prop="level"> <el-form-item :label="$t('客户等级')" prop="level">
<el-select <el-select v-model="form.level" :placeholder="$t('请选择客户等级')">
v-model="form.level" <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_LEVEL)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
: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-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('联系地址')" prop="address"> <el-form-item :label="$t('联系地址')" prop="address">
<el-input <el-input v-model="form.address" :placeholder="$t('请输入联系地址')" />
v-model="form.address"
:placeholder="$t('请输入联系地址')"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('客户类别')" prop="type"> <el-form-item :label="$t('客户类别')" prop="type">
<el-select <el-select v-model="form.type" :placeholder="$t('请选择客户类别')">
v-model="form.type" <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_TYPE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="dict.value" />
: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-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -947,54 +494,31 @@ ...@@ -947,54 +494,31 @@
<!-- </el-col>--> <!-- </el-col>-->
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('常用提货网点')" prop="pickupPoint"> <el-form-item :label="$t('常用提货网点')" prop="pickupPoint">
<el-select <el-select v-model="form.pickupPoint" :placeholder="$t('请输入常用提货网点')">
v-model="form.pickupPoint" <el-option v-for="node in nodeList" :key="node.value" :label="node.label" :value="node.value" />
:placeholder="$t('请输入常用提货网点')"
>
<el-option
v-for="node in nodeList"
:key="node.value"
:label="node.label"
:value="node.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('公司名称')" prop="company"> <el-form-item :label="$t('公司名称')" prop="company">
<el-input <el-input v-model="form.company" :placeholder="$t('请输入公司名称')" />
v-model="form.company"
:placeholder="$t('请输入公司名称')"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('客户生日')" prop="birthday"> <el-form-item :label="$t('客户生日')" prop="birthday">
<el-date-picker <el-date-picker v-model="form.birthday" type="date" value-format="timestamp" :placeholder="$t('请输入客户生日')"> </el-date-picker>
v-model="form.birthday"
type="date"
value-format="timestamp"
:placeholder="$t('请输入客户生日')"
>
</el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('主营类别')" prop="productType"> <el-form-item :label="$t('主营类别')" prop="productType">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="11"> <el-col :span="11">
<el-select <el-select v-model="form.productType" :placeholder="$t('请选择产品类别')">
v-model="form.productType"
:placeholder="$t('请选择产品类别')"
>
<!-- <el-option :label="$t('请选择字典生成')" value="" />--> <!-- <el-option :label="$t('请选择字典生成')" value="" />-->
</el-select> </el-select>
</el-col> </el-col>
<el-col :span="11"> <el-col :span="11">
<el-select <el-select v-model="form.productType" :placeholder="$t('请选择主营类别')">
v-model="form.productType"
:placeholder="$t('请选择主营类别')"
>
<!-- <el-option :label="$t('请选择字典生成')" value="" />--> <!-- <el-option :label="$t('请选择字典生成')" value="" />-->
</el-select> </el-select>
</el-col> </el-col>
...@@ -1003,46 +527,22 @@ ...@@ -1003,46 +527,22 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('客户来源')" prop="source"> <el-form-item :label="$t('客户来源')" prop="source">
<el-select <el-select v-model="form.source" :placeholder="$t('请选择客户来源')">
v-model="form.source" <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_SOURCE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
: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-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('结算方式')" prop="balance"> <el-form-item :label="$t('结算方式')" prop="balance">
<el-select <el-select v-model="form.balance" :placeholder="$t('请选择结算方式')">
v-model="form.balance" <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_BALANCE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
: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-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('客户经理')" prop="customerService"> <el-form-item :label="$t('客户经理')" prop="customerService">
<el-select <el-select v-model="form.customerService" :placeholder="$t('请选择客户经理')">
v-model="form.customerService" <el-option v-for="dict in customerServiceList" :key="dict.id" :label="dict.nickname" :value="dict.id" />
:placeholder="$t('请选择客户经理')"
>
<el-option
v-for="dict in customerServiceList"
:key="dict.id"
:label="dict.nickname"
:value="dict.id"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -1053,84 +553,47 @@ ...@@ -1053,84 +553,47 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('客户状态')" prop="status"> <el-form-item :label="$t('客户状态')" prop="status">
<el-select <el-select v-model="form.status" :placeholder="$t('请选择客户状态')">
v-model="form.status" <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_STATUS)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
: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-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('推介人')" prop="promoter"> <el-form-item :label="$t('推介人')" prop="promoter">
<el-input <el-input v-model="form.promoter" :placeholder="$t('请输入推介人')" />
v-model="form.promoter"
:placeholder="$t('请输入推介人')"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('创建人')" prop="founder"> <el-form-item :label="$t('创建人')" prop="founder">
<el-input <el-input v-model="form.founder" :placeholder="$t('请输入创建人')" />
v-model="form.founder"
:placeholder="$t('请输入创建人')"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('创建时间')" prop="founder"> <el-form-item :label="$t('创建时间')" prop="founder">
<el-date-picker <el-date-picker v-model="form.createTime" type="datetime" value-format="timestamp" :placeholder="$t('选择创建时间')"> </el-date-picker>
v-model="form.createTime"
type="datetime"
value-format="timestamp"
:placeholder="$t('选择创建时间')"
>
</el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('备注')" prop="remarks"> <el-form-item :label="$t('备注')" prop="remarks">
<el-input <el-input v-model="form.remarks" :placeholder="$t('请输入备注')" />
v-model="form.remarks"
:placeholder="$t('请输入备注')"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item :label="$t('到仓确认')" prop="arrivalConfirm"> <el-form-item :label="$t('到仓确认')" prop="arrivalConfirm">
<el-switch <el-switch v-model="form.arrivalConfirm" :active-value="0" :inactive-value="1" />
v-model="form.arrivalConfirm"
:active-value="0"
:inactive-value="1"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item :label="$t('重货标准(CBM)')" prop="weightUnit"> <el-form-item :label="$t('重货标准(CBM)')" prop="weightUnit">
<el-input <el-input v-model="form.weightUnit" :placeholder="$t('请输入重货标准(CBM)')" />
v-model="form.weightUnit"
:placeholder="$t('请输入重货标准(CBM)')"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item :label="$t('指定线路')" prop="line"> <el-form-item :label="$t('指定线路')" prop="line">
<el-switch v-model="showLine"></el-switch> <el-switch v-model="showLine"></el-switch>
<el-table <el-table v-show="showLine" border :data="form.customerLines" style="width: 500px">
v-show="showLine" <el-table-column prop="departureId" :label="$t('始发地')"> </el-table-column>
border <el-table-column prop="objectiveId" :label="$t('目的地')"> </el-table-column>
: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-table>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -1139,131 +602,67 @@ ...@@ -1139,131 +602,67 @@
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>{{ $t("联系人") }}</span> <span>{{ $t("联系人") }}</span>
<el-button <el-button style="float: right" size="small" type="primary" @click="form.customerContacts.push({ department: undefined })">+</el-button>
style="float: right"
size="small"
type="primary"
@click="form.customerContacts.push({ department: undefined })"
>+</el-button
>
</div> </div>
<el-table :data="form.customerContacts" style="width: 100%"> <el-table :data="form.customerContacts" style="width: 100%">
<el-table-column prop="department" :label="$t('部门')" width=""> <el-table-column prop="department" :label="$t('部门')" width="">
<template v-slot="{ row, column, $index }"> <template v-slot="{ row, column, $index }">
<el-input <el-input v-model="row.department" :placeholder="$t('请输入部门')" size="mini" />
v-model="row.department"
:placeholder="$t('请输入部门')"
size="mini"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="position" :label="$t('职位')" width=""> <el-table-column prop="position" :label="$t('职位')" width="">
<template v-slot="{ row }"> <template v-slot="{ row }">
<el-input <el-input v-model="row.position" :placeholder="$t('请输入职位')" size="mini" />
v-model="row.position"
:placeholder="$t('请输入职位')"
size="mini"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="name" :label="$t('联系人')"> <el-table-column prop="name" :label="$t('联系人')">
<template v-slot:header <template v-slot:header>{{ $t("联系人") }}<span style="color: #ff0000">*</span> </template>
>{{ $t("联系人") }}<span style="color: #ff0000">*</span>
</template>
<template v-slot="{ row }"> <template v-slot="{ row }">
<el-input <el-input v-model="row.name" :placeholder="$t('请输入联系人')" size="mini" />
v-model="row.name"
:placeholder="$t('请输入联系人')"
size="mini"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="areaCode" :label="$t('区号')"> <el-table-column prop="areaCode" :label="$t('区号')">
<template v-slot:header <template v-slot:header>{{ $t("区号") }}<span style="color: #ff0000">*</span> </template>
>{{ $t("区号") }}<span style="color: #ff0000">*</span>
</template>
<template v-slot="{ row }"> <template v-slot="{ row }">
<el-select <el-select v-model="row.areaCode" :placeholder="$t('请选择区号')">
v-model="row.areaCode" <el-option v-for="dict in getDictDatas(DICT_TYPE.AREA_CODE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
: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> </el-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="phoneNew" :label="$t('联系方式')"> <el-table-column prop="phoneNew" :label="$t('联系方式')">
<template v-slot:header <template v-slot:header>{{ $t("联系方式") }}<span style="color: #ff0000">*</span> </template>
>{{ $t("联系方式") }}<span style="color: #ff0000">*</span>
</template>
<template v-slot="{ row }"> <template v-slot="{ row }">
<el-input <el-input v-model="row.phoneNew" :placeholder="$t('请输入联系方式')" size="mini" />
v-model="row.phoneNew"
:placeholder="$t('请输入联系方式')"
size="mini"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="" :label="$t('关联账号')"> </el-table-column> <el-table-column prop="" :label="$t('关联账号')"> </el-table-column>
<el-table-column prop="social" :label="$t('社交软件')"> <el-table-column prop="social" :label="$t('社交软件')">
<template v-slot="{ row }"> <template v-slot="{ row }">
<el-select <el-select v-model="row.social" :placeholder="$t('请选择社交软件')">
v-model="row.social" <el-option v-for="dict in getDictDatas(DICT_TYPE.SOCIAL)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
: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> </el-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="socialNumber" :label="$t('社交软件号码')"> <el-table-column prop="socialNumber" :label="$t('社交软件号码')">
<template v-slot="{ row }"> <template v-slot="{ row }">
<el-input <el-input v-model="row.socialNumber" :placeholder="$t('请输入社交软件号码')" size="mini" />
v-model="row.socialNumber"
:placeholder="$t('请输入社交软件号码')"
size="mini"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="email" :label="$t('邮箱')"> <el-table-column prop="email" :label="$t('邮箱')">
<template v-slot="{ row }"> <template v-slot="{ row }">
<el-input <el-input v-model="row.email" :placeholder="$t('请输入邮箱')" size="mini" />
v-model="row.email"
:placeholder="$t('请输入邮箱')"
size="mini"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="isDefault" :label="$t('设为默认')"> <el-table-column prop="isDefault" :label="$t('设为默认')">
<template v-slot="{ row }"> <template v-slot="{ row }">
<el-select <el-select v-model="row.isDefault" :placeholder="$t('设为默认')">
v-model="row.isDefault" <el-option v-for="dict in getDictDatas(DICT_TYPE.IS_DEFAULT)" :key="dict.value" :label="dict.label" :value="parseInt(dict.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> </el-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="name" :label="$t('操作')"> <el-table-column prop="name" :label="$t('操作')">
<template v-slot="{ row, column, $index }"> <template v-slot="{ row, column, $index }">
<el-button <el-button type="danger" @click="form.customerContacts.splice($index, 1)">{{ $t("删除") }}</el-button>
type="danger"
@click="form.customerContacts.splice($index, 1)"
>{{ $t("删除") }}</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -1272,18 +671,12 @@ ...@@ -1272,18 +671,12 @@
<el-row :gutter="10" style="margin-top: 15px"> <el-row :gutter="10" style="margin-top: 15px">
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('发票抬头')" prop="invoiceTitle"> <el-form-item :label="$t('发票抬头')" prop="invoiceTitle">
<el-input <el-input v-model="form.invoiceTitle" :placeholder="$t('请输入发票抬头')" />
v-model="form.invoiceTitle"
:placeholder="$t('请输入发票抬头')"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('纳税人识别号')" prop="licenseNumber"> <el-form-item :label="$t('纳税人识别号')" prop="licenseNumber">
<el-input <el-input v-model="form.licenseNumber" :placeholder="$t('请输入纳税人识别号')" />
v-model="form.licenseNumber"
:placeholder="$t('请输入纳税人识别号')"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
...@@ -1293,86 +686,42 @@ ...@@ -1293,86 +686,42 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('账户')" prop="bankNumber"> <el-form-item :label="$t('账户')" prop="bankNumber">
<el-input <el-input v-model="form.bankNumber" :placeholder="$t('请输入账户')" />
v-model="form.bankNumber"
:placeholder="$t('请输入账户')"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('项目')" prop="project"> <el-form-item :label="$t('项目')" prop="project">
<el-input <el-input v-model="form.project" :placeholder="$t('请输入项目')" />
v-model="form.project"
:placeholder="$t('请输入项目')"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('开票地址')" prop="billingAddress"> <el-form-item :label="$t('开票地址')" prop="billingAddress">
<el-input <el-input v-model="form.billingAddress" :placeholder="$t('请输入开票地址')" />
v-model="form.billingAddress"
:placeholder="$t('请输入开票地址')"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('开票电话')" prop="billingTell"> <el-form-item :label="$t('开票电话')" prop="billingTell">
<el-input <el-input v-model="form.billingTell" :placeholder="$t('请输入开票电话')" />
v-model="form.billingTell"
:placeholder="$t('请输入开票电话')"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('税率')" prop="taxRate"> <el-form-item :label="$t('税率')" prop="taxRate">
<el-input <el-input v-model="form.taxRate" :placeholder="$t('请输入税率')" />
v-model="form.taxRate"
:placeholder="$t('请输入税率')"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">{{ <el-button type="primary" @click="submitForm">{{ $t("确 定") }}</el-button>
$t("确 定")
}}</el-button>
<el-button @click="cancel">{{ $t("取 消") }}</el-button> <el-button @click="cancel">{{ $t("取 消") }}</el-button>
</div> </div>
</el-dialog> </el-dialog>
<customer-follow-list <customer-follow-list :customer-id="customerId" :id="customerId" :customer-service="customerService" :customer-number="customerNumber" ref="CustomerFollowList" v-if="customerFollowVisible"></customer-follow-list>
:customer-id="customerId" <customer-complaints :customer-id="customerId" ref="customerComplaints"></customer-complaints>
:id="customerId" <transfer-customer :show.sync="transferShow" :customer-ids.sync="selectCustomerList"></transfer-customer>
:customer-service="customerService" <add-potential-custom ref="potentialCustom" @change="getList"></add-potential-custom>
:customer-number="customerNumber" <customer-setting ref="customerSetting" @refresh="getList"></customer-setting>
ref="CustomerFollowList" <customer-merge ref="customerMerge" @refresh="getList" :countryList="countryList" :getNodeLists="getNodeLists" :productTypeList="getNodeLists" :customerSelectFn="customerSelectFn" v-if="customerMergeVisible"></customer-merge>
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%"> <el-dialog title="业绩类型" :visible.sync="dialogVisible" width="30%">
<div> <div>
...@@ -1389,58 +738,36 @@ ...@@ -1389,58 +738,36 @@
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button> <el-button @click="dialogVisible = false">取 消</el-button>
<el-button <el-button :disabled="customData.isNew === currentisNew" type="primary" @click="modifyCustomer">修改</el-button>
:disabled="customData.isNew === currentisNew"
type="primary"
@click="modifyCustomer"
>修改</el-button
>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { import { createCustomer, updateCustomer, deleteCustomer, getCustomer, getCustomerPage, exportCustomerExcel, testEnterToOpenSea, getCustomerDeptPage, changeCustomerAir, getPotential, setChangeCustomerFcl, potentialExportExcel, deptExportExcel, recycleUnconfirmedCustomer, updatecustomerToOld, competitorListAll } from "@/api/ecw/customer"
createCustomer, import { getDictDatas, DICT_TYPE, getDictDatas2 } from "@/utils/dict"
updateCustomer, import { CommonStatusEnum } from "@/utils/constants"
deleteCustomer, import { uploadFile } from "@/api/infra/file"
getCustomer, import upload from "@/components/ImageUpload"
getCustomerPage, import { getNodeList } from "@/api/ecw/node"
exportCustomerExcel, import CustomerFollowList from "./components/customerFollow"
testEnterToOpenSea, import customerComplaints from "@/components/customerComplaints"
getCustomerDeptPage, import { listServiceUser, getUserProfile, listAllSimpl } from "@/api/system/user"
changeCustomerAir, import { getCountryListAll } from "@/api/ecw/country"
getPotential, import { getCreditPage } from "@/api/customer/credit"
setChangeCustomerFcl, import { customerExportExcel, changeCustomerDefaultPay, changeCustomerNoConsignee, changeCustomerDefaultBilling } from "@/api/ecw/customer"
potentialExportExcel, import transferCustomer from "@/views/ecw/customer/transferCustomer"
deptExportExcel, import Template from "@/views/cms/template/index.vue"
recycleUnconfirmedCustomer, import AddPotentialCustom from "@/views/ecw/customer/addPotentialCustom.vue"
updatecustomerToOld, import Contacts from "@/views/ecw/customer/components/contacts.vue"
competitorListAll import CustomerSetting from "./components/customerSetting.vue"
} from "@/api/ecw/customer"; import CustomerMerge from "./components/customerMerge.vue"
import {getDictDatas, DICT_TYPE, getDictDatas2} from "@/utils/dict"; import AreaCodeSelector from "@/components/AreaCodeSelector/index.vue"
import { CommonStatusEnum } from "@/utils/constants"; import { getCustomerSelect } from "@/api/ecw/customer"
import { uploadFile } from "@/api/infra/file"; import { getProductTypeList } from "@/api/ecw/productType"
import upload from "@/components/ImageUpload"; import { getProductList } from "@/api/ecw/product"
import { getNodeList } from "@/api/ecw/node"; import { listMySimpleDepts } from "@/api/system/dept"
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 { export default {
name: "EcwCustomerIndex", name: "EcwCustomerIndex",
components: { components: {
...@@ -1479,7 +806,7 @@ export default { ...@@ -1479,7 +806,7 @@ export default {
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10
/*number: null, /*number: null,
name: null, name: null,
level: null, level: null,
...@@ -1503,55 +830,53 @@ export default { ...@@ -1503,55 +830,53 @@ export default {
{ {
required: true, required: true,
message: this.$t("客户名称不能为空"), message: this.$t("客户名称不能为空"),
trigger: "blur", trigger: "blur"
}, }
],
country: [
{ required: true, message: this.$t("国家不能为空"), trigger: "blur" },
], ],
country: [{ required: true, message: this.$t("国家不能为空"), trigger: "blur" }],
level: [ level: [
{ {
required: true, required: true,
message: this.$t("客户等级不能为空"), message: this.$t("客户等级不能为空"),
trigger: "blur", trigger: "blur"
}, }
], ],
type: [ type: [
{ {
required: true, required: true,
message: this.$t("客户类别不能为空"), message: this.$t("客户类别不能为空"),
trigger: "blur", trigger: "blur"
}, }
], ],
// createTime: [{ required: true, message: this.$t("创建时间不能为空"), trigger: "blur" }], // createTime: [{ required: true, message: this.$t("创建时间不能为空"), trigger: "blur" }],
source: [ source: [
{ {
required: true, required: true,
message: this.$t("客户来源不能为空"), message: this.$t("客户来源不能为空"),
trigger: "blur", trigger: "blur"
}, }
], ],
customerService: [ customerService: [
{ {
required: true, required: true,
message: this.$t("客户经理不能为空"), message: this.$t("客户经理不能为空"),
trigger: "blur", trigger: "blur"
}, }
], ],
status: [ status: [
{ {
required: true, required: true,
message: this.$t("客户状态不能为空"), message: this.$t("客户状态不能为空"),
trigger: "blur", trigger: "blur"
}, }
], ],
founder: [ founder: [
{ {
required: true, required: true,
message: this.$t("创建人不能为空"), message: this.$t("创建人不能为空"),
trigger: "blur", trigger: "blur"
}, }
], ]
}, },
// 网点 // 网点
nodeList: [], nodeList: [],
...@@ -1579,21 +904,21 @@ export default { ...@@ -1579,21 +904,21 @@ export default {
allSimplList: [], allSimplList: [],
weightYearly: { weightYearly: {
key: "eqNumberKey", key: "eqNumberKey",
value: "", value: ""
}, },
numYearly: { numYearly: {
key: "eqNumberKey", key: "eqNumberKey",
value: "", value: ""
}, },
productTypeList: [], productTypeList: [],
productList: [], productList: [],
competitorList: [], competitorList: [],
deptList: [], deptList: []
}; }
}, },
computed: { computed: {
path() { path() {
return this.$route.path; return this.$route.path
}, },
channel() { channel() {
return (val) => { return (val) => {
...@@ -1602,43 +927,41 @@ export default { ...@@ -1602,43 +927,41 @@ export default {
.filter((i) => (val.split(",") || []).includes(i.value)) .filter((i) => (val.split(",") || []).includes(i.value))
.map((i) => (this.isChinese ? i.label : i.labelEn)) .map((i) => (this.isChinese ? i.label : i.labelEn))
.join("") .join("")
: ""; : ""
}; }
}, },
isChinese() { isChinese() {
return this.$i18n.locale === "zh_CN"; return this.$i18n.locale === "zh_CN"
}, },
authorityFn() { authorityFn() {
let i = ""; let i = ""
switch (this.$route.path) { switch (this.$route.path) {
case "/customer/department-customers": case "/customer/department-customers":
i = "dep-"; i = "dep-"
break; break
case "/customer/potential": case "/customer/potential":
i = "pot-"; i = "pot-"
break; break
} }
return i; return i
}, },
selectAuthorityFn() { selectAuthorityFn() {
return (val) => { return (val) => {
let t = val.split(":"); let t = val.split(":")
t[t.length - 1] = this.authorityFn + t[t.length - 1]; t[t.length - 1] = this.authorityFn + t[t.length - 1]
console.log(t.join(":")); console.log(t.join(":"))
return t.join(":"); return t.join(":")
}; }
}, },
customerSelectFn() { customerSelectFn() {
if (this.recommended.length > 0) { if (this.recommended.length > 0) {
let i = this.customerSelect.find( let i = this.customerSelect.find((item) => item.id === this.recommended[0].id)
(item) => item.id === this.recommended[0].id
);
if (!i) { if (!i) {
this.customerSelect.push(this.recommended[0]); this.customerSelect.push(this.recommended[0])
} }
return this.customerSelect; return this.customerSelect
} else { } else {
return this.customerSelect; return this.customerSelect
} }
}, },
combinedQueryParams() { combinedQueryParams() {
...@@ -1660,64 +983,64 @@ export default { ...@@ -1660,64 +983,64 @@ export default {
queryParams.endFirstDealTime = this.firstDealTime[1] queryParams.endFirstDealTime = this.firstDealTime[1]
} }
if (this.weightYearly.value) { if (this.weightYearly.value) {
let key = 'eqWeightYearly' let key = "eqWeightYearly"
if (this.weightYearly.key == 'leNumberKey') { if (this.weightYearly.key == "leNumberKey") {
key = 'leWeightYearly' key = "leWeightYearly"
} else if (this.weightYearly.key == 'geNumberKey') { } else if (this.weightYearly.key == "geNumberKey") {
key = 'geWeightYearly' key = "geWeightYearly"
} }
queryParams[key] = this.weightYearly.value; queryParams[key] = this.weightYearly.value
} }
if (this.numYearly.value) { if (this.numYearly.value) {
let key = 'eqNumYearly' let key = "eqNumYearly"
if (this.numYearly.key == 'leNumberKey') { if (this.numYearly.key == "leNumberKey") {
key = 'leNumYearly' key = "leNumYearly"
} else if (this.numYearly.key == 'geNumberKey') { } else if (this.numYearly.key == "geNumberKey") {
key = 'geNumYearly' key = "geNumYearly"
} }
queryParams[key] = this.numYearly.value; queryParams[key] = this.numYearly.value
} }
return queryParams; return queryParams
}, }
}, },
watch: { watch: {
selectCustomerList(val) { selectCustomerList(val) {
if (val.length === 0) { if (val.length === 0) {
this.getList(); this.getList()
this.$refs.multipleTable.clearSelection(); this.$refs.multipleTable.clearSelection()
}
} }
},
}, },
created() { created() {
getCreditPage({ page: 1, rows: 999 }).then((r) => { getCreditPage({ page: 1, rows: 999 }).then((r) => {
this.creditList = r.data.list; this.creditList = r.data.list
}); })
this.getList(); this.getList()
listServiceUser().then((r) => { listServiceUser().then((r) => {
this.customerServiceList = r.data; this.customerServiceList = r.data
}); })
getCountryListAll().then((r) => { getCountryListAll().then((r) => {
this.countryList = r.data; this.countryList = r.data
}); })
//获取用户id信息 lanbm 2024-05-23 add //获取用户id信息 lanbm 2024-05-23 add
getUserProfile().then((res) => { getUserProfile().then((res) => {
this.userId = res.data.id; this.userId = res.data.id
}); })
this.getCustomerSelect(); this.getCustomerSelect()
getNodeList().then((r) => { getNodeList().then((r) => {
this.getNodeLists = r.data; this.getNodeLists = r.data
}); })
listAllSimpl().then((r) => { listAllSimpl().then((r) => {
this.allSimplList = r.data; this.allSimplList = r.data
}); })
getProductTypeList().then((r) => { getProductTypeList().then((r) => {
this.productTypeList = r.data; this.productTypeList = r.data
}); })
competitorListAll().then((r) => { competitorListAll().then((r) => {
this.competitorList = r.data; this.competitorList = r.data
}) })
listMySimpleDepts().then(response => { listMySimpleDepts().then((response) => {
this.deptList = response.data this.deptList = response.data
}) })
}, },
...@@ -1727,112 +1050,106 @@ export default { ...@@ -1727,112 +1050,106 @@ export default {
}) })
}, },
activated() { activated() {
this.getList(); this.getList()
}, },
methods: { methods: {
//合并客户 //合并客户
handleMergeCus() { handleMergeCus() {
this.customerMergeVisible = true this.customerMergeVisible = true
this.$nextTick(_ => { this.$nextTick((_) => {
this.$refs['customerMerge'].init() this.$refs["customerMerge"].init()
this.$refs['customerMerge'].dialogVisible = true this.$refs["customerMerge"].dialogVisible = true
}) })
}, },
recovery(row) { recovery(row) {
this.$confirm(this.$t("是否要回收当前{name}", row), "提示", { this.$confirm(this.$t("是否要回收当前{name}", row), "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning"
}) })
.then(() => { .then(() => {
recycleUnconfirmedCustomer({ customerId: row.id }).then((r) => { recycleUnconfirmedCustomer({ customerId: row.id }).then((r) => {
this.$message.success(this.$t("回收成功。")); this.$message.success(this.$t("回收成功。"))
this.getList(); this.getList()
}); })
}) })
.catch(() => { .catch(() => {
this.$message.info(this.$t("已取消")); this.$message.info(this.$t("已取消"))
}); })
}, },
// 设置整柜 // 设置整柜
setFullContainerLoad(isFcl) { setFullContainerLoad(isFcl) {
setChangeCustomerFcl({ setChangeCustomerFcl({
customerIdList: this.selectCustomerList, customerIdList: this.selectCustomerList,
isFcl, isFcl
}).then((r) => { }).then((r) => {
if (r.code === 0) { if (r.code === 0) {
this.$message.success( this.$message.success(isFcl ? "设置客户为海运整柜成功!" : "设置客户为非海运整柜成功!")
isFcl ? "设置客户为海运整柜成功!" : "设置客户为非海运整柜成功!" this.selectCustomerList = []
); this.getList()
this.selectCustomerList = [];
this.getList();
} }
}); })
}, },
// 设置空运客户 // 设置空运客户
setChangeCustomerAir(isAir) { setChangeCustomerAir(isAir) {
changeCustomerAir({ changeCustomerAir({
customerIdList: this.selectCustomerList, customerIdList: this.selectCustomerList,
isAir, isAir
}).then((r) => { }).then((r) => {
console.log(r); console.log(r)
if (r.code === 0) { if (r.code === 0) {
this.$message.success( this.$message.success(isAir ? "设为空运客户成功!" : "设为非空运客户成功!")
isAir ? "设为空运客户成功!" : "设为非空运客户成功!" this.selectCustomerList = []
); this.getList()
this.selectCustomerList = [];
this.getList();
} }
}); })
}, },
/** 取消按钮 */ /** 取消按钮 */
cancel() { cancel() {
this.open = false; this.open = false
this.reset(); this.reset()
}, },
complaint(row) { complaint(row) {
this.customerId = row.id; this.customerId = row.id
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.customerComplaints.handleAdd(); this.$refs.customerComplaints.handleAdd()
}); })
}, },
countryFormatter(row, column, cellValue) { countryFormatter(row, column, cellValue) {
const country = this.countryList.find((e) => e.id === cellValue); const country = this.countryList.find((e) => e.id === cellValue)
return this.isChinese ? country?.nameZh : country?.nameEn; return this.isChinese ? country?.nameZh : country?.nameEn
}, },
delay(row) { delay(row) {
this.$router.push({ path: "/customer/delay", query: { id: row.id } }); this.$router.push({ path: "/customer/delay", query: { id: row.id } })
}, },
followUp(row) { followUp(row) {
this.customerId = row.id this.customerId = row.id
this.customerService = row.customerService this.customerService = row.customerService
this.customerNumber = row.number this.customerNumber = row.number
this.customerFollowVisible = true this.customerFollowVisible = true
this.$nextTick(_ => { this.$nextTick((_) => {
// this.$refs.CustomerFollowList.customerFollow.dialogVisible = true; // this.$refs.CustomerFollowList.customerFollow.dialogVisible = true;
this.$refs['CustomerFollowList'].init() this.$refs["CustomerFollowList"].init()
this.$refs['CustomerFollowList'].handleAdd() this.$refs["CustomerFollowList"].handleAdd()
}) })
}, },
//报价 //报价
quote(row) { quote(row) {
//lanbm 2024-05-23 添加报价是判断客户所属客户经理,不是就不能报价 //lanbm 2024-05-23 添加报价是判断客户所属客户经理,不是就不能报价
if (row.customerService != this.userId) { if (row.customerService != this.userId) {
this.$message.error(this.$t("此客户属于其他客户经理名下的客户。")); this.$message.error(this.$t("此客户属于其他客户经理名下的客户。"))
return; return
} }
//this.$router.push({path:'/offer/create',query:{id:row.id}}) //this.$router.push({path:'/offer/create',query:{id:row.id}})
this.$router this.$router.push({ path: "/offer/create", query: { customerId: row.id, customerType: row.type, type: 1 } }).then({
.push({ path: "/offer/create", query: { customer: row, type: 1 } })
.then({
//this.$refs.push({path:'/customer-contacts/select',query:{pageNo:1,pageSize:10,searchKey:row.defaultContactPhone}}) //this.$refs.push({path:'/customer-contacts/select',query:{pageNo:1,pageSize:10,searchKey:row.defaultContactPhone}})
}); })
}, },
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
this.loading = true; this.loading = true
// 处理查询参数} // 处理查询参数}
let params = { ...this.queryParams, ...this.combinedQueryParams }; let params = { ...this.queryParams, ...this.combinedQueryParams }
/*this.addBeginAndEndTime( /*this.addBeginAndEndTime(
params, params,
this.dateRangeCreateTime, this.dateRangeCreateTime,
...@@ -1842,32 +1159,30 @@ export default { ...@@ -1842,32 +1159,30 @@ export default {
// 执行查询 // 执行查询
switch (this.$route.path) { switch (this.$route.path) {
case "/customer/customer": case "/customer/customer":
getCustomerPage(params).then(this.setData); getCustomerPage(params).then(this.setData)
break; break
case "/customer/department-customers": case "/customer/department-customers":
getCustomerDeptPage(params).then(this.setData); getCustomerDeptPage(params).then(this.setData)
break; break
case "/customer/potential": case "/customer/potential":
getPotential(params).then(this.setData); getPotential(params).then(this.setData)
break; break
} }
}, },
remoteMethod(val) { remoteMethod(val) {
this.getCustomerSelect(val); this.getCustomerSelect(val)
}, },
getCustomerSelect(val = "") { getCustomerSelect(val = "") {
getCustomerSelect({ pageNo: 1, pageSize: 30, searchKey: val }).then( getCustomerSelect({ pageNo: 1, pageSize: 30, searchKey: val }).then((res) => {
(res) => { this.customerSelect = res.data.list
this.customerSelect = res.data.list; })
}
);
}, },
handleSelectProductType(val) { handleSelectProductType(val) {
if (val && val.length >= 1) { if (val && val.length >= 1) {
this.queryParams.productIds = [] this.queryParams.productIds = []
getProductList({ typeIds: val }).then((r) => { getProductList({ typeIds: val }).then((r) => {
this.productList = r.data this.productList = r.data
}); })
} else { } else {
this.queryParams.productIds = [] this.queryParams.productIds = []
this.productList = [] this.productList = []
...@@ -1875,50 +1190,48 @@ export default { ...@@ -1875,50 +1190,48 @@ export default {
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.$router.push("/customer/add-edit/0"); this.$router.push("/customer/add-edit/0")
// this.reset(); // this.reset();
// this.open = true; // this.open = true;
// this.title = this.$t("添加客户"); // this.title = this.$t("添加客户");
}, },
// 新增潜在客户 // 新增潜在客户
handleAddPotential() { handleAddPotential() {
this.$refs.potentialCustom.dialogTableVisible = true; this.$refs.potentialCustom.dialogTableVisible = true
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const id = row.id; const id = row.id
const name = row.name; const name = row.name
const number = row.number; const number = row.number
this.$modal this.$modal
.confirm( .confirm(this.$t('是否确认删除客户编号为"') + number + this.$t('"的数据项?'))
this.$t('是否确认删除客户编号为"') + number + this.$t('"的数据项?')
)
.then(function () { .then(function () {
return deleteCustomer(id); return deleteCustomer(id)
}) })
.then(() => { .then(() => {
this.getList(); this.getList()
this.$modal.msgSuccess(this.$t("删除成功")); this.$modal.msgSuccess(this.$t("删除成功"))
}) })
.catch(() => {}); .catch(() => {})
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
let func = null; let func = null
let title = ""; let title = ""
switch (this.$route.path) { switch (this.$route.path) {
case "/customer/customer": case "/customer/customer":
func = customerExportExcel; func = customerExportExcel
title = "是否确认导出所有客户数据项?"; title = "是否确认导出所有客户数据项?"
break; break
case "/customer/department-customers": case "/customer/department-customers":
func = deptExportExcel; func = deptExportExcel
title = "是否确认导出部门客户数据项?"; title = "是否确认导出部门客户数据项?"
break; break
case "/customer/potential": case "/customer/potential":
func = potentialExportExcel; func = potentialExportExcel
title = "是否确认导出潜在客户数据项?"; title = "是否确认导出潜在客户数据项?"
break; break
} }
// // 执行导出 // // 执行导出
...@@ -1926,25 +1239,23 @@ export default { ...@@ -1926,25 +1239,23 @@ export default {
.confirm(this.$t(title)) .confirm(this.$t(title))
.then(() => { .then(() => {
func().then((r) => { func().then((r) => {
this.$message.success( this.$message.success(this.$t("已加入导出队列,请稍后在下载日志中下载"))
this.$t("已加入导出队列,请稍后在下载日志中下载") })
);
});
}) })
.catch(() => {}); .catch(() => {})
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNo = 1; this.queryParams.pageNo = 1
this.getList(); this.getList()
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.selectCustomerList = val.map((i) => i.id); this.selectCustomerList = val.map((i) => i.id)
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
console.log(row.id); console.log(row.id)
this.$router.push("/customer/add-edit/" + row.id); this.$router.push("/customer/add-edit/" + row.id)
// this.reset(); // this.reset();
// const id = row.id; // const id = row.id;
// getCustomer(id).then(response => { // getCustomer(id).then(response => {
...@@ -1955,7 +1266,7 @@ export default { ...@@ -1955,7 +1266,7 @@ export default {
}, },
/** 查看按钮操作 */ /** 查看按钮操作 */
handleView(row) { handleView(row) {
this.$router.push("/customer/query/" + row.id); this.$router.push("/customer/query/" + row.id)
}, },
/** 表单重置 */ /** 表单重置 */
reset() { reset() {
...@@ -1994,39 +1305,39 @@ export default { ...@@ -1994,39 +1305,39 @@ export default {
taxRate: undefined, taxRate: undefined,
remarks: undefined, remarks: undefined,
arrivalConfirm: undefined, arrivalConfirm: undefined,
weightUnit: undefined, weightUnit: undefined
}; }
this.resetForm("form"); this.resetForm("form")
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.dateRangeCreateTime = []; this.dateRangeCreateTime = []
this.enterOpenSeaTime = [] this.enterOpenSeaTime = []
this.customerServiceConfirmedTime = [] this.customerServiceConfirmedTime = []
this.firstDealTime = [] this.firstDealTime = []
this.resetForm("queryForm"); this.resetForm("queryForm")
this.queryParams = { this.queryParams = {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10
}; }
this.weightYearly.value = ""; this.weightYearly.value = ""
this.numYearly.value = ""; this.numYearly.value = ""
this.handleQuery(); this.handleQuery()
}, },
/** 调入公海池测试用 */ /** 调入公海池测试用 */
seasPond(row) { seasPond(row) {
testEnterToOpenSea(row.id).then((r) => { testEnterToOpenSea(row.id).then((r) => {
if (r.code === 0) { if (r.code === 0) {
this.$t("调入公海池成功!"); this.$t("调入公海池成功!")
this.getList(); this.getList()
} }
}); })
}, },
setData(response) { setData(response) {
console.log(response, "response"); console.log(response, "response")
this.list = response.data.list; this.list = response.data.list
this.total = response.data.total; this.total = response.data.total
this.loading = false; this.loading = false
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
...@@ -2037,48 +1348,44 @@ export default { ...@@ -2037,48 +1348,44 @@ export default {
// 修改的提交 // 修改的提交
if (this.form.id != null) { if (this.form.id != null) {
updateCustomer(this.form).then((response) => { updateCustomer(this.form).then((response) => {
this.$modal.msgSuccess(this.$t("修改成功")); this.$modal.msgSuccess(this.$t("修改成功"))
this.open = false; this.open = false
this.getList(); this.getList()
}); })
return; return
} }
// 添加的提交 // 添加的提交
createCustomer(this.form).then((response) => { createCustomer(this.form).then((response) => {
this.$modal.msgSuccess(this.$t("新增成功")); this.$modal.msgSuccess(this.$t("新增成功"))
this.open = false; this.open = false
this.getList(); this.getList()
}); })
}); })
}, },
// 修改客户类型 // 修改客户类型
modifyCustomer() { modifyCustomer() {
this.$confirm( this.$confirm(this.$t("修改业绩类型后,将会影响客户新订单业绩计算,请问确定吗?"), this.$t("提示"), {
this.$t("修改业绩类型后,将会影响客户新订单业绩计算,请问确定吗?"),
this.$t("提示"),
{
confirmButtonText: this.$t("确定"), confirmButtonText: this.$t("确定"),
cancelButtonText: this.$t("取消"), cancelButtonText: this.$t("取消"),
type: "warning", type: "warning"
} })
)
.then(() => { .then(() => {
updatecustomerToOld({ updatecustomerToOld({
customerId: this.customData.id, customerId: this.customData.id,
isNew: this.currentisNew, isNew: this.currentisNew
}).then((r) => { }).then((r) => {
this.$message.success(this.$t("修改成功")); this.$message.success(this.$t("修改成功"))
this.dialogVisible = false; this.dialogVisible = false
this.getList(); this.getList()
});
}) })
.catch(() => {}); })
.catch(() => {})
}, },
setDefaultPay() { setDefaultPay() {
changeCustomerDefaultPay({ changeCustomerDefaultPay({
customerIdList: this.selectCustomerList, customerIdList: this.selectCustomerList,
defaultPay: true defaultPay: true
}).then(_ => { }).then((_) => {
this.$message.success(this.$t("操作成功")) this.$message.success(this.$t("操作成功"))
this.getList() this.getList()
}) })
...@@ -2087,7 +1394,7 @@ export default { ...@@ -2087,7 +1394,7 @@ export default {
changeCustomerNoConsignee({ changeCustomerNoConsignee({
customerIdList: this.selectCustomerList, customerIdList: this.selectCustomerList,
noConsigee: true noConsigee: true
}).then(_ => { }).then((_) => {
this.$message.success(this.$t("操作成功")) this.$message.success(this.$t("操作成功"))
this.getList() this.getList()
}) })
...@@ -2096,77 +1403,77 @@ export default { ...@@ -2096,77 +1403,77 @@ export default {
changeCustomerDefaultBilling({ changeCustomerDefaultBilling({
customerIdList: this.selectCustomerList, customerIdList: this.selectCustomerList,
defaultBilling: true defaultBilling: true
}).then(_ => { }).then((_) => {
this.$message.success(this.$t("操作成功")) this.$message.success(this.$t("操作成功"))
this.getList() this.getList()
}) })
}, },
handleSetting(row) { handleSetting(row) {
this.$refs['customerSetting'].dialogVisible = true this.$refs["customerSetting"].dialogVisible = true
this.$nextTick(_ => { this.$nextTick((_) => {
this.$refs['customerSetting'].init(row.id) this.$refs["customerSetting"].init(row.id)
}) })
}, },
getBusiCountryNames(ids) { getBusiCountryNames(ids) {
if (ids) { if (ids) {
const idsArr = ids.split(',') const idsArr = ids.split(",")
const strArr = [] const strArr = []
this.countryList.forEach(item => { this.countryList.forEach((item) => {
if (idsArr.includes(item.id.toString())) { if (idsArr.includes(item.id.toString())) {
strArr.push(this.isChinese ? item.nameZh : item.nameEn) strArr.push(this.isChinese ? item.nameZh : item.nameEn)
} }
}) })
return strArr.length > 0 ? strArr.join(',') : null return strArr.length > 0 ? strArr.join(",") : null
} else { } else {
return null return null
} }
}, },
getPickupPointNames(ids) { getPickupPointNames(ids) {
if (ids) { if (ids) {
const idsArr = ids.split(',') const idsArr = ids.split(",")
const strArr = [] const strArr = []
this.getNodeLists.forEach(item => { this.getNodeLists.forEach((item) => {
if (idsArr.includes(item.id.toString())) { if (idsArr.includes(item.id.toString())) {
strArr.push(this.isChinese ? item.titleZh : item.titleEn) strArr.push(this.isChinese ? item.titleZh : item.titleEn)
} }
}) })
return strArr.length > 0 ? strArr.join(',') : null return strArr.length > 0 ? strArr.join(",") : null
} else { } else {
return null return null
} }
}, },
getCustomerRoles(ids) { getCustomerRoles(ids) {
if (ids) { if (ids) {
const idsArr = ids.split(',') const idsArr = ids.split(",")
const strArr = [] const strArr = []
DICT_TYPE.CUSTOMER_ROLE.forEach(item => { DICT_TYPE.CUSTOMER_ROLE.forEach((item) => {
if (idsArr.includes(item.value.toString())) { if (idsArr.includes(item.value.toString())) {
strArr.push(this.isChinese ? item.label : item.labelEn) strArr.push(this.isChinese ? item.label : item.labelEn)
} }
}) })
return strArr.length > 0 ? strArr.join(',') : null return strArr.length > 0 ? strArr.join(",") : null
} else { } else {
return null return null
} }
}, },
getProductTypeNames(ids) { getProductTypeNames(ids) {
if (ids) { if (ids) {
const idsArr = ids.toString().split(',') const idsArr = ids.toString().split(",")
const strArr = [] const strArr = []
this.productTypeList.forEach(item => { this.productTypeList.forEach((item) => {
if (idsArr.includes(item.id.toString())) { if (idsArr.includes(item.id.toString())) {
strArr.push(this.isChinese ? item.titleZh : item.titleEn) strArr.push(this.isChinese ? item.titleZh : item.titleEn)
} }
}) })
return strArr.length > 0 ? strArr.join(',') : null return strArr.length > 0 ? strArr.join(",") : null
} else { } else {
return null return null
} }
}, },
getPromoterName(id) { getPromoterName(id) {
if (id) { if (id) {
let strName = '' let strName = ""
for(const item of this.customerSelectFn) { for (const item of this.customerSelectFn) {
if (item.id == id) { if (item.id == id) {
strName = item.name strName = item.name
break break
...@@ -2177,6 +1484,6 @@ export default { ...@@ -2177,6 +1484,6 @@ export default {
return null return null
} }
} }
}, }
}; }
</script> </script>
...@@ -101,7 +101,8 @@ ...@@ -101,7 +101,8 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('客户类别')" align="center" prop="sourse"> <el-table-column :label="$t('客户类别')" align="center" prop="sourse">
<template v-slot="{row}"> <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> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('创建时间')" align="center" prop="createTime" width="180"> <el-table-column :label="$t('创建时间')" align="center" prop="createTime" width="180">
...@@ -130,16 +131,18 @@ ...@@ -130,16 +131,18 @@
<script> <script>
import {updateCustomer, getCustomer, import {updateCustomer, getCustomer,
getCustomerPage, exportCustomerExcel } from "@/api/ecw/indirectCustomer"; 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 {listServiceUser} from "@/api/system/user";
import {exportCustomerComplaintExcel} from "@/api/ecw/customerComplaint"; import {exportCustomerComplaintExcel} from "@/api/ecw/customerComplaint";
import {indirectCustomerExportExcel} from "@/api/ecw/customer"; import {indirectCustomerExportExcel} from "@/api/ecw/customer";
import AreaCodeSelector from "@/components/AreaCodeSelector/index.vue"; import AreaCodeSelector from "@/components/AreaCodeSelector/index.vue";
import Template from "@/views/cms/template/index.vue";
export default { export default {
name: "EcwCustomerIndirectcustomer", name: "EcwCustomerIndirectcustomer",
components: { components: {
Template,
AreaCodeSelector AreaCodeSelector
}, },
activated() { activated() {
...@@ -149,6 +152,7 @@ export default { ...@@ -149,6 +152,7 @@ export default {
return { return {
exportLoading:false, exportLoading:false,
getDictDatas, getDictDatas,
getDictDatas2,
DICT_TYPE, DICT_TYPE,
// 遮罩层 // 遮罩层
loading: true, loading: true,
......
<template> <template>
<div> <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"> <el-col :xs="24" :sm="24" :md="24" :lg="20" :xl="16">
<div style="display: flex;justify-content: space-between;align-items: flex-end;"> <div style="display: flex; justify-content: space-between; align-items: flex-end">
<h2>{{$t('查看')}}</h2> <h2>{{ $t("查看") }}</h2>
<div> <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 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-quoted-price']" @click="quote" type="primary" size="small">
<el-button v-has-permi="['ecw:customer:query-follow-up']" type="primary" size="small" @click="customerFollowFn('follow')">{{$t('跟进')}}</el-button> {{ $t("报价") }}
<el-button v-has-permi="['ecw:customer:query-customer-complaint']" type="primary" size="small" @click="customerFollowFn('complain')">{{$t('客诉')}}</el-button> </el-button>
<el-button v-has-permi="['ecw:customer:query-delete']" type="danger" size="small" @click="deleteCustomerFn()">{{$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>
</div> </div>
<el-card style="margin-top: 15px;"> <el-card style="margin-top: 15px">
<el-descriptions :title="$t('基本')" :column="3" border> <el-descriptions :title="$t('基本')" :column="3" border>
<template slot="extra"> <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> </template>
<el-descriptions-item :label="$t('客户编号')">{{ customer.number }}</el-descriptions-item> <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('客户名称')"
<el-descriptions-item :label="$t('国籍')">{{$l(customer,'countryName')}}</el-descriptions-item> ><span style="white-space: pre-wrap">{{ customer.name }}</span></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('国籍')">{{ $l(customer, "countryName") }}</el-descriptions-item>
<el-descriptions-item :label="$t('客户经理')">{{customer.customerServiceName }}</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.inquiry }}</el-descriptions-item>
<el-descriptions-item :label="$t('备注')">{{ customer.remarks }}</el-descriptions-item> <el-descriptions-item :label="$t('备注')">{{ customer.remarks }}</el-descriptions-item>
<el-descriptions-item :label="$t('图片')"> <el-descriptions-item :label="$t('图片')">
<image-display :picture-urls="customer.picture ? customer.picture.split(',') : []" > <image-display :picture-urls="customer.picture ? customer.picture.split(',') : []">
<el-button type="text" > 查看图片</el-button> <el-button type="text"> 查看图片</el-button>
</image-display> </image-display>
</el-descriptions-item> </el-descriptions-item>
<template v-if="showMore"> <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('推介人')">{{ customer.promoterName }}</el-descriptions-item>
<el-descriptions-item :label="$t('客户生日')">{{ parseTime(customer.birthday, '{y}-{m}-{d}') }}</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('业绩类型')">{{ customer.isNew ? $t("新客户") : $t("老客户") }} </el-descriptions-item>
<el-descriptions-item :label="$t('资源类型')"> <el-descriptions-item :label="$t('资源类型')">
<dict-tag :type="DICT_TYPE.ECW_CUSTOMER_RESOURCE_TYPE" :value="customer.resourceType"></dict-tag> <dict-tag :type="DICT_TYPE.ECW_CUSTOMER_RESOURCE_TYPE" :value="customer.resourceType"></dict-tag>
</el-descriptions-item> </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.address }}</el-descriptions-item>
<el-descriptions-item :label="$t('首次成交时间')">{{ customer.firstDealTime }}</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('掉入公海时间')">
<el-descriptions-item :label="$t('获取方式')">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_GET_METHOD, customer.getMethod) }}</el-descriptions-item> {{ customer.estimateEnterOpenSeaTime || customer.enterOpenSeaTime }}
<el-descriptions-item :label="$t('创建入口')">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_FROM, customer.createFrom) }}</el-descriptions-item> </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.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('创建人')">{{ customer.founderName }}</el-descriptions-item>
<el-descriptions-item :label="$t('创建时间')">{{ parseTime(customer.createTime) }}</el-descriptions-item> <el-descriptions-item :label="$t('创建时间')">{{ parseTime(customer.createTime) }}</el-descriptions-item>
<el-descriptions-item :label="$t('最后更新人')">{{ customer.updaterName }}</el-descriptions-item> <el-descriptions-item :label="$t('最后更新人')">{{ customer.updaterName }}</el-descriptions-item>
...@@ -58,62 +76,18 @@ ...@@ -58,62 +76,18 @@
<el-tabs v-model="activeName" style="margin-top: 15px" type="border-card"> <el-tabs v-model="activeName" style="margin-top: 15px" type="border-card">
<el-tab-pane name="contact" :label="$t('联系人')"> <el-tab-pane name="contact" :label="$t('联系人')">
<el-table <el-table :data="customerContacts" style="width: 100%" border>
:data="customerContacts" <el-table-column prop="department" :label="$t('部门')"> </el-table-column>
style="width: 100%" <el-table-column prop="position" :label="$t('职位')"> </el-table-column>
border <el-table-column prop="name" :label="$t('联系人')"> </el-table-column>
> <el-table-column prop="nameEn" :label="$t('联系人英文名称')"> </el-table-column>
<el-table-column <el-table-column prop="phoneNew" :label="$t('联系方式')">
prop="department" <template v-slot="{ row }"> +{{ row.areaCode }} {{ row.phoneNew }} </template>
: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-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-table>
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="order" :label="$t('订单')"> <el-tab-pane name="order" :label="$t('订单')">
...@@ -124,117 +98,71 @@ ...@@ -124,117 +98,71 @@
<dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model="queryParams.transportId" formatter="number" /> <dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model="queryParams.transportId" formatter="number" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('订单状态:')"> <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>
<el-form-item :label="$t('报关方式:')"> <el-form-item :label="$t('报关方式:')">
<dict-selector <dict-selector :type="DICT_TYPE.ECW_CUSTOMS_TYPE" v-model="queryParams.customsTypes" multiple />
:type="DICT_TYPE.ECW_CUSTOMS_TYPE"
v-model="queryParams.customsTypes"
multiple
/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('控货')"> <el-form-item :label="$t('控货')">
<dict-selector <dict-selector :type="DICT_TYPE.INFRA_BOOLEAN_STRING" v-model="queryParams.isCargoControl" />
:type="DICT_TYPE.INFRA_BOOLEAN_STRING"
v-model="queryParams.isCargoControl"
/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('入仓时间:')"> <el-form-item :label="$t('入仓时间:')">
<el-date-picker v-model="rucangtime" <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('结束日期')" />
@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>
<el-form-item :label="$t('目的国')" prop="destCountryId"> <el-form-item :label="$t('目的国')" prop="destCountryId">
<el-select <el-select v-model="destCountryId" multiple :placeholder="$t('请选择目的国')" clearable @change="handleQuery">
v-model="destCountryId" <el-option v-for="item in AddressProvince" :key="item.guojia" :label="item.guojiaName" :value="item.guojia"></el-option>
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-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('目的城市')" prop="objectiveId"> <el-form-item :label="$t('目的城市')" prop="objectiveId">
<el-select <el-select v-model="objectiveId" multiple :placeholder="$t('请选择目的城市')" style="width: 200px" clearable @change="handleQuery">
v-model="objectiveId" <el-option v-for="item in AddressCity" :key="item.shi" :label="item.shiName" :value="item.shi"></el-option>
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-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('目的仓')" prop="destWarehouseId"> <el-form-item :label="$t('目的仓')" prop="destWarehouseId">
<el-select <el-select v-model="destWarehouseId" multiple :placeholder="$t('请选择目的仓')" style="width: 200px" clearable @change="handleQuery">
v-model="destWarehouseId" <el-option v-for="item in AddressTown" :key="item.id" :label="item.titleZh" :value="item.id"></el-option>
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-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="getorderList">{{$t('搜索')}}</el-button> <el-button type="primary" @click="getorderList">{{ $t("搜索") }}</el-button>
<el-button type="primary" @click="handleOrderReset">{{$t('重置')}}</el-button> <el-button type="primary" @click="handleOrderReset">{{ $t("重置") }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<el-descriptions :column="2"> <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.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.lastBusinessDate }} </el-descriptions-item>
<el-descriptions-item :label="$t('全部订单/控货订单')">{{orderStatisticsObj.allOrderTotal || 0}}/{{orderStatisticsObj.controlOrderTotal || 0}}</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.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.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.stock || 0 }}</el-descriptions-item>
<el-descriptions-item :label="$t('已出货订单')">{{orderStatisticsObj.shipmentTotal || 0}}</el-descriptions-item> <el-descriptions-item :label="$t('已出货订单')">{{ orderStatisticsObj.shipmentTotal || 0 }} </el-descriptions-item>
</el-descriptions> </el-descriptions>
<el-table :data="orderList"> <el-table :data="orderList">
<el-table-column :label="$t('订单编号')" width="120px" align="center"> <el-table-column :label="$t('订单编号')" width="120px" align="center">
<template slot-scope="{row}"> <template slot-scope="{ row }">
<el-link type="primary" @click.native="$router.push('/order/detail?orderId=' + row.orderId)">{{row.orderNo}}</el-link> <el-link type="primary" @click.native="$router.push('/order/detail?orderId=' + row.orderId)">
{{ row.orderNo }}
</el-link>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('报价单号')" align="center" width="120px"> <el-table-column :label="$t('报价单号')" align="center" width="120px">
<template slot-scope="{row}"> <template slot-scope="{ row }">
<el-link type="primary" @click.native="$router.push('/offer/detail?offerId=' + row.offerId)">{{row.offerNo}}</el-link> <el-link type="primary" @click.native="$router.push('/offer/detail?offerId=' + row.offerId)">
{{ row.offerNo }}
</el-link>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('唛头')" align="center" prop="marks" /> <el-table-column :label="$t('唛头')" align="center" prop="marks" />
<el-table-column :label="$t('总箱数/入仓箱数')" align="center" prop="sumNum"> <el-table-column :label="$t('总箱数/入仓箱数')" align="center" prop="sumNum">
<template slot-scope="{row}"> <template slot-scope="{ row }"> {{ row.totalNum }}{{ $t("") }}/{{ row.sumNum }}{{ $t("") }} </template>
{{row.totalNum}}{{$t('')}}/{{row.sumNum}}{{$t('')}}
</template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('体积/重量')" align="center" prop="sumWeight"> <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-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-else>{{row.sumVolume}}m³ /{{row.sumWeight}}Kg</template>-->
<component <component
:is="row.orderType == 2 ? 'el-tooltip' : 'div'" :is="row.orderType == 2 ? 'el-tooltip' : 'div'"
class="item" class="item"
...@@ -242,51 +170,53 @@ ...@@ -242,51 +170,53 @@
color: row.orderType == 2 ? 'red' : null color: row.orderType == 2 ? 'red' : null
}" }"
effect="dark" effect="dark"
:content="(row.wvolume||0)+'m³'" :content="(row.wvolume || 0) + 'm³'"
placement="bottom"> 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> <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> </component>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('始发仓')" align="center" prop="startWarehouseName"> <el-table-column :label="$t('始发仓')" align="center" prop="startWarehouseName">
<template slot-scope="{row}"> <template slot-scope="{ row }">
{{row.startWarehouseName}} {{ row.startWarehouseName }}
<span style="color:red" v-if="row.isExternalWarehouse">({{$t('外部仓')}})</span> <span style="color: red" v-if="row.isExternalWarehouse">({{ $t("外部仓") }})</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('运输方式/目的地')" align="center" prop="transportId"> <el-table-column :label="$t('运输方式/目的地')" align="center" prop="transportId">
<template slot-scope="{row}"> <template slot-scope="{ row }">
<dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="row.transportId" /> / {{row.objectiveName}} <dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="row.transportId" />
/ {{ row.objectiveName }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('控货')" align="center" prop="transportId"> <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" /> <dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="row.isCargoControl" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('订单状态')" align="center" prop="statusMsg"> <el-table-column :label="$t('订单状态')" align="center" prop="statusMsg">
<!-- <template slot-scope="scope">--> <!-- <template slot-scope="scope">-->
<!-- <dict-tag :type="DICT_TYPE.ORDER_STATUS" :value="scope.row.status" />--> <!-- <dict-tag :type="DICT_TYPE.ORDER_STATUS" :value="scope.row.status" />-->
<!-- </template>--> <!-- </template>-->
</el-table-column> </el-table-column>
<el-table-column :label="$t('创建时间')" align="center" prop="createTime" /> <el-table-column :label="$t('创建时间')" align="center" prop="createTime" />
<el-table-column :label="$t('入仓时间')"> <el-table-column :label="$t('入仓时间')">
<template v-slot="{row}"> <template v-slot="{ row }">
{{parseTime(row.rucangTime)}} {{ parseTime(row.rucangTime) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('装柜/出仓时间')" align="center" prop="loadTime" /> <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" prop="unloadTime" />
<el-table-column :label="$t('提货率')" align="center"> <el-table-column :label="$t('提货率')" align="center">
<template v-slot="{row}"> <template v-slot="{ row }">
{{row.pickNum | deliveryRate(row.sumNum)}} {{ row.pickNum | deliveryRate(row.sumNum) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('客户经理')" align="center" prop="customerServiceName" /> <el-table-column :label="$t('客户经理')" align="center" prop="customerServiceName" />
<el-table-column :label="$t('业绩归属客户方')" align="center" prop="customerName" /> <el-table-column :label="$t('业绩归属客户方')" align="center" prop="customerName" />
</el-table> </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-card>
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="quote" :label="$t('报价')"> <el-tab-pane name="quote" :label="$t('报价')">
...@@ -294,83 +224,36 @@ ...@@ -294,83 +224,36 @@
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<el-form :inline="true" size="small"> <el-form :inline="true" size="small">
<el-form-item :label="$t('目的国')" prop="destCountryId"> <el-form-item :label="$t('目的国')" prop="destCountryId">
<el-select <el-select v-model="destCountryId" multiple :placeholder="$t('请选择目的国')" clearable @change="handleQuery">
v-model="destCountryId" <el-option v-for="item in AddressProvince" :key="item.guojia" :label="item.guojiaName" :value="item.guojia"></el-option>
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-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('目的城市')" prop="objectiveId"> <el-form-item :label="$t('目的城市')" prop="objectiveId">
<el-select <el-select v-model="objectiveId" multiple :placeholder="$t('请选择目的城市')" style="width: 200px" clearable @change="handleQuery">
v-model="objectiveId" <el-option v-for="item in AddressCity" :key="item.shi" :label="item.shiName" :value="item.shi"></el-option>
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-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('目的仓')" prop="destWarehouseId"> <el-form-item :label="$t('目的仓')" prop="destWarehouseId">
<el-select <el-select v-model="destWarehouseId" multiple :placeholder="$t('请选择目的仓')" style="width: 200px" clearable @change="handleQuery">
v-model="destWarehouseId" <el-option v-for="item in AddressTown" :key="item.id" :label="item.titleZh" :value="item.id"></el-option>
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-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="getInfoListOfferPage">{{$t('搜索')}}</el-button> <el-button type="primary" @click="getInfoListOfferPage">{{ $t("搜索") }}</el-button>
<el-button type="primary" @click="handleOfferReset">{{$t('重置')}}</el-button> <el-button type="primary" @click="handleOfferReset">{{ $t("重置") }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<el-table <el-table :data="infoListOfferList" style="width: 100%">
:data="infoListOfferList" <el-table-column type="index" :label="$t('序号')"> </el-table-column>
style="width: 100%" <el-table-column :label="$t('报价单号')" width="160px">
> <template slot-scope="{ row }">
<el-table-column <el-link type="primary" @click.native="$router.push('/offer/detail?offerId=' + row.offerId)">
type="index" {{ row.number }}
:label="$t('序号')" </el-link>
>
</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> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="orderNo" :label="$t('订单号')"> </el-table-column>
prop="orderNo"
:label="$t('订单号')"
>
</el-table-column>
<!-- <!--
<el-table-column <el-table-column
prop="consignorName" prop="consignorName"
...@@ -381,82 +264,42 @@ ...@@ -381,82 +264,42 @@
</template> </template>
</el-table-column> </el-table-column>
--> -->
<el-table-column <el-table-column prop="relationName" :label="$t('联系人')"> </el-table-column>
prop="relationName" <el-table-column :label="$t('联系方式')">
:label="$t('联系人')" <template v-slot="{ row }"> +{{ row.relationAreaCode }}{{ row.relationPhone }} </template>
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column :label="$t('始发仓')">
:label="$t('联系方式')" <template v-slot="{ row }">
> {{ getWarehouse(row.startWarehouseId) }}
<template v-slot="{row}">
+{{ row.relationAreaCode }}{{ row.relationPhone }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column :label="$t('运输方式/目的地')">
:label="$t('始发仓')" <template slot-scope="{ row }">
> <dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="row.transportType" />
<template v-slot="{row}"> / {{ row.objectiveName }}
{{getWarehouse(row.startWarehouseId)}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column :label="$t('销售阶段')">
:label="$t('运输方式/目的地')" <template v-slot="{ row }">
> {{ STATUS[row.status] }}
<template slot-scope="{row}">
<dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="row.transportType" /> / {{row.objectiveName}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column :label="$t('预计销售额')">
:label="$t('销售阶段')" <template slot-scope="{ row }" v-if="row.estCostVO">
>
<template v-slot="{row}">
{{STATUS[row.status]}}
</template>
</el-table-column>
<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"> <div class="" v-for="(item, feeIndex) in row.estCostVO.feeDtoList" :key="feeIndex">
<dict-tag :type="DICT_TYPE.ECW_COST_FEE_TYPE" :value="item.feeType" /> <dict-tag :type="DICT_TYPE.ECW_COST_FEE_TYPE" :value="item.feeType" />
{{item.amount}} {{currencyMap[item.currencyId]}} {{ item.amount }} {{ currencyMap[item.currencyId] }}
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="stopTime" :label="$t('预计结束时间')"> </el-table-column>
prop="stopTime" <el-table-column prop="businessManagerName" :label="$t('负责人')"> </el-table-column>
:label="$t('预计结束时间')" <el-table-column prop="importance" :label="$t('重要程度')"> </el-table-column>
> <el-table-column prop="importance" :label="$t('报价有效期')">
</el-table-column> <template v-slot="{ row }"> {{ row.startTime }} - {{ row.endTime }} </template>
<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>
<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"> <el-table-column :label="$t('操作')" align="center" fixed="right" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <!--
...@@ -472,20 +315,22 @@ ...@@ -472,20 +315,22 @@
<el-dropdown> <el-dropdown>
<el-button icon="el-icon-plus" circle type="primary"></el-button> <el-button icon="el-icon-plus" circle type="primary"></el-button>
<el-dropdown-menu slot="dropdown"> <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/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/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/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/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="$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="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="recovery(scope.row.offerId)" v-if="[0].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:recovery']">
<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> {{ $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-menu>
</el-dropdown> </el-dropdown>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </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-card>
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="follow" :label="$t('跟进')"> <el-tab-pane name="follow" :label="$t('跟进')">
...@@ -493,18 +338,22 @@ ...@@ -493,18 +338,22 @@
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<el-form size="small" :inline="true" label-width="100px"> <el-form size="small" :inline="true" label-width="100px">
<el-form-item :label="$t('跟进类型')"> <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>
<el-form-item :label="$t('跟进方式')"> <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>
<el-form-item :label="$t('跟进结果')"> <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-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-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('跟进状态')"> <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-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-select>
</el-form-item> </el-form-item>
...@@ -517,21 +366,28 @@ ...@@ -517,21 +366,28 @@
</el-form-item> </el-form-item>
--> -->
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="getCustomerFollowList">{{ <el-button type="primary" icon="el-icon-search" @click="getCustomerFollowList">{{ $t("搜索") }} </el-button>
$t("搜索") <el-button
}}</el-button> type="primary"
<el-button type="primary" @click="()=>{ @click="
followForm = { pageNo:1,pageSize:10}; getCustomerFollowList(); () => {
}">{{$t('重置')}}</el-button> followForm = { pageNo: 1, pageSize: 10 }
<el-button type="success" @click="customerFollowFn('follow')" v-hasPermi="['ecw:customer:follow-create']">{{$t('新增')}}</el-button> getCustomerFollowList()
<el-button type="warning" @click="handleExport" v-hasPermi="['ecw:customer:follow-export']">{{$t('导出')}}</el-button> }
"
>{{ $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-item>
</el-form> </el-form>
</div> </div>
<el-table :data="customerFollowList" style="width: 100%"> <el-table :data="customerFollowList" style="width: 100%">
<el-table-column prop="number" :label="$t('编号')" width="120"> <el-table-column prop="number" :label="$t('编号')" width="120">
<template slot-scope="scope"> <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> </template>
</el-table-column> </el-table-column>
<el-table-column prop="followType" :label="$t('跟进类型')" :formatter="(row, column, cellValue) => getDictDataLabel(DICT_TYPE.CUSTOMER_FOLLOWUP_TYPE, cellValue)"></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 @@ ...@@ -571,8 +427,8 @@
</el-table-column> </el-table-column>
<el-table-column width="150px" :label="$t('操作')" align="center" fixed="right" class-name="small-padding fixed-width"> <el-table-column width="150px" :label="$t('操作')" align="center" fixed="right" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="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-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-collection" @click="handleCustomerFollow(scope.row, true)" v-has-permi="['ecw:customer:follow-add-plan']">{{ $t("增加计划") }} </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -588,95 +444,98 @@ ...@@ -588,95 +444,98 @@
<el-table-column :label="$t('账单')" prop="receiptNo"></el-table-column> <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="orderNo"></el-table-column>
<el-table-column :label="$t('箱数')" prop="num"></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="volume"></el-table-column>
<el-table-column :label="$t('重量')" prop="weight" ></el-table-column> <el-table-column :label="$t('重量')" prop="weight"></el-table-column>
<el-table-column :label="$t('类型')"> <el-table-column :label="$t('类型')">
<template v-slot="{row}"> <template v-slot="{ row }">
<dict-tag :type="DICT_TYPE.PAYMENT_TYPE" :value="row.collectionType" /> <dict-tag :type="DICT_TYPE.PAYMENT_TYPE" :value="row.collectionType" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('费用类型')"> <el-table-column :label="$t('费用类型')">
<template v-slot="{row}"> <template v-slot="{ row }">
<dict-tag :type="DICT_TYPE.FEE_TYPE" :value="row.feeType" /> <dict-tag :type="DICT_TYPE.FEE_TYPE" :value="row.feeType" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('金额')" prop="totalAmount"> <el-table-column :label="$t('金额')" prop="totalAmount"> </el-table-column>
</el-table-column>
<el-table-column :label="$t('已核销比例')" prop="writeOffScale"></el-table-column> <el-table-column :label="$t('已核销比例')" prop="writeOffScale"></el-table-column>
<el-table-column :label="$t('实收日期')"> <el-table-column :label="$t('实收日期')">
<template v-slot="{row}"> <template v-slot="{ row }">
{{parseTime(row.writeOffAt)}} {{ parseTime(row.writeOffAt) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('业务员')" prop="salesmanName"></el-table-column> <el-table-column :label="$t('业务员')" prop="salesmanName"></el-table-column>
</el-table> </el-table>
<pagination v-show="infoListReceiptList.length" :total="infoListReceiptTotal" :page.sync="infoListReceiptFrom.pageNo" :limit.sync="infoListReceiptFrom.pageSize" <pagination v-show="infoListReceiptList.length" :total="infoListReceiptTotal" :page.sync="infoListReceiptFrom.pageNo" :limit.sync="infoListReceiptFrom.pageSize" @pagination="infoListReceiptFn" />
@pagination="infoListReceiptFn"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="empower" :label="$t('品牌授权')"> <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 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 prop="titleEn" :label="$t('英文标题')"></el-table-column>
<el-table-column :label="$t('有无备案')"> <el-table-column :label="$t('有无备案')">
<template v-slot="{row}"> <template v-slot="{ row }">
<dict-tag :type="DICT_TYPE.BRAND_REG_TYPE" :value="row.filing" /> <dict-tag :type="DICT_TYPE.BRAND_REG_TYPE" :value="row.filing" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('授权开始')"> <el-table-column :label="$t('授权开始')">
<template v-slot="{row}"> <template v-slot="{ row }">
{{parseTime(row.startTime)}} {{ parseTime(row.startTime) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('授权结束')"> <el-table-column :label="$t('授权结束')">
<template v-slot="{row}"> <template v-slot="{ row }">
{{parseTime(row.endTime)}} {{ parseTime(row.endTime) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('授权证明')"> <el-table-column :label="$t('授权证明')">
<template v-slot="{row}"> <template v-slot="{ row }">
<div v-if="!!row.fileUrl && row.fileUrl.length > 0"> <div v-if="!!row.fileUrl && row.fileUrl.length > 0">
<span v-for="(item, index) in (row.fileUrl||'').split(',')"> <span v-for="(item, index) in (row.fileUrl || '').split(',')">
<a :href="item" target="_blank">{{$t('附件')}}{{ index + 1 }}</a>, <a :href="item" target="_blank">{{ $t("附件") }}{{ index + 1 }}</a
>,
</span> </span>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="feeScale" :formatter="(row) => getDictDataLabel(DICT_TYPE.BRAND_CUSTOMER_CHARGING_MODEL, row.feeScale)" :label="$t('收费标准')"> </el-table-column>
prop="feeScale" <el-table-column prop="createUsername" :label="$t('添加人')"> </el-table-column>
: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('创建时间')"> <el-table-column :label="$t('创建时间')">
<template v-slot="{row}"> <template v-slot="{ row }">
{{parseTime(row.createTime)}} {{ parseTime(row.createTime) }}
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination v-show="brandAuthorizationTotal.length" :total="brandAuthorizationTotal" :page.sync="brandAuthorizationFrom.pageNo" :limit.sync="brandAuthorizationFrom.pageSize" <pagination v-show="brandAuthorizationTotal.length" :total="brandAuthorizationTotal" :page.sync="brandAuthorizationFrom.pageNo" :limit.sync="brandAuthorizationFrom.pageSize" @pagination="getBrankByCustomerList" />
@pagination="getBrankByCustomerList"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="deliver" :label="$t('发货评估')"> <el-tab-pane name="deliver" :label="$t('发货评估')">
<el-descriptions :column="2"> <el-descriptions :column="2">
<el-descriptions-item :label="$t('客户类别')"> <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>
<el-descriptions-item :label="$t('角色')"> <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>
<el-descriptions-item :label="$t('出货渠道')"> <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>--> <!-- <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>
<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('业务国家')"> <el-descriptions-item :label="$t('业务国家')">
{{ isChinese ? customer.busiCountryNameZh : customer.busiCountryNameEn}} {{ isChinese ? customer.busiCountryNameZh : customer.busiCountryNameEn }}
</el-descriptions-item> </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.weightYearly }}</el-descriptions-item>
<el-descriptions-item :label="$t('主要竞争对手')">{{ customer.competitorNames }}</el-descriptions-item> <el-descriptions-item :label="$t('主要竞争对手')">{{ customer.competitorNames }}</el-descriptions-item>
<el-descriptions-item :label="$t('年度发货次数')">{{ customer.numYearly }}</el-descriptions-item> <el-descriptions-item :label="$t('年度发货次数')">{{ customer.numYearly }}</el-descriptions-item>
...@@ -684,18 +543,24 @@ ...@@ -684,18 +543,24 @@
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="financial" :label="$t('财务资料')"> <el-tab-pane name="financial" :label="$t('财务资料')">
<el-card class="box-card"> <el-card class="box-card">
<div slot="header">{{$t('公司信息')}}</div> <div slot="header">{{ $t("公司信息") }}</div>
<el-descriptions :column="2"> <el-descriptions :column="2">
<el-descriptions-item :label="$t('公司名称')">{{ customer.company }}</el-descriptions-item> <el-descriptions-item :label="$t('公司名称')">{{ customer.company }}</el-descriptions-item>
<el-descriptions-item :label="$t('公司英文名称')">{{ customer.companyEn }}</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('身份证号码')">
<el-descriptions-item v-if="permissions.includes('ecw:customer:query-card')" :label="$t('身份证姓名')">{{ customer.carName }}</el-descriptions-item> {{ customer.carNo }}
<el-descriptions-item :label="$t('结算方式')">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_BALANCE, customer.balance) }}</el-descriptions-item> </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-item :label="$t('付款人姓名')">{{ customer.payerName }}</el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-card> </el-card>
<el-card class="box-card" style="margin-top: 15px;"> <el-card class="box-card" style="margin-top: 15px">
<div slot="header">{{$t('开票信息')}}</div> <div slot="header">{{ $t("开票信息") }}</div>
<el-descriptions :column="2"> <el-descriptions :column="2">
<el-descriptions-item :label="$t('发票抬头')">{{ customer.invoiceTitle }}</el-descriptions-item> <el-descriptions-item :label="$t('发票抬头')">{{ customer.invoiceTitle }}</el-descriptions-item>
<el-descriptions-item :label="$t('纳税人识别号')">{{ customer.licenseNumber }}</el-descriptions-item> <el-descriptions-item :label="$t('纳税人识别号')">{{ customer.licenseNumber }}</el-descriptions-item>
...@@ -707,27 +572,32 @@ ...@@ -707,27 +572,32 @@
<el-descriptions-item :label="$t('税率')">{{ customer.taxRate }}</el-descriptions-item> <el-descriptions-item :label="$t('税率')">{{ customer.taxRate }}</el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-card> </el-card>
<el-card style="margin-top: 15px;"> <el-card style="margin-top: 15px">
<div slot="header">{{$t('银行账户')}}</div> <div slot="header">{{ $t("银行账户") }}</div>
<el-table :data="customer.customerBankBackVOList" border> <el-table :data="customer.customerBankBackVOList" border>
<el-table-column :label="$t('编号')" type="index"></el-table-column> <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('账户名称')" prop="accountName"></el-table-column>
<el-table-column :label="$t('币别')"> <el-table-column :label="$t('币别')">
<template v-slot="{row}"> <template v-slot="{ row }">
{{$l(currecyList.find(i => row.currency == i.id),'title')}} {{
$l(
currecyList.find((i) => row.currency == i.id),
"title"
)
}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('银行名称')" prop="bankName"></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="bankAccount"></el-table-column>
<el-table-column :label="$t('银行代码')" prop="bankCode"></el-table-column> <el-table-column :label="$t('银行代码')" prop="bankCode"></el-table-column>
<el-table-column :label="$t('账户类型')"> <el-table-column :label="$t('账户类型')">
<template v-slot="{row}"> <template v-slot="{ row }">
{{Number(row.accountType) === 1 ? $t('公账') : $t('私账')}} {{ Number(row.accountType) === 1 ? $t("公账") : $t("私账") }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('状态')"> <el-table-column :label="$t('状态')">
<template v-slot="{row}"> <template v-slot="{ row }">
{{row.status ? $t('正常') : $t('停用')}} {{ row.status ? $t("正常") : $t("停用") }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('银行地址')" prop="bankAddress"></el-table-column> <el-table-column :label="$t('银行地址')" prop="bankAddress"></el-table-column>
...@@ -743,8 +613,10 @@ ...@@ -743,8 +613,10 @@
<el-descriptions-item :label="$t('到仓确认')"> <el-descriptions-item :label="$t('到仓确认')">
<el-switch v-model="customer.arrivalConfirm" :active-value="1" :inactive-value="0" disabled /> <el-switch v-model="customer.arrivalConfirm" :active-value="1" :inactive-value="0" disabled />
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :label="$t('重货标准')">{{ customer.weightUnit ? `${customer.weightUnit}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('泡货标准')">
{{ customer.lightUnit ? `${customer.lightUnit}kg/cbm` : "" }}
</el-descriptions-item>
<el-descriptions-item :label="$t('控货无收货人')"> <el-descriptions-item :label="$t('控货无收货人')">
<el-switch v-model="customer.noConsignee" disabled /> <el-switch v-model="customer.noConsignee" disabled />
</el-descriptions-item> </el-descriptions-item>
...@@ -759,20 +631,20 @@ ...@@ -759,20 +631,20 @@
<el-tab-pane name="credit" :label="$t('信用日志')"> <el-tab-pane name="credit" :label="$t('信用日志')">
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix"> <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 :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> </el-descriptions>
</div> </div>
<el-table :data="customerCreditLogList"> <el-table :data="customerCreditLogList">
<el-table-column :label="$t('序号')" type="index"></el-table-column> <el-table-column :label="$t('序号')" type="index"></el-table-column>
<el-table-column :label="$t('规则名称')"> <el-table-column :label="$t('规则名称')">
<template v-slot="{row}"> <template v-slot="{ row }">
{{ isChinese ? row.name : row.nameEn}} {{ isChinese ? row.name : row.nameEn }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="type" :label="$t('规则分类')"> <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" /> <dict-tag :type="DICT_TYPE.CUSTOMER_CREDIT_RULE_TYPE" :value="row.type" />
</template> </template>
</el-table-column> </el-table-column>
...@@ -780,12 +652,12 @@ ...@@ -780,12 +652,12 @@
<el-table-column prop="remark" :label="$t('备注')"></el-table-column> <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('添加人')" prop="createName"></el-table-column>
<el-table-column :label="$t('时间')"> <el-table-column :label="$t('时间')">
<template v-slot="{row}"> <template v-slot="{ row }">
{{parseTime(row.createTime)}} {{ parseTime(row.createTime) }}
</template> </template>
</el-table-column> </el-table-column>
</el-table> </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-card>
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="grade" :label="$t('等级日志')"> <el-tab-pane name="grade" :label="$t('等级日志')">
...@@ -793,49 +665,43 @@ ...@@ -793,49 +665,43 @@
<el-table-column :label="$t('序号')" type="index"></el-table-column> <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="name"></el-table-column>
<el-table-column :label="$t('规则分类')" prop="type"> <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" /> <dict-tag :type="DICT_TYPE.CUSTOMER_LEVEL_RULE_TYPE" :value="row.type" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('规则得分')" prop="score"></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('备注')" prop="remark"></el-table-column>
<el-table-column :label="$t('时间')"> <el-table-column :label="$t('时间')">
<template v-slot="{row}"> <template v-slot="{ row }">
{{parseTime(row.createTime)}} {{ parseTime(row.createTime) }}
</template> </template>
</el-table-column> </el-table-column>
</el-table> </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>
<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> <customer-log :customerId="id" v-if="'operationLog' === activeName"></customer-log>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</el-col> </el-col>
</el-row> </el-row>
<el-dialog <el-dialog :visible.sync="dialogVisible" width="30%">
:visible.sync="dialogVisible" <h1 slot="title">{{ $t("给客户") }}{{ customer.name }}{{ $t("添加信用日志") }}</h1>
width="30%"
>
<h1 slot="title">
{{$t('给客户')}}{{customer.name}}{{$t('添加信用日志')}}
</h1>
<el-form label-width="100"> <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-form-item :label="$t('信用类别')">
<el-select v-model="creditFrom.ruleId"> <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-select>
</el-form-item> </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-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-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="submit">{{$t('提交')}}</el-button> <el-button @click="submit">{{ $t("提交") }}</el-button>
<el-button @click="dialogVisible = false" >{{$t('取消')}}</el-button> <el-button @click="dialogVisible = false">{{ $t("取消") }}</el-button>
</div> </div>
</el-dialog> </el-dialog>
...@@ -844,44 +710,31 @@ ...@@ -844,44 +710,31 @@
</template> </template>
<script> <script>
import { import { getCustomer, getCustomerSelect, getBrankByCustomer, levelLogPage, customerCreditLogPage, infoListOrderPage, orderStatistics, creditLogCreate, creditScoreStatistic, infoListReceiptPage, memberUserList, deleteCustomer } from "@/api/ecw/customer"
getCustomer, import { getOfferPage as infoListOfferPage } from "@/api/ecw/offer"
getCustomerSelect, import { DICT_TYPE, getDictDataLabel, getDictDatas2 } from "@/utils/dict"
getBrankByCustomer, import { getProductTypeList } from "@/api/ecw/productType"
levelLogPage, import { getNodeList } from "@/api/ecw/node"
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 CustomerFollow from "./components/customerFollow"
import { parseTime } from '@/utils/ruoyi' import { parseTime } from "@/utils/ruoyi"
import CustomerComplaint from '@/views/ecw/customerComplaint' import CustomerComplaint from "@/views/ecw/customerComplaint"
import { listServiceUser } from '@/api/system/user' import { listServiceUser, getUserProfile } from "@/api/system/user"
import { getCustomerContactsListByCustomer } from '@/api/ecw/customerContacts' import { getCustomerContactsListByCustomer } from "@/api/ecw/customerContacts"
import {getOrderPage, getRegionList} from "@/api/ecw/order"; import { getOrderPage, getRegionList } from "@/api/ecw/order"
import Template from "@/views/cms/template"; import Template from "@/views/cms/template"
import {getCreditRulePage} from "@/api/customer/creditRule"; import { getCreditRulePage } from "@/api/customer/creditRule"
import {getCountry} from "@/api/ecw/country" import { getCountry } from "@/api/ecw/country"
import {getCurrencyList} from "@/api/ecw/currency"; import { getCurrencyList } from "@/api/ecw/currency"
import customerLog from "@/views/ecw/customer/customerLog.vue"; import customerLog from "@/views/ecw/customer/customerLog.vue"
import {checkPermi} from "@/utils/permission"; import { checkPermi } from "@/utils/permission"
import ImageDisplay from "@/views/ecw/order/components/imageDisplay.vue"; import ImageDisplay from "@/views/ecw/order/components/imageDisplay.vue"
import { getListTree } from "@/api/ecw/region"; import { getListTree } from "@/api/ecw/region"
import { getWarehouseList } from "@/api/ecw/warehouse"; import { getWarehouseList } from "@/api/ecw/warehouse"
import { deleteOffer, cancel, recovery } from "@/api/ecw/offer"; import { deleteOffer, cancel, recovery } from "@/api/ecw/offer"
import { import { getCustomerFollowList, exportCustomerFollow } from "@/api/ecw/customerFollow"
getCustomerFollowList,
exportCustomerFollow
} from "@/api/ecw/customerFollow"
export default { export default {
name: 'query', name: "query",
components: { components: {
ImageDisplay, ImageDisplay,
Template, Template,
...@@ -891,30 +744,39 @@ export default { ...@@ -891,30 +744,39 @@ export default {
}, },
created() { created() {
// 获取币种 // 获取币种
getCurrencyList().then(response => { getCurrencyList().then((response) => {
this.currecyList = response.data; 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 this.creditTypeList = r.data.list
}) })
// getNodeList().then(r => { // getNodeList().then(r => {
// this.nodeList = r.data // this.nodeList = r.data
// }) // })
getCustomer(this.id).then(response => { getCustomer(this.id).then((response) => {
this.customer = { ...this.customer, ...response.data } 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 this.customerContacts = r.data
let list = this.customerContacts.filter(r => r.userid) if (this.customerContacts.length > 0) {
if(list.length > 0){ const contacts = this.customerContacts.findIndex((contacts) => contacts.isDefault === 1)
memberUserList({ids:list.map(i=>i.userid).join(',')}).then(r => { 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 this.memberList = r.data
}) })
} }
}
}) })
}) })
// getCustomerSelect({pageSize:1000,pageNo:1}).then(r => { // getCustomerSelect({pageSize:1000,pageNo:1}).then(r => {
...@@ -924,49 +786,49 @@ export default { ...@@ -924,49 +786,49 @@ export default {
// this.getBrankByCustomerList()//品牌授权 // this.getBrankByCustomerList()//品牌授权
// this.getCustomerGrade() // this.getCustomerGrade()
// this.creditLogPage()//等级日志 // this.creditLogPage()//等级日志
this.getorderList()//订单 this.getorderList() //订单
// this.getInfoListOfferPage()//报价 // this.getInfoListOfferPage()//报价
this.getOrderStatistics()//数据 this.getOrderStatistics() //数据
// this.creditScoreStatisticFn() //信用日志 // this.creditScoreStatisticFn() //信用日志
// this.infoListReceiptFn()//账单 // this.infoListReceiptFn()//账单
this.getData(); this.getData()
this.getWarehouseList() this.getWarehouseList()
this.getUserProfile()
}, },
watch:{ watch: {
activeName(val){ activeName(val) {
switch (val) { switch (val) {
case 'order': case "order":
this.destCountryId = '' this.destCountryId = ""
this.destWarehouseId = '' this.destWarehouseId = ""
this.objectiveId = '' this.objectiveId = ""
this.getorderList()//订单 this.getorderList() //订单
break break
case 'quote': case "quote":
this.destCountryId = '' this.destCountryId = ""
this.destWarehouseId = '' this.destWarehouseId = ""
this.objectiveId = '' this.objectiveId = ""
this.getInfoListOfferPage()//报价 this.getInfoListOfferPage() //报价
break break
case 'follow': case "follow":
this.getCustomerFollowList() this.getCustomerFollowList()
case 'bill': case "bill":
this.infoListReceiptFn()//账单 this.infoListReceiptFn() //账单
break break
case 'data': case "data":
this.getOrderStatistics()//数据 this.getOrderStatistics() //数据
break break
case 'empower': case "empower":
this.getBrankByCustomerList()//品牌授权 this.getBrankByCustomerList() //品牌授权
break break
case 'credit': case "credit":
this.creditScoreStatisticFn() //信用日志 this.creditScoreStatisticFn() //信用日志
this.creditLogPage() this.creditLogPage()
break break
case 'grade': case "grade":
this.getCustomerGrade() this.getCustomerGrade()
//等级日志 //等级日志
break break
} }
}, },
destCountryId: { destCountryId: {
...@@ -974,88 +836,63 @@ export default { ...@@ -974,88 +836,63 @@ export default {
deep: true, //深度监听 deep: true, //深度监听
handler() { handler() {
//每当值省份值改变时其下地区值进行清空 //每当值省份值改变时其下地区值进行清空
this.AddressCity = []; this.AddressCity = []
this.AddressTown = []; this.AddressTown = []
this.objectiveId = ""; this.objectiveId = ""
this.destWarehouseId = ""; this.destWarehouseId = ""
if (this.destCountryId == "") { if (this.destCountryId == "") {
this.getAddressCity() this.getAddressCity()
this.getAddressTown() this.getAddressTown()
} else if ( } else if (this.destCountryId != "" && this.objectiveId == "" && this.destWarehouseId == "") {
this.destCountryId != "" &&
this.objectiveId == "" &&
this.destWarehouseId == ""
) {
this.findByprovinceCode() this.findByprovinceCode()
this.getAddressTown() this.getAddressTown()
} }
}, }
}, },
objectiveId: { objectiveId: {
deep: true, //深度监听 deep: true, //深度监听
handler() { handler() {
this.AddressTown = []; this.AddressTown = []
this.destWarehouseId = ""; this.destWarehouseId = ""
this.findBycityCode() this.findBycityCode()
if ( if (this.objectiveId != "" && this.destCountryId != "" && this.destWarehouseId == "") {
this.objectiveId != "" &&
this.destCountryId != "" &&
this.destWarehouseId == ""
) {
//获取当前城市值id,获取该城市下区域 //获取当前城市值id,获取该城市下区域
} else if (this.destCountryId == "" && this.objectiveId == "" && this.destWarehouseId == "") {
} else if (
this.destCountryId == "" &&
this.objectiveId == "" &&
this.destWarehouseId == ""
) {
this.getAddressTown() this.getAddressTown()
} else if ( } else if (this.destCountryId != "" && this.objectiveId == "" && this.destWarehouseId == "") {
this.destCountryId != "" &&
this.objectiveId == "" &&
this.destWarehouseId == ""
) {
this.findByprovinceCode() this.findByprovinceCode()
this.getAddressTown() this.getAddressTown()
} }
}, }
}, },
destWarehouseId: { destWarehouseId: {
deep: true, //深度监听 deep: true, //深度监听
handler() { handler() {
if ( if (this.objectiveId != "" && this.destCountryId != "" && this.destWarehouseId == "") {
this.objectiveId != "" &&
this.destCountryId != "" &&
this.destWarehouseId == ""
) {
//获取当前城市值id,获取该城市下区域 //获取当前城市值id,获取该城市下区域
this.findBycityCode() this.findBycityCode()
} else if ( } else if (this.destCountryId != "" && this.objectiveId == "" && this.destWarehouseId == "") {
this.destCountryId != "" &&
this.objectiveId == "" &&
this.destWarehouseId == ""
) {
this.getAddressTown() this.getAddressTown()
} }
}, }
}, }
}, },
data() { data() {
return { return {
activeName:'order', activeName: "order",
currecyList:[], currecyList: [],
STATUS:{ STATUS: {
0:this.$t('取消报价'), 0: this.$t("取消报价"),
1:this.$t('特价审批中'), 1: this.$t("特价审批中"),
2:this.$t('需求确认'), 2: this.$t("需求确认"),
3:this.$t('跟进中'), 3: this.$t("跟进中"),
4:this.$t('赢单'), 4: this.$t("赢单"),
5:this.$t('输单'), 5: this.$t("输单"),
6:this.$t('报价完成'), 6: this.$t("报价完成"),
7:this.$t('跟进中') 7: this.$t("跟进中")
}, },
dialogVisible:false, dialogVisible: false,
DICT_TYPE, DICT_TYPE,
getDictDataLabel, getDictDataLabel,
getDictDatas2, getDictDatas2,
...@@ -1066,6 +903,7 @@ export default { ...@@ -1066,6 +903,7 @@ export default {
serviceUserList: [], serviceUserList: [],
customerContacts: [], customerContacts: [],
memberList: [], memberList: [],
relation: 1,
customer: { customer: {
id: undefined, id: undefined,
number: undefined, number: undefined,
...@@ -1103,48 +941,48 @@ export default { ...@@ -1103,48 +941,48 @@ export default {
weightUnit: undefined, weightUnit: undefined,
createTime: undefined createTime: undefined
}, },
brandAuthorizationFrom:{ brandAuthorizationFrom: {
pageNo:1, pageNo: 1,
pageSize:10, pageSize: 10
}, },
brandAuthorizationList:[], brandAuthorizationList: [],
brandAuthorizationTotal:0, brandAuthorizationTotal: 0,
getCustomerGradeFrom:{ getCustomerGradeFrom: {
pageNo:1, pageNo: 1,
pageSize:10, pageSize: 10,
total:0 total: 0
}, },
getCustomerGradeList:[], getCustomerGradeList: [],
customerCreditLogFrom:{ customerCreditLogFrom: {
pageNo:1, pageNo: 1,
pageSize:10, pageSize: 10,
total:0 total: 0
}, },
customerCreditLogList:[], customerCreditLogList: [],
rucangtime:[], rucangtime: [],
queryParams:{ queryParams: {
rows:10, rows: 10,
page:1 page: 1
}, },
orderList:[], orderList: [],
orderTotal:0, orderTotal: 0,
infoListOfferFrom:{ infoListOfferFrom: {
pageNo:1, pageNo: 1,
pageSize:10, pageSize: 10
}, },
infoListOfferTotal:0, infoListOfferTotal: 0,
infoListOfferList:[], infoListOfferList: [],
orderStatisticsObj:{}, orderStatisticsObj: {},
creditTypeList:[], creditTypeList: [],
creditFrom:{},//添加信用 日志 creditFrom: {}, //添加信用 日志
creditScoreStatisticObj:[], creditScoreStatisticObj: [],
infoListReceiptList:[], infoListReceiptList: [],
infoListReceiptFrom:{ infoListReceiptFrom: {
pageNo:1, pageNo: 1,
pageSize:10, pageSize: 10
}, },
infoListReceiptTotal:0, infoListReceiptTotal: 0,
country: '', country: "",
showMore: true, showMore: true,
AddressCity: [], AddressCity: [],
AddressProvince: [], AddressProvince: [],
...@@ -1162,21 +1000,22 @@ export default { ...@@ -1162,21 +1000,22 @@ export default {
customerFollowTotal: 0, customerFollowTotal: 0,
customerFollowList: [], customerFollowList: [],
currencyList: [], currencyList: [],
userId: undefined
} }
}, },
computed: { computed: {
permissions(){ permissions() {
return this.$store.state.user.permissions return this.$store.state.user.permissions
}, },
customerId(){ customerId() {
return this.$route.params.customerId; return this.$route.params.customerId
}, },
isChinese(){ isChinese() {
return this.$i18n.locale === 'zh_CN' return this.$i18n.locale === "zh_CN"
}, },
pickupPoint(){ pickupPoint() {
const pickupPoint = this.nodeList.find(p => p.id === parseInt(this.customer.pickupPoint)) const pickupPoint = this.nodeList.find((p) => p.id === parseInt(this.customer.pickupPoint))
return pickupPoint ? pickupPoint.titleZh : '' return pickupPoint ? pickupPoint.titleZh : ""
}, },
// promoter() { // promoter() {
// return this.customerSelect.find(e => e.id === this.customer.promoter)?.name || '' // return this.customerSelect.find(e => e.id === this.customer.promoter)?.name || ''
...@@ -1185,117 +1024,134 @@ export default { ...@@ -1185,117 +1024,134 @@ export default {
id() { id() {
return parseInt(this.$route.params.customerId) return parseInt(this.$route.params.customerId)
}, },
creditScoreCalculation(){ creditScoreCalculation() {
return (val)=>{ return (val) => {
if(val === 'all'){ if (val === "all") {
return this.$t('信用分') return this.$t("信用分")
}else{ } else {
if(this.isChinese) return (this.getDictDatas(DICT_TYPE.CUSTOMER_CREDIT_RULE_TYPE).find(i => i.value === val)||{}).label 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 else return (this.getDictDatas(DICT_TYPE.CUSTOMER_CREDIT_RULE_TYPE).find((i) => i.value === val) || {}).labelEn
} }
} }
}, },
currencyMap(){ currencyMap() {
let map = {} let map = {}
this.currencyList.forEach(item => { this.currencyList.forEach((item) => {
map[item.id] = this.$l(item, 'title') map[item.id] = this.$l(item, "title")
}) })
return map return map
}, }
}, },
filters: { filters: {
deliveryRate(pickNum, sumNum) { deliveryRate(pickNum, sumNum) {
if (pickNum == 0 || sumNum == 0) { if (pickNum == 0 || sumNum == 0) {
return 0 return 0
} else if (pickNum && sumNum) { } else if (pickNum && sumNum) {
return Math.round(pickNum / sumNum * 10000) / 100 + "%" return Math.round((pickNum / sumNum) * 10000) / 100 + "%"
} }
return null return null
} }
}, },
methods:{ methods: {
customerFollowFn(val){ getUserProfile() {
getUserProfile().then((res) => {
this.userId = res.data.id
})
},
customerFollowFn(val) {
this.activeName = val this.activeName = val
this.$nextTick(()=>{ this.$nextTick(() => {
if(val === 'follow'){ if (val === "follow") {
this.customerFollowVisible = true this.customerFollowVisible = true
this.$nextTick(_ => { this.$nextTick((_) => {
this.$refs['customerFollow'].handleAdd() this.$refs["customerFollow"].handleAdd()
}) })
} else { } 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) { handleCustomerFollow(row, flag) {
this.customerFollowVisible = true this.customerFollowVisible = true
this.$nextTick(_ => { this.$nextTick((_) => {
this.$refs['customerFollow'].handleUpdate(row, flag) this.$refs["customerFollow"].handleUpdate(row, flag)
}) })
}, },
handleCustomerFollowLink(row) { handleCustomerFollowLink(row) {
this.customerFollowVisible = true this.customerFollowVisible = true
this.$nextTick(_ => { this.$nextTick((_) => {
this.$refs['customerFollow'].handleView(row) this.$refs["customerFollow"].handleView(row)
}) })
}, },
checkPermi, checkPermi,
userIdFormatter(row, column, cellValue){ userIdFormatter(row, column, cellValue) {
const member = this.memberList.find(e => e.id === cellValue) const member = this.memberList.find((e) => e.id === cellValue)
if (member) { if (member) {
return member.nickname + '(' + member.mobile + ')' return member.nickname + "(" + member.mobile + ")"
} else { } else {
return '' return ""
} }
}, },
changeDate(val){ changeDate(val) {
if(val){ if (val) {
this.queryParams.beginRucangTime = val[0]; this.queryParams.beginRucangTime = val[0]
this.queryParams. endRucangTime = val[1]; this.queryParams.endRucangTime = val[1]
}else { } else {
this.queryParams.beginRucangTime = undefined; this.queryParams.beginRucangTime = undefined
this.queryParams.endRucangTime = undefined; this.queryParams.endRucangTime = undefined
} }
}, },
//品牌授权 //品牌授权
getBrankByCustomerList(){ getBrankByCustomerList() {
getBrankByCustomer({...this.brandAuthorizationFrom,customerId:this.id}).then(r => {this.brandAuthorizationList = r.data.list; this.brandAuthorizationTotal = r.data.total}) getBrankByCustomer({ ...this.brandAuthorizationFrom, customerId: this.id }).then((r) => {
this.brandAuthorizationList = r.data.list
this.brandAuthorizationTotal = r.data.total
})
}, },
// 信用等级日志 // 信用等级日志
getCustomerGrade(){ getCustomerGrade() {
levelLogPage({...this.getCustomerGradeFrom,customerId:this.id,total:undefined}).then(r => { levelLogPage({ ...this.getCustomerGradeFrom, customerId: this.id, total: undefined }).then((r) => {
if(r.code === 0){ if (r.code === 0) {
this.getCustomerGradeList = r.data.list; this.getCustomerGradeList = r.data.list
this.getCustomerGradeFrom.total = r.data.total; this.getCustomerGradeFrom.total = r.data.total
} }
}) })
}, },
// 信用日志 // 信用日志
creditLogPage(){ creditLogPage() {
customerCreditLogPage({...this.customerCreditLogFrom,customerId:this.id}).then(r => { customerCreditLogPage({ ...this.customerCreditLogFrom, customerId: this.id }).then((r) => {
if(r.code === 0){ if (r.code === 0) {
this.customerCreditLogList = r.data.list; this.customerCreditLogList = r.data.list
this.customerCreditLogFrom.total = r.data.total; this.customerCreditLogFrom.total = r.data.total
} }
}) })
}, },
//订单 //订单
getorderList(){ getorderList() {
let queryParams = {} let queryParams = {}
//目的国 //目的国
if (this.destCountryId != null && this.destCountryId != "") { if (this.destCountryId != null && this.destCountryId != "") {
queryParams.destCountryIds = this.destCountryId; queryParams.destCountryIds = this.destCountryId
} }
//目的城市 //目的城市
if (this.objectiveId != null && this.objectiveId != "") { if (this.objectiveId != null && this.objectiveId != "") {
queryParams.objectiveIds = this.objectiveId; queryParams.objectiveIds = this.objectiveId
} }
//目的仓 //目的仓
if (this.destWarehouseId != null && this.destWarehouseId != "") { if (this.destWarehouseId != null && this.destWarehouseId != "") {
queryParams.destWarehouseIds = this.destWarehouseId; queryParams.destWarehouseIds = this.destWarehouseId
} }
infoListOrderPage({customerDetailId:this.id,...this.queryParams,...queryParams}).then(r => { infoListOrderPage({ customerDetailId: this.id, ...this.queryParams, ...queryParams }).then((r) => {
if(r.code === 0){ if (r.code === 0) {
this.orderList = r.data.list this.orderList = r.data.list
this.orderTotal = r.data.total this.orderTotal = r.data.total
} }
...@@ -1305,102 +1161,99 @@ export default { ...@@ -1305,102 +1161,99 @@ export default {
this.destCountryId = null this.destCountryId = null
this.objectiveId = null this.objectiveId = null
this.destWarehouseId = null this.destWarehouseId = null
this.queryParams = { rows:10,page:1}; this.queryParams = { rows: 10, page: 1 }
this.getorderList() this.getorderList()
this.rucangtime = []; this.rucangtime = []
}, },
// 客户报价 // 客户报价
getInfoListOfferPage(){ getInfoListOfferPage() {
let queryParams = {} let queryParams = {}
//目的国 //目的国
if (this.destCountryId != null && this.destCountryId != "") { if (this.destCountryId != null && this.destCountryId != "") {
queryParams.destCountryIds = this.destCountryId; queryParams.destCountryIds = this.destCountryId
} }
//目的城市 //目的城市
if (this.objectiveId != null && this.objectiveId != "") { if (this.objectiveId != null && this.objectiveId != "") {
queryParams.destCountryIds = this.objectiveId; queryParams.destCountryIds = this.objectiveId
} }
//目的仓 //目的仓
if (this.destWarehouseId != null && this.destWarehouseId != "") { if (this.destWarehouseId != null && this.destWarehouseId != "") {
queryParams.destWarehouseIds = this.destWarehouseId; queryParams.destWarehouseIds = this.destWarehouseId
} }
infoListOfferPage({...this.infoListOfferFrom,customerId:this.id,...queryParams}).then(r => { infoListOfferPage({ ...this.infoListOfferFrom, customerId: this.id, ...queryParams }).then((r) => {
this.infoListOfferList = r.data.list; this.infoListOfferList = r.data.list
this.infoListOfferTotal = r.data.total; this.infoListOfferTotal = r.data.total
}) })
}, },
handleOfferReset() { handleOfferReset() {
this.destCountryId = null this.destCountryId = null
this.objectiveId = null this.objectiveId = null
this.destWarehouseId = null this.destWarehouseId = null
this.infoListOfferFrom = { pageNo:1,pageSize:10}; this.infoListOfferFrom = { pageNo: 1, pageSize: 10 }
this.getInfoListOfferPage() this.getInfoListOfferPage()
}, },
getCustomerFollowList() { getCustomerFollowList() {
getCustomerFollowList({ getCustomerFollowList({
...this.followForm, ...this.followForm,
customerId: this.customerId customerId: this.customerId
}).then(r => { }).then((r) => {
this.customerFollowList = r.data.list; this.customerFollowList = r.data.list
this.customerFollowTotal = r.data.total; this.customerFollowTotal = r.data.total
}) })
}, },
/** 跟进记录导出按钮操作 */ /** 跟进记录导出按钮操作 */
handleExport() { handleExport() {
// 执行导出 // 执行导出
this.$modal.confirm(this.$t('是否确认导出客户跟进记录数据项?')).then(() => { this.$modal.confirm(this.$t("是否确认导出客户跟进记录数据项?")).then(() => {
exportCustomerFollow({ exportCustomerFollow({
...this.followForm, ...this.followForm,
customerId: this.customerId customerId: this.customerId
}).then((r) => { }).then((r) => {
this.$message.success( this.$message.success(this.$t("已加入导出队列,请稍后在下载日志中下载"))
this.$t("已加入导出队列,请稍后在下载日志中下载") })
);
});
}) })
}, },
// 数据 // 数据
getOrderStatistics(){ getOrderStatistics() {
orderStatistics({customerId:this.id}).then(r => { orderStatistics({ customerId: this.id }).then((r) => {
if(r.code === 0){ if (r.code === 0) {
this.orderStatisticsObj = r.data this.orderStatisticsObj = r.data
} }
}) })
}, },
submit(){ submit() {
creditLogCreate({customerId:this.id,...this.creditFrom}).then(r => { creditLogCreate({ customerId: this.id, ...this.creditFrom }).then((r) => {
if(r.code === 0){ if (r.code === 0) {
this.creditLogPage(); this.creditLogPage()
this.creditFrom = {}; this.creditFrom = {}
this.creditScoreStatisticFn() this.creditScoreStatisticFn()
this.dialogVisible = false; this.dialogVisible = false
} }
}) })
}, },
//获得信用客户统计 //获得信用客户统计
creditScoreStatisticFn(){ creditScoreStatisticFn() {
creditScoreStatistic({customerId:this.id}).then(r => { creditScoreStatistic({ customerId: this.id }).then((r) => {
if(r.code === 0) this.creditScoreStatisticObj = r.data if (r.code === 0) this.creditScoreStatisticObj = r.data
}) })
}, },
// 获取账单数据 // 获取账单数据
infoListReceiptFn(){ infoListReceiptFn() {
infoListReceiptPage({...this.infoListReceiptFrom,customerId:this.id}).then(r => { infoListReceiptPage({ ...this.infoListReceiptFrom, customerId: this.id }).then((r) => {
if (r.code === 0) {
if(r.code === 0){ this.infoListReceiptList = r.data.list
this.infoListReceiptList = r.data.list; this.infoListReceiptTotal = r.data.total
this.infoListReceiptTotal = r.data.total;
} }
}) })
}, },
deleteCustomerFn(){ deleteCustomerFn() {
this.$confirm(`${this.$t('是否要删除当前客户')}《${this.customer.name}》?`, `${this.$t('提示')}`, { this.$confirm(`${this.$t("是否要删除当前客户")}《${this.customer.name}》?`, `${this.$t("提示")}`, {
confirmButtonText: this.$t('确定'), confirmButtonText: this.$t("确定"),
cancelButtonText: this.$t('取消'), cancelButtonText: this.$t("取消"),
type: 'warning' type: "warning"
}).then(() => { }).then(() => {
deleteCustomer(this.customerId).then(r => { deleteCustomer(this.customerId).then((r) => {
this.$modal.msgSuccess(this.$t('删除成功')); this.$modal.msgSuccess(this.$t("删除成功"))
this.$router.back() this.$router.back()
}) })
}) })
...@@ -1409,7 +1262,7 @@ export default { ...@@ -1409,7 +1262,7 @@ export default {
//获取当前省份值id,获取该省份下城市 destCountryId provinceCode //获取当前省份值id,获取该省份下城市 destCountryId provinceCode
if (this.destCountryId != null && this.destCountryId != "") { if (this.destCountryId != null && this.destCountryId != "") {
getRegionList(2, this.destCountryId).then(({ data }) => { getRegionList(2, this.destCountryId).then(({ data }) => {
this.AddressCity = data; this.AddressCity = data
}) })
} }
}, },
...@@ -1417,7 +1270,7 @@ export default { ...@@ -1417,7 +1270,7 @@ export default {
//获取当前城市值id,获取该城市下区域 //获取当前城市值id,获取该城市下区域
if (this.objectiveId != null && this.objectiveId != "") { if (this.objectiveId != null && this.objectiveId != "") {
getRegionList(3, this.objectiveId).then(({ data }) => { getRegionList(3, this.objectiveId).then(({ data }) => {
this.AddressTown = data; this.AddressTown = data
}) })
} }
}, },
...@@ -1428,62 +1281,66 @@ export default { ...@@ -1428,62 +1281,66 @@ export default {
}, },
getAddressProvince() { getAddressProvince() {
getRegionList(1, 1).then(({ data }) => { getRegionList(1, 1).then(({ data }) => {
this.AddressProvince = data; this.AddressProvince = data
}) })
}, },
getAddressCity() { getAddressCity() {
getRegionList(4, 4).then(({ data }) => { getRegionList(4, 4).then(({ data }) => {
this.AddressCity = data; this.AddressCity = data
}) })
}, },
getAddressTown() { getAddressTown() {
getRegionList(5, 5).then(({ data }) => { getRegionList(5, 5).then(({ data }) => {
this.AddressTown = data; this.AddressTown = data
}) })
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
if (this.activeName == 'order') { if (this.activeName == "order") {
this.queryParams.page = 1 this.queryParams.page = 1
this.getorderList() this.getorderList()
} else if (this.activeName == 'quote') { } else if (this.activeName == "quote") {
this.infoListOfferFrom.pageNo = 1 this.infoListOfferFrom.pageNo = 1
this.getInfoListOfferPage() this.getInfoListOfferPage()
} else if (this.activeName == "follow") {
this.followForm.pageNo = 1
this.getCustomerFollowList()
} }
}, },
getWarehouseList() { getWarehouseList() {
getWarehouseList().then((res) => { getWarehouseList().then((res) => {
this.warehouseList = res.data; this.warehouseList = res.data
}) })
}, },
getWarehouse(id) { getWarehouse(id) {
let warehouseName = '' let warehouseName = ""
for(const item of this.warehouseList) { for (const item of this.warehouseList) {
if(item.id == id){ if (item.id == id) {
warehouseName = this.$i18n.locale=='zh_CN'?item.titleZh:item.titleEn warehouseName = this.$i18n.locale == "zh_CN" ? item.titleZh : item.titleEn
break break
} }
} }
return warehouseName return warehouseName
}, },
cancel(id){ cancel(id) {
this.doAction(this.$t('确定要取消此报价单么?'), cancel, id); this.doAction(this.$t("确定要取消此报价单么?"), cancel, id)
}, },
recovery(id){ recovery(id) {
this.doAction(this.$t('确定要恢复此报价单么?'), recovery, id); this.doAction(this.$t("确定要恢复此报价单么?"), recovery, id)
}, },
deleteOffer(id){ deleteOffer(id) {
this.doAction(this.$t('确定要删除此报价单么?'), deleteOffer, id); this.doAction(this.$t("确定要删除此报价单么?"), deleteOffer, id)
}, },
doAction(tips, action, id){ doAction(tips, action, id) {
this.$confirm(tips).then(res => { this.$confirm(tips)
.then((res) => {
return action(id) return action(id)
}) })
.then(() => { .then(() => {
this.$message.success('操作成功') this.$message.success("操作成功")
this.handleQuery() this.handleQuery()
}) })
}, }
} }
} }
</script> </script>
...@@ -454,11 +454,12 @@ ...@@ -454,11 +454,12 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('客户类别')" align="center" prop="status"> <el-table-column :label="$t('客户类别')" align="center" prop="status">
<template slot-scope="scope"> <template slot-scope="{ row }">
<dict-tag {{ getDictDatas2(DICT_TYPE.CUSTOMER_TYPE, (row.type||'').split(',')).map(e => isChinese ? e.label : e.labelEn).join(', ')}}
:type="DICT_TYPE.CUSTOMER_TYPE" <!-- <dict-tag-->
:value="scope.row.type" <!-- :type="DICT_TYPE.CUSTOMER_TYPE"-->
/> <!-- :value="scope.row.type"-->
<!-- />-->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('角色')" align="center" prop="status"> <el-table-column :label="$t('角色')" align="center" prop="status">
......
...@@ -451,11 +451,12 @@ ...@@ -451,11 +451,12 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('客户类别')" align="center" prop="status"> <el-table-column :label="$t('客户类别')" align="center" prop="status">
<template slot-scope="scope"> <template slot-scope="{ row }">
<dict-tag {{ getDictDatas2(DICT_TYPE.CUSTOMER_TYPE, (row.type||'').split(',')).map(e => isChinese ? e.label : e.labelEn).join(', ')}}
:type="DICT_TYPE.CUSTOMER_TYPE" <!-- <dict-tag-->
:value="scope.row.type" <!-- :type="DICT_TYPE.CUSTOMER_TYPE"-->
/> <!-- :value="scope.row.type"-->
<!-- />-->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('角色')" align="center" prop="status"> <el-table-column :label="$t('角色')" align="center" prop="status">
......
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-form <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="130px">
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
label-width="130px"
>
<el-form-item :label="$t('客户编号')" prop="number"> <el-form-item :label="$t('客户编号')" prop="number">
<el-input <el-input v-model.trim="queryParams.number" :placeholder="$t('请输入客户编号')" clearable @keyup.enter.native="handleQuery" @input="queryParams.number = queryParams.number.replace(/\s+/g, '')" />
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>
<el-form-item :label="$t('客户名称')" prop="name"> <el-form-item :label="$t('客户名称')" prop="name">
<el-input <el-input v-model.trim="queryParams.name" :placeholder="$t('请输入客户名称')" clearable @keyup.enter.native="handleQuery" @input="queryParams.name = queryParams.name.replace(/\s+/g, '')" />
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>
<el-form-item :label="$t('区号')"> <el-form-item :label="$t('区号')">
<el-select <el-select v-model="queryParams.areaCode" :placeholder="$t('请选择区号')">
v-model="queryParams.areaCode" <el-option v-for="(item, index) in countryList" :key="index" :label="item.nameShort + (isChinese ? item.nameZh : item.nameEn) + ' +' + item.tel" :value="item.tel" />
: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-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('联系方式')"> <el-form-item :label="$t('联系方式')">
<el-input <el-input :placeholder="$t('请输入联系方式')" v-model.trim="queryParams.defaultContactPhone" @input="queryParams.defaultContactPhone = queryParams.defaultContactPhone.replace(/\s+/g, '')"></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>
<!-- <!--
<el-form-item :label="$t('客户经理')" prop="customerService"> <el-form-item :label="$t('客户经理')" prop="customerService">
...@@ -72,146 +36,50 @@ ...@@ -72,146 +36,50 @@
</el-form-item> </el-form-item>
--> -->
<el-form-item :label="$t('客户来源')" prop="source"> <el-form-item :label="$t('客户来源')" prop="source">
<el-select <el-select multiple clearable v-model="queryParams.source" :placeholder="$t('请选择客户来源')" size="small" @change="handleQuery">
multiple <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_SOURCE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="dict.value" />
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-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('客户类别')" prop="level"> <el-form-item :label="$t('客户类别')" prop="level">
<dict-selector <dict-selector multiple clearable :type="DICT_TYPE.CUSTOMER_TYPE" v-model="queryParams.type" @change="handleQuery"></dict-selector>
multiple
clearable
:type="DICT_TYPE.CUSTOMER_TYPE"
v-model="queryParams.type"
@change="handleQuery"
></dict-selector>
</el-form-item> </el-form-item>
<el-form-item :label="$t('角色')"> <el-form-item :label="$t('角色')">
<dict-selector <dict-selector multiple clearable :type="DICT_TYPE.CUSTOMER_ROLE" v-model="queryParams.role" formatter="number" @change="handleQuery" :placeholder="$t('请选择')"></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>
<el-form-item :label="$t('客户状态')" prop="status"> <el-form-item :label="$t('客户状态')" prop="status">
<el-select <el-select multiple clearable v-model="queryParams.status" :placeholder="$t('请选择客户状态')" size="small" @change="handleQuery">
multiple <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_STATUS)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="dict.value" />
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-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('国籍')" prop="country"> <el-form-item :label="$t('国籍')" prop="country">
<el-select <el-select multiple clearable v-model="queryParams.country" :placeholder="$t('请选择')" @change="handleQuery">
multiple <el-option v-for="dict in countryList" :key="dict.id" :label="isChinese ? dict.nameZh : dict.nameEn" :value="parseInt(dict.id)" />
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-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('出货渠道')"> <el-form-item :label="$t('出货渠道')">
<dict-selector <dict-selector multiple clearable :type="DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE" v-model="queryParams.transportType" formatter="number" @change="handleQuery"></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>
<el-form-item :label="$t('业务国家')" v-show="showSearch"> <el-form-item :label="$t('业务国家')" v-show="showSearch">
<el-select <el-select multiple clearable v-model="queryParams.busiCountryIds" :placeholder="$t('请选择')" @change="handleQuery">
multiple <el-option v-for="dict in countryList" :key="dict.id" :label="isChinese ? dict.nameZh : dict.nameEn" :value="parseInt(dict.id)" />
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-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('常用提货网点')" v-show="showSearch"> <el-form-item :label="$t('常用提货网点')" v-show="showSearch">
<el-select multiple v-model="queryParams.pickupPoints"> <el-select multiple v-model="queryParams.pickupPoints">
<el-option <el-option v-for="item in getNodeLists" :key="item.id" :value="item.id" :label="isChinese ? item.titleZh : item.titleEn"></el-option>
v-for="item in getNodeLists"
:key="item.id"
:value="item.id"
:label="isChinese ? item.titleZh : item.titleEn"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('创建人')" v-show="showSearch"> <el-form-item :label="$t('创建人')" v-show="showSearch">
<el-select v-model="queryParams.founder"> <el-select v-model="queryParams.founder">
<el-option <el-option v-for="item in allSimplList" :key="item.id" :label="item.nickname" :value="item.id"> </el-option>
v-for="item in allSimplList"
:key="item.id"
:label="item.nickname"
:value="item.id"
>
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('创建时间')" v-show="showSearch"> <el-form-item :label="$t('创建时间')" v-show="showSearch">
<el-date-picker <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('结束日期')" />
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>
<el-form-item :label="$t('入公海时间')" v-show="showSearch"> <el-form-item :label="$t('入公海时间')" v-show="showSearch">
<el-date-picker <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('结束日期')" />
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>
<el-form-item :label="$t('业绩类型')" v-show="showSearch"> <el-form-item :label="$t('业绩类型')" v-show="showSearch">
<el-select clearable v-model="queryParams.isNew"> <el-select clearable v-model="queryParams.isNew">
...@@ -220,104 +88,37 @@ ...@@ -220,104 +88,37 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('年度发货量')" v-show="showSearch"> <el-form-item :label="$t('年度发货量')" v-show="showSearch">
<el-input <el-input v-model.trim="weightYearly.value" :placeholder="$t('请输入数字')" clearable @keyup.enter.native="handleQuery" @input="weightYearly.value = weightYearly.value.replace(/\s+/g, '')">
v-model.trim="weightYearly.value"
:placeholder="$t('请输入数字')"
clearable
@keyup.enter.native="handleQuery"
@input="weightYearly.value=weightYearly.value.replace(/\s+/g, '')"
>
<template slot="prepend"> <template slot="prepend">
<dict-selector <dict-selector :type="DICT_TYPE.CUSTOMER_QUERY_NUMBER_FIELD" defaultable v-model="weightYearly.key" class="w-50" />
:type="DICT_TYPE.CUSTOMER_QUERY_NUMBER_FIELD"
defaultable
v-model="weightYearly.key"
class="w-50"
/>
</template> </template>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('商品类别')" v-show="showSearch"> <el-form-item :label="$t('商品类别')" v-show="showSearch">
<el-select <el-select @change="handleSelectProductType" multiple v-model="queryParams.productTypes" :placeholder="$t('请选择')">
@change="handleSelectProductType" <el-option :label="item.titleZh" :value="item.id" v-for="item in productTypeList" :key="item.id" />
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-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('商品名称')" v-show="showSearch"> <el-form-item :label="$t('商品名称')" v-show="showSearch">
<el-select <el-select multiple filterable clearable v-model="queryParams.productIds" :placeholder="$t('请选择商品名称')">
multiple <el-option :label="item.titleZh" :value="parseInt(item.id)" v-for="item in productList" :key="item.id" />
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-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('主要竞争对手')" v-show="showSearch"> <el-form-item :label="$t('主要竞争对手')" v-show="showSearch">
<el-select <el-select clearable multiple v-model="queryParams.competitorIds" :placeholder="$t('请选择')" @change="handleQuery">
clearable <el-option v-for="item in competitorList" :key="item.id" :label="item.name" :value="item.id" />
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-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('年度发货次数')" v-show="showSearch"> <el-form-item :label="$t('年度发货次数')" v-show="showSearch">
<el-input <el-input v-model.trim="numYearly.value" :placeholder="$t('请输入数字')" clearable @keyup.enter.native="handleQuery" @input="numYearly.value = numYearly.value.replace(/\s+/g, '')">
v-model.trim="numYearly.value"
:placeholder="$t('请输入数字')"
clearable
@keyup.enter.native="handleQuery"
@input="numYearly.value=numYearly.value.replace(/\s+/g, '')"
>
<template slot="prepend"> <template slot="prepend">
<dict-selector <dict-selector :type="DICT_TYPE.CUSTOMER_QUERY_NUMBER_FIELD" defaultable v-model="numYearly.key" class="w-50" />
:type="DICT_TYPE.CUSTOMER_QUERY_NUMBER_FIELD"
defaultable
v-model="numYearly.key"
class="w-50"
/>
</template> </template>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('推介人')" v-show="showSearch"> <el-form-item :label="$t('推介人')" v-show="showSearch">
<el-select <el-select clearable remote :remote-method="remoteMethod" v-model="queryParams.promoter" :placeholder="$t('请输入推介人')" filterable>
clearable <el-option v-for="item in customerSelectFn" :key="item.id" :label="item.name" :value="item.id"> </el-option>
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-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('入仓确认')" v-show="showSearch"> <el-form-item :label="$t('入仓确认')" v-show="showSearch">
...@@ -336,119 +137,45 @@ ...@@ -336,119 +137,45 @@
<el-switch v-model="queryParams.isShowTidanPrice" /> <el-switch v-model="queryParams.isShowTidanPrice" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('归属时间')" v-show="showSearch"> <el-form-item :label="$t('归属时间')" v-show="showSearch">
<el-date-picker <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('结束日期')" />
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>
<el-form-item :label="$t('首次成交时间')" v-show="showSearch"> <el-form-item :label="$t('首次成交时间')" v-show="showSearch">
<el-date-picker <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('结束日期')" />
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>
<el-form-item :label="$t('获取方式')" v-show="showSearch"> <el-form-item :label="$t('获取方式')" v-show="showSearch">
<el-select <el-select v-model="queryParams.getMethod" multiple :placeholder="$t('请选择')">
v-model="queryParams.getMethod" <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)" />
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-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('创建入口')" v-show="showSearch"> <el-form-item :label="$t('创建入口')" v-show="showSearch">
<el-select <el-select v-model="queryParams.createFroms" multiple :placeholder="$t('请选择')">
v-model="queryParams.createFroms" <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_FROM)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
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-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('结算方式')" v-show="showSearch"> <el-form-item :label="$t('结算方式')" v-show="showSearch">
<el-select <el-select v-model="queryParams.balances" multiple :placeholder="$t('请选择结算方式')">
v-model="queryParams.balances" <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_BALANCE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
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-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{ <el-button type="primary" icon="el-icon-search" @click="handleQuery">{{ $t("搜索") }}</el-button>
$t("搜索") <el-button icon="el-icon-refresh" @click="resetQuery">{{ $t("重置") }}</el-button>
}}</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{
$t("重置")
}}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- 操作工具栏 --> <!-- 操作工具栏 -->
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['ecw:customer:my-create']">{{ $t("新增") }}</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>
<el-col :span="1.5"> <el-col :span="1.5">
<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>
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['ecw:customer:my-export']"
>{{ $t("导出") }}</el-button
>
</el-col> </el-col>
<right-toolbar <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row> </el-row>
<!-- 列表 --> <!-- 列表 -->
<el-table <el-table ref="multipleTable" v-loading="loading" :data="list" @selection-change="handleSelectionChange">
ref="multipleTable"
v-loading="loading"
:data="list"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" fixed></el-table-column> <el-table-column type="selection" width="55" fixed></el-table-column>
<el-table-column :label="$t('客户编号')" align="center" fixed> <el-table-column :label="$t('客户编号')" align="center" fixed>
<template v-slot="{ row }"> <template v-slot="{ row }">
...@@ -489,16 +216,10 @@ ...@@ -489,16 +216,10 @@
--> -->
<el-table-column :label="$t('客户状态')" align="center" prop="status"> <el-table-column :label="$t('客户状态')" align="center" prop="status">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag <dict-tag :type="DICT_TYPE.CUSTOMER_STATUS" :value="scope.row.status" />
:type="DICT_TYPE.CUSTOMER_STATUS"
:value="scope.row.status"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column :label="$t('主联系人')" prop="defaultContactName"></el-table-column>
:label="$t('主联系人')"
prop="defaultContactName"
></el-table-column>
<el-table-column :label="$t('主联系方式')" prop="defaultContactPhone"> <el-table-column :label="$t('主联系方式')" prop="defaultContactPhone">
<template v-slot="{ row }"> <template v-slot="{ row }">
+{{ row.defaultContactPhone }} <br /> +{{ row.defaultContactPhone }} <br />
...@@ -508,20 +229,29 @@ ...@@ -508,20 +229,29 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('客户类别')" align="center" prop="status"> <el-table-column :label="$t('客户类别')" align="center" prop="status">
<template slot-scope="scope"> <template slot-scope="{ row }">
<dict-tag {{
:type="DICT_TYPE.CUSTOMER_TYPE" getDictDatas2(DICT_TYPE.CUSTOMER_TYPE, (row.type || "").split(","))
:value="scope.row.type" .map((e) => (isChinese ? e.label : e.labelEn))
/> .join(", ")
}}
<!-- <dict-tag-->
<!-- :type="DICT_TYPE.CUSTOMER_TYPE"-->
<!-- :value="scope.row.type"-->
<!-- />-->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('角色')" align="center" prop="status"> <el-table-column :label="$t('角色')" align="center" prop="status">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
{{ getDictDatas2(DICT_TYPE.CUSTOMER_ROLE, (row.roles||'').split(',')).map(e => isChinese ? e.label : e.labelEn).join(', ')}} {{
<!-- <dict-tag--> getDictDatas2(DICT_TYPE.CUSTOMER_ROLE, (row.roles || "").split(","))
<!-- :type="DICT_TYPE.CUSTOMER_ROLE"--> .map((e) => (isChinese ? e.label : e.labelEn))
<!-- :value="scope.row.roles"--> .join(", ")
<!-- />--> }}
<!-- <dict-tag-->
<!-- :type="DICT_TYPE.CUSTOMER_ROLE"-->
<!-- :value="scope.row.roles"-->
<!-- />-->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('客户经理')" align="center" prop="customerServiceName"></el-table-column> <el-table-column :label="$t('客户经理')" align="center" prop="customerServiceName"></el-table-column>
...@@ -533,10 +263,7 @@ ...@@ -533,10 +263,7 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('客户来源')"> <el-table-column :label="$t('客户来源')">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag <dict-tag :type="DICT_TYPE.CUSTOMER_SOURCE" :value="scope.row.source" />
:type="DICT_TYPE.CUSTOMER_SOURCE"
:value="scope.row.source"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('业务国家')"> <el-table-column :label="$t('业务国家')">
...@@ -559,8 +286,7 @@ ...@@ -559,8 +286,7 @@
{{ getProductTypeNames(row.productType) }} {{ getProductTypeNames(row.productType) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('主要竞争对手')" prop="competitorNames"> <el-table-column :label="$t('主要竞争对手')" prop="competitorNames"> </el-table-column>
</el-table-column>
<el-table-column :label="$t('年度发货次数')" align="center"> <el-table-column :label="$t('年度发货次数')" align="center">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
{{ row.numYearly }} {{ row.numYearly }}
...@@ -573,13 +299,13 @@ ...@@ -573,13 +299,13 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('入公海时间')" align="center" width="160"> <el-table-column :label="$t('入公海时间')" align="center" width="160">
<template v-slot="{ row }"> <template v-slot="{ row }">
{{ parseTime( row.enterOpenSeaTime ? row.enterOpenSeaTime : row.estimateEnterOpenSeaTime)}} {{ parseTime(row.enterOpenSeaTime ? row.enterOpenSeaTime : row.estimateEnterOpenSeaTime) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('入仓确认')" align="center"> <el-table-column :label="$t('入仓确认')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag type="success" v-if="scope.row.arrivalConfirm == 1">{{ $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> <el-tag type="info" v-else>{{ $t("") }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('控货无收货人')" align="center"> <el-table-column :label="$t('控货无收货人')" align="center">
...@@ -604,14 +330,10 @@ ...@@ -604,14 +330,10 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('获取方式')" align="center"> <el-table-column :label="$t('获取方式')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag <dict-tag :type="DICT_TYPE.CUSTOMER_GET_METHOD" :value="scope.row.getMethod" />
:type="DICT_TYPE.CUSTOMER_GET_METHOD"
:value="scope.row.getMethod"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('创建人')" prop="createUsername" align="center"> <el-table-column :label="$t('创建人')" prop="createUsername" align="center"> </el-table-column>
</el-table-column>
<el-table-column :label="$t('创建时间')" align="center" width="160"> <el-table-column :label="$t('创建时间')" align="center" width="160">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ parseTime(scope.row.createTime) }}</span>
...@@ -619,143 +341,52 @@ ...@@ -619,143 +341,52 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('最后更新时间')" align="center" width="160"> <el-table-column :label="$t('最后更新时间')" align="center" width="160">
<template slot-scope="scope"> <template slot-scope="scope">
<span >{{ parseTime(scope.row.updateTime) }}</span> <span>{{ parseTime(scope.row.updateTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column width="200px" :label="$t('操作')" align="center" fixed="right" class-name="small-padding fixed-width">
width="200px"
:label="$t('操作')"
align="center"
fixed="right"
class-name="small-padding fixed-width"
>
<template slot-scope="scope"> <template slot-scope="scope">
<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>
size="mini" <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['ecw:customer:my-update']">{{ $t("修改") }}</el-button>
type="text" <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>
icon="el-icon-view" <el-button size="mini" type="text" icon="el-icon-user" v-hasPermi="['ecw:customer:my-customer-complaint']" @click="complaint(scope.row)">{{ $t("客诉") }}</el-button>
@click="handleView(scope.row)" <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['ecw:customer:my-delete']">{{ $t("删除") }}</el-button>
v-hasPermi="['ecw:customer:my-query']" <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>
>{{ $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
>
<!--lanbm 2024-05-26 添加的报价功能按钮,取消了权限控制--> <!--lanbm 2024-05-26 添加的报价功能按钮,取消了权限控制-->
<el-button <el-button size="mini" type="text" icon="el-icon-user" @click="quote(scope.row)">{{ $t("报价") }}</el-button>
size="mini" <el-button v-has-permi="['ecw:customer:setting']" size="mini" type="text" icon="el-icon-user" @click="handleSetting(scope.row)">{{ $t("设置") }}</el-button>
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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 分页组件 --> <!-- 分页组件 -->
<pagination <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" @pagination="getList" />
v-show="total > 0" <customer-follow-list :customer-id="customerId" :id="customerId" :customer-service="customerService" :customer-number="customerNumber" ref="CustomerFollowList" v-if="customerFollowVisible"></customer-follow-list>
:total="total" <customer-complaints ref="customerComplaint" :customer-id.sync="customerId"></customer-complaints>
:page.sync="queryParams.pageNo" <transfer-customer :show.sync="show" :customer-ids.sync="selectCustomerList"></transfer-customer>
:limit.sync="queryParams.pageSize" <customer-setting ref="customerSetting" @refresh="getList"></customer-setting>
@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>
</div> </div>
</template> </template>
<script> <script>
import { import { createCustomer, updateCustomer, deleteCustomer, getMyCustomerService, mineExporteExcel, mineExportExcel, competitorListAll } from "@/api/ecw/customer"
createCustomer, import { getDictDatas, DICT_TYPE, getDictDatas2 } from "@/utils/dict"
updateCustomer, import upload from "@/components/ImageUpload"
deleteCustomer, import customerFollowList from "../customer/components/customerFollow"
getMyCustomerService, import customerComplaints from "@/components/customerComplaints"
mineExporteExcel, import { listServiceUser, getUserProfile, listAllSimpl } from "@/api/system/user"
mineExportExcel, import { getCountryListAll } from "@/api/ecw/country"
competitorListAll import { getCreditPage } from "@/api/customer/credit"
} from "@/api/ecw/customer"; import transferCustomer from "@/views/ecw/customer/transferCustomer"
import { getDictDatas, DICT_TYPE, getDictDatas2 } from "@/utils/dict"; import Template from "@/views/cms/template/index.vue"
import upload from "@/components/ImageUpload"; import Contacts from "@/views/ecw/customer/components/contacts.vue"
import customerFollowList from "../customer/components/customerFollow"; import CustomerSetting from "../customer/components/customerSetting.vue"
import customerComplaints from "@/components/customerComplaints"; import AreaCodeSelector from "@/components/AreaCodeSelector/index.vue"
import { listServiceUser, getUserProfile, listAllSimpl} from "@/api/system/user"; import { getNodeList } from "@/api/ecw/node"
import { getCountryListAll } from "@/api/ecw/country"; import { getCustomerSelect, changeCustomerDefaultPay, changeCustomerNoConsignee, changeCustomerDefaultBilling } from "@/api/ecw/customer"
import { getCreditPage } from "@/api/customer/credit"; import { getProductTypeList } from "@/api/ecw/productType"
import transferCustomer from "@/views/ecw/customer/transferCustomer"; import { getProductList } from "@/api/ecw/product"
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 { export default {
name: "EcwMycustomerserviceIndex", name: "EcwMyCustomerServiceIndex",
components: { components: {
Contacts, Contacts,
Template, Template,
...@@ -768,7 +399,7 @@ export default { ...@@ -768,7 +399,7 @@ export default {
}, },
computed: { computed: {
isChinese() { isChinese() {
return this.$i18n.locale === "zh_CN"; return this.$i18n.locale === "zh_CN"
}, },
channel() { channel() {
return (val) => { return (val) => {
...@@ -777,20 +408,18 @@ export default { ...@@ -777,20 +408,18 @@ export default {
.filter((i) => (val.split(",") || []).includes(i.value)) .filter((i) => (val.split(",") || []).includes(i.value))
.map((i) => (this.isChinese ? i.label : i.labelEn)) .map((i) => (this.isChinese ? i.label : i.labelEn))
.join("") .join("")
: ""; : ""
}; }
}, },
customerSelectFn() { customerSelectFn() {
if (this.recommended.length > 0) { if (this.recommended.length > 0) {
let i = this.customerSelect.find( let i = this.customerSelect.find((item) => item.id === this.recommended[0].id)
(item) => item.id === this.recommended[0].id
);
if (!i) { if (!i) {
this.customerSelect.push(this.recommended[0]); this.customerSelect.push(this.recommended[0])
} }
return this.customerSelect; return this.customerSelect
} else { } else {
return this.customerSelect; return this.customerSelect
} }
}, },
combinedQueryParams() { combinedQueryParams() {
...@@ -812,26 +441,26 @@ export default { ...@@ -812,26 +441,26 @@ export default {
queryParams.endFirstDealTime = this.firstDealTime[1] queryParams.endFirstDealTime = this.firstDealTime[1]
} }
if (this.weightYearly.value) { if (this.weightYearly.value) {
let key = 'eqWeightYearly' let key = "eqWeightYearly"
if (this.weightYearly.key == 'leNumberKey') { if (this.weightYearly.key == "leNumberKey") {
key = 'leWeightYearly' key = "leWeightYearly"
} else if (this.weightYearly.key == 'geNumberKey') { } else if (this.weightYearly.key == "geNumberKey") {
key = 'geWeightYearly' key = "geWeightYearly"
} }
queryParams[key] = this.weightYearly.value; queryParams[key] = this.weightYearly.value
} }
if (this.numYearly.value) { if (this.numYearly.value) {
let key = 'eqNumYearly' let key = "eqNumYearly"
if (this.numYearly.key == 'leNumberKey') { if (this.numYearly.key == "leNumberKey") {
key = 'leNumYearly' key = "leNumYearly"
} else if (this.numYearly.key == 'geNumberKey') { } else if (this.numYearly.key == "geNumberKey") {
key = 'geNumYearly' key = "geNumYearly"
} }
queryParams[key] = this.numYearly.value; queryParams[key] = this.numYearly.value
} }
return queryParams; return queryParams
}, }
}, },
data() { data() {
return { return {
...@@ -860,7 +489,7 @@ export default { ...@@ -860,7 +489,7 @@ export default {
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10
/*number: null, /*number: null,
name: null, name: null,
level: null, level: null,
...@@ -884,48 +513,46 @@ export default { ...@@ -884,48 +513,46 @@ export default {
{ {
required: true, required: true,
message: this.$t("客户名称不能为空"), message: this.$t("客户名称不能为空"),
trigger: "blur", trigger: "blur"
}, }
],
country: [
{ required: true, message: this.$t("国家不能为空"), trigger: "blur" },
], ],
country: [{ required: true, message: this.$t("国家不能为空"), trigger: "blur" }],
level: [ level: [
{ {
required: true, required: true,
message: this.$t("客户等级不能为空"), message: this.$t("客户等级不能为空"),
trigger: "blur", trigger: "blur"
}, }
], ],
type: [ type: [
{ {
required: true, required: true,
message: this.$t("客户类别不能为空"), message: this.$t("客户类别不能为空"),
trigger: "blur", trigger: "blur"
}, }
], ],
// createTime: [{ required: true, message: this.$t("创建时间不能为空"), trigger: "blur" }], // createTime: [{ required: true, message: this.$t("创建时间不能为空"), trigger: "blur" }],
source: [ source: [
{ {
required: true, required: true,
message: this.$t("客户来源不能为空"), message: this.$t("客户来源不能为空"),
trigger: "blur", trigger: "blur"
}, }
], ],
status: [ status: [
{ {
required: true, required: true,
message: this.$t("客户状态不能为空"), message: this.$t("客户状态不能为空"),
trigger: "blur", trigger: "blur"
}, }
], ],
founder: [ founder: [
{ {
required: true, required: true,
message: this.$t("创建人不能为空"), message: this.$t("创建人不能为空"),
trigger: "blur", trigger: "blur"
}, }
], ]
}, },
// 网点 // 网点
nodeList: [], nodeList: [],
...@@ -933,7 +560,7 @@ export default { ...@@ -933,7 +560,7 @@ export default {
customerId: undefined, customerId: undefined,
selectCustomerList: [], selectCustomerList: [],
//lanbm 2024-05-26 添加参数 //lanbm 2024-05-26 添加参数
userId:undefined, userId: undefined,
customerService: undefined, customerService: undefined,
customerNumber: undefined, customerNumber: undefined,
customerFollowVisible: false, customerFollowVisible: false,
...@@ -946,52 +573,52 @@ export default { ...@@ -946,52 +573,52 @@ export default {
allSimplList: [], allSimplList: [],
weightYearly: { weightYearly: {
key: "eqNumberKey", key: "eqNumberKey",
value: "", value: ""
}, },
numYearly: { numYearly: {
key: "eqNumberKey", key: "eqNumberKey",
value: "", value: ""
}, },
productTypeList: [], productTypeList: [],
productList: [], productList: [],
competitorList: [], competitorList: [],
deptList: [], deptList: []
}; }
}, },
activated() { activated() {
this.getList(); this.getList()
}, },
created() { created() {
this.getList(); this.getList()
// getNodeList().then(r => { // getNodeList().then(r => {
// this.nodeList = r.data // this.nodeList = r.data
// }) // })
getCreditPage({ page: 1, rows: 999 }).then((r) => { getCreditPage({ page: 1, rows: 999 }).then((r) => {
this.creditList = r.data.list; this.creditList = r.data.list
}); })
listServiceUser().then((r) => { listServiceUser().then((r) => {
this.customerServiceList = r.data; this.customerServiceList = r.data
}); })
getCountryListAll().then((r) => { getCountryListAll().then((r) => {
this.countryList = r.data; this.countryList = r.data
}); })
//获取用户id信息 lanbm 2024-05-23 add //获取用户id信息 lanbm 2024-05-23 add
getUserProfile().then((res) => { getUserProfile().then((res) => {
this.userId = res.data.id; this.userId = res.data.id
}); })
this.getCustomerSelect(); this.getCustomerSelect()
getNodeList().then((r) => { getNodeList().then((r) => {
this.getNodeLists = r.data; this.getNodeLists = r.data
}); })
listAllSimpl().then((r) => { listAllSimpl().then((r) => {
this.allSimplList = r.data; this.allSimplList = r.data
}); })
getProductTypeList().then((r) => { getProductTypeList().then((r) => {
this.productTypeList = r.data; this.productTypeList = r.data
}); })
competitorListAll().then((r) => { competitorListAll().then((r) => {
this.competitorList = r.data; this.competitorList = r.data
}) })
}, },
updated() { updated() {
...@@ -1001,49 +628,42 @@ export default { ...@@ -1001,49 +628,42 @@ export default {
}, },
methods: { methods: {
handleSelectionChange(val) { handleSelectionChange(val) {
this.selectCustomerList = val.map((i) => i.id); this.selectCustomerList = val.map((i) => i.id)
}, },
delay(row) { 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) { countryFormatter(row, column, cellValue) {
const country = this.countryList.find((e) => e.id === cellValue); const country = this.countryList.find((e) => e.id === cellValue)
return this.isChinese ? country?.nameZh : country?.nameEn; return this.isChinese ? country?.nameZh : country?.nameEn
}, },
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
this.loading = true; this.loading = true
// 处理查询参数 // 处理查询参数
let params = { ...this.queryParams, ...this.combinedQueryParams }; let params = { ...this.queryParams, ...this.combinedQueryParams }
this.addBeginAndEndTime( this.addBeginAndEndTime(params, this.dateRangeCreateTime, "createTime", false)
params,
this.dateRangeCreateTime,
"createTime",
false
);
// 执行查询 // 执行查询
getMyCustomerService(params).then((response) => { getMyCustomerService(params).then((response) => {
this.list = response.data.list; this.list = response.data.list
this.total = response.data.total; this.total = response.data.total
this.loading = false; this.loading = false
}); })
}, },
remoteMethod(val) { remoteMethod(val) {
this.getCustomerSelect(val); this.getCustomerSelect(val)
}, },
getCustomerSelect(val = "") { getCustomerSelect(val = "") {
getCustomerSelect({ pageNo: 1, pageSize: 30, searchKey: val }).then( getCustomerSelect({ pageNo: 1, pageSize: 30, searchKey: val }).then((res) => {
(res) => { this.customerSelect = res.data.list
this.customerSelect = res.data.list; })
}
);
}, },
handleSelectProductType(val) { handleSelectProductType(val) {
if (val && val.length >= 1) { if (val && val.length >= 1) {
this.queryParams.productIds = [] this.queryParams.productIds = []
getProductList({ typeIds: val }).then((r) => { getProductList({ typeIds: val }).then((r) => {
this.productList = r.data this.productList = r.data
}); })
} else { } else {
this.queryParams.productIds = [] this.queryParams.productIds = []
this.productList = [] this.productList = []
...@@ -1051,8 +671,8 @@ export default { ...@@ -1051,8 +671,8 @@ export default {
}, },
/** 取消按钮 */ /** 取消按钮 */
cancel() { cancel() {
this.open = false; this.open = false
this.reset(); this.reset()
}, },
/** 表单重置 */ /** 表单重置 */
reset() { reset() {
...@@ -1091,47 +711,47 @@ export default { ...@@ -1091,47 +711,47 @@ export default {
taxRate: undefined, taxRate: undefined,
remarks: undefined, remarks: undefined,
arrivalConfirm: undefined, arrivalConfirm: undefined,
weightUnit: undefined, weightUnit: undefined
}; }
this.resetForm("form"); this.resetForm("form")
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNo = 1; this.queryParams.pageNo = 1
this.getList(); this.getList()
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.dateRangeCreateTime = []; this.dateRangeCreateTime = []
this.enterOpenSeaTime = [] this.enterOpenSeaTime = []
this.customerServiceConfirmedTime = [] this.customerServiceConfirmedTime = []
this.firstDealTime = [] this.firstDealTime = []
this.resetForm("queryForm"); this.resetForm("queryForm")
this.queryParams = { this.queryParams = {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10
}; }
this.weightYearly.value = ""; this.weightYearly.value = ""
this.numYearly.value = ""; this.numYearly.value = ""
this.handleQuery(); this.handleQuery()
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.$router.push({ this.$router.push({
path: "/customer/add-edit/0", path: "/customer/add-edit/0",
query: { isCustomerServiceConfirmed: true }, query: { isCustomerServiceConfirmed: true }
}); })
// this.reset(); // this.reset();
// this.open = true; // this.open = true;
// this.title = this.$t("添加客户"); // this.title = this.$t("添加客户");
}, },
/** 查看按钮操作 */ /** 查看按钮操作 */
handleView(row) { handleView(row) {
this.$router.push("/customer/query/" + row.id); this.$router.push("/customer/query/" + row.id)
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.$router.push("/customer/add-edit/" + row.id); this.$router.push("/customer/add-edit/" + row.id)
// this.reset(); // this.reset();
// const id = row.id; // const id = row.id;
// getCustomer(id).then(response => { // getCustomer(id).then(response => {
...@@ -1145,23 +765,22 @@ export default { ...@@ -1145,23 +765,22 @@ export default {
//lanbm 2024-05-26 添加的报价功能按钮 //lanbm 2024-05-26 添加的报价功能按钮
// 添加报价是判断客户所属客户经理,不是就不能报价 // 添加报价是判断客户所属客户经理,不是就不能报价
if (row.customerService != this.userId) { if (row.customerService != this.userId) {
this.$message.error(this.$t("此客户属于其他客户经理名下的客户。")); this.$message.error(this.$t("此客户属于其他客户经理名下的客户。"))
return; return
} }
//this.$router.push({path:'/offer/create',query:{id:row.id}}) //this.$router.push({path:'/offer/create',query:{id:row.id}})
this.$router
.push({ path: "/offer/create", query: { customer: row, type: 1 } }) this.$router.push({ path: "/offer/create", query: { customerId: row.id, customerType: row.type, type: 1 } }).then({
.then({
//this.$refs.push({path:'/customer-contacts/select',query:{pageNo:1,pageSize:10,searchKey:row.defaultContactPhone}}) //this.$refs.push({path:'/customer-contacts/select',query:{pageNo:1,pageSize:10,searchKey:row.defaultContactPhone}})
}); })
}, },
selectAuthorityFn() { selectAuthorityFn() {
return (val) => { return (val) => {
let t = val.split(":"); let t = val.split(":")
t[t.length - 1] = this.authorityFn + t[t.length - 1]; t[t.length - 1] = this.authorityFn + t[t.length - 1]
//console.log(t.join(":")); //console.log(t.join(":"));
return t.join(":"); return t.join(":")
}; }
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
...@@ -1172,37 +791,33 @@ export default { ...@@ -1172,37 +791,33 @@ export default {
// 修改的提交 // 修改的提交
if (this.form.id != null) { if (this.form.id != null) {
updateCustomer(this.form).then((response) => { updateCustomer(this.form).then((response) => {
this.$modal.msgSuccess(this.$t("修改成功")); this.$modal.msgSuccess(this.$t("修改成功"))
this.open = false; this.open = false
this.getList(); this.getList()
}); })
return; return
} }
// 添加的提交 // 添加的提交
createCustomer(this.form).then((response) => { createCustomer(this.form).then((response) => {
this.$modal.msgSuccess(this.$t("新增成功")); this.$modal.msgSuccess(this.$t("新增成功"))
this.open = false; this.open = false
this.getList(); this.getList()
}); })
}); })
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const id = row.id; const id = row.id
this.$modal this.$modal
.confirm( .confirm(this.$t('是否确认删除客户编号为"') + row.number + this.$t('"的数据项?'))
this.$t('是否确认删除客户编号为"') +
row.number +
this.$t('"的数据项?')
)
.then(function () { .then(function () {
return deleteCustomer(id); return deleteCustomer(id)
}) })
.then(() => { .then(() => {
this.getList(); this.getList()
this.$modal.msgSuccess(this.$t("删除成功")); this.$modal.msgSuccess(this.$t("删除成功"))
}) })
.catch(() => {}); .catch(() => {})
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
...@@ -1216,82 +831,80 @@ export default { ...@@ -1216,82 +831,80 @@ export default {
.confirm(this.$t("是否确认导出我的客户数据项?")) .confirm(this.$t("是否确认导出我的客户数据项?"))
.then(() => { .then(() => {
mineExportExcel().then(() => { mineExportExcel().then(() => {
this.$message.success( this.$message.success(this.$t("已加入导出队列,请稍后在下载日志中下载"))
this.$t("已加入导出队列,请稍后在下载日志中下载") })
);
});
}) })
.catch(() => {}); .catch(() => {})
}, },
followUp(row) { followUp(row) {
this.customerId = row.id; this.customerId = row.id
// this.$refs["customerFollowList"].customerFollow.dialogVisible = true; this.customerService = row.customerService
this.customerService = row.customerService; this.customerNumber = row.number
this.customerNumber = row.number;
this.customerFollowVisible = true this.customerFollowVisible = true
this.$nextTick(_ => { this.$nextTick((_) => {
this.$refs['customerFollowList'].init() // this.$refs.CustomerFollowList.customerFollow.dialogVisible = true;
this.$refs['customerFollowList'].handleAdd() this.$refs["CustomerFollowList"].init()
this.$refs["CustomerFollowList"].handleAdd()
}) })
}, },
complaint(row) { complaint(row) {
this.customerId = row.id; this.customerId = row.id
this.$nextTick(() => { this.$nextTick(() => {
this.$refs["customerComplaint"].handleAdd(); this.$refs["customerComplaint"].handleAdd()
}); })
}, },
handleSetting(row) { handleSetting(row) {
this.$refs['customerSetting'].dialogVisible = true this.$refs["customerSetting"].dialogVisible = true
this.$nextTick(_ => { this.$nextTick((_) => {
this.$refs['customerSetting'].init(row.id) this.$refs["customerSetting"].init(row.id)
}) })
}, },
getBusiCountryNames(ids) { getBusiCountryNames(ids) {
if (ids) { if (ids) {
const idsArr = ids.split(',') const idsArr = ids.split(",")
const strArr = [] const strArr = []
this.countryList.forEach(item => { this.countryList.forEach((item) => {
if (idsArr.includes(item.id.toString())) { if (idsArr.includes(item.id.toString())) {
strArr.push(this.isChinese ? item.nameZh : item.nameEn) strArr.push(this.isChinese ? item.nameZh : item.nameEn)
} }
}) })
return strArr.length > 0 ? strArr.join(',') : null return strArr.length > 0 ? strArr.join(",") : null
} else { } else {
return null return null
} }
}, },
getPickupPointNames(ids) { getPickupPointNames(ids) {
if (ids) { if (ids) {
const idsArr = ids.split(',') const idsArr = ids.split(",")
const strArr = [] const strArr = []
this.getNodeLists.forEach(item => { this.getNodeLists.forEach((item) => {
if (idsArr.includes(item.id.toString())) { if (idsArr.includes(item.id.toString())) {
strArr.push(this.isChinese ? item.titleZh : item.titleEn) strArr.push(this.isChinese ? item.titleZh : item.titleEn)
} }
}) })
return strArr.length > 0 ? strArr.join(',') : null return strArr.length > 0 ? strArr.join(",") : null
} else { } else {
return null return null
} }
}, },
getProductTypeNames(ids) { getProductTypeNames(ids) {
if (ids) { if (ids) {
const idsArr = ids.toString().split(',') const idsArr = ids.toString().split(",")
const strArr = [] const strArr = []
this.productTypeList.forEach(item => { this.productTypeList.forEach((item) => {
if (idsArr.includes(item.id.toString())) { if (idsArr.includes(item.id.toString())) {
strArr.push(this.isChinese ? item.titleZh : item.titleEn) strArr.push(this.isChinese ? item.titleZh : item.titleEn)
} }
}) })
return strArr.length > 0 ? strArr.join(',') : null return strArr.length > 0 ? strArr.join(",") : null
} else { } else {
return null return null
} }
}, },
getPromoterName(id) { getPromoterName(id) {
if (id) { if (id) {
let strName = '' let strName = ""
for(const item of this.customerSelectFn) { for (const item of this.customerSelectFn) {
if (item.id == id) { if (item.id == id) {
strName = item.name strName = item.name
break break
...@@ -1306,10 +919,10 @@ export default { ...@@ -1306,10 +919,10 @@ export default {
watch: { watch: {
selectCustomerList(val) { selectCustomerList(val) {
if (val.length === 0) { if (val.length === 0) {
this.getList(); this.getList()
this.$refs.multipleTable.clearSelection(); this.$refs.multipleTable.clearSelection()
} }
}, }
}, }
}; }
</script> </script>
...@@ -503,11 +503,12 @@ ...@@ -503,11 +503,12 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('客户类别')" align="center" prop="status"> <el-table-column :label="$t('客户类别')" align="center" prop="status">
<template slot-scope="scope"> <template slot-scope="{ row }">
<dict-tag {{ getDictDatas2(DICT_TYPE.CUSTOMER_TYPE, (row.type||'').split(',')).map(e => isChinese ? e.label : e.labelEn).join(', ')}}
:type="DICT_TYPE.CUSTOMER_TYPE" <!-- <dict-tag-->
:value="scope.row.type" <!-- :type="DICT_TYPE.CUSTOMER_TYPE"-->
/> <!-- :value="scope.row.type"-->
<!-- />-->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('角色')" align="center" prop="status"> <el-table-column :label="$t('角色')" align="center" prop="status">
......
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form <el-form ref="form" :model="form" :rules="rules" label-width="120px" inline :validate-on-rule-change="false">
ref="form"
:model="form"
:rules="rules"
label-width="120px"
inline
:validate-on-rule-change="false"
>
<el-card> <el-card>
<div slot="header" class="card-title"> <div slot="header" class="card-title">
{{ {{ $route.path.indexOf("create") > -1 ? $t("新建报价单") : $t("编辑报价单") }}
$route.path.indexOf("create") > -1
? $t("新建报价单")
: $t("编辑报价单")
}}
</div> </div>
<el-form-item :label="$t('所属人')" prop="relation"> <el-form-item :label="$t('所属人')" prop="relation">
<!-- <el-radio-group v-model="form.relation" > --> <!-- <el-radio-group v-model="form.relation" > -->
...@@ -26,59 +15,28 @@ ...@@ -26,59 +15,28 @@
<div class="form-section"> <div class="form-section">
<el-form-item :label="$t('发货人')" prop="consignorId"> <el-form-item :label="$t('发货人')" prop="consignorId">
<div class="contact"> <div class="contact">
<el-input <el-input v-model="form.consignorName" id="defaultContactName" :placeholder="$t('选择或新建')" disabled style="width: 120px" />
v-model="form.consignorName"
id="defaultContactName"
:placeholder="$t('选择或新建')"
disabled
style="width: 120px"
/>
<img <img src="@/assets/svg/contacts.svg" class="phonebook" @click="contactChooseType = 'consignor'" />
src="@/assets/svg/contacts.svg" <img src="@/assets/svg/contact_create.svg" class="phonebook" @click="quickCreateType = '0'" />
class="phonebook"
@click="contactChooseType = 'consignor'"
/>
<img
src="@/assets/svg/contact_create.svg"
class="phonebook"
@click="quickCreateType = '0'"
/>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item :label="$t('发货人电话')" prop="consignorPhone"> <el-form-item :label="$t('发货人电话')" prop="consignorPhone">
<!-- <area-code-selector v-model="form.consignorCountryCode" class="w-200 mr-10" disabled /> --> <!-- <area-code-selector v-model="form.consignorCountryCode" class="w-200 mr-10" disabled /> -->
<el-input <el-input id="defaultContactPhone" :value="`${form.consignorCountryCode ? '+' + form.consignorCountryCode : ''} ${form.consignorPhone || ''}`" class="w-200" disabled />
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-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-input v-else :value="`${form.consignorCountryCode ? '+' + form.consignorCountryCode : ''} ${form.consignorPhone || ''}`" class="w-200" disabled/> -->
</el-form-item> </el-form-item>
<el-form-item :label="$t('发货人公司')" prop="consignorCompany"> <el-form-item :label="$t('发货人公司')" prop="consignorCompany">
<!-- 修改从客户列表按钮进来的 --> <!-- 修改从客户列表按钮进来的 -->
<el-input <el-input v-model="form.consignorCompany" id="company" disabled class="w-200" />
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-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-input v-else v-model="form.consignorCompany" disabled class="w-200"/> -->
</el-form-item> </el-form-item>
<el-form-item label="Email" prop="consignorEmail"> <el-form-item label="Email" prop="consignorEmail">
<el-input <el-input v-model="form.consignorEmail" id="defaultEmail" disabled class="w-200" />
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-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-input v-else v-model="form.consigneeEmail" disabled class="w-200"/> -->
</el-form-item> </el-form-item>
...@@ -87,54 +45,23 @@ ...@@ -87,54 +45,23 @@
<el-form-item :label="$t('收货人')" prop="consigneeId"> <el-form-item :label="$t('收货人')" prop="consigneeId">
<div class="contact"> <div class="contact">
<!-- <el-input v-model="form.consigneeName" :placeholder="$t('请选择或新建')" :disabled="true" style="width:120px"/> --> <!-- <el-input v-model="form.consigneeName" :placeholder="$t('请选择或新建')" :disabled="true" style="width:120px"/> -->
<el-input <el-input v-model="form.consigneeName" id="defaultContactName2" :placeholder="$t('请选择或新建')" :disabled="true" style="width: 120px" />
v-model="form.consigneeName"
id="defaultContactName2"
:placeholder="$t('请选择或新建')"
:disabled="true"
style="width: 120px"
/>
<img <img src="@/assets/svg/contacts.svg" class="phonebook" @click="contactChooseType = 'consignee'" />
src="@/assets/svg/contacts.svg" <img src="@/assets/svg/contact_create.svg" class="phonebook" @click="quickCreateType = '1'" />
class="phonebook"
@click="contactChooseType = 'consignee'"
/>
<img
src="@/assets/svg/contact_create.svg"
class="phonebook"
@click="quickCreateType = '1'"
/>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item :label="$t('收货人电话')" prop="consigneePhone"> <el-form-item :label="$t('收货人电话')" prop="consigneePhone">
<!-- <area-code-selector v-model="form.consigneeCountryCode" class="w-200 mr-10" disabled/> --> <!-- <area-code-selector v-model="form.consigneeCountryCode" class="w-200 mr-10" disabled/> -->
<el-input <el-input id="defaultContactPhone2" :value="`${form.consigneeCountryCode ? '+' + form.consigneeCountryCode : ''} ${form.consigneePhone || ''}`" disabled class="w-200" />
id="defaultContactPhone2"
:value="`${
form.consigneeCountryCode ? '+' + form.consigneeCountryCode : ''
} ${form.consigneePhone || ''}`"
disabled
class="w-200"
/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('收货人公司')" prop="consigneeCompany"> <el-form-item :label="$t('收货人公司')" prop="consigneeCompany">
<el-input <el-input id="company2" v-model="form.consigneeCompany" :disabled="true" class="w-200" />
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-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-input v-else v-model="form.consignorCompany" disabled class="w-200"/> -->
</el-form-item> </el-form-item>
<el-form-item label="Email" prop="consigneeEmail"> <el-form-item label="Email" prop="consigneeEmail">
<el-input <el-input id="defaultEmail2" v-model="form.consigneeEmail" :disabled="true" class="w-200" />
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-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-input v-else v-model="form.consigneeEmail" disabled class="w-200"/> -->
</el-form-item> </el-form-item>
...@@ -175,133 +102,50 @@ ...@@ -175,133 +102,50 @@
</el-descriptions> --> </el-descriptions> -->
</el-card> </el-card>
<el-card class="mt-10"> <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"> <div class="form-section">
<el-form-item :label="$t('运输方式')" prop="transportId"> <el-form-item :label="$t('运输方式')" prop="transportId">
<dict-selector <dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model="form.transportId" class="w-200" />
:type="DICT_TYPE.ECW_TRANSPORT_TYPE"
v-model="form.transportId"
class="w-200"
/>
</el-form-item> </el-form-item>
</div> </div>
<div class="form-section"> <div class="form-section">
<el-form-item :label="$t('始发城市')" prop="departureId"> <el-form-item :label="$t('始发城市')" prop="departureId">
<el-select <el-select v-model="form.departureId" :placeholder="$t('请选择始发地')" class="w-200">
v-model="form.departureId" <el-option v-for="item in exportCityList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
: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-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('目的国')" prop="destCountryId"> <el-form-item :label="$t('目的国')" prop="destCountryId">
<el-select <el-select v-model="form.destCountryId" :placeholder="$t('请选择目的国')" class="w-200">
v-model="form.destCountryId" <el-option v-for="item in AddressProvince" :key="item.guojia" :label="item.guojiaName" :value="item.guojia" />
:placeholder="$t('请选择目的国')"
class="w-200"
>
<el-option
v-for="item in AddressProvince"
:key="item.guojia"
:label="item.guojiaName"
:value="item.guojia"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('目的城市')" prop="objectiveId"> <el-form-item :label="$t('目的城市')" prop="objectiveId">
<el-select <el-select v-model="form.objectiveId" :placeholder="$t('请选择目的地')" class="w-200">
v-model="form.objectiveId" <el-option v-for="item in AddressCity" :key="item.shi" :label="item.shiName" :value="item.shi" />
:placeholder="$t('请选择目的地')"
class="w-200"
>
<el-option
v-for="item in AddressCity"
:key="item.shi"
:label="item.shiName"
:value="item.shi"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</div> </div>
<div class="form-section"> <div class="form-section">
<el-form-item :label="$t('选择线路')" prop="lineId"> <el-form-item :label="$t('选择线路')" prop="lineId">
<!-- <el-input :value="getRouterNameById(form.lineId)" readonly :placeholder="$t('请在右侧选择线路')"></el-input> --> <!-- <el-input :value="getRouterNameById(form.lineId)" readonly :placeholder="$t('请在右侧选择线路')"></el-input> -->
<el-input <el-input :value="selectedRouter ? $l(selectedRouter, 'startTitle') + ' > ' + $l(selectedRouter, 'destTitle') : ''" disabled :placeholder="$t('请在右侧选择线路')" class="w-200"></el-input>
:value="
selectedRouter
? $l(selectedRouter, 'startTitle') +
' > ' +
$l(selectedRouter, 'destTitle')
: ''
"
disabled
:placeholder="$t('请在右侧选择线路')"
class="w-200"
></el-input>
</el-form-item> </el-form-item>
<select <select size="5" v-model="form.lineId" style="min-width: 300px; border: 1px solid #dcdfe6; border-radius: 4px">
size="5"
v-model="form.lineId"
style="
min-width: 300px;
border: 1px solid #dcdfe6;
border-radius: 4px;
"
>
<template v-for="item in routerList"> <template v-for="item in routerList">
<option :value="item.id" :key="item.id"> <option :value="item.id" :key="item.id">{{ $l(item, "startTitle") }} >> {{ $l(item, "destTitle") }}</option>
{{ $l(item, "startTitle") }} >> {{ $l(item, "destTitle") }}
</option>
</template> </template>
</select> </select>
</div> </div>
<div class="form-section"> <div class="form-section">
<el-form-item <el-form-item :label="$t('出货渠道')" v-if="getDictData(DICT_TYPE.ECW_TRANSPORT_TYPE, form.transportId).cssClass == 'channel'" prop="channelId">
:label="$t('出货渠道')" <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>
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> </el-form-item>
</div> </div>
<div class="form-section"> <div class="form-section">
<el-form-item <el-form-item :label="$t('增值服务')" v-if="routeOtherServices.indexOf('1') > -1 || routeOtherServices.indexOf('4') > -1">
:label="$t('增值服务')"
v-if="
routeOtherServices.indexOf('1') > -1 ||
routeOtherServices.indexOf('4') > -1
"
>
<el-checkbox-group v-model="form.type"> <el-checkbox-group v-model="form.type">
<el-checkbox <el-checkbox label="1" v-if="routeOtherServices.indexOf('1') > -1">{{ $t("集运服务") }}</el-checkbox>
label="1" <el-checkbox label="2" v-if="routeOtherServices.indexOf('4') > -1">{{ $t("海外仓") }}</el-checkbox>
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-checkbox-group>
</el-form-item> </el-form-item>
</div> </div>
...@@ -309,13 +153,7 @@ ...@@ -309,13 +153,7 @@
<el-card class="mt-10"> <el-card class="mt-10">
<div slot="header" class="card-title"> <div slot="header" class="card-title">
<div class="card-name">{{ $t("商品") }}</div> <div class="card-name">{{ $t("商品") }}</div>
<el-button <el-button type="primary" size="mini" icon="el-icon-plus" @click="addProduct()" :disabled="!canAddProduct"></el-button>
type="primary"
size="mini"
icon="el-icon-plus"
@click="addProduct()"
:disabled="!canAddProduct"
></el-button>
</div> </div>
<el-table :data="form.prodCreateReqVOList" border class="product-list"> <el-table :data="form.prodCreateReqVOList" border class="product-list">
<el-table-column :label="$t('序号')" width="60px" fixed> <el-table-column :label="$t('序号')" width="60px" fixed>
...@@ -324,9 +162,7 @@ ...@@ -324,9 +162,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('中文品名')" width="160px"> <el-table-column :label="$t('中文品名')" width="160px">
<template slot="header" slot-scope="scope"> <template slot="header" slot-scope="scope"> {{ $t("中文品名") }} <span class="red">*</span> </template>
{{ $t("中文品名") }} <span class="red">*</span>
</template>
<template slot-scope="scope"> <template slot-scope="scope">
<el-form-item <el-form-item
label="" label=""
...@@ -334,35 +170,22 @@ ...@@ -334,35 +170,22 @@
:rules="{ :rules="{
required: true, required: true,
message: $t('请选择产品'), message: $t('请选择产品'),
trigger: 'blur', trigger: 'blur'
}" }"
class="mb-0 mr-0" class="mb-0 mr-0"
> >
<product-selector <product-selector v-model="scope.row.prodId" @change="onProductChange(scope.row, $event)" :disabled="!canAddProduct" />
v-model="scope.row.prodId"
@change="onProductChange(scope.row, $event)"
:disabled="!canAddProduct"
/>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('英文品名')" width="160px"> <el-table-column :label="$t('英文品名')" width="160px">
<template slot="header" slot-scope="scope"> <template slot="header" slot-scope="scope"> {{ $t("英文品名") }} <span class="red">*</span> </template>
{{ $t("英文品名") }} <span class="red">*</span>
</template>
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<product-selector <product-selector lang="En" v-model="row.prodId" @change="onProductChange(row, $event)" :disabled="!canAddProduct" />
lang="En"
v-model="row.prodId"
@change="onProductChange(row, $event)"
:disabled="!canAddProduct"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="100px"> <el-table-column width="100px">
<template slot="header" slot-scope="scope"> <template slot="header" slot-scope="scope"> {{ $t("品牌") }} <span class="red">*</span> </template>
{{ $t("品牌") }} <span class="red">*</span>
</template>
<template slot-scope="scope"> <template slot-scope="scope">
<el-form-item <el-form-item
label="" label=""
...@@ -370,78 +193,44 @@ ...@@ -370,78 +193,44 @@
:rules="{ :rules="{
required: true, required: true,
message: $t('请选择品牌'), message: $t('请选择品牌'),
trigger: 'blur', trigger: 'blur'
}" }"
class="mb-0 mr-0" class="mb-0 mr-0"
> >
<dict-selector <dict-selector v-model="scope.row.brand" :type="DICT_TYPE.ECW_IS_BRAND" defaultable @input="calculationPrice" :disabled="!canAddProduct" />
v-model="scope.row.brand"
:type="DICT_TYPE.ECW_IS_BRAND"
defaultable
@input="calculationPrice"
:disabled="!canAddProduct"
/>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('件数')" width="90px"> <el-table-column :label="$t('件数')" width="90px">
<template slot="header" slot-scope="scope"> <template slot="header" slot-scope="scope"> {{ $t("件数") }} <span class="red">*</span> </template>
{{ $t("件数") }} <span class="red">*</span>
</template>
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<el-input <el-input v-model.number="row.num" @input="calculationPrice" :disabled="!canAddProduct" />
v-model.number="row.num"
@input="calculationPrice"
:disabled="!canAddProduct"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('包装单位')" width="100px"> <el-table-column :label="$t('包装单位')" width="100px">
<template slot="header" slot-scope="scope"> <template slot="header" slot-scope="scope"> {{ $t("包装单位") }} <span class="red">*</span> </template>
{{ $t("包装单位") }} <span class="red">*</span>
</template>
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<dict-selector <dict-selector v-model="row.unit" :type="DICT_TYPE.ECW_PACKAGING_TYPE" defaultable @input="calculationPrice" :disabled="!canAddProduct" />
v-model="row.unit"
:type="DICT_TYPE.ECW_PACKAGING_TYPE"
defaultable
@input="calculationPrice"
:disabled="!canAddProduct"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('数量') + '(个)'"> <el-table-column :label="$t('数量') + '(个)'">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<el-input <el-input v-model="row.quantity" @input="calculationPrice" :disabled="!canAddProduct" />
v-model="row.quantity"
@input="calculationPrice"
:disabled="!canAddProduct"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('总体积') + '(m³)'" width="100px"> <el-table-column :label="$t('总体积') + '(m³)'" width="100px">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<el-input <el-input v-model="row.volume" @input="calculationPrice" :disabled="!canAddProduct" />
v-model="row.volume"
@input="calculationPrice"
:disabled="!canAddProduct"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('总重量') + '(kg)'" width="100px"> <el-table-column :label="$t('总重量') + '(kg)'" width="100px">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<el-input <el-input v-model="row.weight" @input="calculationPrice" :disabled="!canAddProduct" />
v-model="row.weight"
@input="calculationPrice"
:disabled="!canAddProduct"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('总货值') + '(RMB)'" width="120px"> <el-table-column :label="$t('总货值') + '(RMB)'" width="120px">
<template slot="header" slot-scope="scope"> <template slot="header" slot-scope="scope"> {{ $t("总货值") }}(RMB) <span class="red">*</span> </template>
{{ $t("总货值") }}(RMB) <span class="red">*</span>
</template>
<template slot-scope="scope"> <template slot-scope="scope">
<el-form-item <el-form-item
label="" label=""
...@@ -451,57 +240,34 @@ ...@@ -451,57 +240,34 @@
}" }"
class="mb-0 mr-0" class="mb-0 mr-0"
> >
<el-input <el-input v-model="scope.row.worth" @input="calculationPrice" :disabled="!canAddProduct" />
v-model="scope.row.worth"
@input="calculationPrice"
:disabled="!canAddProduct"
/>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('商品特性')" width="250px"> <el-table-column :label="$t('商品特性')" width="250px">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<el-checkbox-group <el-checkbox-group v-model="row.prodAttrArr" @change="onProductAttrChange(row, $event)" :disabled="!canAddProduct">
v-model="row.prodAttrArr" <el-checkbox v-for="item in productAttrList" :label="item.id" :key="item.id">{{ $l(item, "attrName") }}</el-checkbox>
@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> </el-checkbox-group>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('运费')" width="200px"> <el-table-column :label="$t('运费')" width="200px">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<template v-if="row.fee && row.fee.charging == 1"> <template v-if="row.fee && row.fee.charging == 1">
<template v-if="!row.fee.oneFreight">{{ <template v-if="!row.fee.oneFreight">{{ $t("未报价") }}</template>
$t("未报价")
}}</template>
<template v-else> <template v-else>
{{ $t("全包价") }}{{ row.fee.oneFreight }} {{ $t("全包价") }}{{ row.fee.oneFreight }} {{ currencyMap[row.fee.freightCurrency] }} /
{{ currencyMap[row.fee.freightCurrency] }} /
{{ unitMap[row.fee.freightVolume] }} {{ unitMap[row.fee.freightVolume] }}
</template> </template>
</template> </template>
<template <template v-else-if="!row.fee || (!row.fee.oneFreight && !row.fee.oneClearanceFee)">{{ $t("未报价") }}</template>
v-else-if="
!row.fee || (!row.fee.oneFreight && !row.fee.oneClearanceFee)
"
>{{ $t("未报价") }}</template
>
<template v-else-if="row.fee"> <template v-else-if="row.fee">
<div> <div>
{{ $t("运费") }}{{ row.fee.oneFreight }} {{ $t("运费") }}{{ row.fee.oneFreight }} {{ currencyMap[row.fee.freightCurrency] }} /
{{ currencyMap[row.fee.freightCurrency] }} /
{{ unitMap[row.fee.freightVolume] }} {{ unitMap[row.fee.freightVolume] }}
</div> </div>
<div> <div>
{{ $t("清关费") }}{{ row.fee.oneClearanceFee }} {{ $t("清关费") }}{{ row.fee.oneClearanceFee }} {{ currencyMap[row.fee.clearanceFeeCurrency] }} /
{{ currencyMap[row.fee.clearanceFeeCurrency] }} /
{{ unitMap[row.fee.clearanceFeeVolume] }} {{ unitMap[row.fee.clearanceFeeVolume] }}
</div> </div>
</template> </template>
...@@ -509,49 +275,25 @@ ...@@ -509,49 +275,25 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('是否预付')"> <el-table-column :label="$t('是否预付')">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<dict-tag <dict-tag v-if="row.fee" :type="DICT_TYPE.ECW_PAY_ADVANCE" :value="row.fee.isPayAdvance" />
v-if="row.fee"
:type="DICT_TYPE.ECW_PAY_ADVANCE"
:value="row.fee.isPayAdvance"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('商品链接')" width="200px" align="center"> <el-table-column :label="$t('商品链接')" width="200px" align="center">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<el-link <el-link type="primary" :href="row.link" target="_blank" style="display: block">{{ row.link }}</el-link>
type="primary" <el-button type="primary" size="mini" @click="setLink(row)" :disabled="!canAddProduct">
: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("添加商品链接") }} {{ row.link ? $t("编辑商品链接") : $t("添加商品链接") }}
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('快递单号')" width="100px"> <el-table-column :label="$t('快递单号')" width="100px">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<el-input <el-input v-model="row.expressNo" placeholder="" :disabled="!canAddProduct" />
v-model="row.expressNo"
placeholder=""
:disabled="!canAddProduct"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('操作')" width="180px" fixed="right"> <el-table-column :label="$t('操作')" width="180px" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button size="mini" type="danger" @click="delProduct(scope.$index)">{{ $t("删除") }}</el-button>
size="mini"
type="danger"
@click="delProduct(scope.$index)"
>{{ $t("删除") }}</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -563,19 +305,13 @@ ...@@ -563,19 +305,13 @@
<el-descriptions-item :label="$t('总件数')"> <el-descriptions-item :label="$t('总件数')">
{{ sum.totalNum.toFixed() || 0 }} {{ sum.totalNum.toFixed() || 0 }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :label="$t('总体积')"> <el-descriptions-item :label="$t('总体积')"> {{ sum.totalVolume.toFixed() || 0 }}m³ </el-descriptions-item>
{{ sum.totalVolume.toFixed() || 0 }}m³ <el-descriptions-item :label="$t('总重量')"> {{ sum.totalWeight.toFixed() || 0 }}kg </el-descriptions-item>
</el-descriptions-item>
<el-descriptions-item :label="$t('总重量')">
{{ sum.totalWeight.toFixed() || 0 }}kg
</el-descriptions-item>
<el-descriptions-item :label="$t('总数量')"> <el-descriptions-item :label="$t('总数量')">
{{ sum.totalQuatity.toFixed() || 0 }} {{ sum.totalQuatity.toFixed() || 0 }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :label="$t('总货值') + '(RMB)'"> <el-descriptions-item :label="$t('总货值') + '(RMB)'"> {{ sum.totalWorth.toFixed() || 0 }}{{ $t("元") }} </el-descriptions-item>
{{ sum.totalWorth.toFixed() || 0 }}{{ $t("元") }}
</el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-card> </el-card>
...@@ -585,47 +321,26 @@ ...@@ -585,47 +321,26 @@
<el-descriptions :column="5" border> <el-descriptions :column="5" border>
<el-descriptions-item :label="$t('保价费')"> <el-descriptions-item :label="$t('保价费')">
{{ fee.insuranceFee || 0 }} {{ fee.insuranceFee || 0 }}
{{ {{ selectedRouter ? currencyMap[selectedRouter.currencyUnit || 1] : "" }}
selectedRouter
? currencyMap[selectedRouter.currencyUnit || 1]
: ""
}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :label="$t('总运费')"> <el-descriptions-item :label="$t('总运费')">
<template v-for="item in freightFeeList"> <template v-for="item in freightFeeList">
<div :key="item.currencyId"> <div :key="item.currencyId">{{ item.amount || 0 }}{{ currencyMap[item.currencyId] }}</div>
{{ item.amount || 0 }}{{ currencyMap[item.currencyId] }}
</div>
</template> </template>
</el-descriptions-item> </el-descriptions-item>
<!--代收货款,只有非控货订单、并且线路开通了代收货款后,才显示是否代收货款选项--> <!--代收货款,只有非控货订单、并且线路开通了代收货款后,才显示是否代收货款选项-->
<el-descriptions-item :label="$t('总清关费')"> <el-descriptions-item :label="$t('总清关费')">
<template v-for="item in clearanceFeeList"> <template v-for="item in clearanceFeeList">
<div :key="item.currencyId"> <div :key="item.currencyId">{{ item.amount || 0 }}{{ currencyMap[item.currencyId] }}</div>
{{ item.amount || 0 }}{{ currencyMap[item.currencyId] }}
</div>
</template> </template>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :label="$t('其他费用')"> <el-descriptions-item :label="$t('其他费用')">
<el-input <el-input v-model="form.otherFee" placeholder="" class="w-100 mr-10"></el-input>
v-model="form.otherFee" <selector v-model="form.otherFeeCurrencyId" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable class="w-100" />
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>
<el-descriptions-item :label="$t('原价')" :span="2"> <el-descriptions-item :label="$t('原价')" :span="2">
<template v-for="item in originalFeeList"> <template v-for="item in originalFeeList">
<div :key="item.currencyId"> <div :key="item.currencyId">{{ item.amount || 0 }}{{ currencyMap[item.currencyId] }}</div>
{{ item.amount || 0 }}{{ currencyMap[item.currencyId] }}
</div>
</template> </template>
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
...@@ -633,11 +348,7 @@ ...@@ -633,11 +348,7 @@
<div class="card-title" style="padding: 20px 0"> <div class="card-title" style="padding: 20px 0">
{{ $t("优惠信息") }} {{ $t("优惠信息") }}
</div> </div>
<el-table <el-table :data="couponList" :show-header="false" :empty-text="$t('暂无优惠')">
:data="couponList"
:show-header="false"
:empty-text="$t('暂无优惠')"
>
<el-table-column label=""> <el-table-column label="">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.$index + 1 }}. {{ scope.$index + 1 }}.
...@@ -661,32 +372,18 @@ ...@@ -661,32 +372,18 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label=""> <el-table-column label="">
<template slot-scope="{ row }"> <template slot-scope="{ row }"> {{ $t("有效期至") }}{{ row.endTime ? row.endTime : $t("永久有效") }} </template>
{{ $t("有效期至") }}{{
row.endTime ? row.endTime : $t("永久有效")
}}
</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-descriptions :column="1" class="mt-20"> <el-descriptions :column="1" class="mt-20">
<el-descriptions-item <el-descriptions-item :label="$t('优惠费用')" v-if="couponTotalAmountList && couponTotalAmountList.length">
:label="$t('优惠费用')" <div v-for="(item, discountIndex) in couponTotalAmountList" :key="discountIndex">{{ item.totalAmount }} {{ currencyMap[item.currencyId] }}</div>
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>
<el-descriptions-item :label="$t('预计费用')" :span="1"> <el-descriptions-item :label="$t('预计费用')" :span="1">
<div> <div>
<template v-for="item in estimatedCosts"> <template v-for="item in estimatedCosts">
<div :key="item.currencyId"> <div :key="item.currencyId">{{ item.amount || 0 }}{{ currencyMap[item.currencyId] }}</div>
{{ item.amount || 0 }}{{ currencyMap[item.currencyId] }}
</div>
</template> </template>
</div> </div>
</el-descriptions-item> </el-descriptions-item>
...@@ -697,54 +394,25 @@ ...@@ -697,54 +394,25 @@
<div class="card-title" slot="header">{{ $t("通用") }}</div> <div class="card-title" slot="header">{{ $t("通用") }}</div>
<div class="form-section"> <div class="form-section">
<el-form-item :label="$t('唛头')" prop="marks"> <el-form-item :label="$t('唛头')" prop="marks">
<el-input <el-input v-model="form.marks" placeholder="" class="w-200"></el-input>
v-model="form.marks"
placeholder=""
class="w-200"
></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('报关方式')" prop="customsType"> <el-form-item :label="$t('报关方式')" prop="customsType">
<dict-selector <dict-selector :type="DICT_TYPE.ECW_CUSTOMS_TYPE" v-model="form.customsType" form-type="radio" defaultable />
:type="DICT_TYPE.ECW_CUSTOMS_TYPE"
v-model="form.customsType"
form-type="radio"
defaultable
/>
</el-form-item> </el-form-item>
</div> </div>
<div class="form-section"> <div class="form-section">
<el-form-item :label="$t('预计结束时间')" prop="stopTime"> <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 HH:mm:ss" class="w-200"></el-date-picker> -->
<el-date-picker <el-date-picker v-model="form.stopTime" value-format="yyyy-MM-dd" class="w-200" :picker-options="stopDate"></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>
<el-form-item :label="$t('是否控货')" prop="control"> <el-form-item :label="$t('是否控货')" prop="control">
<dict-selector <dict-selector :type="DICT_TYPE.INFRA_BOOLEAN_STRING" formatter="bool" v-model="form.control" form-type="radio" />
:type="DICT_TYPE.INFRA_BOOLEAN_STRING"
formatter="bool"
v-model="form.control"
form-type="radio"
/>
</el-form-item> </el-form-item>
</div> </div>
<div class="form-section"> <div class="form-section">
<el-form-item :label="$t('竞争对手')" prop="competitor"> <el-form-item :label="$t('竞争对手')" prop="competitor">
<el-select <el-select clearable v-model="form.competitor" :placeholder="$t('请选择')" class="w-200">
clearable <el-option v-for="item in competitorList" :key="item.id" :label="item.name" :value="item.id" />
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-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('重要程度')" prop="importance"> <el-form-item :label="$t('重要程度')" prop="importance">
...@@ -754,106 +422,57 @@ ...@@ -754,106 +422,57 @@
<div class="form-section"> <div class="form-section">
<el-form-item :label="$t('价格有效时间')" prop="startTime"> <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 HH:mm:ss" class="w-200"></el-date-picker> -->
<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>
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>
<el-form-item label="" prop="endTime"> <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 HH:mm:ss" class="w-200"></el-date-picker> -->
<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>
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>
<el-form-item :label="$t('交货方式')"> <el-form-item :label="$t('交货方式')">
<!-- <!--
接口要求数据为整数,所以增加trade_type类型的字典,用1234代码以下不同类型 接口要求数据为整数,所以增加trade_type类型的字典,用1234代码以下不同类型
FOB(离岸价),CIF(到岸价),CNF(成本加运费),EXW(出厂价) FOB(离岸价),CIF(到岸价),CNF(成本加运费),EXW(出厂价)
--> -->
<dict-selector <dict-selector :type="DICT_TYPE.ECW_TRADE_TYPE" fomtter="number" v-model="form.tradeType" class="w-200" />
:type="DICT_TYPE.ECW_TRADE_TYPE"
fomtter="number"
v-model="form.tradeType"
class="w-200"
/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('交货地址')"> <el-form-item :label="$t('交货地址')">
<el-input <el-input v-model="form.tradeAdress" :placeholder="$t('港口或地点')"></el-input>
v-model="form.tradeAdress"
:placeholder="$t('港口或地点')"
></el-input>
</el-form-item> </el-form-item>
</div> </div>
<div class="form-section"> <div class="form-section">
<el-form-item :label="$t('备注')" :span="2"> <el-form-item :label="$t('备注')" :span="2">
<el-input <el-input v-model="form.remarks" type="textarea" placeholder="" style="width: 500px; height: 100px"></el-input>
v-model="form.remarks"
type="textarea"
placeholder=""
style="width: 500px; height: 100px"
></el-input>
</el-form-item> </el-form-item>
</div> </div>
</el-card> </el-card>
<el-card class="mt-10" v-if="transport"> <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-form-item :label="$t('快递单号')">
<el-input v-model="form.number" :placeholder="$t('请输入购买商品的快递单号')"></el-input> <el-input v-model="form.number" :placeholder="$t('请输入购买商品的快递单号')"></el-input>
</el-form-item> --> </el-form-item> -->
<el-form-item :label="$t('特殊要求')"> <el-form-item :label="$t('特殊要求')">
<dict-selector <dict-selector v-model="form.transportVO.packageTypeArr" form-type="checkbox" :type="DICT_TYPE.ORDER_SPECIAL_NEEDS" multiple />
v-model="form.transportVO.packageTypeArr"
form-type="checkbox"
:type="DICT_TYPE.ORDER_SPECIAL_NEEDS"
multiple
/>
</el-form-item> </el-form-item>
<br /> <br />
<el-form-item :label="$t('特殊要求备注')"> <el-form-item :label="$t('特殊要求备注')">
<el-input v-model="form.transportVO.packageRemarks"></el-input> <el-input v-model="form.transportVO.packageRemarks"></el-input>
</el-form-item> </el-form-item>
<br /> <br />
<el-form-item <el-form-item :label="$t('是否双清')" v-if="[2, 3, 4].indexOf(+form.transportId) > -1">
:label="$t('是否双清')" <dict-selector v-model="form.transportVO.doubleClear" form-type="radio" :type="DICT_TYPE.ECW_DOUBLE_CLEAR" />
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>
<el-form-item <el-form-item :label="$t('航空公司')" v-if="[3, 4].indexOf(+form.transportId) > -1">
:label="$t('航空公司')"
v-if="[3, 4].indexOf(+form.transportId) > -1"
>
<!--待查询备选数据--> <!--待查询备选数据-->
<!-- <el-select placeholder="" v-model="form.airlineCompany"> <!-- <el-select placeholder="" v-model="form.airlineCompany">
</el-select> --> </el-select> -->
<supplier-selector <supplier-selector v-model="form.transportVO.airlineCompany" companyType="10" />
v-model="form.transportVO.airlineCompany"
companyType="10"
/>
</el-form-item> </el-form-item>
<el-form-item <el-form-item :label="$t('船公司')" v-if="[2].indexOf(+form.transportId) > -1">
:label="$t('船公司')"
v-if="[2].indexOf(+form.transportId) > -1"
>
<!-- <el-select placeholder="" v-model="form.shippingCompany"> <!-- <el-select placeholder="" v-model="form.shippingCompany">
</el-select> --> </el-select> -->
<supplier-selector <supplier-selector v-model="form.transportVO.shippingCompany" companyType="9" />
v-model="form.transportVO.shippingCompany"
companyType="9"
/>
</el-form-item> </el-form-item>
<!-- <!--
<div class="form-section"> <div class="form-section">
...@@ -904,71 +523,51 @@ ...@@ -904,71 +523,51 @@
}}</span> }}</span>
</el-form-item> </el-form-item>
--> -->
</el-card> </el-card>
<el-form-item label="" class="mt-20"> <el-form-item label="" class="mt-20">
<!-- 非草稿状态显示为编辑按钮 --> <!-- 非草稿状态显示为编辑按钮 -->
<el-button <el-button v-if="form.offerId && form.status != 2" type="primary" @click="submitForm(2)">{{ $t("编辑") }}</el-button>
v-if="form.offerId && form.status != 2"
type="primary"
@click="submitForm(2)"
>{{ $t("编辑") }}</el-button
>
<template v-else> <template v-else>
<el-button type="primary" @click="submitForm(2)">{{ <el-button type="primary" @click="submitForm(2)">{{ $t("保存草稿") }}</el-button>
$t("保存草稿")
}}</el-button>
<!-- 草稿 --> <!-- 草稿 -->
<el-button type="primary" @click="submitForm(3)">{{ <el-button type="primary" @click="submitForm(3)">{{ $t("确认报价") }}</el-button>
$t("确认报价")
}}</el-button>
<!-- 需求确认 --> <!-- 需求确认 -->
</template> </template>
<el-button @click="$store.dispatch('tagsView/delCurrentView')">{{ <el-button @click="$store.dispatch('tagsView/delCurrentView')">{{ $t("取消") }}</el-button>
$t("取消")
}}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<choose-contact-dialog <choose-contact-dialog v-if="!!contactChooseType" :type="1" @choose="onContactChoose" @close="contactChooseType = null" />
v-if="!!contactChooseType" <quick-create-customer v-if="quickCreateType" :type="quickCreateType" @success="onContactChoose" @close="quickCreateType = null" />
:type="1"
@choose="onContactChoose"
@close="contactChooseType = null"
/>
<quick-create-customer
v-if="quickCreateType"
:type="quickCreateType"
@success="onContactChoose"
@close="quickCreateType = null"
/>
</div> </div>
</template> </template>
<script> <script>
import { createOffer, updateOffer, getOffer } from "@/api/ecw/offer"; import { createOffer, updateOffer, getOffer } from "@/api/ecw/offer"
import ProductSelector from "@/components/ProductSelector"; import ProductSelector from "@/components/ProductSelector"
import { getProductAttrList } from "@/api/ecw/productAttr"; import { getProductAttrList } from "@/api/ecw/productAttr"
import { getChannelList } from "@/api/ecw/channel"; import { getChannelList } from "@/api/ecw/channel"
import Selector from "@/components/Selector"; import Selector from "@/components/Selector"
import { openedRouterList as getOpenedRouterList } from "@/api/ecw/warehouse"; import { openedRouterList as getOpenedRouterList } from "@/api/ecw/warehouse"
import { getTradeCityList } from "@/api/ecw/region"; import { getTradeCityList } from "@/api/ecw/region"
import { getDictData } from "@/utils/dict"; import { getDictData } from "@/utils/dict"
import { getCurrencyList } from "@/api/ecw/currency"; import { getCurrencyList } from "@/api/ecw/currency"
import { getUnitList } from "@/api/ecw/unit"; import { getUnitList } from "@/api/ecw/unit"
import { calculationPrice } from "@/api/ecw/product"; import { calculationPrice } from "@/api/ecw/product"
import SupplierSelector from "@/components/SupplierSelector"; import SupplierSelector from "@/components/SupplierSelector"
import ChooseContactDialog from "@/components/ChooseContactDialog"; import ChooseContactDialog from "@/components/ChooseContactDialog"
import QuickCreateCustomer from "@/components/QuickCreateCustomer"; import QuickCreateCustomer from "@/components/QuickCreateCustomer"
import { getCustomerContactsSelect } from "@/api/ecw/customerContacts"; import { getCustomerContactsSelect } from "@/api/ecw/customerContacts"
import Decimal from "decimal.js"; import Decimal from "decimal.js"
import getQuote from "@/views/ecw/customer/index.vue"; import getQuote from "@/views/ecw/customer/index.vue"
import { getRegionList } from '@/api/ecw/order'; import { getRegionList } from "@/api/ecw/order"
import { competitorListAll } from "@/api/ecw/customer"; import { competitorListAll } from "@/api/ecw/customer"
import { getCustomerContactsListByCustomer } from "@/api/ecw/customerContacts"
import { parse } from "querystring"
window.Decimal = Decimal; window.Decimal = Decimal
const createDefaultForm = () => { const createDefaultForm = () => {
return { return {
sendstatus: 0, sendstatus: 0,
...@@ -976,9 +575,9 @@ const createDefaultForm = () => { ...@@ -976,9 +575,9 @@ const createDefaultForm = () => {
control: false, control: false,
isCargoControl: false, isCargoControl: false,
prodCreateReqVOList: [], prodCreateReqVOList: [],
transportVO: {}, transportVO: {}
}; }
}; }
export default { export default {
name: "EcwOfferEdit", name: "EcwOfferEdit",
components: { components: {
...@@ -986,14 +585,14 @@ export default { ...@@ -986,14 +585,14 @@ export default {
Selector, Selector,
SupplierSelector, SupplierSelector,
ChooseContactDialog, ChooseContactDialog,
QuickCreateCustomer, QuickCreateCustomer
}, },
data() { data() {
return { return {
// 遮罩层 // 遮罩层
form: { // form: {
relation: 1, // CustomerLevel 的初始值 // relation: 1, // CustomerLevel 的初始值
}, // },
type: this.$route.query.type, type: this.$route.query.type,
contacts: null, contacts: null,
contactsList: [], contactsList: [],
...@@ -1011,7 +610,10 @@ export default { ...@@ -1011,7 +610,10 @@ export default {
// couponList: [], // couponList: [],
fee: {}, // 费用 fee: {}, // 费用
// 表单参数 // 表单参数
form: { ...createDefaultForm() }, form: {
relation: null,
...createDefaultForm()
},
// 表单校验 // 表单校验
labelStyle: "width:120px", labelStyle: "width:120px",
...@@ -1024,14 +626,14 @@ export default { ...@@ -1024,14 +626,14 @@ export default {
//预计结束时间,用于日历框校验 //预计结束时间,用于日历框校验
stopDate: { stopDate: {
disabledDate: (time) => { disabledDate: (time) => {
return Date.now() - 8.64e7 >= time.getTime(); // 加- 8.64e7则表示包当天 return Date.now() - 8.64e7 >= time.getTime() // 加- 8.64e7则表示包当天
}, }
}, },
//有效起始时间 //有效起始时间
startDate: { startDate: {
disabledDate: (time) => { disabledDate: (time) => {
return Date.now() - 8.64e7 >= time.getTime(); // 加- 8.64e7则表示包当天 return Date.now() - 8.64e7 >= time.getTime() // 加- 8.64e7则表示包当天
}, }
}, },
//有效结束时间 //有效结束时间
endDate: { endDate: {
...@@ -1039,84 +641,86 @@ export default { ...@@ -1039,84 +641,86 @@ export default {
if (this.form.startTime) { if (this.form.startTime) {
return ( return (
//限制日期范围 //限制日期范围
new Date(this.form.startTime).getTime() - 8.64e7 >= new Date(this.form.startTime).getTime() - 8.64e7 >= time.getTime() || time.getTime() >= new Date().setDate(new Date().getDate() + 30)
time.getTime() || )
time.getTime() >= new Date().setDate(new Date().getDate() + 30)
);
} else { } else {
// 加- 8.64e7则表示包当天 // 加- 8.64e7则表示包当天
return ( return Date.now() - 8.64e7 >= time.getTime() || time.getTime() >= new Date().setDate(new Date().getDate() + 30)
Date.now() - 8.64e7 >= time.getTime() || }
time.getTime() >= new Date().setDate(new Date().getDate() + 30)
);
} }
},
}, },
AddressProvince: [], AddressProvince: [],
AddressCity: [], AddressCity: [],
competitorList: [] competitorList: []
}; }
}, },
computed: { computed: {
computedStandard() { // computedStandard() {
if (this.$route.query.type == 1) { // let customer = JSON.parse(this.$route.query.customer)
// 使用计算属性动态设置 '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;
case 2: // console.log(customer, "zs")
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;
default: // if (this.$route.query.type == 1) {
return ""; // // 使用计算属性动态设置 '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() { rules() {
let rules = { let rules = {
...@@ -1124,22 +728,18 @@ export default { ...@@ -1124,22 +728,18 @@ export default {
{ {
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
if (value && !/[a-zA-Z]/.test(value.charAt(0))) { if (value && !/[a-zA-Z]/.test(value.charAt(0))) {
return callback(new Error(this.$t("唛头必须以字母开头"))); return callback(new Error(this.$t("唛头必须以字母开头")))
} }
callback(); callback()
},
trigger: "blur",
}, },
trigger: "blur"
}
], ],
lineId: [{ required: true, message: this.$t("请选择线路") }], lineId: [{ required: true, message: this.$t("请选择线路") }],
/* consignorId: [{ required: true, message: this.$t("发货人不能为空"),}], /* consignorId: [{ required: true, message: this.$t("发货人不能为空"),}],
consigneeId: [{ required: true, message: this.$t("收货人不能为空")}], */ consigneeId: [{ required: true, message: this.$t("收货人不能为空")}], */
startTime: [ startTime: [{ required: true, message: this.$t("有效期开始时间不能为空") }],
{ required: true, message: this.$t("有效期开始时间不能为空") }, endTime: [{ required: true, message: this.$t("有效期结束时间不能为空") }],
],
endTime: [
{ required: true, message: this.$t("有效期结束时间不能为空") },
],
transportId: [{ required: true, message: this.$t("选择运输方式") }], transportId: [{ required: true, message: this.$t("选择运输方式") }],
channelId: [{ required: true, message: this.$t("选择出货渠道") }], channelId: [{ required: true, message: this.$t("选择出货渠道") }],
stopTime: [{ required: true, message: this.$t("不能为空") }], stopTime: [{ required: true, message: this.$t("不能为空") }],
...@@ -1147,13 +747,11 @@ export default { ...@@ -1147,13 +747,11 @@ export default {
control: [{ required: true, message: this.$t("请选择是否控货") }], control: [{ required: true, message: this.$t("请选择是否控货") }],
importance: [ importance: [
{ required: true, message: this.$t("请选择重要程度") }, { required: true, message: this.$t("请选择重要程度") },
{ type: "number", min: 1, message: this.$t("请选择重要程度") }, { type: "number", min: 1, message: this.$t("请选择重要程度") }
], ]
}; }
if (this.form.relation == 1) { if (this.form.relation == 1) {
rules.consignorId = [ rules.consignorId = [{ required: true, message: this.$t("发货人不能为空") }]
{ required: true, message: this.$t("发货人不能为空") },
];
// if(this.$route.query.type ==1){ // if(this.$route.query.type ==1){
// if(this.$route.query.customer.defaultContactName==null){ // if(this.$route.query.customer.defaultContactName==null){
// rules.consignorId = [{ required: true, message: this.$t("发货人不能为空")}] // rules.consignorId = [{ required: true, message: this.$t("发货人不能为空")}]
...@@ -1170,63 +768,58 @@ export default { ...@@ -1170,63 +768,58 @@ export default {
// } // }
} }
if (this.form.relation == 2) { if (this.form.relation == 2) {
rules.consigneeId = [ rules.consigneeId = [{ required: true, message: this.$t("收货人不能为空") }]
{ required: true, message: this.$t("收货人不能为空") },
];
} }
return rules; return rules
}, },
exportCityList() { exportCityList() {
return this.tradeCityList.filter((item) => item.type == 2); return this.tradeCityList.filter((item) => item.type == 2)
}, },
importCityList() { importCityList() {
return this.tradeCityList.filter((item) => item.type == 1); return this.tradeCityList.filter((item) => item.type == 1)
}, },
getDictData() { getDictData() {
return (type, value) => getDictData(type, value) || {}; return (type, value) => getDictData(type, value) || {}
}, },
// 根据线路id显示线路名称 // 根据线路id显示线路名称
getRouterNameById() { getRouterNameById() {
return (routerId) => { return (routerId) => {
let router = this.routerList.find((item) => item.id == routerId); let router = this.routerList.find((item) => item.id == routerId)
if (router) { if (router) {
return router.startTitleZh + " > " + router.destTitleZh; return router.startTitleZh + " > " + router.destTitleZh
}
return "-"
} }
return "-";
};
}, },
// 根据渠道id显示渠道名 // 根据渠道id显示渠道名
getChannelNameById() { getChannelNameById() {
return (channelId) => { return (channelId) => {
return this.channelList.find((item) => item.channelId == channelId) return this.channelList.find((item) => item.channelId == channelId)?.nameZh
?.nameZh; }
};
}, },
// 当前运输方式 // 当前运输方式
transport() { transport() {
return this.transportList.find( return this.transportList.find((item) => item.value == this.form.transportId)
(item) => item.value == this.form.transportId
);
}, },
selectedRouter() { selectedRouter() {
// otherService 1 送货上门,2非控货订单代收货款 // otherService 1 送货上门,2非控货订单代收货款
if (!this.form.lineId) return null; if (!this.form.lineId) return null
return this.routerList.find((item) => item.id == this.form.lineId); return this.routerList.find((item) => item.id == this.form.lineId)
}, },
currencyMap() { currencyMap() {
let map = {}; let map = {}
this.currencyList.forEach((item) => { this.currencyList.forEach((item) => {
map[item.id] = this.$l(item, "title"); map[item.id] = this.$l(item, "title")
}); })
return map; return map
}, },
unitMap() { unitMap() {
let map = {}; let map = {}
this.unitList.forEach((item) => { this.unitList.forEach((item) => {
map[item.id] = this.$l(item, "title"); map[item.id] = this.$l(item, "title")
}); })
return map; return map
}, },
sum() { sum() {
let sum = { let sum = {
...@@ -1234,24 +827,24 @@ export default { ...@@ -1234,24 +827,24 @@ export default {
totalVolume: new Decimal(0), totalVolume: new Decimal(0),
totalWeight: new Decimal(0), totalWeight: new Decimal(0),
totalWorth: new Decimal(0), totalWorth: new Decimal(0),
totalQuatity: new Decimal(0), totalQuatity: new Decimal(0)
}; }
this.form.prodCreateReqVOList.forEach((item) => { this.form.prodCreateReqVOList.forEach((item) => {
sum.totalNum = sum.totalNum.plus(item.num || 0); sum.totalNum = sum.totalNum.plus(item.num || 0)
sum.totalVolume = sum.totalVolume.plus(item.volume || 0); sum.totalVolume = sum.totalVolume.plus(item.volume || 0)
sum.totalWeight = sum.totalWeight.plus(item.weight || 0); sum.totalWeight = sum.totalWeight.plus(item.weight || 0)
sum.totalWorth = sum.totalWorth.plus(item.worth || 0); sum.totalWorth = sum.totalWorth.plus(item.worth || 0)
sum.totalQuatity = sum.totalQuatity.plus(item.quantity || 0); sum.totalQuatity = sum.totalQuatity.plus(item.quantity || 0)
}); })
return sum; return sum
}, },
// 总有优惠金额 // 总有优惠金额
couponList() { couponList() {
let arr = []; let arr = []
this.couponAvailableGroupDtoList.forEach((item) => { this.couponAvailableGroupDtoList.forEach((item) => {
if (item.couponAvailableDtoList && item.couponAvailableDtoList.length) { if (item.couponAvailableDtoList && item.couponAvailableDtoList.length) {
// 只取第一个 // 只取第一个
let it = item.couponAvailableDtoList[0]; let it = item.couponAvailableDtoList[0]
arr.push({ arr.push({
prodId: item.prodId, prodId: item.prodId,
type: it.type, type: it.type,
...@@ -1260,137 +853,173 @@ export default { ...@@ -1260,137 +853,173 @@ export default {
endTime: it.endTime, endTime: it.endTime,
reduceTotalAmount: it.reduceTotalAmount, reduceTotalAmount: it.reduceTotalAmount,
reduceAmount: it.reduceAmount, reduceAmount: it.reduceAmount,
reduceCurrencyId: it.reduceCurrencyId, reduceCurrencyId: it.reduceCurrencyId
}); })
} }
}); })
return arr; return arr
}, },
// 计算返回的费用清单 // 计算返回的费用清单
feeDtoList() { feeDtoList() {
return this.fee.feeDtoList || []; return this.fee.feeDtoList || []
}, },
// 清关费 // 清关费
clearanceFeeList() { clearanceFeeList() {
return this.feeDtoList.filter((item) => item.feeType == 2); return this.feeDtoList.filter((item) => item.feeType == 2)
}, },
// 运费 // 运费
freightFeeList() { freightFeeList() {
return this.feeDtoList.filter((item) => item.feeType == 1); return this.feeDtoList.filter((item) => item.feeType == 1)
}, },
// 原价(清关费 + 运费) // 原价(清关费 + 运费)
originalFeeList() { originalFeeList() {
let arr = []; let arr = []
this.clearanceFeeList.forEach((item) => { this.clearanceFeeList.forEach((item) => {
let it = { let it = {
src: this.$t("清关费"), src: this.$t("清关费"),
currencyId: item.currencyId, currencyId: item.currencyId,
amount: Decimal(item.amount), amount: Decimal(item.amount)
}; }
let freight = this.freightFeeList.find( let freight = this.freightFeeList.find((fee) => fee.currencyId == item.currencyId)
(fee) => fee.currencyId == item.currencyId
);
if (freight) { 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) => { this.freightFeeList.forEach((item) => {
if (!arr.find((arrItem) => arrItem.currencyId == item.currencyId)) { if (!arr.find((arrItem) => arrItem.currencyId == item.currencyId)) {
arr.push({ arr.push({
src: this.$t("未计算的运费"), src: this.$t("未计算的运费"),
currencyId: item.currencyId, currencyId: item.currencyId,
amount: Decimal(item.amount), amount: Decimal(item.amount)
}); })
} }
}); })
return arr; return arr
}, },
// 预计费用(原价 - 优惠金额 + 其他费用 + 保价费) // 预计费用(原价 - 优惠金额 + 其他费用 + 保价费)
estimatedCosts() { estimatedCosts() {
let arr = []; let arr = []
this.originalFeeList.forEach((item) => { this.originalFeeList.forEach((item) => {
let it = { let it = {
currencyId: item.currencyId, currencyId: item.currencyId,
amount: Decimal(item.amount), amount: Decimal(item.amount)
}; }
let coupon = this.couponList.find( let coupon = this.couponList.find((coupon) => coupon.reduceCurrencyId == item.currencyId)
(coupon) => coupon.reduceCurrencyId == item.currencyId
);
if (coupon) { 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( const insuranceFeeIndex = arr.findIndex((item) => item.currencyId == this.insuranceFeeCurrency)
(item) => item.currencyId == this.insuranceFeeCurrency
);
if (insuranceFeeIndex > -1) { if (insuranceFeeIndex > -1) {
arr[insuranceFeeIndex].amount = arr[insuranceFeeIndex].amount.plus( arr[insuranceFeeIndex].amount = arr[insuranceFeeIndex].amount.plus(this.fee.insuranceFee || 0)
this.fee.insuranceFee || 0
);
} else { } else {
arr.push({ arr.push({
currencyId: this.insuranceFeeCurrency, currencyId: this.insuranceFeeCurrency,
amount: Decimal(this.fee.insuranceFee || 0), amount: Decimal(this.fee.insuranceFee || 0)
}); })
} }
// 累加其他费用 // 累加其他费用
const otherFeeIndex = arr.findIndex( const otherFeeIndex = arr.findIndex((item) => item.currencyId == this.form.otherFeeCurrencyId)
(item) => item.currencyId == this.form.otherFeeCurrencyId
);
if (otherFeeIndex > -1) { if (otherFeeIndex > -1) {
arr[otherFeeIndex].amount = arr[otherFeeIndex].amount.plus( arr[otherFeeIndex].amount = arr[otherFeeIndex].amount.plus(this.form.otherFee || 0)
this.form.otherFee || 0
);
} else { } else {
if (this.form.otherFee > 0) { if (this.form.otherFee > 0) {
arr.push({ arr.push({
currencyId: this.form.otherFeeCurrencyId, currencyId: this.form.otherFeeCurrencyId,
amount: Decimal(this.form.otherFee || 0), amount: Decimal(this.form.otherFee || 0)
}); })
} }
} }
return arr; return arr
}, },
// 路线开通的服务 // 路线开通的服务
routeOtherServices() { routeOtherServices() {
if (!this.selectedRouter || !this.selectedRouter.otherService) return []; if (!this.selectedRouter || !this.selectedRouter.otherService) return []
return this.selectedRouter.otherService.split(","); return this.selectedRouter.otherService.split(",")
}, },
// 保价费单位(路线里设置,默认美元) // 保价费单位(路线里设置,默认美元)
insuranceFeeCurrency() { insuranceFeeCurrency() {
return this.selectedRouter?.currencyUnit || 1; return this.selectedRouter?.currencyUnit || 1
}, },
// 是否可以添加商品 // 是否可以添加商品
canAddProduct() { canAddProduct() {
if (!this.form.lineId) { if (!this.form.lineId) {
return false; return false
} }
// 如果是海空联运或者空运专线则必须选择渠道 // 如果是海空联运或者空运专线则必须选择渠道
if ( if (this.transport && this.transport.cssClass == "channel" && !this.form.channelId) {
this.transport && return false
this.transport.cssClass == "channel" && }
!this.form.channelId return true
) { }
return false;
}
return true;
},
}, },
watch: { watch: {
"form.relation": function (newVal) { "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"() { "form.departureId"() {
this.getOpenedRouterList(); this.getOpenedRouterList()
}, },
"form.destCountryId"(destCountryId) { "form.destCountryId"(destCountryId) {
if (destCountryId != null) { if (destCountryId != null) {
...@@ -1405,9 +1034,9 @@ export default { ...@@ -1405,9 +1034,9 @@ export default {
}, },
// 目的地 // 目的地
async "form.objectiveId"() { async "form.objectiveId"() {
await this.$nextTick(); await this.$nextTick()
await this.getChannelList(); await this.getChannelList()
this.getOpenedRouterList(); this.getOpenedRouterList()
}, },
"form.transportId"(transportId, oldTransportId) { "form.transportId"(transportId, oldTransportId) {
// 海空联运默认数据 // 海空联运默认数据
...@@ -1420,117 +1049,117 @@ export default { ...@@ -1420,117 +1049,117 @@ export default {
isUnpack: false, isUnpack: false,
isSingleTicketTransport: false, isSingleTicketTransport: false,
packageTypeArr: [], packageTypeArr: [],
packageType: "", packageType: ""
}) })
); )
} }
this.getOpenedRouterList(); this.getOpenedRouterList()
// 更换运输方式之后,之前选择的路线会失效,需要重新选择 // 更换运输方式之后,之前选择的路线会失效,需要重新选择
if ( if (oldTransportId && oldTransportId != transportId && transportId != this.selectedRouter?.transportType) {
oldTransportId && console.log("重置路线", oldTransportId, transportId, this.selectedRouter?.transportType)
oldTransportId != transportId && this.$set(this.form, "lineId", undefined)
transportId != this.selectedRouter?.transportType
) {
console.log(
"重置路线",
oldTransportId,
transportId,
this.selectedRouter?.transportType
);
this.$set(this.form, "lineId", undefined);
} }
}, },
async "form.channelId"() { async "form.channelId"() {
await this.getTradeCity(); await this.getTradeCity()
this.getOpenedRouterList(); this.getOpenedRouterList()
this.calculationPrice("form.channelId"); this.calculationPrice("form.channelId")
}, },
async "form.lineId"(lineId) { async "form.lineId"(lineId) {
let router = this.routerList.find((item) => item.id == lineId); let router = this.routerList.find((item) => item.id == lineId)
if (router) { if (router) {
this.$set(this.form, "departureId", router.startCityId); this.$set(this.form, "departureId", router.startCityId)
this.$set(this.form, "destCountryId", router.destCountryId); this.$set(this.form, "destCountryId", router.destCountryId)
this.$set(this.form, "objectiveId", router.destCityId); this.$set(this.form, "objectiveId", router.destCityId)
} }
await this.$nextTick(); await this.$nextTick()
await this.getChannelList(); await this.getChannelList()
await this.getTradeCity(); await this.getTradeCity()
await this.calculationPrice("form.lineId"); await this.calculationPrice("form.lineId")
}, },
"form.transportVO.packageTypeArr"(val) { "form.transportVO.packageTypeArr"(val) {
this.$set(this.form.transportVO, "packageType", (val || []).join(",")); this.$set(this.form.transportVO, "packageType", (val || []).join(","))
}, },
// 选择的路线变化后,需要判断是否开通了对应的服务,如果没开通需要取消对应的服务选择 // 选择的路线变化后,需要判断是否开通了对应的服务,如果没开通需要取消对应的服务选择
selectedRouter(val) { selectedRouter(val) {
if (!val) return; if (!val) return
["1", "4"].forEach((service) => { ;["1", "4"].forEach((service) => {
if ( if (this.routeOtherServices.indexOf(service) < 0 && this.form.type.indexOf(service) > -1) {
this.routeOtherServices.indexOf(service) < 0 &&
this.form.type.indexOf(service) > -1
) {
this.form.type.splice( this.form.type.splice(
this.form.type.findIndex((item) => item == service), this.form.type.findIndex((item) => item == service),
1 1
); )
}
})
} }
});
},
}, },
activated() { activated() {
if (this.form.offerId != this.$route.query.id) { if (this.form.offerId != this.$route.query.id) {
this.getOffer(); this.getOffer()
} }
}, },
async created() { async created() {
await this.getChannelList(); await this.getChannelList()
await this.getTradeCity(); await this.getTradeCity()
getProductAttrList().then((res) => (this.productAttrList = res.data)); getProductAttrList().then((res) => (this.productAttrList = res.data))
getCurrencyList().then((res) => (this.currencyList = res.data)); getCurrencyList().then((res) => (this.currencyList = res.data))
getUnitList().then((res) => (this.unitList = res.data)); getUnitList().then((res) => (this.unitList = res.data))
this.transportList = this.getDictDatas(this.DICT_TYPE.ECW_TRANSPORT_TYPE); this.transportList = this.getDictDatas(this.DICT_TYPE.ECW_TRANSPORT_TYPE)
getRegionList(1, 1).then((res) => (this.AddressProvince = res.data)) getRegionList(1, 1).then((res) => (this.AddressProvince = res.data))
getRegionList(4, 4).then((res) => (this.AddressCity = res.data)) getRegionList(4, 4).then((res) => (this.AddressCity = res.data))
competitorListAll().then((res) => (this.competitorList = res.data)) competitorListAll().then((res) => (this.competitorList = res.data))
if (this.$route.query.id) { if (this.$route.query.id) {
this.getOffer(); this.getOffer()
} else { } else {
// alert(this.$route.query.customer.defaultContactPhone) // 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: { methods: {
async getChannelList() { async getChannelList() {
let query = { let query = {
cityId: this.form.objectiveId, cityId: this.form.objectiveId,
lineId: this.form.lineId, lineId: this.form.lineId
}; }
this.channelList = (await getChannelList(query)).data || []; this.channelList = (await getChannelList(query)).data || []
}, },
async getTradeCity() { async getTradeCity() {
let query = {}; let query = {}
if (this.form.channelId) { 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() { getOffer() {
//加了是否从全部客户列表中报价按钮进来的判断 //加了是否从全部客户列表中报价按钮进来的判断
if (this.$route.query !== 1) { if (this.$route.query !== 1) {
getOffer(this.$route.query.id).then((res) => { getOffer(this.$route.query.id).then((res) => {
let formData = res.data; let formData = res.data
formData.type = formData.type formData.type = formData.type ? formData.type.split(",").filter((item) => item != "") : []
? formData.type.split(",").filter((item) => item != "") formData.prodCreateReqVOList = []
: [];
formData.prodCreateReqVOList = [];
if (formData.transportVO && formData.transportVO.packageType) { if (formData.transportVO && formData.transportVO.packageType) {
formData.transportVO.packageTypeArr = formData.transportVO.packageTypeArr = formData.transportVO.packageType.split(",").filter((item) => item && item != "")
formData.transportVO.packageType
.split(",")
.filter((item) => item && item != "");
} }
if (res.data.offerProdRespVOList) { if (res.data.offerProdRespVOList) {
res.data.offerProdRespVOList.forEach((item) => { res.data.offerProdRespVOList.forEach((item) => {
...@@ -1554,61 +1183,40 @@ export default { ...@@ -1554,61 +1183,40 @@ export default {
.split(",") .split(",")
.filter((item) => item != "") .filter((item) => item != "")
.map((item) => +item) .map((item) => +item)
: [], : []
}); })
}); })
} }
this.$set(this, "form", formData); this.$set(this, "form", formData)
// 接口只返回了发货人和收货人ID,还需要调用接口获取详细信息回显 // 接口只返回了发货人和收货人ID,还需要调用接口获取详细信息回显
getCustomerContactsSelect({ getCustomerContactsSelect({
ids: [res.data.consigneeId, res.data.consignorId].join(","), ids: [res.data.consigneeId, res.data.consignorId].join(",")
}).then(({ data }) => { }).then(({ data }) => {
this.contactChooseType = "consignee"; this.contactChooseType = "consignee"
this.onContactChoose( this.onContactChoose(data.list.find((item) => item.customerContactsId == res.data.consigneeId))
data.list.find( this.contactChooseType = "consignor"
(item) => item.customerContactsId == res.data.consigneeId this.onContactChoose(data.list.find((item) => item.customerContactsId == res.data.consignorId))
) })
); })
this.contactChooseType = "consignor";
this.onContactChoose(
data.list.find(
(item) => item.customerContactsId == res.data.consignorId
)
);
});
});
} }
}, },
onContactChoose(contact) { onContactChoose(contact) {
if (!contact) return; if (!contact) return
if (!this.contactChooseType && !this.quickCreateType) return; if (!this.contactChooseType && !this.quickCreateType) return
if (!this.contactChooseType && this.quickCreateType) { if (!this.contactChooseType && this.quickCreateType) {
this.contactChooseType = this.contactChooseType = this.quickCreateType == 0 ? "consignor" : "consignee"
this.quickCreateType == 0 ? "consignor" : "consignee";
} }
this.$set(this.form, this.contactChooseType + "Company", contact.company); this.$set(this.form, this.contactChooseType + "Company", contact.company)
this.$set( this.$set(this.form, this.contactChooseType + "Id", contact.customerContactsId)
this.form, this.$set(this.form, this.contactChooseType + "CountryCode", contact.areaCode)
this.contactChooseType + "Id", this.$set(this.form, this.contactChooseType + "Email", contact.email)
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 + 'Id', contact.customerId)
this.$set( this.$set(this.form, this.contactChooseType + "Name", contact.contactsName)
this.form, this.$set(this.form, this.contactChooseType + "Phone", contact.phoneNew)
this.contactChooseType + "Name", this.contactChooseType = null
contact.contactsName this.quickCreateType = null
);
this.$set(this.form, this.contactChooseType + "Phone", contact.phoneNew);
this.contactChooseType = null;
this.quickCreateType = null;
}, },
onProductChange(row, product) { onProductChange(row, product) {
// row.goodsType = product ? product.typeId : null // row.goodsType = product ? product.typeId : null
...@@ -1617,28 +1225,28 @@ export default { ...@@ -1617,28 +1225,28 @@ export default {
: product.attrId : product.attrId
.split(",") .split(",")
.filter((item) => item !== "") .filter((item) => item !== "")
.map((item) => +item); .map((item) => +item)
if (product) { if (product) {
this.$set(this.productNames, product.id, { this.$set(this.productNames, product.id, {
titleZh: product.titleZh, titleZh: product.titleZh,
titleEn: product.titleEn, titleEn: product.titleEn
}); })
} }
this.calculationPrice("onProductChange"); this.calculationPrice("onProductChange")
}, },
/* onLineChange(row){ /* onLineChange(row){
this.calculationPrice() this.calculationPrice()
// this.updateEnabledTransports() // this.updateEnabledTransports()
}, */ }, */
onChannelChange(row) { onChannelChange(row) {
this.calculationPrice("onChannelChange"); this.calculationPrice("onChannelChange")
}, },
onProductAttrChange(row, attr) { onProductAttrChange(row, attr) {
this.calculationPrice("onProductAttrChange"); this.calculationPrice("onProductAttrChange")
}, },
addProduct(data) { addProduct(data) {
this.form.prodCreateReqVOList.push(data || { prodAttrArr: [] }); this.form.prodCreateReqVOList.push(data || { prodAttrArr: [] })
}, },
// 计算商品运费 // 计算商品运费
/* getProductFee(row){ /* getProductFee(row){
...@@ -1652,212 +1260,188 @@ export default { ...@@ -1652,212 +1260,188 @@ export default {
}, */ }, */
// 获取路线 // 获取路线
getOpenedRouterList() { getOpenedRouterList() {
let params = {}; let params = {}
if (this.form.departureId) { if (this.form.departureId) {
params.startCityId = this.form.departureId; params.startCityId = this.form.departureId
} }
if (this.form.objectiveId) { if (this.form.objectiveId) {
params.destCityId = this.form.objectiveId; params.destCityId = this.form.objectiveId
} }
if (this.form.transportId) { if (this.form.transportId) {
params.transportType = this.form.transportId; params.transportType = this.form.transportId
} }
if (this.form.channelId) { if (this.form.channelId) {
params.channelId = this.form.channelId; params.channelId = this.form.channelId
} }
// 如果没有任何条件,不请求接口 // 如果没有任何条件,不请求接口
if ( if (!params.startCityId && !params.destCityId && !params.transportType && !params.channelId) return false
!params.startCityId && getOpenedRouterList(params).then((res) => (this.routerList = res.data))
!params.destCityId &&
!params.transportType &&
!params.channelId
)
return false;
getOpenedRouterList(params).then((res) => (this.routerList = res.data));
}, },
// 计算体积 // 计算体积
calcVolume(row) { calcVolume(row) {
if (!row.boxGauge || !row.num) return false; if (!row.boxGauge || !row.num) return false
try { try {
row.volume = (eval(row.boxGauge) * row.num).toFixed(2); row.volume = (eval(row.boxGauge) * row.num).toFixed(2)
} catch (e) { } catch (e) {
row.volume = ""; row.volume = ""
} }
}, },
// 删除一条产品 // 删除一条产品
delProduct(index) { delProduct(index) {
this.$confirm(this.$t("确定删除此条内容么?")).then((res) => { this.$confirm(this.$t("确定删除此条内容么?")).then((res) => {
this.form.prodCreateReqVOList.splice(index, 1); this.form.prodCreateReqVOList.splice(index, 1)
}); })
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm(status) { submitForm(status) {
this.$refs["form"].validate((valid, errors) => { this.$refs["form"].validate((valid, errors) => {
if (!valid) { if (!valid) {
return this.$showFormValidateErrors(errors); return this.$showFormValidateErrors(errors)
} }
this.form.prodCreateReqVOList.map((item) => { this.form.prodCreateReqVOList.map((item) => {
item.prodAttrIds = item.prodAttrArr.join(","); item.prodAttrIds = item.prodAttrArr.join(",")
item.lineId = this.form.lineId; item.lineId = this.form.lineId
item.channelId = this.form.channelId; item.channelId = this.form.channelId
item.transportId = this.form.transportId; item.transportId = this.form.transportId
}); })
if (this.form.transportVO?.packageTypeArr) { if (this.form.transportVO?.packageTypeArr) {
this.form.transportVO.packageType = this.form.transportVO.packageType = this.form.transportVO.packageTypeArr.join(",")
this.form.transportVO.packageTypeArr.join(",");
} }
let endTime = new Date(this.form.endTime); let endTime = new Date(this.form.endTime)
let startTime = new Date(this.form.startTime); let startTime = new Date(this.form.startTime)
if (endTime.getTime() < startTime.getTime()) { if (endTime.getTime() < startTime.getTime()) {
return this.$message.error( return this.$message.error(this.$t("价格有效结束时间不能小于开始时间"))
this.$t("价格有效结束时间不能小于开始时间")
);
} }
let time2 = new Date().setDate(new Date().getDate() + 30); let time2 = new Date().setDate(new Date().getDate() + 30)
if (endTime > time2) { if (endTime > time2) {
return this.$message.error( return this.$message.error(this.$t("价格有效结束时间不能超过当前时间30天"))
this.$t("价格有效结束时间不能超过当前时间30天")
);
} }
// 修改的提交 // 修改的提交
if (this.form.offerId != null) { if (this.form.offerId != null) {
let data = Object.assign({}, this.form, { let data = Object.assign({}, this.form, {
// transportUpdateReqVOList: this.transportList.filter(item => item._enabled), // transportUpdateReqVOList: this.transportList.filter(item => item._enabled),
prodUpdateReqVOList: this.getProductListWithDefaultValue(), prodUpdateReqVOList: this.getProductListWithDefaultValue()
}); })
if (data.status < 3) { if (data.status < 3) {
data.status = status; data.status = status
} }
updateOffer(data).then((response) => { updateOffer(data).then((response) => {
this.$modal.msgSuccess(this.$t("修改成功")); this.$modal.msgSuccess(this.$t("修改成功"))
this.$redirect("index"); this.$redirect("index")
}); })
return; return
} }
let data = null; let data = null
if (this.$route.query.type == 1) { if (this.$route.query.type == 1) {
console.log(JSON.stringify(this.contactsList)); console.log(JSON.stringify(this.contactsList))
data = Object.assign({}, this.form, { data = Object.assign({}, this.form, {
prodCreateReqVOList: this.getProductListWithDefaultValue(), prodCreateReqVOList: this.getProductListWithDefaultValue(),
consignorId: this.$route.query.customer.defaultContactId, consignorId: this.customer.defaultContactId,
status, status
}); })
// data.consignorId = contacts.customerContactsId // data.consignorId = contacts.customerContactsId
} else { } else {
data = Object.assign({}, this.form, { data = Object.assign({}, this.form, {
prodCreateReqVOList: this.getProductListWithDefaultValue(), prodCreateReqVOList: this.getProductListWithDefaultValue(),
status, status
}); })
} }
// 添加的提交 // 添加的提交
createOffer(data).then((response) => { createOffer(data).then((response) => {
// 重置表单内容 // 重置表单内容
this.$set(this, "form", { ...createDefaultForm() }); this.$set(this, "form", { ...createDefaultForm() })
this.routerList = []; this.routerList = []
this.$nextTick(() => { this.$nextTick(() => {
console.log("清理表单校验和路线"); console.log("清理表单校验和路线")
this.addProduct(); this.addProduct()
this.$refs.form.clearValidate(); this.$refs.form.clearValidate()
}); })
this.$modal.msgSuccess(this.$t("新增成功")); this.$modal.msgSuccess(this.$t("新增成功"))
this.$redirect("index"); this.$redirect("index")
}); })
}); })
}, },
setLink(row) { setLink(row) {
this.$prompt(this.$t("请输入商品链接"), { inputValue: row.link }).then( this.$prompt(this.$t("请输入商品链接"), { inputValue: row.link }).then(({ value }) => {
({ value }) => { this.$set(row, "link", value)
this.$set(row, "link", value); })
}
);
}, },
// 计算商品运费 // 计算商品运费
calculationPrice(tag) { calculationPrice(tag) {
let calcable = true; let calcable = true
if (!this.form.prodCreateReqVOList.length) return; if (!this.form.prodCreateReqVOList.length) return
this.form.prodCreateReqVOList.forEach((item) => { this.form.prodCreateReqVOList.forEach((item) => {
if (!item.prodId) { if (!item.prodId) {
console.log("产品未选择", item); console.log("产品未选择", item)
calcable = false; calcable = false
} }
item.brandType = item.brand; item.brandType = item.brand
}); })
if (this.calculating || !calcable) { if (this.calculating || !calcable) {
console.log("不满足费用计算条件,清空已获取的费用信息"); console.log("不满足费用计算条件,清空已获取的费用信息")
this.form.prodCreateReqVOList.forEach((item) => { this.form.prodCreateReqVOList.forEach((item) => {
delete item.fee; delete item.fee
}); })
this.fee = {}; this.fee = {}
return false; return false
} }
this.calculating = true; this.calculating = true
console.log("calculationPrice"); console.log("calculationPrice")
calculationPrice({ calculationPrice({
lineId: this.form.lineId, lineId: this.form.lineId,
transportId: this.form.transportId, transportId: this.form.transportId,
channelId: channelId: [3, 4].indexOf(this.form.transportId) > -1 ? this.form.channelId : undefined,
[3, 4].indexOf(this.form.transportId) > -1
? this.form.channelId
: undefined,
prodConditionParamList: this.getProductListWithDefaultValue(), prodConditionParamList: this.getProductListWithDefaultValue(),
consigneeCustomerContactsId: this.form.consigneeCustomerContactsId, consigneeCustomerContactsId: this.form.consigneeCustomerContactsId,
consignorCustomerContactsId: this.form.consignorCustomerContactsId, consignorCustomerContactsId: this.form.consignorCustomerContactsId,
customsType: this.form.customsType, customsType: this.form.customsType,
isCargoControl: this.form.control, isCargoControl: this.form.control,
orderType: this.form.orderType, orderType: this.form.orderType
}) })
.then((res) => { .then((res) => {
this.$set(this, "fee", res.data.costDto); this.$set(this, "fee", res.data.costDto)
if (res.data.availableDto) { if (res.data.availableDto) {
this.$set( this.$set(this, "couponTotalAmountList", res.data.availableDto.couponTotalAmountList)
this, this.$set(this, "couponAvailableGroupDtoList", res.data.availableDto.couponAvailableGroupDtoList)
"couponTotalAmountList",
res.data.availableDto.couponTotalAmountList
);
this.$set(
this,
"couponAvailableGroupDtoList",
res.data.availableDto.couponAvailableGroupDtoList
);
} }
this.form.prodCreateReqVOList.map((item, index) => { 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(() => { .finally(() => {
this.calculating = false; this.calculating = false
}); })
}, },
// 体积。件数,数量,重量为选填,但是接口确实必填,所以生成一个副本并赋予默认值 // 体积。件数,数量,重量为选填,但是接口确实必填,所以生成一个副本并赋予默认值
getProductListWithDefaultValue() { getProductListWithDefaultValue() {
let arr = []; let arr = []
this.form.prodCreateReqVOList.forEach((item) => { this.form.prodCreateReqVOList.forEach((item) => {
let tmp = { ...item }; let tmp = { ...item }
tmp.prodAttrIds = tmp.prodAttrArr.join(","); tmp.prodAttrIds = tmp.prodAttrArr.join(",")
if (!tmp.volume) tmp.volume = 0; if (!tmp.volume) tmp.volume = 0
if (!tmp.weight) tmp.weight = 0; if (!tmp.weight) tmp.weight = 0
if (!tmp.quantity) tmp.quantity = 0; if (!tmp.quantity) tmp.quantity = 0
if (!tmp.num) tmp.num = 0; if (!tmp.num) tmp.num = 0
if (!tmp.worth) tmp.worth = 0; if (!tmp.worth) tmp.worth = 0
arr.push(tmp); arr.push(tmp)
}); })
return arr; return arr
}, }
}, }
}; }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.card-title { .card-title {
......
...@@ -1625,7 +1625,7 @@ export default { ...@@ -1625,7 +1625,7 @@ export default {
for(const i in this.form.orderItemVOList){ for(const i in this.form.orderItemVOList){
const item = this.form.orderItemVOList[i] const item = this.form.orderItemVOList[i]
if(!item.prodId){ 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 @@ ...@@ -401,6 +401,7 @@
<script> <script>
//国家列表接口 //国家列表接口
import { getCountryListAll } from "@/api/ecw/country"; import { getCountryListAll } from "@/api/ecw/country";
import { DICT_TYPE, getDictDatas, getDictDatas2 } from '@/utils/dict'
import UserSelector from "@/components/UserSelector"; import UserSelector from "@/components/UserSelector";
import { listServiceUser2 } from "@/api/system/user"; import { listServiceUser2 } from "@/api/system/user";
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
...@@ -482,6 +483,9 @@ export default { ...@@ -482,6 +483,9 @@ export default {
return { return {
// 遮罩层 // 遮罩层
loading: true, loading: true,
getDictDatas2,
getDictDatas,
DICT_TYPE,
// 导出遮罩层 // 导出遮罩层
exportLoading: false, exportLoading: false,
// 显示搜索条件 // 显示搜索条件
...@@ -849,4 +853,3 @@ export default { ...@@ -849,4 +853,3 @@ export default {
}, },
}; };
</script> </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