Просмотр исходного кода

Merge branch 'master' of https://git.cocorobo.cn/CocoRoboLabs/ssti-CollegeManage

Q-ABAB 2 лет назад
Родитель
Сommit
a2a84b2252

+ 10 - 9
src/views/activityManage/makerActvityApply.vue

@@ -277,25 +277,26 @@
             });
             this.isAddTeacher = true;
           },
-          change(){
-            if(this.isAddTeacher)return this.$message.error("错误");
-            for(let a in this.Member)if(/^\s*$/g.test(this.Member[a]))return this.$message.error("请不要留空")
-            Object.assign(this.data.select.teacher[this.Member.index],this.Member)
-            for(let i in this.Member)this.Member[i]='';
-            this.addMemberDialog = false;
-            this.isAddTeacher = true;
-          },
+          
           handleClose(){
             for(let i in this.Member)this.Member[i] = '';
             this.addMemberDialog=false;
             this.isAddTeacher = true;
           },
-          updateTeacher(index){
+          updateTeacher(index){    //显示修改对话框
             Object.assign(this.Member,this.data.select.teacher[index]);
             this.Member['index'] = index;
             this.isAddTeacher = false;
             this.addMemberDialog = true;
           },
+          change(){  //成员信息确定修改
+            if(this.isAddTeacher)return this.$message.error("错误");
+            for(let a in this.Member)if(/^\s*$/g.test(this.Member[a]))return this.$message.error("请不要留空")
+            Object.assign(this.data.select.teacher[this.Member.index],this.Member)
+            for(let i in this.Member)this.Member[i]='';
+            this.addMemberDialog = false;
+            this.isAddTeacher = true;
+          },
           deleteRow(index){
             this.delTeacherTable = this.data.select.teacher[index];
             this.delTeacherTable["index"] = index;

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

@@ -442,7 +442,7 @@
           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];

+ 54 - 99
src/views/projectApply/projectApplicationApply.vue

@@ -95,21 +95,8 @@
           <div style="height: 260px;">
               <div id="two" class="tabTit">
                 <div><p>封面上传</p></div>
-                <!-- <el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传封面</el-button> -->
               </div>
               <hr>
-              <!-- <BeUpload @getFile="getFile" class="uploadPic" :navName="'上传封面'" :accept="accept"></BeUpload> -->
-
-              <!-- <el-upload
-                action="#"
-                list-type="picture-card"
-                :on-preview="handlePictureCardPreview"
-                :on-remove="handleRemove">
-                <i class="el-icon-plus"></i>
-              </el-upload>
-              <el-dialog :visible.sync="dialogVisible">
-                <img width="100%" :src="data.dialogImageUrl" alt="">
-              </el-dialog> -->
               <div style="margin-bottom: 10px;">项目封面</div>
               <el-upload
                 class="avatar-uploader"
@@ -122,17 +109,6 @@
                 <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                 <BeUpload style="position: absolute;width: 301px;height: 180px; opacity: 0;z-index: 333;left: 0;top: 0;" @getFile="getFile" class="uploadPic" :navName="'上传封面'" :accept="accept"></BeUpload>
               </el-upload>
-
-              <!-- <el-upload
-                class="upload-demo"
-                action="#"
-                :on-preview="handlePreview"
-                :on-remove="handleRemove"
-                :file-list="data.fileList"
-                :multiple="false"
-                style="width: 40%;margin-top: -25px;"
-                list-type="picture">
-              </el-upload> -->
             </div>
 
           <!-- 项目封面上传开始结束 -->
@@ -184,8 +160,8 @@
                   <template #default="scope">
                       <div class="operations">
                           <!-- <el-button type="primary" > -->
-                              <el-button type="primary" @click="amendDialogData(scope.row)" size="mini">修改</el-button>
-                              <el-button type="primary" @click="Del(scope.row)" size="mini">删除</el-button>
+                              <el-button type="primary" @click="amendDialogData(scope.$index)" size="mini">修改</el-button>
+                              <el-button type="primary" @click="Del(scope.$index)" size="mini">删除</el-button>
                           <!-- </el-button> -->
                       </div>
                   </template>
@@ -224,7 +200,7 @@
 
       <!--添加成员dialog对话框开始 -->
       <el-dialog
-          title="添加成员"
+          :title= "isAddMember==1?'添加成员':'修改成员'"
           :visible.sync="addMemberDialog"
           :modal="true"
           :close-on-click-modal="true"
@@ -251,47 +227,13 @@
               </div>
             </div>
             <div slot="footer" class="footer">
-              <el-button type="primary" @click="commit" class="diaBtn" >确认提交</el-button>
-              <el-button @click="init" class="diaBtn">取消</el-button>
-            </div>
-      </el-dialog>
-      <!--添加成员dialog对话框结束 -->
-
-      <!--修改成员dialog对话框开始 -->
-      <el-dialog
-          title="修改成员"
-          :visible.sync="data.amendMemberDialog"
-          :modal="true"
-          :close-on-click-modal="true"
-          class="AddMember"
-          :before-close="init">
+              <el-button v-show="isAddMember==1" type="primary" @click="commit" class="diaBtn" >确认提交</el-button>
+              <el-button v-show="isAddMember==2" type="primary" @click="commit2" class="diaBtn" >确认修改</el-button>
 
-            <div class="littleBlock">
-              <div class="dialogLabel">姓名</div>
-              <div>
-                <el-input v-model="data.Member2.name"></el-input>
-              </div>
-            </div>
-
-            <div class="littleBlock">
-              <div class="dialogLabel">班级</div>
-              <div>
-                <el-input v-model="data.Member2.class"></el-input>
-              </div>
-            </div>
-
-            <div class="littleBlock">
-              <div class="dialogLabel">电话</div>
-              <div>
-                <el-input type="number" class="inputNumber" v-model="data.Member2.phone" @blur="getText(data.Member2.phone)" ></el-input>
-              </div>
-            </div>
-            <div slot="footer" class="footer">
-              <el-button type="primary" @click="commit2" class="diaBtn" >确认提交</el-button>
               <el-button @click="init" class="diaBtn">取消</el-button>
             </div>
       </el-dialog>
-      <!--修改成员dialog对话框结束 -->
+      <!--添加成员dialog对话框结束 -->
 
       <!-- 删除成员对话框开始 -->
             <el-dialog
@@ -313,7 +255,7 @@
 <script>
     import BeUpload from "../../components/tool/beUpload.vue";
     export default { 
-      props:["data","next",'back','addPerson','amend'],
+      props:["data","next",'back','addPerson'],
       components: {
         BeUpload,
       },
@@ -321,24 +263,20 @@
         return {
           // dialogImageUrl: '',
           accept:"*",
+          isAddMember:1,
           // fileList: [],
           dialogVisible: false,
           addMemberDialog:false,
-          amendMemberDialog:false,
+          // amendMemberDialog:false,
           delMember:false,
-          rowData:''
+          index:''
         }
       },
       
       methods:{
         getFile(val) {       //上传封面
             console.log(val);
-            // let data=[{
-            //   name:val.fileName,
-            //   url:val.url
-            // }]
             this.data.dialogImageUrl=val.url
-            // console.log(this.data.fileList);
         },
         // submitUpload() {
         //   this.$refs.upload.submit();
@@ -362,7 +300,6 @@
                 return  this.data.telVerify=false;
             }
             if (value == this.data.Member.phone || value == this.data.Member2.phone) {
-              // console.log(222);
               return  this.data.telVerify2=false;
             }
           }else{
@@ -370,7 +307,6 @@
                  this.data.telVerify=true;
             }
             if (value == this.data.Member.phone || value == this.data.Member2.phone) {
-              // console.log(111);
               return  this.data.telVerify2=true;
             }
           }
@@ -378,7 +314,7 @@
         
         init(){
           this.addMemberDialog=false;
-          this.data.amendMemberDialog=false
+          // this.data.amendMemberDialog=false
           this.delMember=false
 
         },
@@ -388,12 +324,40 @@
             if(i=='score')this.data.Member[i] = "0"
             else this.data.Member[i] = "";
           }
-          // this.data.Member={}   //点开立即清除上次数据
+          this.isAddMember=1;
         },
         amendDialogData(val){   //修改项目成员信息对话框显示
-          this.data.amendMemberDialog=true
-          Object.assign(this.data.Member2,val)
-          // console.log(this.data.Member2);
+          Object.assign(this.data.Member,this.data.tableData[val])
+          this.isAddMember=2;
+          this.data.Member['index']=val
+          // console.log(this.data.Member['index']);
+          this.addMemberDialog=true
+        },
+        commit2(){   //确定修改成员
+              if (!this.data.telVerify2) return this.$message.error('请输入正确联系号码格式')
+              Object.assign(this.data.tableData[this.data.Member['index']],this.data.Member)
+              for(let k in this.data.Member) this.data.Member[k]=''
+              this.addMemberDialog=false;
+              this.$message.success('修改成功')
+
+              console.log(this.data.tableData);
+        },
+        Del(val){    //删除对话框显示
+          this.delMember=true;
+          this.index=val
+        },
+        commitDelMember(){   //对话框确定删除成员
+          let a=this.index;
+          this.data.tableData.splice(a,1);
+          this.$message.success('删除成功');
+          this.delMember=false;
+          // this.data.tableData.forEach((item, index, arr)=> {
+          //     if(item.id === a) {
+          //         arr.splice(index, 1);
+          //         this.$message.success('删除成功')
+          //         this.init()
+          //     }
+          // });
         },
         backBtn1(){  // 上一步
           this.$router.push('/projectApplication')
@@ -406,28 +370,19 @@
               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)
-        },
-        commitDelMember(){   //对话框确定删除成员
-          let a=this.rowData
-          // let _this = this
-          this.data.tableData.forEach((item, index, arr)=> {
-              if(item.id === a) {
-                  arr.splice(index, 1);
-                  this.$message.success('删除成功')
-                  this.init()
+              // this.addPerson();
+              let newData = {};
+              for(let j in this.data.Member)newData[j] = this.data.Member[j];
+              this.data.tableData.push(newData);
+              this.$message.success('添加成功')
+              for(let i in this.data.Member){      
+                if(i=='score')this.data.Member[i] = "0"
+                else this.data.Member[i] = "";
               }
-          });
-        },
-        Del(val){
-          this.delMember=true;
-          this.rowData=val.id
+              console.log(this.data.tableData)
+              this.init()
         },
+       
         toPage(val){
             if (val==1) {
               document.getElementById("one").scrollIntoView({ behavior: "smooth" });

+ 103 - 92
src/views/projectApply/projectApplicationApply3.vue

@@ -103,8 +103,8 @@
                   >
                   <template #default="scope">
                       <div class="operations">
-                              <el-button type="primary" @click="amendDialogData(scope.row)" size="mini">修改</el-button>
-                              <el-button type="primary" @click="del(scope.row)"  size="mini">删除</el-button>
+                              <el-button type="primary" @click="amendDialogData(scope.$index)" size="mini">修改</el-button>
+                              <el-button type="primary" @click="del(scope.$index)"  size="mini">删除</el-button>
                       </div>
                   </template>
               </el-table-column>
@@ -127,11 +127,10 @@
       :visible.sync="addFundDialog"
       width="950px"
       class="fundDetail"
-      :before-close="this.init">
+      :before-close="init">
 
       <div class="dialogTop">
           <div class="dagSpan">项目名称</div>
-          <!-- <el-input v-model="data2.projectName" disabled placeholder="请输入内容"></el-input> -->
           <el-select v-model="data2.select.projectName" disabled style="width: 100%;" placeholder="请选择">
             <el-option
               v-for="item in data2.options"
@@ -143,7 +142,6 @@
       </div>
       <div class="dialogTop">
           <div class="dagSpan">项目类型</div>
-          <!-- <el-input v-model="data2.tel" disabled style="width: 30%;" placeholder="请输入内容"></el-input> -->
           <el-select v-model="data2.select.sort"  disabled style="width: 30%;" placeholder="请选择">
             <el-option
               v-for="item in data2.sortOptions"
@@ -174,7 +172,7 @@
       </div>
 
       <div class="dagInpS1">
-          <div class="dagSpan" style="position:relative;top: -100px;">备注</div>
+          <div class="dagSpan" style="position:relative;top: -90px;">备注</div>
           <el-input
             type="textarea"
             :rows="5"
@@ -294,7 +292,7 @@
 
       <!-- 删除成员对话框开始 -->
       <el-dialog
-              title="删除经费明细"
+              title="删除"
               :visible.sync="delFundDetail"
               width="600px"
               class="delMemberDialog">
@@ -313,17 +311,17 @@
 import { VueEditor } from "vue2-editor";
     export default {
       // 接收父组件传递回来的方法
-      props:["data","next",'back','submitBtn','addFundDetail','data2','confirmSetFund'],
+      props:["data","next",'back','submitBtn','data2','confirmSetFund'],
       components:{
         VueEditor
       },
       data() {
         return {
-          iid:[],
+          iid:'',
           delFundDetail:false,   //删除经费明细对话框
           addFundDialog:false,       //经费明细对话框
-          setFund:false,        
-          recompose:0,             //判断是否是修改
+          setFund:false,         //设置月支出计划
+          recompose:0,             //判断是否是修改  0 修改  1 添加
           projectFundDetailInput:{
                 fund:'',
                 type:'',
@@ -356,61 +354,83 @@ import { VueEditor } from "vue2-editor";
           this.setFund=false;
           this.delFundDetail=false;
         },
+        
+        backBtn1(){    //上一步
+          this.back();
+        },
+        submit(){    //提交按钮
+          this.submitBtn();
+        },
+        addBtn(){    //经费明细添加对话框显示
+          this.addFundDialog=true;
+        },
+        amendDialogData(val){   //修改经费明细数据对话框显示
+          this.recompose=1   
+          Object.assign(this.data.dialog,this.data.tableData2[val])
+          this.data.dialog['index']=val
+          this.addFundDialog=true;      
+          // this.data.dialog=val
+          // this.iid=val
+        },
         finish(){    //添加经费明细对话框完成按钮
-            if(this.recompose){
-              console.log('修改');
-                  this.data.tableData2.forEach((e,i,arr) => {
-                      if (e.id == this.iid.id) {
-                        if(this.data2.select.fund == '' || this.data2.select.fund==undefined )return this.$message.error('请输入项目预算总经费')
-                        if (this.data.dialog.type=="" || this.data2.select.fund==undefined ) return this.$message.error('请输入支类别')
-                        if (this.data.dialog.disburseProject=="" || this.data2.select.fund==undefined ) return this.$message.error('请输入支出项目')
-                        if (this.data.dialog.fund=="" || this.data2.select.fund==undefined ) return this.$message.error('请输入金额')
-
-                        let oldMoney = this.data.tableData2.reduce((prev,cur)=>{   //默认第一次为0,
-                          console.log(prev,cur["fund"]);
-                          return prev+cur["fund"]
-                        },0);  //默认值第一次运算为0
-                        // console.log(oldMoney);     第一次0  
-                        oldMoney+=this.data.dialog.fund;   //因为本次的数据还未添加到列表中,所以直接在这里进行相加判断
-                        if(oldMoney>(this.data2.select.fund)*10000) return this.$message.error('经费明细超出预算总金额');
-                        arr.splice(i,1,this.data.dialog)
-                        this.data.dialog={}
-                        this.recompose=0   
-                        return this.init()
-                      }
-                  });
-                  return false
-            }
+            if(this.recompose){                //修改
 
+              if (this.data.dialog.type=="" || this.data2.select.fund==undefined ) return this.$message.error('请输入支类别')
+              if (this.data.dialog.disburseProject=="" || this.data2.select.fund==undefined ) return this.$message.error('请输入支出项目')
+              if (this.data.dialog.fund=="" || this.data2.select.fund==undefined ) return this.$message.error('请输入金额')
+              let oldMoney = this.data.tableData2.reduce((prev,cur)=>{   //默认第一次为0,
+                console.log(prev,cur["fund"]);
+                return prev+cur["fund"]
+              },0);  //默认值第一次运算为0
+              // console.log(oldMoney);     第一次0  
+              oldMoney+=this.data.dialog.fund;   //因为本次的数据还未添加到列表中,所以直接在这里进行相加判断
+              if(oldMoney>(this.data2.select.fund)*10000) return this.$message.error('经费明细超出预算总金额');
+              Object.assign(this.data.tableData2[this.data.dialog['index']],this.data.dialog)
+              for(let k in this.data.dialog) this.data.dialog[k]=''
+              return this.addFundDialog=false;
+              
+                  // Object.assign(this.data.dialog,this.data.tableData2[])
+                  // this.data.tableData2.forEach((e,i,arr) => {
+                  //     if (e.id == this.iid.id) {
+                  //       // if(this.data2.select.fund == '' || this.data2.select.fund==undefined )return this.$message.error('请输入项目预算总经费')
+                  //       if (this.data.dialog.type=="" || this.data2.select.fund==undefined ) return this.$message.error('请输入支类别')
+                  //       if (this.data.dialog.disburseProject=="" || this.data2.select.fund==undefined ) return this.$message.error('请输入支出项目')
+                  //       if (this.data.dialog.fund=="" || this.data2.select.fund==undefined ) return this.$message.error('请输入金额')
 
+                  //       
+                  //       arr.splice(i,1,this.data.dialog)
+                  //       this.data.dialog={}
+                  //       this.recompose=0          
+                  //       return this.init()
+                  //     }
+                  // });
+                  // return false
+            }
+            let oldDia={}   //添加数据防止污染
+            // 添加
             if(this.data2.select.fund == '' || this.data2.select.fund==undefined )return this.$message.error('请输入项目预算总经费')
             if (this.data.dialog.type=="" || this.data2.select.fund==undefined ) return this.$message.error('请输入支类别')
             if (this.data.dialog.disburseProject=="" || this.data2.select.fund==undefined ) return this.$message.error('请输入支出项目')
             if (this.data.dialog.fund=="" || this.data2.select.fund==undefined ) return this.$message.error('请输入金额')
 
 
-            // let oldMoney = this.data.tableData2.reduce((prev,cur)=>prev=prev+cur["fund"],0)
             let oldMoney = this.data.tableData2.reduce((prev,cur)=>{   //默认第一次为0,
-              console.log(prev,cur["fund"]);
+              // console.log(prev,cur["fund"]);
               return prev+cur["fund"]
             },0);  //默认值第一次运算为0
-            console.log(oldMoney);
+            // console.log(oldMoney);
 
             oldMoney+=this.data.dialog.fund;   //因为本次的数据还未添加到列表中,所以直接在这里进行相加判断
 
             if(oldMoney>(this.data2.select.fund)*10000)return this.$message.error('经费明细超出预算总金额');
-            this.addFundDetail();
-            this.init();
-          
-        },
-        backBtn1(){    //上一步
-          this.back();
-        },
-        submit(){    //提交按钮
-          this.submitBtn();
-        },
-        addBtn(){    //经费明细添加按钮
-          this.addFundDialog=true;
+            // let p=this.projectApplicationApply3;
+              // p.dialog.id=uuid.v1();
+            // console.log(this.data.dialog);
+            Object.assign(oldDia,this.data.dialog)
+            this.data.tableData2.push(oldDia);
+            for(let k in this.data.dialog) this.data.dialog[k]='';
+            // console.log(this.data.tableData2);
+            this.addFundDialog=false;
         },
         setFundBtn(){    //经费月支出计划设置经费对话框显示
           // console.log(this.data2.value);
@@ -432,25 +452,21 @@ import { VueEditor } from "vue2-editor";
           this.confirmSetFund()
           this.init()
         },
-        amendDialogData(val){   //修改经费明细数据对话框显示
-          this.recompose=1   
-          console.log(val);
-          this.addFundDialog=true;      
-          this.data.dialog=val
-          this.iid=val
-        },
+       
         del(val){                     //删除经费明细对话框显示
           this.delFundDetail=true;
-          console.log(111);
           this.iid=val
         },
-        commitDel(){
-          this.data.tableData2.forEach((e,i,arr)=>{
-                if (e.id == this.iid.id) {
-                    arr.splice(i,1)
-                    this.delFundDetail=false;
-                }
-            })
+        commitDel(){      //确定删除
+          this.data.tableData2.splice(this.iid,1)
+          this.delFundDetail=false;
+
+          // this.data.tableData2.forEach((e,i,arr)=>{
+          //       if (e.id == this.iid.id) {
+          //           arr.splice(i,1)
+          //           this.delFundDetail=false;
+          //       }
+          //   })
         }
       }
     }
@@ -459,17 +475,17 @@ import { VueEditor } from "vue2-editor";
 <style lang="less">
 //对话框样式
 
-  .el-input__inner{
-    color: #000;
-    font-size: 16px;
-  }
-  .el-textarea__inner{
-    color: #000;
-    font-size: 16px;
-  }
-  .el-input.is-disabled .el-input__inner{
-    color: #3a3838;
-  }
+  // .el-input__inner{
+  //   color: #000;
+  //   font-size: 16px;
+  // }
+  // .el-textarea__inner{
+  //   color: #000;
+  //   font-size: 16px;
+  // }
+  // .el-input.is-disabled .el-input__inner{
+  //   color: #3a3838;
+  // }
   .totalFundLabel{
     width:90px;
     line-height: 38px;
@@ -489,6 +505,9 @@ import { VueEditor } from "vue2-editor";
       line-height: 25px;
       margin: 15px 5px 30px;
     }
+
+
+
     .fundDetail{ //经费明细添加对话框,防止冲突
         .el-dialog__title{    
           font-size: 18px;
@@ -531,7 +550,9 @@ import { VueEditor } from "vue2-editor";
           margin-right: 50px;
         }
     }
-    .AddFund{    //添加对话框
+
+
+    .AddFund{    //月支出计划添加对话框
       .el-input__inner{
           width: 100%;
       }
@@ -597,6 +618,8 @@ import { VueEditor } from "vue2-editor";
         }
     }
   }
+
+
   .delMemberDialog{    //删除经费明细对话框样式
             font-size: 18px;
             .el-dialog{
@@ -621,21 +644,9 @@ import { VueEditor } from "vue2-editor";
               display: flex;
               justify-content: center;
             }
-            // .addDialogMid{
-            //   box-sizing: border-box;
-            //   padding:0 60px 0 10px;
-            //   .addDialogTit{
-            //     display: flex;
-            //     span{
-            //       width: 80px;
-            //       font-size: 16px;
-            //       line-height: 40px;
-            //       text-align: left;
-                  
-            //     }
-            //   }
- 
-            // }
+            .el-dialog__body{
+              padding: 0;
+            }
             .dialog-footer{
               display: flex;
               justify-content: center;

+ 7 - 61
src/views/projectApply/projectApplicationApplyMain.vue

@@ -21,9 +21,9 @@
 
       <!--下方内容区开始-->
       <div class="Main_area">
-        <projectApplicationApply :data="projectApplicationApply1" :next="next" :addPerson="addPerson" :amend="amend" :back="back" v-show="status==0"/>
+        <projectApplicationApply :data="projectApplicationApply1" :next="next"  :back="back" v-show="status==0"/>
         <projectApplicationApply2 :data="projectApplicationApply2" :next="next" :back="back" v-show="status==1"/>
-        <projectApplicationApply3 :data="projectApplicationApply3" :confirmSetFund="confirmSetFund" :data2="projectApplicationApply1" :next="next" :addFundDetail="addFundDetail" :back="back" :submitBtn="submitBtn" v-show="status==2"/> 
+        <projectApplicationApply3 :data="projectApplicationApply3" :confirmSetFund="confirmSetFund" :data2="projectApplicationApply1" :next="next" :back="back" :submitBtn="submitBtn" v-show="status==2"/> 
       </div>
       <!--下方内容区结束-->
 
@@ -47,7 +47,7 @@
   
   <script>
   // 引入项目详情三个页面
-  import { uuid } from 'vue-uuid';
+  // import { uuid } from 'vue-uuid';
   import projectApplicationApply from './projectApplicationApply.vue';
   import projectApplicationApply2 from './projectApplicationApply2.vue';
   import projectApplicationApply3 from './projectApplicationApply3.vue';
@@ -77,23 +77,13 @@
                 sortOptions: [], //分类下拉框
                 textarea:'',   //项目简介
                 Member:{    //添加成员
-                    id:'',
-                    name:'',
-                    class:'',
-                    phone:'',
-                    score:'0'
-                },
-                Member2:{    //修改成员
-                    id:'',
                     name:'',
                     class:'',
                     phone:'',
                     score:'0'
                 },
                 tableData:[ //成员列表
-                  
                 ], 
-                // fileList:[]   //封面
             },
             projectApplicationApply2:{  //项目内容页面
                   contentOne:'',
@@ -140,7 +130,7 @@
                 tableData2:[],// 经费明细列表数据
                
                 dialog:{     //经费明细添加对话框
-                  id:'',
+                  // id:'',
                   fund:'',  //金额
                   type:'',  //支出类别
                   disburseProject:'',  //支出项目
@@ -159,32 +149,6 @@
                 if(this.status==0)return;
                 this.status--;
             },
-            addPerson(){  //立项基础信息页面添加人员
-              this.projectApplicationApply1.Member.id=uuid.v1()
-              let newData = {};
-              for(let j in this.projectApplicationApply1.Member)newData[j] = this.projectApplicationApply1.Member[j];
-              this.projectApplicationApply1.tableData.push(newData);
-              this.$message.success('添加成功')
-              for(let i in this.projectApplicationApply1.Member){
-                if(i=='score')this.projectApplicationApply1.Member[i] = "0"
-                else this.projectApplicationApply1.Member[i] = "";
-              }
-              console.log(this.projectApplicationApply1.tableData)
-              // a.Member={}
-            },
-
-            amend(val){      //立项基础信息页面修改人员信息
-              let a=this.projectApplicationApply1
-              if (!a.telVerify2) return this.$message.error('请输入正确联系号码格式')
-               a.tableData.forEach((e,i)=>{
-                    if(e.id==a.Member2.id) {
-                      Object.assign(e,a.Member2)
-                      this.$message.success('修改成功')
-                      console.log(e);
-                      a.amendMemberDialog=false;
-                    }
-               })
-            },
             getProjectDepartmentData(){  //获取项目立项申请基础信息页面所在部门数据
               let param={
                 uid:this.$store.state.userInfo.userid
@@ -228,28 +192,16 @@
             },
             confirmSetFund(){   //预算经费设置经费对话框提交
               let data=this.projectApplicationApply3;
-
-             
               for(let key in data.items){
                 if (data.items[key]=='') {
                   data.items[key]='-'
                 }
               }
-              // data.items2=data.items;   
               // Object.assign(data.items2,data.items)   //如果提交后不用清除数据的话,这句不用写也行的,直接添加data.items
-               Object.assign(data.tableData[0],data.items) 
-              // data.tableData.splice(0,1,data.items)
-             
-
-              // data.items={}   解开就是点击确定后清空
+               Object.assign(data.tableData[0],data.items)              
               },
-            addFundDetail(){    //预算经费页面经费添加按钮
-              let p=this.projectApplicationApply3;
-              p.dialog.id=uuid.v1();
-              p.tableData2.push(p.dialog);
-              p.dialog={};
-            },
-            submitBtn(){   //预算经费页面提交按钮
+
+            submitBtn(){   //预算经费页面提交显示对话框
                 // console.log("提交啦");
                 this.submitHint = true;
             },
@@ -274,10 +226,6 @@
               // if(b.contentThree=='') return this.$message.error('请输入预期取得成果')
               // if(b.contentFour=='') return this.$message.error('请输入预期取得成果')
               // if(b.contentFive=='') return this.$message.error('请输入项目实施计划')
-              
-
-
-
               let d=[]   //按照后端格式传递数据,项目内容,要将经费支出,与项目明细放在一起,
               for(let key in b){
                   d.push(b[key])
@@ -418,8 +366,6 @@
     background: #32455b;
     }
     .el-dialog__title{
-      // text-align: center;
-      margin-left:250px;
       font-size: 18px;
 
       color:rgb(246, 247, 246);

+ 58 - 94
src/views/projectApply/projectApplicationDetails.vue

@@ -154,8 +154,8 @@
           <template #default="scope">
               <div class="operations">
                       <!-- <el-button type="primary" @click="lookDetail(scope)" size="mini">查看详情</el-button> -->
-                      <el-button type="primary" @click="amendDialogData(scope.row)" size="mini">修改</el-button>
-                      <el-button type="primary" @click="Del(scope.row)" size="mini">删除</el-button>
+                      <el-button type="primary" @click="amendDialogData(scope.$index)" size="mini">修改</el-button>
+                      <el-button type="primary" @click="Del(scope.$index)" size="mini">删除</el-button>
               </div>
           </template>
         </el-table-column>
@@ -185,7 +185,7 @@
     </div>
       <!--添加成员dialog对话框开始 -->
       <el-dialog
-          title="添加成员"
+          :title="isAddMember==1?'添加成员':'修改成员'"
           :visible.sync="addMemberDialog"
           :modal="true"
           :close-on-click-modal="true"
@@ -209,7 +209,7 @@
             <div class="littleBlock">
               <div class="dialogLabel">电话</div>
               <div>
-                <el-input type="number" v-model="addTabMember.phone" onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))" ></el-input>
+                <el-input class="inputNumber" type="number" v-model="addTabMember.phone" @blur="getText(addTabMember.phone)" ></el-input>
               </div>
             </div>
             <!-- <div class="littleBlock">
@@ -219,53 +219,13 @@
               </div>
             </div> -->
             <div slot="footer" class="footer">
-              <el-button type="primary" @click="commit" class="diaBtn" >确认提交</el-button>
-              <el-button @click="init" class="diaBtn">取消</el-button>
-            </div>
-      </el-dialog>
-      <!--添加成员dialog对话框结束 -->
+              <el-button v-show="isAddMember" type="primary" @click="commit" class="diaBtn" >确认提交</el-button>
+              <el-button v-show="!isAddMember" type="primary" @click="commit2" class="diaBtn" >确认修改</el-button>
 
-      <!--修改成员dialog对话框开始 -->
-      <el-dialog
-          title="修改成员"
-          :visible.sync="amendMemberDialog"
-          :modal="true"
-          :close-on-click-modal="true"
-          class="AddMember"
-          :before-close="init">
-
-            <div class="littleBlock">
-              <div class="dialogLabel">姓名</div>
-              <div>
-                <el-input v-model="amendTabMember.name"></el-input>
-              </div>
-            </div>
-
-            <div class="littleBlock">
-              <div class="dialogLabel">班级</div>
-              <div>
-                <el-input v-model="amendTabMember.class"></el-input>
-              </div>
-            </div>
-
-            <div class="littleBlock">
-              <div class="dialogLabel">电话</div>
-              <div>
-                <el-input type="number" v-model="amendTabMember.phone" onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))" ></el-input>
-              </div>
-            </div>
-            <!-- <div class="littleBlock">
-              <div class="dialogLabel">学分</div>
-              <div>
-                <el-input type="number" v-model="amendTabMember.score" onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))" ></el-input>
-              </div>
-            </div> -->
-            <div slot="footer" class="footer">
-              <el-button type="primary" @click="commit2" class="diaBtn" >确认提交</el-button>
               <el-button @click="init" class="diaBtn">取消</el-button>
             </div>
       </el-dialog>
-      <!--修改成员dialog对话框结束 -->
+      <!--添加成员dialog对话框结束 -->
 
        <!-- 删除成员对话框开始 -->
        <el-dialog
@@ -301,7 +261,7 @@
 </template>
 
 <script>
-  import { uuid } from 'vue-uuid';
+  // import { uuid } from 'vue-uuid';
   import BeUpload from "../../components/tool/beUpload.vue";
     export default {
       components: {
@@ -310,9 +270,10 @@
       data() {
         return {
           iid:'',
-          accept:'*',
+          isTel:'',
+          accept:'png,jpg',
+          isAddMember:1,
           dialogImageUrl:'',  //图片地址
-          input:'',
           delMember:false,
           amendMemberDialog:false,
           addMemberDialog:false,
@@ -333,14 +294,7 @@
           tableData:[],   //成员列表数据
           
           addTabMember:{       //添加项目成员
-            id:'',
-            name:'',
-            class:'',
-            phone:'',
-            score:0
-          },
-          amendTabMember:{       //修改项目成员
-            id:'',
+            // id:'',
             name:'',
             class:'',
             phone:'',
@@ -349,62 +303,74 @@
         }
       },
       methods:{
+        getText(value) {     //电话验证
+          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) {
+                return this.isTel=false;
+          }else{
+            return this.isTel=true;
+          }
+        },
         getFile(val) {       //上传封面
             console.log(val);
-            // let data=[{
-            //   name:val.fileName,
-            //   url:val.url
-            // }]
             this.dialogImageUrl=val.url
-            // console.log(this.data.fileList);
         },
         addMember(){       //添加成员按钮,显示对话框
-            this.addMemberDialog=true
+            this.addMemberDialog=true;
+            this.isAddMember=1;
         },
         commit(){         //对话框确认添加成员按钮 
           // console.log(this.addTabMember.name);
+            let newMember={name:'',class:'',phone:'',score:''};
             if (this.addTabMember.name == undefined || this.addTabMember.name=='') return this.$message.error('请输入姓名')
             if (this.addTabMember.class == undefined || this.addTabMember.name=='') return this.$message.error('请输入班级')
             if (this.addTabMember.phone == undefined || this.addTabMember.name=='') return this.$message.error('请输入电话') 
-            // if (this.addTabMember.score == undefined || this.addTabMember.name=='') return this.$message.error('请输入分数') 
-
-            this.addTabMember.id=uuid.v1();
-            this.tableData.push(this.addTabMember)
+            if (!this.isTel) return this.$message.error('请输入正确电话格式')
+            console.log(this.isTel);
+            Object.assign(newMember,this.addTabMember)
+            this.tableData.push(newMember)
             this.$message.success('添加人员成功')
-            this.addTabMember={}
+            for(let k in this.addTabMember){
+              if (k !== 'score') {
+                  this.addTabMember[k]=''
+              }
+            }
+            
             this.addMemberDialog=false;
         },
-        amendDialogData(val){   //人员信息列表修改按钮
-          this.iid=val;
-          console.log(val);
-          // this.amendTabMember=val
-          Object.assign(this.amendTabMember,val)
-          this.amendMemberDialog=true;
+        amendDialogData(index){   //人员信息列表修改按钮
+          Object.assign(this.addTabMember,this.tableData[index])
+          this.addTabMember['index']=index
+          this.isAddMember=0
+          this.addMemberDialog=true
         },
         commit2(){       //人员信息对话框确定修改按钮
-          this.tableData.forEach((e,i)=>{
-            if (e.id == this.iid.id) {
-              Object.assign(e,this.amendTabMember)
-              this.amendMemberDialog=false;
-              this.$message.success('修改信息成功')
+          if (this.addTabMember.name == undefined || this.addTabMember.name=='') return this.$message.error('请输入姓名')
+          if (this.addTabMember.class == undefined || this.addTabMember.name=='') return this.$message.error('请输入班级')
+          if (this.addTabMember.phone == undefined || this.addTabMember.name=='') return this.$message.error('请输入电话')
+          if (!this.isTel) return this.$message.error('请输入正确电话格式')
+          Object.assign(this.tableData[this.addTabMember['index']],this.addTabMember)
+          this.addMemberDialog=false;
+          this.$message.success('修改信息成功')
+          // for(let k in this.addTabMember) this.addTabMember[k]=''
+          for(let k in this.addTabMember){
+              if (k!=='score') {
+                  this.addTabMember[k]=''
+              }
             }
-          })
         },
         Del(val){
           this.iid=val;             //列表删除按钮
           this.delMember=true;
         },
         commitDelMember(){    //对话框确定删除按钮
-          this.tableData.forEach((e,i,arr)=>{
-            if (e.id==this.iid.id) {
-              arr.splice(i,1)
-              this.$message.success('删除成功')
-              this.delMember=false;
-            }
-          })
+          this.tableData.splice(this.iid,1)
+          this.$message.success('删除成功')
+          this.delMember=false;
         },
-        audit(){    //立即审核按钮
-          // this.$message.success('审核成功')
+        audit(){    //立即修改对话框显示
           this.submitHint=true
         },
         submitAll(){
@@ -507,8 +473,6 @@
         this.getData();
         this.getProjectDepartmentData();
         this.getProjectTypeData();
-
-        // this.value=(this.options[0].value)
       },
     }
 </script>
@@ -581,12 +545,12 @@
   .projectApplicationfundAddDialog{  
  
  .el-dialog__header{
-   border-radius: 10px 10px 0 0;
     background: #32455b;
 
  }
  .el-dialog{
-   border-radius:10px ;
+   border-radius:5px ;
+   overflow: hidden;
  }
  
  .deleteContent{

+ 35 - 30
src/views/projectManage/ProjectManagement3_1.vue

@@ -119,8 +119,8 @@
                   >
                   <template #default="scope">
                       <div class="operations">
-                              <el-button type="primary" size="mini" @click="updateTeacher(scope.row.Id)" style="font-size: 14px;">修改</el-button>
-                              <el-button type="primary" size="mini" style="font-size: 14px;" @click="deleteRow(scope.row.Id)">删除</el-button>
+                              <el-button type="primary" size="mini" @click="updateTeacher(scope.$index)" style="font-size: 14px;">修改</el-button>
+                              <el-button type="primary" size="mini" style="font-size: 14px;" @click="deleteRow(scope.$index)">删除</el-button>
                       </div>
                   </template>
                 </el-table-column>
@@ -175,7 +175,7 @@
 
      <!--添加成员dialog对话框开始 -->
      <el-dialog
-            :title="Member.Id==''?'添加指导老师':'修改指导老师'"
+            :title="isAddMember?'添加指导老师':'修改指导老师'"
             :visible.sync="addMemberDialog"
             class="AddMember"
             :before-close="handleClose">
@@ -201,8 +201,8 @@
                 </div>
               </div>
               <div slot="footer" class="footer">
-                <el-button v-if="Member.Id==''" type="primary" @click="commit" class="diaBtn" size="small">确认提交</el-button>
-                <el-button v-if="!Member.Id==''"  type="primary" @click="change" class="diaBtn" size="small">确认修改</el-button>
+                <el-button v-show="isAddMember" type="primary" @click="commit" class="diaBtn" size="small">确认提交</el-button>
+                <el-button v-show="!isAddMember"  type="primary" @click="change" class="diaBtn" size="small">确认修改</el-button>
                 <el-button @click="handleClose" class="diaBtn" size="small">取消</el-button>
               </div>
         </el-dialog>
@@ -244,7 +244,7 @@
 
   <script>
   import { VueEditor } from "vue2-editor";
-  import { uuid } from 'vue-uuid';
+  // import { uuid } from 'vue-uuid';
       export default {
         components:{
           VueEditor,
@@ -252,6 +252,7 @@
         data() {
           return {
             updateActivity:false,
+            isAddMember:1,
             customToolbar: [
               ["bold", "italic", "underline"], [{ list: "ordered" }, { list: "bullet" }],
               [{ align: "" }, { align: "center" }, { align: "right"}, { align: "justify"}],
@@ -277,7 +278,7 @@
           textareaS:[],
           selectInput: [], //部门下拉框
           Member:{
-              Id:"",
+              // Id:"",
               Name:'',
               work:'',
               takeCharge:''
@@ -326,6 +327,7 @@
                     for(let i in this.Member)this.Member[i]='';
                 },
                 addTeacher(){    //添加老师对话框
+                  this.isAddMember=1;
                   this.addMemberDialog=true;
                 },
                 commit(){  //确定添加老师
@@ -334,36 +336,37 @@
                     if(this.Member.takeCharge=='')return this.$message.error('请输入活动分工')
                     let k={}
                     this.addMemberDialog=false;
-                    this.Member.Id=uuid.v1()
                     Object.assign(k,this.Member)
                     this.tableData.push(k);
                     this.$message.success('添加成功')
                     for(let i in this.Member)this.Member[i]='';
               },
 
-              updateTeacher(Id){    //修改对话框出现
-                Object.assign(this.Member,this.tableData.filter(item=>item.Id==Id)[0])
+              updateTeacher(index){    //修改对话框出现
+                Object.assign(this.Member,this.tableData[index])
+                this.Member['index']=index      //在data中赋值这样谁都可以取到了
+                this.isAddMember=0;
                 this.addMemberDialog = true;
               },
               change(){    //确定修改老师
-                if(this.Member.Id=='')return this.$message.error("错误");
                 if(this.Member.Name=='')return this.$message.error('请输入姓名')
                 if(this.Member.work=='')return this.$message.error('请输入工作单位')
                 if(this.Member.takeCharge=='')return this.$message.error('请输入活动分工')
-                // for(let a in this.Member)if(/^\s*$/g.test(this.Member[a]))return this.$message.error("请不要留空")
-                Object.assign(this.tableData.filter(item=>item.Id==this.Member.Id)[0],this.Member)
+
+                Object.assign(this.tableData[this.Member['index']],this.Member)     //this.Member['index']在显示框出现的时候赋值了
                 for(let i in this.Member)this.Member[i]='';
                 this.addMemberDialog = true;
                 this.$message({message:"修改成功",type:"success"})
                 this.addMemberDialog = false;
               },
 
-              deleteRow(Id){   //删除对话框出现
+              deleteRow(index){   //删除对话框出现
                 this.delMember=true
-                this.iid=Id
+                this.iid=index
               },
               commitDelMember(){    //确定删除老师
-                this.tableData = this.tableData.filter(item=>item.Id!=this.iid);
+                this.tableData.splice(this.iid,1)
+                // this.tableData = this.tableData.filter(item=>item.Id!=this.iid);
                 this.$message({message:"删除成功",type:"success"})
                 this.delMember=false
               },
@@ -439,12 +442,9 @@
    
     .projectApplicationfundAddDialog{  //提交对话框开始
  
-      .el-dialog__header{
-        border-radius: 10px 10px 0 0;
-      }
       .el-dialog{
-        border-radius:10px ;
-        top: 10%;
+        border-radius:5px ;
+        overflow: hidden;
       }
       
       .deleteContent{
@@ -456,23 +456,24 @@
       .addDialogLogo{
         width: 60px;
         height: 30px;
+        border-radius: 5px;
+        display: flex;
+        justify-content: center;
         line-height: 30px;
         background: #f2f2f2;
         position: absolute;
-        left: 10px;
-        top: 10px;
-        text-align: center;
+        left: 20px; top: 15px; 
       }
       .el-dialog__header{
         background: #32455b;
       }
       .el-dialog__title{
-        // text-align: center;
+        color:#fff;
+        display: flex;
+        justify-content: center;
+        font-size: 18px;
         position: relative;
-        top: -5px;
-        margin-left:250px;
-        font-size: 22px;
-        color:rgb(246, 247, 246);
+        top: -2px;
       }
       .addDialogMid{
         box-sizing: border-box;
@@ -529,7 +530,11 @@
             }
             .el-dialog__title{
               color:#fff;
-              font-size: 22px;
+              display: flex;
+              justify-content: center;
+              font-size: 18px;
+              position: relative;
+              top: -2px;
             }
             .el-dialog__body{
               display: flex;