Browse Source

增加周会会议确认界面

humingbo 1 year ago
parent
commit
ac14922ca6
1 changed files with 317 additions and 0 deletions
  1. 317 0
      src/views/meeting/weeklyRecordsConfirm.vue

+ 317 - 0
src/views/meeting/weeklyRecordsConfirm.vue

@@ -0,0 +1,317 @@
+<template>
+  <div class="app-container">
+    <div style="display: flex;justify-content: space-between;margin-bottom: 8px">
+      <div style="font-size: 24px">{{ m.meetingName }}</div>
+      <el-button size="mini" @click="exportPdf" icon="el-icon-download" style="margin-right: 20px">导出</el-button>
+    </div>
+    <el-descriptions title="" :column="2" :size="size" border>
+      <el-descriptions-item>
+        <template slot="label">
+          <i class="el-icon-user"></i>
+          会议时间
+        </template>
+        {{ m.beginTime }}至{{ m.endTime }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label">
+          <i class="el-icon-user"></i>
+          会议主持人
+        </template>
+        {{ m.emcee }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label">
+          <i class="el-icon-location-outline"></i>
+          会议地点
+        </template>
+        {{ m.meetingPlace }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label">
+          <i class="el-icon-user"></i>
+          会议记录人
+        </template>
+        {{ m.recorder }}
+      </el-descriptions-item>
+      <el-descriptions-item >
+        <template slot="label">
+          <i class="el-icon-user"></i>
+          参会人员
+        </template>
+        <span v-if="m.innerAttendees!=''" v-for="(item,index) in JSON.parse(m.innerAttendees)">
+          {{ item.name }}
+        </span>
+      </el-descriptions-item>
+      <el-descriptions-item >
+        <template slot="label">
+          <i class="el-icon-user"></i>
+          参会时长
+        </template>
+        <span>{{m.duration}}小时</span>
+      </el-descriptions-item>
+      <el-descriptions-item :span="2">
+        <template slot="label">
+          <i class="el-icon-office-building"></i>
+          参会情况
+        </template>
+        <span>{{m.remark}}</span>
+      </el-descriptions-item>
+    </el-descriptions>
+    <el-table
+      style="width: 100%" border stripe :data="tableData" :highlight-current-row="true"
+      :span-method="objectSpanMethod">
+      <el-table-column prop="group" label="序号" width="60" align="center">
+      </el-table-column>
+      <el-table-column
+        prop="userName"
+        label="姓名" align="center"
+        width="120">
+      </el-table-column>
+      <el-table-column label="本周工作总结" min-width="450">
+        <el-table-column label="工作内容" prop="taskName">
+        </el-table-column>
+        <el-table-column label="是否上周遗留" width="100" prop="lastWeekFlag">
+          <template slot-scope="scope">
+            <div v-if="scope.row.lastWeekFlag==='0'" style="color: darkred">是</div>
+            <div v-else="scope.row.lastWeekFlag==='1'">否</div>
+          </template>
+        </el-table-column>
+        <el-table-column label="完成情况说明" prop="progressValue" width="100">
+          <template slot-scope="scope">
+            <div style="color: darkgreen" @click="getTaskScheduleRemarks(scope.row)">{{ scope.row.progressValue }}%
+            </div>
+          </template>
+        </el-table-column>
+      </el-table-column>
+      <el-table-column prop="workplan" label="下周工作计划">
+        <el-table-column label="工作内容与完成时间" prop="planContent">
+          <template slot-scope="scope">
+            <div v-html="scope.row.planContent">
+            </div>
+          </template>
+        </el-table-column>
+      </el-table-column>
+      <el-table-column prop="scores" label="评分" width="150" align="center">
+        <template slot-scope="scope">
+         {{ scope.row.score}}
+        </template>
+      </el-table-column>
+      <el-table-column prop="remarks" label="备注">
+        <template slot-scope="scope">
+          <span>{{scope.row.remark}}</span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="workComments" label="工作评论">
+        <template slot-scope="scope">
+          <span>{{scope.row.workComment}}</span>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <el-dialog
+      :title="taskFeedbackTitle"
+      :visible.sync="taskFeedbackVisible"
+      width="30%"
+      :close-on-click-modal="false">
+      <div v-html="taskFeedbackContent"></div>
+      <span slot="footer" class="dialog-footer">
+      <el-button @click="taskFeedbackVisible = false" size="mini">取 消</el-button>
+      <el-button type="primary" @click="taskFeedbackVisible = false" size="mini">确 定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+<script>
+
+import {
+  getMeetingByWeekss,
+  getTaskScheduleRemark,
+  getWeeksRecordsByWeeks,
+  workComments,
+  workMeetingsUpdates
+} from '@/api/meeting/meeting'
+
+import {downloadPdf} from "@/api/meeting/meeting";
+
+
+export default {
+  name: 'weeklyRecordsConfirm',
+  data() {
+    return {
+      taskFeedbackTitle: '',
+      taskFeedbackVisible: false,
+      taskFeedbackContent: '',
+      title: '技术部周会',
+      size: '',
+      tableData: [],
+      meetingId: null,
+      weeks: null,
+      m: {
+        id: null,
+        meetingName: '',
+        external: 0,
+        meetingType: 1,
+        meetingPlace: null,
+        beginTime: null,
+        endTime: null,
+        outAttendees: null,
+        innerAttendees: '',
+        emcee: null,
+        recorder: null,
+        createUserId: 1,
+        createTime: null,
+        status: 1,
+        weeks: 46,
+        duration:1
+      },
+      workContents: {
+        col: 0,
+        row: 0
+      },
+      mergeObj: {}, // 用来记录需要合并行的下标
+      mergeArr: ['group', 'userName', 'planContent', 'scores', 'remarks', 'workComments'], // 表格中的列名
+
+
+    }
+  },
+  created() {
+
+  },
+  mounted() {
+    this.meetingId = this.$route.query.meetingId;
+    this.weeks = this.$route.query.weeks;
+    this.getData()
+  },
+  methods: {
+    getData() {
+      let meetingId = this.meetingId
+      let weeks = this.weeks
+      if (meetingId != null && weeks != null) {
+        getWeeksRecordsByWeeks(meetingId, weeks).then(res => {
+          this.tableData = res.data.workContent
+          this.getSpanArr(this.tableData);
+          this.m = res.data.meeting
+        })
+      } else {
+        //获取当前周会会议id与所属周数
+        getMeetingByWeekss().then(res => {
+          let data = res.data;
+          if (data != null) {
+            this.meetingId = data.id
+            this.weeks = data.weeks
+            getWeeksRecordsByWeeks(this.meetingId, this.weeks).then(res => {
+              this.tableData = res.data.workContent
+              this.getSpanArr(this.tableData);
+              this.m = res.data.meeting
+            })
+          } else {
+            this.tableData = []
+          }
+        })
+      }
+
+    },
+
+    objectSpanMethod({row, column, rowIndex, columnIndex}) {
+      if (this.mergeArr.indexOf(column.property) !== -1) {
+        // 判断其值是不是为0
+        if (this.mergeObj[column.property][rowIndex]) {
+          return [this.mergeObj[column.property][rowIndex], 1]
+        } else {
+          // 如果为0则为需要合并的行
+          return [0, 0];
+        }
+      }
+    },
+
+    getSpanArr(data) {
+      this.mergeArr.forEach((key, index1) => {
+        let count = 0; // 用来记录需要合并行的起始位置
+        this.mergeObj[key] = []; // 记录每一列的合并信息
+
+        data.forEach((item, index) => {
+          // index == 0表示数据为第一行,直接 push 一个 1
+          if (index === 0) {
+            this.mergeObj[key].push(1);
+            //item.group=index;
+          } else {
+            // 判断当前行是否与上一行其值相等 如果相等 在 count 记录的位置其值 +1 表示当前行需要合并 并push 一个 0 作为占位
+            if (item[key] === data[index - 1][key]) {
+              this.mergeObj[key][count] += 1;
+              this.mergeObj[key].push(0);
+              //item.group = this.tableData[index - 1].group;
+            } else {
+              // 如果当前行和上一行其值不相等
+              count = index; // 记录当前位置
+              this.mergeObj[key].push(1); // 重新push 一个 1
+              // item.group = this.tableData[index - 1].group + 1; //如果不一样 将组号设置为上一个数据的组号加1
+            }
+          }
+        })
+
+      })
+    },
+    workComment(row) {
+      let scoreId = row.scoreId
+      let score = row.score
+      let remark = row.remark
+      let meetingId = row.meetingId
+      let weeks = row.weeks;
+      let userId = row.executor
+      let workComment = row.workComment
+      if (scoreId === meetingId) {
+        scoreId = null
+      }
+      let data = {
+        id: scoreId,
+        score: score,
+        remark: remark,
+        weeks: weeks,
+        userId: userId,
+        workComment: workComment
+      }
+      workComments(data).then(res => {
+        this.$message({
+          message: '操作成功!',
+          type: 'success'
+        });
+        this.getData()
+      });
+    },
+    workMeetingsUpdate(m){
+      workMeetingsUpdates(m).then(res => {
+        this.$message({
+          message: '操作成功!',
+          type: 'success'
+        });
+        this.getData()
+      })
+
+    },
+    getTaskScheduleRemarks(row) {
+      this.taskFeedbackTitle = row.userName + ":" + row.taskName
+
+      getTaskScheduleRemark(row.taskId).then(res => {
+        let content = res.data;
+        let feedbackContent = '';
+        let j = 1;
+        for (let i = 0; i < content.length; i++) {
+          feedbackContent += j + ":" + content[i].description + "&nbsp;&nbsp;&nbsp;&nbsp;" + content[i].value + "%" + "&nbsp;&nbsp;&nbsp" + '</br>'
+          j++;
+        }
+        if (content.length === 0) {
+          feedbackContent = '暂无反馈'
+        }
+        this.taskFeedbackContent = feedbackContent
+      });
+      this.taskFeedbackVisible = true
+    },
+    exportPdf() {
+      downloadPdf(this.meetingId, this.weeks)
+    },
+  }
+
+}
+</script>
+
+