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

yangwl
A0010407 10 months ago
parent 37a850598c
commit f6daa7703e

@ -1,22 +1,42 @@
<template> <template>
<div> <div>
<el-dialog title="检验项目" <el-dialog
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 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"
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"
@ -24,13 +44,28 @@
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="检验方式" align="left" prop="checkMode" :show-overflow-tooltip="true" /> <el-table-column label="检验方式" align="left" prop="checkMode" />
<el-table-column label="检验工具" align="left" prop="checkTool" :show-overflow-tooltip="true" /> <el-table-column label="检验工具" align="left" prop="checkTool" />
<el-table-column label="检验标准" align="left" prop="checkStandard" :show-overflow-tooltip="true" /> <el-table-column
<el-table-column label="上差值" align="left" prop="upperDiff" :show-overflow-tooltip="true" /> label="检验标准"
<el-table-column label="下差值" align="left" prop="downDiff" :show-overflow-tooltip="true" /> align="left"
<el-table-column label="单位" align="left" prop="unitCode" :show-overflow-tooltip="true" width="80"/> prop="checkStandard"
<el-table-column label="检测结果" key="status" align="center" prop="status" width="90"> />
<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"> <template slot-scope="scope">
<el-switch <el-switch
v-model="scope.row.status" v-model="scope.row.status"
@ -40,16 +75,37 @@
></el-switch> ></el-switch>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="测量值" align="left" prop="actualValue" :show-overflow-tooltip="true" width="120"/> <el-table-column
<el-table-column label="不良项目" align="left" prop="defectCode" :show-overflow-tooltip="true" width="120"> label="测量值"
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 v-for="item in defectList" :key="item.defectCode" :label="item.defectSubclass" :value="item.defectCode"> <el-option
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 label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column
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"
@ -57,13 +113,14 @@
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>
<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"
@ -72,27 +129,50 @@
</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"
@click="submitBomForm"
v-if="checkStatus == '0'"
> </el-button
>
<el-button @click="cancelForm"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<!--测量值弹窗--> <!--测量值弹窗-->
<el-dialog title="测量值" :visible.sync="valueOpen" width="600px" append-to-body> <el-dialog
<el-form :model="dynamicValidateForm" ref="dynamicValidateForm" label-width="100px" class="demo-dynamic"> title="测量值"
: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, message: '测量值不能为空', trigger: 'blur' required: true,
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 @click.prevent="removeDomain(domain)" style="margin-left:30px">删除</el-button> <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> <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>
@ -101,14 +181,19 @@
</div> </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,11 +283,21 @@ 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.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;
}); });
}, },
@ -206,11 +305,19 @@ export default {
// /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 () {
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";
}); });
}, },
@ -225,15 +332,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;
} }
}); });
@ -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>

@ -1,8 +1,19 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px"> <el-form
: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 v-model="queryParams.checkType" clearable placeholder="请选择检验节点"> <el-select
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"
@ -52,7 +63,6 @@
/> />
</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"
@ -60,7 +70,8 @@
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>
@ -88,7 +99,8 @@
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">
@ -106,8 +118,16 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> <el-button
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button> type="primary"
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>
@ -120,7 +140,8 @@
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">
@ -132,7 +153,8 @@
: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">
@ -154,33 +176,104 @@
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 :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="qcProduceList" @selection-change="handleSelectionChange"> <el-table
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 label="checkType" align="center" prop="checkType" v-if="false"/> <el-table-column
<el-table-column label="任务编号" align="center" prop="checkNo" width="120"/> label="checkType"
<el-table-column label="批次号" align="center" prop="incomeBatchNo" width="200" :show-overflow-tooltip="true" /> align="center"
<el-table-column label="订单号" align="center" prop="orderNo" width="130"/> prop="checkType"
<el-table-column label="物料号" align="center" prop="materialCode" width="170"/> v-if="false"
<el-table-column label="物料名称" align="center" prop="materialName" width="250" :show-overflow-tooltip="true" /> />
<el-table-column
label="任务编号"
align="center"
prop="checkNo"
width="120"
>
<template slot-scope="scope">
<el-button type="text" @click="handleView(scope.row)">{{
scope.row.checkNo
}}</el-button>
</template>
</el-table-column>
<el-table-column
label="批次号"
align="center"
prop="incomeBatchNo"
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 label="不合格数量" align="center" prop="noOkQuality" width="120"/> <el-table-column
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 label="车间编码" align="center" prop="supplierCode" width="120"/> <el-table-column
<el-table-column label="车间名称" align="center" prop="supplierName" width="170"/> label="车间编码"
<el-table-column label="生产时间" align="center" prop="incomeTime" width="150"> align="center"
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 label="检测地点" align="center" prop="checkLoc" width="120"/> <el-table-column
<el-table-column label="检测状态" align="center" prop="checkStatus" > label="检测地点"
align="center"
prop="checkLoc"
width="120"
/>
<el-table-column label="检测状态" align="center" prop="checkStatus">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag <dict-tag
:options="dict.type.check_status" :options="dict.type.check_status"
@ -188,17 +281,41 @@
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="检测人工号" align="center" prop="checkManCode" width="100" /> <el-table-column
<el-table-column label="检测人姓名" align="center" prop="checkManName" width="100"/> label="检测人工号"
<el-table-column label="检验时间" align="center" prop="checkTime" width="180"> align="center"
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>{{ parseTime(scope.row.checkTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> <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 label="创建时间" align="center" prop="createTime" width="180"> <el-table-column
label="创建时间"
align="center"
prop="createTime"
width="180"
>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> <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" />
@ -212,7 +329,11 @@
></el-switch> ></el-switch>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column
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"
@ -220,7 +341,14 @@
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
ref="itemSelectProject"
@saveCheck="saveCheck"
:checkStatus="scope.row.checkStatus"
></ItemSelectProject>
<!-- <!--
<el-button <el-button
size="mini" size="mini"
@ -234,7 +362,7 @@
</el-table> </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"
@ -242,17 +370,30 @@
/> />
<!-- 添加或修改生产过程检验任务对话框 --> <!-- 添加或修改生产过程检验任务对话框 -->
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body> <el-dialog
: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 v-model="form.checkNo" placeholder="请输入检验任务编号" disabled/> <el-input
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 v-model="form.checkType" placeholder="请选择检验类型" style="width: 100%;"> <el-select
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"
@ -264,8 +405,12 @@
</el-col> </el-col>
<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 slot="append" @click="handleSelectWorkOrder" icon="el-icon-search"></el-button> <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>
@ -273,37 +418,54 @@
<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 v-model="form.materialName" placeholder="请选择物料名称"/> <el-input
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 v-model="form.materialCode" placeholder="请输入物料号"/> <el-input
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 type="number" v-model="form.quality" placeholder="请输入生产数量" disabled/> <el-input
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 clearable <el-date-picker
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 v-model="form.unit" placeholder="请选择单位" style="width: 100%;"> <el-select
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"
@ -316,11 +478,18 @@
<el-col :span="8"> <el-col :span="8">
<el-form-item label="批次号" prop="incomeBatchNo"> <el-form-item label="批次号" prop="incomeBatchNo">
<el-select v-model="form.incomeBatchNo" class="selectItem" placeholder="请选择批次" clearable> <el-select
<el-option v-for="(item,index) in batchList" v-model="form.incomeBatchNo"
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>
@ -329,45 +498,79 @@
<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 type="number" v-model="form.sampleQuality" placeholder="请输入抽样数量" /> <el-input
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 type="number" v-model="item.noOkQuality" placeholder="请输入不合格数量" /> <el-input
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 v-model="form.supplierName" placeholder="请输入所属车间名称" > <el-input
<el-button slot="append" @click="handleSelectWorkCenter" icon="el-icon-search"></el-button> v-model="form.supplierName"
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 v-model="form.supplierCode" placeholder="请输入所属车间编码" disabled/> <el-input
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 type="number" v-model="form.sampleQuality" placeholder="请输入抽样数量" /> <el-input
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 v-model="form.checkManName" placeholder="请选择检测人姓名"> <el-input
<el-button slot="append" @click="handleSelectUser" icon="el-icon-search"></el-button> v-model="form.checkManName"
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 v-model="form.checkManCode" placeholder="请输入检测人工号" disabled/> <el-input
v-model="form.checkManCode"
placeholder="请输入检测人工号"
disabled
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
@ -397,19 +600,21 @@
ref="itemSelectUser" ref="itemSelectUser"
@onSelected="onSelectUser" @onSelected="onSelectUser"
></ItemSelectUser> ></ItemSelectUser>
<!--检验项目弹窗-->
<ItemSelectProject
ref="itemSelectProject"
@saveCheck="saveCheck"
></ItemSelectProject>
</div> </div>
</template> </template>
<script> <script>
import { listQcProduce, getQcProduce, delQcProduce, addQcProduce, updateQcProduce, import {
getCheckTypes,changeProduceStatus,getBatchList listQcProduce,
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";
@ -417,8 +622,13 @@ 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: { ItemSelectWorkCenter,ItemSelectUser,ItemSelectProject,ItemSelectWorkOrder}, components: {
dicts: ["unit","check_status","check_result"], ItemSelectWorkCenter,
ItemSelectUser,
ItemSelectProject,
ItemSelectWorkOrder,
},
dicts: ["unit", "check_status", "check_result"],
data() { data() {
return { return {
// //
@ -435,7 +645,7 @@ export default {
total: 0, total: 0,
// //
qcProduceList: [], qcProduceList: [],
checkTypeList:[], checkTypeList: [],
defectTypeList: [], defectTypeList: [],
// //
title: "", title: "",
@ -473,41 +683,37 @@ export default {
// //
form: {}, form: {},
checkTypes:[], checkTypes: [],
batchList:[], batchList: [],
// //
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() {
@ -520,41 +726,49 @@ 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) {
var dd = new Date(); var dd = new Date();
dd.setDate(dd.getDate() + num); dd.setDate(dd.getDate() + num);
var y = dd.getFullYear(); var y = dd.getFullYear();
var m = dd.getMonth() + 1;// var m = dd.getMonth() + 1; //
var d = dd.getDate(); var d = dd.getDate();
return y + "-" + m + "-" + d+" 00:00:00"; return y + "-" + m + "-" + d + " 00:00:00";
}, },
/** 查询生产过程检验任务列表 */ /** 查询生产过程检验任务列表 */
getList() { getList() {
this.loading = true; this.loading = true;
if(this.queryParams.incomeTimeArray.length>0){ if (this.queryParams.incomeTimeArray.length > 0) {
this.queryParams.incomeTimeStart = moment(this.queryParams.incomeTimeArray[0]).format('YYYY-MM-DD HH:mm:ss'); this.queryParams.incomeTimeStart = moment(
this.queryParams.incomeTimeEnd = moment(this.queryParams.incomeTimeArray[1]).format('YYYY-MM-DD HH:mm:ss'); this.queryParams.incomeTimeArray[0]
).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.checkTimeArray[0]).format('YYYY-MM-DD HH:mm:ss'); this.queryParams.checkTimeStart = moment(
this.queryParams.checkTimeEnd = moment(this.queryParams.checkTimeArray[1]).format('YYYY-MM-DD HH:mm:ss'); this.queryParams.checkTimeArray[0]
).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;
@ -596,7 +810,7 @@ export default {
updateTime: null, updateTime: null,
factoryCode: null, factoryCode: null,
delFlag: null, delFlag: null,
defects: [] defects: [],
}; };
this.resetForm("form"); this.resetForm("form");
}, },
@ -612,9 +826,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() {
@ -622,13 +836,12 @@ 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) { if (this.form.defects == null) {
this.form.defects = this.defectTypeList; this.form.defects = this.defectTypeList;
@ -636,23 +849,23 @@ export default {
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();
}); });
@ -663,27 +876,41 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const recordIds = row.recordId || this.ids; const recordIds = row.recordId || this.ids;
this.$modal.confirm('是否确认删除生产过程检验任务编号为"' + recordIds + '"的数据项?').then(function() { this.$modal
.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('quality/qcProduce/export', { this.download(
...this.queryParams "quality/qcProduce/export",
}, `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.confirm('确认要"' + text + '""' + row.checkNo + '"吗?').then(function() { this.$modal
.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";
}); });
}, },
@ -700,7 +927,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;
}); });
}, },
@ -725,26 +952,30 @@ export default {
this.form.checkManName = obj.name; this.form.checkManName = obj.name;
}, },
// //
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) {
this.$refs.itemSelectProject.showFlag = true;
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