From c8f8a9c645f7857859a9d56fac96192d994be70b Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期一, 24 六月 2024 18:48:29 +0800 Subject: [PATCH] 按钮权限更新 --- src/views/tigerprojects/system/lowcode/composition/RouteAction.vue | 90 ++++++++++++++++++++++++--------------------- 1 files changed, 48 insertions(+), 42 deletions(-) diff --git a/src/views/tigerprojects/system/lowcode/composition/RouteAction.vue b/src/views/tigerprojects/system/lowcode/composition/RouteAction.vue index cc0363e..f72ddea 100644 --- a/src/views/tigerprojects/system/lowcode/composition/RouteAction.vue +++ b/src/views/tigerprojects/system/lowcode/composition/RouteAction.vue @@ -4,7 +4,7 @@ * @version: * @Date: 2024-06-20 12:13:27 * @LastEditors: Ben Lin - * @LastEditTime: 2024-06-21 15:37:05 + * @LastEditTime: 2024-06-24 10:56:19 --> <template> <Card title="鎿嶄綔"> @@ -20,7 +20,7 @@ <script lang="ts" setup> import { Card, CardGrid } from 'ant-design-vue'; import Icon from '@/components/Icon/Icon.vue'; - import { RouteToProd } from '/@/api/tigerapi/mes/router'; + import { RouteToCust, RouteToProd } from '/@/api/tigerapi/mes/router'; import GeneralModal from '/@/views/components/GeneralModal.vue'; import { useModal } from '/@/components/Modal'; import { useI18n } from '/@/hooks/web/useI18n'; @@ -30,7 +30,7 @@ import { useMessage } from '/@/hooks/web/useMessage'; const { refreshPage } = useTabs(); - const {createErrorModal} = useMessage(); + const { createErrorModal } = useMessage(); // const props = defineProps({ // prodCode: { type: String }, // }); @@ -109,41 +109,40 @@ // }, ]; function changeItem(action) { - if (action == 'addRoute') { - openModal(true, { - title: '宸ヨ壓璺嚎鍒楄〃', - schemas: [ - { - field: 'ROT_CODE', - component: 'Input', - label: '宸ヨ壓璺嚎缂栫爜', - colProps: { - span: 12, - }, + openModal(true, { + title: '宸ヨ壓璺嚎鍒楄〃', + schemas: [ + { + field: 'ROT_CODE', + component: 'Input', + label: '宸ヨ壓璺嚎缂栫爜', + colProps: { + span: 12, }, - ], - ItemColumns: [ - { - title: t('宸ヨ壓璺嚎缂栫爜'), - dataIndex: 'ROT_CODE', - resizable: true, - sorter: true, - width: 200, - }, - { - title: t('宸ヨ壓璺嚎鍚嶇О'), - dataIndex: 'ROT_NAME', - resizable: true, - sorter: true, - width: 180, - }, - ], - tableName: 'MES_ROUTE', - rowKey: 'ROT_CODE', - returnFieldName: 'ROUTE_CODE', //杩斿洖鍊艰璧嬪�肩殑瀛楁鍚嶇О - searchInfo: { TABLE_NAME: 'MES_ROUTE' }, - }); - } + }, + ], + ItemColumns: [ + { + title: t('宸ヨ壓璺嚎缂栫爜'), + dataIndex: 'ROT_CODE', + resizable: true, + sorter: true, + width: 200, + }, + { + title: t('宸ヨ壓璺嚎鍚嶇О'), + dataIndex: 'ROT_NAME', + resizable: true, + sorter: true, + width: 180, + }, + ], + tableName: 'MES_ROUTE', + rowKey: 'ROT_CODE', + returnFieldName: 'ROUTE_CODE', //杩斿洖鍊艰璧嬪�肩殑瀛楁鍚嶇О + searchInfo: { TABLE_NAME: 'MES_ROUTE' }, + which: action, + }); } /** @@ -152,17 +151,24 @@ * @param {*} u * @return {*} */ - async function handleSuccess(d, u) { - if(isNullOrEmpty(Prod_Code.value)){ - createErrorModal({ title: t('sys.api.errorTip'), content: '浜у搧涓虹┖锛屼笉鑳芥坊鍔犲伐鑹鸿矾绾匡紝璇风偣鍑诲乏渚ч�夋嫨浜у搧' }); + async function handleSuccess(d, u) { + if (isNullOrEmpty(Prod_Code.value)) { + createErrorModal({ + title: t('sys.api.errorTip'), + content: '浜у搧涓虹┖锛屼笉鑳芥坊鍔犲伐鑹鸿矾绾匡紝璇风偣鍑诲乏渚ч�夋嫨浜у搧', + }); return; } let codes = d.values.id.split(','); var i; for (i = 0; i < codes.length; i++) { - await RouteToProd({ rotId: codes[i], prodCode: Prod_Code.value }); + if (d.which == 'addRoute') { + await RouteToProd({ rotId: codes[i], prodCode: Prod_Code.value }); + } else { + await RouteToCust({ rotId: codes[i], prodCode: Prod_Code.value, custCode: '' }); + } } - + await refreshPage(); } </script> -- Gitblit v1.9.3