Commit d4012634 authored by dragondean@qq.com's avatar dragondean@qq.com

bug

parent 213600ae
......@@ -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'),
......
<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>{{ form.prodTitleZh }}</span>
</el-form-item>
<el-form-item :label="$t('英文名称')">
<span>{{ form.prodTitleEn }}</span>
</el-form-item>
<el-form-item :label="$t('线路')">
<dict-tag :type="DICT_TYPE.TRANSPORT_TYPE" :value="form.transportId" />
{{ channel ? $l(channel, 'title') : '' }}
{{$t("从【{departureName}】发往【{objectiveName}", {departureName: form.departureName, objectiveName: form.objectiveName})}}
</el-form-item>
<el-form-item :label="$t('是否预付')">
<dict-tag :type="DICT_TYPE.ECW_YESNO" :value="form.isPayAdvance" />
</el-form-item>
<el-row v-if="!form.charging">
<el-col :span="12">
<el-form-item :label="$t('旧运费')">
{{form.orgSeaFreight}} {{ currentMap[form.seaFreightCurrency] }} / {{ unitMap[form.seaFreightVolume] }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('旧清关费')">
{{form.orgClearanceFreight}} {{ currentMap[form.clearanceFreightCurrency] }} / {{ unitMap[form.clearanceFreightVolume] }}
</el-form-item>
</el-col>
</el-row>
<el-row v-if="!form.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] }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('新清关费')" style="width: 400px" prop="clearanceFreight">
<el-input v-model="form.clearanceFreight" type="number" class="w-100" />
{{ currentMap[form.clearanceFreightCurrency] }} / {{ unitMap[form.clearanceFreightVolume] }}
</el-form-item>
</el-col>
</el-row>
<el-form-item :label="$t('旧全包价')" v-if="form.charging">
{{form.orgSeaFreight}} {{ currentMap[form.seaFreightCurrency] }} / {{ unitMap[form.seaFreightVolume] }}
</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>
</el-form>
<div class="page-title">审批流程</div>
<work-flow xmlkey="sheet_sale" 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 { getProductTypeList, getProductType } from '@/api/ecw/productType'
import WorkFlow from '@/components/WorkFlow'
export default {
name: "specialDiscount",
props: {
order: Object,
orderItemId: Number,
},
components: {
WorkFlow
},
created() {
// 查看详情,列表进来的
if(this.orderItemId){
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)
},
data() {
return {
unitList:[],
// channelList:[],
currencyList:[],
// productTypeList:[],
ccIdArr: [],
form: {
type: 1
},
rules:{
seaFreight : {required: true, message: '运费不能为空'},
clearanceFreight: {required: true, message: '清关费不能为空'}
},
productType: null,
channel: null
}
},
watch:{
ccIdArr(){
this.$set(this.form, 'ccIds', this.ccIdArr.join(','))
}
},
methods: {
handleSubmit(){
this.$refs.form.validate().then(res => {
createOrderSpecial(Object.assign({}, this.form, {type: 1})).then(res => {
this.$message.success(this.$t('提交成功'))
this.$emit('success')
})
})
},
getOrderSpecial(){
getOrderSpecial(this.order.orderId, 1, {orderItemId: this.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){
return this.$l(this.productTypeList.find(e => e.id === id), 'title')
}, */
closeDialog(){
this.$emit('close')
}
},
computed: {
// 根据渠道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] = 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-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.
This diff is collapsed.
......@@ -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