index.vue 12 KB

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