|
@@ -13,7 +13,8 @@
|
|
|
<el-tabs v-model="activeName" @tab-click="handleClick">
|
|
<el-tabs v-model="activeName" @tab-click="handleClick">
|
|
|
<el-tab-pane label="来源清单" name="1">
|
|
<el-tab-pane label="来源清单" name="1">
|
|
|
<!-- 来料列表表格 -->
|
|
<!-- 来料列表表格 -->
|
|
|
- <ele-pro-table ref="table12" :columns="tableColumns" :datasource="datasource"
|
|
|
|
|
|
|
+ <ele-pro-table ref="table12" :columns="tableColumns" :datasource="datasource" :needPage="btnType == 'add' ? false : true"
|
|
|
|
|
+
|
|
|
@selection-change="handleSelectionChange" :initLoad="false">
|
|
@selection-change="handleSelectionChange" :initLoad="false">
|
|
|
<template v-slot:toolbar v-if="this.baseForm.qualityMode == 2 && btnType != 'detail'">
|
|
<template v-slot:toolbar v-if="this.baseForm.qualityMode == 2 && btnType != 'detail'">
|
|
|
<el-dropdown trigger="click" @command="handleSampleNumber">
|
|
<el-dropdown trigger="click" @command="handleSampleNumber">
|
|
@@ -425,10 +426,12 @@ export default {
|
|
|
changesStokledgerNumberModal(val, dimension) {
|
|
changesStokledgerNumberModal(val, dimension) {
|
|
|
this.$refs.table12.setData([])
|
|
this.$refs.table12.setData([])
|
|
|
if (dimension == 3) return this.$refs.table12.setData(val)
|
|
if (dimension == 3) return this.$refs.table12.setData(val)
|
|
|
- let num = Number(val[0].outboundNum)
|
|
|
|
|
|
|
+ let item = val[0]
|
|
|
|
|
+ let num = Number(item.outboundNum)
|
|
|
let list = []
|
|
let list = []
|
|
|
|
|
+ let weight = (item.weight / item.measureQuantity).toFixed(2)
|
|
|
for (let i = 0; i < num; i++) {
|
|
for (let i = 0; i < num; i++) {
|
|
|
- list.push({...val[0], id: i + 1, packingQuantity:null, measureQuantity: 1 });
|
|
|
|
|
|
|
+ list.push({...item, id: i + 1, packingQuantity:null, measureQuantity: 1, weight });
|
|
|
}
|
|
}
|
|
|
this.$refs.table12.setData(list)
|
|
this.$refs.table12.setData(list)
|
|
|
},
|
|
},
|
|
@@ -440,11 +443,6 @@ export default {
|
|
|
},
|
|
},
|
|
|
async datasource({ page, limit, where }) {
|
|
async datasource({ page, limit, where }) {
|
|
|
const res = await getInventoryListByPlanId({ ...where, page, limit });
|
|
const res = await getInventoryListByPlanId({ ...where, page, limit });
|
|
|
- // if (res.list.length > 1) {
|
|
|
|
|
- // this.isCheck = true
|
|
|
|
|
- // } else {
|
|
|
|
|
- // this.isCheck = false
|
|
|
|
|
- // }
|
|
|
|
|
this.packingList = res.list;
|
|
this.packingList = res.list;
|
|
|
return res.list;
|
|
return res.list;
|
|
|
},
|
|
},
|
|
@@ -677,6 +675,7 @@ export default {
|
|
|
list[i].sampleCode = await this.getSampleCode();
|
|
list[i].sampleCode = await this.getSampleCode();
|
|
|
}
|
|
}
|
|
|
this.sampleList = list;
|
|
this.sampleList = list;
|
|
|
|
|
+ this.baseForm.sampleNumber = list.length;
|
|
|
console.log(this.sampleList, 'this.sampleList222')
|
|
console.log(this.sampleList, 'this.sampleList222')
|
|
|
this.samplePagination.currentPage = 1;
|
|
this.samplePagination.currentPage = 1;
|
|
|
this.samplePagination.total = list.length;
|
|
this.samplePagination.total = list.length;
|
|
@@ -1048,8 +1047,11 @@ export default {
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ console.log('样品清单', this.sampleList)
|
|
|
this.sampleList = result;
|
|
this.sampleList = result;
|
|
|
- this.baseForm.sampleNumber = this.sampleList.length;
|
|
|
|
|
|
|
+ this.baseForm.sampleNumber = this.sampleList.length; // 更新样品数量
|
|
|
|
|
+
|
|
|
this.changeSamUnit(sampleUnit)
|
|
this.changeSamUnit(sampleUnit)
|
|
|
|
|
|
|
|
},
|
|
},
|
|
@@ -1140,9 +1142,13 @@ export default {
|
|
|
this.baseForm = { ...this.defaultForm() };
|
|
this.baseForm = { ...this.defaultForm() };
|
|
|
},
|
|
},
|
|
|
handleClose() {
|
|
handleClose() {
|
|
|
- this.resetForm();
|
|
|
|
|
- this.resetTable();
|
|
|
|
|
- this.visible = false;
|
|
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ // 关闭后,销毁所有的表单数据
|
|
|
|
|
+ this.resetForm();
|
|
|
|
|
+ this.resetTable();
|
|
|
|
|
+ this.$refs['baseInfoRefs'] && this.$refs['baseInfoRefs'].$refs.form1.resetFields();
|
|
|
|
|
+ this.visible = false;
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
/* 保存编辑 */
|
|
/* 保存编辑 */
|
|
@@ -1262,12 +1268,11 @@ export default {
|
|
|
handleExtractFull() {
|
|
handleExtractFull() {
|
|
|
this.$refs.ruleForm.validate(async (valid) => {
|
|
this.$refs.ruleForm.validate(async (valid) => {
|
|
|
if (!valid || !this.validateSelection()) return;
|
|
if (!valid || !this.validateSelection()) return;
|
|
|
-
|
|
|
|
|
|
|
+ this.baseForm.sampleMeasureUnit = this.formData.sampleUnit
|
|
|
this.sampleList = [];
|
|
this.sampleList = [];
|
|
|
const sampleCount = Number(this.formData.portion);
|
|
const sampleCount = Number(this.formData.portion);
|
|
|
const measureQ = this.formData.number || 1;
|
|
const measureQ = this.formData.number || 1;
|
|
|
const unit = this.formData.sampleUnit;
|
|
const unit = this.formData.sampleUnit;
|
|
|
-
|
|
|
|
|
try {
|
|
try {
|
|
|
if (this.isStandard1OrWeightSample()) {//抽检计量整样小样或者抽检计重小样
|
|
if (this.isStandard1OrWeightSample()) {//抽检计量整样小样或者抽检计重小样
|
|
|
if (!this.validateMeasureQuantity(measureQ, unit, sampleCount)) return;
|
|
if (!this.validateMeasureQuantity(measureQ, unit, sampleCount)) return;
|