From a42c6f16bbb177dfcc754d53d925afddead38eba Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期二, 12 十一月 2024 22:51:26 +0800
Subject: [PATCH] 包装规则中查询更新,判断存在更新

---
 src/views/tigerprojects/system/lowcode/high/dtl.vue |   27 ++++++++++++++++++---------
 1 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/src/views/tigerprojects/system/lowcode/high/dtl.vue b/src/views/tigerprojects/system/lowcode/high/dtl.vue
index 4dd220c..975bbed 100644
--- a/src/views/tigerprojects/system/lowcode/high/dtl.vue
+++ b/src/views/tigerprojects/system/lowcode/high/dtl.vue
@@ -49,6 +49,7 @@
   import { useI18n } from '/@/hooks/web/useI18n';
   import { Card } from 'ant-design-vue';
   import { EntityCustFunctionType } from '/@/api/tigerapi/model/basModel';
+  import { useMessage } from '/@/hooks/web/useMessage';
 
   const { t } = useI18n();
   const ACard = Card;
@@ -67,6 +68,7 @@
   const keyFieldValues = inject('keyFieldValues') as Ref<Recordable[]>;
 
   const go = useGo();
+  const { createErrorModal } = useMessage();
   const [registerItemAdd, { openModal: openItemModal }] = useModal();
   const cType = ref('');
   const dtlSlots = ref([] as any[]);
@@ -183,7 +185,7 @@
       useFormData,
       crudColSlots: isNullOrUnDef(objParams.value['crudColSlots'])
         ? []
-        : objParams.value['crudColSlots'][item['name']],  //鎻掓Ы鍒楄〃
+        : objParams.value['crudColSlots'][item['name']], //鎻掓Ы鍒楄〃
       data,
       name: item.name, //drawers鍒楄〃閲岄潰鐨刵ame锛岃〃绀烘槸鍝竴涓疄浣擄紝涔熷氨鏄珮绾ц〃鍗曚腑琛ㄦ牸鐨勫悕瀛�
       keyName: item.keyName, //瀹為檯鐢ㄦ潵纭畾鍔ㄦ�佸紩鍏ュ疄浣�.ts鐨勫疄浣撳悕绉�
@@ -305,14 +307,21 @@
   function handleSuccess(d, u, item) {
     if (!isNullOrUnDef(custImport.value)) {
       /* 鑷畾涔夌紪杈戞柟娉曪紝鏍规嵁瀹炰綋鍚嶅幓璋冪敤 */
-      EditOperation(data, d, u, item);
-      useTables[item][1].setProps({
-        dataSource: [],
-      });
-      useTables[item][1].setProps({
-        dataSource: data.value[item],
-      });
-      useTables[item][1].reload();
+      if (data.value[item].some((q) => q.ITEM_CODE == d.ITEM_CODE)) {
+        createErrorModal({
+          title: t('sys.api.errorTip'),
+          content: t(`鏂欏彿[${d.ITEM_CODE}]宸茬粡瀛樺湪`),
+        });
+      } else {
+        EditOperation(data, d, u, item);
+        useTables[item][1].setProps({
+          dataSource: [],
+        });
+        useTables[item][1].setProps({
+          dataSource: data.value[item],
+        });
+        useTables[item][1].reload();
+      }
     }
   }
 

--
Gitblit v1.9.3