|
@@ -312,11 +312,7 @@
|
|
|
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="handleSchemeDialogClose">取消</el-button>
|
|
<el-button @click="handleSchemeDialogClose">取消</el-button>
|
|
|
- <el-button
|
|
|
|
|
- type="primary"
|
|
|
|
|
- :loading="schemeSaving"
|
|
|
|
|
- @click="saveScheme"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <el-button type="primary" :loading="schemeSaving" @click="saveScheme">
|
|
|
保存
|
|
保存
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</div>
|
|
</div>
|
|
@@ -432,7 +428,9 @@
|
|
|
></DictSelection>
|
|
></DictSelection>
|
|
|
<el-input
|
|
<el-input
|
|
|
v-model="itemForm.defaultValue"
|
|
v-model="itemForm.defaultValue"
|
|
|
- :placeholder="itemForm.textType == 1 ? '请输入数字' : '请输入'"
|
|
|
|
|
|
|
+ :placeholder="
|
|
|
|
|
+ itemForm.textType == 1 ? '请输入数字' : '请输入'
|
|
|
|
|
+ "
|
|
|
@input="defaultInput"
|
|
@input="defaultInput"
|
|
|
></el-input>
|
|
></el-input>
|
|
|
</div>
|
|
</div>
|
|
@@ -457,10 +455,7 @@
|
|
|
clearable
|
|
clearable
|
|
|
v-model="itemForm.symbol"
|
|
v-model="itemForm.symbol"
|
|
|
></DictSelection>
|
|
></DictSelection>
|
|
|
- <el-select
|
|
|
|
|
- v-model="itemForm.defaultValue"
|
|
|
|
|
- placeholder="请选择"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <el-select v-model="itemForm.defaultValue" placeholder="请选择">
|
|
|
<el-option label="TRUE" :value="'TRUE'"></el-option>
|
|
<el-option label="TRUE" :value="'TRUE'"></el-option>
|
|
|
<el-option label="FALSE" :value="'FALSE'"></el-option>
|
|
<el-option label="FALSE" :value="'FALSE'"></el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
@@ -503,7 +498,10 @@
|
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
|
|
|
<el-row :gutter="16">
|
|
<el-row :gutter="16">
|
|
|
- <el-col :span="12" v-if="itemForm.textType != 2 && itemForm.textType != 5">
|
|
|
|
|
|
|
+ <el-col
|
|
|
|
|
+ :span="12"
|
|
|
|
|
+ v-if="itemForm.textType != 2 && itemForm.textType != 5"
|
|
|
|
|
+ >
|
|
|
<el-form-item
|
|
<el-form-item
|
|
|
label="参数单位"
|
|
label="参数单位"
|
|
|
prop="unitName"
|
|
prop="unitName"
|
|
@@ -539,7 +537,7 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="质检阶段" prop="qualityStage">
|
|
|
|
|
|
|
+ <el-form-item label="质检阶段">
|
|
|
<el-select
|
|
<el-select
|
|
|
v-model="itemForm.qualityStage"
|
|
v-model="itemForm.qualityStage"
|
|
|
placeholder="请选择"
|
|
placeholder="请选择"
|
|
@@ -699,10 +697,10 @@
|
|
|
textType: [
|
|
textType: [
|
|
|
{ required: true, message: '请选择参数类型', trigger: 'change' }
|
|
{ required: true, message: '请选择参数类型', trigger: 'change' }
|
|
|
],
|
|
],
|
|
|
- status: [{ required: true, message: '请选择状态', trigger: 'change' }],
|
|
|
|
|
- qualityStage: [
|
|
|
|
|
- { required: true, message: '请选择质检阶段', trigger: 'change' }
|
|
|
|
|
- ]
|
|
|
|
|
|
|
+ status: [{ required: true, message: '请选择状态', trigger: 'change' }]
|
|
|
|
|
+ // qualityStage: [
|
|
|
|
|
+ // { required: true, message: '请选择质检阶段', trigger: 'change' }
|
|
|
|
|
+ // ]
|
|
|
},
|
|
},
|
|
|
columns: [
|
|
columns: [
|
|
|
{
|
|
{
|
|
@@ -799,7 +797,8 @@
|
|
|
return (list || []).map((item) => ({
|
|
return (list || []).map((item) => ({
|
|
|
...item,
|
|
...item,
|
|
|
unitName: item.unitName || item.unit || '',
|
|
unitName: item.unitName || item.unit || '',
|
|
|
- _localKey: item._localKey || this.getRowKey(item) || this.createLocalKey()
|
|
|
|
|
|
|
+ _localKey:
|
|
|
|
|
+ item._localKey || this.getRowKey(item) || this.createLocalKey()
|
|
|
}));
|
|
}));
|
|
|
},
|
|
},
|
|
|
normalizeToNumber(value) {
|
|
normalizeToNumber(value) {
|
|
@@ -819,17 +818,25 @@
|
|
|
if (!this.isQualityInspection) {
|
|
if (!this.isQualityInspection) {
|
|
|
return '';
|
|
return '';
|
|
|
}
|
|
}
|
|
|
- const row = this.schemeTypeList.find((item) => item.label == '首件两检');
|
|
|
|
|
|
|
+ const row = this.schemeTypeList.find(
|
|
|
|
|
+ (item) => item.label == '首件两检'
|
|
|
|
|
+ );
|
|
|
return row ? row.value : '';
|
|
return row ? row.value : '';
|
|
|
},
|
|
},
|
|
|
getParameterSummary(row) {
|
|
getParameterSummary(row) {
|
|
|
if (row.textType == 3) {
|
|
if (row.textType == 3) {
|
|
|
const rangeValue = [row.minValue, row.maxValue]
|
|
const rangeValue = [row.minValue, row.maxValue]
|
|
|
- .filter((item) => item !== '' && item !== null && item !== undefined)
|
|
|
|
|
|
|
+ .filter(
|
|
|
|
|
+ (item) => item !== '' && item !== null && item !== undefined
|
|
|
|
|
+ )
|
|
|
.join(' - ');
|
|
.join(' - ');
|
|
|
- return `${row.symbol || ''}${rangeValue}${row.unitName || row.unit || ''}`;
|
|
|
|
|
|
|
+ return `${row.symbol || ''}${rangeValue}${
|
|
|
|
|
+ row.unitName || row.unit || ''
|
|
|
|
|
+ }`;
|
|
|
}
|
|
}
|
|
|
- return `${row.symbol || ''}${row.defaultValue || ''}${row.unitName || row.unit || ''}`;
|
|
|
|
|
|
|
+ return `${row.symbol || ''}${row.defaultValue || ''}${
|
|
|
|
|
+ row.unitName || row.unit || ''
|
|
|
|
|
+ }`;
|
|
|
},
|
|
},
|
|
|
resetSchemeForm() {
|
|
resetSchemeForm() {
|
|
|
this.schemeForm = createSchemeForm(this.getDefaultSchemeType());
|
|
this.schemeForm = createSchemeForm(this.getDefaultSchemeType());
|
|
@@ -859,7 +866,9 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
async assignSchemeCode() {
|
|
async assignSchemeCode() {
|
|
|
- this.schemeForm.qualitySchemeTemplateCode = await getCode('template_code');
|
|
|
|
|
|
|
+ this.schemeForm.qualitySchemeTemplateCode = await getCode(
|
|
|
|
|
+ 'template_code'
|
|
|
|
|
+ );
|
|
|
},
|
|
},
|
|
|
async openItemDialog(row, index = -1) {
|
|
async openItemDialog(row, index = -1) {
|
|
|
this.currentItemIndex = index;
|
|
this.currentItemIndex = index;
|
|
@@ -973,13 +982,19 @@
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if (this.itemForm.defaultValue !== '' && this.itemForm.maxValue !== '') {
|
|
|
|
|
|
|
+ if (
|
|
|
|
|
+ this.itemForm.defaultValue !== '' &&
|
|
|
|
|
+ this.itemForm.maxValue !== ''
|
|
|
|
|
+ ) {
|
|
|
if (defaultValue >= maxValue) {
|
|
if (defaultValue >= maxValue) {
|
|
|
this.$message.warning('默认值应小于参数上限');
|
|
this.$message.warning('默认值应小于参数上限');
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if (this.itemForm.defaultValue !== '' && this.itemForm.minValue !== '') {
|
|
|
|
|
|
|
+ if (
|
|
|
|
|
+ this.itemForm.defaultValue !== '' &&
|
|
|
|
|
+ this.itemForm.minValue !== ''
|
|
|
|
|
+ ) {
|
|
|
if (defaultValue <= minValue) {
|
|
if (defaultValue <= minValue) {
|
|
|
this.$message.warning('默认值应大于参数下限');
|
|
this.$message.warning('默认值应大于参数下限');
|
|
|
return false;
|
|
return false;
|
|
@@ -1004,7 +1019,8 @@
|
|
|
this.itemForm.sort === '' || this.itemForm.sort === null
|
|
this.itemForm.sort === '' || this.itemForm.sort === null
|
|
|
? this.schemeForm.inspectionItemVOList.length + 1
|
|
? this.schemeForm.inspectionItemVOList.length + 1
|
|
|
: Number(this.itemForm.sort),
|
|
: Number(this.itemForm.sort),
|
|
|
- unitName: this.itemForm.textType == 5 ? 'h' : this.itemForm.unitName,
|
|
|
|
|
|
|
+ unitName:
|
|
|
|
|
+ this.itemForm.textType == 5 ? 'h' : this.itemForm.unitName,
|
|
|
unit: this.itemForm.textType == 5 ? 'h' : this.itemForm.unitName,
|
|
unit: this.itemForm.textType == 5 ? 'h' : this.itemForm.unitName,
|
|
|
executionMethod: 1,
|
|
executionMethod: 1,
|
|
|
procedureJson: this.itemForm.procedureJson || {},
|
|
procedureJson: this.itemForm.procedureJson || {},
|
|
@@ -1018,7 +1034,11 @@
|
|
|
if (this.currentItemIndex === -1) {
|
|
if (this.currentItemIndex === -1) {
|
|
|
this.schemeForm.inspectionItemVOList.push(itemData);
|
|
this.schemeForm.inspectionItemVOList.push(itemData);
|
|
|
} else {
|
|
} else {
|
|
|
- this.$set(this.schemeForm.inspectionItemVOList, this.currentItemIndex, itemData);
|
|
|
|
|
|
|
+ this.$set(
|
|
|
|
|
+ this.schemeForm.inspectionItemVOList,
|
|
|
|
|
+ this.currentItemIndex,
|
|
|
|
|
+ itemData
|
|
|
|
|
+ );
|
|
|
}
|
|
}
|
|
|
this.schemeForm.inspectionItemVOList.sort((a, b) => {
|
|
this.schemeForm.inspectionItemVOList.sort((a, b) => {
|
|
|
return Number(a.sort || 0) - Number(b.sort || 0);
|
|
return Number(a.sort || 0) - Number(b.sort || 0);
|
|
@@ -1036,21 +1056,24 @@
|
|
|
type: this.normalizeToNumber(this.schemeForm.type),
|
|
type: this.normalizeToNumber(this.schemeForm.type),
|
|
|
status: 1,
|
|
status: 1,
|
|
|
qualityMode: this.normalizeToNumber(this.schemeForm.qualityMode),
|
|
qualityMode: this.normalizeToNumber(this.schemeForm.qualityMode),
|
|
|
- inspectionItemVOList: this.schemeForm.inspectionItemVOList.map((item) => {
|
|
|
|
|
- const { _localKey, ...rest } = item;
|
|
|
|
|
- return {
|
|
|
|
|
- ...rest,
|
|
|
|
|
- id: '',
|
|
|
|
|
- textType: this.normalizeToNumber(rest.textType),
|
|
|
|
|
- status: this.normalizeToNumber(rest.status),
|
|
|
|
|
- qualityStage: this.normalizeToNumber(rest.qualityStage),
|
|
|
|
|
- qualityStandardType: this.normalizeToNumber(
|
|
|
|
|
- rest.qualityStandardType
|
|
|
|
|
- ),
|
|
|
|
|
- executionMethod: this.normalizeToNumber(rest.executionMethod) || 1,
|
|
|
|
|
- unit: rest.unitName || rest.unit || ''
|
|
|
|
|
- };
|
|
|
|
|
- }),
|
|
|
|
|
|
|
+ inspectionItemVOList: this.schemeForm.inspectionItemVOList.map(
|
|
|
|
|
+ (item) => {
|
|
|
|
|
+ const { _localKey, ...rest } = item;
|
|
|
|
|
+ return {
|
|
|
|
|
+ ...rest,
|
|
|
|
|
+ id: '',
|
|
|
|
|
+ textType: this.normalizeToNumber(rest.textType),
|
|
|
|
|
+ status: this.normalizeToNumber(rest.status),
|
|
|
|
|
+ qualityStage: this.normalizeToNumber(rest.qualityStage),
|
|
|
|
|
+ qualityStandardType: this.normalizeToNumber(
|
|
|
|
|
+ rest.qualityStandardType
|
|
|
|
|
+ ),
|
|
|
|
|
+ executionMethod:
|
|
|
|
|
+ this.normalizeToNumber(rest.executionMethod) || 1,
|
|
|
|
|
+ unit: rest.unitName || rest.unit || ''
|
|
|
|
|
+ };
|
|
|
|
|
+ }
|
|
|
|
|
+ ),
|
|
|
templateCategoryList: []
|
|
templateCategoryList: []
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
@@ -1144,22 +1167,27 @@
|
|
|
async changeSel(row) {
|
|
async changeSel(row) {
|
|
|
const { data } = await getTemplateById(row.id);
|
|
const { data } = await getTemplateById(row.id);
|
|
|
const typeLabel = this.getSchemeTypeLabel(data.type);
|
|
const typeLabel = this.getSchemeTypeLabel(data.type);
|
|
|
- const inspectionItemVOList = (data.inspectionItemVOList || []).map((item) => ({
|
|
|
|
|
- ...item,
|
|
|
|
|
- type: data.type,
|
|
|
|
|
- qualityMode: data.qualityMode,
|
|
|
|
|
- categoryLevelClassName: item.categoryLevelClassName || typeLabel,
|
|
|
|
|
- qualitySchemeTemplateCode: data.qualitySchemeTemplateCode,
|
|
|
|
|
- qualitySchemeTemplateName: data.qualitySchemeTemplateName,
|
|
|
|
|
- templateRemark: data.templateRemark,
|
|
|
|
|
- sampleProportion: data.sampleProportion,
|
|
|
|
|
- sampleProportionUnit: data.sampleProportionUnit,
|
|
|
|
|
- validityPeriod: data.validityPeriod,
|
|
|
|
|
- validityPeriodUnit: data.validityPeriodUnit,
|
|
|
|
|
- unitName: item.unitName || item.unit || '',
|
|
|
|
|
- unit: item.unitName || item.unit || ''
|
|
|
|
|
- }));
|
|
|
|
|
- this.list = [...this.list, ...this.attachLocalKeys(inspectionItemVOList)];
|
|
|
|
|
|
|
+ const inspectionItemVOList = (data.inspectionItemVOList || []).map(
|
|
|
|
|
+ (item) => ({
|
|
|
|
|
+ ...item,
|
|
|
|
|
+ type: data.type,
|
|
|
|
|
+ qualityMode: data.qualityMode,
|
|
|
|
|
+ categoryLevelClassName: item.categoryLevelClassName || typeLabel,
|
|
|
|
|
+ qualitySchemeTemplateCode: data.qualitySchemeTemplateCode,
|
|
|
|
|
+ qualitySchemeTemplateName: data.qualitySchemeTemplateName,
|
|
|
|
|
+ templateRemark: data.templateRemark,
|
|
|
|
|
+ sampleProportion: data.sampleProportion,
|
|
|
|
|
+ sampleProportionUnit: data.sampleProportionUnit,
|
|
|
|
|
+ validityPeriod: data.validityPeriod,
|
|
|
|
|
+ validityPeriodUnit: data.validityPeriodUnit,
|
|
|
|
|
+ unitName: item.unitName || item.unit || '',
|
|
|
|
|
+ unit: item.unitName || item.unit || ''
|
|
|
|
|
+ })
|
|
|
|
|
+ );
|
|
|
|
|
+ this.list = [
|
|
|
|
|
+ ...this.list,
|
|
|
|
|
+ ...this.attachLocalKeys(inspectionItemVOList)
|
|
|
|
|
+ ];
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|