|
@@ -0,0 +1,225 @@
|
|
|
+<template>
|
|
|
+ <section>
|
|
|
+ <!--工具条-->
|
|
|
+ <!-- <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
|
|
|
+ <el-form :inline="true">
|
|
|
+ <el-form-item label="类型:">
|
|
|
+ <el-select v-model="search.value" placeholder="请选择类型" @change="getList()">
|
|
|
+ <el-option label="全部" value="-1"></el-option>
|
|
|
+ <el-option label="待审核" value="0"></el-option>
|
|
|
+ <el-option label="已通过" value="1"></el-option>
|
|
|
+ <el-option label="已驳回" value="2"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item v-if="search.value == -1" label="日期:" style="margin-left:20px;">
|
|
|
+ <el-date-picker v-model="search.date" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
|
|
|
+ @change="getList()" :clearable="true" type="date" placeholder="选择工作日期"></el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </el-col> -->
|
|
|
+
|
|
|
+ <!--列表-->
|
|
|
+ <el-table :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
|
|
|
+ <el-table-column type="expand">
|
|
|
+ <template slot-scope="props">
|
|
|
+ <el-timeline>
|
|
|
+ <el-timeline-item v-for="(item,index) in props.row.data" :key="index" >
|
|
|
+ <el-card shadow="never">
|
|
|
+ <p>项目:<b>{{item.project}}</b></p>
|
|
|
+ <p>时长:{{item.time}}h</p>
|
|
|
+ <p>事项:<span v-html="item.content"></span></p>
|
|
|
+ </el-card>
|
|
|
+ </el-timeline-item>
|
|
|
+ </el-timeline>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column type="index" width="60"></el-table-column>
|
|
|
+ <el-table-column prop="name" label="姓名" sortable></el-table-column>
|
|
|
+ <el-table-column prop="date" label="日期" sortable>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="search.value == -1">{{search.date}}</span>
|
|
|
+ <span v-else>{{scope.row.date}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="state" label="状态" sortable>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.state == 0" style="color:#DAA520;">待审核</span>
|
|
|
+ <span v-else-if="scope.row.state == 1" style="color:#32CD32;">已通过</span>
|
|
|
+ <span v-else-if="scope.row.state == 2" style="color:#FF0000;">已驳回</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" width="220">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button v-if="user.role != 0 && scope.row.state == 0" type="primary" :loading="logining" size="small" @click="approve(scope.row.id,scope.row.date)">通过</el-button>
|
|
|
+ <el-button v-if="user.role != 0 && scope.row.state == 0" type="danger" :loading="logining" size="small" @click="deny(scope.row.id,0,scope.row.date)">驳回</el-button>
|
|
|
+ <el-button v-if="user.role != 0 && scope.row.state == 1" type="danger" :loading="logining" size="small" @click="deny(scope.row.id,1,scope.row.date)">撤销</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <!--工具条-->
|
|
|
+ <!-- <el-col v-if="search.value != -1" :span="24" class="toolbar">
|
|
|
+ <el-pagination
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ :page-sizes="[20 , 50 , 80 , 100]"
|
|
|
+ :page-size="20"
|
|
|
+ layout="total, sizes, prev, pager, next"
|
|
|
+ :total="total"
|
|
|
+ style="float:right;"
|
|
|
+ ></el-pagination>
|
|
|
+ </el-col> -->
|
|
|
+ </section>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import util from "../../common/js/util";
|
|
|
+
|
|
|
+ export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ user: JSON.parse(sessionStorage.getItem("user")),
|
|
|
+
|
|
|
+ search: {
|
|
|
+ value: 0,
|
|
|
+ date: util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
|
|
|
+ },
|
|
|
+
|
|
|
+ users: [],
|
|
|
+
|
|
|
+ tableHeight: 0,
|
|
|
+ listLoading: false,
|
|
|
+ total: 0,
|
|
|
+ page: 1,
|
|
|
+ size: 20,
|
|
|
+ list: [],
|
|
|
+ logining: false,
|
|
|
+
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ //分页
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ this.page = val;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+
|
|
|
+ handleSizeChange(val) {
|
|
|
+ this.size = val;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+
|
|
|
+ //获取项目列表
|
|
|
+ getList() {
|
|
|
+ this.listLoading = true;
|
|
|
+ let form = {}
|
|
|
+ if(this.search.value==-1) {
|
|
|
+ form.date = this.search.date
|
|
|
+ } else {
|
|
|
+ form.state = this.search.value;
|
|
|
+ }
|
|
|
+ this.http.post(this.search.value==-1?this.port.report.list:this.port.report.portList, form,
|
|
|
+ res => {
|
|
|
+ this.listLoading = false;
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.list = res.data;
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.listLoading = false;
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ // 通过日报
|
|
|
+ approve(id,date) {
|
|
|
+ this.logining = true;
|
|
|
+ var time = "";
|
|
|
+ if(this.search.value == -1) {
|
|
|
+ time = this.search.date;
|
|
|
+ } else {
|
|
|
+ time = date;
|
|
|
+ }
|
|
|
+ this.http.post( this.port.report.approve, {id: id , date: time},
|
|
|
+ res => {
|
|
|
+ this.logining = false;
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.$message({
|
|
|
+ message: "审核成功",
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
+ this.getList();
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.logining = false;
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ // 未通过日报
|
|
|
+ deny(id,i,date) {
|
|
|
+ this.logining = true;
|
|
|
+ var time = "";
|
|
|
+ if(this.search.value == -1) {
|
|
|
+ time = this.search.date;
|
|
|
+ } else {
|
|
|
+ time = date;
|
|
|
+ }
|
|
|
+ this.http.post( this.port.report.deny, {id: id , date: time},
|
|
|
+ res => {
|
|
|
+ this.logining = false;
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.$message({
|
|
|
+ message: i==0?"驳回成功":"撤销成功",
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
+ this.getList();
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.logining = false;
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ let height = window.innerHeight;
|
|
|
+ this.tableHeight = height - 85;
|
|
|
+ const that = this;
|
|
|
+ window.onresize = function temp() {
|
|
|
+ that.tableHeight = window.innerHeight - 85;
|
|
|
+ };
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
+ };
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+</style>
|