application.vue 7.2 KB

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