gasManage.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  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="['bottle:bottleStorage: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="electronicTag"/>
  47. <el-table-column label="气瓶编号" align="left" prop="airNumber"></el-table-column>
  48. <el-table-column label="气体名称" align="left" prop="airName"></el-table-column>
  49. <el-table-column label="气瓶规格" align="left" prop="configName"></el-table-column>
  50. <el-table-column label="使用人数" align="left" prop="numberPersons"></el-table-column>
  51. <el-table-column label="当前气压" align="left" prop="currentPressure">
  52. <template slot-scope="scope">
  53. <span >{{scope.row.currentPressure}}Mpa</span>
  54. </template>
  55. </el-table-column>
  56. <el-table-column label="最后使用时间" align="left" prop="lastTime"></el-table-column>
  57. <el-table-column label="状态" align="left" prop="storageStatus">
  58. <template slot-scope="scope">
  59. <p :class="scope.row.storageStatus == 1?'color_warn':(scope.row.storageStatus == 2?'color_14AE10':(scope.row.storageStatus == 3?'color_red':''))">{{scope.row.storageStatus == 1?'闲置':(scope.row.storageStatus == 2?'使用':(scope.row.storageStatus == 3?'出库':''))}}</p>
  60. </template>
  61. </el-table-column>
  62. <el-table-column label="操作" align="left" class-name="small-padding fixed-width" width="160">
  63. <template slot-scope="scope">
  64. <div class="table-button-box">
  65. <p class="table-button-null"></p>
  66. <p class="table-button-p"
  67. v-hasPermi="['bottle:bottleStorage:query']"
  68. @click="handleClick('',scope.row,'detail')"
  69. >查看</p>
  70. <p class="table-button-p"
  71. v-hasPermi="['bottle:bottleStorageOut:add']"
  72. @click="handleClick('',scope.row,'out')"
  73. >出库</p>
  74. <p class="table-button-null"></p>
  75. </div>
  76. </template>
  77. </el-table-column>
  78. </el-table>
  79. <pagination :page-sizes="[20, 30, 40, 50]"
  80. :total="total"
  81. layout="total, prev, pager, next, sizes, jumper"
  82. :page.sync="queryParams.pageNum"
  83. :limit.sync="queryParams.pageSize"
  84. @pagination="getList"
  85. />
  86. </div>
  87. <!--新增页面-->
  88. <add-page v-if="pageType==2" :pageData="pageData"></add-page>
  89. <!--详情页面-->
  90. <detail-page v-if="pageType==3" :pageData2="pageData2"></detail-page>
  91. <!-- 弹窗-->
  92. <el-dialog :title=dialogTitle :visible.sync="dialogVisible" width="500px" append-to-body>
  93. <el-form ref="form" :model="form" label-width="80px">
  94. <div style="margin-bottom: 20px">{{dialogContent}}</div>
  95. <el-input oninput="value=value.replace(/[^1-9]{0,1}(\d*(?:\.\d{0,1})?).*$/g, '$1')" v-model="form.pressure" placeholder="请输入气表实际压力,精确到小数点后一位" />
  96. </el-form>
  97. <div slot="footer" class="dialog-footer">
  98. <el-button @click="cancel">取消</el-button>
  99. <el-button type="primary" @click="submitForm">出库</el-button>
  100. </div>
  101. </el-dialog>
  102. </div>
  103. </template>
  104. <script>
  105. import { getToken } from "@/utils/auth";
  106. import addPage from "./gasManageAdd.vue"
  107. import detailPage from "./gasManageDetail.vue"
  108. import { gasManageList, gasManageOut, returnRecord, useRecord } from '@/api/gasManage3_0/gasManageSYD'
  109. export default {
  110. name: "Approval",
  111. components: {
  112. addPage,
  113. detailPage
  114. },
  115. data() {
  116. return {
  117. //页面状态
  118. pageType:1,
  119. loading:false,
  120. headers: {
  121. Authorization: "Bearer " + getToken()
  122. },
  123. dialogTitle:'气瓶出库提示',
  124. dialogContent:'请输入当前气压值',
  125. dialogVisible:false,
  126. // 查询参数
  127. queryParams: {
  128. pageNum: 1,
  129. pageSize:20,
  130. remark:'login',
  131. searchValue:'',
  132. startTime:'',
  133. endTime:'',
  134. },
  135. form:{
  136. pressure:'',
  137. },
  138. total:0,
  139. tableData:[{}],
  140. dateRange:[],
  141. pageData:{},
  142. pageData2:{},
  143. };
  144. },
  145. methods: {
  146. handleClick(index,row,doType){
  147. let _this=this;
  148. if(doType=='add'){//新增
  149. _this.pageType=2;
  150. }else if(doType=='detail'){//查看
  151. _this.pageData2.id=row.id;
  152. _this.pageType=3;
  153. }else if(doType=='out'){//出库
  154. _this.dialogVisible=true;
  155. _this.form.storageId=row.id
  156. // this.$confirm('是否确认出库?', '提示', {
  157. // confirmButtonText: '确定',
  158. // cancelButtonText: '取消',
  159. // type: 'warning'
  160. // }).then(() => {
  161. //
  162. // }).catch(() => {});
  163. }else if(doType=='back'){//返回
  164. _this.pageType=1;
  165. _this.getList()
  166. }
  167. },
  168. /** 搜索按钮操作 */
  169. handleQuery() {
  170. this.queryParams.pageNum = 1;
  171. this.getList();
  172. },
  173. /** 重置按钮操作 */
  174. resetQuery() {
  175. this.queryParams.searchValue = "";
  176. this.dateRange=[];
  177. this.queryParams.startTime=null;
  178. this.queryParams.endTime=null
  179. this.handleQuery();
  180. },
  181. // 取消按钮
  182. cancel() {
  183. this.form = {};
  184. this.dialogVisible = false;
  185. },
  186. //出库
  187. submitForm(){
  188. let _this=this;
  189. this.$refs["form"].validate(valid => {
  190. if (valid) {
  191. gasManageOut(this.form).then( response => {
  192. let res=response.data;
  193. if(response.code==200){
  194. _this.dialogVisible=false;
  195. _this.getList()
  196. }
  197. });
  198. }
  199. });
  200. },
  201. getList(){
  202. let _this=this;
  203. if(this.dateRange&&this.dateRange.length>0) {
  204. this.queryParams.startTime=this.dateRange[0]
  205. this.queryParams.endTime=this.dateRange[1]
  206. } else {
  207. this.queryParams.startTime=null;
  208. this.queryParams.endTime=null
  209. }
  210. gasManageList(_this.queryParams).then( response => {
  211. let res=response.rows;
  212. _this.tableData=res;
  213. _this.total=response.total;
  214. });
  215. },
  216. },
  217. mounted() {
  218. this.getList()
  219. }
  220. };
  221. </script>
  222. <style scoped lang="scss">
  223. .approval_handle {
  224. display: flex!important;
  225. flex-direction: column;
  226. .approval_handle-page{
  227. flex:1;
  228. display: flex!important;
  229. flex-direction: column;
  230. box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);
  231. padding:20px 20px 20px!important;
  232. border-radius:10px;
  233. .button-box{
  234. width:200px;
  235. display: flex;
  236. }
  237. }
  238. }
  239. </style>