index.vue 12 KB

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