index.vue 12 KB

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