authorize.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  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">
  11. <p>授权申请</p>
  12. <p></p>
  13. </div>
  14. </div>
  15. <div class="authorize-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.applyStatus" 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>
  48. <p class="inquire-button-one" @click="handleQuery" style="margin-right:10px;">查询</p>
  49. <p class="reset-button-one" @click="resetQuery">重置</p>
  50. </el-form-item>
  51. </el-form>
  52. <el-table v-loading="loading" border :data="tableList">
  53. <el-table-column label="申请时间" align="center" prop="creatTime" show-overflow-tooltip/>
  54. <el-table-column label="申请人" align="center" prop="userName" show-overflow-tooltip/>
  55. <el-table-column label="共同申请人" align="center" prop="userName2" show-overflow-tooltip/>
  56. <el-table-column label="申请实验室" align="center" prop="subjectName" show-overflow-tooltip/>
  57. <el-table-column label="位置" align="center" prop="position" show-overflow-tooltip v-if="$store.state.settings.smartAlarmType == 1"/>
  58. <el-table-column label="所属学院" align="center" prop="college" show-overflow-tooltip/>
  59. <el-table-column label="授权人" align="center" prop="safeUserName" width="160px" show-overflow-tooltip/>
  60. <el-table-column label="失效时间" align="center" prop="approvalTime" width="160px" show-overflow-tooltip>
  61. <template slot-scope="scope">
  62. <span>{{scope.row.loseTime!=1?scope.row.loseTime:''}}</span>
  63. </template>
  64. </el-table-column>
  65. <el-table-column label="状态" align="center" prop="applyStatus" width="180px" show-overflow-tooltip>
  66. <template slot-scope="scope">
  67. <span>{{scope.row.applyStatus==1?'已授权':(scope.row.applyStatus==2?'已失效':'')}}</span>
  68. </template>
  69. </el-table-column>
  70. <!--<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="140" v-if="tableButtonType">-->
  71. <!--<template slot-scope="scope">-->
  72. <!--<div class="button-box">-->
  73. <!--&lt;!&ndash;<p class="table-min-button" @click="tableButtonClick(scope.row,1)">通过</p>&ndash;&gt;-->
  74. <!--&lt;!&ndash;<p class="table-min-button" @click="tableButtonClick(scope.row,2)">拒绝</p>&ndash;&gt;-->
  75. <!--<p class="table-min-button" v-show="scope.row.applyStatus==1&&scope.row.safe" @click="tableButtonClick(scope.row,1)">通过</p>-->
  76. <!--<p class="table-min-button" v-show="scope.row.applyStatus==1&&scope.row.safe" @click="tableButtonClick(scope.row,2)">拒绝</p>-->
  77. <!--&lt;!&ndash;<p class="table-min-button" v-show="scope.row.applyStatus==2" @click="tableButtonClick(scope.row,3)">查看</p>&ndash;&gt;-->
  78. <!--</div>-->
  79. <!--</template>-->
  80. <!--</el-table-column>-->
  81. </el-table>
  82. <pagination :page-sizes="[20, 30, 40, 50]"
  83. v-show="total>0"
  84. :total="total"
  85. :page.sync="queryParams.pageNum"
  86. :limit.sync="queryParams.pageSize"
  87. @pagination="getList"/>
  88. </div>
  89. </div>
  90. <infoPage v-if="pageType == 2" :infoData="infoData"></infoPage>
  91. </div>
  92. </template>
  93. <script>
  94. import { openDoorApplyList,postApproval,getOpenDoorApply } from "@/api/laboratory/subject";
  95. import infoPage from "./infoPage.vue";
  96. export default {
  97. name: "authorize",
  98. components: {
  99. infoPage
  100. },
  101. data(){
  102. return{
  103. pageType:1,
  104. // table操作按钮校验
  105. tableButtonType:this.hasPermiDom(['system:user_student:query','system:user_student:query']),
  106. loading:false,
  107. // 搜索数据
  108. queryParamsData:{
  109. pageNum:1,
  110. pageSize:20,
  111. },
  112. // 搜索实际发送数据
  113. queryParams:{
  114. pageNum:1,
  115. pageSize:20,
  116. },
  117. dateRange:[],
  118. //数据数量
  119. total:10,
  120. tableList:[],
  121. //审批状态
  122. optionsListTwo:[{id:'1',name:'审批中'},{id:'2',name:'已授权'},{id:'3',name:'已拒绝'}],
  123. //详情
  124. infoData:{},
  125. }
  126. },
  127. created() {
  128. },
  129. mounted(){
  130. this.getList();
  131. },
  132. methods:{
  133. //操作接口
  134. tableButtonClick(item,type){
  135. if(type == 1){
  136. this.$confirm('确认要通过审批吗?', "警告", {
  137. confirmButtonText: "确定",
  138. cancelButtonText: "取消",
  139. type: "warning"
  140. }).then(() => {
  141. let obj = {
  142. applyId:item.id,
  143. approvaStatus:'1',
  144. }
  145. postApproval(obj).then((response) => {
  146. this.msgSuccess(response.msg)
  147. this.getList();
  148. });
  149. }).catch(function() {
  150. // 取消
  151. });
  152. }else if(type == 2){
  153. this.$confirm('确认要拒绝审批吗?', "警告", {
  154. confirmButtonText: "确定",
  155. cancelButtonText: "取消",
  156. type: "warning"
  157. }).then(() => {
  158. let obj = {
  159. applyId:item.id,
  160. approvaStatus:'2',
  161. };
  162. postApproval(obj).then((response) => {
  163. this.msgSuccess(response.msg);
  164. this.getList();
  165. });
  166. }).catch(function() {
  167. // 取消
  168. });
  169. } else if(type == 3){
  170. getOpenDoorApply(item.id).then((response) => {
  171. this.infoData = response.data;
  172. this.pageType = 2;
  173. });
  174. }
  175. },
  176. goPageButton(){
  177. this.pageType = 1;
  178. },
  179. titleClick(){
  180. this.$parent.titleClick(2);
  181. },
  182. /** 搜索按钮操作 */
  183. handleQuery() {
  184. this.queryParamsData.pageNum = 1;
  185. this.queryParamsData.pageSize = 20;
  186. this.queryParams = JSON.parse(JSON.stringify(this.queryParamsData));
  187. this.getList();
  188. },
  189. /** 重置按钮操作 */
  190. resetQuery() {
  191. this.$set(this,'queryParamsData',{});
  192. this.$set(this,'queryParams',{});
  193. this.$set(this,'dateRange',[]);
  194. this.handleQuery();
  195. },
  196. //获取数据列表
  197. getList(){
  198. this.queryParamsData = JSON.parse(JSON.stringify(this.queryParams));
  199. if(this.dateRange&&this.dateRange.length>0) {
  200. this.queryParamsData.startTime = this.dateRange[0];
  201. this.queryParamsData.endTime = this.dateRange[1];
  202. } else {
  203. this.queryParamsData.startTime = null;
  204. this.queryParamsData.endTime = null;
  205. }
  206. openDoorApplyList(this.queryParamsData).then(response => {
  207. this.tableList = response.rows;
  208. this.total = response.total
  209. });
  210. },
  211. }
  212. }
  213. </script>
  214. <style scoped lang="scss">
  215. .authorize{
  216. flex:1;
  217. display: flex;
  218. flex-direction: column;
  219. .authorize-page{
  220. flex:1;
  221. display: flex;
  222. flex-direction: column;
  223. overflow: hidden;
  224. .title-box{
  225. display: flex;
  226. border-bottom:1px solid #E0E0E0;
  227. margin-bottom:20px;
  228. div{
  229. height:80px;
  230. margin-right:20px;
  231. cursor: pointer;
  232. p:nth-child(1){
  233. font-size:18px;
  234. text-align: center;
  235. padding:0 20px;
  236. margin-top:26px;
  237. }
  238. p:nth-child(2){
  239. width:40px;
  240. height:4px;
  241. border-radius:40px;
  242. margin:12px auto;
  243. }
  244. .top-p-color{
  245. color: #0045AF;
  246. }
  247. .bottom-p-color{
  248. background: #0045AF;
  249. }
  250. }
  251. .buttonTitleColorA{
  252. color:#0045AF;
  253. }
  254. .buttonTitleColorB{
  255. color:#999999;
  256. }
  257. }
  258. .authorize-min{
  259. flex:1;
  260. display: flex;
  261. flex-direction: column;
  262. overflow: hidden;
  263. margin:0 20px!important;
  264. .button-box{
  265. display: flex;
  266. }
  267. }
  268. }
  269. }
  270. </style>