ContractInfo.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. <template>
  2. <transition
  3. appear
  4. name="animate__animated animate__move"
  5. enter-active-class="animate__slideInLeft"
  6. leave-active-class="animate__slideOutLeft"
  7. >
  8. <div class="widget-ContractInfo" v-if="show">
  9. <div class="head">
  10. <div class="title">
  11. <div class="icon"></div>
  12. <span class="site-info">合同情况</span>
  13. </div>
  14. </div>
  15. <div class="content-info">
  16. <div class="content-item">
  17. <div class="title">
  18. <div class="icon"></div>
  19. <span class="item-name">建管项目:</span>
  20. <span class="item-info">项目数量{{ ProjectTotal }}个,累计完成产值{{ TotalValue }}亿</span>
  21. </div>
  22. <div class="content">
  23. <div class="chart-container">
  24. <div class="chart-title">完成占比:8.3%</div>
  25. <ComThreeDimensionsChart v-on="$listeners" />
  26. <!-- 底座背景 -->
  27. <div class="bg"></div>
  28. </div>
  29. <div class="dataInfo">
  30. <div
  31. class="data-item"
  32. v-for="(item, index) of staList"
  33. :key="item.name"
  34. :style="index === 0 ? 'background: rgba(11, 122, 192,0.16)' : 'background: rgba(8, 178, 114,0.16)'"
  35. >
  36. <div class="pointSymbol" :style="index === 0 ? 'background:#2BA7FF' : 'background:#13D28A'"></div>
  37. <div class="data-title">{{ item.name }}</div>
  38. <div class="data-value">{{ item.value }}{{ item.unit }}</div>
  39. </div>
  40. </div>
  41. </div>
  42. </div>
  43. <div class="content-item">
  44. <div class="title">
  45. <div class="icon"></div>
  46. <span class="item-name">EPC项目:</span>
  47. <span class="item-info">总投资{{ EPCInvestNum }}亿</span>
  48. </div>
  49. <div class="content epc">
  50. <ComBatteryChart :chartData="EPCData" v-on="$listeners" />
  51. </div>
  52. </div>
  53. <div class="content-item">
  54. <div class="title">
  55. <div class="icon"></div>
  56. <span class="item-name">近6个月数据(万元)</span>
  57. <span class="item-info"></span>
  58. </div>
  59. <div class="content">
  60. <ComLineChart :chartData="latestData" />
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. </transition>
  66. </template>
  67. <script>
  68. import ComThreeDimensionsChart from '@/views/groupPage/components/ComThreeDimensionsChart.vue'
  69. import ComBatteryChart from '@/views/groupPage/components/ComBatteryChart.vue'
  70. import ComLineChart from '@/views/groupPage/components/ComLineChart.vue'
  71. export default {
  72. name: 'ContractInfo', //合同情况
  73. components: {
  74. ComThreeDimensionsChart,
  75. ComBatteryChart,
  76. ComLineChart
  77. },
  78. props: {
  79. show: {}
  80. },
  81. data() {
  82. return {
  83. staList: [
  84. { name: '本年投资计划', value: 0, unit: '亿' },
  85. { name: '本年累计完成产值', value: 0, unit: '亿' }
  86. ],
  87. //建管项目
  88. ProjectTotal: 0, //项目总数
  89. TotalValue: 0, //累计完成产值
  90. //EPC
  91. EPCInvestNum: 0, //EPC项目投资数
  92. EPCData: {
  93. spending: 0,
  94. income: 0,
  95. profits: 0
  96. }, //EPC收支信息
  97. latestData: {
  98. income: [],
  99. spending: [],
  100. profits: []
  101. }
  102. }
  103. },
  104. watch: {
  105. show: {
  106. handler(n, o) {}
  107. }
  108. },
  109. computed: {
  110. setNoNull() {
  111. return this.$listeners.setNullAndUndefinedEmpty
  112. }
  113. },
  114. mounted() {
  115. this.getPageData()
  116. },
  117. methods: {
  118. roundFun(value, n) {
  119. return Math.round(value * Math.pow(10, n)) / Math.pow(10, n)
  120. },
  121. getPageData() {
  122. const { getRequestResult } = this.$listeners
  123. let data = { blockCode: 'ycepclist' }
  124. //获取全部数据
  125. getRequestResult(data).then((res) => {
  126. res = res.map((item) => {
  127. return {
  128. ...item,
  129. indexValue:
  130. item.unit === '万元'
  131. ? this.roundFun(this.setNoNull(item.indexValue) / 10000, 2)
  132. : this.setNoNull(item.indexValue)
  133. }
  134. })
  135. //获取项目数据
  136. this.ProjectTotal = res.filter((item) => item.indexCode === 'A1')[0].indexValue
  137. this.TotalValue = res.filter((item) => item.indexCode === 'A5')[0].indexValue
  138. this.staList[0].value = res.filter((item) => item.indexCode === 'A6')[0].indexValue
  139. this.staList[1].value = res.filter((item) => item.indexCode === 'A7')[0].indexValue
  140. //获取EPC数据
  141. this.EPCInvestNum = res.filter((item) => item.indexCode === 'A4')[0].indexValue
  142. this.EPCData = {
  143. spending: res.filter((item) => item.indexCode === 'A10')[0].indexValue,
  144. income: res.filter((item) => item.indexCode === 'A9')[0].indexValue,
  145. profits:
  146. res.filter((item) => item.indexCode === 'A9')[0].indexValue -
  147. res.filter((item) => item.indexCode === 'A10')[0].indexValue
  148. }
  149. //获取近六个月数据
  150. this.latestData.income.push(res.filter((item) => item.indexCode === 'A47')[0].indexValue)
  151. this.latestData.income.push(res.filter((item) => item.indexCode === 'A50')[0].indexValue)
  152. this.latestData.income.push(res.filter((item) => item.indexCode === 'A53')[0].indexValue)
  153. this.latestData.income.push(res.filter((item) => item.indexCode === 'A56')[0].indexValue)
  154. this.latestData.income.push(res.filter((item) => item.indexCode === 'A59')[0].indexValue)
  155. this.latestData.income.push(res.filter((item) => item.indexCode === 'A62')[0].indexValue)
  156. //
  157. this.latestData.spending.push(res.filter((item) => item.indexCode === 'A48')[0].indexValue)
  158. this.latestData.spending.push(res.filter((item) => item.indexCode === 'A51')[0].indexValue)
  159. this.latestData.spending.push(res.filter((item) => item.indexCode === 'A54')[0].indexValue)
  160. this.latestData.spending.push(res.filter((item) => item.indexCode === 'A57')[0].indexValue)
  161. this.latestData.spending.push(res.filter((item) => item.indexCode === 'A60')[0].indexValue)
  162. this.latestData.spending.push(res.filter((item) => item.indexCode === 'A63')[0].indexValue)
  163. //
  164. this.latestData.profits.push(res.filter((item) => item.indexCode === 'A49')[0].indexValue)
  165. this.latestData.profits.push(res.filter((item) => item.indexCode === 'A52')[0].indexValue)
  166. this.latestData.profits.push(res.filter((item) => item.indexCode === 'A55')[0].indexValue)
  167. this.latestData.profits.push(res.filter((item) => item.indexCode === 'A58')[0].indexValue)
  168. this.latestData.profits.push(res.filter((item) => item.indexCode === 'A61')[0].indexValue)
  169. this.latestData.profits.push(res.filter((item) => item.indexCode === 'A64')[0].indexValue)
  170. })
  171. }
  172. }
  173. }
  174. </script>
  175. <style lang="scss" scoped>
  176. .animate__slideInLeft,
  177. .animate__slideOutLeft {
  178. animation-duration: 3s; //动画持续时间
  179. animation-delay: 0s; //动画延迟时间
  180. }
  181. .widget-ContractInfo {
  182. $size10: 0.052083rem /* 10/192 */;
  183. $size20: 0.104167rem /* 20/192 */;
  184. z-index: 2;
  185. //position
  186. bottom: $size10 /* 10/192 */;
  187. margin-left: $size20 /* 20/192 */;
  188. position: absolute;
  189. //size
  190. height: calc(100% - 0.557292rem /* 107/192 */);
  191. width: 2.083333rem /* 400/192 */;
  192. //background
  193. // background-color: rgba(20, 24, 47, 0.5);
  194. color: #eee;
  195. // box-shadow: 0 0 20px rgba(1, 9, 20, 1);
  196. //font
  197. // font-family: Source Han Sans CN-HEAVY;
  198. .head {
  199. height: 0.166667rem /* 32/192 */;
  200. width: 100%;
  201. background: linear-gradient(-90deg, rgba(43, 167, 255, 0.2) 0%, rgba(43, 167, 255, 0.08) 100%);
  202. font-family: Source Han Sans CN-HEAVY;
  203. .title {
  204. width: 100%;
  205. height: 100%;
  206. display: flex;
  207. font-weight: 400;
  208. align-items: center;
  209. .icon {
  210. height: 0.166667rem /* 32/192 */;
  211. width: 0.34375rem /* 66/192 */;
  212. background: url('~@/views/groupPage/images/模块图标/合同情况.png') no-repeat center center;
  213. background-size: 100% 100%;
  214. }
  215. span {
  216. flex: 1;
  217. font-weight: bold;
  218. font-size: 0.083333rem /* 16/192 */;
  219. color: #ffffff;
  220. padding: 0.041667rem /* 8/192 */;
  221. background: linear-gradient(0deg, #9bd2fa 0%, #ffffff 100%);
  222. background-clip: text;
  223. -webkit-text-fill-color: transparent;
  224. }
  225. .el-select {
  226. flex: 0.4;
  227. /deep/ input {
  228. padding: 0;
  229. background: transparent;
  230. border: none;
  231. font-size: 0.072917rem /* 14/192 */;
  232. font-weight: 500;
  233. color: #2ba7ff;
  234. }
  235. /deep/ .el-icon-arrow-up:before {
  236. content: '';
  237. display: block;
  238. // 定义元素宽高
  239. margin-top: 0.041667rem /* 8/192 */;
  240. width: 0.130208rem /* 25/192 */;
  241. height: 0.078125rem /* 15/192 */;
  242. background: url('~@/views/groupPage/images/三角下.png') no-repeat center center;
  243. background-size: 100% 100%;
  244. transform: rotate(180deg);
  245. }
  246. }
  247. .datePicker {
  248. position: absolute;
  249. left: 1.041667rem /* 200/192 */;
  250. top: 0.182292rem /* 35/192 */;
  251. .el-range-editor--mini.el-input__inner {
  252. width: 1.041667rem /* 200/192 */;
  253. height: 0.145833rem /* 28/192 */;
  254. }
  255. /deep/ .el-date-editor .el-range-input {
  256. width: 100%;
  257. }
  258. }
  259. }
  260. }
  261. .content-info {
  262. width: 100%;
  263. height: calc(100% - 0.166667rem);
  264. overflow: auto;
  265. padding: 2px;
  266. font-family: Source Han Sans CN-MEDIUM;
  267. .content-item {
  268. width: 100%;
  269. height: 33%;
  270. float: left;
  271. overflow: hidden;
  272. .title {
  273. width: 100%;
  274. display: flex;
  275. // padding: .145833rem 0 .104167rem 0;
  276. padding: 0.145833rem 0 0.026042rem /* 5/192 */ 0;
  277. .icon {
  278. height: 0.072917rem /* 14/192 */;
  279. width: 0.078125rem /* 15/192 */;
  280. margin-right: 0.046875rem /* 9/192 */;
  281. background: url('~@/views/groupPage/images/三角.png') no-repeat center center;
  282. background-size: 100% 100%;
  283. }
  284. .item-name {
  285. color: #ffffff;
  286. font-size: 0.072917rem /* 14/192 */;
  287. font-weight: 500;
  288. }
  289. .item-info {
  290. color: #2ba7ff;
  291. font-size: 0.072917rem /* 14/192 */;
  292. font-weight: 500;
  293. }
  294. }
  295. .content {
  296. height: calc(100% - 0.234375rem /* 45/192 */);
  297. width: 100%;
  298. display: flex;
  299. .chart-container {
  300. width: 50%;
  301. .chart-title {
  302. position: absolute;
  303. left: 0.234375rem /* 45/192 */;
  304. font-size: 0.083333rem /* 16/192 */;
  305. font-family: Source Han Sans CN;
  306. font-weight: bold;
  307. top: 0.520833rem /* 100/192 */;
  308. color: #ffffff;
  309. }
  310. .bg {
  311. width: 100%;
  312. height: 100%;
  313. }
  314. .bg {
  315. position: absolute;
  316. top: 0.614583rem /* 118/192 */;
  317. left: 0.041667rem /* 8/192 */;
  318. z-index: -1;
  319. width: 0.9375rem /* 180/192 */;
  320. height: 0.807292rem /* 155/192 */;
  321. background: no-repeat center;
  322. background-image: url('~@/views/groupPage/images/底座样式.png');
  323. background-size: 100% 100%;
  324. }
  325. }
  326. .dataInfo {
  327. width: 50%;
  328. display: flex;
  329. flex-flow: column;
  330. justify-content: space-around;
  331. font-family: Source Han Sans CN;
  332. .data-item {
  333. display: flex;
  334. align-items: center;
  335. padding: 0.052083rem /* 10/192 */;
  336. color: #ffffff;
  337. height: 0.338542rem /* 65/192 */;
  338. .pointSymbol,
  339. .data-title {
  340. margin-right: 0.052083rem /* 10/192 */;
  341. white-space: nowrap;
  342. }
  343. .pointSymbol {
  344. border-radius: 50%;
  345. height: 0.052083rem /* 10/192 */;
  346. width: 0.052083rem /* 10/192 */;
  347. }
  348. .data-title {
  349. font-size: 0.072917rem /* 14/192 */;
  350. font-weight: 400;
  351. color: #ffffff;
  352. }
  353. .data-value {
  354. font-size: 0.083333rem /* 16/192 */;
  355. font-family: Source Han Sans CN-HEAVY;
  356. font-weight: bold;
  357. color: #ffffff;
  358. position: absolute;
  359. right: 2%;
  360. }
  361. }
  362. }
  363. }
  364. .epc {
  365. background: rgba(14, 167, 255, 0.08);
  366. margin-top: 0.15625rem /* 30/192 */;
  367. }
  368. }
  369. }
  370. }
  371. </style>