gasApply.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <!--气瓶申请-->
  2. <template>
  3. <div class="app-container approval_handle">
  4. <div class="approval_handle-page" v-if="pageType == 1">
  5. <el-form :model="queryParams" ref="queryForm" style="margin-top:20px;" :inline="true">
  6. <el-form-item label="关键字" prop="name">
  7. <el-input
  8. v-model="queryParams.searchValue"
  9. placeholder="请输入实验地点"
  10. clearable
  11. maxLength="30"
  12. size="small"
  13. />
  14. </el-form-item>
  15. <el-form-item label="申请时间" prop="dateRange">
  16. <el-date-picker
  17. :clearable="false"
  18. v-model="dateRange"
  19. size="small"
  20. style="width: 240px"
  21. value-format="yyyy-MM-dd"
  22. type="daterange"
  23. range-separator="-"
  24. start-placeholder="开始日期"
  25. end-placeholder="结束日期"
  26. ></el-date-picker>
  27. </el-form-item>
  28. <el-form-item>
  29. <p class="inquire-button-one" @click="handleQuery">查询</p>
  30. <p class="reset-button-one" @click="resetQuery">重置</p>
  31. </el-form-item>
  32. </el-form>
  33. <el-table border v-loading="loading" :data="tableData">
  34. <el-table-column label="实验地点" align="left" prop="location"/>
  35. <el-table-column label="申请时间" align="left" prop="createTime"></el-table-column>
  36. <el-table-column label="状态" align="left" width="340">
  37. <template slot-scope="scope">
  38. <span>未派送 - {{scope.row.wpsNum}} / 待入库 - {{scope.row.drkNum}} / 已入库 - {{scope.row.storageNum}} / 已拒收 - {{scope.row.refuseNum}}</span>
  39. </template>
  40. </el-table-column>
  41. <el-table-column label="操作" align="left" class-name="small-padding fixed-width" width="120">
  42. <template slot-scope="scope">
  43. <div class="table-button-box">
  44. <p class="table-button-null"></p>
  45. <p class="table-button-p"
  46. v-hasPermi="['airbottle:taskManage:query']"
  47. @click="handleClick('',scope.row,'detail')"
  48. >查看</p>
  49. <p class="table-button-null"></p>
  50. </div>
  51. </template>
  52. </el-table-column>
  53. </el-table>
  54. <pagination :page-sizes="[20, 30, 40, 50]"
  55. :total="total"
  56. layout="total, prev, pager, next, sizes, jumper"
  57. :page.sync="queryParams.pageNum"
  58. :limit.sync="queryParams.pageSize"
  59. @pagination="getList"
  60. />
  61. </div>
  62. <!--详情页面-->
  63. <detail-page v-if="pageType==3" :pageData2="pageData2"></detail-page>
  64. </div>
  65. </template>
  66. <script>
  67. import { gasApplyList, } from '@/api/gasManage3_0/gasManage'
  68. import { getToken } from "@/utils/auth";
  69. import detailPage from "./gasApplyDetail.vue"
  70. export default {
  71. name: "Approval",
  72. components: {
  73. detailPage
  74. },
  75. data() {
  76. return {
  77. //页面状态
  78. pageType:1,
  79. loading:false,
  80. headers: {
  81. Authorization: "Bearer " + getToken()
  82. },
  83. // 查询参数
  84. queryParams: {
  85. pageNum: 1,
  86. pageSize:20,
  87. remark:'login',
  88. searchValue:'',
  89. startTime:'',
  90. endTime:'',
  91. },
  92. total:0,
  93. tableData:[],
  94. dateRange:[],
  95. pageData2:{},
  96. };
  97. },
  98. methods: {
  99. handleClick(index,row,doType){
  100. let _this=this;
  101. if(doType=='apply'){//申请
  102. _this.pageType=2;
  103. }else if(doType=='detail'){//查看
  104. _this.pageData2.id=row.id;
  105. _this.pageType=3;
  106. }else if(doType=='back'){//返回
  107. _this.pageType=1;
  108. }else if(doType=='again'){//重新申请
  109. _this.pageType=2;
  110. }
  111. },
  112. /** 搜索按钮操作 */
  113. handleQuery() {
  114. this.queryParams.pageNum = 1;
  115. this.getList();
  116. },
  117. /** 重置按钮操作 */
  118. resetQuery() {
  119. this.queryParams.searchValue = "";
  120. this.dateRange=[];
  121. this.queryParams.startTime=null;
  122. this.queryParams.endTime=null
  123. this.handleQuery();
  124. },
  125. getList(){
  126. let _this=this;
  127. if(this.dateRange&&this.dateRange.length>0) {
  128. this.queryParams.startTime=this.dateRange[0]
  129. this.queryParams.endTime=this.dateRange[1]
  130. } else {
  131. this.queryParams.startTime=null;
  132. this.queryParams.endTime=null
  133. }
  134. gasApplyList(_this.queryParams).then( response => {
  135. let res=response.rows;
  136. _this.tableData=res;
  137. _this.total=response.total;
  138. });
  139. },
  140. },
  141. mounted() {
  142. this.getList()
  143. }
  144. };
  145. </script>
  146. <style scoped lang="scss">
  147. .approval_handle {
  148. display: flex!important;
  149. flex-direction: column;
  150. .approval_handle-page{
  151. flex:1;
  152. display: flex!important;
  153. flex-direction: column;
  154. box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);
  155. padding:20px 20px 20px!important;
  156. border-radius:10px;
  157. .button-box{
  158. width:200px;
  159. display: flex;
  160. }
  161. }
  162. }
  163. </style>