index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592
  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="commoDity" style="width:68%;height:350px;margin-left: 40px"></div>
  101. <div id="cargoOwner" style="width:30%;height:350px;"></div>
  102. </div>
  103. </div>
  104. <el-dialog
  105. title="消息提示"
  106. :visible.sync="dialogVisible"
  107. width="80%"
  108. :before-close="handleClose"
  109. :close-on-click-modal="false"
  110. >
  111. <span v-html="text" class="text" style="max-width: 100%;height: auto;"></span>
  112. <span slot="footer" class="dialog-footer">
  113. <!-- <el-button @click="dialogVisible = false">取 消</el-button>-->
  114. <el-button type="primary" @click="dialogVisible = false">关 闭</el-button>
  115. </span>
  116. </el-dialog>
  117. <el-button type="primary" @click="addOrUpdateHandle">查看审批</el-button>
  118. <el-button type="primary" @click="addOrUpdateHand">审批弹窗</el-button>
  119. <!-- 弹窗, 新增 / 修改 -->
  120. <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
  121. <approval-comments v-if="addOrUpdateVisib" ref="ApprovalComments" @refreshDataList="returnData"></approval-comments>
  122. </div>
  123. </template>
  124. <script>
  125. import { listCorps, information, warehouse } from '../../src/api/index'
  126. import AddOrUpdate from '@/views/viewApproval'
  127. import ApprovalComments from '@/views/startApproval'
  128. export default {
  129. name: 'index',
  130. data() {
  131. return {
  132. editModel: {},
  133. // 版本号
  134. version: '3.2.1',
  135. select: '',
  136. text: '',
  137. dialogVisible: false,
  138. addOrUpdateVisible: false,
  139. addOrUpdateVisib: false,
  140. tableData: [{
  141. date: '2020-11-20 12:00',
  142. name: '某客户账单审核',
  143. address: '查看详情'
  144. }, {
  145. date: '2020-11-20 12:00',
  146. name: '某客户账单审核',
  147. address: '查看详情'
  148. }, {
  149. date: '2020-11-20 12:00',
  150. name: '仓储费审核结算审核',
  151. address: '查看详情'
  152. }],
  153. chart: [],
  154. warehouse: [],
  155. master: [],
  156. commodity: [],
  157. commoditytwo: [],
  158. name: [],
  159. tableDataTwo: []
  160. }
  161. },
  162. components: {
  163. AddOrUpdate,
  164. ApprovalComments
  165. },
  166. mounted() {
  167. },
  168. created() {
  169. this.getList()
  170. this.warehouses()
  171. this.firstinventory()
  172. },
  173. methods: {
  174. getDataList(){
  175. this.addOrUpdateVisible = false
  176. },
  177. returnData(){
  178. this.addOrUpdateVisib = false
  179. },
  180. addOrUpdateHandle(){
  181. this.addOrUpdateVisible = true
  182. let id = '448'
  183. let actId = '110'
  184. this.$nextTick(() => {
  185. this.$refs.addOrUpdate.init(id,actId)
  186. })
  187. },
  188. addOrUpdateHand(){
  189. this.addOrUpdateVisib = true
  190. let id = '448'
  191. let actId = '110'
  192. this.$nextTick(() => {
  193. this.$refs.ApprovalComments.init(id,actId)
  194. })
  195. },
  196. bug(res) {
  197. this.dialogVisible = true
  198. this.text = res
  199. },
  200. handleClose(done) {
  201. // console.log(done)
  202. this.dialogVisible = false
  203. },
  204. firstinventory() {
  205. information(0).then(response => {
  206. this.chart = response.data
  207. for (let index of this.chart.corpsListWhouse) {
  208. this.master.push({
  209. name: index.fName,
  210. value: index.fGrossweightD
  211. })
  212. this.name.push(index.fName)
  213. }
  214. for (let index of this.chart.goodslistWhouse) {
  215. this.commodity.push(index.fName)
  216. this.commoditytwo.push(index.fGrossweightD)
  217. }
  218. this.drawLine()
  219. this.drawLinetwo()
  220. this.commoDity()
  221. })
  222. },
  223. query() {
  224. this.master = []
  225. this.commodity = []
  226. this.commoditytwo = []
  227. this.name = []
  228. if (this.select === '') {
  229. return this.select
  230. } else {
  231. information(this.select).then(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.commoDity()
  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. drawLinetwo() {
  388. // 基于准备好的dom,初始化echarts实例,所以只能在mounted中调用
  389. let myChart = this.$echarts.init(document.getElementById('cargoOwner'))
  390. // 绘制图表
  391. myChart.setOption({
  392. title: {
  393. text: this.chart.whouseList[0].fName + '货权方统计',
  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. commoDity() {
  433. // 基于准备好的dom,初始化echarts实例,所以只能在mounted中调用
  434. let myChart = this.$echarts.init(document.getElementById('commoDity'))
  435. // 绘制图表
  436. myChart.setOption({
  437. title: {
  438. text:this.chart.whouseList[0].fName + '商品统计',
  439. subtext: '实时数据',
  440. left: 'center'
  441. },
  442. color: ['#3398DB'],
  443. tooltip: {
  444. trigger: 'axis',
  445. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  446. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  447. }
  448. },
  449. grid: {
  450. left: '3%',
  451. right: '4%',
  452. bottom: '3%',
  453. containLabel: true
  454. },
  455. xAxis: [
  456. {
  457. type: 'category',
  458. data: this.commodity,
  459. axisTick: {
  460. alignWithLabel: true
  461. }
  462. }
  463. ],
  464. yAxis: [
  465. {
  466. type: 'value'
  467. }
  468. ],
  469. series: [
  470. {
  471. name: '实时状态',
  472. type: 'bar',
  473. barWidth: '60%',
  474. data: this.commoditytwo
  475. }
  476. ]
  477. })
  478. }
  479. }
  480. }
  481. </script>
  482. <style scoped lang="scss">
  483. .block {
  484. width: 68%;
  485. float: left;
  486. display: flex;
  487. flex-wrap: wrap;
  488. justify-content: space-around;
  489. height: 350px;
  490. li:hover{
  491. background-color: #025184;
  492. }
  493. li:nth-child(6),li:nth-child(7),li:nth-child(8),li:nth-child(9),li:nth-child(10){
  494. background-color: #2f4554;
  495. }
  496. 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{
  497. background-color: #2f4454d1;
  498. }
  499. li {
  500. width: 18%;
  501. height: 150px;
  502. background-color: #1c84c6;
  503. margin-left: 10px;
  504. text-align: center;
  505. color: #FFFFFF;
  506. border-radius: 10px;
  507. cursor:pointer;
  508. div {
  509. margin-top: 40px;
  510. p {
  511. font-size: 20px;
  512. }
  513. }
  514. }
  515. }
  516. .home {
  517. blockquote {
  518. padding: 10px 20px;
  519. margin: 0 0 20px;
  520. font-size: 17.5px;
  521. border-left: 5px solid #eee;
  522. }
  523. hr {
  524. margin-top: 20px;
  525. margin-bottom: 20px;
  526. border: 0;
  527. border-top: 1px solid #eee;
  528. }
  529. .col-item {
  530. margin-bottom: 20px;
  531. }
  532. ul {
  533. padding: 0;
  534. margin: 0;
  535. }
  536. font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  537. font-size: 13px;
  538. color: #676a6c;
  539. overflow-x: hidden;
  540. ul {
  541. list-style-type: none;
  542. }
  543. h4 {
  544. margin-top: 0px;
  545. }
  546. h2 {
  547. margin-top: 10px;
  548. font-size: 26px;
  549. font-weight: 100;
  550. }
  551. p {
  552. margin-top: 10px;
  553. b {
  554. font-weight: 700;
  555. }
  556. }
  557. .update-log {
  558. ol {
  559. display: block;
  560. list-style-type: decimal;
  561. margin-block-start: 1em;
  562. margin-block-end: 1em;
  563. margin-inline-start: 0;
  564. margin-inline-end: 0;
  565. padding-inline-start: 40px;
  566. }
  567. }
  568. }
  569. </style>
  570. <style>
  571. .text img {
  572. max-width: 100%;
  573. height: auto;
  574. }
  575. </style>