Explorar o código

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

yuanyiming %!s(int64=2) %!d(string=hai) anos
pai
achega
4916bfc6dc

+ 1 - 0
src/App.vue

@@ -230,6 +230,7 @@
           .inpBlock{    //一个个输入框小方块
             display: flex;
             margin-bottom: 15px;
+            position: relative;
             input::-webkit-outer-spin-button,
             input::-webkit-inner-spin-button {
               -webkit-appearance: none !important;

+ 107 - 46
src/views/activityManage/makerActvity.vue

@@ -11,49 +11,49 @@
     <div class="selects">
       <div class="selectsBlock">
         <div class="selectLabel">项目筛选</div>
-        <el-select v-model="pavalues.value" placeholder="我的项目">
+        <el-select v-model="pavalues.value" @change="getData" placeholder="请选择">
+          <el-option label="所有项目" :value="0"/>
           <el-option
             v-for="item in options"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value">
+            :key="item.courseId"
+            :label="item.title"
+            :value="item.courseId">
           </el-option>
         </el-select>
       </div>
 
       <div class="selectsBlock">
-        <div class="selectLabel">部门</div>
-        <el-select v-model="pavalues.value1" placeholder="请选择">
+        <div class="selectLabel">所在部门</div>
+        <el-select v-model="pavalues.value1" @change="getData" placeholder="请选择">
+          <el-option label="所有部门" :value="0"/>
           <el-option
             v-for="item in options1"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value">
+            :key="item.id"
+            :label="item.name"
+            :value="item.id">
           </el-option>
         </el-select>
       </div>
 
       <div class="selectsBlock">
-        <div class="selectLabel">分类</div>
-        <el-select v-model="pavalues.value2" placeholder="请选择">
+        <div class="selectLabel">负责人</div>
+        <el-select v-model="pavalues.value2" @change="getData" placeholder="请选择">
+          <el-option label="所有负责人" value=""></el-option>
           <el-option
             v-for="item in options2"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value">
+            :key="item.pro_leader"
+            :label="item.pro_leader"
+            :value="item.pro_leader">
           </el-option>
         </el-select>
       </div>
 
       <div class="selectsBlock">
-        <div class="selectLabel">负责人</div>
-        <el-select v-model="pavalues.value3" placeholder="请选择">
-          <el-option
-            v-for="item in options3"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value">
-          </el-option>
+        <div class="selectLabel">状态</div>
+        <el-select v-model="pavalues.value3" @change="getData" placeholder="请选择">
+          <el-option label="所有状态" :value="99"/>
+          <el-option label="未报销" :value="0"/>
+          <el-option label="已报销" :value="1"/>  
         </el-select>
       </div>
 
@@ -66,42 +66,43 @@
         :data="tableData"
         tooltip-effect="dark"
         stripe
-        class="fontSize"
+        class="fontSize core_dialogue"
+        style="height:65%;overflow: auto;"
         :header-cell-style="{ background: '#f2f2f2',color:'#000' }"
         >
         
         <el-table-column
-          prop="projectName"
+          prop="title"
           label="活动名称"
           align="center"
           min-width="10%">
         </el-table-column>
         <el-table-column
-          prop="projectPerson"
+          prop="pro_leader"
           label="负责人"
           align="center"
           min-width="7%">
         </el-table-column>
         <el-table-column
-          prop="relevancy"
+          prop="PName"
           align="center"
           label="关联项目"
           min-width="9%">
         </el-table-column>
         <el-table-column
-          prop="budget"
+          prop="money"
           align="center"
-          label="预算经费"
+          label="预算经费(元)"
           min-width="8%">
         </el-table-column>
-        <el-table-column
+        <!-- <el-table-column
           prop="useBudget"
           align="center"
           label="实际使用(元)"
           min-width="8%">
-        </el-table-column>
+        </el-table-column> -->
         <el-table-column
-          prop="dept"
+          prop="name"
           align="center"
           label="所在部门"
           min-width="8%">
@@ -112,15 +113,18 @@
           align="center"
           min-width="7%">
           <template #default="scope">
-                <!-- {{scope.row.name + (scope.row.status==0?"":"(已屏蔽)")}} -->
-                {{status?"未报销":"已报销"}}
+                <span v-if="scope.row.state==0">未报销</span>
+                <span v-if="scope.row.state==1">已报销</span>
           </template>
         </el-table-column>
         <el-table-column
-          prop="date"
+          prop="begin_at"
           align="center"
           label="活动时间"
           min-width="10%">
+          <template #default="scope">
+            {{ GetTime(scope.row.begin_at)}}
+          </template>
         </el-table-column>
         <el-table-column
           prop="operation"
@@ -267,7 +271,14 @@
       </div>
     </el-dialog>
     <!-- 完结对话框结束 -->
-
+    <el-pagination
+        @current-change="CurrentChange"
+        :page-size="Page.lim"
+        layout=" prev, pager, next"
+        background
+        class="pagination"
+        :total="Page.total">
+      </el-pagination>
 
   </div>
 </template>
@@ -286,8 +297,6 @@
           options:[],
           options1:[],
           options2:[],
-          options3:[],
-          options4:[],
           // 表格数据
           tableData:[{
             projectName:'陆地游泳辅助器',
@@ -303,10 +312,15 @@
           ],
           // 四个下拉框数据
           pavalues:{
-            value:'',
-            value1:'',
-            value2:'',
-            value3:'',
+            value:0,//项目ID
+            value1:0,//部门ID
+            value2:'',//负责人
+            value3:99,//状态
+          },
+          Page:{
+            nowPage:1,
+            total:10,
+            lim:10
           }
         }
       },
@@ -359,16 +373,58 @@
         MADetails(){   // 查看详情
           this.$router.push('/makerActvityDetails')
         },
- 
-      }
-
+        CurrentChange(nowPage){
+          this.Page.nowPage = nowPage;
+          this.getData();
+        },
+        getData(){
+          this.ajax.get(this.$store.state.api+"/GetAllActivity",{
+            uid:this.$store.state.userInfo.userid,
+            pid:this.pavalues.value,
+            cid:this.pavalues.value1,
+            leader:this.pavalues.value2,
+            state:this.pavalues.value3,
+            page:this.Page.nowPage,
+            lim:this.Page.lim,
+          }).then(res=>{
+            let data = res.data;
+            this.tableData = data[0];
+            this.options = data[1];
+            this.options1 = data[2];
+            this.options2 = data[3];
+            console.log(data)
+            this.Page.total = data[4][0]['total'];
+          }).catch(err=>{
+            this.$message.error(err.message)
+          })
+        },
+        GetTime(data){
+          data = JSON.parse(data);
+          if(data[0]==data[1])return data[0];
+          let sp1 = data[0].split('-')
+          let sp2  =data[1].split('-')
+          if(sp1[0]==sp2[0]){
+            if(sp1[1]==sp2[1]){
+              return `${sp1[0]}-${sp1[1]}-${sp1[2]} 至 ${sp2[2]}`
+            }else{
+              return `${sp1[0]}-${sp1[1]}-${sp1[2]} 至 ${sp2[1]}-${sp2[2]}`
+            }           
+          }else{
+            return data[0]+" 至 "+data[1]
+          }
+        }
+      },
+      mounted() {
+        this.getData()
+      },
     }
 </script>
 
 <style lang="less">
 .makerActvity{
-
-
+  position: relative;
+  width: 100%;
+  height: 100%;
 
   .dialogWidth{
       .el-input__inner{
@@ -498,4 +554,9 @@
     }
   }
 }
+.pagination{
+  // position: absolute;
+    float: right;
+    margin: 20px 35px 10px;
+  }
 </style>

+ 12 - 3
src/views/activityManage/makerActvityApply.vue

@@ -47,7 +47,7 @@
                           <div class="inpBlock">
                               <div class="label">预算经费</div>
                               <el-input type="number" v-model.number="data.select.fund" placeholder="请输入内容"></el-input>
-                              <div style="position: absolute;right: -30px;top: 10px;">()</div>
+                              <div style="position: absolute;right: -30px;top: 10px;">()</div>
                           </div>
                           <div class="inpBlock">
                               <div class="label">负责人</div>
@@ -69,13 +69,22 @@
 
                       <div class="selectRight">
                         <div class="inpBlock">
-                              <div class="label">项目开始时间</div>
-                              <el-date-picker
+                              <div class="label">活动时间</div>
+                              <!-- <el-date-picker
                                 v-model="data.select.time"
                                 type="datetime"
                                 value-format="yyyy-MM-dd HH:mm:ss"
                                 style="width: 100%;"
                                 placeholder="选择日期">
+                              </el-date-picker> -->
+                              <el-date-picker
+                                v-model="data.select.time"
+                                type="daterange"
+                                value-format="yyyy-MM-dd"
+                                style="width: 100%;"
+                                range-separator="至"
+                                start-placeholder="开始日期"
+                                end-placeholder="结束日期">
                               </el-date-picker>
                           </div>
                           <div class="inpBlock">

+ 5 - 4
src/views/activityManage/makerActvityApplyMain.vue

@@ -49,18 +49,19 @@ import makerActvityApply2 from './makerActvityApply2.vue';
                     tit:data1['activityName'],
                     con:data1['introduce'],
                     leader:data1['leader'],
+                    money:data1['fund'],
+                    students:data1['people'],
                     teacher:JSON.stringify(data1['teacher']),
                     chapters:JSON.stringify(this.makerActvityApply2Data),
                     pid:data1['pid'],
                     cid:data1['value'],
                     phone:data1['tel'],
-                    beginTime:data1['time'],
+                    beginTime:JSON.stringify(data1['time']),
                 }
-                console.log(param)
                 this.ajax.post(this.$store.state.api+"/CreateActivity",param).then(res=>{
                     if(res.data==1){
                         this.$message({message:"创建创客活动成功!",type:"success"})
-                        this.$route.push("/makerActvity")
+                        this.$router.push("/makerActvity")
                     }else{
                         this.$message.error(`创建创客活动失败:${res.data}`);
                     }
@@ -126,7 +127,7 @@ import makerActvityApply2 from './makerActvityApply2.vue';
                             if(!this.checkPhone(checkData[i]))return;
                             break;
                         case "time":
-                            if(cEmpty.test(checkData[i]))return this.$message.error("请选择项目开始时间");
+                            if(checkData[i].length<2)return this.$message.error("请选择项目开始时间");
                             break;
                         case "value":
                             if(cEmpty.test(checkData[i]))return this.$message.error("请选择所在部门");