index.vue 7.7 KB

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