gasManage.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  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. :close-on-click-modal="false">
  94. <el-form ref="form" :model="form" label-width="80px">
  95. <div style="margin-bottom: 20px">{{dialogContent}}</div>
  96. <el-input oninput="value=value.replace(/[^1-9]{0,1}(\d*(?:\.\d{0,1})?).*$/g, '$1')" v-model="form.pressure" placeholder="请输入气表实际压力,精确到小数点后一位" />
  97. </el-form>
  98. <div slot="footer" class="dialog-footer">
  99. <el-button @click="cancel">取消</el-button>
  100. <el-button type="primary" @click="submitForm">出库</el-button>
  101. </div>
  102. </el-dialog>
  103. </div>
  104. </template>
  105. <script>
  106. import { getToken } from "@/utils/auth";
  107. import addPage from "./gasManageAdd.vue"
  108. import detailPage from "./gasManageDetail.vue"
  109. import { gasManageList, gasManageOut, returnRecord, useRecord } from '@/api/gasManage3_0/gasManageSYD'
  110. export default {
  111. name: "Approval",
  112. components: {
  113. addPage,
  114. detailPage
  115. },
  116. data() {
  117. return {
  118. //页面状态
  119. pageType:1,
  120. loading:false,
  121. headers: {
  122. Authorization: "Bearer " + getToken()
  123. },
  124. dialogTitle:'气瓶出库提示',
  125. dialogContent:'请输入当前气压值',
  126. dialogVisible:false,
  127. // 查询参数
  128. queryParams: {
  129. pageNum: 1,
  130. pageSize:20,
  131. remark:'login',
  132. searchValue:'',
  133. startTime:'',
  134. endTime:'',
  135. },
  136. form:{
  137. pressure:'',
  138. },
  139. total:0,
  140. tableData:[{}],
  141. dateRange:[],
  142. pageData:{},
  143. pageData2:{},
  144. };
  145. },
  146. methods: {
  147. handleClick(index,row,doType){
  148. let _this=this;
  149. if(doType=='add'){//新增
  150. _this.pageType=2;
  151. }else if(doType=='detail'){//查看
  152. _this.pageData2.id=row.id;
  153. _this.pageType=3;
  154. }else if(doType=='out'){//出库
  155. _this.dialogVisible=true;
  156. _this.form.storageId=row.id
  157. // this.$confirm('是否确认出库?', '提示', {
  158. // confirmButtonText: '确定',
  159. // cancelButtonText: '取消',
  160. // type: 'warning'
  161. // }).then(() => {
  162. //
  163. // }).catch(() => {});
  164. }else if(doType=='back'){//返回
  165. _this.pageType=1;
  166. _this.getList()
  167. }
  168. },
  169. /** 搜索按钮操作 */
  170. handleQuery() {
  171. this.queryParams.pageNum = 1;
  172. this.getList();
  173. },
  174. /** 重置按钮操作 */
  175. resetQuery() {
  176. this.queryParams.searchValue = "";
  177. this.dateRange=[];
  178. this.queryParams.startTime=null;
  179. this.queryParams.endTime=null
  180. this.handleQuery();
  181. },
  182. // 取消按钮
  183. cancel() {
  184. this.form = {};
  185. this.dialogVisible = false;
  186. },
  187. //出库
  188. submitForm(){
  189. let _this=this;
  190. this.$refs["form"].validate(valid => {
  191. if (valid) {
  192. gasManageOut(this.form).then( response => {
  193. let res=response.data;
  194. if(response.code==200){
  195. _this.dialogVisible=false;
  196. _this.getList()
  197. }
  198. });
  199. }
  200. });
  201. },
  202. getList(){
  203. let _this=this;
  204. if(this.dateRange&&this.dateRange.length>0) {
  205. this.queryParams.startTime=this.dateRange[0]
  206. this.queryParams.endTime=this.dateRange[1]
  207. } else {
  208. this.queryParams.startTime=null;
  209. this.queryParams.endTime=null
  210. }
  211. gasManageList(_this.queryParams).then( response => {
  212. let res=response.rows;
  213. _this.tableData=res;
  214. _this.total=response.total;
  215. });
  216. },
  217. },
  218. mounted() {
  219. this.getList()
  220. }
  221. };
  222. </script>
  223. <style scoped lang="scss">
  224. .approval_handle {
  225. display: flex!important;
  226. flex-direction: column;
  227. .approval_handle-page{
  228. flex:1;
  229. display: flex!important;
  230. flex-direction: column;
  231. box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);
  232. padding:20px 20px 20px!important;
  233. border-radius:10px;
  234. .button-box{
  235. width:200px;
  236. display: flex;
  237. }
  238. }
  239. }
  240. </style>