index.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. <template >
  2. <div class="app-container">
  3. <el-table v-loading="loading" :data="approvedangerList" @selection-change="handleSelectionChange" :height="clientHeight" border>
  4. <el-table-column type="selection" width="55" align="center" />
  5. <el-table-column label="流程ID" align="center" prop="processId" :show-overflow-tooltip="true"/>
  6. <el-table-column label="流程名称" align="center" prop="processName" :show-overflow-tooltip="true"/>
  7. <el-table-column label="流程创建时间" align="center" prop="processCreateTime" :show-overflow-tooltip="true"/>
  8. <!-- <el-table-column :label="$t('隐患级别')" align="center" prop="tApprove.hiddendangerLevel" :show-overflow-tooltip="true"/>-->
  9. <el-table-column label="申请编号" align="center" prop="apNo" :show-overflow-tooltip="true"/>
  10. <el-table-column
  11. prop="isEnd"
  12. header-align="center"
  13. align="center"
  14. label="是否结束">
  15. <template slot-scope="scope">
  16. <el-tag
  17. :type="scope.row.end? 'success' : 'danger'"
  18. disable-transitions>{{scope.row.end? '是' : '否'}}</el-tag>
  19. </template>
  20. </el-table-column>
  21. <el-table-column label="操作" align="center" width="120" class-name="small-padding fixed-width">
  22. <template slot-scope="scope">
  23. <!-- <el-button-->
  24. <!-- size="mini"-->
  25. <!-- type="text"-->
  26. <!-- @click="cancelProcess(scope.row)"-->
  27. <!-- >{{ $t('查看') }}</el-button>-->
  28. <el-button
  29. size="mini"
  30. type="text"
  31. @click="detailHandle(scope.row)"
  32. >查看</el-button>
  33. <el-button
  34. size="mini"
  35. type="text"
  36. @click="processImg(scope.row.processId)"
  37. >流程图</el-button>
  38. </template>
  39. </el-table-column>
  40. </el-table>
  41. <pagination
  42. v-show="total>0"
  43. :total="total"
  44. :page.sync="queryParams.pageNum"
  45. :limit.sync="queryParams.pageSize"
  46. @pagination="getList"
  47. />
  48. <process-img v-if="processImgVisible" ref="processImg" @refreshDataList="getList"></process-img>
  49. <!--<add-or-update v-if="specDealVisible" ref="specDeal" @refreshDataList="getList"></add-or-update>-->
  50. <!--<spec-modify v-if="specModifyDealVisible" ref="specModifyDeal" @refreshDataList="getList"></spec-modify>-->
  51. <!--<spec-training-plan v-if="specTrainingPlanVisible" ref="specTrainingPlan" @refreshDataList="getList"></spec-training-plan>-->
  52. <!--<spec-maintenance v-if="specMaintenanceVisible" ref="specMaintenance" @refreshDataList="getList"></spec-maintenance>-->
  53. <!--<intact-detail v-if="intactDetailVisible" ref="intactDetail" @refreshDataList="getList"></intact-detail>-->
  54. <!--<kekao-detail v-if="kekaoDetailVisible" ref="kekaoDetail" @refreshDataList="getList"></kekao-detail>-->
  55. <!--<invoice-detail v-if="invoiceDetailVisible" ref="invoiceDetail" @refreshDataList="getList"></invoice-detail>-->
  56. <!--<offlinevalve-detail v-if="offlinevalveDetailVisible" ref="offlinevalveDetail" @refreshDataList="getList"></offlinevalve-detail>-->
  57. <!--<safetychange-detail v-if="safetychangeDetailVisible" ref="safetychangeDetail" @refreshDataList="getList"></safetychange-detail>-->
  58. <!--<sai-apply-detail v-if="saiApplyVisible" ref="saiApplyDetail" @refreshDataList="getList"></sai-apply-detail>-->
  59. <common-detail v-if="commonVisible" ref="commonDetail" @refreshDataList="getList"/>
  60. </div>
  61. </template>
  62. <script>
  63. import {getMyApprovelist} from "@/api/branch/approvedanger";
  64. import {treeselect} from "@/api/system/dept";
  65. import Treeselect from "@riophae/vue-treeselect";
  66. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  67. import ProcessImg from '../processImg'
  68. import CommonDetail from "@/views/branch/approve/detail/common-detail";
  69. // import AddOrUpdate from '../approveDetail/spec-detail';
  70. // import SpecModify from '../approveDetail/specModify-detail';
  71. // import SpecTrainingPlan from '../approveDetail/specTrainingPlan-detaill';
  72. // import SpecMaintenance from '../approveDetail/specMaintenance-detail';
  73. // import IntactDetail from '../approveDetail/intact-detail';
  74. // import KekaoDetail from "@/views/approve/approveDetail/kekao-detail";
  75. // import InvoiceDetail from "@/views/approve/approveDetail/invoice-detail";
  76. // import OfflinevalveDetail from "@/views/approve/approveDetail/offlinevalve-detail";
  77. // import SafetychangeDetail from "@/views/approve/approveDetail/safetychange-detail";
  78. // import SaiApplyDetail from "@/views/approve/approveDetail/sai-apply-detail";
  79. export default {
  80. name: "Myapprove",
  81. components: {
  82. // SaiApplyDetail,
  83. // SafetychangeDetail,
  84. // OfflinevalveDetail,
  85. Treeselect,
  86. ProcessImg,
  87. CommonDetail,
  88. // AddOrUpdate,
  89. // SpecModify,
  90. // SpecTrainingPlan,
  91. // SpecMaintenance,
  92. // IntactDetail,
  93. // KekaoDetail,
  94. // InvoiceDetail
  95. },
  96. data() {
  97. return {
  98. // 遮罩层
  99. loading: true,
  100. processImgVisible: false,
  101. specDealVisible: false,
  102. specModifyDealVisible: false,
  103. specTrainingPlanVisible: false,
  104. specMaintenanceVisible: false,
  105. intactDetailVisible:false,
  106. kekaoDetailVisible:false,
  107. invoiceDetailVisible:false,
  108. offlinevalveDetailVisible:false,
  109. safetychangeDetailVisible:false,
  110. saiApplyVisible:false,
  111. commonVisible: false,
  112. // 选中数组
  113. ids: [],
  114. // 非单个禁用
  115. single: true,
  116. // 非多个禁用
  117. multiple: true,
  118. // 显示搜索条件
  119. showSearch: false,
  120. // 总条数
  121. total: 0,
  122. // 我的申请表格数据
  123. approvedangerList: [],
  124. // 弹出层标题
  125. title: "",
  126. // 部门树选项
  127. deptOptions: undefined,
  128. clientHeight:300,
  129. // 是否显示弹出层
  130. open: false,
  131. // 装置名称字典
  132. plantCodeOptions: [],
  133. // 查询参数
  134. queryParams: {
  135. pageNum: 1,
  136. pageSize: 20,
  137. plantCode: null,
  138. recorderId: null,
  139. hiddendangerLevel: null,
  140. hiddendangerContent: null,
  141. measures: null,
  142. completeTime: null,
  143. status: null,
  144. creattime: null,
  145. endtime: null,
  146. processId: null,
  147. approveNo: null,
  148. deptId: null,
  149. },
  150. // 表单参数
  151. form: {},
  152. };
  153. },
  154. watch: {
  155. // 根据名称筛选部门树
  156. deptName(val) {
  157. this.$refs.tree.filter(val);
  158. }
  159. },
  160. created() {
  161. //设置表格高度对应屏幕高度
  162. this.$nextTick(() => {
  163. this.clientHeight = document.body.clientHeight -200
  164. })
  165. this.getList();
  166. this.getTreeselect();
  167. this.getDicts("PLANT_DIVIDE").then(response => {
  168. this.plantCodeOptions = response.data;
  169. });
  170. },
  171. methods: {
  172. /** 查询隐患申请列表 */
  173. getList() {
  174. this.loading = true;
  175. getMyApprovelist(this.queryParams).then(response => {
  176. this.approvedangerList = response.rows;
  177. this.total = response.total;
  178. this.loading = false;
  179. });
  180. },
  181. //操作审批流程
  182. detailHandle (row) {
  183. if (row.processName == "通用审批流程") {
  184. this.commonVisible = true
  185. this.$nextTick(() => {
  186. this.$refs.commonDetail.init(row.obj.memberId, row.taskId, row.processId, row.taskName, 2)
  187. })
  188. }
  189. },
  190. /** 查询部门下拉树结构 */
  191. getTreeselect() {
  192. treeselect().then(response => {
  193. this.deptOptions = response.data;
  194. });
  195. },
  196. // 装置名称字典翻译
  197. plantCodeFormat(row, column) {
  198. return this.selectDictLabel(this.plantCodeOptions, row.plantCode);
  199. },
  200. // 取消按钮
  201. cancel() {
  202. this.open = false;
  203. this.reset();
  204. },
  205. // 表单重置
  206. reset() {
  207. this.form = {
  208. id: null,
  209. plantCode: null,
  210. recorderId: null,
  211. hiddendangerLevel: null,
  212. hiddendangerContent: null,
  213. measures: null,
  214. completeTime: null,
  215. status: 0,
  216. creattime: null,
  217. endtime: null,
  218. processId: null,
  219. approveNo: null,
  220. deptId: null,
  221. delFlag: null
  222. };
  223. this.resetForm("form");
  224. },
  225. /** 搜索按钮操作 */
  226. handleQuery() {
  227. this.queryParams.pageNum = 1;
  228. this.getList();
  229. },
  230. /** 重置按钮操作 */
  231. resetQuery() {
  232. this.resetForm("queryForm");
  233. this.handleQuery();
  234. },
  235. // 多选框选中数据
  236. handleSelectionChange(selection) {
  237. this.ids = selection.map(item => item.id)
  238. this.single = selection.length!==1
  239. this.multiple = !selection.length
  240. },
  241. processImg (processId) {
  242. this.processImgVisible = true
  243. this.$nextTick(() => {
  244. this.$refs.processImg.init(processId)
  245. })
  246. },
  247. }
  248. };
  249. </script>