AnalysisLiquidate.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. <template>
  2. <div class="page-header-index-wide">
  3. <a-row :gutter="24" type="flex">
  4. <a-col :xl="6" :lg="24" :md="24" :sm="24" :xs="24">
  5. <a-card title="清收任务分析" :style="{padding: '0px',marginBottom:'0px'}">
  6. <a-card
  7. title="年度累计完成额"
  8. :style="{ marginTop: '0px'}">
  9. <div
  10. style="cursor: pointer"
  11. @click="jumpClick()">
  12. <h2>{{ newAmountTaskYearlyAmount }}</h2>
  13. <trend style="margin-right: 16px;" :flag="'no'">
  14. <span slot="term"><badge text="任务" status="success"/></span>
  15. {{ BaseTool.Amount.defaultDivTenThousandFormatter(newAmountTaskYearly.newAmount) }}万
  16. </trend>
  17. <trend :flag="'no'">
  18. <span slot="term"><badge text="完成率" status="error"/></span>
  19. {{ BaseTool.Amount.default(newAmountTaskYearly.ratio) }}%
  20. </trend>
  21. </div>
  22. </a-card>
  23. <a-card
  24. title="本月完成额"
  25. :style="{ marginTop: '0px' }">
  26. <div
  27. style="cursor: pointer"
  28. @click="jumpClick()">
  29. <h2>{{ newAmountTaskMonthAmount }}</h2>
  30. <trend style="margin-right: 16px;" :flag="'no'">
  31. <span slot="term"><badge text="任务" status="success"/></span>
  32. {{ BaseTool.Amount.defaultDivTenThousandFormatter(newAmountTaskMonth.newAmount) }}万
  33. </trend>
  34. <trend :flag="'no'">
  35. <span slot="term"><badge text="完成率" status="error"/></span>
  36. {{ BaseTool.Amount.default(newAmountTaskMonth.ratio) }}%
  37. </trend>
  38. </div>
  39. </a-card>
  40. </a-card>
  41. </a-col>
  42. <a-col :xl="18" :lg="24" :md="24" :sm="24" :xs="24">
  43. <a-card
  44. :loading="loading"
  45. :bordered="false"
  46. :body-style="{padding: '0'}"
  47. >
  48. <div class="salesCard">
  49. <a-tabs default-active-key="1" size="large" :tab-bar-style="{marginBottom: '24px', paddingLeft: '16px'}">
  50. <a-tab-pane loading="true" tab="清收任务完成统计(任务+完成)" key="1">
  51. <a-row>
  52. <a-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24">
  53. <label style="padding-left: 10px">年份区间:</label>
  54. <a-select placeholder="开始年份" v-model="startYear" style="width: 35%">
  55. <a-select-option
  56. v-for="(value,index) in years"
  57. :key="index"
  58. :label="value"
  59. :value="value">{{ value }}</a-select-option>
  60. </a-select>
  61. <a-select placeholder="结束年份" v-model="endYear" style="width: 35%">
  62. <a-select-option
  63. v-for="(value,index) in years"
  64. :key="index"
  65. :label="value"
  66. :value="value">{{ value }}</a-select-option>
  67. </a-select>
  68. </a-col>
  69. <a-col
  70. :xl="24"
  71. :lg="24"
  72. :md="24"
  73. :sm="24"
  74. :xs="24"
  75. style="margin-top: 10px">
  76. <label style="padding-left: 10px">统计维度:</label>
  77. <a-select placeholder="请选择" v-model="type" style="width: 20%">
  78. <a-select-option
  79. v-for="(label,value) in yearlyTaskTypeDict"
  80. :key="value"
  81. :label="label"
  82. :value="parseInt(value)">{{ label }}
  83. </a-select-option>
  84. </a-select>
  85. <a-button type="primary" @click="taskAnalysis()" style="margin-left:10px;margin-right: 15px">查询</a-button>
  86. </a-col>
  87. </a-row>
  88. <a-row>
  89. <a-col class="chart_col">
  90. <div>
  91. <h4 style="margin-bottom: 20px; margin-left: 20px; display: inline-block">清收任务统计</h4>
  92. <h4 class="chart_wy_h4">万元</h4>
  93. <v-chart
  94. class="chart"
  95. :forceFit="true"
  96. :height="height"
  97. :data="newAmountDatas1"
  98. :scale="scale1"
  99. :padding="['auto', '50', '80', '100']">
  100. <v-tooltip />
  101. <v-legend
  102. :custom="legendCustom"
  103. :allow-all-canceled="legendAllowAllCanceled"
  104. :items="legendItems1"
  105. :on-click="legendOnClick"
  106. />
  107. <v-axis
  108. data-key="ratio"
  109. :grid="axisGrid"
  110. position="right"
  111. :label="axisLabel"
  112. />
  113. <v-bar position="targetName*amount" color="name" :adjust="adjust"/>
  114. <v-smooth-line position="targetName*ratio" color="#e6b600" :size="gemoSize" />
  115. <v-point shape="circle" position="targetName*ratio" color="#e6b600" :size="gemoSize" />
  116. </v-chart>
  117. </div>
  118. </a-col>
  119. </a-row>
  120. <a-row>
  121. <a-col class="chart_col">
  122. <div>
  123. <h4 style="margin-bottom: 20px; margin-left: 20px; display: inline-block">累计清收任务统计</h4>
  124. <h4 class="chart_wy_h4">万元</h4>
  125. <v-chart
  126. class="chart"
  127. :forceFit="true"
  128. :height="height"
  129. :data="newAmountDatas2"
  130. :scale="scale2"
  131. :padding="['auto', '50', '80', '100']">
  132. <v-tooltip />
  133. <v-legend
  134. :custom="legendCustom"
  135. :allow-all-canceled="legendAllowAllCanceled"
  136. :items="legendItems2"
  137. :on-click="legendOnClick"
  138. />
  139. <v-axis
  140. data-key="ratio"
  141. :grid="axisGrid"
  142. position="right"
  143. :label="axisLabel"
  144. />
  145. <v-bar position="targetName*amount" color="name" :adjust="adjust"/>
  146. <v-smooth-line position="targetName*ratio" color="#e6b600" :size="gemoSize" />
  147. <v-point shape="circle" position="targetName*ratio" color="#e6b600" :size="gemoSize" />
  148. </v-chart>
  149. </div>
  150. </a-col>
  151. </a-row>
  152. <a-row>
  153. <a-col class="chart_col">
  154. <div @click="jumpClick()">
  155. <h4 style="margin-bottom: 20px; margin-left: 20px; display: inline-block">年度清收任务统计</h4>
  156. <h4 class="chart_wy_h4">万元</h4>
  157. <v-chart
  158. class="chart"
  159. :forceFit="true"
  160. :height="height"
  161. :data="newAmountDatas3"
  162. :scale="scale3"
  163. :padding="['auto', '50', '80', '100']">
  164. <v-tooltip />
  165. <v-legend
  166. :custom="legendCustom"
  167. :allow-all-canceled="legendAllowAllCanceled"
  168. :items="legendItems3"
  169. :on-click="legendOnClick"
  170. />
  171. <v-axis
  172. data-key="ratio"
  173. :grid="axisGrid"
  174. position="right"
  175. :label="axisLabel"
  176. />
  177. <v-bar position="targetName*amount" color="name" :adjust="adjust"/>
  178. <v-smooth-line position="targetName*ratio" color="#e6b600" :size="gemoSize" />
  179. <v-point shape="circle" position="targetName*ratio" color="#e6b600" :size="gemoSize" />
  180. </v-chart>
  181. </div>
  182. </a-col>
  183. </a-row>
  184. </a-tab-pane>
  185. </a-tabs>
  186. </div>
  187. </a-card>
  188. </a-col>
  189. </a-row>
  190. </div>
  191. </template>
  192. <script>
  193. import { ChartCard, MiniArea, MiniBar, MiniProgress, RankList, Bar, Trend, NumberInfo, MiniSmoothArea } from '@/components'
  194. import { mixinDevice } from '@/utils/mixin'
  195. export default {
  196. name: 'AnalysisLiquidateNew',
  197. mixins: [mixinDevice],
  198. components: {
  199. ChartCard,
  200. MiniArea,
  201. MiniBar,
  202. MiniProgress,
  203. RankList,
  204. Bar,
  205. Trend,
  206. NumberInfo,
  207. MiniSmoothArea
  208. },
  209. data () {
  210. return {
  211. loading: true,
  212. scale1: [{
  213. dataKey: 'amount',
  214. min: 0,
  215. formatter: function formatter (text) {
  216. return text
  217. }
  218. }, {
  219. dataKey: 'ratio',
  220. alias: '完成比例',
  221. min: 0,
  222. formatter: function formatter (text) {
  223. return text + '%'
  224. }
  225. }],
  226. scale2: [{
  227. dataKey: 'amount',
  228. min: 0,
  229. formatter: function formatter (text) {
  230. return text
  231. }
  232. }, {
  233. dataKey: 'ratio',
  234. alias: '累计完成比例',
  235. min: 0,
  236. formatter: function formatter (text) {
  237. return text + '%'
  238. }
  239. }],
  240. scale3: [{
  241. dataKey: 'amount',
  242. min: 0,
  243. formatter: function formatter (text) {
  244. return text
  245. }
  246. }, {
  247. dataKey: 'ratio',
  248. alias: '年度完成比例',
  249. min: 0,
  250. formatter: function formatter (text) {
  251. return text + '%'
  252. }
  253. }],
  254. height: 400,
  255. axisLabel: {
  256. textStyle: {
  257. fill: '#fdae6b'
  258. }
  259. },
  260. axisGrid: null,
  261. gemoSize: 3,
  262. adjust: [{
  263. type: 'dodge',
  264. marginRatio: 1 / 32
  265. }],
  266. legendCustom: true,
  267. legendAllowAllCanceled: true,
  268. legendItems1: [
  269. { value: '任务额', marker: { symbol: 'square', fill: '#38A0FF', radius: 5 } },
  270. { value: '完成额', marker: { symbol: 'square', fill: '#4CCA73', radius: 5 } },
  271. { value: '完成比例', marker: { symbol: 'hyphen', stroke: '#e6b600', radius: 5, lineWidth: 3 } }
  272. ],
  273. legendItems2: [
  274. { value: '累计任务额', marker: { symbol: 'square', fill: '#38A0FF', radius: 5 } },
  275. { value: '累计完成额', marker: { symbol: 'square', fill: '#4CCA73', radius: 5 } },
  276. { value: '完成比例', marker: { symbol: 'hyphen', stroke: '#e6b600', radius: 5, lineWidth: 3 } }
  277. ],
  278. legendItems3: [
  279. { value: '年度任务额', marker: { symbol: 'square', fill: '#38A0FF', radius: 5 } },
  280. { value: '完成额', marker: { symbol: 'square', fill: '#4CCA73', radius: 5 } },
  281. { value: '完成比例', marker: { symbol: 'hyphen', stroke: '#e6b600', radius: 5, lineWidth: 3 } }
  282. ],
  283. legendOnClick: (ev, chart) => {
  284. const item = ev.item
  285. const value = item.value
  286. const checked = ev.checked
  287. const geoms = chart.getAllGeoms()
  288. for (let i = 0; i < geoms.length; i++) {
  289. const geom = geoms[i]
  290. if (geom.getYScale().field === value) {
  291. if (checked) {
  292. geom.show()
  293. } else {
  294. geom.hide()
  295. }
  296. }
  297. }
  298. },
  299. yearlyTaskTypeDict: {},
  300. newAmountTaskYearly: {
  301. amount: 0,
  302. newAmount: 0,
  303. ratio: 0
  304. },
  305. newAmountTaskMonth: {
  306. amount: 0,
  307. newAmount: 0,
  308. ratio: 0
  309. },
  310. type: 3,
  311. year: parseInt(this.BaseTool.Moment().format(this.BaseTool.Date.PICKER_NORM_YEAR)),
  312. month: parseInt(this.BaseTool.Moment().format(this.BaseTool.Date.PICKER_NORM_MONTH)),
  313. newAmountDatas2: [],
  314. newAmountDatas1: [],
  315. newAmountDatas3: [],
  316. startYear: parseInt(this.BaseTool.Moment().format(this.BaseTool.Date.PICKER_NORM_YEAR)),
  317. endYear: parseInt(this.BaseTool.Moment().format(this.BaseTool.Date.PICKER_NORM_YEAR)),
  318. years: []
  319. }
  320. },
  321. created () {
  322. setTimeout(() => {
  323. this.loading = !this.loading
  324. }, 1000)
  325. this.yearlyTaskTypeDict = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YEARLY_TASK_TYPE)
  326. this.taskAnalysis()
  327. this.init()
  328. },
  329. computed: {
  330. newAmountTaskYearlyAmount: function () {
  331. return `¥${this.BaseTool.Amount.defaultDivTenThousandFormatter(this.newAmountTaskYearly.amount)}万`
  332. },
  333. newAmountTaskMonthAmount: function () {
  334. return `¥${this.BaseTool.Amount.defaultDivTenThousandFormatter(this.newAmountTaskMonth.amount)}万`
  335. }
  336. },
  337. methods: {
  338. taskAnalysis () {
  339. this.newAmountDatas1 = []
  340. this.newAmountDatas2 = []
  341. this.newAmountDatas3 = []
  342. },
  343. getTargetName (item) {
  344. return ((this.startYear === this.endYear || this.type === 1) ? '' : (item.year + '年')) + item.targetName + this.yearlyTaskTypeDict[item.type]
  345. },
  346. init () {
  347. const year = parseInt(this.BaseTool.Moment().format(this.BaseTool.Date.PICKER_NORM_YEAR))
  348. const years = []
  349. for (let i = year + 1; i >= 2018; i--) {
  350. years.push(i)
  351. }
  352. this.years = years
  353. },
  354. jumpClick () {
  355. return false
  356. // this.$router.push({ path: '/invest/loan/liquidate' })
  357. }
  358. }
  359. }
  360. </script>
  361. <style lang="less" scoped>
  362. .extra-wrapper {
  363. line-height: 55px;
  364. padding-right: 24px;
  365. .extra-item {
  366. display: inline-block;
  367. margin-right: 24px;
  368. a {
  369. margin-left: 24px;
  370. }
  371. }
  372. }
  373. .antd-pro-pages-dashboard-analysis-twoColLayout {
  374. position: relative;
  375. display: flex;
  376. display: block;
  377. flex-flow: row wrap;
  378. }
  379. .antd-pro-pages-dashboard-analysis-salesCard {
  380. height: calc(100% - 24px);
  381. /deep/ .ant-card-head {
  382. position: relative;
  383. }
  384. }
  385. .dashboard-analysis-iconGroup {
  386. i {
  387. margin-left: 16px;
  388. color: rgba(0,0,0,.45);
  389. cursor: pointer;
  390. transition: color .32s;
  391. color: black;
  392. }
  393. }
  394. .analysis-salesTypeRadio {
  395. position: absolute;
  396. right: 54px;
  397. bottom: 12px;
  398. }
  399. .chart_wy_h4 {
  400. float: right;
  401. margin-bottom: 20px;
  402. margin-right: 10px;
  403. display: inline-block
  404. }
  405. @media screen and (max-width: 500px) {
  406. .chart_col {
  407. width: 110%;
  408. }
  409. .chart{
  410. position: relative;
  411. left: -45px;
  412. }
  413. .chart_wy_h4{
  414. float: right;
  415. margin-bottom: 20px;
  416. margin-right:11%;
  417. display: inline-block
  418. }
  419. }
  420. </style>