From aa8db511b7823300bf3312018fbec75a6fa1ccf5 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期二, 27 六月 2023 16:25:06 +0800
Subject: [PATCH] 提交代码

---
 Source/UBCS-WEB/src/views/code/code.vue |  370 +++++++++++++++++++++++++++++++++-------------------
 1 files changed, 231 insertions(+), 139 deletions(-)

diff --git a/Source/UBCS-WEB/src/views/code/code.vue b/Source/UBCS-WEB/src/views/code/code.vue
index 5e3a4ec..9962d0a 100644
--- a/Source/UBCS-WEB/src/views/code/code.vue
+++ b/Source/UBCS-WEB/src/views/code/code.vue
@@ -63,40 +63,46 @@
             @click="handleDelete">
             鍒� 闄�
           </el-button>
-          <el-button size="small"
+          <el-button type="primary"
+            size="small"
+            icon="el-icon-search"
+            plain
+            @click="openAdvancedQuery('codeRule')">
+            楂樼骇鏌ヨ
+          </el-button>
+          <el-button
+            size="small"
             icon="icon-kelong"
             plain
             @click="openCodeRuleDialog">
             鍏� 闅�
           </el-button>
-          <el-button size="small"
+          <el-button
+            size="small"
             icon="icon-lianjiekelong"
             style="font-size: 12px;"
             plain
             @click="openOtherCodeRuleDialog">
             浠庡叾浠栬鍒欎腑鍏嬮殕鐮佹
           </el-button>
-          <el-button size="small"
+          <el-button
+            size="small"
             icon="el-icon-s-help"
             plain
             @click="handleRange">
             浣跨敤鑼冨洿
           </el-button>
-          <el-button size="small"
+          <el-button 
+              size="small"
               icon="icon-qingkong"
               plain
               @click="clearAllCodeSec">
               娓呯┖鐮佸��
           </el-button>
-          <el-button size="small"
-            icon="el-icon-search"
-            plain
-            @click="openAdvancedQuery">
-            楂樼骇鏌ヨ
-        </el-button>
         </template>
       </avue-crud>
     </basic-container>
+
     <!-- 楂樼骇鏌ヨ瀵硅瘽妗� -->
     <advanced-query
       :ref="advancedQueryParam.ref"
@@ -104,6 +110,7 @@
       :visible.sync="advancedQueryParam.advancedQuerySettingBox"
       @echoContion="echoSeniorContionMap">
     </advanced-query>
+
     <!-- 缂栫爜瑙勫垯鐩稿叧瀵硅瘽妗� -->
     <el-dialog title="缂栫爜瑙勫垯浣跨敤鑼冨洿"
       append-to-body
@@ -117,6 +124,7 @@
         @refresh-change="refreshUseRangeChange">
       </avue-crud>
     </el-dialog>
+
     <!-- 缂栫爜瑙勫垯,鍏嬮殕瀵硅瘽妗� -->
     <el-dialog title="鍏嬮殕缂栫爜瑙勫垯"
       append-to-body
@@ -170,6 +178,7 @@
         <el-button @click="cloneSettingBox = false">鍙� 娑�</el-button>
       </div>
     </el-dialog>
+
     <!-- 缂栫爜瑙勫垯,浠庡叾浠栬鍒欏厠闅嗗璇濇 -->
     <el-dialog title="鍏嬮殕缂栫爜瑙勫垯鐨勫熀纭�淇℃伅"
       append-to-body
@@ -286,6 +295,14 @@
             plain
             @click="deleteBasicCode(scope.row)">
             鍒� 闄�
+        </el-button>
+        <el-button type="primary"
+            size="small"
+            icon="el-icon-search"
+            plain
+            :disabled="selectionList.length <= 0"
+            @click="openAdvancedQuery('codeBasicSec')">
+            楂樼骇鏌ヨ
         </el-button>
       </template>
 
@@ -511,7 +528,7 @@
                 </el-select>
               </el-form-item>
               <el-form-item label="琛ヤ綅鏃剁殑瀛楃:" :label-width="rightFormLabelWidth">
-                <el-select v-model="form.codeFillSeparatorSelect" @blur="inputSelectBlur" filterable placeholder="璇烽�夋嫨" :disabled="basicSecOnlyRead">
+                <el-select v-model="form.codeFillSeparator" @blur="inputSelectBlur" filterable placeholder="璇烽�夋嫨" :disabled="basicSecOnlyRead">
                   <el-option
                     v-for="item in enumParam.codeFillSeparator"
                     :key="item.itemValue"
@@ -648,7 +665,7 @@
                 </el-select>
               </el-form-item>
               <el-form-item label="琛ヤ綅鏃剁殑瀛楃:" :label-width="rightFormLabelWidth">
-                <el-select v-model="form.codeFillSeparatorSelect" filterable @blur="inputSelectBlur" placeholder="璇烽�夋嫨" :disabled="basicSecOnlyRead">
+                <el-select v-model="form.codeFillSeparator" filterable @blur="inputSelectBlur" placeholder="璇烽�夋嫨" :disabled="basicSecOnlyRead">
                   <el-option
                     v-for="item in enumParam.codeFillSeparator"
                     :key="item.itemValue"
@@ -762,6 +779,7 @@
         ref="referConfigFormDialog"
         @echoReferConfig="echoReferConfig">
       </refer-config-form-dialog>
+      
       <!-- 绗簩灞傚璇濇,鐩存帴閫夋嫨鍙傜収閰嶇疆crud缁勪欢 -->
       <refer-config-crud-dialog
         ref="referConfigCrudDialog"
@@ -1052,7 +1070,8 @@
           advancedQueryParam: {
             ref: 'advancedQuery',
             advancedQuerySettingBox: false,
-            options: {},
+            options: [],
+            currentOpen: '', //褰撳墠鎵撳紑楂樼骇鏌ヨ鐨勭獥鍙f槸
             //conditionMapParams: {},
           },
 
@@ -1069,49 +1088,24 @@
           };
         },
       },
-      created() {
-          MasterTable({
-            codeClassifyOid: "D9CF223F-317D-71EB-BD11-433A94CAD9F3",
-            functionId: 5,
-          }).then(res=>{
-            console.log(res.data.tableDefineVO.seniorQueryColumns);
-            this.advancedQueryParam.options = res.data.tableDefineVO.seniorQueryColumns;
-          }) 
-          // this.advancedQueryParam.options = [
-          //   {
-          //     data: [],
-          //     title: '缂栧彿',
-          //     fieldType: 'text',
-          //     queryField: 'id',
-          //   },{
-          //     data: [],
-          //     title: '鍚嶇О',
-          //     fieldType: 'text',
-          //     queryField: 'name',
-          //   },{
-          //     data: [],
-          //     title: '鎻忚堪',
-          //     fieldType: 'text',
-          //     queryField: 'description',
-          //   }, {
-          //     data: [],
-          //     title: '鐘舵��',
-          //     fieldType: 'text',
-          //     queryField: 'description',
-          //   }
-          // ]
-      },
       watch:{
 
       },
       methods: {
 
-        /** 楂樼骇鏌ヨ瀵硅瘽妗嗙粍浠�,缁勪欢杩斿洖鐨勫�兼槸condtionMap[field]褰㈠紡鐨勬煡璇㈡潯浠讹紝淇濈暀鍜屼箣鍓嶄竴鏍� */
+        /** 楂樼骇鏌ヨ瀵硅瘽妗嗙粍浠�,缁勪欢杩斿洖鐨勫�兼槸condtionMap[field]褰㈠紡鐨勬煡璇㈡潯浠讹紝淇濈暀浜嗗拰涔嬪墠涓�鏍风殑鏂瑰紡 */
         echoSeniorContionMap(conditionMaps){
-          console.log(conditionMaps);
-          
+          //console.log(conditionMaps);
+          if(JSON.stringify(conditionMaps)!='{}'){
+            if(this.advancedQueryParam.currentOpen =='codeRule'){
+              this.query = conditionMaps;
+              this.onLoad(this.page);
+            }else{
+              this.sendGridCodeBasicSec(conditionMaps,true);
+            }
+            //console.log(conditionMaps);
+          }
         },
-
         /* 鍏紡缂栬緫妗嗗唴瀹规敼鍙�,瀛愮粍浠剁紪杈戝畬鍏紡涔嬪悗鍐呭鍥炴樉鏃惰皟鐢� */
         updateFormulaContent(content){
           this.form.getValueClass = content;
@@ -1124,12 +1118,13 @@
           //杞崲鎴怞SON瀛楃涓茶繘琛岀埗缁勪欢鍥炴樉
           let submitFormJson = JSON.stringify(content);
           this.form.referConfig = submitFormJson;
+          this.form.referValueInfo = submitFormJson;
         },
         /** 寮曠敤鐮佹涓恒�愬弬鐓у紩鐢ㄧ殑涓氬姟绫诲瀷銆戦�夊彇鍊间箣鍚庣殑鍐呭鍥炴樉鏃惰皟鐢� */
         echoReferBtmType(content){
-            // 瀹炵幇鍥炴樉
-            this.form.referBtmId = content.id;
-            this.form.referBtmName = content.name;
+          // 瀹炵幇鍥炴樉
+          this.form.referBtmId = content.id;
+          this.form.referBtmName = content.name;
         },
         
         /** 鐖跺垎绫婚�夋嫨瀵硅瘽妗嗭紝绗簩灞傚祵濂楀璇濇锛屽強鍏剁浉鍏虫柟娉� */ 
@@ -1184,8 +1179,13 @@
           let parentClsParam = this.parentClsfyParams;
           parentClsParam.classifyDialogLoading = true;
           let oid = this.selectionList.length==0 ? this.form.pkCodeRule:this.selectionList[0].oid;
-          Object.assign(params,{pkCodeRule:oid})
-          refDataGridClassifySec(page.currentPage, page.pageSize, Object.assign(params, parentClsParam.parentClassifyQuery)).then(res => {
+          let conditionMaps = {};
+          conditionMaps['conditionMap[pkCodeRule]'] = oid;
+          refDataGridClassifySec(
+            page.currentPage, 
+            page.pageSize, 
+            conditionMaps
+          ).then(res => {
             //console.log(res.data);
             const data = res.data.data;
             parentClsParam.parentClassifyDataPage.total = data.total;
@@ -1206,23 +1206,25 @@
         loadlistClassifyLinkAttr() {
           let attrParam = this.selectAttrParams;
           //console.log(this.currentSelectTreeData);
-          attrParam.selectAttrOptionLoading = true;
-          let param = {};
-          // 澶氫釜conditionMap杩欐牱浼犲弬
+          this.selectAttrParams.selectAttrOptionLoading = true;
+          let conditionMaps = {};
           if(attrParam.selectAttrQeury){
-              Object.keys(attrParam.selectAttrQeury).forEach(key=>{
-                  param['conditionMap['+key+']'] = attrParam.selectAttrQeury[key];
-              });
-          }
-          param['conditionMap[codeClassifyOid]'] = this.currentSelectTreeData.oid;
-          param['conditionMap[btmTypeOid]'] = this.currentSelectTreeData.btmTypeOid;
-          listClassifyLinkAttr(param).then(res=>{
-            //console.log(res.data.data);
-            attrParam.selectAttrData = res.data.data;
-            attrParam.selectAttrOptionLoading = false;
-            this.$nextTick(() => {
-                this.$refs[attrParam.ref].doLayout()
+            Object.keys(attrParam.selectAttrQeury).forEach(key=>{
+              conditionMaps['conditionMap['+key+']'] = attrParam.selectAttrQeury[key].trim();
             });
+          }
+          conditionMaps['conditionMap[codeClassifyOid]'] = this.currentSelectTreeData.oid;
+          conditionMaps['conditionMap[btmTypeOid]'] = this.currentSelectTreeData.btmTypeOid;
+          listClassifyLinkAttr(conditionMaps).then(res=>{
+            const data = res.data;
+            this.$nextTick(() => {
+              this.$refs[attrParam.ref].doLayout()
+            });
+            //console.log(data.data);
+            this.selectAttrParams.selectAttrData = data.data;
+            this.selectAttrParams.selectAttrOptionLoading = false;
+            // 灏嗘悳绱㈡鍐呭缃┖
+            this.selectAttrParams.selectAttrQeury = {};
           })
         },
         // 鐐瑰嚮鎼滅储鍚庤Е鍙戣浜嬩欢
@@ -1668,7 +1670,8 @@
               // 鍏抽棴瀵硅瘽妗�
               this.addBasicCodeSettingBox = false
             }
-            
+            // 鐐瑰嚮鏂板鍩虹鐮佹,鍏抽棴绐楀彛涔嬪悗瑙﹀彂閲嶆柊鍔犺浇
+            this.loadBasic(this.selectionList[0]);
           }else{
             editSave(this.form).then(() => {
                // 鍏抽棴瀵硅瘽妗�
@@ -1680,9 +1683,8 @@
               }, error => {
                 window.console.log(error);
             });
+            this.loadBasic(this.selectionList[0]);
           }
-          // 鐐瑰嚮鏂板鍩虹鐮佹,鍏抽棴绐楀彛涔嬪悗瑙﹀彂閲嶆柊鍔犺浇
-          this.loadBasic(this.selectionList[0]);
         },
         // 鍥犱负elementui鐨勮〃鍗曟牎楠岃缃笉涓婃墍浠ラ噰鐢ㄥ垽鏂殑鏂瑰紡鏉ュ仛琛ㄥ崟妫�楠屾柟寮�
         checkForm(){
@@ -1730,7 +1732,7 @@
               return false;
             }
           }else if(this.form.secType==='codeserialsec'){
-            console.log(form.codeFillType);
+            //console.log(form.codeFillType);
             //娴佹按鐮佹
             if(form.codeSecLength == ''){
               this.$message.warning('(鐮佹鐨勯暱搴�)'+tipsMsg);
@@ -1756,7 +1758,7 @@
               this.$message.warning('(缂栫爜琛ヤ綅鏂瑰紡)'+tipsMsg);
               return false;
             }
-            if(form.codeFillType != '涓嶈ˉ浣�' && form.codeFillSeparatorSelect == ''){
+            if(form.codeFillType != '涓嶈ˉ浣�' && form.codeFillSeparator == ''){
               this.$message.warning('褰撹ˉ浣嶆柟寮忎负宸﹁ˉ浣嶆垨鑰呭彸琛ヤ綅鐨勬椂鍊欙紝琛ヤ綅瀛楃涓嶈兘涓虹┖');
               return false;
             }
@@ -1780,11 +1782,10 @@
               this.$refs.codeFillLimit.$el.querySelector('input').focus();
               return false;
             }
-            if(form.codeFillFlag == ''){
-              this.$message.warning('(娴佹按鏄惁琛ョ爜)'+tipsMsg);
-              this.$refs.switch.$el.querySelector('input').focus();
-              return false;
-            }
+            // if(form.codeFillFlag == '' || ){
+            //   this.$message.warning('(娴佹按鏄惁琛ョ爜)'+tipsMsg);
+            //   return false;
+            // }
           }else if(this.form.secType==='codelevelsec'){
             //灞傜骇鐮佹
             if(form.codeLevelType == ''){
@@ -1852,7 +1853,8 @@
               this.$message.warning('(缂栫爜琛ヤ綅鏂瑰紡)'+tipsMsg);
               return false;
             }
-            if(form.codeFillType != '涓嶈ˉ浣�' && form.codeFillSeparatorSelect == ''){
+            // console.log(form);
+            if(form.codeFillType != 'code_fill_none' && form.codeFillSeparator == ''){
               this.$message.warning('褰撹ˉ浣嶆柟寮忎负宸﹁ˉ浣嶆垨鑰呭彸琛ヤ綅鐨勬椂鍊欙紝琛ヤ綅瀛楃涓嶈兘涓虹┖');
               return false;
             }
@@ -1900,17 +1902,29 @@
           }
           // console.log(row.oid);
           //瀛樺偍褰撳墠鍏宠仈鐨勭紪鐮佽鍒欑浉鍏充俊鎭�
-          this.currentCodeRuleOid = row.oid;
-          this.currentRuleLcStatus = row.lcStatus;
-          this.sendGridCodeBasicSec({"pkCodeRule":row.oid});
+          if(row!='' || row!=null){
+            this.currentCodeRuleOid = row.oid;
+            this.currentRuleLcStatus = row.lcStatus;
+            this.sendGridCodeBasicSec({"pkCodeRule":row.oid},false);
+          }
         },
         // 鍙戦�佸姞杞藉熀纭�鐮佹鐨勮姹�
-        sendGridCodeBasicSec(condition){
+        sendGridCodeBasicSec(condition,isAdancedQuery/** 鏄惁楂樼骇鏌ヨ */){
           // 濡傛灉褰撳墠鍩虹鐮佹琛ㄤ腑鐨勬悳绱㈡寜閽闅愯棌锛屽氨闇�瑕佸湪姝ゅ紑鍚�
           if(this.selectionList.length>=0 && !this.$refs.crudBasic.option.column[0].search){
             this.hideBasicTable(true);
           }
-          gridCodeBasicSec(1, -1, condition).then(res => {
+          let conditionMaps = {};
+          if(condition && !isAdancedQuery){
+            Object.keys(condition).forEach(key=>{
+              conditionMaps['conditionMap['+key+']'] = condition[key].trim();
+            });
+          }
+          if(isAdancedQuery){
+            condition['conditionMap[pkCodeRule]'] = this.currentCodeRuleOid == null || this.currentCodeRuleOid == '' 
+            ? this.selectionList[0].oid:this.currentCodeRuleOid;
+          }
+          gridCodeBasicSec(1, -1,isAdancedQuery ? condition:conditionMaps).then(res => {
             const data = res.data.data;
             if(this.cloneSettingBox){
               this.cloneData = data.records;
@@ -1938,11 +1952,11 @@
         },
         basicSearchChange(params, done){
           //console.log(this.$refs.crudBasic);
-          this.sendGridCodeBasicSec(Object.assign(params,{"pkCodeRule":this.selectionList[this.selectionList.length-1].oid}));
+          this.sendGridCodeBasicSec(Object.assign(params,{"pkCodeRule":this.selectionList[this.selectionList.length-1].oid}),false);
           done();
         },
         basicSearchReset(){
-          this.sendGridCodeBasicSec({"pkCodeRule":this.selectionList[this.selectionList.length-1].oid});
+          this.sendGridCodeBasicSec({"pkCodeRule":this.selectionList[this.selectionList.length-1].oid},false);
         },
         // 涓婄Щ涓嬬Щ鍩虹鐮佹
         upOrderNum(row){
@@ -1992,7 +2006,7 @@
         },
         // 鍩虹鐮佹鍒锋柊鏃舵煡璇�
         refreshChangeBasicSec(){
-          this.loadBasic({"oid":this.currentCodeRuleOid == null || this.currentCodeRuleOid == '' ? this.selectionList[0].oid:this.currentCodeRuleOid});
+          this.loadBasic(this.selectionList.at(-1));
         },
         // 鎿嶄綔鍩虹鐮佹涓悳绱㈡竻绌虹瓑鎸夐挳鐨勬樉绀�/闅愯棌
         hideBasicTable(hideBoolean){
@@ -2000,13 +2014,82 @@
           this.$refs.crudBasic.option.columnBtn = hideBoolean;
           this.$refs.crudBasic.option.column[0].search = hideBoolean;
           this.$refs.crudBasic.option.column[1].search = hideBoolean;
+          if(!hideBoolean){
+            this.selectionList = [];
+            this.basicData = [];
+          }
         },
 
 
         /** 缂栫爜瑙勫垯鐩稿叧鏂规硶 */
         // 鎵撳紑楂樼骇鏌ヨ绐楀彛
-        openAdvancedQuery(){
-          this.advancedQueryParam.advancedQuerySettingBox = !this.advancedQueryParam.advancedQuerySettingBox;
+        openAdvancedQuery(condition){
+          if(condition=='codeRule'){
+            this.advancedQueryParam.options = [
+              {
+                data: [],
+                title: '缂栧彿',
+                fieldType: 'text',
+                queryField: 'id',
+              },{
+                data: [],
+                title: '鍚嶇О',
+                fieldType: 'text',
+                queryField: 'name',
+              },{
+                data: [],
+                title: '鎻忚堪',
+                fieldType: 'text',
+                queryField: 'description',
+              },{
+                data: [
+                  // {
+                  //   key: '缂栬緫涓�',
+                  //   value: 'Editing',
+                  // },
+                  // {
+                  //   key: '宸插彂甯�',
+                  //   value: 'Released',
+                  // },
+                  // {
+                  //   key: '鍋滅敤',
+                  //   value: 'Disabled',
+                  // },
+                ],
+                title: '鐘舵��',
+                fieldType: 'combox',
+                queryField: 'lcStatus',
+                comboxKey: 'codeSearchLCStatus',
+              },
+            ]
+          }else {
+            this.advancedQueryParam.options = [
+              {
+                data: [],
+                title: '鐮佹缂栧彿',
+                fieldType: 'text',
+                queryField: 'id',
+              },{
+                data: [],
+                title: '鐮佹鍚嶇О',
+                fieldType: 'text',
+                queryField: 'name',
+              },{
+                data: [],
+                title: '鎻忚堪',
+                fieldType: 'text',
+                queryField: 'description',
+              },{
+                data: [],
+                title: '鐮佹绫诲瀷',
+                fieldType: 'combox',
+                queryField: 'secType',
+                comboxKey: 'codeSecType',
+              }
+            ]
+          }
+          this.advancedQueryParam.currentOpen = condition;
+          this.advancedQueryParam.advancedQuerySettingBox = true;
         },
         // 鏌ヨ浣跨敤鑼冨洿
         handleRange(){
@@ -2032,17 +2115,6 @@
         // 鍒锋柊浣跨敤鑼冨洿鍒楄〃
         refreshUseRangeChange(){
           this.getRangeCodeList();
-        },
-        // 鍗曞嚮缂栫爜瑙勫垯瀹炵幇琛岄�夋嫨
-        codeRuleRowClick (row) {
-          // 杩欏効搴旇鍙互涓嶈锛屽洜涓簍oggleRowSelection涔熶細瑙﹀彂琛岄�夋嫨鏃堕棿
-          this.selectionList = row;
-          this.$refs.crud.toggleSelection();
-          this.$refs.crud.setCurrentRow(row);
-          this.$refs.crud.toggleRowSelection(row); //閫変腑褰撳墠琛�
-          if(row!=''){
-            this.loadBasic(row);
-          }
         },
         // 鍚敤涓庡仠鐢�
         enableOrDeactivatse(oId,update){
@@ -2140,7 +2212,7 @@
           this.selectionOtherCloneCodeBasicList = list;
           this.$refs.crudCloneCodeBasicOther.setCurrentRow(this.selectionOtherCloneCodeBasicList[list.length-1]);
         },
-         // 浠庡叾浠栫紪鐮佽鍒欎腑鍏嬮殕鐮佹淇℃伅
+        // 浠庡叾浠栫紪鐮佽鍒欎腑鍏嬮殕鐮佹淇℃伅
         saveOtherCodeBasic(){
           let oid = this.selectionList[0].oid;
           let fromDialogPkCodebasic = this.selectionOtherCloneCodeBasicList;
@@ -2158,7 +2230,7 @@
           //console.log(res);
           let oidArr = [];
           fromDialogPkCodebasic.forEach(ele => {
-            oidArr.push(ele.id);
+            oidArr.push(ele.oid);
           });
           let data = {
             "pkCodeRule": oid,
@@ -2275,25 +2347,38 @@
           this.onLoad(this.page);
         },
         searchChange(params, done) {
-          this.query = params;
           this.page.currentPage = 1;
-          this.onLoad(this.page, params);
+          // 澶氫釜conditionMap杩欐牱浼犲弬锛屽揩閫熸煡璇㈤粯璁ら噰鐢ㄦā绯婃煡璇�
+          let requestData = {};
+          if(params){
+            Object.keys(params).forEach(key=>{
+              requestData["conditionMap"+'['+key+'_like]'] = params[key].trim();
+            });
+          }
+          this.query = requestData;
+          this.onLoad(this.page);
           done();
         }, 
         // 缂栫爜瑙勫垯褰撳墠閫変腑琛屽彉鍖栫殑鏃跺�欒Е鍙�
         selectionChange(list) {
           this.selectionList = list;
-          this.$refs.crud.setCurrentRow(this.selectionList[list.length-1]);
-          //褰撳墠閫変腑琛屼负绌虹殑鏃跺�欏氨灏嗙爜娈电鐞嗚〃鏍兼暟鎹疆绌�
-          if(list == ''){
-            this.basicData = [];
+          //褰撳墠閫変腑琛屼负绌虹殑鏃跺�欏氨灏嗙爜娈电鐞嗚〃鏍兼暟鎹疆绌�,骞剁鐢ㄧ浉鍏冲姛鑳�
+          if(this.selectionList.length <= 0){
             this.hideBasicTable(false);
           }
-          if(this.selectionList.length > 0){
+          if (this.selectionList.length > 0) {
+            this.$refs.crud.setCurrentRow(this.selectionList[list.length-1]);
             this.currentCodeRuleOid = this.selectionList[list.length-1].oid;
             this.currentRuleLcStatus = this.selectionList[list.length-1].lcStatus;
             this.loadBasic(this.selectionList[list.length-1]);
           }
+        },
+        // 鍗曞嚮缂栫爜瑙勫垯瀹炵幇琛岄�夋嫨
+        codeRuleRowClick (row) {
+          // console.log(this.currentRuleLcStatus);
+          this.$refs.crud.toggleSelection();
+          this.$refs.crud.toggleRowSelection(row); //閫変腑褰撳墠琛�
+  
         },
         selectionClear() {
           this.selectionList = [];
@@ -2308,14 +2393,23 @@
         refreshChange() {
           this.onLoad(this.page, this.query);
         },
-        onLoad(page, params = {}) {
+        onLoad(page,params={}) {
           this.loading = true;
-          gridCodeRule(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
+          gridCodeRule(
+            page.currentPage, 
+            page.pageSize, 
+            this.query
+          ).then(res => {
             //console.log(res.data);
             const data = res.data.data;
             this.page.total = data.total;
             this.data = data.records;
             this.loading = false;
+            // 鏌ヨ鐨勫�间负绌烘椂锛岃灏嗙爜娈电鐞嗙浉鍏崇殑鍐呭绂佺敤
+            if(data.records.length <= 0) {
+              this.hideBasicTable(false);
+              return;
+            }
             this.loadBasic(this.data[0])
             this.$nextTick(() => {
               this.$refs.crud.toggleRowSelection(this.data[0]);
@@ -2409,7 +2503,7 @@
         // 琛ヤ綅鏃剁殑瀛楃锛屽疄鐜板彲杈撳彲閫�
         inputSelectBlur(e){
           if (e.target.value) {  
-            this.form.codeFillSeparatorSelect = e.target.value;
+            this.form.codeFillSeparator = e.target.value;
           }
         },
         // 鐮佹绫诲瀷鏀瑰彉鏃讹紝澧炲姞瀵瑰簲鐨刦orm琛ㄥ崟涓殑灞炴��
@@ -2470,8 +2564,8 @@
               serialStart: row!=null&&row.serialStart != '' ? row.serialStart:1,  //娴佹按鍙疯捣濮嬪��
               serialStep: row!=null&&row.serialStep != '' ? row.serialStep:1,   //娴佹按鐨勬闀�
               codeFillType: row!=null&&row.codeFillType != '' ? row.codeFillType:'code_fill_left', //缂栫爜琛ヤ綅鏂瑰紡
-              codeFillSeparatorSelect: row!=null&&row.codeFillSeparator != '' ? row.codeFillSeparatorSelect:0,    //琛ヤ綅鏃剁殑瀛楃锛岄�変腑鐨勪笅鎷夋鐨勪笅鏍�
-              codeFillSeparator: row!=null&&row.codeFillSeparator != '' ? row.codeFillSeparator:0,          //琛ヤ綅鏃剁殑瀛楃
+              // codeFillSeparatorSelect: row!=null&&row.codeFillSeparatorSelect != '' ? row.codeFillSeparatorSelect:0,    //琛ヤ綅鏃剁殑瀛楃锛岄�変腑鐨勪笅鎷夋鐨勪笅鏍�
+              codeFillSeparator: row!=null&&row.codeFillSeparator != '' ? row.codeFillSeparator:'0',          //琛ヤ綅鏃剁殑瀛楃
               codeFillLength: row!=null&&row.codeFillLength != '' ? row.codeFillLength:'',              //濉厖闀垮害
               codeFillLimit: row!=null&&row.codeFillLimit != '' ? row.codeFillLimit:'',               //娴佹按涓婇檺
               codeFillFlag: row!=null&&row.codeFillFlag != '' ? row.codeFillFlag=='true' ?  true:false :false,      //娴佹按鏄惁琛ョ爜
@@ -2497,6 +2591,7 @@
               referBtmId: row!=null&&row.referBtmId != '' ? row.referBtmId:'',   //鍙傜収寮曠敤鐨勪笟鍔$被鍨嬶紝鐨刬d
               referBtmName: row!=null&&row.referBtmName != '' ? row.referBtmName:'', //鍙傜収寮曠敤鐨勪笟鍔$被鍨�
               referConfig: row!=null&&row.referConfig != '' ? row.referConfig:'',  //鍙傜収閰嶇疆
+              referValueInfo: row!=null&&row.referValueInfo != '' ? row.referValueInfo:'',  //鍙傜収閰嶇疆
             });
           }else if(this.form.secType==='codedatesec'){
             //鏃ユ湡鐮佹
@@ -2518,51 +2613,48 @@
             //鍙彉鐮佹
             this.form = Object.assign({}, this.form,{
               codeSecLength: row!=null&&row.codeSecLength != '' ? row.codeSecLength:'',             //鐮佹鐨勯暱搴�
-              codeFillType: row!=null&&row.codeFillType != '' ? row.codeFillType:'code_fill_right', //缂栫爜閮ㄤ綅鏂瑰紡锛屾灇涓炬煡璇�
-              codeFillSeparatorSelect: row!=null&&row.codeFillSeparatorSelect != '' ? row.codeFillSeparatorSelect:0,  //閫変腑鐨勮ˉ浣嶆椂鐨勫瓧绗︾殑涓嬫爣
-              codeFillSeparator: row!=null&&row.codeFillSeparator != '' ? row.codeFillSeparator:'', //琛ヤ綅鏃剁殑瀛楃锛屽彲杈撳彲閫夋煡璇�
+              codeFillType: row!=null&&row.codeFillType != '' ? row.codeFillType:'code_fill_left', //缂栫爜閮ㄤ綅鏂瑰紡锛屾灇涓炬煡璇�
+              // codeFillSeparatorSelect: row!=null&&row.codeFillSeparatorSelect != '' ? row.codeFillSeparatorSelect:0,  //閫変腑鐨勮ˉ浣嶆椂鐨勫瓧绗︾殑涓嬫爣
+              codeFillSeparator: row!=null&&row.codeFillSeparator != '' ? row.codeFillSeparator:'0', //琛ヤ綅鏃剁殑瀛楃锛屽彲杈撳彲閫夋煡璇�
             });
             this.loadCodeFillType();
             this.loadCodeFillSeparator();
           }
           // console.log(this.form);
         },
+        // 绗竴娆¤姹傜殑鏋氫妇鏁版嵁鏀剧紦瀛�
+        getLocalStorageEnum(key){
+          let enumCach = JSON.parse(localStorage.getItem(key));
+          if(enumCach == null) {
+            getDictionary({code: key}).then(res=>{
+              enumCach = res.data.data;
+              localStorage.setItem(key,JSON.stringify(res.data.data));
+            })
+          }
+          return enumCach;
+        },
         //鏋氫妇鍜屽彲杈撳彲閫夊唴瀹规煡璇�
         loadCodeSecType(){
-          getDictionary({code: "codeSecType"}).then(res=>{
-            this.enumParam.secTypeList = res.data.data;
-          })
+          this.enumParam.secTypeList = this.getLocalStorageEnum("codeSecType");
           this.loadCodeSecLength();
         },
         loadCodeSecLength(){
-          getDictionary({code: "codeSecLength"}).then(res=>{
-            this.enumParam.codeSecLengthType = res.data.data;
-          })
+          this.enumParam.codeSecLengthType = this.getLocalStorageEnum("codeSecLength");
         },
         loadCodeFillType(){
-          getDictionary({code: "codeFillType"}).then(res=>{
-            this.enumParam.codeFillType = res.data.data;
-          })
+          this.enumParam.codeFillType = this.getLocalStorageEnum("codeFillType");
         },
         loadCodeFillSeparator(){
-          getDictionary({code: "codeFillSeparator"}).then(res=>{
-            this.enumParam.codeFillSeparator = res.data.data;
-          })
+          this.enumParam.codeFillSeparator = this.getLocalStorageEnum("codeFillSeparator");
         },
         loadCodeLevelType(){
-          getDictionary({code: "codeLevelType"}).then(res=>{
-            this.enumParam.codeLevelType = res.data.data;
-          })
+          this.enumParam.codeLevelType = this.getLocalStorageEnum("codeLevelType");
         },
         loadCodeCutType(){
-          getDictionary({code: "codeCutType"}).then(res=>{
-            this.enumParam.codeCutType = res.data.data;
-          })
+          this.enumParam.codeCutType = this.getLocalStorageEnum("codeCutType");
         },
         loadCodeGetValueType(){
-          getDictionary({code: "codeGetValueType"}).then(res=>{
-            this.enumParam.codeGetValueType = res.data.data;
-          })
+          this.enumParam.codeGetValueType =  this.getLocalStorageEnum("codeGetValueType");
         },
         
       }

--
Gitblit v1.9.3