authorizejinan.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. <!--门禁授权-->
  2. <template>
  3. <div class="authorize">
  4. <div class="authorize-page" v-if="pageType == 1">
  5. <div class="title-box">
  6. <div>
  7. <p class="top-p-color">门禁授权</p>
  8. <p class="bottom-p-color"></p>
  9. </div>
  10. <div @click="titleClick(2)">
  11. <p>授权失败</p>
  12. <p></p>
  13. </div>
  14. <div @click="titleClick(3)">
  15. <p>授权日志</p>
  16. <p></p>
  17. </div>
  18. </div>
  19. <div class="authorize-min">
  20. <el-form :model="queryParamsData" ref="queryForm" :inline="true">
  21. <el-form-item label="关键字" prop="searchValue" label-width="68px">
  22. <el-input
  23. maxlength="20"
  24. v-model="queryParamsData.searchValue"
  25. placeholder="姓名/实验室"
  26. clearable
  27. size="small"/>
  28. </el-form-item>
  29. <el-form-item label="状态" prop="status" label-width="50px">
  30. <el-select v-model="queryParamsData.operate" clearable placeholder="请选择状态">
  31. <el-option
  32. v-for="item in optionsListTwo"
  33. :key="item.code"
  34. :label="item.name"
  35. :value="item.code">
  36. </el-option>
  37. </el-select>
  38. </el-form-item>
  39. <el-form-item>
  40. <p class="inquire-button-one" @click="handleQuery" style="margin-right:10px;">查询</p>
  41. <p class="reset-button-one" @click="resetQuery">重置</p>
  42. </el-form-item>
  43. </el-form>
  44. <el-table v-loading="loading" border :data="tableList">
  45. <el-table-column label="所属学院" align="left" prop="deptName" />
  46. <el-table-column label="实验室" align="left" prop="subName" />
  47. <el-table-column label="位置" align="left" prop="posi" />
  48. <el-table-column label="实验室负责人" align="left" prop="adminName" />
  49. <el-table-column label="门禁" align="left" prop="hardName" />
  50. <el-table-column label="授权人数" align="left" prop="available" />
  51. <el-table-column label="状态" align="left" prop="operate" >
  52. <template slot-scope="scope" v-if="scope.row.operate">
  53. <span>{{scope.row.operate.name}}</span>
  54. </template>
  55. </el-table-column>
  56. <el-table-column label="操作" align="left" class-name="small-padding fixed-width" width="120">
  57. <template slot-scope="scope">
  58. <div class="button-box">
  59. <p class="table-min-button"
  60. v-hasPermi="['haikang:user:list']"
  61. @click="handleClick('',scope.row,'detail')"
  62. >查看授权</p>
  63. </div>
  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. <lookImpower v-if="pageType == 2" :pageData="pageData"></lookImpower>
  76. </div>
  77. </template>
  78. <script>
  79. import { getHaikangList } from '@/api/laboratory/subject'
  80. import lookImpower from "./lookImpower.vue";
  81. export default {
  82. name: "authorize",
  83. components: {
  84. lookImpower
  85. },
  86. data(){
  87. return{
  88. pageType:1,
  89. loading:false,
  90. // 搜索数据
  91. queryParamsData:{
  92. pageNum:1,
  93. pageSize:20,
  94. searchValue:'',
  95. operate:'',
  96. },
  97. // 搜索实际发送数据
  98. queryParams:{
  99. pageNum:1,
  100. pageSize:20,
  101. },
  102. //数据数量
  103. total:10,
  104. tableList:[{}],
  105. //审批状态
  106. optionsListTwo:[{code:null,name:'全部'},{code:0,name:'离线'},{code:2,name:'在线'}],
  107. //详情
  108. pageData:{},
  109. }
  110. },
  111. created() {
  112. },
  113. mounted(){
  114. this.getList();
  115. },
  116. methods:{
  117. handleClick(index,row,doType){
  118. if(doType=='detail'){
  119. this.pageType=2
  120. this.pageData=row
  121. console.log(this.pageData)
  122. }else if(doType=='back'){
  123. this.pageType=1
  124. }
  125. },
  126. //操作接口
  127. goPageButton(){
  128. this.pageType = 1;
  129. },
  130. titleClick(type){
  131. this.$parent.titleClick(type);
  132. },
  133. /** 搜索按钮操作 */
  134. handleQuery() {
  135. this.queryParamsData.pageNum = 1;
  136. this.queryParamsData.pageSize = 20;
  137. this.queryParams = JSON.parse(JSON.stringify(this.queryParamsData));
  138. this.getList();
  139. },
  140. /** 重置按钮操作 */
  141. resetQuery() {
  142. this.$set(this,'queryParamsData',{});
  143. this.$set(this,'queryParams',{});
  144. this.handleQuery();
  145. },
  146. //获取数据列表
  147. getList(){
  148. this.queryParamsData = JSON.parse(JSON.stringify(this.queryParams));
  149. getHaikangList(this.queryParamsData).then(response => {
  150. this.tableList = response.rows;
  151. this.total = response.total
  152. });
  153. },
  154. }
  155. }
  156. </script>
  157. <style scoped lang="scss">
  158. .authorize{
  159. flex:1;
  160. display: flex;
  161. flex-direction: column;
  162. .authorize-page{
  163. flex:1;
  164. display: flex;
  165. flex-direction: column;
  166. overflow: hidden;
  167. .title-box{
  168. display: flex;
  169. border-bottom:1px solid #E0E0E0;
  170. margin-bottom:20px;
  171. div{
  172. height:80px;
  173. margin-right:20px;
  174. cursor: pointer;
  175. p:nth-child(1){
  176. font-size:18px;
  177. text-align: center;
  178. padding:0 20px;
  179. margin-top:26px;
  180. }
  181. p:nth-child(2){
  182. width:40px;
  183. height:4px;
  184. border-radius:40px;
  185. margin:12px auto;
  186. }
  187. .top-p-color{
  188. color: #0045AF;
  189. }
  190. .bottom-p-color{
  191. background: #0045AF;
  192. }
  193. }
  194. .buttonTitleColorA{
  195. color:#0045AF;
  196. }
  197. .buttonTitleColorB{
  198. color:#999999;
  199. }
  200. }
  201. .authorize-min{
  202. flex:1;
  203. display: flex;
  204. flex-direction: column;
  205. overflow: hidden;
  206. margin:0 20px!important;
  207. .button-box{
  208. display: flex;
  209. }
  210. }
  211. }
  212. }
  213. </style>