|
|
@@ -493,246 +493,254 @@
|
|
|
|
|
|
getList(ids) {
|
|
|
this.idsList = ids || [];
|
|
|
- let param = {
|
|
|
- ids: ids,
|
|
|
- taskId: this.taskObj.id,
|
|
|
- type: 0
|
|
|
- };
|
|
|
|
|
|
- this.isLoad = false;
|
|
|
- listByIdsReport(param)
|
|
|
- .then((res) => {
|
|
|
- this.List = res.map((obj) => {
|
|
|
- if (!Object.prototype.hasOwnProperty.call(obj, 'turnover')) {
|
|
|
- obj['turnover'] = [];
|
|
|
- }
|
|
|
- if (
|
|
|
- !Object.prototype.hasOwnProperty.call(obj, 'aridRegionList')
|
|
|
- ) {
|
|
|
- obj['aridRegionList'] = [];
|
|
|
- }
|
|
|
+ if (this.taskObj.id != -2) {
|
|
|
+ let param = {
|
|
|
+ ids: ids,
|
|
|
+ taskId: this.taskObj.id,
|
|
|
+ type: 0
|
|
|
+ };
|
|
|
+
|
|
|
+ this.isLoad = false;
|
|
|
+ listByIdsReport(param)
|
|
|
+ .then((res) => {
|
|
|
+ this.List = res.map((obj) => {
|
|
|
+ if (!Object.prototype.hasOwnProperty.call(obj, 'turnover')) {
|
|
|
+ obj['turnover'] = [];
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ !Object.prototype.hasOwnProperty.call(obj, 'aridRegionList')
|
|
|
+ ) {
|
|
|
+ obj['aridRegionList'] = [];
|
|
|
+ }
|
|
|
|
|
|
- if (!Object.prototype.hasOwnProperty.call(obj, 'instanceList')) {
|
|
|
- obj['instanceList'] = [];
|
|
|
- }
|
|
|
+ if (
|
|
|
+ !Object.prototype.hasOwnProperty.call(obj, 'instanceList')
|
|
|
+ ) {
|
|
|
+ obj['instanceList'] = [];
|
|
|
+ }
|
|
|
|
|
|
- if (!Object.prototype.hasOwnProperty.call(obj, 'palletList')) {
|
|
|
- obj['palletList'] = [];
|
|
|
- }
|
|
|
+ if (!Object.prototype.hasOwnProperty.call(obj, 'palletList')) {
|
|
|
+ obj['palletList'] = [];
|
|
|
+ }
|
|
|
|
|
|
- if (
|
|
|
- !Object.prototype.hasOwnProperty.call(obj, 'revolvingDiskList')
|
|
|
- ) {
|
|
|
- obj['revolvingDiskList'] = [];
|
|
|
- }
|
|
|
+ if (
|
|
|
+ !Object.prototype.hasOwnProperty.call(
|
|
|
+ obj,
|
|
|
+ 'revolvingDiskList'
|
|
|
+ )
|
|
|
+ ) {
|
|
|
+ obj['revolvingDiskList'] = [];
|
|
|
+ }
|
|
|
|
|
|
- if (obj.palletList.length > 0) {
|
|
|
- obj.palletList = obj.palletList.map((m) => {
|
|
|
- return {
|
|
|
- hideKc: true, // 不显示库存
|
|
|
- quantity: m.feedQuantity,
|
|
|
- ...m
|
|
|
- };
|
|
|
- });
|
|
|
- }
|
|
|
+ if (obj.palletList.length > 0) {
|
|
|
+ obj.palletList = obj.palletList.map((m) => {
|
|
|
+ return {
|
|
|
+ hideKc: true, // 不显示库存
|
|
|
+ quantity: m.feedQuantity,
|
|
|
+ ...m
|
|
|
+ };
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
- // console.log(this.taskObj.type, 'this.taskObj.type');
|
|
|
+ // console.log(this.taskObj.type, 'this.taskObj.type');
|
|
|
|
|
|
- if (
|
|
|
- (this.taskObj.type == 6 && obj.singleReport == 1) ||
|
|
|
- (this.clientEnvironmentId == 3 &&
|
|
|
- obj.singleReport == 0 &&
|
|
|
- this.taskObj.type == 6)
|
|
|
- ) {
|
|
|
- obj.semiProductList = obj.pickOutInList;
|
|
|
- obj.pickOutInList = [];
|
|
|
-
|
|
|
- console.log('赋值了');
|
|
|
- } else if (this.taskObj.type == 6 && obj.singleReport == 0) {
|
|
|
- obj.product = obj.pickOutInList;
|
|
|
- obj.pickOutInList = [];
|
|
|
- } else if (
|
|
|
- this.taskObj.type == 4 &&
|
|
|
- obj.singleReport == 0 &&
|
|
|
- this.clientEnvironmentId != 3 &&
|
|
|
- this.clientEnvironmentId != 2
|
|
|
- ) {
|
|
|
- if (obj.pickOutInList && obj.pickOutInList.length != 0) {
|
|
|
+ if (
|
|
|
+ (this.taskObj.type == 6 && obj.singleReport == 1) ||
|
|
|
+ (this.clientEnvironmentId == 3 &&
|
|
|
+ obj.singleReport == 0 &&
|
|
|
+ this.taskObj.type == 6)
|
|
|
+ ) {
|
|
|
+ obj.semiProductList = obj.pickOutInList;
|
|
|
+ obj.pickOutInList = [];
|
|
|
+
|
|
|
+ console.log('赋值了');
|
|
|
+ } else if (this.taskObj.type == 6 && obj.singleReport == 0) {
|
|
|
obj.product = obj.pickOutInList;
|
|
|
obj.pickOutInList = [];
|
|
|
+ } else if (
|
|
|
+ this.taskObj.type == 4 &&
|
|
|
+ obj.singleReport == 0 &&
|
|
|
+ this.clientEnvironmentId != 3 &&
|
|
|
+ this.clientEnvironmentId != 2
|
|
|
+ ) {
|
|
|
+ if (obj.pickOutInList && obj.pickOutInList.length != 0) {
|
|
|
+ obj.product = obj.pickOutInList;
|
|
|
+ obj.pickOutInList = [];
|
|
|
+ }
|
|
|
+ } else if (
|
|
|
+ this.taskObj.type == 4 &&
|
|
|
+ obj.singleReport == 1 &&
|
|
|
+ this.clientEnvironmentId != 3 &&
|
|
|
+ this.clientEnvironmentId != 2
|
|
|
+ ) {
|
|
|
+ if (obj.pickOutInList && obj.pickOutInList.length != 0) {
|
|
|
+ obj.semiProductList = obj.pickOutInList;
|
|
|
+ obj.pickOutInList = [];
|
|
|
+ }
|
|
|
}
|
|
|
- } else if (
|
|
|
- this.taskObj.type == 4 &&
|
|
|
- obj.singleReport == 1 &&
|
|
|
- this.clientEnvironmentId != 3 &&
|
|
|
- this.clientEnvironmentId != 2
|
|
|
- ) {
|
|
|
- if (obj.pickOutInList && obj.pickOutInList.length != 0) {
|
|
|
- obj.semiProductList = obj.pickOutInList;
|
|
|
- obj.pickOutInList = [];
|
|
|
+
|
|
|
+ if (
|
|
|
+ obj.singleReport == 1 &&
|
|
|
+ obj.currentTaskDiagram.type != 2 &&
|
|
|
+ obj.currentTaskDiagram.type != 3 &&
|
|
|
+ obj.currentTaskDiagram.type != 6
|
|
|
+ ) {
|
|
|
+ obj.semiProductList.map((item) => {
|
|
|
+ item.extInfo.taskId = '';
|
|
|
+ item.extInfo.taskName = '';
|
|
|
+ });
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- if (
|
|
|
- obj.singleReport == 1 &&
|
|
|
- obj.currentTaskDiagram.type != 2 &&
|
|
|
- obj.currentTaskDiagram.type != 3 &&
|
|
|
- obj.currentTaskDiagram.type != 6
|
|
|
- ) {
|
|
|
- obj.semiProductList.map((item) => {
|
|
|
- item.extInfo.taskId = '';
|
|
|
- item.extInfo.taskName = '';
|
|
|
- });
|
|
|
- }
|
|
|
+ if (
|
|
|
+ obj.singleReport == 0 &&
|
|
|
+ obj.currentTaskDiagram.type != 2 &&
|
|
|
+ obj.currentTaskDiagram.type != 3 &&
|
|
|
+ obj.currentTaskDiagram.type != 6
|
|
|
+ ) {
|
|
|
+ obj.product.map((item) => {
|
|
|
+ item.extInfo.taskId = '';
|
|
|
+ item.extInfo.taskName = '';
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
- if (
|
|
|
- obj.singleReport == 0 &&
|
|
|
- obj.currentTaskDiagram.type != 2 &&
|
|
|
- obj.currentTaskDiagram.type != 3 &&
|
|
|
- obj.currentTaskDiagram.type != 6
|
|
|
- ) {
|
|
|
- obj.product.map((item) => {
|
|
|
- item.extInfo.taskId = '';
|
|
|
- item.extInfo.taskName = '';
|
|
|
- });
|
|
|
- }
|
|
|
+ if (
|
|
|
+ this.clientEnvironmentId == 3 &&
|
|
|
+ obj.singleReport == 0 &&
|
|
|
+ this.taskObj.type != 6
|
|
|
+ ) {
|
|
|
+ obj.semiProductList.map((a) => {
|
|
|
+ a.extInfo.batchReportInfo = [
|
|
|
+ {
|
|
|
+ allFeedQuantity: '',
|
|
|
+ allReportWeight: '',
|
|
|
+ taskId: '',
|
|
|
+ taskName: ''
|
|
|
+ }
|
|
|
+ ];
|
|
|
+
|
|
|
+ a.extInfo.notBatchReportInfo = [
|
|
|
+ {
|
|
|
+ allFeedQuantity: '',
|
|
|
+ notType: '',
|
|
|
+ taskId: '',
|
|
|
+ taskName: '',
|
|
|
+ notReason: ''
|
|
|
+ }
|
|
|
+ ];
|
|
|
+
|
|
|
+ return {
|
|
|
+ a
|
|
|
+ };
|
|
|
+ });
|
|
|
|
|
|
- if (
|
|
|
- this.clientEnvironmentId == 3 &&
|
|
|
- obj.singleReport == 0 &&
|
|
|
- this.taskObj.type != 6
|
|
|
- ) {
|
|
|
- obj.semiProductList.map((a) => {
|
|
|
- a.extInfo.batchReportInfo = [
|
|
|
- {
|
|
|
- allFeedQuantity: '',
|
|
|
- allReportWeight: '',
|
|
|
- taskId: '',
|
|
|
- taskName: ''
|
|
|
- }
|
|
|
- ];
|
|
|
-
|
|
|
- a.extInfo.notBatchReportInfo = [
|
|
|
- {
|
|
|
- allFeedQuantity: '',
|
|
|
- notType: '',
|
|
|
- taskId: '',
|
|
|
- taskName: '',
|
|
|
- notReason: ''
|
|
|
+ obj.semiProductList = JSON.parse(
|
|
|
+ JSON.stringify(obj.semiProductList)
|
|
|
+ );
|
|
|
+ }
|
|
|
+ obj.semiProductList = obj.semiProductList.map((item) => {
|
|
|
+ if (this.taskObj.type != 6) {
|
|
|
+ if (item['extInfo']?.reportWeight) {
|
|
|
+ item['extInfo'].reportWeight = '';
|
|
|
}
|
|
|
- ];
|
|
|
-
|
|
|
- return {
|
|
|
- a
|
|
|
- };
|
|
|
- });
|
|
|
-
|
|
|
- obj.semiProductList = JSON.parse(
|
|
|
- JSON.stringify(obj.semiProductList)
|
|
|
- );
|
|
|
- }
|
|
|
- obj.semiProductList = obj.semiProductList.map((item) => {
|
|
|
- if (this.taskObj.type != 6) {
|
|
|
- if (item['extInfo']?.reportWeight) {
|
|
|
- item['extInfo'].reportWeight = '';
|
|
|
}
|
|
|
- }
|
|
|
- item.confirm = 0;
|
|
|
+ item.confirm = 0;
|
|
|
|
|
|
- console.log(item, 'item');
|
|
|
- return item;
|
|
|
- });
|
|
|
+ console.log(item, 'item');
|
|
|
+ return item;
|
|
|
+ });
|
|
|
|
|
|
- obj.product = obj.product.map((item) => {
|
|
|
- if (this.taskObj.type != 6) {
|
|
|
- if (item['extInfo']?.reportWeight) {
|
|
|
- item['extInfo'].reportWeight = '';
|
|
|
+ obj.product = obj.product.map((item) => {
|
|
|
+ if (this.taskObj.type != 6) {
|
|
|
+ if (item['extInfo']?.reportWeight) {
|
|
|
+ item['extInfo'].reportWeight = '';
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- item.confirm = 0;
|
|
|
+ item.confirm = 0;
|
|
|
|
|
|
- console.log(item, 'item');
|
|
|
- return item;
|
|
|
- });
|
|
|
+ console.log(item, 'item');
|
|
|
+ return item;
|
|
|
+ });
|
|
|
|
|
|
- obj.workReportInfo = {
|
|
|
- executorTime: null,
|
|
|
- formingNum: null,
|
|
|
- formingWeight: null,
|
|
|
- formedNum: null,
|
|
|
- formedWeight: null,
|
|
|
- taskId: this.taskObj.id,
|
|
|
- notFormedNum: null,
|
|
|
- notFormedWeigh: null
|
|
|
- };
|
|
|
-
|
|
|
- obj.notFormedList = [
|
|
|
- {
|
|
|
+ obj.workReportInfo = {
|
|
|
+ executorTime: null,
|
|
|
+ formingNum: null,
|
|
|
+ formingWeight: null,
|
|
|
+ formedNum: null,
|
|
|
+ formedWeight: null,
|
|
|
+ taskId: this.taskObj.id,
|
|
|
notFormedNum: null,
|
|
|
- notFormedWeight: null,
|
|
|
- weightUnit: obj.weightUnit,
|
|
|
- unit: obj.unit,
|
|
|
- warehouseId: null // 处置 仓库id
|
|
|
- }
|
|
|
- ];
|
|
|
+ notFormedWeigh: null
|
|
|
+ };
|
|
|
+
|
|
|
+ obj.notFormedList = [
|
|
|
+ {
|
|
|
+ notFormedNum: null,
|
|
|
+ notFormedWeight: null,
|
|
|
+ weightUnit: obj.weightUnit,
|
|
|
+ unit: obj.unit,
|
|
|
+ warehouseId: null // 处置 仓库id
|
|
|
+ }
|
|
|
+ ];
|
|
|
|
|
|
- if (obj.semiProductList.length > 0) {
|
|
|
- // 预制体报工
|
|
|
- obj.workReportInfo.formedNum = obj.semiProductList.length;
|
|
|
- let numCot = 0;
|
|
|
if (obj.semiProductList.length > 0) {
|
|
|
- obj.semiProductList.map((fitem) => {
|
|
|
- numCot = numCot + fitem.feedQuantity || 1;
|
|
|
- });
|
|
|
- obj.workReportInfo.formedNum = numCot;
|
|
|
+ // 预制体报工
|
|
|
+ obj.workReportInfo.formedNum = obj.semiProductList.length;
|
|
|
+ let numCot = 0;
|
|
|
+ if (obj.semiProductList.length > 0) {
|
|
|
+ obj.semiProductList.map((fitem) => {
|
|
|
+ numCot = numCot + fitem.feedQuantity || 1;
|
|
|
+ });
|
|
|
+ obj.workReportInfo.formedNum = numCot;
|
|
|
+ }
|
|
|
+ } else if (obj.product.length > 0) {
|
|
|
+ const number = obj.product.reduce((acc, pro) => {
|
|
|
+ return pro.feedQuantity
|
|
|
+ ? acc + Number(pro.feedQuantity)
|
|
|
+ : acc;
|
|
|
+ }, 0);
|
|
|
+
|
|
|
+ obj.workReportInfo.formedNum = number;
|
|
|
}
|
|
|
- } else if (obj.product.length > 0) {
|
|
|
- const number = obj.product.reduce((acc, pro) => {
|
|
|
- return pro.feedQuantity
|
|
|
- ? acc + Number(pro.feedQuantity)
|
|
|
- : acc;
|
|
|
- }, 0);
|
|
|
-
|
|
|
- obj.workReportInfo.formedNum = number;
|
|
|
- }
|
|
|
|
|
|
- obj.workReportInfo.formingNum = obj.formingNum;
|
|
|
- obj.workReportInfo.formingWeight = obj.formingWeight;
|
|
|
- obj.workReportInfo.unit = obj.unit;
|
|
|
- obj.workReportInfo.weightUnit = obj.weightUnit;
|
|
|
- obj.workReportInfo.workOrderId = obj.workOrderId;
|
|
|
- obj.workReportInfo.executorTime = obj.executorTime;
|
|
|
+ obj.workReportInfo.formingNum = obj.formingNum;
|
|
|
+ obj.workReportInfo.formingWeight = obj.formingWeight;
|
|
|
+ obj.workReportInfo.unit = obj.unit;
|
|
|
+ obj.workReportInfo.weightUnit = obj.weightUnit;
|
|
|
+ obj.workReportInfo.workOrderId = obj.workOrderId;
|
|
|
+ obj.workReportInfo.executorTime = obj.executorTime;
|
|
|
+
|
|
|
+ obj.paramDetailList.map((m) => {
|
|
|
+ if (m.extInfo.textType == 5) {
|
|
|
+ m.remainingTime = m.extInfo.remainingTime;
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ ...m.extInfo
|
|
|
+ };
|
|
|
+ });
|
|
|
+
|
|
|
+ console.log(obj, 4445555);
|
|
|
|
|
|
- obj.paramDetailList.map((m) => {
|
|
|
- if (m.extInfo.textType == 5) {
|
|
|
- m.remainingTime = m.extInfo.remainingTime;
|
|
|
+ if (this.taskObj.type == 4) {
|
|
|
+ let numVal = 0;
|
|
|
+ obj.pickOutInList.map((item) => {
|
|
|
+ numVal = numVal + item.feedQuantity;
|
|
|
+ });
|
|
|
+ obj.workReportInfo.formedNum = numVal;
|
|
|
}
|
|
|
return {
|
|
|
- ...m.extInfo
|
|
|
+ ...obj
|
|
|
};
|
|
|
});
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.isLoad = true;
|
|
|
|
|
|
- console.log(obj, 4445555);
|
|
|
-
|
|
|
- if (this.taskObj.type == 4) {
|
|
|
- let numVal = 0;
|
|
|
- obj.pickOutInList.map((item) => {
|
|
|
- numVal = numVal + item.feedQuantity;
|
|
|
- });
|
|
|
- obj.workReportInfo.formedNum = numVal;
|
|
|
+ if (this.taskObj.type == 1) {
|
|
|
+ this.getCacheFn();
|
|
|
}
|
|
|
- return {
|
|
|
- ...obj
|
|
|
- };
|
|
|
});
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- this.isLoad = true;
|
|
|
-
|
|
|
- if (this.taskObj.type == 1) {
|
|
|
- this.getCacheFn();
|
|
|
- }
|
|
|
- });
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
openPicking(id, item) {
|