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