Commit bfe01737 authored by 邓春圆's avatar 邓春圆

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

parents d384c43d 9d2dda59
...@@ -134,4 +134,10 @@ export function serviceConfig(data) { ...@@ -134,4 +134,10 @@ export function serviceConfig(data) {
}) })
} }
// 数量是否必填
export function quantityRequired(lineId) {
return request({
url: '/ecw/warehouse/quantity/required/' + lineId,
method: 'get'
})
}
...@@ -226,7 +226,7 @@ ...@@ -226,7 +226,7 @@
</el-col>--> </el-col>-->
</el-row> </el-row>
<el-form-item :label="$t('放入箱数')+':'"> <el-form-item :label="$t('放入箱数')+':'">
{{shopForm.num||0}} <el-input-number v-model="shopForm.num" controls-position="right" :min="0" :max="+shopForm.leftNum" @change="calcAverg"></el-input-number>
</el-form-item> </el-form-item>
...@@ -271,10 +271,11 @@ ...@@ -271,10 +271,11 @@
<script> <script>
import { import {
getSplitList, getSplitList,
quantitycheck, // quantitycheck,
createSplitItem, createSplitItem,
deleteSplitItem, deleteSplitItem,
} from "@/api/ecw/orderHandle"; } from "@/api/ecw/orderHandle";
import {quantityRequired} from "@/api/ecw/warehouse";
import { getTradeCityList } from "@/api/ecw/region"; import { getTradeCityList } from "@/api/ecw/region";
import WorkFlow from "@/components/WorkFlow"; import WorkFlow from "@/components/WorkFlow";
import {getOrder, splitItemUpdate} from "@/api/ecw/order"; import {getOrder, splitItemUpdate} from "@/api/ecw/order";
...@@ -405,14 +406,6 @@ export default { ...@@ -405,14 +406,6 @@ export default {
}); });
return _total; return _total;
}, },
/*totalSplitQty() {
let _total = 0;
const { orderSplitItemBackVOList = [] } = this.splitData;
orderSplitItemBackVOList.forEach((v) => {
_total = Decimal.add(_total, Number(v.quantity)).toNumber();
});
return _total;
},*/
/* 打开拆单 */ /* 打开拆单 */
getSplit() { getSplit() {
this.orderItems = this.currRow.goodsList ?? []; this.orderItems = this.currRow.goodsList ?? [];
...@@ -545,11 +538,12 @@ export default { ...@@ -545,11 +538,12 @@ export default {
leftNum = Math.min(leftNum, this.mainOrderItem.num) leftNum = Math.min(leftNum, this.mainOrderItem.num)
// 放入箱数 // 放入箱数
this.$set(this.shopForm, 'num', leftNum) this.$set(this.shopForm, 'num', leftNum)
this.calcAverg()
},
// 按比例计算体积重量的默认值
calcAverg(){
// 装箱比例 // 装箱比例
const rate = leftNum / this.mainOrderItem.num const rate = this.shopForm.num / this.mainOrderItem.num
// 放入个数,剩余个数是算不出来的,因为不知道已装数量,所以放入数量只能按照总数的比例计算 // 放入个数,剩余个数是算不出来的,因为不知道已装数量,所以放入数量只能按照总数的比例计算
this.$set(this.shopForm, 'quantity', Math.ceil(this.mainOrderItem.quantity*rate|| 0 * rate)) this.$set(this.shopForm, 'quantity', Math.ceil(this.mainOrderItem.quantity*rate|| 0 * rate))
...@@ -559,65 +553,8 @@ export default { ...@@ -559,65 +553,8 @@ export default {
this.$set(this.shopForm, 'weight', (this.mainOrderItem.weight * rate).toFixed(2)) this.$set(this.shopForm, 'weight', (this.mainOrderItem.weight * rate).toFixed(2))
this.$set(this.shopForm, 'chargeWeight', (this.mainOrderItem.chargeWeight * rate).toFixed(2)) this.$set(this.shopForm, 'chargeWeight', (this.mainOrderItem.chargeWeight * rate).toFixed(2))
}, },
/*async changeProdTitleZh() {
const item = this.setShopForm("zhId");
this.shopForm.enId = item.id;
this.shopForm = { ...this.shopForm };
await this.getSelectData(item);
},
async changeProdTitleEn() {
const item = this.setShopForm("enId");
this.shopForm.zhId = item.id;
this.shopForm = { ...this.shopForm };
await this.getSelectData(item);
},
setShopForm(key) {
let list = [];
list = this.orderItems.filter((item) => item.id == this.shopForm[key]);
const data = list[0];
const itemNum = data.num ?? 0;
const itemQty = data.quantity ?? 0;
// 获取拆单项的总num
const total = this.totalSplitNum();
// 订单的剩余
const orderNum = this.currRow.num - this.currRow.installNum;
// 剩余可装
const remainNum = Decimal.sub(orderNum, total).toNumber();
this.shopForm.num = 0;
this.shopForm.putNum = 0;
// 剩余可装大于等于订单项剩余,显示订单剩余
if (remainNum >= itemNum) {
this.shopForm.num = remainNum;
this.shopForm.putNum = itemNum;
}
// 订单剩余小于订单项剩余,显示订单项剩余
if (remainNum < itemNum) {
this.shopForm.num = this.shopForm.putNum = remainNum;
}
const totalQty = this.totalSplitQty();
this.shopForm.quantity = 0;
if (totalQty >= itemQty) {
this.shopForm.quantity = totalQty;
}
if (totalQty < itemQty) {
this.shopForm.quantity = itemQty;
}
this.shopForm.orderItemId = data.orderItemId;
this.shopForm.putQuantity = Decimal.div(
this.shopForm.quantity,
this.shopForm.num
).toFixed(0);
return data;
},*/
async getSelectData(item) { async getSelectData(item) {
await quantitycheck({ await quantityRequired(this.orderData.lineId).then((res) => {
seaFreightVolume: item.seaFreightVolume,
clearanceFreightVolume: item.clearanceFreightVolume,
}).then((res) => {
if (res.data) { if (res.data) {
this.isQuantity = true; this.isQuantity = true;
this.shopRules.putQuantity = [ this.shopRules.putQuantity = [
......
...@@ -1045,6 +1045,7 @@ export default { ...@@ -1045,6 +1045,7 @@ export default {
this.routerList = [] this.routerList = []
this.$nextTick(() => { this.$nextTick(() => {
console.log('清理表单校验和路线') console.log('清理表单校验和路线')
this.addProduct()
this.$refs.form.clearValidate() this.$refs.form.clearValidate()
}) })
this.$modal.msgSuccess(this.$t("新增成功")); this.$modal.msgSuccess(this.$t("新增成功"));
......
...@@ -96,7 +96,8 @@ ...@@ -96,7 +96,8 @@
</el-row> </el-row>
<el-row v-if="scope.row.warehouseInInfoVO"> <el-row v-if="scope.row.warehouseInInfoVO">
<span>{{$t('品牌')}} <span>{{$t('品牌')}}
<dict-tag :type="DICT_TYPE.ECW_IS_BRAND" :value="scope.row.feeType" /> <template v-if="scope.row.brandName">{{scope.row.brandName}}</template>
<dict-tag v-else :type="DICT_TYPE.ECW_IS_BRAND" :value="scope.row.feeType" />
</span> </span>
<span style="margin-left: 10px;">{{$t('箱数')}}:{{!scope.row.warehouseInInfoVO?0:scope.row.warehouseInInfoVO.cartonsNum}}</span> <span style="margin-left: 10px;">{{$t('箱数')}}:{{!scope.row.warehouseInInfoVO?0:scope.row.warehouseInInfoVO.cartonsNum}}</span>
<span style="margin-left: 10px;">{{$t('体积')}}:{{!scope.row.warehouseInInfoVO?0:scope.row.warehouseInInfoVO.volume}}m³</span> <span style="margin-left: 10px;">{{$t('体积')}}:{{!scope.row.warehouseInInfoVO?0:scope.row.warehouseInInfoVO.volume}}m³</span>
...@@ -137,8 +138,8 @@ ...@@ -137,8 +138,8 @@
<div> <div>
<el-button v-if="index==0" disabled type="primary" @click="addShop(index)">{{$t('放入')}}</el-button> <el-button v-if="index==0" disabled type="primary" @click="addShop(index)">{{$t('放入')}}</el-button>
<el-button v-if="index!=0" type="primary" @click="addShop(index)">{{$t('放入')}}</el-button> <el-button v-if="index!=0" type="primary" @click="addShop(index)">{{$t('放入')}}</el-button>
<el-button v-if="index==0" disabled type="primary" plain @click="deleteSplit(item.id)">{{$t('删除')}}</el-button> <!--<el-button v-if="index==0" disabled type="primary" plain @click="deleteSplit(item.id)">{{$t('删除')}}</el-button>-->
<el-button v-if="index!=0" type="primary" plain @click="deleteSplit(item.id)">{{$t('删除')}}</el-button> <el-button :disabled="index < splitData.length - 1" type="primary" plain @click="deleteSplit(item.id)">{{$t('删除')}}</el-button>
</div> </div>
</div> </div>
<el-table v-if="item.orderSplitItemBackVOList" border :data="item.orderSplitItemBackVOList"> <el-table v-if="item.orderSplitItemBackVOList" border :data="item.orderSplitItemBackVOList">
...@@ -151,7 +152,8 @@ ...@@ -151,7 +152,8 @@
<el-table-column :label="$t('英文名')" align="center" prop="prodTitleEn" /> <el-table-column :label="$t('英文名')" align="center" prop="prodTitleEn" />
<el-table-column :label="$t('品牌')" align="center"> <el-table-column :label="$t('品牌')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :type="DICT_TYPE.ECW_IS_BRAND" :value="scope.row.brandType" /> <template v-if="scope.row.brandName">{{scope.row.brandName}}</template>
<dict-tag v-else :type="DICT_TYPE.ECW_IS_BRAND" :value="scope.row.feeType" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('入仓体积')" align="center" > <el-table-column :label="$t('入仓体积')" align="center" >
...@@ -310,10 +312,9 @@ import { ...@@ -310,10 +312,9 @@ import {
createSplitItem, createSplitItem,
deleteSplitItem, deleteSplitItem,
deleteSplit, deleteSplit,
quantitycheck,
deleteAllSplit deleteAllSplit
} from "@/api/ecw/orderHandle" } from "@/api/ecw/orderHandle"
import {getWarehouseList} from '@/api/ecw/warehouse' import {getWarehouseList, quantityRequired} from '@/api/ecw/warehouse'
import {getChannelList} from '@/api/ecw/channel' import {getChannelList} from '@/api/ecw/channel'
import WorkFlow from '@/components/WorkFlow' import WorkFlow from '@/components/WorkFlow'
import {getOrder, splitItemUpdate} from '@/api/ecw/order' import {getOrder, splitItemUpdate} from '@/api/ecw/order'
...@@ -378,17 +379,22 @@ export default { ...@@ -378,17 +379,22 @@ export default {
if (this.$route.query.orderId) { if (this.$route.query.orderId) {
this.queryParams.orderId = this.$route.query.orderId this.queryParams.orderId = this.$route.query.orderId
} }
await this.getList() Promise.all([this.getList(), this.getOrder()]).then(res => {
this.getOrder() console.log("拆单数据", this.splitData, this.splitData.length)
console.log("拆单数据", this.splitData, this.splitData.length) if(this.orderData.inWarehouseState != 207 && this.splitData.length){
if(this.splitData.length){ // 2023-05-20确认不需要询问,直接重置
this.$confirm(this.$t('已有拆单数据,是否要重置?')).then(res => { deleteAllSplit(this.queryParams.orderId).then(res => {
return deleteAllSplit(this.queryParams.orderId) this.getList()
}).then(res => { })
this.getList() /*this.$confirm(this.$t('已有拆单数据,是否要重置?')).then(res => {
this.$message.success("重置成功") return deleteAllSplit(this.queryParams.orderId)
}) }).then(res => {
} this.getList()
this.$message.success("重置成功")
})*/
}
})
}, },
watch: { watch: {
//监听table这个对象 //监听table这个对象
...@@ -467,7 +473,7 @@ export default { ...@@ -467,7 +473,7 @@ export default {
}, },
getOrder(){ getOrder(){
this.loading = true; this.loading = true;
getOrder(this.queryParams.orderId).then(response => { return getOrder(this.queryParams.orderId).then(response => {
this.orderData = response.data this.orderData = response.data
this.query.destWarehouseId = response.data.logisticsInfoDto.startWarehouseId this.query.destWarehouseId = response.data.logisticsInfoDto.startWarehouseId
this.loading = false this.loading = false
...@@ -612,15 +618,15 @@ export default { ...@@ -612,15 +618,15 @@ export default {
this.shopForm.prodTitleEn = list[0].prodTitleEn this.shopForm.prodTitleEn = list[0].prodTitleEn
this.shopForm.prodTitleZh = list[0].prodTitleZh this.shopForm.prodTitleZh = list[0].prodTitleZh
var orderItemData = this.orderData.orderItemVOList.find(item=>item.orderItemId==this.shopForm.orderItemId) var orderItemData = this.orderData.orderItemVOList.find(item=>item.orderItemId==this.shopForm.orderItemId)
var params = { /*var params = {
'seaFreightVolume':orderItemData.seaFreightVolume, 'seaFreightVolume':orderItemData.seaFreightVolume,
'clearanceFreightVolume':orderItemData.clearanceFreightVolume 'clearanceFreightVolume':orderItemData.clearanceFreightVolume
} }
console.log(orderItemData) console.log(orderItemData)*/
this.numcheck(params) this.numcheck()
}, },
numcheck(params){ numcheck(){
quantitycheck(params).then(res=>{ quantityRequired(this.orderData.lineId).then(res=>{
this.quantityshow = res.data this.quantityshow = res.data
}) })
}, },
......
...@@ -88,22 +88,22 @@ ...@@ -88,22 +88,22 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('重货方数')" v-if="type=='order_heavy_cargo_exception'"> <el-table-column :label="$t('重货方数')" v-if="type=='order_heavy_cargo_exception'">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{scope.row.weVolume||0}}CBM</span> <span>{{scope.row.chargeVolume||0}}CBM</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('泡货方数')" v-if="type!='order_heavy_cargo_exception'"> <el-table-column :label="$t('泡货方数')" v-if="type!='order_heavy_cargo_exception'">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{scope.row.weVolume||0}}CBM</span> <span>{{scope.row.chargeVolume||0}}CBM</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('重货重量')" v-if="type=='order_heavy_cargo_exception'"> <el-table-column :label="$t('重货重量')" v-if="type=='order_heavy_cargo_exception'">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{scope.row.voWeight||0}}KG</span> <span>{{scope.row.chargeWeight ||0}}KG</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('泡货重量')" v-if="type!='order_heavy_cargo_exception'" > <el-table-column :label="$t('泡货重量')" v-if="type!='order_heavy_cargo_exception'" >
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{scope.row.vweight||0}}KG</span> <span>{{scope.row.chargeWeight ||0}}KG</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('最后操作时间')" scope="handlerTime" /> <el-table-column :label="$t('最后操作时间')" scope="handlerTime" />
......
...@@ -152,7 +152,7 @@ ...@@ -152,7 +152,7 @@
</el-form-item> </el-form-item>
</template> </template>
</template> </template>
<!--特需--> <!--特需-->
<template v-if="form.priceType==1"> <template v-if="form.priceType==1">
<el-form-item <el-form-item
...@@ -192,7 +192,7 @@ ...@@ -192,7 +192,7 @@
<selector disabled v-model="special.clearanceVolumeUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" /> <selector disabled v-model="special.clearanceVolumeUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
</el-form-item> </el-form-item>
</template> </template>
<el-form-item :label="$t('价格有效期')"> <el-form-item :label="$t('价格有效期')">
<el-date-picker v-model="form.validateStartDate" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker> <el-date-picker v-model="form.validateStartDate" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
...@@ -253,7 +253,7 @@ ...@@ -253,7 +253,7 @@
<div>{{ $t('预付') }}<dict-tag :type="DICT_TYPE.ECW_PAY_ADVANCE" :value="row.detail.needPay" /></div> <div>{{ $t('预付') }}<dict-tag :type="DICT_TYPE.ECW_PAY_ADVANCE" :value="row.detail.needPay" /></div>
<div>{{ $t('单价模式') }}<dict-tag :type="DICT_TYPE.ECW_PRICE_TYPE" :value="row.detail.priceType" /></div> <div>{{ $t('单价模式') }}<dict-tag :type="DICT_TYPE.ECW_PRICE_TYPE" :value="row.detail.priceType" /></div>
<div v-if="row.detail.minWeight">{{ $t('最小起计量') }}{{ row.detail.minWeight }}{{unitMap[row.detail.minWeightUnit]}}</div> <div v-if="row.detail.minWeight">{{ $t('最小起计量') }}{{ row.detail.minWeight }}{{unitMap[row.detail.minWeightUnit]}}</div>
<!----阶梯定价--> <!----阶梯定价-->
<template v-if="row.detail.stepPrice == 1"> <template v-if="row.detail.stepPrice == 1">
<template v-for="(item, index) in row.detail.priceStepList"> <template v-for="(item, index) in row.detail.priceStepList">
...@@ -292,7 +292,7 @@ ...@@ -292,7 +292,7 @@
全包价: 全包价:
{{row.detail.allPrice}} {{currencyMap[row.detail.allPriceUnit]}} / {{unitMap[row.detail.allVolumeUnit]}} {{row.detail.allPrice}} {{currencyMap[row.detail.allPriceUnit]}} / {{unitMap[row.detail.allVolumeUnit]}}
</div> </div>
<template v-for="(item, index) in row.detail.specialList"> <template v-for="(item, index) in row.detail.specialList">
<template v-if="row.detail.priceType != 1"> <template v-if="row.detail.priceType != 1">
<div :key="item.specialDictType + '_freight'" > <div :key="item.specialDictType + '_freight'" >
...@@ -384,7 +384,7 @@ export default { ...@@ -384,7 +384,7 @@ export default {
}) })
return map return map
} }
}, },
watch: { watch: {
showLogsDialog(showLogsDialog){ showLogsDialog(showLogsDialog){
...@@ -587,7 +587,7 @@ export default { ...@@ -587,7 +587,7 @@ export default {
warehouseLineDO: {... res.data[0]} warehouseLineDO: {... res.data[0]}
})] })]
}) })
} }
} }
...@@ -630,9 +630,9 @@ export default { ...@@ -630,9 +630,9 @@ export default {
"transportVolumeUnit": null, "transportVolumeUnit": null,
}) })
} }
}) })
}, },
methods: { methods: {
// 同步全部单位 // 同步全部单位
...@@ -735,7 +735,7 @@ export default { ...@@ -735,7 +735,7 @@ export default {
this.form.priceStepList.forEach(item => { this.form.priceStepList.forEach(item => {
let notEmptyFields = ['startNum', 'endNum', 'weightUnit'] let notEmptyFields = ['startNum', 'endNum', 'weightUnit']
notEmptyFields.forEach(field => { notEmptyFields.forEach(field => {
if(item[field].toString().trim() == ''){ if(!item[field] || item[field].toString().trim() == ''){
stepPriceEmpty = true stepPriceEmpty = true
} }
}) })
...@@ -744,7 +744,7 @@ export default { ...@@ -744,7 +744,7 @@ export default {
} }
}) })
if(stepPriceEmpty){ if(stepPriceEmpty){
return this.$message.error(this.$t('阶梯价格设置不能留空')) return this.$message.error(this.$t('阶梯价格设置不能留空'))
} }
} }
......
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