|
@@ -25,24 +25,17 @@
|
|
|
action: () => openModal(),
|
|
|
},
|
|
|
]"
|
|
|
- @get-list="getList"
|
|
|
- >
|
|
|
+ @get-list="getList">
|
|
|
<template #code="{ item }">
|
|
|
<div>
|
|
|
- <div
|
|
|
- v-for="(item, index) in getData(item.codeAPName, 'code')"
|
|
|
- :key="index"
|
|
|
- >
|
|
|
+ <div v-for="(item, index) in getData(item.codeAPName, 'code')" :key="index">
|
|
|
{{ item }}
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<template #productName="{ item }">
|
|
|
<div>
|
|
|
- <div
|
|
|
- v-for="(item, index) in getData(item.codeAPName, 'productName')"
|
|
|
- :key="index"
|
|
|
- >
|
|
|
+ <div v-for="(item, index) in getData(item.codeAPName, 'productName')" :key="index">
|
|
|
{{ item }}
|
|
|
</div>
|
|
|
</div>
|
|
@@ -92,21 +85,11 @@
|
|
|
</byTable>
|
|
|
</div>
|
|
|
|
|
|
- <el-dialog
|
|
|
- title="产品装箱"
|
|
|
- v-model="dtlModalType"
|
|
|
- width="80%"
|
|
|
- v-loading="loading"
|
|
|
- >
|
|
|
+ <el-dialog title="产品装箱" v-model="dtlModalType" width="80%" v-loading="loading">
|
|
|
<el-row :gutter="10">
|
|
|
<el-col :span="8">
|
|
|
<div class="common-title">箱规</div>
|
|
|
- <el-form
|
|
|
- :model="boxFormData"
|
|
|
- :rules="rules"
|
|
|
- ref="formDom"
|
|
|
- label-position="top"
|
|
|
- >
|
|
|
+ <el-form :model="boxFormData" :rules="rules" ref="formDom" label-position="top">
|
|
|
<el-form-item label="尺寸(cm³)" required>
|
|
|
<el-col :span="7">
|
|
|
<el-form-item label="" :prop="'boxLong'" :rules="rules.boxLong">
|
|
@@ -117,8 +100,7 @@
|
|
|
:controls="false"
|
|
|
:min="0"
|
|
|
@change="computeBomVolume"
|
|
|
- onmousewheel="return false;"
|
|
|
- ></el-input-number>
|
|
|
+ onmousewheel="return false;"></el-input-number>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="1" style="text-align: center"> * </el-col>
|
|
@@ -131,8 +113,7 @@
|
|
|
:controls="false"
|
|
|
:min="0"
|
|
|
@change="computeBomVolume"
|
|
|
- onmousewheel="return false;"
|
|
|
- ></el-input-number>
|
|
|
+ onmousewheel="return false;"></el-input-number>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="1" style="text-align: center"> * </el-col>
|
|
@@ -145,8 +126,7 @@
|
|
|
:controls="false"
|
|
|
:min="0"
|
|
|
@change="computeBomVolume"
|
|
|
- onmousewheel="return false;"
|
|
|
- ></el-input-number>
|
|
|
+ onmousewheel="return false;"></el-input-number>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-form-item>
|
|
@@ -158,99 +138,56 @@
|
|
|
:controls="false"
|
|
|
:min="0"
|
|
|
disabled
|
|
|
- onmousewheel="return false;"
|
|
|
- ></el-input-number>
|
|
|
+ onmousewheel="return false;"></el-input-number>
|
|
|
</el-form-item>
|
|
|
- <el-form-item
|
|
|
- label="净重(kg)"
|
|
|
- :prop="'netWeight'"
|
|
|
- :rules="rules.netWeight"
|
|
|
- >
|
|
|
+ <el-form-item label="净重(kg)" :prop="'netWeight'" :rules="rules.netWeight">
|
|
|
<el-input-number
|
|
|
v-model="boxFormData.netWeight"
|
|
|
:precision="2"
|
|
|
:controls="false"
|
|
|
:min="0"
|
|
|
placeholder="请输入"
|
|
|
- onmousewheel="return false;"
|
|
|
- ></el-input-number>
|
|
|
+ onmousewheel="return false;"></el-input-number>
|
|
|
</el-form-item>
|
|
|
- <el-form-item
|
|
|
- label="毛重(kg)"
|
|
|
- :prop="'roughWeight'"
|
|
|
- :rules="rules.roughWeight"
|
|
|
- >
|
|
|
+ <el-form-item label="毛重(kg)" :prop="'roughWeight'" :rules="rules.roughWeight">
|
|
|
<el-input-number
|
|
|
v-model="boxFormData.roughWeight"
|
|
|
:precision="2"
|
|
|
:controls="false"
|
|
|
:min="0"
|
|
|
placeholder="请输入"
|
|
|
- onmousewheel="return false;"
|
|
|
- ></el-input-number>
|
|
|
+ onmousewheel="return false;"></el-input-number>
|
|
|
</el-form-item>
|
|
|
- <el-form-item
|
|
|
- label="总箱数"
|
|
|
- :prop="'packQuantity'"
|
|
|
- :rules="rules.packQuantity"
|
|
|
- >
|
|
|
+ <el-form-item label="总箱数" :prop="'packQuantity'" :rules="rules.packQuantity">
|
|
|
<el-input-number
|
|
|
v-model="boxFormData.packQuantity"
|
|
|
:precision="0"
|
|
|
:controls="false"
|
|
|
:min="1"
|
|
|
placeholder="请输入"
|
|
|
- onmousewheel="return false;"
|
|
|
- ></el-input-number>
|
|
|
+ onmousewheel="return false;"></el-input-number>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</el-col>
|
|
|
<el-col :span="16">
|
|
|
<!-- 添加行 -->
|
|
|
<div class="add-box" style="margin-bottom: 20px">
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- @click="packDetailProductListPush(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>
|
|
|
+ <el-button type="primary" @click="packDetailProductListPush(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.packDetailGoodsList"
|
|
|
- ref="tableDom2"
|
|
|
- v-if="encasementType == '2'"
|
|
|
- >
|
|
|
+ <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-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-input v-model="boxFormData.packDetailGoodsList[$index].unit" onmousewheel="return false;" />
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -262,67 +199,36 @@
|
|
|
:precision="4"
|
|
|
:controls="false"
|
|
|
:min="0"
|
|
|
- onmousewheel="return false;"
|
|
|
- />
|
|
|
+ onmousewheel="return false;" />
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="quantity" label="操作" width="100">
|
|
|
<template #default="{ row, $index }">
|
|
|
- <el-button type="danger" @click="boxFormData.packDetailGoodsList.splice($index,1)"> 删除 </el-button>
|
|
|
+ <el-button type="danger" @click="boxFormData.packDetailGoodsList.splice($index, 1)"> 删除 </el-button>
|
|
|
</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"
|
|
|
- >
|
|
|
+ <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 }">
|
|
|
<!-- 选择产品 -->
|
|
|
- <el-form-item
|
|
|
- prop="mathId"
|
|
|
- style="margin-bottom: 0px"
|
|
|
- :inline-message="true"
|
|
|
- >
|
|
|
+ <el-form-item prop="mathId" style="margin-bottom: 0px" :inline-message="true">
|
|
|
<el-select
|
|
|
- :model-value="
|
|
|
- boxFormData.packDetailProductList[$index].mathId
|
|
|
- "
|
|
|
+ :model-value="boxFormData.packDetailProductList[$index].mathId"
|
|
|
placeholder="请选择"
|
|
|
@change="(e) => selectProduct(e, $index)"
|
|
|
filterable
|
|
|
- style="width: 100%"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in formData.data.contractProductData"
|
|
|
- :disabled="item.disabled"
|
|
|
- :label="item.productName"
|
|
|
- :value="item.mathId"
|
|
|
- >
|
|
|
+ style="width: 100%">
|
|
|
+ <el-option v-for="item in formData.data.contractProductData" :disabled="item.disabled" :label="item.productName" :value="item.mathId">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="productSpec"
|
|
|
- label="规格型号"
|
|
|
- min-width="100"
|
|
|
- />
|
|
|
+ <el-table-column prop="productSpec" label="规格型号" min-width="100" />
|
|
|
<el-table-column prop="cpQuantity" label="合同数量" width="100" />
|
|
|
- <el-table-column
|
|
|
- prop="waitQuantity"
|
|
|
- label="待装箱数量"
|
|
|
- width="100"
|
|
|
- />
|
|
|
+ <el-table-column prop="waitQuantity" label="待装箱数量" width="100" />
|
|
|
<el-table-column prop="quantity" label="装箱数量" width="100">
|
|
|
<template #default="{ row, $index }">
|
|
|
<el-form-item prop="quantity" :inline-message="true">
|
|
@@ -332,93 +238,42 @@
|
|
|
:precision="4"
|
|
|
:controls="false"
|
|
|
:min="0"
|
|
|
- onmousewheel="return false;"
|
|
|
- />
|
|
|
+ onmousewheel="return false;" />
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<!-- 删除按钮 -->
|
|
|
<el-table-column prop="quantity" label="操作" width="100">
|
|
|
<template #default="{ row, $index }">
|
|
|
- <el-button
|
|
|
- type="danger"
|
|
|
- @click="boxFormData.packDetailProductList.splice($index, 1)"
|
|
|
- >
|
|
|
- 删除
|
|
|
- </el-button>
|
|
|
+ <el-button type="danger" @click="boxFormData.packDetailProductList.splice($index, 1)"> 删除 </el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<template #footer>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- @click="submitBox()"
|
|
|
- size="large"
|
|
|
- :loading="submitLoading"
|
|
|
- >
|
|
|
- 确 定
|
|
|
- </el-button>
|
|
|
+ <el-button type="primary" @click="submitBox()" size="large" :loading="submitLoading"> 确 定 </el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
|
|
|
- <el-dialog
|
|
|
- title="产品装箱"
|
|
|
- v-model="dialogVisible"
|
|
|
- width="600"
|
|
|
- v-loading="loading"
|
|
|
- >
|
|
|
- <el-form
|
|
|
- :model="formData.data"
|
|
|
- :rules="rules"
|
|
|
- ref="formDom"
|
|
|
- label-position="top"
|
|
|
- >
|
|
|
+ <el-dialog title="产品装箱" v-model="dialogVisible" width="600" v-loading="loading">
|
|
|
+ <el-form :model="formData.data" :rules="rules" ref="formDom" label-position="top">
|
|
|
<el-row :gutter="10">
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="客户名称" prop="customerId">
|
|
|
- <el-select
|
|
|
- v-model="formData.data.customerId"
|
|
|
- placeholder="请选择"
|
|
|
- @change="handleChangeCustomer"
|
|
|
- filterable
|
|
|
- style="width: 100%"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in customerList"
|
|
|
- :label="item.name"
|
|
|
- :value="item.id"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
+ <el-select v-model="formData.data.customerId" placeholder="请选择" @change="handleChangeCustomer" filterable style="width: 100%">
|
|
|
+ <el-option v-for="item in customerList" :label="item.name" :value="item.id"> </el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-form-item label="选择合同" prop="contractIds">
|
|
|
- <el-select
|
|
|
- v-model="formData.data.contractIds"
|
|
|
- placeholder="请选择"
|
|
|
- @change="handleChangeContract"
|
|
|
- filterable
|
|
|
- style="width: 100%"
|
|
|
- multiple
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in contractData"
|
|
|
- :label="item.code"
|
|
|
- :value="item.id"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
+ <el-select v-model="formData.data.contractIds" placeholder="请选择" @change="handleChangeContract" filterable style="width: 100%" multiple>
|
|
|
+ <el-option v-for="item in contractData" :label="item.code" :value="item.id"> </el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<div class="box-icon-warp">
|
|
|
- <div
|
|
|
- class="box-content"
|
|
|
- v-for="(i, index) in formData.data.packDetailList"
|
|
|
- :key="i.id"
|
|
|
- @click="openDtlUpdata(index)"
|
|
|
- >
|
|
|
+ <div class="box-content" v-for="(i, index) in formData.data.packDetailList" :key="i.id" @click="openDtlUpdata(index)">
|
|
|
<div class="box-icon">
|
|
|
<i class="iconfont icon-iconm_daick"></i>
|
|
|
</div>
|
|
@@ -431,42 +286,14 @@
|
|
|
</el-form>
|
|
|
<template #footer>
|
|
|
<el-button @click="handleClose" size="large">取 消</el-button>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- @click="submitForm()"
|
|
|
- size="large"
|
|
|
- :loading="submitLoading"
|
|
|
- >
|
|
|
- 确 定
|
|
|
- </el-button>
|
|
|
+ <el-button type="primary" @click="submitForm()" size="large" :loading="submitLoading"> 确 定 </el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
- <el-dialog
|
|
|
- title="合并出货"
|
|
|
- v-model="dialogVisibleOne"
|
|
|
- width="400"
|
|
|
- v-loading="loadingOne"
|
|
|
- >
|
|
|
- <byForm
|
|
|
- :formConfig="formConfig"
|
|
|
- :formOption="formOption"
|
|
|
- v-model="formData.dataOne"
|
|
|
- :rules="rules"
|
|
|
- ref="byform"
|
|
|
- >
|
|
|
- </byForm>
|
|
|
+ <el-dialog title="合并出货" v-model="dialogVisibleOne" width="400" v-loading="loadingOne">
|
|
|
+ <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.dataOne" :rules="rules" ref="byform"> </byForm>
|
|
|
<template #footer>
|
|
|
- <el-button @click="dialogVisibleOne = false" size="large"
|
|
|
- >取 消</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- @click="submitFormOne()"
|
|
|
- size="large"
|
|
|
- :loading="submitLoading"
|
|
|
- >
|
|
|
- 确 定
|
|
|
- </el-button>
|
|
|
+ <el-button @click="dialogVisibleOne = false" size="large">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitFormOne()" size="large" :loading="submitLoading"> 确 定 </el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
@@ -496,16 +323,8 @@ const sourceList = ref({
|
|
|
});
|
|
|
|
|
|
const computeBomVolume = () => {
|
|
|
- if (
|
|
|
- boxFormData.value.boxLong &&
|
|
|
- boxFormData.value.boxWide &&
|
|
|
- boxFormData.value.boxHigh
|
|
|
- ) {
|
|
|
- boxFormData.value.bomVolume =
|
|
|
- (boxFormData.value.boxLong *
|
|
|
- boxFormData.value.boxWide *
|
|
|
- boxFormData.value.boxHigh) /
|
|
|
- 1000000;
|
|
|
+ if (boxFormData.value.boxLong && boxFormData.value.boxWide && boxFormData.value.boxHigh) {
|
|
|
+ boxFormData.value.bomVolume = (boxFormData.value.boxLong * boxFormData.value.boxWide * boxFormData.value.boxHigh) / 1000000;
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -551,23 +370,19 @@ const openCustom = (type) => {
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
- boxFormData.value.packDetailGoodsList =
|
|
|
- boxFormData.value.packDetailProductList.map((item) => {
|
|
|
- return {
|
|
|
- remark: item.productName,
|
|
|
- unit: null,
|
|
|
- quantity: item.quantity,
|
|
|
- };
|
|
|
- });
|
|
|
+ boxFormData.value.packDetailGoodsList = boxFormData.value.packDetailProductList.map((item) => {
|
|
|
+ return {
|
|
|
+ remark: item.productName,
|
|
|
+ unit: null,
|
|
|
+ quantity: item.quantity,
|
|
|
+ };
|
|
|
+ });
|
|
|
}
|
|
|
encasementType.value = type;
|
|
|
};
|
|
|
|
|
|
const openDtlModal = () => {
|
|
|
- if (
|
|
|
- !formData.data.contractProductData ||
|
|
|
- formData.data.contractProductData.length == 0
|
|
|
- ) {
|
|
|
+ if (!formData.data.contractProductData || formData.data.contractProductData.length == 0) {
|
|
|
ElMessage.error("请先选择合同");
|
|
|
return;
|
|
|
}
|
|
@@ -634,10 +449,7 @@ const submitBox = () => {
|
|
|
ElMessage.error("请填写装箱数量");
|
|
|
return;
|
|
|
} else {
|
|
|
- if (
|
|
|
- item.quantity * boxFormData.value.packQuantity >
|
|
|
- item.waitQuantity
|
|
|
- ) {
|
|
|
+ if (item.quantity * boxFormData.value.packQuantity > item.waitQuantity) {
|
|
|
return ElMessage({
|
|
|
message: "装箱数量 * 总箱数不可大于待装箱数量",
|
|
|
type: "info",
|
|
@@ -889,15 +701,11 @@ const config = computed(() => {
|
|
|
},
|
|
|
el: "button",
|
|
|
click() {
|
|
|
- ElMessageBox.confirm(
|
|
|
- "此操作将永久作废该数据, 是否继续?",
|
|
|
- "提示",
|
|
|
- {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- }
|
|
|
- ).then(() => {
|
|
|
+ ElMessageBox.confirm("此操作将永久作废该数据, 是否继续?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }).then(() => {
|
|
|
// 删除
|
|
|
proxy
|
|
|
.post("/pack/delete", {
|
|
@@ -965,8 +773,10 @@ const getList = async (req) => {
|
|
|
roughWeight: jarr[4],
|
|
|
netWeight: jarr[5],
|
|
|
};
|
|
|
- let createArr = new Array(Number(jarr[6])).fill(obj);
|
|
|
- newArr = [...newArr, ...createArr];
|
|
|
+ if(jarr[6]) {
|
|
|
+ let createArr = new Array(Number(jarr[6])).fill(obj);
|
|
|
+ newArr = [...newArr, ...createArr];
|
|
|
+ }
|
|
|
}
|
|
|
e.dataJsonListCopy = newArr;
|
|
|
}
|
|
@@ -1126,9 +936,7 @@ const handleClickPacking = () => {
|
|
|
productName: x.productName,
|
|
|
}));
|
|
|
const customerId = formData.data.customerId ? formData.data.customerId : "";
|
|
|
- const contractIds = formData.data.contractIds
|
|
|
- ? formData.data.contractIds.join(",")
|
|
|
- : "";
|
|
|
+ const contractIds = formData.data.contractIds ? formData.data.contractIds.join(",") : "";
|
|
|
let item = {
|
|
|
customerId: customerId,
|
|
|
contractIds: contractIds,
|
|
@@ -1145,10 +953,7 @@ const handleClickPacking = () => {
|
|
|
isShow: false,
|
|
|
};
|
|
|
formData.data.packDetailList.push(item);
|
|
|
- handleChangePackQuantity(
|
|
|
- item.packQuantity,
|
|
|
- formData.data.packDetailList.length - 1
|
|
|
- );
|
|
|
+ handleChangePackQuantity(item.packQuantity, formData.data.packDetailList.length - 1);
|
|
|
tableDom.value.clearSelection();
|
|
|
selectProductData.value = [];
|
|
|
table.value.clearSelection();
|
|
@@ -1164,18 +969,14 @@ const handleChangePackQuantity = (val, index) => {
|
|
|
const obj = {};
|
|
|
for (let i = 0; i < formData.data.contractProductData.length; i++) {
|
|
|
const e = formData.data.contractProductData[i];
|
|
|
- obj[e.contractId + "_" + e.productId + ""] = (
|
|
|
- Number(e.cpQuantity) - Number(e.sumPackQuantity)
|
|
|
- ).toFixed(2);
|
|
|
+ obj[e.contractId + "_" + e.productId + ""] = (Number(e.cpQuantity) - Number(e.sumPackQuantity)).toFixed(2);
|
|
|
}
|
|
|
// 计算数量 即装箱数量 * 箱数 新增字段放在最外层
|
|
|
for (let i = 0; i < formData.data.packDetailList.length; i++) {
|
|
|
const ele = formData.data.packDetailList[i];
|
|
|
for (let j = 0; j < ele.packDetailProductList.length; j++) {
|
|
|
const jele = ele.packDetailProductList[j];
|
|
|
- ele[jele.contractId + "_" + jele.productId + ""] = (
|
|
|
- Number(ele.packQuantity) * jele.quantity
|
|
|
- ).toFixed(2);
|
|
|
+ ele[jele.contractId + "_" + jele.productId + ""] = (Number(ele.packQuantity) * jele.quantity).toFixed(2);
|
|
|
}
|
|
|
}
|
|
|
// 计算新的待装箱数量
|
|
@@ -1232,32 +1033,24 @@ const getSelectData = () => {
|
|
|
};
|
|
|
const contractData = ref([]);
|
|
|
const handleChangeCustomer = (val) => {
|
|
|
- proxy
|
|
|
- .get(`/contract/getNoPackContractByCustomerId?customerId=${val}`)
|
|
|
- .then((res) => {
|
|
|
- contractData.value = res.data;
|
|
|
- formData.data.contractIds = [];
|
|
|
- formData.data.packDetailList = [];
|
|
|
- });
|
|
|
+ proxy.get(`/contract/getNoPackContractByCustomerId?customerId=${val}`).then((res) => {
|
|
|
+ contractData.value = res.data;
|
|
|
+ formData.data.contractIds = [];
|
|
|
+ formData.data.packDetailList = [];
|
|
|
+ });
|
|
|
};
|
|
|
const handleChangeContract = (val) => {
|
|
|
const customerId = formData.data.customerId ? formData.data.customerId : "";
|
|
|
- proxy
|
|
|
- .get(
|
|
|
- `/contractProduct/getNoPackContractProductById?customerId=${customerId}&contractIds=${val}`
|
|
|
- )
|
|
|
- .then((res) => {
|
|
|
- formData.data.contractProductData = res.data.map((x) => ({
|
|
|
- ...x,
|
|
|
- waitQuantity: (
|
|
|
- Number(x.cpQuantity) - Number(x.sumPackQuantity)
|
|
|
- ).toFixed(2),
|
|
|
- quantity: null,
|
|
|
- mathId: Math.random().toString(36).substr(2),
|
|
|
- disabled: false,
|
|
|
- }));
|
|
|
- handleChangePackQuantity();
|
|
|
- });
|
|
|
+ proxy.get(`/contractProduct/getNoPackContractProductById?customerId=${customerId}&contractIds=${val}`).then((res) => {
|
|
|
+ formData.data.contractProductData = res.data.map((x) => ({
|
|
|
+ ...x,
|
|
|
+ waitQuantity: (Number(x.cpQuantity) - Number(x.sumPackQuantity)).toFixed(2),
|
|
|
+ quantity: null,
|
|
|
+ mathId: Math.random().toString(36).substr(2),
|
|
|
+ disabled: false,
|
|
|
+ }));
|
|
|
+ handleChangePackQuantity();
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
const getData = (data, type) => {
|