index.vue 18 KB

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