ContractInfo.vue 13 KB

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