|
@@ -169,9 +169,33 @@
|
|
|
<!-- 添加行 -->
|
|
|
<div class="add-box" style="margin-bottom: 20px;">
|
|
|
<el-button type="primary" @click="packDetailProductListPush(boxIndex)"> 添加行 </el-button>
|
|
|
- <el-button type="primary" @click="openCustom(boxIndex)"> 自定义装箱 </el-button>
|
|
|
+ <el-button type="primary" @click="openCustom('2')" v-if='encasementType == "1"'> 自定义装箱 </el-button>
|
|
|
+ <el-button type="primary" @click="openCustom('1')" v-if='encasementType == "2"'> 标准装箱 </el-button>
|
|
|
</div>
|
|
|
- <el-table :data="boxFormData.packDetailProductList" @select="handleSelectProduct" @select-all="handleSelectProduct" ref="tableDom">
|
|
|
+ <el-table :data="boxFormData.packDetailGoodsList" ref="tableDom2" v-if='encasementType == "2"'>
|
|
|
+ <el-table-column prop="remark" label="货品描述" min-width="180">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <el-form-item prop="remark" :inline-message="true">
|
|
|
+ <el-input v-model="boxFormData.packDetailGoodsList[$index].remark" onmousewheel="return false;" />
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="unit" label="单位" min-width="180">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <el-form-item prop="unit" :inline-message="true">
|
|
|
+ <el-input v-model="boxFormData.packDetailGoodsList[$index].unit" onmousewheel="return false;" />
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="quantity" label="入箱数" min-width="180">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <el-form-item prop="quantity" :inline-message="true">
|
|
|
+ <el-input-number v-model="boxFormData.packDetailGoodsList[$index].quantity" :precision="4" :controls="false" :min="0" onmousewheel="return false;" />
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <el-table v-else :data="boxFormData.packDetailProductList" @select="handleSelectProduct" @select-all="handleSelectProduct" ref="tableDom">
|
|
|
<el-table-column prop="productName" label="产品名称" min-width="180">
|
|
|
<template #default="{ row, $index }">
|
|
|
<!-- 选择产品 -->
|
|
@@ -310,8 +334,8 @@ let boxFormData = ref({
|
|
|
id: Math.random().toString(36).substr(2),
|
|
|
});
|
|
|
|
|
|
-const openCustom = () => {
|
|
|
-
|
|
|
+const openCustom = (type) => {
|
|
|
+ encasementType.value = type
|
|
|
}
|
|
|
|
|
|
const openDtlModal = () => {
|
|
@@ -416,18 +440,21 @@ const dtlformData = reactive({
|
|
|
const selectProduct = (val,index) => {
|
|
|
let msg = {...formData.data.contractProductData.find((item) => item.mathId == val)}
|
|
|
//根据val 禁用相应的下拉数据
|
|
|
- console.log(msg,index)
|
|
|
+
|
|
|
boxFormData.value.packDetailProductList[index] = {
|
|
|
productId: msg.productId,
|
|
|
productName: msg.productName,
|
|
|
productSpec: msg.productSpec,
|
|
|
contractCode: msg.contractCode,
|
|
|
- contractProductId: msg.contractProductId,
|
|
|
+ contractProductId: msg.id,
|
|
|
cpQuantity: msg.cpQuantity,
|
|
|
waitQuantity: msg.waitQuantity,
|
|
|
quantity: null,
|
|
|
mathId: msg.mathId,
|
|
|
+ contractId: msg.contractId,
|
|
|
+ contractProductId: msg.id,
|
|
|
}
|
|
|
+ console.log(boxFormData.value.packDetailProductList)
|
|
|
formData.data.contractProductData.forEach((item) => {
|
|
|
item.disabled = false
|
|
|
boxFormData.value.packDetailProductList.forEach((item1) => {
|
|
@@ -672,6 +699,8 @@ const formConfig = reactive([
|
|
|
},
|
|
|
]);
|
|
|
|
|
|
+const encasementType = ref('1')
|
|
|
+
|
|
|
const getList = async (req) => {
|
|
|
selectData.value = [];
|
|
|
sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
|
|
@@ -749,11 +778,15 @@ const submitForm = () => {
|
|
|
}
|
|
|
submitLoading.value = true;
|
|
|
loadingOne.value = true;
|
|
|
+
|
|
|
+ formData.data.contractIds = formData.data.contractIds.join(",");
|
|
|
for (let i = 0; i < formData.data.packDetailList.length; i++) {
|
|
|
const e = formData.data.packDetailList[i];
|
|
|
e.bomVolume = (e.boxLong * e.boxWide * e.boxHigh) / 1000000;
|
|
|
+ e.contractIds = formData.data.contractIds;
|
|
|
+ e.customerId = formData.data.customerId;
|
|
|
}
|
|
|
- formData.data.contractIds = formData.data.contractIds.join(",");
|
|
|
+ console.log(formData.data.packDetailList)
|
|
|
formData.data.packDetailList.map((x) => {
|
|
|
return{
|
|
|
...x,
|