sales-reached.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <template>
  2. <div>
  3. <div class="home-container" v-if="sysType != 2">
  4. <el-card class="home-container__card">
  5. <div class="title">
  6. <span>
  7. 当月入库
  8. </span>
  9. <span>
  10. <i
  11. class="el-icon-refresh-right"
  12. style="cursor: pointer;font-size:20px"
  13. @click="refresh"
  14. ></i>
  15. </span>
  16. </div>
  17. <div class="content" v-loading="loading">
  18. <div style="display:flex">
  19. <div id="ringData" ref="ringData" style="width:20vw;height:33vh" />
  20. <div>
  21. <div class="content_item">
  22. <div class="content_item_num">{{ data.grossAmount || 0 }}</div>
  23. <div class="content_item_text">已审核数量</div>
  24. </div>
  25. <div class="content_item">
  26. <div class="content_item_num">{{ data.reachAmount || 0 }}</div>
  27. <div class="content_item_text">未审核数量</div>
  28. </div>
  29. <div class="content_item">
  30. <div class="divider" />
  31. </div>
  32. <div class="content_item">
  33. <div class="content_item_num">{{ data.notReachAmount || 0}}</div>
  34. <div class="content_item_text">合计</div>
  35. </div>
  36. </div>
  37. </div>
  38. </div>
  39. </el-card>
  40. </div>
  41. <!-- <domSales v-if="sysType == 2"/>-->
  42. </div>
  43. </template>
  44. <script>
  45. import { monthSales } from "@/api/wel";
  46. // import domSales from "/home/domesticTrade/domSales";
  47. export default {
  48. name: "basicContainer",
  49. props: {
  50. sysType: Number
  51. },
  52. components: {
  53. // domSales
  54. },
  55. data() {
  56. return {
  57. loading: false,
  58. tradeType: null,
  59. data: {}
  60. };
  61. },
  62. created() {
  63. this.getSysType();
  64. },
  65. mounted() {
  66. this.init();
  67. },
  68. methods: {
  69. init() {
  70. this.getmonthSales();
  71. },
  72. getSysType() {
  73. const sysType = localStorage.getItem("sysitemType");
  74. if (sysType == 6) {
  75. this.tradeType = "JXS";
  76. } else if (sysType == 5) {
  77. this.tradeType = "SW";
  78. } else if (sysType == 4) {
  79. this.tradeType = "CK";
  80. } else if (sysType == 3) {
  81. this.tradeType = "JK";
  82. } else if (sysType == 2) {
  83. this.tradeType = "GN";
  84. } else if (sysType == 1) {
  85. this.tradeType = "XX";
  86. } else if (sysType == 999) {
  87. this.tradeType = "ADMIN";
  88. }
  89. },
  90. getmonthSales() {
  91. this.loading = true;
  92. monthSales({ tradeType: this.tradeType, billType: "BJ" })
  93. .then(res => {
  94. this.data = res.data.data;
  95. })
  96. .finally(() => {
  97. this.loading = false;
  98. this.ringData();
  99. });
  100. },
  101. refresh() {
  102. this.init();
  103. },
  104. ringData() {
  105. let ringData = this.$echarts.init(document.getElementById("ringData"));
  106. ringData.setOption({
  107. tooltip: {
  108. trigger: "item"
  109. },
  110. legend: {
  111. top: "3%",
  112. left: "center"
  113. },
  114. graphic: [
  115. {
  116. type: "text",
  117. left: "center",
  118. top: "43%",
  119. style: {
  120. text: this.data.yieldRate + "%",
  121. textAlign: "center",
  122. fill: "#000",
  123. fontSize: 24
  124. }
  125. },
  126. {
  127. type: "text",
  128. left: "center",
  129. top: "53%",
  130. style: {
  131. text: "报价达成率",
  132. textAlign: "center",
  133. fill: "#999999",
  134. fontSize: 16
  135. }
  136. }
  137. ],
  138. color: ["#F6695E", "#E3E3E3"],
  139. series: [
  140. {
  141. name: "当月报价",
  142. type: "pie",
  143. radius: ["55%", "70%"],
  144. avoidLabelOverlap: false,
  145. label: {
  146. show: false,
  147. position: "center"
  148. },
  149. labelLine: {
  150. show: false
  151. },
  152. data: [
  153. { value: Number(this.data.grossAmount), name: "已审核数量" },
  154. { value: Number(this.data.reachAmount), name: "未审核数量" }
  155. ]
  156. }
  157. ]
  158. });
  159. }
  160. }
  161. };
  162. </script>
  163. <style lang="scss" scoped>
  164. .home-container {
  165. padding: 0px 5px 5px 5px;
  166. box-sizing: border-box;
  167. height: 100%;
  168. ::v-deep .el-card__body {
  169. padding: 10px 15px;
  170. font-size: 14px;
  171. }
  172. &__card {
  173. width: 100%;
  174. height: 100%;
  175. }
  176. .title {
  177. display: flex;
  178. justify-content: space-between;
  179. }
  180. }
  181. .content {
  182. display: flex;
  183. &_item {
  184. margin-top: 20px;
  185. .divider {
  186. display: block;
  187. height: 0px;
  188. width: 12vw;
  189. border-top: 1px dashed #dcdfe6;
  190. }
  191. &_num {
  192. font-size: 18px;
  193. font-weight: 600;
  194. }
  195. &_text {
  196. color: #909399;
  197. }
  198. }
  199. }
  200. </style>