index.vue 17 KB

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