gasManage.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  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-item style="float: right;">
  33. <el-col :span="1.5">
  34. <el-button
  35. type="primary"
  36. plain
  37. icon="el-icon-plus"
  38. size="mini"
  39. @click="handleClick('','','add')"
  40. v-hasPermi="['airbottle:flowDetail:add']"
  41. >气瓶入库</el-button>
  42. </el-col>
  43. </el-form-item>
  44. </el-form>
  45. <el-table border v-loading="loading" :data="tableData">
  46. <el-table-column label="标签码" align="left" prop="location"/>
  47. <el-table-column label="气瓶编号" align="left" prop="createTime"></el-table-column>
  48. <el-table-column label="气体名称" align="left" prop="createTime"></el-table-column>
  49. <el-table-column label="气瓶规格" align="left" prop="createTime"></el-table-column>
  50. <el-table-column label="使用人数" align="left" prop="createTime"></el-table-column>
  51. <el-table-column label="当前气压" align="left" prop="createTime"></el-table-column>
  52. <el-table-column label="最后使用时间" align="left" prop="createTime"></el-table-column>
  53. <el-table-column label="状态" align="left" prop="createTime"></el-table-column>
  54. <el-table-column label="操作" align="left" class-name="small-padding fixed-width" width="160">
  55. <template slot-scope="scope">
  56. <div class="button-box">
  57. <p class="table-min-button"
  58. v-hasPermi="['airbottle:taskManage:query']"
  59. @click="handleClick('',scope.row,'detail')"
  60. >查看</p>
  61. <p class="table-min-button"
  62. v-hasPermi="['airbottle:taskManage:query']"
  63. @click="handleClick('',scope.row,'out')"
  64. >出库</p>
  65. </div>
  66. </template>
  67. </el-table-column>
  68. </el-table>
  69. <pagination :page-sizes="[20, 30, 40, 50]"
  70. :total="total"
  71. layout="total, prev, pager, next, sizes, jumper"
  72. :page.sync="queryParams.pageNum"
  73. :limit.sync="queryParams.pageSize"
  74. @pagination="getList"
  75. />
  76. </div>
  77. <!--新增页面-->
  78. <add-page v-if="pageType==2" :pageData="pageData"></add-page>
  79. <!--详情页面-->
  80. <detail-page v-if="pageType==3" :pageData2="pageData2"></detail-page>
  81. </div>
  82. </template>
  83. <script>
  84. import { gasApplyList, } from '@/api/gasManage3_0/gasManage'
  85. import { getToken } from "@/utils/auth";
  86. import addPage from "./gasManageAdd.vue"
  87. import detailPage from "./gasManageDetail.vue"
  88. export default {
  89. name: "Approval",
  90. components: {
  91. addPage,
  92. detailPage
  93. },
  94. data() {
  95. return {
  96. //页面状态
  97. pageType:1,
  98. loading:false,
  99. headers: {
  100. Authorization: "Bearer " + getToken()
  101. },
  102. // 查询参数
  103. queryParams: {
  104. pageNum: 1,
  105. pageSize:20,
  106. remark:'login',
  107. searchValue:'',
  108. startTime:'',
  109. endTime:'',
  110. },
  111. total:0,
  112. tableData:[{}],
  113. dateRange:[],
  114. pageData:{},
  115. pageData2:{},
  116. };
  117. },
  118. methods: {
  119. handleClick(index,row,doType){
  120. let _this=this;
  121. if(doType=='add'){//新增
  122. _this.pageType=2;
  123. }else if(doType=='detail'){//查看
  124. _this.pageData2.id=row.id;
  125. _this.pageType=3;
  126. }else if(doType=='out'){//出库
  127. this.$confirm('是否确认出库?', '提示', {
  128. confirmButtonText: '确定',
  129. cancelButtonText: '取消',
  130. type: 'warning'
  131. }).then(() => {
  132. }).catch(() => {});
  133. }else if(doType=='back'){//返回
  134. _this.pageType=1;
  135. }
  136. },
  137. /** 搜索按钮操作 */
  138. handleQuery() {
  139. this.queryParams.pageNum = 1;
  140. this.getList();
  141. },
  142. /** 重置按钮操作 */
  143. resetQuery() {
  144. this.queryParams.searchValue = "";
  145. this.dateRange=[];
  146. this.queryParams.startTime=null;
  147. this.queryParams.endTime=null
  148. this.handleQuery();
  149. },
  150. getList(){
  151. let _this=this;
  152. if(this.dateRange&&this.dateRange.length>0) {
  153. this.queryParams.startTime=this.dateRange[0]
  154. this.queryParams.endTime=this.dateRange[1]
  155. } else {
  156. this.queryParams.startTime=null;
  157. this.queryParams.endTime=null
  158. }
  159. gasApplyList(_this.queryParams).then( response => {
  160. let res=response.rows;
  161. _this.tableData=res;
  162. _this.total=response.total;
  163. });
  164. },
  165. },
  166. mounted() {
  167. // this.getList()
  168. }
  169. };
  170. </script>
  171. <style scoped lang="scss">
  172. .approval_handle {
  173. display: flex!important;
  174. flex-direction: column;
  175. .approval_handle-page{
  176. flex:1;
  177. display: flex!important;
  178. flex-direction: column;
  179. box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);
  180. padding:20px 20px 20px!important;
  181. border-radius:10px;
  182. .button-box{
  183. width:200px;
  184. display: flex;
  185. }
  186. }
  187. }
  188. </style>