质量管理

This commit is contained in:
朱菊兰 2024-07-19 10:44:17 +08:00
parent b3623d29c5
commit 587985e3c6
14 changed files with 432 additions and 752 deletions

View File

@ -6,37 +6,67 @@
-->
<template>
<el-form ref="form" :model="dataForm" label-width="120px" v-loading="formLoading">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="产线" prop="productionLineId"
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-select v-model="dataForm.productionLineId" placeholder="请选择产线" filterable
@change="handleProductlineChange">
<el-option v-for="opt in productionLineList" :key="opt.value" :label="opt.label" :value="opt.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="工段" prop="sectionId" :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-select v-model="dataForm.sectionId" placeholder="请选择工段" filterable @change="$emit('update', dataForm)">
<el-option v-for="opt in workshopSectionList" :key="opt.value" :label="opt.label" :value="opt.value" />
</el-select>
</el-form-item>
</el-col>
<el-form
ref="form"
:model="dataForm"
label-width="110px"
v-loading="formLoading">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item
label="产线"
prop="productionLineId"
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-select
v-model="dataForm.productionLineId"
placeholder="请选择产线"
filterable
@change="handleProductlineChange">
<el-option
v-for="opt in productionLineList"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="工段"
prop="sectionId"
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-select
v-model="dataForm.sectionId"
placeholder="请选择工段"
filterable
@change="$emit('update', dataForm)">
<el-option
v-for="opt in workshopSectionList"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="按钮盒识别码" prop="buttonId" :rules="[
{ required: true, message: '不能为空', trigger: 'blur' },
{
type: 'number',
message: '请输入整数',
trigger: 'blur',
transform: (val) => Number.isInteger(Number(val)) && Number(val),
},
]">
<el-input v-model="dataForm.buttonId" @change="$emit('update', dataForm)" placeholder="请输入整数" />
</el-form-item>
<el-col :span="12">
<el-form-item
label="按钮盒识别码"
prop="buttonId"
:rules="[
{ required: true, message: '不能为空', trigger: 'blur' },
{
type: 'number',
message: '请输入整数',
trigger: 'blur',
transform: (val) => Number.isInteger(Number(val)) && Number(val),
},
]">
<el-input
v-model="dataForm.buttonId"
@change="$emit('update', dataForm)"
placeholder="请输入整数" />
</el-form-item>
<el-form-item
label="产线"
prop="productionLineId"
@ -101,35 +131,50 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="按钮值" prop="keyValue" :rules="[
{ required: true, message: '不能为空', trigger: 'blur' },
{
type: 'number',
message: '请输入100以内的整数',
trigger: 'blur',
transform: (val) =>
Number.isInteger(+val) &&
Number(val) >= 0 &&
Number(val) <= 100 &&
Number(val),
},
]">
<el-input v-model="dataForm.keyValue" type="number" min="0" max="100" @change="$emit('update', dataForm)"
placeholder="请输入按钮盒模式" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="按钮值"
prop="keyValue"
:rules="[
{ required: true, message: '不能为空', trigger: 'blur' },
{
type: 'number',
message: '请输入100以内的整数',
trigger: 'blur',
transform: (val) =>
Number.isInteger(+val) &&
Number(val) >= 0 &&
Number(val) <= 100 &&
Number(val),
},
]">
<el-input
v-model="dataForm.keyValue"
type="number"
min="0"
max="100"
@change="$emit('update', dataForm)"
placeholder="请输入按钮盒模式" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="检测内容" prop="inspectionDetId">
<el-select v-model="dataForm.inspectionDetId" placeholder="请选择检测内容" filterable
@change="$emit('update', dataForm)">
<el-option v-for="opt in inspectionDetList" :key="opt.value" :label="opt.label" :value="opt.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-col :span="12">
<el-form-item label="检测内容" prop="inspectionDetId">
<el-select
v-model="dataForm.inspectionDetId"
placeholder="请选择检测内容"
filterable
@change="$emit('update', dataForm)">
<el-option
v-for="opt in inspectionDetList"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
@ -150,14 +195,14 @@ export default {
data() {
return {
formLoading: true,
productionLineList: [],
inspectionDetList:[],
productionLineList: [],
inspectionDetList: [],
workshopSectionList: [],
};
},
mounted() {
this.getProductionLineList()
this.getQualityInspectionDetList()
this.getProductionLineList();
this.getQualityInspectionDetList();
// this.getWorksectionList();
// this.getCode('/base/equipment-group-alarm/getCode').then((code) => {
// this.formLoading = false;
@ -197,20 +242,20 @@ export default {
}
this.formLoading = false;
},
async getQualityInspectionDetList() {
this.formLoading = true;
const res = await this.$axios({
url: '/base/quality-inspection-det/listAll',
method: 'get',
});
if (res.code == 0) {
this.inspectionDetList = res.data.map((item) => ({
label: item.content,
value: item.id,
}));
}
this.formLoading = false;
},
async getQualityInspectionDetList() {
this.formLoading = true;
const res = await this.$axios({
url: '/base/quality-inspection-det/listAll',
method: 'get',
});
if (res.code == 0) {
this.inspectionDetList = res.data.map((item) => ({
label: item.content,
value: item.id,
}));
}
this.formLoading = false;
},
async getWorksectionList(id) {
this.formLoading = true;
const res = await this.$axios({

View File

@ -12,12 +12,13 @@
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-data="list"
@emitFun="handleEmitFun">
@emitFun="handleEmitFun"
:max-height="tableH">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
label="操作"
:width="120"
:width="80"
fixed="right"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
@ -56,10 +57,11 @@ import {
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import moment from 'moment';
import DialogForm from './dialogForm.vue';
import tableHeightMixin from '@/mixins/tableHeightMixin';
export default {
name: 'QualityInspectionBoxBtn',
mixins: [basicPageMixin],
mixins: [basicPageMixin, tableHeightMixin],
components: { DialogForm },
data() {
return {
@ -70,7 +72,9 @@ export default {
label: '产线',
url: '/base/production-line/listAll',
prop: 'productionId',
rules: [{ required: true, message: '产线不能为空', trigger: 'blur' }],
rules: [
{ required: true, message: '产线不能为空', trigger: 'blur' },
],
bind: {
filterable: true,
},
@ -80,7 +84,9 @@ export default {
label: '工段',
url: '/base/workshop-section/listAll',
prop: 'sectionId',
rules: [{ required: true, message: '工段不能为空', trigger: 'blur' }],
rules: [
{ required: true, message: '工段不能为空', trigger: 'blur' },
],
bind: {
filterable: true,
},
@ -118,17 +124,17 @@ export default {
},
],
bind: { type: 'number', min: 0, max: 100 },
},
{
select: true,
label: '检测内容',
url: '/base/quality-inspection-det/listAll',
prop: 'inspectionDetId',
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
bind: {
filterable: true,
},
},
},
{
select: true,
label: '检测内容',
url: '/base/quality-inspection-det/listAll',
prop: 'inspectionDetId',
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
bind: {
filterable: true,
},
},
],
],
searchBarFormConfig: [
@ -180,41 +186,42 @@ export default {
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
},
{
prop: 'productionLineName',
prop: 'productionLineName',
label: '产线',
showOverflowtooltip: true,
},
{
prop: 'sectionName',
label: '工段',
showOverflowtooltip: true,
},
{
prop: 'inspectionDetContent',
label: '检测内容',
showOverflowtooltip: true,
},
{
width: 160,
prop: 'buttonId',
label: '按钮盒识别码',
},
// {
// width: 256,
// prop: 'productionId',
// label: '线ID',
// ,
// },
// {
// width: 256,
// prop: 'sectionId',
// label: 'ID',
// ,
// },
{ width: 90, prop: 'keyValue', label: '按钮值' },
{ width: 128, prop: 'model', label: '按钮盒模式' },
{
width: 90,
prop: 'keyValue',
label: '按钮值',
showOverflowtooltip: true,
},
{
width: 128,
prop: 'model',
label: '按钮盒模式',
showOverflowtooltip: true,
},
],
//
queryParams: {
pageNo: 1,
pageSize: 10,
pageSize: 20,
inspectionDetContent: null,
},
// keys, queryParams pageNo, pageSize key
@ -222,8 +229,8 @@ export default {
form: {
id: null,
buttonId: null,
inspectionDetId: null,
productionLineId: null,
inspectionDetId: null,
productionLineId: null,
sectionId: null,
model: null,
keyValue: null,
@ -261,7 +268,7 @@ export default {
handleAdd() {
this.reset();
this.open = true;
this.title = '添加安灯按钮16键对应';
this.title = '新增';
},
/** 修改按钮操作 */
handleUpdate(row) {
@ -270,7 +277,7 @@ export default {
getQualityInspectionBoxBtn(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = '修改安灯按钮16键对应';
this.title = '编辑';
});
},
/** 提交按钮 */

View File

@ -12,12 +12,13 @@
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-data="list"
@emitFun="handleEmitFun">
@emitFun="handleEmitFun"
:max-height="tableH">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
label="操作"
:width="120"
:width="80"
fixed="right"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
@ -102,10 +103,11 @@ import {
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import tableHeightMixin from '@/mixins/tableHeightMixin';
export default {
name: 'QualityInspectionDet',
mixins: [basicPageMixin],
mixins: [basicPageMixin, tableHeightMixin],
data() {
return {
typeList: [], //
@ -180,19 +182,18 @@ export default {
{
prop: 'createTime',
label: '添加时间',
fixed: true,
width: 180,
width: 160,
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
},
{ prop: 'typeName', label: '检测类型' },
{ prop: 'content', label: '检测内容' },
{ prop: 'code', label: '检测编码' },
{ prop: 'remark', label: '备注' },
{ prop: 'typeName', label: '检测类型', showOverflowtooltip: true },
{ prop: 'content', label: '检测内容', showOverflowtooltip: true },
{ prop: 'code', label: '检测编码', showOverflowtooltip: true },
{ prop: 'remark', label: '备注', showOverflowtooltip: true },
],
//
queryParams: {
pageNo: 1,
pageSize: 10,
pageSize: 20,
content: null,
createTime: [],
},

View File

@ -18,7 +18,7 @@
v-if="tableBtn.length"
slot="handleBtn"
label="操作"
:width="120"
:width="80"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
</base-table>
@ -36,7 +36,7 @@
:dialogTitle="title"
:dialogVisible="open"
@close="cancel"
width="30%"
width="40%"
@cancel="cancel"
@confirm="submitForm">
<DialogForm
@ -112,13 +112,12 @@ export default {
{
prop: 'createTime',
label: '添加时间',
fixed: true,
width: 180,
width: 160,
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
},
{ prop: 'name', label: '检测类型' },
{ prop: 'code', label: '类型编码' },
{ prop: 'remark', label: '备注' },
{ prop: 'name', label: '检测类型', showOverflowtooltip: true },
{ prop: 'code', label: '类型编码', showOverflowtooltip: true },
{ prop: 'remark', label: '备注', showOverflowtooltip: true },
],
//
searchBarFormConfig: [
@ -152,7 +151,7 @@ export default {
//
queryParams: {
pageNo: 1,
pageSize: 10,
pageSize: 20,
name: null,
},
//
@ -232,7 +231,7 @@ export default {
handleAdd() {
this.reset();
this.open = true;
this.title = '添加质量检测类型基础';
this.title = '新增';
},
/** 修改按钮操作 */
handleUpdate(row) {
@ -241,7 +240,7 @@ export default {
getQualityInspectionType(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = '修改质量检测类型基础';
this.title = '编辑';
});
},
/** 提交按钮 */

View File

@ -6,88 +6,99 @@
* @Description:
-->
<template>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="auto">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="报废原因编码" prop="code">
<el-input v-model="dataForm.code" placeholder="请输入报废原因编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="报废原因" prop="content">
<el-input v-model="dataForm.content" placeholder="请输入报废原因" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="报废类型" prop="typeId">
<el-select v-model="dataForm.typeId" placeholder="请选择报废类型">
<el-option v-for="dict in typeList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" clearable placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="auto">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="报废原因编码" prop="code">
<el-input v-model="dataForm.code" placeholder="请输入报废原因编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="报废原因" prop="content">
<el-input v-model="dataForm.content" placeholder="请输入报废原因" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="报废类型" prop="typeId">
<el-select v-model="dataForm.typeId" placeholder="请选择报废类型">
<el-option
v-for="dict in typeList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input
v-model="dataForm.remark"
clearable
placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../../core/mixins/basic-add';
import { createQualityScrapDet, updateQualityScrapDet, getQualityScrapDet, getCode } from "@/api/base/qualityScrapDet";
import { getList,} from "@/api/base/qualityScrapType";
// import { getMaterialList } from "@/api/base/material";
import {
createQualityScrapDet,
updateQualityScrapDet,
getQualityScrapDet,
getCode,
} from '@/api/base/qualityScrapDet';
import { getList } from '@/api/base/qualityScrapType';
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
codeURL: getCode,
createURL: createQualityScrapDet,
updateURL: updateQualityScrapDet,
infoURL: getQualityScrapDet,
},
typeList:[],
dataForm: {
id: undefined,
code: undefined,
content: undefined,
typeId:null,
// description: undefined,
remark: undefined,
isGetCode: true,
codeURL: getCode,
createURL: createQualityScrapDet,
updateURL: updateQualityScrapDet,
infoURL: getQualityScrapDet,
},
typeList: [],
dataForm: {
id: undefined,
code: undefined,
content: undefined,
typeId: null,
remark: undefined,
},
// materialList: [],
dataRule: {
// materialId: [{ required: true, message: "", trigger: "blur" }],
code: [{ required: true, message: "报废原因编码不能为空", trigger: "blur" }],
content: [{ required: true, message: "报废原因不能为空", trigger: "blur" }],
typeId: [{ required: true, message: "报废类型不能为空", trigger: "change" }],
}
code: [
{ required: true, message: '报废原因编码不能为空', trigger: 'blur' },
],
content: [
{ required: true, message: '报废原因不能为空', trigger: 'blur' },
],
typeId: [
{ required: true, message: '报废类型不能为空', trigger: 'change' },
],
},
};
},
mounted() {
this.getDict()
console.log('我看看', this.dataForm)
this.getDict();
},
methods: {
async getDict() {
//
const res = await getList();
//
const res = await getList();
this.typeList = res.data;
},
// setMaterialCode() {
// const chooseM = this.materialList.filter(item => {
// return item.id === this.dataForm.materialId
// })
// this.dataForm.materialCode = chooseM[0].code
// }
},
};
</script>

View File

@ -9,11 +9,12 @@
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
:table-data="tableData"
:max-height="tableH">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
@ -21,7 +22,7 @@
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
:total="total"
@pagination="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
@ -29,7 +30,7 @@
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="40%">
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
@ -46,32 +47,38 @@ import {
deleteQualityScrapDet,
} from '@/api/base/qualityScrapDet';
import { getList } from '@/api/base/qualityScrapType';
import tableHeightMixin from '@/mixins/tableHeightMixin';
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime,
width: 160,
},
{
prop: 'content',
label: '报废原因',
showOverflowtooltip: true,
},
{
prop: 'code',
label: '报废原因编码',
showOverflowtooltip: true,
},
{
prop: 'typeName',
label: '报废类型',
showOverflowtooltip: true,
},
{
prop: 'remark',
label: '备注',
showOverflowtooltip: true,
},
];
export default {
mixins: [basicPage],
mixins: [basicPage, tableHeightMixin],
data() {
return {
urlOptions: {
@ -109,6 +116,7 @@ export default {
labelField: 'name',
valueField: 'id',
param: 'typeId',
filterable: true,
},
{
type: 'button',
@ -129,6 +137,11 @@ export default {
plain: true,
},
],
listQuery: {
pageNo: 1,
pageSize: 20,
},
total: 0,
};
},
components: {
@ -144,7 +157,7 @@ export default {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.listQuery).then((response) => {
this.tableData = response.data.list;
this.listQuery.total = response.data.total;
this.total = response.data.total;
this.dataListLoading = false;
});
},
@ -157,20 +170,10 @@ export default {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.content = val.content ? val.content : undefined;
this.listQuery.typeId = val.typeId ? val.typeId : undefined;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;

View File

@ -55,7 +55,6 @@ import {
getQualityScrapType,
getCode,
} from '@/api/base/qualityScrapType';
// import { getMaterialList } from "@/api/base/material";
export default {
mixins: [basicAdd],
@ -75,9 +74,7 @@ export default {
description: undefined,
remark: undefined,
},
// materialList: [],
dataRule: {
// materialId: [{ required: true, message: "", trigger: "blur" }],
code: [
{ required: true, message: '报废类型编码不能为空', trigger: 'blur' },
],
@ -87,22 +84,5 @@ export default {
},
};
},
mounted() {
// this.getDict()
console.log('我看看', this.dataForm);
},
methods: {
// async getDict() {
// //
// const res = await getMaterialList();
// this.materialList = res.data;
// },
// setMaterialCode() {
// const chooseM = this.materialList.filter(item => {
// return item.id === this.dataForm.materialId
// })
// this.dataForm.materialCode = chooseM[0].code
// }
},
};
</script>

View File

@ -9,11 +9,12 @@
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
:table-data="tableData"
:max-height="tableH">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
@ -21,7 +22,7 @@
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
:total="total"
@pagination="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
@ -29,7 +30,7 @@
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="40%">
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
@ -45,33 +46,39 @@ import {
getQualityScrapTypePage,
deleteQualityScrapType,
} from '@/api/base/qualityScrapType';
import tableHeightMixin from '@/mixins/tableHeightMixin';
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime,
width: 160,
},
{
prop: 'name',
label: '报废类型',
showOverflowtooltip: true,
},
{
prop: 'code',
label: '报废类型编码',
showOverflowtooltip: true,
},
{
prop: 'description',
label: '描述信息',
showOverflowtooltip: true,
},
{
prop: 'remark',
label: '备注',
showOverflowtooltip: true,
},
];
export default {
mixins: [basicPage],
mixins: [basicPage, tableHeightMixin],
data() {
return {
urlOptions: {
@ -121,6 +128,11 @@ export default {
plain: true,
},
],
listQuery: {
pageNo: 1,
pageSize: 20,
},
total: 0,
};
},
components: {
@ -133,7 +145,7 @@ export default {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.listQuery).then((response) => {
this.tableData = response.data.list;
this.listQuery.total = response.data.total;
this.total = response.data.total;
this.dataListLoading = false;
});
},
@ -141,19 +153,9 @@ export default {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name ? val.name : undefined;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;

View File

@ -1,10 +1,3 @@
<!--
filename: index.vue
author: liubin
date: 2023-09-04 09:34:52
description: 设备效率分析
-->
<template>
<div class="app-container allow-overflow">
<!-- 搜索工作栏 -->
@ -15,10 +8,7 @@
<el-row>
<el-col class="custom-tabs">
<el-tabs
v-model="activeName"
:stretch="true"
@tab-click="handleTabClick">
<el-tabs v-model="activeName" :stretch="true">
<el-tab-pane :label="'\u2002数据列表\u2002'" name="table">
<!-- 列表 -->
<base-table
@ -27,7 +17,7 @@
:page="1"
:limit="10"
:table-data="list"
@emitFun="handleEmitFun"></base-table>
:max-height="tableH"></base-table>
</el-tab-pane>
<el-tab-pane
:label="'\u3000可视化\u3000'"
@ -74,7 +64,6 @@
v-for="item in list"
:key="item.id"
:value="item" />
<!-- <pie-chart v-for="item in 5" :key="item" :value="item" /> -->
</div>
</div>
</div>
@ -86,40 +75,43 @@
</template>
<script>
// import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import PieChart from './components/pieChart.vue';
import tableHeightMixin from '@/mixins/tableHeightMixin';
export default {
name: 'EfficiencyAnalysis',
mixins: [basicPageMixin],
mixins: [basicPageMixin, tableHeightMixin],
components: { PieChart },
props: {},
data() {
return {
activeName: 'table',
open: false,
visualizationOpen: false,
trendOpen: false,
// tableBtn: [
// this.$auth.hasPermi('base:equipment-group:update')
// ? {
// type: 'edit',
// btnName: '',
// }
// : undefined,
// this.$auth.hasPermi('base:equipment-group:delete')
// ? {
// type: 'delete',
// btnName: '',
// }
// : undefined,
// ].filter((v) => v),
tableProps: [
{ prop: 'factoryName', label: '工厂' },
{ prop: 'lineName', label: '产线' },
{ prop: 'sectionName', label: '工段' },
{ prop: 'equipmentName', label: '设备' },
{
prop: 'factoryName',
label: '工厂',
minWidth: 120,
showOverflowtooltip: true,
},
{
prop: 'lineName',
label: '产线',
minWidth: 120,
showOverflowtooltip: true,
},
{
prop: 'sectionName',
label: '工段',
minWidth: 120,
showOverflowtooltip: true,
},
{
prop: 'equipmentName',
label: '设备',
minWidth: 120,
showOverflowtooltip: true,
},
{
label: '有效时间',
children: [
@ -127,12 +119,13 @@ export default {
width: 128,
prop: 'workTime',
label: '工作时长[h]',
filter: (val) => (val != null ? +val.toFixed(2) : '-'),
},
{
width: 128,
prop: 'workRate',
label: '百分比[%]',
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
filter: (val) => (val != null ? +val.toFixed(2) : '-'),
},
],
},
@ -143,8 +136,14 @@ export default {
width: 128,
prop: 'stopTime',
label: '停机时长[h]',
filter: (val) => (val != null ? +val.toFixed(2) : '-'),
},
{
width: 128,
prop: 'stopRate',
label: '百分比[%]',
filter: (val) => (val != null ? +val.toFixed(2) : '-'),
},
{ width: 128, prop: 'stopRate', label: '百分比[%]' },
],
},
{
@ -154,14 +153,19 @@ export default {
width: 128,
prop: 'downTime',
label: '故障时长[h]',
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
filter: (val) => (val != null ? +val.toFixed(2) : '-'),
},
{
width: 128,
prop: 'downRate',
label: '百分比[%]',
filter: (val) => (val != null ? +val.toFixed(2) : '-'),
},
{ width: 128, prop: 'downRate', label: '百分比[%]' },
{
width: 128,
prop: 'timeEfficiency',
label: '时间开动率',
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
filter: (val) => (val != null ? +val.toFixed(2) : '-'),
},
],
},
@ -172,87 +176,31 @@ export default {
width: 128,
prop: 'realProcSpeed',
label: '实际加工速度',
filter: (val) => (val != null ? +val.toFixed(2) : '-'),
},
{
width: 128,
prop: 'designProcSpeed',
label: '理论加工速度',
filter: (val) => (val != null ? +val.toFixed(2) : '-'),
},
{
width: 128,
prop: 'peEfficiency',
label: '速度开动率',
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
filter: (val) => (val != null ? +val.toFixed(2) : '-'),
},
],
},
// {
// prop: 'oee',
// label: 'OEE',
// filter: (val) => (val != null ? +val.toFixed(3) : '-'),
// },
// {
// prop: 'teep',
// label: 'TEEP',
// filter: (val) => (val != null ? +val.toFixed(3) : '-'),
// },
// {
// _action: 'view-trend',
// label: '',
// ,
// subcomponent: {
// props: ['injectData'],
// render: function (h) {
// const _this = this;
// return h(
// 'el-button',
// {
// props: { type: 'text' },
// on: {
// click: function () {
// console.log('inejctdata', _this.injectData);
// _this.$emit('emitData', {
// action: _this.injectData._action,
// // value: _this.injectData.id,
// value: _this.injectData,
// });
// },
// },
// },
// ''
// );
// },
// },
// },
],
searchBarFormConfig: [
{
type: 'select',
label: '工单',
placeholder: '请选择工单',
label: '工单名称',
param: 'workOrderId',
selectOptions: [],
filterable: true,
},
// {
// type: 'select',
// label: '线',
// placeholder: '线',
// param: 'lineId',
// selectOptions: [],
// },
//
// {
// type: 'select',
// label: '',
// param: 'dateFilterType',
// defaultSelect: 0,
// selectOptions: [
// { id: 0, name: '' },
// { id: 1, name: '' },
// ],
// index: 2,
// extraOptions: [
{
// parent: 'dateFilterType',
//
@ -265,21 +213,8 @@ export default {
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timerange',
param: 'recordTime',
},
// {
// parent: 'dateFilterType',
// //
// type: 'datePicker',
// // label: '',
// dateType: 'date',
// placeholder: '',
// format: 'yyyy-MM-dd',
// valueFormat: 'yyyy-MM-dd',
// param: 'timeday',
// },
// ],
// },
{
type: 'button',
btnName: '查询',
@ -296,26 +231,9 @@ export default {
plain: true,
color: 'success',
},
// {
// type: 'button',
// btnName: 'OEE',
// name: 'add',
// plain: true,
// color: 'success',
// },
// {
// type: 'button',
// btnName: 'TEEP',
// name: 'add',
// plain: true,
// color: 'warning',
// },
],
//
open: false,
//
queryParams: {
// lineId: null,
workOrderId: null,
recordTime: [],
},
@ -326,19 +244,16 @@ export default {
},
created() {
this.getWorkOrder();
// this.getLine();
this.getList();
},
methods: {
/** 准备工厂数据 */
async getWorkOrder() {
console.log(1111);
const { code, data } = await this.$axios({
url: '/base/core-work-order/listbyfilter',
method: 'get',
});
if (code == 0) {
console.log('1111', data);
this.searchBarFormConfig[0].selectOptions = data.map((item) => {
return {
name: item.name,
@ -347,33 +262,6 @@ export default {
});
}
},
// /** 线 */
// async getLine() {
// const { code, data } = await this.$axios({
// url: '/base/production-line/listAll',
// method: 'get',
// });
// if (code == 0) {
// this.searchBarFormConfig[1].selectOptions = data.map((item) => {
// return {
// name: item.name,
// id: item.id,
// };
// });
// }
// },
/** 覆盖 handleEmitFun 的默认实现 */
handleEmitFun({ action, value }) {
switch (action) {
case 'view-trend':
const { id } = value;
this.open = true;
this.trendOpen = true;
break;
}
},
/** 查询列表 */
async getList() {
this.loading = true;
@ -388,41 +276,17 @@ export default {
},
handleSearchBarBtnClick({ btnName, ...payload }) {
console.log('handleSearchBarBtnClick', btnName, payload);
if (btnName == 'visualization') {
//
this.visualizationOpen = true;
this.open = true;
}
console.log(btnName);
console.log(payload);
if (btnName == 'search') {
this.queryParams.workOrderId = payload.workOrderId || null;
// this.queryParams.lineId = payload.lineId || null;
if (0 == payload.dateFilterType) {
this.queryParams.recordTime = payload.timerange;
} else if (1 == payload.dateFilterType) {
this.queryParams.recordTime = [
`${payload.timeday} 00:00:00`,
`${payload.timeday} 23:59:59`,
];
}
this.queryParams.recordTime = payload.recordTime || undefined;
this.getList();
} else {
this.queryParams.recordTime = null;
console.log('导出');
}
this.getList();
},
cancel() {
this.open = false;
},
closed() {
this.visualizationOpen = false;
this.trendOpen = false;
},
submitForm() {},
handleTabClick() {},
},
};
</script>

View File

@ -1,10 +1,3 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 14:55:51
* @LastEditors: zhp
* @LastEditTime: 2023-11-24 10:55:54
* @Description:
-->
<template>
<div class="app-container">
<search-bar
@ -15,59 +8,62 @@
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="list">
<!-- <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
@clickBtn="handleClick" /> -->
</base-table>
:table-data="list"
:max-height="tableH"></base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getList" />
<!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> -->
</div>
</template>
<script>
// import AddOrUpdate from './add-or-updata';
// import unitDict from './unitDict';
// import basicPage from '../mixins/basic-page';
import { parseTime } from '../mixins/code-filter';
import {
getMaterialUseLogPage,
getWorkOrderList,
exportEnergyPlcExcel,
} from '@/api/quality/materialTraceability';
import tableHeightMixin from '@/mixins/tableHeightMixin';
const tableProps = [
{
prop: 'materialName',
label: '物料名称',
showOverflowtooltip: true,
},
{
prop: 'materialCode',
label: '物料编码',
showOverflowtooltip: true,
minWidth: 120,
},
{
prop: 'dateName',
label: '物料批次',
showOverflowtooltip: true,
},
{
prop: 'equipName',
label: '使用设备',
showOverflowtooltip: true,
},
{
prop: 'num',
label: '使用数量',
showOverflowtooltip: true,
},
{
prop: 'useTime',
label: '使用时间',
filter: parseTime,
width: 160,
},
{
prop: 'userName',
label: '操作人',
showOverflowtooltip: true,
},
{
prop: 'source',
@ -77,18 +73,15 @@ const tableProps = [
{
prop: 'remark',
label: '备注',
showOverflowtooltip: true,
},
];
export default {
// mixins: [basicPage],
mixins: [tableHeightMixin],
data() {
return {
// urlOptions: {
// getDataListURL: getMaterialUseLogPage,
// // deleteURL: deletePackingType,
// // exportURL: exportPackingExcel,
// },
heightNum: 220,
tableProps,
tableBtn: [
this.$auth.hasPermi(`base:packaging-print-log:update`)
@ -116,7 +109,7 @@ export default {
formConfig: [
{
type: 'select',
label: '工单',
label: '工单名称',
selectOptions: [],
labelField: 'name',
valueField: 'id',
@ -144,28 +137,6 @@ export default {
{
type: 'separate',
},
// {
// type: 'separate',
// },
// {
// type: 'button',
// btnName: '',
// name: 'reset',
// },
// {
// type: 'separate',
// },
// {
// type: this.$auth.hasPermi('base:packaging-print-log:create') ? 'button' : '',
// btnName: '',
// name: 'add',
// color: 'success',
// plain: true,
// },
// {
// type: 'separate',
// type: this.$auth.hasPermi('base:product:create') ? 'separate' : '',
// },
{
type: this.$auth.hasPermi('monitoring:materiel-date-from:export')
? 'button'
@ -193,19 +164,7 @@ export default {
});
},
getDict() {
//
// getCustomerList().then((response) => {
// console.log(response);
// this.customerList = response.data
// // this.listQuery.total = response.data.total;
// })
// getModelList().then((response) => {
// console.log(response);
// this.modelList = response.data
// // this.listQuery.total = response.data.total;
// })
getWorkOrderList().then((response) => {
// console.log(response);
this.formConfig[0].selectOptions = response.data.map((item) => {
return {
name: item.name,
@ -213,7 +172,6 @@ export default {
};
});
console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
});
},
handleExport() {
@ -239,7 +197,6 @@ export default {
this.listQuery.workOrderId = val.workOrderId
? val.workOrderId
: undefined;
// this.queryParams.status = val.status
if (val.timeVal && val.timeVal.length != 0) {
this.listQuery.startTime = val.timeVal[0] + ' 00:00:00';
this.listQuery.endTime = val.timeVal[1] + ' 23:59:59';
@ -250,11 +207,6 @@ export default {
this.getList();
} else {
this.handleExport();
// this.addOrEditTitle = ''
// this.centervisible = true
// this.$nextTick(() => {
// this.$refs.orderAdd.init()
// })
}
},
otherMethods(val) {

View File

@ -1,10 +1,3 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 14:55:51
* @LastEditors: zhp
* @LastEditTime: 2023-11-28 10:51:44
* @Description:
-->
<template>
<div class="app-container">
<search-bar
@ -15,7 +8,8 @@
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="list">
:table-data="list"
:max-height="tableH">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
@ -29,34 +23,35 @@
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getList" />
<!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> -->
</div>
</template>
<script>
// import AddOrUpdate from './add-or-updata';
// import unitDict from './unitDict';
// import basicPage from '../mixins/basic-page';
import { parseTime } from '../mixins/code-filter';
import {
getProcessTraceabilityPage,
getWorkOrderList,
getCoreProduct,
// exportEnergyPlcExcel
} from '@/api/quality/processTraceability';
import { publicFormatter } from '@/utils/dict';
import tableHeightMixin from '@/mixins/tableHeightMixin';
const tableProps = [
{
prop: 'name',
label: '工单名称',
showOverflowtooltip: true,
minWidth: 120,
},
{
prop: 'code',
label: '工单编码',
showOverflowtooltip: true,
minWidth: 120,
},
{
prop: 'planProductName',
label: '产品名',
showOverflowtooltip: true,
},
{
prop: 'status',
@ -76,11 +71,13 @@ const tableProps = [
prop: 'startProduceTime',
label: '开始生产时间',
filter: parseTime,
width: 160,
},
{
prop: 'finishProduceTime',
label: '结束生产时间',
filter: parseTime,
width: 160,
},
{
prop: 'actualQuantity',
@ -91,33 +88,25 @@ const tableProps = [
label: '单位',
filter: publicFormatter('unit_dict'),
},
{
prop: 'processFlowName',
label: '工艺名称',
},
{
prop: 'yield',
label: '合格率',
filter: (val) => (val ? val.toFixed(2) + '%' : '-'),
align: 'center',
},
{
prop: 'processFlowName',
label: '工艺名称',
showOverflowtooltip: true,
},
];
export default {
// mixins: [basicPage],
mixins: [tableHeightMixin],
data() {
return {
// urlOptions: {
// getDataListURL: getMaterialUseLogPage,
// // deleteURL: deletePackingType,
// // exportURL: exportPackingExcel,
// },
tableProps,
tableBtn: [
// this.$auth.hasPermi(`base:packaging-print-log:update`)
// ? {
// type: 'edit',
// btnName: '',
// }
// : undefined,
{
type: 'processDetail',
btnName: '查看工艺详情',
@ -127,10 +116,6 @@ export default {
listQuery: {
pageSize: 10,
pageNo: 1,
// total: 0,
// orderName: '',
// startTime: undefined,
// endTime:undefined,
},
formConfig: [
{
@ -161,40 +146,9 @@ export default {
name: 'search',
color: 'primary',
},
// {
// type: 'separate',
// },
// {
// type: 'button',
// btnName: '',
// name: 'reset',
// },
// {
// type: 'separate',
// },
// {
// type: this.$auth.hasPermi('base:packaging-print-log:create') ? 'button' : '',
// btnName: '',
// name: 'add',
// color: 'success',
// plain: true,
// },
// {
// type: 'separate',
// type: this.$auth.hasPermi('base:product:create') ? 'separate' : '',
// },
// {
// type: this.$auth.hasPermi('monitoring:materiel-date-from:export') ? 'button' : '',
// btnName: '',
// name: 'export',
// color: 'warning',
// },
],
};
},
components: {
// AddOrUpdate,
},
created() {
this.getList();
this.getDict();
@ -222,29 +176,13 @@ export default {
specifications: res.data.specifications,
productName: val.data.planProductName,
processFlowName: val.data.processFlowName,
// planProductId: val.data.planProductId
// equipmentName,
},
});
});
// this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex)
}
},
getDict() {
//
// getCustomerList().then((response) => {
// console.log(response);
// this.customerList = response.data
// // this.listQuery.total = response.data.total;
// })
// getModelList().then((response) => {
// console.log(response);
// this.modelList = response.data
// // this.listQuery.total = response.data.total;
// })
getWorkOrderList().then((response) => {
// console.log(response);
this.formConfig[0].selectOptions = response.data.map((item) => {
return {
name: item.name,
@ -252,27 +190,12 @@ export default {
};
});
console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
});
},
// handleExport() {
// //
// let params = { ...this.listQuery };
// params.pageNo = undefined;
// params.pageSize = undefined;
// this.$modal.confirm('?').then(() => {
// this.exportLoading = true;
// return exportEnergyPlcExcel(params);
// }).then(response => {
// this.$download.excel(response, ' ');
// this.exportLoading = false;
// }).catch(() => { });
// },
buttonClick(val) {
console.log(val);
if (val.btnName === 'search') {
this.listQuery.orderName = val.orderName ? val.orderName : undefined;
// this.queryParams.status = val.status
if (val.timeVal && val.timeVal.length != 0) {
this.listQuery.startTime = val.timeVal[0] + ' 00:00:00';
this.listQuery.endTime = val.timeVal[1] + ' 23:59:59';
@ -281,13 +204,6 @@ export default {
this.listQuery.endTime = undefined;
}
this.getList();
} else {
// this.handleExport()
// this.addOrEditTitle = ''
// this.centervisible = true
// this.$nextTick(() => {
// this.$refs.orderAdd.init()
// })
}
},
otherMethods(val) {

View File

@ -1,10 +1,3 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 14:55:51
* @LastEditors: zhp
* @LastEditTime: 2023-11-10 16:26:45
* @Description:
-->
<template>
<div class="app-container">
<search-bar
@ -15,30 +8,24 @@
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="list">
<!-- <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
@clickBtn="handleClick" /> -->
</base-table>
:table-data="list"
:max-height="tableH"></base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
:total="total"
@pagination="getList" />
<!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> -->
</div>
</template>
<script>
// import AddOrUpdate from './add-or-updata';
// import unitDict from './unitDict';
// import basicPage from '../mixins/basic-page';
import { publicFormatter } from '@/utils/dict';
import { parseTime } from '../mixins/code-filter';
import {
getRawMaterialPage,
getWorkOrderList,
// exportEnergyPlcExcel
} from '@/api/quality/rawMaterialTraceability';
import tableHeightMixin from '@/mixins/tableHeightMixin';
const tableProps = [
{
@ -51,6 +38,7 @@ const tableProps = [
prop: 'material',
label: '原料名称',
filter: publicFormatter('material'),
showOverflowtooltip: true,
},
{
prop: 'origin',
@ -58,12 +46,13 @@ const tableProps = [
filter: (val) => (val == 1 ? '内部' : '外部'),
},
{
prop: 'supplierId',
prop: 'supplierName',
label: '供应商',
},
{
prop: 'batch',
label: '批次',
showOverflowtooltip: true,
},
{
prop: 'num',
@ -77,14 +66,9 @@ const tableProps = [
];
export default {
// mixins: [basicPage],
mixins: [tableHeightMixin],
data() {
return {
// urlOptions: {
// getDataListURL: getMaterialUseLogPage,
// // deleteURL: deletePackingType,
// // exportURL: exportPackingExcel,
// },
tableProps,
tableBtn: [
this.$auth.hasPermi(`base:packaging-print-log:update`)
@ -104,73 +88,29 @@ export default {
listQuery: {
pageSize: 10,
pageNo: 1,
total: 0,
workOrderId: undefined,
startTime: undefined,
endTime: undefined,
},
total: 0,
formConfig: [
{
type: 'select',
label: '工单',
label: '工单名称',
selectOptions: [],
labelField: 'name',
valueField: 'id',
param: 'workOrderId',
},
// {
// type: 'datePicker',
// label: '',
// dateType: 'daterange',
// format: 'yyyy-MM-dd',
// valueFormat: "yyyy-MM-dd",
// rangeSeparator: '-',
// startPlaceholder: '',
// endPlaceholder: '',
// param: 'timeVal',
// defaultSelect: [],
// width: 250
// },
{
type: 'button',
btnName: '搜索',
btnName: '查询',
name: 'search',
color: 'primary',
},
// {
// type: 'separate',
// },
// {
// type: 'button',
// btnName: '',
// name: 'reset',
// },
// {
// type: 'separate',
// },
// {
// type: this.$auth.hasPermi('base:packaging-print-log:create') ? 'button' : '',
// btnName: '',
// name: 'add',
// color: 'success',
// plain: true,
// },
// {
// type: 'separate',
// type: this.$auth.hasPermi('base:product:create') ? 'separate' : '',
// },
// {
// type: this.$auth.hasPermi('monitoring:materiel-date-from:export') ? 'button' : '',
// btnName: '',
// name: 'export',
// color: 'warning',
// },
],
};
},
components: {
// AddOrUpdate,
},
created() {
this.getList();
this.getDict();
@ -179,23 +119,11 @@ export default {
getList() {
getRawMaterialPage({ ...this.listQuery }).then((res) => {
this.list = res.data.records || [];
this.listQuery.total = res.data.total || 0;
this.total = res.data.total || 0;
});
},
getDict() {
//
// getCustomerList().then((response) => {
// console.log(response);
// this.customerList = response.data
// // this.listQuery.total = response.data.total;
// })
// getModelList().then((response) => {
// console.log(response);
// this.modelList = response.data
// // this.listQuery.total = response.data.total;
// })
getWorkOrderList().then((response) => {
// console.log(response);
this.formConfig[0].selectOptions = response.data.map((item) => {
return {
name: item.name,
@ -203,44 +131,15 @@ export default {
};
});
console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
});
},
// handleExport() {
// //
// let params = { ...this.listQuery };
// params.pageNo = undefined;
// params.pageSize = undefined;
// this.$modal.confirm('?').then(() => {
// this.exportLoading = true;
// return exportEnergyPlcExcel(params);
// }).then(response => {
// this.$download.excel(response, ' ');
// this.exportLoading = false;
// }).catch(() => { });
// },
buttonClick(val) {
console.log(val);
if (val.btnName === 'search') {
this.listQuery.workOrderId = val.workOrderId
? val.workOrderId
: undefined;
// this.queryParams.status = val.status
// if (val.timeVal && val.timeVal.length != 0 ) {
// this.listQuery.startTime = val.timeVal[0] + ' 00:00:00'
// this.listQuery.endTime = val.timeVal[1] + ' 23:59:59'
// } else {
// this.listQuery.startTime = undefined
// this.listQuery.endTime = undefined
// }
this.getList();
} else {
// this.handleExport()
// this.addOrEditTitle = ''
// this.centervisible = true
// this.$nextTick(() => {
// this.$refs.orderAdd.init()
// })
}
},
otherMethods(val) {

View File

@ -12,7 +12,8 @@
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-data="list"
@emitFun="handleEmitFun">
@emitFun="handleEmitFun"
:max-height="tableH">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
@ -58,19 +59,19 @@ import moment from 'moment';
import DialogForm from './dialogForm.vue';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import tableHeightMixin from '@/mixins/tableHeightMixin';
export default {
name: 'QualityInspectionRecord',
components: {
DialogForm,
},
mixins: [basicPageMixin],
mixins: [basicPageMixin, tableHeightMixin],
data() {
return {
searchBarFormConfig: [
{
type: 'select',
label: '工单名称',
placeholder: '请选择工单名称',
param: 'workOrderId',
selectOptions: [],
filterable: true,
@ -78,7 +79,6 @@ export default {
{
type: 'select',
label: '检测内容',
placeholder: '请输入检测内容',
selectOptions: [],
param: 'inspectionDetContent',
filterable: true,
@ -134,32 +134,31 @@ export default {
{
prop: 'createTime',
label: '添加时间',
fixed: true,
width: 180,
width: 160,
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
},
{
// width: 128,
prop: 'workOrderName',
label: '工单名称',
showOverflowtooltip: true,
},
{
// width: 128,
prop: 'inspectionDetContent',
label: '检测内容',
showOverflowtooltip: true,
},
{
// width: 128,
prop: 'productionLineName',
label: '产线',
showOverflowtooltip: true,
},
{
// width: 128,
prop: 'checkPerson',
label: '检测人员',
showOverflowtooltip: true,
},
{
// width: 160,
width: 160,
prop: 'checkTime',
label: '检测时间',
filter: (val) =>
@ -190,7 +189,7 @@ export default {
//
queryParams: {
pageNo: 1,
pageSize: 10,
pageSize: 20,
workOrderId: null,
inspectionDetContent: null,
checkTime: [],

View File

@ -9,11 +9,12 @@
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
:table-data="tableData"
:max-height="tableH">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
:width="110"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
@ -21,7 +22,7 @@
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
:total="total"
@pagination="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
@ -61,29 +62,35 @@ import {
getWorkOrderList,
getTeamList,
} from '@/api/base/qualityScrapLog';
import tableHeightMixin from '@/mixins/tableHeightMixin';
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime,
width: 160,
},
{
prop: 'workOrderName',
label: '工单',
showOverflowtooltip: true,
},
{
prop: 'teamId',
prop: 'teamName',
label: '班组',
showOverflowtooltip: true,
},
{
prop: 'detContent',
label: '报废原因',
showOverflowtooltip: true,
},
{
prop: 'logTime',
label: '报废时间',
filter: parseTime,
width: 160,
},
{
prop: 'num',
@ -92,7 +99,7 @@ const tableProps = [
];
export default {
mixins: [basicPage],
mixins: [basicPage, tableHeightMixin],
data() {
return {
urlOptions: {
@ -159,6 +166,12 @@ export default {
plain: true,
},
],
listQuery: {
pageNo: 1,
pageSize: 20,
},
total: 0,
teamList: [],
showDetail: false,
};
},
@ -181,35 +194,34 @@ export default {
//
getDict() {
getWorkOrderList().then((res) => {
console.log(res);
// console.log(response);
this.formConfig[0].selectOptions = res.data.map((item) => {
return {
name: item.name,
id: item.id,
};
});
// console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
});
getTeamList().then((res) => {
console.log(res);
// console.log(response);
this.formConfig[1].selectOptions = res.data.map((item) => {
return {
name: item.name,
id: item.id,
};
});
// console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
this.teamList = res.data;
});
},
getDataList() {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.listQuery).then((response) => {
this.tableData = response.data.list;
this.listQuery.total = response.data.total;
let arr = response.data.list;
arr.forEach((item) => {
item.teamName = this.teamList.find((v) => v.id == item.teamId)
? this.teamList.find((v) => v.id == item.teamId).name
: '';
});
this.tableData = arr;
this.total = response.data.total;
this.dataListLoading = false;
});
},
@ -217,22 +229,12 @@ export default {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.workOrderId = val.workOrderId
? val.workOrderId
: undefined;
this.listQuery.teamId = val.teamId ? val.teamId : undefined;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;