Parcourir la source

debug35初版

zishan-an il y a 1 an
Parent
commit
b90c11c878

+ 10 - 6
src/api/index.js

@@ -100,6 +100,9 @@ export function fieldTemplateLists() {
     return request.get('/fieldtemplate/fieldTemplateList');
 
 }
+export function getTemplateById(templateId){
+    return request.get('/fieldtemplate/getTemplateById?id=' +  templateId);
+}
 export function cooperatorProductList(pageNum,pageSize){
     return request.post('/cooperator_product/cooperatorProductList',
         {
@@ -389,21 +392,22 @@ export function fieldTemplateSave(templateData) {
     });
 }
 
-export function cooperatorAdd(cooperator_name, cooperatorNum, corp_certificate_type, field_template_no) {
+export function cooperatorAdd(cooperator_name, corpCertificateNum, corp_certificate_type, field_template_id) {
     return request.post('/cooperator/add', {
         cooperator_name : cooperator_name,
-        cooperatorNum : cooperatorNum,
-        corp_certificate_type : corp_certificate_type, 
-        field_template_no : field_template_no
+        corpCertificateNum : corpCertificateNum,
+        corp_certificate_type : corp_certificate_type,
+        field_template_id : field_template_id
     });
 }
 
-export function cooperatorEdit(cooperator_id, cooperator_name, cooperatorNum, corp_certificate_type) {
+export function cooperatorEdit(cooperator_id, cooperator_name, cooperatorNum, corp_certificate_type,fieldTemplateId) {
     return request.post('/cooperator/edit', {
         cooperator_id : cooperator_id, 
         cooperator_name : cooperator_name,
         cooperatorNum : cooperatorNum,
-        corp_certificate_type : corp_certificate_type, 
+        corp_certificate_type : corp_certificate_type,
+        fieldTemplateId:fieldTemplateId
     });
 }
 

+ 27 - 18
src/views/system/cooperatorAdd.vue

@@ -32,24 +32,23 @@
                 <el-input v-model="cooperator_name" style="width:215px"></el-input>
               </el-form-item>
               <el-form-item label="证件号码" width="200px">
-                <el-input v-model="cooperatorNum" style="width:215px"></el-input>
+                <el-input v-model="corpCertificateNum" style="width:215px"></el-input>
               </el-form-item>
               <el-form-item label="证件类型" width="200px">
-                <el-select name="art-cate" v-model="corp_certificate_type_name" style="height:35px">
-                    <option disabled selected style="display: block;" >请选择证件类型</option>
-                    <option v-for="item in arr "
-                            :key="item" :label="item"
-                            :value="item"></option>
-
+                <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"
+                    />
                 </el-select>
               </el-form-item>
 
               <el-form-item label="所属字段表" width="200px">
-                <el-select name="art-cate" v-model="fieldTemplateNo" style="height:35px" >
-                    <option disabled selected style="display: block;">请选择字段表</option>
-                    <option v-for="(item,index) in fieldTemplateList " 
-                            :key="index" 
-                            :value="item.templateNo">{{item.templateName}}</option>
+                <el-select name="art-cate" v-model="fieldTemplateId" placeholder="请选择字段表" style="height:35px" >
+                    <el-option v-for="(item,index) in fieldTemplateList "
+                            :key="index"
+                          :label="item.templateName"
+                            :value="item.id"
+                  />
 
                 </el-select>
               </el-form-item>
@@ -93,7 +92,7 @@ export default {
       currentPage: 1,
       // cooperatorName : this.$route.query.cooperatorName,
       cooperatorName : "",
-      cooperatorNum : "",
+      corpCertificateNum : "",
       fieldCount : "",
       modelCount : "",
       createTime : "",
@@ -109,12 +108,22 @@ export default {
       cooperatorProduct : [],
       productStatus : "",
       arr: ["统一社会信用代码", "组织机构代码" ],
+      type_list: [
+        {
+          key: 1,
+          label: "统一社会信用代码"
+        },
+        {
+          key: 2,
+          label: "组织机构代码"
+        }
+      ],
       cooperator_name : "",
       corp_certificate_num : "",
       corp_certificate_type_name : "",
       corp_certificate_type : "",
       fieldTemplateList : "",
-      fieldTemplateNo : ""
+      fieldTemplateId : ""
     }
   },
   watch: {},
@@ -219,14 +228,14 @@ export default {
           this.corp_certificate_type = "0"
         else
           this.corp_certificate_type =  "1"
-      console.log(this.fieldTemplateNo)
+      console.log(this.fieldTemplateId)
 
       if(this.cooperator_name=="")
       {
         this.$alert("请输入合作方名称");
         return;
       }
-      if(this.cooperatorNum=="")
+      if(this.corpCertificateNum=="")
       {
         this.$alert("请输入证件号码");
         return;
@@ -236,7 +245,7 @@ export default {
         this.$alert("请选择证件类WW型");
         return;
       }
-      if(this.fieldTemplateNo=="")
+      if(this.fieldTemplateId=="")
       {
         this.$alert("请选择所属字段表");
         return;
@@ -246,7 +255,7 @@ export default {
         type: 'success'
       });
 
-        cooperatorAdd(this.cooperator_name, this.cooperatorNum, this.corp_certificate_type, this.fieldTemplateNo).then(
+        cooperatorAdd(this.cooperator_name, this.corpCertificateNum, this.corp_certificate_type, this.fieldTemplateId).then(
           res=>
           {
 

+ 28 - 89
src/views/system/cooperatorDetailed.vue

@@ -73,92 +73,9 @@
               </el-col>
 
             </el-row>
-            <!-- <el-row>
-                  <el-col span="8" :offset="2">
-                  
-                      <el-button type="primary" round @click="onButtonClickApply()" size="medium" >合作方产品申请</el-button>
-                    
-                  </el-col>
-
-                  <el-col span="8" :offset="4" >
-                    
-                      <el-button type="primary" round @click="onButtonClickEdit()" size="medium" >编辑合作方信息</el-button>
-                    
-                  </el-col>
-            </el-row> -->
+
           </el-form>
-          <!-- <el-row>
-            <el-col >
-              <el-form  label-position="labelPosition" class="model_add_button" label-width="150px">
-
-                <el-row>
-                  <el-col span="10" offset="0">
-                    <el-form-item label="合作方名称" width="100px">
-                    <span>{{cooperatorName}}</span>
-                    </el-form-item>
-                  </el-col>
-                  <el-col span="10"  :offset="4">
-                    <el-form-item label="合作方编号" width="100px">
-                    <span>{{cooperatorId}}</span>
-                    </el-form-item>
-                  </el-col>
-
-                </el-row>
-              </el-form>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col >
-              <el-form  label-position="labelPosition" class="model_add_button" label-width="150px">
-
-                <el-row>
-                  <el-col span="10" offset="0">
-                    <el-form-item label="合作方证件类型" width="100px">
-                    <span>{{corpCertificateType}}</span>
-                    </el-form-item>
-                  </el-col>
-                  <el-col span="10"  :offset="4">
-                    <el-form-item label="合作方证件编号" width="100px">
-                    <span>{{corpCertificateNum}}</span>
-                    </el-form-item>
-                  </el-col>
-
-                </el-row>
-              </el-form>
-            </el-col>
-          </el-row>
-
-          <el-row>
-            <el-col>
-              <el-form  label-position="labelPosition" class="model_add_button" label-width="180px">
-
-                <el-row>
-                  <el-col span="4">
-                  
-                      <el-button type="primary" round @click="onButtonClickApply()" size="mini" >合作方产品申请</el-button>
-                    
-                  </el-col>
-
-                  <el-col span="5" :offset="0">
-                    
-                      <el-button type="primary" round @click="onButtonClickEdit()" size="mini" >编辑合作方信息</el-button>
-                    
-                  </el-col>
-                  <el-col span="10" :offset="1">
-                    <el-form-item label="模板名称" width="100px">
-                      <span>{{templateName}}</span>
-                    </el-form-item>
-                  </el-col>
-
-                  <el-col span="10" :offset="4">
-                    <el-form-item label="创建时间" width="100px">
-                      <span>{{createTime}}</span>
-                    </el-form-item>
-                  </el-col>
-                </el-row>
-              </el-form>
-            </el-col>
-          </el-row> -->
+
         </div>
 
         <el-divider></el-divider>
@@ -276,7 +193,13 @@
 
 import {
   getList,
-  userInfo, partnerList, roleDel,findCooperatorListByName, findCooperatorFieldByNum, findCooperatorProductByNum
+  userInfo,
+  partnerList,
+  roleDel,
+  findCooperatorListByName,
+  findCooperatorFieldByNum,
+  findCooperatorProductByNum,
+  getTemplateById
 } from '@/api/index.js'
 import store from "@/store";
 import request from '@/utils/request.js'
@@ -304,7 +227,8 @@ export default {
       corpCertificateType:this.$route.query.corpCertificateType,
       corpCertificateNum:this.$route.query.corpCertificateNum,
       createTime : this.$route.query.createTime,
-      templateName : this.$route.query.templateName,
+      templateId : this.$route.query.templateId,
+      templateName:'',
       cooperatorData : [],
       selected1: true,
       selected2: false,
@@ -325,6 +249,17 @@ export default {
   beforeMount() {},
   mounted() 
   {
+    if(this.templateId){
+    getTemplateById(this.templateId).then(
+      res=>
+      {
+        this.templateName=res.data.templateName;
+      }
+    )
+    }
+    if (this.cooperatorNum==""){
+      this.cooperatorNum=null
+    }
     findCooperatorFieldByNum(this.cooperatorNum).then(
       res=>
       {
@@ -437,7 +372,7 @@ export default {
           modelName:row.modelName,
           cooperatorName:this.$route.query.cooperatorName,
 
-        }// 要传递的参数
+    }// 要传递的参数
       })
     },
     onButtonClickEdit() {
@@ -448,7 +383,11 @@ export default {
           'cooperatorId' : this.cooperatorId,
           'cooperatorNum' : this.cooperatorNum,
           'cooperatorName' : this.cooperatorName,
-          'createTime' : this.createTime
+          'createTime' : this.createTime,
+          'templateName':this.templateName,
+          'templateId':this.templateId,
+
+
         }
       })
     },

+ 43 - 17
src/views/system/cooperatorEdit.vue

@@ -35,14 +35,22 @@
                   <el-input v-model="corp_certificate_num" style="width:400px"></el-input>
                 </el-form-item>
                 <el-form-item label="证件类型" width="100px">
-                  <select name="art-cate" v-model="corp_certificate_type_name" style="height:35px">
-                      <option disabled selected style="display: block;">请选择证件类型</option>
-                      <option v-for="(item,index) in arr " 
-                              :key="index" 
-                              :value="item.name">{{item.name}}</option>
-                  </select>
+                  <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"
+                    />
+                  </el-select>
                 </el-form-item>
+                <el-form-item label="所属字段表模板" width="200px">
+                  <el-select name="art-cate" v-model="fieldTemplateId" placeholder="请选择字段表模板" style="height:35px" >
+                    <el-option v-for="(item,index) in fieldTemplateList "
+                               :key="index"
+                               :label="item.templateName"
+                               :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>
@@ -87,22 +95,36 @@ export default {
       selected5: true,
       selected6: false,
       input:'',
+
+
       cooperatorField : [],
       cooperatorProduct : [],
       productStatus : "",
       arr: [{ name: '统一社会信用代码' }, { name: '组织机构代码' }, ],
-
+      type_list: [
+        {
+          key: 1,
+          label: "统一社会信用代码"
+        },
+        {
+          key: 2,
+          label: "组织机构代码"
+        }
+      ],
       cooperator_name : this.$route.query.cooperatorName,
       corp_certificate_num : this.$route.query.cooperatorNum,
       corp_certificate_type_name : "",
       corp_certificate_type : "",
       fieldTemplateList : "",
-      fieldTemplateNo : "",
+      fieldTemplateNa : "",
       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,
+      templateName:this.$route.query.templateName,
+      fieldTemplateId:this.$route.query.templateName
 
     }
   },
@@ -117,13 +139,13 @@ export default {
       this.corp_certificate_type_name = "统一社会信用代码"
     else
       this.corp_certificate_type_name =  "组织机构代码"
-    // fieldTemplateLists().then(
-    //   res=>
-    //   {
-    //     this.fieldTemplateList=res.data.field_template_list;
-    //     console.log(this.fieldTemplateList)
-    //   }
-    // )
+    fieldTemplateLists().then(
+      res=>
+      {
+        this.fieldTemplateList=res.data.field_template_list;
+        console.log(this.fieldTemplateList)
+      }
+    )
   },
   beforeUpdate() {},
   updated() {},
@@ -203,10 +225,14 @@ export default {
       this.$router.push({
         path: '/cooperatorDetailed',
         query: {
+
+          corpCertificateType:this.corpCertificateType,
           cooperatorId : this.cooperatorId,
           cooperatorName: this.cooperatorName,
           cooperatorNum : this.cooperatorNum,
-          createTime : this.createTime
+          createTime : this.createTime,
+          templateId : this.templateId,
+
         }// 要传递的参数
       })
     },
@@ -239,7 +265,7 @@ export default {
         message: '编辑成功',
         type: 'success'
       });
-        cooperatorEdit(this.cooperatorId, this.cooperator_name, this.corp_certificate_num, this.corp_certificate_type).then(
+        cooperatorEdit(this.cooperatorId, this.cooperator_name, this.corp_certificate_num, this.corp_certificate_type,this.fieldTemplateId).then(
           res=>
           {
             this.$router.push({

+ 2 - 1
src/views/system/cooperatorInfo.vue

@@ -269,7 +269,8 @@ export default {
           corpCertificateType:row.corpCertificateType,
           corpCertificateNum:row.corpCertificateNum,
           createTime : row.createTime,
-          templateName : row.templateName,
+          templateId : row.templateId,
+
         }// 要传递的参数
       })
     },