index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  1. <template >
  2. <div class="app-container">
  3. <!-- 顶部工具栏 -->
  4. <el-row :gutter="10">
  5. <div class="top-right-btn">
  6. <el-row>
  7. <el-tooltip effect="dark" :content="$t('tagsView.refresh')" placement="top">
  8. <el-button size="mini" circle icon="el-icon-refresh" @click="getList()" />
  9. </el-tooltip>
  10. </el-row>
  11. </div>
  12. </el-row>
  13. <el-table v-loading="loading" :data="approvedangerList" @selection-change="handleSelectionChange" :height="clientHeight" border>
  14. <el-table-column type="selection" width="55" align="center" />
  15. <el-table-column :label="$t('流程')+' '+ $t('ID')" align="center" prop="processId" :show-overflow-tooltip="true"/>
  16. <el-table-column :label="$t('流程')+' ' + $t('名称')" align="center" prop="processName" :show-overflow-tooltip="true"/>
  17. <el-table-column :label="$t('流程')+' ' + $t('创建时间')" align="center" prop="processCreateTime" :show-overflow-tooltip="true"/>
  18. <el-table-column :label="$t('待办任务')+' ' + $t('名称')" align="center" prop="taskName" :show-overflow-tooltip="true"/>
  19. <el-table-column :label="$t('待办任务')+' ' + $t('创建时间')" align="center" prop="taskCreateTime" :show-overflow-tooltip="true"/>
  20. <el-table-column :label="$t('申请编号')" align="center" prop="apNo" :show-overflow-tooltip="true">
  21. <!-- <template slot-scope="scope">-->
  22. <!-- <span v-if="scope.row.processName === ($t('事件') + $t('审批流程')) ">{{scope.row.tApproveAccident.approveNo}}</span>-->
  23. <!-- <span v-if="scope.row.processName === ($t('重大隐患') + $t('审批流程') )|| scope.row.processName === ($t('普通隐患') + $t('审批流程') )">{{scope.row.tApprove.approveNo}}</span>-->
  24. <!-- </template>-->
  25. </el-table-column>
  26. <el-table-column :label="$t('操作')" align="center" width="120" class-name="small-padding fixed-width">
  27. <template slot-scope="scope">
  28. <el-button
  29. size="mini"
  30. type="text"
  31. icon="el-icon-edit"
  32. @click="addOrUpdateHandle(scope.row)"
  33. >{{ $t('处理') }}</el-button>
  34. <el-button
  35. size="mini"
  36. type="text"
  37. @click="processImg(scope.row.processId)"
  38. >{{ $t('流程图') }}</el-button>
  39. </template>
  40. </el-table-column>
  41. </el-table>
  42. <pagination
  43. v-show="total>0"
  44. :total="total"
  45. :page.sync="queryParams.pageNum"
  46. :limit.sync="queryParams.pageSize"
  47. @pagination="getList"
  48. />
  49. <!-- 弹窗, 新增 / 修改 -->
  50. <div v-if="addOrUpdateVisible">
  51. <el-dialog v-dialogDrag :visible.sync="addOrUpdateVisible" :destroy-on-close="true">
  52. <add-or-update v-if="this.infoprocessName === ($t('重大隐患')+' '+ $t('审批流程') )|| this.infoprocessName === ($t('普通隐患')+' ' + $t('审批流程') )" :info="approveInfo"></add-or-update>
  53. <accident v-if="this.infoprocessName === ($t('事件')+ $t('审批流程'))" :info="approveInfo" @recordInfo="approveChange($event)"></accident>
  54. <el-form>
  55. <el-form-item :label="$t('上传措施前照片')" prop="before" v-if="this.infoTaskName === '执行人'">
  56. <el-upload
  57. ref="uploadbefore"
  58. :limit="1"
  59. :headers="uploadbefore.headers"
  60. :action="uploadbefore.url"
  61. :disabled="uploadbefore.isUploading"
  62. :on-progress="handleFileUploadProgressBefore"
  63. :on-success="handleFileSuccessBefore"
  64. :auto-upload="true"
  65. drag
  66. >
  67. <i class="el-icon-upload"></i>
  68. <div class="el-upload__text">
  69. {{ $t('将文件拖到此处,或') }}
  70. <em>{{ $t('点击上传') }}</em>
  71. </div>
  72. </el-upload>
  73. </el-form-item>
  74. <el-form-item :label="$t('上传措施后照片')" prop="after" v-if="this.infoTaskName === $t('执行人')">
  75. <el-upload
  76. ref="uploadafter"
  77. :limit="1"
  78. :headers="uploadafter.headers"
  79. :action="uploadafter.url"
  80. :disabled="uploadafter.isUploading"
  81. :on-progress="handleFileUploadProgressAfter"
  82. :on-success="handleFileSuccessAfter"
  83. drag
  84. >
  85. <i class="el-icon-upload"></i>
  86. <div class="el-upload__text">
  87. {{ $t('将文件拖到此处,或') }}
  88. <em>{{ $t('点击上传') }}</em>
  89. </div>
  90. </el-upload>
  91. </el-form-item>
  92. <el-form-item :label="$t('审批意见')" prop="comment">
  93. <el-input v-model="comment" :placeholder="$t('请输入') + $t('审批意见')" maxlength="100" show-word-limit></el-input>
  94. </el-form-item>
  95. </el-form>
  96. <span v-if="this.infoprocessName === ($t('重大隐患')+' ' + $t('审批流程') ) || this.infoprocessName === ($t('普通隐患')+' ' + $t('审批流程') )" slot="footer">
  97. <span v-if="this.infoTaskName === $t('执行人')" class="dialog-footer">
  98. <el-button type="primary" @click="dataFormSubmit(1)">{{ $t('已完成') }}</el-button>
  99. <el-button type="danger" @click="dataFormSubmit(0)">{{ $t('无法执行') }}</el-button>
  100. </span>
  101. <span v-if="this.infoTaskName === $t('验证人')" class="dialog-footer">
  102. <el-button type="primary" @click="dataFormSubmit(1)">{{ $t('通过') }}</el-button>
  103. <el-button type="danger" @click="dataFormSubmit(0)">{{ $t('无效') }}</el-button>
  104. <el-button type="warning" @click="dataFormSubmit(2)">{{ $t('未达标') }}</el-button>
  105. </span>
  106. <span v-if="this.infoTaskName === $t('记录人')" class="dialog-footer">
  107. <el-button type="primary" @click="dataFormSubmit(1)">{{ $t('重新提交') }}</el-button>
  108. </span>
  109. <span v-if="this.infoTaskName === $t('确认')" class="dialog-footer">
  110. <el-button type="primary" @click="dataFormSubmit(1)">{{ $t('确认') }}</el-button>
  111. <el-button type="danger" @click="dataFormSubmit(0)">{{ $t('确认')+' ' + $t('不通过') }}</el-button>
  112. </span>
  113. </span>
  114. <span v-if="this.infoprocessName === ($t('事件') + $t('审批流程'))" slot="footer">
  115. <span v-if="this.infoTaskName === $t('记录人')" class="dialog-footer">
  116. <el-button type="primary" @click="dataFormSubmit(1)">{{ $t('提交') }}</el-button>
  117. </span>
  118. </span>
  119. </el-dialog>
  120. </div>
  121. <add-or-update v-if="specDealVisible" ref="specDeal" @refreshDataList="getList"></add-or-update>
  122. <spec-modify v-if="specModifyDealVisible" ref="specModifyDeal" @refreshDataList="getList"></spec-modify>
  123. <spec-training-plan v-if="specTrainingPlanDealVisible" ref="specTrainingPlanDeal" @refreshDataList="getList"></spec-training-plan>
  124. <process-img v-if="processImgVisible" ref="processImg" @refreshDataList="getList"></process-img>
  125. <intact-resolve v-if="intactResolveVisible" ref="intactResolveDeal" @refreshDataList="getList"></intact-resolve>
  126. <spec-maintenance v-if="specMaintenanceVisible" ref="specMaintenance" @refreshDataList="getList"></spec-maintenance>
  127. </div>
  128. </template>
  129. <script>
  130. import {getPendinglist, handleApprovedanger} from "@/api/ehs/approvedanger";
  131. import AddOrUpdate from './spec-detail';
  132. import SpecModify from './specModify-deal';
  133. import SpecTrainingPlan from './specTrainingPlan-deal';
  134. import IntactResolve from '../approveDetail/intact-resolve';
  135. import Accident from '../approveaccidentDetail/index';
  136. import ProcessImg from '../processImg/index';
  137. import {treeselect} from "@/api/system/dept";
  138. import {getToken} from "@/utils/auth";
  139. import Treeselect from "@riophae/vue-treeselect";
  140. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  141. import SpecMaintenance from "@/views/approve/pending/specMaintenance-deal";
  142. export default {
  143. name: "Pending",
  144. components: {
  145. Treeselect,
  146. AddOrUpdate,
  147. SpecModify,
  148. Accident,
  149. SpecTrainingPlan,
  150. ProcessImg,
  151. IntactResolve,
  152. SpecMaintenance
  153. },
  154. data() {
  155. return {
  156. // 遮罩层
  157. loading: true,
  158. //弹窗界面是否开启
  159. addOrUpdateVisible: false,
  160. processImgVisible: false,
  161. specDealVisible: false,
  162. specModifyDealVisible: false,
  163. specTrainingPlanDealVisible: false,
  164. intactResolveVisible:false,
  165. specMaintenanceVisible: false,
  166. // 选中数组
  167. ids: [],
  168. // 非单个禁用
  169. single: true,
  170. // 非多个禁用
  171. multiple: true,
  172. // 显示搜索条件
  173. showSearch: false,
  174. // 总条数
  175. total: 0,
  176. // 我的申请表格数据
  177. approvedangerList: [],
  178. // 弹出层标题
  179. title: "",
  180. // 部门树选项
  181. deptOptions: undefined,
  182. clientHeight:300,
  183. // 是否显示弹出层
  184. open: false,
  185. // 装置名称字典
  186. plantCodeOptions: [],
  187. // 查询参数
  188. queryParams: {
  189. pageNum: 1,
  190. pageSize: 20,
  191. plantCode: null,
  192. recorderId: null,
  193. hiddendangerLevel: null,
  194. hiddendangerContent: null,
  195. measures: null,
  196. completeTime: null,
  197. status: null,
  198. creattime: null,
  199. endtime: null,
  200. processId: null,
  201. approveNo: null,
  202. deptId: null,
  203. },
  204. // 措施前上传照片参数
  205. uploadbefore: {
  206. file: "",
  207. // 是否禁用上传
  208. isUploading: false,
  209. // 是否更新已经存在的用户数据
  210. updateSupport: 0,
  211. // 设置上传的请求头部
  212. headers: { Authorization: "Bearer " + getToken() },
  213. // 上传的地址
  214. url: process.env.VUE_APP_BASE_API + "/common/upload",
  215. // 报告附件上传位置编号
  216. ids: 0,
  217. commonfileList: null,
  218. },
  219. // 措施后上传照片参数
  220. uploadafter: {
  221. file: "",
  222. // 是否禁用上传
  223. isUploading: false,
  224. // 是否更新已经存在的用户数据
  225. updateSupport: 0,
  226. // 设置上传的请求头部
  227. headers: { Authorization: "Bearer " + getToken() },
  228. // 上传的地址
  229. url: process.env.VUE_APP_BASE_API + "/common/upload",
  230. // 报告附件上传位置编号
  231. ids: 0,
  232. commonfileList: null,
  233. },
  234. // 表单参数
  235. form: {},
  236. //事件记录人更新内容
  237. recordInfo: {},
  238. //处理数据传输
  239. approveInfo: null,
  240. //审批显示按键判断依据
  241. infoprocessName: null,
  242. infoTaskName: null,
  243. //上传措施前后照片url,文件名称
  244. beforeUrl: null,
  245. beforeFilename: null,
  246. afterUrl: null,
  247. afterFilename: null,
  248. //审批备注
  249. comment: null
  250. };
  251. },
  252. watch: {
  253. // 根据名称筛选部门树
  254. deptName(val) {
  255. this.$refs.tree.filter(val);
  256. }
  257. },
  258. created() {
  259. //设置表格高度对应屏幕高度
  260. this.$nextTick(() => {
  261. this.clientHeight = document.body.clientHeight -250
  262. })
  263. this.getList();
  264. this.getTreeselect();
  265. this.getDicts("PLANT_DIVIDE").then(response => {
  266. this.plantCodeOptions = response.data;
  267. });
  268. },
  269. methods: {
  270. /** 查询隐患申请列表 */
  271. getList() {
  272. this.loading = true;
  273. getPendinglist(this.queryParams).then(response => {
  274. this.approvedangerList = response.rows;
  275. this.total = response.total;
  276. this.loading = false;
  277. });
  278. },
  279. /** 查询部门下拉树结构 */
  280. getTreeselect() {
  281. treeselect().then(response => {
  282. this.deptOptions = response.data;
  283. });
  284. },
  285. // 装置名称字典翻译
  286. plantCodeFormat(row, column) {
  287. return this.selectDictLabel(this.plantCodeOptions, row.plantCode);
  288. },
  289. // 取消按钮
  290. cancel() {
  291. this.addOrUpdateVisible = false;
  292. this.reset();
  293. },
  294. /** 事件子组件传值 */
  295. approveChange(value) {
  296. this.recordInfo = value
  297. },
  298. // 表单重置
  299. reset() {
  300. this.form = {
  301. id: null,
  302. plantCode: null,
  303. recorderId: null,
  304. hiddendangerLevel: null,
  305. hiddendangerContent: null,
  306. measures: null,
  307. completeTime: null,
  308. status: 0,
  309. creattime: null,
  310. endtime: null,
  311. processId: null,
  312. approveNo: null,
  313. deptId: null,
  314. delFlag: null,
  315. submitType: null,
  316. commont: null,
  317. accidentLevel: null,
  318. executorId: null
  319. };
  320. this.resetForm("form");
  321. },
  322. //操作审批流程
  323. addOrUpdateHandle (row) {
  324. if (row.processName == "特种设备审核"){
  325. this.specDealVisible = true
  326. this.$nextTick(() => {
  327. console.log(row.taskName)
  328. this.$refs.specDeal.init(row.specApprove.id, row.taskId, row.processId,row.taskName)
  329. })
  330. }else if (row.processName == "年度检查报告申请"){
  331. this.specDealVisible = true
  332. this.$nextTick(() => {
  333. console.log(row.taskName)
  334. this.$refs.specDeal.init(row.specApprove.id, row.taskId, row.processId,row.taskName)
  335. })
  336. }else if (row.processName == "月度检查"){
  337. this.specDealVisible = true
  338. this.$nextTick(() => {
  339. console.log(row.taskName)
  340. this.$refs.specDeal.init(row.specApprove.id, row.taskId, row.processId,row.taskName)
  341. })
  342. }else if (row.processName == "设备修改/删除审核"){
  343. this.specModifyDealVisible = true
  344. this.$nextTick(() => {
  345. console.log(row.taskName)
  346. this.$refs.specModifyDeal.init(row.approveSpecModify.id, row.taskId, row.processId,row.taskName)
  347. })
  348. }else if (row.processName == "专项培训计划审核"){
  349. this.specTrainingPlanDealVisible = true
  350. this.$nextTick(() => {
  351. console.log(row.taskName)
  352. this.$refs.specTrainingPlanDeal.init(row.approveObj.id, row.taskId, row.processId,row.taskName)
  353. })
  354. }else if (row.processName == "设备维修审批流程"){
  355. this.specMaintenanceVisible = true
  356. this.$nextTick(() => {
  357. console.log(row.taskName)
  358. this.$refs.specMaintenance.init(row.approveObj.id, row.taskId, row.processId,row.taskName)
  359. })
  360. }else if (row.processName == "设备变更申请"){
  361. this.intactResolveVisible = true
  362. this.$nextTick(() => {
  363. console.log(row)
  364. this.$refs.intactResolveDeal.init(row.approveObj.id, row.taskId, row.processId,row.taskName)
  365. })
  366. }else {
  367. this.approveInfo = row;
  368. this.infoTaskName = row.taskName;
  369. this.infoprocessName = row.processName;
  370. this.addOrUpdateVisible = true;
  371. }
  372. },
  373. // 多选框选中数据
  374. handleSelectionChange(selection) {
  375. this.ids = selection.map(item => item.id)
  376. this.single = selection.length!==1
  377. this.multiple = !selection.length
  378. },
  379. // 表单提交
  380. dataFormSubmit (val) {
  381. //相关信息
  382. this.form = this.approveInfo
  383. this.form.submitType = val
  384. this.form.comment = this.comment
  385. // 审批确认后,申请人填写相关信息
  386. if (this.form.processName === (this.$t('事件') + this.$t('审批流程'))) {
  387. this.form.accidentLevel = this.recordInfo.accidentLevel;
  388. this.form.measures = this.recordInfo.measures;
  389. this.form.executorId = this.recordInfo.executorId;
  390. this.form.completeTime = this.recordInfo.completeTime;
  391. console.info("accidentLevel:" + this.form.accidentLevel)
  392. console.info("measures:" + this.form.measures)
  393. console.info("executorId:" + this.form.executorId)
  394. console.info("completeTime:" + this.form.completeTime)
  395. }
  396. //提交审批
  397. this.form.beforeUrl = this.beforeUrl
  398. this.form.beforeFilename = this.beforeFilename
  399. this.form.afterUrl = this.afterUrl
  400. this.form.afterFilename = this.afterFilename
  401. handleApprovedanger(this.form).then(response => {
  402. this.msgSuccess(this.$t('处理成功'));
  403. this.addOrUpdateVisible = false;
  404. this.getList();
  405. });
  406. this.$nextTick(function () {
  407. this.comment = ''
  408. })
  409. },
  410. // 文件上传中处理
  411. handleFileUploadProgressBefore(event, file, fileList) {
  412. this.uploadbefore.isUploading = true;
  413. },
  414. handleFileUploadProgressAfter(event, file, fileList) {
  415. this.uploadafter.isUploading = true;
  416. },
  417. // 文件上传成功处理
  418. handleFileSuccessBefore(response, file, fileList) {
  419. this.uploadbefore.isUploading = false;
  420. //this.$refs.uploadbefore.clearFiles();
  421. this.beforeUrl = response.url;
  422. this.beforeFilename = response.fileName;
  423. },
  424. handleFileSuccessAfter(response, file, fileList) {
  425. this.uploadafter.isUploading = false;
  426. //this.$refs.uploadafter.clearFiles();
  427. this.afterUrl = response.url;
  428. this.afterFilename = response.fileName;
  429. },
  430. // 提交上传文件
  431. submitFileForm() {
  432. this.$refs.uploadbefore.submit()
  433. this.$refs.uploadafter.submit()
  434. },
  435. processImg (processId) {
  436. this.processImgVisible = true
  437. this.$nextTick(() => {
  438. this.$refs.processImg.init(processId)
  439. })
  440. },
  441. }
  442. };
  443. </script>