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

master
A0010407 8 months ago
parent 37a850598c
commit f6daa7703e

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