Browse Source

合作方产品申请部分及登陆超时bug

zishan-an 1 year ago
parent
commit
6d86285b4c

+ 4 - 3
src/api/index.js

@@ -201,13 +201,14 @@ export function modelDefineList(){
 }
 
 
-export function cooperatorProductApply(cooperator_no, cooperator_name,  product_num, product_name, model_id) {
+export function cooperatorProductApply(cooperator_num, cooperator_name,  product_num, product_name, model_id,fieldSelected) {
     return request.post('/cooperator_product/apply', {
-        cooperator_no : cooperator_no, 
+        cooperator_num : cooperator_num,
         cooperator_name : cooperator_name, 
         product_num : product_num,
         product_name : product_name,
-        model_id : model_id
+        model_id : model_id,
+        fieldSelected:fieldSelected
     });
 }
 

+ 1 - 1
src/utils/request.js

@@ -15,7 +15,7 @@ const service = axios.create({
     // axios中请求配置有baseURL选项,表示请求URL公共部分
     baseURL: baseURL,
     // 超时
-    timeout: 10000
+    timeout: 1000*60*60
 })
 
 

+ 3 - 1
src/views/system/cooperatorAdd.vue

@@ -123,7 +123,9 @@ export default {
       corp_certificate_type_name : "",
       corp_certificate_type : "",
       fieldTemplateList : "",
-      fieldTemplateId : ""
+      fieldTemplateId : "",
+      fieldTemplateNo : ""
+
     }
   },
   watch: {},

+ 9 - 2
src/views/system/cooperatorDetailed.vue

@@ -253,7 +253,7 @@ export default {
     getTemplateById(this.templateId).then(
       res=>
       {
-        this.templateName=res.data.templateName;
+        this.templateName=res.data.fieldTemplate.templateName;
       }
     )
     }
@@ -383,6 +383,8 @@ export default {
           'cooperatorId' : this.cooperatorId,
           'cooperatorNum' : this.cooperatorNum,
           'cooperatorName' : this.cooperatorName,
+          'corpCertificateNum' : this.corpCertificateNum,
+
           'createTime' : this.createTime,
           'templateName':this.templateName,
           'templateId':this.templateId,
@@ -395,10 +397,15 @@ export default {
       this.$router.push({
         path: '/cooperatorProductApply',
         query: {
+          'corpCertificateType':this.corpCertificateType,
           'cooperatorId' : this.cooperatorId,
           'cooperatorNum' : this.cooperatorNum,
+          'corpCertificateNum' : this.corpCertificateNum,
+
           'cooperatorName' : this.cooperatorName,
-          'createTime' : this.createTime
+          'createTime' : this.createTime,
+          'templateName':this.templateName,
+          'templateId':this.templateId,
 
         }
       })

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

@@ -226,13 +226,13 @@ export default {
         path: '/cooperatorDetailed',
         query: {
 
-          corpCertificateType:this.corpCertificateType,
-          cooperatorId : this.cooperatorId,
-          cooperatorName: this.cooperatorName,
-          cooperatorNum : this.cooperatorNum,
-          createTime : this.createTime,
-          templateId : this.templateId,
 
+          cooperatorId : this.$route.query.cooperatorId,
+          cooperatorName : this.$route.query.cooperatorName,
+          cooperatorNum : this.$route.query.cooperatorNum,
+          createTime : this.$route.query.createTime,
+          corpCertificateType:this.$route.query.corpCertificateType,
+          templateId:this.$route.query.templateId,
         }// 要传递的参数
       })
     },

+ 75 - 30
src/views/system/cooperatorProductApply.vue

@@ -44,12 +44,9 @@
             </el-tab-pane>
 
             <el-tab-pane label="合作方产品字段信息" name="second">
-              <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 :data="cooperatorField" style="width: 100%;" ref="cooperatorFields"
+                        @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}">
@@ -77,21 +74,34 @@
                 
                 
                 </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-button class="model_add_button " size="small" round type="primary" @click="paneNext2()">下一步</el-button>
               <el-button class="model_add_button " size="small" round type="danger" style="margin-left: 50px" @click="paneClose1()">关闭</el-button>
 
             </el-tab-pane>
             <el-tab-pane label="合作方产品模型信息" name="third">
               <el-form  class="model_add_button" ref="form"  label-width="120px">
-                <el-form-item label="产品模型" width="100px">
-                  <select name="art-cate" v-model="modelNo">
-                      <option disabled selected style="display: block;">请选择产品模型</option>
-                      <option v-for="(item,index) in modelDefineList " 
-                              :key="index" 
-                              :value="item.modelNo">{{item.modelName}}</option>
-                  </select>
+                <el-form-item label="产品模型" width="200px">
+                  <el-select name="art-cate" v-model="modelId" placeholder="请选择产品模型" style="height:35px" >
+
+                    <el-option v-for="(item,index) in modelData "
+                               :key="index"
+                               :label="item.modelName"
+                               :value="item.id"
+                    />
+                  </el-select>
+
                 </el-form-item>
+
               </el-form>
               <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" style="margin-left: 50px" @click="paneClose1()">关闭</el-button>
@@ -119,7 +129,13 @@
 
 import {
   getList,
-  modelDefineList, findCooperatorFieldByNum, findCooperatorProductByNum, findCooperatorProductFieldByNum, cooperatorProductApply,findCooperatorFieldsByName
+  modelDefineList,
+  findCooperatorFieldByNum,
+  findCooperatorProductByNum,
+  findCooperatorProductFieldByNum,
+  cooperatorProductApply,
+  findCooperatorFieldsByName,
+  cooperatorList
 } from '@/api/index.js'
 import store from "@/store";
 import request from '@/utils/request.js'
@@ -135,11 +151,17 @@ export default {
       activeKey: 0,
       activeKey: 1,
       activeName: "third",
-      currentPage: 1,
+      currentPage1: 1,
+      pagesize1:10,
       cooperatorName : this.$route.query.cooperatorName,
       cooperatorNum : this.$route.query.cooperatorNum,
       cooperatorId : this.$route.query.cooperatorId,
       createTime : this.$route.query.createTime,
+      templateId:this.$route.query.templateId,
+      templateName:this.$route.query.templateName,
+      fieldTemplateId:this.$route.query.templateName,
+      corpCertificateType:this.$route.query.corpCertificateType,
+
       cooperator_product_no : "",
       cooperator_product_name : "",
       cooperatorData : [],
@@ -157,7 +179,10 @@ export default {
       cooperatorProductField : [],
       modelDefineList : [],
       modelNo : "",
+      modelId:"",
       cooperatorFields : [],
+      fieldSelected:[],
+      modelData:"",
       templateSelection: '',
         templateRadio: null,
     }
@@ -181,6 +206,13 @@ export default {
         this.cooperatorProduct=res.data.cooperator_product;
       }
     ),
+    modelInfo(1,100).then(res=>
+    {
+      this.modelData = res.data.modelData.list;
+      console.log("你是谁");
+
+      console.log(this.modelData);
+    })
     this.getTableData();
   },
   beforeUpdate() {},
@@ -188,6 +220,21 @@ export default {
   destroyed() {},
   methods: {
     request() {},
+    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);
+          }
+        });
+      }
+    },
     handleClick1(tab, event) {
       if(tab.name=='first'){
         this.gotolinkHome();
@@ -260,12 +307,6 @@ export default {
     paneNext1()
     {
       this.activeName2 = "second"
-      findCooperatorProductFieldByNum(this.cooperator_product_no).then(
-      res=>
-      {
-        this.cooperatorProductField=res.data.cooperator_product_field;
-      }
-    )
     },
     paneNext2()
     {
@@ -283,25 +324,29 @@ export default {
       this.$router.push({
         path: '/cooperatorDetailed',
         query: {
-          cooperatorId : this.cooperatorId,
-          cooperatorName: this.cooperatorName,
-          cooperatorNum : this.cooperatorNum,
-          createTime : this.createTime
+          cooperatorId : this.$route.query.cooperatorId,
+          cooperatorName : this.$route.query.cooperatorName,
+          cooperatorNum : this.$route.query.cooperatorNum,
+          createTime : this.$route.query.createTime,
+          corpCertificateType:this.$route.query.corpCertificateType,
+          templateId:this.$route.query.templateId,
         }// 要传递的参数
       })
     },
     submit()
     {
-      cooperatorProductApply(this.cooperatorNum, this.cooperatorName, this.cooperator_product_no, this.cooperator_product_name, this.modelNo).then(
+      cooperatorProductApply(this.cooperatorNum, this.cooperatorName, this.cooperator_product_no, this.cooperator_product_name, this.modelId,this.fieldSelected).then(
           res=>
           {
             this.$router.push({
               path: '/cooperatorDetailed',
               query: {
-                cooperatorId : this.cooperatorId,
-                cooperatorName: this.cooperatorName,
-                cooperatorNum : this.cooperatorNum,
-                createTime : this.createTime
+                cooperatorId : this.$route.query.cooperatorId,
+                cooperatorName : this.$route.query.cooperatorName,
+                cooperatorNum : this.$route.query.cooperatorNum,
+                createTime : this.$route.query.createTime,
+                corpCertificateType:this.$route.query.corpCertificateType,
+                templateId:this.$route.query.templateId,
               }// 要传递的参数
             })
           },