From 04aac2eda9b5d9473eb96d12b32cb76fb45135c6 Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期日, 21 七月 2024 19:52:31 +0800 Subject: [PATCH] 工单更新 --- src/views/tigerprojects/mes/eng/route/components/ActionItemProps.vue | 193 +++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 159 insertions(+), 34 deletions(-) diff --git a/src/views/tigerprojects/mes/eng/route/components/ActionItemProps.vue b/src/views/tigerprojects/mes/eng/route/components/ActionItemProps.vue index 1a4642d..7f6c6f1 100644 --- a/src/views/tigerprojects/mes/eng/route/components/ActionItemProps.vue +++ b/src/views/tigerprojects/mes/eng/route/components/ActionItemProps.vue @@ -1,4 +1,12 @@ <!-- + * @Description: file content + * @Author: your name + * @version: + * @Date: 2024-05-01 17:18:49 + * @LastEditors: Ben Lin + * @LastEditTime: 2024-07-19 15:58:20 +--> +<!-- * @Description: 琛ㄥ崟椤瑰睘鎬э紝鎺т欢灞炴�ч潰鏉� --> <template> @@ -22,9 +30,18 @@ :readonly="true" /> </FormItem> + <FormItem label="琛屼负鍚嶇О" name="琛屼负鍚嶇О"> + <Input + :style="{ width: '100%' }" + v-model:value="routeConfig.currentAct.ACT_NAME" + :min="0" + :step="1" + /> + </FormItem> <FormItem label="琛屼负绫诲瀷" name="琛屼负绫诲瀷"> <ApiSelect - :api="ActTypeStatus" + :api="GetEnum" + :params="{ name: 'MES_ROUTE_NODE_ACT+ACT_TYPEs' }" v-model:value="routeConfig.currentAct.ACT_TYPE" resultField="Data" :label-field="actTypeLable" @@ -32,45 +49,42 @@ placeholder="璇烽�夋嫨琛屼负绫诲瀷" /> </FormItem> - <FormItem label="鑷畾涔夋柟娉曠被鍨�" name="鑷畾涔夋柟娉曠被鍨�"> - <ApiSelect - :api="DoTypeStatus" - v-model:value="routeConfig.currentAct.DO_TYPE" - resultField="Data" - :label-field="actTypeLable" - valueField="Value" - placeholder="璇烽�夋嫨琛屼负绫诲瀷" - /> - </FormItem> - <FormItem label="鑷畾涔夋柟娉�(璋冪敤鏂规硶鐨勫叏鍚�)" name="鑷畾涔夋柟娉�"> + <FormItem label="琛屼负瀹氫箟" name="琛屼负瀹氫箟"> <Input - :style="{ width: '100%' }" - v-model:value="routeConfig.currentAct.DO_METHOD" + :style="{ width: '85%' }" + v-model:value="routeConfig.currentAct.ACT_CODE" :min="0" :step="1" /> + <a-button + class="mt-1 ml-1" + size="small" + @click="handleSelectItem(item)" + preIcon="search|svg" + /> + <GeneralModal @register="registerItemAdd" @success="handleItemSuccess" /> </FormItem> - <FormItem label="閫氳繃鏃舵墽琛�(璋冪敤鏂规硶鐨勫叏鍚�)" name="閫氳繃鏃舵墽琛�"> - <Input - :style="{ width: '100%' }" - v-model:value="routeConfig.currentAct.DO_IF_PASS" - :min="0" - :step="1" + <FormItem label="鏄惁璁剧疆鎵嶈兘涓嬪彂鐢熶骇(Y/N)" name="鏄惁璁剧疆鎵嶈兘涓嬪彂鐢熶骇(Y/N)"> + <Select + ref="select" + v-model:value="routeConfig.currentAct.NEED_SETUP" + style="width: 150px" + :options="needSetupOptions" /> </FormItem> - <FormItem label="澶辫触鏃舵墽琛�(璋冪敤鏂规硶鐨勫叏鍚�)" name="澶辫触鏃舵墽琛�"> - <Input - :style="{ width: '100%' }" - v-model:value="routeConfig.currentAct.DO_IF_FAIL" - :min="0" - :step="1" + <FormItem label="鎵ц鍑洪敊鏃讹紝鏄惁閲嶇疆鏁翠釜宸ュ簭鐨勬搷浣�(Y/N)" name="鎵ц鍑洪敊鏃讹紝鏄惁閲嶇疆鏁翠釜宸ュ簭鐨勬搷浣�(Y/N)"> + <Select + ref="select" + v-model:value="routeConfig.currentAct.NEED_RESET" + style="width: 150px" + :options="needResetOptions" /> </FormItem> <FormItem label="鏄惁鍚敤" name="鏄惁鍚敤"> <Select ref="select" v-model:value="routeConfig.currentAct.IS_ACTIVE" - style="width: 120px" + style="width: 150px" :options="options1" /> </FormItem> @@ -78,15 +92,21 @@ </div> </template> <script lang="ts" setup> - import { Select, Input, Form, FormItem } from 'ant-design-vue'; + import { Select, Input, Form, FormItem, Tag } from 'ant-design-vue'; import { useRouteDesignState } from '../hooks/useRouteDesignState'; + import GeneralModal from '/@/views/components/GeneralModal.vue'; import { SelectTypes } from 'ant-design-vue/es/select'; import { ApiSelect } from '/@/components/Form/index'; - import { ref, unref, watch } from 'vue'; + import { h, ref, unref, watch } from 'vue'; import { useLocale } from '/@/locales/useLocale'; - import { ActTypeStatus, DoTypeStatus } from '/@/api/tigerapi/mes/router'; + import { GetEnum } from '/@/api/tigerapi/system'; + import { useModal } from '/@/components/Modal'; + import { useI18n } from '/@/hooks/web/useI18n'; const { getLocale } = useLocale(); + const { t } = useI18n(); + const emit = defineEmits(['changeName']); + const [registerItemAdd, { openModal: openItemModal }] = useModal(); const { routeConfig, mesRoute } = useRouteDesignState(); const options1 = ref<SelectTypes['options']>([ { @@ -98,21 +118,126 @@ label: '涓嶅惎鐢�', }, ]); + const needSetupOptions = ref<SelectTypes['options']>([ + { + value: 'Y', + label: '蹇呴渶璁剧疆', + }, + { + value: 'N', + label: '鏃犻渶璁剧疆', + }, + ]); + const needResetOptions = ref<SelectTypes['options']>([ + { + value: 'Y', + label: '鏄�', + }, + { + value: 'N', + label: '鍚�', + }, + ]); const actTypeLable = unref(getLocale) == 'zh_CN' ? 'Desc' : 'Name'; watch( () => routeConfig.currentAct, (newVal, oldVal) => { routeConfig.routeData.acts.forEach((r) => { if (r.ID == routeConfig.currentAct.ID) { + if (r.ACT_NAME != newVal.ACT_NAME) { + r.ACT_NAME = newVal.ACT_NAME; + console.log(r.ACT_NAME, newVal.ACT_NAME); + emit('changeName', { id: r.ID, val: r.ACT_NAME }); + } r.IS_ACTIVE = newVal.IS_ACTIVE; r.ACT_TYPE = newVal.ACT_TYPE; - r.DO_TYPE = newVal.DO_TYPE; - r.DO_METHOD = newVal.DO_METHOD; - r.DO_IF_PASS = newVal.DO_IF_PASS; - r.DO_IF_FAIL = newVal.DO_IF_FAIL; + r.ACT_CODE = newVal.ACT_CODE; + r.NEED_SETUP = newVal.NEED_SETUP; + r.NEED_RESET = newVal.NEED_RESET; + // r.DO_TYPE = newVal.DO_TYPE; + // r.DO_METHOD = newVal.DO_METHOD; + // r.DO_IF_PASS = newVal.DO_IF_PASS; + // r.DO_IF_FAIL = newVal.DO_IF_FAIL; } }); }, { deep: true, immediate: true }, ); + + function handleSelectItem(item) { + openItemModal(true, { + title: '宸ュ簭琛屼负瀹氫箟', + schemas: [ + { + field: 'ACT_CODE', + component: 'Input', + label: '琛屼负缂栫爜', + colProps: { + span: 12, + }, + }, + ], + ItemColumns: [ + { + title: t('琛屼负缂栫爜'), + dataIndex: 'ACT_CODE', + resizable: true, + sorter: true, + width: 100, + }, + { + title: t('琛屼负鍚嶇О'), + dataIndex: 'ACT_NAME', + resizable: true, + sorter: true, + width: 100, + }, + { + title: t('琛屼负绫诲瀷'), + dataIndex: 'ACT_TYPE', + resizable: true, + sorter: true, + width: 100, + customRender: ({ record }) => { + const type = record.ACT_TYPE; + var text = ''; + var color = 'green'; + switch (type) { + case 0: + text = '榛樿琛屼负'; + break; + case 1: + color = 'orange'; + text = '鎵爜楠岃瘉'; + break; + case 2: + color = 'blue'; + text = '缁勮涓婃枡'; + break; + case 3: + color = '#24c7cf'; + text = '浜у搧娴嬭瘯'; + break; + case 4: + color = '#550689'; + text = '浜у搧鎶芥'; + break; + case 5: + color = '#bfbfbf'; + text = '鏍囩鎵撳嵃'; + break; + } + return h(Tag, { color: color }, () => text); + }, + }, + ], + tableName: 'MES_CUSTOM_ACT', + rowKey: 'ACT_CODE', + searchInfo: { TABLE_NAME: 'MES_CUSTOM_ACT', ACT_TYPE: routeConfig.currentAct.ACT_TYPE }, + }); + } + + function handleItemSuccess(d, u) { + routeConfig.currentAct.ACT_CODE = d.values['val']; + } </script> -- Gitblit v1.9.3