index.vue 11 KB

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