2024-1-15-1 质量模块-生产过程检验-检验项目查看

master
A0010407 8 months ago
parent 37a850598c
commit f6daa7703e

@ -1,114 +1,199 @@
<template>
<div>
<el-dialog title="检验项目"
v-if="showFlag"
:visible.sync="showFlag"
:modal= false
width="1000px"
>
<el-row :gutter="20">
<el-col :span="24" :xs="24">
<el-table v-loading="loading" :data="itemList" ref="myTable" >
<el-table-column width="50" align="center" type="selection">
</el-table-column>
<!-- 序号 -->
<el-table-column label="检测规则Id" align="left" prop="recordId" :show-overflow-tooltip="true" v-if="false"/>
<el-table-column label="检测规则编码" align="left" prop="projectNo" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="检验规则名称" align="left" prop="ruleName" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="检验规则属性" align="left" prop="propertyCode" :show-overflow-tooltip="true" width="120">
<template slot-scope="scope">
<dict-tag
:options="dict.type.qc_rule_prop"
:value="scope.row.propertyCode"
<el-dialog
title="检验项目"
v-if="showFlag"
:visible.sync="showFlag"
:modal="false"
width="1000px"
>
<el-row :gutter="20">
<el-col :span="24" :xs="24">
<el-table v-loading="loading" :data="itemList" ref="myTable">
<el-table-column width="50" align="center" type="selection">
</el-table-column>
<!-- 序号 -->
<el-table-column
label="检测规则Id"
align="left"
prop="recordId"
v-if="false"
/>
<el-table-column
label="检测规则编码"
align="left"
prop="projectNo"
width="120"
/>
<el-table-column
label="检验规则名称"
align="left"
prop="ruleName"
width="300"
/>
<el-table-column
label="检验规则属性"
align="left"
prop="propertyCode"
width="120"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.qc_rule_prop"
:value="scope.row.propertyCode"
/>
</template>
</el-table-column>
<el-table-column label="检验方式" align="left" prop="checkMode" />
<el-table-column label="检验工具" align="left" prop="checkTool" />
<el-table-column
label="检验标准"
align="left"
prop="checkStandard"
/>
<el-table-column label="上差值" align="left" prop="upperDiff" />
<el-table-column label="下差值" align="left" prop="downDiff" />
<el-table-column
label="单位"
align="left"
prop="unitCode"
width="80"
/>
</template>
</el-table-column>
<el-table-column label="检验方式" align="left" prop="checkMode" :show-overflow-tooltip="true" />
<el-table-column label="检验工具" align="left" prop="checkTool" :show-overflow-tooltip="true" />
<el-table-column label="检验标准" align="left" prop="checkStandard" :show-overflow-tooltip="true" />
<el-table-column label="上差值" align="left" prop="upperDiff" :show-overflow-tooltip="true" />
<el-table-column label="下差值" align="left" prop="downDiff" :show-overflow-tooltip="true" />
<el-table-column label="单位" align="left" prop="unitCode" :show-overflow-tooltip="true" width="80"/>
<el-table-column label="检测结果" key="status" align="center" prop="status" width="90">
<template slot-scope="scope">
<el-switch
v-model="scope.row.status"
active-value="Y"
inactive-value="N"
@change="handleStatusChange(scope.row)"
></el-switch>
</template>
</el-table-column>
<el-table-column label="测量值" align="left" prop="actualValue" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="不良项目" align="left" prop="defectCode" :show-overflow-tooltip="true" width="120">
<template scope="scope">
<el-select v-model="scope.row.defectCode">
<el-option v-for="item in defectList" :key="item.defectCode" :label="item.defectSubclass" :value="item.defectCode">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleShowValue(scope.row)"
v-hasPermi="['quality:qcIncome:edit']"
>检测值</el-button>
</template>
</el-table-column>
</el-table>
<el-table-column
label="检测结果"
key="status"
align="center"
prop="status"
width="90"
>
<template slot-scope="scope">
<el-switch
v-model="scope.row.status"
active-value="Y"
inactive-value="N"
@change="handleStatusChange(scope.row)"
></el-switch>
</template>
</el-table-column>
<el-table-column
label="测量值"
align="left"
prop="actualValue"
width="150"
/>
<el-table-column
label="不良项目"
align="left"
prop="defectCode"
width="120"
v-if="checkStatus == '0'"
>
<template scope="scope">
<el-select v-model="scope.row.defectCode">
<el-option
v-for="item in defectList"
:key="item.defectCode"
:label="item.defectSubclass"
:value="item.defectCode"
>
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
v-if="checkStatus == '0'"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleShowValue(scope.row)"
v-hasPermi="['quality:qcIncome:edit']"
>检测值</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitBomForm"> </el-button>
<el-button @click="showFlag=false"> </el-button>
</div>
</el-dialog>
<!--测量值弹窗-->
<el-dialog title="测量值" :visible.sync="valueOpen" width="600px" append-to-body>
<el-form :model="dynamicValidateForm" ref="dynamicValidateForm" label-width="100px" class="demo-dynamic">
<el-form-item
v-for="(domain, index) in dynamicValidateForm.domains"
:label="'测量值' + index"
:key="domain.key"
:prop="'domains.' + index + '.value'"
:rules="{
required: true, message: '测量值不能为空', trigger: 'blur'
}"
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<div slot="footer" class="dialog-footer">
<el-button
type="primary"
@click="submitBomForm"
v-if="checkStatus == '0'"
> </el-button
>
<el-button @click="cancelForm"> </el-button>
</div>
</el-dialog>
<!--测量值弹窗-->
<el-dialog
title="测量值"
:visible.sync="valueOpen"
width="600px"
append-to-body
>
<el-form
:model="dynamicValidateForm"
ref="dynamicValidateForm"
label-width="100px"
class="demo-dynamic"
>
<el-form-item
v-for="(domain, index) in dynamicValidateForm.domains"
:label="'测量值' + index"
:key="domain.key"
:prop="'domains.' + index + '.value'"
:rules="{
required: true,
message: '测量值不能为空',
trigger: 'blur',
}"
>
<el-input v-model="domain.value" style="width: 70%"></el-input>
<el-button
@click.prevent="removeDomain(domain)"
style="margin-left: 30px"
>删除</el-button
>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm('dynamicValidateForm')"
>提交</el-button
>
<el-input v-model="domain.value" style="width: 70%;"></el-input>
<el-button @click.prevent="removeDomain(domain)" style="margin-left:30px">删除</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm('dynamicValidateForm')"></el-button>
<el-button @click="addDomain"></el-button>
<el-button @click="resetForm('dynamicValidateForm')"></el-button>
</el-form-item>
</el-form>
</el-dialog>
</div>
<el-button @click="addDomain"></el-button>
<el-button @click="resetForm('dynamicValidateForm')"></el-button>
</el-form-item>
</el-form>
</el-dialog>
</div>
</template>
<script>
import { getCkeckProjectList,changeCheckDetailStatus,commitActualValue,commitCheckResult,getDefectList } from "@/api/quality/income";
import {
getCkeckProjectList,
changeCheckDetailStatus,
commitActualValue,
commitCheckResult,
getDefectList,
} from "@/api/quality/income";
export default {
name: "itemSelectUser",
dicts: ["check_result","qc_rule_prop"],
dicts: ["check_result", "qc_rule_prop"],
data() {
return {
showFlag:false,
showFlag: false,
//
selectedRows: {},
//
@ -126,60 +211,64 @@ export default {
bomCode: undefined,
defaultProps: {
id: "id",
label: "label"
label: "label",
},
//
queryParams: {
pageNum: 1,
pageSize: 10,
belongTo:''
belongTo: "",
//,userCode: '',
//userName : ''
},
data:{},
data: {},
dynamicValidateForm: {
domains: [{
value: ''
}]
domains: [
{
value: "",
},
],
},
//
valueOpen: false,
valueOpen: false,
//id
recordId:'',
typeCode:'',//
defectList:[]//
recordId: "",
typeCode: "", //
defectList: [], //
};
},
created() {
this.getDefect();
},
props: {
checkStatus: undefined,
},
methods: {
getDefect(){
getDefectList('defect_in').then(response => {
this.defectList = response;
getDefect() {
getDefectList("defect_in").then((response) => {
this.defectList = response;
});
},
init(rowdata,typeCode){
this.data=rowdata;
init(rowdata, typeCode) {
this.data = rowdata;
this.queryParams.belongTo = this.data.recordId;
this.typeCode = typeCode;
this.checkType = this.data.checkType;
this.orderNo = this.data.orderNo;
this.queryParams.pageNum = 1;
this.queryParams.pageSize = 10;
this.getList();
},
/** 查询表格列表*/
getList() {
this.loading = true;
getCkeckProjectList(this.queryParams).then(response => {
this.itemList = response.rows;
this.total = response.total;
this.loading = false;
}
);
getCkeckProjectList(this.queryParams).then((response) => {
this.itemList = response.rows;
this.total = response.total;
this.loading = false;
});
},
/** 搜索按钮操作 */
@ -194,46 +283,64 @@ export default {
this.handleQuery();
},
/** 取消按钮操作 */
cancelForm() {
this.showFlag = false;
},
//
submitBomForm() {
commitCheckResult(this.queryParams.belongTo,this.typeCode,this.checkType,this.orderNo).then(response => {
this.$modal.msgSuccess("检测完成");
this.$emit('saveCheck');
this.showFlag = false;
commitCheckResult(
this.queryParams.belongTo,
this.typeCode,
this.checkType,
this.orderNo
).then((response) => {
this.$modal.msgSuccess("检测完成");
this.$emit("saveCheck");
this.showFlag = false;
});
},
// /YN
handleStatusChange(row) {
let text = row.status === "N" ? "不合格" : "合格";
this.$modal.confirm('确认' + '"' + row.projectNo + '"'+text+'吗?').then(function() {
return changeCheckDetailStatus(row.recordId, row.status, row.defectCode);
}).then(() => {
this.$modal.msgSuccess(text + "操作成功");
}).catch(function() {
row.status = row.status === "N" ? "Y" : "N";
});
},
handleStatusChange(row) {
let text = row.status === "N" ? "不合格" : "合格";
this.$modal
.confirm("确认" + '"' + row.projectNo + '"' + text + "吗?")
.then(function () {
return changeCheckDetailStatus(
row.recordId,
row.status,
row.defectCode
);
})
.then(() => {
this.$modal.msgSuccess(text + "操作成功");
})
.catch(function () {
row.status = row.status === "N" ? "Y" : "N";
});
},
//
/** 检测结果钮操作 */
handleShowValue(row) {
this.valueOpen = true;
handleShowValue(row) {
this.valueOpen = true;
this.recordId = row.recordId;
},
},
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
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();
});
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();
});
} else {
console.log('error submit!!');
console.log("error submit!!");
return false;
}
});
@ -242,17 +349,17 @@ export default {
this.$refs[formName].resetFields();
},
removeDomain(item) {
var index = this.dynamicValidateForm.domains.indexOf(item)
var index = this.dynamicValidateForm.domains.indexOf(item);
if (index !== -1) {
this.dynamicValidateForm.domains.splice(index, 1)
this.dynamicValidateForm.domains.splice(index, 1);
}
},
addDomain() {
this.dynamicValidateForm.domains.push({
value: '',
key: Date.now()
value: "",
key: Date.now(),
});
}
}
},
},
};
</script>

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save