infoStatistics.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584
  1. <!--信息统计-->
  2. <template>
  3. <div class="app-container approval_handle">
  4. <div class="approval_handle-page" v-if="pageType==1">
  5. <div class="info">
  6. <div class="info_t">
  7. <div class="info_t_l" >
  8. <div id="info_t_l"></div>
  9. <div class="select_border">
  10. <el-form :model="queryParams2" ref="queryForm" :inline="true">
  11. <el-form-item label="" prop="zgType" label-width="80px">
  12. <el-select v-model="queryParams2.category" placeholder="请选择">
  13. <el-option :label="item.dictLabel" :value="item.dictLabel" v-for="(item,index) in materialTypeList" :key="index"></el-option>
  14. </el-select>
  15. </el-form-item>
  16. </el-form>
  17. </div>
  18. </div>
  19. <div class="info_t_c">
  20. <div id="info_t_c"></div>
  21. <div class="select_border">
  22. <el-form :model="queryParams3" ref="queryForm" :inline="true">
  23. <el-select v-model="queryParams3.category" placeholder="请选择">
  24. <el-option :label="item.dictLabel" :value="item.dictLabel" v-for="(item,index) in materialTypeList" :key="index"></el-option>
  25. </el-select>
  26. </el-form>
  27. </div>
  28. </div>
  29. <div class="info_t_r">
  30. <div class="info_t_r_title">实验室库存排名</div>
  31. <div class="info_t_r_b">
  32. <li>
  33. <i>排名</i>
  34. <i>门牌号</i>
  35. <i>库存</i>
  36. </li>
  37. <li class="info_t_r_b_h" v-for="(item,index) in labStorageList">
  38. <i><b>{{index+1}}</b></i>
  39. <i>{{item.name}}</i>
  40. <i>{{item.inNum}}</i>
  41. </li>
  42. </div>
  43. <div class="select_border">
  44. <el-form :model="queryParams4" ref="queryForm" :inline="true">
  45. <el-select v-model="queryParams4.category" placeholder="请选择">
  46. <el-option :label="item.dictLabel" :value="item.dictLabel" v-for="(item,index) in materialTypeList" :key="index"></el-option>
  47. </el-select>
  48. </el-form>
  49. </div>
  50. </div>
  51. </div>
  52. <div class="info_b">
  53. <el-form :model="queryParams" ref="queryForm" style="margin-top:20px;" :inline="true">
  54. <el-form-item label="关键字" prop="name">
  55. <el-input
  56. v-model="queryParams.searchValue"
  57. placeholder="气瓶编号/气瓶厂家/实验地点"
  58. clearable
  59. maxLength="30"
  60. size="small"
  61. @keyup.enter.native="handleQuery"
  62. />
  63. </el-form-item>
  64. <el-form-item label="最后使用时间" prop="dateRange">
  65. <el-date-picker
  66. :clearable="false"
  67. v-model="dateRange"
  68. size="small"
  69. style="width: 240px"
  70. value-format="yyyy-MM-dd"
  71. type="daterange"
  72. range-separator="-"
  73. start-placeholder="开始日期"
  74. end-placeholder="结束日期"
  75. ></el-date-picker>
  76. </el-form-item>
  77. <el-form-item label="状态" prop="zgType" label-width="80px">
  78. <el-select v-model="queryParams.storageStatus" clearable size="small">
  79. <el-option label="空闲" value="1" />
  80. <el-option label="使用中" value="2" />
  81. <el-option label="已出库" value="3" />
  82. </el-select>
  83. </el-form-item>
  84. <el-form-item>
  85. <p class="inquire-button-one" @click="handleQuery">查询</p>
  86. <p class="reset-button-one" @click="resetQuery">重置</p>
  87. </el-form-item>
  88. </el-form>
  89. <el-table border v-loading="loading" :data="tableData">
  90. <el-table-column label="气瓶编号" align="left" prop="airNumber"/>
  91. <el-table-column label="气体名称" align="left" prop="airName"></el-table-column>
  92. <el-table-column label="气体级别/规格" align="left" prop="configName"></el-table-column>
  93. <el-table-column label="气瓶厂家" align="left" prop="companyName"></el-table-column>
  94. <el-table-column label="实验地点" align="left" prop="location"></el-table-column>
  95. <el-table-column label="使用人数" align="left" prop="numberPersons"></el-table-column>
  96. <el-table-column label="当前气压" align="left" prop="currentPressure">
  97. <template slot-scope="scope">
  98. <span>{{scope.row.currentPressure}}Mpa</span>
  99. </template>
  100. </el-table-column>
  101. <el-table-column label="最后使用时间" align="left" prop="lastTime"></el-table-column>
  102. <el-table-column label="状态" align="left" prop="storageStatus">
  103. <template slot-scope="scope">
  104. <p :class="scope.row.storageStatus == 1?'color_warn':(scope.row.storageStatus == 2?'color_FF4E00':(scope.row.storageStatus == 3?'color_14AE10':''))">{{scope.row.storageStatus == 1?'空闲':(scope.row.storageStatus == 2?'使用中':(scope.row.storageStatus == 3?'已出库':''))}}</p>
  105. </template>
  106. </el-table-column>
  107. <el-table-column label="操作" align="left" class-name="small-padding fixed-width" width="120">
  108. <template slot-scope="scope">
  109. <div class="button-box">
  110. <p class="table-min-button"
  111. @click="handleClick('',scope.row,'detail')"
  112. >查看</p>
  113. </div>
  114. </template>
  115. </el-table-column>
  116. </el-table>
  117. <pagination
  118. :total="total"
  119. layout="total, prev, pager, next, sizes, jumper"
  120. :page.sync="queryParams.pageNum"
  121. :limit.sync="queryParams.pageSize"
  122. @pagination="getList"
  123. />
  124. </div>
  125. </div>
  126. </div>
  127. <!--查看 -->
  128. <detail-page v-if="pageType==2" :pageData2="pageData2"></detail-page>
  129. </div>
  130. </template>
  131. <script>
  132. import {
  133. buildingStorageStatistics, gasCategoryList,
  134. gasStorageStatistics,
  135. labStorageStatistics,
  136. outStatistics, storageInfoList
  137. } from '@/api/gasManage3_0/gasManage'
  138. import { getToken } from "@/utils/auth";
  139. import echarts from 'echarts'
  140. import detailPage from "./infoStatisticsDetail.vue"
  141. export default {
  142. name: "info",
  143. components: {
  144. detailPage
  145. },
  146. data() {
  147. return {
  148. pageType:1,
  149. loading:false,
  150. dateRange:[],
  151. total:0,
  152. tableData:[],
  153. // 查询参数
  154. queryParams: {
  155. pageNum: 1,
  156. pageSize:20,
  157. searchValue: '',
  158. storageStatus: '',
  159. },
  160. queryParams2: {
  161. pageNum: 1,
  162. pageSize:20,
  163. category:'气瓶',
  164. },
  165. queryParams3: {
  166. pageNum: 1,
  167. pageSize:20,
  168. category:'气瓶',
  169. },
  170. queryParams4: {
  171. pageNum: 1,
  172. pageSize:20,
  173. category:'气瓶',
  174. },
  175. labStorageList:[],
  176. pageData2:{},
  177. materialTypeList:[],
  178. };
  179. },
  180. created() {
  181. },
  182. methods: {
  183. handleClick(index,row,doType){
  184. let _this=this;
  185. if(doType=='apply'){//申请
  186. }else if(doType=='detail'){//查看
  187. _this.pageData2.item=row;
  188. _this.pageType=2;
  189. }else if(doType=='back'){
  190. _this.pageType=1;
  191. }
  192. },
  193. //气瓶类目
  194. gasCategoryList(){
  195. let _this=this;
  196. gasCategoryList().then( response => {
  197. let res=response.rows;
  198. _this.materialTypeList=res;
  199. });
  200. },
  201. /** 搜索按钮操作 */
  202. handleQuery() {
  203. this.queryParams.pageNum = 1;
  204. this.getList();
  205. },
  206. /** 重置按钮操作 */
  207. resetQuery() {
  208. this.queryParams.searchValue = "";
  209. this.queryParams.storageStatus = "";
  210. this.dateRange=[];
  211. this.queryParams.startTime=null;
  212. this.queryParams.endTime=null
  213. this.handleQuery();
  214. },
  215. //气瓶库存统计
  216. gasFun:function(dataX,dataY){
  217. var option = {
  218. tooltip: {
  219. trigger: 'axis',
  220. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  221. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  222. }
  223. },
  224. title: {
  225. left:'2%',
  226. top:12,
  227. text: '气瓶库存统计',
  228. textStyle: {
  229. color: "#333333",
  230. fontSize:16,
  231. },
  232. },
  233. grid: {
  234. left: '2%',
  235. right: '2%',
  236. bottom: '14%',
  237. top:'24%',
  238. containLabel: true
  239. },
  240. xAxis: {
  241. type: 'category',
  242. data: dataX,
  243. axisLine: {
  244. lineStyle: {
  245. color: '#ccc'
  246. }
  247. },
  248. axisTick: {
  249. show: false,
  250. length: 9,
  251. alignWithLabel: true,
  252. lineStyle: {
  253. color: '#7DFFFD'
  254. }
  255. },
  256. axisLabel: {
  257. // interval: 0,
  258. // rotate: 40,
  259. textStyle: {
  260. fontFamily: 'Microsoft YaHei',
  261. color: '#666666',
  262. fontSize:16,
  263. }
  264. },
  265. },
  266. yAxis: {
  267. nameTextStyle:{
  268. color:'#ccc',
  269. align:'center',
  270. fontSize:18,
  271. },
  272. type: 'value',
  273. axisLine: {
  274. show: true,
  275. lineStyle: {
  276. color: '#ccc'
  277. }
  278. },
  279. splitLine: {
  280. show: false,
  281. lineStyle: {
  282. color: 'rgba(255,255,255,0.3)'
  283. }
  284. },
  285. axisTick: {
  286. show: false,
  287. length: 9,
  288. alignWithLabel: true,
  289. lineStyle: {
  290. color: '#7DFFFD'
  291. }
  292. },
  293. axisLabel: {
  294. // interval: 0,
  295. // rotate: 40,
  296. textStyle: {
  297. fontFamily: 'Microsoft YaHei',
  298. color: '#666666',
  299. fontSize:16,
  300. }
  301. },
  302. },
  303. series: [{
  304. name: '入库',
  305. type: 'bar',
  306. barWidth: '14',
  307. itemStyle: {
  308. normal: {
  309. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  310. offset: 0,
  311. color: '#88C8FF'
  312. }, {
  313. offset: 1,
  314. color: '#0183FA'
  315. }]),
  316. barBorderRadius:[12,12,0,0],
  317. },
  318. },
  319. showBackground:true,
  320. data: dataY
  321. }]
  322. };
  323. var info_t_l = echarts.init(document.getElementById('info_t_l'));
  324. info_t_l.setOption(option);
  325. },
  326. //楼栋库存占比
  327. buildingFun:function(dataX,dataY) {
  328. var option = {
  329. color: ['#6DC9CA', '#F4AF43', '#33C174','#5742BF','#0068B7'],//颜色
  330. title: {
  331. left:'2%',
  332. top:12,
  333. text: '楼栋库存占比',
  334. textStyle: {
  335. color: "#333333",
  336. fontSize:16,
  337. },
  338. },
  339. tooltip: {
  340. trigger: 'item',
  341. formatter: "{a} <br/>{b}: {c} ({d}%)"
  342. },
  343. legend: {
  344. orient: 'vertical',
  345. left: '4%',
  346. top: '20%',
  347. data:dataY,
  348. itemWidth: 10,
  349. itemHeight: 10,
  350. itemGap: 30,
  351. textStyle: {
  352. color: '#333333'
  353. }
  354. },
  355. series: [
  356. {
  357. name:'楼栋库存占比',
  358. type:'pie',
  359. center : ['65%', '55%'],
  360. radius: ['25%', '55%'],
  361. avoidLabelOverlap: false,
  362. roseType: 'area',
  363. label: {
  364. normal: {
  365. show: false,
  366. },
  367. },
  368. data:dataX
  369. }
  370. ]
  371. };
  372. var info_t_c = echarts.init(document.getElementById('info_t_c'));
  373. info_t_c.setOption(option);
  374. },
  375. //气瓶库存统计
  376. gasStorageStatistics(){
  377. let _this=this;
  378. gasStorageStatistics().then( response => {
  379. let res=response.data;
  380. let dataX=[];
  381. let dataY=[];
  382. if(response.code==200){
  383. res.forEach(function(item){
  384. dataX.push(item.date)
  385. dataY.push(item.inNum)
  386. })
  387. this.gasFun(dataX,dataY);
  388. }
  389. });
  390. },
  391. //气瓶库存统计
  392. buildingStorageStatistics(){
  393. let _this=this;
  394. buildingStorageStatistics().then( response => {
  395. let res=response.data;
  396. let dataX=[];
  397. let dataY=[];
  398. if(response.code==200){
  399. res.forEach(function(item){
  400. dataX.push({value:item.inNum, name:item.name},)
  401. dataY.push(item.name)
  402. })
  403. this.buildingFun(dataX,dataY);
  404. }
  405. });
  406. },
  407. ////实验室库存排名统计
  408. labStorageStatistics(){
  409. let _this=this;
  410. labStorageStatistics().then( response => {
  411. let res=response.data;
  412. if(response.code==200){
  413. _this.labStorageList=res
  414. }
  415. });
  416. },
  417. //信息统计查询气瓶入库列表
  418. getList(){
  419. let _this=this;
  420. if(this.dateRange&&this.dateRange.length>0) {
  421. this.queryParams.startTime=this.dateRange[0]
  422. this.queryParams.endTime=this.dateRange[1]
  423. } else {
  424. this.queryParams.startTime=null;
  425. this.queryParams.endTime=null
  426. }
  427. storageInfoList(_this.queryParams).then( response => {
  428. let res=response.rows;
  429. if(response.code==200){
  430. _this.tableData=res
  431. _this.total=response.total
  432. }
  433. });
  434. },
  435. },
  436. mounted(){
  437. this.gasCategoryList();
  438. this.getList();
  439. this.gasStorageStatistics();
  440. this.buildingStorageStatistics();
  441. this.labStorageStatistics();
  442. },
  443. };
  444. </script>
  445. <style lang="scss" scoped>
  446. .approval_handle {
  447. display: flex!important;
  448. flex-direction: column;
  449. .approval_handle-page{
  450. flex:1;
  451. display: flex!important;
  452. flex-direction: column;
  453. box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);
  454. padding:20px 20px 20px!important;
  455. border-radius:10px;
  456. .info{
  457. flex:1;
  458. display: flex!important;
  459. flex-direction: column;
  460. .info_t{
  461. display: flex;
  462. justify-content: flex-start;
  463. .info_t_l{
  464. width: 38%;
  465. height: 340px;
  466. margin-right: 7.4%;
  467. position: relative;
  468. #info_t_l{
  469. width: 100%;
  470. height: 340px;
  471. }
  472. .select_border{
  473. position: absolute;
  474. top: 12px;
  475. right: 20px;
  476. }
  477. }
  478. .info_t_c{
  479. width: 26%;
  480. height: 340px;
  481. margin-right: 8.2%;
  482. position: relative;
  483. #info_t_c{
  484. width: 100%;
  485. height: 340px;
  486. }
  487. .select_border{
  488. position: absolute;
  489. top: 12px;
  490. right: 20px;
  491. }
  492. }
  493. .info_t_r{
  494. width: 16.6%;
  495. height: 340px;
  496. position: relative;
  497. .info_t_r_title{
  498. font-size: 16px;
  499. font-family: Microsoft YaHei;
  500. font-weight: bold;
  501. color: #333333;
  502. line-height: 16px;
  503. margin-top: 16px;
  504. margin-bottom: 16px;
  505. }
  506. .info_t_r_b{
  507. height: 260px;
  508. overflow-y: auto;
  509. >li{
  510. list-style-type: none;
  511. height: 40px;
  512. border-bottom: 1px solid #E0E0E0;
  513. display: flex;
  514. justify-content: flex-start;
  515. padding-left: 10px;
  516. >i{
  517. font-style: normal;
  518. font-size: 16px;
  519. font-family: Microsoft YaHei;
  520. font-weight: 400;
  521. color: #333333;
  522. line-height: 40px;
  523. display: inline-block;
  524. }
  525. >i:nth-of-type(1){
  526. width: 84px;
  527. >b{
  528. color: #0183FA;
  529. padding: 4px 10px;
  530. box-sizing: border-box;
  531. background: #CCE6FE;
  532. border-radius: 50%;
  533. font-weight:500;
  534. }
  535. }
  536. >i:nth-of-type(2){
  537. width: 118px;
  538. }
  539. >i:nth-of-type(3){
  540. width: 52px;
  541. }
  542. }
  543. }
  544. .select_border{
  545. position: absolute;
  546. width: 120px;
  547. top: 12px;
  548. right: 0px;
  549. }
  550. }
  551. }
  552. .info_b{
  553. flex: 1;
  554. display: flex!important;
  555. flex-direction: column;
  556. }
  557. }
  558. .button-box{
  559. width:200px;
  560. display: flex;
  561. }
  562. }
  563. }
  564. </style>