application.vue 7.1 KB

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