|
|
|
@ -18,30 +18,6 @@
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="4" v-if="this.typeCode == 'material' || this.typeCode == 'product'">
|
|
|
|
|
<el-form-item label="检测水平" prop="checkLevel">
|
|
|
|
|
<el-select v-model="queryParams.checkLevel" placeholder="请选择检测水平类型" clearable>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in dict.type.sample_level"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="4" v-if="this.typeCode == 'material' || this.typeCode == 'product'">
|
|
|
|
|
<el-form-item label="接受质量限" prop="checkAql">
|
|
|
|
|
<el-select v-model="queryParams.checkAql" placeholder="请选择检测水平类型" clearable>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in dict.type.sample_aql"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="4">
|
|
|
|
|
<el-form-item label="是否发起OA" prop="startOA">
|
|
|
|
|
<el-radio-group v-model="form.startOA">
|
|
|
|
@ -100,9 +76,13 @@
|
|
|
|
|
<el-table-column label="检验方式" align="left" prop="checkMode" width="150" :show-overflow-tooltip="true"/>
|
|
|
|
|
<el-table-column label="检验工具" align="left" prop="checkTool" />
|
|
|
|
|
<el-table-column label="检验标准" align="left" prop="checkStandard" width="150" :show-overflow-tooltip="true"/>
|
|
|
|
|
<el-table-column label="上差值" align="left" prop="upperDiff" />
|
|
|
|
|
<el-table-column label="下差值" align="left" prop="downDiff" />
|
|
|
|
|
<el-table-column label="上差值" align="left" prop="upperDiff" v-if="this.typeCode == 'material' || this.typeCode == 'product'"/>
|
|
|
|
|
<el-table-column label="下差值" align="left" prop="downDiff" v-if="this.typeCode == 'material' || this.typeCode == 'product'"/>
|
|
|
|
|
<el-table-column label="单位" align="left" prop="unitCode" width="80"/>
|
|
|
|
|
<el-table-column label="样本量编码" align="left" prop="sampleCode" width="80" v-if="this.typeCode == 'material' || this.typeCode == 'product'"/>
|
|
|
|
|
<el-table-column label="抽样数量" align="left" prop="sampleQuality" width="80" v-if="this.typeCode == 'material' || this.typeCode == 'product'"/>
|
|
|
|
|
<el-table-column label="检测水平" align="left" prop="checkLevel" width="80" v-if="this.typeCode == 'material' || this.typeCode == 'product'"/>
|
|
|
|
|
<el-table-column label="接受质量限" align="left" prop="sampleAql" width="80" v-if="this.typeCode == 'material' || this.typeCode == 'product'"/>
|
|
|
|
|
<el-table-column label="检测结果" key="status" align="center" prop="status" width="90" v-if="this.viewStatus == '1' ">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="测量值" align="left" prop="actualValue" width="120"/>
|
|
|
|
@ -161,6 +141,32 @@
|
|
|
|
|
<!--测量值弹窗-->
|
|
|
|
|
<el-dialog title="测量值" :visible.sync="valueOpen" width="600px" append-to-body>
|
|
|
|
|
<el-form :model="dynamicValidateForm" v-loading="dyloading" ref="dynamicValidateForm" label-width="100px" class="demo-dynamic">
|
|
|
|
|
<el-form-item label="接受质量限" prop="checkLevel" v-if="this.typeCode == 'material' || this.typeCode == 'product'">
|
|
|
|
|
<el-select placeholder="请选择检测水平类型" clearable
|
|
|
|
|
@change="setSampleLevel" v-model="dynamicValidateForm.checkLevel"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in dict.type.sample_level"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item label="接受质量限" prop="sampleAql" v-if="this.typeCode == 'material' || this.typeCode == 'product'">
|
|
|
|
|
<el-select placeholder="请选择接受质量限制" clearable
|
|
|
|
|
@change="setSampleAql" v-model="dynamicValidateForm.sampleAql"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in dict.type.sample_aql"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item
|
|
|
|
|
v-for="(domain, index) in dynamicValidateForm.domains"
|
|
|
|
|
:label="'测量值' + index"
|
|
|
|
@ -205,7 +211,9 @@
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
|
|
|
|
|
import { getCkeckProjectList,changeCheckDetailStatus,commitActualValue,commitCheckResult,getDefectList,getWeightValue} from "@/api/quality/income";
|
|
|
|
|
import { getCkeckProjectList,changeCheckDetailStatus,commitActualValue,
|
|
|
|
|
commitCheckResult,getDefectList,getWeightValue,getnoOkVals,getAutoJudge
|
|
|
|
|
} from "@/api/quality/income";
|
|
|
|
|
import { getDefectValue, commitDefectValue, updateDefectValue} from "@/api/quality/checkTaskDefect";
|
|
|
|
|
export default {
|
|
|
|
|
name: "itemSelectUser",
|
|
|
|
@ -278,10 +286,10 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
rules: {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
aqlNoOkVal:0,
|
|
|
|
|
sampleCode: null,
|
|
|
|
|
checkLevel:null
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
@ -304,6 +312,7 @@ export default {
|
|
|
|
|
this.queryParams.belongTo = this.data.recordId;
|
|
|
|
|
this.typeCode = typeCode;
|
|
|
|
|
this.checkType = this.data.checkType;
|
|
|
|
|
this.quality = this.data.quality;
|
|
|
|
|
this.orderNo = this.data.orderNo;
|
|
|
|
|
this.viewStatus = this.data.checkStatus;
|
|
|
|
|
this.queryParams.pageNum = 1;
|
|
|
|
@ -357,6 +366,9 @@ export default {
|
|
|
|
|
this.resetForm("form");
|
|
|
|
|
this.form.checkResult = 'Y';
|
|
|
|
|
this.form.startOA = '0';
|
|
|
|
|
this.aqlNoOkVal = 0;
|
|
|
|
|
this.sampleCode = null;
|
|
|
|
|
this.checkLevel= null;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
@ -416,18 +428,6 @@ export default {
|
|
|
|
|
this.dynamicValidateForm.domains = [{ value: ''}];
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 数据状态修改/Y合格N不合格
|
|
|
|
|
/* handleStatusChange(row) {
|
|
|
|
|
let text = row.status === "N" ? "不合格" : "合格";
|
|
|
|
|
this.$modal.confirm('确认' + '"' + row.projectNo + '"'+text+'吗?').then(function() {
|
|
|
|
|
return changeCheckDetailStatus(row.recordId, row.status, row.remark, row.defectCode, row.defectQuality);
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.$modal.msgSuccess(text + "操作成功");
|
|
|
|
|
}).catch(function() {
|
|
|
|
|
row.status = row.status === "N" ? "Y" : "N";
|
|
|
|
|
});
|
|
|
|
|
}, */
|
|
|
|
|
|
|
|
|
|
//动态测量值
|
|
|
|
|
/** 检测结果钮操作 */
|
|
|
|
|
handleShowValue(row) {
|
|
|
|
@ -435,11 +435,21 @@ export default {
|
|
|
|
|
this.valueOpen = true;
|
|
|
|
|
this.recordId = row.recordId;
|
|
|
|
|
this.weight = row.weight;
|
|
|
|
|
this.upperDiff = row.upperDiff;
|
|
|
|
|
this.downDiff = row.downDiff;
|
|
|
|
|
if(row.sampleAql != null ){
|
|
|
|
|
this.dynamicValidateForm.sampleAql = row.sampleAql;
|
|
|
|
|
}
|
|
|
|
|
if(row.checkLevel != null ){
|
|
|
|
|
this.dynamicValidateForm.checkLevel = row.checkLevel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const actualValue = row.actualValue;
|
|
|
|
|
if(actualValue !== null && actualValue !== '') {
|
|
|
|
|
this.dynamicValidateForm.domains = [];
|
|
|
|
|
let values = actualValue.split(",");
|
|
|
|
|
values.forEach((item,index) => {
|
|
|
|
|
item = item.replace(/"/g, '').replace("[","").replace("]","");
|
|
|
|
|
this.dynamicValidateForm.domains.push({
|
|
|
|
|
value: item.toString(),
|
|
|
|
|
key: Date.now() + index
|
|
|
|
@ -473,22 +483,50 @@ export default {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
submitForm(formName) {
|
|
|
|
|
let _this = this;
|
|
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
var autoStatus=null;
|
|
|
|
|
var auto
|
|
|
|
|
let values = this.dynamicValidateForm.domains;
|
|
|
|
|
var actualValues = values.map(item => item.value);
|
|
|
|
|
commitActualValue(this.recordId, actualValues).then(response => {
|
|
|
|
|
this.dynamicValidateForm.domains = [{ value: ''}];
|
|
|
|
|
this.$modal.msgSuccess("提交成功");
|
|
|
|
|
this.valueOpen = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
if(this.typeCode=='material' || this.typeCode =='product'){//只有来料和成品有自动判定
|
|
|
|
|
//自动判定开始(仅使用范围形)
|
|
|
|
|
getAutoJudge(this.quality,
|
|
|
|
|
this.checkLevel,
|
|
|
|
|
this.sampleAql,
|
|
|
|
|
actualValues,
|
|
|
|
|
_this.downDiff,
|
|
|
|
|
_this.upperDiff
|
|
|
|
|
).then(response => {
|
|
|
|
|
autoStatus = response.data.status;
|
|
|
|
|
this.commitActualValueFun(this.recordId, actualValues,autoStatus,
|
|
|
|
|
this.checkLevel,
|
|
|
|
|
this.sampleAql,
|
|
|
|
|
response.data.sampleCode,
|
|
|
|
|
response.data.sampleQuality
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//结束
|
|
|
|
|
}else{//不需要自动判定的情况
|
|
|
|
|
this.commitActualValueFun(this.recordId, actualValues,autoStatus,null,null,null,null);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
console.log('error submit!!');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
commitActualValueFun(recordId, actualValues,autoStatus,checkLevel,sampleAql,sampleCode,sampleQuality){
|
|
|
|
|
commitActualValue(recordId, actualValues,autoStatus,checkLevel,sampleAql,sampleCode,sampleQuality).then(response => {
|
|
|
|
|
this.dynamicValidateForm.domains = [{ value: ''}];
|
|
|
|
|
this.$modal.msgSuccess("提交成功");
|
|
|
|
|
this.valueOpen = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
resetForm(formName) {
|
|
|
|
|
this.$refs[formName].resetFields();
|
|
|
|
|
},
|
|
|
|
@ -570,9 +608,13 @@ export default {
|
|
|
|
|
this.$modal.msgError(response.msg);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
setSampleLevel(sampleLevel){
|
|
|
|
|
this.checkLevel = sampleLevel;
|
|
|
|
|
},
|
|
|
|
|
setSampleAql(sampleAql){
|
|
|
|
|
this.sampleAql = sampleAql;
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|