审核检验二次编辑-图片

master
zhaoxiaolin 7 months ago
parent 6381c4bd39
commit 2c01c784db

@ -1,8 +1,8 @@
import request from '@/utils/request' import request from '@/utils/request'
export function getDefectValue(belongToDetail) { export function getDefectValue(belongToDetail,checkType) {
return request({ return request({
url: '/quality/qcCheckTaskDefect/getDefectValue/' + belongToDetail, url: '/quality/qcCheckTaskDefect/getDefectValue/' + belongToDetail+'/'+checkType,
method: 'get', method: 'get',
}); });
} }

@ -150,9 +150,9 @@ export function commitCheckResult(data) {
}) })
} }
export function getDefectList(defectType) { export function getDefectList(checkType) {
const data = { const data = {
defectType checkType
} }
return request({ return request({
url: '/quality/qcIncome/getDefectList', url: '/quality/qcIncome/getDefectList',
@ -244,3 +244,11 @@ export function getWarehouseList(query) {
params: query params: query
}); });
} }
export function getClassInfoListByCheckType(query) {
return request({
url: '/quality/defectClass/getClassInfoListByCheckType',
method: 'get',
params: query
});
}

@ -4,7 +4,7 @@
v-if="showFlag" v-if="showFlag"
:visible.sync="showFlag" :visible.sync="showFlag"
:modal= false :modal= false
width="1400px" width="1300px"
> >
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="24" :xs="24"> <el-col :span="24" :xs="24">
@ -51,26 +51,24 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="14">
<el-form-item v-if="form.startOA == '1'" label="不合格描述" prop="remark">
<el-input type='textarea' v-model="form.remark" placeholder="请输入不合格描述" />
</el-form-item>
</el-col>
--> -->
<el-col :span="14"> <el-col :span="6">
<el-form-item label="不合格描述" prop="remarkCode"> <el-form-item label="缺陷分类" prop="remarkCode">
<!-- <el-input type='textarea' v-model="form.remark" placeholder="请输入不合格描述" /> --> <el-select v-model="form.remarkCode" placeholder="请选择缺陷分类" clearable>
<el-select v-model="form.remarkCode" placeholder="请选择不合格描述" clearable>
<el-option <el-option
v-for="dict in remarkList" v-for="dict in classInfoList"
:key="dict.dictValue" :key="dict.id"
:label="dict.dictLabel" :label="dict.className"
:value="dict.dictValue" :value="dict.id"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8">
<el-form-item label="备注描述" prop="attr3">
<el-input type='textarea' v-model="form.attr3" placeholder="请输入备注描述" />
</el-form-item>
</el-col>
</el-row> </el-row>
</el-form> </el-form>
@ -79,9 +77,9 @@
</el-table-column> </el-table-column>
<!-- 序号 --> <!-- 序号 -->
<el-table-column label="检测规则Id" align="left" prop="recordId" v-if="false"/> <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="projectNo" width="120" fixed/>
<el-table-column label="检验规则名称" align="left" prop="ruleName" width="300"/> <el-table-column label="检验规则名称" align="left" prop="ruleName" width="150" :show-overflow-tooltip="true" fixed/>
<el-table-column label="检验规则属性" align="left" prop="propertyCode" width="120" > <el-table-column label="规则属性" align="left" prop="propertyCode" width="80" fixed>
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag <dict-tag
:options="dict.type.qc_rule_prop" :options="dict.type.qc_rule_prop"
@ -92,22 +90,29 @@
<el-table-column label="检验方式" align="left" prop="checkMode" width="150" :show-overflow-tooltip="true"/> <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="checkTool" />
<el-table-column label="检验标准" align="left" prop="checkStandard" width="150" :show-overflow-tooltip="true"/> <el-table-column label="检验标准" align="left" prop="checkStandard" width="150" :show-overflow-tooltip="true"/>
<!--
<el-table-column label="上差值" align="left" prop="upperDiff" v-if="this.typeCode == 'material' || this.typeCode == 'product'"/> <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="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="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="sampleCode" width="90" 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="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="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="接受质量限" align="left" prop="sampleAql" width="90" 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 label="检测结果" key="status" align="center" prop="status" width="90" v-if="this.viewStatus == '1' ">
</el-table-column> </el-table-column>
<el-table-column label="测量值" align="left" prop="actualValue" width="120"/> <el-table-column label="测量值" align="left" prop="actualValue" width="120"/>
<el-table-column label="抽样数量" align="left" prop="sampleQuality" width="110">
<template slot-scope="scope">
<el-input v-model="scope.row.sampleQuality" placeholder="请输入抽样数量" type="number"/>
</template>
</el-table-column>
<el-table-column label="不良描述" align="left" prop="remark" width="120"> <el-table-column label="不良描述" align="left" prop="remark" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.remark" placeholder="请输入不良描述" /> <el-input v-model="scope.row.remark" placeholder="请输入不良描述" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="不良类型" align="left" prop="defectCode" width="120"> <el-table-column label="不良类型" align="left" prop="defectCode" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
@ -138,6 +143,17 @@
></el-switch> ></el-switch>
</template> </template>
</el-table-column> </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-picture"
@click="handleShowPic(scope.row)"
v-hasPermi="['quality:qcIncome:edit']"
>查看</el-button>
</template>
</el-table-column>
</el-table> </el-table>
<pagination <pagination
@ -187,7 +203,7 @@
<el-form-item <el-form-item
v-for="(domain, index) in dynamicValidateForm.domains" v-for="(domain, index) in dynamicValidateForm.domains"
:label="'测量值' + index" :label="'测量值' + (index+1)"
:key="domain.key" :key="domain.key"
:prop="'domains.' + index + '.value'" :prop="'domains.' + index + '.value'"
:rules="{ :rules="{
@ -212,12 +228,22 @@
v-for="(item, index) in defectForm.defectItems" v-for="(item, index) in defectForm.defectItems"
:label="item.defectSubclass" :label="item.defectSubclass"
:key="index" :key="index"
:prop="`defectItems.${index}.noOkQuality`"
:rules="{
required: true, message: '不良类型不能为空', trigger: 'blur'
}"
> >
<el-row :gutter="20">
<el-col :span="10">
<el-input type="number" v-model="item.noOkQuality" placeholder="请输入不良数量"/> <el-input type="number" v-model="item.noOkQuality" placeholder="请输入不良数量"/>
</el-col>
<el-col :span="10">
<el-select placeholder="请选择缺陷分类" clearable v-model="item.classId">
<el-option
v-for="dict in item.classList"
:key="dict.id"
:label="dict.className"
:value="dict.id"
/>
</el-select>
</el-col>
</el-row>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="submitDefectForm('defectForm')"></el-button> <el-button type="primary" @click="submitDefectForm('defectForm')"></el-button>
@ -225,20 +251,75 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-dialog> </el-dialog>
<!--图片预览弹窗-->
<el-dialog title="检验图片" :visible.sync="picValueOpen" width="700px" append-to-body>
<el-upload
:action="uploadUrl"
:headers="uploadHeaders"
:on-success="handleUploadSuccess"
list-type="picture-card"
:file-list="fileList"
:auto-upload="false">
<i slot="default" class="el-icon-plus"></i>
<div slot="file" slot-scope="{file}">
<img
class="el-upload-list__item-thumbnail"
:src="file.url" alt=""
>
<span class="el-upload-list__item-actions">
<span
class="el-upload-list__item-preview"
@click="handlePictureCardPreview(file)"
>
<i class="el-icon-zoom-in"></i>
</span>
<span
v-if="!disabled"
class="el-upload-list__item-delete"
@click="handleDownload(file)"
>
<i class="el-icon-download"></i>
</span>
<span
v-if="!disabled"
class="el-upload-list__item-delete"
@click="handleRemove(file)"
>
<i class="el-icon-delete"></i>
</span>
</span>
</div>
</el-upload>
<br/>
<el-button size="small" type="primary" @click="submitPicForm"></el-button>
</el-dialog>
<el-dialog :visible.sync="dialogVisible">
<img width="100%" :src="dialogImageUrl" alt="">
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { getCkeckProjectList,changeCheckDetailStatus,getIncome,commitActualValue, import { getCkeckProjectList,changeCheckDetailStatus,getIncome,commitActualValue,
commitCheckResult,getDefectList,getWeightValue,getnoOkVals,getAutoJudge commitCheckResult,getDefectInfoList,getWeightValue,getnoOkVals,getAutoJudge,getClassInfoListByCheckType
} from "@/api/quality/income"; } from "@/api/quality/income";
import { getDefectValue, commitDefectValue, updateDefectValue} from "@/api/quality/checkTaskDefect"; import { getDefectValue, commitDefectValue, updateDefectValue} from "@/api/quality/checkTaskDefect";
import { getDictData,} from "@/api/system/dict/data"; import { getToken } from "@/utils/auth";
export default { export default {
name: "itemSelectUser", name: "itemSelectUser",
dicts: ["qc_rule_prop","material_type_oa","material_from_oa","sample_level","sample_aql"], dicts: ["qc_rule_prop","material_type_oa","material_from_oa","sample_level","sample_aql"],
data() { data() {
return { return {
fileList:[],
uploadList: [],
uploadUrl: process.env.VUE_APP_BASE_API + "/file/upload",
uploadHeaders: {
Authorization: "Bearer " + getToken(),
},
dialogImageUrl: '',
dialogVisible: false,
disabled: false,
viewStatus : '0', viewStatus : '0',
showFlag: false, showFlag: false,
dyloading: false, dyloading: false,
@ -255,7 +336,7 @@ export default {
// BOM // BOM
itemList: null, itemList: null,
qcCheckTaskDetails: [], qcCheckTaskDetails: [],
remarkList: [], classInfoList: [],
// //
bomCode: undefined, bomCode: undefined,
defaultProps: { defaultProps: {
@ -282,8 +363,14 @@ export default {
sampleAql:null, sampleAql:null,
checkLevel:null checkLevel:null
}, },
dynamicPicForm:{
domains: [{
value: ''
}],
},
// //
valueOpen: false, valueOpen: false,
picValueOpen: false,
//id //id
recordId:'', recordId:'',
weight: null, weight: null,
@ -293,7 +380,6 @@ export default {
typeCode:'', typeCode:'',
// //
defectOpen: false, defectOpen: false,
updateFlag: false,
// //
defectList:[], defectList:[],
defectForm: { defectForm: {
@ -302,34 +388,28 @@ export default {
defectCode: '', defectCode: '',
noOkQuality: 0, noOkQuality: 0,
belongToDetail: '', belongToDetail: '',
belongTo: '' belongTo: '',
classId:'',
classList:[]
} }
] ]
}, },
rules: { rules: {
}, },
downDiff:null,
upperDiff:null,
aqlNoOkVal:0, aqlNoOkVal:0,
sampleCode: null, sampleCode: null,
checkLevel:null checkLevel:null,
checkType:''
}; };
}, },
created() { created() {
this.getDefect();
this.handleGetDictData(); //this.handleGetDictData();
}, },
methods: { methods: {
getDefect(){
getDefectList(this.typeCode).then(response => {
this.defectList = response;
this.defectForm.defectItems = this.defectList.map(item => ({
defectSubclass: item.defectSubclass,
defectCode: item.defectCode,
noOkQuality: 0
}));
});
},
init(rowdata,typeCode){ init(rowdata,typeCode){
this.data=rowdata; this.data=rowdata;
this.queryParams.belongTo = this.data.recordId; this.queryParams.belongTo = this.data.recordId;
@ -342,7 +422,7 @@ export default {
this.queryParams.pageSize = 10; this.queryParams.pageSize = 10;
this.getCheckInfo(); this.getCheckInfo();
this.getList(); this.getList();
this.getDefect(); this.handleGetDictData();
}, },
view(rowdata,typeCode){ view(rowdata,typeCode){
@ -356,7 +436,7 @@ export default {
this.queryParams.pageSize = 10; this.queryParams.pageSize = 10;
this.getCheckInfo(); this.getCheckInfo();
this.getList(); this.getList();
this.getDefect(); this.handleGetDictData();
}, },
/** 查询表格列表*/ /** 查询表格列表*/
@ -371,12 +451,9 @@ export default {
}, },
handleGetDictData() { handleGetDictData() {
const query = { getClassInfoListByCheckType({checkType:this.checkType}).then(response => {
dictType: 'unqualified_remark',
}
getDictData(query).then(response => {
if (response.code === 200) { if (response.code === 200) {
this.remarkList = response.data; this.classInfoList = response.data;
} }
}); });
}, },
@ -450,7 +527,7 @@ export default {
supplierCode: this.data.supplierCode, supplierCode: this.data.supplierCode,
supplierName: this.data.supplierName, supplierName: this.data.supplierName,
quality: this.data.quality, quality: this.data.quality,
unit: this.data.unit, unit: this.data.unit
} }
// //
const finalData = {...this.form,...data} const finalData = {...this.form,...data}
@ -504,24 +581,19 @@ export default {
}, },
/** 不良类型弹窗 */ /** 不良类型弹窗 */
handleDefectType(row) { handleDefectType(row) {
this.defectForm.defectItems.forEach(item => { getDefectValue(row.recordId,this.checkType).then(response => {
item.belongToDetail = row.recordId;
item.belongTo = row.belongTo;
item.noOkQuality = 0;
});
getDefectValue(row.recordId).then(response => {
let values = response.rows; let values = response.rows;
if(values.length > 0){ if(values.length > 0){
this.defectForm.defectItems = values.map(item => ({ this.defectForm.defectItems = values.map(item => ({
//qc_check_task_defectrecordId //qc_check_task_defectrecordId
recordId: item.recordId, belongTo: this.queryParams.belongTo,
belongToDetail: row.recordId,
defectSubclass: item.defectSubclass, defectSubclass: item.defectSubclass,
defectCode: item.defectCode, defectCode: item.defectCode,
noOkQuality: item.noOkQuality, noOkQuality: item.noOkQuality,
classId: item.classId,
classList: item.classList
})); }));
this.updateFlag = true;
}else{
this.updateFlag = false;
} }
this.defectOpen = true; this.defectOpen = true;
}); });
@ -536,7 +608,6 @@ export default {
let values = this.dynamicValidateForm.domains; let values = this.dynamicValidateForm.domains;
var actualValues = values.map(item => item.value); var actualValues = values.map(item => item.value);
if(this.typeCode=='material' || this.typeCode =='product'){// if(this.typeCode=='material' || this.typeCode =='product'){//
debugger
//(使) //(使)
getAutoJudge(this.quality, getAutoJudge(this.quality,
this.dynamicValidateForm.checkLevel, this.dynamicValidateForm.checkLevel,
@ -596,7 +667,6 @@ export default {
const formData = this.defectForm.defectItems; const formData = this.defectForm.defectItems;
if (valid) { if (valid) {
// //
if(!this.updateFlag) {
commitDefectValue(formData).then(response => { commitDefectValue(formData).then(response => {
if(response.code === 200) { if(response.code === 200) {
this.$modal.msgSuccess("提交成功"); this.$modal.msgSuccess("提交成功");
@ -608,26 +678,10 @@ export default {
this.getDefect(); this.getDefect();
}); });
} else { } else {
console.log(formData);
updateDefectValue(formData).then(response => {
if(response.code === 200) {
this.$modal.msgSuccess("修改成功");
}else {
this.$modal.msgError(response.msg);
}
this.defectForm.defectItems = [];
this.defectOpen = false;
this.getDefect();
});
}
} else {
// //
console.log('error submit!!'); console.log('error submit!!');
return false; return false;
} }
}); });
}, },
resetDefectForm() { resetDefectForm() {
@ -663,6 +717,51 @@ export default {
setSampleAql(sampleAql){ setSampleAql(sampleAql){
this.sampleAql = sampleAql; this.sampleAql = sampleAql;
}, },
/** 检测图片弹窗操作 */
handleShowPic(row) {
var i=0;
this.handleResetPic();
this.picValueOpen = true;
this.recordId = row.recordId;
const files = row.fileUrls;
files.map(item => (
this.fileList.push({
uid: i++,
url: item
})
))
},
handleResetPic() {
this.dynamicPicForm.domains = [{ value: ''}];
},
handleRemove(file) {
this.fileList = this.fileList.filter(item => item !== file);
},
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url;
this.dialogVisible = true;
},
handleDownload(file) {
window.location.href = file.url
},
handleUploadSuccess(res, file) {
debugger
if (res.code === 200) {
this.uploadList.push({ name: res.data.name, url: res.data.url });
this.uploadedSuccessfully();
} else {
this.number--;
this.$modal.closeLoading();
this.$modal.msgError(res.msg);
this.$refs.fileUpload.handleRemove(file);
this.uploadedSuccessfully();
}
},
submitPicForm() {
var picValues = null;
this.uploadList.map(item => picValues=picValues+item.url+',');
console.log(picValues)
},
} }
}; };
</script> </script>

@ -151,7 +151,7 @@ export default {
}, },
// //
handleClose() { handleClose() {
const obj = { path: "/system/role" }; const obj = { path: "/op/system/role" };
this.$tab.closeOpenPage(obj); this.$tab.closeOpenPage(obj);
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */

Loading…
Cancel
Save