|
|
@@ -139,6 +139,7 @@
|
|
|
v-model="attributeData.deliveryMethod"
|
|
|
placeholder="请选择"
|
|
|
@change="changeMethod"
|
|
|
+ style="width: 135px"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in deliveryMethodTypeList"
|
|
|
@@ -160,6 +161,15 @@
|
|
|
</el-link>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+
|
|
|
+ <el-col :span="12" v-if="isInfo">
|
|
|
+ <el-form-item label="是否尾工序:" prop="isLast">
|
|
|
+ <el-radio-group v-model="attributeData.isLast">
|
|
|
+ <el-radio :label="1">是</el-radio>
|
|
|
+ <el-radio :label="0">否</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
|
|
|
@@ -169,28 +179,6 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <!-- <el-descriptions> -->
|
|
|
- <!-- <el-descriptions-item label="委外名称">{{
|
|
|
- outsourceData.name
|
|
|
- }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="委外类型">{{
|
|
|
- outsourceData.type == 4 ? '带料委外' : '不带料委外'
|
|
|
- }}</el-descriptions-item>
|
|
|
-
|
|
|
- <el-descriptions-item label="委外数量">{{
|
|
|
- outsourceData.formedNumLast
|
|
|
- }}</el-descriptions-item> -->
|
|
|
-
|
|
|
- <!-- <el-descriptions-item label="直接入库">{{ outObj.isInWarehouse == 1 ? '是' : '否' }}</el-descriptions-item> -->
|
|
|
- <!-- <el-descriptions-item label="直接入库">{{ '是' }}</el-descriptions-item> -->
|
|
|
-
|
|
|
- <!-- <el-descriptions-item v-if="outsourceData.deliveryMethod == 2">
|
|
|
- <el-button type="primary" size="mini" @click="batchDeliveryTime"
|
|
|
- >设置分批到货时间</el-button
|
|
|
- >
|
|
|
- </el-descriptions-item> -->
|
|
|
- <!-- </el-descriptions> -->
|
|
|
-
|
|
|
<el-tabs v-model="activeName" v-if="timeList.length == 0">
|
|
|
<el-tab-pane label="物品清单" name="0">
|
|
|
<div class="materialList">
|
|
|
@@ -958,7 +946,8 @@
|
|
|
factoriesName: '',
|
|
|
taskDataList: [],
|
|
|
priority: '',
|
|
|
- deliveryMethod: 1
|
|
|
+ deliveryMethod: 1,
|
|
|
+ isLast: 0
|
|
|
},
|
|
|
timeList: [],
|
|
|
rules: {
|
|
|
@@ -1203,15 +1192,9 @@
|
|
|
this.attributeData.formedNumLast = total + batchTotal;
|
|
|
},
|
|
|
|
|
|
- handleRowSelect(selection, row) {
|
|
|
- // console.log(selection, 'handleRowSelect');
|
|
|
- // this.changNumber(selection);
|
|
|
- },
|
|
|
+ handleRowSelect(selection, row) {},
|
|
|
|
|
|
- handleSelectAll(selection) {
|
|
|
- // console.log(selection, 'handleSelectAll');
|
|
|
- // this.changNumber(selection);
|
|
|
- },
|
|
|
+ handleSelectAll(selection) {},
|
|
|
|
|
|
inputNum(item, index) {
|
|
|
if (item.feedQuantity) {
|
|
|
@@ -1474,226 +1457,6 @@
|
|
|
});
|
|
|
},
|
|
|
|
|
|
- // chooseTime(current, clonedTimeList, currentIndex) {
|
|
|
- // if (clonedTimeList.length === 0) {
|
|
|
- // this.timeList = [];
|
|
|
- // this.attributeData.formedNumLast = 0;
|
|
|
- // this.pickOutInListSelect = [];
|
|
|
-
|
|
|
- // this.$nextTick(() => {
|
|
|
- // if (this.$refs.pickOutRef) {
|
|
|
- // this.$refs.pickOutRef.clearSelection();
|
|
|
- // }
|
|
|
- // });
|
|
|
-
|
|
|
- // return;
|
|
|
- // }
|
|
|
-
|
|
|
- // if (
|
|
|
- // this.workData.list[0].singleReport == 1 ||
|
|
|
- // this.pickOutInList.length > 1
|
|
|
- // ) {
|
|
|
- // this.timeList = clonedTimeList.map((item) => item);
|
|
|
- // const selectedIds = new Set();
|
|
|
- // for (let item of this.timeList) {
|
|
|
- // for (let it of item.pickOutInList) {
|
|
|
- // selectedIds.add(it.id);
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
- // this.attributeData.formedNumLast = this.timeList.reduce(
|
|
|
- // (acc, pro) => {
|
|
|
- // const num = parseFloat(pro.purchaseQuantity);
|
|
|
- // return acc + (isNaN(num) ? 0 : num);
|
|
|
- // },
|
|
|
- // 0
|
|
|
- // );
|
|
|
-
|
|
|
- // const unassignedList = this.pickOutInList.filter(
|
|
|
- // (item) => !selectedIds.has(item.id)
|
|
|
- // );
|
|
|
-
|
|
|
- // const totalNum = this.pickOutInList.reduce(
|
|
|
- // (sum, item) => sum + Number(item.feedQuantity || 0),
|
|
|
- // 0
|
|
|
- // );
|
|
|
-
|
|
|
- // if (unassignedList.length > 0) {
|
|
|
- // const number = unassignedList.reduce(
|
|
|
- // (sum, item) => sum + Number(item.feedQuantity || 0),
|
|
|
- // 0
|
|
|
- // );
|
|
|
-
|
|
|
- // const data = {
|
|
|
- // batchNo: '一次性到货',
|
|
|
- // requireDeliveryTime: null,
|
|
|
- // purchaseQuantity: number,
|
|
|
- // pickOutInList: unassignedList,
|
|
|
- // bomMaterialList: [],
|
|
|
- // standardOutputList: [],
|
|
|
- // isParent: 1
|
|
|
- // };
|
|
|
-
|
|
|
- // const exists = this.timeList.some((t) => t.batchNo == '一次性到货');
|
|
|
-
|
|
|
- // if (!exists) {
|
|
|
- // this.timeList.unshift(data);
|
|
|
- // } else {
|
|
|
- // const index = this.timeList.findIndex(
|
|
|
- // (t) => t.batchNo == '一次性到货'
|
|
|
- // );
|
|
|
- // this.timeList.splice(index, 1, data);
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
- // if (this.bomMaterialList.length != 0) {
|
|
|
- // for (let item of this.bomMaterialList) {
|
|
|
- // for (let it of this.timeList) {
|
|
|
- // const proportion = this.div(it.purchaseQuantity, totalNum);
|
|
|
- // const allocatedQuantity = this.mul(
|
|
|
- // proportion,
|
|
|
- // item.demandQuantity
|
|
|
- // );
|
|
|
-
|
|
|
- // const materialItem = {
|
|
|
- // ...item,
|
|
|
- // demandQuantity: allocatedQuantity
|
|
|
- // };
|
|
|
-
|
|
|
- // it.bomMaterialList.push(materialItem);
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
- // if (this.standardOutputList.length != 0) {
|
|
|
- // for (let item of this.standardOutputList) {
|
|
|
- // for (let it of this.timeList) {
|
|
|
- // const proportion = this.div(it.purchaseQuantity, totalNum);
|
|
|
- // const allocatedQuantity = this.mul(
|
|
|
- // proportion,
|
|
|
- // item.demandQuantity
|
|
|
- // );
|
|
|
-
|
|
|
- // const materialItem = {
|
|
|
- // ...item,
|
|
|
- // demandQuantity: allocatedQuantity
|
|
|
- // };
|
|
|
-
|
|
|
- // it.standardOutputList.push(materialItem);
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
- // this.timeList[0].innerActive = '0';
|
|
|
- // this.activeBatch = this.timeList[0].batchNo;
|
|
|
- // this.pickOutInListSelect = [];
|
|
|
- // } else {
|
|
|
- // if (this.pickOutInList.length == 1) {
|
|
|
- // this.timeList = clonedTimeList.map((item) => {
|
|
|
- // item.pickOutInList = [this.deepCopy(this.pickOutInListSelect[0])];
|
|
|
-
|
|
|
- // return item;
|
|
|
- // });
|
|
|
-
|
|
|
- // this.attributeData.formedNumLast = this.timeList.reduce(
|
|
|
- // (acc, pro) => {
|
|
|
- // const num = parseFloat(pro.purchaseQuantity);
|
|
|
- // return acc + (isNaN(num) ? 0 : num);
|
|
|
- // },
|
|
|
- // 0
|
|
|
- // );
|
|
|
- // const totalNum = this.pickOutInList.reduce(
|
|
|
- // (sum, item) => sum + Number(item.feedQuantity || 0),
|
|
|
- // 0
|
|
|
- // );
|
|
|
- // const batchNum = this.timeList.reduce(
|
|
|
- // (sum, item) => sum + Number(item.purchaseQuantity || 0),
|
|
|
- // 0
|
|
|
- // );
|
|
|
-
|
|
|
- // let singleWeight = 0;
|
|
|
-
|
|
|
- // if (
|
|
|
- // this.pickOutInList[0].newWeight ||
|
|
|
- // this.pickOutInList[0].newWeight == 0
|
|
|
- // ) {
|
|
|
- // singleWeight = this.div(
|
|
|
- // this.pickOutInList[0].newWeight,
|
|
|
- // totalNum
|
|
|
- // );
|
|
|
- // }
|
|
|
- // const remainderNum = this.sub(totalNum, batchNum);
|
|
|
- // if (remainderNum != 0) {
|
|
|
- // const data = {
|
|
|
- // batchNo: '一次性到货',
|
|
|
- // requireDeliveryTime: null,
|
|
|
- // purchaseQuantity: remainderNum,
|
|
|
- // pickOutInList: [this.deepCopy(this.pickOutInListSelect[0])],
|
|
|
- // bomMaterialList: [],
|
|
|
- // standardOutputList: [],
|
|
|
- // isParent: 1
|
|
|
- // };
|
|
|
- // const exists = this.timeList.some(
|
|
|
- // (t) => t.batchNo == '一次性到货'
|
|
|
- // );
|
|
|
- // if (!exists) {
|
|
|
- // this.timeList.unshift(data);
|
|
|
- // } else {
|
|
|
- // const index = this.timeList.findIndex(
|
|
|
- // (t) => t.batchNo == '一次性到货'
|
|
|
- // );
|
|
|
- // this.timeList.splice(index, 1, data);
|
|
|
- // }
|
|
|
- // }
|
|
|
- // if (this.bomMaterialList.length != 0) {
|
|
|
- // for (let item of this.bomMaterialList) {
|
|
|
- // for (let it of this.timeList) {
|
|
|
- // const proportion = this.div(it.purchaseQuantity, totalNum);
|
|
|
- // const allocatedQuantity = this.mul(
|
|
|
- // proportion,
|
|
|
- // item.demandQuantity
|
|
|
- // );
|
|
|
- // const materialItem = {
|
|
|
- // ...item,
|
|
|
- // demandQuantity: allocatedQuantity
|
|
|
- // };
|
|
|
- // it.bomMaterialList.push(materialItem);
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // if (this.standardOutputList.length != 0) {
|
|
|
- // for (let item of this.standardOutputList) {
|
|
|
- // for (let it of this.timeList) {
|
|
|
- // const proportion = this.div(it.purchaseQuantity, totalNum);
|
|
|
- // const allocatedQuantity = this.mul(
|
|
|
- // proportion,
|
|
|
- // item.demandQuantity
|
|
|
- // );
|
|
|
- // const materialItem = {
|
|
|
- // ...item,
|
|
|
- // demandQuantity: allocatedQuantity
|
|
|
- // };
|
|
|
- // it.standardOutputList.push(materialItem);
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
- // this.timeList = this.timeList.map((it) => {
|
|
|
- // it.pickOutInList.forEach((item) => {
|
|
|
- // item.feedQuantity = it.purchaseQuantity;
|
|
|
- // item.newWeight = this.mul(singleWeight, it.purchaseQuantity);
|
|
|
- // });
|
|
|
-
|
|
|
- // return it;
|
|
|
- // });
|
|
|
-
|
|
|
- // this.timeList[0].innerActive = '0';
|
|
|
- // this.activeBatch = this.timeList[0].batchNo;
|
|
|
- // this.pickOutInListSelect = [];
|
|
|
- // }
|
|
|
- // }
|
|
|
- // },
|
|
|
-
|
|
|
chooseTime(current, clonedTimeList, currentIndex) {
|
|
|
if (clonedTimeList.length === 0) {
|
|
|
this.resetAll();
|
|
|
@@ -1883,6 +1646,7 @@
|
|
|
maxFactor
|
|
|
);
|
|
|
},
|
|
|
+
|
|
|
sub(a, b) {
|
|
|
const { int: aInt, factor: aFactor } = this.toInteger(a);
|
|
|
const { int: bInt, factor: bFactor } = this.toInteger(b);
|
|
|
@@ -1892,6 +1656,7 @@
|
|
|
maxFactor
|
|
|
);
|
|
|
},
|
|
|
+
|
|
|
mul(a, b) {
|
|
|
const aLen = this.getDecimalLength(a);
|
|
|
const bLen = this.getDecimalLength(b);
|
|
|
@@ -1901,6 +1666,7 @@
|
|
|
Math.pow(10, aLen + bLen)
|
|
|
);
|
|
|
},
|
|
|
+
|
|
|
div(a, b) {
|
|
|
const aLen = this.getDecimalLength(a);
|
|
|
const bLen = this.getDecimalLength(b);
|
|
|
@@ -1912,8 +1678,6 @@
|
|
|
},
|
|
|
|
|
|
handOK(isRelease) {
|
|
|
- // isRelease? 0 提交 2提交并发布
|
|
|
-
|
|
|
if (!this.attributeData.requireDeliveryTime) {
|
|
|
return this.$message.warning('请选择交付日期!');
|
|
|
}
|