123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640 |
- <template>
- <!--创客活动 -->
- <div class="makerActvity">
- <div class="pAHeader">
- <div class="pAHeader1">创客活动</div>
- <el-button @click="makerActvityApply">创客活动申请</el-button>
- </div>
- <hr>
- <!-- 搜索框开始 -->
- <div class="selects">
- <div class="selectsBlock">
- <div class="selectLabel">项目筛选</div>
- <el-select v-model="pavalues.value" @change="getData" placeholder="请选择">
- <el-option label="所有项目" :value="0"/>
- <el-option
- v-for="item in options"
- :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" @change="getData" placeholder="请选择">
- <el-option label="所有部门" :value="0"/>
- <el-option
- v-for="item in options1"
- :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" @change="getData" placeholder="请选择">
- <el-option label="所有负责人" value=""></el-option>
- <el-option
- v-for="item in options2"
- :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" @change="getData" placeholder="请选择">
- <el-option label="所有状态" :value="99"/>
- <el-option label="未报销" :value="0"/>
- <el-option label="已报销" :value="1"/>
- </el-select>
- </div>
- </div>
- <!-- 搜索框结束 -->
- <!-- 表格开始 -->
- <el-table
- ref="multipleTable"
- :data="tableData"
- tooltip-effect="dark"
- stripe
- class="fontSize core_dialogue"
- style="height:65%;overflow: auto;"
- :header-cell-style="{ background: '#f2f2f2',color:'#000' }"
- >
-
- <el-table-column
- prop="title"
- label="活动名称"
- align="center"
- min-width="10%">
- </el-table-column>
- <el-table-column
- prop="pro_leader"
- label="负责人"
- align="center"
- min-width="7%">
- </el-table-column>
- <el-table-column
- prop="PName"
- align="center"
- label="关联项目"
- min-width="9%">
- </el-table-column>
- <el-table-column
- prop="money"
- align="center"
- label="预算经费(元)"
- min-width="8%">
- </el-table-column>
- <!-- <el-table-column
- prop="useBudget"
- align="center"
- label="实际使用(元)"
- min-width="8%">
- </el-table-column> -->
- <el-table-column
- prop="name"
- align="center"
- label="所在部门"
- min-width="8%">
- </el-table-column>
- <el-table-column
- prop="state"
- label="状态"
- align="center"
- min-width="7%">
- <template #default="scope">
- <span v-if="scope.row.state==0">未报销</span>
- <span v-if="scope.row.state==1">已报销</span>
- </template>
- </el-table-column>
- <el-table-column
- 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"
- width="350"
- align="center"
- label="操作"
- >
- <template #default="scope">
- <div class="operations">
- <!-- <el-button type="primary" > -->
- <el-button type="primary" @click="MADetails(scope.row.acId)" size="mini">查看详情</el-button>
- <el-button type="primary" v-if="scope.row.state==0" @click="audi(scope.row)" size="mini">审核</el-button>
- <el-button type="info" disabled v-if="scope.row.state==1" @click="audi(scope.row)" size="mini">审核</el-button>
- <el-button type="primary" size="mini" @click="edit(scope)">申请表</el-button>
- <el-button type="primary" v-if="scope.row.reportFile==''||scope.row.reportFile==null" size="mini" @click="end(scope.row)" >完结</el-button>
- <el-button type="info" v-show="scope.row.reportFile!=''&&scope.row.reportFile!=null" size="mini" disabled>完结</el-button>
- <!-- </el-button> -->
- </div>
- </template>
- </el-table-column>
- </el-table>
- <!-- 表格结束 -->
- <!-- 活动审核对话框开始 -->
- <el-dialog
- title="活动审核"
- :visible.sync="auditDialog"
- class="dialogWidth"
- :before-close="init">
-
- <div class="diaTit">
- <div class="spans">项目名称:</div>
- <div class="spanCon">{{ processTable.name }}</div>
- <div class="spans" style="margin-left: 30px;">项目负责人:</div>
- <div class="spanCon">{{ processTable.leader }}</div>
- </div>
- <div class="diaTit1">
- <div class="spans1">所在部门</div>
- <div>
- <el-input disabled v-model="processTable.className"></el-input>
- </div>
- </div>
- <div class="diaTit1">
- <div class="spans1">预算总经费</div>
- <div>
- <el-input disabled v-model="processTable.money"></el-input>
- </div>
- </div>
- <div class="diaTit1">
- <div class="spans1">联系电话</div>
- <div>
- <el-input disabled v-model="processTable.phone"></el-input>
- </div>
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="commit" class="diaBtn">确认提交</el-button>
- <el-button @click="init" class="diaBtn">取消</el-button>
- </div>
- </el-dialog>
- <!-- 活动审核对话框结束 -->
- <!-- 驳回提交对话框开始 -->
- <el-dialog
- title="驳回提交"
- :visible.sync="rejectDialog"
- class="dialogWidth"
- width="700px"
- :before-close="init">
-
- <div class="diaTit">
- <div class="spans">项目名称:</div>
- <div class="spanCon">{{ processTable.name }}</div>
- <div class="spans" style="margin-left: 30px;">项目负责人:</div>
- <div class="spanCon">{{ processTable.leader }}</div>
- </div>
- <div class="diaTit1">
- <div class="spans1">所在部门</div>
- <div>
- <el-input disabled v-model="processTable.className"></el-input>
- </div>
- </div>
- <div class="diaTit1">
- <div class="spans1">预算总经费</div>
- <div>
- <el-input disabled v-model="processTable.money"></el-input>
- </div>
- </div>
- <div class="diaTit1">
- <div class="spans1">联系电话</div>
- <div>
- <el-input disabled v-model="processTable.phone"></el-input>
- </div>
- </div>
- <div class="diaTit1">
- <div class="spans1" style="position: relative;top:-23px">撤回意见</div>
- <div>
- <el-input
- type="textarea"
- :rows="4"
- style="width:200px"
- resize="none"
- placeholder="请输入内容"
- v-model="textarea">
- </el-input>
- </div>
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="commit2" class="diaBtn">确认提交</el-button>
- <el-button @click="init" class="diaBtn">取消</el-button>
- </div>
- </el-dialog>
- <!-- 驳回提交对话框结束 -->
- <!-- 完结对话框开始 -->
- <el-dialog
- title="提示"
- :visible.sync="endDialog"
- width="600px"
- class="endDialog"
- :before-close="cancelEndTableFile">
- <div class="addDialogLogo">LOGO</div>
- <div class="deleteContent">"{{ endTable.title }}"项目活动,是否确定完结?</div>
- <div class="deleteContent1">活动完结报告</div>
- <div class="download" v-for="item in endTable.file">
- <div>{{ item.fileName }}</div>
- <el-button type="primary" @click="delEndTableFile(item.fid)" size="mini">删除文件</el-button>
- </div>
- <div class="addMoneyBtn">
- <div class="jia">+</div>添加
- <div id="upFile">
- <beUpload @getFile="getFile" :navName="'上传文件'" :accept="accept"> </beUpload>
- </div>
- </div>
- <!-- <div class="DelBtn" style="margin-left: 0;" v-if="endTable.file!=''&&endTable.file!=null">
- <el-button type="primary" @click="endTable.file=''">删除文件</el-button>
- </div> -->
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="ending" class="diaBtn">确认提交</el-button>
- <el-button @click="cancelEndTableFile" class="diaBtn">取消</el-button>
- </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>
- <script>
- import beUpload from '../../components/tool/beUpload'
- import { uuid } from 'vue-uuid';
- export default {
- components:{beUpload},
- data() {
- return {
- accept:".doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
- status:1,
- textarea:'',
- input:'',
- endDialog:false, //完结对话框
- auditDialog:false, //审核对话框
- rejectDialog:false, //驳回对话框
- options:[],
- options1:[],
- options2:[],
- // 表格数据
- tableData:[],
- // 四个下拉框数据
- pavalues:{
- value:0,//项目ID
- value1:0,//部门ID
- value2:'',//负责人
- value3:99,//状态
- },
- Page:{
- nowPage:1,
- total:10,
- lim:10
- },
- processTable:{
- Id:"",
- name:"",
- leader:"",
- className:"",
- money:"",
- phone:""
- },
- endTable:{
- Id:"",
- title:"",
- file:[],
- }
- }
- },
- methods:{
- getFile(val) {//上传文件
- val.fid = uuid.v1();
- this.endTable.file.push(val);
- },
- delEndTableFile(id){
- this.endTable.file = this.endTable.file.filter(item=>item.fid!=id);
- },
- cancelEndTableFile(){
- if(this.endTable.file.length>=1){
- this.$confirm('文件还未上传,确定取消吗?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.endDialog = false;
- })
- }else{
- this.endDialog = false;
- }
- },
- init(){//重置
- this.auditDialog=false;
- this.endDialog=false;
- this.rejectDialog=false;
- },
-
- commit(){ // 活动审核对话框确定
- this.ajax.post(this.$store.state.api+"/UpdateActivityState",{
- uid:this.$store.state.userInfo.userid,
- aid:this.processTable.Id,
- st:1,
- }).then(res=>{
- if(res.data==1){
- this.$message.success("审核成功");
- this.auditDialog = false;
- for(let i in this.processTable)this.processTable[i] = '';
- this.getData()
- }else{
- this.$message.error("审核失败")
- }
- this.getData();
- }).catch(err=>{
- this.$message.error(err.message)
- })
- },
- // 驳回对话框确定
- commit2(){
- this.rejectDialog=false;
- this.status++
- },
- end(val){//完结按钮
- this.endTable.title = val.title;
- this.endTable.Id = val.acId;
- this.endTable.file = val.reportFile==''||val.reportFile==null?[]:val.reportFile;
- this.endDialog=true;
- },
- ending(){ //完结提交
- if(this.endTable.file.length.length==0)return this.$message.error("请上传完结报告");
- this.ajax.post(this.$store.state.api+"/UploadActivityFile",{
- uid:this.$store.state.userInfo.userid,
- aid:this.endTable.Id,
- file:JSON.stringify(this.endTable.file),
- }).then(res=>{
- if(res.data==1){
- this.$message.success("结项成功");
- this.endDialog = false;
- }else{
- this.$message.error("结项失败")
- }
- this.getData();
- })
- // this.endDialog=false;
- },
-
- edit(){ // 申请表按钮
- },
-
- audi(row){ // 审核按钮
- this.processTable.Id = row.acId;
- this.processTable.name = row.title;
- this.processTable.leader = row.pro_leader;
- this.processTable.money = row.money,
- this.processTable.phone = row.phone,
- this.processTable.className = row.name;
- this.auditDialog = true;
- },
-
- makerActvityApply(){ // 创客活动申请按钮
- this.$router.push('/makerActvityApplyMain')
- },
-
- MADetails(Id){ // 查看详情
- this.$router.push(`/makerActvityDetails?Id=${Id}`)
- },
- 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;
- data[0].forEach(item=>item.reportFile = item.reportFile==''||item.reportFile==null?[]:JSON.parse(item.reportFile));
- this.tableData = data[0];
- this.options = data[1];
- this.options1 = data[2];
- this.options2 = data[3];
- this.Page.total = data[4][0]['total'];
- console.log(this.tableData)
- }).catch(err=>{
- this.$message.error(err.message)
- })
- },
- GetTime(data){
- let cdata = JSON.parse(data);
- if(cdata[0]==cdata[1])return cdata[0];
- let sp1 = cdata[0].split('-')
- let sp2 =cdata[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 cdata[0]+" 至 "+cdata[1]
- }
- }
- },
- mounted() {
- this.getData();
- },
- }
- </script>
- <style lang="less">
- .makerActvity{
- position: relative;
- width: 100%;
- height: 100%;
- .dialogWidth{
- .el-input__inner{
- width: 300px;
- }
- .el-textarea__inner{
- width: 380px;
- }
- .el-dialog{
- width: 600px;
- border-radius: 5px;
- overflow: hidden;
- }
- .el-dialog__body{
- padding:30px 0px 30px 90px ;
- }
-
- .el-dialog__header{
- background: #32455b;
- }
- .el-dialog__title{
- color: #fff;
- position: relative;
- top: -5px;
- font-size: 18px;
- }
- .diaTit{ //dialog项目名称、负责人
- width: 100%;
- display: flex;
- .spans{
- width: 84px;
- font-size: 16px;
- margin-right: 10px;
- display: inline-block;
- text-align: justify;
- color: #000;
- font-size: 16px;
- text-justify:distribute-all-lines;
- text-align-last: justify;
- transform: translate(0,22%);
- margin-bottom: 10px;
- }
-
- }
- .spanCon{
- font-size: 16px;
- margin-top: 5px;
- color: #a0a0a0;
- }
- .spans1{ //label
- min-width: 84px;
- font-size: 16px;
- color: #000;
- margin-right: 10px;
- display: inline-block;
- text-align: justify;
- text-justify:distribute-all-lines;
- text-align-last: justify;
- transform: translate(0,22%);
- }
-
- .diaTit1{ //label和input框
- display: flex;
- width: 80%;
- margin-top: 20px;
-
- }
-
-
- }
- .dialog-footer{
- width: 100%;
- display: flex;
- justify-content: center;
- .diaBtn{
- font-size: 16px;
- }
- }
- .endDialog{ //完结对话框的
- .el-dialog__header{
- display: flex;
- justify-content: center;
- box-sizing: border-box;
- background: #32455b;
- }
- .el-dialog__title{
- color:rgb(246, 247, 246);
- display: flex;
- justify-content: center;
- }
- .el-dialog{
- width: 600px;
- border-radius: 5px;
- overflow: hidden;
- }
- .deleteContent{
- width: 100%;
- font-size: 22px;
- color: #000;
- box-sizing: border-box;
- // padding: 0 20px;
- display: flex;
- justify-content: center;
- }
- .deleteContent1{
- width: 100%;
- text-align: left;
- font-size: 18px;
- font-weight: bold;
- color: #000;
- margin-top: 30px;
- }
- .download{
- margin: 10px 0 10px;
- width: 100%;
- text-align: left;
- font-size: 16px;
- font-weight: bold;
- color: #5391fd;
- display: flex;
- justify-content: space-between;
- }
- .addDialogLogo{
- width: 60px;
- height: 30px;
- line-height: 30px;
- background: #f2f2f2;
- position: absolute;
- left: 10px;
- top: 15px;
- text-align: center;
- }
- }
- }
- .pagination{
- // position: absolute;
- float: right;
- margin: 20px 35px 10px;
- }
- .downloadList{
- width: 80%;
- }
- </style>
|