index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637
  1. <template>
  2. <div class="app-container home">
  3. <ul class="block">
  4. <li @click="jump('/business/inStock')">
  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 @click="jump('/business/outStock')">
  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 @click="jump('/basicdata/corps')">
  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 @click="jump('/basicdata/goods')">
  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 @click="jump('/business/transfer')">
  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 @click="jump('/finance/charge')">
  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 @click="jump('/finance/payment')">
  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 @click="jump('/finance/contrast')">
  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 @click="jump('/business/goodsTransfer')">
  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 @click="jump('/agreement/agreementStorage')">
  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. <el-select v-model="select" slot="prepend" size="mini" :select="query()" placeholder="点击切换仓库"
  69. style="position:absolute; width: 8%;right: 1%;"
  70. >
  71. <div v-for="(item, index) in warehouse" :key="index">
  72. <el-option :label="item.fName" :value="item.fWarehouseid"></el-option>
  73. </div>
  74. </el-select>
  75. </div>
  76. </div>
  77. <div style="width: 100%;margin-bottom: 50px;">
  78. <el-table :data="tableData" :header-cell-style="{borderBottom:'1px dashed #dfe6ec'}" :cell-style="cellStyle"
  79. style="width: 67.5%;float: left;"
  80. >
  81. <el-table-column prop="name" label="待办事宜">
  82. </el-table-column>
  83. <el-table-column prop="date" label="时间"></el-table-column>
  84. <el-table-column prop="address" label="操作" width="80"></el-table-column>
  85. </el-table>
  86. <el-table :data="tableDataTwo" :header-cell-style="{borderBottom:'1px dashed #dfe6ec'}" :cell-style="cellStyle"
  87. style="width: 30%;float: right;margin-left: 20px;"
  88. >
  89. <el-table-column prop="noticeTitle" :show-overflow-tooltip="true" label="消息中心"/>
  90. <el-table-column prop="address" label="操作" width="80">
  91. <span @click="bug()" style="cursor:pointer">查看详情</span>
  92. <template slot-scope="scope">
  93. <span @click="bug(scope.row.noticeContent)" style="cursor:pointer">查看详情</span>
  94. </template>
  95. </el-table-column>
  96. </el-table>
  97. </div>
  98. <div style="width: 100%;float: left;margin-top:20px;">
  99. <div style="display: flex;">
  100. <div id="box_s" style="width:33%;height:350px;"></div>
  101. <div id="box_" style="width:33%;height:350px;"></div>
  102. <div id="box_ss" style="width:30%;height:350px;margin-left: 40px"></div>
  103. </div>
  104. </div>
  105. <el-dialog
  106. title="消息提示"
  107. :visible.sync="dialogVisible"
  108. width="80%"
  109. :before-close="handleClose"
  110. :close-on-click-modal="false"
  111. >
  112. <span v-html="text" class="text" style="max-width: 100%;height: auto;"></span>
  113. <span slot="footer" class="dialog-footer">
  114. <!-- <el-button @click="dialogVisible = false">取 消</el-button>-->
  115. <el-button type="primary" @click="dialogVisible = false">关 闭</el-button>
  116. </span>
  117. </el-dialog>
  118. <el-button type="primary" @click="addOrUpdateHandle">查看审批</el-button>
  119. <el-button type="primary" @click="addOrUpdateHand">审批弹窗</el-button>
  120. <!-- 弹窗, 新增 / 修改 -->
  121. <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate"></add-or-update>
  122. <approval-comments v-if="addOrUpdateVisib" ref="ApprovalComments"></approval-comments>
  123. </div>
  124. </template>
  125. <script>
  126. import { listCorps, information, warehouse } from '../../src/api/index'
  127. import AddOrUpdate from '@/views/viewApproval'
  128. import ApprovalComments from '@/views/startApproval'
  129. export default {
  130. name: 'index',
  131. data() {
  132. return {
  133. editModel: {},
  134. // 版本号
  135. version: '3.2.1',
  136. select: '',
  137. text: '',
  138. dialogVisible: false,
  139. addOrUpdateVisible: false,
  140. addOrUpdateVisib: false,
  141. tableData: [{
  142. date: '2020-11-20 12:00',
  143. name: '某客户账单审核',
  144. address: '查看详情'
  145. }, {
  146. date: '2020-11-20 12:00',
  147. name: '某客户账单审核',
  148. address: '查看详情'
  149. }, {
  150. date: '2020-11-20 12:00',
  151. name: '仓储费审核结算审核',
  152. address: '查看详情'
  153. }],
  154. chart: [],
  155. warehouse: [],
  156. master: [],
  157. commodity: [],
  158. commoditytwo: [],
  159. name: [],
  160. tableDataTwo: []
  161. }
  162. },
  163. components: {
  164. AddOrUpdate,
  165. ApprovalComments
  166. },
  167. mounted() {
  168. },
  169. created() {
  170. this.getList()
  171. this.warehouses()
  172. this.firstinventory()
  173. },
  174. methods: {
  175. addOrUpdateHandle(){
  176. this.addOrUpdateVisible = true
  177. this.addOrUpdateVisib = false
  178. let id = '448'
  179. let actId = '110'
  180. this.$nextTick(() => {
  181. this.$refs.addOrUpdate.init(id,actId)
  182. })
  183. },
  184. addOrUpdateHand(){
  185. this.addOrUpdateVisib = true
  186. this.addOrUpdateVisible = false
  187. let id = '448'
  188. let actId = '110'
  189. this.$nextTick(() => {
  190. this.$refs.ApprovalComments.init(id,actId)
  191. })
  192. },
  193. bug(res) {
  194. this.dialogVisible = true
  195. this.text = res
  196. },
  197. handleClose(done) {
  198. // console.log(done)
  199. this.dialogVisible = false
  200. },
  201. firstinventory() {
  202. information(0).then(response => {
  203. console.log(response)
  204. this.chart = response.data
  205. for (let index of this.chart.corpsListWhouse) {
  206. this.master.push({
  207. name: index.fName,
  208. value: index.fGrossweightD
  209. })
  210. this.name.push(index.fName)
  211. }
  212. for (let index of this.chart.goodslistWhouse) {
  213. this.commodity.push(index.fName)
  214. this.commoditytwo.push(index.fGrossweightD)
  215. }
  216. this.drawLine()
  217. this.drawLinetwo()
  218. this.drawLine_ss()
  219. this.drawLinetwos()
  220. })
  221. },
  222. query() {
  223. this.master = []
  224. this.commodity = []
  225. this.commoditytwo = []
  226. this.name = []
  227. if (this.select === '') {
  228. return this.select
  229. } else {
  230. information(this.select).then(response => {
  231. console.log(response)
  232. this.chart = response.data
  233. for (let index of this.chart.corpsListWhouse) {
  234. this.master.push({
  235. name: index.fName,
  236. value: index.fGrossweightD
  237. })
  238. this.name.push(index.fName)
  239. }
  240. for (let index of this.chart.goodslistWhouse) {
  241. this.commodity.push(index.fName)
  242. this.commoditytwo.push(index.fGrossweightD)
  243. }
  244. this.drawLine()
  245. this.drawLinetwo()
  246. this.drawLine_ss()
  247. })
  248. }
  249. },
  250. jump(res) {
  251. this.$router.push({ path: res })
  252. },
  253. //设置单元格边框
  254. cellStyle({ row, column, rowIndex, columnIndex }) {
  255. return 'border-bottom: 1px dashed rgb(223, 230, 236)'
  256. },
  257. //查询消息中心
  258. getList() {
  259. this.loading = true
  260. listCorps(this.queryParams).then(response => {
  261. this.tableDataTwo = response.rows
  262. })
  263. },
  264. //查询仓库
  265. warehouses() {
  266. warehouse().then(response => {
  267. this.warehouse = []
  268. for (let index of response.rows) {
  269. this.warehouse.push({
  270. fName: index.fName,
  271. fWarehouseid: index.fWarehouseid
  272. })
  273. }
  274. })
  275. },
  276. goTarget(href) {
  277. window.open(href, '_blank')
  278. },
  279. //仓库图表
  280. drawLine() {
  281. // 基于准备好的dom,初始化echarts实例,所以只能在mounted中调用
  282. let myChart = this.$echarts.init(document.getElementById('box'))
  283. // 绘制图表
  284. myChart.setOption({
  285. title: {
  286. text: this.chart.whouseList[0].fName + '统计',
  287. subtext: '实时数据',
  288. left: 'center'
  289. },
  290. tooltip: {
  291. trigger: 'item',
  292. formatter: '{a} <br/>{b} : {c} ({d}%)'
  293. },
  294. legend: {
  295. bottom: 10,
  296. left: 'center',
  297. data: ['空闲库容', '占用库容']
  298. },
  299. series: [
  300. {
  301. type: 'pie',
  302. name: '实时数据',
  303. radius: '65%',
  304. center: ['50%', '50%'],
  305. selectedMode: 'single',
  306. data: [
  307. {
  308. label: {
  309. backgroundColor: '#eee',
  310. borderColor: '#777',
  311. borderWidth: 1,
  312. borderRadius: 4,
  313. rich: {
  314. title: {
  315. color: '#eee',
  316. align: 'center'
  317. },
  318. abg: {
  319. backgroundColor: '#333',
  320. width: '100%',
  321. align: 'right',
  322. height: 25,
  323. borderRadius: [4, 4, 0, 0]
  324. },
  325. Sunny: {
  326. height: 30,
  327. align: 'left'
  328. },
  329. Cloudy: {
  330. height: 30,
  331. align: 'left'
  332. },
  333. Showers: {
  334. height: 30,
  335. align: 'left'
  336. },
  337. weatherHead: {
  338. color: '#333',
  339. height: 24,
  340. align: 'left'
  341. },
  342. hr: {
  343. borderColor: '#777',
  344. width: '100%',
  345. borderWidth: 0.5,
  346. height: 0
  347. },
  348. value: {
  349. width: 20,
  350. padding: [0, 20, 0, 30],
  351. align: 'left'
  352. },
  353. valueHead: {
  354. color: '#333',
  355. width: 20,
  356. padding: [0, 20, 0, 30],
  357. align: 'center'
  358. },
  359. rate: {
  360. width: 40,
  361. align: 'right',
  362. padding: [0, 10, 0, 0]
  363. },
  364. rateHead: {
  365. color: '#333',
  366. width: 40,
  367. align: 'center',
  368. padding: [0, 10, 0, 0]
  369. }
  370. }
  371. }
  372. },
  373. { value: this.chart.whouseList[0].fGrossweightD, name: '占用库容' },
  374. { value: parseFloat(this.chart.whouseList[0].fTotalgross - this.chart.whouseList[0].fGrossweightD).toFixed(1), name: '空闲库容' }
  375. ],
  376. emphasis: {
  377. itemStyle: {
  378. shadowBlur: 10,
  379. shadowOffsetX: 0,
  380. shadowColor: 'rgba(0, 0, 0, 0.5)'
  381. }
  382. }
  383. }
  384. ]
  385. })
  386. },
  387. drawLinetwos() {
  388. // 基于准备好的dom,初始化echarts实例,所以只能在mounted中调用
  389. let myChart = this.$echarts.init(document.getElementById('box_'))
  390. // 绘制图表
  391. myChart.setOption({
  392. title: {
  393. text: '数据统计',
  394. subtext: '实时数据',
  395. left: 'center'
  396. },
  397. tooltip: {
  398. trigger: 'item',
  399. formatter: '{a} <br/>{b}: {c} ({d}%)'
  400. },
  401. legend: {
  402. bottom: 10,
  403. left: 'center',
  404. data: this.name
  405. },
  406. series: [
  407. {
  408. name: '访问来源',
  409. type: 'pie',
  410. radius: ['40%', '60%'],
  411. avoidLabelOverlap: false,
  412. label: {
  413. show: false,
  414. position: 'center'
  415. },
  416. emphasis: {
  417. label: {
  418. // show: true,
  419. fontSize: '30',
  420. fontWeight: 'bold'
  421. }
  422. },
  423. labelLine: {
  424. show: false
  425. },
  426. data:
  427. this.master
  428. }
  429. ]
  430. })
  431. },
  432. drawLinetwo() {
  433. // 基于准备好的dom,初始化echarts实例,所以只能在mounted中调用
  434. let myChart = this.$echarts.init(document.getElementById('box_s'))
  435. // 绘制图表
  436. myChart.setOption({
  437. title: {
  438. text: this.chart.whouseList[0].fName + '货权方统计',
  439. subtext: '实时数据',
  440. left: 'center'
  441. },
  442. tooltip: {
  443. trigger: 'item',
  444. formatter: '{a} <br/>{b}: {c} ({d}%)'
  445. },
  446. legend: {
  447. bottom: 10,
  448. left: 'center',
  449. data: this.name
  450. },
  451. series: [
  452. {
  453. name: '访问来源',
  454. type: 'pie',
  455. radius: ['40%', '60%'],
  456. avoidLabelOverlap: false,
  457. label: {
  458. show: false,
  459. position: 'center'
  460. },
  461. emphasis: {
  462. label: {
  463. // show: true,
  464. fontSize: '30',
  465. fontWeight: 'bold'
  466. }
  467. },
  468. labelLine: {
  469. show: false
  470. },
  471. data:
  472. this.master
  473. }
  474. ]
  475. })
  476. },
  477. drawLine_ss() {
  478. // 基于准备好的dom,初始化echarts实例,所以只能在mounted中调用
  479. let myChart = this.$echarts.init(document.getElementById('box_ss'))
  480. // 绘制图表
  481. myChart.setOption({
  482. title: {
  483. text:this.chart.whouseList[0].fName + '商品统计',
  484. subtext: '实时数据',
  485. left: 'center'
  486. },
  487. color: ['#3398DB'],
  488. tooltip: {
  489. trigger: 'axis',
  490. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  491. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  492. }
  493. },
  494. grid: {
  495. left: '3%',
  496. right: '4%',
  497. bottom: '3%',
  498. containLabel: true
  499. },
  500. xAxis: [
  501. {
  502. type: 'category',
  503. data: this.commodity,
  504. axisTick: {
  505. alignWithLabel: true
  506. }
  507. }
  508. ],
  509. yAxis: [
  510. {
  511. type: 'value'
  512. }
  513. ],
  514. series: [
  515. {
  516. name: '实时状态',
  517. type: 'bar',
  518. barWidth: '60%',
  519. data: this.commoditytwo
  520. }
  521. ]
  522. })
  523. }
  524. }
  525. }
  526. </script>
  527. <style scoped lang="scss">
  528. .block {
  529. width: 68%;
  530. float: left;
  531. display: flex;
  532. flex-wrap: wrap;
  533. justify-content: space-around;
  534. height: 350px;
  535. li:hover{
  536. background-color: #025184;
  537. }
  538. li:nth-child(6),li:nth-child(7),li:nth-child(8),li:nth-child(9),li:nth-child(10){
  539. background-color: #2f4554;
  540. }
  541. li:nth-child(6):hover,li:nth-child(7):hover,li:nth-child(8):hover,li:nth-child(9):hover,li:nth-child(10):hover{
  542. background-color: #2f4454d1;
  543. }
  544. li {
  545. width: 18%;
  546. height: 150px;
  547. background-color: #1c84c6;
  548. margin-left: 10px;
  549. text-align: center;
  550. color: #FFFFFF;
  551. border-radius: 10px;
  552. cursor:pointer;
  553. div {
  554. margin-top: 40px;
  555. p {
  556. font-size: 20px;
  557. }
  558. }
  559. }
  560. }
  561. .home {
  562. blockquote {
  563. padding: 10px 20px;
  564. margin: 0 0 20px;
  565. font-size: 17.5px;
  566. border-left: 5px solid #eee;
  567. }
  568. hr {
  569. margin-top: 20px;
  570. margin-bottom: 20px;
  571. border: 0;
  572. border-top: 1px solid #eee;
  573. }
  574. .col-item {
  575. margin-bottom: 20px;
  576. }
  577. ul {
  578. padding: 0;
  579. margin: 0;
  580. }
  581. font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  582. font-size: 13px;
  583. color: #676a6c;
  584. overflow-x: hidden;
  585. ul {
  586. list-style-type: none;
  587. }
  588. h4 {
  589. margin-top: 0px;
  590. }
  591. h2 {
  592. margin-top: 10px;
  593. font-size: 26px;
  594. font-weight: 100;
  595. }
  596. p {
  597. margin-top: 10px;
  598. b {
  599. font-weight: 700;
  600. }
  601. }
  602. .update-log {
  603. ol {
  604. display: block;
  605. list-style-type: decimal;
  606. margin-block-start: 1em;
  607. margin-block-end: 1em;
  608. margin-inline-start: 0;
  609. margin-inline-end: 0;
  610. padding-inline-start: 40px;
  611. }
  612. }
  613. }
  614. </style>
  615. <style>
  616. .text img {
  617. max-width: 100%;
  618. height: auto;
  619. }
  620. </style>