From 3c9a4bbc3aec2ff83ef0e807b60b416311727da8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=99=88=E5=AE=9C=E9=98=B3?= <1301318913@qq.com>
Date: Wed, 27 Mar 2024 11:07:57 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0mes=E5=B7=A5=E4=BD=9C?=
=?UTF-8?q?=E6=97=A5=E5=8E=86=E6=8E=92=E4=BA=A7=E8=AE=A1=E5=88=92=E8=8F=9C?=
=?UTF-8?q?=E5=8D=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/mes/productionPlan/index.ts | 61 +++++
src/views/mes/productionPlan/index.vue | 244 ++++++++++++++++++
.../mes/productionPlan/productionPlan.data.ts | 182 +++++++++++++
3 files changed, 487 insertions(+)
create mode 100644 src/api/mes/productionPlan/index.ts
create mode 100644 src/views/mes/productionPlan/index.vue
create mode 100644 src/views/mes/productionPlan/productionPlan.data.ts
diff --git a/src/api/mes/productionPlan/index.ts b/src/api/mes/productionPlan/index.ts
new file mode 100644
index 000000000..de60663ba
--- /dev/null
+++ b/src/api/mes/productionPlan/index.ts
@@ -0,0 +1,61 @@
+import request from '@/config/axios'
+
+export interface ProductionPlanVO {
+ id: number
+ planCode: string
+ planName: string
+ teamType: string
+ endTime: Date
+ shiftMode: string
+ billState: number
+ deleteTime: Date
+ status: string
+ concurrencyStamp: number
+ remark: string
+ deleter: string
+ siteId: number
+ textOne: string
+ textTwo: string
+ textThree: string
+}
+
+// 查询生产排产计划列表
+export const getProductionPlanPage = async (params) => {
+ if (params.isSearch) {
+ delete params.isSearch
+ const data = {...params}
+ return await request.post({ url: '/mes/productionPlan/senior', data })
+ } else {
+ return await request.get({ url: `/mes/productionPlan/page`, params })
+ }
+}
+
+// 查询生产排产计划详情
+export const getProductionPlan = async (id: number) => {
+ return await request.get({ url: `/mes/productionPlan/get?id=` + id })
+}
+
+// 新增生产排产计划
+export const createProductionPlan = async (data: ProductionPlanVO) => {
+ return await request.post({ url: `/mes/productionPlan/create`, data })
+}
+
+// 修改生产排产计划
+export const updateProductionPlan = async (data: ProductionPlanVO) => {
+ return await request.put({ url: `/mes/productionPlan/update`, data })
+}
+
+// 删除生产排产计划
+export const deleteProductionPlan = async (id: number) => {
+ return await request.delete({ url: `/mes/productionPlan/delete?id=` + id })
+}
+
+// 导出生产排产计划 Excel
+export const exportProductionPlan = async (params) => {
+ return await request.download({ url: `/mes/productionPlan/export-excel`, params })
+}
+
+// 下载用户导入模板
+export const importTemplate = () => {
+ return request.download({ url: '/mes/productionPlan/get-import-template' })
+}
\ No newline at end of file
diff --git a/src/views/mes/productionPlan/index.vue b/src/views/mes/productionPlan/index.vue
new file mode 100644
index 000000000..1c9271bea
--- /dev/null
+++ b/src/views/mes/productionPlan/index.vue
@@ -0,0 +1,244 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ row.code }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/mes/productionPlan/productionPlan.data.ts b/src/views/mes/productionPlan/productionPlan.data.ts
new file mode 100644
index 000000000..539264c0e
--- /dev/null
+++ b/src/views/mes/productionPlan/productionPlan.data.ts
@@ -0,0 +1,182 @@
+import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
+import { dateFormatter } from '@/utils/formatTime'
+
+// 表单校验
+export const ProductionPlanRules = reactive({
+ endTime: [required],
+ concurrencyStamp: [required],
+})
+
+export const ProductionPlan = useCrudSchemas(reactive([
+ {
+ label: 'id',
+ field: 'id',
+ sort: 'custom',
+ isForm: false,
+ },
+ {
+ label: '计划编号',
+ field: 'planCode',
+ sort: 'custom',
+ isSearch: true,
+ },
+ {
+ label: '计划名称',
+ field: 'planName',
+ sort: 'custom',
+ isSearch: true,
+ },
+ {
+ label: '班组类型',
+ field: 'teamType',
+ sort: 'custom',
+ isSearch: true,
+ // form: {
+ // component: 'SelectV2'
+ // },
+ },
+ {
+ label: '结束时间',
+ field: 'endTime',
+ 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')]
+ }
+ },
+ form: {
+ component: 'DatePicker',
+ componentProps: {
+ type: 'datetime',
+ valueFormat: 'x'
+ }
+ },
+ },
+ {
+ label: '轮班方式',
+ field: 'shiftMode',
+ sort: 'custom',
+ isSearch: true,
+ },
+ {
+ label: '单据状态',
+ field: 'billState',
+ sort: 'custom',
+ isSearch: true,
+ form: {
+ component: 'InputNumber',
+ value: 0
+ },
+ },
+ {
+ label: '删除时间',
+ field: 'deleteTime',
+ 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')]
+ }
+ },
+ form: {
+ component: 'DatePicker',
+ componentProps: {
+ type: 'datetime',
+ valueFormat: 'x'
+ }
+ },
+ },
+ {
+ label: '状态',
+ field: 'status',
+ sort: 'custom',
+ isSearch: true,
+ form: {
+ component: 'Radio'
+ },
+ },
+ {
+ label: '并发乐观锁',
+ field: 'concurrencyStamp',
+ sort: 'custom',
+ isSearch: 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: true,
+ },
+ {
+ label: '位置ID',
+ field: 'siteId',
+ sort: 'custom',
+ isSearch: false,
+ form: {
+ component: 'InputNumber',
+ value: 0
+ },
+ },
+ {
+ label: '备用字段一',
+ field: 'textOne',
+ sort: 'custom',
+ isSearch: false,
+ },
+ {
+ label: '备用字段二',
+ field: 'textTwo',
+ sort: 'custom',
+ isSearch: false,
+ },
+ {
+ label: '备用字段三',
+ field: 'textThree',
+ sort: 'custom',
+ isSearch: false,
+ },
+ {
+ label: '操作',
+ field: 'action',
+ isForm: false,
+ table: {
+ width: 150,
+ fixed: 'right'
+ }
+ }
+]))