index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  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. :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="80px"
  24. >
  25. <el-form-item label="关键字" label-width="60px">
  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
  110. v-loading="loading"
  111. :data="questionList"
  112. height="640"
  113. size="small"
  114. >
  115. <el-table-column
  116. header-align="center"
  117. type="index"
  118. label="序号"
  119. align="center"
  120. width="60px"
  121. v-if="columns[0].visible"
  122. ></el-table-column>
  123. <el-table-column
  124. header-align="center"
  125. label="所属机构"
  126. prop="orgName"
  127. v-if="columns[1].visible"
  128. />
  129. <el-table-column
  130. header-align="center"
  131. label="隐患来源"
  132. prop="srcTaskName"
  133. v-if="columns[2].visible"
  134. />
  135. <el-table-column
  136. header-align="center"
  137. label="检查标准"
  138. prop="checkItem"
  139. v-if="columns[3].visible"
  140. />
  141. <el-table-column
  142. header-align="center"
  143. label="隐患描述"
  144. prop="questionDesc"
  145. v-if="columns[4].visible"
  146. />
  147. <el-table-column
  148. header-align="center"
  149. label="提出人"
  150. align="center"
  151. prop="submitorName"
  152. width="100px"
  153. v-if="columns[5].visible"
  154. />
  155. <el-table-column
  156. header-align="center"
  157. label="发现时间"
  158. align="center"
  159. prop="submitTime"
  160. width="170px"
  161. v-if="columns[6].visible"
  162. >
  163. <template slot-scope="scope">
  164. <span>{{
  165. dayjs(scope.row.submitTime).format("YYYY-MM-DD HH:mm:ss")
  166. }}</span>
  167. </template>
  168. </el-table-column>
  169. <el-table-column
  170. header-align="center"
  171. label="隐患状态"
  172. width="100px"
  173. align="center"
  174. prop="confirmStatus"
  175. v-if="columns[7].visible"
  176. >
  177. <template slot-scope="scope">
  178. <span>{{
  179. getLabel(
  180. dict.type.question_confirm_status,
  181. scope.row.confirmStatus
  182. )
  183. }}</span>
  184. </template>
  185. </el-table-column>
  186. <el-table-column
  187. header-align="center"
  188. label="操作"
  189. width="180"
  190. class-name="small-padding fixed-width"
  191. >
  192. <template slot-scope="scope">
  193. <el-button
  194. size="mini"
  195. type="text"
  196. icon="el-icon-tickets"
  197. @click="handleDetail(scope.row)"
  198. v-hasPermi="['question:list:query']"
  199. >详情</el-button
  200. >
  201. <el-button
  202. size="mini"
  203. type="text"
  204. icon="el-icon-s-check"
  205. @click="handleConfirm(scope.row)"
  206. v-hasPermi="['question:list:confirm']"
  207. v-if="
  208. scope.row.orgId == orgId && scope.row.confirmStatus == 0
  209. "
  210. >隐患确认</el-button
  211. >
  212. <el-button
  213. size="mini"
  214. type="text"
  215. icon="el-icon-s-flag"
  216. @click="handleConfirmDissent(scope.row)"
  217. v-hasPermi="['question:list:confirmDissent']"
  218. v-if="
  219. scope.row.submitorId == userId &&
  220. scope.row.confirmStatus == 1
  221. "
  222. >异议审批</el-button
  223. >
  224. </template>
  225. </el-table-column>
  226. </el-table>
  227. <pagination
  228. v-show="total > 0"
  229. :total="total"
  230. :page.sync="queryParams.pageNum"
  231. :limit.sync="queryParams.pageSize"
  232. @pagination="getList"
  233. />
  234. </div>
  235. </el-col>
  236. </el-row>
  237. <Dialog ref="dialog" @success="getList()"></Dialog>
  238. </div>
  239. </template>
  240. <script>
  241. import { listQuestion } from "@/api/question/list.js";
  242. import OrgTree from "@/components/orgTree";
  243. import Dialog from "./dialog.vue";
  244. import { mapGetters } from "vuex";
  245. import dayjs from "dayjs";
  246. import { getLabel } from "./../../commonOption";
  247. import DataRangePicker from "@/components/dateTime/daterange.picker.vue";
  248. export default {
  249. name: "Question",
  250. data() {
  251. return {
  252. // 遮罩层
  253. loading: true,
  254. // // 选中数组
  255. // ids: [],
  256. // // 非单个禁用
  257. // single: true,
  258. // // 非多个禁用
  259. // multiple: true,
  260. // 显示搜索条件
  261. showSearch: true,
  262. // 总条数
  263. total: 0,
  264. // 隐患问题清单表格数据
  265. questionList: [],
  266. selectedOrgName: null,
  267. // 查询参数
  268. queryParams: {
  269. pageNum: 1,
  270. pageSize: 10,
  271. orgId: this.orgId,
  272. submitRange: null,
  273. confirmStatus: null,
  274. reformStatus: null,
  275. checkSub: true,
  276. },
  277. columns: [
  278. { key: 0, label: `序号`, visible: true },
  279. { key: 1, label: `所属机构`, visible: true },
  280. { key: 2, label: `隐患来源`, visible: true },
  281. { key: 3, label: `检查标准`, visible: true },
  282. { key: 4, label: `隐患描述`, visible: true },
  283. { key: 5, label: `提出人`, visible: true },
  284. { key: 6, label: `发现时间`, visible: true },
  285. { key: 7, label: `隐患状态`, visible: true },
  286. ],
  287. };
  288. },
  289. dicts: ["question_confirm_status"],
  290. components: { OrgTree, Dialog, DataRangePicker },
  291. computed: {
  292. ...mapGetters(["orgId", "userId"]),
  293. },
  294. created() {},
  295. methods: {
  296. dayjs,
  297. getLabel,
  298. /** 查询隐患问题清单列表 */
  299. getList() {
  300. this.loading = true;
  301. listQuestion(this.queryParams).then((response) => {
  302. this.questionList = response.rows;
  303. this.total = response.total;
  304. this.loading = false;
  305. });
  306. },
  307. /** 搜索按钮操作 */
  308. handleQuery() {
  309. this.queryParams.pageNum = 1;
  310. this.getList();
  311. },
  312. /** 重置按钮操作 */
  313. resetQuery() {
  314. this.resetForm("queryForm");
  315. this.queryParams.submitRange = null;
  316. this.handleQuery();
  317. },
  318. // // 多选框选中数据
  319. // handleSelectionChange(selection) {
  320. // this.ids = selection.map((item) => item.id);
  321. // this.single = selection.length !== 1;
  322. // this.multiple = !selection.length;
  323. // },
  324. handleDetail(row) {
  325. this.$refs.dialog.show(row, "detail");
  326. },
  327. handleConfirm(row) {
  328. this.$refs.dialog.show(row, "confirm");
  329. },
  330. handleConfirmDissent(row) {
  331. this.$refs.dialog.show(row, "confirmDissent");
  332. },
  333. handleReform(row) {
  334. this.$refs.dialog.show(row, "reform");
  335. },
  336. /** 导出按钮操作 */
  337. handleExport() {
  338. this.download(
  339. "core/question/export",
  340. {
  341. ...this.queryParams,
  342. },
  343. `${
  344. this.selectedOrgName
  345. }_${this.$tab.getCurrentTabName()}_${dayjs().format("YYYYMMDD")}.xlsx`
  346. );
  347. },
  348. //单选框状态改变
  349. checkChange(state) {
  350. this.queryParams.checkSub = state;
  351. this.getList();
  352. },
  353. getDefaultOrg(org) {
  354. this.queryParams.orgId = org.id;
  355. this.selectedOrgName = org.shortName;
  356. this.getList();
  357. },
  358. // 节点单击事件
  359. clickTreeNode(data) {
  360. this.queryParams.orgId = data.id;
  361. this.selectedOrgName = data.shortName;
  362. this.getList();
  363. },
  364. },
  365. };
  366. </script>