质量管理
This commit is contained in:
parent
9bcb4d42fa
commit
0f70fe85c8
@ -1,53 +1,92 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" />
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<SearchBar
|
||||
:formConfigs="searchBarFormConfig"
|
||||
ref="search-bar"
|
||||
@headBtnClick="handleSearchBarBtnClick" />
|
||||
|
||||
<!-- 列表 -->
|
||||
<base-table :table-props="tableProps" :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-data="list"
|
||||
@emitFun="handleEmitFun">
|
||||
<method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" fixed="right" :method-list="tableBtn"
|
||||
@clickBtn="handleTableBtnClick" />
|
||||
</base-table>
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-data="list"
|
||||
@emitFun="handleEmitFun">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
label="操作"
|
||||
:width="120"
|
||||
fixed="right"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleTableBtnClick" />
|
||||
</base-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
<!-- 分页组件 -->
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<base-dialog :dialogTitle="title" :dialogVisible="open" width="40%" @close="cancel" @cancel="cancel"
|
||||
@confirm="submitForm">
|
||||
<DialogForm v-if="open" ref="form" v-model="form" :rows="[
|
||||
[
|
||||
{
|
||||
select: true,
|
||||
label: '检测类型',
|
||||
prop: 'typeId',
|
||||
url: '/base/quality-inspection-type/listAll',
|
||||
rules: [{ required: true, message: '检测类型不能为空', trigger: 'blur' }],
|
||||
bind: {
|
||||
filterable: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '检测内容',
|
||||
prop: 'content',
|
||||
rules: [{ required: true, message: '检测内容不能为空', trigger: 'blur' }],
|
||||
},
|
||||
],
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<base-dialog
|
||||
:dialogTitle="title"
|
||||
:dialogVisible="open"
|
||||
width="40%"
|
||||
@close="cancel"
|
||||
@cancel="cancel"
|
||||
@confirm="submitForm">
|
||||
<DialogForm
|
||||
v-if="open"
|
||||
ref="form"
|
||||
v-model="form"
|
||||
:rows="[
|
||||
[
|
||||
{
|
||||
select: true,
|
||||
label: '检测类型',
|
||||
prop: 'typeId',
|
||||
url: '/base/quality-inspection-type/listAll',
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '检测类型不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
bind: {
|
||||
filterable: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '检测内容',
|
||||
prop: 'content',
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '检测内容不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '内容编码',
|
||||
prop: 'code',
|
||||
url: '/base/quality-inspection-det/getCode',
|
||||
},
|
||||
{ input: true, label: '备注', prop: 'remark' }],
|
||||
]" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '内容编码',
|
||||
prop: 'code',
|
||||
url: '/base/quality-inspection-det/getCode',
|
||||
},
|
||||
{ input: true, label: '备注', prop: 'remark' },
|
||||
],
|
||||
]" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -145,10 +184,10 @@ export default {
|
||||
width: 180,
|
||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
},
|
||||
{ prop: 'typeName', label: '类型名称', },
|
||||
{ prop: 'content', label: '检测内容', },
|
||||
{ prop: 'code', label: '检测编码', },
|
||||
{ prop: 'remark', label: '备注', },
|
||||
{ prop: 'typeName', label: '检测类型' },
|
||||
{ prop: 'content', label: '检测内容' },
|
||||
{ prop: 'code', label: '检测编码' },
|
||||
{ prop: 'remark', label: '备注' },
|
||||
],
|
||||
// 查询参数
|
||||
queryParams: {
|
@ -1,52 +1,77 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" />
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<SearchBar
|
||||
:formConfigs="searchBarFormConfig"
|
||||
ref="search-bar"
|
||||
@headBtnClick="handleSearchBarBtnClick" />
|
||||
|
||||
<!-- 列表 -->
|
||||
<base-table :table-props="tableProps" :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-data="list"
|
||||
@emitFun="handleEmitFun">
|
||||
<method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" :method-list="tableBtn"
|
||||
@clickBtn="handleTableBtnClick" />
|
||||
</base-table>
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-data="list"
|
||||
@emitFun="handleEmitFun">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
label="操作"
|
||||
:width="120"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleTableBtnClick" />
|
||||
</base-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
<!-- 分页组件 -->
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<base-dialog :dialogTitle="title" :dialogVisible="open" @close="cancel" width="30%" @cancel="cancel"
|
||||
@confirm="submitForm">
|
||||
<DialogForm v-if="open" ref="form" v-model="form" :rows="[
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '检测类型名称',
|
||||
prop: 'name',
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '检测类型名称不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
// bind: {
|
||||
// disabled: true, // some condition, like detail mode...
|
||||
// }
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '检测类型编码',
|
||||
prop: 'code',
|
||||
url: '/base/quality-inspection-type/getCode',
|
||||
},
|
||||
],
|
||||
[{ input: true, label: '备注', prop: 'remark' }],
|
||||
]" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<base-dialog
|
||||
:dialogTitle="title"
|
||||
:dialogVisible="open"
|
||||
@close="cancel"
|
||||
width="30%"
|
||||
@cancel="cancel"
|
||||
@confirm="submitForm">
|
||||
<DialogForm
|
||||
v-if="open"
|
||||
ref="form"
|
||||
v-model="form"
|
||||
:rows="[
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '检测类型',
|
||||
prop: 'name',
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '检测类型不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
// bind: {
|
||||
// disabled: true, // some condition, like detail mode...
|
||||
// }
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '检测类型编码',
|
||||
prop: 'code',
|
||||
url: '/base/quality-inspection-type/getCode',
|
||||
},
|
||||
],
|
||||
[{ input: true, label: '备注', prop: 'remark' }],
|
||||
]" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -89,41 +114,9 @@ export default {
|
||||
width: 180,
|
||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
},
|
||||
{ prop: 'name', label: '检测类型名称' },
|
||||
{ prop: 'code', label: '检测类型编码' },
|
||||
{ prop: 'name', label: '检测类型' },
|
||||
{ prop: 'code', 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: [
|
||||
@ -139,11 +132,6 @@ export default {
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
// {
|
||||
// type: 'button',
|
||||
// btnName: '重置',
|
||||
// name: 'reset',
|
||||
// },
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
@ -29,7 +29,7 @@
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width="30%">
|
||||
width="40%">
|
||||
<add-or-update
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="successSubmit"></add-or-update>
|
||||
@ -42,31 +42,31 @@ import AddOrUpdate from './add-or-updata';
|
||||
import basicPage from '../../../core/mixins/basic-page';
|
||||
import { parseTime } from '../../../core/mixins/code-filter';
|
||||
import {
|
||||
getQualityScrapDetPage,
|
||||
deleteQualityScrapDet,
|
||||
getQualityScrapDetPage,
|
||||
deleteQualityScrapDet,
|
||||
} from '@/api/base/qualityScrapDet';
|
||||
import { getList, } from "@/api/base/qualityScrapType";
|
||||
import { getList } from '@/api/base/qualityScrapType';
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '添加时间',
|
||||
filter: parseTime
|
||||
},
|
||||
{
|
||||
prop: 'content',
|
||||
label: '报废原因'
|
||||
},
|
||||
filter: parseTime,
|
||||
},
|
||||
{
|
||||
prop: 'content',
|
||||
label: '报废原因',
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '报废原因编码'
|
||||
label: '报废原因编码',
|
||||
},
|
||||
{
|
||||
prop: 'typeName',
|
||||
label: '报废类型'
|
||||
label: '报废类型',
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注'
|
||||
label: '备注',
|
||||
},
|
||||
];
|
||||
|
||||
@ -75,41 +75,41 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: getQualityScrapDetPage,
|
||||
deleteURL: deleteQualityScrapDet,
|
||||
getDataListURL: getQualityScrapDetPage,
|
||||
deleteURL: deleteQualityScrapDet,
|
||||
// exportURL: exportFactoryExcel,
|
||||
},
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi(`base:quality-inspection-det:update`)
|
||||
this.$auth.hasPermi(`base:quality-inspection-det:update`)
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:quality-inspection-det:delete`)
|
||||
this.$auth.hasPermi(`base:quality-inspection-det:delete`)
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v)=>v),
|
||||
].filter((v) => v),
|
||||
tableData: [],
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '报废原因',
|
||||
placeholder: '报废原因',
|
||||
param: 'content',
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '报废类型',
|
||||
selectOptions: [],
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
param: 'typeId',
|
||||
},
|
||||
label: '报废原因',
|
||||
placeholder: '报废原因',
|
||||
param: 'content',
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '报废类型',
|
||||
selectOptions: [],
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
param: 'typeId',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
@ -120,11 +120,13 @@ export default {
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:quality-scrap-det:create') ? 'button' : '',
|
||||
type: this.$auth.hasPermi('base:quality-scrap-det:create')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
@ -132,32 +134,32 @@ export default {
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
},
|
||||
created() { },
|
||||
mounted () {
|
||||
this.getDict();
|
||||
},
|
||||
created() {},
|
||||
mounted() {
|
||||
this.getDict();
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
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;
|
||||
});
|
||||
},
|
||||
async getDict() {
|
||||
// 物料列表
|
||||
const res = await getList();
|
||||
this.formConfig[1].selectOptions = res.data;
|
||||
},
|
||||
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;
|
||||
});
|
||||
},
|
||||
async getDict() {
|
||||
// 物料列表
|
||||
const res = await getList();
|
||||
this.formConfig[1].selectOptions = res.data;
|
||||
},
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.content = val.content ? val.content : undefined;
|
||||
this.listQuery.typeId = val.typeId ? val.typeId : undefined;
|
||||
this.listQuery.content = val.content ? val.content : undefined;
|
||||
this.listQuery.typeId = val.typeId ? val.typeId : undefined;
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'reset':
|
108
src/views/devConfig/quality/qualityScrapType/add-or-updata.vue
Normal file
108
src/views/devConfig/quality/qualityScrapType/add-or-updata.vue
Normal file
@ -0,0 +1,108 @@
|
||||
<!--
|
||||
* @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>
|
@ -29,7 +29,7 @@
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width="30%">
|
||||
width="40%">
|
||||
<add-or-update
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="successSubmit"></add-or-update>
|
||||
@ -42,31 +42,31 @@ import AddOrUpdate from './add-or-updata';
|
||||
import basicPage from '../../../core/mixins/basic-page';
|
||||
import { parseTime } from '../../../core/mixins/code-filter';
|
||||
import {
|
||||
getQualityScrapTypePage,
|
||||
deleteQualityScrapType
|
||||
getQualityScrapTypePage,
|
||||
deleteQualityScrapType,
|
||||
} from '@/api/base/qualityScrapType';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '添加时间',
|
||||
filter: parseTime
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
label: '报废类型'
|
||||
},
|
||||
filter: parseTime,
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
label: '报废类型',
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '报废类型编码'
|
||||
label: '报废类型编码',
|
||||
},
|
||||
{
|
||||
prop: 'description',
|
||||
label: '描述信息'
|
||||
label: '描述信息',
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注'
|
||||
label: '备注',
|
||||
},
|
||||
];
|
||||
|
||||
@ -81,25 +81,25 @@ export default {
|
||||
},
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi(`base:quality-scrap-type:update`)
|
||||
this.$auth.hasPermi(`base:quality-scrap-type:update`)
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:quality-scrap-type:delete`)
|
||||
this.$auth.hasPermi(`base:quality-scrap-type:delete`)
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v)=>v),
|
||||
].filter((v) => v),
|
||||
tableData: [],
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '报废类型',
|
||||
placeholder: '报废类型',
|
||||
placeholder: '报废类型',
|
||||
param: 'name',
|
||||
},
|
||||
{
|
||||
@ -112,11 +112,13 @@ export default {
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:quality-scrap-type:create') ? 'button' : '',
|
||||
type: this.$auth.hasPermi('base:quality-scrap-type:create')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
@ -127,14 +129,14 @@ export default {
|
||||
created() {},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
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;
|
||||
});
|
||||
},
|
||||
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':
|
@ -1,209 +0,0 @@
|
||||
<!--
|
||||
* @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>
|
@ -1,222 +0,0 @@
|
||||
<!--
|
||||
* @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>
|
@ -1,213 +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" @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>
|
@ -1,86 +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">
|
||||
<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>
|
@ -1,120 +0,0 @@
|
||||
<!--
|
||||
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>
|
@ -1,80 +0,0 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
@ -1,176 +0,0 @@
|
||||
{
|
||||
"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": ""
|
||||
}
|
259
src/views/quality/qualityScrapLog/add-or-updata.vue
Normal file
259
src/views/quality/qualityScrapLog/add-or-updata.vue
Normal file
@ -0,0 +1,259 @@
|
||||
<!--
|
||||
* @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="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工单号" prop="workOrderId">
|
||||
<el-select
|
||||
v-model="dataForm.workOrderId"
|
||||
placeholder="请选择工单号"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="dict in workOrderList"
|
||||
:key="dict.id"
|
||||
:label="dict.name"
|
||||
:value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="班组" prop="teamId">
|
||||
<el-select
|
||||
v-model="dataForm.teamId"
|
||||
placeholder="请选择班组"
|
||||
style="width: 100%">
|
||||
<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="请输入数量" />
|
||||
</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%">
|
||||
<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%">
|
||||
<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"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
style="width: 100%"
|
||||
placeholder="选择日期"></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%">
|
||||
<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="请输入描述" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-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>
|
284
src/views/quality/qualityScrapLog/detail-or-updata.vue
Normal file
284
src/views/quality/qualityScrapLog/detail-or-updata.vue
Normal file
@ -0,0 +1,284 @@
|
||||
<!--
|
||||
* @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>
|
243
src/views/quality/qualityScrapLog/index.vue
Normal file
243
src/views/quality/qualityScrapLog/index.vue
Normal file
@ -0,0 +1,243 @@
|
||||
<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: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: [],
|
||||
detailOrUpdateVisible: false,
|
||||
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,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
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>
|
Loading…
Reference in New Issue
Block a user