|
@@ -581,9 +581,21 @@
|
|
|
</template>
|
|
</template>
|
|
|
</ele-pro-table>
|
|
</ele-pro-table>
|
|
|
|
|
|
|
|
- <header-title :title="formData.reportWorkType==5?'实验过程':formData.reportWorkType==6?'工艺要求':formData.reportWorkType==7?'实验记录':''" v-if="qmsReportWorkType.includes(formData.reportWorkType)">
|
|
|
|
|
|
|
+ <header-title
|
|
|
|
|
+ :title="
|
|
|
|
|
+ formData.reportWorkType == 5
|
|
|
|
|
+ ? '实验过程'
|
|
|
|
|
+ : formData.reportWorkType == 6
|
|
|
|
|
+ ? '工艺要求'
|
|
|
|
|
+ : formData.reportWorkType == 7
|
|
|
|
|
+ ? '实验记录'
|
|
|
|
|
+ : ''
|
|
|
|
|
+ "
|
|
|
|
|
+ v-if="qmsReportWorkType.includes(formData.reportWorkType)"
|
|
|
|
|
+ >
|
|
|
</header-title>
|
|
</header-title>
|
|
|
<experimentationProcess
|
|
<experimentationProcess
|
|
|
|
|
+ :edit="type!='detail'"
|
|
|
v-if="qmsReportWorkType.includes(formData.reportWorkType)"
|
|
v-if="qmsReportWorkType.includes(formData.reportWorkType)"
|
|
|
ref="experimentationProcess"
|
|
ref="experimentationProcess"
|
|
|
></experimentationProcess>
|
|
></experimentationProcess>
|
|
@@ -1023,7 +1035,7 @@
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
return {
|
|
return {
|
|
|
- qmsReportWorkType:['5','6','7'],
|
|
|
|
|
|
|
+ qmsReportWorkType: ['5', '6', '7'],
|
|
|
dialogTitle: '',
|
|
dialogTitle: '',
|
|
|
visible: false,
|
|
visible: false,
|
|
|
formDateBase,
|
|
formDateBase,
|
|
@@ -1252,6 +1264,9 @@
|
|
|
this.$refs.cycleMultipleRef?.setRecordRulesCycleList(
|
|
this.$refs.cycleMultipleRef?.setRecordRulesCycleList(
|
|
|
this.formData.recordRulesCycleList
|
|
this.formData.recordRulesCycleList
|
|
|
);
|
|
);
|
|
|
|
|
+ if (this.qmsReportWorkType.includes(this.formData.reportWorkType)) {
|
|
|
|
|
+ this.$refs.experimentationProcess.init(data.tempJson.tempJson);
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
this.formData.startDate = new Date(data.startDate);
|
|
this.formData.startDate = new Date(data.startDate);
|
|
@@ -1311,6 +1326,7 @@
|
|
|
|
|
|
|
|
this.loading = false;
|
|
this.loading = false;
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
|
|
+ console.log(error, 'error');
|
|
|
this.loading = false;
|
|
this.loading = false;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -1349,7 +1365,10 @@
|
|
|
if (!valid) {
|
|
if (!valid) {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
- if (this.formData.details.length == 0) {
|
|
|
|
|
|
|
+ if (
|
|
|
|
|
+ this.formData.details.length == 0 &&
|
|
|
|
|
+ !this.qmsReportWorkType.includes(this.formData.reportWorkType)
|
|
|
|
|
+ ) {
|
|
|
return this.$message.warning('至少条件一条规则项');
|
|
return this.$message.warning('至少条件一条规则项');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1380,6 +1399,7 @@
|
|
|
this.$emit('reload');
|
|
this.$emit('reload');
|
|
|
this.$emit('reloadTypeList');
|
|
this.$emit('reloadTypeList');
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
|
|
+ console.log(error, 'dasda');
|
|
|
this.btnLoading = false;
|
|
this.btnLoading = false;
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -1391,22 +1411,24 @@
|
|
|
if (!valid) {
|
|
if (!valid) {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
- if (this.formData.details.length == 0) {
|
|
|
|
|
- return this.$message.warning('至少条件一条规则项');
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (!this.qmsReportWorkType.includes(this.formData.reportWorkType)) {
|
|
|
|
|
+ if (this.formData.details.length == 0) {
|
|
|
|
|
+ return this.$message.warning('至少条件一条规则项');
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- if (this.formData.reportWorkType == 4) {
|
|
|
|
|
- // 生产统计过滤掉非成品统计的明细
|
|
|
|
|
- this.formData.details = this.formData.details.filter(
|
|
|
|
|
- (i) => i.statisticsType
|
|
|
|
|
- );
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (this.formData.reportWorkType == 4) {
|
|
|
|
|
+ // 生产统计过滤掉非成品统计的明细
|
|
|
|
|
+ this.formData.details = this.formData.details.filter(
|
|
|
|
|
+ (i) => i.statisticsType
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- // 判断参数类型是否选择
|
|
|
|
|
- for (const detail of this.formData.details) {
|
|
|
|
|
- if (!detail.paramType) {
|
|
|
|
|
- console.log('detail', detail);
|
|
|
|
|
- return this.$message.warning('请选择规则明细中的参数类型!');
|
|
|
|
|
|
|
+ // 判断参数类型是否选择
|
|
|
|
|
+ for (const detail of this.formData.details) {
|
|
|
|
|
+ if (!detail.paramType) {
|
|
|
|
|
+ console.log('detail', detail);
|
|
|
|
|
+ return this.$message.warning('请选择规则明细中的参数类型!');
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1427,6 +1449,7 @@
|
|
|
this.handleClose();
|
|
this.handleClose();
|
|
|
this.$emit('reload');
|
|
this.$emit('reload');
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
|
|
+ console.log(error, 'error');
|
|
|
this.btnLoading = false;
|
|
this.btnLoading = false;
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -1565,6 +1588,7 @@
|
|
|
// 数据格式化
|
|
// 数据格式化
|
|
|
formatBody() {
|
|
formatBody() {
|
|
|
this.formData.recordRulesCycleList =
|
|
this.formData.recordRulesCycleList =
|
|
|
|
|
+ this.$refs.cycleMultipleRef &&
|
|
|
this.$refs.cycleMultipleRef.recordRulesCycleList
|
|
this.$refs.cycleMultipleRef.recordRulesCycleList
|
|
|
.map((i) => {
|
|
.map((i) => {
|
|
|
// 根据月日时分排序计算权重排序
|
|
// 根据月日时分排序计算权重排序
|
|
@@ -1601,7 +1625,14 @@
|
|
|
body.stopDate,
|
|
body.stopDate,
|
|
|
'yyyy-MM-dd HH:mm:ss'
|
|
'yyyy-MM-dd HH:mm:ss'
|
|
|
);
|
|
);
|
|
|
-
|
|
|
|
|
|
|
+ if (this.qmsReportWorkType.includes(body.reportWorkType)) {
|
|
|
|
|
+ let tempJson = this.$refs.experimentationProcess.getValue();
|
|
|
|
|
+ if (tempJson) {
|
|
|
|
|
+ body.tempJson = {
|
|
|
|
|
+ tempJson: JSON.stringify(tempJson)
|
|
|
|
|
+ };
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
// details 根据下标添加 sortNum
|
|
// details 根据下标添加 sortNum
|
|
|
body.details = body.details.map((item, index) => {
|
|
body.details = body.details.map((item, index) => {
|
|
|
return { ...item };
|
|
return { ...item };
|
|
@@ -1818,14 +1849,16 @@
|
|
|
// 过程控制修改 保存
|
|
// 过程控制修改 保存
|
|
|
processEditSave() {
|
|
processEditSave() {
|
|
|
// 只验证详情内容
|
|
// 只验证详情内容
|
|
|
- if (this.formData.details.length == 0) {
|
|
|
|
|
- return this.$message.warning('至少条件一条规则项');
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (!this.qmsReportWorkType.includes(this.formData.reportWorkType)) {
|
|
|
|
|
+ if (this.formData.details.length == 0) {
|
|
|
|
|
+ return this.$message.warning('至少条件一条规则项');
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- // 判断参数类型是否选择
|
|
|
|
|
- for (const detail of this.formData.details) {
|
|
|
|
|
- if (!detail.paramType) {
|
|
|
|
|
- return this.$message.warning('请选择规则明细中的参数类型!');
|
|
|
|
|
|
|
+ // 判断参数类型是否选择
|
|
|
|
|
+ for (const detail of this.formData.details) {
|
|
|
|
|
+ if (!detail.paramType) {
|
|
|
|
|
+ return this.$message.warning('请选择规则明细中的参数类型!');
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|