|
|
@@ -4,74 +4,97 @@
|
|
|
:modal-append-to-body="false"
|
|
|
:modal="false"
|
|
|
:wrapper-closable="false"
|
|
|
- size="30%"
|
|
|
+ size="99%"
|
|
|
:visible.sync="dialogVisible"
|
|
|
>
|
|
|
+ <template slot="title">
|
|
|
+ <div class="el-drawer-title">
|
|
|
+ <span class="name">{{ title }}</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
<div class="content-container">
|
|
|
- <vuescroll :ops="ops" style="height: calc(100vh - 200px)">
|
|
|
- <el-form ref="ruleForm" :model="formData" :rules="rules" label-width="120px">
|
|
|
- <el-form-item label="告警位置" prop="riskPointId">
|
|
|
- <risk-point-selector v-model="formData.riskPointId" />
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
- <el-form-item label="告警标题" prop="alertTitle">
|
|
|
- <el-input v-model="formData.alertTitle" />
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
- <el-form-item label="等级" prop="alertLevel">
|
|
|
- <el-select v-model="formData.alertLevel">
|
|
|
- <el-option-group>
|
|
|
- <el-option
|
|
|
- v-for="item in alertLevelList"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
+ <el-row class="content-body">
|
|
|
+ <div v-show="tabType==='form'">
|
|
|
+ <vuescroll :ops="ops" style="height: calc(100vh - 300px)">
|
|
|
+ <el-form ref="ruleForm" :model="formData" :rules="rules" label-width="130px">
|
|
|
+ <el-form-item label="隐患标题" prop="hdangerTitle">
|
|
|
+ <el-input v-model="formData.hdangerTitle" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="采空区" prop="goafId">
|
|
|
+ <el-select v-model="formData.goafId" filterable placeholder="采空区名称" style="width: 100%">
|
|
|
+ <el-option value="" label="请选择采空区" disabled />
|
|
|
+ <el-option v-for="item in goafs" :key="item.goafId" :value="item.goafId" :label="item.goafName" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="检查表" prop="checklistId">
|
|
|
+ <el-select v-model="formData.checklistId" style="width: 100%" filterable placeholder="检查表">
|
|
|
+ <el-option
|
|
|
+ v-for="item in checklist"
|
|
|
+ :key="item.checklistId"
|
|
|
+ :label="item.checklistTitle"
|
|
|
+ :value="item.checklistId"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="隐患等级" prop="hdangerLevel">
|
|
|
+ <el-radio-group v-model="formData.hdangerLevel">
|
|
|
+ <el-radio :label="0">较低</el-radio>
|
|
|
+ <el-radio :label="1">一般</el-radio>
|
|
|
+ <el-radio :label="2">较大</el-radio>
|
|
|
+ <el-radio :label="3">重大</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="发生时间" prop="submitTime">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="formData.submitTime"
|
|
|
+ type="date"
|
|
|
+ placeholder="设置发生时间"
|
|
|
+ format="yyyy-MM-dd HH:mm:ss"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
+ clearable
|
|
|
+ style="width: 100%"
|
|
|
/>
|
|
|
- </el-option-group>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
- <el-form-item label="简要描述" prop="alertDesc">
|
|
|
- <el-input v-model="formData.alertDesc" type="textarea" :rows="4" placeholder="描述" />
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
- <el-form-item label="附件" prop="attachList">
|
|
|
- <card-upload v-model="formData.attachList" />
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
- <el-form-item label="处理人员" prop="accountIdTo">
|
|
|
- <user-selector :default-val="formData.accountIdTo" @setUserInfo="handleSelectUser" />
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
- <el-form-item label="说明" prop="actionRemark">
|
|
|
- <el-input v-model="formData.actionRemark" type="textarea" :rows="5" placeholder="说明" />
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </vuescroll>
|
|
|
-
|
|
|
- <div class="btn-group">
|
|
|
- <el-button
|
|
|
- v-for="(item,index) in flowData.activityIns.actionList"
|
|
|
- :key="index"
|
|
|
- type="primary"
|
|
|
- @click="submitForm('ruleForm', item.actionId, item.actionCode)"
|
|
|
- >{{ item.actionTitle }} </el-button>
|
|
|
- <el-button class="cancel-btn" @click="dialogVisible = false">取 消</el-button>
|
|
|
- </div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="整改截止时间" prop="dangerDeadline">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="formData.dangerDeadline"
|
|
|
+ type="date"
|
|
|
+ placeholder="设置截止时间"
|
|
|
+ format="yyyy-MM-dd HH:mm:ss"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
+ clearable
|
|
|
+ style="width: 100%"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="描述" prop="hdangerDesc">
|
|
|
+ <el-input v-model="formData.hdangerDesc" type="textarea" :rows="5" placeholder="隐患描述" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <work-flow ref="WFlow" handle-user="评审人" />
|
|
|
+ <div class="btn-group">
|
|
|
+ <el-button type="primary" @click="submitForm('ruleForm')">提交</el-button>
|
|
|
+ <el-button @click="dialogVisible = false">取消</el-button>
|
|
|
+ </div>
|
|
|
+ </vuescroll>
|
|
|
+ </div>
|
|
|
+ </el-row>
|
|
|
</div>
|
|
|
-
|
|
|
</el-drawer>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { startAlert, handleAlert, getAlertById } from '@/api/aqpt/alertApi'
|
|
|
-import { UserSelector, CardUpload } from '@/components'
|
|
|
-import { RiskPointSelector } from '@/views/aqpt/components'
|
|
|
+import { getChecklist } from '@/api/goaf/check'
|
|
|
+import { handleDanger, getDangerById } from '@/api/goaf/dangerApi'
|
|
|
+import { getGoafBaseInfo } from '@/api/goaf/info'
|
|
|
import Vuescroll from 'vuescroll'
|
|
|
-
|
|
|
+import { mapGetters } from 'vuex'
|
|
|
+import { WorkFlow } from '@/components'
|
|
|
export default {
|
|
|
name: 'SubmitTask',
|
|
|
- components: { Vuescroll, CardUpload, UserSelector, RiskPointSelector },
|
|
|
+ components: {
|
|
|
+ Vuescroll,
|
|
|
+ WorkFlow
|
|
|
+ },
|
|
|
props: {
|
|
|
title: {
|
|
|
type: String,
|
|
|
@@ -88,55 +111,46 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
dialogVisible: false,
|
|
|
-
|
|
|
+ tabType: 'form',
|
|
|
formData: {
|
|
|
- alertId: undefined,
|
|
|
- riskPointId: undefined,
|
|
|
- alertLevel: 6,
|
|
|
- alertTitle: '', // 预警标题
|
|
|
- alertDesc: '', // 描述
|
|
|
-
|
|
|
- wfDefId: undefined,
|
|
|
- wfInsId: undefined,
|
|
|
- activityDefId: undefined,
|
|
|
- activityInsId: undefined,
|
|
|
- activityCode: '',
|
|
|
- actionId: undefined,
|
|
|
- actionCode: '',
|
|
|
-
|
|
|
- groupIdTo: undefined,
|
|
|
- positionIdTo: undefined,
|
|
|
- accountIdTo: undefined, // 执行人
|
|
|
-
|
|
|
- actionRemark: '', // 说明
|
|
|
- attachList: []
|
|
|
+ 'formCode': 'submit',
|
|
|
+ 'hdangerId': 1,
|
|
|
+ 'dangerId': undefined,
|
|
|
+ 'hdangerTitle': '', // 隐患标题
|
|
|
+ 'dangerCatId': undefined, // 隐患类别ID
|
|
|
+ 'hdangerLevel': 1, // 隐患等级
|
|
|
+ 'hdangerDesc': '', // 描述
|
|
|
+ 'submitTime': new Date(),
|
|
|
+ 'dangerDeadline': '', // 截止时间
|
|
|
+ 'goafId': undefined,
|
|
|
+ 'submitGroupId': '',
|
|
|
+ 'submitGroupName': '',
|
|
|
+ 'submitPositionId': '',
|
|
|
+ 'submitPositionName': '',
|
|
|
+ 'submitAccountId': '',
|
|
|
+ 'submitAccountName': '',
|
|
|
+ 'checklistId': ''
|
|
|
},
|
|
|
-
|
|
|
- flowData: {
|
|
|
- activityIns: {
|
|
|
- actionList: []
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- alertLevelList: [
|
|
|
- { value: 0, label: '未知' },
|
|
|
- { value: 1, label: '1级' },
|
|
|
- { value: 2, label: '2级' },
|
|
|
- { value: 3, label: '3级' },
|
|
|
- { value: 4, label: '4级' },
|
|
|
- { value: 5, label: '5级' },
|
|
|
- { value: 6, label: '6级' }
|
|
|
- ],
|
|
|
-
|
|
|
+ goafs: [],
|
|
|
+ checklist: [],
|
|
|
rules: {
|
|
|
- riskPointId: [
|
|
|
- { required: true, message: '请选择风险点', trigger: 'blur' }
|
|
|
+ hdangerTitle: [
|
|
|
+ { required: true, message: '请输入隐患标题', trigger: 'blur' }
|
|
|
],
|
|
|
- alertTitle: [
|
|
|
- { required: true, message: '请输入标题', trigger: 'blur' }
|
|
|
+ goafId: [
|
|
|
+ { required: true, message: '请选择采空区', trigger: 'change' }
|
|
|
],
|
|
|
- alertLevel: [
|
|
|
- { required: true, message: '请选择等级', trigger: 'blur' }
|
|
|
+ checklistId: [
|
|
|
+ { required: true, message: '请选择检查表', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ hdangerLevel: [
|
|
|
+ { required: true, message: '请输选择隐患等级', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ submitTime: [
|
|
|
+ { required: true, message: '发生时间', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ dangerDeadline: [
|
|
|
+ { required: true, message: '截止时间', trigger: 'blur' }
|
|
|
],
|
|
|
accountIdTo: [
|
|
|
{ required: true, message: '请选择执行人', trigger: 'blur' }
|
|
|
@@ -144,51 +158,46 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- mounted() {},
|
|
|
+ computed: {
|
|
|
+ ...mapGetters([
|
|
|
+ 'userData'
|
|
|
+ ])
|
|
|
+ },
|
|
|
methods: {
|
|
|
|
|
|
- // 附件
|
|
|
- attachListChange(dataList) {
|
|
|
- this.formData.attachList = dataList
|
|
|
- },
|
|
|
-
|
|
|
- // Task Start View
|
|
|
+ // 启动
|
|
|
start() {
|
|
|
- this.resetFormData()
|
|
|
+ const wfDefId = 1
|
|
|
this.dialogVisible = true
|
|
|
+ const userData = JSON.parse(JSON.stringify(this.userData))
|
|
|
+ this.formData.ocId = userData.ocId
|
|
|
|
|
|
- startAlert().then((resp) => {
|
|
|
- const { code, data, msg } = resp
|
|
|
- if (code === 0) {
|
|
|
- this.flowData = data
|
|
|
- this.formData.wfDefId = data.wfDefId
|
|
|
- this.formData.wfInsId = data.wfInsId
|
|
|
- this.formData.activityDefId = data.activityIns.activityDefId
|
|
|
- this.formData.activityInsId = data.activityIns.activityInsId
|
|
|
- this.formData.activityCode = data.activityIns.activityCode
|
|
|
- } else {
|
|
|
- this.$message.error(msg)
|
|
|
- }
|
|
|
- }).catch((error) => {
|
|
|
- console.log(error)
|
|
|
+ getChecklist().then((res) => {
|
|
|
+ this.checklist = res.data
|
|
|
+ })
|
|
|
+ getGoafBaseInfo().then((res) => {
|
|
|
+ this.goafs = res.data
|
|
|
+ })
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.WFlow.start(wfDefId).then((res) => {
|
|
|
+ if (res > 0) {
|
|
|
+ this.formData.hdangerId = res
|
|
|
+ } else {
|
|
|
+ this.$message.error('流程初始化失败')
|
|
|
+ }
|
|
|
+ })
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- // Task Handling View
|
|
|
- handle(alertId) {
|
|
|
+ // 显示窗口
|
|
|
+ showModel(dangerId) {
|
|
|
this.resetFormData()
|
|
|
this.dialogVisible = true
|
|
|
- getAlertById(alertId).then((resp) => {
|
|
|
+ getDangerById(dangerId).then((resp) => {
|
|
|
const { code, data, msg } = resp
|
|
|
if (code === 0) {
|
|
|
- this.formData = data.data
|
|
|
- const flow = data.flow
|
|
|
- this.flowData = flow
|
|
|
- this.formData.wfDefId = flow.wfDefId
|
|
|
- this.formData.wfInsId = flow.wfInsId
|
|
|
- this.formData.activityDefId = flow.activityIns.activityDefId
|
|
|
- this.formData.activityInsId = flow.activityIns.activityInsId
|
|
|
- this.formData.activityCode = flow.activityIns.activityCode
|
|
|
+ this.formData = data
|
|
|
+ this.$refs.WFlow.get(dangerId)
|
|
|
} else {
|
|
|
this.$message.error(msg)
|
|
|
}
|
|
|
@@ -197,64 +206,82 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- // Select User
|
|
|
- handleSelectUser(item) {
|
|
|
- this.formData.accountIdTo = item.accountId
|
|
|
- this.formData.groupIdTo = item.groupId
|
|
|
- this.formData.positionIdTo = item.positionId
|
|
|
- },
|
|
|
-
|
|
|
- // Reset Form Data
|
|
|
resetFormData() {
|
|
|
this.formData = {
|
|
|
- alertId: undefined,
|
|
|
- riskPointId: undefined,
|
|
|
- alertLevel: 6,
|
|
|
- alertTitle: '', // 预警标题
|
|
|
- alertDesc: '', // 描述
|
|
|
-
|
|
|
- wfDefId: undefined,
|
|
|
- wfInsId: undefined,
|
|
|
- activityDefId: undefined,
|
|
|
- activityInsId: undefined,
|
|
|
- activityCode: '',
|
|
|
- actionId: undefined,
|
|
|
- actionCode: '',
|
|
|
-
|
|
|
- groupIdTo: undefined,
|
|
|
- positionIdTo: undefined,
|
|
|
- accountIdTo: undefined, // 执行人
|
|
|
-
|
|
|
- actionRemark: '', // 说明
|
|
|
- attachList: []
|
|
|
+ 'formCode': 'submit',
|
|
|
+ 'hdangerId': 1,
|
|
|
+ 'dangerId': undefined,
|
|
|
+ 'hdangerTitle': '', // 隐患标题
|
|
|
+ 'dangerCatId': undefined, // 隐患类别ID
|
|
|
+ 'hdangerLevel': 1, // 隐患等级
|
|
|
+ 'hdangerDesc': '', // 描述
|
|
|
+ 'submitTime': new Date(),
|
|
|
+ 'dangerDeadline': '', // 截止时间
|
|
|
+ 'goafId': undefined,
|
|
|
+ 'submitGroupId': '',
|
|
|
+ 'submitGroupName': '',
|
|
|
+ 'submitPositionId': '',
|
|
|
+ 'submitPositionName': '',
|
|
|
+ 'submitAccountId': '',
|
|
|
+ 'submitAccountName': '',
|
|
|
+ 'checklistId': ''
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
- // Submit Flow
|
|
|
- submitForm(formName, actionId, actionCode) {
|
|
|
- this.formData.actionId = actionId
|
|
|
- this.formData.actionCode = actionCode
|
|
|
- this.$refs[formName].validate((valid) => {
|
|
|
+ // 保存
|
|
|
+ submitForm() {
|
|
|
+ this.$refs['ruleForm'].validate((valid) => {
|
|
|
if (valid) {
|
|
|
- handleAlert(this.formData).then((resp) => {
|
|
|
- const { code, msg } = resp
|
|
|
- if (code === 0) {
|
|
|
- this.dialogVisible = false
|
|
|
- this.formSuccess()
|
|
|
- this.$message.success(msg)
|
|
|
- } else {
|
|
|
- this.$message.error(msg)
|
|
|
- }
|
|
|
- }).catch((error) => {
|
|
|
- console.log(error)
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.WFlow.handle({}).then((res) => {
|
|
|
+ this.handleCommand(res)
|
|
|
+ }).catch((error) => {
|
|
|
+ console.log(error)
|
|
|
+ })
|
|
|
})
|
|
|
} else {
|
|
|
- console.log('error submit!!')
|
|
|
- return false
|
|
|
+ this.$message.error('提交失败请检查')
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
|
|
|
+ // 提交
|
|
|
+ handleCommand(flow) {
|
|
|
+ const attachList = flow.data.attachList
|
|
|
+ this.formData.submitRemark = flow.data.actionRemark
|
|
|
+ this.formData.attachList = attachList
|
|
|
+ if (Array.isArray(attachList) && attachList.length > 0) {
|
|
|
+ const attach = attachList[0]
|
|
|
+ this.formData.scenePhoto = attach.fileUrl
|
|
|
+ this.formData.sceneIcon = attach.fileIcon
|
|
|
+ }
|
|
|
+ this.formData.submitGroupId = this.userData.groupId
|
|
|
+ this.formData.submitGroupName = this.userData.groupName
|
|
|
+ this.formData.submitPositionId = this.userData.positionId
|
|
|
+ this.formData.submitPositionName = this.userData.positionName
|
|
|
+ this.formData.submitAccountId = this.userData.userId
|
|
|
+ this.formData.submitAccountName = this.userData.userName
|
|
|
+
|
|
|
+ if (flow.curActivityCode === 'review') {
|
|
|
+ this.formData.status = 1
|
|
|
+ }
|
|
|
+ if (flow.curActivityCode === 'rectify') {
|
|
|
+ this.formData.status = 2
|
|
|
+ }
|
|
|
+ if (flow.curActivityCode === 'accept') {
|
|
|
+ this.formData.status = 3
|
|
|
+ }
|
|
|
+
|
|
|
+ handleDanger(this.formData).then((resp) => {
|
|
|
+ const { code, msg } = resp
|
|
|
+ if (code === 0) {
|
|
|
+ this.$emit('formSuccess')
|
|
|
+ this.dialogVisible = false
|
|
|
+ this.$message.success(msg)
|
|
|
+ } else {
|
|
|
+ this.$message.error(msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
formSuccess() {
|
|
|
this.$emit('formSuccess')
|
|
|
},
|
|
|
@@ -273,6 +300,10 @@ export default {
|
|
|
.content-container {
|
|
|
position: relative;
|
|
|
height: calc(100% - 15px);
|
|
|
+ .ruleForm {
|
|
|
+ margin: 0 100px;
|
|
|
+ }
|
|
|
+
|
|
|
.btn-group {
|
|
|
width: 100%;
|
|
|
text-align: center;
|