From c9f779c19d920efcca14fd17bbcca8254f92790d Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期四, 22 八月 2024 10:22:40 +0800 Subject: [PATCH] 绑定工艺更新 --- src/views/tigerprojects/mes/prod/biz_mes_wo/biz_mes_wo.data.ts | 174 +++++++++++++++++++++++++++++++++++++-------------------- 1 files changed, 113 insertions(+), 61 deletions(-) diff --git a/src/views/tigerprojects/mes/prod/biz_mes_wo/biz_mes_wo.data.ts b/src/views/tigerprojects/mes/prod/biz_mes_wo/biz_mes_wo.data.ts index 5acf20a..f4bb103 100644 --- a/src/views/tigerprojects/mes/prod/biz_mes_wo/biz_mes_wo.data.ts +++ b/src/views/tigerprojects/mes/prod/biz_mes_wo/biz_mes_wo.data.ts @@ -1,10 +1,9 @@ import { BasicColumn, FormSchema } from '/@/components/Table'; -import { optionsListApi, optionsListApiType } from '/@/api/tigerapi/mes/smt/tool'; import { h, unref } from 'vue'; import { Tag, Tooltip } from 'ant-design-vue'; import { useLocale } from '/@/locales/useLocale'; -import { MesWoStatus } from '/@/api/tigerapi/mes/wo'; import { useI18n } from '/@/hooks/web/useI18n'; +import { GetEnum, getEntity } from '/@/api/tigerapi/system'; const { getLocale } = useLocale(); const { t } = useI18n(); @@ -35,13 +34,37 @@ let text = ''; let color = ''; switch (record.ORDER_TYPE) { - case 'Normal': - text = '姝e父'; + case 0: + text = '璁″垝'; + color = '#8a8a8a'; + break; + case 1: + text = '鏍囧噯'; color = 'green'; break; - case 'Rework': + case 2: text = '杩斿伐'; color = 'red'; + break; + case 3: + text = '鍦ㄥ簱鏀瑰埗'; + color = 'blue'; + break; + case 5: + text = '濮斿'; + color = 'yellow'; + break; + case 6: + text = '鐮斿彂'; + color = 'orange'; + break; + case 7: + text = '棰勬祴'; + color = '#078737'; + break; + case 8: + text = '鎷嗗嵏'; + color = '#e1822c'; break; default: break; @@ -55,13 +78,13 @@ sorter: true, resizable: true, customRender: ({ record }) => { - const status = record.STATUS; + const status = record.ROUTE_STATUS; let text = ''; let color = ''; switch (status) { case 0: text = '寰呴厤缃�'; - color = '#515151'; + color = '#8a8a8a'; break; case 1: text = '宸查厤缃�'; @@ -93,7 +116,7 @@ switch (status) { case 0: text = '鍒濆鍖�'; - color = '#515151'; + color = '#8a8a8a'; break; case 1: text = '宸插鍏�'; @@ -120,6 +143,12 @@ } return h(Tooltip, { title: text }, () => h(Tag, { color: color }, () => text)); }, + }, + { + title: '璁″垝鏁伴噺', + dataIndex: 'PLAN_QTY', + sorter: true, + resizable: true, }, { title: '宸ヨ壓璺嚎缂栫爜', @@ -247,7 +276,8 @@ component: 'ApiSelect', colProps: { span: 8 }, componentProps: { - api: MesWoStatus, + api: GetEnum, + params: { name: 'BIZ_MES_WO+STATUSs' }, resultField: 'Data', labelField: unref(getLocale) == 'zh_CN' ? 'Desc' : 'Name', valueField: 'Value', @@ -256,20 +286,16 @@ { field: 'ORDER_TYPE', label: '宸ュ崟绫诲瀷', - component: 'Select', + component: 'ApiSelect', colProps: { span: 8 }, defaultValue: '', componentProps: { - options: [ - { - label: '姝e父', - value: 'Normal', - }, - { - label: '杩斿伐', - value: 'Rework', - }, - ], + api: GetEnum, + params: { name: 'BIZ_MES_WO+ORDER_TYPEs' }, + resultField: 'Data', + labelField: unref(getLocale) == 'zh_CN' ? 'Desc' : 'Name', + valueField: 'Value', + placeholder: '璇烽�夋嫨宸ュ崟绫诲瀷', }, }, { @@ -287,6 +313,14 @@ span: 4, }, }, + { + field: 'TABLE_NAME', + label: '琛ㄥ悕', + component: 'Input', + colProps: { span: 8 }, + defaultValue: 'BIZ_MES_WO', ////蹇呴渶鍦ㄩ〉闈㈢殑鏌ヨ閮ㄥ垎鍔犲叆'TABLE_NAME'瀛楁骞惰祴鍊艰〃鍚嶏紝杩欐牱灏卞彲浠ョ敤閫氱敤鍒嗛〉鏌ヨ + ifShow: false, + }, ]; //鏂板缁勪欢export const @@ -296,7 +330,7 @@ label: '宸ュ崟鍙�', required: true, component: 'Input', - colProps: { span: 12 }, + colProps: { span: 24 }, }, { field: 'ID', @@ -309,26 +343,27 @@ label: '宸ュ崟鎻忚堪', component: 'Input', show: false, - colProps: { span: 12 }, + colProps: { span: 24 }, }, { field: 'ORDER_TYPE', label: '宸ュ崟绫诲瀷', - component: 'Select', - colProps: { span: 12 }, - defaultValue: 'Normal', + component: 'ApiSelect', + colProps: { span: 24 }, + defaultValue: 1, componentProps: { - options: [ - { - label: '姝e父', - value: 'Normal', - }, - { - label: '杩斿伐', - value: 'Rework', - }, - ], + api: GetEnum, + params: { name: 'BIZ_MES_WO+ORDER_TYPEs' }, + resultField: 'Data', + labelField: unref(getLocale) == 'zh_CN' ? 'Desc' : 'Name', + valueField: 'Value', }, + }, + { + field: 'PLAN_QTY', + label: '璁″垝鏁伴噺', + component: 'Input', + show: true, }, { field: 'STATUS', @@ -341,75 +376,92 @@ label: '鐖跺伐鍗�', //required: true, component: 'Input', - colProps: { span: 12 }, + colProps: { span: 24 }, }, { field: 'ITEM_CODE', label: '鐗╂枡缂栫爜', required: true, component: 'Input', - colProps: { span: 12 }, + colProps: { span: 20 }, + }, + { + field: '0', + component: 'Input', + label: '1', + colSlot: 'addItem', + colProps: { + span: 4, + }, }, { field: 'ITEM_TYPE', label: '鐗╂枡绫诲瀷', //required: true, component: 'Input', - colProps: { span: 12 }, + colProps: { span: 24 }, }, { field: 'ITEM_MODEL', label: '鏈哄瀷', //required: true, component: 'Input', - colProps: { span: 12 }, + colProps: { span: 24 }, }, { field: 'PRIORITY', label: '浼樺厛绾�', //required: true, component: 'Input', - colProps: { span: 12 }, + colProps: { span: 24 }, }, { field: 'CUST_CODE', label: '瀹㈡埛缂栫爜', required: true, component: 'Input', - colProps: { span: 12 }, - }, - { - field: 'FACTORY', - label: '宸ュ巶', - required: true, - component: 'ApiSelect', - colProps: { span: 12 }, - componentProps: { - api: optionsListApiType, - resultField: 'Data', - labelField: 'Name', - valueField: 'Value', - }, + colProps: { span: 24 }, }, { field: 'PLAN_LINE', label: '璁″垝绾夸綋', required: true, - component: 'Input', - colProps: { span: 12 }, + component: 'ApiSelect', + colProps: { span: 24 }, + componentProps: { + api: getEntity, + params: { entityName: 'MES_LINE', sqlcmd: ' 1=1 ' }, + resultField: 'Data.Items', + labelField: 'LINE_NAME', + valueField: 'LINE_CODE', + }, }, { field: 'ACT_LINE', label: '瀹為檯绾夸綋', // required: true, - component: 'Input', - colProps: { span: 12 }, + component: 'ApiSelect', + colProps: { span: 24 }, + componentProps: { + api: getEntity, + params: { entityName: 'MES_LINE', sqlcmd: ' 1=1 ' }, + resultField: 'Data.Items', + labelField: 'LINE_NAME', + valueField: 'LINE_CODE', + }, + }, + { + field: 'PLAN_START_TIME', + label: '璁″垝寮�濮嬫椂闂�', + required: true, + component: 'DatePicker', + colProps: { span: 24 }, }, { field: 'PLAN_END_TIME', - label: '璁″垝寮�濮嬫椂闂�', + label: '璁″垝缁撴潫鏃堕棿', required: true, - component: 'Input', - colProps: { span: 12 }, + component: 'DatePicker', + colProps: { span: 24 }, }, ]; -- Gitblit v1.9.3