Prechádzať zdrojové kódy

项目立项申请bug修改完成

yuanyiming 2 rokov pred
rodič
commit
7973dcd4e0

+ 11 - 11
src/views/projectApply/projectApplication.vue

@@ -375,7 +375,7 @@
           this.iid=val   //将要删除的id进行存储供删除对话框使用
           if (val.isupload==0) {
             this.dialogVisible=true;
-            console.log(val);
+            // console.log(val);
             this.auditDialog.projectName=val.title;
             this.auditDialog.person=val.pro_leader;
             this.auditDialog.department=val.name;
@@ -389,7 +389,7 @@
           
         },
         commit(){    //立项审核对话框里面的确定提交按钮
-          console.log(this.iid);
+          // console.log(this.iid);
             let param={
               uid:this.$store.state.userInfo.userid,
               pid:this.iid.courseId
@@ -397,7 +397,7 @@
             this.ajax
                 .post(this.$store.state.api+"/ApproveProject",param)
                 .then(res=>{
-                    console.log(res);
+                    // console.log(res);
                     this.dialogVisible=false;
                     this.$message.success('提交成功')
                     this.getData()
@@ -409,16 +409,16 @@
         commit2(val){   //立项撤回对话框里面的确定撤回按钮
           this.dialogVisible1=false;
           this.status--
-          console.log(this.status);
+          // console.log(this.status);
         },
 
         handleSelectionChange(val) {   //批量选择功能后续可能用到 
-          console.log(val);
+          // console.log(val);
           this.multipleSelection = val;
         },
        
         lookDetail(val){    //查看详情按钮
-          console.log(val);
+          // console.log(val);
           localStorage.setItem("pid",JSON.stringify(val))
           this.$router.push('/projectApplicationDetails')
         },
@@ -437,11 +437,11 @@
             lim:this.table.packageSize  //限制获取几页
           }
           // return console.log(param);
-          console.log(param)
+          // console.log(param)
           this.ajax    
             .get(this.$store.state.api+'/SelectAllProject',param)
               .then(res=>{
-                console.log(res.data);
+                // console.log(res.data);
                 let data=res.data;
                 let a=this.options;
                 this.tableData=data[0];
@@ -455,12 +455,12 @@
               })  
         },
         del(val) {   //表格删除按钮,点击显示删除对话框
-          console.log(val);
+          // console.log(val);
           this.dialogVisible2=true
           this.iid=val   //将要删除的id进行存储供删除对话框使用
         },
         dialogDel(){   //确定删除这个项目
-          console.log(this.iid)
+          // console.log(this.iid)
           if (this.iid.userid == this.$store.state.userInfo.userid) {
             let param={
               uid:this.$store.state.userInfo.userid,
@@ -469,7 +469,7 @@
             this.ajax
                 .post(this.$store.state.api+"/DeleteProject",param)
                 .then(res=>{
-                    console.log(res);
+                    // console.log(res);
                     if (res.data) {
                         this.$message.success('删除成功')
                         this.getData()

+ 10 - 11
src/views/projectApply/projectApplication2.vue

@@ -18,7 +18,7 @@
 
       <div class="PA2textArea">
         <div class="PA2textAreaTit">项目创新点</div>
-        <vue-editor  :editorToolbar="customToolbar" v-model="data[0][0]"></vue-editor>
+        <vue-editor  :editorToolbar="customToolbar" v-model="data[0]"></vue-editor>
       </div>
 
       <div class="PA2mid">
@@ -26,22 +26,22 @@
       </div>
       <div class="PA2textArea">
         <div class="PA2textAreaTit PA2textAreaTit2">一、项目预期成果、数量及形式</div>
-        <vue-editor  :editorToolbar="customToolbar" v-model="data[0][1]"></vue-editor>
+        <vue-editor  :editorToolbar="customToolbar" v-model="data[1]"></vue-editor>
         
       </div>
       <div class="PA2textArea">
         <div class="PA2textAreaTit PA2textAreaTit2">二、创客人才培养预期成果、数量</div>
-        <vue-editor  :editorToolbar="customToolbar" v-model="data[0][2]"></vue-editor>
+        <vue-editor  :editorToolbar="customToolbar" v-model="data[2]"></vue-editor>
        
       </div>
       <div class="PA2textArea">
         <div class="PA2textAreaTit PA2textAreaTit2">三、项目预期孵化、转化创业项目情况</div>
-        <vue-editor  :editorToolbar="customToolbar" v-model="data[0][3]"></vue-editor>
+        <vue-editor  :editorToolbar="customToolbar" v-model="data[3]"></vue-editor>
         
       </div>
       <div class="PA2textArea">
         <div class="PA2textAreaTit">项目实施计划</div>
-        <vue-editor  :editorToolbar="customToolbar" v-model="data[0][4]"></vue-editor>
+        <vue-editor  :editorToolbar="customToolbar" v-model="data[4]"></vue-editor>
         
       </div>
       <div class="baseBtn">
@@ -55,7 +55,6 @@
           :visible.sync="submitHint"
           width="600px"
           class="projectApplicationfundAddDialog"
-          style="top: 120px;"
           :before-close="init">
           <div class="addDialogLogo">LOGO</div>
           <div class="deleteContent">确定修改项目基本信息?</div>
@@ -115,7 +114,6 @@ import { VueEditor } from "vue2-editor";
           },
           init(){
             this.submitHint=false
-
           },
           getData(){   //初始化完成获取基本数据进行填充
             let param={
@@ -125,15 +123,16 @@ import { VueEditor } from "vue2-editor";
               this.ajax
                     .get(this.$store.state.api+'/GetProjectDetailMessage',param)
                     .then(res=>{
-                      let data=JSON.parse(res.data[0][0].chapters)
-                      console.log(data)
-                      this.data=data
+                      let GetData=JSON.parse(res.data[0][0].chapters)
+                      // console.log(GetData)
+                      this.data=GetData
+                      // console.log(this.data);
                     },err=>{
                       console.log(err);
                     })
           },
         },
-        created(){
+        mounted(){
           this.getData();
         }
       }

+ 42 - 20
src/views/projectApply/projectApplicationApply.vue

@@ -52,8 +52,10 @@
                           </div>
                           <div class="inpBlock">
                               <div class="label">联系电话</div>
-                              <el-input type="number" v-model="data.select.tel" placeholder="请输入内容"></el-input>
+                              <el-input type="number" v-model="data.select.tel"  @blur="getText(data.select.tel)" placeholder="请输入联系方式"></el-input>
                           </div>
+                          <!-- <div v-if="!isPhoneValid" class="error-message">电话号码格式不正确</div> -->
+
                       </div>
 
                       <div class="selectRight">
@@ -63,13 +65,13 @@
                                 v-model="data.select.value1"
                                 type="datetime"
                                 style="width: 100%;"
-                                value-format="yyyy-MM-DD HH:mm:ss"
+                                value-format="yyyy-MM-dd HH:mm:ss"
                                 placeholder="选择日期">
                               </el-date-picker>
                           </div>
                           <div class="inpBlock" style="position: relative;">
                               <div class="label">预算总经费</div>
-                              <el-input type="number" onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))" v-model="data.select.fund" placeholder="请输入内容"></el-input>
+                              <el-input type="number" v-model="data.select.fund" placeholder="请输入内容"></el-input>
                               <div style="position: absolute;right: -30px;top: 10px;">(万)</div>
                           </div>
                           <div class="inpBlock">
@@ -200,7 +202,7 @@
             <div class="littleBlock">
               <div class="dialogLabel">电话</div>
               <div>
-                <el-input type="number" onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))" v-model="data.Member.phone"></el-input>
+                <el-input type="number" v-model="data.Member.phone" @blur="getText(data.Member.phone)" ></el-input>
               </div>
             </div>
             <div slot="footer" class="footer">
@@ -213,7 +215,7 @@
       <!--修改成员dialog对话框开始 -->
       <el-dialog
           title="修改成员"
-          :visible.sync="amendMemberDialog"
+          :visible.sync="data.amendMemberDialog"
           :modal="true"
           :close-on-click-modal="true"
           class="AddMember"
@@ -236,7 +238,7 @@
             <div class="littleBlock">
               <div class="dialogLabel">电话</div>
               <div>
-                <el-input type="number" onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))" v-model="data.Member2.phone"></el-input>
+                <el-input type="number" v-model="data.Member2.phone" @blur="getText(data.Member2.phone)" ></el-input>
               </div>
             </div>
             <div slot="footer" class="footer">
@@ -259,9 +261,6 @@
               </span>
             </el-dialog>
       <!-- 删除成员对话框结束 -->
-
-
-
     </div>
   
 </template>
@@ -272,6 +271,7 @@
       props:["data","next",'back','addPerson','amend'],
       data() {
         return {
+          telVerify:'',
           input:"",
           addMemberDialog:false,
           amendMemberDialog:false,
@@ -279,19 +279,45 @@
           rowData:''
         }
       },
+      
       methods:{
+
+        getText(value) {     //电话验证
+          // console.log(value);
+          // let text = document.getElementById(inputId).value; //获取输入框的ID 存放到text变量中
+          let verify = /^(?:(?:\+|00)86)?1(?:(?:3[\d])|(?:4[5-79])|(?:5[0-35-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\d])|(?:9[189]))\d{8}$/; //获取正则表达式 存放到verify变量中
+          let result = verify.test(value.trim()); //判断输入框内容是否符合 正则表达式
+          // if(!result && value != "") {
+          if(!result) {
+            if (value == this.data.select.tel) {
+                this.$message.error('请输入正确联系号码格式')
+                return  this.data.telVerify=false;
+            }
+            if (value == this.data.Member.phone || value == this.data.Member2.phone) {
+              return  this.data.telVerify2=false;
+            }
+          }else{
+            if (value == this.data.select.tel) {
+                return  this.data.telVerify=true;
+            }
+            if (value == this.data.Member.phone || value == this.data.Member2.phone) {
+              return  this.data.telVerify2=true;
+            }
+          }
+        },
+        
         init(){
           this.addMemberDialog=false;
-          this.amendMemberDialog=false
+          this.data.amendMemberDialog=false
           this.delMember=false
 
         },
         addMember(){   //添加项目成员
           this.addMemberDialog=true
-          this.data.Member={}
+          this.data.Member={}   //点开立即清除上次数据
         },
         amendDialogData(val){   //修改项目成员信息对话框显示
-          this.amendMemberDialog=true
+          this.data.amendMemberDialog=true
           Object.assign(this.data.Member2,val)
           // console.log(this.data.Member2);
         },
@@ -303,15 +329,14 @@
             this.next();
         },
         commit(){   //确定添加成员  
-              if (this.data.Member.name == undefined) return this.$message.error('请输入姓名')
-              if (this.data.Member.class == undefined) return this.$message.error('请输入班级')
-              if (this.data.Member.phone == undefined) return this.$message.error('请输入电话')   
+              if (this.data.Member.name =="" ||this.data.Member.name==undefined) return this.$message.error('请输入姓名')
+              if (this.data.Member.class=="" ||this.data.Member.class==undefined) return this.$message.error('请输入班级')
+              if (!this.data.telVerify2) return this.$message.error('请输入正确联系号码格式')
               this.addPerson();
               this.init()
         },
         commit2(){   //确定修改成员
             this.amend(this.rowData)
-            this.init()
         },
         commitDelMember(){   //对话框确定删除成员
           let a=this.rowData
@@ -340,10 +365,7 @@
             }
         }
       },
-      
-      created(){
-        // this.value=(this.options[0].value)
-      },
+
       mounted(){
         // console.log(this.data)
         

+ 24 - 20
src/views/projectApply/projectApplicationApplyMain.vue

@@ -33,7 +33,6 @@
           :visible.sync="submitHint"
           width="600px"
           class="projectApplicationfundAddDialog"
-          style="top: 120px;"
           :before-close="init">
           <div class="addDialogLogo">LOGO</div>
           <div class="deleteContent">确定提交“×××”项目立项?</div>
@@ -57,9 +56,12 @@
         components:{projectApplicationApply,projectApplicationApply2,projectApplicationApply3},
         data() {
           return {
-            status:0,
-            submitHint:false,
+            status:0,   //判断顶部导航跳转
+            submitHint:false,   //提交按钮
             projectApplicationApply1:{   //立项基础信息页面
+              amendMemberDialog:false,  //修改人员对话框显示判断
+                telVerify:'',
+                telVerify2:'',  //添加修改成员电话判断
                 select:{    //基本信息数据框
                   projectName:'', 
                   person:'',
@@ -75,9 +77,9 @@
                 textarea:'',   //项目简介
                 Member:{    //添加成员
                     id:'',
-                    name:'23',
-                    class:'23',
-                    phone:'23',
+                    name:'',
+                    class:'',
+                    phone:'',
                     score:'0'
                 },
                 Member2:{    //修改成员
@@ -154,13 +156,25 @@
             },
             addPerson(){  //立项基础信息页面添加人员
               let a=this.projectApplicationApply1
-
               a.addMemberDialog=false;
               a.Member.id=uuid.v1()
               a.tableData.push(a.Member);
               this.$message.success('添加成功')
               a.Member={}
             },
+
+            amend(val){      //立项基础信息页面修改人员信息
+              let a=this.projectApplicationApply1
+              if (!a.telVerify2) return this.$message.error('请输入正确联系号码格式')
+              //  console.log(a.Member2);
+               a.tableData.forEach((e,i)=>{
+                    if(e.id==a.Member2.id) {
+                      Object.assign(e,a.Member2)
+                      this.$message.success('修改成功')
+                      a.amendMemberDialog=false;
+                    }
+               })
+            },
             getProjectDepartmentData(){  //获取项目立项申请基础信息页面所在部门数据
               let param={
                 uid:this.$store.state.userInfo.userid
@@ -193,18 +207,6 @@
                         console.log(err);
                       })
             },
-           
-            amend(val){      //立项基础信息页面修改人员信息
-              let a=this.projectApplicationApply1
-               
-              //  console.log(a.Member2);
-               a.tableData.forEach((e,i)=>{
-                    if(e.id==a.Member2.id) {
-                      Object.assign(e,a.Member2)
-                      this.$message.success('修改成功')
-                    }
-               })
-            },
             //立项基础信息页面删除功能在它自己页面人员信息
 
 
@@ -259,9 +261,10 @@
               if(a.select.value=='') return this.$message.error('请选择所在部门')
               if(a.select.fund=='') return this.$message.error('请输入预算总经费')
               if(a.select.tel=='') return this.$message.error('请输入联系电话')
+              if(!a.telVerify) return this.$message.error('请输入正确联系电话格式')
+
               if(a.select.sort=='') return this.$message.error('请选择分类')
               if(a.textarea=='') return this.$message.error('请输入项目简介')
-
               if(b.contentOne=='') return this.$message.error('请输入项目创新点')
               if(b.contentTwo=='') return this.$message.error('请输入预期取得成果')
               if(b.contentThree=='') return this.$message.error('请输入预期取得成果')
@@ -381,6 +384,7 @@
     }
     .el-dialog{
       border-radius:10px ;
+      top: 10%;
     }
     
     .deleteContent{

+ 3 - 7
src/views/projectApply/projectApplicationDetails.vue

@@ -52,9 +52,9 @@
                         <div class="label">项目开始时间</div>
                         <el-date-picker
                           v-model="select.Date"
-                          type="date"
+                          type="datetime"
                           style="width: 100%;"
-                          value-format="yyyy-MM-DD HH:mm:ss"
+                          value-format="yyyy-MM-dd HH:mm:ss"
                           placeholder="选择日期">
                         </el-date-picker>
                     </div>
@@ -419,19 +419,15 @@
             this.ajax
                   .get(this.$store.state.api+'/GetProjectBase',param)
                   .then(res=>{
-                    console.log(res);
+                    // console.log(res);
                     let data=res.data[0][0]
-                    // console.log(data);
                     this.select.project=data.title;
                     this.select.Fund=data.money;
                     this.select.person=data.pro_leader;
                     this.select.Date=data.begintime;
-                    // this.select.department=da.
                     this.textarea=data.brief;
                     this.tableData=JSON.parse(data.course_student) 
                     this.select.tel=data.phone;
-                    // this.select.department=data.typeid;
-                    // this.select.sort=data.courseId
                     this.select.departmentData = data['classid']
                     this.select.sort = data['typeid']
                   },err=>{