index.vue 11 KB

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