Q-ABAB 2 år sedan
förälder
incheckning
3abf0b48f5

+ 4 - 4
src/components/tool/getProjectNo.js

@@ -10,12 +10,12 @@ export default function getProjectNo(str="XM"){
     return new Promise((resolve,reject)=>{
         ajax.get(store.state.api+TYPE_NO[str],{
             uid:store.state.userInfo.userid,
-        }).then(res=>{
-            if(res['data'][0].length==0)return resolve(`${str}000000001`)
+        }).then(res=>{dwwdwad
+            if(res['data'][0].length==0)return resolve(`${str}0000001`)
             let LastNo = res['data'][0][0]['No']
-            let number = parseInt(LastNo.slice(-9));
+            let number = parseInt(LastNo.slice(-7));
             let newNumber = number+1;
-            let newNo = `${str}${newNumber.toString().padStart(9,"0")}`;
+            let newNo = `${str}${newNumber.toString().padStart(7,"0")}`;
             resolve(newNo);
         }).catch(err=>{
             reject(null)

+ 57 - 37
src/views/projectApply/MakerSpaceApply.vue

@@ -6,7 +6,19 @@
       </div>
       <hr>
       <MakerSpaceWord :wordData="wordData"/>
-      <el-button type="primary" @click="applyBtn">提交</el-button>
+      <el-button type="primary" @click="test">提交项目</el-button>
+      <el-dialog
+          title="提示"
+          :visible.sync="submitHint"
+          width="600px"
+          class="pageSubmitData">
+          <div class="addDialogLogo">LOGO</div>
+          <div class="deleteContent">确定提交“{{wordData['projectName']}}”项目立项?</div>
+          <span slot="footer" class="dialog-footer">
+            <el-button type="primary" @click="applyProject" class="AllDialogBtn">确认提交</el-button>
+            <el-button @click="submitHint=false" class="AllDialogBtn">取消</el-button>
+          </span>
+        </el-dialog>
     </div>
   </template>
   
@@ -70,10 +82,11 @@
               //知识产权事务费:Transaction   TransactionRemarks
             },
             loading:false,
+            submitHint:false,
           }
         },
         methods:{
-            applyBtn(){//项目提交
+            test(){//项目提交
               //检查各个字段
               const cEmpty = /^\s*$/g;
               for(let i in this.wordData){
@@ -242,44 +255,51 @@
                     break
                 }
               }
+              this.submitHint = true;
+            },
+            applyProject(){
               //先获取编号
               getProjectNo("XM").then((result)=>{
-              let pram = {
-                uid:this.$store.state.userInfo.userid,//用户ID
-                pNo:result,//项目编号
-                tit:this.wordData['projectName'],//项目名称
-                bf:this.wordData['brief'],//项目简介
-                pLeader:this.wordData['pro_leader'],//项目负责人
-                lLeader:this.wordData['lead_leader'],//学院牵头领导,
-                cid:this.wordData['college'],//学院ID,
-                ct:JSON.stringify(this.wordData['teacher']),//教师组,
-                cs:JSON.stringify(this.wordData['student']),//学生组,
-                f:this.wordData['fund']['total'],//总经费
-                chp:JSON.stringify({
-                    Construction:this.wordData['Construction'],//建设内容
-                    ProjectBasis:this.wordData['ProjectBasis'],//立项依据
-                    development:this.wordData['development'],//创客空间物理环境、制度建设及软件设施建设情况
-                    studio:this.wordData['studio'],//学生创客工作室建设情况
-                    studentTeam:this.wordData['studentTeam'],//学生创客团队(人才)培养预期成果、数量
-                    studentActivities:this.wordData['studentActivities'],//学生创客活动组织实施情况
-                    Transforming:this.wordData['Transforming'],//学生创客团队孵化、转化创业项目情况
-                    condition:this.wordData['condition'],//立 项基 础及条 件
-                }),//项目详细
-                tid:"5f7a66d5-c206-11ed-a4cd-509a4c5b67cf",//特色创客空间建设项目分类ID
-                tName:this.wordData['state'],//项目状态
-                mon:JSON.stringify(this.wordData['fund']),//预算经费
-                planEnd:this.wordData['plannedEnd_at'],//计划完成时间,
-                beh:this.wordData['begin_at'],//项目开始时间,
-                apply:this.wordData['applicationDate'],//申请日期
-              }
-              console.log(pram);
-              this.ajax.post(this.$store.state.api+'/MakerSpaceWordApply',pram).then(result=>{
-                console.log(result);
-              }).catch(err=>{
-                console.log(err);
-              })
+                let pram = {
+                  uid:this.$store.state.userInfo.userid,//用户ID
+                  pNo:result,//项目编号
+                  tit:this.wordData['projectName'],//项目名称
+                  bf:this.wordData['brief'],//项目简介
+                  pLeader:this.wordData['pro_leader'],//项目负责人
+                  lLeader:this.wordData['lead_leader'],//学院牵头领导,
+                  cid:this.wordData['college'],//学院ID,
+                  ct:JSON.stringify(this.wordData['teacher']),//教师组,
+                  cs:JSON.stringify(this.wordData['student']),//学生组,
+                  f:this.wordData['fund']['total'],//总经费
+                  chp:JSON.stringify({
+                      Construction:this.wordData['Construction'],//建设内容
+                      ProjectBasis:this.wordData['ProjectBasis'],//立项依据
+                      development:this.wordData['development'],//创客空间物理环境、制度建设及软件设施建设情况
+                      studio:this.wordData['studio'],//学生创客工作室建设情况
+                      studentTeam:this.wordData['studentTeam'],//学生创客团队(人才)培养预期成果、数量
+                      studentActivities:this.wordData['studentActivities'],//学生创客活动组织实施情况
+                      Transforming:this.wordData['Transforming'],//学生创客团队孵化、转化创业项目情况
+                      condition:this.wordData['condition'],//立 项基 础及条 件
+                  }),//项目详细
+                  tid:"5f7a66d5-c206-11ed-a4cd-509a4c5b67cf",//特色创客空间建设项目分类ID
+                  tName:this.wordData['state'],//项目状态
+                  mon:JSON.stringify(this.wordData['fund']),//预算经费
+                  planEnd:this.wordData['plannedEnd_at'],//计划完成时间,
+                  beh:this.wordData['begin_at'],//项目开始时间,
+                  apply:this.wordData['applicationDate'],//申请日期
+                }
+                this.ajax.post(this.$store.state.api+'/MakerSpaceWordApply',pram).then(result=>{
+                  if(result['data']==1){
+                    this.$message.success("项目提交成功");
+                    this.$router.push('/projectApplication')
+                  }else{
+                    this.$message.error("项目提交失败");
+                  }
+                }).catch(err=>{
+                  console.log(err);
+                })
             })
-            },
+            }
         },
         mounted(){      //跳转到此页面立刻获取数据
         //   this.getData();     //获取表格数据

+ 1 - 2
src/views/projectApply/components/MakerSpaceWord.vue

@@ -382,7 +382,7 @@
           <div class="fundTable">
             <div class="fundTotal">
               <div class="fundLabel">总经费</div>
-              <div class="fundValue">{{wordData['fund']['total']||0}}</div>
+              <div class="fundValue">{{wordData['fund']['total']||0}}</div>
             </div>
             <div class="fundHeader">
               <div class="HeaderLabel">支出类别</div>
@@ -590,7 +590,6 @@
       },
       getTotal(){
         this.wordData['fund']['total'] = Number(this.wordData['fund']['device'])+Number(this.wordData['fund']['Material'])+Number(this.wordData['fund']['processing'])+Number(this.wordData['fund']['Collaboration'])+Number(this.wordData['fund']['APPRAISAL'])+Number(this.wordData['fund']['entery'])+Number(this.wordData['fund']['activities'])+Number(this.wordData['fund']['Transaction'])
-        this.wordData['fund']['total'] = this.wordData['fund']['total']/10000
       }
     },
     mounted(){

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

@@ -47,7 +47,12 @@
           </el-option>
         </el-select>
       </div>
-
+      <div class="selectInp">
+        <div class="ProjectManagementQuery">
+          <el-input v-model="selectText" @change="getData" placeholder="请输入项目名称"></el-input>
+          <el-button type="primary" class="btn" @click="getData" size="mini">查询</el-button>
+        </div>
+      </div>
       <div class="selectsBlock">
         <div class="selectLabel">负责人</div>
         <el-select v-model="selectInp.person" @change="getData" placeholder="请选择">
@@ -73,6 +78,7 @@
         </el-select>
       </div>
     </div>
+    
 <!-- 搜索框结束 -->
 <!-- 表格开始 -->
     <div>
@@ -92,6 +98,12 @@
           >
 
         </el-table-column> -->
+        <el-table-column
+          prop="ProjectNo"
+          label="项目编号"
+          align="center"
+          min-width="11%">
+        </el-table-column>
         <el-table-column
           prop="title"
           label="项目名称"
@@ -123,6 +135,11 @@
           label="预算(万)"
           align="center"
           min-width="8%">
+          <template #default="scope">
+            <div>
+              {{ scope.row.fund/10000 }}
+            </div>
+          </template>
         </el-table-column>
         <el-table-column
           prop="startTime"

+ 1 - 1
src/views/projectManage/ProjectManagement.vue

@@ -89,7 +89,7 @@
 
       </div>
       <div class="ProjectManagementQuery">
-        <el-input v-model="selectText" style="340px" placeholder="请输入项目名称"></el-input>
+        <el-input v-model="selectText" placeholder="请输入项目名称"></el-input>
         <el-button type="primary" class="btn" size="mini">查询</el-button>
       </div>
     </div>