index.vue 19 KB

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