boxLine.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403
  1. <template>
  2. <div class="box-line-new">
  3. <div class="item">
  4. <div class="title inline-16">
  5. {{ $t(title) }}
  6. </div>
  7. <el-tooltip effect="dark" placement="top-start">
  8. <div slot="content">
  9. {{
  10. $t(
  11. "①累计目标金额:到当前时间为止的累计的目标金额,不计算未经历时间的目标金额;"
  12. )
  13. }}
  14. <br />{{
  15. $t(
  16. "②同比增长率:同比增长率是指本期和上一年同期相比较的增长率,计算公式为:同比增长率=(本期数-同期数)÷同期数×100%。"
  17. )
  18. }}
  19. <br />{{
  20. $t(
  21. "③环比增长率:环比增长率是指本期和上期相比较的增长率,计算公式为:环比增长率 =(本期数-上期数)÷上期数 ×100%。"
  22. )
  23. }}
  24. <br />{{ $t("④目标达成率=实际金额÷目标金额×100%") }}
  25. </div>
  26. <!-- <i class="el-icon-question" style="color: #afb0be;float: right"></i>-->
  27. <img
  28. width="14px"
  29. height="14px"
  30. src="../../../assets/icons/prompt_icon.svg"
  31. style="float: right"
  32. />
  33. </el-tooltip>
  34. <div class="content-new">
  35. <div style="width: 18%">
  36. <div
  37. style="
  38. display: flex;
  39. justify-content: center;
  40. align-items: center;
  41. height: 150px;
  42. "
  43. >
  44. <el-progress
  45. color="#6395fa"
  46. type="circle"
  47. :percentage="percentage"
  48. :stroke-width="15"
  49. :width="150"
  50. :format="format"
  51. ></el-progress>
  52. </div>
  53. </div>
  54. <div style="width: 20%; height: 150px; margin-left: 16px">
  55. <div style="display: inline-block; height: 120px; margin-top: 16px">
  56. <p class="box-title">{{ $t("实际金额") }}</p>
  57. <p style="font-size: 26px; color: #4f7bfd">
  58. <span style="font-size: 14px">¥</span>
  59. <!-- {{list.amount > 10000?tool.formatAmount(tool.unitConversion(list.amount,10000),2) +this.$t('万'):tool.formatAmount(list.amount,2)}}</p>-->
  60. <span v-if="list.amount > 10000"
  61. >{{
  62. tool.formatAmount(tool.unitConversion(list.amount, 10000), 2)
  63. }}<span style="font-size: 14px">{{ $t("万") }}</span></span
  64. >
  65. <span v-else>{{
  66. tool.formatAmount(tool.unitConversion(list.amount, 10000), 2)
  67. }}</span>
  68. </p>
  69. <p class="box-title" style="color: #929292" v-if="list.tbxsje > 0">
  70. <span
  71. v-if="
  72. param.content.dateType == '本年' ||
  73. param.content.dateType == '去年'
  74. "
  75. >{{ $t("年同比") }}</span
  76. >
  77. <span v-else-if="param.content.dateType == '本季'">{{
  78. $t("季同比")
  79. }}</span>
  80. <span v-else-if="param.content.dateType == '本月'">{{
  81. $t("月同比")
  82. }}</span>
  83. <i class="el-icon-caret-top" style="color: #2ad72a"></i
  84. ><span class="box-size-color"
  85. >{{ Math.round(list.tbxsje * 100 * 100) / 100 }}%</span
  86. >
  87. </p>
  88. <p class="box-title" style="color: #929292" v-if="list.tbxsje == 0">
  89. <span
  90. v-if="
  91. param.content.dateType == '本年' ||
  92. param.content.dateType == '去年'
  93. "
  94. >{{ $t("年同比") }}</span
  95. >
  96. <span v-else-if="param.content.dateType == '本季'">{{
  97. $t("季同比")
  98. }}</span>
  99. <span v-else-if="param.content.dateType == '本月'">{{
  100. $t("月同比")
  101. }}</span>
  102. <span class="box-size-color" style="margin-left: 10px"
  103. >{{ Math.round(list.tbxsje * 100 * 100) / 100 }}%</span
  104. >
  105. </p>
  106. <p class="box-title" style="color: #929292" v-if="list.tbxsje < 0">
  107. <span
  108. v-if="
  109. param.content.dateType == '本年' ||
  110. param.content.dateType == '去年'
  111. "
  112. >{{ $t("年同比") }}</span
  113. >
  114. <span v-else-if="param.content.dateType == '本季'">{{
  115. $t("季同比")
  116. }}</span>
  117. <span v-else-if="param.content.dateType == '本月'">{{
  118. $t("月同比")
  119. }}</span>
  120. <i class="el-icon-caret-bottom" style="color: red"></i
  121. ><span class="box-size-color"
  122. >{{ Math.round(list.tbxsje * 100 * 100) / 100 }}%</span
  123. >
  124. </p>
  125. <p class="box-title" style="color: #929292" v-if="list.hbxsje > 0">
  126. <span
  127. v-if="
  128. param.content.dateType == '本年' ||
  129. param.content.dateType == '去年'
  130. "
  131. >{{ $t("年环比") }}</span
  132. >
  133. <span v-else-if="param.content.dateType == '本季'">{{
  134. $t("季环比")
  135. }}</span>
  136. <span v-else-if="param.content.dateType == '本月'">{{
  137. $t("月环比")
  138. }}</span>
  139. <i class="el-icon-caret-top" style="color: #2ad72a"></i
  140. ><span class="box-size-color"
  141. >{{ Math.round(list.hbxsje * 100 * 100) / 100 }}%</span
  142. >
  143. </p>
  144. <p class="box-title" style="color: #929292" v-if="list.hbxsje == 0">
  145. <span
  146. v-if="
  147. param.content.dateType == '本年' ||
  148. param.content.dateType == '去年'
  149. "
  150. >{{ $t("年环比") }}</span
  151. >
  152. <span v-else-if="param.content.dateType == '本季'">{{
  153. $t("季环比")
  154. }}</span>
  155. <span v-else-if="param.content.dateType == '本月'">{{
  156. $t("月环比")
  157. }}</span>
  158. <span class="box-size-color" style="margin-left: 10px"
  159. >{{ Math.round(list.hbxsje * 100 * 100) / 100 }}%</span
  160. >
  161. </p>
  162. <p class="box-title" style="color: #929292" v-if="list.hbxsje < 0">
  163. <span
  164. v-if="
  165. param.content.dateType == '本年' ||
  166. param.content.dateType == '去年'
  167. "
  168. >{{ $t("年环比") }}</span
  169. >
  170. <span v-else-if="param.content.dateType == '本季'">{{
  171. $t("季环比")
  172. }}</span>
  173. <span v-else-if="param.content.dateType == '本月'">{{
  174. $t("月环比")
  175. }}</span>
  176. <i class="el-icon-caret-bottom" style="color: red"></i
  177. ><span class="box-size-color"
  178. >{{ Math.round(list.hbxsje * 100 * 100) / 100 }}%</span
  179. >
  180. </p>
  181. </div>
  182. </div>
  183. <div style="width: 30%; height: 150px">
  184. <div style="display: inline-block; height: 120px; margin-top: 16px">
  185. <p class="box-title">{{ $t("目标金额") }}</p>
  186. <p style="font-size: 26px; color: #0c0c0c">
  187. <span style="font-size: 14px">¥</span>
  188. <!-- {{list.target_l > 10000?tool.formatAmount( tool.unitConversion(list.target_l,10000),2) +this.$t('万'):tool.formatAmount(list.target_l,2)}}</p>-->
  189. <span v-if="list.target_l > 10000"
  190. >{{
  191. tool.formatAmount(
  192. tool.unitConversion(list.target_l, 10000),
  193. 2
  194. )
  195. }}<span style="font-size: 14px">{{ $t("万") }}</span></span
  196. >
  197. <span v-else>{{
  198. tool.formatAmount(tool.unitConversion(list.target_l, 10000), 2)
  199. }}</span>
  200. </p>
  201. <p class="box-title" style="color: #929292">
  202. {{ $t("目标达成率")
  203. }}<span class="box-size-color" style="margin-left: 40px"
  204. >{{ Math.round(list.wcamount * 100 * 100) / 100 }}%</span
  205. >
  206. </p>
  207. <p
  208. class="box-title"
  209. style="color: #929292"
  210. v-if="list.unamount >= 0"
  211. >
  212. {{ $t("实际与目标差额")
  213. }}<span class="box-size-color" style="margin-left: 10px"
  214. >¥{{
  215. list.unamount > 10000
  216. ? tool.formatAmount(
  217. tool.unitConversion(list.unamount, 10000),
  218. 2
  219. ) + $t("万")
  220. : tool.formatAmount(list.unamount, 2)
  221. }}</span
  222. >
  223. </p>
  224. <p class="box-title" style="color: #929292" v-else>
  225. {{ $t("实际与目标差额")
  226. }}<span class="box-size-color" style="margin-left: 10px"
  227. >¥{{
  228. list.unamount < 10000
  229. ? tool.formatAmount(
  230. tool.unitConversion(list.unamount, 10000),
  231. 2
  232. ) + $t("万")
  233. : tool.formatAmount(list.unamount, 2)
  234. }}</span
  235. >
  236. </p>
  237. </div>
  238. </div>
  239. <div style="width: 30%; height: 150px">
  240. <div style="display: inline-block; height: 120px; margin-top: 16px">
  241. <p class="box-title">{{ $t("累计目标金额") }}</p>
  242. <p style="font-size: 26px; color: #0c0c0c">
  243. <span style="font-size: 16px">¥</span>
  244. <!-- {{list.target_l > 10000?tool.formatAmount( tool.unitConversion(list.nowTarget_l,10000),2) +this.$t('万'):tool.formatAmount(list.nowTarget_l,2)}}</p>-->
  245. <span v-if="list.nowTarget_l > 10000"
  246. >{{
  247. tool.formatAmount(
  248. tool.unitConversion(list.nowTarget_l, 10000),
  249. 2
  250. )
  251. }}<span style="font-size: 14px">{{ $t("万") }}</span></span
  252. >
  253. <span v-else>{{
  254. tool.formatAmount(
  255. tool.unitConversion(list.nowTarget_l, 10000),
  256. 2
  257. )
  258. }}</span>
  259. </p>
  260. <p class="box-title" style="color: #929292">
  261. {{ $t("累计目标达成率")
  262. }}<span class="box-size-color" style="margin-left: 40px"
  263. >{{ Math.round(list.wcnowTarget_l * 100 * 100) / 100 }}%</span
  264. >
  265. </p>
  266. <p
  267. class="box-title"
  268. style="color: #929292"
  269. v-if="list.unnowTarget_l >= 0"
  270. >
  271. {{ $t("实际与累计目标差额")
  272. }}<span class="box-size-color" style="margin-left: 10px"
  273. >¥{{
  274. list.unnowTarget_l > 10000
  275. ? tool.formatAmount(
  276. tool.unitConversion(list.unnowTarget_l, 10000),
  277. 2
  278. ) + $t("万")
  279. : tool.formatAmount(list.unnowTarget_l, 2)
  280. }}</span
  281. >
  282. </p>
  283. <p class="box-title" style="color: #929292" v-else>
  284. {{ $t("实际与累计目标差额")
  285. }}<span class="box-size-color" style="margin-left: 10px"
  286. >¥{{
  287. list.unnowTarget_l < 10000
  288. ? tool.formatAmount(
  289. tool.unitConversion(list.unnowTarget_l, 10000),
  290. 2
  291. ) + $t("万")
  292. : tool.formatAmount(list.unnowTarget_l, 2)
  293. }}</span
  294. >
  295. </p>
  296. </div>
  297. </div>
  298. </div>
  299. </div>
  300. </div>
  301. </template>
  302. <script>
  303. export default {
  304. name: "boxLine",
  305. props: ["title", "typeDate", "index"],
  306. data() {
  307. return {
  308. list: [],
  309. percentage: 0,
  310. param: {
  311. id: 20231009125304,
  312. content: {
  313. type: 1, // 0人员 1部门
  314. dataid: 103,
  315. dateType: "本年", // 本年 本季 本月
  316. datatype: 2, // 1-订单 2-出货 3-开票 4-回款
  317. where: {
  318. isleave: "",
  319. },
  320. },
  321. },
  322. };
  323. },
  324. methods: {
  325. format(percentage) {
  326. return this.$t("目标达成率") + "\n\n" + percentage + "%";
  327. },
  328. async listData() {
  329. this.title === "订单"
  330. ? (this.param.content.datatype = 1)
  331. : this.title === "出货"
  332. ? (this.param.content.datatype = 2)
  333. : this.title === "开票"
  334. ? (this.param.content.datatype = 3)
  335. : (this.param.content.datatype = 4);
  336. const res = await this.$api.requested(this.param);
  337. this.list = res.data;
  338. this.percentage = Math.round(this.list.wcamount * 100 * 100) / 100;
  339. },
  340. },
  341. };
  342. </script>
  343. <style scoped>
  344. .box-line-new {
  345. display: flex;
  346. flex-wrap: wrap;
  347. /* min-width: 900px;*/
  348. }
  349. .item {
  350. /* width: 900px;*/
  351. width: 100%;
  352. height: 210px;
  353. padding: 10px;
  354. border-radius: 2px;
  355. border: 1px solid #e9e9e9;
  356. background-color: #ffffff;
  357. box-sizing: border-box;
  358. box-shadow: -1px -1px 5px 0px rgba(0, 0, 0, 0.2);
  359. }
  360. .item .title {
  361. display: flex;
  362. flex-wrap: nowrap;
  363. font-size: 16px;
  364. }
  365. .item .content-new {
  366. display: flex;
  367. width: 100%;
  368. height: 300px;
  369. margin-top: 10px;
  370. }
  371. .item .content-new .left {
  372. width: 160px;
  373. }
  374. .item .content-new .right {
  375. width: 188px;
  376. }
  377. .item .content-new .top {
  378. width: 100%;
  379. height: 150px;
  380. padding-top: 20px;
  381. margin-bottom: -20px;
  382. }
  383. .item .content-new .bottom {
  384. width: 100%;
  385. height: 150px;
  386. }
  387. .box-title {
  388. font-size: 14px;
  389. }
  390. .box-size-color {
  391. color: #5a5a5a;
  392. font-size: 14px;
  393. }
  394. /deep/ .el-progress__text {
  395. white-space: pre;
  396. font-size: 14px !important;
  397. }
  398. </style>