Commit 4840d57d authored by knight's avatar knight

集运地址功能

parent 4c42dffa
...@@ -3776,6 +3776,8 @@ ...@@ -3776,6 +3776,8 @@
"集运重量上限(kg)": "Cons Weight Limit(kg)", "集运重量上限(kg)": "Cons Weight Limit(kg)",
"集运体积上限(m³)": "Cons Volume Limit(m³)", "集运体积上限(m³)": "Cons Volume Limit(m³)",
"在仓预警时长(天)": "stock duration limit(days)", "在仓预警时长(天)": "stock duration limit(days)",
"集运地址": "Cons Address",
"会员号": "User Number",
"系统类型": "System Type", "系统类型": "System Type",
"请选择系统类型": "Please select a system type", "请选择系统类型": "Please select a system type",
"强制更新": "Force updates", "强制更新": "Force updates",
......
<template>
<el-dialog append-to-body :title="$t('集运地址')" :visible.sync="dialogVisible" width="750px">
<el-tabs v-model="activeName" type="card" @tab-click="handleClick">
<el-tab-pane
v-for="warehouse in warehouseList"
:label="warehouse.titleZh"
:name="warehouse.titleEn"
v-if="warehouse.isConsService">
<el-descriptions class="margin-top" :column="1" border>
<el-descriptions-item :label="$t('会员号')" span="30">
<el-tag style="color:red;font-size: 20px;">{{ memberNumber }}</el-tag>
<el-button type="text" @click="copyToClipboard(memberNumber)" style="float: right">{{$t('复制')}}</el-button>
</el-descriptions-item>
<el-descriptions-item :label="$t('运输方式偏好')">
<el-radio-group @change="handleTransportChange" v-model="customer.preferenceTransportType">
<el-radio
v-for="dict in preferenceTransportData"
:label=parseInt(dict.value)
>
{{ $l(dict, "label") }}</el-radio
>
</el-radio-group>
</el-descriptions-item>
<el-descriptions-item :label="$t('收件人姓名')">
{{ warehouse.head }}
<el-tag style="color:red;font-size: 20px;">{{ memberNumber }}</el-tag>
<el-button type="text" @click="copyToClipboard(`${warehouse.head }${memberNumber}`)" style="float: right">{{$t('复制')}}</el-button>
</el-descriptions-item>
<el-descriptions-item :label="$t('收件人电话')" >
{{ warehouse.tell }}
<el-button type="text" @click="copyToClipboard(warehouse.tell)" style="float: right">{{$t('复制')}}</el-button>
</el-descriptions-item>
<el-descriptions-item :label="$t('地址')" >
{{ warehouse.addressZh }}
<el-tag style="color:red;font-size: 20px;">{{ memberNumber }}</el-tag>
<el-button type="text" @click="copyToClipboard(`${warehouse.addressZh} ${memberNumber}`)" style="float: right">{{$t('复制')}}</el-button>
</el-descriptions-item>
</el-descriptions>
</el-tab-pane>
</el-tabs>
<el-row style="padding-top: 150px;padding-left: 350px;">
<el-button type="warning" @click="handleCopyAll">一键复制</el-button>
<el-button type="primary">入仓须知</el-button>
<el-button type="success">禁运物品</el-button>
</el-row>
</el-dialog>
</template>
<script>
import { getWarehouseList } from '@/api/ecw/warehouse'
import ShippingAir from '@/views/ecw/box/shippingAir/shippingAir.vue'
import { DICT_TYPE, getDictDatas } from '@/utils/dict'
import { customerSettingButton } from '@/api/ecw/customer'
export default {
name: "CustomerConsAddress",
data(){
return{
dialogVisible: false,
// 默认选择一个仓库
activeName: "Foshan",
warehouseList: [],
customer: [],
memberNumber: '',
// 获取运输方式偏好字典
preferenceTransportData: getDictDatas(DICT_TYPE.ECW_PREFERENCE_TRANSPORT_TYPE),
}
},
created() {
getWarehouseList({tradeType : 2}).then((r) => {
this.warehouseList = r.data
})
},
methods:{
// 点击集运地址后被调用
init(customer){
// 获取用户信息
this.customer = customer
// 初始化时根据运输方式更新客户编号
this.updateMemberNumber();
},
// 切换tab栏的时候调用
handleClick(tab, event) {
},
// 更新运输方式偏好对应的编号和保存设置
handleTransportChange(preferenceTransportType) {
const param = {
id: this.customer.id,
preferenceTransportType: preferenceTransportType
}
// 修改用户运输方式偏好设置
customerSettingButton(param).then((response) => {
this.$modal.msgSuccess(this.$t("修改成功"))
})
this.updateMemberNumber(preferenceTransportType)
},
// 更新会员号方法
updateMemberNumber() {
if (!this.customer?.number) return;
let suffix = '';
switch (this.customer.preferenceTransportType) {
case 1:
suffix = 'S';
break;
case 3:
suffix = 'A';
break;
}
this.memberNumber = this.customer.number + suffix;
},
// 复制功能
async copyToClipboard(text) {
try {
await navigator.clipboard.writeText(text);
this.$message.success(this.$t('复制成功'));
} catch (err) {
this.$message.error(this.$t('复制失败'));
}
},
// 一键复制
handleCopyAll() {
const currentWarehouse = this.warehouseList.find(
item => item.titleEn === this.activeName
);
if (!currentWarehouse) return;
// 构建复制内容
const content = [
`${currentWarehouse.head}${this.memberNumber}`,
`${currentWarehouse.tell}`,
`${currentWarehouse.addressZh} ${this.memberNumber}`
].join(',');
this.copyToClipboard(content);
},
}
}
</script>
...@@ -128,7 +128,6 @@ export default { ...@@ -128,7 +128,6 @@ export default {
} }
}, },
created() { created() {
console.log( this.preferenceTransportData)
getWarehouseList().then((r) => { getWarehouseList().then((r) => {
this.warehouseList = r.data this.warehouseList = r.data
}) })
......
...@@ -427,6 +427,7 @@ ...@@ -427,6 +427,7 @@
<!--lanbm 2024-05-23 添加报价按钮逻辑控制--> <!--lanbm 2024-05-23 添加报价按钮逻辑控制-->
<el-button v-has-permi="[selectAuthorityFn('ecw:customer:treat-quoted-price')]" size="mini" type="text" icon="el-icon-user" @click="quote(scope.row)">{{ $t("报价") }}</el-button> <el-button v-has-permi="[selectAuthorityFn('ecw:customer:treat-quoted-price')]" size="mini" type="text" icon="el-icon-user" @click="quote(scope.row)">{{ $t("报价") }}</el-button>
<el-button v-has-permi="['ecw:customer:setting']" size="mini" type="text" icon="el-icon-user" @click="handleSetting(scope.row)">{{ $t("设置") }}</el-button> <el-button v-has-permi="['ecw:customer:setting']" size="mini" type="text" icon="el-icon-user" @click="handleSetting(scope.row)">{{ $t("设置") }}</el-button>
<el-button v-has-permi="['ecw:customer:cons-address']" size="mini" type="text" icon="el-icon-user" v-if="scope.row.isConsService" @click="handleConsAddress(scope.row)">{{ $t("集运地址") }}</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -706,6 +707,8 @@ ...@@ -706,6 +707,8 @@
<transfer-customer :show.sync="transferShow" :customer-ids.sync="selectCustomerList"></transfer-customer> <transfer-customer :show.sync="transferShow" :customer-ids.sync="selectCustomerList"></transfer-customer>
<add-potential-custom ref="potentialCustom" @change="getList"></add-potential-custom> <add-potential-custom ref="potentialCustom" @change="getList"></add-potential-custom>
<customer-setting ref="customerSetting" @refresh="getList"></customer-setting> <customer-setting ref="customerSetting" @refresh="getList"></customer-setting>
<customer-cons-address ref="customerConsAddress" @refresh="getList"></customer-cons-address>
<customer-merge ref="customerMerge" @refresh="getList" :countryList="countryList" :getNodeLists="getNodeLists" :productTypeList="getNodeLists" :customerSelectFn="customerSelectFn" v-if="customerMergeVisible"></customer-merge> <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%">
...@@ -747,6 +750,7 @@ import Template from "@/views/cms/template/index.vue" ...@@ -747,6 +750,7 @@ import Template from "@/views/cms/template/index.vue"
import AddPotentialCustom from "@/views/ecw/customer/addPotentialCustom.vue" import AddPotentialCustom from "@/views/ecw/customer/addPotentialCustom.vue"
import Contacts from "@/views/ecw/customer/components/contacts.vue" import Contacts from "@/views/ecw/customer/components/contacts.vue"
import CustomerSetting from "./components/customerSetting.vue" import CustomerSetting from "./components/customerSetting.vue"
import CustomerConsAddress from "./components/customerConsAddress.vue"
import CustomerMerge from "./components/customerMerge.vue" import CustomerMerge from "./components/customerMerge.vue"
import AreaCodeSelector from "@/components/AreaCodeSelector/index.vue" import AreaCodeSelector from "@/components/AreaCodeSelector/index.vue"
import { getCustomerSelect } from "@/api/ecw/customer" import { getCustomerSelect } from "@/api/ecw/customer"
...@@ -771,6 +775,7 @@ export default { ...@@ -771,6 +775,7 @@ export default {
transferCustomer, transferCustomer,
AreaCodeSelector, AreaCodeSelector,
CustomerSetting, CustomerSetting,
CustomerConsAddress,
CustomerMerge, CustomerMerge,
CustomerFollow CustomerFollow
}, },
...@@ -1476,6 +1481,13 @@ export default { ...@@ -1476,6 +1481,13 @@ export default {
this.$refs["customerSetting"].init(row.id) this.$refs["customerSetting"].init(row.id)
}) })
}, },
handleConsAddress(row) {
this.$refs["customerConsAddress"].dialogVisible = true
this.$nextTick((_) => {
this.$refs["customerConsAddress"].init(row)
})
},
getBusiCountryNames(ids) { getBusiCountryNames(ids) {
if (ids) { if (ids) {
const idsArr = ids.split(",") const idsArr = ids.split(",")
......
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