FrequencyView.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  1. <template>
  2. <div class="frenquency-container">
  3. <div class="frenquency-container-inner">
  4. <div class="header">
  5. <div class="header-title">频发问题</div>
  6. <div class="header-select">
  7. <div>
  8. <div class="text">类别 :</div>
  9. <NewSelect
  10. ref="auditTypeRef"
  11. :placeholder="'请选择类别'"
  12. class="select-input"
  13. v-model="typeSelectVal"
  14. :options="typeOptions"
  15. :value="typeSelectVal"
  16. />
  17. </div>
  18. <div>
  19. <div class="text">被审计街镇 :</div>
  20. <NewSelect
  21. ref="townTypeRef"
  22. :placeholder="'请选择街镇'"
  23. class="select-input"
  24. v-model="townSelectVal"
  25. :options="townOptions"
  26. :value="townSelectVal"
  27. />
  28. </div>
  29. <div>
  30. <div class="text">立项年度 :</div>
  31. <NewSelect
  32. ref="timeRef"
  33. :placeholder="'立项年度'"
  34. class="select-input"
  35. v-model="timeSelectVal"
  36. :options="timeOptions"
  37. :value="timeSelectVal"
  38. />
  39. </div>
  40. </div>
  41. <div class="query-btn" @click="getTableData(1)">查询</div>
  42. <div class="reset-btn" @click="resetEvent">重置</div>
  43. </div>
  44. <div class="center">
  45. <el-table :data="tableData" style="width: 100%" max-height="600">
  46. <el-table-column type="index" width="70" align="center">
  47. </el-table-column>
  48. <el-table-column
  49. prop="createYear"
  50. label="立项年度"
  51. width="150"
  52. align="center"
  53. >
  54. </el-table-column>
  55. <el-table-column
  56. prop="auditTown"
  57. label="被审计镇"
  58. align="center"
  59. width="180"
  60. >
  61. </el-table-column>
  62. <el-table-column prop="type" label="类别" align="center">
  63. </el-table-column>
  64. <el-table-column prop="keyPoint" label="重点审计事项" align="center">
  65. </el-table-column>
  66. <el-table-column prop="problemType" label="问题分类" align="center">
  67. </el-table-column>
  68. <el-table-column prop="problemNature" label="问题定性" align="center">
  69. </el-table-column>
  70. </el-table>
  71. </div>
  72. <div class="footer">
  73. <Pagination class="pagination-style" :paginationData="paginationData" />
  74. </div>
  75. </div>
  76. </div>
  77. </template>
  78. <script>
  79. import NewSelect from "@/components/common/NewSelect.vue";
  80. import Pagination from "@/components/common/Pagination.vue";
  81. /**
  82. * 频发问题 -- 智能辅助
  83. * @author: Gao Lu
  84. * @Date: 2022.11.24
  85. */
  86. export default {
  87. name: "FrequencyDialog",
  88. components: { NewSelect, Pagination },
  89. data() {
  90. return {
  91. // 数据字典暂存对象
  92. classDictMap: {},
  93. typeSelectVal: "",
  94. typeOptions: [],
  95. townSelectVal: "",
  96. townOptions: [],
  97. timeSelectVal: "",
  98. timeOptions: [],
  99. tableData: [],
  100. currentPage: 1,
  101. currentPageSize: 10,
  102. paginationData: {
  103. pageSize: 10,
  104. pagerCount: 5,
  105. currentPage: 1,
  106. pageSizes: [5, 10, 20, 30],
  107. total: 50,
  108. currentChange: (val) => {
  109. this.getTableData(val);
  110. },
  111. handleSizeChange: (val) => {
  112. this.handleSizeChange(val);
  113. },
  114. },
  115. };
  116. },
  117. created() {
  118. this.townOptions = [];
  119. this.timeOptions = [];
  120. this.typeOptions = [];
  121. // 时间选择
  122. for (let i = 1980; i <= parseInt(this.$dayjs().format("YYYY")); i++) {
  123. this.timeOptions.unshift({
  124. value: i,
  125. label: i,
  126. });
  127. }
  128. // 获取数据字典中下拉框数据
  129. this.classDictQuery("0", "sj_select", "审计类别");
  130. this.classDictQuery("0", "浦东新区行政区划", "浦东新区行政区划");
  131. this.getTableData(1);
  132. },
  133. methods: {
  134. // 数据字典查询 -- 获取所需类别
  135. classDictQuery(type, cName, keyName) {
  136. let params = new FormData();
  137. params = {
  138. type: type,
  139. cName: cName,
  140. };
  141. this.$Post(this.urlsCollection.selectByCNameAType, params).then((res) => {
  142. if (res.code === 200 && res.content.length > 0) {
  143. this.classDictMap[keyName] = new Map();
  144. res.content.forEach((v) => {
  145. this.classDictMap[keyName].set(v.index + "", v.name);
  146. });
  147. if (keyName === "浦东新区行政区划") {
  148. this.classDictMap[keyName].forEach((v, i) => {
  149. this.townOptions.push({
  150. value: i,
  151. label: v,
  152. });
  153. });
  154. this.townOptions.unshift({
  155. value: "全部",
  156. label: "全部",
  157. });
  158. }
  159. if (keyName === "审计类别") {
  160. this.classDictMap[keyName].forEach((v, i) => {
  161. this.typeOptions.push({
  162. value: i,
  163. label: v,
  164. });
  165. });
  166. }
  167. }
  168. });
  169. },
  170. resetEvent() {
  171. this.typeSelectVal = "";
  172. this.townSelectVal = "";
  173. this.timeSelectVal = "";
  174. this.$refs.auditTypeRef.imgValue = "";
  175. this.$refs.townTypeRef.imgValue = "";
  176. this.$refs.timeRef.imgValue = "";
  177. this.getTableData(1);
  178. console.log("重置");
  179. },
  180. // 切换页
  181. getTableData(val) {
  182. this.tableData = [];
  183. console.log(`当前页: ${val}`);
  184. let searchParam = [];
  185. // 类别
  186. if (this.typeSelectVal) {
  187. let paramType = {
  188. field: "sj_select",
  189. // 等值查询
  190. searchType: "1",
  191. content: {
  192. value: this.typeSelectVal,
  193. },
  194. };
  195. searchParam.push(paramType);
  196. }
  197. // 被审计街镇
  198. if (this.townSelectVal && this.townSelectVal !== "全部") {
  199. let paramTown = {
  200. field: "bsjz",
  201. // 等值查询
  202. searchType: "1",
  203. content: {
  204. value: this.townSelectVal,
  205. },
  206. };
  207. searchParam.push(paramTown);
  208. }
  209. // 立项年度
  210. if (this.timeSelectVal) {
  211. let paramTime = {
  212. field: "c_new_date",
  213. // 等值查询
  214. searchType: "1",
  215. content: {
  216. value: this.timeSelectVal,
  217. },
  218. };
  219. searchParam.push(paramTime);
  220. }
  221. let params = new FormData();
  222. params = {
  223. columnId: 24,
  224. states: "0,1,2,3",
  225. pageSize: this.currentPageSize,
  226. page: val - 1,
  227. search: JSON.stringify(searchParam),
  228. };
  229. this.$Post(this.urlsCollection.selectContentList, params).then((res) => {
  230. if (res.code === 200 && res.content.data.length > 0) {
  231. this.paginationData.currentPage = val;
  232. this.paginationData.total = res.content.count;
  233. this.tableData = res.content.data.map((v) => {
  234. return {
  235. id: v.id || "--",
  236. createYear: v.c_new_date || "--",
  237. // createYear: this.$dayjs(v.c_year).format("YYYY")|| "--",
  238. auditTown:
  239. this.classDictMap["浦东新区行政区划"].get(v.bsjz) || "--",
  240. type: this.classDictMap["审计类别"].get(v.sj_select) || "--",
  241. keyPoint: v.c_zdsjsx || "--",
  242. problemType: v.c_wtfl || "--",
  243. problemNature: v.c_wtdx || "--",
  244. };
  245. });
  246. }
  247. });
  248. },
  249. // 切换条数
  250. handleSizeChange(val) {
  251. console.log(`每页 ${val} 条`);
  252. this.currentPageSize = val;
  253. this.getTableData(this.currentPage);
  254. },
  255. },
  256. };
  257. </script>
  258. <style lang="less" scoped>
  259. .frenquency-container {
  260. display: flex;
  261. align-items: center;
  262. justify-content: center;
  263. &-inner {
  264. width: 98%;
  265. height: 97%;
  266. background: rgba(0, 39, 77, 0.5);
  267. .header {
  268. height: 13%;
  269. width: 100%;
  270. position: relative;
  271. &-title {
  272. width: 84px;
  273. height: 20px;
  274. font-size: 20px;
  275. font-family: PingFang SC;
  276. font-weight: 400;
  277. color: #4dc3ff;
  278. line-height: 30px;
  279. position: absolute;
  280. top: 1px;
  281. left: 10px;
  282. }
  283. &-select {
  284. position: absolute;
  285. left: 10px;
  286. bottom: 5px;
  287. width: 900px;
  288. height: 40px;
  289. color: #e6e6e6;
  290. display: flex;
  291. justify-content: space-between;
  292. & > div {
  293. // position: absolute;
  294. display: flex;
  295. justify-content: space-around;
  296. width: 320px;
  297. .text {
  298. display: flex;
  299. align-items: center;
  300. justify-content: flex-end;
  301. width: 100px;
  302. height: 28px;
  303. }
  304. .select-input {
  305. width: 170px;
  306. }
  307. }
  308. }
  309. .reset-btn,
  310. .query-btn {
  311. width: 60px;
  312. height: 30px;
  313. border-radius: 3px;
  314. border: none;
  315. color: #fff;
  316. cursor: pointer;
  317. display: flex;
  318. align-items: center;
  319. justify-content: center;
  320. position: absolute;
  321. top: 15px;
  322. }
  323. .reset-btn {
  324. right: 30px;
  325. background: rgba(129, 140, 164, 1);
  326. }
  327. .query-btn {
  328. right: 110px;
  329. background-image: linear-gradient(
  330. to top,
  331. rgba(79, 172, 254, 1),
  332. rgba(0, 242, 254, 1)
  333. );
  334. }
  335. }
  336. .center {
  337. height: 77%;
  338. width: 100%;
  339. overflow: auto;
  340. /deep/.el-table {
  341. background: rgba(0, 39, 77, 0.6);
  342. // font-size: 0.95rem;
  343. font-family: PingFang SC;
  344. font-weight: 500;
  345. thead {
  346. color: #4dc3ff;
  347. font-size: 15px;
  348. }
  349. }
  350. }
  351. .footer {
  352. height: 10%;
  353. width: 100%;
  354. position: absolute;
  355. .pagination-style {
  356. position: absolute;
  357. right: 50px;
  358. }
  359. }
  360. }
  361. }
  362. </style>