Commit 4aeeec21 authored by dcy's avatar dcy

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

parents 84126abb f3327bf5
......@@ -293,20 +293,20 @@ export const constantRoutes = [
name: 'order-special',
meta: {title: '订单特价申请', icon: '', activeMenu: '/order/index'}
},
{
/* {
path: 'discount/:orderItemId(\\d+)',
component: (resolve) => import('@/views/ecw/order/special/discount'),
props: true,
name: 'discount',
meta: {title: '订单优惠申请', icon: '', activeMenu: '/order/index'}
},
{
}, */
/* {
path: 'discount1/:orderItemId(\\d+)',
component: (resolve) => import('@/views/ecw/order/special/discount'),
props: true,
name: 'discount1',
meta: {title: '订单折扣申请', icon: '', activeMenu: '/order/index'}
},
},
{
path: 'speciallight/:orderId(\\d+)',
component: (resolve) => import('@/views/ecw/order/special/light'),
......@@ -328,6 +328,7 @@ export const constantRoutes = [
name: 'special-commission',
meta: {title: '修改佣金规则', icon: '', activeMenu: '/order/index'}
},
*/
{
path: 'associated-order/:orderId(\\d+)',
component: (resolve) => require(['@/views/ecw/order/associatedOrder'],resolve),
......
<template>
<el-dialog visible :close-on-click-modal="false" :before-close="closeDialog" :title="$t('佣金规则')">
<el-form ref="form" :model="form" label-width="80px" :rules="rules">
<el-form-item :label="$t('商品类型')">
<span>{{ $l(productType, 'title') }}</span>
</el-form-item>
<el-form-item :label="$t('商品名称')">
<span>{{ orderItem.prodTitleZh }}</span>
</el-form-item>
<el-form-item :label="$t('英文名称')">
<span>{{ orderItem.prodTitleEn }}</span>
</el-form-item>
<el-form-item :label="$t('线路')">
<dict-tag :type="DICT_TYPE.TRANSPORT_TYPE" :value="order.transportId" />
{{ channel ? $l(channel, 'title') : '' }}
{{$t("从【{departureName}】发往【{objectiveName}", {departureName: $l(order.logisticsInfoDto, 'startTitle'), objectiveName: $l(order.logisticsInfoDto, 'destTitle')})}}
</el-form-item>
<el-form-item :label="$t('是否预付')">
<dict-tag :type="DICT_TYPE.ECW_YESNO" :value="orderItem.isPayAdvance" />
</el-form-item>
<el-row v-if="!orderItem.charging">
<el-col :span="12">
<el-form-item :label="$t('运费')">
{{form.oneSeaFreight}} {{ currencyMap[orderItem.seaFreightCurrency] }} / {{ unitMap[orderItem.seaFreightVolume] }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('清关费')">
{{form.oneClearanceFreight}} {{ currencyMap[form.clearanceFreightCurrency] }} / {{ unitMap[form.clearanceFreightVolume] }}
</el-form-item>
</el-col>
</el-row>
<el-form-item :label="$t('全包价')" v-if="orderItem.charging">
{{orderItem.oneSeaFreight}} {{ currencyMap[form.freightCurrency] }} / {{ unitMap[orderItem.seaFreightVolume] }}
</el-form-item>
<el-form-item :label="$t('佣金类型')" prop="commissionType">
<dict-selector :type="DICT_TYPE.COMMISSION_TYPE" v-model="form.commissionType" form-type="radio" formatter="number" />
</el-form-item>
<!-- 明佣或者明佣+暗佣才显示 -->
<el-form-item label="明佣佣金" v-if="form.commissionType == 1 || form.commissionType == 3">
<el-input v-model.number="form.lightCommissionAmount" placeholder="" class="w-100"></el-input>
{{ currencyMap[orderItem.seaFreightCurrency] }} / {{ unitMap[orderItem.seaFreightVolume] }}
</el-form-item>
<!-- 明佣+暗佣才显示 -->
<el-form-item label="暗佣佣金" v-if="form.commissionType == 3">
<el-input v-model.number="form.shadeCommissionAmount" placeholder="" class="w-100"></el-input>
{{ currencyMap[form.freightCurrency] }} / {{ unitMap[form.freightVolume] }}
</el-form-item>
<!-- 无佣金不显示 -->
<div class="pl-50" v-if="form.commissionType != 0">
<div v-if="form.commissionType != 2">{{$l(orderItem, 'prodTitle')}}</div>
<!-- 明佣+暗佣显示 -->
<div v-if="form.commissionType == 3">
{{$t('成本价')}}{{form.freight}} {{ currencyMap[form.freightCurrency] }} / {{ unitMap[form.freightVolume] }}
</div>
<!-- 暗佣显示 -->
<div v-if="form.commissionType == 2">
{{$l(orderItem, 'prodTitle')}}
<template v-if="darkCommission">
{{$t('暗佣')}}{{darkCommission}} {{ currencyMap[form.freightCurrency] }} / {{ unitMap[form.freightVolume] }}
</template>
<el-link type="primary" @click.native="$router.push('/customer/customerCommission?customerId=' + customerId)">{{$t('去设置')}}</el-link>
</div>
<div v-if="form.commissionType == 1 || form.commissionType == 3">{{$t('销售价')}}{{form.freight + form.shadeCommissionAmount + form.lightCommissionAmount }} {{ 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>
</el-form>
<div class="page-title">审批流程</div>
<work-flow xmlkey="commission_config" v-model="ccIdArr" />
<div v-if="!form.applyStatus">
<el-button type="primary" @click="handleSubmit">提交</el-button>
</div>
<div v-else>
<el-button type="primary" @click="$router.push('/bpm/process-instance/detail?id=' + form.formId)">
<dict-tag :type="DICT_TYPE.APPLY_STATUS" :value="form.applyStatus" />
</el-button>
</div>
</el-dialog>
</template>
<script>
import {createOrderSpecial, getOrderSpecial} from "@/api/ecw/order"
import {getUnitList} from "@/api/ecw/unit"
import {getChannel} from "@/api/ecw/channel"
import { getCurrencyList } from '@/api/ecw/currency'
import { getProductType } from '@/api/ecw/productType'
import WorkFlow from '@/components/WorkFlow'
import {getDarkReturnCommission} from '@/api/ecw/customerCommission'
export default {
name: "OrderSpecialCommission",
props: {
order: Object,
orderItem: Object,
},
components: {
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() {
return {
applyType: 3, // 1是优惠申请2是管理折扣3是佣金设置4是重货优惠5是泡货优惠
unitList:[],
currencyList:[],
ccIdArr: [],
form: {
type: 3
},
rules:{
seaFreight : {required: true, message: '运费不能为空'},
clearanceFreight: {required: true, message: '清关费不能为空'}
},
productType: null,
channel: null,
darkCommission: null
}
},
watch:{
ccIdArr(){
this.$set(this.form, 'ccIds', this.ccIdArr.join(','))
},
'form.commissionType'(val, old){
if(typeof old !='undefined' && old != val){
this.$set(this.form, 'lightCommissionAmount', 0)
this.$set(this.form, 'shadeCommissionAmount', 0)
}
// 暗佣需要查询暗佣设置
if(val == 2){
this.getCommission()
}
}
},
methods: {
handleSubmit(){
this.$refs.form.validate().then(res => {
createOrderSpecial(Object.assign({}, this.form, {applyType: this.applyType})).then(res => {
this.$message.success(this.$t('提交成功'))
this.$emit('success')
})
})
},
getOrderSpecial(){
getOrderSpecial(this.order.orderId, this.applyType, {orderItemId: this.orderItem.orderItemId}).then(r => {
this.form = r.data
})
},
/* getProductTypeNameById(id){
return this.$l(this.productTypeList.find(e => e.id === id), 'title')
}, */
closeDialog(){
this.$emit('close')
},
getCommission(){
getDarkReturnCommission({
customerId: this.order.customerId,
customsType: this.order.customsType,
darkCurrency: this.orderItem.seaFreightCurrency,
darkUnit: this.order.seaFreightVolume,
departureId: this.order.departureVO.departureId,
objectiveId: this.order.objectiveVO.objectiveId,
productAttr: this.orderItem.prodAttrIds.split(',').filter(item => item && item != ''),
productType: this.orderItem.prodType,
transportId: this.order.transportId,
type: 2, // 暗佣
}).then(res => {
this.darkCommission = res.data?.darkCommission
})
}
},
computed: {
// 根据渠道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>
<template>
<el-dialog visible :close-on-click-modal="false" :before-close="closeDialog" :title="$t('优惠申请')">
<el-dialog visible :close-on-click-modal="false" :before-close="closeDialog" :title="applyType == 2 ? $t('管理折扣') : $t('优惠申请')">
<el-form ref="form" :model="form" label-width="80px" :rules="rules">
<el-form-item :label="$t('商品类型')">
<span>{{ $l(productType, 'title') }}</span>
</el-form-item>
<el-form-item :label="$t('商品名称')">
<span>{{ form.prodTitleZh }}</span>
<span>{{ orderItem.prodTitleZh }}</span>
</el-form-item>
<el-form-item :label="$t('英文名称')">
<span>{{ form.prodTitleEn }}</span>
<span>{{ orderItem.prodTitleEn }}</span>
</el-form-item>
<el-form-item :label="$t('线路')">
<dict-tag :type="DICT_TYPE.TRANSPORT_TYPE" :value="form.transportId" />
<dict-tag :type="DICT_TYPE.TRANSPORT_TYPE" :value="order.transportId" />
{{ channel ? $l(channel, 'title') : '' }}
{{$t("从【{departureName}】发往【{objectiveName}", {departureName: form.departureName, objectiveName: form.objectiveName})}}
{{$t("从【{departureName}】发往【{objectiveName}", {departureName: $l(order.logisticsInfoDto, 'startTitle'), objectiveName: $l(order.logisticsInfoDto, 'destTitle')})}}
</el-form-item>
<el-form-item :label="$t('是否预付')">
<dict-tag :type="DICT_TYPE.ECW_YESNO" :value="form.isPayAdvance" />
<dict-tag :type="DICT_TYPE.ECW_YESNO" :value="orderItem.isPayAdvance" />
</el-form-item>
<el-row v-if="!form.charging">
<el-row v-if="!orderItem.charging">
<el-col :span="12">
<el-form-item :label="$t('旧运费')">
{{form.orgSeaFreight}} {{ currentMap[form.seaFreightCurrency] }} / {{ unitMap[form.seaFreightVolume] }}
{{form.orgFreight}} {{ currentMap[form.freightCurrency] }} / {{ unitMap[form.freightVolume] }}
</el-form-item>
</el-col>
<el-col :span="12">
......@@ -31,11 +31,11 @@
</el-form-item>
</el-col>
</el-row>
<el-row v-if="!form.charging">
<el-row v-if="!orderItem.charging">
<el-col :span="12">
<el-form-item :label="$t('新运费')" style="width: 400px" prop="seaFreight">
<el-input v-model="form.seaFreight" type="number" class="w-100" />
{{ currentMap[form.seaFreightCurrency] }} / {{ unitMap[form.seaFreightVolume] }}
{{ currentMap[form.freightCurrency] }} / {{ unitMap[form.freightVolume] }}
</el-form-item>
</el-col>
<el-col :span="12">
......@@ -46,17 +46,17 @@
</el-col>
</el-row>
<el-form-item :label="$t('旧全包价')" v-if="form.charging">
{{form.orgSeaFreight}} {{ currentMap[form.seaFreightCurrency] }} / {{ unitMap[form.seaFreightVolume] }}
<el-form-item :label="$t('旧全包价')" v-if="orderItem.charging">
{{form.freight}} {{ currentMap[form.freightCurrency] }} / {{ unitMap[form.freightVolume] }}
</el-form-item>
<el-form-item :label="$t('新全包价')" style="width: 400px" prop="clearanceFreight" v-if="form.charging">
<el-input v-model="form.seaFreight" type="number" class="w-100" />
{{ currentMap[form.seaFreightCurrency] }} / {{ unitMap[form.seaFreightVolume] }}
<el-form-item :label="$t('新全包价')" style="width: 400px" prop="clearanceFreight" v-if="orderItem.charging">
<el-input v-model="form.freight" type="number" class="w-100" />
{{ currentMap[form.freightCurrency] }} / {{ unitMap[form.freightVolume] }}
</el-form-item>
</el-form>
<div class="page-title">审批流程</div>
<work-flow xmlkey="sheet_sale" v-model="ccIdArr" />
<work-flow xmlkey="special_apply" v-model="ccIdArr" />
<div v-if="!form.applyStatus">
<el-button type="primary" @click="handleSubmit">提交</el-button>
</div>
......@@ -73,39 +73,46 @@ import {createOrderSpecial, getOrderSpecial} from "@/api/ecw/order"
import {getUnitList} from "@/api/ecw/unit"
import {getChannel, getChannelList} from "@/api/ecw/channel"
import { getCurrencyList } from '@/api/ecw/currency'
import { getProductTypeList, getProductType } from '@/api/ecw/productType'
import { getProductType } from '@/api/ecw/productType'
import WorkFlow from '@/components/WorkFlow'
export default {
name: "specialDiscount",
name: "OrderSpecialDiscount",
props: {
order: Object,
orderItemId: Number,
orderItem: Object,
applyType:{ // // 1是优惠申请2是管理折扣3是佣金设置4是重货优惠5是泡货优惠, 默认是优惠申请,可以设置为2表示管理折扣,公用一个组件
type: Number,
default: 1
}
},
components: {
WorkFlow
},
created() {
// 查看详情,列表进来的
if(this.orderItemId){
this.getOrderSpecial()
}
this.getOrderSpecial()
getUnitList().then(res => this.unitList = res.data)
// getChannelList().then(res => this.channelList = res.data)
getCurrencyList().then(res => this.currencyList = res.data)
// getProductTypeList().then(res => this.productTypeList = 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() {
return {
// applyType: 1, // 1是优惠申请2是管理折扣3是佣金设置4是重货优惠5是泡货优惠
unitList:[],
// channelList:[],
currencyList:[],
// productTypeList:[],
ccIdArr: [],
form: {
type: 1
},
form: { },
rules:{
seaFreight : {required: true, message: '运费不能为空'},
clearanceFreight: {required: true, message: '清关费不能为空'}
......@@ -122,23 +129,15 @@ export default {
methods: {
handleSubmit(){
this.$refs.form.validate().then(res => {
createOrderSpecial(Object.assign({}, this.form, {type: 1})).then(res => {
createOrderSpecial(Object.assign({}, this.form, {applyType: this.applyType})).then(res => {
this.$message.success(this.$t('提交成功'))
this.$emit('success')
})
})
},
getOrderSpecial(){
getOrderSpecial(this.order.orderId, 1, {orderItemId: this.orderItemId}).then(r => {
getOrderSpecial(this.order.orderId, this.applyType, {orderItemId: this.orderItem.orderItemId}).then(r => {
this.form = r.data
getProductType(this.form.productType).then(res => {
this.productType = res.data
})
if(this.form.channelId){
getChannel(this.form.channelId).then(res => {
this.channel = res.data
})
}
})
},
/* getProductTypeNameById(id){
......
<template>
<el-dialog visible :close-on-click-modal="false" :before-close="closeDialog" :title="$t('管理折扣')">
<el-form ref="form" :model="form" label-width="80px" :rules="rules">
<el-form-item :label="$t('旧全包价')" v-if="orderItem.charging">
{{form.freight}} {{ currentMap[form.freightCurrency] }} / {{ unitMap[form.freightVolume] }}
</el-form-item>
<el-form-item :label="$t('新全包价')" style="width: 400px" prop="clearanceFreight" v-if="orderItem.charging">
<el-input v-model="form.freight" type="number" class="w-100" />
{{ currentMap[form.freightCurrency] }} / {{ unitMap[form.freightVolume] }}
</el-form-item>
</el-form>
<div class="page-title">审批流程</div>
<work-flow xmlkey="special_apply" v-model="ccIdArr" />
<div v-if="!form.applyStatus">
<el-button type="primary" @click="handleSubmit">提交</el-button>
</div>
<div v-else>
<el-button type="primary" @click="$router.push('/bpm/process-instance/detail?id=' + form.formId)">
<dict-tag :type="DICT_TYPE.APPLY_STATUS" :value="form.applyStatus" />
</el-button>
</div>
</el-dialog>
</template>
<script>
import {createOrderSpecial, getOrderSpecial} from "@/api/ecw/order"
import {getUnitList} from "@/api/ecw/unit"
import {getChannel, getChannelList} from "@/api/ecw/channel"
import { getCurrencyList } from '@/api/ecw/currency'
import { getProductType } from '@/api/ecw/productType'
import WorkFlow from '@/components/WorkFlow'
export default {
name: "OrderSpecialDiscount",
props: {
order: Object,
orderItem: Object,
applyType: Number // 4是重货优惠5是泡货优惠
},
components: {
WorkFlow
},
created() {
// 查看详情,列表进来的
this.getOrderSpecial()
},
data() {
return {
// applyType: 2, //1是优惠申请2是管理折扣3是佣金设置4是重货优惠5是泡货优惠
ccIdArr: [],
form: {
},
rules:{
},
}
},
watch:{
ccIdArr(){
this.$set(this.form, 'ccIds', this.ccIdArr.join(','))
}
},
methods: {
handleSubmit(){
this.$refs.form.validate().then(res => {
createOrderSpecial(Object.assign({}, this.form, {applyType: this.applyType})).then(res => {
this.$message.success(this.$t('提交成功'))
this.$emit('success')
})
})
},
getOrderSpecial(){
getOrderSpecial(this.order.orderId, this.applyType, {}).then(r => {
this.form = r.data
})
},
closeDialog(){
this.$emit('close')
}
}
}
</script>
This diff is collapsed.
<template>
<div class="app-container">
<el-row type="flex" justify="center">
<el-col :xs="24" :sm="24" :md="24" :lg="20" :xl="16">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span style="font-size: 18px;font-weight: bold">{{$t('优惠申请')}}</span>
</div>
<el-form ref="form" :model="form" label-width="80px">
<el-form-item label="商品类型">
<span>{{ getProductAttrNameById(form.prodType) }}</span>
</el-form-item>
<el-form-item label="商品名称">
<span>{{ form.prodTitleZh }}</span>
</el-form-item>
<el-form-item label="英文名称">
<span>{{ form.prodTitleEn }}</span>
</el-form-item>
<el-form-item label="线路">
{{ `【${getDictDataLabel(DICT_TYPE.TRANSPORT_TYPE, form.transportId)}】${ getChannelNameById(form.channelId) }从【${startTitleZh}】发往【${destTitleZh}】`}}
</el-form-item>
<el-form-item label="是否预付">
{{ form.isPayAdvance === 0 ? '' : '' }}
</el-form-item>
<el-form-item label="旧运费" style="width: 400px">
<el-input v-model="form.orgFreight" readonly>
<div slot="prepend" style="width: 60px">{{ currentMap[form.orgFreightCurrency] }}</div>
<div slot="append" style="width: 60px">{{ unitMap[form.orgFreightVolume] }}</div>
</el-input>
</el-form-item>
<el-form-item label="旧清关费" style="width: 400px">
<el-input v-model="form.orgClearanceFreight" readonly>
<div slot="prepend" style="width: 60px">{{ currentMap[form.orgClearanceFreightCurrency] }}</div>
<div slot="append" style="width: 60px">{{ unitMap[form.orgClearanceFreightVolume] }}</div>
</el-input>
</el-form-item>
<el-form-item label="新运费" required style="width: 400px">
<el-input v-model="form.freight" type="number" class="input-with-select">
<div slot="prepend" style="width: 60px">{{ currentMap[form.freightCurrency] }}</div>
<div slot="append" style="width: 60px">{{ unitMap[form.freightVolume] }}</div>
</el-input>
</el-form-item>
<el-form-item label="新清关费" required style="width: 400px">
<el-input v-model="form.clearanceFreight" type="number" class="input-with-select">
<div slot="prepend" style="width: 60px">{{ currentMap[form.clearanceFreightCurrency] }}</div>
<div slot="append" style="width: 60px">{{ unitMap[form.clearanceFreightVolume] }}</div>
</el-input>
</el-form-item>
</el-form>
<div>
<h2>审批流程</h2>
<work-flow xmlkey="free_apply" v-model="form.channelId" />
</div>
<div>
<el-button type="primary" @click="handleSubmit">提交</el-button>
</div>
</el-card>
</el-col>
</el-row>
</div>
</template>
<script>
import {createOrderSpecial, getOrderSpecial, getOrderSpecialByApproveId} from "@/api/ecw/order"
import {DICT_TYPE, getDictDataLabel} from "@/utils/dict"
import DictSelector from "@/components/DictSelector"
import {getUnitList} from "@/api/ecw/unit"
import {getChannelList} from "@/api/ecw/channel"
import { getCurrencyList } from '@/api/ecw/currency'
import { getProductAttrList } from '@/api/ecw/productAttr'
import {openedRouterList} from "@/api/ecw/warehouse"
import WorkFlow from "@/components/WorkFlow"
export default {
name: "specialDiscount",
props: {
orderItemId: String,
id: Number,
readonly: {
type: Boolean,
default: false
}
},
components: {
DictSelector,
WorkFlow
},
created() {
// 临时
if(this.$route.query.orderId){
this.form.orderId = this.$route.query.orderId - 0
// this.getOrder()
}
// 查看详情,列表进来的
if(this.orderItemId){
this.form.orderItemId = this.orderItemId - 0
this.getOrderSpecial()
}
// 从流程查看详情
if(this.id)
this.getOrderSpecialByApproveId()
getUnitList().then(res => this.unitList = res.data)
getChannelList().then(res => this.channelList = res.data)
getCurrencyList().then(res => this.currencyList = res.data)
getProductAttrList().then(res => this.productAttrList = res.data)
},
data() {
return {
getDictDataLabel,
DICT_TYPE,
unitList:[],
channelList:[],
currencyList:[],
productAttrList:[],
form: {
"abnormalState": 0,
"applyResult": "",
"applyStatus": 0,
"applyType": '1',
"ccIds": "",
"channelId": 0,
"charging": 0,
"clearanceFreight": 0,
"clearanceFreightCurrency": 0,
"clearanceFreightVolume": 0,
"commissionCurrencyId": 0,
"commissionType": 0,
"commission_id": 0,
"destAddressEn": "",
"destAddressZh": "",
"destTitleEn": "",
"destTitleZh": "",
"destVolume": "",
"destWarehouseId": 0,
"freight": 0,
"freightCurrency": 0,
"freightVolume": 0,
"inWarehouseState": 0,
"isPayAdvance": 0,
"lightCommissionAmount": 0,
"lineId": 0,
"orderId": 0,
"orderItemId": 0,
"orderNo": "",
"orgClearanceFreight": 0,
"orgClearanceFreightCurrency": 0,
"orgClearanceFreightVolume": 0,
"orgFreight": 0,
"orgFreightCurrency": 0,
"orgFreightVolume": 0,
"orgVWeight": "",
"orgWVolume": "",
"prodId": 0,
"prodTitleEn": "",
"prodTitleZh": "",
"prodType": 0,
"shadeCommissionAmount": 0,
"shipmentState": 0,
"startAddressEn": "",
"startAddressZh": "",
"startTitleEn": "",
"startTitleZh": "",
"startVolume": "",
"startWarehouseId": 0,
"status": 0,
"toWarehouseState": 0,
"transportId": 0,
"vweight": "",
"wvolume": ""
},
startTitleZh: '',
destTitleZh: ''
}
},
methods: {
handleSubmit(){
createOrderSpecial({
"applyType": this.isDiscount ? '2' : '1',
clearanceFreight: this.form.clearanceFreight,
clearanceFreightCurrency: this.form.clearanceFreightCurrency,
clearanceFreightVolume: this.form.clearanceFreightVolume,
orderId: this.form.orderId,
orderItemId: this.form.orderItemId,
freight: this.form.freight,
freightCurrency: this.form.freightCurrency,
freightVolume: this.form.freightVolume,
}).then(r => {
this.$message.success(r.msg || '提交成功')
this.$tab.closePage()
})
},
getOrderSpecial(){
getOrderSpecial(this.form.orderItemId).then(r => {
this.form = r.data
this.form.freight = ''
this.form.clearanceFreight = ''
})
},
getOrderSpecialByApproveId(){
getOrderSpecialByApproveId(this.id).then(r => {
this.form = r.data
})
},
getProductAttrNameById(id){
return this.productAttrList.find(e => e.id === id)?.attrName || ''
}
},
computed: {
// 折扣管理页面
isDiscount(){
return this.$route.query.discount
},
// 根据渠道id显示渠道名
getChannelNameById(){
return channelId => {
const s = this.channelList.find(item => item.channelId == channelId) ?. nameZh
return s ? '' + s + '' : ''
}
},
currentMap(){
let map = {}
this.currencyList.forEach(item => {
map[item.id] = item.titleZh
})
return map
},
unitMap(){
let map = {}
this.unitList.forEach(item => {
map[item.id] = item.titleZh
})
return map
}
},
watch: {
'form.lineId'(val){
if (val){
openedRouterList({lineId: val}).then(r => {
if(r.data && r.data.length > 0){
this.startTitleZh = r.data[0].startTitleZh
this.destTitleZh = r.data[0].destTitleZh
}
})
}
}
}
}
</script>
<style scoped lang="scss">
</style>
......@@ -30,7 +30,7 @@
prop="address"
:label="$t('入库货物属性')">
<template v-slot="{row}">
<!-- // TODO 待测试完善 -->
<!-- // TODO 缺少入库品牌信息 -->
<template v-if="row.warehouseInInfoVO">
{{$t('品牌')}}<dict-tag :type="DICT_TYPE.ECW_IS_BRAND" :value="row.brandType" /><br>
{{$t('箱数')}}{{ row.warehouseInInfoVO.cartonsNum }}<br>
......@@ -49,7 +49,7 @@
<el-table-column
:label="$t('原价')">
<template v-slot="{row}">
<template v-if="!row.originalSeaFreight">未报价</template>
<template v-if="!row.originalSeaFreight">{{$t('未报价')}}</template>
<template v-else-if="row.charging ==1">
{{$t('全包价')}}{{ row.originalSeaFreight }} {{ currencyMap[row.seaFreightCurrency] }}/{{ unitMap[row.seaFreightVolume] }}
</template>
......@@ -63,7 +63,7 @@
<el-table-column
label="成本价">
<template v-slot="{row}">
<template v-if="!row.costSeaFreight">未报价</template>
<template v-if="!row.costSeaFreight">{{$t('未报价')}}</template>
<template v-else-if="row.charging">
{{$t('全包价')}}{{ row.costSeaFreight }} {{ currencyMap[row.seaFreightCurrency] }}/{{ unitMap[row.seaFreightVolume] }}
</template>
......@@ -77,7 +77,7 @@
<el-table-column
:label="$t('销售价')">
<template v-slot="{row}">
<template v-if="!row.oneSeaFreight">未报价</template>
<template v-if="!row.oneSeaFreight">{{$t('未报价')}}</template>
<template v-else-if="row.charging">
{{$t('全包价')}}{{ row.oneSeaFreight }} {{ currencyMap[row.seaFreightCurrency] }}/{{ unitMap[row.seaFreightVolume] }}
</template>
......@@ -93,23 +93,33 @@
prop="address"
:label="$t('操作')">
<template v-slot="{row}">
<el-button size="mini" type="text" v-hasPermi="['ecw:order:update']" @click="showDiscountItemId=row.orderItemId">优惠申请</el-button>
<el-button size="mini" type="text" v-hasPermi="['ecw:order:update']" @click="$router.push(`/order/specialCommission/${row.orderItemId}`)">佣金规则</el-button>
<el-button size="mini" type="text" v-hasPermi="['ecw:order:update']" @click="$router.push(`/order/discount1/${row.orderItemId}?orderId=${row.orderId}&discount=1`)">管理折扣</el-button>
<el-button size="mini" type="text" v-hasPermi="['ecw:order:update']" @click="showDiscountItem=row">{{$t('优惠申请')}}</el-button>
<el-button size="mini" type="text" v-hasPermi="['ecw:order:update']" @click="showCommissionItem=row">{{$t('佣金规则')}}</el-button>
<el-button size="mini" type="text" v-hasPermi="['ecw:order:update']" @click="showAllowanceItem=row">{{$t('管理折扣')}}</el-button>
</template>
</el-table-column>
</el-table>
<div style="text-align: center;margin-top: 80px">
<el-button type="primary" @click="toweight" v-if="hasWarehouseInInfo && (order.transportId === 1 || order.transportId === 2)">申请重货优惠</el-button>
<el-button type="primary" @click="tolight" v-if="hasWarehouseInInfo && (order.transportId === 3 || order.transportId === 4)">申请泡货优惠</el-button>
<el-button type="primary" @click="$tab.closePage()">关闭窗口</el-button>
<div class="mt-50 flex-center">
<!--
1.海运整柜、海运拼柜显示重货优惠 1,2
2.空运专线、海空联运显示泡货优惠 3,4
-->
<el-button type="primary" @click="showPreferentialType=4" v-if="order.transportId === 1 || order.transportId === 2">{{$t('申请重货优惠')}}</el-button>
<el-button type="primary" @click="showPreferentialType=5" v-else>{{$t('申请泡货优惠')}}</el-button>
<el-button type="primary" @click="$tab.closePage()">{{$t('关闭窗口')}}</el-button>
</div>
</el-card>
<special-discount v-if="!!showDiscountItemId" :order="order" :orderItemId="showDiscountItemId" />
<!-- 优惠申请 -->
<discount v-if="!!showDiscountItem" :order="order" :orderItem="showDiscountItem" @close="showDiscountItem=null" @success="onDiscountSuccess" />
<!-- 管理折扣 -->
<discount v-if="!!showAllowanceItem" :order="order" :orderItem="showAllowanceItem" @close="showAllowanceItem=null" :applyType="2" @success="onDiscountSuccess" />
<!-- 佣金规则 -->
<commission v-if="!!showCommissionItem" :order="order" :orderItem="showCommissionItem" @close="showCommissionItem=null" @success="onCommissionSuccess" />
<!-- 重泡货优惠 -->
<preferential v-if="!!showPreferentialType" :applyType="showPreferentialType" :order="order" @close="showPreferentialType=null" @success="onPreferentialSuccess" />
</div>
</template>
......@@ -121,11 +131,13 @@ import {getProductAttrList} from "@/api/ecw/productAttr"
import { parseTime } from '@/utils/ruoyi'
import {getOrder} from "@/api/ecw/order"
import SpecialDiscount from '@/views/ecw/order/components/SpecialDiscount.vue'
import Discount from './Discount'
import Commission from './Commission'
import Preferential from './Preferential'
export default {
name: "OrderSpecial",
components: {
SpecialDiscount
Discount, Commission, Preferential
},
props: {
orderId: [String, Number]
......@@ -138,15 +150,14 @@ export default {
// 遮罩层
loading: true,
list: [],
total:0,
/* total:0,
params:{
page:1,
rows:20,
orderId:0,
type:2
},
}, */
relationId:0,
creatorName:'test',
order: {
number: '',
orderItemVOList: []
......@@ -156,14 +167,14 @@ export default {
productAttrList:[],
hasWarehouseInInfo: false,
showDiscountItemId: null
showDiscountItem: null, // 优惠申请
showCommissionItem: null, // 佣金规则
showAllowanceItem: null, // 管理折扣
showPreferentialType: null, // 重泡货类型
};
},
created() {
if(this.orderId){
this.params.orderId = this.orderId
this.getOrder()
}
this.getOrder()
getUnitList().then(res => this.unitList = res.data)
getCurrencyList().then(res => this.currencyList = res.data)
getProductAttrList().then(res => this.productAttrList = res.data)
......@@ -191,17 +202,18 @@ export default {
path:"/order/specialLight/"+this.params.orderId,
})
},
/* getProductNamesByIds(ids){
const result = []
ids.split(',').forEach(e => {
this.productAttrList.forEach(f => {
if (parseInt(e) === f.id) {
result.push(f.attrName)
}
})
})
return result.join(',')
} */
onDiscountSuccess(){
this.showDiscountItem = null
this.getOrder()
},
onCommissionSuccess(){
this.showCommissionItem = null
this.getOrder()
},
onPreferentialSuccess(){
this.showPreferentialType = null
this.getOrder()
}
},
computed: {
currencyMap(){
......
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