feat(采购到货拆批):1.修正[采购到货拆批-PC端]前台页面及方法

This commit is contained in:
leiqiaozhen 2024-11-25 13:46:40 +08:00
parent 9d680b05bd
commit af1f482a0f

View File

@ -70,7 +70,7 @@
<div style="margin-top: 10px;">
<el-button type="primary" @click="submit">提交</el-button>
<el-button type="primary" @click="oneClickExecute">一键入库</el-button>
<!-- <el-button type="primary" @click="oneClickExecute">一键入库</el-button>-->
<el-button type="warning" @click="doClear">清除</el-button>
</div>
@ -106,16 +106,17 @@
</el-input>
</el-descriptions-item>
</el-descriptions>
<div style="margin-top: 10px;" v-if="itemForm.itemType === 'ROH' || itemForm.itemType === 'VERP'">
<div style="margin-top: 10px;">
<el-row :gutter="10">
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
<el-form-item label="存储区域">
<el-input v-model="itemForm.storageLocation" :disabled="isUse">
<i slot="suffix" class="el-input__icon el-icon-search"
@click.stop="showStorageLocationDialog"></i>
</el-input>
</el-form-item>
</el-col>
<!-- 存储区域 注释掉-->
<!-- <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">-->
<!-- <el-form-item label="存储区域">-->
<!-- <el-input v-model="itemForm.storageLocation" :disabled="isUse">-->
<!-- <i slot="suffix" class="el-input__icon el-icon-search"-->
<!-- @click.stop="showStorageLocationDialog"></i>-->
<!-- </el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
<el-form-item label="最小包装数量">
<el-input type="number" v-model="itemForm.minNum" :disabled="isUse"
@ -164,14 +165,21 @@
<el-dialog :visible.sync="detailDialogVisible" center fullscreen>
<el-table :data="itemForm.inventoryList" border>
<el-table-column label="序号" prop="seq"></el-table-column>
<!-- <el-table-column label="序号" prop="seq"></el-table-column>-->
<el-table-column type="index" label="序号">
<template slot-scope="scope">
<div>
{{ scope.$index + 1 }}
</div>
</template>
</el-table-column>
<el-table-column label="数量" prop="inventoryQty">
<template slot-scope="scope">
<el-input v-model="scope.row.inventoryQty" type="number" @change="reSetRemainderNum($event,scope.row)"
:disabled="isUse"></el-input>
</template>
</el-table-column>
<el-table-column label="存储区域" prop="storageLocation"></el-table-column>
<!-- <el-table-column label="存储区域" prop="storageLocation"></el-table-column>-->
<el-table-column label="组" prop="group" v-if="itemForm.itemType === 'ROH'"></el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
@ -185,70 +193,71 @@
</div>
</el-dialog>
<el-dialog :visible.sync="dialogItemType1Form2Visible" center fullscreen @close="backUpCodeList">
<div style="margin-top: 10px;">
<el-form :model="itemForm" label-width="auto">
<el-descriptions :column="1" border :labelStyle="lableWidth">
<el-descriptions-item label="单据号">
{{ itemForm.documentNo }}
</el-descriptions-item>
<el-descriptions-item label="物料号">
{{ itemForm.item }}
</el-descriptions-item>
<el-descriptions-item label="物料描述">
{{ itemForm.itemDescription }}
</el-descriptions-item>
<el-descriptions-item label="客户编码">
{{ itemForm.customer }}
</el-descriptions-item>
<el-descriptions-item label="目标仓">
{{ itemForm.targetWarehouse }}
</el-descriptions-item>
<el-descriptions-item label="需求数量">
{{ itemForm.applicationsQuantity }}
</el-descriptions-item>
<el-descriptions-item label="汇总数量">
{{ itemForm.sumQuantity }}
</el-descriptions-item>
<el-descriptions-item label="单位">
{{ itemForm.unitOfMeasure }}
</el-descriptions-item>
<el-descriptions-item label="批次">
{{ itemForm.batch }}
</el-descriptions-item>
<!--<el-descriptions-item label="存储区域">
<el-input v-model="itemForm.storageLocation" :disabled="isUse">
<i slot="suffix" class="el-input__icon el-icon-search"
@click.stop="showStorageLocationDialog"></i>
</el-input>
</el-descriptions-item>-->
</el-descriptions>
<div style="margin-top: 10px;">
<el-form-item prop="code">
<el-input v-model="itemForm.code" placeholder="扫描条码" autofocus
@keyup.enter.native="scanCode" :disabled="isUse">
<i slot="suffix" class="el-input__icon el-icon-full-screen"></i>
</el-input>
</el-form-item>
<el-table :data="itemForm.inventoryList" border>
<el-table-column label="条码" prop="inventoryIdOrCarrier"></el-table-column>
<el-table-column label="数量" prop="inventoryQty"></el-table-column>
<el-table-column label="载具类型" prop="type"></el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button size="mini" type="primary" @click="delRow2(scope.$index, scope.row)"
:disabled="scope.row.isScan === 'N'">删除
</el-button>
</template>
</el-table-column>
</el-table>
</div>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="saveItemType1" :disabled="isUse">保存</el-button>
</div>
</el-dialog>
<!-- <el-dialog :visible.sync="dialogItemType1Form2Visible" center fullscreen @close="backUpCodeList">-->
<!-- <div style="margin-top: 10px;">-->
<!-- <el-form :model="itemForm" label-width="auto">-->
<!-- <el-descriptions :column="1" border :labelStyle="lableWidth">-->
<!-- <el-descriptions-item label="单据号">-->
<!-- {{ itemForm.documentNo }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item label="物料号">-->
<!-- {{ itemForm.item }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item label="物料描述">-->
<!-- {{ itemForm.itemDescription }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item label="客户编码">-->
<!-- {{ itemForm.customer }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item label="目标仓">-->
<!-- {{ itemForm.targetWarehouse }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item label="需求数量">-->
<!-- {{ itemForm.applicationsQuantity }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item label="汇总数量">-->
<!-- {{ itemForm.sumQuantity }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item label="单位">-->
<!-- {{ itemForm.unitOfMeasure }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item label="批次">-->
<!-- {{ itemForm.batch }}-->
<!-- </el-descriptions-item>-->
<!-- &lt;!&ndash;<el-descriptions-item label="存储区域">-->
<!-- <el-input v-model="itemForm.storageLocation" :disabled="isUse">-->
<!-- <i slot="suffix" class="el-input__icon el-icon-search"-->
<!-- @click.stop="showStorageLocationDialog"></i>-->
<!-- </el-input>-->
<!-- </el-descriptions-item>&ndash;&gt;-->
<!-- </el-descriptions>-->
<!-- <div style="margin-top: 10px;">-->
<!-- <el-form-item prop="code">-->
<!-- <el-input v-model="itemForm.code" placeholder="扫描条码" autofocus-->
<!-- @keyup.enter.native="scanCode" :disabled="isUse">-->
<!-- <i slot="suffix" class="el-input__icon el-icon-full-screen"></i>-->
<!-- </el-input>-->
<!-- </el-form-item>-->
<!-- <el-table :data="itemForm.inventoryList" border>-->
<!-- <el-table-column label="条码" prop="inventoryIdOrCarrier"></el-table-column>-->
<!-- <el-table-column label="数量" prop="inventoryQty"></el-table-column>-->
<!-- <el-table-column label="载具类型" prop="type"></el-table-column>-->
<!-- <el-table-column label="操作">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button size="mini" type="primary" @click="delRow2(scope.$index, scope.row)"-->
<!-- :disabled="scope.row.isScan === 'N'">删除-->
<!-- </el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- </el-table>-->
<!-- </div>-->
<!-- </el-form>-->
<!-- </div>-->
<!-- <div slot="footer" class="dialog-footer">-->
<!-- <el-button type="primary" @click="saveItemType1" :disabled="isUse">保存</el-button>-->
<!-- </div>-->
<!-- </el-dialog>-->
<!-- -->
</basic-container>
</div>
</template>
@ -431,7 +440,7 @@
showProductionRequisitionDialog() {
let me = this;
me.productionRequisitionDialogVisible = true;
me.$refs.documentDialog.clear();
// me.$refs.documentDialog.clear();
me.productionRequisitionDialogObj.queryParam = {"documentType": me.documentType};
},
productionRequisitionSelect(row) {
@ -442,6 +451,8 @@
me.documentNo = me.formObj.documentNo;
getDocumentDetail(me.formObj.documentNo).then(res => {
if (res.data.code == 0) {
console.log(res.data.data)
debugger
for (let i = 0; i < res.data.data.length; i++) {
let obj = Object.assign({}, {
"item": res.data.data[i].item,
@ -483,6 +494,7 @@
me.formObj.itemList = [];
me.submitList = [];
getDocumentDetail(me.formObj.documentNo).then(res => {
debugger
if (res.data.code == 0) {
if (res.data.data[0].documentType !== me.documentType) {
if (me.documentType === 'PROCUREMENT_STORAGE') {
@ -523,6 +535,7 @@
showItemDialog(index, row) {
//判断是物料类型弹出不同的表单
let me = this;
debugger
//判断行项目是否已经关闭,关闭则不可扫描条码和保存
if (row.state === "CLOSE") {
this.isUse = true;
@ -538,40 +551,57 @@
obj.inventoryList = saveObj.inventoryList.slice();
}
}
if (row.itemType === 'ROH' || row.itemType === 'VERP') {
obj = obj == null ? Object.assign({
"inventoryList": [],
"code": "",
"storageLocation": "",
"minNum": 0,
"barCodeNum": 0,
"remainderNum": row.applicationsQuantity,
"sumRemainderNum": 0,
"minGroupNum": 0,
}, row) : obj;
me.itemForm = obj;
me.dialogItemType1FormVisible = true;
} else if (row.itemType === 'KMAT') {
obj = obj == null ? Object.assign({
"inventoryList": [{
inventoryQty: row.applicationsQuantity
}],
"code": "",
"storageLocation": "",
}, row) : obj;
me.itemForm = obj;
me.dialogItemType1FormVisible = true;
} else if (row.itemType === 'FERT') {
obj = obj == null ? Object.assign({
"inventoryList": [],
"code": "",
"sumQuantity": 0,
}, row) : obj;
me.itemForm = obj;
me.dialogItemType1Form2Visible = true;
} else {
me.$message.error("不支持的物料类型");
}
// 注释掉按物料类型进行显示入库执行的弹窗,改为只有包材这一种类型
// if (row.itemType === 'ROH' || row.itemType === 'VERP') {
// obj = obj == null ? Object.assign({
// "inventoryList": [],
// "code": "",
// "storageLocation": "",
// "minNum": 0,
// "barCodeNum": 0,
// "remainderNum": row.applicationsQuantity,
// "sumRemainderNum": 0,
// "minGroupNum": 0,
// }, row) : obj;
// me.itemForm = obj;
// me.dialogItemType1FormVisible = true;
// } else if (row.itemType === 'KMAT') {
// obj = obj == null ? Object.assign({
// "inventoryList": [{
// inventoryQty: row.applicationsQuantity
// }],
// "code": "",
// "storageLocation": "",
// }, row) : obj;
// me.itemForm = obj;
// me.dialogItemType1FormVisible = true;
// } else if (row.itemType === 'FERT') {
// obj = obj == null ? Object.assign({
// "inventoryList": [],
// "code": "",
// "sumQuantity": 0,
// }, row) : obj;
// me.itemForm = obj;
// me.dialogItemType1Form2Visible = true;
// } else {
// me.$message.error("不支持的物料类型");
// }
// VERP包材 现在只有包材概念,其他几种都不要了
obj = obj == null ? Object.assign({
"inventoryList": [],
"code": "",
"storageLocation": "",
"minNum": 0,
"barCodeNum": 0,
"remainderNum": row.applicationsQuantity,
"sumRemainderNum": 0,
"minGroupNum": 0,
}, row) : obj;
me.itemForm = obj;
me.dialogItemType1FormVisible = true;
},
submit() {
@ -621,7 +651,9 @@
} else if (me.itemForm.inventoryList.length === 0) {
me.$message.error("无信息可以保存,请点击返回按钮");
} else {
if (((me.itemForm.itemType === 'ROH' || me.itemForm.itemType === 'VERP') && me.itemForm.remainderNum !== 0) || (me.itemForm.itemType === 'FERT' && me.itemForm.sumQuantity !== me.itemForm.applicationsQuantity && isBlank(me.finishQtyControl))) {
// if (((me.itemForm.itemType === 'ROH' || me.itemForm.itemType === 'VERP') && me.itemForm.remainderNum !== 0) || (me.itemForm.itemType === 'FERT' && me.itemForm.sumQuantity !== me.itemForm.applicationsQuantity && isBlank(me.finishQtyControl))) {
if (me.itemForm.remainderNum !== 0) {
me.$message.error("剩余数量不为0,请继续输入");
} else {
me.backUpList = [];
@ -647,29 +679,50 @@
//最小包装数量改变事件
minNumChange() {
let me = this;
if (isBlank(me.itemForm.storageLocation)) {
// 改为不校验存储位置
if (!me.itemForm.minNum) {
me.itemForm.minNum = 0;
me.$message.error("存储位置为空");
me.$message.error("最小包装数量必须大于0");
} else {
if (!me.itemForm.minNum) {
me.itemForm.minNum = 0;
me.$message.error("最小包装数量必须大于0");
//最小数量
let minNum = me.itemForm.minNum;
//剩余数量
let remainderNum = me.itemForm.remainderNum;
let num = 0;
num = remainderNum % minNum;
if (num == 0) {
me.itemForm.barCodeNum = remainderNum / minNum;
} else {
//最小数量
let minNum = me.itemForm.minNum;
//剩余数量
let remainderNum = me.itemForm.remainderNum;
let num = 0;
num = remainderNum % minNum;
if (num == 0) {
me.itemForm.barCodeNum = remainderNum / minNum;
} else {
let barCodeNum = Math.floor(remainderNum / minNum);
me.itemForm.barCodeNum = barCodeNum;
}
me.inputFocus("barCodeNum");
let barCodeNum = Math.floor(remainderNum / minNum);
me.itemForm.barCodeNum = barCodeNum;
}
me.inputFocus("barCodeNum");
}
// if (isBlank(me.itemForm.storageLocation)) {
// me.itemForm.minNum = 0;
// me.$message.error("存储位置为空");
// } else {
// if (!me.itemForm.minNum) {
// me.itemForm.minNum = 0;
// me.$message.error("最小包装数量必须大于0");
// } else {
// //最小数量
// let minNum = me.itemForm.minNum;
// //剩余数量
// let remainderNum = me.itemForm.remainderNum;
// let num = 0;
// num = remainderNum % minNum;
// if (num == 0) {
// me.itemForm.barCodeNum = remainderNum / minNum;
// } else {
// let barCodeNum = Math.floor(remainderNum / minNum);
// me.itemForm.barCodeNum = barCodeNum;
// }
// me.inputFocus("barCodeNum");
// }
// }
},
//条码数量改变事件
barCodeNumChange() {