labCenterPerson.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. <!--实验中心人员配置-->
  2. <template>
  3. <div class="app-container approval_handle">
  4. <div class="approval_handle-page" v-if="pageType == 1">
  5. <el-form :model="queryParams" ref="queryForm" style="margin-top:20px;" :inline="true">
  6. <el-form-item label="关键字" prop="name">
  7. <el-input
  8. v-model="queryParams.searchValue"
  9. placeholder="姓名/工号/联系方式"
  10. clearable
  11. maxLength="30"
  12. size="small"
  13. />
  14. </el-form-item>
  15. <el-form-item label="所属院系" prop="deptId" class="form-item">
  16. <el-select v-model="queryParams.deptId" placeholder="请选择所属院系">
  17. <el-option
  18. v-for="dict in deptOptions"
  19. :key="dict.deptId"
  20. :label="dict.deptName"
  21. :value="dict.deptId"
  22. ></el-option>
  23. </el-select>
  24. </el-form-item>
  25. <el-form-item>
  26. <p class="inquire-button-one" @click="handleQuery">查询</p>
  27. <p class="reset-button-one" @click="resetQuery">重置</p>
  28. </el-form-item>
  29. <el-form-item style="float: right;">
  30. <el-col :span="1.5">
  31. <el-button
  32. type="primary"
  33. plain
  34. icon="el-icon-plus"
  35. size="mini"
  36. @click="handleClick('','','add')"
  37. v-hasPermi="['airbottle:flowDetail:add']"
  38. >新增</el-button>
  39. </el-col>
  40. </el-form-item>
  41. </el-form>
  42. <el-table border v-loading="loading" :data="tableData">
  43. <el-table-column label="姓名" align="left" prop="userName"/>
  44. <el-table-column label="工号" align="left" prop="userNumber"></el-table-column>
  45. <el-table-column label="联系方式" align="left" prop="userTelephone"></el-table-column>
  46. <el-table-column label="所属院系" align="left" prop="deptName"></el-table-column>
  47. <el-table-column label="操作" align="left" class-name="small-padding fixed-width" width="120">
  48. <template slot-scope="scope">
  49. <div class="button-box">
  50. <p class="table-min-button"
  51. @click="handleClick('',scope.row,'delete')"
  52. v-hasPermi="['airbottle:flowDetail:remove']"
  53. >删除</p>
  54. </div>
  55. </template>
  56. </el-table-column>
  57. </el-table>
  58. <pagination
  59. :total="total"
  60. layout="total, prev, pager, next, sizes, jumper"
  61. :page.sync="queryParams.pageNum"
  62. :limit.sync="queryParams.pageSize"
  63. @pagination="getList"
  64. />
  65. </div>
  66. <!--新增 -->
  67. <add-page v-if="pageType==2" :pageData2="pageData2"></add-page>
  68. </div>
  69. </template>
  70. <script>
  71. import {
  72. RFIDtagAdd,
  73. listDepartments,
  74. labCenterPersonList,
  75. labCenterPersonDelete
  76. } from '@/api/gasManage3_0/gasManage'
  77. import { getToken } from "@/utils/auth";
  78. import addPage from "./labCenterPersonAdd.vue"
  79. export default {
  80. name: "Approval",
  81. components: {
  82. addPage
  83. },
  84. data() {
  85. return {
  86. dialogVisible :false,
  87. //页面状态
  88. pageType:1,
  89. loading:false,
  90. headers: {
  91. Authorization: "Bearer " + getToken()
  92. },
  93. // 查询参数
  94. queryParams: {
  95. pageNum: 1,
  96. pageSize:20,
  97. searchValue:'',
  98. },
  99. form:{
  100. tagCode:'',
  101. },
  102. pageData2:{},
  103. total:0,
  104. tableData:[],
  105. dateRange:[],
  106. deptOptions:[],
  107. };
  108. },
  109. methods: {
  110. /** 查询院系列表 */
  111. getDeptList() {
  112. listDepartments().then(response => {
  113. this.$set(this, 'deptOptions', response.data)
  114. });
  115. },
  116. /** 查询楼栋列表 */
  117. getBuildings(id) {
  118. if(id) {
  119. this.$set(this.form, 'buildId', '');//楼栋
  120. this.buildings = [];
  121. this.$set(this.form, 'floorId', '');//楼层
  122. this.floors = [];
  123. this.$set(this.form, 'layoutId', '');//房间
  124. this.layoutLists = [];
  125. listbuildings(id).then(response => {
  126. this.buildings = response.data;
  127. });
  128. }
  129. },
  130. handleClick(index,row,doType){
  131. let _this=this;
  132. if(doType=='add'){//添加
  133. _this.pageType=2;
  134. }else if(doType=='delete'){//删除
  135. this.$confirm('是否确认删除当前数据项?', "警告", {
  136. confirmButtonText: "确定",
  137. cancelButtonText: "取消",
  138. type: "warning"
  139. }).then(function() {
  140. labCenterPersonDelete(row.id).then( response => {
  141. if(response.code==200){
  142. _this.getList();
  143. _this.msgSuccess("删除成功");
  144. }
  145. });
  146. }).then(() => {
  147. }).catch(() => {});
  148. }else if(doType=='back'){//重新申请
  149. _this.pageType=1;
  150. }
  151. },
  152. /** 搜索按钮操作 */
  153. handleQuery() {
  154. this.queryParams.pageNum = 1;
  155. this.getList();
  156. },
  157. /** 重置按钮操作 */
  158. resetQuery() {
  159. this.queryParams.searchValue = "";
  160. this.queryParams.deptId = "";
  161. this.handleQuery();
  162. },
  163. getList(){
  164. let _this=this;
  165. labCenterPersonList(_this.queryParams).then( response => {
  166. let res=response.rows;
  167. _this.tableData=res;
  168. _this.total=response.total;
  169. });
  170. },
  171. submitForm(){
  172. let _this = this;
  173. RFIDtagAdd(_this.form).then(res => {
  174. this.$message({
  175. type: 'success',
  176. message: '操作成功!',
  177. duration:2000,
  178. onClose:function(){
  179. _this.backPage();
  180. _this.loading = false;
  181. }
  182. });
  183. });
  184. },
  185. },
  186. mounted() {
  187. this.getDeptList();
  188. this.getList();
  189. }
  190. };
  191. </script>
  192. <style scoped lang="scss">
  193. .approval_handle {
  194. display: flex!important;
  195. flex-direction: column;
  196. overflow: hidden;
  197. .approval_handle-page{
  198. flex:1;
  199. display: flex!important;
  200. flex-direction: column;
  201. box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);
  202. padding:20px 20px 20px!important;
  203. border-radius:10px;
  204. overflow: hidden;
  205. .button-box{
  206. width:200px;
  207. display: flex;
  208. }
  209. }
  210. .entering_t{
  211. font-size: 16px;
  212. font-family: Microsoft YaHei;
  213. font-weight: 400;
  214. color: #333333;
  215. line-height: 16px;
  216. margin: 36px auto 25px;
  217. text-align: center;
  218. }
  219. .entering_img{
  220. width: 288px;
  221. height: 140px;
  222. }
  223. .entering_input{
  224. width: 288px;
  225. }
  226. }
  227. </style>