质量管理

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -55,7 +55,6 @@ import {
getQualityScrapType, getQualityScrapType,
getCode, getCode,
} from '@/api/base/qualityScrapType'; } from '@/api/base/qualityScrapType';
// import { getMaterialList } from "@/api/base/material";
export default { export default {
mixins: [basicAdd], mixins: [basicAdd],
@ -75,9 +74,7 @@ export default {
description: undefined, description: undefined,
remark: undefined, remark: undefined,
}, },
// materialList: [],
dataRule: { dataRule: {
// materialId: [{ required: true, message: "", trigger: "blur" }],
code: [ code: [
{ required: true, message: '报废类型编码不能为空', trigger: 'blur' }, { 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> </script>

View File

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

View File

@ -1,10 +1,3 @@
<!--
filename: index.vue
author: liubin
date: 2023-09-04 09:34:52
description: 设备效率分析
-->
<template> <template>
<div class="app-container allow-overflow"> <div class="app-container allow-overflow">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
@ -15,10 +8,7 @@
<el-row> <el-row>
<el-col class="custom-tabs"> <el-col class="custom-tabs">
<el-tabs <el-tabs v-model="activeName" :stretch="true">
v-model="activeName"
:stretch="true"
@tab-click="handleTabClick">
<el-tab-pane :label="'\u2002数据列表\u2002'" name="table"> <el-tab-pane :label="'\u2002数据列表\u2002'" name="table">
<!-- 列表 --> <!-- 列表 -->
<base-table <base-table
@ -27,7 +17,7 @@
:page="1" :page="1"
:limit="10" :limit="10"
:table-data="list" :table-data="list"
@emitFun="handleEmitFun"></base-table> :max-height="tableH"></base-table>
</el-tab-pane> </el-tab-pane>
<el-tab-pane <el-tab-pane
:label="'\u3000可视化\u3000'" :label="'\u3000可视化\u3000'"
@ -74,7 +64,6 @@
v-for="item in list" v-for="item in list"
:key="item.id" :key="item.id"
:value="item" /> :value="item" />
<!-- <pie-chart v-for="item in 5" :key="item" :value="item" /> -->
</div> </div>
</div> </div>
</div> </div>
@ -86,40 +75,43 @@
</template> </template>
<script> <script>
// import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import PieChart from './components/pieChart.vue'; import PieChart from './components/pieChart.vue';
import tableHeightMixin from '@/mixins/tableHeightMixin';
export default { export default {
name: 'EfficiencyAnalysis', name: 'EfficiencyAnalysis',
mixins: [basicPageMixin], mixins: [basicPageMixin, tableHeightMixin],
components: { PieChart }, components: { PieChart },
props: {}, props: {},
data() { data() {
return { return {
activeName: 'table', 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: [ tableProps: [
{ prop: 'factoryName', label: '工厂' }, {
{ prop: 'lineName', label: '产线' }, prop: 'factoryName',
{ prop: 'sectionName', label: '工段' }, label: '工厂',
{ prop: 'equipmentName', 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: '有效时间', label: '有效时间',
children: [ children: [
@ -127,12 +119,13 @@ export default {
width: 128, width: 128,
prop: 'workTime', prop: 'workTime',
label: '工作时长[h]', label: '工作时长[h]',
filter: (val) => (val != null ? +val.toFixed(2) : '-'),
}, },
{ {
width: 128, width: 128,
prop: 'workRate', prop: 'workRate',
label: '百分比[%]', label: '百分比[%]',
filter: (val) => (val != null ? +val.toFixed(3) : '-'), filter: (val) => (val != null ? +val.toFixed(2) : '-'),
}, },
], ],
}, },
@ -143,8 +136,14 @@ export default {
width: 128, width: 128,
prop: 'stopTime', prop: 'stopTime',
label: '停机时长[h]', 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, width: 128,
prop: 'downTime', prop: 'downTime',
label: '故障时长[h]', 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, width: 128,
prop: 'timeEfficiency', prop: 'timeEfficiency',
label: '时间开动率', label: '时间开动率',
filter: (val) => (val != null ? +val.toFixed(3) : '-'), filter: (val) => (val != null ? +val.toFixed(2) : '-'),
}, },
], ],
}, },
@ -172,87 +176,31 @@ export default {
width: 128, width: 128,
prop: 'realProcSpeed', prop: 'realProcSpeed',
label: '实际加工速度', label: '实际加工速度',
filter: (val) => (val != null ? +val.toFixed(2) : '-'),
}, },
{ {
width: 128, width: 128,
prop: 'designProcSpeed', prop: 'designProcSpeed',
label: '理论加工速度', label: '理论加工速度',
filter: (val) => (val != null ? +val.toFixed(2) : '-'),
}, },
{ {
width: 128, width: 128,
prop: 'peEfficiency', prop: 'peEfficiency',
label: '速度开动率', 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: [ searchBarFormConfig: [
{ {
type: 'select', type: 'select',
label: '工单', label: '工单名称',
placeholder: '请选择工单',
param: 'workOrderId', param: 'workOrderId',
selectOptions: [], selectOptions: [],
filterable: true, 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', // parent: 'dateFilterType',
// //
@ -265,21 +213,8 @@ export default {
rangeSeparator: '-', rangeSeparator: '-',
startPlaceholder: '开始时间', startPlaceholder: '开始时间',
endPlaceholder: '结束时间', 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', type: 'button',
btnName: '查询', btnName: '查询',
@ -296,26 +231,9 @@ export default {
plain: true, plain: true,
color: 'success', 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: { queryParams: {
// lineId: null,
workOrderId: null, workOrderId: null,
recordTime: [], recordTime: [],
}, },
@ -326,19 +244,16 @@ export default {
}, },
created() { created() {
this.getWorkOrder(); this.getWorkOrder();
// this.getLine();
this.getList(); this.getList();
}, },
methods: { methods: {
/** 准备工厂数据 */ /** 准备工厂数据 */
async getWorkOrder() { async getWorkOrder() {
console.log(1111);
const { code, data } = await this.$axios({ const { code, data } = await this.$axios({
url: '/base/core-work-order/listbyfilter', url: '/base/core-work-order/listbyfilter',
method: 'get', method: 'get',
}); });
if (code == 0) { if (code == 0) {
console.log('1111', data);
this.searchBarFormConfig[0].selectOptions = data.map((item) => { this.searchBarFormConfig[0].selectOptions = data.map((item) => {
return { return {
name: item.name, 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() { async getList() {
this.loading = true; this.loading = true;
@ -388,41 +276,17 @@ export default {
}, },
handleSearchBarBtnClick({ btnName, ...payload }) { handleSearchBarBtnClick({ btnName, ...payload }) {
console.log('handleSearchBarBtnClick', btnName, payload); console.log(btnName);
if (btnName == 'visualization') { console.log(payload);
//
this.visualizationOpen = true;
this.open = true;
}
if (btnName == 'search') { if (btnName == 'search') {
this.queryParams.workOrderId = payload.workOrderId || null; this.queryParams.workOrderId = payload.workOrderId || null;
// this.queryParams.lineId = payload.lineId || null; this.queryParams.recordTime = payload.recordTime || undefined;
if (0 == payload.dateFilterType) { this.getList();
this.queryParams.recordTime = payload.timerange;
} else if (1 == payload.dateFilterType) {
this.queryParams.recordTime = [
`${payload.timeday} 00:00:00`,
`${payload.timeday} 23:59:59`,
];
}
} else { } else {
this.queryParams.recordTime = null; this.queryParams.recordTime = null;
console.log('导出');
} }
this.getList();
}, },
cancel() {
this.open = false;
},
closed() {
this.visualizationOpen = false;
this.trendOpen = false;
},
submitForm() {},
handleTabClick() {},
}, },
}; };
</script> </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> <template>
<div class="app-container"> <div class="app-container">
<search-bar <search-bar
@ -15,59 +8,62 @@
:table-props="tableProps" :table-props="tableProps"
:page="listQuery.pageNo" :page="listQuery.pageNo"
:limit="listQuery.pageSize" :limit="listQuery.pageSize"
:table-data="list"> :table-data="list"
<!-- <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn" :max-height="tableH"></base-table>
@clickBtn="handleClick" /> -->
</base-table>
<pagination <pagination
:limit.sync="listQuery.pageSize" :limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo" :page.sync="listQuery.pageNo"
:total="listQuery.total" :total="listQuery.total"
@pagination="getList" /> @pagination="getList" />
<!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> -->
</div> </div>
</template> </template>
<script> <script>
// import AddOrUpdate from './add-or-updata';
// import unitDict from './unitDict';
// import basicPage from '../mixins/basic-page';
import { parseTime } from '../mixins/code-filter'; import { parseTime } from '../mixins/code-filter';
import { import {
getMaterialUseLogPage, getMaterialUseLogPage,
getWorkOrderList, getWorkOrderList,
exportEnergyPlcExcel, exportEnergyPlcExcel,
} from '@/api/quality/materialTraceability'; } from '@/api/quality/materialTraceability';
import tableHeightMixin from '@/mixins/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'materialName', prop: 'materialName',
label: '物料名称', label: '物料名称',
showOverflowtooltip: true,
}, },
{ {
prop: 'materialCode', prop: 'materialCode',
label: '物料编码', label: '物料编码',
showOverflowtooltip: true,
minWidth: 120,
}, },
{ {
prop: 'dateName', prop: 'dateName',
label: '物料批次', label: '物料批次',
showOverflowtooltip: true,
}, },
{ {
prop: 'equipName', prop: 'equipName',
label: '使用设备', label: '使用设备',
showOverflowtooltip: true,
}, },
{ {
prop: 'num', prop: 'num',
label: '使用数量', label: '使用数量',
showOverflowtooltip: true,
}, },
{ {
prop: 'useTime', prop: 'useTime',
label: '使用时间', label: '使用时间',
filter: parseTime, filter: parseTime,
width: 160,
}, },
{ {
prop: 'userName', prop: 'userName',
label: '操作人', label: '操作人',
showOverflowtooltip: true,
}, },
{ {
prop: 'source', prop: 'source',
@ -77,18 +73,15 @@ const tableProps = [
{ {
prop: 'remark', prop: 'remark',
label: '备注', label: '备注',
showOverflowtooltip: true,
}, },
]; ];
export default { export default {
// mixins: [basicPage], mixins: [tableHeightMixin],
data() { data() {
return { return {
// urlOptions: { heightNum: 220,
// getDataListURL: getMaterialUseLogPage,
// // deleteURL: deletePackingType,
// // exportURL: exportPackingExcel,
// },
tableProps, tableProps,
tableBtn: [ tableBtn: [
this.$auth.hasPermi(`base:packaging-print-log:update`) this.$auth.hasPermi(`base:packaging-print-log:update`)
@ -116,7 +109,7 @@ export default {
formConfig: [ formConfig: [
{ {
type: 'select', type: 'select',
label: '工单', label: '工单名称',
selectOptions: [], selectOptions: [],
labelField: 'name', labelField: 'name',
valueField: 'id', valueField: 'id',
@ -144,28 +137,6 @@ export default {
{ {
type: 'separate', 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') type: this.$auth.hasPermi('monitoring:materiel-date-from:export')
? 'button' ? 'button'
@ -193,19 +164,7 @@ export default {
}); });
}, },
getDict() { 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) => { getWorkOrderList().then((response) => {
// console.log(response);
this.formConfig[0].selectOptions = response.data.map((item) => { this.formConfig[0].selectOptions = response.data.map((item) => {
return { return {
name: item.name, name: item.name,
@ -213,7 +172,6 @@ export default {
}; };
}); });
console.log(this.formConfig[0].selectOptions); console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
}); });
}, },
handleExport() { handleExport() {
@ -239,7 +197,6 @@ export default {
this.listQuery.workOrderId = val.workOrderId this.listQuery.workOrderId = val.workOrderId
? val.workOrderId ? val.workOrderId
: undefined; : undefined;
// this.queryParams.status = val.status
if (val.timeVal && val.timeVal.length != 0) { if (val.timeVal && val.timeVal.length != 0) {
this.listQuery.startTime = val.timeVal[0] + ' 00:00:00'; this.listQuery.startTime = val.timeVal[0] + ' 00:00:00';
this.listQuery.endTime = val.timeVal[1] + ' 23:59:59'; this.listQuery.endTime = val.timeVal[1] + ' 23:59:59';
@ -250,11 +207,6 @@ export default {
this.getList(); this.getList();
} else { } else {
this.handleExport(); this.handleExport();
// this.addOrEditTitle = ''
// this.centervisible = true
// this.$nextTick(() => {
// this.$refs.orderAdd.init()
// })
} }
}, },
otherMethods(val) { 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> <template>
<div class="app-container"> <div class="app-container">
<search-bar <search-bar
@ -15,7 +8,8 @@
:table-props="tableProps" :table-props="tableProps"
:page="listQuery.pageNo" :page="listQuery.pageNo"
:limit="listQuery.pageSize" :limit="listQuery.pageSize"
:table-data="list"> :table-data="list"
:max-height="tableH">
<method-btn <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
@ -29,34 +23,35 @@
:page.sync="listQuery.pageNo" :page.sync="listQuery.pageNo"
:total="listQuery.total" :total="listQuery.total"
@pagination="getList" /> @pagination="getList" />
<!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> -->
</div> </div>
</template> </template>
<script> <script>
// import AddOrUpdate from './add-or-updata';
// import unitDict from './unitDict';
// import basicPage from '../mixins/basic-page';
import { parseTime } from '../mixins/code-filter'; import { parseTime } from '../mixins/code-filter';
import { import {
getProcessTraceabilityPage, getProcessTraceabilityPage,
getWorkOrderList, getWorkOrderList,
getCoreProduct, getCoreProduct,
// exportEnergyPlcExcel
} from '@/api/quality/processTraceability'; } from '@/api/quality/processTraceability';
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict';
import tableHeightMixin from '@/mixins/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'name', prop: 'name',
label: '工单名称', label: '工单名称',
showOverflowtooltip: true,
minWidth: 120,
}, },
{ {
prop: 'code', prop: 'code',
label: '工单编码', label: '工单编码',
showOverflowtooltip: true,
minWidth: 120,
}, },
{ {
prop: 'planProductName', prop: 'planProductName',
label: '产品名', label: '产品名',
showOverflowtooltip: true,
}, },
{ {
prop: 'status', prop: 'status',
@ -76,11 +71,13 @@ const tableProps = [
prop: 'startProduceTime', prop: 'startProduceTime',
label: '开始生产时间', label: '开始生产时间',
filter: parseTime, filter: parseTime,
width: 160,
}, },
{ {
prop: 'finishProduceTime', prop: 'finishProduceTime',
label: '结束生产时间', label: '结束生产时间',
filter: parseTime, filter: parseTime,
width: 160,
}, },
{ {
prop: 'actualQuantity', prop: 'actualQuantity',
@ -91,33 +88,25 @@ const tableProps = [
label: '单位', label: '单位',
filter: publicFormatter('unit_dict'), filter: publicFormatter('unit_dict'),
}, },
{
prop: 'processFlowName',
label: '工艺名称',
},
{ {
prop: 'yield', prop: 'yield',
label: '合格率', label: '合格率',
filter: (val) => (val ? val.toFixed(2) + '%' : '-'),
align: 'center',
},
{
prop: 'processFlowName',
label: '工艺名称',
showOverflowtooltip: true,
}, },
]; ];
export default { export default {
// mixins: [basicPage], mixins: [tableHeightMixin],
data() { data() {
return { return {
// urlOptions: {
// getDataListURL: getMaterialUseLogPage,
// // deleteURL: deletePackingType,
// // exportURL: exportPackingExcel,
// },
tableProps, tableProps,
tableBtn: [ tableBtn: [
// this.$auth.hasPermi(`base:packaging-print-log:update`)
// ? {
// type: 'edit',
// btnName: '',
// }
// : undefined,
{ {
type: 'processDetail', type: 'processDetail',
btnName: '查看工艺详情', btnName: '查看工艺详情',
@ -127,10 +116,6 @@ export default {
listQuery: { listQuery: {
pageSize: 10, pageSize: 10,
pageNo: 1, pageNo: 1,
// total: 0,
// orderName: '',
// startTime: undefined,
// endTime:undefined,
}, },
formConfig: [ formConfig: [
{ {
@ -161,40 +146,9 @@ export default {
name: 'search', name: 'search',
color: 'primary', 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() { created() {
this.getList(); this.getList();
this.getDict(); this.getDict();
@ -222,29 +176,13 @@ export default {
specifications: res.data.specifications, specifications: res.data.specifications,
productName: val.data.planProductName, productName: val.data.planProductName,
processFlowName: val.data.processFlowName, processFlowName: val.data.processFlowName,
// planProductId: val.data.planProductId
// equipmentName,
}, },
}); });
}); });
// this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex)
} }
}, },
getDict() { 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) => { getWorkOrderList().then((response) => {
// console.log(response);
this.formConfig[0].selectOptions = response.data.map((item) => { this.formConfig[0].selectOptions = response.data.map((item) => {
return { return {
name: item.name, name: item.name,
@ -252,27 +190,12 @@ export default {
}; };
}); });
console.log(this.formConfig[0].selectOptions); 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) { buttonClick(val) {
console.log(val); console.log(val);
if (val.btnName === 'search') { if (val.btnName === 'search') {
this.listQuery.orderName = val.orderName ? val.orderName : undefined; this.listQuery.orderName = val.orderName ? val.orderName : undefined;
// this.queryParams.status = val.status
if (val.timeVal && val.timeVal.length != 0) { if (val.timeVal && val.timeVal.length != 0) {
this.listQuery.startTime = val.timeVal[0] + ' 00:00:00'; this.listQuery.startTime = val.timeVal[0] + ' 00:00:00';
this.listQuery.endTime = val.timeVal[1] + ' 23:59:59'; this.listQuery.endTime = val.timeVal[1] + ' 23:59:59';
@ -281,13 +204,6 @@ export default {
this.listQuery.endTime = undefined; this.listQuery.endTime = undefined;
} }
this.getList(); this.getList();
} else {
// this.handleExport()
// this.addOrEditTitle = ''
// this.centervisible = true
// this.$nextTick(() => {
// this.$refs.orderAdd.init()
// })
} }
}, },
otherMethods(val) { 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> <template>
<div class="app-container"> <div class="app-container">
<search-bar <search-bar
@ -15,30 +8,24 @@
:table-props="tableProps" :table-props="tableProps"
:page="listQuery.pageNo" :page="listQuery.pageNo"
:limit="listQuery.pageSize" :limit="listQuery.pageSize"
:table-data="list"> :table-data="list"
<!-- <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn" :max-height="tableH"></base-table>
@clickBtn="handleClick" /> -->
</base-table>
<pagination <pagination
:limit.sync="listQuery.pageSize" :limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo" :page.sync="listQuery.pageNo"
:total="listQuery.total" :total="total"
@pagination="getList" /> @pagination="getList" />
<!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> -->
</div> </div>
</template> </template>
<script> <script>
// import AddOrUpdate from './add-or-updata';
// import unitDict from './unitDict';
// import basicPage from '../mixins/basic-page';
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict';
import { parseTime } from '../mixins/code-filter'; import { parseTime } from '../mixins/code-filter';
import { import {
getRawMaterialPage, getRawMaterialPage,
getWorkOrderList, getWorkOrderList,
// exportEnergyPlcExcel
} from '@/api/quality/rawMaterialTraceability'; } from '@/api/quality/rawMaterialTraceability';
import tableHeightMixin from '@/mixins/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
@ -51,6 +38,7 @@ const tableProps = [
prop: 'material', prop: 'material',
label: '原料名称', label: '原料名称',
filter: publicFormatter('material'), filter: publicFormatter('material'),
showOverflowtooltip: true,
}, },
{ {
prop: 'origin', prop: 'origin',
@ -58,12 +46,13 @@ const tableProps = [
filter: (val) => (val == 1 ? '内部' : '外部'), filter: (val) => (val == 1 ? '内部' : '外部'),
}, },
{ {
prop: 'supplierId', prop: 'supplierName',
label: '供应商', label: '供应商',
}, },
{ {
prop: 'batch', prop: 'batch',
label: '批次', label: '批次',
showOverflowtooltip: true,
}, },
{ {
prop: 'num', prop: 'num',
@ -77,14 +66,9 @@ const tableProps = [
]; ];
export default { export default {
// mixins: [basicPage], mixins: [tableHeightMixin],
data() { data() {
return { return {
// urlOptions: {
// getDataListURL: getMaterialUseLogPage,
// // deleteURL: deletePackingType,
// // exportURL: exportPackingExcel,
// },
tableProps, tableProps,
tableBtn: [ tableBtn: [
this.$auth.hasPermi(`base:packaging-print-log:update`) this.$auth.hasPermi(`base:packaging-print-log:update`)
@ -104,73 +88,29 @@ export default {
listQuery: { listQuery: {
pageSize: 10, pageSize: 10,
pageNo: 1, pageNo: 1,
total: 0,
workOrderId: undefined, workOrderId: undefined,
startTime: undefined, startTime: undefined,
endTime: undefined, endTime: undefined,
}, },
total: 0,
formConfig: [ formConfig: [
{ {
type: 'select', type: 'select',
label: '工单', label: '工单名称',
selectOptions: [], selectOptions: [],
labelField: 'name', labelField: 'name',
valueField: 'id', valueField: 'id',
param: 'workOrderId', 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', type: 'button',
btnName: '搜索', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', 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() { created() {
this.getList(); this.getList();
this.getDict(); this.getDict();
@ -179,23 +119,11 @@ export default {
getList() { getList() {
getRawMaterialPage({ ...this.listQuery }).then((res) => { getRawMaterialPage({ ...this.listQuery }).then((res) => {
this.list = res.data.records || []; this.list = res.data.records || [];
this.listQuery.total = res.data.total || 0; this.total = res.data.total || 0;
}); });
}, },
getDict() { 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) => { getWorkOrderList().then((response) => {
// console.log(response);
this.formConfig[0].selectOptions = response.data.map((item) => { this.formConfig[0].selectOptions = response.data.map((item) => {
return { return {
name: item.name, name: item.name,
@ -203,44 +131,15 @@ export default {
}; };
}); });
console.log(this.formConfig[0].selectOptions); 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) { buttonClick(val) {
console.log(val); console.log(val);
if (val.btnName === 'search') { if (val.btnName === 'search') {
this.listQuery.workOrderId = val.workOrderId this.listQuery.workOrderId = val.workOrderId
? val.workOrderId ? val.workOrderId
: undefined; : 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(); this.getList();
} else {
// this.handleExport()
// this.addOrEditTitle = ''
// this.centervisible = true
// this.$nextTick(() => {
// this.$refs.orderAdd.init()
// })
} }
}, },
otherMethods(val) { otherMethods(val) {

View File

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

View File

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