Kaynağa Gözat

增加新增合作方、申请产品时的非空约束

Danj0rr 11 ay önce
ebeveyn
işleme
194d91f33c

+ 292 - 290
src/views/system/cooperatorAdd.vue

@@ -1,308 +1,302 @@
 <template>
-  <div class="container" style="height: 80vh;min-height: 100%; padding-bottom: 100px;">
-
+    <div class="container" style="height: 80vh;min-height: 100%; padding-bottom: 100px;">
 
 
         <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-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-divider></el-divider>-->
-            <el-form  class="model_add_button" ref="form"  label-width="90px">
-              <el-form-item label="合作方名称"  width="200px">
-                <el-input v-model="cooperator_name" style="width:215px"></el-input>
-              </el-form-item>
-              <el-form-item label="证件号码" width="200px">
-                <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" 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>
-          </div>
-            <div class="upper_bottom_bar" style="margin-top: 20px">
-                    <el-button round class="model_add_button " type="primary" size="medium" style="margin-right: 10px;" @click="submit()" >
-                      完成
+            <el-divider direction="vertical"></el-divider>
+
+            <!--          <div class="line" />-->
+
+            <el-main>
+                <div class="submit_view">
+                    <span style="display: block; margin-bottom: 20px;">新增合作方</span>
+                    <!--            <el-divider></el-divider>-->
+                    <el-form class="model_add_button" ref="form" label-width="90px">
+                        <el-form-item label="合作方名称" width="200px">
+                            <el-input v-model="cooperator_name" style="width:215px"></el-input>
+                        </el-form-item>
+                        <el-form-item label="证件号码" width="200px">
+                            <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" 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>
+                </div>
+                <div class="upper_bottom_bar" style="margin-top: 20px">
+                    <el-button round class="model_add_button " type="primary" size="medium" style="margin-right: 10px;"
+                               @click="submit()">
+                        完成
                     </el-button>
-                    <el-button round class="model_add_button " type="danger" size="medium" style="margin-right: 10px;" @click="return_page()">返回
+                    <el-button round class="model_add_button " type="danger" size="medium" style="margin-right: 10px;"
+                               @click="return_page()">返回
                     </el-button>
                 </div>
-          </el-main>
+            </el-main>
         </el-container>
 
 
-
-  </div>
+    </div>
 </template>
 
 <script>
 
 import {
-  fieldTemplateLists, cooperatorAdd
+    fieldTemplateLists, cooperatorAdd
 } 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,
-      currentPage: 1,
-      // cooperatorName : this.$route.query.cooperatorName,
-      cooperatorName : "",
-      corpCertificateNum : "",
-      fieldCount : "",
-      modelCount : "",
-      createTime : "",
-      cooperatorData : [],
-      selected1: true,
-      selected2: false,
-      selected3: false,
-      selected4: true,
-      selected5: true,
-      selected6: false,
-      input:'',
-      isCollapse: false,
-
-      cooperatorField : [],
-      cooperatorProduct : [],
-      productStatus : "",
-      arr: ["统一社会信用代码", "组织机构代码" ],
-      type_list: [
-        {
-          key: 1,
-          label: "统一社会信用代码"
-        },
-        {
-          key: 2,
-          label: "组织机构代码"
+    name: "cooperatorInfo",
+    props: [],
+    components: {},
+    data() {
+        return {
+            activeKey: 0,
+            activeName: "third",
+            activeKey: 1,
+            currentPage: 1,
+            // cooperatorName : this.$route.query.cooperatorName,
+            cooperatorName: "",
+            corpCertificateNum: "",
+            fieldCount: "",
+            modelCount: "",
+            createTime: "",
+            cooperatorData: [],
+            selected1: true,
+            selected2: false,
+            selected3: false,
+            selected4: true,
+            selected5: true,
+            selected6: false,
+            input: '',
+            isCollapse: false,
+
+            cooperatorField: [],
+            cooperatorProduct: [],
+            productStatus: "",
+            arr: ["统一社会信用代码", "组织机构代码"],
+            type_list: [
+                {
+                    key: 1,
+                    label: "统一社会信用代码"
+                },
+                {
+                    key: 2,
+                    label: "组织机构代码"
+                }
+            ],
+            cooperator_name: "",
+            corp_certificate_num: "",
+            corp_certificate_type_name: "",
+            corp_certificate_type: "",
+            fieldTemplateList: "",
+            fieldTemplateId: "",
+            fieldTemplateNo: ""
+
         }
-      ],
-      cooperator_name : "",
-      corp_certificate_num : "",
-      corp_certificate_type_name : "",
-      corp_certificate_type : "",
-      fieldTemplateList : "",
-      fieldTemplateId : "",
-      fieldTemplateNo : ""
-
-    }
-  },
-  watch: {},
-  computed: {},
-  beforeCreate() {},
-  created() {},
-  beforeMount() {},
-  mounted() 
-  {
-    fieldTemplateLists().then(
-      res=>
-      {
-        this.fieldTemplateList=res.data.field_template_list;
-        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');
+    beforeMount() {
     },
-    gotolinkCooperator()
-    {
-      this.$router.replace('/cooperatorInfo');
+    mounted() {
+        fieldTemplateLists().then(
+            res => {
+                this.fieldTemplateList = res.data.field_template_list;
+                console.log(this.fieldTemplateList)
+            }
+        )
     },
-
-    gotolinkField()
-    {
-      this.$router.replace('/fieldInfo');
+    beforeUpdate() {
     },
-    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;
+    updated() {
     },
-    gotolink3()
-    {
-      //指定跳转地址
-      this.$router.replace('/cooperatorInfo');
-      this.selected1 = true;
-      this.selected2 = false;
-      this.selected3 = true;
-      this.selected4 = false;
-      this.selected5 = false;
-      this.selected6 = true;
+    destroyed() {
     },
-    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: {
-          
-        }
-      })
-    },
-    submit (){
-        if(this.corp_certificate_type_name == "统一社会信用代码")
-          this.corp_certificate_type = "20"
-        else
-          this.corp_certificate_type =  "30"
-      console.log(this.fieldTemplateId)
-
-      if(this.cooperator_name=="")
-      {
-        this.$alert("请输入合作方名称");
-        return;
-      }
-      if(this.corpCertificateNum=="")
-      {
-        this.$alert("请输入证件号码");
-        return;
-      }
-      if(this.corp_certificate_type=="")
-      {
-        this.$alert("请选择证件类型");
-        return;
-      }
-      if(this.fieldTemplateId=="")
-      {
-        this.$alert("请选择所属字段表");
-        return;
-      }
-      this.$message({
-        message: '新增成功',
-        type: 'success'
-      });
-
-        cooperatorAdd(this.cooperator_name, this.corpCertificateNum, 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('/cooperatorInfo');
+            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: '/cooperatorInfo',
+                query: {}
             })
-          },
-        ),
-        console.log('111')
-    },
+        },
+        submit() {
+            if (this.corp_certificate_type_name == "统一社会信用代码")
+                this.corp_certificate_type = "20"
+            else
+                this.corp_certificate_type = "30"
+            console.log(this.fieldTemplateId)
 
-  },
-  fillter: {},
+            if (this.cooperator_name == "") {
+                this.$alert("请输入合作方名称");
+                return;
+            }
+            if (this.corpCertificateNum == "") {
+                this.$alert("请输入证件号码");
+                return;
+            }
+            if (this.corp_certificate_type == "") {
+                this.$alert("请选择证件类型");
+                return;
+            }
+            if (this.fieldTemplateId == "") {
+                this.$alert("请选择所属字段表");
+                return;
+            }
+
+
+            cooperatorAdd(this.cooperator_name, this.corpCertificateNum, this.corp_certificate_type, this.fieldTemplateId).then(
+                res => {
+                    this.$message({
+                        message: '新增成功',
+                        type: 'success'
+                    });
+                    this.$router.push({
+                        path: '/cooperatorInfo',
+                        query: {}
+                    })
+                },
+            ),
+                console.log('111')
+        },
+
+    },
+    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;
@@ -310,13 +304,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;
@@ -324,45 +318,53 @@ export default {
     text-decoration: none;
     display: inline-block;
     font-size: 18px;
-    width:180px;
-    height:50px;
+    width: 180px;
+    height: 50px;
     font-weight: 900
 }
-.el-menu-vertical-demo{
-  font-weight: bold;
+
+.el-menu-vertical-demo {
+    font-weight: bold;
 }
+
 .upper_bottom_bar {
     display: flex;
 }
+
 .line-between-divs {
     border-bottom: 1px solid #ccc; /* 设置横线的样式,颜色可以根据需要调整 */
-  }
-.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-divider--vertical {
-  height: 47em;
-  margin-left: 20px;
+    height: 47em;
+    margin-left: 20px;
 }
-.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>

Dosya farkı çok büyük olduğundan ihmal edildi
+ 484 - 467
src/views/system/cooperatorProductApply.vue


Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor