Commit e84f9d69 authored by 我在何方's avatar 我在何方

创建订单自单代报提示

parent 19580036
......@@ -413,6 +413,33 @@ export function getOrderSpecialByApproveId(approveId) {
})
}
// 特价申请-批量
export function createOrderSpecialBatch(data) {
return request({
url: '/ecw/order/special/apply/batch',
method: 'put',
data: data
})
}
// 获得订单特价申请详情-批量
export function getOrderSpecialBatch(orderId, type) {
console.log(orderId, type)
return request({
url: '/ecw/order/special/info/batch/' + orderId + '/' + type,
method: 'get'
})
}
// 根据订单项商品ID与审批类型获得订单商品的特价申请详情-批量
export function getOrderSpecialByApproveIdBatch(approveId) {
return request({
url: '/ecw/order/special/batch/info?approveId=' + approveId,
method: 'get'
})
}
// 订单号检索功能
export function getOrderNoSearch(params) {
return request({
......
......@@ -4041,5 +4041,6 @@
"保费币种": "Premium Currency",
"是否支持控货": "Does it support controlling goods",
"默认送货上门": "Default door-to-door delivery",
"广州市捷道国际货运代理有限公司": "E&C LOGISTICS LIMITED"
"广州市捷道国际货运代理有限公司": "E&C LOGISTICS LIMITED",
"报关退税,请备齐资料。":"Customs refund, prepare necessary documents."
}
......@@ -33,7 +33,19 @@
</div>
</div>
</el-descriptions-item>
<!-- 优惠申请 -->
<el-descriptions-item :label="$t('申请理由')" v-if="type == 31 || type == 32" :span="4">
<div class="bold" v-for="(item,index) in detail" :key="index">
<div>
{{item.charging ? $t('原全包价') : $t('原运费')}}{{item.orgFreight}} {{ currencyMap[item.freightCurrency] }} / {{ unitMap[item.freightVolume] }}
{{item.charging ? $t('新全包价') : $t('新运费')}}{{item.freight}} {{ currencyMap[item.freightCurrency] }} / {{ unitMap[item.freightVolume] }}
</div>
<div v-if="!item.charging">
{{$t('原清关费')}}{{item.orgClearanceFreight}} {{ currencyMap[item.clearanceFreightCurrency] }} / {{ unitMap[item.clearanceFreightVolume] }}
{{$t('新清关费')}}{{item.clearanceFreight}} {{ currencyMap[item.clearanceFreightCurrency] }} / {{ unitMap[item.clearanceFreightVolume] }}
</div>
</div>
</el-descriptions-item>
<!-- 重泡货 -->
<el-descriptions-item :label="$t('申请理由')" v-if="type == 4 || type ==5" :span="4">
<div class="bold" v-if="type == 4">
......
......@@ -324,6 +324,9 @@
/>
</el-form-item>
</div>
<div class="form-section" v-if="form.customsType==2">
<span style="color:red;font-size:14px">{{$t('报关退税,请备齐资料。')}}</span>
</div>
<div class="form-section" v-if="collectionProxy">
<el-form-item :label="$t('是否代收货款')" prop="isCollection">
<dict-selector :type="DICT_TYPE.INFRA_BOOLEAN_STRING" formatter="bool" v-model="form.isCollection" form-type="radio" :disabled="false" />
......
<template>
<el-dialog visible :close-on-click-modal="false" width="80%" :before-close="closeDialog" :title="applyType == 32 ? $t('管理折扣') : $t('优惠申请')">
<el-form ref="form" :model="order" label-width="80px">
<el-form-item :label="$t('订单号')">
<span>{{ order.orderNo }}</span>
</el-form-item>
<el-form-item :label="$t('线路')">{{ $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>
<el-table border :data="form.batchApplyOrderItemDetailVOList">
<el-table-column :label="$t('品名')" align="center">
<template v-slot="{row}">
{{row.prodTitleZh+'/'+row.prodTitleEn}}
</template>
</el-table-column>
<el-table-column :label="$t('填单货物属性')" align="center">
<template slot-scope="scope">
{{$t('品牌')}}<dict-tag :type="DICT_TYPE.ECW_IS_BRAND" :value="order.orderItemVOList[scope.$index].brandType" /><br>
{{$t('箱数')}}{{ order.orderItemVOList[scope.$index].num }}<br>
{{$t('体积')}}{{ order.orderItemVOList[scope.$index].volume }}m³<br>
{{$t('重量')}}{{ order.orderItemVOList[scope.$index].weight }}Kg
</template>
</el-table-column>
<el-table-column
prop="address"
:label="$t('入库货物属性')">
<template slot-scope="scope">
<template v-if="order.orderItemVOList[scope.$index].warehouseInInfoVO">
{{$t('品牌')}}
<template v-if="order.orderItemVOList[scope.$index].brandName">{{order.orderItemVOList[scope.$index].brandName}}</template>
<dict-tag v-else :type="DICT_TYPE.ECW_IS_BRAND" :value="order.orderItemVOList[scope.$index].feeType" /><br>
{{$t('箱数')}}{{ order.orderItemVOList[scope.$index].warehouseInInfoVO.cartonsNum }}<br>
{{$t('体积')}}{{ order.orderItemVOList[scope.$index].warehouseInInfoVO.volume }}m³<br>
{{$t('重量')}}{{ order.orderItemVOList[scope.$index].warehouseInInfoVO.weight }}Kg
</template>
<span v-else>{{$t('暂时没有入库信息')}}</span>
</template>
</el-table-column>
<el-table-column :label="$t('旧费用')" align="center">
<template v-slot="{row}">
<div v-if="!row.charging">
<div>{{$t('旧运费')}}:{{row.orgFreight}} {{ currentMap[row.freightCurrency] }} / {{ unitMap[row.freightVolume] }}</div>
<div>{{$t('旧清关费')}}:{{row.orgClearanceFreight}} {{ currentMap[row.clearanceFreightCurrency] }} / {{ unitMap[row.clearanceFreightVolume] }}</div>
</div>
<div v-else>
{{$t('旧全包价')}}:{{row.orgFreight}} {{ currentMap[row.freightCurrency] }} / {{ unitMap[row.freightVolume] }}
</div>
</template>
</el-table-column>
<el-table-column :label="$t('新费用')" align="center" width="300px">
<template v-slot="{row}">
<div v-if="!row.charging">
<div>{{$t('新运费')}}: <el-input v-model="row.freight" type="number" class="w-100" /> {{ currentMap[row.freightCurrency] }} / {{ unitMap[row.freightVolume] }}</div>
<div>{{$t('新清关费')}}: <el-input v-model="row.clearanceFreight" type="number" class="w-100" /> {{ currentMap[row.clearanceFreightCurrency] }} / {{ unitMap[row.clearanceFreightVolume] }}</div>
</div>
<div v-else>
{{$t('新全包价')}}: <el-input v-model="row.freight" type="number" class="w-100" />{{ currentMap[row.freightCurrency] }} / {{ unitMap[row.freightVolume] }}
</div>
</template>
</el-table-column>
</el-table>
<div class="page-title">{{ $t('审批流程') }}</div>
<work-flow xmlkey="special_apply" v-model="ccIdArr" />
<div v-if="form.applyStatus != 1">
<el-button type="primary" @click="handleSubmit" >{{ $t('提交') }}</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>
<el-button type="primary" @click="cancelAudit">{{ $t('取消审核') }}</el-button>
<el-button type="default" @click="closeDialog">{{ $t('返回') }}</el-button>
</div>
</el-dialog>
</template>
<script>
import {createOrderSpecialBatch, getOrderSpecialBatch} 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 {cancelProcessInstance} from '@/api/bpm/processInstance'
import WorkFlow from '@/components/WorkFlow'
export default {
name: "OrderSpecialDiscount",
props: {
order: Object,
applyType:{ // // 31是优惠申请32是管理折扣
type: Number,
default: 31
}
},
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: 1, // 1是优惠申请2是管理折扣3是佣金设置4是重货优惠5是泡货优惠
unitList:[],
// channelList:[],
currencyList:[],
// productTypeList:[],
ccIdArr: [],
form: { },
productType: null,
channel: null
}
},
watch:{
ccIdArr(){
this.$set(this.form, 'ccIds', this.ccIdArr.join(','))
}
},
methods: {
handleSubmit(){
var fee = false
var msg = ''
this.form.batchApplyOrderItemDetailVOList.map(v=>{
if(v.charging){
if(!v.freight){
fee = true
msg = this.$t('新全包价不能为空')
}else if(v.freight==v.orgFreight){
fee = true
msg = this.$t('新全包价不能与旧全包价一致')
}
}else{
if(!v.clearanceFreight){
fee = true
msg = this.$t('新清关费不能为空')
}
if(!v.freight){
fee = true
msg = this.$t('新运费不能为空')
}
if(v.freight&&v.clearanceFreight){
if(v.freight==v.orgFreight&&v.clearanceFreight==v.orgClearanceFreight){
fee = true
msg = this.$t('新费用不能与旧费用一致')
}
}
}
})
if(fee){
this.$message.error(msg)
return
}
createOrderSpecialBatch(Object.assign({}, this.form, {orderId:this.order.orderId,orderNo:this.order.orderNo},{applyType: this.applyType})).then(res => {
this.$message.success(this.$t('提交成功'))
this.$emit('success')
})
},
getOrderSpecial(){
getOrderSpecialBatch(this.order.orderId, this.applyType).then(r => {
this.form = r.data
})
},
/* getProductTypeNameById(id){
return this.$l(this.productTypeList.find(e => e.id === id), 'title')
}, */
cancelAudit(){
this.$prompt(this.$t('请输入取消原因?'), this.$t("取消审批"), {
type: 'warning',
confirmButtonText: this.$t("确定"),
cancelButtonText: this.$t("取消"),
inputPattern: /^[\s\S]*.*[^\s][\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: this.$t("取消原因不能为空"),
}).then(({ value }) => {
return cancelProcessInstance(this.form.formId, value);
}).then(() => {
this.$modal.msgSuccess(this.$t("取消成功"));
this.closeDialog()
})
},
closeDialog(){
this.$emit('close')
}
},
computed: {
// 是否可以提交
submitable(){
let submitable = false;
if(!this.form.freight || (!this.form.clearanceFreight && !this.form.charging)){
return false
}
[
['orgClearanceFreight', 'clearanceFreight'],
['orgFreight', 'freight']
].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 ? this.$t('') + s + this.$t('') : ''
}
},
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>
......@@ -5,9 +5,12 @@
<!-- 列表 -->
<div class="order-header">
<span style="font-size: 15px;">{{$t('订单号')}}{{ order.orderNo }}</span>
<el-button v-hasPermi="['ecw:order:reduce']" type="primary" @click="showDiscountsIds=order.orderId" >{{$t('批量特价申请')}}</el-button>
<el-button v-hasPermi="['ecw:order:commission']" type="primary" @click="showAllowanceIds=order.orderId" >{{$t('批量管理折扣')}}</el-button>
</div>
<el-table v-loading="loading" :data="order.orderItemVOList">
<el-table v-loading="loading" :data="order.orderItemVOList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column :label="$t('序号')" align="center" prop="id" type="index"></el-table-column>
<el-table-column
prop="prodTitleZh"
......@@ -48,7 +51,7 @@
:formatter="(_, __, v) => parseTime(v)"
:label="$t('最后操作时间')">
</el-table-column>
<el-table-column
:label="$t('原价')">
<template v-slot="{row}">
......@@ -124,6 +127,11 @@
<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" />
<!-- 批量优惠申请 -->
<discounts v-if="!!showDiscountsIds" :order="order" @close="showDiscountsIds=null" @success="onDiscountsSuccess" />
<!-- 批量管理折扣 -->
<discounts v-if="!!showAllowanceIds" :order="order" @close="showAllowanceIds=null" :applyType="32" @success="onDiscountsSuccess" />
<!-- 佣金规则 -->
</div>
</template>
......@@ -138,10 +146,11 @@ import {getOrder} from "@/api/ecw/order"
import Discount from './Discount'
import Commission from './Commission'
import Preferential from './Preferential'
import Discounts from './Discounts'
export default {
name: "OrderSpecial",
components: {
Discount, Commission, Preferential
Discount, Commission, Preferential,Discounts
},
props: {
orderId: [String, Number]
......@@ -175,6 +184,10 @@ export default {
showCommissionItem: null, // 佣金规则
showAllowanceItem: null, // 管理折扣
showPreferentialType: null, // 重泡货类型
showDiscountsIds: null, // 批量优惠申请
showAllowanceIds: null, // 批量管理折扣
multipleSelection:null,
ids:null
};
},
created() {
......@@ -211,6 +224,12 @@ export default {
this.showAllowanceItem = null
this.getOrder()
},
onDiscountsSuccess(){
this.showDiscountsIds = null
this.showAllowanceIds = null
this.multipleSelection = null
this.getOrder()
},
onCommissionSuccess(){
this.showCommissionItem = null
this.getOrder()
......@@ -218,7 +237,12 @@ export default {
onPreferentialSuccess(){
this.showPreferentialType = null
this.getOrder()
}
},
// 表格多选
handleSelectionChange(selection) {
this.multipleSelection = selection
this.ids = selection.map(item => item.orderItemId)
},
},
computed: {
currencyMap(){
......@@ -248,6 +272,9 @@ export default {
padding-bottom: 16px;
display: flex;
align-items: center;
justify-content: space-between;
/* justify-content: space-between; */
}
.order-header button{
margin-left:20px;
}
</style>
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