123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280 |
- <template>
- <el-drawer
- :title="title"
- :modal-append-to-body="false"
- :modal="false"
- :wrapper-closable="false"
- size="99%"
- :visible.sync="dialogVisible"
- >
- <template slot="title">
- <div class="el-drawer-title">
- <span class="name">{{ title }}</span>
- <el-tabs v-model="tabType">
- <el-tab-pane label="基本信息" name="form" />
- <el-tab-pane label="历史记录" name="history" />
- </el-tabs>
- </div>
- </template>
- <div class="content-container">
- <el-row class="content-body">
- <div v-show="tabType==='form'">
- <Vuescroll :ops="ops" style="height: calc(100vh - 400px)">
- <DangerInfo :view-data="viewData" class="form" />
- <work-flow ref="WFlow" handle-user="整改人" />
- </Vuescroll>
- <div class="btn-group">
- <el-button type="primary" @click="submitForm('ruleForm')">提交</el-button>
- <el-button @click="dialogVisible = false">取消</el-button>
- </div>
- </div>
- <div v-show="tabType==='history'">
- <ActivityHandleRecord ref="ActivityHandleRecord" />
- </div>
- </el-row>
- </div>
- </el-drawer>
- </template>
- <script>
- import { updateDanger, getDangerById } from '@/api/goaf/dangerApi'
- import Vuescroll from 'vuescroll'
- import { WorkFlow, ActivityHandleRecord } from '@/components'
- import DangerInfo from '../components/DangerInfo'
- export default {
- name: 'ReviewTask',
- components: { Vuescroll, DangerInfo, WorkFlow, ActivityHandleRecord },
- filters: {},
- props: {
- title: {
- type: [String],
- default: ''
- }
- },
- data() {
- return {
- ops: {
- bar: {
- keepShow: false,
- background: 'rgba(144, 147, 153, 0.4)',
- onlyShowBarOnScroll: false
- }
- },
- dialogVisible: false,
- tabType: 'form',
- rules: { },
- viewData: {
- hdangerId: undefined,
- dangerCode: '',
- dangerTitle: '',
- dangerSource: undefined,
- dangerDesc: '',
- dangerLevel: undefined,
- dangerCatId: undefined,
- dangerCatTitle: '',
- riskPointId: undefined,
- riskPointTitle: '',
- submitGroupId: undefined,
- submitGroupName: '',
- submitPositionId: undefined,
- submitPositionName: '',
- submitAccountId: undefined,
- submitAccountName: '',
- submitTime: '',
- dangerDeadLine: '',
- reviewGroupId: undefined,
- reviewGroupName: '',
- reviewPositionId: undefined,
- reviewPositionName: '',
- reviewAccountId: undefined,
- reviewAccountName: '',
- reviewTime: '',
- rectifyGroupId: undefined,
- rectifyGroupName: '',
- rectifyPositionId: undefined,
- rectifyPositionName: '',
- rectifyAccountId: undefined,
- rectifyAccountName: '',
- dangerReason: '',
- rectifyCat: 1,
- rectifyMeasure: '',
- rectifyRemark: '',
- rectifyTime: '',
- acceptGroupId: undefined,
- acceptGroupName: '',
- acceptPositionId: undefined,
- acceptPositionName: '',
- acceptAccountId: undefined,
- acceptAccountName: '',
- acceptTime: '',
- status: 0,
- attachList: []
- },
- formData: {
- formCode: 'review',
- hdangerId: undefined,
- status: 0,
- attachList: []
- }
- }
- },
- mounted() {
- },
- methods: {
- previewList(photos) {
- if (!photos) return null
- if (Array.isArray(photos)) {
- const list = photos.map((item) => {
- return item.fileUrl
- })
- return list
- }
- return [photos.fileUrl]
- },
- // 显示窗口
- showModel(hdangerId, info) {
- this.resetFormData()
- this.dialogVisible = true
- getDangerById(hdangerId).then((resp) => {
- const { code, data, msg } = resp
- if (code === 0) {
- this.viewData = info || data
- this.$refs.WFlow.get(hdangerId)
- this.$refs.ActivityHandleRecord.getData(hdangerId)
- } else {
- this.$message.error(msg)
- }
- }).catch((error) => {
- console.log(error)
- })
- },
- // 重置
- resetFormData() {
- this.formData = {
- formCode: 'review',
- hdangerId: undefined,
- status: 0,
- attachList: []
- }
- },
- // 保存
- submitForm(formName) {
- this.$nextTick(() => {
- this.$refs.WFlow.handle({}).then((res) => {
- if (res === false) {
- this.$message.error('请检查填写信息')
- return false
- }
- this.handleCommand(res)
- }).catch((error) => {
- console.log(error)
- })
- })
- },
- // 处理
- handleCommand(flow) {
- this.formData.hdangerId = this.viewData.hdangerId
- if (flow.curActivityCode === 'review') {
- this.formData.status = 1
- }
- if (flow.curActivityCode === 'rectify') {
- this.formData.status = 2
- }
- if (flow.curActivityCode === 'accept') {
- this.formData.status = 3
- }
- this.formData.reviewRemark = flow.data.actionRemark
- this.formData.attachList = flow.data.attachList
- this.formData.reviewAccountId = flow.user.accountIdTo
- this.formData.reviewAccountName = flow.user.accountNameTo
- this.formData.reviewGroupId = flow.user.groupIdTo
- this.formData.reviewGroupName = flow.user.groupNameTo
- this.formData.reviewPositionId = flow.user.positionIdTo
- this.formData.reviewPositionName = flow.user.positionNameTo
- updateDanger(this.formData).then((resp) => {
- const { code, msg } = resp
- if (code === 0) {
- this.dialogVisible = false
- this.$message.success(msg)
- this.$emit('formSuccess')
- } else {
- this.$message.error(msg)
- }
- }).catch((error) => {
- console.log(error)
- })
- },
- formSuccess() {
- this.$emit('formSuccess')
- },
- resetFormField(formName) {
- this.$refs[formName].resetFields()
- }
- }
- }
- </script>
- <style lang="scss">
- </style>
- <style lang="scss" scoped>
- .hd-info-component {
- margin: 15px;
- position: relative;
- height: calc(100% - 15px);
- .btn-group {
- position: absolute;
- bottom: 0;
- left: 0;
- width: 100%;
- .el-button {
- width: 100%;
- margin: 0 0 15px;
- }
- .cancel-btn {
- background: #004F7B;
- border-color: #004F7B;
- color: #FFF;
- &:hover {
- background: #026197;
- border-color: #026197;
- }
- }
- }
- .el-row {
- margin-bottom: 20px;
- margin-top: 20px;
- text-align: center;
- &:last-child {
- margin-bottom: 0;
- }
- .el-button {
- width: 10%;
- }
- }
- }
- </style>
|