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

备货明细选择订单商品

parent ad5e60d0
......@@ -1023,3 +1023,11 @@ export function getParentOrder(orderId){
method: 'get'
})
}
// 获取订单入仓商品明细通用属性集合,用于备货选择订单商品到明细
export function getOrderItemCommonAttr(orderId){
return request({
url: '/order/order-warehouse-in/get-order-warehouse-in-common-attr-list?orderId=' + orderId,
method: 'get'
})
}
<template>
<el-dialog
:title="$t('选择订单商品')"
:visible.sync="visible"
width="90vw"
>
<el-table ref="multipleTable" :data="orderItemDetails" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column :label="$t('品名')" prop="name">
<template #default="{row}">{{$l(row, "prodName")}}</template>
</el-table-column>
<el-table-column :label="$t('品牌')" prop="brand">
<template #default="{row}">{{$l(row, "brandName")}}</template>
</el-table-column>
<el-table-column :label="$t('材质')" prop="material">
<template #default="{row}">{{$l(row, "materialLabel")}}</template>
</el-table-column>
<el-table-column :label="$t('商品特性')" prop="attr">
<template #default="{row}">{{$l(row, "prodAttrNames")}}</template>
</el-table-column>
<el-table-column :label="$t('用途')" prop="unit">
<template #default="{row}">{{$l(row, "usageNames")}}</template>
</el-table-column>
<el-table-column :label="$t('数量')" prop="quantityAll"></el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleSubmit">{{$t('确定')}}</el-button>
<el-button @click="handleClose">{{$t('取消')}}</el-button>
</div>
</el-dialog>
</template>
<script>
import ProductSelector from "@/components/ProductSelector"
import WarehouseAreaSelect from "@/components/WarehouseAreaSelect"
import {getFeeTypeByOrderProduct, getProductBrankPage} from "@/api/ecw/productBrank"
import {cancelProcessInstance} from "@/api/bpm/processInstance"
import WorkFlow from "@/components/WorkFlow"
import {DICT_TYPE, getDictDataLabel, getDictDatas} from "@/utils/dict"
import {finishPacked, getOrderItemCommonAttr, orderWarehouseIn, orderWarehouseInUpdateApply} from "@/api/ecw/order"
import {getProductAttrList} from "@/api/ecw/productAttr"
import {getProductTypeList} from "@/api/ecw/productType"
import {addProduct} from "@/api/ecw/product"
import WarehouseRecordDetail from "@/views/ecw/order/warehousing/components/WarehouseRecordDetail.vue";
import ImageAndVideoUpload from "@/components/ImageAndVideoUpload/index.vue";
import Template from "@/views/cms/template/index.vue";
export default {
props: {
orderId: {
type: Number,
default: undefined
}
},
data(){
return {
visible: true,
// 备选的商品明细
orderItemDetails: [],
multipleSelection:[]
}
},
watch:{
visible(val){
if (!val) {
this.$emit('close')
}
},
},
async created() {
getOrderItemCommonAttr(this.orderId).then(res => {
this.orderItemDetails = res.data
})
},
methods: {
handleSelectionChange(e){
console.log("handleSelectionChange", e)
this.multipleSelection = e
},
handleSubmit(){
this.$emit("success", this.multipleSelection)
},
handleClose() {
this.visible = false
}
}
}
</script>
<style scoped>
</style>
<template>
<el-dialog
<el-dialog
:title="$t('添加新品名')"
:visible.sync="visible"
width="90vw"
......
......@@ -65,9 +65,9 @@
<el-button type="text" @click="showMedia(props.row)">{{$t('查看')}}</el-button>
</template>
</el-table-column>
<el-table-column prop="areaName" :label="$t(' ')" width="220px">
<el-table-column prop="areaName" width="220px">
<template v-slot="{row}">
<WarehouseRecordDetail v-model="row.orderWarehouseInDetailsVOList" @input="saveDetail(props.row)" />
<WarehouseRecordDetail v-model="row.orderWarehouseInDetailsVOList" @input="saveDetail(props.row)" show-choose-order-item :order-id="orderId" />
<el-button class="pl-5 pr-5" size="mini" type="primary" @click="package(props.row, $t('修改打包'))">{{$t('修改')}}</el-button>
<el-button class="pl-5 pr-5" size="mini" type="danger" @click="package(props.row, $t('修改打包'))">{{$t('删除')}}</el-button>
</template>
......
......@@ -24,12 +24,14 @@
</el-form>
<el-button v-show="!readonly" type="primary" size="mini" @click="handleAddItem">添加一条明细</el-button>
<el-button v-if="showChooseOrderItem" type="primary" size="mini" @click="handleShowChooseDialog">选择订单商品</el-button>
<span v-show="!readonly" slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="handleSave">确 定</el-button>
</span>
</el-dialog>
<choose-order-products v-if="showChooseDialog" :order-id="orderId" @close="showChooseDialog=false" @success="handleChooseOrderProducts"></choose-order-products>
</div>
</template>
......@@ -37,13 +39,15 @@
import ProductSelector from "@/components/ProductSelector/index.vue";
import WarehouseRecordDetailItem from "@/views/ecw/order/warehousing/components/WarehouseRecordDetailItem.vue";
import {getProductAttrList} from "@/api/ecw/productAttr";
import {getOrderItemCommonAttr} from "@/api/ecw/order";
import ChooseOrderProducts from "@/views/ecw/order/stocking/components/ChooseOrderProducts.vue";
/**
* 入仓明细弹窗
*/
export default {
name: 'WarehouseRecordDetail',
components: {WarehouseRecordDetailItem, ProductSelector},
components: {ChooseOrderProducts, WarehouseRecordDetailItem, ProductSelector},
props: {
value: {
......@@ -61,7 +65,10 @@ export default {
num:{
type:Number,
default:0
}
},
// 是否显示添加订单商品按钮
showChooseOrderItem:Boolean,
orderId: Number
},
data() {
......@@ -69,7 +76,8 @@ export default {
dialogVisible: false,
dataList: [],
// 特性列表
attrList: []
attrList: [],
showChooseDialog: false
};
},
......@@ -158,6 +166,36 @@ export default {
}
this.$emit('input', this.dataList)
this.dialogVisible = false
},
handleShowChooseDialog(){
this.showChooseDialog = true
},
handleChooseOrderProducts(data){
this.showChooseDialog = false
if(!data?.length) return
// 如果第一条是空的,则删除先
let firstItem = this.dataList[0]
if(!firstItem.prodId && !firstItem.brand && !firstItem.prodAttrIds && !firstItem.material && !firstItem.quantityAll){
this.dataList.splice(0, 1)
}
data.forEach(item => {
this.dataList.push({
"boxGauge": "",
"brand": item.brand,
"cartonsNum": undefined,
"createTime": "",
"expressNo": "",
"prodAttrIds": '',
"prodId": item.prodId,
"quantityAll": item.quantityAll,
"specificationType": undefined,
"unit": "",
"usageIds": item.usageIds || "",
"volume": undefined,
"weight": undefined,
"material": item.material
})
})
}
},
......
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