index.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <!-- 库存信息 -->
  2. <template>
  3. <div class="app-container inventoryInformation">
  4. <div class="page-container inventoryInformationPage" v-if="pageType === 1">
  5. <div class="page-form-title-box">
  6. <el-form :model="queryParams" class="form-box" ref="queryForm"
  7. :inline="true" style="width:100%;">
  8. <el-form-item label="关键字" prop="searchValue" label-width="60px">
  9. <el-input
  10. maxLength="30"
  11. v-model="queryParams.searchValue"
  12. placeholder="编号/气体名称/实验地点"
  13. clearable
  14. style="width: 200px"
  15. />
  16. </el-form-item>
  17. <el-form-item label="学院" prop="collegeId">
  18. <el-select v-model="queryParams.collegeId"
  19. clearable placeholder="请选择学院" style="width: 200px">
  20. <el-option
  21. v-for="dict in optionList"
  22. :key="dict.deptId"
  23. :label="dict.deptName"
  24. :value="dict.deptId"
  25. />
  26. </el-select>
  27. </el-form-item>
  28. <el-form-item label="入库时间" prop="state">
  29. <el-date-picker
  30. :clearable="false"
  31. v-model="dateRange"
  32. size="small"
  33. style="width: 240px"
  34. value-format="yyyy-MM-dd"
  35. type="daterange"
  36. range-separator="-"
  37. start-placeholder="开始日期"
  38. end-placeholder="结束日期"
  39. ></el-date-picker>
  40. </el-form-item>
  41. <p class="page-inquire-common-style-button" @click="handleQuery">查询</p>
  42. <p class="page-reset-common-style-button" @click="resetQuery">重置</p>
  43. </el-form>
  44. </div>
  45. <div class="page-content-box">
  46. <el-table class="table-box" v-loading="loading" border :data="dataList">
  47. <!--<el-table-column label="气瓶编号" prop="gasName" show-overflow-tooltip/>-->
  48. <el-table-column label="气体名称" prop="gasName" show-overflow-tooltip/>
  49. <el-table-column label="气体级别/规格" prop="content" width="150" show-overflow-tooltip>
  50. <template slot-scope="scope">
  51. {{forData(1,scope.row.level)}}/ {{forData(2,scope.row.size)}}
  52. </template>
  53. </el-table-column>
  54. <el-table-column label="气体余量" prop="gasPressure" width="150" show-overflow-tooltip/>
  55. <el-table-column label="学院" prop="collegeName" width="249" show-overflow-tooltip/>
  56. <el-table-column label="实验地点" prop="subjectName" width="346" show-overflow-tooltip>
  57. <template slot-scope="scope">
  58. {{scope.row.subjectName}}{{scope.row.roomNum?'('+scope.row.roomNum+')':''}}
  59. </template>
  60. </el-table-column>
  61. <el-table-column label="有效期" prop="validPeriod" width="249" show-overflow-tooltip>
  62. <template slot-scope="scope">
  63. <span>{{ parseTime(scope.row.validPeriod,'{y}-{m}-{d}') }}</span>
  64. </template>
  65. </el-table-column>
  66. </el-table>
  67. <pagination :page-sizes="[20, 30, 40, 50]"
  68. v-show="total>0"
  69. :total="total"
  70. :page.sync="queryParams.pageNum"
  71. :limit.sync="queryParams.pageSize"
  72. @pagination="getList"
  73. />
  74. </div>
  75. </div>
  76. </div>
  77. </template>
  78. <script>
  79. import { airbottleStockList } from "@/api/gasBottleManage/index";
  80. import { listDepartments } from "@/api/system/dept";
  81. //import { getDicts } from "@/api/commonality/noPermission";
  82. //import { systemUserSelect } from "@/api/commonality/permission";
  83. //import { getInfo } from "@/api/basicsModules/index";
  84. //import addPage from "./addPage.vue";
  85. export default {
  86. name: 'index',
  87. data () {
  88. return {
  89. tableButtonType:this.hasPermiDom(['demo:demo:detail','demo:demo:edit','demo:demo:del',]),
  90. //页面状态
  91. pageType:1,
  92. //页面遮罩
  93. loading:false,
  94. //下拉列表数据
  95. optionList:[],
  96. //气瓶级别
  97. gasBottleLevel:[],
  98. gasBottleSpecification:[],
  99. //查询条件
  100. queryParams:{
  101. pageNum:1,
  102. pageSize:20,
  103. searchValue:"",
  104. collegeId :null,
  105. },
  106. //时间数据
  107. dateRange:[],
  108. //列表数据
  109. dataList:[],
  110. //数据数量
  111. total:0,
  112. //弹窗开关
  113. dialogType:false,
  114. dialogTitle:"",
  115. dialogForm:null,
  116. }
  117. },
  118. created () {
  119. },
  120. mounted () {
  121. this.listDepartments();
  122. this.getList();
  123. this.getDicts("gasBottleLevel").then((response) => {
  124. this.$set(this,'gasBottleLevel',response.data);
  125. });
  126. this.getDicts("gasBottleSpecification").then((response) => {
  127. this.$set(this,'gasBottleSpecification',response.data);
  128. });
  129. },
  130. methods: {
  131. listDepartments(){
  132. listDepartments().then(response => {
  133. this.$set(this,'optionList',response.data);
  134. });
  135. },
  136. //查询按钮
  137. handleQuery(){
  138. this.$set(this.queryParams,'pageNum',1);
  139. this.getList();
  140. },
  141. //重置按钮
  142. resetQuery(){
  143. this.$set(this,'dateRange',[])
  144. this.$set(this,'queryParams',{
  145. pageNum:1,
  146. pageSize:20,
  147. searchValue:"",
  148. collegeId :null,
  149. });
  150. this.getList();
  151. },
  152. //获取数据列表
  153. getList(){
  154. this.$set(this,'loading',true);
  155. let obj = JSON.parse(JSON.stringify(this.queryParams))
  156. if(this.dateRange[0]){
  157. obj.startTime = this.dateRange[0]+'T00:00:00'
  158. obj.endTime = this.dateRange[1]+'T23:59:59'
  159. }else{
  160. obj.startTime = "";
  161. obj.endTime = "";
  162. }
  163. airbottleStockList(obj).then(response => {
  164. this.$set(this,'loading',false);
  165. this.$set(this,'dataList',response.data.records);
  166. this.$set(this,'total',response.data.total);
  167. });
  168. },
  169. forData(type,id){
  170. let self = this;
  171. let num = 0;
  172. if(type == 1){
  173. for(let i=0;i<self.gasBottleLevel.length;i++){
  174. if(id == self.gasBottleLevel[i].dictValue){
  175. num++
  176. return self.gasBottleLevel[i].dictLabel
  177. }
  178. }
  179. }else if (type){
  180. for(let i=0;i<self.gasBottleSpecification.length;i++){
  181. if(id == self.gasBottleSpecification[i].dictValue){
  182. num++
  183. return self.gasBottleSpecification[i].dictLabel
  184. }
  185. }
  186. }
  187. if(num == 0){
  188. return '其他'
  189. }
  190. },
  191. },
  192. }
  193. </script>
  194. <style scoped lang="scss">
  195. .inventoryInformation{
  196. display: flex;
  197. flex-direction: column;
  198. .inventoryInformationPage{
  199. }
  200. }
  201. </style>
  202. <style lang="scss">
  203. .inventoryInformation-dialog-box{
  204. .el-dialog__body{
  205. padding:10px 20px;
  206. .text-p{
  207. line-height:30px;
  208. font-size:16px;
  209. text-align: center;
  210. }
  211. }
  212. .dialog-footer{
  213. display: flex;
  214. .dialog-footer-null-p{
  215. flex:1;
  216. }
  217. }
  218. }
  219. </style>