Commit 653fc0a9 authored by Smile's avatar Smile

Merge remote-tracking branch 'origin/jd_cons' into jd_cons

parents cee87185 1fd7d083
...@@ -3784,6 +3784,7 @@ ...@@ -3784,6 +3784,7 @@
"集运体积上限(m³)": "Cons Volume Limit(m³)", "集运体积上限(m³)": "Cons Volume Limit(m³)",
"在仓预警时长(天)": "stock duration limit(days)", "在仓预警时长(天)": "stock duration limit(days)",
"集运地址": "Cons Address", "集运地址": "Cons Address",
"集运设置": "Cons Setting",
"会员号": "User Number", "会员号": "User Number",
"一键复制": "Copy All", "一键复制": "Copy All",
"系统类型": "System Type", "系统类型": "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 @@ ...@@ -59,24 +59,6 @@
</el-form-item> </el-form-item>
</el-col> </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-row>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
...@@ -113,7 +95,6 @@ export default { ...@@ -113,7 +95,6 @@ export default {
noConsignee: false, noConsignee: false,
defaultPay: false, defaultPay: false,
defaultBilling: false, defaultBilling: false,
isConsService: false,
}, },
showZhong: false, showZhong: false,
showZhong1: false, showZhong1: false,
...@@ -154,15 +135,9 @@ export default { ...@@ -154,15 +135,9 @@ export default {
noConsignee: row.noConsignee, noConsignee: row.noConsignee,
defaultPay: row.defaultPay, defaultPay: row.defaultPay,
defaultBilling: row.defaultBilling, defaultBilling: row.defaultBilling,
isConsService: row.isConsService,
} }
// 判断是否开启集运服务
if (this.form.isConsService){
this.form.isConsService = true
// 选择运输服务偏好
this.preferenceTransportType = row.preferenceTransportType
}
// 打开重泡货开关 // 打开重泡货开关
if (this.form.weightUnit) { if (this.form.weightUnit) {
this.showZhong = true this.showZhong = true
...@@ -212,10 +187,6 @@ export default { ...@@ -212,10 +187,6 @@ export default {
} }
this.updateCustomerLines() this.updateCustomerLines()
// 集运服务配置
this.form.isConsService = this.form.isConsService ? 1 : 0;
this.form.preferenceTransportType = this.preferenceTransportType
// 检查路线是否启用了但是没选择目的仓 // 检查路线是否启用了但是没选择目的仓
let errors = 0 let errors = 0
this.form.customerLines.forEach((line) => { this.form.customerLines.forEach((line) => {
......
...@@ -428,6 +428,7 @@ ...@@ -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="[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> <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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -708,6 +709,7 @@ ...@@ -708,6 +709,7 @@
<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-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> <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" ...@@ -761,9 +763,11 @@ import UserSelector from "@/components/UserSelector/index.vue"
import CustomerFollow from "@/views/ecw/customer/components/customerFollow.vue" import CustomerFollow from "@/views/ecw/customer/components/customerFollow.vue"
import ProductSelector from "@/components/ProductSelector/index.vue" import ProductSelector from "@/components/ProductSelector/index.vue"
import CompetitorSelector from "@/components/CompetitorSelector/index.vue" import CompetitorSelector from "@/components/CompetitorSelector/index.vue"
import CustomerConsSetting from '@/views/ecw/customer/components/customerConsSetting.vue'
export default { export default {
name: "EcwCustomerIndex", name: "EcwCustomerIndex",
components: { components: {
CustomerConsSetting,
ProductSelector, ProductSelector,
CompetitorSelector, CompetitorSelector,
Contacts, Contacts,
...@@ -1481,12 +1485,24 @@ export default { ...@@ -1481,12 +1485,24 @@ export default {
this.$refs["customerSetting"].init(row.id) this.$refs["customerSetting"].init(row.id)
}) })
}, },
/**
* 打开集运地址窗口
*/
handleConsAddress(row) { handleConsAddress(row) {
this.$refs["customerConsAddress"].dialogVisible = true this.$refs["customerConsAddress"].dialogVisible = true
this.$nextTick((_) => { this.$nextTick((_) => {
this.$refs["customerConsAddress"].init(row) this.$refs["customerConsAddress"].init(row)
}) })
}, },
/**
* 打开集运设置窗口
*/
handleConsSetting(row){
this.$refs["customerConsSetting"].dialogVisible = true
this.$nextTick((_) => {
this.$refs["customerConsSetting"].init(row)
})
},
getBusiCountryNames(ids) { getBusiCountryNames(ids) {
if (ids) { if (ids) {
......
...@@ -582,7 +582,7 @@ ...@@ -582,7 +582,7 @@
</div> </div>
<br /> <br />
<el-form ref="lineform" :model="lineform" :rules="lineform.rules" label-width="160px"> <el-form ref="lineform" :model="lineform" :rules="rules" label-width="160px">
<el-form-item :label="$t('始发港服务')"> <el-form-item :label="$t('始发港服务')">
<el-checkbox-group v-model="lineform.otherService"> <el-checkbox-group v-model="lineform.otherService">
<el-checkbox <el-checkbox
...@@ -652,9 +652,9 @@ ...@@ -652,9 +652,9 @@
<!-- 集运服务费设置 --> <!-- 集运服务费设置 -->
<template> <template>
<el-form-item :label="$t('集运服务费')"> <el-form-item :label="$t('集运服务费')" prop="consServiceFeeCurrency" >
<el-input-number v-model="lineform.consServiceFee" :controls="false" :precision="2" :step="0.1" @change="handleServiceFeeChange"></el-input-number> <el-input-number v-model="lineform.consServiceFee" :controls="false" :precision="2" :step="0.1" @change="handleServiceFeeChange"></el-input-number>
<el-select v-model="lineform.consServiceFeeCurrency" style="margin-left: 20px;" clearable :placeholder="$t('请选择币种')"> <el-select v-model="lineform.consServiceFeeCurrency" style="margin-left: 20px;" clearable :placeholder="$t('请选择币种')">
<el-option <el-option
v-for="item in currencyList" v-for="item in currencyList"
:disabled="item.status === 1" :disabled="item.status === 1"
...@@ -666,7 +666,7 @@ ...@@ -666,7 +666,7 @@
</template> </template>
<!-- 集运验货服务费设置 --> <!-- 集运验货服务费设置 -->
<template> <template>
<el-form-item :label="$t('集运验货服务费')"> <el-form-item :label="$t('集运验货服务费')" prop="consInspectionFeeCurrency">
<el-input-number v-model="lineform.consInspectionFee" :controls="false" :precision="2" :step="0.1" ></el-input-number> <el-input-number v-model="lineform.consInspectionFee" :controls="false" :precision="2" :step="0.1" ></el-input-number>
<el-select v-model="lineform.consInspectionFeeCurrency" style="margin-left: 20px;" clearable :placeholder="$t('请选择币种')"> <el-select v-model="lineform.consInspectionFeeCurrency" style="margin-left: 20px;" clearable :placeholder="$t('请选择币种')">
<el-option <el-option
...@@ -1094,20 +1094,6 @@ export default { ...@@ -1094,20 +1094,6 @@ export default {
consVolumeLimit: "", consVolumeLimit: "",
stockDurationLimit: "", stockDurationLimit: "",
rules:{
consServiceFeeCurrency: [
{
validator: (rule, value, callback) => {
if (this.lineform.consServiceFee != null && !value) {
callback(new Error(this.$t('集运服务费币种不能为空')));
} else {
callback();
}
},
trigger: ['blur', 'change']
}
],
}
}, },
startName: "", startName: "",
destName: "", destName: "",
...@@ -1207,6 +1193,32 @@ export default { ...@@ -1207,6 +1193,32 @@ export default {
}, },
], ],
consServiceFeeCurrency: [
{
validator: (rule, value, callback) => {
if (this.lineform.consServiceFee > 0 && !value) {
callback(new Error(this.$t('集运服务费币种不能为空')));
} else {
callback();
}
},
trigger: ['blur', 'change']
}
],
consInspectionFeeCurrency: [
{
validator: (rule, value, callback) => {
if (this.lineform.consInspectionFee > 0 && !value) {
callback(new Error(this.$t('集运验货服务费币种不能为空')));
} else {
callback();
}
},
trigger: ['blur', 'change']
}
],
}, },
nodeId: this.$route.query.nodeId, nodeId: this.$route.query.nodeId,
// 枚举 // 枚举
...@@ -1590,8 +1602,10 @@ export default { ...@@ -1590,8 +1602,10 @@ export default {
}, },
submitLineForm() { submitLineForm() {
this.$refs["lineform"].validate((valid,errors) => {
this.$refs["lineform"].validate((valid,errors) => {
if (valid) { if (valid) {
// 校验通过,执行保存逻辑 // 校验通过,执行保存逻辑
......
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