From 2e9c878dab8b83a5acbfb2caf934a66394b60d98 Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期一, 30 十二月 2024 20:44:20 +0800 Subject: [PATCH] 一些优化 --- src/views/tigerprojects/mes/eng/route/components/PostProps.vue | 47 ++++++++++++++++++++++++++++++----------------- 1 files changed, 30 insertions(+), 17 deletions(-) diff --git a/src/views/tigerprojects/mes/eng/route/components/PostProps.vue b/src/views/tigerprojects/mes/eng/route/components/PostProps.vue index 9574d2e..5a31d94 100644 --- a/src/views/tigerprojects/mes/eng/route/components/PostProps.vue +++ b/src/views/tigerprojects/mes/eng/route/components/PostProps.vue @@ -1,10 +1,10 @@ <!-- - * @Description: file content + * @Description: 宸ヨ壓璺嚎宀椾綅璧勬簮缁存姢 * @Author: Ben Lin * @version: * @Date: 2024-06-11 21:07:04 * @LastEditors: Ben Lin - * @LastEditTime: 2024-07-26 08:48:12 + * @LastEditTime: 2024-10-23 21:36:49 --> <!-- * @Description: 鍙充晶灞炴�ч潰鏉挎帶浠� 琛ㄥ崟灞炴�ч潰鏉� @@ -28,6 +28,7 @@ placement: 'left', confirm: handleDelete.bind(null, record), }, + name: '', }, ]" /> @@ -45,15 +46,9 @@ import { useModal } from '/@/components/Modal'; import GeneralModal from '/@/views/components/GeneralModal.vue'; import { useI18n } from '/@/hooks/web/useI18n'; - import { - DeleteEntity, - DeleteWhere, - SaveEntity, - getEntity, - getListByPage, - } from '/@/api/tigerapi/system'; + import { DeleteWhere, getListByPage } from '/@/api/tigerapi/system'; import { useRouteDesignState } from '../hooks/useRouteDesignState'; - import { SaveRouteNodePost } from '/@/api/tigerapi/mes/router'; + import { SaveRouteNodePost, SaveWoRouteNodePost } from '/@/api/tigerapi/mes/router'; const { t } = useI18n(); const { routeConfig, mesRoute } = useRouteDesignState(); @@ -81,7 +76,9 @@ const [registerTable, { reload }] = useTable({ title: '鍒楄〃', api: getListByPage, - searchInfo: { TABLE_NAME: 'V_MES_ROUTE_NODE_POST', NODE_ID: routeConfig.currentItem.ID }, + searchInfo: routeConfig['isWorkOrder'] + ? { TABLE_NAME: 'V_MES_WO_NODE_POST', NODE_ID: routeConfig['currentItem'].ID } + : { TABLE_NAME: 'V_MES_ROUTE_NODE_POST', NODE_ID: routeConfig['currentItem'].ID }, columns, useSearchForm: false, showTableSetting: false, @@ -154,7 +151,11 @@ ], tableName: 'MES_POSITION', rowKey: 'POST_CODE', - searchInfo: { TABLE_NAME: 'MES_POSITION' }, + searchInfo: { + TABLE_NAME: 'MES_POSITION', + OPER_CODE: routeConfig['currentItem'].OPER_CODE, + nolike: 'Y', + }, }); } @@ -164,9 +165,10 @@ * @return {*} */ function handleDelete(record: Recordable) { + let entityName = routeConfig['isWorkOrder'] ? 'MES_WO_NODE_POST' : 'MES_ROUTE_NODE_POST'; DeleteWhere( `POST_CODE = '${record.POST_CODE}' And NODE_ID = '${record.NODE_ID}'`, - 'MES_ROUTE_NODE_POST', + entityName, ).then((res) => { reload(); }); @@ -183,10 +185,21 @@ let eintity: any[] = []; var i; for (i = 0; i < codes.length; i++) { - eintity.push({ NODE_ID: routeConfig.currentItem.ID, POST_CODE: codes[i], REMARK: '' }); + eintity.push({ + NODE_ID: routeConfig['currentItem'].ID, + POST_CODE: codes[i], + REMARK: '', + WORK_ORDER: routeConfig['currentItem'].WORK_ORDER, + }); } - SaveRouteNodePost(eintity).then((res) => { - reload(); - }); + if (routeConfig['isWorkOrder']) { + SaveWoRouteNodePost(eintity).then((res) => { + reload(); + }); + } else { + SaveRouteNodePost(eintity).then((res) => { + reload(); + }); + } } </script> -- Gitblit v1.9.3