Bladeren bron

下载及合作方产品字段部分

zishan-an 1 jaar geleden
bovenliggende
commit
b3d86d7b6c

+ 8 - 1
src/api/index.js

@@ -82,7 +82,13 @@ export function findCooperatorProductByNum(cooperatorNum,pageNum,pageSize){
         pageSize:pageSize,
     })  ;
 }
-
+export function findTemplateFieldByNum(templateNo,pageNum,pageSize){
+    return request.post('/fieldtemplate/findTemplateFieldByNum/',{
+        templateNo:templateNo,
+        pageNum:pageNum,
+        pageSize:pageSize,
+    })  ;
+}
 export function fieldTemplateList(pageNum,pageSize) {
     return request.post('/fieldtemplate/findAll',
     {
@@ -378,6 +384,7 @@ export function fieldTemplateEdit(templateData) {
         templateNo : templateData.templateNo,
         templateName : templateData.templateName,
         // status : templateData.status,
+        fieldSelected:templateData.fieldBaseSelected,
 
 
     });

+ 1 - 1
src/views/system/businessAnalysis.vue

@@ -323,7 +323,7 @@ export default {
     
     
     },
-  
+
 }
 </script>
 

+ 41 - 37
src/views/system/businessInfoAnalysis.vue

@@ -25,7 +25,7 @@
 
       <el-main>
 
-        <el-tabs v-model="activeName2" @tab-click="handleClick" >
+        <el-tabs v-model="activeName" @tab-click="handleClick" >
           <el-tab-pane label="业务信息" name="first">
             <el-descriptions style="margin-top: 20px"  :column="1" border>
               <el-descriptions-item label="业务编号">
@@ -98,7 +98,7 @@
           <!--            yuan-->
 
           <el-tab-pane label="文件" name="third">
-            <el-button size="small" class="el-icon-upload" type="primary" round style="margin-left: 1100px" @click="add_file_show=true">上传</el-button>
+            <el-button size="small" class="el-icon-upload" type="primary" round style="position: absolute; right: 10%;" @click="add_file_show=true">上传</el-button>
             <el-button size="small" class="el-icon-download" type="primary" round style="position: absolute; right: 1%;" @click="fileDown(downSelected)">下载</el-button>
 
             <el-divider></el-divider>
@@ -210,12 +210,7 @@
 
         </el-form>
       </div>
-      <div style="margin-right:10px">
 
-        <el-button type="success"   @click="add_condition()">确认</el-button>
-
-
-      </div>
     </el-dialog>
   </div>
 </template>
@@ -240,8 +235,7 @@ export default {
   data() {
     return {
       activeKey: 0,
-      activeName: "third",
-      activeName2 : "first",
+      activeName: "first",
       currentPage1: 1,
       pagesize1:5,
       currentPage2: 1,
@@ -301,8 +295,19 @@ export default {
           }
         }
     )
+    let name = sessionStorage.getItem('currentTab')
+    // 判断是否存在currentTab,即tab页之前是否被点击切换到别的页面
+    if(name){
+      this.activeName = name
+    }
   },
   beforeUpdate() {},
+  beforeRouteLeave(to, from, next){
+    // 在离开此路由之后清除保存的状态(我的需求是只需要在当前tab页操作刷新保存状态,路由切换之后不需要保存)
+    // 根据个人需求决定清除的时间
+    sessionStorage.removeItem('currentTab')
+    next()
+  },
   updated() {},
   destroyed() {},
   methods: {
@@ -316,19 +321,14 @@ export default {
       // console.log(this.selectedNum)
 
     },
-    handleCurrentChange1:function(currentPage){
-      this.currentPage1=currentPage;
-    },
-    handleSizeChange1:function(size){
-      this.pagesize1=size;
-    },
-    handleCurrentChange2:function(currentPage){
-      this.currentPage2=currentPage;
-    },
-    handleSizeChange2:function(size){
-      this.pagesize2=size;
-    },
 
+    handleClick(tab, event) {
+      // 点击tab后触发事件,修改显示页面,将状态保存在sessionStorage里面
+      sessionStorage.setItem('currentTab', tab.name)
+      console.log(tab, event);
+      console.log("当前activeName=", this.activeName)
+      console.log("当前name=", tab.name)
+    },
     add_condition()
     {
       this.add_file_show=false;
@@ -369,7 +369,7 @@ export default {
     },
     onButtonClickReturn()
     {
-      this.$router.replace('/businessFail');
+      this.$router.replace('/businessAnalysis');
     },
 
     //yuan
@@ -383,12 +383,15 @@ export default {
     fileDown: function (downSelected){
       console.log(downSelected)
       for (let i = 0; i < this.downSelected.length; i++) {
-        request.post('/report/download',{
-          file_name : this.downSelected[i],
-        }).catch((error) => {
-          console.log(error);
-        })
-      }
+        fileDownload(this.downSelected[i]).then(
+            res=>
+            {
+              this.$message({
+                message: '下载成功',
+                type: 'success'
+              });
+            },
+        )}
 
       // console.log(fileName)
       // fileDownload(fileName).then((res) => {
@@ -433,20 +436,21 @@ export default {
       })
       request.post('/up/uploadUi',fd).then(res=>{
 
-        // console.log(res)
-        if (res.data === 200) {
-          //console.log(res);
-          this.$message('文件上传成功')
-          // this.$router.go(0)
-
-        }else{
-          this.$message('无文件')
-        }
       })
           .catch(err => {
             this.$message.error(err.message)
             // console.log(err)
           })
+      this.add_file_show=false;
+      setTimeout(() => {
+        this.$message({
+          message: '文件上传成功',
+          type: 'success'
+        });
+        setTimeout(() => {
+          location.reload();
+        }, 1000);
+      }, 100);
     },
     fileDelete: function (id){
       reportFileDelete(id).then((res) => {

+ 43 - 57
src/views/system/businessInfoFail.vue

@@ -25,7 +25,7 @@
 
       <el-main>
 
-      <el-tabs v-model="activeName2" @tab-click="handleClick" >
+      <el-tabs v-model="activeName" @tab-click="handleClick" >
         <el-tab-pane label="业务信息" name="first">
           <el-descriptions style="margin-top: 20px"  :column="1" border>
                 <el-descriptions-item label="业务编号">
@@ -96,9 +96,8 @@
 
 
         <!--            yuan-->
-
         <el-tab-pane label="文件" name="third">
-          <el-button size="small" class="el-icon-upload" type="primary" round style="margin-left: 1100px" @click="add_file_show=true">上传</el-button>
+          <el-button size="small" class="el-icon-upload" type="primary" round style="position: absolute; right: 10%;" @click="add_file_show=true">上传</el-button>
           <el-button size="small" class="el-icon-download" type="primary" round style="position: absolute; right: 1%;" @click="fileDown(downSelected)">下载</el-button>
 
           <el-divider></el-divider>
@@ -210,12 +209,12 @@
 
         </el-form>
       </div>
-      <div style="margin-right:10px">
+<!--      <div style="margin-right:10px">-->
 
-        <el-button type="success"   @click="add_condition()">确认</el-button>
+<!--        <el-button type="success"   @click="add_condition()">确认</el-button>-->
 
 
-      </div>
+<!--      </div>-->
     </el-dialog>
     </div>
 </template>
@@ -240,8 +239,7 @@ export default {
   data() {
     return {
       activeKey: 0,
-      activeName: "third",
-      activeName2 : "first",
+      activeName: "first",
       currentPage1: 1,
       pagesize1:5,
       currentPage2: 1,
@@ -301,33 +299,27 @@ export default {
           }
         }
     )
+    let name = sessionStorage.getItem('currentTab')
+    // 判断是否存在currentTab,即tab页之前是否被点击切换到别的页面
+    if(name){
+      this.activeName = name
+    }
   },
   beforeUpdate() {},
+  beforeRouteLeave(to, from, next){
+    // 在离开此路由之后清除保存的状态(我的需求是只需要在当前tab页操作刷新保存状态,路由切换之后不需要保存)
+    // 根据个人需求决定清除的时间
+    sessionStorage.removeItem('currentTab')
+    next()
+  },
   updated() {},
   destroyed() {},
   methods: {
     request() {},
     handleSelectionChange(selection) {
       this.downSelected = selection.map(item => item.fileName)
-      // this.allField.push(this.fieldSelected)
-      // console.log(this.downSelected)
-
-      // this.selectedNum = selection.length
-      // console.log(this.selectedNum)
 
     },
-    handleCurrentChange1:function(currentPage){
-      this.currentPage1=currentPage;
-    },
-    handleSizeChange1:function(size){
-      this.pagesize1=size;
-    },
-    handleCurrentChange2:function(currentPage){
-      this.currentPage2=currentPage;
-    },
-    handleSizeChange2:function(size){
-      this.pagesize2=size;
-    },
 
     add_condition()
     {
@@ -335,6 +327,13 @@ export default {
       location.reload();
 
     },
+    handleClick(tab, event) {
+      // 点击tab后触发事件,修改显示页面,将状态保存在sessionStorage里面
+      sessionStorage.setItem('currentTab', tab.name)
+      console.log(tab, event);
+      console.log("当前activeName=", this.activeName)
+      console.log("当前name=", tab.name)
+    },
     gotolink1()
     {
       this.$router.replace('/businesstodo');
@@ -383,25 +382,15 @@ export default {
     fileDown: function (downSelected){
       console.log(downSelected)
       for (let i = 0; i < this.downSelected.length; i++) {
-        request.post('/report/download',{
-          file_name : this.downSelected[i],
-        }).catch((error) => {
-          console.log(error);
-        })
-      }
-
-      // console.log(fileName)
-      // fileDownload(fileName).then((res) => {
-      //   this.$message({
-      //     message: '下载成功',
-      //     type: 'success'
-      //   });
-      //   // location.reload();
-      //   // this.roleList();
-      // }).catch((error) => {
-      //   console.log(error);
-      // })
-
+        fileDownload(this.downSelected[i]).then(
+            res=>
+            {
+              this.$message({
+                message: '下载成功',
+                type: 'success'
+              });
+            },
+        )}
 
     },
     upload(){
@@ -421,8 +410,6 @@ export default {
         else {
           this.fileNameXml = "1"
         }
-
-
         request.post('/report/fileReportAdd',{
           file_name : item.raw.name,
           fileModel:this.fileNameModel,
@@ -432,21 +419,21 @@ export default {
         console.log(this.fileNameModel)
       })
       request.post('/up/uploadUi',fd).then(res=>{
-
-        // console.log(res)
-        if (res.data === 200) {
-          //console.log(res);
-          this.$message('文件上传成功')
-          // this.$router.go(0)
-
-        }else{
-          this.$message('无文件')
-        }
       })
           .catch(err => {
             this.$message.error(err.message)
             // console.log(err)
           })
+      this.add_file_show=false;
+      setTimeout(() => {
+        this.$message({
+          message: '文件上传成功',
+          type: 'success'
+        });
+        setTimeout(() => {
+          location.reload();
+        }, 1000);
+      }, 100);
     },
     fileDelete: function (id){
       reportFileDelete(id).then((res) => {
@@ -455,7 +442,6 @@ export default {
           type: 'success'
         });
         location.reload();
-
         // this.roleList();
       })
 

+ 43 - 40
src/views/system/businessInfoToDo.vue

@@ -25,7 +25,7 @@
 
       <el-main>
 
-        <el-tabs v-model="activeName2" @tab-click="handleClick" >
+        <el-tabs v-model="activeName" @tab-click="handleClick" >
           <el-tab-pane label="业务信息" name="first">
             <el-descriptions style="margin-top: 20px"  :column="1" border>
               <el-descriptions-item label="业务编号">
@@ -98,7 +98,7 @@
           <!--            yuan-->
 
           <el-tab-pane label="文件" name="third">
-            <el-button size="small" class="el-icon-upload" type="primary" round style="margin-left: 1100px" @click="add_file_show=true">上传</el-button>
+            <el-button size="small" class="el-icon-upload" type="primary" round style="position: absolute; right: 10%;" @click="add_file_show=true">上传</el-button>
             <el-button size="small" class="el-icon-download" type="primary" round style="position: absolute; right: 1%;" @click="fileDown(downSelected)">下载</el-button>
 
             <el-divider></el-divider>
@@ -210,12 +210,7 @@
 
         </el-form>
       </div>
-      <div style="margin-right:10px">
 
-        <el-button type="success"   @click="add_condition()">确认</el-button>
-
-
-      </div>
     </el-dialog>
   </div>
 </template>
@@ -223,8 +218,8 @@
 <script>
 
 import {
-  cooperatorEdit, reportFileDelete,fileDownload,
-  findBusinessInfoByNum, findCustomInfoByNum, reportFileList, templateDel
+  cooperatorEdit, reportFileDelete, fileDownload,
+  findBusinessInfoByNum, findCustomInfoByNum, reportFileList, templateDel, fieldTemplateEdit
 } from '@/api/index.js'
 import store from "@/store";
 import request from '@/utils/request.js'
@@ -240,8 +235,7 @@ export default {
   data() {
     return {
       activeKey: 0,
-      activeName: "third",
-      activeName2 : "first",
+      activeName: "first",
       currentPage1: 1,
       pagesize1:5,
       currentPage2: 1,
@@ -301,8 +295,19 @@ export default {
           }
         }
     )
+    let name = sessionStorage.getItem('currentTab')
+    // 判断是否存在currentTab,即tab页之前是否被点击切换到别的页面
+    if(name){
+      this.activeName = name
+    }
   },
   beforeUpdate() {},
+  beforeRouteLeave(to, from, next){
+    // 在离开此路由之后清除保存的状态(我的需求是只需要在当前tab页操作刷新保存状态,路由切换之后不需要保存)
+    // 根据个人需求决定清除的时间
+    sessionStorage.removeItem('currentTab')
+    next()
+  },
   updated() {},
   destroyed() {},
   methods: {
@@ -316,19 +321,14 @@ export default {
       // console.log(this.selectedNum)
 
     },
-    handleCurrentChange1:function(currentPage){
-      this.currentPage1=currentPage;
-    },
-    handleSizeChange1:function(size){
-      this.pagesize1=size;
-    },
-    handleCurrentChange2:function(currentPage){
-      this.currentPage2=currentPage;
-    },
-    handleSizeChange2:function(size){
-      this.pagesize2=size;
-    },
 
+    handleClick(tab, event) {
+      // 点击tab后触发事件,修改显示页面,将状态保存在sessionStorage里面
+      sessionStorage.setItem('currentTab', tab.name)
+      console.log(tab, event);
+      console.log("当前activeName=", this.activeName)
+      console.log("当前name=", tab.name)
+    },
     add_condition()
     {
       this.add_file_show=false;
@@ -369,7 +369,7 @@ export default {
     },
     onButtonClickReturn()
     {
-      this.$router.replace('/businessFail');
+      this.$router.replace('/businesstodo');
     },
 
     //yuan
@@ -383,12 +383,15 @@ export default {
     fileDown: function (downSelected){
       console.log(downSelected)
       for (let i = 0; i < this.downSelected.length; i++) {
-        request.post('/report/download',{
-          file_name : this.downSelected[i],
-        }).catch((error) => {
-          console.log(error);
-        })
-      }
+        fileDownload(this.downSelected[i]).then(
+            res=>
+            {
+              this.$message({
+                message: '下载成功',
+                type: 'success'
+              });
+            },
+        )}
 
       // console.log(fileName)
       // fileDownload(fileName).then((res) => {
@@ -432,21 +435,21 @@ export default {
         console.log(this.fileNameModel)
       })
       request.post('/up/uploadUi',fd).then(res=>{
-
-        // console.log(res)
-        if (res.data === 200) {
-          //console.log(res);
-          this.$message('文件上传成功')
-          // this.$router.go(0)
-
-        }else{
-          this.$message('无文件')
-        }
       })
           .catch(err => {
             this.$message.error(err.message)
             // console.log(err)
           })
+      this.add_file_show=false;
+      setTimeout(() => {
+        this.$message({
+          message: '文件上传成功',
+          type: 'success'
+        });
+        setTimeout(() => {
+          location.reload();
+        }, 1000);
+      }, 100);
     },
     fileDelete: function (id){
       reportFileDelete(id).then((res) => {

+ 12 - 1
src/views/system/businesstodo.vue

@@ -2,8 +2,8 @@
   <div class="container" style="min-height: 100%; padding-bottom: 100px;">
     <el-container>
       <el-aside :width="isCollapse?'65px':'250px'">
+        <el-button   @click = "toggleCollapse" type="primary" class="el-icon-s-fold"></el-button>
 
-        <div class="toggle-button" @click = "toggleCollapse"><<<</div>
         <el-menu
           default-active="1"
           class="el-menu-vertical-demo"
@@ -410,6 +410,17 @@ export default {
 letter-spacing: 0.2rem;
 cursor: pointer;
 }
+.el-icon-s-fold
+{
+  background: rgb(255,255,255);
+  /*font-size: 10px;*/
+  /*Tine-height: 24px;*/
+  color: black;
+  border: none;
+  text-align: center;
+  letter-spacing: 0.2rem;
+  cursor: pointer;
+}
 /*.toggle-button:hover {*/
 /*  background: rgb(76,127,152);*/
 /*}*/

+ 26 - 4
src/views/system/cooperatorProductApply.vue

@@ -45,6 +45,8 @@
 
             <el-tab-pane label="合作方产品字段信息" name="second">
               <el-table :data="cooperatorFieldShow" style="width: 100%;" ref="cooperatorFields"
+                        @select-all="selectAll"
+                        @clearSelection="clearSelect"
                         @select="handleSelectionChange" :row-key="rowKey" stripe>
                 <el-table-column type="selection" :reserve-selection=true  width="55" />
 
@@ -213,9 +215,7 @@ export default {
     modelInfo(1,100).then(res=>
     {
       this.modelData = res.data.modelData.list;
-      console.log("你是谁");
 
-      console.log(this.modelData);
     })
     this.getTableData();
   },
@@ -239,6 +239,9 @@ export default {
         });
       }
     },
+
+
+
     handleClick1(tab, event) {
       if(tab.name=='first'){
         this.gotolinkHome();
@@ -278,7 +281,16 @@ export default {
           res=>
           {
             this.cooperatorField=res.data.cooperator_field.list;
-            this.cooperatorFieldShow = this.cooperatorField
+            this.cooperatorFieldShow = this.cooperatorField;
+            this.$nextTick(() => {
+              this.cooperatorField.forEach(item => {
+                // 重点: 在当前分页列表中查询与回显数据是否有一致的id,一致则勾选数据回显
+                // toggleRowSelection(item, true):设置当前行数据为选中状态
+                if (this.fieldSelected.includes(item.id)) {
+                  this.$refs.cooperatorFields.toggleRowSelection(item, true);
+                }
+              });
+            });
 
           }
       );
@@ -289,7 +301,16 @@ export default {
           res=>
           {
             this.cooperatorField=res.data.cooperator_field.list;
-            this.cooperatorFieldShow = this.cooperatorField
+            this.cooperatorFieldShow = this.cooperatorField;
+            this.$nextTick(() => {
+              this.cooperatorField.forEach(item => {
+                // 重点: 在当前分页列表中查询与回显数据是否有一致的id,一致则勾选数据回显
+                // toggleRowSelection(item, true):设置当前行数据为选中状态
+                if (this.fieldSelected.includes(item.id)) {
+                  this.$refs.cooperatorFields.toggleRowSelection(item, true);
+                }
+              });
+            });
           }
       )
     },
@@ -463,5 +484,6 @@ export default {
 .el-menu-vertical-demo{
   font-weight: bold;
 }
+
 .container {  }
 </style>

+ 0 - 1
src/views/system/fieldTemplateAdd.vue

@@ -389,7 +389,6 @@ export default {
             });
           }
       )
-
     },
     handleSizeChange1:function(size){
       this.pagesize1=size;

+ 222 - 5
src/views/system/fieldTemplateEdit.vue

@@ -40,7 +40,150 @@
 <!--                  <el-input v-model="createTime" style="width:400px"></el-input>-->
 <!--                </el-form-item>-->
           </el-form>
+          <el-divider></el-divider>
 
+          <el-tabs v-model="activeName2"   stretch>
+            <el-tab-pane label="基础字段"  name="first">
+              <el-table :data="fieldBaseShow" style="width: 100%;" ref="baseTable"
+                        @select="handleSelectionChange" :row-key="rowKey" stripe>
+                <el-table-column type="selection" :reserve-selection=true  width="55" />
+                <el-table-column align="center" label="编号" width="100">
+                  <template v-slot="{row}">
+                    <span>{{ row.fieldNo}}</span>
+                  </template>
+                </el-table-column>
+
+
+                <el-table-column align="center" label="字段名称(中文)" width="140">
+                  <template v-slot="{row}">
+                    <span>{{ row.nameZh}}</span>
+                  </template>
+                </el-table-column>
+
+                <el-table-column align="center" label="字段名称(英文)" width="140">
+                  <template v-slot="{row}">
+                    <span>{{ row.name}}</span>
+                  </template>
+                </el-table-column>
+
+                <el-table-column align="center" label="提取逻辑" width="100">
+                  <template v-slot="{row}">
+                    <span>{{ row.fetchLogic}}</span>
+                  </template>
+                </el-table-column>
+
+                <el-table-column align="center" label="类型" width="100">
+                  <template v-slot="{row}">
+                    <span>{{ row.type}}</span>
+                  </template>
+                </el-table-column>
+
+                <el-table-column prop="state" label="状态" width="100">
+                  <template slot-scope="scope">
+                    {{ scope.row.state ? '已启用' : '已禁用' }}
+                  </template>
+                </el-table-column>
+
+                <el-table-column align="center" label="创建者" width="100">
+                  <template v-slot="{row}">
+                    <span>{{ row.createBy}}</span>
+                  </template>
+                </el-table-column>
+
+                <el-table-column align="center" label="创建时间" width="200">
+                  <template v-slot="{row}">
+                    <span>{{ row.createTime}}</span>
+                  </template>
+                </el-table-column>
+
+              </el-table>
+              <el-pagination background
+                             @size-change="handleSizeChange1"
+                             @current-change="handleCurrentChange1"
+                             :current-page="currentPage1"
+                             :page-size="pagesize1"
+                             :page-sizes="[5,10,15]"
+
+                             layout="total,jumper,prev, pager, next,sizes"
+                             :total=baseTotal >
+              </el-pagination>
+            </el-tab-pane>
+            <el-tab-pane label="衍生字段" name="second">
+
+              <el-table :data="fieldDerive"
+                        ref="deriveTable"
+                        style="width: 100%;"
+                        @select="handleSelectionChange2" :row-key="rowKey" stripe>
+                <el-table-column type="selection" :reserve-selection=true  width="55" />
+
+                <el-table-column align="center" label="编号" width="100">
+                  <template v-slot="{row}">
+                    <span>{{ row.fieldNo}}</span>
+                  </template>
+                </el-table-column>
+
+
+                <el-table-column align="center" label="字段名称(中文)" width="140">
+                  <template v-slot="{row}">
+                    <span>{{ row.nameZh}}</span>
+                  </template>
+                </el-table-column>
+
+                <el-table-column align="center" label="字段名称(英文)" width="140">
+                  <template v-slot="{row}">
+                    <span>{{ row.name}}</span>
+                  </template>
+                </el-table-column>
+
+                <el-table-column align="center" label="提取逻辑" width="100">
+                  <template v-slot="{row}">
+                    <span>{{ row.fetchLogic}}</span>
+                  </template>
+                </el-table-column>
+
+                <el-table-column align="center" label="类型" width="100">
+                  <template v-slot="{row}">
+                    <span>{{ row.type}}</span>
+                  </template>
+                </el-table-column>
+
+                <el-table-column align="center" label="字段状态" width="100">
+                  <template v-slot="{row}">
+                    <span>{{ row.status}}</span>
+                  </template>
+                </el-table-column>
+
+                <el-table-column align="center" label="创建者" width="100">
+                  <template v-slot="{row}">
+                    <span>{{ row.createBy}}</span>
+                  </template>
+                </el-table-column>
+
+                <el-table-column align="center" label="创建时间" width="150">
+                  <template v-slot="{row}">
+                    <span>{{ row.createTime}}</span>
+                  </template>
+                </el-table-column>
+
+
+
+
+
+              </el-table>
+              <el-pagination background
+                             @size-change="handleSizeChange2"
+                             @current-change="handleCurrentChange2"
+                             :current-page="currentPage2"
+                             :page-size="pagesize2"
+                             :page-sizes="[5,10,15]"
+
+                             layout="total,jumper,prev, pager, next,sizes"
+                             :total=deriveTotal >
+              </el-pagination>
+            </el-tab-pane>
+
+
+          </el-tabs>
           <el-button class="model_add_button " size="small" round type="primary" @click="submit()">完成</el-button>
           <el-button class="model_add_button " size="small" round type="danger" @click="return_page()">返回</el-button>
 
@@ -57,7 +200,7 @@
 
 import {
   getList,
-  userInfo, partnerList, fieldDel, cooperatorEdit
+  userInfo, partnerList, fieldDel, cooperatorEdit, findTemplateFieldByNum, fieldListBase
 } from '@/api/index.js'
 import store from "@/store";
 import request from '@/utils/request.js'
@@ -77,11 +220,21 @@ export default {
 
       activeName: "fourth",
       currentPage1: 1,
-      pagesize1:5,
-
+      pagesize1:10,
+      currentPage2: 1,
+      pagesize2:10,
       fieldList : [],
       fieldBase:[],
+      fieldBaseShow:[],
       fieldDerive:[],
+      fieldBaseSelected:[],
+      fieldDeriveSelected:[],
+      baseTotal:'',
+      deriveTotal:'',
+      allField: [],
+      selectedNum:0,
+
+
       fieldExtra:[],
       selected1: true,
       selected2: false,
@@ -101,6 +254,8 @@ export default {
             templateId:this.$route.query.templateId,
             templateNo:this.$route.query.templateNo,
             templateName:this.$route.query.templateName,
+            fieldBaseSelected:[],
+            fieldDeriveSelected:[],
             // status:this.$route.query.status,
             // createBy:'',
             // createTime:'',
@@ -115,13 +270,75 @@ export default {
 
   mounted()
   {
+    findTemplateFieldByNum(this.templateNo,this.currentPage1,this.pagesize1).then(
+      res=>
+      {
+        this.fieldBase=res.data.base_field.list;
+        this.fieldBaseShow = this.fieldBase
+
+        var j = parseInt(res.data.base_field.total)
+        this.baseTotal = j
+      }
+  );
   },
   beforeUpdate() {},
   updated() {},
   destroyed() {},
   methods: {
     request() {},
+    handleSelectionChange(selecteds, row) {
+      if (!this.fieldBaseSelected.includes(row.id)) {
+        // 回显数据里没有本条,把这条加进来(选中)
+        this.fieldBaseSelected.push(row.id);
+        console.log(this.fieldBaseSelected)
 
+      } else {
+        // 回显数据里有本条,把这条删除(取消选中)
+        this.fieldBaseSelected.forEach((id, index) => {
+          if (id === row.id) {
+            this.fieldBaseSelected.splice(index, 1);
+          }
+        });
+      }
+    },
+    handleCurrentChange1:function(currentPage){
+      this.currentPage1=currentPage;
+      findTemplateFieldByNum(this.templateNo,this.currentPage1,this.pagesize1).then(
+          res=>
+          {
+            this.fieldBase=res.data.base_field.list;
+            this.fieldBaseShow = this.fieldBase
+            this.$nextTick(() => {
+              this.fieldBase.forEach(item => {
+                // 重点: 在当前分页列表中查询与回显数据是否有一致的id,一致则勾选数据回显
+                // toggleRowSelection(item, true):设置当前行数据为选中状态
+                if (this.fieldBaseSelected.includes(item.id)) {
+                  this.$refs.baseTable.toggleRowSelection(item, true);
+                }
+              });
+            });
+          }
+      )
+    },
+    handleSizeChange1:function(size){
+      this.pagesize1=size;
+      findTemplateFieldByNum(this.templateNo,this.currentPage1,this.pagesize1).then(
+          res=>
+          {
+            this.fieldBase=res.data.base_field.list;
+            this.fieldBaseShow = this.fieldBase
+            this.$nextTick(() => {
+              this.fieldBase.forEach(item => {
+                // 重点: 在当前分页列表中查询与回显数据是否有一致的id,一致则勾选数据回显
+                // toggleRowSelection(item, true):设置当前行数据为选中状态
+                if (this.fieldBaseSelected.includes(item.id)) {
+                  this.$refs.baseTable.toggleRowSelection(item, true);
+                }
+              });
+            });
+          }
+      )
+    },
     handleClick(tab, event) {
       if(tab.name=='second'){
         this.gotolinkbusiness();
@@ -161,6 +378,8 @@ export default {
       this.templateData.templateId = this.templateId;
       this.templateData.templateNo = this.templateNo;
       this.templateData.templateName = this.templateName;
+      this.templateData.fieldBaseSelected = this.fieldBaseSelected;
+
       // this.templateData.status = this.status;
 
 
@@ -174,10 +393,8 @@ export default {
             this.$router.push({
               path: '/fieldTemplate',
               query: {
-
               }
             })
-
           },
       ),
       console.log(this.templateData)