Commit 8ab8085b authored by 邓春圆's avatar 邓春圆

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

parents 66732690 788acbe4
......@@ -7,7 +7,7 @@
export default {
data(){
return {
valueSync: null
valueSync: undefined
}
},
props:{
......@@ -47,10 +47,12 @@ export default {
},
watch:{
valueSync(val){
this.$emit('input', val)
console.log('valueSync变化', val, this.value)
this.$emit('input', val)
},
value(value){
this.valueSync = value
console.log('value传值变化', value, this.valueSync)
if(value !== undefined)this.valueSync = value
},
optionsFormated(){
this.setDefault()
......@@ -77,4 +79,4 @@ export default {
}
}
}
</script>
\ No newline at end of file
</script>
......@@ -459,7 +459,13 @@ export default {
revoke_clear:{
component:() => import("@/views/ecw/box/components/RevokeClear"),
id: this.processInstance.businessKey
}
},
// 重量超限
over_weight_exception:{
component: () => import('@/views/ecw/order/exception/components/overweightException'),
id: this.processInstance.businessKey,
path: this.processInstance.processDefinition?.formCustomViewPath
},
}
console.log('formCustomViewPath', this.processInstance.processDefinition.formCustomViewPath.trim())
return map[this.processInstance.processDefinition.formCustomViewPath.trim()]
......
......@@ -157,7 +157,9 @@ export default {
unitList:[],
currencyList:[],
form:{
copyUserId:[]
copyUserId:[],
freightUnitId: 6,
clearanceUnitId: 6
},
// 表格多选
multipleSelection: [],
......
......@@ -291,7 +291,7 @@ export default {
this.exportLoading = true;
return exportCargoControl(this.combinedQueryParams);
}).then(response => {
this.$download.excel(response, this.$t('控货订单') + '.xlsx');
this.$message.success(this.$t('已加入导出队列,请稍后在下载日志中下载'))
this.exportLoading = false;
}).catch(() => { });
},
......
......@@ -18,9 +18,9 @@
<el-descriptions-item :label="$t('商品特性')">{{productAttr}}</el-descriptions-item>
<el-descriptions-item :label="$t('用途')">
<div v-if="orderItem.usageIds">
<div v-for="(item,index) in row.usageIds.split(',')">
<div v-for="(item,index) in orderItem.usageIds.split(',')">
<dict-tag :type="DICT_TYPE.OREER_ITEM_USAGE" :value="item" />
<span v-if="(index+1)!=row.usageIds.split(',').length">,</span>
<span v-if="(index+1)!=orderItem.usageIds.split(',').length">,</span>
</div>
</div>
</el-descriptions-item>
......@@ -151,8 +151,8 @@
<el-button type="primary" @click="closeDialog">{{$t('关闭窗口')}}</el-button>
</el-dialog>
<el-dialog :title="$t('入仓影像')" :visible.sync="mvShow" :before-close="closeMv" :close-on-click-modal="false" width="600px">
<div style="display:flex;flex-wrap:wrap">
<el-dialog :title="$t('入仓影像')" :visible.sync="mvShow" :before-close="closeMv" :close-on-click-modal="false">
<!-- <div style="display:flex;flex-wrap:wrap">
<div v-for="(item, index) in pictureUrls" :index="index" :key="index" style="width:80px;height:80px">
<img v-if="item.type === 'image'" :src="item.url" mode="scaleToFill" style="height: 100%" @tap="previewImage(item.url)" />
<video v-else-if="item.type === 'video'" :id="`video_${index}`" style="width: 100%;height: 100%" :src="item.url" @play="playVideo(index)" @tap="playVideo(index)" @fullscreenchange="fullscreenchange"></video>
......@@ -160,15 +160,18 @@
</div>
<div v-if="pictureUrls.length==0">
<span>{{$t('暂无影像')}}</span>
</div>
</div> -->
<image-and-video-upload readonly :fileSize="50" :isShowTip="true" :value="pictureUrls" ></image-and-video-upload>
</el-dialog>
<el-dialog :title="$t('箱明细')" :visible.sync="boxShow" :before-close="closeBox" :close-on-click-modal="false" width="800px">
<el-form>
<WarehouseRecordDetailItem
v-for="(item, index) in boxData"
:key="index" v-model="boxData[index]"
:index="index" :attr-list="attrList"
:readonly="true"
/>
</el-form>
</el-dialog>
</div>
</template>
......@@ -178,10 +181,11 @@ import { DICT_TYPE } from '@/utils/dict'
import { parseTime } from '@/utils/ruoyi'
import WarehouseAreaSelect from "@/components/WarehouseAreaSelect"
import {getProductAttrList} from '@/api/ecw/productAttr'
import ImageAndVideoUpload from '@/components/ImageAndVideoUpload'
import WarehouseRecordDetailItem from "@/views/ecw/order/warehousing/components/WarehouseRecordDetailItem.vue";
export default {
components: {
WarehouseAreaSelect,WarehouseRecordDetailItem
WarehouseAreaSelect,WarehouseRecordDetailItem,ImageAndVideoUpload
},
filters: {parseTime},
props:{
......@@ -287,12 +291,7 @@ export default {
seeMv(list){
this.mvShow=true
if(list){
this.pictureUrls = list.map(e => {
return {
url: e,
type: this.isImageFile(e) ? 'image' : 'video',
}
})
this.pictureUrls = list
}else{
this.pictureUrls = []
}
......
......@@ -733,6 +733,11 @@ export default {
{field: 'hiddenCommission', label: this.$t('暗佣')}
]
// 批量加价
if(row.markupSeaFreight){
freightFields.push({field: 'markupSeaFreight', label: this.$t('批量加价')})
}
// 品牌加价
if(row['brandFreightPrice'] && row['brandFreightPrice'] > 0){
freightFields.push({field: 'brandFreightPrice', label: brandType == 1 ? this.$t('有品牌加价') : this.$t('中性品牌加价')})
......@@ -763,6 +768,10 @@ export default {
{field: 'electrifiedClearanceFeePrice', label: this.$t('带电加价')},
{field: 'discountClearanceFeePrice', label: this.$t('优惠活动减免')}
]
// 批量加价
if(row.markupClearanceFreight){
clearanceFields.push({field: 'markupClearanceFreight', label: this.$t('批量加价')})
}
// 品牌加价
if(row['brandClearanceFeePrice'] && row['brandClearanceFeePrice'] > 0){
clearanceFields.push({field: 'brandClearanceFeePrice', label: brandType == 1 ? this.$t('有品牌加价') : this.$t('中性品牌加价')})
......
<!--拆单审核中的申请信息部分-->
<template>
<div v-if="order">
<el-descriptions :column="3" v-if="order" :colon="false">
<el-descriptions-item :label="$t('订单号')">{{order.orderNo}}</el-descriptions-item>
<el-descriptions-item :label="$t('运输方式')">
<dict-tag class="mr-10" :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="order.transportId" />
</el-descriptions-item>
<el-descriptions-item :label="$t('出货方式')">
{{channel ? channel.nameZh : '/'}}
</el-descriptions-item>
<el-descriptions-item :label="$t('唛头')">{{order.marks}}</el-descriptions-item>
<el-descriptions-item :label="$t('始发仓')">
{{order.logisticsInfoDto.startTitleZh}}
</el-descriptions-item>
<el-descriptions-item :label="$t('目的仓')" :span="2">
{{order.logisticsInfoDto.destAddressZh}}
</el-descriptions-item>
<el-descriptions-item :label="$t('异常描述')" :span="2">
{{$l(orderExceptionData.orderExceptionDescVO, 'desc')}}
</el-descriptions-item>
</el-descriptions>
<div v-for="row in orderItemData" :key="row.orderItemId">
<div v-if="row.charging ==1" class="price_list">
<span>旧成交价:</span>
<div>
<div v-if="!row.oneSeaFreight">
<span>{{$t('全包价')}}:</span>
<span>{{$t('未报价')}}</span>
</div>
<div v-else>
<span>{{$t('全包价')}}:</span>
<span>{{row.oneSeaFreight}} {{currencyMap[row.seaFreightCurrency]}} / {{unitMap[row.seaFreightVolume]}}</span>
</div>
</div>
</div>
<div v-else class="price_list">
<span>旧成交价:</span>
<div>
<div v-if="!row.oneSeaFreight">
<span>{{$t('运费')}}:</span>
<span>{{$t('未报价')}}</span>
</div>
<div v-else>
<span>{{$t('运费')}}:</span>
<span>{{row.oneSeaFreight}} {{currencyMap[row.seaFreightCurrency]}} / {{unitMap[row.seaFreightVolume]}}</span>
</div>
</div>
<div>
<div v-if="!row.oneClearanceFreight">
<span >{{$t('清关费')}}:</span>
<span>{{$t('未报价')}}</span>
</div>
<div v-else>
<span>{{$t('清关费')}}:</span>
<span>{{row.oneClearanceFreight}} {{currencyMap[row.clearanceFreightCurrency]}} / {{unitMap[row.clearanceFreightVolume]}}</span>
</div>
</div>
</div>
</div>
<div v-for="row in loopOrderItem" :key="row.orderItemId">
<div v-if="row.charging ==1" class="price_list">
<span>新成交价:</span>
<div>
<div v-if="!row.oneSeaFreight">
<span >{{$t('全包价')}}:</span>
<span>{{$t('未报价')}}</span>
</div>
<div v-else>
<span >{{$t('全包价')}}:</span>
<span>{{row.oneSeaFreight}} {{currencyMap[row.seaFreightCurrency]}} / {{unitMap[row.seaFreightVolume]}}</span>
</div>
</div>
</div>
<div v-else class="price_list">
<span>新成交价:</span>
<div>
<div v-if="!row.oneSeaFreight">
<span>{{$t('运费')}}:</span>
<span>{{$t('未报价')}}</span>
</div>
<div v-else>
<span >{{$t('运费')}}:</span>
<span>{{row.oneSeaFreight}} {{currencyMap[row.seaFreightCurrency]}} / {{unitMap[row.seaFreightVolume]}}</span>
</div>
</div>
<div>
<div v-if="!row.oneClearanceFreight">
<span >{{$t('清关费')}}:</span>
<span>{{$t('未报价')}}</span>
</div>
<div v-else>
<span>{{$t('清关费')}}:</span>
<span>{{row.oneClearanceFreight}} {{currencyMap[row.clearanceFreightCurrency]}} / {{unitMap[row.clearanceFreightVolume]}}</span>
</div>
</div>
</div>
</div>
<el-descriptions :column="3" v-if="order" :colon="false">
<el-descriptions-item :label="$t('备注')" :span="2">
{{$l(orderExceptionData.orderExceptionRemark, 'desc')}}
</el-descriptions-item>
</el-descriptions>
</div>
</template>
<script>
import {getOrder} from '@/api/ecw/order'
import {getChannel} from '@/api/ecw/channel'
import {getUnitList} from "@/api/ecw/unit"
import { getCurrencyList } from '@/api/ecw/currency'
import {getProductAttrList} from '@/api/ecw/productAttr'
import Decimal from 'decimal.js'
import {getExceptionDetailByBusinessId,getOrderExceptionChannelPriceList} from '@/api/ecw/orderException'
export default {
name: 'overweightException',
props:{
id: [String, Number],
path: String
},
data(){
return {
orderExceptionData: null,
order: null,
channel: null,
unitList:[],
currencyList:[],
detail:null,
loopOrderItem:[],
orderItemData:[]
}
},
watch:{
id(){
this.getData()
},
order(){
if(this.order.channelId){
this.getChannel()
}
},
},
computed:{
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
}
},
async created(){
await getUnitList().then(res => this.unitList = res.data)
await getCurrencyList().then(res => this.currencyList = res.data)
this.productAttrList = (await getProductAttrList()).data
if(this.id){
this.getData()
}
},
methods:{
Decimal,
getData(){
getExceptionDetailByBusinessId({businessId:this.id}).then(res => {
this.orderExceptionData = res.data
if(this.orderExceptionData.orderExceptionRemark){
this.orderExceptionData.orderExceptionRemark=JSON.parse(this.orderExceptionData.orderExceptionRemark)
}
if(res.data.orderId){
getOrder(res.data.orderId).then(res => {
this.order = res.data
this.getExceptionPriceList(res.data.orderId)
})
}
})
},
getProdAtrr(ids){
if(!ids) return ''
let attr = []
let attrIds = ids.split(',')
this.productAttrList.forEach(item=>{
if(attrIds.indexOf(item.id) > -1||attrIds.indexOf(item.id+'')>-1){
attr.push(this.$l(item, 'attrName'))
}
})
return attr.join(',')
},
getChannel(){
getChannel(this.order.channelId).then(res => {
this.channel = res.data
})
},
getExceptionPriceList(orderId){
let that = this
that.loopOrderItem = []
getOrderExceptionChannelPriceList({orderId:orderId,exceptionId:this.orderExceptionData.id,exceptionResultId:parseInt(that.id)}).then(res=>{
if(res.code==0&&res.data.length>0){
that.order.orderItemVOList.map(v=>{
let item = res.data.find(vs=>vs.orderItemId==v.orderItemId)
let orderItem = {}
if(item){
orderItem.oneSeaFreight = item.freightFee
orderItem.seaFreightCurrency = item.freightCurrencyId
orderItem.seaFreightVolume = item.freightUnitId
orderItem.oneClearanceFreight = item.clearanceFee
orderItem.clearanceFreightCurrency = item.clearanceCurrencyId
orderItem.clearanceFreightVolume = item.clearanceUnitId
that.loopOrderItem.push(orderItem)
that.orderItemData.push(v)
}
})
}
})
}
}
}
</script>
<style scoped lang="scss">
.title{
padding: 10px 0;
span{
font-size: 14px;
font-weight: bold;
}
}
.bold{
font-weight: bold;
}
::v-deep .prepay_exception_detail .el-form-item{
margin-bottom: 0;
}
.price_list{
display: flex;
align-items: center;
margin-right:10px;
font-weight: 700;
font-size: 14px;
color:#333;
margin-bottom:10px;
}
.price_list div{
}
</style>
......@@ -379,7 +379,7 @@
</el-dropdown-menu>
</el-dropdown>
<template v-if="exclude(scope.row.status, [0, 11,12,13,14,15,17,18]) && exclude(scope.row.inWarehouseState, [204,205,206])">
<template v-if="exclude(scope.row.status, [0, 11,12,13,14,15,17,18, 32]) && exclude(scope.row.inWarehouseState, [204,205,206])">
<!-- <el-divider direction="vertical"></el-divider> -->
<!--仓库相关的-->
<el-dropdown v-hasPermi="[
......@@ -468,7 +468,8 @@
<!--修改备货-->
<template v-if="
include(scope.row.airShipment, [3, 4, 10]) &&
scope.row.abnormalState === 0
scope.row.abnormalState === 0 &&
scope.row.status <= 5
">
<el-dropdown-item @click.native="$router.push({path:'/order/stocking?action=update&id=' + scope.row.orderId})" v-hasPermi="['ecw:order:stocking_update']">{{$t('修改备货')}}</el-dropdown-item>
</template>
......@@ -896,7 +897,12 @@ export default {
}else if(this.dept){
func = orderDeptStatistics
}
func(this.combinedQueryParams).then(res => {
const query = {...this.combinedQueryParams}
if(query.packageTypeArr && query.packageTypeArr.length){
query.packageType = query.packageTypeArr.join(',')
delete query.packageTypeArr
}
func(query).then(res => {
this.statistics = res.data
})
},
......
......@@ -45,6 +45,13 @@
{{$l(orderExceptionData.orderExceptionDescVO, 'desc')}}
</el-form-item>
</el-row>
<el-row :span="12" v-if="orderExceptionData.orderExceptionType=='order_other_exception'&&orderExceptionData.orderExceptionRemark">
<el-form-item :label="$t('详细说明')+':'">
<!-- <dict-tag :type="DICT_TYPE.ORDER_ERROR_TYPE" :value="orderExceptionData.orderExceptionType" /> -->
<!-- {{orderExceptionData.orderExceptionDescVO?orderExceptionData.orderExceptionDescVO.descZh:''}} -->
{{$l(orderExceptionData.orderExceptionRemark, 'desc')}}
</el-form-item>
</el-row>
<!-- 单证异常,发货人异常,其他异常 不显示这部分内容 -->
<div v-if="['order_doc_exception','order_consignor_exception', 'order_other_exception','overweight_exception','channel_packaging_overweight_exception'].indexOf(orderExceptionData.orderExceptionType) == -1">
......@@ -361,8 +368,9 @@
<el-input style="width: 500px;" type="textarea" v-model="handlerParams.orderExceptionHandlerRemark" :disabled="orderExceptionData.orderExceptionStatus==2" />
</el-form-item>
</el-row>
<!-- 线路单证异常 -->
<div v-if="orderExceptionData.orderExceptionType=='line_loop_exception'">
<!-- 线路单证异常,重量超限,渠道超限异常 -->
<div v-if="orderExceptionData.orderExceptionType=='line_loop_exception'||((orderExceptionData.orderExceptionType=='channel_packaging_overweight_exception'||orderExceptionData.orderExceptionType=='overweight_exception')&&handlerParams.orderExceptionHandlerResult=='allow_over')">
<div v-for="row in loopOrderItem" :key="row.orderItemId">
<div v-if="row.charging ==1">
......@@ -415,7 +423,7 @@
</div>
</div>
<div class="price_list">
<div v-if="!row.oneSeaFreight">
<div v-if="!row.oneClearanceFreight">
<span class="price_label">{{$t('清关费')}}:</span>
<span>{{$t('未报价')}}</span>
</div>
......@@ -768,8 +776,10 @@
待审核可能没有bpmStatus字段
-->
<template v-if="orderExceptionData.bpmStatus == 1 || (orderExceptionData.bpmId && !orderExceptionData.bpmStatus)">
<el-button type="primary" @click="$router.push(`/bpm/process-instance/detail?id=`+orderExceptionData.bpmId)">{{$t('审核中')}}</el-button>
<el-button plain type="primary" @click="cancelAudit">{{$t('取消审核')}}</el-button>
<el-button v-if="['channel_packaging_overweight_exception','overweight_exception'].indexOf(orderExceptionData.orderExceptionType)>-1" type="primary" @click="$router.push(`/bpm/process-instance/detail?id=`+orderExceptionData.bpmId)">{{$t('重量超限改价审核中')}}</el-button>
<el-button v-else type="primary" @click="$router.push(`/bpm/process-instance/detail?id=`+orderExceptionData.bpmId)">{{$t('审核中')}}</el-button>
<el-button v-if="['channel_packaging_overweight_exception','overweight_exception'].indexOf(orderExceptionData.orderExceptionType)>-1" plain type="primary" @click="cancelAudit">{{$t('取消重量超限改价审核')}}</el-button>
<el-button v-else plain type="primary" @click="cancelAudit">{{$t('取消审核')}}</el-button>
<el-button plain type="primary" @click="$store.dispatch('tagsView/delCurrentView')">{{$t('返回')}}</el-button>
</template>
<template v-else-if="orderExceptionData.orderExceptionStatus==2">
......@@ -891,7 +901,7 @@
},
watch:{
'handlerParams.orderExceptionHandlerResult'(val){
if(val == 'no_pay'){
if(val == 'no_pay'||val=="allow_over"){
this.showWorkFlow = true
}else if(val=="continue_channel"){
this.showWorkFlow = true
......@@ -1027,6 +1037,10 @@
if(that.orderExceptionData.orderExceptionAttr){
that.handlerParams.fileList = that.orderExceptionData.orderExceptionAttr.split(',')
}
if(that.orderExceptionData.orderExceptionRemark){
that.orderExceptionData.orderExceptionRemark=JSON.parse(that.orderExceptionData.orderExceptionRemark)
}
// if(response.data.hasOwnProperty('orderItemId')){
// that.getShopData(response.data.orderItemId)
// }
......@@ -1093,12 +1107,17 @@
v.clearanceFreightVolume = this.unitList[1]['id']
}
})
}else if(handlerParams.orderExceptionHandlerResult=='continue_channel'){
this.getExceptionPriceList('continue_channel')
}else if(this.handlerParams.orderExceptionHandlerResult=='line_loop_exception'){
this.getExceptionPriceList('line_loop_exception',1)
}
}
if(this.orderExceptionData.orderExceptionType=='line_loop_exception'){
this.getExceptionPriceList('line_loop_exception')
if(this.handlerParams.orderExceptionHandlerResult=='continue_channel'){
this.getExceptionPriceList('continue_channel',1)
}
if(['channel_packaging_overweight_exception','overweight_exception'].indexOf(this.orderExceptionData.orderExceptionType)>-1&&this.orderExceptionData.orderExceptionStatus=='1'){
this.getExceptionPriceList('continue_channel',2)
}else{
this.getExceptionPriceList('line_loop_exception',1)
}
});
},
......@@ -1203,8 +1222,8 @@
return
}
}
if((this.orderExceptionData.orderExceptionType=='not_shipping_channel_exception')||this.orderExceptionData.orderExceptionType=='line_loop_exception'){
if(this.orderExceptionData.orderExceptionType=='line_loop_exception'){
if(['line_loop_exception','channel_packaging_overweight_exception','overweight_exception','not_shipping_channel_exception'].indexOf(this.orderExceptionData.orderExceptionType)>-1){
if(this.orderExceptionData.orderExceptionType=='line_loop_exception'||((this.orderExceptionData.orderExceptionType=='channel_packaging_overweight_exception'||this.orderExceptionData.orderExceptionType=='overweight_exception')&&this.handlerParams.orderExceptionHandlerResult=='allow_over')){
this.handlerParams.orderItemVOList = this.loopOrderItem
}else{
this.handlerParams.orderItemVOList = this.orderData.orderItemVOList
......@@ -1418,14 +1437,13 @@
return arr
},
//获取提交的不可出渠道异常商品清关费
getExceptionPriceList(type){
getExceptionPriceList(type,index){
let that = this
that.loopOrderItem =[]
if(type=='line_loop_exception'){
this.loopOrderItem =[]
that.orderData.orderItemVOList.map((v,i)=>{
if(v.orderItemId==this.orderExceptionData.orderItemId){
this.loopOrderItem.push(v)
if(v.orderItemId==that.orderExceptionData.orderItemId){
that.loopOrderItem.push(v)
}
})
}else{
......@@ -1442,6 +1460,9 @@
v.clearanceFreightCurrency = item.clearanceCurrencyId
v.clearanceFreightVolume = item.clearanceUnitId
}
if(item&&index==2){
that.loopOrderItem.push(v)
}
})
}
}
......
......@@ -52,18 +52,25 @@
</el-descriptions-item>
</el-descriptions>
<el-row>
<el-col :span="8">
<el-col :span="4">
<el-form-item :label="$t('材质')" style="margin-top: 20px">
<dict-tag :type="DICT_TYPE.ECW_PRODUCT_MATERIAL" :value="orderItemB.material" clearable></dict-tag>
</el-form-item>
</el-col>
<el-col :span="16">
<el-col :span="12">
<el-form-item :label="$t('入仓特性')" style="margin-top: 20px">
<el-checkbox-group v-model="form.warehouseInProdAttrIds" disabled>
<el-checkbox v-for="item in attrList" :key="item.id" :label="item.id">{{ item.attrName }}</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item :label="$t('用途')" style="margin-top: 20px">
<el-checkbox-group v-model="form.usageIds" disabled>
<el-checkbox v-for="item in getDictDatas(DICT_TYPE.WAREHOUSING_RECORD_DETAIL_USAGE)" :key="item.value" :label="item.value">{{ $l(item, 'label') }}</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-col>
</el-row>
<!--<el-form-item :label="$t('入仓时间')" v-if="!edit">
{{form.inTime}}
......@@ -461,6 +468,7 @@ export default {
this.form.prodType = this.warehousing.prodType
this.form.type = this.warehousing.type
this.form.feeType = this.warehousing.feeType
this.form.usageIds = this.warehousing.usageIds?.split(',')
this.warehousing.orderWarehouseInBackItemDoList.forEach(e => {
let bg = {}
......
......@@ -111,17 +111,17 @@
-
<el-input v-model="item.endNum" type="number" placeholder="" class="w-100"></el-input>
/
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.weightUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable class="w-100" />
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.weightUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" class="w-100" />
</el-form-item>
<el-form-item :label="$t('默认运费')" v-if="form.priceType != 1" :prop="`priceStepList.${index}.transportPrice`" :rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}">
<inputor default2="0" v-model.number="item.transportPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10"/>
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.transportPriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable class="w-100" />
/ <selector :disabled="index > 0" @input="syncAllUnit" v-model="item.transportVolumeUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable class="w-100" />
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.transportPriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" class="w-100" />
/ <selector :disabled="index > 0" @input="syncAllUnit" v-model="item.transportVolumeUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" class="w-100" />
</el-form-item>
<el-form-item :label="$t('默认清关费')" v-if="form.priceType != 1 && type != 'air'" :prop="`priceStepList.${index}.transportPrice`" :rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}">
<inputor default2="0" v-model.number="item.clearancePrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" :rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}"/>
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.clearancePriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable class="w-100" />
/ <selector disabled @input="syncAllUnit" v-model="item.clearanceVolumeUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable class="w-100" />
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.clearancePriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" class="w-100" />
/ <selector disabled @input="syncAllUnit" v-model="item.clearanceVolumeUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" class="w-100" />
</el-form-item>
<el-form-item
......@@ -130,31 +130,31 @@
:prop="`priceStepList.${index}.allPrice`"
:rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}"
>
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.allPriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable class="w-100" />
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.allPriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" class="w-100" />
<inputor default2="0" v-model.number="item.allPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 ml-10" :rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}"/>
/ <selector :disabled="index > 0" @input="syncAllUnit" v-model="item.allVolumeUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable class="w-100" />
/ <selector :disabled="index > 0" @input="syncAllUnit" v-model="item.allVolumeUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" class="w-100" />
</el-form-item>
</div>
</template>
<template v-else>
<el-form-item :label="$t('默认全包价')" v-if="form.priceType == 1" prop="allPrice" :rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}">
<selector test="allPriceUnit" v-model="form.allPriceUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100 mr-10 aaa" />
<selector test="allPriceUnit" v-model="form.allPriceUnit" :options="currencyList" :label-field="$l('title')" value-field="id" class="w-100 mr-10 aaa" />
<inputor default2="0" v-model.number="form.allPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr10" />
<span class="mr-10">/</span>
<selector v-model="form.allVolumeUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" />
<selector v-model="form.allVolumeUnit" :options="unitList" :label-field="$l('title')" value-field="id" class="w-100" />
</el-form-item>
<template v-else>
<el-form-item :label="$t('默认运费')" prop="transportPrice" :rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}">
<selector v-model="form.transportPriceUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100 mr-10" />
<selector v-model="form.transportPriceUnit" :options="currencyList" :label-field="$l('title')" value-field="id" class="w-100 mr-10" />
<inputor default2="0" v-model.number="form.transportPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" />
<span class="mr-10">/</span>
<selector v-model="form.transportVolumeUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" />
<selector v-model="form.transportVolumeUnit" :options="unitList" :label-field="$l('title')" value-field="id" class="w-100" />
</el-form-item>
<el-form-item v-if="type != 'air'" :label="$t('默认清关费')" prop="clearancePrice" :rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}">
<selector v-model="form.clearancePriceUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100 mr-10" />
<selector v-model="form.clearancePriceUnit" :options="currencyList" :label-field="$l('title')" value-field="id" class="w-100 mr-10" />
<inputor default2="0" v-model.number="form.clearancePrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" />
<span class="mr-10">/</span>
<selector disabled v-model="form.clearanceVolumeUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" />
<selector disabled v-model="form.clearanceVolumeUnit" :options="unitList" :label-field="$l('title')" value-field="id" class="w-100" />
</el-form-item>
</template>
......@@ -505,7 +505,7 @@ export default {
if(priceType == 1 && !this.form.allPrice){
this.$set(this.form, 'allPriceUnit', 1)
}
this.syncAllUnit()
this.syncAllUnit('watch:form.priceType')
},
'form.minWeightUnit'(minWeightUnit){
console.log('最小起计量单位', minWeightUnit)
......@@ -541,7 +541,7 @@ export default {
if(stepPrice == 1 && (!this.form.priceStepList || !this.form.priceStepList.length)){
this.$set(this.form, 'priceStepList', [{},{}])
}
this.syncAllUnit()
this.syncAllUnit('watch:form.stepPrice')
this.stepPrice = !!stepPrice
},
needPay(val){
......@@ -570,6 +570,13 @@ export default {
if(this.$route.query.readonly){
this.readonly = true
}
if(this.type == 'air'){
this.stepPrice = true
}
const defaultVolumeUnit = this.type === 'air' ? 6 : 7
const defaultPriceUnit = 1
// action=batchUpdate 表示批量修改单个商品的价格(一条或者多条),如果没有ids显示路线选择组件,否则不显示路线组件
// action=update 表示修改单个商品的单条路线价格,需要回显
if(this.$route.query.action == 'update'){
......@@ -594,6 +601,21 @@ export default {
this.form.validateEndDate = parseTime(res.data.validateEndDate)
}
this.lineList = [res.data]
// 如果是阶梯价格,但是一个阶梯价都没有(异常数据),则默认给两个阶梯价
if(this.form.stepPrice == 1 && (!this.form.priceStepList || !this.form.priceStepList.length)){
const defaultStep = this.form.priceType == 1 ? {
allPriceUnit: defaultPriceUnit,
allVolumeUnit: defaultVolumeUnit,
weightUnit: defaultVolumeUnit
} : {
transportVolumeUnit: defaultVolumeUnit,
transportPriceUnit: defaultPriceUnit,
weightUnit: defaultVolumeUnit
}
console.log('阶梯价没有阶梯信息,默认给两个', {...defaultStep})
this.$set(this.form, 'priceStepList', [{...defaultStep},{...defaultStep}])
}
}
// action=batchUpdate且ids不为空
......@@ -641,17 +663,7 @@ export default {
// 是否单询,默认否
needOrderInquiry: 0
}
this.$nextTick(() => {
// 默认体积单位,空运为千克,海运为立方米
this.setDefaultVolumeUnit(this.type === 'air' ? 6 : 7)
// 默认货币单位(美元)
this.setDefaultPriceUnit(1)
// 空运默认的阶梯重量单位是千克
if(this.type === 'air'){
this.$set(this.form.priceStepList[0], 'weightUnit', 6)
}
})
this.form.validateStartDate = parseTime(Date.now())
this.form.validateEndDate = parseTime(Date.now() + 86400*365*2*1000)
......@@ -674,7 +686,21 @@ export default {
})
}
}
if(!this.$route.query.action || this.$route.query.action == 'batchUpdate'){
this.$nextTick(() => {
// 默认体积单位,空运为千克,海运为立方米
console.log('指定默认单位', this.type === 'air' ? 6 : 7)
this.setDefaultVolumeUnit(this.type === 'air' ? 6 : 7)
// 默认货币单位(美元)
this.setDefaultPriceUnit(1)
// 空运默认的阶梯重量单位是千克
if(this.type === 'air'){
this.$set(this.form.priceStepList[0], 'weightUnit', 6)
}
})
}
if (this.$route.query.product_type) {
......@@ -700,18 +726,10 @@ export default {
})
}
})
// 空命则阶梯订单
this.$nextTick(() => {
if(this.type == 'air'){
this.stepPrice = true
}
})
},
methods: {
// 同步全部单位
syncAllUnit(){
syncAllUnit(from){
let obj = this.form.stepPrice == 1 ? this.form.priceStepList[0] : this.form
let fields = {}
// 全包价
......@@ -729,11 +747,11 @@ export default {
}
}
// 全包价还需要同步阶梯的重量单位
// 阶梯价还需要同步阶梯的重量单位
if(this.form.stepPrice == 1){
fields['weightUnit'] = obj.weightUnit
}
console.log('-> 同步特需单位', fields)
console.log('-> 同步特需单位', fields, {from})
this.syncSpecialUnit(fields)
},
// 同步特需的货币单位和体积单位
......
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