index.vue 12 KB

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