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

yangwl
A0010407 10 months ago
parent f6daa7703e
commit 7ed7e6496e

@ -1,42 +1,22 @@
<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-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 <el-table-column label="检测规则Id" align="left" prop="recordId" v-if="false"/>
label="检测规则Id" <el-table-column label="检测规则编码" align="left" prop="projectNo" width="120"/>
align="left" <el-table-column label="检验规则名称" align="left" prop="ruleName" width="300"/>
prop="recordId" <el-table-column label="检验规则属性" align="left" prop="propertyCode" width="120" >
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"> <template slot-scope="scope">
<dict-tag <dict-tag
:options="dict.type.qc_rule_prop" :options="dict.type.qc_rule_prop"
@ -44,28 +24,13 @@
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="检验方式" align="left" prop="checkMode" /> <el-table-column label="检验方式" align="left" prop="checkMode" " />
<el-table-column label="检验工具" align="left" prop="checkTool" /> <el-table-column label="检验工具" align="left" prop="checkTool" />
<el-table-column <el-table-column label="检验标准" align="left" prop="checkStandard" />
label="检验标准"
align="left"
prop="checkStandard"
/>
<el-table-column label="上差值" align="left" prop="upperDiff" /> <el-table-column label="上差值" align="left" prop="upperDiff" />
<el-table-column label="下差值" align="left" prop="downDiff" /> <el-table-column label="下差值" align="left" prop="downDiff" />
<el-table-column <el-table-column label="单位" align="left" prop="unitCode" width="80"/>
label="单位" <el-table-column label="检测结果" key="status" align="center" prop="status" width="90">
align="left"
prop="unitCode"
width="80"
/>
<el-table-column
label="检测结果"
key="status"
align="center"
prop="status"
width="90"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
v-model="scope.row.status" v-model="scope.row.status"
@ -75,37 +40,16 @@
></el-switch> ></el-switch>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="测量值" align="left" prop="actualValue" width="120" v-if="checkStatus == '0' "/>
label="测量值" <el-table-column label="不良项目" align="left" prop="defectCode" width="120" v-if="checkStatus == '0' ">
align="left"
prop="actualValue"
width="150"
/>
<el-table-column
label="不良项目"
align="left"
prop="defectCode"
width="120"
v-if="checkStatus == '0'"
>
<template scope="scope"> <template scope="scope">
<el-select v-model="scope.row.defectCode"> <el-select v-model="scope.row.defectCode">
<el-option <el-option v-for="item in defectList" :key="item.defectCode" :label="item.defectSubclass" :value="item.defectCode">
v-for="item in defectList"
:key="item.defectCode"
:label="item.defectSubclass"
:value="item.defectCode"
>
</el-option> </el-option>
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="操作" align="center" class-name="small-padding fixed-width" v-if="checkStatus == '0' ">
label="操作"
align="center"
class-name="small-padding fixed-width"
v-if="checkStatus == '0'"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
@ -113,8 +57,7 @@
icon="el-icon-edit" icon="el-icon-edit"
@click="handleShowValue(scope.row)" @click="handleShowValue(scope.row)"
v-hasPermi="['quality:qcIncome:edit']" v-hasPermi="['quality:qcIncome:edit']"
>检测值</el-button >检测值</el-button>
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -129,50 +72,27 @@
</el-col> </el-col>
</el-row> </el-row>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button <el-button type="primary" @click="submitBomForm" v-if="checkStatus == '0' "> </el-button>
type="primary" <el-button @click="showFlag=false"> </el-button>
@click="submitBomForm"
v-if="checkStatus == '0'"
> </el-button
>
<el-button @click="cancelForm"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<!--测量值弹窗--> <!--测量值弹窗-->
<el-dialog <el-dialog title="测量值" :visible.sync="valueOpen" width="600px" append-to-body>
title="测量值" <el-form :model="dynamicValidateForm" ref="dynamicValidateForm" label-width="100px" class="demo-dynamic">
:visible.sync="valueOpen"
width="600px"
append-to-body
>
<el-form
:model="dynamicValidateForm"
ref="dynamicValidateForm"
label-width="100px"
class="demo-dynamic"
>
<el-form-item <el-form-item
v-for="(domain, index) in dynamicValidateForm.domains" v-for="(domain, index) in dynamicValidateForm.domains"
:label="'测量值' + index" :label="'测量值' + index"
:key="domain.key" :key="domain.key"
:prop="'domains.' + index + '.value'" :prop="'domains.' + index + '.value'"
:rules="{ :rules="{
required: true, required: true, message: '测量值不能为空', trigger: 'blur'
message: '测量值不能为空',
trigger: 'blur',
}" }"
> >
<el-input v-model="domain.value" style="width: 70%"></el-input> <el-input v-model="domain.value" style="width: 70%;"></el-input>
<el-button <el-button @click.prevent="removeDomain(domain)" style="margin-left:30px">删除</el-button>
@click.prevent="removeDomain(domain)"
style="margin-left: 30px"
>删除</el-button
>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="submitForm('dynamicValidateForm')" <el-button type="primary" @click="submitForm('dynamicValidateForm')"></el-button>
>提交</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>
@ -181,13 +101,8 @@
</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"],
@ -211,30 +126,28 @@ 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() {
@ -244,8 +157,9 @@ export default {
checkStatus : undefined, checkStatus : undefined,
}, },
methods: { methods: {
getDefect(){ getDefect(){
getDefectList("defect_in").then((response) => { getDefectList('defect_in').then(response => {
this.defectList = response; this.defectList = response;
}); });
}, },
@ -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,21 +198,11 @@ 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.typeCode,
this.checkType,
this.orderNo
).then((response) => {
this.$modal.msgSuccess("检测完成"); this.$modal.msgSuccess("检测完成");
this.$emit("saveCheck"); this.$emit('saveCheck');
this.showFlag = false; this.showFlag = false;
}); });
}, },
@ -305,19 +210,11 @@ export default {
// /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(
row.recordId,
row.status,
row.defectCode
);
})
.then(() => {
this.$modal.msgSuccess(text + "操作成功"); this.$modal.msgSuccess(text + "操作成功");
}) }).catch(function() {
.catch(function () {
row.status = row.status === "N" ? "Y" : "N"; row.status = row.status === "N" ? "Y" : "N";
}); });
}, },
@ -332,15 +229,15 @@ export default {
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>

@ -1,19 +1,8 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="80px"
>
<el-form-item label="检验节点" prop="checkType"> <el-form-item label="检验节点" prop="checkType">
<el-select <el-select v-model="queryParams.checkType" clearable placeholder="请选择检验节点">
v-model="queryParams.checkType"
clearable
placeholder="请选择检验节点"
>
<el-option <el-option
v-for="dict in checkTypes" v-for="dict in checkTypes"
:key="dict.id" :key="dict.id"
@ -63,6 +52,7 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="生产时间" prop="incomeTimeArray"> <el-form-item label="生产时间" prop="incomeTimeArray">
<el-date-picker <el-date-picker
v-model="queryParams.incomeTimeArray" v-model="queryParams.incomeTimeArray"
@ -70,8 +60,7 @@
type="datetimerange" type="datetimerange"
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期">
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -99,8 +88,7 @@
type="datetimerange" type="datetimerange"
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期">
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="检验结果" prop="checkResult"> <el-form-item label="检验结果" prop="checkResult">
@ -118,16 +106,8 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
type="primary" <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -140,8 +120,7 @@
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['quality:qcProduce:add']" v-hasPermi="['quality:qcProduce:add']"
>新增</el-button >新增</el-button>
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
@ -153,8 +132,7 @@
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['quality:qcProduce:edit']" v-hasPermi="['quality:qcProduce:edit']"
>修改</el-button >修改</el-button>
>
</el-col> </el-col>
<!-- <!--
<el-col :span="1.5"> <el-col :span="1.5">
@ -176,103 +154,38 @@
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['quality:qcProduce:export']" v-hasPermi="['quality:qcProduce:export']"
>导出</el-button >导出</el-button>
>
</el-col> </el-col>
<right-toolbar <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row> </el-row>
<el-table <el-table v-loading="loading" :data="qcProduceList" @selection-change="handleSelectionChange">
v-loading="loading"
:data="qcProduceList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="id" align="center" prop="recordId" v-if="false"/> <el-table-column label="id" align="center" prop="recordId" v-if="false"/>
<el-table-column <el-table-column label="checkType" align="center" prop="checkType" v-if="false"/>
label="checkType" <el-table-column label="任务编号" align="center" prop="checkNo" width="120">
align="center"
prop="checkType"
v-if="false"
/>
<el-table-column
label="任务编号"
align="center"
prop="checkNo"
width="120"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="handleView(scope.row)">{{ <el-button type="text" @click="handleView(scope.row)">{{
scope.row.checkNo scope.row.checkNo
}}</el-button> }}</el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="批次号" align="center" prop="incomeBatchNo" width="200" :show-overflow-tooltip="true" />
label="批次号" <el-table-column label="订单号" align="center" prop="orderNo" width="130"/>
align="center" <el-table-column label="物料号" align="center" prop="materialCode" width="170"/>
prop="incomeBatchNo" <el-table-column label="物料名称" align="center" prop="materialName" width="250" :show-overflow-tooltip="true" />
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
label="订单号"
align="center"
prop="orderNo"
width="130"
/>
<el-table-column
label="物料号"
align="center"
prop="materialCode"
width="170"
/>
<el-table-column
label="物料名称"
align="center"
prop="materialName"
width="250"
:show-overflow-tooltip="true"
/>
<el-table-column label="数量" align="center" prop="quality" /> <el-table-column label="数量" align="center" prop="quality" />
<el-table-column label="抽样数量" align="center" prop="sampleQuality" /> <el-table-column label="抽样数量" align="center" prop="sampleQuality" />
<el-table-column <el-table-column label="不合格数量" align="center" prop="noOkQuality" width="120"/>
label="不合格数量"
align="center"
prop="noOkQuality"
width="120"
/>
<el-table-column label="单位" align="center" prop="unit" /> <el-table-column label="单位" align="center" prop="unit" />
<el-table-column <el-table-column label="车间编码" align="center" prop="supplierCode" width="120"/>
label="车间编码" <el-table-column label="车间名称" align="center" prop="supplierName" width="170"/>
align="center" <el-table-column label="生产时间" align="center" prop="incomeTime" width="150">
prop="supplierCode"
width="120"
/>
<el-table-column
label="车间名称"
align="center"
prop="supplierName"
width="170"
/>
<el-table-column
label="生产时间"
align="center"
prop="incomeTime"
width="150"
>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.incomeTime, "{y}-{m}-{d}") }}</span> <span>{{ parseTime(scope.row.incomeTime, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="检测地点" align="center" prop="checkLoc" width="120"/>
label="检测地点"
align="center"
prop="checkLoc"
width="120"
/>
<el-table-column label="检测状态" align="center" prop="checkStatus" > <el-table-column label="检测状态" align="center" prop="checkStatus" >
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag <dict-tag
@ -281,41 +194,17 @@
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="检测人工号" align="center" prop="checkManCode" width="100" />
label="检测人工号" <el-table-column label="检测人姓名" align="center" prop="checkManName" width="100"/>
align="center" <el-table-column label="检验时间" align="center" prop="checkTime" width="180">
prop="checkManCode"
width="100"
/>
<el-table-column
label="检测人姓名"
align="center"
prop="checkManName"
width="100"
/>
<el-table-column
label="检验时间"
align="center"
prop="checkTime"
width="180"
>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ <span>{{ parseTime(scope.row.checkTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
parseTime(scope.row.checkTime, "{y}-{m}-{d} {h}:{i}:{s}")
}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="检验节点" align="center" prop="checkName" /> <el-table-column label="检验节点" align="center" prop="checkName" />
<el-table-column <el-table-column label="创建时间" align="center" prop="createTime" width="180">
label="创建时间"
align="center"
prop="createTime"
width="180"
>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
parseTime(scope.row.createTime, "{y}-{m}-{d} {h}:{i}:{s}")
}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="检验结果" align="center" prop="checkResult" /> <el-table-column label="检验结果" align="center" prop="checkResult" />
@ -329,11 +218,7 @@
></el-switch> ></el-switch>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
@ -341,8 +226,7 @@
icon="el-icon-edit" icon="el-icon-edit"
@click="handleCheckProject(scope.row)" @click="handleCheckProject(scope.row)"
v-hasPermi="['quality:qcProduce:edit']" v-hasPermi="['quality:qcProduce:edit']"
>检验</el-button >检验</el-button>
>
<!--检验项目弹窗--> <!--检验项目弹窗-->
<ItemSelectProject <ItemSelectProject
ref="itemSelectProject" ref="itemSelectProject"
@ -370,30 +254,17 @@
/> />
<!-- 添加或修改生产过程检验任务对话框 --> <!-- 添加或修改生产过程检验任务对话框 -->
<el-dialog <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
:title="title"
:visible.sync="open"
width="1000px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="100px"> <el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="检验任务编号" prop="checkNo"> <el-form-item label="检验任务编号" prop="checkNo">
<el-input <el-input v-model="form.checkNo" placeholder="请输入检验任务编号" disabled/>
v-model="form.checkNo"
placeholder="请输入检验任务编号"
disabled
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="检验类型" prop="checkType" > <el-form-item label="检验类型" prop="checkType" >
<el-select <el-select v-model="form.checkType" placeholder="请选择检验类型" style="width: 100%;">
v-model="form.checkType"
placeholder="请选择检验类型"
style="width: 100%"
>
<el-option <el-option
v-for="dict in checkTypes" v-for="dict in checkTypes"
:key="dict.id" :key="dict.id"
@ -406,11 +277,7 @@
<el-col :span="8"> <el-col :span="8">
<el-form-item label="订单号" prop="orderNo"> <el-form-item label="订单号" prop="orderNo">
<el-input v-model="form.orderNo" placeholder="请选择订单号" > <el-input v-model="form.orderNo" placeholder="请选择订单号" >
<el-button <el-button slot="append" @click="handleSelectWorkOrder" icon="el-icon-search"></el-button>
slot="append"
@click="handleSelectWorkOrder"
icon="el-icon-search"
></el-button>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -418,54 +285,37 @@
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="物料名称" prop="materialName"> <el-form-item label="物料名称" prop="materialName">
<el-input <el-input v-model="form.materialName" placeholder="请选择物料名称"/>
v-model="form.materialName"
placeholder="请选择物料名称"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="物料号" prop="materialCode"> <el-form-item label="物料号" prop="materialCode">
<el-input <el-input v-model="form.materialCode" placeholder="请输入物料号"/>
v-model="form.materialCode"
placeholder="请输入物料号"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="生产数量" prop="quality"> <el-form-item label="生产数量" prop="quality">
<el-input <el-input type="number" v-model="form.quality" placeholder="请输入生产数量" disabled/>
type="number"
v-model="form.quality"
placeholder="请输入生产数量"
disabled
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="生产时间" prop="incomeTime"> <el-form-item label="生产时间" prop="incomeTime">
<el-date-picker <el-date-picker clearable
clearable
v-model="form.incomeTime" v-model="form.incomeTime"
type="datetime" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择生产时间" placeholder="请选择生产时间">
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="单位" prop="unit" > <el-form-item label="单位" prop="unit" >
<el-select <el-select v-model="form.unit" placeholder="请选择单位" style="width: 100%;">
v-model="form.unit"
placeholder="请选择单位"
style="width: 100%"
>
<el-option <el-option
v-for="dict in dict.type.unit" v-for="dict in dict.type.unit"
:key="dict.value" :key="dict.value"
@ -478,18 +328,11 @@
<el-col :span="8"> <el-col :span="8">
<el-form-item label="批次号" prop="incomeBatchNo"> <el-form-item label="批次号" prop="incomeBatchNo">
<el-select <el-select v-model="form.incomeBatchNo" class="selectItem" placeholder="请选择批次" clearable>
v-model="form.incomeBatchNo" <el-option v-for="(item,index) in batchList"
class="selectItem"
placeholder="请选择批次"
clearable
>
<el-option
v-for="(item, index) in batchList"
:key="index" :key="index"
:label="item.batchCode" :label="item.batchCode"
:value="item.batchCode" :value="item.batchCode">
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -498,79 +341,45 @@
<el-row> <el-row>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="抽样数量" prop="sampleQuality"> <el-form-item label="抽样数量" prop="sampleQuality">
<el-input <el-input type="number" v-model="form.sampleQuality" placeholder="请输入抽样数量" />
type="number"
v-model="form.sampleQuality"
placeholder="请输入抽样数量"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6" v-for="(item,index) in form.defects" :key="index"> <el-col :span="6" v-for="(item,index) in form.defects" :key="index">
<el-form-item :label="item.defectSubclass" prop=""> <el-form-item :label="item.defectSubclass" prop="">
<el-input <el-input type="number" v-model="item.noOkQuality" placeholder="请输入不合格数量" />
type="number"
v-model="item.noOkQuality"
placeholder="请输入不合格数量"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="车间名称" prop="supplierName"> <el-form-item label="车间名称" prop="supplierName">
<el-input <el-input v-model="form.supplierName" placeholder="请输入所属车间名称" >
v-model="form.supplierName" <el-button slot="append" @click="handleSelectWorkCenter" icon="el-icon-search"></el-button>
placeholder="请输入所属车间名称"
>
<el-button
slot="append"
@click="handleSelectWorkCenter"
icon="el-icon-search"
></el-button>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="车间编码" prop="supplierCode"> <el-form-item label="车间编码" prop="supplierCode">
<el-input <el-input v-model="form.supplierCode" placeholder="请输入所属车间编码" disabled/>
v-model="form.supplierCode"
placeholder="请输入所属车间编码"
disabled
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="抽样数量" prop="sampleQuality"> <el-form-item label="抽样数量" prop="sampleQuality">
<el-input <el-input type="number" v-model="form.sampleQuality" placeholder="请输入抽样数量" />
type="number"
v-model="form.sampleQuality"
placeholder="请输入抽样数量"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="检测人姓名" prop="checkManName"> <el-form-item label="检测人姓名" prop="checkManName">
<el-input <el-input v-model="form.checkManName" placeholder="请选择检测人姓名">
v-model="form.checkManName" <el-button slot="append" @click="handleSelectUser" icon="el-icon-search"></el-button>
placeholder="请选择检测人姓名"
>
<el-button
slot="append"
@click="handleSelectUser"
icon="el-icon-search"
></el-button>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="检测人工号" prop="checkManCode" > <el-form-item label="检测人工号" prop="checkManCode" >
<el-input <el-input v-model="form.checkManCode" placeholder="请输入检测人工号" disabled/>
v-model="form.checkManCode"
placeholder="请输入检测人工号"
disabled
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
@ -604,17 +413,10 @@
</template> </template>
<script> <script>
import { import { listQcProduce, getQcProduce, delQcProduce, addQcProduce, updateQcProduce,
listQcProduce, getCheckTypes,changeProduceStatus,getBatchList
getQcProduce,
delQcProduce,
addQcProduce,
updateQcProduce,
getCheckTypes,
changeProduceStatus,
getBatchList,
} from "@/api/quality/qcProduce"; } from "@/api/quality/qcProduce";
import moment from "moment"; import moment from 'moment';
import ItemSelectWorkOrder from "./selectWorkOrder.vue"; import ItemSelectWorkOrder from "./selectWorkOrder.vue";
import ItemSelectWorkCenter from "./selectWorkCenter.vue"; import ItemSelectWorkCenter from "./selectWorkCenter.vue";
import ItemSelectUser from "../qcIncome/selectUser.vue"; import ItemSelectUser from "../qcIncome/selectUser.vue";
@ -622,12 +424,7 @@ import ItemSelectProject from "../qcIncome/checkProjectType.vue";
import { getDefectTypeListByDefectType } from "@/api/quality/defectType.js"; import { getDefectTypeListByDefectType } from "@/api/quality/defectType.js";
export default { export default {
name: "QcProduce", name: "QcProduce",
components: { components: { ItemSelectWorkCenter,ItemSelectUser,ItemSelectProject,ItemSelectWorkOrder},
ItemSelectWorkCenter,
ItemSelectUser,
ItemSelectProject,
ItemSelectWorkOrder,
},
dicts: ["unit","check_status","check_result"], dicts: ["unit","check_status","check_result"],
data() { data() {
return { return {
@ -688,32 +485,36 @@ export default {
// //
rules: { rules: {
incomeBatchNo: [ incomeBatchNo: [
{ required: true, message: "批次号不能为空", trigger: "blur" }, { required: true, message: "批次号不能为空", trigger: "blur" }
], ],
orderNo: [ orderNo: [
{ required: true, message: "订单号不能为空", trigger: "blur" }, { required: true, message: "订单号不能为空", trigger: "blur" }
], ],
materialName: [ materialName: [
{ required: true, message: "物料号不能为空", trigger: "blur" }, { required: true, message: "物料号不能为空", trigger: "blur" }
],
quality: [
{ required: true, message: "数量不能为空", trigger: "blur" }
],
unit: [
{ required: true, message: "单位不能为空", trigger: "blur" }
], ],
quality: [{ required: true, message: "数量不能为空", trigger: "blur" }],
unit: [{ required: true, message: "单位不能为空", trigger: "blur" }],
supplierName: [ supplierName: [
{ required: true, message: "车间不能为空", trigger: "blur" }, { required: true, message: "车间不能为空", trigger: "blur" }
], ],
incomeTime: [ incomeTime: [
{ required: true, message: "生产时间不能为空", trigger: "blur" }, { required: true, message: "生产时间不能为空", trigger: "blur" }
], ],
checkManName: [ checkManName: [
{ required: true, message: "检测人不能为空", trigger: "blur" }, { required: true, message: "检测人不能为空", trigger: "blur" }
], ],
checkLoc: [ checkLoc: [
{ required: true, message: "检测地点不能为空", trigger: "blur" }, { required: true, message: "检测地点不能为空", trigger: "blur" }
], ],
checkType: [ checkType: [
{ required: true, message: "检测类型不能为空", trigger: "blur" }, { required: true, message: "检测类型不能为空", trigger: "blur" }
], ]
}, }
}; };
}, },
created() { created() {
@ -726,15 +527,15 @@ export default {
/****/ /****/
// //
getCheckTypes() { getCheckTypes() {
getCheckTypes("produce").then((response) => { getCheckTypes('produce').then(response => {
this.checkTypes = response; this.checkTypes = response;
}); });
}, },
/**获取默认查询时间段**/ /**获取默认查询时间段**/
getDate() { getDate() {
let start = this.Fungetdate(0); let start = this.Fungetdate (0)
let end = this.Fungetdate(1); let end = this.Fungetdate (1)
this.queryParams.incomeTimeArray.push(start, end); this.queryParams.incomeTimeArray.push(start,end)
//this.queryParams.checkTimeArray.push(start,end) //this.queryParams.checkTimeArray.push(start,end)
}, },
Fungetdate (num) { Fungetdate (num) {
@ -751,24 +552,16 @@ export default {
this.loading = true; this.loading = true;
if(this.queryParams.incomeTimeArray.length>0){ if(this.queryParams.incomeTimeArray.length>0){
this.queryParams.incomeTimeStart = moment( this.queryParams.incomeTimeStart = moment(this.queryParams.incomeTimeArray[0]).format('YYYY-MM-DD HH:mm:ss');
this.queryParams.incomeTimeArray[0] this.queryParams.incomeTimeEnd = moment(this.queryParams.incomeTimeArray[1]).format('YYYY-MM-DD HH:mm:ss');
).format("YYYY-MM-DD HH:mm:ss");
this.queryParams.incomeTimeEnd = moment(
this.queryParams.incomeTimeArray[1]
).format("YYYY-MM-DD HH:mm:ss");
} }
if(this.queryParams.checkTimeArray.length>0){ if(this.queryParams.checkTimeArray.length>0){
this.queryParams.checkTimeStart = moment( this.queryParams.checkTimeStart = moment(this.queryParams.checkTimeArray[0]).format('YYYY-MM-DD HH:mm:ss');
this.queryParams.checkTimeArray[0] this.queryParams.checkTimeEnd = moment(this.queryParams.checkTimeArray[1]).format('YYYY-MM-DD HH:mm:ss');
).format("YYYY-MM-DD HH:mm:ss");
this.queryParams.checkTimeEnd = moment(
this.queryParams.checkTimeArray[1]
).format("YYYY-MM-DD HH:mm:ss");
} }
listQcProduce(this.queryParams).then((response) => { listQcProduce(this.queryParams).then(response => {
this.qcProduceList = response.rows; this.qcProduceList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
@ -810,7 +603,7 @@ export default {
updateTime: null, updateTime: null,
factoryCode: null, factoryCode: null,
delFlag: null, delFlag: null,
defects: [], defects: []
}; };
this.resetForm("form"); this.resetForm("form");
}, },
@ -826,9 +619,9 @@ export default {
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map((item) => item.recordId); this.ids = selection.map(item => item.recordId)
this.single = selection.length !== 1; this.single = selection.length!==1
this.multiple = !selection.length; this.multiple = !selection.length
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
@ -836,36 +629,34 @@ export default {
this.form.defects = this.defectTypeList; this.form.defects = this.defectTypeList;
this.open = true; this.open = true;
this.title = "添加生产过程检验任务"; this.title = "添加生产过程检验任务";
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const recordId = row.recordId || this.ids; const recordId = row.recordId || this.ids
getQcProduce(recordId).then((response) => { getQcProduce(recordId).then(response => {
this.form = response.data; this.form = response.data;
if (this.form.defects == null) {
this.form.defects = this.defectTypeList;
}
this.open = true; this.open = true;
this.title = "修改生产过程检验任务"; this.title = "修改生产过程检验任务";
getBatchList(response.data.orderNo).then((response) => { getBatchList(response.data.orderNo).then(response => {
this.batchList = response; this.batchList = response;
}); });
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate((valid) => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
if (this.form.recordId != null) { if (this.form.recordId != null) {
updateQcProduce(this.form).then((response) => { updateQcProduce(this.form).then(response => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
} else { } else {
addQcProduce(this.form).then((response) => { addQcProduce(this.form).then(response => {
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
@ -876,41 +667,27 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const recordIds = row.recordId || this.ids; const recordIds = row.recordId || this.ids;
this.$modal this.$modal.confirm('是否确认删除生产过程检验任务编号为"' + recordIds + '"的数据项?').then(function() {
.confirm(
'是否确认删除生产过程检验任务编号为"' + recordIds + '"的数据项?'
)
.then(function () {
return delQcProduce(recordIds); return delQcProduce(recordIds);
}) }).then(() => {
.then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}) }).catch(() => {});
.catch(() => {});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download( this.download('quality/qcProduce/export', {
"quality/qcProduce/export", ...this.queryParams
{ }, `qcProduce_${new Date().getTime()}.xlsx`)
...this.queryParams,
},
`qcProduce_${new Date().getTime()}.xlsx`
);
}, },
// //
handleStatusChange(row) { handleStatusChange(row) {
let text = row.status === "0" ? "停用" : "启用"; let text = row.status === "0" ? "停用" : "启用";
this.$modal this.$modal.confirm('确认要"' + text + '""' + row.checkNo + '"吗?').then(function() {
.confirm('确认要"' + text + '""' + row.checkNo + '"吗?')
.then(function () {
return changeProduceStatus(row.recordId, row.status); return changeProduceStatus(row.recordId, row.status);
}) }).then(() => {
.then(() => {
this.$modal.msgSuccess(text + "成功"); this.$modal.msgSuccess(text + "成功");
}) }).catch(function() {
.catch(function () {
row.status = row.status === "0" ? "1" : "0"; row.status = row.status === "0" ? "1" : "0";
}); });
}, },
@ -927,7 +704,7 @@ export default {
this.form.quality = obj.quality; this.form.quality = obj.quality;
this.form.unit = obj.unit; this.form.unit = obj.unit;
this.form.incomeTime = obj.incomeTime; this.form.incomeTime = obj.incomeTime;
getBatchList(obj.workorderCode).then((response) => { getBatchList(obj.workorderCode).then(response => {
this.batchList = response; this.batchList = response;
}); });
}, },
@ -953,29 +730,29 @@ export default {
}, },
// //
handleCheckProject(row){ handleCheckProject(row){
if (row.checkStatus != "0") { if(row.checkStatus != '0'){
this.$modal.msgSuccess("已经完成检验"); this.$modal.msgSuccess("已经完成检验");
return; return
} }
this.$refs.itemSelectProject.showFlag = true; this.$refs.itemSelectProject.showFlag = true;
this.$refs.itemSelectProject.init(row, "produce"); this.$refs.itemSelectProject.init(row,'produce');
}, },
// //
handleView(row){ handleView(row){
this.$refs.itemSelectProject.showFlag = true; this.$refs.itemSelectProject.showFlag = true;
this.$refs.itemSelectProject.init(row, "produce"); this.$refs.itemSelectProject.init(row,'produce');
}, },
// //
saveCheck(){ saveCheck(){
this.getList(); this.getList();
}, },
handleDefectType() { handleDefectType() {
const defectType = "produce"; const defectType = "produce"
getDefectTypeListByDefectType(defectType).then((response) => { getDefectTypeListByDefectType(defectType).then(response => {
this.defectTypeList = response.rows; this.defectTypeList = response.rows;
}); });
}, }
}, }
}; };
</script> </script>

Loading…
Cancel
Save