From f09e05514d9a9e2623cfa73c4de1ffa98bb30bf8 Mon Sep 17 00:00:00 2001
From: xiejun <xiejun@vci-tech.com>
Date: 星期二, 23 一月 2024 10:09:07 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 Source/UBCS-WEB/src/components/code-dialog-page/referConfigFormDialog.vue |  160 ++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 126 insertions(+), 34 deletions(-)

diff --git a/Source/UBCS-WEB/src/components/code-dialog-page/referConfigFormDialog.vue b/Source/UBCS-WEB/src/components/code-dialog-page/referConfigFormDialog.vue
index 8c30e40..295ca05 100644
--- a/Source/UBCS-WEB/src/components/code-dialog-page/referConfigFormDialog.vue
+++ b/Source/UBCS-WEB/src/components/code-dialog-page/referConfigFormDialog.vue
@@ -189,45 +189,27 @@
             @echoSelectedAttr="echoSelectedAttr">
         </refer-select-btm-attr-dialog>
 
-        <el-dialog title="閫夋嫨鏄剧ず瀛楁"
+        <el-dialog title="閫夊彇IN鎴朜OTIN鏉′欢"
             append-to-body
-            :visible.sync="isShowShowField"
+            :visible.sync="isShowInOrNotInCondition"
             width="70%"
             destroy-on-close
             style="height: 110vh; margin-top: -12vh; overflow-y: hidden">
-            <avue-crud :option="selectionShowFieldOption"
-                :table-loading="selectShowFieldLoading"
-                :data="selectShowFieldData"
-                ref="selectShowFieldCrud"
-                @row-click="showFieldRowClick"
-                @selection-change="selectionShowFieldDataChange"
-                @search-change="showFieldSearchChange"
-                @search-reset="showFieldSearchReset">
+            <avue-crud :option="selectInOrNotInCondOption"
+                :page.sync="inOrNotInPage"
+                @current-change="inOrNotInCurrentChange"
+                @size-change="inOrNotInSizeChange"
+                @selection-change="selectionInOrNotInChange"
+                @row-click="rowInOrNotInClick"
+                @search-change="selectInOrNotInSearchChange"
+                @search-reset="searchInOrNotInReset"
+                :data="selectInOrNotInCondData"
+                ref="inOrNotInConditionCrud">
             </avue-crud>
             <div slot="footer" class="dialog-footer">
-                <el-button type="primary" @click="selectedShowField">纭� 瀹�</el-button>
-                <el-button @click="isShowShowField = false">鍙� 娑�</el-button>
-            </div>
-        </el-dialog>
-
-        <el-dialog title="閫夋嫨鏌ヨ鏉′欢"
-            append-to-body
-            :visible.sync="isShowSearchCondition"
-            width="70%"
-            destroy-on-close
-            style="height: 110vh; margin-top: -12vh; overflow-y: hidden">
-            <avue-crud :option="selectionSearchConditionOption"
-                :table-loading="selectSearchConditionLoading"
-                :data="selectSearchConditionData"
-                ref="selectSearchConditionCrud"
-                @row-click="searchConditionRowClick"
-                @selection-change="searchConditionDataChange"
-                @search-change="searchConditionSearchChange"
-                @search-reset="searchConditionSearchReset">
-            </avue-crud>
-            <div slot="footer" class="dialog-footer">
-                <el-button type="primary" @click="selectedSearchCondition">纭� 瀹�</el-button>
-                <el-button @click="isShowSearchCondition = false">鍙� 娑�</el-button>
+              <!-- <div class="avue-dialog__footer--left valueInfo">{{ valueInfo }}</div> -->
+              <el-button type="primary" @click="selectedInOrNotInCond">纭� 瀹�</el-button>
+              <el-button @click="isShowInOrNotInCondition = false">鍙� 娑�</el-button>
             </div>
         </el-dialog>
 
@@ -236,6 +218,7 @@
 
 <script>
     import func from "@/util/func";
+    import {getList} from "@/api/refer/table";
     export default {
         name: "referConfigFormDialog",
         props: {
@@ -420,7 +403,7 @@
                             clearable: false,
                             dicData: [
                                 {   
-                                    value: '_in', label: '瀛樺湪浜�'
+                                  value: '_in', label: '瀛樺湪浜�'
                                 },{
                                     value: '_notin', label: '涓嶅瓨鍦ㄤ簬'
                                 },{
@@ -473,6 +456,37 @@
                 preClickAttrRow: '',
                 preClickAddSearchConditionRow: '',
 
+                //鐐瑰嚮琛屽脊鍑篿n鎴杗otin鐨勫��
+                isShowInOrNotInCondition: false,
+                selectInOrNotInCondData: [],
+                selectInOrNotInCondOption: {
+                  height:'220',
+                  tip: false,
+                  addBtn: false,
+                  editBtn: false,
+                  searchShow: true,
+                  searchMenuSpan: 6,
+                  border: false,
+                  index: true,
+                  viewBtn: false,
+                  delBtn: false,
+                  selection: true,
+                  disablePage: false,
+                  refreshBtn: false,
+                  columnBtn: false,
+                  menu: false,
+                  dialogClickModal: false,
+                  highlightCurrentRow: true,
+                  column: []
+                },
+                inOrNotInPage: {
+                  pageSize: 10,
+                  currentPage: 1,
+                  total: 0,
+                },
+                selectionInOrNotInList: [],
+                inOrNotInParam: {},
+                
             };
         },
         // 琛ㄥ崟鐣岄潰鏄剧ず鍐呭閰嶇疆
@@ -981,9 +995,78 @@
                     //console.log(this.codeShowFieldConfigVOS[this.preClickAttrRow.$index]);
                     this.form.codeSrchCondConfigVOS[this.preClickAddSearchConditionRow.$index].$cellEdit = false;
                 }
+                if(row.filterType === '_in' || row.filterType === '_notin'){
+                  //console.log(row);
+                  this.selectInOrNotInCondOption.column = [{
+                    prop: row.filterField,
+                    label: row.filterTypeText,
+                    search: true,
+                    searchLabelWidth: 45,
+                    searchSpan: 8,
+                    sortable: true,
+                  }]
+                  this.initPageData.pageSize = 10;
+                  this.initPageData.currentPage = 1;
+                  this.loadInOrNotInConditionData(this.initPageData);
+                  this.isShowInOrNotInCondition = true;
+                }
                 row.$cellEdit = true;
                 this.preClickAddSearchConditionRow = row;
             },
+            loadInOrNotInConditionData(page, params = {}){
+              let mustParams = {
+                referType: this.form.referType,
+                referBo: this.form.referType,
+              };
+              getList(Object.assign(mustParams,params),page.currentPage,page.pageSize,'/api/ubcs-code/mdmEngineController/defaultReferDataGrid','GET').then(res=>{
+                //console.log(res.data);
+                this.selectInOrNotInCondData = res.data.records;
+                this.inOrNotInPage.total = res.data.total;
+              });
+            },
+            inOrNotInCurrentChange(currentPage) {
+              this.inOrNotInPage.currentPage = currentPage;
+            },
+            inOrNotInSizeChange(pageSize) {
+              this.inOrNotInPage.pageSize = pageSize;
+            },
+            rowInOrNotInClick(row){
+              this.$refs.inOrNotInConditionCrud.toggleSelection();
+              this.$refs.inOrNotInConditionCrud.toggleRowSelection(row); //閫変腑褰撳墠琛�
+            },
+            selectionInOrNotInChange(list){
+              if (this.isMuti && list.length > 1) {
+                const nowVal = list.shift();
+                this.$refs.inOrNotInConditionCrud.toggleRowSelection(nowVal, false);
+              }
+              this.selectionInOrNotInList = list
+            },
+            selectedInOrNotInCond(){
+              if(this.selectionInOrNotInList && this.selectionInOrNotInList.length > 0){
+                // console.log(this.selectionInOrNotInList)
+                this.preClickAddSearchConditionRow.filterValue = this.selectionInOrNotInList.map(item => item[this.selectInOrNotInCondOption.column[0].prop]).join(',');
+                this.isShowInOrNotInCondition = false;
+              }
+            },
+            /** 鐐瑰嚮鎼滅储鍚庤Е鍙戣浜嬩欢 */
+            selectInOrNotInSearchChange(params, done) {
+              this.initPageData.currentPage = 1;
+              let requestData = {};
+              if(params) {
+                Object.keys(params).forEach((key)=>{
+                  requestData["conditionMap" + "["+ key +"_like]"] = params[key].trim();
+                })
+              }
+              this.inOrNotInParam = requestData;
+              this.loadInOrNotInConditionData(this.initPageData,this.inOrNotInParam);
+              done();
+            },
+            /** 閲嶇疆浣嶅睘鎬ч�夊彇鍊艰〃鏍肩殑鎼滅储妗嗕箣鍚庣殑鍥炶皟 */
+            searchInOrNotInReset() {
+              this.inOrNotInParam = {};
+              this.loadInOrNotInConditionData(this.initPageData);
+            },
+
             //涓婁竴涓〉闈㈠凡缁忛�変腑鍙傜収搴旂敤鐨勪笟鍔$被鍨嬬殑鎯呭喌锛屽拰涓婁竴娆″凡缁忛厤缃繃鍙傜収閰嶇疆鐨勬儏鍐典笅杩涜椤甸潰鍒濆鍖栨覆鏌�
             initPageData(val){
                 // console.log(val.referConfig);
@@ -1263,4 +1346,13 @@
         transition:opacity .0s !important;
     }
 
+    /* .valueInfo {
+      float: left;
+      border: 1px solid #E9E7E7;
+      display: inline-block;
+      vertical-align: middle;
+      padding: 9px 15px;
+      line-height: 1;
+    } */
+
 </style>

--
Gitblit v1.9.3