losleftform.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. <template>
  2. <div>
  3. <div class="home-container" >
  4. <el-card class="home-container__card">
  5. <div class="title">
  6. <span></span>
  7. <div class="right">
  8. <div class="right_but">
  9. <div
  10. class="right_but_left"
  11. :class="{ right_but_active: isActive == 1 }"
  12. @click="inDay">本日
  13. </div>
  14. <div
  15. class="right_but_right"
  16. :class="{ right_but_active: isActive == 2 }"
  17. @click="inMoon">本月
  18. </div>
  19. </div>
  20. <el-date-picker
  21. v-model="realDate"
  22. type="daterange"
  23. size="mini"
  24. start-placeholder="开始日期"
  25. end-placeholder="结束日期"
  26. value-format="yyyy-MM-dd"
  27. style="margin-right:10px;width:240px"
  28. :clearable="false"
  29. >
  30. </el-date-picker>
  31. <el-button
  32. type="primary"
  33. size="mini"
  34. icon="el-icon-search"
  35. style="margin-right:10px;"
  36. @click="search"
  37. circle
  38. ></el-button>
  39. <i class="el-icon-refresh-right" style="cursor: pointer;font-size:20px" @click="refresh"></i>
  40. </div>
  41. </div>
  42. <div class="content" v-loading="loading">
  43. <div style="display:flex">
  44. <div id="ringData" ref="ringData" style="width:20vw;height:33vh"/>
  45. <div>
  46. <div class="content_item">
  47. <div class="content_item_num">{{ data.sum }}</div>
  48. <div class="content_item_text">订单总数量</div>
  49. </div>
  50. <div class="content_item">
  51. <div class="content_item_num">{{ data.refurbishment }}</div>
  52. <div class="content_item_text">退舱数量</div>
  53. </div>
  54. <div class="content_item">
  55. <div class="divider"/>
  56. </div>
  57. <div class="content_item">
  58. <div class="content_item_num">{{ data.complete }}</div>
  59. <div class="content_item_text">完成数量</div>
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. </el-card>
  65. </div>
  66. </div>
  67. </template>
  68. <script>
  69. import {monthSales, documentQuantityStatistics, completionRate} from "@/api/wel";
  70. import search from "@/page/index/search.vue";
  71. import {dateFormat, defaultDate2,defaultDate3} from "@/util/date";
  72. import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
  73. export default {
  74. name: "basicContainer",
  75. props: {
  76. sysType: Number
  77. },
  78. components: {
  79. SearchQuery
  80. },
  81. data() {
  82. return {
  83. tenantId: this.$store.getters.userInfo.tenant_id,
  84. loading: false,
  85. data: {},
  86. isActive: 1, // 本日/本月按钮是否选中状态
  87. realDate:[], // 时间
  88. };
  89. },
  90. created() {
  91. this.realDate = defaultDate2();
  92. },
  93. mounted() {
  94. this.init();
  95. },
  96. methods: {
  97. init() {
  98. if (this.realDate == null) {
  99. return this.$message.error("请选择日期");
  100. }
  101. this.completionRatefun()
  102. },
  103. // 获取数据
  104. completionRatefun(){
  105. this.loading = true
  106. completionRate({
  107. dateStart:this.realDate[0],
  108. dateEnd:this.realDate[1]
  109. }).then(res=>{
  110. console.log(res.data.data,92)
  111. this.data = res.data.data
  112. }).finally(() => {
  113. this.loading = false;
  114. this.ringData();
  115. });
  116. },
  117. refresh() {
  118. this.init();
  119. },
  120. // 本日按钮
  121. inDay() {
  122. this.isActive = 1;
  123. this.realDate = defaultDate2(); // 获取当天
  124. this.init();
  125. },
  126. // 本月按钮
  127. inMoon() {
  128. this.isActive = 2;
  129. this.realDate = defaultDate3(); // 获取本月第一天和本月最后一天
  130. this.init();
  131. },
  132. // 搜索
  133. search() {
  134. this.isActive = 3;
  135. this.init();
  136. },
  137. // echarts配置项
  138. ringData() {
  139. let ringData = this.$echarts.init(document.getElementById("ringData"));
  140. ringData.setOption({
  141. tooltip: {
  142. trigger: "item"
  143. },
  144. legend: {
  145. top: "3%",
  146. left: "center"
  147. },
  148. graphic: [
  149. {
  150. type: "text",
  151. left: "center",
  152. top: "43%",
  153. style: {
  154. text: this.data.rate + "%",
  155. textAlign: "center",
  156. fill: "#000",
  157. fontSize: 24
  158. }
  159. },
  160. {
  161. type: "text",
  162. left: "center",
  163. top: "53%",
  164. style: {
  165. text: "业务完成率",
  166. textAlign: "center",
  167. fill: "#999999",
  168. fontSize: 16
  169. }
  170. }
  171. ],
  172. color: ["#F6695E", "#E3E3E3"],
  173. series: [
  174. {
  175. name: "当月报价",
  176. type: "pie",
  177. radius: ["55%", "70%"],
  178. avoidLabelOverlap: false,
  179. label: {
  180. show: false,
  181. position: "center"
  182. },
  183. labelLine: {
  184. show: false
  185. },
  186. data: [
  187. { value: Number(this.data.refurbishment), name: "退舱数量" },
  188. { value: Number(this.data.complete), name: "完成数量" }
  189. ]
  190. }
  191. ]
  192. });
  193. }
  194. }
  195. };
  196. </script>
  197. <style lang="scss" scoped>
  198. .home-container {
  199. padding: 0px 5px 5px 5px;
  200. box-sizing: border-box;
  201. height: 100%;
  202. ::v-deep .el-card__body {
  203. padding: 10px 15px;
  204. font-size: 14px;
  205. }
  206. &__card {
  207. width: 100%;
  208. height: 100%;
  209. }
  210. .title {
  211. display: flex;
  212. justify-content: space-between;
  213. .right {
  214. display: flex;
  215. align-items: center;
  216. &_but {
  217. margin: 0 10px;
  218. border: 1px solid #409eff;
  219. width: 80px;
  220. border-radius: 3px;
  221. display: flex;
  222. &_left {
  223. width: 40px;
  224. text-align: center;
  225. color: #409eff;
  226. border-right: 1px solid #409eff;
  227. cursor: pointer;
  228. }
  229. &_right {
  230. width: 40px;
  231. text-align: center;
  232. color: #409eff;
  233. cursor: pointer;
  234. }
  235. &_active {
  236. color: #fff;
  237. background-color: #409eff;
  238. }
  239. }
  240. }
  241. }
  242. }
  243. .content {
  244. display: flex;
  245. &_item {
  246. margin-top: 20px;
  247. .divider {
  248. display: block;
  249. height: 0px;
  250. width: 12vw;
  251. border-top: 1px dashed #dcdfe6;
  252. }
  253. &_num {
  254. font-size: 18px;
  255. font-weight: 600;
  256. }
  257. &_text {
  258. color: #909399;
  259. }
  260. }
  261. }
  262. </style>