index.vue 9.8 KB

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