From b46cf401da847d7cca6269c6b2ffb04f6f72691a Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期日, 14 五月 2023 03:57:37 +0800
Subject: [PATCH] 新增应用码段下的参照配置界面,以及代码整合

---
 Source/UBCS-WEB/src/views/code/code.vue |  338 +++++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 223 insertions(+), 115 deletions(-)

diff --git a/Source/UBCS-WEB/src/views/code/code.vue b/Source/UBCS-WEB/src/views/code/code.vue
index 89dd072..b30a4e4 100644
--- a/Source/UBCS-WEB/src/views/code/code.vue
+++ b/Source/UBCS-WEB/src/views/code/code.vue
@@ -184,6 +184,7 @@
             ref="crudCloneCodeBasicOther"
             :table-loading="loadingBasic"
             :data="basicData"
+            @row-click="codeOtherCloneBasicRowClick"
             @selection-change="selectionOtherCloneCodeBasicChange">
           </avue-crud>
         </el-row>
@@ -202,6 +203,9 @@
         ref="crudBasic"
         :table-loading="loadingBasic"
         :data="basicData"
+        @row-click="codeBasicSecRowClick"
+        @search-change="basicSearchChange"
+        @search-reset="basicSearchReset"
         :permission="permissionList"
         @selection-change="selectionBasicChange"
         @refresh-change="refreshChangeBasicSec">
@@ -252,15 +256,19 @@
       <!-- 鍩虹鐮佹琛ㄦ牸宸︿笂鏂规寜閽尯鍩� -->
       <template slot="menuLeft" slot-scope="scope">
         <el-button type="primary"
-                  size="small"
-                  icon="el-icon-plus"
-                  @click="addBasicCodeSec">鏂� 澧�
+            size="small"
+            icon="el-icon-plus"
+            :disabled="selectionList.length <= 0"
+            @click="addBasicCodeSec">
+            鏂� 澧�
         </el-button>
         <el-button type="danger"
-                  size="small"
-                  icon="el-icon-delete"
-                  plain
-                  @click="deleteBasicCode(scope.row)">鍒� 闄�
+            size="small"
+            icon="el-icon-delete"
+            :disabled="selectionList.length <= 0"
+            plain
+            @click="deleteBasicCode(scope.row)">
+            鍒� 闄�
         </el-button>
       </template>
 
@@ -360,7 +368,7 @@
             </div>
             <div style="margin-top:20px; display: flex; align-items:center; justify-content:center;">
               <el-button :disabled="selectedFixedOrCodeclassifyValue!=''" size="mini" type="primary" icon="el-icon-circle-plus" class="button" @click="addCodeSecValue('codefixedsec')">娣诲姞</el-button>
-              <el-button :disabled="selectedFixedOrCodeclassifyValue==''" size="mini" type="success" plain plain icon="el-icon-edit-outline" class="button" @click="editCodeSecValue('codefixedsec')">淇敼</el-button>
+              <el-button :disabled="selectedFixedOrCodeclassifyValue==''" size="mini" type="success" plain icon="el-icon-edit-outline" class="button" @click="editCodeSecValue('codefixedsec')">淇敼</el-button>
               <el-button :disabled="selectedFixedOrCodeclassifyValue==''" size="mini" type="danger" icon="el-icon-close" class="button" @click="delCodeSecValue('codefixedsec')">鍒犻櫎</el-button>
               <el-button size="mini" type="warning" plain icon="el-icon-close" class="button" @click = "clearFixedOrClassifyForm('codefixedsec')">鍙栨秷</el-button>
             </div>
@@ -379,8 +387,8 @@
       @close="clearBasicAddForm">
 
       <!--  绗竴灞傚璇濇,娣诲姞鐮佹淇℃伅瀵硅瘽妗嗕腑鐨勫唴瀹� -->
-      <div class="total" style="overflow-y: auto; height: 70vh">
-        <el-form :model="form">
+      <div class="add-basicsec-total" style="overflow-y: auto; height: 70vh">
+        <el-form :model="form" class="add-basicsec-form">
           <span class="left">
             <el-form-item label="鐮佹缂栧彿:" :label-width="leftFormLabelWidth" required>
               <el-input v-model="form.id" :readonly="basicSecOnlyRead" ref="id"></el-input>
@@ -394,9 +402,9 @@
               <el-select v-model="form.secType" placeholder="璇烽�夋嫨" @change="changeSectypeFormItems(null)" :disabled="basicSecOnlyRead">
                 <el-option
                   v-for="item in sectypeList"
-                  :key="item.dictValue"
-                  :label="item.dictValue"
-                  :value="item.dictKey">
+                  :key="item.itemValue"
+                  :label="item.itemName"
+                  :value="item.itemValue">
                 </el-option>
               </el-select>
             </el-form-item>
@@ -422,9 +430,9 @@
                 <el-select v-model="form.codeSecLengthType" placeholder="璇烽�夋嫨" :disabled="basicSecOnlyRead">
                   <el-option
                   v-for="item in codeSecLengthType"
-                  :key="item.dictValue"
-                  :label="item.dictValue"
-                  :value="item.dictKey">
+                  :key="item.itemValue"
+                  :label="item.itemName"
+                  :value="item.itemValue">
                 </el-option>
                 </el-select>
               </el-form-item>
@@ -479,9 +487,9 @@
                 <el-select v-model="form.codeFillType" placeholder="璇烽�夋嫨" :disabled="basicSecOnlyRead">
                   <el-option label="宸﹁ˉ浣�" value="codeattrsec"
                     v-for="item in codeFillType"
-                    :key="item.dictValue"
-                    :label="item.dictValue"
-                    :value="item.dictKey">
+                    :key="item.itemValue"
+                    :label="item.itemName"
+                    :value="item.itemValue">
                   </el-option>
                 </el-select>
               </el-form-item>
@@ -489,9 +497,9 @@
                 <el-select v-model="form.codeFillSeparatorSelect" @blur="inputSelectBlur" filterable placeholder="璇烽�夋嫨" :disabled="basicSecOnlyRead">
                   <el-option
                     v-for="item in codeFillSeparator"
-                    :key="item.dictValue"
-                    :label="item.dictValue"
-                    :value="item.dictKey">
+                    :key="item.itemValue"
+                    :label="item.itemName"
+                    :value="item.itemValue">
                   </el-option>
                 </el-select>
               </el-form-item>
@@ -514,9 +522,9 @@
                 <el-select v-model="form.codeLevelType" placeholder="璇烽�夋嫨" :disabled="basicSecOnlyRead">
                   <el-option
                     v-for="item in codeLevelType"
-                    :key="item.dictValue"
-                    :label="item.dictValue"
-                    :value="item.dictKey">
+                    :key="item.itemValue"
+                    :label="item.itemName"
+                    :value="item.itemValue">
                   </el-option>
                 </el-select>
               </el-form-item>
@@ -527,9 +535,9 @@
                 <el-select v-model="form.valueCutType" placeholder="璇烽�夋嫨" :disabled="basicSecOnlyRead">
                   <el-option
                     v-for="item in codeCutType"
-                    :key="item.dictValue"
-                    :label="item.dictValue"
-                    :value="item.dictKey">
+                    :key="item.itemValue"
+                    :label="item.itemName"
+                    :value="item.itemValue">
                   </el-option>
                 </el-select>
               </el-form-item>
@@ -537,9 +545,9 @@
                 <el-select v-model="form.codeGetValueType" placeholder="璇烽�夋嫨" :disabled="basicSecOnlyRead">
                   <el-option
                     v-for="item in codeGetValueType"
-                    :key="item.dictValue"
-                    :label="item.dictValue"
-                    :value="item.dictKey">
+                    :key="item.itemValue"
+                    :label="item.itemName"
+                    :value="item.itemValue">
                   </el-option>
                 </el-select>
               </el-form-item>
@@ -583,9 +591,9 @@
                 <el-select v-model="form.codeSecLengthType" placeholder="璇烽�夋嫨" :disabled="basicSecOnlyRead">
                   <el-option
                     v-for="item in codeSecLengthType"
-                    :key="item.dictValue"
-                    :label="item.dictValue"
-                    :value="item.dictKey">
+                    :key="item.itemValue"
+                    :label="item.itemName"
+                    :value="item.itemValue">
                   </el-option>
                 </el-select>
               </el-form-item>
@@ -600,7 +608,7 @@
                   placeholder="璇烽�夋嫨"
                   prefix-icon="el-icon-search"
                   readonly="true"
-                  v-model="form.parentClassifySecOid"
+                  v-model="form.parentClassifySecText"
                   @focus="openAttrSelectOrGetValue('parentClassifySecOid')"
                   :disabled="basicSecOnlyRead">
                   <i slot="suffix" class="el-icon-circle-close" @click="clearAttrDataByIcon('parentClassifySecOid')" style="margin-right: 5px;cursor: pointer;"></i>
@@ -616,9 +624,9 @@
                 <el-select v-model="form.codeFillType" placeholder="璇烽�夋嫨" :disabled="basicSecOnlyRead">
                   <el-option
                       v-for="item in codeFillType"
-                      :key="item.dictValue"
-                      :label="item.dictValue"
-                      :value="item.dictKey">
+                      :key="item.itemValue"
+                      :label="item.itemName"
+                      :value="item.itemValue">
                   </el-option>
                 </el-select>
               </el-form-item>
@@ -626,9 +634,9 @@
                 <el-select v-model="form.codeFillSeparatorSelect" filterable @blur="inputSelectBlur" placeholder="璇烽�夋嫨" :disabled="basicSecOnlyRead">
                   <el-option
                     v-for="item in codeFillSeparator"
-                    :key="item.dictValue"
-                    :label="item.dictValue"
-                    :value="item.dictKey">
+                    :key="item.itemValue"
+                    :label="item.itemName"
+                    :value="item.itemValue">
                   </el-option>
                 </el-select>
               </el-form-item>
@@ -643,7 +651,7 @@
         <el-button type="primary" @click="saveOrEditBasicCode" v-show="showbtn">淇� 瀛�</el-button>
       </div>
 
-      <!--  绗簩灞傚璇濇,灞炴�х爜娈碉紝灞炴�ч�夋嫨寮圭獥 -->
+      <!--  绗簩灞傚璇濇,灞炴�х爜娈碉紝灞炴�ч�夋嫨瀵硅瘽妗� -->
       <el-dialog title="涓恒�愬睘鎬с�戦�夊彇鍊�"
         append-to-body
         :visible.sync="isShowSelectAttrOption"
@@ -663,7 +671,6 @@
                 </el-scrollbar>
               </div>
             </el-col>
-
             <!-- 鍙充晶琛ㄦ牸鏄剧ず鍖哄煙 -->
             <el-col span="19">
               <basic-container>
@@ -672,17 +679,17 @@
                   :data="selectattrData"
                   :option="attrOption"
                   :table-loading="selectAttrOptionLoading"
+                  ref="selectionAttrCrud"
                   @search-change="selectAttrOptionSearchChange"
                   @search-reset="searchAttrReset"
+                  @row-click="selectionAttrRowClick"
                   @selection-change="selectionChangeAttr">
                 </avue-crud>
                 </div>
               </basic-container>
             </el-col>
-
           </el-row>
         </div>
-
         <div slot="footer" class="dialog-footer">
           <el-button @click="isShowSelectAttrOption = false">鍙� 娑�</el-button>
           <el-button type="primary" @click="selectedListClassifyLinkAttr">纭� 瀹�</el-button>
@@ -690,21 +697,20 @@
         
       </el-dialog>
 
-      <!-- 绗簩灞傚璇濇,灞炴�х爜娈碉紝鍏紡缂栬緫妗嗗脊绐楃粍浠� -->
+      <!-- 绗簩灞傚璇濇,灞炴�х爜娈碉紝鍏紡缂栬緫妗嗗璇濇缁勪欢 -->
       <formula-editor ref="formulaEditor" 
         @updateFormulaContent="updateFormulaContent" 
         :thisSceneTableData="thisSceneTableData"
         :systemVariableTableData="systemVariableTableData">
       </formula-editor>
 
-      <!-- 绗簩灞傚璇濇,涓恒�愮埗鍒嗙被鐮佹銆戦�夊彇鍊煎脊绐� -->
+      <!-- 绗簩灞傚璇濇,涓恒�愮埗鍒嗙被鐮佹銆戦�夊彇鍊煎璇濇 -->
       <el-dialog title="涓恒�愮埗鍒嗙被鐮佹銆戦�夊彇鍊�"
         append-to-body
         :visible.sync="isShowParentClassifyOption"
         width="65%"
         style="height: 150vh; margin-top: -13vh;"
         destroy-on-close>
-
         <avue-crud
           :page.sync="parentClassifyDataPage"
           ref="crudParentClassify"
@@ -714,26 +720,24 @@
           @refresh-change="refreshParentClassifyDataChange"
           @search-change="parentClassifySearchChange"
           @search-reset="parentClassifySearchReset"
+          @row-click="parentClassifyRowClick"
           @selection-change="parentClassifySelectionChange"
           @current-change="parentClassifyCurrentChange"
           @size-change="parentClassifySizeChange"
           @on-load="parentClassifyOnLoad">
         </avue-crud>
-
         <div slot="footer" class="dialog-footer">
           <el-button @click="isShowParentClassifyOption = false">鍙� 娑�</el-button>
           <el-button type="primary" @click="saveSelectedParentClassify">淇� 瀛�</el-button>
         </div>
       </el-dialog>
 
-      <!-- 绗簩灞傚璇濇,涓恒�愬弬鐓у紩鐢ㄧ殑涓氬姟绫诲瀷銆戦�夊彇鍊煎脊绐� -->
+      <!-- 绗簩灞傚璇濇,涓恒�愬弬鐓у紩鐢ㄧ殑涓氬姟绫诲瀷銆戦�夊彇鍊煎脊瀵硅瘽妗� -->
       <el-dialog title="涓恒�愬弬鐓у紩鐢ㄧ殑涓氬姟绫诲瀷銆戦�夊彇鍊�"
         append-to-body
         :visible.sync="isShowSelectReferBtmOption"
         width="65%"
-        style="height: 150vh; margin-top: -13vh;"
-        destroy-on-close>
-
+        style="height: 150vh; margin-top: -13vh;">
         <avue-crud
           :page.sync="referBtmDataPage"
           ref="crudReferBtm"
@@ -746,19 +750,23 @@
           @selection-change="referBtmSelectionChange"
           @current-change="referBtmCurrentChange"
           @size-change="referBtmSizeChange"
-          @on-load="referBtmOnLoad">
+          @row-click="referBtmRowClick">
         </avue-crud>
-
         <div slot="footer" class="dialog-footer">
           <el-button @click="isShowSelectReferBtmOption = false">鍙� 娑�</el-button>
           <el-button type="primary" @click="saveSelectedreferBtm">淇� 瀛�</el-button>
         </div>
       </el-dialog>
 
+      <!-- 绗簩灞傚璇濇,鍙傜収閰嶇疆缁勪欢 -->
+      <refer-config-dialog
+        ref="referConfigDialog"
+        @echoReferConfig="echoReferConfig" >
+      </refer-config-dialog>
+
     </el-dialog>
 
   </basic-container>
- 
 </template>
 
 <script>
@@ -776,7 +784,7 @@
   import { treeTopCodeClassify, listClassifyLinkAttr } from "@/api/code/codeclassify";
   import { gridCodeFixedValue,addSaveCodeFixedValue,deleteCodeFixedValue,editCodeFixedValue,saveOrder } from "@/api/code/codeFixedValue";
   import { treeCodeClassifyValue,addSaveCodeClassifyValue,editCodeClassifyValue,deleteCodeClassifyValue,saveCodeClassifyValueOrder } from "@/api/code/codeClassifyValue";
-  import { getDictionary } from "@/api/omd/dict";
+  import { getDictionary } from "@/api/omd/enum";
   import optionBasic from "@/const/code/codebasic";
   import cloneOption from "@/const/code/cloneOption";
   import cloneBasicOption from "@/const/code/cloneBasicDialogOption";
@@ -894,7 +902,7 @@
           },
           classisyValueTreeOption: classisyValueTreeOption, //鍒嗙被鐮佹鏍戠浉鍏抽厤缃」
           classifyValueTreeData: [],
-          currentSelectTreeData: '', //褰撳墠閫変腑鐨勫垎绫荤爜鍊兼爲鑺傜偣
+          //currentSelectClsValueTreeData: '', //褰撳墠閫変腑鐨勫垎绫荤爜鍊兼爲鑺傜偣
 
           /* 涓哄睘鎬ч�夊彇鍊肩獥鍙f樉绀烘墦寮�鎺у埗鍙橀噺 */
           isShowSelectAttrOption: false,
@@ -1107,8 +1115,17 @@
         updateFormulaContent(content){
           this.form.getValueClass = content;
         },
+
+        /* 鍙傜収閰嶇疆,瀛愮粍浠跺~瀹屽弬鐓ч厤缃箣鍚庡唴瀹瑰洖鏄炬椂璋冪敤 */
+        echoReferConfig(content){
+          this.form.referConfig = content;
+        },
         
-        /** 閫変腑鍙傜収寮曠敤鐨勪笟鍔$被鍨嬶紝绗簩灞傚祵濂楀璇濇锛屽強鍏剁浉鍏虫柟娉�  */
+        /** 涓哄弬鐓у紩鐢ㄧ殑涓氬姟绫诲瀷閫夊彇鍊硷紝绗簩灞傚祵濂楀璇濇锛屽強鍏剁浉鍏虫柟娉�  */
+        // 琛ㄦ牸鏁版嵁鍒锋柊鎸夐挳
+        referBtmDataChange(){
+          this.referBtmOnLoad(this.referBtmDataPage, this.referBtmQuery);
+        },
         saveSelectedreferBtm(){
           if(this.referBtmSelectionList.length != 1){
             this.$message.warning("鍙兘閫夋嫨涓�鏉℃暟鎹�!");
@@ -1131,9 +1148,16 @@
           this.referBtmOnLoad(this.page, params);
           done();
         },
+         // 鍗曞嚮閫変腑琛ㄦ牸琛屾椂瑙﹀彂
+        referBtmRowClick(row){
+          this.$refs.crudReferBtm.toggleSelection();
+          this.referBtmSelectionList = row;
+          this.$refs.crudReferBtm.setCurrentRow(row);
+          this.$refs.crudReferBtm.toggleRowSelection(row); //閫変腑褰撳墠琛�
+        },
         referBtmSelectionChange(list) {
-          //console.log(list);
           this.referBtmSelectionList = list;
+          this.$refs.crudReferBtm.setCurrentRow(this.referBtmSelectionList[list.length-1]);
         },
         referBtmSelectionClear() {
           this.referBtmSelectionList = [];
@@ -1150,6 +1174,10 @@
         },
         //鍔犺浇涓弬鐓у紩鐢ㄧ殑涓氬姟绫诲瀷鐨勬暟鎹�
         referBtmOnLoad(page, params = {}) {
+          //琛ㄦ牸琛岄敊浣嶉棶棰�
+          this.$nextTick(() => {
+            this.$refs.crudReferBtm.doLayout();
+          })
           this.referBtmDialogLoading = true;
           let oid = this.selectionList.length==0 ?  this.form.pkCodeRule:this.selectionList[0].oid;
           Object.assign(params,{pkCodeRule:oid})
@@ -1170,10 +1198,10 @@
         saveSelectedParentClassify(){
           //console.log(this.parentClassifySelectionList.length);
           if(this.parentClassifySelectionList.length != 1){
-            this.$message.warning("鍙兘閫夋嫨涓�鏉℃暟鎹�!");
+            this.$message.warning("璇烽�夋嫨涓�鏉℃暟鎹�!");
             return false;
           }
-          //璋冪敤瀛愮粍浠跺苟浼犻�掑綋鍓嶉�変腑鐨勫弬鏁板�硷紝瀹炵幇鍥炴樉
+          //鍙傛暟鍊硷紝瀹炵幇鍥炴樉
           this.form.parentClassifySecOid = this.parentClassifySelectionList[0].oid;
           this.form.parentClassifySecText = this.parentClassifySelectionList[0].name;
           //娓呯┖褰撳墠閫変腑鐨勮
@@ -1190,9 +1218,15 @@
           this.parentClassifyOnLoad(this.page, params);
           done();
         },
+        parentClassifyRowClick(row){
+          this.$refs.crudParentClassify.toggleSelection();
+          this.parentClassifySelectionList = row;
+          this.$refs.crudParentClassify.setCurrentRow(row);
+          this.$refs.crudParentClassify.toggleRowSelection(row); //閫変腑褰撳墠琛�
+        },
         parentClassifySelectionChange(list) {
-          //console.log(this.parentClassifyCurrentChange);
           this.parentClassifySelectionList = list;
+          this.$refs.crudParentClassify.setCurrentRow(this.parentClassifySelectionList[list.length-1]);
         },
         parentClassifySelectionClear() {
           this.parentClassifySelectionList = [];
@@ -1229,7 +1263,8 @@
           this.loadlistClassifyLinkAttr()
         },
         // 鍔犺浇鍒嗙被杩炴帴灞炴�ц〃鏍兼暟鎹�
-        loadlistClassifyLinkAttr(){
+        loadlistClassifyLinkAttr(condition) {
+          //杩欏効杩橀渶瑕佸畬鍠�
           this.selectAttrOptionLoading = true;
           listClassifyLinkAttr({"page": 1,"limit": -1,'conditionMap[codeClassifyOid]':this.currentSelectTreeData.oid}).then(res=>{
           //console.log(res.data.data);
@@ -1246,13 +1281,21 @@
         // 鐐瑰嚮鎼滅储鍚庤Е鍙戣浜嬩欢
         selectAttrOptionSearchChange(params, done) {
           this.query = params;
-          console.log(params);  //杩欏効闇�瑕佹敼
-          this.loadlistClassifyLinkAttr({"page":1,"limit":-1 ,'conditionMap[codeClassifyOid]':this.currentSelectTreeData.oid});
+          //console.log(params);  //杩欏効闇�瑕佹敼
+          this.loadlistClassifyLinkAttr(Object.assign(params,{'conditionMap[codeClassifyOid]':this.currentSelectTreeData.oid}));
           done();
+        },
+        // 涓哄睘鎬ч�夊�肩晫闈紝鍗曞嚮琛ㄦ牸琛屾椂瑙﹀彂璇ヤ簨浠�
+        selectionAttrRowClick(row){
+          this.$refs.selectionAttrCrud.toggleSelection();
+          this.selectionChangeAttrList = row;
+          this.$refs.selectionAttrCrud.setCurrentRow(row);
+          this.$refs.selectionAttrCrud.toggleRowSelection(row); //閫変腑褰撳墠琛�
         },
         // 灞炴�у彇鍊煎綋鍓嶉�変腑琛屽彂鐢熷彉鍖栨椂瑙﹀彂
         selectionChangeAttr(list){
           this.selectionChangeAttrList = list;
+          this.$refs.selectionAttrCrud.setCurrentRow(this.selectionChangeAttrList[list.length-1]);
         },
         // 閲嶇疆浣嶅睘鎬ч�夊彇鍊艰〃鏍肩殑鎼滅储妗嗕箣鍚庣殑鍥炶皟
         searchAttrReset() {
@@ -1261,7 +1304,7 @@
         // 涓哄睘鎬ч�夊彇鍊间箣鍚庣殑鍥炴樉
         selectedListClassifyLinkAttr(){
           if(this.selectionChangeAttrList.length != 1){
-            this.$message.warning("鍙兘閫夋嫨涓�鏉℃暟鎹�!");
+            this.$message.warning("璇烽�夋嫨涓�鏉℃暟鎹�!");
             return false;
           }
           //璋冪敤瀛愮粍浠跺苟浼犻�掑綋鍓嶉�変腑鐨勫弬鏁板�硷紝瀹炵幇鍥炴樉
@@ -1609,7 +1652,7 @@
         /** 鍩虹鐮佹鐩稿叧鏂规硶 */
         //闃叉鎵撳紑杩囩紪杈戠獥鍙d箣鍚庤〃鍗曚腑瀛樺湪鍊硷紝鎵�浠ラ渶瑕佹竻绌�,骞跺垵濮嬪寲form琛ㄥ崟灞炴��
         clearBasicAddForm(){
-          this.form = this.$options.data().form;;
+          this.form = this.$options.data().form;
           // this.changeSectypeFormItems(null);
         },
         // 鎵撳紑鏂板绐楀彛
@@ -1624,7 +1667,7 @@
           this.openBasicDialog('add',null);
           this.loadCodeSecType();
         },
-        //鎵撳紑鏂板鎴栫紪杈戝熀纭�鐮佹瀵硅瘽妗�
+        // 鎵撳紑鏂板鎴栫紪杈戝熀纭�鐮佹瀵硅瘽妗�
         openBasicDialog(condition,row){
           //console.log(row);
           if(condition == 'add') {
@@ -1903,9 +1946,16 @@
           //瀛樺偍褰撳墠鍏宠仈鐨勭紪鐮佽鍒欑浉鍏充俊鎭�
           this.currentCodeRuleOid = row.oid;
           this.currentRuleLcStatus = row.lcStatus;
-          gridCodeBasicSec(1, -1, {"pkCodeRule":row.oid}).then(res => {
+          this.sendGridCodeBasicSec({"pkCodeRule":row.oid});
+        },
+        // 鍙戦�佸姞杞藉熀纭�鐮佹鐨勮姹�
+        sendGridCodeBasicSec(condition){
+          // 濡傛灉褰撳墠鍩虹鐮佹琛ㄤ腑鐨勬悳绱㈡寜閽闅愯棌锛屽氨闇�瑕佸湪姝ゅ紑鍚�
+          if(this.selectionList.length>=0 && !this.$refs.crudBasic.option.column[0].search){
+            this.hideBasicTable(true);
+          }
+          gridCodeBasicSec(1, -1, condition).then(res => {
             const data = res.data.data;
-            // console.log(data);
             if(this.cloneSettingBox){
               this.cloneData = data.records;
               // console.log(tihs.cloneData);
@@ -1920,7 +1970,23 @@
         // 鍩虹鐮佹閫変腑鏃惰Е鍙�
         selectionBasicChange(list) {
           this.selectionBasicList = list;
+          this.$refs.crudBasic.setCurrentRow(this.selectionBasicList[list.length-1]);
           //console.log(this.selectionBasicList);
+        },
+        // 鍩虹鐮佹琚崟鍑昏〃鏍艰鏃惰Е鍙�
+        codeBasicSecRowClick(row){
+          this.$refs.crudBasic.toggleSelection();
+          this.selectionBasicList = row;
+          this.$refs.crudBasic.setCurrentRow(row);
+          this.$refs.crudBasic.toggleRowSelection(row); //閫変腑褰撳墠琛�
+        },
+        basicSearchChange(params, done){
+          //console.log(this.$refs.crudBasic);
+          this.sendGridCodeBasicSec(Object.assign(params,{"pkCodeRule":this.selectionList[this.selectionList.length-1].oid}));
+          done();
+        },
+        basicSearchReset(){
+          this.sendGridCodeBasicSec({"pkCodeRule":this.selectionList[this.selectionList.length-1].oid});
         },
         // 涓婄Щ涓嬬Щ鍩虹鐮佹
         upOrderNum(row){
@@ -1968,12 +2034,19 @@
             });
           })
         },
-        //鍩虹鐮佹鏌ヨ
+        // 鍩虹鐮佹鍒锋柊鏃舵煡璇�
         refreshChangeBasicSec(){
           this.loadBasic({"oid":this.currentCodeRuleOid == null || this.currentCodeRuleOid == '' ? this.selectionList[0].oid:this.currentCodeRuleOid});
         },
+        // 鎿嶄綔鍩虹鐮佹涓悳绱㈡竻绌虹瓑鎸夐挳鐨勬樉绀�/闅愯棌
+        hideBasicTable(hideBoolean){
+          this.$refs.crudBasic.option.refreshBtn = hideBoolean;
+          this.$refs.crudBasic.option.columnBtn = hideBoolean;
+          this.$refs.crudBasic.option.column[0].search = hideBoolean;
+          this.$refs.crudBasic.option.column[1].search = hideBoolean;
+        },
 
-  
+
         /** 缂栫爜瑙勫垯鐩稿叧鏂规硶 */
         // 鏌ヨ浣跨敤鑼冨洿
         handleRange(){
@@ -1983,7 +2056,7 @@
           this.codeRangeSettingBox = true;
           this.getRangeCodeList()
         },
-        //鍔犺浇浣跨敤鑼冨洿鍒楄〃
+        // 鍔犺浇浣跨敤鑼冨洿鍒楄〃
         getRangeCodeList(){        
           this.dialogLoading = true;
           if(this.selectionList[0].oid==null){
@@ -1996,17 +2069,19 @@
             this.dialogLoading = false;
           });
         },
-        //鍒锋柊浣跨敤鑼冨洿鍒楄〃
+        // 鍒锋柊浣跨敤鑼冨洿鍒楄〃
         refreshUseRangeChange(){
           this.getRangeCodeList();
         },
-        //鍗曞嚮缂栫爜瑙勫垯瀹炵幇琛岄�夋嫨
+        // 鍗曞嚮缂栫爜瑙勫垯瀹炵幇琛岄�夋嫨
         codeRuleRowClick (row) {
-          this.$refs.crud.toggleSelection();
           this.selectionList = row;
+          this.$refs.crud.toggleSelection();
           this.$refs.crud.setCurrentRow(row);
           this.$refs.crud.toggleRowSelection(row); //閫変腑褰撳墠琛�
-          this.loadBasic(row);
+          if(row!=''){
+            this.loadBasic(row);
+          }
         },
         // 鍚敤涓庡仠鐢�
         enableOrDeactivatse(oId,update){
@@ -2073,26 +2148,42 @@
           }
           this.cloneOtherCodeRuleSettingBox = true;
         },
-        //鍗曞嚮缂栫爜瑙勫垯瀹炵幇琛岄�夋嫨
-        codeOtherCloneRuleRowClick (row) {
+        // 浠庡叾浠栫紪鐮佽鍒欎腑鍏嬮殕鐮佹瀵硅瘽妗�-鍗曞嚮缂栫爜瑙勫垯瀹炵幇琛岄�夋嫨
+        codeOtherCloneRuleRowClick(row) {
+          this.$refs.crudCloneCodeRuleOther.toggleSelection();
+          this.selectionOtherCloneCodeRuleList = row;
+          this.$refs.crudCloneCodeRuleOther.setCurrentRow(row);
+          this.$refs.crudCloneCodeRuleOther.toggleRowSelection(row); //閫変腑褰撳墠琛�
           this.loadBasic(row);
         },
-        // 缂栫爜瑙勫垯褰撳墠閫変腑琛屽彉鍖栫殑鏃跺�欒Е鍙�
+        // 浠庡叾浠栫紪鐮佽鍒欎腑鍏嬮殕鐮佹瀵硅瘽妗�-鍗曞嚮鍩虹鐮佹瀹炵幇琛岄�夋嫨
+        codeOtherCloneBasicRowClick(row){
+          this.$refs.crudCloneCodeBasicOther.toggleSelection();
+          this.selectionOtherCloneCodeBasicList = row;
+          this.$refs.crudCloneCodeBasicOther.setCurrentRow(row);
+          this.$refs.crudCloneCodeBasicOther.toggleRowSelection(row); //閫変腑褰撳墠琛�
+        },
+        // 浠庡叾浠栬鍒欏厠闅嗙爜娈电晫闈腑缂栫爜瑙勫垯褰撳墠閫変腑琛屽彉鍖栫殑鏃跺�欒Е鍙�
         selectionOtherCloneCodeRuleChange(list) {
           //console.log(list);
           this.selectionOtherCloneCodeRuleList = list;
+          this.$refs.crudBasic.setCurrentRow(this.selectionBasicList[list.length-1]);
+          if(list == ''){
+            this.basicData = [];
+          }
           if(this.selectionOtherCloneCodeRuleList.length > 0){
             this.loadBasic(this.selectionOtherCloneCodeRuleList[list.length-1]);
           }
         },
         selectionOtherCloneCodeBasicChange(list){
-          this.selectionOtherCloneCodeBasicList = list; 
+          this.selectionOtherCloneCodeBasicList = list;
+          this.$refs.crudCloneCodeBasicOther.setCurrentRow(this.selectionOtherCloneCodeBasicList[list.length-1]);
         },
          // 浠庡叾浠栫紪鐮佽鍒欎腑鍏嬮殕鐮佹淇℃伅
         saveOtherCodeBasic(){
           let oid = this.selectionList[0].oid;
           let fromDialogPkCodebasic = this.selectionOtherCloneCodeBasicList;
-          if(fromDialogPkCodebasic.length < 0){
+          if(fromDialogPkCodebasic.length <= 0){
             this.$message.warning("璇烽�夋嫨鐮佹鏁版嵁!");
             return;
           }
@@ -2104,13 +2195,13 @@
             return;
           }
           //console.log(res);
-          let oidArr = '';
-          fromDialogPkCodebasic.forEach((item) =>{
-            oidArr = oidArr+","+item.oid;
-          })
+          let oidArr = [];
+          fromDialogPkCodebasic.forEach(ele => {
+            oidArr.push(ele.id);
+          });
           let data = {
             "pkCodeRule": oid,
-            "oidArr": oidArr,
+            "oidArr": oidArr.join(","),
           }
           //console.log(data);
           cloneCodeBasic(data).then(() => {
@@ -2136,9 +2227,9 @@
           }
           let currentData = this.selectionList[0];
           this.$confirm("纭畾瑕佹竻绌虹爜鍊硷紵濡傛灉娓呯┖灏嗕笉鑳借鎭㈠锛岃璋ㄦ厧锛�", {
-            confirmButtonText: "纭畾",
-            cancelButtonText: "鍙栨秷",
-            type: "warning"
+              confirmButtonText: "纭畾",
+              cancelButtonText: "鍙栨秷",
+              type: "warning"
             })
             .then(() => {
               let ts = new Date(currentData.ts).getTime();
@@ -2152,7 +2243,6 @@
               });
             });
         },
-
         // 娣诲姞
         rowSave(row, done, loading) {
           add(row).then(() => {
@@ -2232,12 +2322,15 @@
         // 缂栫爜瑙勫垯褰撳墠閫変腑琛屽彉鍖栫殑鏃跺�欒Е鍙�
         selectionChange(list) {
           this.selectionList = list;
-          //console.log("selectionChange====="+list);
           this.$refs.crud.setCurrentRow(this.selectionList[list.length-1]);
+          //褰撳墠閫変腑琛屼负绌虹殑鏃跺�欏氨灏嗙爜娈电鐞嗚〃鏍兼暟鎹疆绌�
+          if(list == ''){
+            this.basicData = [];
+            this.hideBasicTable(false);
+          }
           if(this.selectionList.length > 0){
             this.currentCodeRuleOid = this.selectionList[list.length-1].oid;
             this.currentRuleLcStatus = this.selectionList[list.length-1].lcStatus;
-            //console.log(this.currentRuleLcStatus);
             this.loadBasic(this.selectionList[list.length-1]);
           }
         },
@@ -2264,7 +2357,7 @@
             this.loading = false;
             this.loadBasic(this.data[0])
             this.$nextTick(() => {
-              //this.$refs.crud.toggleRowSelection(this.data[0]);
+              this.$refs.crud.toggleRowSelection(this.data[0]);
               this.$refs.crud.setCurrentRow(this.data[0]);
             })
             this.selectionList = data.records[0];
@@ -2274,7 +2367,7 @@
 
 
         /** 绗竴灞傚璇濇鐩稿叧鏂规硶 */
-        // 鎵撳紑浜屽眰寮圭獥鏂规硶
+        // 鎵撳紑浜屽眰瀵硅瘽妗嗘柟娉�
         openAttrSelectOrGetValue(condition){
           if(condition === 'attr'){
             this.isShowSelectAttrOption = true;
@@ -2285,11 +2378,13 @@
             this.isShowParentClassifyOption = true;
           }else if(condition === 'referBtmId'){
             this.isShowSelectReferBtmOption = true;
+            this.refreshReferBtmDataChange();
           }else if(condition === 'referConfig'){
-            //this.$emit('openSelectreferConfig')
+            this.$refs.referConfigDialog.isShowReferConfig = true;
+            //琛ㄦ牸閿欒鐨勯棶棰樻墍
+            this.$refs.referConfigDialog.onloadAttrData();
           }
         },
-
         // 鐐瑰嚮杈撳叆妗嗙殑脳鍙凤紝娓呯┖杈撳叆妗嗕腑鐨勫唴瀹�
         clearAttrDataByIcon(condition){
           if(condition === 'attr'){
@@ -2434,7 +2529,6 @@
             this.sectypeList = res.data.data;
           })
           this.loadCodeSecLength();
-          //console.log(this.sectypeList);
         },
         loadCodeSecLength(){
           getDictionary({code: "codeSecLength"}).then(res=>{
@@ -2464,7 +2558,6 @@
         loadCodeGetValueType(){
           getDictionary({code: "codeGetValueType"}).then(res=>{
             this.codeGetValueType = res.data.data;
-            //console.log(this.codeGetValueType);
           })
         },
         
@@ -2483,7 +2576,6 @@
     padding: 14px 0 2px 20px;
   }
   
-
   .clone-input-textarea > .el-form-item__content {
     width: 495px;
   }
@@ -2515,17 +2607,16 @@
   .basic-container > .el-card  > .el-card__body {
     margin: -10px 0;
   }
+
   .code-basicsec-container{
     padding: 1px 6px;
   }
 
   .el-divider--horizontal {
-    margin-top: 19px !important;
+    /* margin-top: 19px !important; */
     margin-bottom: -20px !important;
+    width: 100%;
     height: 2px;
-    margin: 0;
-    position: fixed;
-    width: 57.5vw;
   }
 
   .el-card__body > .abox {
@@ -2554,34 +2645,51 @@
   }
 
   /** 鏂板鐮佹 */
-  .total{
-    height: 500px;
+  .add-basicsec-total {
     width: 100%;
   }
 
-  .total .el-input__inner,.total .el-textarea__inner {
+  .add-basicsec-total .el-input__inner,.add-basicsec-total .el-textarea__inner {
     width: 220px;
+  }
+
+  .add-basicsec-total > .add-basicsec-form {
+    display: flex;
+    flex-direction: row;
+    width: 100%;
+    height: 100%;
+    align-items: center;
+    justify-content: space-around;
   }
 
   .el-divider--vertical {
     width: 2px;
-    height: 72vh;
-    margin: 0 5px;
+    height: 72%;
+    margin: 0 auto;
     position: fixed;
   }
 
  .left {
-    float: left;
+    /* float: left; */
     width: 49%;
+    height: 100%;
  }
+
  .right {
-    float: right;
-    margin-right: 2.5vw;
-    /* width: 40%; */
+    /* float: right; */
+    margin-right: 2vw;
+    height: 100%;
+    width: auto;
  }
+
  .right > .el-form > .el-form-item{
     margin-bottom: 8px;
  }
-
+ /* 瀵硅瘽妗嗗簳閮ㄦ寜閽竟妗嗘牱寮� */
+ .el-dialog__footer{
+    /* width: 100%; */
+    border-top: 1px solid #E9E7E7;
+    padding: 5px 10px 10px;
+  }
 
 </style>
\ No newline at end of file

--
Gitblit v1.9.3