index.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. <template>
  2. <div class="app-container">
  3. <el-row :gutter="20">
  4. <el-col :span="4" :xs="24">
  5. <org-tree
  6. v-model="queryParams.orgId"
  7. @defaultOrg="getDefaultOrg"
  8. @checkChange="checkChange"
  9. @click="clickTreeNode"
  10. :businessTree="true"
  11. ></org-tree>
  12. </el-col>
  13. <el-col :span="20" :xs="24">
  14. <el-form
  15. :model="queryParams"
  16. ref="queryForm"
  17. size="small"
  18. :inline="true"
  19. v-show="showSearch"
  20. label-width="68px"
  21. >
  22. <el-form-item label="关键字" prop="searchKey">
  23. <el-input
  24. v-model="queryParams.searchKey"
  25. placeholder="请输入关键字"
  26. clearable
  27. />
  28. </el-form-item>
  29. <el-form-item prop="reformStatus" label="整改状态">
  30. <el-select
  31. prop="reformStatus"
  32. label="整改状态"
  33. v-model="queryParams.reformStatus"
  34. placeholder="请选择整改状态"
  35. clearable
  36. >
  37. <el-option
  38. v-for="dict in dict.type.question_reform_status"
  39. :key="dict.value"
  40. :label="dict.label"
  41. :value="dict.value"
  42. />
  43. </el-select>
  44. </el-form-item>
  45. <el-form-item label="整改期限" prop="reformRange">
  46. <el-date-picker
  47. clearable
  48. v-model="queryParams.reformRange"
  49. type="daterange"
  50. format="yyyy-MM-dd"
  51. placeholder="请选择整改期限"
  52. >
  53. </el-date-picker>
  54. </el-form-item>
  55. </el-form>
  56. <el-row :gutter="10" class="mb8">
  57. <el-col :span="1.5">
  58. <el-button
  59. type="primary"
  60. icon="el-icon-search"
  61. size="mini"
  62. @click="handleQuery"
  63. >搜索</el-button
  64. >
  65. <el-button type="primary" icon="el-icon-refresh" size="mini" @click="resetQuery"
  66. >重置</el-button
  67. >
  68. <el-button
  69. type="primary"
  70. plain
  71. icon="el-icon-download"
  72. size="mini"
  73. @click="handleExport"
  74. >导出</el-button
  75. >
  76. </el-col>
  77. <right-toolbar
  78. :showSearch.sync="showSearch"
  79. @queryTable="getList"
  80. :columns="columns"
  81. ></right-toolbar>
  82. </el-row>
  83. <el-table
  84. v-loading="loading"
  85. :data="questionList"
  86. >
  87. <el-table-column
  88. type="index"
  89. label="序号"
  90. width="60px"
  91. v-if="columns[0].visible"
  92. ></el-table-column>
  93. <el-table-column
  94. label="所属机构"
  95. prop="orgName"
  96. v-if="columns[1].visible"
  97. />
  98. <el-table-column
  99. label="标准依据"
  100. prop="checkContent"
  101. v-if="columns[2].visible"
  102. />
  103. <el-table-column
  104. label="隐患描述"
  105. prop="questionDesc"
  106. v-if="columns[3].visible"
  107. />
  108. <el-table-column
  109. label="整改期限"
  110. prop="submitTime"
  111. width="120"
  112. v-if="columns[4].visible"
  113. >
  114. <template slot-scope="scope">
  115. <span>{{
  116. dayjs(scope.row.reformDeadline).format("YYYY-MM-DD")
  117. }}</span>
  118. </template>
  119. </el-table-column>
  120. <el-table-column
  121. label="整改状态"
  122. prop="reformStatus"
  123. width="80px"
  124. v-if="columns[5].visible"
  125. >
  126. <template slot-scope="scope">
  127. <span>{{
  128. getLabel(
  129. dict.type.question_reform_status,
  130. scope.row.reformStatus
  131. )
  132. }}</span>
  133. </template>
  134. </el-table-column>
  135. <el-table-column
  136. label="操作"
  137. align="center"
  138. class-name="small-padding fixed-width"
  139. >
  140. <template slot-scope="scope">
  141. <el-button
  142. size="mini"
  143. type="text"
  144. icon="el-icon-tickets"
  145. @click="handleDetail(scope.row)"
  146. v-hasPermi="['question:reform:query']"
  147. >详情</el-button
  148. >
  149. <el-button
  150. size="mini"
  151. type="text"
  152. icon="el-icon-s-unfold"
  153. @click="handleReform(scope.row)"
  154. v-hasPermi="['question:reform:reform']"
  155. v-if="scope.row.orgId==orgId && scope.row.confirmStatus==2 && scope.row.reformStatus!=11"
  156. >整改</el-button
  157. >
  158. </template>
  159. </el-table-column>
  160. </el-table>
  161. <pagination
  162. v-show="total > 0"
  163. :total="total"
  164. :page.sync="queryParams.pageNum"
  165. :limit.sync="queryParams.pageSize"
  166. @pagination="getList"
  167. />
  168. </el-col>
  169. </el-row>
  170. <Dialog ref="dialog" @success="getList()"></Dialog>
  171. </div>
  172. </template>
  173. <script>
  174. import {
  175. page,
  176. } from "@/api/question/reform.js";
  177. import OrgTree from "@/components/orgTree";
  178. import Dialog from "./dialog.vue";
  179. import { mapGetters } from "vuex";
  180. import dayjs from "dayjs";
  181. import { getLabel } from "./../../commonOption";
  182. export default {
  183. name: "QuestionReform",
  184. data() {
  185. return {
  186. // 遮罩层
  187. loading: true,
  188. // // 选中数组
  189. // ids: [],
  190. // // 非单个禁用
  191. // single: true,
  192. // // 非多个禁用
  193. // multiple: true,
  194. // 显示搜索条件
  195. showSearch: true,
  196. // 总条数
  197. total: 0,
  198. // 隐患问题清单表格数据
  199. questionList: [],
  200. // 查询参数
  201. queryParams: {
  202. pageNum: 1,
  203. pageSize: 10,
  204. orgId: this.orgId,
  205. reformRange: null,
  206. reformStatus: null,
  207. checkSub: true,
  208. },
  209. columns: [
  210. { key: 0, label: `序号`, visible: true },
  211. { key: 1, label: `机构名称`, visible: true },
  212. { key: 2, label: `标准依据`, visible: true },
  213. { key: 3, label: `隐患描述`, visible: true },
  214. { key: 4, label: `整改期限`, visible: true },
  215. { key: 5, label: `整改状态`, visible: true },
  216. ],
  217. };
  218. },
  219. dicts: ["question_reform_status"],
  220. components: { OrgTree, Dialog },
  221. computed: {
  222. ...mapGetters(["orgId","userId"]),
  223. },
  224. created() {},
  225. methods: {
  226. dayjs,
  227. getLabel,
  228. /** 查询隐患问题清单列表 */
  229. getList() {
  230. this.loading = true;
  231. page(this.queryParams).then((response) => {
  232. this.questionList = response.rows;
  233. this.total = response.total;
  234. this.loading = false;
  235. });
  236. },
  237. /** 搜索按钮操作 */
  238. handleQuery() {
  239. this.queryParams.pageNum = 1;
  240. this.getList();
  241. },
  242. /** 重置按钮操作 */
  243. resetQuery() {
  244. this.resetForm("queryForm");
  245. this.handleQuery();
  246. },
  247. // // 多选框选中数据
  248. // handleSelectionChange(selection) {
  249. // this.ids = selection.map((item) => item.id);
  250. // this.single = selection.length !== 1;
  251. // this.multiple = !selection.length;
  252. // },
  253. handleDetail(row){
  254. this.$refs.dialog.show(row,'detail')
  255. },
  256. handleConfirm(row){
  257. this.$refs.dialog.show(row,'confirm')
  258. },
  259. handleConfirmDissent(row){
  260. this.$refs.dialog.show(row,'confirmDissent')
  261. },
  262. handleReform(row){
  263. this.$refs.dialog.show(row,'reform')
  264. },
  265. /** 导出按钮操作 */
  266. handleExport() {
  267. this.download(
  268. "core/questionreform/export",
  269. {
  270. ...this.queryParams,
  271. },
  272. `${this.selectedOrgName}_${this.$tab.getCurrentTabName()}_${dayjs().format("YYYYMMDD")}.xlsx`
  273. );
  274. },
  275. //单选框状态改变
  276. checkChange(state) {
  277. this.queryParams.checkSub = state;
  278. this.getList();
  279. },
  280. getDefaultOrg(org) {
  281. this.queryParams.orgId = org.id;
  282. this.selectedOrgName=org.shortName;
  283. this.getList();
  284. },
  285. // 节点单击事件
  286. clickTreeNode(data) {
  287. this.queryParams.orgId = data.id;
  288. this.selectedOrgName=data.shortName;
  289. this.getList();
  290. },
  291. },
  292. };
  293. </script>