Commit f35394d3 authored by dcy's avatar dcy

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

parents b559eec8 7012ac1f
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<el-descriptions class="margin-top" border :title="$t('发货人')" :column="1" :labelStyle="{width:'150px'}"> <el-descriptions class="margin-top" border :title="$t('发货人')" :column="1" :labelStyle="{width:'150px'}">
<el-descriptions-item :label="$t('发货人')">{{order.consignorVO.name}}</el-descriptions-item> <el-descriptions-item :label="$t('发货人')">{{order.consignorVO.name}}</el-descriptions-item>
<el-descriptions-item :label="$t('发货人电话')"> <el-descriptions-item :label="$t('发货人电话')">
{{order.consignorVO.countryCode}} {{order.consignorVO.phone}} +{{order.consignorVO.countryCode}} {{order.consignorVO.phone}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :label="$t('发货人邮箱')">{{order.consignorVO.email}}</el-descriptions-item> <el-descriptions-item :label="$t('发货人邮箱')">{{order.consignorVO.email}}</el-descriptions-item>
<el-descriptions-item :label="$t('发货人公司名称')"> <el-descriptions-item :label="$t('发货人公司名称')">
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<el-descriptions class="margin-top" border :title="$t('收货人')" :column="2" :labelStyle="{width:'150px'}"> <el-descriptions class="margin-top" border :title="$t('收货人')" :column="2" :labelStyle="{width:'150px'}">
<el-descriptions-item :label="$t('收货人')">{{order.consigneeVO.name}}</el-descriptions-item> <el-descriptions-item :label="$t('收货人')">{{order.consigneeVO.name}}</el-descriptions-item>
<el-descriptions-item :label="$t('收货人电话')"> <el-descriptions-item :label="$t('收货人电话')">
{{order.consigneeVO.countryCode}} {{order.consigneeVO.phone}} +{{order.consigneeVO.countryCode}} {{order.consigneeVO.phone}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :label="$t('收货人邮箱')">{{order.consigneeVO.email}}</el-descriptions-item> <el-descriptions-item :label="$t('收货人邮箱')">{{order.consigneeVO.email}}</el-descriptions-item>
<el-descriptions-item :label="$t('收货人公司名称')"> <el-descriptions-item :label="$t('收货人公司名称')">
......
...@@ -22,7 +22,9 @@ ...@@ -22,7 +22,9 @@
<el-row v-if="!orderItem.charging"> <el-row v-if="!orderItem.charging">
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('运费')"> <el-form-item :label="$t('运费')">
{{orderItem.oneSeaFreight}} {{ currencyMap[orderItem.seaFreightCurrency] }} / {{ unitMap[orderItem.seaFreightVolume] }} <!-- {{orderItem.oneSeaFreight}} -->
{{originPrice}}
{{ currencyMap[orderItem.seaFreightCurrency] }} / {{ unitMap[orderItem.seaFreightVolume] }}
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
...@@ -47,7 +49,7 @@ ...@@ -47,7 +49,7 @@
</el-form-item> </el-form-item>
<!-- 明佣+暗佣才显示 --> <!-- 明佣+暗佣才显示 -->
<el-form-item label="暗佣佣金" v-if="form.commissionType == 3"> <el-form-item label="暗佣佣金" v-if="form.commissionType == 3" prop="shadeCommissionAmount" :rules="{type: 'number', max: originPrice.toNumber(), message: '暗佣设置错误', trigger: 'blur'}">
<el-input v-model.number="form.shadeCommissionAmount" placeholder="" class="w-100"></el-input> <el-input v-model.number="form.shadeCommissionAmount" placeholder="" class="w-100"></el-input>
{{ currencyMap[orderItem.seaFreightCurrency] }} / {{ unitMap[orderItem.seaFreightVolume] }} {{ currencyMap[orderItem.seaFreightCurrency] }} / {{ unitMap[orderItem.seaFreightVolume] }}
</el-form-item> </el-form-item>
...@@ -58,7 +60,10 @@ ...@@ -58,7 +60,10 @@
<!-- 明佣+暗佣显示 --> <!-- 明佣+暗佣显示 -->
<div v-if="form.commissionType == 3"> <div v-if="form.commissionType == 3">
{{$t('成本价')}}{{Decimal(form.freight || orderItem.oneSeaFreight).minus(form.shadeCommissionAmount)}} {{ currencyMap[form.freightCurrency] }} / {{ unitMap[form.freightVolume] }} {{$t('成本价')}}
<!-- {{Decimal(form.freight || orderItem.oneSeaFreight).minus(form.shadeCommissionAmount)}} -->
{{ costPrice }}
{{ currencyMap[form.freightCurrency] }} / {{ unitMap[form.freightVolume] }}
</div> </div>
<!-- 暗佣显示 --> <!-- 暗佣显示 -->
...@@ -70,8 +75,16 @@ ...@@ -70,8 +75,16 @@
<el-link type="primary" @click.native="$router.push('/customer/customerCommission?customerId=' + order.customerId)">{{$t('去设置')}}</el-link> <el-link type="primary" @click.native="$router.push('/customer/customerCommission?customerId=' + order.customerId)">{{$t('去设置')}}</el-link>
</div> </div>
<div v-if="form.commissionType == 1 || form.commissionType == 3">{{$t('销售价')}}{{Decimal(form.freight || orderItem.oneSeaFreight).plus(form.lightCommissionAmount) }} {{ currencyMap[form.freightCurrency] }} / {{ unitMap[form.freightVolume] }}</div> <div v-if="form.commissionType == 1 || form.commissionType == 3">
<div v-if="form.commissionType == 3">{{$t('实际佣金返点')}}{{form.shadeCommissionAmount + form.lightCommissionAmount }} {{ currencyMap[form.freightCurrency] }} / {{ unitMap[form.freightVolume] }}</div> {{$t('销售价')}}
<!-- {{Decimal(form.freight || orderItem.oneSeaFreight).plus(form.lightCommissionAmount) }} -->
{{salePrice}}
{{ currencyMap[form.freightCurrency] }} / {{ unitMap[form.freightVolume] }}</div>
<div v-if="form.commissionType == 3">
{{$t('实际佣金返点')}}
{{form.shadeCommissionAmount + form.lightCommissionAmount }}
{{ currencyMap[form.freightCurrency] }} / {{ unitMap[form.freightVolume] }}
</div>
</div> </div>
</el-form> </el-form>
...@@ -100,6 +113,7 @@ import WorkFlow from '@/components/WorkFlow' ...@@ -100,6 +113,7 @@ import WorkFlow from '@/components/WorkFlow'
import {getDarkReturnCommission} from '@/api/ecw/customerCommission' import {getDarkReturnCommission} from '@/api/ecw/customerCommission'
import Decimal from 'decimal.js' import Decimal from 'decimal.js'
import {cancelProcessInstance} from '@/api/bpm/processInstance' import {cancelProcessInstance} from '@/api/bpm/processInstance'
import { number } from "echarts/lib/export"
export default { export default {
name: "OrderSpecialCommission", name: "OrderSpecialCommission",
props: { props: {
...@@ -109,22 +123,6 @@ export default { ...@@ -109,22 +123,6 @@ export default {
components: { components: {
WorkFlow WorkFlow
}, },
created() {
// 查看详情,列表进来的
this.getOrderSpecial()
getUnitList().then(res => this.unitList = res.data)
getCurrencyList().then(res => this.currencyList = res.data)
getProductType(this.orderItem.prodType).then(res => {
this.productType = res.data
})
if(this.order.channelId){
getChannel(this.order.channelId).then(res => {
this.channel = res.data
})
}
},
data() { data() {
return { return {
applyType: 3, // 1是优惠申请2是管理折扣3是佣金设置4是重货优惠5是泡货优惠 applyType: 3, // 1是优惠申请2是管理折扣3是佣金设置4是重货优惠5是泡货优惠
...@@ -143,6 +141,60 @@ export default { ...@@ -143,6 +141,60 @@ export default {
darkCommission: null darkCommission: null
} }
}, },
computed: {
// 是否可以提交
submitable(){
let submitable = false;
[
['orgLightCommissionAmount', 'lightCommissionAmount'],
['orgShadeCommissionAmount', 'shadeCommissionAmount'],
['commissionType', 'orgCommissionType']
].forEach(item => {
if(this.form[item[0]] != this.form[item[1]]){
submitable = true
}
})
return submitable
},
// 根据渠道id显示渠道名
getChannelNameById(){
return channelId => {
const s = this.channelList.find(item => item.channelId == channelId) ?. nameZh
return s ? '' + s + '' : ''
}
},
currencyMap(){
let map = {}
this.currencyList.forEach(item => {
map[item.id] = this.$l(item, 'title')
})
return map
},
unitMap(){
let map = {}
this.unitList.forEach(item => {
map[item.id] = this.$l(item, 'title')
})
return map
},
// 原价
originPrice(){
if(!this.form.orgFreight) return 0
return Decimal(this.form.orgFreight).minus(this.form.orgLightCommissionAmount || 0)
},
// 成本价
costPrice(){
if(!this.originPrice) return 0
return Decimal(this.originPrice).minus(this.form.shadeCommissionAmount || 0)
},
// 销售价
salePrice(){
if(!this.originPrice) return 0
return Decimal(this.originPrice).plus(this.form.lightCommissionAmount || 0)
}
},
watch:{ watch:{
ccIdArr(){ ccIdArr(){
this.$set(this.form, 'ccIds', this.ccIdArr.join(',')) this.$set(this.form, 'ccIds', this.ccIdArr.join(','))
...@@ -160,6 +212,22 @@ export default { ...@@ -160,6 +212,22 @@ export default {
} }
} }
}, },
created() {
// 查看详情,列表进来的
this.getOrderSpecial()
getUnitList().then(res => this.unitList = res.data)
getCurrencyList().then(res => this.currencyList = res.data)
getProductType(this.orderItem.prodType).then(res => {
this.productType = res.data
})
if(this.order.channelId){
getChannel(this.order.channelId).then(res => {
this.channel = res.data
})
}
},
methods: { methods: {
Decimal(n){ Decimal(n){
if(!n) return Decimal if(!n) return Decimal
...@@ -214,43 +282,6 @@ export default { ...@@ -214,43 +282,6 @@ export default {
this.closeDialog() this.closeDialog()
}) })
}, },
},
computed: {
// 是否可以提交
submitable(){
let submitable = false;
[
['orgLightCommissionAmount', 'lightCommissionAmount'],
['orgShadeCommissionAmount', 'shadeCommissionAmount'],
['commissionType', 'orgCommissionType']
].forEach(item => {
if(this.form[item[0]] != this.form[item[1]]){
submitable = true
}
})
return submitable
},
// 根据渠道id显示渠道名
getChannelNameById(){
return channelId => {
const s = this.channelList.find(item => item.channelId == channelId) ?. nameZh
return s ? '' + s + '' : ''
}
},
currencyMap(){
let map = {}
this.currencyList.forEach(item => {
map[item.id] = this.$l(item, 'title')
})
return map
},
unitMap(){
let map = {}
this.unitList.forEach(item => {
map[item.id] = this.$l(item, 'title')
})
return map
}
} }
} }
</script> </script>
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form ref="form" :model="form" :rules="rules" label-width="150px"> <el-form ref="form" :model="form" :rules="rules" label-width="150px">
<products-selector v-model="form.productIdList" class="mb-20" /> <products-selector v-model="form.productIdList" show-all @setall="isAllProduct=$event" class="mb-20" />
<routers-selector v-model="selectedRoutes" /> <routers-selector v-model="selectedRoutes" />
...@@ -222,6 +222,7 @@ export default { ...@@ -222,6 +222,7 @@ export default {
// needBook: 0, // needBook: 0,
// dayLimit: 10000 // dayLimit: 10000
}, },
isAllProduct: false, // 是否全部商品
specialProducts: [], specialProducts: [],
priceStepList: [{},{}], // 阶梯价格 priceStepList: [{},{}], // 阶梯价格
// specialList:[], // 特殊需求,默认四个 // specialList:[], // 特殊需求,默认四个
...@@ -371,10 +372,13 @@ export default { ...@@ -371,10 +372,13 @@ export default {
this.$message.error(this.$t('请选择线路')); this.$message.error(this.$t('请选择线路'));
return; return;
} }
if(!this.isAllProduct && (!this.form.productIdList || !this.form.productIdList.length)){
return this.$message.error('请选择商品')
}
let data = Object.assign({}, this.form, { let data = Object.assign({}, this.form, {
// lineChannelList: this.selectedRoutes, // lineChannelList: this.selectedRoutes,
specialList: this.specialProducts, specialList: this.specialProducts,
isAllProduct: this.form.productIdList.length == 0 ? 1 : 0 isAllProduct: this.isAllProduct ? 1:0
}) })
if(this.form.stepPrice == 1){ if(this.form.stepPrice == 1){
data.priceStepList = this.priceStepList data.priceStepList = this.priceStepList
......
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