Compare commits

..

No commits in common. "7e6cfb63457ab29969375fdb92420d6f6193aee6" and "5a00db7dcd3f3f47081b66bf0423196ca021c700" have entirely different histories.

29 changed files with 3011 additions and 2656 deletions

View File

@ -1,20 +0,0 @@
export default {
data() {
return {
tableH: this.tableHeight(260),
};
},
created() {
this.tableH = this?.heightNum ? this.tableHeight(this.heightNum) : this.tableHeight(260);
window.addEventListener('resize', this._setTableHeight);
},
destroyed() {
window.removeEventListener('resize', this._setTableHeight);
},
methods: {
_setTableHeight() {
this.tableH = this?.heightNum ? this.tableHeight(this.heightNum) : this.tableHeight(260);
// this.tableH = this.tableHeight(260);
},
},
};

View File

@ -1,108 +0,0 @@
<!--
* @Author: zhp
* @Date: 2023-11-06 15:15:30
* @LastEditTime: 2023-11-24 08:42:18
* @LastEditors: zhp
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()">
<el-row :gutter="24">
<el-col :span="12">
<el-form-item label="报废类型编码" prop="code" label-width="120px">
<el-input v-model="dataForm.code" placeholder="请输入报废类型编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="报废类型" prop="name" label-width="90px">
<el-input v-model="dataForm.name" placeholder="请输入报废类型" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="12">
<el-form-item
label="报废类型描述"
prop="description"
label-width="120px">
<el-input
v-model="dataForm.description"
clearable
placeholder="报废类型描述" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark" label-width="90px">
<el-input
v-model="dataForm.remark"
clearable
placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../../core/mixins/basic-add';
import {
createQualityScrapType,
updateQualityScrapType,
getQualityScrapType,
getCode,
} from '@/api/base/qualityScrapType';
// import { getMaterialList } from "@/api/base/material";
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
codeURL: getCode,
createURL: createQualityScrapType,
updateURL: updateQualityScrapType,
infoURL: getQualityScrapType,
},
dataForm: {
id: undefined,
code: undefined,
name: undefined,
description: undefined,
remark: undefined,
},
// materialList: [],
dataRule: {
// materialId: [{ required: true, message: "", trigger: "blur" }],
code: [
{ required: true, message: '报废类型编码不能为空', trigger: 'blur' },
],
name: [
{ required: true, message: '报废类型不能为空', trigger: 'blur' },
],
},
};
},
mounted() {
// this.getDict()
console.log('我看看', this.dataForm);
},
methods: {
// async getDict() {
// //
// const res = await getMaterialList();
// this.materialList = res.data;
// },
// setMaterialCode() {
// const chooseM = this.materialList.filter(item => {
// return item.id === this.dataForm.materialId
// })
// this.dataForm.materialCode = chooseM[0].code
// }
},
};
</script>

View File

@ -1,92 +1,53 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<SearchBar <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" />
:formConfigs="searchBarFormConfig"
ref="search-bar"
@headBtnClick="handleSearchBarBtnClick" />
<!-- 列表 --> <!-- 列表 -->
<base-table <base-table :table-props="tableProps" :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-data="list"
:table-props="tableProps" @emitFun="handleEmitFun">
:page="queryParams.pageNo" <method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" fixed="right" :method-list="tableBtn"
:limit="queryParams.pageSize" @clickBtn="handleTableBtnClick" />
:table-data="list" </base-table>
@emitFun="handleEmitFun">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
label="操作"
:width="120"
fixed="right"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
</base-table>
<!-- 分页组件 --> <!-- 分页组件 -->
<pagination <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
v-show="total > 0" @pagination="getList" />
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="getList" />
<!-- 对话框(添加 / 修改) --> <!-- 对话框(添加 / 修改) -->
<base-dialog <base-dialog :dialogTitle="title" :dialogVisible="open" width="40%" @close="cancel" @cancel="cancel"
:dialogTitle="title" @confirm="submitForm">
:dialogVisible="open" <DialogForm v-if="open" ref="form" v-model="form" :rows="[
width="40%" [
@close="cancel" {
@cancel="cancel" select: true,
@confirm="submitForm"> label: '检测类型',
<DialogForm prop: 'typeId',
v-if="open" url: '/base/quality-inspection-type/listAll',
ref="form" rules: [{ required: true, message: '检测类型不能为空', trigger: 'blur' }],
v-model="form" bind: {
:rows="[ filterable: true,
[ },
{ },
select: true, {
label: '检测类型', input: true,
prop: 'typeId', label: '检测内容',
url: '/base/quality-inspection-type/listAll', prop: 'content',
rules: [ rules: [{ required: true, message: '检测内容不能为空', trigger: 'blur' }],
{ },
required: true, ],
message: '检测类型不能为空',
trigger: 'blur',
},
],
bind: {
filterable: true,
},
},
{
input: true,
label: '检测内容',
prop: 'content',
rules: [
{
required: true,
message: '检测内容不能为空',
trigger: 'blur',
},
],
},
],
[ [
{ {
input: true, input: true,
label: '内容编码', label: '内容编码',
prop: 'code', prop: 'code',
url: '/base/quality-inspection-det/getCode', url: '/base/quality-inspection-det/getCode',
}, },
{ input: true, label: '备注', prop: 'remark' }, { input: true, label: '备注', prop: 'remark' }],
], ]" />
]" /> </base-dialog>
</base-dialog> </div>
</div>
</template> </template>
<script> <script>
@ -184,10 +145,10 @@ export default {
width: 180, 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: '类型名称', },
{ prop: 'content', label: '检测内容' }, { prop: 'content', label: '检测内容', },
{ prop: 'code', label: '检测编码' }, { prop: 'code', label: '检测编码', },
{ prop: 'remark', label: '备注' }, { prop: 'remark', label: '备注', },
], ],
// //
queryParams: { queryParams: {

View File

@ -1,78 +1,52 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<SearchBar <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" />
:formConfigs="searchBarFormConfig"
ref="search-bar"
@headBtnClick="handleSearchBarBtnClick" />
<!-- 列表 --> <!-- 列表 -->
<base-table <base-table :table-props="tableProps" :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-data="list"
:table-props="tableProps" @emitFun="handleEmitFun">
:page="queryParams.pageNo" <method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" :method-list="tableBtn"
:limit="queryParams.pageSize" @clickBtn="handleTableBtnClick" />
:table-data="list" </base-table>
@emitFun="handleEmitFun"
:max-height="tableH">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
label="操作"
:width="120"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
</base-table>
<!-- 分页组件 --> <!-- 分页组件 -->
<pagination <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
v-show="total > 0" @pagination="getList" />
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="getList" />
<!-- 对话框(添加 / 修改) --> <!-- 对话框(添加 / 修改) -->
<base-dialog <base-dialog :dialogTitle="title" :dialogVisible="open" @close="cancel" width="30%" @cancel="cancel"
:dialogTitle="title" @confirm="submitForm">
:dialogVisible="open" <DialogForm v-if="open" ref="form" v-model="form" :rows="[
@close="cancel" [
width="30%" {
@cancel="cancel" input: true,
@confirm="submitForm"> label: '检测类型名称',
<DialogForm prop: 'name',
v-if="open" rules: [
ref="form" {
v-model="form" required: true,
:rows="[ message: '检测类型名称不能为空',
[ trigger: 'blur',
{ },
input: true, ],
label: '检测类型', // bind: {
prop: 'name', // disabled: true, // some condition, like detail mode...
rules: [ // }
{ },
required: true, ],
message: '检测类型不能为空', [
trigger: 'blur', {
}, input: true,
], label: '检测类型编码',
// bind: { prop: 'code',
// disabled: true, // some condition, like detail mode... url: '/base/quality-inspection-type/getCode',
// } },
}, ],
], [{ input: true, label: '备注', prop: 'remark' }],
[ ]" />
{ </base-dialog>
input: true, </div>
label: '检测类型编码',
prop: 'code',
url: '/base/quality-inspection-type/getCode',
},
],
[{ input: true, label: '备注', prop: 'remark' }],
]" />
</base-dialog>
</div>
</template> </template>
<script> <script>
@ -87,11 +61,10 @@ import {
exportQualityInspectionTypeExcel, exportQualityInspectionTypeExcel,
} from '@/api/base/qualityInspectionType'; } from '@/api/base/qualityInspectionType';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import tableHeightMixin from '@/mixins/tableHeightMixin';
export default { export default {
name: 'QualityInspectionType', name: 'QualityInspectionType',
mixins: [basicPageMixin, tableHeightMixin], mixins: [basicPageMixin],
data() { data() {
return { return {
tableBtn: [ tableBtn: [
@ -116,9 +89,41 @@ export default {
width: 180, 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: '检测类型名称' },
{ prop: 'code', label: '类型编码' }, { prop: 'code', label: '检测类型编码' },
{ prop: 'remark', label: '备注' }, { prop: 'remark', label: '备注' },
// {
// label: '',
// alignt: 'center',
// subcomponent: {
// render: function (h) {
// return h('div', null, [
// h(
// 'el-button',
// {
// props: {
// icon: 'el-icon-edit',
// size: 'mini',
// type: 'text',
// },
// },
// ' '
// ),
// h(
// 'el-button',
// {
// props: {
// icon: 'el-icon-edit',
// size: 'mini',
// type: 'text',
// },
// },
// ' '
// ),
// ]);
// },
// },
// },
], ],
// //
searchBarFormConfig: [ searchBarFormConfig: [
@ -134,6 +139,11 @@ export default {
name: 'search', name: 'search',
color: 'primary', color: 'primary',
}, },
// {
// type: 'button',
// btnName: '',
// name: 'reset',
// },
{ {
type: 'separate', type: 'separate',
}, },

View File

@ -29,7 +29,7 @@
@cancel="handleCancel" @cancel="handleCancel"
@confirm="handleConfirm" @confirm="handleConfirm"
:before-close="handleCancel" :before-close="handleCancel"
width="40%"> width="30%">
<add-or-update <add-or-update
ref="addOrUpdate" ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update> @refreshDataList="successSubmit"></add-or-update>
@ -42,31 +42,31 @@ import AddOrUpdate from './add-or-updata';
import basicPage from '../../../core/mixins/basic-page'; import basicPage from '../../../core/mixins/basic-page';
import { parseTime } from '../../../core/mixins/code-filter'; import { parseTime } from '../../../core/mixins/code-filter';
import { import {
getQualityScrapDetPage, getQualityScrapDetPage,
deleteQualityScrapDet, deleteQualityScrapDet,
} from '@/api/base/qualityScrapDet'; } from '@/api/base/qualityScrapDet';
import { getList } from '@/api/base/qualityScrapType'; import { getList, } from "@/api/base/qualityScrapType";
const tableProps = [ const tableProps = [
{ {
prop: 'createTime', prop: 'createTime',
label: '添加时间', label: '添加时间',
filter: parseTime, filter: parseTime
}, },
{ {
prop: 'content', prop: 'content',
label: '报废原因', label: '报废原因'
}, },
{ {
prop: 'code', prop: 'code',
label: '报废原因编码', label: '报废原因编码'
}, },
{ {
prop: 'typeName', prop: 'typeName',
label: '报废类型', label: '报废类型'
}, },
{ {
prop: 'remark', prop: 'remark',
label: '备注', label: '备注'
}, },
]; ];
@ -75,41 +75,41 @@ export default {
data() { data() {
return { return {
urlOptions: { urlOptions: {
getDataListURL: getQualityScrapDetPage, getDataListURL: getQualityScrapDetPage,
deleteURL: deleteQualityScrapDet, deleteURL: deleteQualityScrapDet,
// exportURL: exportFactoryExcel, // exportURL: exportFactoryExcel,
}, },
tableProps, tableProps,
tableBtn: [ tableBtn: [
this.$auth.hasPermi(`base:quality-inspection-det:update`) this.$auth.hasPermi(`base:quality-inspection-det:update`)
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑', btnName: '编辑',
} }
: undefined, : undefined,
this.$auth.hasPermi(`base:quality-inspection-det:delete`) this.$auth.hasPermi(`base:quality-inspection-det:delete`)
? { ? {
type: 'delete', type: 'delete',
btnName: '删除', btnName: '删除',
} }
: undefined, : undefined,
].filter((v) => v), ].filter((v)=>v),
tableData: [], tableData: [],
formConfig: [ formConfig: [
{ {
type: 'input', type: 'input',
label: '报废原因', label: '报废原因',
placeholder: '报废原因', placeholder: '报废原因',
param: 'content', param: 'content',
}, },
{ {
type: 'select', type: 'select',
label: '报废类型', label: '报废类型',
selectOptions: [], selectOptions: [],
labelField: 'name', labelField: 'name',
valueField: 'id', valueField: 'id',
param: 'typeId', param: 'typeId',
}, },
{ {
type: 'button', type: 'button',
btnName: '查询', btnName: '查询',
@ -120,13 +120,11 @@ export default {
type: 'separate', type: 'separate',
}, },
{ {
type: this.$auth.hasPermi('base:quality-scrap-det:create') type: this.$auth.hasPermi('base:quality-scrap-det:create') ? 'button' : '',
? 'button'
: '',
btnName: '新增', btnName: '新增',
name: 'add', name: 'add',
color: 'success', color: 'success',
plain: true, plain: true
}, },
], ],
}; };
@ -134,32 +132,32 @@ export default {
components: { components: {
AddOrUpdate, AddOrUpdate,
}, },
created() {}, created() { },
mounted() { mounted () {
this.getDict(); this.getDict();
}, },
methods: { methods: {
// //
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; this.tableData = response.data.list;
this.listQuery.total = response.data.total; this.listQuery.total = response.data.total;
this.dataListLoading = false; this.dataListLoading = false;
}); });
}, },
async getDict() { async getDict() {
// //
const res = await getList(); const res = await getList();
this.formConfig[1].selectOptions = res.data; this.formConfig[1].selectOptions = res.data;
}, },
buttonClick(val) { buttonClick(val) {
switch (val.btnName) { switch (val.btnName) {
case 'search': case 'search':
this.listQuery.pageNo = 1; this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10; 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': case 'reset':

View File

@ -0,0 +1,209 @@
<!--
* @Author: zhp
* @Date: 2023-11-06 15:15:30
* @LastEditTime: 2023-11-21 14:11:18
* @LastEditors: zhp
* @Description:
-->
<template>
<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 v-model="dataForm.workOrderId" placeholder="请选择工单号">
<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="teamId">
<el-select v-model="dataForm.teamId" placeholder="请选择班组">
<el-option v-for="dict in teamList" :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-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="产线" prop="lineId">
<el-select v-model="dataForm.lineId" placeholder="请选择产线">
<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="detId">
<el-select v-model="dataForm.detId" placeholder="请选择报废原因">
<el-option v-for="dict in detList" :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="logTime">
<el-date-picker 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="source">
<el-select v-model="dataForm.source" placeholder="请选择来源">
<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="description">
<el-input v-model="dataForm.description" placeholder="请输入描述" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../../core/mixins/basic-add';
import {
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 {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: false,
// codeURL: getCode,
createURL: createQualityScrapLog,
updateURL: updateQualityScrapLog,
infoURL: getQualityScrapLog,
},
lineList:[],
typeList: [],
workOrderList: [],
detList:[],
teamList: [],
sourceList: [
{
id: 1,
name: '手动',
},
{
id: 2,
name: '自动',
}
],
dataForm: {
id: undefined,
logTime: undefined,
source:1,
detId: undefined,
workOrderId: null,
teamId: undefined,
num: undefined,
lineId:undefined,
description:undefined,
// description: undefined,
remark: undefined,
},
// 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" }],
logTime: [{ required: true, message: "报废时间不能为空", trigger: "change" }],
}
};
},
mounted() {
this.getDict()
console.log('我看看', this.dataForm)
this.getCurrentTime()
},
methods: {
getCurrentTime() {
// new Date().Format("yyyy-MM-dd HH:mm:ss")
this.dataForm.logTime = new Date()
// this.dataForm.logTime = year + "-" + month + "-" + day;
console.log(this.dataForm.logTime);
},
async getDict() {
//
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
}
})
// 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
}
})
// 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
}
})
// 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
}
})
// console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
})
},
// setMaterialCode() {
// const chooseM = this.materialList.filter(item => {
// return item.id === this.dataForm.materialId
// })
// this.dataForm.materialCode = chooseM[0].code
// }
},
};
</script>

View File

@ -0,0 +1,222 @@
<!--
* @Author: zhp
* @Date: 2023-11-06 15:15:30
* @LastEditTime: 2023-11-07 19:38:13
* @LastEditors: zhp
* @Description:
-->
<template>
<el-dialog :visible.sync="dialogVisible" width="50%" :before-close="handleClose">
<small-title slot="title" :no-padding="true">
{{ '详情' }}
</small-title>
<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 v-model="dataForm.workOrderId" placeholder="请选择工单号" disabled>
<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="teamId">
<el-select v-model="dataForm.teamId" placeholder="请选择班组" disabled>
<el-option v-for="dict in teamList" :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="sum">
<el-input v-model="dataForm.sum" placeholder="请输入数量" disabled />
</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="请选择产线" disabled>
<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="detId">
<el-select v-model="dataForm.detId" placeholder="请选择报废原因" disabled>
<el-option v-for="dict in detList" :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="logTime">
<el-date-picker v-model="dataForm.logTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" disabled
placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="来源" prop="source">
<el-select v-model="dataForm.source" placeholder="请选择来源" disabled>
<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="description">
<el-input v-model="dataForm.description" placeholder="请输入描述" disabled />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="备注" disabled />
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-dialog>
</template>
<script>
import basicAdd from '../../../core/mixins/basic-add';
import {
createQualityScrapLog, updateQualityScrapLog, getQualityScrapLog, getWorkOrderList,
getTeamList, getDetList,getLineList } from "@/api/base/qualityScrapLog";
import { getList,} from "@/api/base/qualityScrapType";
import SmallTitle from './SmallTitle';
export default {
components: {
SmallTitle,
},
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: false,
// codeURL: getCode,
createURL: createQualityScrapLog,
updateURL: updateQualityScrapLog,
infoURL: getQualityScrapLog,
},
lineList:[],
typeList: [],
workOrderList: [],
detList:[],
teamList: [],
sourceList: [
{
id: 1,
name: '手动',
},
{
id: 2,
name: '自动',
}
],
dialogVisible:false,
dataForm: {
id: undefined,
logTime: undefined,
source:1,
detId: undefined,
workOrderId: null,
teamId: undefined,
num: undefined,
lineId:undefined,
description:undefined,
// description: undefined,
remark: undefined,
},
// 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" }],
logTime: [{ required: true, message: "报废时间不能为空", trigger: "change" }],
}
};
},
mounted() {
// this.getDict()
console.log('我看看', this.dataForm)
this.getCurrentTime()
},
methods: {
init() {
this.dialogVisible = true
},
getCurrentTime() {
// new Date().Format("yyyy-MM-dd HH:mm:ss")
this.dataForm.logTime = new Date()
// this.dataForm.logTime = year + "-" + month + "-" + day;
console.log(this.dataForm.logTime);
},
// async getDict() {
// //
// 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
// }
// })
// // 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
// }
// })
// // console.log(this.formConfig[0].selectOptions);
// // this.listQuery.total = response.data.total;
// })
// getDetList().then((res) => {
// console.log(res);
// // console.log(response);
// this.workOrderList = res.data.map((item) => {
// return {
// name: item.name,
// id: item.id
// }
// })
// // console.log(this.formConfig[0].selectOptions);
// // this.listQuery.total = response.data.total;
// })
// getTeamList().then((res) => {
// console.log(res);
// // console.log(response);
// this.teamList = res.data.map((item) => {
// return {
// name: item.name,
// id: item.id
// }
// })
// // console.log(this.formConfig[0].selectOptions);
// // this.listQuery.total = response.data.total;
// })
// },
// setMaterialCode() {
// const chooseM = this.materialList.filter(item => {
// return item.id === this.dataForm.materialId
// })
// this.dataForm.materialCode = chooseM[0].code
// }
},
};
</script>

View File

@ -0,0 +1,213 @@
<template>
<div class="app-container">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<base-table 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="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>
<detail-or-update v-if="detailOrUpdateVisible" ref="detailOrUpdate" @refreshDataList="successSubmit" />
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import DetailOrUpdate from './detail-or-updata';
import basicPage from '../../../core/mixins/basic-page';
import { parseTime } from '../../../core/mixins/code-filter';
import {
getQualityScrapLogPage,
deleteQualityScrapLog,
getWorkOrderList,
getTeamList
} from '@/api/base/qualityScrapLog';
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime
},
{
prop: 'workOrderName',
label: '工单'
},
{
prop: 'teamId',
label: '班组'
},
{
prop: 'detContent',
label: '报废原因'
},
{
prop: 'logTime',
label: '报废时间',
filter: parseTime
},
{
prop: 'num',
label: '数量'
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getQualityScrapLogPage,
deleteURL: deleteQualityScrapLog,
// exportURL: exportFactoryExcel,
},
tableProps,
tableBtn: [
this.$auth.hasPermi(`base:quality-scrap-log:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`base:quality-scrap-log:detail`)
? {
type: 'detail',
btnName: '详情',
}
: undefined,
this.$auth.hasPermi(`base:quality-scrap-log:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableData: [],
detailOrUpdateVisible:false,
formConfig: [
{
type: 'select',
label: '工单',
selectOptions: [],
labelField: 'name',
valueField: 'id',
param: 'workOrderId',
},
{
type: 'select',
label: '班组',
selectOptions: [],
labelField: 'name',
valueField: 'id',
param: 'teamId',
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('base:quality-scrap-det:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
},
],
};
},
components: {
AddOrUpdate,
DetailOrUpdate
},
created() {
this.getDict()
},
methods: {
otherMethods(val) {
if (val.type === 'detail') {
this.detailOrUpdateVisible = true;
// this.addOrEditTitle = "";
this.$nextTick(() => {
this.$refs.detailOrUpdate.init(val.data.id, true);
});
}
},
//
getDict() {
getWorkOrderList().then((res) => {
console.log(res);
// console.log(response);
this.formConfig[0].selectOptions = res.data.map((item) => {
return {
name: item.name,
id: item.id
}
})
// console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
})
getTeamList().then((res) => {
console.log(res);
// console.log(response);
this.formConfig[1].selectOptions = res.data.map((item) => {
return {
name: item.name,
id: item.id
}
})
// console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
})
},
getDataList() {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.listQuery).then(response => {
this.tableData = response.data.list;
this.listQuery.total = response.data.total;
this.dataListLoading = false;
});
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.workOrderId = val.workOrderId ? val.workOrderId : undefined;
this.listQuery.teamId = val.teamId ? val.teamId : undefined;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@ -0,0 +1,86 @@
<!--
* @Author: zhp
* @Date: 2023-11-06 15:15:30
* @LastEditTime: 2023-11-24 08:42:18
* @LastEditors: zhp
* @Description:
-->
<template>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()">
<el-row :gutter="24">
<el-col :span="12">
<el-form-item label="报废类型编码" prop="code">
<el-input v-model="dataForm.code" placeholder="请输入报废类型编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="报废类型" prop="name">
<el-input v-model="dataForm.name" placeholder="请输入报废类型" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="12">
<el-form-item label="描述类型" prop="description">
<el-input v-model="dataForm.description" clearable placeholder="描述类型" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" clearable placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../../core/mixins/basic-add';
import { createQualityScrapType, updateQualityScrapType, getQualityScrapType, getCode } from "@/api/base/qualityScrapType";
// import { getMaterialList } from "@/api/base/material";
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
codeURL: getCode,
createURL: createQualityScrapType,
updateURL: updateQualityScrapType,
infoURL: getQualityScrapType,
},
dataForm: {
id: undefined,
code: undefined,
name: undefined,
description: undefined,
remark: undefined,
},
// materialList: [],
dataRule: {
// materialId: [{ required: true, message: "", trigger: "blur" }],
code: [{ required: true, message: "报废类型编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "报废类型不能为空", trigger: "blur" }],
}
};
},
mounted() {
// this.getDict()
console.log('我看看', this.dataForm)
},
methods: {
// async getDict() {
// //
// const res = await getMaterialList();
// this.materialList = res.data;
// },
// setMaterialCode() {
// const chooseM = this.materialList.filter(item => {
// return item.id === this.dataForm.materialId
// })
// this.dataForm.materialCode = chooseM[0].code
// }
},
};
</script>

View File

@ -29,7 +29,7 @@
@cancel="handleCancel" @cancel="handleCancel"
@confirm="handleConfirm" @confirm="handleConfirm"
:before-close="handleCancel" :before-close="handleCancel"
width="40%"> width="30%">
<add-or-update <add-or-update
ref="addOrUpdate" ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update> @refreshDataList="successSubmit"></add-or-update>
@ -42,31 +42,31 @@ import AddOrUpdate from './add-or-updata';
import basicPage from '../../../core/mixins/basic-page'; import basicPage from '../../../core/mixins/basic-page';
import { parseTime } from '../../../core/mixins/code-filter'; import { parseTime } from '../../../core/mixins/code-filter';
import { import {
getQualityScrapTypePage, getQualityScrapTypePage,
deleteQualityScrapType, deleteQualityScrapType
} from '@/api/base/qualityScrapType'; } from '@/api/base/qualityScrapType';
const tableProps = [ const tableProps = [
{ {
prop: 'createTime', prop: 'createTime',
label: '添加时间', label: '添加时间',
filter: parseTime, filter: parseTime
}, },
{ {
prop: 'name', prop: 'name',
label: '报废类型', label: '报废类型'
}, },
{ {
prop: 'code', prop: 'code',
label: '报废类型编码', label: '报废类型编码'
}, },
{ {
prop: 'description', prop: 'description',
label: '描述信息', label: '描述信息'
}, },
{ {
prop: 'remark', prop: 'remark',
label: '备注', label: '备注'
}, },
]; ];
@ -81,25 +81,25 @@ export default {
}, },
tableProps, tableProps,
tableBtn: [ tableBtn: [
this.$auth.hasPermi(`base:quality-scrap-type:update`) this.$auth.hasPermi(`base:quality-scrap-type:update`)
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑', btnName: '编辑',
} }
: undefined, : undefined,
this.$auth.hasPermi(`base:quality-scrap-type:delete`) this.$auth.hasPermi(`base:quality-scrap-type:delete`)
? { ? {
type: 'delete', type: 'delete',
btnName: '删除', btnName: '删除',
} }
: undefined, : undefined,
].filter((v) => v), ].filter((v)=>v),
tableData: [], tableData: [],
formConfig: [ formConfig: [
{ {
type: 'input', type: 'input',
label: '报废类型', label: '报废类型',
placeholder: '报废类型', placeholder: '报废类型',
param: 'name', param: 'name',
}, },
{ {
@ -112,13 +112,11 @@ export default {
type: 'separate', type: 'separate',
}, },
{ {
type: this.$auth.hasPermi('base:quality-scrap-type:create') type: this.$auth.hasPermi('base:quality-scrap-type:create') ? 'button' : '',
? 'button'
: '',
btnName: '新增', btnName: '新增',
name: 'add', name: 'add',
color: 'success', color: 'success',
plain: true, plain: true
}, },
], ],
}; };
@ -129,14 +127,14 @@ export default {
created() {}, created() {},
methods: { methods: {
// //
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; this.tableData = response.data.list;
this.listQuery.total = response.data.total; this.listQuery.total = response.data.total;
this.dataListLoading = false; this.dataListLoading = false;
}); });
}, },
buttonClick(val) { buttonClick(val) {
switch (val.btnName) { switch (val.btnName) {
case 'search': case 'search':

File diff suppressed because it is too large Load Diff

View File

@ -186,16 +186,16 @@ export default {
}, },
], ],
}, },
// { {
// prop: 'oee', prop: 'oee',
// label: 'OEE', label: 'OEE',
// filter: (val) => (val != null ? +val.toFixed(3) : '-'), filter: (val) => (val != null ? +val.toFixed(3) : '-'),
// }, },
// { {
// prop: 'teep', prop: 'teep',
// label: 'TEEP', label: 'TEEP',
// filter: (val) => (val != null ? +val.toFixed(3) : '-'), filter: (val) => (val != null ? +val.toFixed(3) : '-'),
// }, },
// { // {
// _action: 'view-trend', // _action: 'view-trend',
// label: '', // label: '',
@ -230,9 +230,8 @@ export default {
type: 'select', type: 'select',
label: '工单', label: '工单',
placeholder: '请选择工单', placeholder: '请选择工单',
param: 'workOrderId', param: 'workOrderId',
selectOptions: [], selectOptions: [],
filterable: true,
}, },
// { // {
// type: 'select', // type: 'select',
@ -253,20 +252,20 @@ export default {
// ], // ],
// index: 2, // index: 2,
// extraOptions: [ // extraOptions: [
{ {
// parent: 'dateFilterType', // parent: 'dateFilterType',
// //
type: 'datePicker', type: 'datePicker',
label: '时间段', // label: '',
dateType: 'daterange', dateType: 'daterange',
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd HH:mm:ss', valueFormat: 'yyyy-MM-dd HH:mm:ss',
defaultTime: ['00:00:00', '00:00:00'], defaultTime: ['00:00:00', '00:00:00'],
rangeSeparator: '-', rangeSeparator: '-',
startPlaceholder: '开始时间', startPlaceholder: '开始时间',
endPlaceholder: '结束时间', endPlaceholder: '结束时间',
param: 'timerange', param: 'timerange',
}, },
// { // {
// parent: 'dateFilterType', // parent: 'dateFilterType',
// // // //
@ -286,16 +285,16 @@ export default {
name: 'search', name: 'search',
color: 'primary', color: 'primary',
}, },
{ // {
type: 'separate', // type: 'separate',
}, // },
{ // {
type: 'button', // type: 'button',
btnName: '导出', // btnName: '',
name: 'export', // name: 'visualization',
plain: true, // plain: true,
color: 'success', // color: 'success',
}, // },
// { // {
// type: 'button', // type: 'button',
// btnName: 'OEE', // btnName: 'OEE',
@ -316,7 +315,7 @@ export default {
// //
queryParams: { queryParams: {
// lineId: null, // lineId: null,
workOrderId: null, workOrderId: null,
recordTime: [], recordTime: [],
}, },
// //
@ -325,20 +324,20 @@ export default {
}; };
}, },
created() { created() {
this.getWorkOrder(); this.getWorkOrder()
// this.getLine(); // this.getLine();
this.getList(); this.getList();
}, },
methods: { methods: {
/** 准备工厂数据 */ /** 准备工厂数据 */
async getWorkOrder() { async getWorkOrder() {
console.log(1111); 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); 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,
@ -395,7 +394,7 @@ export default {
this.open = 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.lineId = payload.lineId || null;
if (0 == payload.dateFilterType) { if (0 == payload.dateFilterType) {
this.queryParams.recordTime = payload.timerange; this.queryParams.recordTime = payload.timerange;

View File

@ -6,26 +6,16 @@
* @Description: * @Description:
--> -->
<template> <template>
<div class="app-container"> <div class="app-container">
<search-bar <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
:formConfigs="formConfig" <base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize" :table-data="list">
ref="searchBarForm" <!-- <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
@headBtnClick="buttonClick" />
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="list">
<!-- <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
@clickBtn="handleClick" /> --> @clickBtn="handleClick" /> -->
</base-table> </base-table>
<pagination <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
:limit.sync="listQuery.pageSize" @pagination="getList" />
:page.sync="listQuery.pageNo" <!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> -->
:total="listQuery.total" </div>
@pagination="getList" />
<!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> -->
</div>
</template> </template>
<script> <script>
@ -34,236 +24,228 @@
// import basicPage from '../mixins/basic-page'; // 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';
const tableProps = [ const tableProps = [
{ {
prop: 'materialName', prop: 'materialName',
label: '物料名称', label: '物料名称'
}, },
{ {
prop: 'materialCode', prop: 'materialCode',
label: '物料编码', label: '物料编码'
}, },
{ {
prop: 'dateName', prop: 'dateName',
label: '物料批次', label: '物料批次'
}, },
{ {
prop: 'equipName', prop: 'equipName',
label: '使用设备', label: '使用设备'
}, },
{ {
prop: 'num', prop: 'num',
label: '使用数量', label: '使用数量'
}, },
{ {
prop: 'useTime', prop: 'useTime',
label: '使用时间', label: '使用时间',
filter: parseTime, filter: parseTime
}, },
{ {
prop: 'userName', prop: 'userName',
label: '操作人', label: '操作人'
}, },
{ {
prop: 'source', prop: 'source',
label: '数据来源', label: '数据来源',
filter: (val) => (val == 1 ? '内部' : '外部'), filter: (val) => val == 1 ? '内部' : '外部'
}, },
{ {
prop: 'remark', prop: 'remark',
label: '备注', label: '备注'
}, }
]; ];
export default { export default {
// mixins: [basicPage], // mixins: [basicPage],
data() { data() {
return { return {
// urlOptions: { // urlOptions: {
// getDataListURL: getMaterialUseLogPage, // getDataListURL: getMaterialUseLogPage,
// // deleteURL: deletePackingType, // // deleteURL: deletePackingType,
// // exportURL: exportPackingExcel, // // exportURL: exportPackingExcel,
// }, // },
tableProps, tableProps,
tableBtn: [ tableBtn: [
this.$auth.hasPermi(`base:packaging-print-log:update`) this.$auth.hasPermi(`base:packaging-print-log:update`)
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑', btnName: '编辑',
} }
: undefined, : undefined,
this.$auth.hasPermi(`base:packaging-print-log:delete`) this.$auth.hasPermi(`base:packaging-print-log:delete`)
? { ? {
type: 'delete', type: 'delete',
btnName: '删除', btnName: '删除',
} }
: undefined, : undefined,
].filter((v) => v),
list: [], ].filter((v) => v),
listQuery: { list: [],
pageSize: 10, listQuery: {
pageNo: 1, pageSize: 10,
total: 0, pageNo: 1,
workOrderId: undefined, total: 0,
startTime: undefined, workOrderId: undefined,
endTime: undefined, startTime: undefined,
}, endTime:undefined,
formConfig: [ },
{ formConfig: [
type: 'select', {
label: '工单', type: 'select',
selectOptions: [], label: '工单',
labelField: 'name', selectOptions: [],
valueField: 'id', labelField: 'name',
param: 'workOrderId', valueField: 'id',
}, param: 'workOrderId'
{ },
type: 'datePicker', {
label: '时间段', type: 'datePicker',
dateType: 'daterange', label: '时间段',
format: 'yyyy-MM-dd', dateType: 'daterange',
valueFormat: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
rangeSeparator: '-', valueFormat: "yyyy-MM-dd",
startPlaceholder: '开始时间', rangeSeparator: '-',
endPlaceholder: '结束时间', startPlaceholder: '开始时间',
param: 'timeVal', endPlaceholder: '结束时间',
defaultSelect: [], param: 'timeVal',
width: 250, defaultSelect: [],
}, width: 250
{ },
type: 'button', {
btnName: '查询', type: 'button',
name: 'search', btnName: '搜索',
color: 'primary', name: 'search',
}, color: 'primary',
{ },
type: 'separate', {
}, type: 'separate',
// { },
// type: 'separate', // {
// }, // type: 'separate',
// { // },
// type: 'button', // {
// btnName: '', // type: 'button',
// name: 'reset', // btnName: '',
// }, // name: 'reset',
// { // },
// type: 'separate', // {
// }, // type: 'separate',
// { // },
// type: this.$auth.hasPermi('base:packaging-print-log:create') ? 'button' : '', // {
// btnName: '', // type: this.$auth.hasPermi('base:packaging-print-log:create') ? 'button' : '',
// name: 'add', // btnName: '',
// color: 'success', // name: 'add',
// plain: true, // color: 'success',
// }, // plain: true,
// { // },
// type: 'separate', // {
// type: this.$auth.hasPermi('base:product:create') ? 'separate' : '', // type: 'separate',
// }, // type: this.$auth.hasPermi('base:product:create') ? 'separate' : '',
{ // },
type: this.$auth.hasPermi('monitoring:materiel-date-from:export') {
? 'button' type: this.$auth.hasPermi('monitoring:materiel-date-from:export') ? 'button' : '',
: '', btnName: '导出',
btnName: '导出', name: 'export',
name: 'export', color: 'warning',
plain: true, },
color: 'success', ],
}, };
], },
}; components: {
}, // AddOrUpdate,
components: { },
// AddOrUpdate, created() {
}, this.getList()
created() { this.getDict()
this.getList(); },
this.getDict(); methods: {
}, getList() {
methods: { getMaterialUseLogPage({ ...this.listQuery }).then(res => {
getList() { this.list = res.data || []
getMaterialUseLogPage({ ...this.listQuery }).then((res) => { this.listQuery.total = res.data.total || 0
this.list = res.data || []; })
this.listQuery.total = res.data.total || 0; },
}); getDict() {
}, //
getDict() { // getCustomerList().then((response) => {
// // console.log(response);
// getCustomerList().then((response) => { // this.customerList = response.data
// console.log(response); // // this.listQuery.total = response.data.total;
// this.customerList = response.data // })
// // this.listQuery.total = response.data.total; // getModelList().then((response) => {
// }) // console.log(response);
// getModelList().then((response) => { // this.modelList = response.data
// console.log(response); // // this.listQuery.total = response.data.total;
// this.modelList = response.data // })
// // this.listQuery.total = response.data.total; getWorkOrderList().then((response) => {
// }) // console.log(response);
getWorkOrderList().then((response) => { this.formConfig[0].selectOptions = response.data.map((item) => {
// console.log(response); return {
this.formConfig[0].selectOptions = response.data.map((item) => { name: item.name,
return { id: item.id
name: item.name, }
id: item.id, })
}; console.log(this.formConfig[0].selectOptions);
}); // this.listQuery.total = response.data.total;
console.log(this.formConfig[0].selectOptions); })
// this.listQuery.total = response.data.total; },
}); handleExport() {
}, //
handleExport() { let params = { ...this.listQuery };
// params.pageNo = undefined;
let params = { ...this.listQuery }; params.pageSize = undefined;
params.pageNo = undefined; this.$modal.confirm('是否确认导出所有数据项?').then(() => {
params.pageSize = undefined; this.exportLoading = true;
this.$modal return exportEnergyPlcExcel(params);
.confirm('是否确认导出所有数据项?') }).then(response => {
.then(() => { this.$download.excel(response, '物料信息追溯 ');
this.exportLoading = true; this.exportLoading = false;
return exportEnergyPlcExcel(params); }).catch(() => { });
}) },
.then((response) => { buttonClick(val) {
this.$download.excel(response, '物料信息追溯 '); console.log(val)
this.exportLoading = false; if (val.btnName === 'search') {
}) this.listQuery.workOrderId = val.workOrderId ? val.workOrderId :undefined
.catch(() => {}); // this.queryParams.status = val.status
}, if (val.timeVal && val.timeVal.length != 0 ) {
buttonClick(val) { this.listQuery.startTime = val.timeVal[0] + ' 00:00:00'
console.log(val); this.listQuery.endTime = val.timeVal[1] + ' 23:59:59'
if (val.btnName === 'search') { } else {
this.listQuery.workOrderId = val.workOrderId this.listQuery.startTime = undefined
? val.workOrderId this.listQuery.endTime = undefined
: undefined; }
// this.queryParams.status = val.status this.getList()
if (val.timeVal && val.timeVal.length != 0) { } else {
this.listQuery.startTime = val.timeVal[0] + ' 00:00:00'; this.handleExport()
this.listQuery.endTime = val.timeVal[1] + ' 23:59:59'; // this.addOrEditTitle = ''
} else { // this.centervisible = true
this.listQuery.startTime = undefined; // this.$nextTick(() => {
this.listQuery.endTime = undefined; // this.$refs.orderAdd.init()
} // })
this.getList(); }
} else { },
this.handleExport(); otherMethods(val) {
// this.addOrEditTitle = '' this.addOrUpdateVisible = true;
// this.centervisible = true this.addOrEditTitle = '详情';
// this.$nextTick(() => { this.$nextTick(() => {
// this.$refs.orderAdd.init() this.$refs.addOrUpdate.init(val.data.id, true);
// }) });
} },
}, },
otherMethods(val) {
this.addOrUpdateVisible = true;
this.addOrEditTitle = '详情';
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id, true);
});
},
},
}; };
</script> </script>

View File

@ -6,31 +6,16 @@
* @Description: * @Description:
--> -->
<template> <template>
<div class="app-container"> <div class="app-container">
<search-bar <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
:formConfigs="formConfig" <base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize" :table-data="list">
ref="searchBarForm" <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
@headBtnClick="buttonClick" /> @clickBtn="handleClick" />
<base-table </base-table>
:table-props="tableProps" <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
:page="listQuery.pageNo" @pagination="getList" />
:limit="listQuery.pageSize" <!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> -->
:table-data="list"> </div>
<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="getList" />
<!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> -->
</div>
</template> </template>
<script> <script>
@ -39,264 +24,256 @@
// import basicPage from '../mixins/basic-page'; // 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 // exportEnergyPlcExcel
} from '@/api/quality/processTraceability'; } from '@/api/quality/processTraceability';
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict';
const tableProps = [ const tableProps = [
{ {
prop: 'name', prop: 'name',
label: '工单名称', label: '工单名称'
}, },
{ {
prop: 'code', prop: 'code',
label: '工单编码', label: '工单编码'
}, },
{ {
prop: 'planProductName', prop: 'planProductName',
label: '产品名', label: '产品名'
}, },
{ {
prop: 'status', prop: 'status',
label: '状态', label: '状态',
filter: (val) => filter: (val) => val == 1 ? '等待' : val == 2 ? '激活' : val == 3 ? '暂停' : val == 4 ? '完成' : '作废',
val == 1 },
? '等待' {
: val == 2 prop: 'startProduceTime',
? '激活' label: '开始生产时间',
: val == 3 filter: parseTime
? '暂停' },
: val == 4 {
? '完成' prop: 'finishProduceTime',
: '作废', label: '结束生产时间',
}, filter: parseTime
{ },
prop: 'startProduceTime', {
label: '开始生产时间', prop: 'actualQuantity',
filter: parseTime, label: '生产数量'
}, },
{ {
prop: 'finishProduceTime', prop: 'planProductUnit',
label: '结束生产时间', label: '单位',
filter: parseTime, filter: publicFormatter('unit_dict')
}, },
{ {
prop: 'actualQuantity', prop: 'processFlowName',
label: '生产数量', label: '工艺名称'
}, },
{ {
prop: 'planProductUnit', prop: 'yield',
label: '单位', label: '合格率'
filter: publicFormatter('unit_dict'), }
},
{
prop: 'processFlowName',
label: '工艺名称',
},
{
prop: 'yield',
label: '合格率',
},
]; ];
export default { export default {
// mixins: [basicPage], // mixins: [basicPage],
data() { data() {
return { return {
// urlOptions: { // urlOptions: {
// getDataListURL: getMaterialUseLogPage, // getDataListURL: getMaterialUseLogPage,
// // deleteURL: deletePackingType, // // deleteURL: deletePackingType,
// // exportURL: exportPackingExcel, // // exportURL: exportPackingExcel,
// }, // },
tableProps, tableProps,
tableBtn: [ tableBtn: [
// this.$auth.hasPermi(`base:packaging-print-log:update`) // this.$auth.hasPermi(`base:packaging-print-log:update`)
// ? { // ? {
// type: 'edit', // type: 'edit',
// btnName: '', // btnName: '',
// } // }
// : undefined, // : undefined,
{ {
type: 'processDetail', type: 'processDetail',
btnName: '查看工艺详情', btnName: '查看工艺详情',
}, },
].filter((v) => v),
list: [],
listQuery: {
pageSize: 10,
pageNo: 1,
// total: 0,
// orderName: '',
// startTime: undefined,
// endTime:undefined,
},
formConfig: [
{
type: 'select',
label: '工单名称',
selectOptions: [],
labelField: 'name',
valueField: 'id',
param: 'orderName',
filterable: true,
},
{
type: 'datePicker',
label: '工单开始时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: [],
width: 250,
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
// {
// type: 'separate',
// },
// {
// type: 'button',
// btnName: '',
// name: 'reset',
// },
// {
// type: 'separate',
// },
// {
// type: this.$auth.hasPermi('base:packaging-print-log:create') ? 'button' : '',
// btnName: '',
// name: 'add',
// color: 'success',
// plain: true,
// },
// {
// type: 'separate',
// type: this.$auth.hasPermi('base:product:create') ? 'separate' : '',
// },
// {
// type: this.$auth.hasPermi('monitoring:materiel-date-from:export') ? 'button' : '',
// btnName: '',
// name: 'export',
// color: 'warning',
// },
],
};
},
components: {
// AddOrUpdate,
},
created() {
this.getList();
this.getDict();
},
methods: {
getList() {
getProcessTraceabilityPage(this.listQuery).then((res) => {
this.list = res.data.list || [];
this.listQuery.total = res.data.total || 0;
});
},
handleClick(val) {
if (val.type === 'processDetail') {
console.log(val);
let specificationsData = '';
getCoreProduct(val.data.planProductId).then((res) => {
console.log(res);
this.$router.push({ ].filter((v) => v),
path: 'process-traceability-detail', list: [],
query: { listQuery: {
id: val.data.processFlowId, pageSize: 10,
orderId: val.data.id, pageNo: 1,
name: val.data.name, // total: 0,
specifications: res.data.specifications, // orderName: '',
productName: val.data.planProductName, // startTime: undefined,
processFlowName: val.data.processFlowName, // endTime:undefined,
// planProductId: val.data.planProductId },
// equipmentName, formConfig: [
}, {
}); type: 'select',
}); label: '工单',
selectOptions: [],
labelField: 'name',
valueField: 'id',
param: 'orderName',
filterable: true,
},
{
type: 'datePicker',
label: '工单开始时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "yyyy-MM-dd",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: [],
width: 250
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
// {
// type: 'separate',
// },
// {
// type: 'button',
// btnName: '',
// name: 'reset',
// },
// {
// type: 'separate',
// },
// {
// type: this.$auth.hasPermi('base:packaging-print-log:create') ? 'button' : '',
// btnName: '',
// name: 'add',
// color: 'success',
// plain: true,
// },
// {
// type: 'separate',
// type: this.$auth.hasPermi('base:product:create') ? 'separate' : '',
// },
// {
// type: this.$auth.hasPermi('monitoring:materiel-date-from:export') ? 'button' : '',
// btnName: '',
// name: 'export',
// color: 'warning',
// },
],
};
},
components: {
// AddOrUpdate,
},
created() {
this.getList()
this.getDict()
},
methods: {
getList() {
getProcessTraceabilityPage(this.listQuery).then(res => {
this.list = res.data.list || []
this.listQuery.total = res.data.total || 0
})
},
handleClick(val) {
if (val.type === "processDetail") {
console.log(val);
let specificationsData =''
getCoreProduct(val.data.planProductId).then((res) => {
console.log(res)
// this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex) this.$router.push({
} path: 'process-traceability-detail',
}, query: {
getDict() { id: val.data.processFlowId,
// orderId: val.data.id,
// getCustomerList().then((response) => { name: val.data.name,
// console.log(response); specifications: res.data.specifications,
// this.customerList = response.data productName: val.data.planProductName,
// // this.listQuery.total = response.data.total; processFlowName: val.data.processFlowName,
// }) // planProductId: val.data.planProductId
// getModelList().then((response) => { // equipmentName,
// console.log(response); },
// this.modelList = response.data });
// // this.listQuery.total = response.data.total; })
// })
getWorkOrderList().then((response) => { // this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex)
// console.log(response); }
this.formConfig[0].selectOptions = response.data.map((item) => { },
return { getDict() {
name: item.name, //
id: item.name, // getCustomerList().then((response) => {
}; // console.log(response);
}); // this.customerList = response.data
console.log(this.formConfig[0].selectOptions); // // this.listQuery.total = response.data.total;
// this.listQuery.total = response.data.total; // })
}); // getModelList().then((response) => {
}, // console.log(response);
// handleExport() { // this.modelList = response.data
// // // // this.listQuery.total = response.data.total;
// let params = { ...this.listQuery }; // })
// params.pageNo = undefined; getWorkOrderList().then((response) => {
// params.pageSize = undefined; // console.log(response);
// this.$modal.confirm('?').then(() => { this.formConfig[0].selectOptions = response.data.map((item) => {
// this.exportLoading = true; return {
// return exportEnergyPlcExcel(params); name: item.name,
// }).then(response => { id: item.name
// this.$download.excel(response, ' '); }
// this.exportLoading = false; })
// }).catch(() => { }); console.log(this.formConfig[0].selectOptions);
// }, // this.listQuery.total = response.data.total;
buttonClick(val) { })
console.log(val); },
if (val.btnName === 'search') { // handleExport() {
this.listQuery.orderName = val.orderName ? val.orderName : undefined; // //
// this.queryParams.status = val.status // let params = { ...this.listQuery };
if (val.timeVal && val.timeVal.length != 0) { // params.pageNo = undefined;
this.listQuery.startTime = val.timeVal[0] + ' 00:00:00'; // params.pageSize = undefined;
this.listQuery.endTime = val.timeVal[1] + ' 23:59:59'; // this.$modal.confirm('?').then(() => {
} else { // this.exportLoading = true;
this.listQuery.startTime = undefined; // return exportEnergyPlcExcel(params);
this.listQuery.endTime = undefined; // }).then(response => {
} // this.$download.excel(response, ' ');
this.getList(); // this.exportLoading = false;
} else { // }).catch(() => { });
// this.handleExport() // },
// this.addOrEditTitle = '' buttonClick(val) {
// this.centervisible = true console.log(val)
// this.$nextTick(() => { if (val.btnName === 'search') {
// this.$refs.orderAdd.init() this.listQuery.orderName = val.orderName ? val.orderName :undefined
// }) // this.queryParams.status = val.status
} if (val.timeVal && val.timeVal.length != 0 ) {
}, this.listQuery.startTime = val.timeVal[0] + ' 00:00:00'
otherMethods(val) { this.listQuery.endTime = val.timeVal[1] + ' 23:59:59'
this.addOrUpdateVisible = true; } else {
this.addOrEditTitle = '详情'; this.listQuery.startTime = undefined
this.$nextTick(() => { this.listQuery.endTime = undefined
this.$refs.addOrUpdate.init(val.data.id, true); }
}); this.getList()
}, } else {
}, // this.handleExport()
// this.addOrEditTitle = ''
// this.centervisible = true
// this.$nextTick(() => {
// this.$refs.orderAdd.init()
// })
}
},
otherMethods(val) {
this.addOrUpdateVisible = true;
this.addOrEditTitle = '详情';
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id, true);
});
},
},
}; };
</script> </script>

View File

@ -0,0 +1,219 @@
<!--
filename: dialogForm.vue
author: liubin
date: 2023-09-11 15:55:13
description: DialogForm for qualityInspectionRecord only
-->
<template>
<el-form ref="form" :model="innerDataForm" label-width="100px" v-loading="formLoading">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="工单名称" prop="workOrderId" :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-select v-model="innerDataForm.workOrderId" placeholder="请选择工单名称" filterable clearable>
<el-option v-for="opt in workOrderList" :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="inspectionDetId"
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-select v-model="innerDataForm.inspectionDetId" placeholder="请选择检测内容" filterable clearable
@change="handleInspectionDetChange">
<el-option v-for="opt in inspectionDetList" :key="opt.value" :label="opt.label" :value="opt.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="产线" prop="productionLineId"
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-select v-model="innerDataForm.productionLineId" placeholder="请选择产线" filterable clearable
@change="handleProductlineChange">
<el-option v-for="opt in productionLineList" :key="opt.value" :label="opt.label" :value="opt.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="工段" prop="sectionId" :rules="[{ required: false, message: '不能为空', trigger: 'blur' }]">
<el-select v-model="innerDataForm.sectionId" placeholder="请选择工段" clearable filterable
@change="$emit('update', innerDataForm)">
<el-option v-for="opt in sectionList" :key="opt.value" :label="opt.label" :value="opt.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="检测人员" prop="checkPerson">
<el-input v-model="innerDataForm.checkPerson" clearable @change="$emit('update', innerDataForm)"
placeholder="请输入检测人员" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="检测时间" prop="checkTime" :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-date-picker v-model="innerDataForm.checkTime" type="datetime" placeholder="请选择检测时间"
value-format="timestamp" @change="$emit('update', innerDataForm)"></el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="来源" prop="source" :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-select v-model="innerDataForm.source" placeholder="请选择来源" filterable clearable
@change="$emit('update', innerDataForm)">
<el-option v-for="opt in [
{ label: '手动', value: 1 },
{ label: '自动', value: 2 },
]" :key="opt.value" :label="opt.label" :value="opt.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col>
<el-form-item label="备注" prop="remark">
<el-input v-model="innerDataForm.remark" @change="$emit('update', innerDataForm)" placeholder="请输入备注">
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
export default {
name: 'DialogForm',
model: {
prop: 'dataForm',
event: 'update',
},
emits: ['update'],
components: {},
props: {
dataForm: {
type: Object,
default: () => ({}),
},
},
data() {
return {
formLoading: true,
inspectionDetList: [],
productionLineList: [],
sectionList: [],
workOrderList:[],
innerDataForm: {},
cacheInspectionDetList: null,
};
},
mounted() {
Promise.all([this.getProductLineList(), this.getInspectionDetList(), this.getWorkOrderList()]).then(
() => {
this.formLoading = false;
}
);
},
watch: {
// 'innerDataForm.productionLineId': {
// handler: async function (plId) {
// if (plId) await this.getWorksectionList(plId);
// },
// immediate: true,
// },
dataForm: {
handler: function (dataForm) {
this.innerDataForm = Object.assign({}, dataForm);
if (dataForm.productionLineId)
this.getWorksectionList(dataForm.productionLineId);
},
immediate: true,
},
},
methods: {
/** 模拟透传 ref */
validate(cb) {
return this.$refs.form.validate(cb);
},
resetFields(args) {
return this.$refs.form.resetFields(args);
},
handleInspectionDetChange(value) {
const { id, content } = this.cacheInspectionDetList.find(
(item) => item.id == value
);
this.innerDataForm.inspectionDetId = id;
this.innerDataForm.inspectionDetContent = content;
this.$emit('update', this.innerDataForm);
},
async handleProductlineChange(id) {
// await this.getWorksectionList(id);
this.innerDataForm.sectionId = null;
this.$emit('update', this.innerDataForm);
},
// getCode
async getCode(url) {
const response = await this.$axios(url);
return response.data;
},
// 线
async getProductLineList() {
const response = await this.$axios('/base/core-production-line/listAll');
this.productionLineList = response.data.map((item) => ({
label: item.name,
value: item.id,
}));
},
async getWorkOrderList() {
const response = await this.$axios('base/core-work-order/listbyfilter');
this.workOrderList = response.data.map((item) => ({
label: item.name,
value: item.id,
}));
},
//
async getInspectionDetList() {
const response = await this.$axios(
'/base/quality-inspection-det/listAll'
);
this.cacheInspectionDetList = response.data;
this.inspectionDetList = response.data.map((item) => ({
label: item.content,
value: item.id,
}));
},
//
async getWorksectionList(plId) {
const response = await this.$axios(
'/base/core-workshop-section/listByParentId',
{
params: {
id: plId,
},
}
);
this.sectionList = response.data.map((item) => ({
label: item.name,
value: item.id,
}));
},
},
};
</script>
<style scoped lang="scss">
.el-date-editor,
.el-select {
width: 100%;
}
</style>

View File

@ -17,7 +17,7 @@
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
label="操作" label="操作"
:width="80" :width="120"
fixed="right" fixed="right"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="handleTableBtnClick" /> @clickBtn="handleTableBtnClick" />
@ -66,22 +66,94 @@ export default {
mixins: [basicPageMixin], mixins: [basicPageMixin],
data() { data() {
return { return {
rows: [
[
{
select: true,
label: '检测内容',
url: '/base/quality-inspection-det/listAll',
prop: 'inspectionDetId',
labelKey: 'content',
rules: [{ required: true, message: '检测内容不能为空', trigger: 'blur' }],
bind: {
filterable: true,
},
},
{
select: true,
label: '来源',
prop: 'source',
value: 1, //
options: [
{ label: '手动', value: 1 },
{ label: '自动', value: 2 },
],
bind: {
filterable: true,
},
},
],
[
{
select: true,
label: '产线',
url: '/base/production-line/listAll',
prop: 'productionLineId',
bind: {
filterable: true,
},
rules: [{ required: true, message: '产线不能为空', trigger: 'blur' }],
},
{
select: true,
label: '工段',
url: '/base/workshop-section/listAll', // url options
options: [], // options, options
prop: 'sectionId',
bind: {
filterable: true,
},
rules: [{ required: false, message: '不能为空', trigger: 'blur' }],
},
],
[
{
input: true,
label: '检测人员',
prop: 'checkPerson',
},
{
datetime: true,
label: '检测时间',
prop: 'checkTime',
rules: [{ required: true, message: '检测时间不能为空', trigger: 'blur' }],
bind: {
format: 'yyyy-MM-dd HH:mm:ss',
'value-format': 'timestamp',
// 'value-format': 'yyyy-MM-dd HH:mm:ss',
clearable: true,
},
},
],
[{ textarea: true, label: '描述', prop: 'explainText' }],
[{ input: true, label: '备注', prop: 'remark' }],
],
searchBarFormConfig: [ searchBarFormConfig: [
{ {
type: 'select', type: 'select',
label: '工单名称', label: '工单名称',
placeholder: '请选择工单名称', placeholder: '请选择工单名称',
param: 'workOrderId', param: 'workOrderId',
selectOptions: [], selectOptions: [],
filterable: true, filterable:true
}, },
{ {
type: 'select', type: 'select',
label: '检测内容', label: '检测内容',
placeholder: '请输入检测内容', placeholder: '请输入检测内容',
selectOptions: [], selectOptions: [],
param: 'inspectionDetContent', param: 'inspectionDetContent',
filterable: true, filterable: true
}, },
{ {
type: 'datePicker', type: 'datePicker',
@ -107,7 +179,9 @@ export default {
type: 'separate', type: 'separate',
}, },
{ {
type: this.$auth.hasPermi('base:quality-inspection-record:create') type: this.$auth.hasPermi(
'base:quality-inspection-record:create'
)
? 'button' ? 'button'
: '', : '',
btnName: '新增', btnName: '新增',
@ -123,7 +197,7 @@ export default {
btnName: '修改', btnName: '修改',
} }
: undefined, : undefined,
this.$auth.hasPermi('base:quality-inspection-record:delete') this.$auth.hasPermi('base:quality-inspection-record:delete')
? { ? {
type: 'delete', type: 'delete',
btnName: '删除', btnName: '删除',
@ -137,12 +211,12 @@ export default {
fixed: true, fixed: true,
width: 180, 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, // width: 128,
prop: 'workOrderName', prop: 'workOrderName',
label: '工单名称', label: '工单名称',
}, },
{ {
// width: 128, // width: 128,
prop: 'inspectionDetContent', prop: 'inspectionDetContent',
@ -150,7 +224,7 @@ export default {
}, },
{ {
// width: 128, // width: 128,
prop: 'productionLineName', prop: 'lineName',
label: '产线', label: '产线',
}, },
{ {
@ -173,25 +247,25 @@ export default {
}, },
], ],
// keys, queryParams pageNo, pageSize key // keys, queryParams pageNo, pageSize key
searchBarKeys: ['workOrderId', 'inspectionDetContent', 'checkTime'], searchBarKeys: ['inspectionDetContent', 'checkTime', 'productionLineId'],
form: { form: {
id: undefined, id: undefined,
inspectionDetId: undefined, inspectionDetId: undefined,
inspectionDetContent: undefined, inspectionDetContent: undefined,
productionLineId: undefined, productionLineId: undefined,
sectionId: undefined, sectionId: undefined,
checkPerson: undefined, checkPerson: undefined,
workOrderId: undefined, workOrderId:undefined,
checkTime: undefined, checkTime: undefined,
source: undefined, source: undefined,
workOrderId: undefined, explainText: undefined,
remark: undefined, remark: undefined,
}, },
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
workOrderId: null, workOrderId:null,
inspectionDetContent: null, inspectionDetContent: null,
checkTime: [], checkTime: [],
// productionLineId: null, // productionLineId: null,
@ -200,20 +274,43 @@ export default {
}, },
created() { created() {
this.getList(); this.getList();
this.getProductLineList(); this.getProductLineList()
}, },
watch: { watch: {
form: { form: {
handler: function (val) { handler: function (val) {
console.log('form change:', val); console.log('form change:', val);
}, },
deep: true, deep: true
}, }
// 线
// 'form.productionLineId': {
// handler: function (val) {
// if (val == null) return;
// this.$axios('/base/workshop-section/listByParentId', {
// params: {
// id: val,
// },
// }).then((response) => {
// this.$set(
// this.rows[1][1], // this.rows
// 'options',
// response.data.map((item) => {
// return {
// label: item.name,
// value: item.id,
// };
// })
// );
// });
// },
// immediate: true,
// },
}, },
methods: { methods: {
/** 获取搜索栏的产线列表 */ /** 获取搜索栏的产线列表 */
getProductLineList() { getProductLineList() {
this.$axios('/base/core-work-order/listbyfilter').then((response) => { this.$axios('/base/core-work-order/listbyfilter').then((response) => {
this.searchBarFormConfig[0].selectOptions = response.data.map( this.searchBarFormConfig[0].selectOptions = response.data.map(
(item) => { (item) => {
return { return {
@ -222,17 +319,17 @@ export default {
}; };
} }
); );
}); })
this.$axios('/base/quality-inspection-det/listAll').then((response) => { this.$axios('/base/quality-inspection-det/listAll').then((response) => {
this.searchBarFormConfig[1].selectOptions = response.data.map( this.searchBarFormConfig[1].selectOptions = response.data.map(
(item) => { (item) => {
return { return {
name: item.content, name: item.content,
id: item.content, id: item.content,
}; };
} }
); );
}); });
}, },
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
@ -259,7 +356,7 @@ export default {
checkPerson: undefined, checkPerson: undefined,
checkTime: undefined, checkTime: undefined,
source: undefined, source: undefined,
workOrderId: undefined, explainText: undefined,
remark: undefined, remark: undefined,
productionLineId: undefined, productionLineId: undefined,
}; };
@ -279,7 +376,7 @@ export default {
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = '新增'; this.title = '添加质量检查信息记录表';
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
@ -287,13 +384,13 @@ export default {
const id = row.id; const id = row.id;
getQualityInspectionRecord(id).then((response) => { getQualityInspectionRecord(id).then((response) => {
/** 因为后端返回的时间是时间戳格式,需转换 */ /** 因为后端返回的时间是时间戳格式,需转换 */
const info = {}; const info = {}
Object.keys(this.form).forEach((key) => { Object.keys(this.form).forEach(key => {
info[key] = response.data[key]; info[key] = response.data[key]
}); });
this.form = info; this.form = info;
this.open = true; this.open = true;
this.title = '编辑'; this.title = '修改质量检查信息记录表';
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */

View File

@ -0,0 +1,120 @@
<!--
filename: index.vue
author: liubin
date: 2023-08-04 14:44:58
description:
-->
<template>
<div class="app-container">
<SearchBar
:formConfigs="[{ label: '近24小时检测记录', type: 'title' }]"
ref="search-bar" />
<!-- <pre><code v-html="jsondemo"></code></pre> -->
<el-skeleton v-if="initing" :rows="6" animated />
<div v-else >
<base-table
:table-props="tableProps"
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-data="list"
@emitFun="handleEmitFun"></base-table>
</div>
</div>
</template>
<script>
// import response from './response.json';
import { handleNameData, handleDynamicData } from '@/utils/dynamicProps';
// import hljs from 'highlight.js/lib/highlight';
// import json from 'highlight.js/lib/languages/json';
// import 'highlight.js/styles/github-gist.css';
// hljs.registerLanguage('json', json);
export default {
name: 'QualityRecentHours',
components: {},
props: {},
data() {
return {
initing: false,
queryParams: {
pageNo: 1,
pageSize: 10,
},
list: [
// {
// inspectionContent: '1',
// '2023-03-18T00:00:00-线1': '线1-asdf',
// '2023-03-18T01:00:00-线2': '线2-kldf',
// '2023-03-18T02:00:00-线1': '线1-vasdkj',
// },
],
tableProps: [
{
prop: 'inspectionContent',
label: '检测内容',
},
],
};
},
computed: {},
mounted() {
this.getList();
},
methods: {
async getList() {
const response = await this.$axios({
url: '/analysis/record-in-one-day/get',
method: 'get',
});
const {
data: { data: dyanmicData, nameData },
} = response;
this.initing = true;
const dynamicProps = handleNameData(nameData);
this.tableProps.push(...dynamicProps);
const dataList = handleDynamicData(dyanmicData);
this.list = dataList;
this.queryParams.pageSize = dataList.length;
setTimeout(() => {
this.initing = false;
}, 1000);
},
handleEmitFun(payload) {
console.log('payload', payload);
},
},
};
</script>
<style scoped lang="scss">
::-webkit-scrollbar {
display: none;
}
pre {
margin: 10px;
background: #f6f8faf6;
border: 1px solid #e1e4e8;
padding: 12px;
border-radius: 12px;
position: fixed;
// top: 15vh;
top: 10vh;
left: 0;
max-height: 80vh;
overflow-y: auto;
z-index: 100000;
box-shadow: 0 0 32px 12px #0001;
}
code {
font-family: 'IntelOne Mono', 'Ubuntu', 'Courier New', Courier, monospace;
}
</style>

View File

@ -0,0 +1,80 @@
{
"tableProps": [
{
"prop": "inspectionContent",
"label": "检测内容",
"align": "center"
},
{
"prop": "2023-03-18T00:00:00",
"label": "2023-03-18T00:00:00",
"align": "center",
"children": [
{
"prop": "2023-03-18T00:00:00-产线1",
"label": "产线1",
"align": "center"
},
{
"prop": "2023-03-18T00:00:00-产线2",
"label": "产线2",
"align": "center"
},
{
"prop": "2023-03-18T00:00:00-产线3",
"label": "产线3",
"align": "center"
},
{
"prop": "2023-03-18T00:00:00-产线4",
"label": "产线4",
"align": "center"
},
{
"prop": "2023-03-18T00:00:00-产线5",
"label": "产线5",
"align": "center"
}
]
},
{
"prop": "2023-03-18T01:00:00",
"label": "2023-03-18T01:00:00",
"align": "center",
"children": [
{
"prop": "2023-03-18T01:00:00-产线1",
"label": "产线1",
"align": "center"
},
{
"prop": "2023-03-18T01:00:00-产线2",
"label": "产线2",
"align": "center"
},
{
"prop": "2023-03-18T01:00:00-产线3",
"label": "产线3",
"align": "center"
}
]
},
{
"prop": "2023-03-18T02:00:00",
"label": "2023-03-18T02:00:00",
"align": "center",
"children": [
{
"prop": "2023-03-18T02:00:00-产线1",
"label": "产线1",
"align": "center"
},
{
"prop": "2023-03-18T02:00:00-产线2",
"label": "产线2",
"align": "center"
}
]
}
]
}

View File

@ -0,0 +1,176 @@
{
"code": 0,
"data": {
"data": [
{
"data": [
{
"id": "测试222023-08-09T02:00",
"parentId": "测试22",
"dynamicName": "2023-08-09T02:00",
"dynamicValue": 1691517600000,
"children": [
{
"id": "1672847052717821953",
"parentId": "测试222023-08-09T02:00",
"dynamicName": "产线1",
"dynamicValue": 1
}
]
},
{
"id": "测试222023-08-09T08:00",
"parentId": "测试22",
"dynamicName": "2023-08-09T08:00",
"dynamicValue": 1691539200000,
"children": [
{
"id": "1672847052717821953",
"parentId": "测试222023-08-09T08:00",
"dynamicName": "产线1",
"dynamicValue": 1
}
]
},
{
"id": "测试222023-08-09T11:00",
"parentId": "测试22",
"dynamicName": "2023-08-09T11:00",
"dynamicValue": 1691550000000,
"children": [
{
"id": "1672847052717821953",
"parentId": "测试222023-08-09T11:00",
"dynamicName": "产线1",
"dynamicValue": 1
}
]
}
],
"inspectionDetContent": "测试22"
},
{
"data": [
{
"id": "测试112023-08-09T02:00",
"parentId": "测试11",
"dynamicName": "2023-08-09T02:00",
"dynamicValue": 1691517600000,
"children": [
{
"id": "1672847052717821954",
"parentId": "测试112023-08-09T02:00",
"dynamicName": "产线22",
"dynamicValue": 1
}
]
},
{
"id": "测试112023-08-09T08:00",
"parentId": "测试11",
"dynamicName": "2023-08-09T08:00",
"dynamicValue": 1691539200000,
"children": [
{
"id": "1672847052717821953",
"parentId": "测试112023-08-09T08:00",
"dynamicName": "产线1",
"dynamicValue": 1
}
]
},
{
"id": "测试112023-08-09T09:00",
"parentId": "测试11",
"dynamicName": "2023-08-09T09:00",
"dynamicValue": 1691542800000,
"children": [
{
"id": "1672847052717821954",
"parentId": "测试112023-08-09T09:00",
"dynamicName": "产线22",
"dynamicValue": 2
}
]
}
],
"inspectionDetContent": "测试11"
}
],
"nameData": [
{
"name": "2023-08-09T02:00",
"tree": 1,
"id": "测试222023-08-09T02:00",
"parentId": "测试22"
},
{
"name": "产线1",
"tree": 2,
"id": "1672847052717821953",
"parentId": "测试222023-08-09T02:00"
},
{
"name": "2023-08-09T08:00",
"tree": 1,
"id": "测试222023-08-09T08:00",
"parentId": "测试22"
},
{
"name": "产线1",
"tree": 2,
"id": "1672847052717821953",
"parentId": "测试222023-08-09T08:00"
},
{
"name": "2023-08-09T11:00",
"tree": 1,
"id": "测试222023-08-09T11:00",
"parentId": "测试22"
},
{
"name": "产线1",
"tree": 2,
"id": "1672847052717821953",
"parentId": "测试222023-08-09T11:00"
},
{
"name": "2023-08-09T02:00",
"tree": 1,
"id": "测试112023-08-09T02:00",
"parentId": "测试11"
},
{
"name": "产线22",
"tree": 2,
"id": "1672847052717821954",
"parentId": "测试112023-08-09T02:00"
},
{
"name": "2023-08-09T08:00",
"tree": 1,
"id": "测试112023-08-09T08:00",
"parentId": "测试11"
},
{
"name": "产线1",
"tree": 2,
"id": "1672847052717821953",
"parentId": "测试112023-08-09T08:00"
},
{
"name": "2023-08-09T09:00",
"tree": 1,
"id": "测试112023-08-09T09:00",
"parentId": "测试11"
},
{
"name": "产线22",
"tree": 2,
"id": "1672847052717821954",
"parentId": "测试112023-08-09T09:00"
}
]
},
"msg": ""
}

View File

@ -6,26 +6,16 @@
* @Description: * @Description:
--> -->
<template> <template>
<div class="app-container"> <div class="app-container">
<search-bar <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
:formConfigs="formConfig" <base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize" :table-data="list">
ref="searchBarForm" <!-- <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
@headBtnClick="buttonClick" />
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="list">
<!-- <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
@clickBtn="handleClick" /> --> @clickBtn="handleClick" /> -->
</base-table> </base-table>
<pagination <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
:limit.sync="listQuery.pageSize" @pagination="getList" />
:page.sync="listQuery.pageNo" <!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> -->
:total="listQuery.total" </div>
@pagination="getList" />
<!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> -->
</div>
</template> </template>
<script> <script>
@ -35,221 +25,219 @@
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 // exportEnergyPlcExcel
} from '@/api/quality/rawMaterialTraceability'; } from '@/api/quality/rawMaterialTraceability';
const tableProps = [ const tableProps = [
{ {
prop: 'createTime', prop: 'createTime',
label: '添加时间', label: '添加时间',
filter: parseTime, filter: parseTime
width: 150, },
}, {
{ prop: 'material',
prop: 'material', label: '原料名称',
label: '原料名称', filter: publicFormatter('material')
filter: publicFormatter('material'), },
}, {
{ prop: 'origin',
prop: 'origin', label: '来源',
label: '来源', filter: (val)=>val == 1 ? '内部' : '外部'
filter: (val) => (val == 1 ? '内部' : '外部'), },
}, {
{ prop: 'supplierId',
prop: 'supplierId', label: '供应商'
label: '供应商', },
}, {
{ prop: 'batch',
prop: 'batch', label: '批次'
label: '批次', },
}, {
{ prop: 'num',
prop: 'num', label: '数量'
label: '数量', },
}, {
{ prop: 'unit',
prop: 'unit', label: '单位',
label: '单位', filter: publicFormatter('unit_dict')
filter: publicFormatter('unit_dict'), }
},
]; ];
export default { export default {
// mixins: [basicPage], // mixins: [basicPage],
data() { data() {
return { return {
// urlOptions: { // urlOptions: {
// getDataListURL: getMaterialUseLogPage, // getDataListURL: getMaterialUseLogPage,
// // deleteURL: deletePackingType, // // deleteURL: deletePackingType,
// // exportURL: exportPackingExcel, // // exportURL: exportPackingExcel,
// }, // },
tableProps, tableProps,
tableBtn: [ tableBtn: [
this.$auth.hasPermi(`base:packaging-print-log:update`) this.$auth.hasPermi(`base:packaging-print-log:update`)
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑', btnName: '编辑',
} }
: undefined, : undefined,
this.$auth.hasPermi(`base:packaging-print-log:delete`) this.$auth.hasPermi(`base:packaging-print-log:delete`)
? { ? {
type: 'delete', type: 'delete',
btnName: '删除', btnName: '删除',
} }
: undefined, : undefined,
].filter((v) => v),
list: [], ].filter((v) => v),
listQuery: { list: [],
pageSize: 10, listQuery: {
pageNo: 1, pageSize: 10,
total: 0, pageNo: 1,
workOrderId: undefined, total: 0,
startTime: undefined, workOrderId: undefined,
endTime: undefined, startTime: undefined,
}, endTime:undefined,
formConfig: [ },
{ formConfig: [
type: 'select', {
label: '工单', type: 'select',
selectOptions: [], label: '工单',
labelField: 'name', selectOptions: [],
valueField: 'id', labelField: 'name',
param: 'workOrderId', valueField: 'id',
}, param: 'workOrderId'
// { },
// type: 'datePicker', // {
// label: '', // type: 'datePicker',
// dateType: 'daterange', // label: '',
// format: 'yyyy-MM-dd', // dateType: 'daterange',
// valueFormat: "yyyy-MM-dd", // format: 'yyyy-MM-dd',
// rangeSeparator: '-', // valueFormat: "yyyy-MM-dd",
// startPlaceholder: '', // rangeSeparator: '-',
// endPlaceholder: '', // startPlaceholder: '',
// param: 'timeVal', // endPlaceholder: '',
// defaultSelect: [], // param: 'timeVal',
// width: 250 // defaultSelect: [],
// }, // width: 250
{ // },
type: 'button', {
btnName: '搜索', type: 'button',
name: 'search', btnName: '搜索',
color: 'primary', name: 'search',
}, color: 'primary',
// { },
// type: 'separate', // {
// }, // type: 'separate',
// { // },
// type: 'button', // {
// btnName: '', // type: 'button',
// name: 'reset', // btnName: '',
// }, // name: 'reset',
// { // },
// type: 'separate', // {
// }, // type: 'separate',
// { // },
// type: this.$auth.hasPermi('base:packaging-print-log:create') ? 'button' : '', // {
// btnName: '', // type: this.$auth.hasPermi('base:packaging-print-log:create') ? 'button' : '',
// name: 'add', // btnName: '',
// color: 'success', // name: 'add',
// plain: true, // color: 'success',
// }, // plain: true,
// { // },
// type: 'separate', // {
// type: this.$auth.hasPermi('base:product:create') ? 'separate' : '', // type: 'separate',
// }, // type: this.$auth.hasPermi('base:product:create') ? 'separate' : '',
// { // },
// type: this.$auth.hasPermi('monitoring:materiel-date-from:export') ? 'button' : '', // {
// btnName: '', // type: this.$auth.hasPermi('monitoring:materiel-date-from:export') ? 'button' : '',
// name: 'export', // btnName: '',
// color: 'warning', // name: 'export',
// }, // color: 'warning',
], // },
}; ],
}, };
components: { },
// AddOrUpdate, components: {
}, // AddOrUpdate,
created() { },
this.getList(); created() {
this.getDict(); this.getList()
}, this.getDict()
methods: { },
getList() { methods: {
getRawMaterialPage({ ...this.listQuery }).then((res) => { getList() {
this.list = res.data.records || []; getRawMaterialPage({ ...this.listQuery }).then(res => {
this.listQuery.total = res.data.total || 0; this.list = res.data.list || []
}); this.listQuery.total = res.data.total || 0
}, })
getDict() { },
// getDict() {
// getCustomerList().then((response) => { //
// console.log(response); // getCustomerList().then((response) => {
// this.customerList = response.data // console.log(response);
// // this.listQuery.total = response.data.total; // this.customerList = response.data
// }) // // this.listQuery.total = response.data.total;
// getModelList().then((response) => { // })
// console.log(response); // getModelList().then((response) => {
// this.modelList = response.data // console.log(response);
// // this.listQuery.total = response.data.total; // this.modelList = response.data
// }) // // this.listQuery.total = response.data.total;
getWorkOrderList().then((response) => { // })
// console.log(response); getWorkOrderList().then((response) => {
this.formConfig[0].selectOptions = response.data.map((item) => { // console.log(response);
return { this.formConfig[0].selectOptions = response.data.map((item) => {
name: item.name, return {
id: item.id, name: item.name,
}; id: item.id
}); }
console.log(this.formConfig[0].selectOptions); })
// this.listQuery.total = response.data.total; console.log(this.formConfig[0].selectOptions);
}); // this.listQuery.total = response.data.total;
}, })
// handleExport() { },
// // // handleExport() {
// let params = { ...this.listQuery }; // //
// params.pageNo = undefined; // let params = { ...this.listQuery };
// params.pageSize = undefined; // params.pageNo = undefined;
// this.$modal.confirm('?').then(() => { // params.pageSize = undefined;
// this.exportLoading = true; // this.$modal.confirm('?').then(() => {
// return exportEnergyPlcExcel(params); // this.exportLoading = true;
// }).then(response => { // return exportEnergyPlcExcel(params);
// this.$download.excel(response, ' '); // }).then(response => {
// this.exportLoading = false; // this.$download.excel(response, ' ');
// }).catch(() => { }); // this.exportLoading = false;
// }, // }).catch(() => { });
buttonClick(val) { // },
console.log(val); buttonClick(val) {
if (val.btnName === 'search') { console.log(val)
this.listQuery.workOrderId = val.workOrderId if (val.btnName === 'search') {
? val.workOrderId this.listQuery.workOrderId = val.workOrderId ? val.workOrderId :undefined
: undefined; // this.queryParams.status = val.status
// 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' // } else {
// } else { // this.listQuery.startTime = undefined
// this.listQuery.startTime = undefined // this.listQuery.endTime = undefined
// this.listQuery.endTime = undefined // }
// } this.getList()
this.getList(); } else {
} else { // this.handleExport()
// this.handleExport() // this.addOrEditTitle = ''
// this.addOrEditTitle = '' // this.centervisible = true
// this.centervisible = true // this.$nextTick(() => {
// this.$nextTick(() => { // this.$refs.orderAdd.init()
// this.$refs.orderAdd.init() // })
// }) }
} },
}, otherMethods(val) {
otherMethods(val) { this.addOrUpdateVisible = true;
this.addOrUpdateVisible = true; this.addOrEditTitle = '详情';
this.addOrEditTitle = '详情'; this.$nextTick(() => {
this.$nextTick(() => { this.$refs.addOrUpdate.init(val.data.id, true);
this.$refs.addOrUpdate.init(val.data.id, true); });
}); },
}, },
},
}; };
</script> </script>

View File

@ -1,290 +0,0 @@
<!--
filename: dialogForm.vue
author: liubin
date: 2023-09-11 15:55:13
description: DialogForm for qualityInspectionRecord only
-->
<template>
<el-form
ref="form"
:model="innerDataForm"
label-width="100px"
v-loading="formLoading">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item
label="工单名称"
prop="workOrderId"
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-select
v-model="innerDataForm.workOrderId"
placeholder="请选择工单名称"
filterable
clearable>
<el-option
v-for="opt in workOrderList"
: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="inspectionDetId"
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-select
v-model="innerDataForm.inspectionDetId"
placeholder="请选择检测内容"
filterable
clearable
@change="handleInspectionDetChange">
<el-option
v-for="opt in inspectionDetList"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item
label="产线"
prop="productionLineId"
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-select
v-model="innerDataForm.productionLineId"
placeholder="请选择产线"
filterable
clearable
@change="handleProductlineChange">
<el-option
v-for="opt in productionLineList"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="工段"
prop="sectionId"
:rules="[{ required: false, message: '不能为空', trigger: 'blur' }]">
<el-select
v-model="innerDataForm.sectionId"
placeholder="请选择工段"
clearable
filterable
@change="$emit('update', innerDataForm)">
<el-option
v-for="opt in sectionList"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="检测人" prop="checkPerson">
<el-input
v-model="innerDataForm.checkPerson"
clearable
@change="$emit('update', innerDataForm)"
placeholder="请输入检测人" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="检测时间"
prop="checkTime"
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-date-picker
v-model="innerDataForm.checkTime"
type="datetime"
placeholder="请选择检测时间"
value-format="timestamp"
@change="$emit('update', innerDataForm)"></el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item
label="来源"
prop="source"
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-select
v-model="innerDataForm.source"
placeholder="请选择来源"
filterable
clearable
@change="$emit('update', innerDataForm)">
<el-option
v-for="opt in [
{ label: '手动', value: 1 },
{ label: '自动', value: 2 },
]"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col>
<el-form-item label="备注" prop="remark">
<el-input
v-model="innerDataForm.remark"
@change="$emit('update', innerDataForm)"
placeholder="请输入备注"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
export default {
name: 'DialogForm',
model: {
prop: 'dataForm',
event: 'update',
},
emits: ['update'],
components: {},
props: {
dataForm: {
type: Object,
default: () => ({}),
},
},
data() {
return {
formLoading: true,
inspectionDetList: [],
productionLineList: [],
sectionList: [],
workOrderList: [],
innerDataForm: {},
cacheInspectionDetList: null,
};
},
mounted() {
Promise.all([
this.getProductLineList(),
this.getInspectionDetList(),
this.getWorkOrderList(),
]).then(() => {
this.formLoading = false;
});
},
watch: {
// 'innerDataForm.productionLineId': {
// handler: async function (plId) {
// if (plId) await this.getWorksectionList(plId);
// },
// immediate: true,
// },
dataForm: {
handler: function (dataForm) {
this.innerDataForm = Object.assign({}, dataForm);
if (dataForm.productionLineId)
this.getWorksectionList(dataForm.productionLineId);
},
immediate: true,
},
},
methods: {
/** 模拟透传 ref */
validate(cb) {
return this.$refs.form.validate(cb);
},
resetFields(args) {
return this.$refs.form.resetFields(args);
},
handleInspectionDetChange(value) {
const { id, content } = this.cacheInspectionDetList.find(
(item) => item.id == value
);
this.innerDataForm.inspectionDetId = id;
this.innerDataForm.inspectionDetContent = content;
this.$emit('update', this.innerDataForm);
},
async handleProductlineChange(id) {
// await this.getWorksectionList(id);
this.innerDataForm.sectionId = null;
this.$emit('update', this.innerDataForm);
},
// getCode
async getCode(url) {
const response = await this.$axios(url);
return response.data;
},
// 线
async getProductLineList() {
const response = await this.$axios('/base/core-production-line/listAll');
this.productionLineList = response.data.map((item) => ({
label: item.name,
value: item.id,
}));
},
async getWorkOrderList() {
const response = await this.$axios('base/core-work-order/listbyfilter');
this.workOrderList = response.data.map((item) => ({
label: item.name,
value: item.id,
}));
},
//
async getInspectionDetList() {
const response = await this.$axios(
'/base/quality-inspection-det/listAll'
);
this.cacheInspectionDetList = response.data;
this.inspectionDetList = response.data.map((item) => ({
label: item.content,
value: item.id,
}));
},
//
async getWorksectionList(plId) {
const response = await this.$axios(
'/base/core-workshop-section/listByParentId',
{
params: {
id: plId,
},
}
);
this.sectionList = response.data.map((item) => ({
label: item.name,
value: item.id,
}));
},
},
};
</script>
<style scoped lang="scss">
.el-date-editor,
.el-select {
width: 100%;
}
</style>

View File

@ -1,269 +0,0 @@
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="auto">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="工单号" prop="workOrderId">
<el-select
v-model="dataForm.workOrderId"
placeholder="请选择工单号"
style="width: 100%"
:disabled="showDetail">
<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="12">
<el-form-item label="班组" prop="teamId" :disabled="showDetail">
<el-select
v-model="dataForm.teamId"
placeholder="请选择班组"
style="width: 100%"
:disabled="showDetail">
<el-option
v-for="dict in teamList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="数量" prop="num" style="width: 100%">
<el-input
v-model="dataForm.num"
placeholder="请输入数量"
:disabled="showDetail" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="产线" prop="lineId">
<el-select
v-model="dataForm.lineId"
placeholder="请选择产线"
style="width: 100%"
:disabled="showDetail">
<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="12">
<el-form-item label="报废原因" prop="detId">
<el-select
v-model="dataForm.detId"
placeholder="请选择报废原因"
style="width: 100%"
:disabled="showDetail">
<el-option
v-for="dict in detList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="报废时间" prop="logTime">
<el-date-picker
v-model="dataForm.logTime"
type="datetime"
label-format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss"
style="width: 100%"
placeholder="选择日期"
:disabled="showDetail"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="来源" prop="source">
<el-select
v-model="dataForm.source"
placeholder="请选择来源"
style="width: 100%"
:disabled="showDetail">
<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="24">
<el-form-item label="描述" prop="description">
<el-input
v-model="dataForm.description"
placeholder="请输入描述"
type="textarea"
:autosize="{ minRows: 2, maxRows: 4 }"
:disabled="showDetail" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input
v-model="dataForm.remark"
placeholder="备注"
:disabled="showDetail" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import {
createQualityScrapLog,
updateQualityScrapLog,
getQualityScrapLog,
getWorkOrderList,
getTeamList,
getDetList,
getLineList,
} from '@/api/base/qualityScrapLog';
// import { getList } from '@/api/base/qualityScrapType';
import moment from 'moment';
export default {
data() {
return {
lineList: [],
workOrderList: [],
detList: [],
teamList: [],
sourceList: [
{
id: 1,
name: '手动',
},
{
id: 2,
name: '自动',
},
],
dataForm: {
id: undefined,
logTime: undefined,
source: 1,
detId: undefined,
workOrderId: null,
teamId: undefined,
num: null,
lineId: undefined,
description: undefined,
remark: undefined,
},
dataRule: {
workOrderId: [
{ required: true, message: '工单号不能为空', trigger: 'change' },
],
num: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
detId: [
{ required: true, message: '报废原因不能为空', trigger: 'change' },
],
logTime: [
{ required: true, message: '报废时间不能为空', trigger: 'change' },
],
},
showDetail: false,
};
},
mounted() {
this.getList();
},
methods: {
init(id, show) {
this.showDetail = show ? true : false;
this.dataForm.id = id || undefined;
if (id) {
//
getQualityScrapLog(id).then((res) => {
console.log(res);
this.dataForm = res.data;
this.dataForm.logTime = res.data.logTime || null;
console.log('==================');
});
} else {
this.dataForm.logTime = moment().format('yyyy-MM-DD hh:mm:ss');
}
},
//
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false;
}
//
if (this.dataForm.id) {
updateQualityScrapLog(this.dataForm).then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
this.$emit('refreshDataList');
});
return;
}
//
createQualityScrapLog(this.dataForm).then((response) => {
this.$modal.msgSuccess('新增成功');
this.visible = false;
this.$emit('refreshDataList');
});
});
},
getList() {
//
getWorkOrderList().then((res) => {
console.log(res);
this.workOrderList = res.data.map((item) => {
return {
name: item.name,
id: item.id,
};
});
});
getLineList().then((res) => {
console.log(res);
this.lineList = res.data.map((item) => {
return {
name: item.name,
id: item.id,
};
});
});
getDetList().then((res) => {
console.log(res);
this.detList = res.data.map((item) => {
return {
name: item.content,
id: item.id,
};
});
});
getTeamList().then((res) => {
console.log(res);
this.teamList = res.data.map((item) => {
return {
name: item.name,
id: item.id,
};
});
});
},
formClear() {
this.$refs.dataForm.resetFields();
},
},
};
</script>

View File

@ -1,250 +0,0 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
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="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
<el-row slot="footer" type="flex" justify="end">
<el-col :span="12">
<el-button size="small" class="btnTextStyle" @click="handleCancel">
{{ this.addOrEditTitle === '详情' ? '关闭' : '取消' }}
</el-button>
<el-button
v-show="this.addOrEditTitle !== '详情'"
type="primary"
size="small"
class="btnTextStyle"
@click="handleConfirm">
确定
</el-button>
</el-col>
</el-row>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../core/mixins/basic-page';
import { parseTime } from '../../core/mixins/code-filter';
import {
getQualityScrapLogPage,
deleteQualityScrapLog,
getWorkOrderList,
getTeamList,
} from '@/api/base/qualityScrapLog';
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime,
},
{
prop: 'workOrderName',
label: '工单',
},
{
prop: 'teamId',
label: '班组',
},
{
prop: 'detContent',
label: '报废原因',
},
{
prop: 'logTime',
label: '报废时间',
filter: parseTime,
},
{
prop: 'num',
label: '数量',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getQualityScrapLogPage,
deleteURL: deleteQualityScrapLog,
// exportURL: exportFactoryExcel,
},
tableProps,
tableBtn: [
this.$auth.hasPermi(`base:quality-scrap-log:detail`)
? {
type: 'detail',
btnName: '详情',
}
: undefined,
this.$auth.hasPermi(`base:quality-scrap-log:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`base:quality-scrap-log:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v) => v),
tableData: [],
formConfig: [
{
type: 'select',
label: '工单名称',
selectOptions: [],
labelField: 'name',
valueField: 'id',
param: 'workOrderId',
filterable: true,
},
{
type: 'select',
label: '班组',
selectOptions: [],
labelField: 'name',
valueField: 'id',
param: 'teamId',
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('base:quality-scrap-det:create')
? 'button'
: '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true,
},
],
showDetail: false,
};
},
components: {
AddOrUpdate,
},
created() {
this.getDict();
},
methods: {
otherMethods(val) {
if (val.type === 'detail') {
this.addOrEditTitle = '详情';
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id, true);
});
}
},
//
getDict() {
getWorkOrderList().then((res) => {
console.log(res);
// console.log(response);
this.formConfig[0].selectOptions = res.data.map((item) => {
return {
name: item.name,
id: item.id,
};
});
// console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
});
getTeamList().then((res) => {
console.log(res);
// console.log(response);
this.formConfig[1].selectOptions = res.data.map((item) => {
return {
name: item.name,
id: item.id,
};
});
// console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
});
},
getDataList() {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.listQuery).then((response) => {
this.tableData = response.data.list;
this.listQuery.total = response.data.total;
this.dataListLoading = false;
});
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.workOrderId = val.workOrderId
? val.workOrderId
: undefined;
this.listQuery.teamId = val.teamId ? val.teamId : undefined;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>