Jelajahi Sumber

更正编辑成功提示的触发

Danj0rr 11 bulan lalu
induk
melakukan
4bd6d2646e
1 mengubah file dengan 316 tambahan dan 312 penghapusan
  1. 316 312
      src/views/system/cooperatorEdit.vue

+ 316 - 312
src/views/system/cooperatorEdit.vue

@@ -1,321 +1,322 @@
 <template>
-  <div class="container" style="min-height: 100%; padding-bottom: 100px;">
-
-    <el-tabs v-model="activeName" @tab-click="handleClick"  stretch>
-
-
-
-        <el-container>
-          <el-aside :width="isCollapse?'65px':'150px'">
-            <el-button   @click = "toggleCollapse" type="primary"
-                         style="display:block;margin:0 auto"
-                         size="medium"
-                         class="el-icon-s-fold">
-            </el-button>                <el-menu
-              default-active="1"
-              class="el-menu-vertical-demo"
-              :collapse="isCollapse"
-
-            >
-              <el-menu-item @click="gotolink2" class="vertical-center" index="1">
-                <i class="el-icon-location"></i>
-                <span slot="title">合作方</span>
-              </el-menu-item>
-              <el-menu-item  @click="gotolink3" class="vertical-center" index="2">
-                <i class="el-icon-menu"></i>
-                <span slot="title">合作产品</span>
-              </el-menu-item>
-            </el-menu>
-          </el-aside>
-          <el-divider direction="vertical"></el-divider>
-
-          <!--          <div class="line" />-->
-
-          <el-main>
-            <div class="submit_view">
-              <span style="display: block; margin-bottom: 20px;">编辑合作方</span>
-              <el-form  class="model_add_button" ref="form"  label-width="120px">
-                <el-form-item label="合作方名称" width="100px">
-                  <el-input v-model="cooperator_name" style="width:215px"></el-input>
-                </el-form-item>
-                <el-form-item label="证件号码" width="100px">
-                  <el-input v-model="corp_certificate_num" style="width:215px"></el-input>
-                </el-form-item>
-                <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.label"
-                    />
-                  </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>
-              <el-button class="model_add_button " size="small" round type="danger" @click="return_page()">返回</el-button>
-
-            </div>
-          </el-main>
-        </el-container>
-
-
-    </el-tabs>
-    
-  </div>
+    <div class="container" style="min-height: 100%; padding-bottom: 100px;">
+
+        <el-tabs v-model="activeName" @tab-click="handleClick" stretch>
+
+
+            <el-container>
+                <el-aside :width="isCollapse?'65px':'150px'">
+                    <el-button @click="toggleCollapse" type="primary"
+                               style="display:block;margin:0 auto"
+                               size="medium"
+                               class="el-icon-s-fold">
+                    </el-button>
+                    <el-menu
+                            default-active="1"
+                            class="el-menu-vertical-demo"
+                            :collapse="isCollapse"
+
+                    >
+                        <el-menu-item @click="gotolink2" class="vertical-center" index="1">
+                            <i class="el-icon-location"></i>
+                            <span slot="title">合作方</span>
+                        </el-menu-item>
+                        <el-menu-item @click="gotolink3" class="vertical-center" index="2">
+                            <i class="el-icon-menu"></i>
+                            <span slot="title">合作产品</span>
+                        </el-menu-item>
+                    </el-menu>
+                </el-aside>
+                <el-divider direction="vertical"></el-divider>
+
+                <!--          <div class="line" />-->
+
+                <el-main>
+                    <div class="submit_view">
+                        <span style="display: block; margin-bottom: 20px;">编辑合作方</span>
+                        <el-form class="model_add_button" ref="form" label-width="120px">
+                            <el-form-item label="合作方名称" width="100px">
+                                <el-input v-model="cooperator_name" style="width:215px"></el-input>
+                            </el-form-item>
+                            <el-form-item label="证件号码" width="100px">
+                                <el-input v-model="corp_certificate_num" style="width:215px"></el-input>
+                            </el-form-item>
+                            <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.label"
+                                    />
+                                </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>
+                        <el-button class="model_add_button " size="small" round type="danger" @click="return_page()">
+                            返回
+                        </el-button>
+
+                    </div>
+                </el-main>
+            </el-container>
+
+
+        </el-tabs>
+
+    </div>
 </template>
 
 <script>
 
 import {
-  fieldTemplateLists, cooperatorEdit
+    fieldTemplateLists, cooperatorEdit
 } from '@/api/index.js'
 import store from "@/store";
 import request from '@/utils/request.js'
-import { fieldInfo, modelInfo } from '../../api';
+import {fieldInfo, modelInfo} from '../../api';
 
 export default {
 
-  name: "cooperatorInfo",
-  props: [],
-  components: {},
-  data() {
-    return {
-      activeKey: 0,
-      activeName: "third",
-      activeKey: 1,
-      activeName: "third",
-      currentPage: 1,
-      cooperatorData : [],
-      selected1: true,
-      selected2: false,
-      selected3: false,
-      selected4: true,
-      selected5: true,
-      selected6: false,
-      input:'',
-
-      isCollapse: false,
-
-      cooperatorField : [],
-      cooperatorProduct : [],
-      productStatus : "",
-      arr: [{ name: '统一社会信用代码' }, { name: '组织机构代码' }, ],
-      type_list: [
-        {
-          key: 20,
-          label: "统一社会信用代码"
-        },
-        {
-          key: 30,
-          label: "组织机构代码"
+    name: "cooperatorInfo",
+    props: [],
+    components: {},
+    data() {
+        return {
+            activeKey: 0,
+            activeName: "third",
+            activeKey: 1,
+            activeName: "third",
+            currentPage: 1,
+            cooperatorData: [],
+            selected1: true,
+            selected2: false,
+            selected3: false,
+            selected4: true,
+            selected5: true,
+            selected6: false,
+            input: '',
+
+            isCollapse: false,
+
+            cooperatorField: [],
+            cooperatorProduct: [],
+            productStatus: "",
+            arr: [{name: '统一社会信用代码'}, {name: '组织机构代码'},],
+            type_list: [
+                {
+                    key: 20,
+                    label: "统一社会信用代码"
+                },
+                {
+                    key: 30,
+                    label: "组织机构代码"
+                }
+            ],
+            cooperator_name: this.$route.query.cooperatorName,
+            corp_certificate_num: this.$route.query.corpCertificateNum,
+            corp_certificate_type_name: "",
+            corp_certificate_type: "",
+            fieldTemplateList: "",
+            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,
+            corpCertificateNum: this.$route.query.corpCertificateNum,
+
         }
-      ],
-      cooperator_name : this.$route.query.cooperatorName,
-      corp_certificate_num : this.$route.query.corpCertificateNum,
-      corp_certificate_type_name : "",
-      corp_certificate_type : "",
-      fieldTemplateList : "",
-      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,
-      corpCertificateNum : this.$route.query.corpCertificateNum,
-
-    }
-  },
-  watch: {},
-  computed: {},
-  beforeCreate() {},
-  created() {},
-  beforeMount() {},
-  mounted() 
-  {
-    if(this.corpCertificateType == "20")
-      this.corp_certificate_type_name = "统一社会信用代码"
-    else
-      this.corp_certificate_type_name =  "组织机构代码"
-    fieldTemplateLists().then(
-      res=>
-      {
-        this.fieldTemplateList=res.data.field_template_list;
-        console.log("asfafs的")
-
-        console.log(this.fieldTemplateList)
-      }
-    )
-  },
-  beforeUpdate() {},
-  updated() {},
-  destroyed() {},
-  methods: {
-    request() {},
-
-    toggleCollapse(){
-      this.isCollapse = !this.isCollapse;
     },
-    handleClick(tab, event) {
-      if(tab.name=='first'){
-        this.gotolinkHome();
-      }
-      if(tab.name=='second'){
-        this.gotolinkbusiness();
-      }
-      if(tab.name=='third'){
-        this.gotolinkCooperator();
-      }
-      if(tab.name=='fourth'){
-        this.gotolinkField();
-      }
+    watch: {},
+    computed: {},
+    beforeCreate() {
     },
-    gotolinkHome()
-    {
-      this.$router.replace('/homePage');
+    created() {
     },
-    gotolinkbusiness()
-    {
-      this.$router.replace('/businesstodo');
-    },
-    gotolinkCooperator()
-    {
-      this.$router.replace('/cooperatorInfo');
+    beforeMount() {
     },
+    mounted() {
+        if (this.corpCertificateType == "20")
+            this.corp_certificate_type_name = "统一社会信用代码"
+        else
+            this.corp_certificate_type_name = "组织机构代码"
+        fieldTemplateLists().then(
+            res => {
+                this.fieldTemplateList = res.data.field_template_list;
+                console.log("asfafs的")
 
-    gotolinkField()
-    {
-      this.$router.replace('/fieldInfo');
-    },
-    handleCurrentChange() {},
-    handleSizeChange() {},
-
-    gotolink2()
-    {
-      //指定跳转地址
-      this.$router.replace('/cooperatorInfo');
-      this.selected1 = true;
-      this.selected2 = false;
-      this.selected3 = false;
-      this.selected4 = true;
-      this.selected5 = true;
-      this.selected6 = false;
+                console.log(this.fieldTemplateList)
+            }
+        )
     },
-    gotolink3()
-    {
-      //指定跳转地址
-      this.$router.replace('/cooperatorProductInfo');
-      this.selected1 = true;
-      this.selected2 = false;
-      this.selected3 = true;
-      this.selected4 = false;
-      this.selected5 = false;
-      this.selected6 = true;
+    beforeUpdate() {
     },
-    tables:function () { //在你的数据表格中定义tabels
-      const input = this.input
-      if (input) {
-        // console.log("input输入的搜索内容:" + this.input)
-        return this.cooperatorData.filter(data => {
-          console.log("object:" + Object.keys(data))
-          return Object.keys(data).some(key => {
-            return String(data[key]).indexOf(input) > -1
-          })
-        })
-      }
-      return this.cooperatorData
+    updated() {
     },
-    return_page (){
-      this.$router.push({
-        path: '/cooperatorDetailed',
-        query: {
-
-
-          cooperatorId : this.cooperatorId,
-          cooperatorName : this.cooperatorName,
-          cooperatorNum : this.cooperatorNum,
-          createTime : this.createTime,
-          corpCertificateNum:this.corpCertificateNum,
-          corpCertificateType:this.corpCertificateType,
-          templateId:this.templateId,
-        }// 要传递的参数
-      })
+    destroyed() {
     },
-    submit (){
-        if(this.corp_certificate_type_name == "统一社会信用代码")
-          this.corp_certificate_type = "20"
-        else
-          this.corp_certificate_type =  "30"
-      if(this.cooperator_name=="")
-      {
-        this.$alert("请输入合作方名称");
-        return;
-      }
-      if(this.corpCertificateNum=="")
-      {
-        this.$alert("请输入证件号码");
-        return;
-      }
-      if(this.corp_certificate_type=="")
-      {
-        this.$alert("请选择证件类型");
-        return;
-      }
-      // if(this.fieldTemplateNo=="")
-      // {
-      //   this.$alert("请选择所属字段表");
-      //   return;
-      // }
-      this.$message({
-        message: '编辑成功',
-        type: 'success'
-      });
-      if(this.templateName==this.fieldTemplateId){
-        this.fieldTemplateId = this.templateId
-      }
-        cooperatorEdit(this.cooperatorId, this.cooperator_name, this.corp_certificate_num, this.corp_certificate_type,this.fieldTemplateId).then(
-          res=>
-          {
+    methods: {
+        request() {
+        },
+
+        toggleCollapse() {
+            this.isCollapse = !this.isCollapse;
+        },
+        handleClick(tab, event) {
+            if (tab.name == 'first') {
+                this.gotolinkHome();
+            }
+            if (tab.name == 'second') {
+                this.gotolinkbusiness();
+            }
+            if (tab.name == 'third') {
+                this.gotolinkCooperator();
+            }
+            if (tab.name == 'fourth') {
+                this.gotolinkField();
+            }
+        },
+        gotolinkHome() {
+            this.$router.replace('/homePage');
+        },
+        gotolinkbusiness() {
+            this.$router.replace('/businesstodo');
+        },
+        gotolinkCooperator() {
+            this.$router.replace('/cooperatorInfo');
+        },
+
+        gotolinkField() {
+            this.$router.replace('/fieldInfo');
+        },
+        handleCurrentChange() {
+        },
+        handleSizeChange() {
+        },
+
+        gotolink2() {
+            //指定跳转地址
+            this.$router.replace('/cooperatorInfo');
+            this.selected1 = true;
+            this.selected2 = false;
+            this.selected3 = false;
+            this.selected4 = true;
+            this.selected5 = true;
+            this.selected6 = false;
+        },
+        gotolink3() {
+            //指定跳转地址
+            this.$router.replace('/cooperatorProductInfo');
+            this.selected1 = true;
+            this.selected2 = false;
+            this.selected3 = true;
+            this.selected4 = false;
+            this.selected5 = false;
+            this.selected6 = true;
+        },
+        tables: function () { //在你的数据表格中定义tabels
+            const input = this.input
+            if (input) {
+                // console.log("input输入的搜索内容:" + this.input)
+                return this.cooperatorData.filter(data => {
+                    console.log("object:" + Object.keys(data))
+                    return Object.keys(data).some(key => {
+                        return String(data[key]).indexOf(input) > -1
+                    })
+                })
+            }
+            return this.cooperatorData
+        },
+        return_page() {
             this.$router.push({
-              path: '/cooperatorInfo',
-              query: {
-                
-              }
+                path: '/cooperatorDetailed',
+                query: {
+
+
+                    cooperatorId: this.$route.query.cooperatorId,
+                    cooperatorName: this.$route.query.cooperatorName,
+                    cooperatorNum: this.$route.query.cooperatorNum,
+                    createTime: this.$route.query.createTime,
+                    corpCertificateNum: this.$route.query.corpCertificateNum,
+                    corpCertificateType: this.$route.query.corpCertificateType,
+                    templateId: this.$route.query.templateId,
+                }// 要传递的参数
             })
-          },
-        ),
-        console.log('111')
-    },
+        },
+        submit() {
+            if (this.corp_certificate_type_name == "统一社会信用代码")
+                this.corp_certificate_type = "20"
+            else
+                this.corp_certificate_type = "30"
+            if (this.cooperator_name == "") {
+                this.$alert("请输入合作方名称");
+                return;
+            }
+            if (this.corpCertificateNum == "") {
+                this.$alert("请输入证件号码");
+                return;
+            }
+            if (this.corp_certificate_type == "") {
+                this.$alert("请选择证件类型");
+                return;
+            }
+            // if(this.fieldTemplateNo=="")
+            // {
+            //   this.$alert("请选择所属字段表");
+            //   return;
+            // }
+
+            if (this.templateName == this.fieldTemplateId) {
+                this.fieldTemplateId = this.templateId
+            }
+            cooperatorEdit(this.cooperatorId, this.cooperator_name, this.corp_certificate_num, this.corp_certificate_type, this.fieldTemplateId).then(
+                res => {
+                    this.$message({
+                        message: '编辑成功',
+                        type: 'success'
+                    });
+                    this.$router.push({
+                        path: '/cooperatorInfo',
+                        query: {}
+                    })
+                },
+            ),
+                console.log('111')
+        },
 
-  },
-  fillter: {},
+    },
+    fillter: {},
 }
 </script>
 
 <style scoped>
 /* 竖线 */
-.line{
-  float: left;
-  width: 0.1em;
-  height: 19.5em;
-  margin-right: 1em;
-  margin-left: 0em;
-  background:#000000;
+.line {
+    float: left;
+    width: 0.1em;
+    height: 19.5em;
+    margin-right: 1em;
+    margin-left: 0em;
+    background: #000000;
 }
 
 .button {
-    background-color: white; 
+    background-color: white;
     border: none;
     color: black;
     padding: 15px 32px;
@@ -323,13 +324,13 @@ export default {
     text-decoration: none;
     display: inline-block;
     font-size: 16px;
-    width:180px;
-    height:50px;
+    width: 180px;
+    height: 50px;
     font-weight: normal
 }
 
 .buttonselected {
-    background-color: white; 
+    background-color: white;
     border: none;
     color: black;
     padding: 15px 32px;
@@ -337,37 +338,40 @@ export default {
     text-decoration: none;
     display: inline-block;
     font-size: 18px;
-    width:180px;
-    height:50px;
+    width: 180px;
+    height: 50px;
     font-weight: 900
 }
 
-.line{
-  float: left;
-  width: 0.1em;
-  height: 19.5em;
-  margin-right: 1em;
-  margin-left: 0em;
-  background:#000000;
+.line {
+    float: left;
+    width: 0.1em;
+    height: 19.5em;
+    margin-right: 1em;
+    margin-left: 0em;
+    background: #000000;
 }
-.el-menu-vertical-demo{
-  font-weight: bold;
+
+.el-menu-vertical-demo {
+    font-weight: bold;
 }
 
-.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;
+.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;
 }
+
 .el-divider--vertical {
-  height: 47em;
-  margin-left: 20px;
+    height: 47em;
+    margin-left: 20px;
+}
+
+.container {
 }
-.container {  }
 </style>