|
|
@@ -415,10 +415,28 @@
|
|
|
import ProductModal from '@/views/inspectionProject/components/ProductModal.vue';
|
|
|
import imgList from '@/components/upload/imgList.vue';
|
|
|
import detailMixins from '../mixins/detailMixins';
|
|
|
-
|
|
|
+ const defForm = {
|
|
|
+ code: '',
|
|
|
+ correlationId: '',
|
|
|
+ consumablesJson: [],
|
|
|
+ toolJson: [],
|
|
|
+ attachmentUrl: [],
|
|
|
+ experimentalTime: '',
|
|
|
+ imgUrl: [],
|
|
|
+ procedureJson: null,
|
|
|
+ qualityStandardName: '',
|
|
|
+ qualityStandardId: '',
|
|
|
+ processRequirementsJson: '',
|
|
|
+ recordJson: null,
|
|
|
+ qualityWorkOrderId: '',
|
|
|
+ results: 1,
|
|
|
+ resultsDescription: '',
|
|
|
+ experimentEquipmentList: []
|
|
|
+ };
|
|
|
export default {
|
|
|
components: { experimentationProcess, releaseRules, ProductModal, imgList },
|
|
|
- props: {},
|
|
|
+
|
|
|
+ props: { pageName: '' },
|
|
|
mixins: [dictMixins, detailMixins],
|
|
|
|
|
|
data() {
|
|
|
@@ -430,22 +448,7 @@
|
|
|
type: '',
|
|
|
getSampleQuantityCount: 0,
|
|
|
form: {
|
|
|
- code: '',
|
|
|
- correlationId: '',
|
|
|
- consumablesJson: [],
|
|
|
- toolJson: [],
|
|
|
- attachmentUrl: [],
|
|
|
- experimentalTime: '',
|
|
|
- imgUrl: [],
|
|
|
- procedureJson: null,
|
|
|
- qualityStandardName: '',
|
|
|
- qualityStandardId: '',
|
|
|
- processRequirementsJson: '',
|
|
|
- recordJson: null,
|
|
|
- qualityWorkOrderId: '',
|
|
|
- results: 1,
|
|
|
- resultsDescription: '',
|
|
|
- experimentEquipmentList: []
|
|
|
+ ...defForm
|
|
|
},
|
|
|
laboratoryList: [],
|
|
|
unitColumns: [
|
|
|
@@ -629,34 +632,51 @@
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
- this.form.correlationId = row.id;
|
|
|
- this.form.qualityStandardName = row.qualityStandardName;
|
|
|
- this.form.qualityStandardId = row.qualityStandardId;
|
|
|
- this.form.qualityWorkOrderId = row.qualityWorkOrderId;
|
|
|
- this.form.processRequirementsJson = '';
|
|
|
- if (row.symbol) {
|
|
|
- this.form.processRequirementsJson += row.symbol;
|
|
|
- }
|
|
|
- if (row.textType == 3) {
|
|
|
- this.form.processRequirementsJson +=
|
|
|
- row.minValue + '-' + row.maxValue;
|
|
|
+ if (row.experiment && row.experiment.correlationId) {
|
|
|
+ this.form = JSON.parse(JSON.stringify(row.experiment));
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (this.form.procedureJson.tempJson) {
|
|
|
+ this.$refs.experimentationProcess1.init(
|
|
|
+ this.form.procedureJson.tempJson
|
|
|
+ );
|
|
|
+ }
|
|
|
+ if (this.form.recordJson.tempJson) {
|
|
|
+ this.$refs.experimentationProcess2.init(
|
|
|
+ this.form.recordJson.tempJson
|
|
|
+ );
|
|
|
+ }
|
|
|
+ });
|
|
|
} else {
|
|
|
- this.form.processRequirementsJson += row.defaultValue;
|
|
|
- }
|
|
|
- if (row.unitName) {
|
|
|
- this.form.processRequirementsJson += row.unitName;
|
|
|
- }
|
|
|
-
|
|
|
- this.$nextTick(async () => {
|
|
|
- if (row.procedureJson.tempJson) {
|
|
|
- this.$refs.experimentationProcess1.init(
|
|
|
- row.procedureJson.tempJson
|
|
|
- );
|
|
|
+ this.form.correlationId = row.id;
|
|
|
+ this.form.qualityStandardName = row.qualityStandardName;
|
|
|
+ this.form.qualityStandardId = row.qualityStandardId;
|
|
|
+ this.form.qualityWorkOrderId = row.qualityWorkOrderId;
|
|
|
+ this.form.processRequirementsJson = '';
|
|
|
+ if (row.symbol) {
|
|
|
+ this.form.processRequirementsJson += row.symbol;
|
|
|
}
|
|
|
- if (row.recordJson.tempJson) {
|
|
|
- this.$refs.experimentationProcess2.init(row.recordJson.tempJson);
|
|
|
+ if (row.textType == 3) {
|
|
|
+ this.form.processRequirementsJson +=
|
|
|
+ row.minValue + '-' + row.maxValue;
|
|
|
+ } else {
|
|
|
+ this.form.processRequirementsJson += row.defaultValue;
|
|
|
}
|
|
|
- });
|
|
|
+ if (row.unitName) {
|
|
|
+ this.form.processRequirementsJson += row.unitName;
|
|
|
+ }
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (row.procedureJson.tempJson) {
|
|
|
+ this.$refs.experimentationProcess1.init(
|
|
|
+ row.procedureJson.tempJson
|
|
|
+ );
|
|
|
+ }
|
|
|
+ if (row.recordJson.tempJson) {
|
|
|
+ this.$refs.experimentationProcess2.init(
|
|
|
+ row.recordJson.tempJson
|
|
|
+ );
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
this.getFactoryarea();
|
|
|
@@ -759,13 +779,22 @@
|
|
|
tempJson: JSON.stringify(recordJson)
|
|
|
};
|
|
|
}
|
|
|
+ let row = JSON.parse(JSON.stringify(this.tableData[0]));
|
|
|
+ if (!this.pageName) {
|
|
|
+ row.experiment = data;
|
|
|
+ this.$emit('done', row);
|
|
|
+ this.handleClose();
|
|
|
+
|
|
|
+ return;
|
|
|
+ }
|
|
|
let api = data.id ? update : save;
|
|
|
api(data)
|
|
|
.then((msg) => {
|
|
|
this.loading = false;
|
|
|
this.$message.success(msg);
|
|
|
+ row.experimentId = msg;
|
|
|
this.handleClose();
|
|
|
- this.$emit('done', this.tableData[0]);
|
|
|
+ this.$emit('done', row);
|
|
|
})
|
|
|
.catch((e) => {
|
|
|
this.loading = false;
|
|
|
@@ -773,7 +802,14 @@
|
|
|
});
|
|
|
},
|
|
|
handleClose() {
|
|
|
- this.visible = false;
|
|
|
+ this.form = {
|
|
|
+ ...defForm
|
|
|
+ };
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.experimentationProcess1.init('{}');
|
|
|
+ this.$refs.experimentationProcess2.init('{}');
|
|
|
+ this.visible = false;
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
};
|