From b8886034cbd7a43911d6b24e322f604f557c1e02 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期二, 23 五月 2023 20:35:59 +0800
Subject: [PATCH] 增加referconfig的相关接口

---
 Source/UBCS-WEB/src/views/code/code.vue |   55 +++++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 45 insertions(+), 10 deletions(-)

diff --git a/Source/UBCS-WEB/src/views/code/code.vue b/Source/UBCS-WEB/src/views/code/code.vue
index 059b848..723d656 100644
--- a/Source/UBCS-WEB/src/views/code/code.vue
+++ b/Source/UBCS-WEB/src/views/code/code.vue
@@ -757,11 +757,15 @@
         </div>
       </el-dialog>
 
-      <!-- 绗簩灞傚璇濇,鍙傜収閰嶇疆缁勪欢 -->
-      <refer-config-dialog
-        ref="referConfigDialog"
+      <!-- 绗簩灞傚璇濇,鑷畾涔夊弬鐓ч厤缃瓼orm缁勪欢 -->
+      <refer-config-form-dialog
+        ref="referConfigFormDialog"
         @echoReferConfig="echoReferConfig" >
-      </refer-config-dialog>
+      </refer-config-form-dialog>
+      <!-- 绗簩灞傚璇濇,鐩存帴閫夋嫨鍙傜収閰嶇疆curd缁勪欢 -->
+      <refer-config-crud-dialog
+        ref="referConfigCrudDialog">
+      </refer-config-crud-dialog>
 
     </el-dialog>
 
@@ -1119,7 +1123,6 @@
         echoReferConfig(content){
           this.form.referBtmId = content.referType;
           this.form.referBtmName = content.referTypeName;
-          //console.log(content);
           //杞崲鎴怞SON瀛楃涓茶繘琛岀埗缁勪欢鍥炴樉
           let submitFormJson = JSON.stringify(content);
           this.form.referConfig = submitFormJson;
@@ -2385,14 +2388,46 @@
             this.isShowSelectReferBtmOption = true;
             this.refreshReferBtmDataChange();
           }else if(condition === 'referConfig'){
-            this.$refs.referConfigDialog.isShowReferConfig = true;
-            if(func.notEmpty(this.form.referConfig)){
-               this.$refs.referConfigDialog.initPageData(this.form.referConfig);
+            if(func.notEmpty(this.form.referConfig) || func.notEmpty(this.form.referBtmName)){
+              this.$refs.referConfigFormDialog.isShowReferConfig = true;
+              let value = {
+                referTypeName: this.form.referBtmName,
+                referType: this.form.referBtmId,
+                referConfig: this.form.referConfig,
+              }
+              this.$refs.referConfigFormDialog.initPageData(value);
+            }else{
+              this.openTipsChooseOrCust();
             }
-            //琛ㄦ牸閿欒鐨勯棶棰樻墍
-            this.$refs.referConfigDialog.onloadAttrData();
+             //this.$refs.referConfigFormDialog.onloadAttrData();
           }
         },
+        // 鎵撳紑鑷畾涔夊弬鐓ч厤缃垨鐩存帴閫夋嫨鍙傜収閰嶇疆鐣岄潰
+        openTipsChooseOrCust(){
+          this.$confirm('璇烽�夋嫨鍙傜収閰嶇疆鐨勫畾涔夋柟寮忥紵','鍙傜収閰嶇疆鐨勬柟寮�', {
+            distinguishCancelAndClose: true,
+            closeOnClickModal: false,
+            confirmButtonText: '鑷畾涔夊弬鐓ч厤缃�',
+            cancelButtonText: '鐩存帴閫夋嫨鍙傜収閰嶇疆'
+          })
+          .then(() => {
+            // 鎵撳紑鑷畾鍙傜収閰嶇疆瀵硅瘽妗�
+            this.$refs.referConfigFormDialog.isShowReferConfigForm = true;
+            // 琛ㄦ牸閿欒鐨勯棶棰�
+            this.$refs.referConfigFormDialog.onloadAttrData();
+          })
+          .catch(action => {
+            if (action === "cancel") {
+              // 鎵撳紑鐩存帴閫夋嫨鍙傜収閰嶇疆瀵硅瘽妗�
+              this.$refs.referConfigCrudDialog.isShowReferConfigCrud = true;
+              this.$refs.referConfigCrudDialog.referConfigOnload();
+            }
+            //console.log(action);
+          });
+          // 璁╁弬鐓ч厤缃緭鍏ユ澶卞幓鐒︾偣锛屽惁鍒欒鎻愮ず妗嗘棤娉曡鍏抽棴
+          this.$refs.referConfig.$el.querySelector('input').blur();
+        },
+
         // 鐐瑰嚮杈撳叆妗嗙殑脳鍙凤紝娓呯┖杈撳叆妗嗕腑鐨勫唴瀹�
         clearAttrDataByIcon(condition){
           if(condition === 'attr'){

--
Gitblit v1.9.3