质量样式

This commit is contained in:
朱菊兰 2024-04-26 16:44:01 +08:00
parent 14b2a49053
commit 23afb0db0d
9 changed files with 1007 additions and 781 deletions

View File

@ -14,6 +14,7 @@ VUE_APP_TITLE = MES系统
# 芋道管理系统/开发环境
VUE_APP_BASE_API = 'http://192.168.0.33:48082'
# VUE_APP_BASE_API = 'http://192.168.1.104:48082'
# VUE_APP_BASE_API = 'http://10.70.2.2:8080'
# 积木报表指向地址
VUE_APP_JIMU_API = 'http://192.168.1.101:48082'

View File

@ -6,68 +6,127 @@
* @Description:
-->
<template>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="auto">
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="auto">
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="工单号" prop="workOrderId">
<el-select filterable v-model="dataForm.workOrderId" placeholder="请选择工单号">
<el-option v-for="dict in workOrderList" :key="dict.id" :label="dict.name" :value="dict.id" />
<el-col :span="12">
<el-form-item
label="工单号"
prop="workOrderId">
<el-select
filterable
v-model="dataForm.workOrderId"
placeholder="请选择工单号"
style="width: 100%">
<el-option
v-for="dict in workOrderList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="数量" prop="num">
<el-input v-model="dataForm.num" placeholder="请输入数量" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="报废时间" prop="logTime">
<el-date-picker style="width: 100%;" v-model="dataForm.logTime" type="datetime" value-format="timestamp"
placeholder="选择日期">
</el-date-picker>
<el-col :span="12">
<el-form-item
label="数量"
prop="num"
style="width: 100%">
<el-input
v-model="dataForm.num"
placeholder="请输入数量" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="产线" prop="lineId">
<el-select v-model="dataForm.lineId" placeholder="请选择产线" @change="getWorksectionById">
<el-option v-for="dict in lineList" :key="dict.id" :label="dict.name" :value="dict.id" />
<el-col :span="12">
<el-form-item
label="产线"
prop="lineId">
<el-select
v-model="dataForm.lineId"
placeholder="请选择产线"
@change="getWorksectionById"
style="width: 100%">
<el-option
v-for="dict in lineList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="工段" prop="sectionId">
<el-select v-model="dataForm.sectionId" placeholder="请选择工段">
<el-option v-for="dict in sectionList" :key="dict.id" :label="dict.name" :value="dict.id" />
<el-col :span="12">
<el-form-item
label="工段"
prop="sectionId">
<el-select
v-model="dataForm.sectionId"
placeholder="请选择工段"
style="width: 100%">
<el-option
v-for="dict in sectionList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="报废原因" prop="detId">
<el-select v-model="dataForm.detId" placeholder="请选择报废原因" multiple>
<el-option v-for="dict in detList" :key="dict.id" :label="dict.name" :value="dict.id" />
<el-col :span="12">
<el-form-item
label="报废时间"
prop="logTime">
<el-date-picker
style="width: 100%"
v-model="dataForm.logTime"
type="datetime"
value-format="timestamp"
placeholder="选择日期"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="报废原因"
prop="detId">
<el-select
v-model="dataForm.detId"
placeholder="请选择报废原因"
multiple
style="width: 100%">
<el-option
v-for="dict in detList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="描述" prop="description">
<el-input v-model="dataForm.description" type="textarea" :rows="4" placeholder="请输入描述" />
<el-form-item
label="描述"
prop="description">
<el-input
v-model="dataForm.description"
type="textarea"
:rows="4"
placeholder="请输入描述"
style="width: 100%" />
</el-form-item>
</el-col>
</el-row>
<el-col :span="8">
<el-form-item label="来源" prop="source">
<el-select v-model="dataForm.source" placeholder="请选择来源" multiple>
<el-option v-for="dict in sourceList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="备注" />
<el-col :span="24">
<el-form-item
label="备注"
prop="remark">
<el-input
v-model="dataForm.remark"
placeholder="备注"
style="width: 100%" />
</el-form-item>
</el-col>
</el-form>
@ -76,9 +135,15 @@
<script>
import basicAdd from './basic-add';
import {
createQualityScrapLog, updateQualityScrapLog, getQualityScrapLog, getWorkOrderList,
getTeamList, getDetList,getLineList } from "@/api/base/qualityScrapLog";
import { getList,} from "@/api/base/qualityScrapType";
createQualityScrapLog,
updateQualityScrapLog,
getQualityScrapLog,
getWorkOrderList,
getTeamList,
getDetList,
getLineList,
} from '@/api/base/qualityScrapLog';
import { getList } from '@/api/base/qualityScrapType';
// import { getMaterialList } from "@/api/base/material";
import moment from 'moment';
export default {
@ -98,20 +163,9 @@ export default {
detList: [],
teamList: [],
sectionList: [],
sourceList: [
{
id: 1,
name: '平板端',
},
{
id: 2,
name: '网页端',
}
],
dataForm: {
id: undefined,
logTime: undefined,
source:1,
detId: undefined,
workOrderId: null,
teamId: undefined,
@ -125,17 +179,23 @@ export default {
// materialList: [],
dataRule: {
// materialId: [{ required: true, message: "", trigger: "blur" }],
workOrderId: [{ required: true, message: "工单号不能为空", trigger: "change" }],
num: [{ required: true, message: "数量不能为空", trigger: "blur" }],
detId: [{ required: true, message: "报废原因不能为空", trigger: "change" }],
workOrderId: [
{ required: true, message: '工单号不能为空', trigger: 'change' },
],
num: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
detId: [
{ required: true, message: '报废原因不能为空', trigger: 'change' },
],
logTime: [{ required: true, message: "报废时间不能为空", trigger: "change" }],
}
logTime: [
{ required: true, message: '报废时间不能为空', trigger: 'change' },
],
},
};
},
mounted() {
this.getDict()
console.log('我看看', this.dataForm)
this.getDict();
console.log('我看看', this.dataForm);
// this.getCurrentTime()
// this.dataForm.logTime = new Date()
},
@ -147,56 +207,56 @@ export default {
// },
async getDict() {
//
const res = await getList()
this.typeList = res.data
const res = await getList();
this.typeList = res.data;
getWorkOrderList().then((res) => {
console.log(res);
// console.log(response);
this.workOrderList = res.data.map((item) => {
return {
name: item.name,
id: item.id
}
})
id: item.id,
};
});
// console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
})
});
getLineList().then((res) => {
console.log(res);
// console.log(response);
this.lineList = res.data.map((item) => {
return {
name: item.name,
id: item.id
}
})
id: item.id,
};
});
// console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
})
});
getDetList().then((res) => {
console.log(res);
// console.log(response);
this.detList = res.data.map((item) => {
return {
name: item.content,
id: item.id
}
})
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.teamList = res.data.map((item) => {
return {
name: item.name,
id: item.id
}
})
id: item.id,
};
});
// console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
})
});
},
async getWorksectionById(lineId) {
if (lineId) {
@ -208,7 +268,7 @@ export default {
},
});
if (code == 0) {
console.log(data)
console.log(data);
this.sectionList = data.map((item) => {
return {
name: item.name,
@ -231,7 +291,7 @@ export default {
id: item.id,
};
});
})
});
}
},
// setMaterialCode() {

View File

@ -58,10 +58,6 @@ export default {
this.dataForm.detId = response.data.detIdList
this.getWorksectionById(this.dataForm.lineId)
this.dataForm.logTime = new Date(response.data.logTime)
// if (this.setData) {
// this.setDataForm()
// }
});
} else {
if (this.urlOptions.isGetCode) {

View File

@ -24,7 +24,7 @@ export default {
},
tableData: [],
listQuery: {
pageSize: 10,
pageSize: 20,
pageNo: 1,
total: 1,
},

View File

@ -6,79 +6,156 @@
* @Description:
-->
<template>
<el-dialog :visible.sync="visible" width="50%">
<small-title slot="title" :no-padding="true">
<el-dialog
:visible.sync="visible"
width="50%">
<small-title
slot="title"
:no-padding="true">
{{ '详情' }}
</small-title>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()"
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="auto">
<el-row :gutter="24">
<el-col :span="8">
<el-form-item label="工单号" prop="workOrderId">
<el-select disabled v-model="dataForm.workOrderId" placeholder="请选择工单号">
<el-option v-for="dict in workOrderList" :key="dict.id" :label="dict.name" :value="dict.id" />
<el-form-item
label="工单号"
prop="workOrderId">
<el-select
disabled
v-model="dataForm.workOrderId"
placeholder="请选择工单号"
style="width: 100%">
<el-option
v-for="dict in workOrderList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="数量" prop="num">
<el-input disabled v-model="dataForm.num" placeholder="请输入数量" />
<el-form-item
label="数量"
prop="num">
<el-input
disabled
v-model="dataForm.num"
placeholder="请输入数量"
style="width: 100%" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="报废时间" prop="logTime">
<el-date-picker disabled v-model="dataForm.logTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期">
</el-date-picker>
<el-form-item
label="报废时间"
prop="logTime"
style="width: 100%">
<el-date-picker
disabled
v-model="dataForm.logTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期"></el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="产线" prop="lineId">
<el-select disabled v-model="dataForm.lineId" placeholder="请选择产线" @change="getWorksectionById">
<el-option v-for="dict in lineList" :key="dict.id" :label="dict.name" :value="dict.id" />
<el-form-item
label="产线"
prop="lineId">
<el-select
disabled
v-model="dataForm.lineId"
placeholder="请选择产线"
@change="getWorksectionById"
style="width: 100%">
<el-option
v-for="dict in lineList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="工段" prop="sectionId">
<el-select v-model="dataForm.sectionId" placeholder="请选择工段" disabled>
<el-option v-for="dict in sectionList" :key="dict.id" :label="dict.name" :value="dict.id" />
<el-form-item
label="工段"
prop="sectionId">
<el-select
v-model="dataForm.sectionId"
placeholder="请选择工段"
disabled
style="width: 100%">
<el-option
v-for="dict in sectionList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="报废原因" prop="detId">
<el-select v-model="dataForm.detId" placeholder="请选择报废原因" multiple disabled>
<el-option v-for="dict in detList" :key="dict.id" :label="dict.name" :value="dict.id" />
<el-form-item
label="报废原因"
prop="detId">
<el-select
v-model="dataForm.detId"
placeholder="请选择报废原因"
multiple
disabled
style="width: 100%">
<el-option
v-for="dict in detList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="描述" prop="description">
<el-input v-model="dataForm.description" type="textarea" :rows="4" placeholder="请输入描述" />
<el-form-item
label="描述"
prop="description">
<el-input
v-model="dataForm.description"
type="textarea"
:rows="4"
placeholder="请输入描述" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item
label="备注"
prop="remark">
<el-input
v-model="dataForm.remark"
placeholder="备注" />
</el-form-item>
</el-col>
</el-row>
<el-col :span="8">
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="备注" />
</el-form-item>
</el-col>
</el-form>
</el-dialog>
</template>
<script>
import basicAdd from './basic-add';
import {
createQualityScrapLog, updateQualityScrapLog, getQualityScrapLog, getWorkOrderList,
getTeamList, getDetList,getLineList } from "@/api/base/qualityScrapLog";
import { getList,} from "@/api/base/qualityScrapType";
createQualityScrapLog,
updateQualityScrapLog,
getQualityScrapLog,
getWorkOrderList,
getTeamList,
getDetList,
getLineList,
} from '@/api/base/qualityScrapLog';
import { getList } from '@/api/base/qualityScrapType';
import SmallTitle from './SmallTitle';
export default {
components: {
@ -107,7 +184,7 @@ export default {
{
id: 2,
name: '自动',
}
},
],
sectionList: [],
visible: false,
@ -127,17 +204,23 @@ export default {
// materialList: [],
dataRule: {
// materialId: [{ required: true, message: "", trigger: "blur" }],
workOrderId: [{ required: true, message: "工单号不能为空", trigger: "change" }],
num: [{ required: true, message: "数量不能为空", trigger: "blur" }],
detId: [{ required: true, message: "报废原因不能为空", trigger: "change" }],
workOrderId: [
{ required: true, message: '工单号不能为空', trigger: 'change' },
],
num: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
detId: [
{ required: true, message: '报废原因不能为空', trigger: 'change' },
],
logTime: [{ required: true, message: "报废时间不能为空", trigger: "change" }],
}
logTime: [
{ required: true, message: '报废时间不能为空', trigger: 'change' },
],
},
};
},
mounted() {
this.getDict()
console.log('我看看', this.dataForm)
this.getDict();
console.log('我看看', this.dataForm);
// this.getCurrentTime()
},
methods: {
@ -152,56 +235,56 @@ export default {
// },
async getDict() {
//
const res = await getList()
this.typeList = res.data
const res = await getList();
this.typeList = res.data;
getWorkOrderList().then((res) => {
console.log(res);
// console.log(response);
this.workOrderList = res.data.map((item) => {
return {
name: item.name,
id: item.id
}
})
id: item.id,
};
});
// console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
})
});
getLineList().then((res) => {
console.log(res);
// console.log(response);
this.lineList = res.data.map((item) => {
return {
name: item.name,
id: item.id
}
})
id: item.id,
};
});
// console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
})
});
getDetList().then((res) => {
console.log(res);
// console.log(response);
this.detList = res.data.map((item) => {
return {
name: item.content,
id: item.id
}
})
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.teamList = res.data.map((item) => {
return {
name: item.name,
id: item.id
}
})
id: item.id,
};
});
// console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
})
});
},
async getWorksectionById(lineId) {
if (lineId) {
@ -213,7 +296,7 @@ export default {
},
});
if (code == 0) {
console.log(data)
console.log(data);
this.sectionList = data.map((item) => {
return {
name: item.name,
@ -236,7 +319,7 @@ export default {
id: item.id,
};
});
})
});
}
},
},

View File

@ -1,18 +1,44 @@
<template>
<div class="app-container">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<base-table :max-height="tableH" v-loading="dataListLoading" :table-props="tableProps" :page="listQuery.pageNo"
:limit="listQuery.pageSize" :table-data="tableData">
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
:max-height="tableH"
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="addOrUpdateVisible" @cancel="handleCancel"
@confirm="handleConfirm" :before-close="handleCancel" width="50%">
<add-or-update ref="addOrUpdate" @refreshDataList="successSubmit"></add-or-update>
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
<detail-or-update v-if="detailOrUpdateVisible" ref="detailOrUpdate" @refreshDataList="successSubmit" />
<detail-or-update
v-if="detailOrUpdateVisible"
ref="detailOrUpdate"
@refreshDataList="successSubmit" />
</div>
</template>
@ -30,40 +56,42 @@ import {
} from '@/api/base/qualityScrapLog';
const tableProps = [
// {
// prop: 'createTime',
// label: '',
// filter: parseTime
// },
{
prop: 'createTime',
label: '报废时间',
filter: parseTime
filter: parseTime,
width: 160,
},
{
prop: 'lineName',
label: '产线名称'
label: '产线名称',
width: 90,
},
{
prop: 'sectionName',
label: '工段'
label: '工段',
minWidth: 100,
},
{
prop: 'workOrderName',
label: '工单名称'
label: '工单名称',
minWidth: 160,
},
{
prop: 'num',
label: '数量'
label: '数量',
width: 90,
},
{
prop: 'detContent',
label: '报废原因'
label: '报废原因',
minWidth: 160,
},
{
prop: 'source',
label: '来源',
filter: (val) => val == 1 ? '平板端' : '网页端'
filter: (val) => (val == 1 ? '平板端' : '网页端'),
width: 90,
},
];
@ -107,7 +135,7 @@ export default {
labelField: 'name',
valueField: 'id',
param: 'workOrderId',
filterable: true
filterable: true,
},
// {
// type: 'select',
@ -119,32 +147,38 @@ export default {
// filterable: true
// },
{
type: this.$auth.hasPermi('base:quality-scrap-det:query') ? 'button' : '',
type: this.$auth.hasPermi('base:quality-scrap-det:query')
? 'button'
: '',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: this.$auth.hasPermi('base:quality-scrap-det:create') ? 'separate' : '',
type: this.$auth.hasPermi('base:quality-scrap-det:create')
? 'separate'
: '',
// type: 'separate',
},
{
type: this.$auth.hasPermi('base:quality-scrap-det:create') ? 'button' : '',
type: this.$auth.hasPermi('base:quality-scrap-det:create')
? 'button'
: '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
plain: true,
},
],
};
},
components: {
AddOrUpdate,
DetailOrUpdate
DetailOrUpdate,
},
mounted() {
this.getDict()
this.getDataList()
this.getDict();
this.getDataList();
},
methods: {
otherMethods(val) {
@ -157,16 +191,16 @@ export default {
}
},
deleteHandle(id, name, index, data) {
this.$confirm(`确认要删除序号为${index}的数据项?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
this.$confirm(`确认要删除序号为${index}的数据项?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
this.urlOptions.deleteURL(id).then(({ data }) => {
this.$message({
message: "操作成功",
type: "success",
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList();
@ -184,12 +218,12 @@ export default {
this.formConfig[0].selectOptions = res.data.map((item) => {
return {
name: item.name,
id: item.id
}
})
id: item.id,
};
});
// console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
})
});
// getTeamList().then((res) => {
// console.log(res);
// // console.log(response);
@ -205,7 +239,7 @@ export default {
},
getDataList() {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.listQuery).then(response => {
this.urlOptions.getDataListURL(this.listQuery).then((response) => {
this.tableData = response.data.list;
this.listQuery.total = response.data.total;
this.dataListLoading = false;
@ -216,7 +250,9 @@ export default {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 20;
this.listQuery.workOrderId = val.workOrderId ? val.workOrderId : undefined;
this.listQuery.workOrderId = val.workOrderId
? val.workOrderId
: undefined;
// this.listQuery.teamId = val.teamId ? val.teamId : undefined;
this.getDataList();
break;
@ -227,7 +263,7 @@ export default {
pageNo: 1,
total: 1,
};
this.getDataList()
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';

View File

@ -1,24 +1,50 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<SearchBar :isFold="true" :formConfigs="searchBarFormConfig" ref="search-bar"
<SearchBar
:isFold="true"
:formConfigs="searchBarFormConfig"
ref="search-bar"
@headBtnClick="handleSearchBarBtnClick" />
<!-- 列表 -->
<base-table :table-props="tableProps" :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-data="list"
@emitFun="handleEmitFun">
<method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" fixed="right" :method-list="tableBtn"
<base-table
:table-props="tableProps"
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-data="list"
@emitFun="handleEmitFun"
:max-height="tableH">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
label="操作"
:width="90"
fixed="right"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
</base-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="getList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog :dialogTitle="title" :dialogVisible="open" width="50%" @close="cancel" @cancel="cancel"
<base-dialog
:dialogTitle="title"
:dialogVisible="open"
width="50%"
@close="cancel"
@cancel="cancel"
@confirm="submitForm">
<DialogForm v-if="open" ref="form" v-model="form" />
<DialogForm
v-if="open"
ref="form"
v-model="form" />
</base-dialog>
</div>
</template>
@ -37,12 +63,13 @@ import moment from 'moment';
import DialogForm from './dialogForm.vue';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
export default {
name: 'QualityInspectionRecord',
components: {
DialogForm,
},
mixins: [basicPageMixin],
mixins: [basicPageMixin, tableHeightMixin],
data() {
return {
rows: [
@ -52,11 +79,17 @@ export default {
label: '工单名称',
url: 'base/core-work-order/listbyfilter',
prop: 'workOrderId',
rules: [{ required: true, message: '工单名称不能为空', trigger: 'change' }],
rules: [
{
required: true,
message: '工单名称不能为空',
trigger: 'change',
},
],
bind: {
filterable: true,
},
}
},
],
[
{
@ -65,7 +98,9 @@ export default {
url: '/base/quality-inspection-det/listAll',
prop: 'inspectionDetId',
labelKey: 'content',
rules: [{ required: true, message: '检测内容不能为空', trigger: 'blur' }],
rules: [
{ required: true, message: '检测内容不能为空', trigger: 'blur' },
],
bind: {
filterable: true,
},
@ -93,7 +128,9 @@ export default {
bind: {
filterable: true,
},
rules: [{ required: true, message: '产线不能为空', trigger: 'blur' }],
rules: [
{ required: true, message: '产线不能为空', trigger: 'blur' },
],
},
{
select: true,
@ -113,7 +150,6 @@ export default {
label: '检测人员',
prop: 'checkPerson',
},
],
[{ textarea: true, label: '描述', prop: 'explainText' }],
[{ input: true, label: '备注', prop: 'remark' }],
@ -125,7 +161,7 @@ export default {
placeholder: '请选择工单名称',
param: 'workOrderId',
selectOptions: [],
filterable:true
filterable: true,
},
{
type: 'select',
@ -133,7 +169,7 @@ export default {
placeholder: '请输入检测内容',
selectOptions: [],
param: 'inspectionDetContent',
filterable: true
filterable: true,
},
{
type: 'select',
@ -146,7 +182,7 @@ export default {
},
{
type: 'datePicker',
label: '时间',
label: '检测时间',
dateType: 'daterange', // datetimerange
// format: 'yyyy-MM-dd HH:mm:ss',
format: 'yyyy-MM-dd',
@ -159,9 +195,7 @@ export default {
// width: 350,
},
{
type: this.$auth.hasPermi(
'base:quality-inspection-record:query'
)
type: this.$auth.hasPermi('base:quality-inspection-record:query')
? 'button'
: '',
btnName: '查询',
@ -169,17 +203,13 @@ export default {
color: 'primary',
},
{
type: this.$auth.hasPermi(
'base:quality-inspection-record:create'
)
type: this.$auth.hasPermi('base:quality-inspection-record:create')
? 'separate'
: '',
// type: 'separate',
},
{
type: this.$auth.hasPermi(
'base:quality-inspection-record:create'
)
type: this.$auth.hasPermi('base:quality-inspection-record:create')
? 'button'
: '',
btnName: '新增',
@ -207,55 +237,57 @@ 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: '工单名称',
minWidth: 180,
showOverflowtooltip: true,
},
{
// width: 128,
prop: 'productionLineName',
label: '产线',
},
{
// width: 128,
prop: 'sectionName',
label: '工段',
},
{
// width: 128,
prop: 'inspectionDetContent',
label: '检测内容',
minWidth: 180,
showOverflowtooltip: true,
},
{
prop: 'productionLineName',
label: '产线',
minWidth: 80,
},
{
prop: 'sectionName',
label: '工段',
minWidth: 120,
},
// {
// // width: 128,
// prop: 'productionLineName',
// label: '线',
// },
{
// width: 128,
prop: 'checkPerson',
label: '检测人员',
showOverflowtooltip: true,
},
{
// width: 160,
prop: 'checkTime',
label: '检测时间',
width: 160,
filter: (val) =>
val != null ? moment(val).format('yyyy-MM-DD HH:mm:ss') : '-',
},
{
width: 90,
prop: 'source',
label: '来源',
filter: (val) => val == 1 ? '平板端' : '网页端',
width: 80,
filter: (val) => (val == 1 ? '平板端' : '网页端'),
},
],
// keys, queryParams pageNo, pageSize key
searchBarKeys: ['inspectionDetContent', 'checkTime', 'workOrderId','checkPerson'],
searchBarKeys: [
'inspectionDetContent',
'checkTime',
'workOrderId',
'checkPerson',
],
form: {
id: undefined,
// workOrderId:undefined,
@ -273,7 +305,7 @@ export default {
//
queryParams: {
pageNo: 1,
pageSize: 10,
pageSize: 20,
workOrderId: null,
inspectionDetContent: null,
checkTime: [],
@ -284,15 +316,15 @@ export default {
},
created() {
this.getList();
this.getProductLineList()
this.getProductLineList();
},
watch: {
form: {
handler: function (val) {
console.log('form change:', val);
},
deep: true
}
deep: true,
},
// 线
// 'form.productionLineId': {
// handler: function (val) {
@ -320,16 +352,16 @@ export default {
methods: {
/** 获取搜索栏的产线列表 */
deleteHandle(id, name, index, data) {
this.$confirm(`确认要删除序号为${index}的数据项?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
this.$confirm(`确认要删除序号为${index}的数据项?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
this.urlOptions.deleteURL(id).then(({ data }) => {
this.$message({
message: "操作成功",
type: "success",
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList();
@ -349,7 +381,7 @@ export default {
};
}
);
})
});
this.$axios('/base/quality-inspection-det/listAll').then((response) => {
this.searchBarFormConfig[1].selectOptions = response.data.map(
(item) => {
@ -359,24 +391,26 @@ export default {
};
}
);
})
});
this.$axios('base/quality-inspection-box-btn-auth/getUserList', {
pageNo: 1,
pageSize: 999
pageSize: 999,
}).then((res) => {
// console.log(response);
this.searchBarFormConfig[2].selectOptions = res.data.map((item) => ({
name: item.username,
id: item.username,
}));
})
});
},
/** 查询列表 */
getList() {
this.loading = true;
//
let str = this.queryParams.checkPerson ? this.queryParams.checkPerson.join() :undefined
this.queryParams.checkPerson = str
let str = this.queryParams.checkPerson
? this.queryParams.checkPerson.join()
: undefined;
this.queryParams.checkPerson = str;
getQualityInspectionRecordPage(this.queryParams).then((response) => {
this.list = response.data.list;
this.total = response.data.total;
@ -428,9 +462,9 @@ export default {
getQualityInspectionRecord(id).then((response) => {
/** 因为后端返回的时间是时间戳格式,需转换 */
console.log(response.data);
const info = {}
Object.keys(this.form).forEach(key => {
info[key] = response.data[key]
const info = {};
Object.keys(this.form).forEach((key) => {
info[key] = response.data[key];
});
this.form = info;
console.log(this.form);
@ -445,8 +479,8 @@ export default {
return;
}
//
let str = this.form.checkPerson ? this.form.checkPerson.join() : null
this.form.checkPerson = str
let str = this.form.checkPerson ? this.form.checkPerson.join() : null;
this.form.checkPerson = str;
if (this.form.id != null) {
updateQualityInspectionRecord(this.form).then((response) => {
this.$modal.msgSuccess('修改成功');

View File

@ -68,6 +68,7 @@ export default {
label: '生产线',
selectOptions: [],
param: 'lineId',
multiple: true,
},
{
type: 'select',
@ -104,6 +105,7 @@ export default {
label: '生产线',
selectOptions: [],
param: 'lineId',
multiple: true,
},
{
type: 'select',
@ -137,12 +139,12 @@ export default {
queryParams: {
startTime: '',
endTime: '',
lineId: '',
lineId: [],
},
queryParams2: {
startTime: '',
endTime: '',
lineId: '',
lineId: [],
},
tableProp1,
tableProp: [],
@ -150,11 +152,11 @@ export default {
tableProp2: [],
tableData2: [],
procedureName: [
{ name: '压延(拉引量t)', ename: 'calenderingCapacity' },
// { name: '(t)', ename: 'calenderingCapacity' },
{ name: '优化切割(片)', ename: 'cuttingNum' },
{ name: '堆垛(片)', ename: 'unloadPieces' },
{ name: '堆垛(托)', ename: 'unloadCount' },
{ name: '良品率(%)', ename: 'rate' },
{ name: '优切良品率(%)', ename: 'rate' },
],
span: [], //2
};
@ -311,10 +313,10 @@ export default {
} else {
if (data[i].lineName === data[i - 1].lineName) {
//线,
let startNum = 5 * (lineNum - 1);
let endNum = 5 * lineNum - 1;
let startNum = 4 * (lineNum - 1);
let endNum = 4 * lineNum - 1;
for (let k = startNum; k <= endNum; k++) {
let str = this.procedureName[k % 5];
let str = this.procedureName[k % 4];
tempData[k][data[i].timeStr] = data[i][str.ename];
}
} else {
@ -356,9 +358,9 @@ export default {
//
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
if (columnIndex === 0) {
if (rowIndex % 5 === 0) {
if (rowIndex % 4 === 0) {
return {
rowspan: 5,
rowspan: 4,
colspan: 1,
};
} else {
@ -472,7 +474,7 @@ export default {
top: 0;
left: 0;
background-color: #ebeef5;
transform: rotate(-70deg);
transform: rotate(-63deg);
-webkit-transform-origin: top;
transform-origin: top;
width: 1px;
@ -480,11 +482,11 @@ export default {
.el-table thead.is-group tr:last-of-type th:nth-child(1):before {
content: '';
position: absolute;
height: 67px;
height: 93px;
top: 0;
left: 75px;
left: 55px;
background-color: #ebeef5;
transform: rotate(-70deg);
transform: rotate(-63deg);
-webkit-transform-origin: top;
transform-origin: top;
width: 1px;

View File

@ -3,7 +3,8 @@
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
@headBtnClick="buttonClick" />
@headBtnClick="buttonClick"
@datepicker-change="datepickerChange" />
<base-table
class="israLineReportTable1"
ref="israLineReportTable11"
@ -57,14 +58,16 @@ export default {
type: 'datePicker',
label: '时间段',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd',
format: 'yyyy-MM-dd HH:mm',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: [],
width: 250,
width: 300,
onchange: true,
clearable: false,
},
{
type: 'select',
@ -106,12 +109,14 @@ export default {
},
mounted() {
this.tableProp = this.tableProp1;
let start = moment().format('yyyy-MM-DD');
let end = moment().format('yyyy-MM-DD');
let start = moment(moment().format('yyyy-MM-DD') + ' 07:00:00').format(
'yyyy-MM-DD HH:mm:ss'
);
let end =
moment(moment().valueOf() + 86400000).format('yyyy-MM-DD') + ' 06:59:59';
this.formConfig[0].defaultSelect = [start, end];
this.queryParams.startTime =
moment(start + ' 00:00:00').valueOf() + 25200000;
this.queryParams.endTime = moment(end + ' 23:59:59').valueOf() + 25200000;
this.queryParams.startTime = moment(start).valueOf();
this.queryParams.endTime = moment(end).valueOf();
this.getList();
},
methods: {
@ -237,13 +242,22 @@ export default {
}
}
},
// change
datepickerChange(val) {
console.log(val);
let start = moment(
moment(val.value[0]).format('yyyy-MM-DD') + ' 07:00:00'
).format('yyyy-MM-DD HH:mm:ss');
let end =
moment(moment(val.value[1]).valueOf() + 86400000).format('yyyy-MM-DD') +
' 06:59:59';
this.formConfig[0].defaultSelect = [start, end];
},
buttonClick(val) {
if (val.btnName === 'search') {
if (val.timeVal && val.timeVal.length > 0) {
this.queryParams.startTime =
moment(val.timeVal[0] + ' 00:00:00').valueOf() + 25200000;
this.queryParams.endTime =
moment(val.timeVal[1] + ' 23:59:59').valueOf() + 25200000;
this.queryParams.startTime = moment(val.timeVal[0]).valueOf();
this.queryParams.endTime = moment(val.timeVal[1]).valueOf();
}
this.queryParams.lineId = val.lineId;
this.getList();