Commit 1fd7d083 authored by knight's avatar knight

新增需求-客户的集运设置按钮

parent 3823e8ed
......@@ -3784,6 +3784,7 @@
"集运体积上限(m³)": "Cons Volume Limit(m³)",
"在仓预警时长(天)": "stock duration limit(days)",
"集运地址": "Cons Address",
"集运设置": "Cons Setting",
"会员号": "User Number",
"一键复制": "Copy All",
"系统类型": "System Type",
......
<template>
<el-dialog append-to-body :title="$t('集运设置')" :visible.sync="dialogVisible" width="750px">
<el-form ref="form" :model="form" label-width="150px">
<el-row :gutter="10">
<el-col :span="5">
<el-form-item :label="$t('集运')">
<el-switch v-model="form.isConsService" />
</el-form-item>
</el-col>
<el-col :span="12" v-show="form.isConsService">
<el-form-item :label="$t('运输方式偏好')">
<el-radio-group v-model="form.preferenceTransportType">
<el-radio
v-for="dict in preferenceTransportData"
:label=parseInt(dict.value)
>
{{ $l(dict, "label") }}</el-radio
>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12" v-show="form.isConsService">
<el-form-item :label="$t('常用提货网点')">
<el-select filterable clearable v-model="form.consPickupPoint" :placeholder="$t('请选择提货网点')">
<el-option v-for="item in pickupPointData" :key="item.id" :label="isChinese() ? item.titleZh : item.titleEn" :value="parseInt(item.id)" />
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="warning" @click="handleClose">{{ $t("关 闭") }}</el-button>
<el-button type="primary" @click="handeSubmit">{{ $t("保 存") }}</el-button>
</div>
</el-dialog>
</template>
<script>
import { DICT_TYPE, getDictDatas } from '@/utils/dict'
import { customerSettingButton } from '@/api/ecw/customer'
import { getWarehouseList } from '@/api/ecw/warehouse'
export default {
name: "CustomerConsSetting",
data(){
return {
dialogVisible: false,
form: {
isConsService: '',
preferenceTransportType : 1,
consPickupPoint: '',
},
// 获取运输方式偏好数据
preferenceTransportData: getDictDatas(DICT_TYPE.ECW_PREFERENCE_TRANSPORT_TYPE),
// 获取提货点
pickupPointData: {},
}
},
created() {
// 获取提货点仓库
getWarehouseList({tradeType : 1}).then((r) => {
this.pickupPointData = r.data
})
},
methods:{
init(customer){
this.form = customer;
this.form.preferenceTransportType = 1;
},
isChinese() {
return this.$i18n.locale === "zh_CN"
},
handleClose() {
//this.resetForm("form")
this.dialogVisible = false
},
handeSubmit(){
this.$refs["form"].validate((valid, err) => {
if (this.form.consPickupPoint === ''){
this.form.consPickupPoint = 0;
}
customerSettingButton(this.form).then((response) => {
this.$modal.msgSuccess(this.$t("操作成功"))
this.dialogVisible = false
const obj = { path: "/customer/customer" }
this.$emit("refresh")
})
});
},
},
}
</script>
<style scoped lang="scss">
</style>
......@@ -59,24 +59,6 @@
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item :label="$t('集运')">
<el-switch v-model="form.isConsService" />
</el-form-item>
</el-col>
<el-col :span="12" v-show="form.isConsService">
<el-form-item :label="$t('运输方式偏好')">
<el-radio-group v-model="preferenceTransportType">
<el-radio
v-for="dict in preferenceTransportData"
:label=parseInt(dict.value)
>
{{ $l(dict, "label") }}</el-radio
>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
......@@ -113,7 +95,6 @@ export default {
noConsignee: false,
defaultPay: false,
defaultBilling: false,
isConsService: false,
},
showZhong: false,
showZhong1: false,
......@@ -154,15 +135,9 @@ export default {
noConsignee: row.noConsignee,
defaultPay: row.defaultPay,
defaultBilling: row.defaultBilling,
isConsService: row.isConsService,
}
// 判断是否开启集运服务
if (this.form.isConsService){
this.form.isConsService = true
// 选择运输服务偏好
this.preferenceTransportType = row.preferenceTransportType
}
// 打开重泡货开关
if (this.form.weightUnit) {
this.showZhong = true
......@@ -212,10 +187,6 @@ export default {
}
this.updateCustomerLines()
// 集运服务配置
this.form.isConsService = this.form.isConsService ? 1 : 0;
this.form.preferenceTransportType = this.preferenceTransportType
// 检查路线是否启用了但是没选择目的仓
let errors = 0
this.form.customerLines.forEach((line) => {
......
......@@ -428,6 +428,7 @@
<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:cons-address']" size="mini" type="text" icon="el-icon-user" v-if="scope.row.isConsService" @click="handleConsAddress(scope.row)">{{ $t("集运地址") }}</el-button>
<el-button v-has-permi="['ecw:customer:cons-setting']" size="mini" type="text" icon="el-icon-user" @click="handleConsSetting(scope.row)">{{ $t("集运设置") }}</el-button>
</template>
</el-table-column>
</el-table>
......@@ -708,6 +709,7 @@
<add-potential-custom ref="potentialCustom" @change="getList"></add-potential-custom>
<customer-setting ref="customerSetting" @refresh="getList"></customer-setting>
<customer-cons-address ref="customerConsAddress" @refresh="getList"></customer-cons-address>
<customer-cons-setting ref="customerConsSetting" @refresh="getList"></customer-cons-setting>
<customer-merge ref="customerMerge" @refresh="getList" :countryList="countryList" :getNodeLists="getNodeLists" :productTypeList="getNodeLists" :customerSelectFn="customerSelectFn" v-if="customerMergeVisible"></customer-merge>
<!--业绩类型 -->
......@@ -761,9 +763,11 @@ import UserSelector from "@/components/UserSelector/index.vue"
import CustomerFollow from "@/views/ecw/customer/components/customerFollow.vue"
import ProductSelector from "@/components/ProductSelector/index.vue"
import CompetitorSelector from "@/components/CompetitorSelector/index.vue"
import CustomerConsSetting from '@/views/ecw/customer/components/customerConsSetting.vue'
export default {
name: "EcwCustomerIndex",
components: {
CustomerConsSetting,
ProductSelector,
CompetitorSelector,
Contacts,
......@@ -1481,12 +1485,24 @@ export default {
this.$refs["customerSetting"].init(row.id)
})
},
/**
* 打开集运地址窗口
*/
handleConsAddress(row) {
this.$refs["customerConsAddress"].dialogVisible = true
this.$nextTick((_) => {
this.$refs["customerConsAddress"].init(row)
})
},
/**
* 打开集运设置窗口
*/
handleConsSetting(row){
this.$refs["customerConsSetting"].dialogVisible = true
this.$nextTick((_) => {
this.$refs["customerConsSetting"].init(row)
})
},
getBusiCountryNames(ids) {
if (ids) {
......
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