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

yangwl
A0010407 10 months ago
parent f6daa7703e
commit 7ed7e6496e

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

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

Loading…
Cancel
Save