|
|
@@ -4,9 +4,7 @@
|
|
|
<el-button type="primary" size="mini" @click="save(2)"
|
|
|
>一键投料(报工)</el-button
|
|
|
>
|
|
|
- <el-button type="primary" size="mini"
|
|
|
- >清空缓存</el-button
|
|
|
- >
|
|
|
+ <el-button type="primary" size="mini">清空缓存</el-button>
|
|
|
<el-button type="primary" size="mini" @click="save(1)">缓存</el-button>
|
|
|
</div>
|
|
|
|
|
|
@@ -99,7 +97,11 @@
|
|
|
|
|
|
<script>
|
|
|
import { workorderList } from '@/api/produce/workOrder';
|
|
|
- import { batchSave, feedSaveCache } from '@/api/produce/feeding';
|
|
|
+ import {
|
|
|
+ batchSave,
|
|
|
+ feedSaveCache,
|
|
|
+ feedGetCache
|
|
|
+ } from '@/api/produce/feeding';
|
|
|
|
|
|
import pickingList from '../picking/pickingList.vue';
|
|
|
|
|
|
@@ -157,71 +159,77 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- List: []
|
|
|
+ List: [],
|
|
|
+ idsList: []
|
|
|
};
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
getList(ids) {
|
|
|
+ this.idsList = ids || [];
|
|
|
let param = {
|
|
|
ids: ids,
|
|
|
taskId: this.taskObj.id
|
|
|
};
|
|
|
- workorderList(param).then((res) => {
|
|
|
- this.List = res.map((m) => {
|
|
|
- m.workOrderId = m.id;
|
|
|
- m.paramDetailList = [];
|
|
|
-
|
|
|
- m.instanceList = []; // 物料
|
|
|
- m.equipmentList = []; // 设备
|
|
|
- m.modelList = []; // 模具
|
|
|
- m.aridRegionList = []; // 干燥区
|
|
|
- m.packingList = []; // 包装
|
|
|
- m.palletList = []; // 舟皿
|
|
|
- m.revolvingDiskList = []; // 周转盘
|
|
|
- m.semiProductList = []; //半成品
|
|
|
-
|
|
|
- if (m.pickOutInList.length > 0) {
|
|
|
- m.pickOutInList.forEach((f) => {
|
|
|
- if (f.rootCategoryLevelId == 1) {
|
|
|
- m.instanceList.push(f);
|
|
|
- } else if (f.rootCategoryLevelId == 4) {
|
|
|
- m.modelList.push(f);
|
|
|
- } else if (f.rootCategoryLevelId == 5) {
|
|
|
- m.modelList.push(f);
|
|
|
- } else if (f.rootCategoryLevelId == 11) {
|
|
|
- m.aridRegionList.push(f);
|
|
|
- } else if (f.rootCategoryLevelId == 13) {
|
|
|
- m.packingList.push(f);
|
|
|
- } else if (f.rootCategoryLevelId == 8) {
|
|
|
- m.palletList.push(f);
|
|
|
- } else if (f.rootCategoryLevelId == 26) {
|
|
|
- m.revolvingDiskList.push(f);
|
|
|
- } else if (
|
|
|
- [23, 2, 9, 28].includes(Number(f.rootCategoryLevelId))
|
|
|
- ) {
|
|
|
- m.semiProductList.push(f);
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ workorderList(param)
|
|
|
+ .then((res) => {
|
|
|
+ this.List = res.map((m) => {
|
|
|
+ m.workOrderId = m.id;
|
|
|
+ m.paramDetailList = [];
|
|
|
+
|
|
|
+ m.instanceList = []; // 物料
|
|
|
+ m.equipmentList = []; // 设备
|
|
|
+ m.modelList = []; // 模具
|
|
|
+ m.aridRegionList = []; // 干燥区
|
|
|
+ m.packingList = []; // 包装
|
|
|
+ m.palletList = []; // 舟皿
|
|
|
+ m.revolvingDiskList = []; // 周转盘
|
|
|
+ m.semiProductList = []; //半成品
|
|
|
+
|
|
|
+ if (m.pickOutInList.length > 0) {
|
|
|
+ m.pickOutInList.forEach((f) => {
|
|
|
+ if (f.rootCategoryLevelId == 1) {
|
|
|
+ m.instanceList.push(f);
|
|
|
+ } else if (f.rootCategoryLevelId == 4) {
|
|
|
+ m.modelList.push(f);
|
|
|
+ } else if (f.rootCategoryLevelId == 5) {
|
|
|
+ m.modelList.push(f);
|
|
|
+ } else if (f.rootCategoryLevelId == 11) {
|
|
|
+ m.aridRegionList.push(f);
|
|
|
+ } else if (f.rootCategoryLevelId == 13) {
|
|
|
+ m.packingList.push(f);
|
|
|
+ } else if (f.rootCategoryLevelId == 8) {
|
|
|
+ m.palletList.push(f);
|
|
|
+ } else if (f.rootCategoryLevelId == 26) {
|
|
|
+ m.revolvingDiskList.push(f);
|
|
|
+ } else if (
|
|
|
+ [23, 2, 9, 28].includes(Number(f.rootCategoryLevelId))
|
|
|
+ ) {
|
|
|
+ m.semiProductList.push(f);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
- // 处理字段
|
|
|
- m.quality == '' ? (m.quality = {}) : '';
|
|
|
+ // 处理字段
|
|
|
+ m.quality == '' ? (m.quality = {}) : '';
|
|
|
|
|
|
- if (!Object.prototype.hasOwnProperty.call(m, 'product')) {
|
|
|
- m.product = '{}';
|
|
|
- }
|
|
|
+ if (!Object.prototype.hasOwnProperty.call(m, 'product')) {
|
|
|
+ m.product = '{}';
|
|
|
+ }
|
|
|
|
|
|
- delete m.id;
|
|
|
- if (this.taskObj.id) {
|
|
|
- m.taskId = this.taskObj.id;
|
|
|
- m.taskName = this.taskObj.name;
|
|
|
- }
|
|
|
- return {
|
|
|
- ...m
|
|
|
- };
|
|
|
+ delete m.id;
|
|
|
+ if (this.taskObj.id) {
|
|
|
+ m.taskId = this.taskObj.id;
|
|
|
+ m.taskName = this.taskObj.name;
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ ...m
|
|
|
+ };
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.getCacheFn();
|
|
|
});
|
|
|
- });
|
|
|
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
@@ -279,6 +287,36 @@
|
|
|
});
|
|
|
},
|
|
|
|
|
|
+ getCacheFn() {
|
|
|
+ let parma = {
|
|
|
+ workOrderIds: this.idsList,
|
|
|
+ taskId: this.taskObj.id,
|
|
|
+ type: 2
|
|
|
+ };
|
|
|
+
|
|
|
+ feedGetCache(parma).then((res) => {
|
|
|
+ if (res.length == 0) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ let objList = res[0].extInfo.objList;
|
|
|
+ this.List.forEach((f) => {
|
|
|
+ objList.forEach((o) => {
|
|
|
+ if (f.workOrderId == o.workOrderId && f.taskId == o.taskId) {
|
|
|
+ f['instanceList'] = o.instanceList || [];
|
|
|
+ f['equipmentList'] = o.equipmentList || [];
|
|
|
+ f['modelList'] = o.modelList || [];
|
|
|
+ f['aridRegionList'] = o.aridRegionList || [];
|
|
|
+ f['packingList'] = o.packingList || [];
|
|
|
+ f['palletList'] = o.palletList || [];
|
|
|
+ f['revolvingDiskList'] = o.revolvingDiskList || [];
|
|
|
+ f['semiProductList'] = o.semiProductList || [];
|
|
|
+ this.$forceUpdate();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
async save(type) {
|
|
|
this.List.forEach((f) => {
|
|
|
f.instanceList.forEach((e) => {
|
|
|
@@ -301,7 +339,6 @@
|
|
|
},
|
|
|
|
|
|
checkCache(type) {
|
|
|
-
|
|
|
return new Promise((resolve) => {
|
|
|
if (type == 1) {
|
|
|
feedSaveCache(this.List).then((rr) => {
|