From 91c82965b2d987452ca276e3a03b48c8dcda2ae9 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期三, 19 八月 2026 11:47:26 +0800
Subject: [PATCH] config(env): 更新生产环境配置和公司名称
---
src/views/mes/pro/batch/data.ts | 336 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 336 insertions(+), 0 deletions(-)
diff --git a/src/views/mes/pro/batch/data.ts b/src/views/mes/pro/batch/data.ts
new file mode 100644
index 0000000..1b765a7
--- /dev/null
+++ b/src/views/mes/pro/batch/data.ts
@@ -0,0 +1,336 @@
+import type { VbenFormSchema } from '#/adapter/form';
+import type { VxeTableGridOptions } from '#/adapter/vxe-table';
+import type { MesProBatchApi } from '#/api/mes/pro/batch';
+
+import { markRaw } from 'vue';
+
+import { DICT_TYPE } from '@vben/constants';
+import { getDictOptions } from '@vben/hooks';
+
+import { MdmItemSelect } from '#/views/basicData/mdm/components';
+import { ProLineSelect } from '#/views/mes/pro/line/components';
+import { UserSelect } from '#/views/system/user/components';
+import { getRangePickerDefaultProps } from '#/utils';
+
+/** 琛ㄥ崟绫诲瀷 */
+export type FormType = 'create' | 'detail' | 'update';
+
+/** 鏂板/淇敼鐨勮〃鍗� */
+export function useFormSchema(formType: FormType): VbenFormSchema[] {
+ const disabled = formType === 'detail';
+ return [
+ {
+ fieldName: 'id',
+ component: 'Input',
+ dependencies: {
+ triggerFields: [''],
+ show: () => false,
+ },
+ },
+ {
+ fieldName: 'code',
+ label: '鎵规鍙�',
+ component: 'Input',
+ componentProps: {
+ disabled: true,
+ placeholder: '淇濆瓨鍚庤嚜鍔ㄧ敓鎴�',
+ },
+ dependencies: {
+ triggerFields: [''],
+ show: () => formType !== 'create',
+ },
+ },
+ {
+ fieldName: 'status',
+ label: '鎵规鐘舵��',
+ component: 'Select',
+ componentProps: {
+ disabled: true,
+ options: getDictOptions(DICT_TYPE.MES_PRO_BATCH_STATUS, 'number'),
+ },
+ dependencies: {
+ triggerFields: [''],
+ show: () => formType !== 'create',
+ },
+ },
+ {
+ fieldName: 'itemId',
+ label: '鍝佺',
+ component: markRaw(MdmItemSelect),
+ componentProps: {
+ disabled,
+ placeholder: '璇烽�夋嫨鍝佺锛堜骇鍝佸搧绉嶏級',
+ },
+ rules: 'selectRequired',
+ },
+ {
+ fieldName: 'lineId',
+ label: '浜х嚎',
+ component: markRaw(ProLineSelect),
+ componentProps: {
+ disabled,
+ placeholder: '璇烽�夋嫨浜х嚎',
+ },
+ rules: 'selectRequired',
+ },
+ {
+ fieldName: 'produceDate',
+ label: '鐢熶骇鏃ユ湡',
+ component: 'DatePicker',
+ componentProps: {
+ class: '!w-full',
+ disabled,
+ format: 'YYYY-MM-DD HH:mm:ss',
+ placeholder: '璇烽�夋嫨鐢熶骇鏃ユ湡',
+ showTime: true,
+ valueFormat: 'YYYY-MM-DD HH:mm:ss',
+ },
+ rules: 'required',
+ },
+ {
+ fieldName: 'planQuantity',
+ label: '璁″垝鏁伴噺',
+ component: 'InputNumber',
+ componentProps: {
+ class: '!w-full',
+ disabled,
+ min: 0,
+ placeholder: '璇疯緭鍏ヨ鍒掓暟閲�',
+ precision: 2,
+ },
+ },
+ {
+ fieldName: 'ownerUserId',
+ label: '璐d换浜�',
+ component: markRaw(UserSelect),
+ componentProps: {
+ disabled,
+ placeholder: '璇烽�夋嫨璐d换浜�',
+ },
+ rules: 'selectRequired',
+ },
+ {
+ fieldName: 'remark',
+ label: '澶囨敞',
+ component: 'Textarea',
+ formItemClass: 'col-span-3',
+ componentProps: {
+ disabled,
+ placeholder: '璇疯緭鍏ュ娉�',
+ rows: 2,
+ },
+ },
+ ];
+}
+
+/** 鍒楄〃鐨勬悳绱㈣〃鍗� */
+export function useGridFormSchema(): VbenFormSchema[] {
+ return [
+ {
+ fieldName: 'code',
+ label: '鎵规鍙�',
+ component: 'Input',
+ componentProps: {
+ allowClear: true,
+ placeholder: '璇疯緭鍏ユ壒娆″彿',
+ },
+ },
+ {
+ fieldName: 'itemId',
+ label: '鍝佺',
+ component: markRaw(MdmItemSelect),
+ componentProps: {
+ placeholder: '璇烽�夋嫨鍝佺',
+ },
+ },
+ {
+ fieldName: 'lineCode',
+ label: '浜х嚎缂栫爜',
+ component: 'Input',
+ componentProps: {
+ allowClear: true,
+ placeholder: '璇疯緭鍏ヤ骇绾跨紪鐮�',
+ },
+ },
+ {
+ fieldName: 'lineName',
+ label: '浜х嚎鍚嶇О',
+ component: 'Input',
+ componentProps: {
+ allowClear: true,
+ placeholder: '璇疯緭鍏ヤ骇绾垮悕绉�',
+ },
+ },
+ {
+ fieldName: 'ownerUserId',
+ label: '璐d换浜�',
+ component: markRaw(UserSelect),
+ componentProps: {
+ placeholder: '璇烽�夋嫨璐d换浜�',
+ },
+ },
+ {
+ fieldName: 'status',
+ label: '鎵规鐘舵��',
+ component: 'Select',
+ componentProps: {
+ allowClear: true,
+ options: getDictOptions(DICT_TYPE.MES_PRO_BATCH_STATUS, 'number'),
+ placeholder: '璇烽�夋嫨鎵规鐘舵��',
+ },
+ },
+ {
+ fieldName: 'produceDate',
+ label: '鐢熶骇鏃ユ湡',
+ component: 'RangePicker',
+ componentProps: {
+ ...getRangePickerDefaultProps(),
+ allowClear: true,
+ },
+ },
+ {
+ fieldName: 'createTime',
+ label: '鍒涘缓鏃堕棿',
+ component: 'RangePicker',
+ componentProps: {
+ ...getRangePickerDefaultProps(),
+ allowClear: true,
+ },
+ },
+ ];
+}
+
+/** 鍒楄〃鐨勫瓧娈� */
+export function useGridColumns(): VxeTableGridOptions<MesProBatchApi.Batch>['columns'] {
+ return [
+ {
+ field: 'code',
+ title: '鎵规鍙�',
+ fixed: 'left',
+ minWidth: 200,
+ slots: { default: 'code' },
+ },
+ {
+ field: 'itemCode',
+ title: '鍝佺缂栫爜',
+ width: 120,
+ },
+ {
+ field: 'itemName',
+ title: '鍝佺鍚嶇О',
+ width: 140,
+ },
+ {
+ field: 'lineCode',
+ title: '浜х嚎缂栫爜',
+ width: 100,
+ },
+ {
+ field: 'lineName',
+ title: '浜х嚎鍚嶇О',
+ width: 120,
+ },
+ {
+ field: 'produceDate',
+ title: '鐢熶骇鏃ユ湡',
+ width: 170,
+ formatter: 'formatDateTime',
+ },
+ {
+ field: 'planQuantity',
+ title: '璁″垝鏁伴噺',
+ width: 100,
+ },
+ {
+ field: 'ownerUserName',
+ title: '璐d换浜�',
+ width: 100,
+ },
+ {
+ field: 'bagQuantity',
+ title: '琚嬬爜鏁伴噺',
+ width: 90,
+ },
+ {
+ field: 'palletQuantity',
+ title: '鎵樼洏鐮佹暟閲�',
+ width: 100,
+ },
+ {
+ field: 'status',
+ title: '鎵规鐘舵��',
+ width: 100,
+ cellRender: {
+ name: 'CellDict',
+ props: { type: DICT_TYPE.MES_PRO_BATCH_STATUS },
+ },
+ },
+ {
+ field: 'createTime',
+ title: '鍒涘缓鏃堕棿',
+ width: 170,
+ formatter: 'formatDateTime',
+ },
+ {
+ title: '鎿嶄綔',
+ width: 300,
+ fixed: 'right',
+ slots: { default: 'actions' },
+ },
+ ];
+}
+
+/** 鐢熶骇浜哄憳閰嶇疆瀛愯〃鐨勫瓧娈碉紙鍙紪杈戞�侊級 */
+export function useWorkerEditGridColumns(): VxeTableGridOptions<MesProBatchApi.BatchWorker>['columns'] {
+ return [
+ {
+ field: 'userId',
+ title: '鐢熶骇浜哄憳',
+ minWidth: 200,
+ slots: { default: 'userId' },
+ },
+ {
+ field: 'workerType',
+ title: '宀椾綅绫诲瀷',
+ width: 160,
+ slots: { default: 'workerType' },
+ },
+ {
+ field: 'remark',
+ title: '澶囨敞',
+ minWidth: 160,
+ slots: { default: 'remark' },
+ },
+ {
+ title: '鎿嶄綔',
+ width: 80,
+ fixed: 'right',
+ slots: { default: 'actions' },
+ },
+ ];
+}
+
+/** 鐢熶骇浜哄憳閰嶇疆瀛愯〃鐨勫瓧娈碉紙鍙鎬侊級 */
+export function useWorkerReadGridColumns(): VxeTableGridOptions<MesProBatchApi.BatchWorker>['columns'] {
+ return [
+ {
+ field: 'userName',
+ title: '浜哄憳濮撳悕',
+ minWidth: 160,
+ },
+ {
+ field: 'workerType',
+ title: '宀椾綅绫诲瀷',
+ width: 160,
+ cellRender: {
+ name: 'CellDict',
+ props: { type: DICT_TYPE.MES_PRO_BATCH_WORKER_TYPE },
+ },
+ },
+ {
+ field: 'remark',
+ title: '澶囨敞',
+ minWidth: 160,
+ },
+ ];
+}
--
Gitblit v1.9.3