FrequencyView.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  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. let searchParam = [];
  184. // 类别
  185. if (this.typeSelectVal) {
  186. let paramType = {
  187. field: "sj_select",
  188. // 等值查询
  189. searchType: "1",
  190. content: {
  191. value: this.typeSelectVal,
  192. },
  193. };
  194. searchParam.push(paramType);
  195. }
  196. // 被审计街镇
  197. if (this.townSelectVal && this.townSelectVal !== "全部") {
  198. let paramTown = {
  199. field: "bsjz",
  200. // 等值查询
  201. searchType: "1",
  202. content: {
  203. value: this.townSelectVal,
  204. },
  205. };
  206. searchParam.push(paramTown);
  207. }
  208. // 立项年度
  209. if (this.timeSelectVal) {
  210. let paramTime = {
  211. field: "c_new_date",
  212. // 等值查询
  213. searchType: "1",
  214. content: {
  215. value: this.timeSelectVal,
  216. },
  217. };
  218. searchParam.push(paramTime);
  219. }
  220. let params = new FormData();
  221. params = {
  222. columnId: 24,
  223. states: "0,1,2,3",
  224. pageSize: this.currentPageSize,
  225. page: val - 1,
  226. search: JSON.stringify(searchParam),
  227. };
  228. this.$Post(this.urlsCollection.selectContentList, params).then((res) => {
  229. if (res.code === 200 && res.content.data.length > 0) {
  230. this.paginationData.currentPage = val;
  231. this.paginationData.total = res.content.count;
  232. this.tableData = res.content.data.map((v) => {
  233. return {
  234. id: v.id || "--",
  235. createYear: v.c_new_date || "--",
  236. // createYear: this.$dayjs(v.c_year).format("YYYY")|| "--",
  237. auditTown:
  238. this.classDictMap["浦东新区行政区划"].get(v.bsjz) || "--",
  239. type: this.classDictMap["审计类别"].get(v.sj_select) || "--",
  240. keyPoint: v.c_zdsjsx || "--",
  241. problemType: v.c_wtfl || "--",
  242. problemNature: v.c_wtdx || "--",
  243. };
  244. });
  245. }
  246. });
  247. },
  248. // 切换条数
  249. handleSizeChange(val) {
  250. console.log(`每页 ${val} 条`);
  251. this.currentPageSize = val;
  252. this.getTableData(this.currentPage);
  253. },
  254. },
  255. };
  256. </script>
  257. <style lang="less" scoped>
  258. .frenquency-container {
  259. display: flex;
  260. align-items: center;
  261. justify-content: center;
  262. &-inner {
  263. width: 98%;
  264. height: 97%;
  265. background: rgba(0, 39, 77, 0.5);
  266. .header {
  267. height: 13%;
  268. width: 100%;
  269. position: relative;
  270. &-title {
  271. width: 84px;
  272. height: 20px;
  273. font-size: 20px;
  274. font-family: PingFang SC;
  275. font-weight: 400;
  276. color: #4dc3ff;
  277. line-height: 30px;
  278. position: absolute;
  279. top: 1px;
  280. left: 10px;
  281. }
  282. &-select {
  283. position: absolute;
  284. left: 10px;
  285. bottom: 5px;
  286. width: 900px;
  287. height: 40px;
  288. color: #e6e6e6;
  289. display: flex;
  290. justify-content: space-between;
  291. & > div {
  292. // position: absolute;
  293. display: flex;
  294. justify-content: space-around;
  295. width: 320px;
  296. .text {
  297. display: flex;
  298. align-items: center;
  299. justify-content: flex-end;
  300. width: 100px;
  301. height: 28px;
  302. }
  303. .select-input {
  304. width: 170px;
  305. }
  306. }
  307. }
  308. .reset-btn,
  309. .query-btn {
  310. width: 60px;
  311. height: 30px;
  312. border-radius: 3px;
  313. border: none;
  314. color: #fff;
  315. cursor: pointer;
  316. display: flex;
  317. align-items: center;
  318. justify-content: center;
  319. position: absolute;
  320. top: 15px;
  321. }
  322. .reset-btn {
  323. right: 30px;
  324. background: rgba(129, 140, 164, 1);
  325. }
  326. .query-btn {
  327. right: 110px;
  328. background-image: linear-gradient(
  329. to top,
  330. rgba(79, 172, 254, 1),
  331. rgba(0, 242, 254, 1)
  332. );
  333. }
  334. }
  335. .center {
  336. height: 77%;
  337. width: 100%;
  338. overflow: auto;
  339. /deep/.el-table {
  340. background: rgba(0, 39, 77, 0.6);
  341. // font-size: 0.95rem;
  342. font-family: PingFang SC;
  343. font-weight: 500;
  344. thead {
  345. color: #4dc3ff;
  346. font-size: 15px;
  347. }
  348. }
  349. }
  350. .footer {
  351. height: 10%;
  352. width: 100%;
  353. position: absolute;
  354. .pagination-style {
  355. position: absolute;
  356. right: 50px;
  357. }
  358. }
  359. }
  360. }
  361. </style>