index.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <!--申请-->
  2. <template>
  3. <div class="app-container application">
  4. <div class="application-page" v-if="pageType == 1">
  5. <div class="application-min">
  6. <el-form :model="queryParamsData" ref="queryForm" :inline="true">
  7. <el-form-item label="关键字" prop="searchValue" label-width="68px">
  8. <el-input
  9. maxlength="20"
  10. v-model="queryParamsData.searchValue"
  11. placeholder="姓名/实验室"
  12. clearable
  13. size="small"/>
  14. </el-form-item>
  15. <el-form-item label="状态" prop="status" label-width="50px">
  16. <el-select v-model="queryParamsData.status" clearable placeholder="请选择状态">
  17. <el-option
  18. v-for="item in optionsListTwo"
  19. :key="item.id"
  20. :label="item.name"
  21. :value="item.id">
  22. </el-option>
  23. </el-select>
  24. </el-form-item>
  25. <el-form-item label="申请时间" prop="subjectId" label-width="80px">
  26. <el-date-picker
  27. :clearable="false"
  28. v-model="dateRange"
  29. style="width: 240px;height:40px;"
  30. value-format="yyyy-MM-dd"
  31. type="daterange"
  32. range-separator="-"
  33. start-placeholder="开始日期"
  34. end-placeholder="结束日期"
  35. ></el-date-picker>
  36. </el-form-item>
  37. <el-form-item style="float: right;">
  38. <el-col :span="1.5">
  39. <p class="inquire-button-one"
  40. style="width:100px;margin-right:0;"
  41. @click="goPageButton(2)"
  42. >授权申请</p>
  43. </el-col>
  44. </el-form-item>
  45. <el-form-item style="margin-left:20px;">
  46. <p class="inquire-button-one" @click="handleQuery" style="margin-right:10px;">查询</p>
  47. <p class="reset-button-one" @click="resetQuery">重置</p>
  48. </el-form-item>
  49. </el-form>
  50. <el-table v-loading="loading" border :data="tableList" style="margin:20px 0;">
  51. <el-table-column label="申请时间" align="center" prop="creatTime" show-overflow-tooltip/>
  52. <el-table-column label="申请实验室" align="center" prop="subjectName" show-overflow-tooltip/>
  53. <el-table-column label="位置" align="center" prop="position" show-overflow-tooltip v-if="$store.state.settings.smartAlarmType == 1"/>
  54. <el-table-column label="所属学院" align="center" prop="college" show-overflow-tooltip/>
  55. <el-table-column label="授权人" align="center" prop="safeUserName" width="160px" show-overflow-tooltip/>
  56. <el-table-column label="失效时间" align="center" prop="loseTime" width="160px" show-overflow-tooltip>
  57. <template slot-scope="scope">
  58. <span>{{scope.row.loseTime!=1?scope.row.loseTime:''}}</span>
  59. </template>
  60. </el-table-column>
  61. <el-table-column label="状态" align="center" prop="applyStatus" width="180px" show-overflow-tooltip>
  62. <template slot-scope="scope">
  63. <span>{{scope.row.applyStatus==1?'已授权':(scope.row.applyStatus==2?'已失效':'')}}</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. </div>
  74. </div>
  75. <addPage v-if="pageType == 2"></addPage>
  76. </div>
  77. </template>
  78. <script>
  79. import { applyList } from "@/api/studentApi/accessAuthorization/index";
  80. import addPage from "./addPage.vue";
  81. export default {
  82. name: "application",
  83. components: {
  84. addPage
  85. },
  86. data(){
  87. return{
  88. pageType:1,
  89. // table操作按钮校验
  90. tableButtonType:this.hasPermiDom(['system:user_student:query','system:user_student:query']),
  91. loading:false,
  92. // 搜索数据
  93. queryParamsData:{
  94. pageNum:1,
  95. pageSize:20,
  96. },
  97. // 搜索实际发送数据
  98. queryParams:{
  99. pageNum:1,
  100. pageSize:20,
  101. },
  102. dateRange:[],
  103. //数据数量
  104. total:10,
  105. tableList:[],
  106. //审批状态
  107. optionsListTwo:[{id:'1',name:'审批中'},{id:'2',name:'已授权'},{id:'3',name:'已拒绝'}]
  108. }
  109. },
  110. created() {
  111. },
  112. mounted(){
  113. this.getList();
  114. },
  115. methods:{
  116. titleClick(){
  117. this.$parent.titleClick(1);
  118. },
  119. //页面状态切换
  120. goPageButton(type){
  121. if(type == 1){
  122. this.pageType = 1;
  123. }else if(type == 2){
  124. this.pageType = 2;
  125. }else if(type == 3){
  126. this.resetQuery();
  127. this.pageType = 1;
  128. }
  129. },
  130. /** 搜索按钮操作 */
  131. handleQuery() {
  132. this.queryParamsData.pageNum = 1;
  133. this.queryParamsData.pageSize = 20;
  134. this.queryParams = JSON.parse(JSON.stringify(this.queryParamsData));
  135. this.getList();
  136. },
  137. /** 重置按钮操作 */
  138. resetQuery() {
  139. this.$set(this,'queryParamsData',{});
  140. this.$set(this,'queryParams',{});
  141. this.$set(this,'dateRange',[]);
  142. this.handleQuery();
  143. },
  144. //获取数据列表
  145. getList(){
  146. this.queryParamsData = JSON.parse(JSON.stringify(this.queryParams));
  147. if(this.dateRange&&this.dateRange.length>0) {
  148. this.queryParamsData.startTime = this.dateRange[0];
  149. this.queryParamsData.endTime = this.dateRange[1];
  150. } else {
  151. this.queryParamsData.startTime = null;
  152. this.queryParamsData.endTime = null;
  153. }
  154. applyList(this.queryParamsData).then(response => {
  155. this.tableList = response.rows;
  156. this.total = response.total
  157. });
  158. },
  159. }
  160. }
  161. </script>
  162. <style scoped lang="scss">
  163. .application{
  164. flex:1;
  165. display: flex;
  166. flex-direction: column;
  167. *{
  168. margin: 0;
  169. }
  170. .application-page{
  171. flex:1;
  172. display: flex;
  173. flex-direction: column;
  174. overflow: hidden;
  175. padding:20px!important;
  176. .application-min{
  177. flex:1;
  178. display: flex;
  179. flex-direction: column;
  180. overflow: hidden;
  181. margin:0 20px!important;
  182. .button-box{
  183. display: flex;
  184. }
  185. }
  186. }
  187. }
  188. </style>