Răsfoiți Sursa

Merge remote-tracking branch 'origin/develop' into develop

maqingyang 1 an în urmă
părinte
comite
58c44b07cc

+ 25 - 3
src/api/index.js

@@ -82,13 +82,21 @@ export function findCooperatorProductByNum(cooperatorNum,pageNum,pageSize){
         pageSize:pageSize,
     })  ;
 }
-export function findTemplateFieldByNum(templateNo,pageNum,pageSize){
-    return request.post('/fieldtemplate/findTemplateFieldByNum/',{
+export function findBaseFieldByNo(templateNo,pageNum,pageSize){
+    return request.post('/fieldtemplate/findBaseFieldByNo/',{
         templateNo:templateNo,
         pageNum:pageNum,
         pageSize:pageSize,
     })  ;
 }
+export function findDeriveFieldByNo(templateNo,pageNum,pageSize){
+    return request.post('/fieldtemplate/findDeriveFieldByNo/',{
+        templateNo:templateNo,
+        pageNum:pageNum,
+        pageSize:pageSize,
+    })  ;
+}
+
 export function fieldTemplateList(pageNum,pageSize) {
     return request.post('/fieldtemplate/findAll',
     {
@@ -220,6 +228,17 @@ export function cooperatorProductApply(cooperator_num, cooperator_name,  product
     });
 }
 
+export function editApply(productId,productNum, productName,  fieldSelectedOld, fieldSelected) {
+    return request.post('/cooperator_product/editApply', {
+        productId:productId,
+        productNum : productNum,
+        productName : productName,
+        fieldSelectedOld : fieldSelectedOld,
+        fieldSelected : fieldSelected,
+
+    });
+}
+
 export function findBusinessInfoByNum(businessNum){
     return request({
         url: '/business/findBusinessInfoByNum/'+ businessNum ,
@@ -384,7 +403,10 @@ export function fieldTemplateEdit(templateData) {
         templateNo : templateData.templateNo,
         templateName : templateData.templateName,
         // status : templateData.status,
-        fieldSelected:templateData.fieldBaseSelected,
+        fieldBaseSelected:templateData.fieldBaseSelected,
+        fieldBaseSelectedOld:templateData.fieldBaseSelectedOld,
+        fieldDeriveSelected:templateData.fieldDeriveSelected,
+        fieldDeriveSelectedOld:templateData.fieldDeriveSelectedOld,
 
 
     });

+ 2 - 2
src/views/system/cooperatorAdd.vue

@@ -227,9 +227,9 @@ export default {
     },
     submit (){
         if(this.corp_certificate_type_name == "统一社会信用代码")
-          this.corp_certificate_type = "0"
+          this.corp_certificate_type = "20"
         else
-          this.corp_certificate_type =  "1"
+          this.corp_certificate_type =  "30"
       console.log(this.fieldTemplateId)
 
       if(this.cooperator_name=="")

+ 5 - 1
src/views/system/cooperatorDetailed.vue

@@ -32,7 +32,7 @@
               </el-col>
               <el-col span="10"  >
                 <el-form-item label="合作方证件类型: " width="100px">
-                <span>{{type_list[corpCertificateType/10-2]}}</span>
+                <span>{{corp_certificate_type_name}}</span>
                 </el-form-item>
               </el-col>
             </el-row>
@@ -278,6 +278,10 @@ export default {
   beforeMount() {},
   mounted() 
   {
+    if(this.corpCertificateType == "20")
+      this.corp_certificate_type_name = "统一社会信用代码"
+    else
+      this.corp_certificate_type_name =  "组织机构代码"
     if(this.templateId){
     getTemplateById(this.templateId).then(
       res=>

+ 6 - 6
src/views/system/cooperatorEdit.vue

@@ -37,7 +37,7 @@
                 <el-form-item label="证件类型" width="100px">
                   <el-select name="art-cate" v-model="corp_certificate_type_name" placeholder="选择证件类型" style="height:35px">
                     <el-option v-for='item in type_list' :key="item.key" :label="item.label"
-                               :value="item.key"
+                               :value="item.label"
                     />
                   </el-select>
                 </el-form-item>
@@ -103,11 +103,11 @@ export default {
       arr: [{ name: '统一社会信用代码' }, { name: '组织机构代码' }, ],
       type_list: [
         {
-          key: 1,
+          key: 20,
           label: "统一社会信用代码"
         },
         {
-          key: 2,
+          key: 30,
           label: "组织机构代码"
         }
       ],
@@ -136,7 +136,7 @@ export default {
   beforeMount() {},
   mounted() 
   {
-    if(this.corpCertificateType == "0")
+    if(this.corpCertificateType == "20")
       this.corp_certificate_type_name = "统一社会信用代码"
     else
       this.corp_certificate_type_name =  "组织机构代码"
@@ -240,9 +240,9 @@ export default {
     },
     submit (){
         if(this.corp_certificate_type_name == "统一社会信用代码")
-          this.corp_certificate_type = "0"
+          this.corp_certificate_type = "20"
         else
-          this.corp_certificate_type =  "1"
+          this.corp_certificate_type =  "30"
       if(this.cooperator_name=="")
       {
         this.$alert("请输入合作方名称");

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

@@ -58,7 +58,7 @@
 
                     <el-table-column align="center" label="字段编号" width="160">
                     <template v-slot="{row}">
-                        <span>{{ row.fieldNo}}</span>
+                      <span>{{ row.id}}</span>
                     </template>
                     </el-table-column>
 

+ 8 - 5
src/views/system/cooperatorProductFieldInfo.vue

@@ -43,13 +43,13 @@
                   </template>
                   </el-table-column>
 
-                  <el-table-column align="center" label="字段名称(文)" >
+                  <el-table-column align="center" label="字段名称(文)" >
                   <template v-slot="{row}">
                       <span>{{ row.name}}</span>
                   </template>
                   </el-table-column>
 
-                  <el-table-column align="center" label="字段名称(文)" >
+                  <el-table-column align="center" label="字段名称(文)" >
                   <template v-slot="{row}">
                       <span>{{ row.nameZH}}</span>
                   </template>
@@ -129,6 +129,9 @@
         try {
           const { data } = await findCooperatorProductFieldByNum(this.$route.query.productNum);
           this.cooperatorProductFieldData = data.cooperator_product_field;
+          // console.log("Adsgfasdg")
+          //
+          // console.log(this.$route.query.cooperatorNum)
         } catch (error) {
           console.error(error);
         }
@@ -201,7 +204,7 @@
       gotolink4()
       {
         //指定跳转地址
-        this.$router.push({path:'/cooperatorProductInfoBase',query:{productNum:this.$route.query.productNum,productName:this.$route.query.productName,modelName:this.$route.query.modelName,cooperatorName:this.$route.query.cooperatorName}});
+        this.$router.push({path:'/cooperatorProductInfoBase',query:{productNum:this.$route.query.productNum,productName:this.$route.query.productName,modelName:this.$route.query.modelName,cooperatorName:this.$route.query.cooperatorName,cooperatorNum:this.$route.query.cooperatorNum}});
         this.selected1 = true;
         this.selected2 = false;
         this.selected3 = true;
@@ -212,7 +215,7 @@
       gotolink5()
       {
         //指定跳转地址
-        this.$router.push({path:'/cooperatorProductFieldInfo',query:{productNum:this.$route.query.productNum,productName:this.$route.query.productName,modelName:this.$route.query.modelName,cooperatorName:this.$route.query.cooperatorName}});
+        this.$router.push({path:'/cooperatorProductFieldInfo',query:{productNum:this.$route.query.productNum,productName:this.$route.query.productName,modelName:this.$route.query.modelName,cooperatorName:this.$route.query.cooperatorName,cooperatorNum:this.$route.query.cooperatorNum}});
         this.selected1 = true;
         this.selected2 = false;
         this.selected3 = true;
@@ -221,7 +224,7 @@
         this.selected6 = true;
       },
       gotolink6(){
-        this.$router.push({path:'/cooperatorProductFieldModify',query:{productNum:this.$route.query.productNum,productName:this.$route.query.productName,modelName:this.$route.query.modelName,cooperatorName:this.$route.query.cooperatorName}});
+        this.$router.push({path:'/cooperatorProductFieldModify',query:{productId:this.$route.query.productId,productNum:this.$route.query.productNum,productName:this.$route.query.productName,modelName:this.$route.query.modelName,cooperatorName:this.$route.query.cooperatorName,cooperatorNum:this.$route.query.cooperatorNum}});
         this.selected1 = true;
         this.selected2 = false;
         this.selected3 = true;

+ 168 - 55
src/views/system/cooperatorProductFieldModify.vue

@@ -10,50 +10,52 @@
 <!--            <div class="line" />-->
 
             <el-main>
-                <div class = "top-bar" >
-                    <el-tabs ref= "tabs" v-model="activeName2" @tab-click="handleClick2" >
-                    <el-tab-pane label="产品基础信息" name="first"  ></el-tab-pane>
-                    <el-tab-pane label="产品字段信息" name="second" ></el-tab-pane>
-                    </el-tabs>
-                </div>
 
+              <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" />
+
+                <el-table-column align="center" label="字段类型" width="160">
+                  <template v-slot="{row}">
+                    <span>{{ row.type}}</span>
+                  </template>
+                </el-table-column>
+
+                <el-table-column align="center" label="字段编号" width="160">
+                  <template v-slot="{row}">
+                    <span>{{ row.id}}</span>
+                  </template>
+                </el-table-column>
 
-            
-                <el-table :data="cooperatorFields" style="width: 100%;" ref="cooperatorFields" @row-click="singleElection" highlight-current-row>
-                    <el-table-column label="" width="65">
-                        <template slot-scope="scope">
-                            <el-radio class="radio" v-model="templateSelection" :label="scope.$index">&nbsp;</el-radio>
-                        </template>
-                    </el-table-column>
+                <el-table-column align="center" label="字段名称(中文)" width="160">
+                  <template v-slot="{row}">
+                    <span>{{ row.name}}</span>
+                  </template>
+                </el-table-column>
 
-                    <el-table-column align="center" label="字段类型" width="160">
-                    <template v-slot="{row}">
-                        <span>{{ row.type}}</span>
-                    </template>
-                    </el-table-column>
+                <el-table-column align="center" label="字段名称(英文)" width="160">
+                  <template v-slot="{row}">
+                    <span>{{ row.nameZH}}</span>
+                  </template>
+                </el-table-column>
 
-                    <el-table-column align="center" label="字段编号" width="160">
-                    <template v-slot="{row}">
-                        <span>{{ row.fieldNo}}</span>
-                    </template>
-                    </el-table-column>
 
-                    <el-table-column align="center" label="字段名称(中文)" width="160">
-                    <template v-slot="{row}">
-                        <span>{{ row.name}}</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]"
 
-                    <el-table-column align="center" label="字段名称(英文)" width="160">
-                    <template v-slot="{row}">
-                        <span>{{ row.nameZH}}</span>
-                    </template>
-                    </el-table-column>
-                
-                
-                </el-table>
-                <div class = "bottom-bar" style="margin-top: 20px" >
-                    <el-button round type="primary" size="small"  @click="gotolink6" >完成</el-button>
+                             layout="total,jumper,prev, pager, next,sizes"
+                             :total=showFieldTotal >
+              </el-pagination>
+
+              <div class = "bottom-bar" style="margin-top: 20px" >
+                    <el-button round type="primary" size="small"  @click="submit()" >完成</el-button>
                     <el-button round type="danger" size="small"  style="margin-left: 50px" @click="gotolink3" >关闭</el-button>
                 </div>
             </el-main>
@@ -63,10 +65,15 @@
   </template>
   
   <script>
-  
+
   import {
     getList,
-    userInfo, partnerList, roleDel
+    userInfo,
+    partnerList,
+    roleDel,
+    findCooperatorFieldByNum,
+    findCooperatorProductFieldByNum,
+    editApply
   } from '@/api/index.js'
   import store from "@/store";
   import request from '@/utils/request.js'
@@ -86,8 +93,15 @@
         activeKey: 0,
         activeName: "third",
         activeName2: "second",
-        currentPage: 1,
+        currentPage1: 1,
+        pagesize1:10,
+        cooperatorField : [],
+        cooperatorFieldShow : [],
         cooperatorFields : [],
+        fieldSelected:[],
+        fieldSelectedOld:[],
+        cooperatorProductFieldData : [],
+
         selected1: true,
         selected2: false,
         selected3: true,
@@ -98,17 +112,62 @@
         buttondisabled2: 'false',
         templateSelection: '',
         templateRadio: null,
+        cooperatorNum:this.$route.query.cooperatorNum,
+        fieldTotal:'',
+        showFieldTotal:'',
       }
     },
     watch: {},
     computed: {
     },
     beforeCreate() {},
-    created() {},
-    beforeMount() {},
+    created() {
+
+
+    },
+    beforeMount() {
+
+
+    },
     mounted() 
     {
-        this.getTableData();
+      findCooperatorFieldByNum(this.cooperatorNum,this.currentPage1,this.pagesize1).then(
+          res=>
+          {
+            this.cooperatorField=res.data.cooperator_field.list;
+            this.cooperatorFieldShow = this.cooperatorField
+
+            var j = parseInt(res.data.cooperator_field.total)
+            this.fieldTotal = j
+            this.showFieldTotal = this.fieldTotal
+            findCooperatorProductFieldByNum(this.$route.query.productNum).then(
+                res=>
+                {
+                  this.cooperatorProductFieldData=res.data.cooperator_product_field
+
+                  for (let i = 0; i < this.cooperatorProductFieldData.length; i++) {
+                    if (!this.fieldSelected.includes(this.cooperatorProductFieldData[i].fieldId)) {
+                      // 回显数据里没有本条,把这条加进来(选中)
+                      this.fieldSelected.push(this.cooperatorProductFieldData[i].fieldId);
+                      this.fieldSelectedOld.push(this.cooperatorProductFieldData[i].id);
+
+                    }
+                  };
+                  this.cooperatorField.forEach(item => {
+                    // 重点: 在当前分页列表中查询与回显数据是否有一致的id,一致则勾选数据回显
+                    // toggleRowSelection(item, true):设置当前行数据为选中状态
+                    if (this.fieldSelected.includes(item.id)) {
+                      this.$refs.cooperatorFields.toggleRowSelection(item, true);
+                    }
+                  });
+                  console.log(this.fieldSelectedOld)
+                  console.log("id是")
+
+                }
+            )
+          }
+      );
+
     },
     beforeUpdate() {},
     updated() {},
@@ -141,6 +200,60 @@
           this.gotolinkField();
         }
       },
+      handleSelectionChange(selecteds, row) {
+        if (!this.fieldSelected.includes(row.id)) {
+          // 回显数据里没有本条,把这条加进来(选中)
+          this.fieldSelected.push(row.id);
+          console.log(this.fieldSelected)
+
+        } else {
+          // 回显数据里有本条,把这条删除(取消选中)
+          this.fieldSelected.forEach((id, index) => {
+            if (id === row.id) {
+              this.fieldSelected.splice(index, 1);
+            }
+          });
+        }
+      },
+      handleCurrentChange1:function(currentPage){
+        this.currentPage1=currentPage;
+        findCooperatorFieldByNum(this.cooperatorNum,this.currentPage1,this.pagesize1).then(
+            res=>
+            {
+              this.cooperatorField=res.data.cooperator_field.list;
+              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);
+                  }
+                });
+              });
+
+            }
+        );
+      },
+      handleSizeChange1:function(size){
+        this.pagesize1=size;
+        findCooperatorFieldByNum(this.cooperatorNum,this.currentPage1,this.pagesize1).then(
+            res=>
+            {
+              this.cooperatorField=res.data.cooperator_field.list;
+              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);
+                  }
+                });
+              });
+            }
+        )
+      },
       gotolinkHome()
       {
         this.$router.replace('/homePage');
@@ -213,17 +326,17 @@
         this.selected5 = false;
         this.selected6 = true;
       },
-      async gotolink6(){
-        const { data } = await updateProductFieldNo(this.$route.query.productNum,this.templateRadio);
-        this.$router.push({path:'/cooperatorProductInfoBase',query:{productNum:this.$route.query.productNum,productName:this.$route.query.productName,modelName:this.$route.query.modelName,fieldNo:this.templateRadio}});
-        this.selected1 = true;
-        this.selected2 = false;
-        this.selected3 = true;
-        this.selected4 = false;
-        this.selected5 = false;
-        this.selected6 = true;
-
-      }
+      submit()
+      {
+        editApply(this.$route.query.productId,this.$route.query.productNum, this.$route.query.productName,  this.fieldSelectedOld,this.fieldSelected).then(
+            res=>
+            {
+              this.$router.push({path:'/cooperatorProductInfoBase',
+                query:{productId:this.$route.query.productId,productNum:this.$route.query.productNum,productName:this.$route.query.productName,modelName:this.$route.query.modelName,
+                  cooperatorName:this.$route.query.cooperatorName,cooperatorNum:this.$route.query.cooperatorNum}});
+            },
+        )
+      },
   
     },
 

+ 11 - 1
src/views/system/cooperatorProductInfo.vue

@@ -123,6 +123,9 @@ export default {
       selected5: false,
       selected6: true,
       input:'',
+
+
+
     }
   },
   watch: {},
@@ -259,7 +262,14 @@ export default {
     gotolink4(row)
     {
       //指定跳转地址
-      this.$router.push({path:'/cooperatorProductInfoBase',query:{productNum:row.productNum,productName:row.productName,modelName:row.modelName,cooperatorName:row.cooperatorName}});
+      this.$router.push({path:'/cooperatorProductInfoBase',query:{
+          productId:row.id,
+
+          productNum:row.productNum,
+          productName:row.productName,
+          modelName:row.modelName,
+          cooperatorName:row.cooperatorName,
+          cooperatorNum:row.cooperatorNum}});
       this.selected1 = true;
       this.selected2 = false;
       this.selected3 = false;

+ 9 - 14
src/views/system/cooperatorProductInfoBase.vue

@@ -38,9 +38,9 @@
                         {{this.$route.query.productName }}
                     </p>
                 </el-descriptions-item>
-                <el-descriptions-item label="产品模型">
+                <el-descriptions-item label="合作方名称">
                     <p>
-                        {{this.$route.query.modelName }}
+                        {{this.$route.query.cooperatorName }}
                     </p>
                 </el-descriptions-item>
                 
@@ -89,6 +89,10 @@ import { Row } from 'element-ui';
         buttondisabled1: 'true',
         buttondisabled2: 'false',
         input:'',
+
+
+
+
       }
     },
     watch: {},
@@ -171,21 +175,12 @@ import { Row } from 'element-ui';
         this.selected5 = false;
         this.selected6 = true;
       },
-      gotolink4()
-      {
-        //指定跳转地址
-        this.$router.push({path:'/cooperatorProductInfoBase',query:{productNum:this.$route.query.productNum,productName:this.$route.query.productName,modelName:this.$route.query.modelName,cooperatorName:this.$route.query.cooperatorName}});
-        this.selected1 = true;
-        this.selected2 = false;
-        this.selected3 = true;
-        this.selected4 = false;
-        this.selected5 = false;
-        this.selected6 = true;
-      },
+
       gotolink5()
       {
         //指定跳转地址
-        this.$router.push({path:'/cooperatorProductFieldInfo',query:{productNum:this.$route.query.productNum,productName:this.$route.query.productName,modelName:this.$route.query.modelName,cooperatorName:this.$route.query.cooperatorName}});
+        this.$router.push({path:'/cooperatorProductFieldInfo',query:{productId:this.$route.query.productId,productNum:this.$route.query.productNum,productName:this.$route.query.productName,modelName:this.$route.query.modelName,
+            cooperatorName:this.$route.query.cooperatorName,cooperatorNum:this.$route.query.cooperatorNum}});
         this.selected1 = true;
         this.selected2 = false;
         this.selected3 = true;

+ 147 - 15
src/views/system/fieldTemplateEdit.vue

@@ -200,7 +200,7 @@
 
 import {
   getList,
-  userInfo, partnerList, fieldDel, cooperatorEdit, findTemplateFieldByNum, fieldListBase
+  userInfo, partnerList, fieldDel, cooperatorEdit, findBaseFieldByNo, fieldListBase, fieldListDerive,findDeriveFieldByNo
 } from '@/api/index.js'
 import store from "@/store";
 import request from '@/utils/request.js'
@@ -228,7 +228,12 @@ export default {
       fieldBaseShow:[],
       fieldDerive:[],
       fieldBaseSelected:[],
+      fieldBaseSelectedOld:[],
+
       fieldDeriveSelected:[],
+      fieldDeriveSelectedOld:[],
+      fieldTemplateDerive:[],
+      fieldTemplateBase:[],
       baseTotal:'',
       deriveTotal:'',
       allField: [],
@@ -255,7 +260,11 @@ export default {
             templateNo:this.$route.query.templateNo,
             templateName:this.$route.query.templateName,
             fieldBaseSelected:[],
+            fieldBaseSelectedOld:[],
+
             fieldDeriveSelected:[],
+            fieldDeriveSelectedOld:[],
+
             // status:this.$route.query.status,
             // createBy:'',
             // createTime:'',
@@ -270,16 +279,77 @@ 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
-      }
-  );
+    fieldListBase(this.currentPage1,this.pagesize1).then(
+        res=>
+        {
+          this.fieldBase=res.data.fieldListBase.list;
+          this.fieldBaseShow = this.fieldBase
+          var j = parseInt(res.data.fieldListBase.total)
+          this.baseTotal = j
+          findBaseFieldByNo(this.templateNo,this.currentPage1,this.pagesize1).then(
+              res=>
+              {
+                this.fieldTemplateBase=res.data.base_field.list;
+                for (let i = 0; i < this.fieldTemplateBase.length; i++) {
+                  if (!this.fieldBaseSelected.includes(this.fieldTemplateBase[i].fieldDefineId)) {
+                    // 回显数据里没有本条,把这条加进来(选中)
+                    this.fieldBaseSelected.push(this.fieldTemplateBase[i].fieldDefineId);
+                    this.fieldBaseSelectedOld.push(this.fieldTemplateBase[i].id);
+
+                  }
+                }
+                this.fieldBase.forEach(item => {
+                  // 重点: 在当前分页列表中查询与回显数据是否有一致的id,一致则勾选数据回显
+                  // toggleRowSelection(item, true):设置当前行数据为选中状态
+                  if (this.fieldBaseSelected.includes(item.id)) {
+                    this.$refs.baseTable.toggleRowSelection(item, true);
+                  }
+                });
+                console.log("adshkjagsdhiuka")
+                console.log(this.fieldTemplateBase)
+
+                console.log(this.fieldBaseSelectedOld)
+
+              }
+          );
+          // console.log(this.fieldBase)
+        }
+    )
+    fieldListDerive(this.currentPage2,this.pagesize2).then(
+        res=>
+        {
+          this.fieldDerive=res.data.fieldListDerive.list;
+
+          this.fieldDeriveShow = this.fieldDerive
+          var k = parseInt(res.data.fieldListDerive.total)
+          this.deriveTotal = k
+          findDeriveFieldByNo(this.templateNo,this.currentPage2,this.pagesize2).then(
+              res=>
+              {
+                this.fieldTemplateDerive=res.data.derive_field.list;
+                for (let i = 0; i < this.fieldTemplateDerive.length; i++) {
+                  if (!this.fieldDeriveSelected.includes(this.fieldTemplateDerive[i].fieldDefineId)) {
+                    // 回显数据里没有本条,把这条加进来(选中)
+                    this.fieldDeriveSelected.push(this.fieldTemplateDerive[i].fieldDefineId);
+                    this.fieldDeriveSelectedOld.push(this.fieldTemplateDerive[i].id);
+
+                  }
+                }
+                this.fieldDerive.forEach(item => {
+                  // 重点: 在当前分页列表中查询与回显数据是否有一致的id,一致则勾选数据回显
+                  // toggleRowSelection(item, true):设置当前行数据为选中状态
+                  if (this.fieldDeriveSelected.includes(item.id)) {
+                    this.$refs.deriveTable.toggleRowSelection(item, true);
+                  }
+                });
+                console.log(this.fieldDeriveSelectedOld)
+
+              }
+          );
+          // console.log(this.fieldDerive)
+        }
+    )
+
   },
   beforeUpdate() {},
   updated() {},
@@ -301,12 +371,13 @@ export default {
         });
       }
     },
+
     handleCurrentChange1:function(currentPage){
       this.currentPage1=currentPage;
-      findTemplateFieldByNum(this.templateNo,this.currentPage1,this.pagesize1).then(
+      fieldListBase(this.currentPage1,this.pagesize1).then(
           res=>
           {
-            this.fieldBase=res.data.base_field.list;
+            this.fieldBase=res.data.fieldListBase.list;
             this.fieldBaseShow = this.fieldBase
             this.$nextTick(() => {
               this.fieldBase.forEach(item => {
@@ -322,10 +393,10 @@ export default {
     },
     handleSizeChange1:function(size){
       this.pagesize1=size;
-      findTemplateFieldByNum(this.templateNo,this.currentPage1,this.pagesize1).then(
+      fieldListBase(this.currentPage1,this.pagesize1).then(
           res=>
           {
-            this.fieldBase=res.data.base_field.list;
+            this.fieldBase=res.data.fieldListBase.list;
             this.fieldBaseShow = this.fieldBase
             this.$nextTick(() => {
               this.fieldBase.forEach(item => {
@@ -339,6 +410,63 @@ export default {
           }
       )
     },
+
+    handleSelectionChange2(selecteds, row) {
+      if (!this.fieldDeriveSelected.includes(row.id)) {
+        // 回显数据里没有本条,把这条加进来(选中)
+        this.fieldDeriveSelected.push(row.id);
+        console.log(this.fieldDeriveSelected)
+
+      } else {
+        // 回显数据里有本条,把这条删除(取消选中)
+        this.fieldDeriveSelected.forEach((id, index) => {
+          if (id === row.id) {
+            this.fieldDeriveSelected.splice(index, 1);
+          }
+        });
+      }
+    },
+    handleCurrentChange2:function(currentPage){
+      this.currentPage2=currentPage;
+      fieldListDerive(this.currentPage2,this.pagesize2).then(
+          res=>
+          {
+            this.fieldDerive=res.data.fieldListDerive.list;
+
+            this.fieldDeriveShow = this.fieldDerive
+            this.$nextTick(() => {
+              this.fieldDerive.forEach(item => {
+                // 重点: 在当前分页列表中查询与回显数据是否有一致的id,一致则勾选数据回显
+                // toggleRowSelection(item, true):设置当前行数据为选中状态
+                if (this.fieldDeriveSelected.includes(item.id)) {
+                  this.$refs.deriveTable.toggleRowSelection(item, true);
+                }
+              });
+            });
+          }
+      )
+    },
+    handleSizeChange2:function(size){
+      this.pagesize2=size;
+      fieldListDerive(this.currentPage2,this.pagesize2).then(
+          res=>
+          {
+            this.fieldDerive=res.data.fieldListDerive.list;
+
+            this.fieldDeriveShow = this.fieldDerive
+            this.$nextTick(() => {
+              this.fieldDerive.forEach(item => {
+                // 重点: 在当前分页列表中查询与回显数据是否有一致的id,一致则勾选数据回显
+                // toggleRowSelection(item, true):设置当前行数据为选中状态
+                if (this.fieldDeriveSelected.includes(item.id)) {
+                  this.$refs.deriveTable.toggleRowSelection(item, true);
+                }
+              });
+            });
+          }
+      )
+
+    },
     handleClick(tab, event) {
       if(tab.name=='second'){
         this.gotolinkbusiness();
@@ -379,6 +507,10 @@ export default {
       this.templateData.templateNo = this.templateNo;
       this.templateData.templateName = this.templateName;
       this.templateData.fieldBaseSelected = this.fieldBaseSelected;
+      this.templateData.fieldBaseSelectedOld = this.fieldBaseSelectedOld;
+
+      this.templateData.fieldDeriveSelected = this.fieldDeriveSelected;
+      this.templateData.fieldDeriveSelectedOld = this.fieldDeriveSelectedOld;
 
       // this.templateData.status = this.status;