质量报表+mes修改生产线

master
zhaoxiaolin 12 months ago
parent ce92f7e861
commit 2d37a3dba9

@ -47,6 +47,8 @@
"js-beautify": "1.13.0", "js-beautify": "1.13.0",
"js-cookie": "3.0.1", "js-cookie": "3.0.1",
"jsencrypt": "3.0.0-rc.1", "jsencrypt": "3.0.0-rc.1",
"less": "^3.9.0",
"less-loader": "^5.0.0",
"moment": "^2.29.4", "moment": "^2.29.4",
"nprogress": "0.2.0", "nprogress": "0.2.0",
"print-js": "^1.6.0", "print-js": "^1.6.0",
@ -60,9 +62,7 @@
"vue-meta": "2.4.0", "vue-meta": "2.4.0",
"vue-router": "3.4.9", "vue-router": "3.4.9",
"vuedraggable": "2.24.3", "vuedraggable": "2.24.3",
"vuex": "3.6.0", "vuex": "3.6.0"
"less": "^3.9.0",
"less-loader": "^5.0.0"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "4.4.6", "@vue/cli-plugin-babel": "4.4.6",

@ -93,10 +93,11 @@ export function getCkeckProjectList(query) {
} }
//合格不合格 //合格不合格
export function changeCheckDetailStatus(recordId, status) { export function changeCheckDetailStatus(recordId, status,defectCode) {
const data = { const data = {
recordId, recordId,
status status,
defectCode
} }
return request({ return request({
url: '/quality/qcIncome/changeCheckDetailStatus', url: '/quality/qcIncome/changeCheckDetailStatus',
@ -131,3 +132,14 @@ export function commitCheckResult(recordId,typeCode,checkType) {
data: data data: data
}) })
} }
export function getDefectList(defectType) {
const data = {
defectType
}
return request({
url: '/quality/qcIncome/getDefectList',
method: 'put',
data: data
});
}

@ -18,3 +18,10 @@ export function getProduceChartData(query) {
}); });
} }
export function getWorkcenterList() {
return request({
url: '/quality/staticTable/getWorkcenterList',
method: 'get'
});
}

@ -774,12 +774,13 @@ export default {
// - // -
handleUpdateDown(row) { handleUpdateDown(row) {
var statusesArray = this.statuses; var statusesArray = this.statuses;
/**
for (var i = 0; i < statusesArray.length; i++) { for (var i = 0; i < statusesArray.length; i++) {
if (statusesArray[i] == 'w1') {// if (statusesArray[i] == 'w1') {//
this.$modal.msgError("已经下达的订单不允许操作"); this.$modal.msgError("已经下达的订单不允许操作");
return return
} }
} }**/
this.loading = true; this.loading = true;
let _this = this; let _this = this;
const workorderIds = row.workorderCode || this.codes; const workorderIds = row.workorderCode || this.codes;

@ -34,6 +34,14 @@
</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 label="测量值" align="left" prop="actualValue" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="不良项目" align="left" prop="defectCode" :show-overflow-tooltip="true" width="120">
<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>
</el-select>
</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"> <template slot-scope="scope">
<el-button <el-button
@ -87,7 +95,7 @@
</template> </template>
<script> <script>
import { getCkeckProjectList,changeCheckDetailStatus,commitActualValue,commitCheckResult } from "@/api/quality/income"; import { getCkeckProjectList,changeCheckDetailStatus,commitActualValue,commitCheckResult,getDefectList } from "@/api/quality/income";
export default { export default {
name: "itemSelectUser", name: "itemSelectUser",
dicts: ["check_result"], dicts: ["check_result"],
@ -132,13 +140,21 @@ export default {
//id //id
recordId:'', recordId:'',
typeCode:'',// typeCode:'',//
defectList:[]//
}; };
}, },
created() { created() {
//this.getList(); this.getDefect();
}, },
methods: { methods: {
getDefect(){
getDefectList('defect_produce').then(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;
@ -183,7 +199,7 @@ export default {
handleStatusChange(row) { handleStatusChange(row) {
let text = row.status === "N" ? "不合格" : "合格"; let text = row.status === "N" ? "不合格" : "合格";
this.$modal.confirm('确认' + '"' + row.projectNo + '"'+text+'吗?').then(function() { this.$modal.confirm('确认' + '"' + row.projectNo + '"'+text+'吗?').then(function() {
return changeCheckDetailStatus(row.recordId, row.status); return changeCheckDetailStatus(row.recordId, row.status, row.defectCode);
}).then(() => { }).then(() => {
this.$modal.msgSuccess(text + "操作成功"); this.$modal.msgSuccess(text + "操作成功");
}).catch(function() { }).catch(function() {

@ -92,7 +92,6 @@
v-hasPermi="['quality:qcIncome:add']" v-hasPermi="['quality:qcIncome:add']"
>新增</el-button> >新增</el-button>
</el-col> </el-col>
<!--
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="success" type="success"
@ -104,6 +103,7 @@
v-hasPermi="['quality:qcIncome:edit']" v-hasPermi="['quality:qcIncome:edit']"
>修改</el-button> >修改</el-button>
</el-col> </el-col>
<!--
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="danger" type="danger"
@ -138,6 +138,7 @@
<el-table-column label="物料号" align="center" prop="materialCode" width="170"/> <el-table-column label="物料号" align="center" prop="materialCode" width="170"/>
<el-table-column label="物料名称" align="center" prop="materialName" width="150"/> <el-table-column label="物料名称" align="center" prop="materialName" width="150"/>
<el-table-column label="收货数量" align="center" prop="quality" /> <el-table-column label="收货数量" align="center" prop="quality" />
<el-table-column label="不合格数量" align="center" prop="noOkQuality" />
<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 label="供应商编码" align="center" prop="supplierCode" width="120"/>
<el-table-column label="供应商名称" align="center" prop="supplierName" width="240"/> <el-table-column label="供应商名称" align="center" prop="supplierName" width="240"/>
@ -225,7 +226,7 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <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-button slot="append" @click="handleSelectMaterial" icon="el-icon-search"></el-button> <el-button slot="append" @click="handleSelectMaterial" icon="el-icon-search"></el-button>
@ -233,13 +234,11 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="8">
<el-form-item label="物料号" prop="materialCode"> <el-form-item label="物料号" prop="materialCode">
<el-input v-model="form.materialCode" placeholder="请输入物料号" disabled/> <el-input v-model="form.materialCode" placeholder="请输入物料号" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
<el-row>
<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%;">
@ -252,11 +251,18 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
<el-row>
<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="请输入收货数量" /> <el-input type="number" v-model="form.quality" placeholder="请输入收货数量" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8">
<el-form-item label="不合格数量" prop="noOkQuality">
<el-input type="number" v-model="form.noOkQuality" placeholder="请输入不合格数量" />
</el-form-item>
</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%;">

@ -120,7 +120,7 @@
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">
<el-button <el-button
type="success" type="success"
@ -132,6 +132,7 @@
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">
<el-button <el-button
type="danger" type="danger"
@ -166,6 +167,8 @@
<el-table-column label="物料号" align="center" prop="materialCode" width="170"/> <el-table-column label="物料号" align="center" prop="materialCode" width="170"/>
<el-table-column label="物料名称" align="center" prop="materialName" width="150"/> <el-table-column label="物料名称" align="center" prop="materialName" width="150"/>
<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="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 label="车间编码" align="center" prop="supplierCode" width="120"/>
<el-table-column label="车间名称" align="center" prop="supplierName" width="240"/> <el-table-column label="车间名称" align="center" prop="supplierName" width="240"/>
@ -251,7 +254,7 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <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-button slot="append" @click="handleSelectMaterial" icon="el-icon-search"></el-button> <el-button slot="append" @click="handleSelectMaterial" icon="el-icon-search"></el-button>
@ -259,13 +262,12 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="8">
<el-form-item label="物料号" prop="materialCode"> <el-form-item label="物料号" prop="materialCode">
<el-input v-model="form.materialCode" placeholder="请输入物料号" disabled/> <el-input v-model="form.materialCode" placeholder="请输入物料号" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
<el-row>
<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%;">
@ -278,9 +280,16 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="生产数量" prop="quality">
<el-input type="number" v-model="form.quality" placeholder="请输入生产数量" />
</el-form-item>
</el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="收货数量" prop="quality"> <el-form-item label="抽样数量" prop="sampleQuality">
<el-input type="number" v-model="form.quality" placeholder="请输入收货数量" /> <el-input type="number" v-model="form.sampleQuality" placeholder="请输入抽样数量" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
@ -296,6 +305,23 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row>
<el-col :span="8">
<el-form-item label="A类不良数量" prop="aNoOkquality">
<el-input type="number" v-model="form.aNoOkquality" placeholder="请输入不良数量" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="B类不良数量" prop="bNoOkquality">
<el-input type="number" v-model="form.bNoOkquality" placeholder="请输入不良数量" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="C类不良数量" prop="cNoOkquality">
<el-input type="number" v-model="form.cNoOkquality" placeholder="请输入不良数量" />
</el-form-item>
</el-col>
</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">

@ -302,16 +302,15 @@ export default {
// //
handleClose(tag) { handleClose(tag) {
this.selectMaterielListtag.splice(this.selectMaterielListtag.indexOf(tag.supplierName), 1); this.selectMaterielListtag.splice(this.selectMaterielListtag.indexOf(tag.supplierName), 1);
this.form.supplierCode =''
this.form.supplierName =''
var code = ""; var code = "";
var desc = ""; var desc = "";
for (let i = 0; i < this.selectMaterielListtag.length; i++) { for (let i = 0; i < this.selectMaterielListtag.length; i++) {
code = code + this.selectMaterielListtag[i].supplierCode + ","; code = code + this.selectMaterielListtag[i].supplierCode + ",";
desc = desc + this.selectMaterielListtag[i].supplierName + ","; desc = desc + this.selectMaterielListtag[i].supplierName + ",";
} }
this.form.supplierCode += code; this.queryParams.supplierCode += code;
this.form.supplierName += desc; this.queryParams.supplierName += desc;
} }
} }
}; };

@ -135,7 +135,6 @@ export default {
submitBomForm() { submitBomForm() {
this.$emit('onSelected', this.selectedRows); this.$emit('onSelected', this.selectedRows);
this.showFlag = false; this.showFlag = false;
this.queryParams.itemCodeGet = "";
} }
} }
}; };

@ -5,7 +5,7 @@
<el-date-picker <el-date-picker
v-model="queryParams.ymArray" v-model="queryParams.ymArray"
format="yyyy-MM" format="yyyy-MM"
type="datetimerange" type="monthrange"
range-separator="至" range-separator="至"
start-placeholder="开始月份" start-placeholder="开始月份"
end-placeholder="结束月份"> end-placeholder="结束月份">
@ -21,7 +21,7 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="产品" prop="supplierCodeArray"> <el-form-item label="产品">
<div class="tagbox"> <div class="tagbox">
<div class="tag" style="" placeholder="请选择产品"> <div class="tag" style="" placeholder="请选择产品">
<el-tag <el-tag
@ -32,7 +32,7 @@
:disable-transitions="false" :disable-transitions="false"
@close="handleClose(tag)" @close="handleClose(tag)"
> >
{{ tag.supplierName }} {{ tag.componentName }}
</el-tag> </el-tag>
</div> </div>
<el-button <el-button
@ -42,8 +42,8 @@
icon="el-icon-search" icon="el-icon-search"
></el-button> ></el-button>
<el-row style="display: none;"> <el-row style="display: none;">
<el-input type="input" clearable v-model="queryParams.supplierCode" placeholder="点击选择物料"/> <el-input type="input" v-model="queryParams.materialCode" placeholder="点击选择产品"/>
<el-input type="input"clearable v-model="queryParams.supplierName" placeholder="点击选择物料"/> <el-input type="input" v-model="queryParams.materialName" placeholder="点击选择产品"/>
</el-row> </el-row>
</div> </div>
</el-form-item> </el-form-item>
@ -62,16 +62,23 @@
<div id="orderline" style="width:100%;height:500px"></div> <div id="orderline" style="width:100%;height:500px"></div>
</div> </div>
</el-row> </el-row>
<!--产品物料选择弹窗-->
<ItemSelectMaterial
ref="itemSelectMaterial"
@onSelected="onSelectMaterial"
></ItemSelectMaterial>
</div> </div>
</template> </template>
<script> <script>
import * as echarts from 'echarts' import * as echarts from 'echarts'
require('echarts/theme/macarons') require('echarts/theme/macarons')
import {getProduceChartData} from "@/api/quality/qcTable"; import {getProduceChartData,getWorkcenterList} from "@/api/quality/qcTable";
import ItemSelectMaterial from "./selectMaterial.vue";
import moment from 'moment'; import moment from 'moment';
export default { export default {
name: "produceLineChart", name: "produceLineChart",
components: { ItemSelectMaterial},
data() { data() {
return { return {
title:"不良率统计", title:"不良率统计",
@ -90,17 +97,28 @@ export default {
status: null, status: null,
shiftId: null, shiftId: null,
productCode: null, productCode: null,
supplierName: '', materialCode: '',
supplierCode: '' materialName: ''
} },
options:null,
// listtag
selectMaterielListtag:[],
} }
}, },
mounted(){ mounted(){
this.getDate(); this.getDate();
this.getList() this.getList()
this.getWorkcenterList();
}, },
methods: { methods: {
getWorkcenterList(){
getWorkcenterList().then(data => {
this.options = data;
});
this.queryParams.workCenter = this.options[0].factoryCode;
},
/**获取默认查询时间段**/ /**获取默认查询时间段**/
getDate() { getDate() {
let start = this.Fungetdate (0) let start = this.Fungetdate (0)
@ -175,11 +193,90 @@ export default {
//] //]
}, },
true true
)} )
)} })
},
/**供应商选择弹出框**/
handleSelectSupplier() {
this.$refs.itemSelectMaterial.showFlag = true;
},
//
onSelectMaterial(objs) {
var code = '';
var desc = '';
for (let i = 0; i < objs.length; i++) {
if(this.queryParams.materialCode.indexOf(objs[i].component)<0){
code = code + objs[i].component + ',';
this.selectMaterielListtag.push(objs[i])
}else{
this.$message({
message: objs[i].componentName+'已经选择',
type: 'warning'
})
}
if(this.queryParams.materialName.indexOf(objs[i].componentName)<0){
desc = desc + objs[i].componentName + ',';
}
}
this.queryParams.materialCode += code;
this.queryParams.materialName += desc;
},
//
handleClose(tag) {
this.selectMaterielListtag.splice(this.selectMaterielListtag.indexOf(tag.componentName), 1);
var code = "";
var desc = "";
for (let i = 0; i < this.selectMaterielListtag.length; i++) {
code = code + this.selectMaterielListtag[i].component + ",";
desc = desc + this.selectMaterielListtag[i].componentName + ",";
}
this.queryParams.materialCode = code;
this.queryParams.materialName = desc;
}
} }
}; };
</script> </script>
<style lang="scss" scoped>
.tagbox {
display: flex;
/* overflow: scroll; */
position: relative;
width: 80%;
padding-left: 26px;
margin-bottom: 15px;
.tagboxlabel{
width: 100px;
text-align: right;
vertical-align: middle;
font-size: 14px;
color: black;
line-height: 40px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
margin-right: 12px;
}
.tag {
width: 720px;
border: 1px #DCDFE6 solid;
height: 60px;
padding: 5px 15px;
overflow-y: scroll;
.tagitem{
margin-left: 5px;
}
}
.button1{
width: 37px;
height: 37px;
position: absolute;
right: -39px;
top: 2px;
}
}
</style>

@ -0,0 +1,148 @@
<template>
<el-dialog title="BOM物料选择"
v-if="showFlag"
:visible.sync="showFlag"
:modal= false
width="1000px"
>
<el-row :gutter="20">
<!--BOM数据-->
<el-col :span="24" :xs="24">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="105px" align="center">
<el-form-item label="物料编码" prop="itemCode">
<el-input
v-model="queryParams.component"
placeholder="请输入物料编码"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料名称" prop="itemName">
<el-input
v-model="queryParams.componentName"
placeholder="请输入物料名称"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</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-form-item>
</el-form>
<el-table v-loading="loading" :data="itemList" @selection-change="handleBomSelectionChange" ref="myTable" >
<el-table-column width="50" align="center" type="selection">
</el-table-column>
<!-- 序号 -->
<el-table-column type="index" width="90" align="center" :index="indexMethod" label="序号"></el-table-column>
<el-table-column label="BOM物料组件编码" align="left" key="component" prop="component" v-if="columns[2].visible" :show-overflow-tooltip="true" />
<el-table-column label="BOM物料组件名称" align="left" key="componentName" prop="componentName" v-if="columns[3].visible" :show-overflow-tooltip="true" />
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitBomForm"> </el-button>
<el-button @click="showFlag=false"> </el-button>
</div>
</el-dialog>
</template>
<script>
import {getQcListBom } from "@/api/quality/income";
export default {
name: "itemSelectMaterial",
data() {
return {
showFlag:false,
//
selectedRows: {},
//
single: true,
//
multiple: false,
//
showSearch: true,
//
total: 0,
// BOM
itemList: null,
//
bomCode: undefined,
defaultProps: {
id: "id",
label: "label"
},
//
queryParams: {
pageNum: 1,
pageSize: 10,
component: '',
componentName : ''
},
//
columns: [
{ key: 0, label: `BOM物料编码`, visible: true },
{ key: 1, label: `产品名称`, visible: true },
{ key: 2, label: `BOM物料组件编码`, visible: true },
{ key: 3, label: `BOM物料组件名称`, visible: true }
]
};
},
created() {
this.getList();
},
methods: {
handleEquipmentSelectionChange (val) {
this.itemList = val
},
/** 查询BOM列表*/
getList() {
this.loading = true;
this.queryParams.bomCode = this.queryParams.itemCode;
this.queryParams.productDescZh = this.queryParams.itemName;
getQcListBom(this.queryParams).then(response => {
this.itemList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleBomSelectionChange(selection) {
this.selectedRows = selection
},
submitBomForm() {
this.$emit('onSelected', this.selectedRows);
this.showFlag = false;
}
}
};
</script>
Loading…
Cancel
Save