index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467
  1. <template>
  2. <div class="app-container home">
  3. <ul class="block">
  4. <li>
  5. <div>
  6. <i class="el-icon-download" style="font-size: 50px;text-align: center"></i>
  7. <p>入库</p>
  8. </div>
  9. </li>
  10. <li>
  11. <div>
  12. <i class="el-icon-upload2" style="font-size: 50px;text-align: center"></i>
  13. <p>出库</p>
  14. </div>
  15. </li>
  16. <li>
  17. <div>
  18. <i class="el-icon-s-custom" style="font-size: 50px;text-align: center"></i>
  19. <p>新增用户</p>
  20. </div>
  21. </li>
  22. <li>
  23. <div>
  24. <i class="el-icon-s-cooperation" style="font-size: 50px;text-align: center"></i>
  25. <p>新增商品</p>
  26. </div>
  27. </li>
  28. <li>
  29. <div>
  30. <i class="el-icon-connection" style="font-size: 50px;text-align: center"></i>
  31. <p>调拨</p>
  32. </div>
  33. </li>
  34. <li>
  35. <div>
  36. <i class="el-icon-wallet" style="font-size: 50px;text-align: center"></i>
  37. <p>收款</p>
  38. </div>
  39. </li>
  40. <li>
  41. <div>
  42. <i class="el-icon-money" style="font-size: 50px;text-align: center"></i>
  43. <p>付款</p>
  44. </div>
  45. </li>
  46. <li>
  47. <div>
  48. <i class="el-icon-s-management" style="font-size: 50px;text-align: center"></i>
  49. <p>对账</p>
  50. </div>
  51. </li>
  52. <li>
  53. <div>
  54. <i class="el-icon-takeaway-box" style="font-size: 50px;text-align: center"></i>
  55. <p>货转</p>
  56. </div>
  57. </li>
  58. <li>
  59. <div>
  60. <i class="el-icon-s-order" style="font-size: 50px;text-align: center"></i>
  61. <p>协议</p>
  62. </div>
  63. </li>
  64. </ul>
  65. <div style="width: 30%;float: right">
  66. <div style="display: flex;">
  67. <div id="box" style="width:100%;height:350px;"></div>
  68. </div>
  69. </div>
  70. <div style="width: 100%;margin-bottom: 50px">
  71. <el-table :data="tableData" :header-cell-style="{borderBottom:'1px dashed #dfe6ec'}" :cell-style="cellStyle" style="width: 65%;float: left;">
  72. <el-table-column prop="name" label="待办事宜" width="360">
  73. </el-table-column>
  74. <el-table-column prop="date" label="时间" width="300"></el-table-column>
  75. <el-table-column prop="address" label="操作"></el-table-column>
  76. </el-table>
  77. <el-table :data="tableData" :header-cell-style="{borderBottom:'1px dashed #dfe6ec'}" :cell-style="cellStyle" style="width: 30%;float: left;margin-left: 20px;margin-right: 20px;">
  78. <el-table-column prop="name" label="消息中心" width="220"/>
  79. <el-table-column prop="address" label="操作"/>
  80. </el-table>
  81. </div>
  82. <div style="width: 100%;float: left;margin-top:20px;">
  83. <div style="display: flex;">
  84. <div id="box_s" style="width:100%;height:350px;"></div>
  85. <div id="box_ss" style="width:100%;height:350px;"></div>
  86. </div>
  87. </div>
  88. </div>
  89. </template>
  90. <script>
  91. import { listCorps , listCorps_s,listCorps_ss} from "../../src/api/index";
  92. export default {
  93. name: "index",
  94. data() {
  95. return {
  96. // 版本号
  97. version: "3.2.1",
  98. tableData: [{
  99. date: '2020-11-20 12:00',
  100. name: '<p>某客户账单审核</p>',
  101. address: '查看详情'
  102. }, {
  103. date: '2020-11-20 12:00',
  104. name: '某客户账单审核',
  105. address: '查看详情'
  106. }, {
  107. date: '2020-11-20 12:00',
  108. name: '仓储费审核结算审核',
  109. address: '查看详情'
  110. }]
  111. };
  112. },
  113. mounted() {
  114. this.drawLine();
  115. this.drawLine_s();
  116. this.drawLine_ss();
  117. },
  118. created(){
  119. this.getList();
  120. this.getLabel_s();
  121. this.getLabel_ss();
  122. },
  123. methods: {
  124. //设置单元格边框
  125. cellStyle({row, column, rowIndex, columnIndex}) {
  126. return 'border-bottom: 1px dashed rgb(223, 230, 236)'
  127. },
  128. //查询消息中心
  129. getList() {
  130. this.loading = true;
  131. listCorps(this.queryParams).then(response => {
  132. console.log(response.rows);
  133. });
  134. },
  135. // 仓库图表
  136. getLabel_s(){
  137. listCorps_s(this.queryParse).then(response =>{
  138. console.log(response.rows);
  139. })
  140. },
  141. // 商品图表
  142. getLabel_ss(){
  143. listCorps_ss(0).then(response =>{
  144. console.log(response);
  145. })
  146. },
  147. goTarget(href) {
  148. window.open(href, "_blank");
  149. },
  150. //仓库图表
  151. drawLine() {
  152. // 基于准备好的dom,初始化echarts实例,所以只能在mounted中调用
  153. let myChart = this.$echarts.init(document.getElementById('box'))
  154. // 绘制图表
  155. myChart.setOption({
  156. title: {
  157. text: '某某库存统计',
  158. subtext: '虚构数据',
  159. left: 'center'
  160. },
  161. tooltip: {
  162. trigger: 'item',
  163. formatter: '{a} <br/>{b} : {c} ({d}%)'
  164. },
  165. legend: {
  166. // orient: 'vertical',
  167. // top: 'middle',
  168. bottom: 10,
  169. left: 'center',
  170. data: ['西凉', '益州', '兖州', '荆州']
  171. },
  172. series: [
  173. {
  174. type: 'pie',
  175. radius: '65%',
  176. center: ['50%', '50%'],
  177. selectedMode: 'single',
  178. data: [
  179. {
  180. label: {
  181. backgroundColor: '#eee',
  182. borderColor: '#777',
  183. borderWidth: 1,
  184. borderRadius: 4,
  185. rich: {
  186. title: {
  187. color: '#eee',
  188. align: 'center'
  189. },
  190. abg: {
  191. backgroundColor: '#333',
  192. width: '100%',
  193. align: 'right',
  194. height: 25,
  195. borderRadius: [4, 4, 0, 0]
  196. },
  197. Sunny: {
  198. height: 30,
  199. align: 'left'
  200. },
  201. Cloudy: {
  202. height: 30,
  203. align: 'left'
  204. },
  205. Showers: {
  206. height: 30,
  207. align: 'left'
  208. },
  209. weatherHead: {
  210. color: '#333',
  211. height: 24,
  212. align: 'left'
  213. },
  214. hr: {
  215. borderColor: '#777',
  216. width: '100%',
  217. borderWidth: 0.5,
  218. height: 0
  219. },
  220. value: {
  221. width: 20,
  222. padding: [0, 20, 0, 30],
  223. align: 'left'
  224. },
  225. valueHead: {
  226. color: '#333',
  227. width: 20,
  228. padding: [0, 20, 0, 30],
  229. align: 'center'
  230. },
  231. rate: {
  232. width: 40,
  233. align: 'right',
  234. padding: [0, 10, 0, 0]
  235. },
  236. rateHead: {
  237. color: '#333',
  238. width: 40,
  239. align: 'center',
  240. padding: [0, 10, 0, 0]
  241. }
  242. }
  243. }
  244. },
  245. {value: 200, name: '1号仓库'},
  246. {value: 500, name: '剩余库容'},
  247. ],
  248. emphasis: {
  249. itemStyle: {
  250. shadowBlur: 10,
  251. shadowOffsetX: 0,
  252. shadowColor: 'rgba(0, 0, 0, 0.5)'
  253. }
  254. }
  255. }
  256. ]
  257. });
  258. },
  259. drawLine_s() {
  260. // 基于准备好的dom,初始化echarts实例,所以只能在mounted中调用
  261. let myChart = this.$echarts.init(document.getElementById('box_s'))
  262. // 绘制图表
  263. myChart.setOption({
  264. backgroundColor: '#fff',
  265. title: {
  266. text: '货主库存占比统计',
  267. left: 'center',
  268. top: 20,
  269. textStyle: {
  270. color: '#333333'
  271. }
  272. },
  273. tooltip: {
  274. trigger: 'item',
  275. formatter: '{a} <br/>{b} : {c} ({d}%)'
  276. },
  277. visualMap: {
  278. show: false,
  279. min: 80,
  280. max: 600,
  281. inRange: {
  282. colorLightness: [0, 1]
  283. }
  284. },
  285. series: [
  286. {
  287. name: '虚构数据',
  288. type: 'pie',
  289. radius: '80%',
  290. center: ['50%', '60%'],
  291. data: [
  292. {value: 335, name: '货主1'},
  293. {value: 310, name: '货主2'},
  294. {value: 274, name: '货主3'},
  295. {value: 235, name: '货主4'},
  296. {value: 400, name: '货主5'}
  297. ].sort(function (a, b) { return a.value - b.value; }),
  298. roseType: 'radius',
  299. label: {
  300. // color: 'rgba(0, 0, 0, 1)'
  301. },
  302. labelLine: {
  303. lineStyle: {
  304. // color: 'rgba(51, 51, 51, 1)'
  305. },
  306. smooth: 0.2,
  307. length: 10,
  308. length2: 20
  309. },
  310. itemStyle: {
  311. // color: '#000',
  312. // shadowBlur: 200,
  313. shadowColor: 'rgba(0, 0, 0, 0.5)'
  314. },
  315. animationType: 'scale',
  316. animationEasing: 'elasticOut',
  317. animationDelay: function (idx) {
  318. return Math.random() * 200;
  319. }
  320. }
  321. ]
  322. });
  323. },
  324. drawLine_ss() {
  325. // 基于准备好的dom,初始化echarts实例,所以只能在mounted中调用
  326. let myChart = this.$echarts.init(document.getElementById('box_ss'))
  327. // 绘制图表
  328. myChart.setOption({
  329. title: {
  330. text: '本仓库商品统计',
  331. subtext: '虚构数据',
  332. left: 'center'
  333. },
  334. color: ['#3398DB'],
  335. tooltip: {
  336. trigger: 'axis',
  337. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  338. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  339. }
  340. },
  341. grid: {
  342. left: '3%',
  343. right: '4%',
  344. bottom: '3%',
  345. containLabel: true
  346. },
  347. xAxis: [
  348. {
  349. type: 'category',
  350. data: ['棉花', '淀粉', '木薯', '冰糖', '麻花', '海盐', '胡椒粉'],
  351. axisTick: {
  352. alignWithLabel: true
  353. }
  354. }
  355. ],
  356. yAxis: [
  357. {
  358. type: 'value'
  359. }
  360. ],
  361. series: [
  362. {
  363. name: '实时状态',
  364. type: 'bar',
  365. barWidth: '60%',
  366. data: [10, 52, 200, 334, 390, 330, 220]
  367. }
  368. ]
  369. });
  370. }
  371. },
  372. };
  373. </script>
  374. <style scoped lang="scss">
  375. .block{
  376. width: 70%;
  377. float: left;
  378. display: flex;
  379. flex-wrap: wrap;
  380. height: 350px;
  381. li{
  382. width: 18%;
  383. height: 150px;
  384. background-color: #1c84c6;
  385. margin-left: 10px;
  386. text-align: center;
  387. color: #FFFFFF;
  388. border-radius: 10px;
  389. div{
  390. margin-top: 40px;
  391. p{
  392. font-size: 20px;
  393. }
  394. }
  395. }
  396. }
  397. .home {
  398. blockquote {
  399. padding: 10px 20px;
  400. margin: 0 0 20px;
  401. font-size: 17.5px;
  402. border-left: 5px solid #eee;
  403. }
  404. hr {
  405. margin-top: 20px;
  406. margin-bottom: 20px;
  407. border: 0;
  408. border-top: 1px solid #eee;
  409. }
  410. .col-item {
  411. margin-bottom: 20px;
  412. }
  413. ul {
  414. padding: 0;
  415. margin: 0;
  416. }
  417. font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  418. font-size: 13px;
  419. color: #676a6c;
  420. overflow-x: hidden;
  421. ul {
  422. list-style-type: none;
  423. }
  424. h4 {
  425. margin-top: 0px;
  426. }
  427. h2 {
  428. margin-top: 10px;
  429. font-size: 26px;
  430. font-weight: 100;
  431. }
  432. p {
  433. margin-top: 10px;
  434. b {
  435. font-weight: 700;
  436. }
  437. }
  438. .update-log {
  439. ol {
  440. display: block;
  441. list-style-type: decimal;
  442. margin-block-start: 1em;
  443. margin-block-end: 1em;
  444. margin-inline-start: 0;
  445. margin-inline-end: 0;
  446. padding-inline-start: 40px;
  447. }
  448. }
  449. }
  450. </style>