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

master
A0010407 1 year ago
parent f6daa7703e
commit 7ed7e6496e

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

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