spic-audit-dsc-top-div.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  1. <template>
  2. <a-row>
  3. <a-col
  4. v-for="(one, index) in ['sjdws', 'fgl', 'sjwts', 'yzgwt', 'zgzwt', 'wtje']"
  5. :key="one"
  6. :span="4"
  7. :class="one + '-col'"
  8. >
  9. <div :class="$style.mainDiv" @click="fnOpenModel(one)">
  10. <div :class="$style.leftDiv">
  11. <span :class="$style.cardtitle">
  12. <span :class="$style.number">{{ number[index] }}</span>
  13. <br />
  14. <span :class="$style.title">{{ title[index] }}</span>
  15. </span>
  16. </div>
  17. <div :class="$style.rightDiv">
  18. <!-- <a-avatar :style="{ backgroundColor: bgcolor[index] }" :class="$style.avatar" :size="65">
  19. <template v-slot:icon>
  20. <sd-icon
  21. :style="{
  22. marginLeft: index === 0 ? '5px' : '0px',
  23. marginTop: index === 3 ? '20px' : '0px',
  24. }"
  25. :type="icon[index]"
  26. theme="fill"
  27. >
  28. </sd-icon>
  29. </template>
  30. </a-avatar> -->
  31. </div>
  32. </div>
  33. </a-col>
  34. </a-row>
  35. </template>
  36. <script>
  37. import axios from '@/common/services/axios-instance'
  38. import iamAuditDscService from './iam-audit-dsc-service'
  39. import components from './_import-components/spic-audit-dsc-top-div-import'
  40. export default {
  41. name: 'SpicAuditDscTopDiv',
  42. metaInfo: {
  43. title: 'SpicAuditDscTopDiv',
  44. },
  45. components,
  46. props: {
  47. /**
  48. * 统计的组织ID
  49. */
  50. unidId: {
  51. type: Array,
  52. default: () => {
  53. return []
  54. },
  55. },
  56. /**
  57. * 统计的年份
  58. */
  59. planYear: {
  60. type: String,
  61. default: null,
  62. },
  63. },
  64. data() {
  65. return {
  66. icon: [
  67. 'sd-audit-dsc-user-icon',
  68. 'sd-audit-dsc-project-all-icon',
  69. 'sd-audit-dsc-project-start-icon',
  70. 'sd-audit-dsc-gzdg-icon',
  71. 'sd-audit-dsc-find-icon',
  72. 'sd-audit-dsc-rectify-icon',
  73. ],
  74. title: [
  75. '本年度审计项目数',
  76. '近3年度审计覆盖率',
  77. '审计问题发现数量',
  78. '到期整改的问题数量',
  79. '整改中问题数量',
  80. '问题涉及金额(万元)',
  81. ],
  82. bgcolor: ['#bb7ec4', '#ffb648', '#ff4a55', '#00a389', '#54c5eb', '#bb7ec4'],
  83. number: [],
  84. }
  85. },
  86. computed: {
  87. // 因为props传值不会自动更新,使用计算值
  88. selectYear() {
  89. return this.planYear
  90. },
  91. // 因为props传值不会自动更新,使用计算值
  92. selectUnidId() {
  93. if (this.unidId.length > 0) {
  94. return this.unidId[0].id
  95. } else {
  96. return null
  97. }
  98. },
  99. // 因为props传值不会自动更新,使用计算值
  100. selectUnidText() {
  101. if (this.unidId.length > 0) {
  102. return this.unidId[0].name
  103. } else {
  104. return null
  105. }
  106. },
  107. },
  108. watch: {
  109. // 年份和组织变化时,重新加载数据
  110. selectYear() {
  111. this.getData()
  112. },
  113. selectUnidId() {
  114. this.getData()
  115. },
  116. },
  117. created() {
  118. // 创建时获取内容
  119. this.getData()
  120. },
  121. methods: {
  122. /**
  123. * 打开对应的模块
  124. */
  125. fnOpenModel(type) {
  126. debugger
  127. // 审计单位数量
  128. if (type === 'sjdws') {
  129. window.open(
  130. '#/spic-audit-dsc-unit-list?params={"unitNames":"\'' +
  131. this.selectUnidText +
  132. '\'","planYear":"' +
  133. this.selectYear +
  134. '","type":"unit","unitId":"' +
  135. this.selectUnidId +
  136. '"}&type=auditedunitlist'
  137. )
  138. }
  139. // 近三年审计单位覆盖率
  140. if (type === 'fgl') {
  141. window.open(
  142. '#/spic-audit-dsc-three-coverage-list?params={"unitNames":"\'' +
  143. this.selectUnidText +
  144. '\'","planYear":"' +
  145. this.selectYear +
  146. '","type":"fourunit","isTwoUnit":"1","unitId":"' +
  147. this.selectUnidId +
  148. '"}&type=fourYearCoverage' +
  149. '&year=' +
  150. this.selectYear
  151. )
  152. }
  153. // 审计发现问题数
  154. if (type === 'sjwts') {
  155. const param = {}
  156. param.unitId = this.selectUnidId
  157. param.planYear = this.selectYear
  158. window.open(
  159. '#/spic-audit-dsc-find-list?params=' +
  160. encodeURIComponent(JSON.stringify(param)) +
  161. '&type=findqusetionlist'
  162. )
  163. }
  164. // 已整改问题数
  165. if (type === 'yzgwt') {
  166. window.open(
  167. '#/spic-audit-dsc-rectify-list?params={"unitNames":"\'' +
  168. this.selectUnidText +
  169. '\'","planYear":"' +
  170. this.selectYear +
  171. '","type":"rect","unitId":"' +
  172. this.selectUnidId +
  173. '"}&type=rectlist'
  174. )
  175. }
  176. // 已整改问题数
  177. if (type === 'zgzwt') {
  178. window.open(
  179. '#/spic-audit-dsc-rectify-list?params={"unitNames":"\'' +
  180. this.selectUnidText +
  181. '\'","planYear":"' +
  182. this.selectYear +
  183. '","type":"recting","unitId":"' +
  184. this.selectUnidId +
  185. '"}&type=rectinglist'
  186. )
  187. }
  188. // 已整改问题数量
  189. if (type === 'wtje') {
  190. window.open(
  191. '#/spic-audit-dsc-find-list?params={"unitNames":"\'' +
  192. this.selectUnidText +
  193. '\'","planYear":"' +
  194. this.selectYear +
  195. '","unitId":"' +
  196. this.selectUnidId +
  197. '"}&type=amountlist'
  198. )
  199. }
  200. },
  201. /**
  202. * 初始化数据
  203. */
  204. getData() {
  205. this.number = []
  206. // 获取整体数量
  207. const params = {
  208. unitId: this.selectUnidId,
  209. planYear: this.selectYear,
  210. type: 1,
  211. }
  212. if (this.selectUnidId) {
  213. iamAuditDscService.getAllNumResult(params).then((res) => {
  214. // 按顺序将内容写入
  215. const data = res.data
  216. console.log('顶部总体数量数据', data)
  217. // 本年度单位审计数量
  218. this.number.push(data.UNIT_NUM)
  219. // 近4年度审计覆盖率(待定)
  220. this.number.push(data.PERCENT)
  221. // 审计问题发现数
  222. this.number.push(data.FIND_NUM)
  223. // 已整改的问题数
  224. this.number.push(data.RECT_NUM)
  225. // 整改中的问题数
  226. this.number.push(data.RECTING_NUM)
  227. // 问题涉及金额
  228. this.number.push(data.AMOUNT)
  229. })
  230. }
  231. },
  232. },
  233. }
  234. </script>
  235. <style module lang="scss">
  236. @use '@/common/design' as *;
  237. .main-div {
  238. display: flex;
  239. height: 105px;
  240. margin: 0 10px;
  241. cursor: pointer;
  242. background: #fff;
  243. border-radius: 10px;
  244. .left-div {
  245. width: 70%;
  246. padding-left: 22px;
  247. color: #fff;
  248. .title {
  249. height: 45%;
  250. text-align: left;
  251. font-weight: 600;
  252. // line-height: 60px;
  253. }
  254. .number {
  255. text-align: center;
  256. height: 35%;
  257. font-size: 40px;
  258. font-weight: 600;
  259. line-height: 60px;
  260. }
  261. .cardtitle {
  262. text-align: center;
  263. display: inline-block;
  264. }
  265. }
  266. .right-div {
  267. width: 30%;
  268. .avatar {
  269. margin-top: 20px;
  270. }
  271. }
  272. }
  273. :global(yzgwt-col) {
  274. .main-div {
  275. cursor: not-allowed;
  276. }
  277. }
  278. :global(.sjdws-col) {
  279. :global(.main-div_spic-audit-dsc-top-div_custom) {
  280. background-image: url('../imagess/top-img.png');
  281. background-size: 100% 100%;
  282. background-repeat: no-repeat;
  283. }
  284. .right-div {
  285. width: 30%;
  286. background-image: url('../imagess/num.png');
  287. background-size: 60px 60px;
  288. background-position: left center;
  289. background-repeat: no-repeat;
  290. }
  291. }
  292. :global(.fgl-col) {
  293. :global(.main-div_spic-audit-dsc-top-div_custom) {
  294. background-image: url('../imagess/top-img2.png');
  295. background-size: 100% 100%;
  296. background-repeat: no-repeat;
  297. }
  298. .right-div {
  299. width: 30%;
  300. background-image: url('../imagess/num2.png');
  301. background-size: 60px 60px;
  302. background-position: left center;
  303. background-repeat: no-repeat;
  304. }
  305. }
  306. :global(.sjwts-col) {
  307. :global(.main-div_spic-audit-dsc-top-div_custom) {
  308. background-image: url('../imagess/top-img3.png');
  309. background-size: 100% 100%;
  310. background-repeat: no-repeat;
  311. }
  312. .right-div {
  313. width: 30%;
  314. background-image: url('../imagess/num3.png');
  315. background-size: 60px 60px;
  316. background-position: left center;
  317. background-repeat: no-repeat;
  318. }
  319. }
  320. :global(.yzgwt-col) {
  321. :global(.main-div_spic-audit-dsc-top-div_custom) {
  322. background-image: url('../imagess/top-img4.png');
  323. background-size: 100% 100%;
  324. background-repeat: no-repeat;
  325. }
  326. .right-div {
  327. width: 30%;
  328. background-image: url('../imagess/num4.png');
  329. background-size: 60px 60px;
  330. background-position: left center;
  331. background-repeat: no-repeat;
  332. }
  333. }
  334. :global(.zgzwt-col) {
  335. :global(.main-div_spic-audit-dsc-top-div_custom) {
  336. background-image: url('../imagess/top-img5.png');
  337. background-size: 100% 100%;
  338. background-repeat: no-repeat;
  339. }
  340. .right-div {
  341. width: 30%;
  342. background-image: url('../imagess/num5.png');
  343. background-size: 60px 60px;
  344. background-position: left center;
  345. background-repeat: no-repeat;
  346. }
  347. }
  348. :global(.wtje-col) {
  349. :global(.main-div_spic-audit-dsc-top-div_custom) {
  350. background-image: url('../imagess/top-img6.png');
  351. background-size: 100% 100%;
  352. background-repeat: no-repeat;
  353. }
  354. .right-div {
  355. width: 30%;
  356. background-image: url('../imagess/num6.png');
  357. background-size: 60px 60px;
  358. background-repeat: no-repeat;
  359. background-position: left center;
  360. }
  361. }
  362. </style>