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
...@@ -104,14 +109,16 @@ ...@@ -104,14 +109,16 @@
</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("搜索") $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">
<el-table-column align="center" width="80"> <el-table-column align="center" width="80">
<template slot-scope="{row}"> <template slot-scope="{row}">
<el-radio v-model="customerId" :label="row.id">&nbsp;</el-radio> <el-radio v-model="customerId" :label="row.id">&nbsp;</el-radio>
...@@ -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">
...@@ -247,7 +257,7 @@ ...@@ -247,7 +257,7 @@
/> />
</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">
...@@ -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: {
...@@ -328,9 +339,9 @@ export default { ...@@ -328,9 +339,9 @@ export default {
return (val) => { return (val) => {
return !!val return !!val
? this.getDictDatas(this.DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE) ? this.getDictDatas(this.DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE)
.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("")
: ""; : "";
}; };
}, },
...@@ -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 } }) //this.$refs.push({path:'/customer-contacts/select',query:{pageNo:1,pageSize:10,searchKey:row.defaultContactPhone}})
.then({ })
//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("修改业绩类型后,将会影响客户新订单业绩计算,请问确定吗?"), confirmButtonText: this.$t("确定"),
this.$t("提示"), cancelButtonText: this.$t("取消"),
{ type: "warning"
confirmButtonText: this.$t("确定"), })
cancelButtonText: this.$t("取消"),
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>
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
clearable clearable
v-model.number="queryParams.memberMobile" v-model.number="queryParams.memberMobile"
:placeholder="$t('请输入会员电话')"/> :placeholder="$t('请输入会员电话')"/>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item :label="$t('会员编号')" prop="number"> <el-form-item :label="$t('会员编号')" prop="number">
<el-input <el-input
...@@ -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,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -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,147 +102,58 @@ ...@@ -175,147 +102,58 @@
</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('增值服务')" <el-checkbox-group v-model="form.type">
v-if=" <el-checkbox label="1" v-if="routeOtherServices.indexOf('1') > -1">{{ $t("集运服务") }}</el-checkbox>
routeOtherServices.indexOf('1') > -1 || <el-checkbox label="2" v-if="routeOtherServices.indexOf('4') > -1">{{ $t("海外仓") }}</el-checkbox>
routeOtherServices.indexOf('4') > -1 </el-checkbox-group>
" </el-form-item>
>
<el-checkbox-group v-model="form.type">
<el-checkbox
label="1"
v-if="routeOtherServices.indexOf('1') > -1"
>{{ $t("集运服务") }}</el-checkbox
>
<el-checkbox
label="2"
v-if="routeOtherServices.indexOf('4') > -1"
>{{ $t("海外仓") }}</el-checkbox
>
</el-checkbox-group>
</el-form-item>
</div> </div>
</el-card> </el-card>
<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">
...@@ -874,7 +493,7 @@ ...@@ -874,7 +493,7 @@
> >
<el-input v-model="form.transportVO.remarks"></el-input> <el-input v-model="form.transportVO.remarks"></el-input>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
:label="$t('是否拆包')" :label="$t('是否拆包')"
v-if="[3, 4].indexOf(+form.transportId) > -1" v-if="[3, 4].indexOf(+form.transportId) > -1"
...@@ -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 false;
} }
return true; 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))
} }
} }
......
...@@ -397,10 +397,11 @@ ...@@ -397,10 +397,11 @@
/> />
</div> </div>
</template> </template>
<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