From 82f6392c1e2589a839b0944ba7f07c79542b30ed Mon Sep 17 00:00:00 2001
From: gaojs <757918719@qq.com>
Date: Mon, 6 May 2024 11:07:45 +0800
Subject: [PATCH] =?UTF-8?q?MES=E2=80=94=E2=80=94>=20=E5=8F=AB=E6=96=99?=
=?UTF-8?q?=E8=A1=A5=E6=96=99=E5=89=8D=E5=90=8E=E7=AB=AF=E7=94=9F=E6=88=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/mes/itemRequestMain/index.ts | 60 +++++
src/views/mes/itemRequestMain/index.vue | 244 ++++++++++++++++++
.../itemRequestMain/itemRequestMain.data.ts | 170 ++++++++++++
3 files changed, 474 insertions(+)
create mode 100644 src/api/mes/itemRequestMain/index.ts
create mode 100644 src/views/mes/itemRequestMain/index.vue
create mode 100644 src/views/mes/itemRequestMain/itemRequestMain.data.ts
diff --git a/src/api/mes/itemRequestMain/index.ts b/src/api/mes/itemRequestMain/index.ts
new file mode 100644
index 000000000..9cc8e205f
--- /dev/null
+++ b/src/api/mes/itemRequestMain/index.ts
@@ -0,0 +1,60 @@
+import request from '@/config/axios'
+
+export interface ItemRequestMainVO {
+ deleteTime: Date
+ id: number
+ status: string
+ concurrencyStamp: number
+ remark: string
+ deleter: string
+ siteId: number
+ planDayCode: string
+ workBillNo: string
+ batchCode: string
+ requestBillNo: string
+ workstationCode: string
+ productCode: string
+ processCode: string
+ requestType: string
+}
+
+// 查询叫料申请单主列表
+export const getItemRequestMainPage = async (params) => {
+ if (params.isSearch) {
+ delete params.isSearch
+ const data = {...params}
+ return await request.post({ url: '/mes/item-request-main/senior', data })
+ } else {
+ return await request.get({ url: `/mes/item-request-main/page`, params })
+ }
+}
+
+// 查询叫料申请单主详情
+export const getItemRequestMain = async (id: number) => {
+ return await request.get({ url: `/mes/item-request-main/get?id=` + id })
+}
+
+// 新增叫料申请单主
+export const createItemRequestMain = async (data: ItemRequestMainVO) => {
+ return await request.post({ url: `/mes/item-request-main/create`, data })
+}
+
+// 修改叫料申请单主
+export const updateItemRequestMain = async (data: ItemRequestMainVO) => {
+ return await request.put({ url: `/mes/item-request-main/update`, data })
+}
+
+// 删除叫料申请单主
+export const deleteItemRequestMain = async (id: number) => {
+ return await request.delete({ url: `/mes/item-request-main/delete?id=` + id })
+}
+
+// 导出叫料申请单主 Excel
+export const exportItemRequestMain = async (params) => {
+ return await request.download({ url: `/mes/item-request-main/export-excel`, params })
+}
+
+// 下载用户导入模板
+export const importTemplate = () => {
+ return request.download({ url: '/mes/item-request-main/get-import-template' })
+}
\ No newline at end of file
diff --git a/src/views/mes/itemRequestMain/index.vue b/src/views/mes/itemRequestMain/index.vue
new file mode 100644
index 000000000..6db2e2d19
--- /dev/null
+++ b/src/views/mes/itemRequestMain/index.vue
@@ -0,0 +1,244 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ row.code }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/mes/itemRequestMain/itemRequestMain.data.ts b/src/views/mes/itemRequestMain/itemRequestMain.data.ts
new file mode 100644
index 000000000..602571af5
--- /dev/null
+++ b/src/views/mes/itemRequestMain/itemRequestMain.data.ts
@@ -0,0 +1,170 @@
+import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
+import { dateFormatter } from '@/utils/formatTime'
+
+// 表单校验
+export const ItemRequestMainRules = reactive({
+ concurrencyStamp: [required],
+})
+
+export const ItemRequestMain = useCrudSchemas(reactive([
+ {
+ label: '删除时间',
+ field: 'deleteTime',
+ sort: 'custom',
+ formatter: dateFormatter,
+ isSearch: false,
+ isTable: false,
+ isForm: false,
+ isDetail:false,
+ search: {
+ component: 'DatePicker',
+ componentProps: {
+ valueFormat: 'YYYY-MM-DD HH:mm:ss',
+ type: 'daterange',
+ defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
+ }
+ },
+ form: {
+ component: 'DatePicker',
+ componentProps: {
+ type: 'datetime',
+ valueFormat: 'x'
+ }
+ },
+ },
+ {
+ label: '主键',
+ field: 'id',
+ sort: 'custom',
+ isSearch: false,
+ isTable: false,
+ isForm: false,
+ isDetail:false,
+ },
+ {
+ label: '状态',
+ field: 'status',
+ sort: 'custom',
+ isSearch: true,
+ form: {
+ component: 'Radio'
+ },
+ },
+ {
+ label: '并发乐观锁',
+ field: 'concurrencyStamp',
+ sort: 'custom',
+ isSearch: false,
+ isTable: false,
+ isForm: false,
+ isDetail:false,
+ form: {
+ component: 'InputNumber',
+ value: 0
+ },
+ },
+ {
+ label: '备注',
+ field: 'remark',
+ sort: 'custom',
+ isSearch: true,
+ },
+ {
+ label: '创建时间',
+ field: 'createTime',
+ sort: 'custom',
+ formatter: dateFormatter,
+ isSearch: true,
+ search: {
+ component: 'DatePicker',
+ componentProps: {
+ valueFormat: 'YYYY-MM-DD HH:mm:ss',
+ type: 'daterange',
+ defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
+ }
+ },
+ isForm: false,
+ },
+ {
+ label: '删除用户名',
+ field: 'deleter',
+ sort: 'custom',
+ isSearch: false,
+ isTable: false,
+ isForm: false,
+ isDetail:false,
+ },
+ {
+ label: '位置ID',
+ field: 'siteId',
+ sort: 'custom',
+ isSearch: false,
+ isTable: false,
+ isForm: false,
+ isDetail:false,
+ form: {
+ component: 'InputNumber',
+ value: 0
+ },
+ },
+ {
+ label: '计划编码',
+ field: 'planDayCode',
+ sort: 'custom',
+ isSearch: true,
+ },
+ {
+ label: '工单编码',
+ field: 'workBillNo',
+ sort: 'custom',
+ isSearch: true,
+ },
+ {
+ label: '批次编码',
+ field: 'batchCode',
+ sort: 'custom',
+ isSearch: true,
+ },
+ {
+ label: '申请单号',
+ field: 'requestBillNo',
+ sort: 'custom',
+ isSearch: true,
+ },
+ {
+ label: '工位编码',
+ field: 'workstationCode',
+ sort: 'custom',
+ isSearch: true,
+ },
+ {
+ label: '产品编码',
+ field: 'productCode',
+ sort: 'custom',
+ isSearch: true,
+ },
+ {
+ label: '工序编码',
+ field: 'processCode',
+ sort: 'custom',
+ isSearch: true,
+ },
+ {
+ label: '类型(1:叫料、2:补料)',
+ field: 'requestType',
+ sort: 'custom',
+ isSearch: true,
+ form: {
+ component: 'SelectV2'
+ },
+ },
+ {
+ label: '操作',
+ field: 'action',
+ isForm: false,
+ table: {
+ width: 150,
+ fixed: 'right'
+ }
+ }
+]))