|
@@ -0,0 +1,165 @@
|
|
|
+<template>
|
|
|
+ <el-drawer
|
|
|
+ :title="title"
|
|
|
+ :modal-append-to-body="false"
|
|
|
+ :modal="false"
|
|
|
+ :wrapper-closable="false"
|
|
|
+ size="60%"
|
|
|
+ :visible.sync="dialogVisible"
|
|
|
+ >
|
|
|
+ <div class="content-container">
|
|
|
+ <el-card>
|
|
|
+ <div slot="header" class="clearfix">
|
|
|
+ <span>巡检任务</span>
|
|
|
+ </div>
|
|
|
+ <vuescroll :ops="ops">
|
|
|
+ <el-table ref="multipleTable" border :data="dataList" height="60vh" @selection-change="selectionChange">
|
|
|
+ <el-table-column
|
|
|
+ type="selection"
|
|
|
+ width="55"
|
|
|
+ />
|
|
|
+ <el-table-column type="index" label="序号" header-align="center" align="center" width="80" />
|
|
|
+ <el-table-column prop="checklistItemContent" label="检查项">
|
|
|
+ <template v-slot="{row}">
|
|
|
+ <span><i class="el-icon-tickets" /> {{ row.checklistItemContent }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- <el-table-column label="操作" header-align="center" align="center" width="180">
|
|
|
+ <template v-slot="{row}">
|
|
|
+ <el-button size="mini" icon="el-icon-view" type="primary" @click="handleUpdate(row)">编辑</el-button>
|
|
|
+ <el-button v-if="row.isFixed !== 1" size="mini" icon="el-icon-delete" type="danger" @click="handleDelete(row)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column> -->
|
|
|
+ </el-table>
|
|
|
+ <div class="btn-group">
|
|
|
+ <el-button type="primary" @click="handleSubmit">提交</el-button>
|
|
|
+ <el-button class="cancel-btn" @click="dialogVisible = false">取消</el-button>
|
|
|
+ </div>
|
|
|
+ </vuescroll>
|
|
|
+ </el-card>
|
|
|
+ <submit-activity ref="submit" title="登记隐患" />
|
|
|
+ </div>
|
|
|
+ </el-drawer>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import SubmitActivity from '@/views/goaf/danger/activity/Submit'
|
|
|
+import { getChecklistItemById } from '@/api/goaf/check'
|
|
|
+import { handleCheckTask } from '@/api/goaf/task'
|
|
|
+import { mapGetters } from 'vuex'
|
|
|
+import Vuescroll from 'vuescroll'
|
|
|
+export default {
|
|
|
+ name: 'ChecklistEdit',
|
|
|
+ components: {
|
|
|
+ Vuescroll,
|
|
|
+ SubmitActivity
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ title: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ ops: {
|
|
|
+ bar: {
|
|
|
+ keepShow: false,
|
|
|
+ background: 'rgba(144, 147, 153, 0.4)',
|
|
|
+ onlyShowBarOnScroll: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ dialogVisible: false,
|
|
|
+ viewData: {
|
|
|
+ 'checklistId': undefined,
|
|
|
+ 'ocId': '',
|
|
|
+ 'checklistTitle': '',
|
|
|
+ 'checklistDesc': '',
|
|
|
+ 'checklistItemId': undefined,
|
|
|
+ 'checklistItemContent': ''
|
|
|
+ },
|
|
|
+ dataList: [],
|
|
|
+ selection: []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapGetters([
|
|
|
+ 'userData'
|
|
|
+ ])
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ showView(data) {
|
|
|
+ this.dialogVisible = true
|
|
|
+ this.viewData = JSON.parse(JSON.stringify(data))
|
|
|
+ getChecklistItemById(data.checklistId).then((res) => {
|
|
|
+ this.dataList = res.data
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.dataList.forEach(item => {
|
|
|
+ this.$refs.multipleTable.toggleRowSelection(item)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ selectionChange(selection) {
|
|
|
+ this.selection = selection
|
|
|
+ },
|
|
|
+ handleSubmit() {
|
|
|
+ const allselect = this.dataList.length === this.selection.length
|
|
|
+ let checkItemNopass = ''
|
|
|
+ let checkItemPass = ''
|
|
|
+ const selectionItemIds = []
|
|
|
+ this.selection.forEach((item) => {
|
|
|
+ checkItemPass += item.checklistItemContent + ','
|
|
|
+ selectionItemIds.push(item.checklistItemId)
|
|
|
+ })
|
|
|
+ this.dataList.forEach(item => {
|
|
|
+ if (selectionItemIds.indexOf(item.checklistItemId) < 0) {
|
|
|
+ checkItemNopass += item.checklistItemContent + '不通过,'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ checkItemPass = checkItemPass.substring(0, checkItemPass.length - 1)
|
|
|
+ checkItemNopass = checkItemNopass.substring(0, checkItemNopass.length - 1)
|
|
|
+ handleCheckTask({
|
|
|
+ ...this.viewData,
|
|
|
+ 'handleAccountId': this.userData.userId,
|
|
|
+ 'handleAccountName': this.userData.userName,
|
|
|
+ 'handlePositionId': this.userData.positionId,
|
|
|
+ 'handlePositionName': this.userData.positionName,
|
|
|
+ 'handleGroupId': this.userData.groupId,
|
|
|
+ 'handleGroupName': this.userData.groupName,
|
|
|
+ 'status': 1,
|
|
|
+ 'checkResult': allselect ? 0 : 1,
|
|
|
+ checkItemPass,
|
|
|
+ checkItemNopass
|
|
|
+ }).then(() => {
|
|
|
+ this.dialogVisible = false
|
|
|
+ this.$emit('success')
|
|
|
+ if (!allselect) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs['submit'].start({
|
|
|
+ ...this.viewData,
|
|
|
+ checkItemNopass
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+ <style lang="scss" scoped> .btn-group {
|
|
|
+ margin-top: 20px;
|
|
|
+ .cancel-btn {
|
|
|
+ background: #004F7B;
|
|
|
+ border-color: #004F7B;
|
|
|
+ color: #FFF;
|
|
|
+ margin-left: 20px;
|
|
|
+ &:hover {
|
|
|
+ background: #026197;
|
|
|
+ border-color: #026197;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ </style>
|
|
|
+
|