index.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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="申请人姓名" align="center" prop="apName" :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. icon="el-icon-view"
  27. @click="handleView(scope.row)"
  28. >查看</el-button>
  29. <el-button
  30. size="mini"
  31. type="text"
  32. @click="processImg(scope.row.processId)"
  33. >流程图</el-button>
  34. </template>
  35. </el-table-column>
  36. </el-table>
  37. <pagination
  38. v-show="total>0"
  39. :total="total"
  40. :page.sync="queryParams.pageNum"
  41. :limit.sync="queryParams.pageSize"
  42. @pagination="getList"
  43. />
  44. <process-img v-if="processImgVisible" ref="processImg" @refreshDataList="getList"></process-img>
  45. <questionnaire-detail v-if="questionnaireVisible" ref="questionnaireDetail" @refreshDataList="getList"/>
  46. </div>
  47. </template>
  48. <script>
  49. import { getTaskdonelist } from "@/api/rc/approvedanger";
  50. import QuestionnaireDetail from "@/views/rc/approve/detail/questionnaire-detail";
  51. import ProcessImg from "../processImg/index";
  52. export default {
  53. name: "Taskdone",
  54. components: {
  55. ProcessImg,
  56. QuestionnaireDetail
  57. },
  58. data() {
  59. return {
  60. // 遮罩层
  61. loading: true,
  62. processImgVisible: false,
  63. questionnaireVisible: false,
  64. // 选中数组
  65. ids: [],
  66. // 非单个禁用
  67. single: true,
  68. // 非多个禁用
  69. multiple: true,
  70. // 显示搜索条件
  71. showSearch: false,
  72. // 总条数
  73. total: 0,
  74. // 我的申请表格数据
  75. approvedangerList: [],
  76. // 弹出层标题
  77. title: "",
  78. // 部门树选项
  79. deptOptions: undefined,
  80. clientHeight:300,
  81. // 是否显示弹出层
  82. open: false,
  83. // 装置名称字典
  84. plantCodeOptions: [],
  85. // 查询参数
  86. queryParams: {
  87. pageNum: 1,
  88. pageSize: 20,
  89. plantCode: null,
  90. recorderId: null,
  91. hiddendangerLevel: null,
  92. hiddendangerContent: null,
  93. measures: null,
  94. completeTime: null,
  95. status: null,
  96. creattime: null,
  97. endtime: null,
  98. processId: null,
  99. approveNo: null,
  100. deptId: null,
  101. },
  102. // 表单参数
  103. form: {},
  104. //处理数据传输
  105. approveInfo: null,
  106. //弹窗界面是否开启
  107. addOrUpdateVisible: false,
  108. };
  109. },
  110. watch: {
  111. // 根据名称筛选部门树
  112. deptName(val) {
  113. this.$refs.tree.filter(val);
  114. }
  115. },
  116. created() {
  117. //设置表格高度对应屏幕高度
  118. this.$nextTick(() => {
  119. this.clientHeight = document.body.clientHeight -200
  120. })
  121. this.getList();
  122. },
  123. methods: {
  124. /** 查询隐患申请列表 */
  125. getList() {
  126. this.loading = true;
  127. getTaskdonelist(this.queryParams).then(response => {
  128. this.approvedangerList = response.rows;
  129. this.total = response.total;
  130. this.loading = false;
  131. });
  132. },
  133. /** 查看操作 */
  134. handleView (row) {
  135. if (row.processName == "问卷审批流程") {
  136. this.title = '处理问卷审批流程';
  137. this.questionnaireVisible = true
  138. this.$nextTick(() => {
  139. this.$refs.questionnaireDetail.init(row.progress, row.taskId, row.processId, row.taskName, 3)
  140. })
  141. }
  142. },
  143. // 装置名称字典翻译
  144. plantCodeFormat(row, column) {
  145. return this.selectDictLabel(this.plantCodeOptions, row.plantCode);
  146. },
  147. // 取消按钮
  148. cancel() {
  149. this.open = false;
  150. this.reset();
  151. },
  152. // 表单重置
  153. reset() {
  154. this.form = {
  155. id: null,
  156. plantCode: null,
  157. recorderId: null,
  158. hiddendangerLevel: null,
  159. hiddendangerContent: null,
  160. measures: null,
  161. completeTime: null,
  162. status: 0,
  163. creattime: null,
  164. endtime: null,
  165. processId: null,
  166. approveNo: null,
  167. deptId: null,
  168. delFlag: null
  169. };
  170. this.resetForm("form");
  171. },
  172. /** 搜索按钮操作 */
  173. handleQuery() {
  174. this.queryParams.pageNum = 1;
  175. this.getList();
  176. },
  177. /** 重置按钮操作 */
  178. resetQuery() {
  179. this.resetForm("queryForm");
  180. this.handleQuery();
  181. },
  182. // 多选框选中数据
  183. handleSelectionChange(selection) {
  184. this.ids = selection.map(item => item.id)
  185. this.single = selection.length!==1
  186. this.multiple = !selection.length
  187. },
  188. processImg (processId) {
  189. this.processImgVisible = true
  190. this.$nextTick(() => {
  191. this.$refs.processImg.init(processId)
  192. })
  193. },
  194. }
  195. };
  196. </script>