LabBindingApply.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. <!-- 实验室绑定申请 -->
  2. <template>
  3. <div class="app-container lab-binding-card">
  4. <div class="card-header">
  5. <span class="card-title">实验室绑定申请</span>
  6. <div class="header-right">
  7. <!-- 分组筛选按钮 -->
  8. <div class="table-top-button-box">
  9. <div>
  10. <p
  11. v-for="(btn, i) in filterData.statusBtns" :key="btn.value"
  12. :class="filterData.activeStatus === btn.value ? 'check-table-button' : ''"
  13. @click="checkButton(btn.value)"
  14. >{{ btn.label }}</p>
  15. </div>
  16. </div>
  17. </div>
  18. </div>
  19. <div class="page-content-box">
  20. <el-table class="table-box" :data="dataList" border>
  21. <el-table-column prop="userName" label="申请人" width="80" show-overflow-tooltip/>
  22. <el-table-column prop="userAccount" label="学号" width="110" show-overflow-tooltip/>
  23. <el-table-column prop="educationName" label="用户类型" width="100" show-overflow-tooltip/>
  24. <el-table-column prop="deptName" label="所属学院" min-width="120" show-overflow-tooltip />
  25. <el-table-column prop="subName" label="申请实验室" min-width="160" show-overflow-tooltip />
  26. <el-table-column prop="levelName" label="分级" width="70" align="center" show-overflow-tooltip>
  27. <template slot-scope="scope">
  28. <span :style="'color:'+scope.row.levelColor+';'">{{ scope.row.levelName }}</span>
  29. </template>
  30. </el-table-column>
  31. <el-table-column prop="typeName" label="分类" width="120" />
  32. <el-table-column prop="reason" label="进入原因" min-width="120" show-overflow-tooltip />
  33. <el-table-column prop="submitTime" label="提交时间" width="150" show-overflow-tooltip>
  34. <template slot-scope="scope">
  35. <span>{{ parseTime(scope.row.submitTime,"{y}-{m}-{d} {h}:{i}") }}</span>
  36. </template>
  37. </el-table-column>
  38. <el-table-column prop="approveTime" label="通过时间" width="150" show-overflow-tooltip>
  39. <template slot-scope="scope">
  40. <span>{{ parseTime(scope.row.approveTime,"{y}-{m}-{d} {h}:{i}") }}</span>
  41. </template>
  42. </el-table-column>
  43. <el-table-column prop="statusCode" label="状态" width="80" align="center" show-overflow-tooltip>
  44. <template slot-scope="scope">
  45. <span :class="scope.row.statusCode==0?'status-txt-a':(scope.row.statusCode==1?'status-txt-b':(scope.row.statusCode==2?'status-txt-c':''))">
  46. {{ scope.row.statusCode==0?'待审批':(scope.row.statusCode==1?'已通过':(scope.row.statusCode==2?'已驳回':'')) }}
  47. </span>
  48. </template>
  49. </el-table-column>
  50. <el-table-column label="操作" min-width="130" align="left">
  51. <template slot-scope="scope">
  52. <p class="button-color-a" v-if="scope.row.statusCode==0" @click="tableButton(1,scope.row)">通过</p>
  53. <p class="button-color-b" v-if="scope.row.statusCode==0" @click="tableButton(2,scope.row)">驳回</p>
  54. </template>
  55. </el-table-column>
  56. </el-table>
  57. <pagination :page-sizes="[20, 30, 40, 50]"
  58. v-show="total>0"
  59. :total="total"
  60. :page.sync="queryParams.page"
  61. :limit.sync="queryParams.pageSize"
  62. @pagination="getList"
  63. />
  64. </div>
  65. <el-dialog class="slab-binding-card-dialog"
  66. :modal-append-to-body="false"
  67. :close-on-click-modal="false" :close-on-press-escape="false"
  68. title="驳回申请"
  69. :visible.sync="dialogType"
  70. v-if="dialogType"
  71. width="560px"
  72. append-to-body>
  73. <div style="min-height:60px;overflow: hidden">
  74. <div>
  75. <el-form :model="dialogData" ref="dialogForm" :rules="dialogRules">
  76. <el-form-item label="" prop="reason" label-width="0">
  77. <el-input
  78. type="textarea"
  79. :autosize="{ minRows: 4, maxRows: 4}"
  80. placeholder="请输入原因"
  81. maxLength="100"
  82. resize="none"
  83. style="width: 520px"
  84. v-model="dialogData.reason">
  85. </el-input>
  86. </el-form-item>
  87. </el-form>
  88. </div>
  89. </div>
  90. <div slot="footer" class="dialog-footer dialog-footer-box">
  91. <p class="dialog-footer-button-null"></p>
  92. <p class="dialog-footer-button-info" @click="dialogCancel">取消</p>
  93. <p class="dialog-footer-button-primary" @click="dialogSubmit">提交</p>
  94. <p class="dialog-footer-button-null"></p>
  95. </div>
  96. </el-dialog>
  97. </div>
  98. </template>
  99. <script>
  100. import {
  101. examElLabEduRelationAuditList,examElLabEduRelationAudit,
  102. } from "@/api/safetyEducationExaminationNew/index";
  103. export default {
  104. name: 'LabBindingApply',
  105. data() {
  106. return {
  107. filterData: {
  108. activeStatus: '',
  109. statusBtns: [
  110. { label: '全部', value: '' },
  111. { label: '待审批', value: '0' },
  112. { label: '已通过', value: '1' },
  113. { label: '已驳回', value: '2' },
  114. ]
  115. },
  116. queryParams: {
  117. page: 1,
  118. pageSize: 20,
  119. },
  120. dataList: [],
  121. //数据数量
  122. total: 0,
  123. dialogType:false,
  124. dialogData:{
  125. reason:'',
  126. },
  127. dialogRules:{
  128. reason: [
  129. { required: true, message: "请输入驳回原因", trigger: "blur" }
  130. ],
  131. },
  132. checkId:null,
  133. }
  134. },
  135. mounted(){
  136. this.getList();
  137. },
  138. methods: {
  139. checkButton(val){
  140. if(this.filterData.activeStatus != val){
  141. this.$set(this.filterData,'activeStatus',val);
  142. this.handleQuery();
  143. }
  144. },
  145. tableButton(val,row){
  146. let self = this;
  147. this.$set(this,'checkId',row.id);
  148. this.$set(this.dialogData,'reason','');
  149. if (val == 1){
  150. //通过
  151. this.$confirm('确认审核通过?', "提示", {
  152. confirmButtonText: "确认",
  153. cancelButtonText: "取消",
  154. type: "warning"
  155. }).then(function() {
  156. }).then(() => {
  157. self.examElLabEduRelationAudit(1)
  158. }).catch(() => {});
  159. } else {
  160. //驳回
  161. this.$set(this,'dialogType',true);
  162. }
  163. },
  164. //提交按钮
  165. dialogSubmit(){
  166. let self = this;
  167. this.$refs["dialogForm"].validate(valid => {
  168. if (valid) {
  169. self.examElLabEduRelationAudit(2)
  170. }
  171. })
  172. },
  173. examElLabEduRelationAudit(statusCode){
  174. let obj = {
  175. id:this.checkId,
  176. statusCode:statusCode,
  177. reason:this.dialogData.reason,
  178. }
  179. examElLabEduRelationAudit(obj).then(response => {
  180. this.msgSuccess(response.message)
  181. this.$set(this,'dialogType',false);
  182. this.getList();
  183. })
  184. },
  185. //关闭按钮
  186. dialogCancel(){
  187. this.$set(this,'dialogType',false);
  188. },
  189. //查询按钮
  190. handleQuery() {
  191. this.$set(this.queryParams, 'page', 1)
  192. this.getList()
  193. },
  194. //获取数据列表
  195. getList() {
  196. let obj = JSON.parse(JSON.stringify(this.queryParams))
  197. obj.statusCode = this.filterData.activeStatus;
  198. examElLabEduRelationAuditList(obj).then(response => {
  199. this.$set(this, 'dataList', response.data.records)
  200. this.$set(this, 'total', response.data.total)
  201. })
  202. },
  203. },
  204. }
  205. </script>
  206. <style scoped lang="scss">
  207. .lab-binding-card {
  208. background: #fff;
  209. /*border-radius: 6px;*/
  210. padding: 20px;
  211. margin-bottom: 12px;
  212. /*box-shadow: 0 1px 4px rgba(0,0,0,0.06);*/
  213. background: rgba(255, 255, 255, 0.95);
  214. box-shadow: 0 4px 20px rgba(37, 50, 74, 0.06);
  215. .card-header {
  216. display: flex;
  217. justify-content: space-between;
  218. align-items: center;
  219. margin-bottom: 16px;
  220. .card-title {
  221. font-size: 16px;
  222. font-weight: 700;
  223. color: #222;
  224. }
  225. .header-right {
  226. display: flex;
  227. align-items: center;
  228. gap: 20px;
  229. }
  230. }
  231. .page-content-box{
  232. height:500px;
  233. padding:0;
  234. }
  235. /* 分组筛选按钮 — 与其他页面保持一致 */
  236. .table-top-button-box {
  237. display: inline-block;
  238. vertical-align: top;
  239. div {
  240. display: flex;
  241. p {
  242. border: 1px solid #DCDFE6;
  243. width: 80px;
  244. text-align: center;
  245. height: 40px;
  246. line-height: 40px;
  247. cursor: pointer;
  248. font-size: 14px;
  249. &:nth-child(1) {
  250. border-top-left-radius: 4px;
  251. border-bottom-left-radius: 4px;
  252. }
  253. &:nth-child(2) { border-left: none; }
  254. &:nth-child(3) { border-left: none; border-right: none; }
  255. &:nth-child(4) {
  256. border-top-right-radius: 4px;
  257. border-bottom-right-radius: 4px;
  258. }
  259. &.check-table-button {
  260. border: 1px solid #0183fa;
  261. background-color: #0183fa;
  262. color: #fff;
  263. }
  264. }
  265. }
  266. }
  267. .button-color-a{
  268. width:60px;
  269. cursor: pointer;
  270. margin-right:10px;
  271. display: inline-block;
  272. text-align: center;
  273. line-height:24px;
  274. border-radius:4px;
  275. border: 1px solid #00B176;
  276. color: #fff;
  277. background-color: #00B176;
  278. }
  279. .button-color-b{
  280. width:60px;
  281. cursor: pointer;
  282. display: inline-block;
  283. text-align: center;
  284. line-height:24px;
  285. border-radius:4px;
  286. border: 1px solid #E86452;
  287. color: #fff;
  288. background-color: #E86452;
  289. }
  290. .status-txt-a{
  291. color: #F59A48;
  292. }
  293. .status-txt-b{
  294. color: #00B176;
  295. }
  296. .status-txt-c{
  297. color: #E86452;
  298. }
  299. ::v-deep .row-reject td {
  300. background: #fffafa !important;
  301. }
  302. ::v-deep .el-table td {
  303. padding: 10px 0;
  304. }
  305. }
  306. </style>