Commit 02213e1d authored by dragondean@qq.com's avatar dragondean@qq.com

修复备货箱明细没有内容的情况下选择商品明细报错https://zentao.test.jdshangmen.com/bug-view-5719.html

parent b5f66b3f
...@@ -6,7 +6,7 @@ VUE_APP_TITLE = 捷道管理系统-测试站 ...@@ -6,7 +6,7 @@ VUE_APP_TITLE = 捷道管理系统-测试站
# 捷道管理系统/开发环境 # 捷道管理系统/开发环境
VUE_APP_BASE_API = 'https://api.jd.jdshangmen.com' VUE_APP_BASE_API = 'https://apitest.groupage.cn'
# 路由懒加载 # 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true VUE_CLI_BABEL_TRANSPILE_MODULES = true
......
...@@ -12,6 +12,13 @@ ...@@ -12,6 +12,13 @@
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
width="1024px" width="1024px"
:before-close="handleClose"> :before-close="handleClose">
<template v-slot:title>
<div class="flex flex-items-center">
<div class="title flex-1 flex flex-items-center">{{$t('选择订单商品')}}</div>
<el-button v-if="showChooseOrderItem" type="primary" size="mini" @click="handleShowChooseDialog">选择订单商品</el-button>
<div style="width: 100px"><!--占位,防止被关闭按钮挡住--></div>
</div>
</template>
<el-form v-if="dialogVisible"> <el-form v-if="dialogVisible">
<WarehouseRecordDetailItem <WarehouseRecordDetailItem
...@@ -30,6 +37,7 @@ ...@@ -30,6 +37,7 @@
<el-button type="primary" @click="handleSave">确 定</el-button> <el-button type="primary" @click="handleSave">确 定</el-button>
</span> </span>
</el-dialog> </el-dialog>
<choose-order-products v-if="showChooseDialog" :order-id="orderId" @close="showChooseDialog=false" @success="handleChooseOrderProducts"></choose-order-products>
</div> </div>
</template> </template>
...@@ -37,13 +45,15 @@ ...@@ -37,13 +45,15 @@
import ProductSelector from "@/components/ProductSelector/index.vue"; import ProductSelector from "@/components/ProductSelector/index.vue";
import WarehouseRecordDetailItem from "@/views/ecw/order/warehousing/components/WarehouseRecordDetailItem.vue"; import WarehouseRecordDetailItem from "@/views/ecw/order/warehousing/components/WarehouseRecordDetailItem.vue";
import {getProductAttrList} from "@/api/ecw/productAttr"; import {getProductAttrList} from "@/api/ecw/productAttr";
import {getOrderItemCommonAttr} from "@/api/ecw/order";
import ChooseOrderProducts from "@/views/ecw/order/stocking/components/ChooseOrderProducts.vue";
/** /**
* 入仓明细弹窗 * 入仓明细弹窗
*/ */
export default { export default {
name: 'WarehouseRecordDetail', name: 'WarehouseRecordDetail',
components: {WarehouseRecordDetailItem, ProductSelector}, components: {ChooseOrderProducts, WarehouseRecordDetailItem, ProductSelector},
props: { props: {
value: { value: {
...@@ -61,7 +71,10 @@ export default { ...@@ -61,7 +71,10 @@ export default {
num:{ num:{
type:Number, type:Number,
default:0 default:0
} },
// 是否显示添加订单商品按钮
showChooseOrderItem:Boolean,
orderId: Number
}, },
data() { data() {
...@@ -69,7 +82,8 @@ export default { ...@@ -69,7 +82,8 @@ export default {
dialogVisible: false, dialogVisible: false,
dataList: [], dataList: [],
// 特性列表 // 特性列表
attrList: [] attrList: [],
showChooseDialog: false
}; };
}, },
...@@ -158,6 +172,40 @@ export default { ...@@ -158,6 +172,40 @@ export default {
} }
this.$emit('input', this.dataList) this.$emit('input', this.dataList)
this.dialogVisible = false this.dialogVisible = false
},
handleShowChooseDialog(){
this.showChooseDialog = true
},
handleChooseOrderProducts(data){
this.showChooseDialog = false
if(!data?.length) return
// 如果最后一条是空的,则删除先
if(this.dataList?.length){
const index = this.dataList.length - 1
let lastItem = this.dataList[index]
if(!lastItem.prodId && !lastItem.brand && !lastItem.prodAttrIds && !lastItem.material && !lastItem.quantityAll){
this.dataList.splice(index, 1)
}
}
data.forEach(item => {
this.dataList.push({
"boxGauge": "",
"brand": item.brand,
"cartonsNum": undefined,
"createTime": "",
"expressNo": "",
"prodAttrIds": item.prodAttrIds,
"prodId": item.prodId,
"quantityAll": item.quantityAll,
"specificationType": undefined,
"unit": "",
"usageIds": item.usageIds || "",
"volume": undefined,
"weight": undefined,
"material": item.material
})
})
} }
}, },
...@@ -173,5 +221,7 @@ export default { ...@@ -173,5 +221,7 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.title{
font-size: 16px;
}
</style> </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