teach_detail.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. <template>
  2. <view class="content">
  3. <!-- 申请类型 -->
  4. <view class="request_type">
  5. <text class="type_title" v-if="department=='7'">临时人员</text>
  6. <text class="type_title" v-if="department=='4'">教师换课</text>
  7. <view class="type_time">{{list.submissionTime}}</view>
  8. <view class="type_zhuang2" v-if="list.status==0">已拒绝</view>
  9. <view class="type_zhuang3" v-if="list.status==1">待审批</view>
  10. <view class="type_zhuang3" v-if="list.status==2">处理中</view>
  11. <view class="type_zhuang" v-if="list.status==3">审批通过</view>
  12. </view>
  13. <!-- 申请内容 -->
  14. <view class="request_detail">
  15. <uni-forms ref="valiForm">
  16. <uni-forms-item label="类型" name="companyName" required>
  17. <view class="uni-input">
  18. <template v-if="list.department=='0'">其他</template>
  19. <template v-if="list.department=='1'">学生</template>
  20. <template v-if="list.department=='4'">教职工</template>
  21. <template v-if="list.department=='5'">校友</template>
  22. <template v-if="list.department=='6'">访客</template>
  23. <template v-if="list.department=='7'">临时人员</template>
  24. </view>
  25. </uni-forms-item>
  26. <view class="form-line"></view>
  27. <uni-forms-item label="开始时间" name="companyName" required>
  28. <view class="uni-input">
  29. {{list.startTime}}
  30. </view>
  31. </uni-forms-item>
  32. <view class="form-line"></view>
  33. <uni-forms-item label="结束时间" name="companyName" required>
  34. <view class="uni-input">
  35. {{list.endTime}}
  36. </view>
  37. </uni-forms-item>
  38. <view class="form-line"></view>
  39. <uni-forms-item label="申请部门" name="companyName" required>
  40. <view class="uni-input">
  41. <template v-if="list.department=='0'">其他</template>
  42. <template v-if="list.department=='1'">学生</template>
  43. <template v-if="list.department=='4'">教职工</template>
  44. <template v-if="list.department=='5'">校友</template>
  45. <template v-if="list.department=='6'">访客</template>
  46. <template v-if="list.department=='7'">临时人员</template>
  47. </view>
  48. </uni-forms-item>
  49. <view class="form-line" v-if="department=='4'"></view>
  50. <uni-forms-item label="换课老师" name="companyName" required v-if="department=='4'">
  51. <view class="uni-input">
  52. {{list.changeUsersName}}
  53. </view>
  54. </uni-forms-item>
  55. </uni-forms>
  56. </view>
  57. <!-- 申请备注 -->
  58. <view class="request_remark">
  59. <uni-forms-item label="备注" name="companyName" required>
  60. </uni-forms-item>
  61. <view class="liyou">{{list.reasonApplication}}</view>
  62. <text class="textsrea-txt">{{zishunum}}</text>
  63. </view>
  64. <!-- 审批记录 -->
  65. <view class="request_list" v-if="list.status==0 || list.status==3">
  66. <view class="list_title">审批记录</view>
  67. <!-- 几级审批 -->
  68. <view style="position: absolute;margin-top: 110rpx;background: rgba(255, 255, 255, 1);height: 30%;">
  69. <view>
  70. <image class="item_image"></image>
  71. <view class="item_title">提交申请</view>
  72. <view class="item_name">{{list.usersName}}</view>
  73. <view class="item_time">{{list.submissionTime}}</view>
  74. <view class="item_line" v-if="list.approverName || list.secondaryApproverName"></view>
  75. </view>
  76. <view v-if="list.secondaryApproverName">
  77. <image class="item_image"></image>
  78. <view class="item_title">{{list.secondaryExamineAndApproveRemark}}</view>
  79. <view class="item_name">{{list.secondaryApproverName}}</view>
  80. <view class="item_time">{{list.secondaryExamineAndApproveTime}}</view>
  81. <view class="item_line" v-if="list.approverName"></view>
  82. </view>
  83. <view v-if="list.approverName">
  84. <image class="item_image"></image>
  85. <view class="item_title">{{list.examineAndApproveRemark}}</view>
  86. <view class="item_name">{{list.approverName}}</view>
  87. <view class="item_time">{{list.examineAndApproveTime}}</view>
  88. </view>
  89. </view>
  90. </view>
  91. <!-- 审批意见 -->
  92. <view class="option_title" v-if="list.status==1 || list.status==2">审批意见</view>
  93. <view class="request_list" v-if="list.status==1 || list.status==2">
  94. <uni-easyinput type="textarea" v-model="option" placeholder="请输入审批意见" @input="input"></uni-easyinput>
  95. <text class="textsrea-txt" style="margin-left: 337px;">{{textNum}}/800</text>
  96. </view>
  97. <view class="submit-disagree" v-if="list.status==1 || list.status==2" @click="disagree()">驳回</view>
  98. <view class="submit-agree" v-if="list.status==1 || list.status==2" @click="agree()">同意</view>
  99. </view>
  100. </template>
  101. <script>
  102. import {
  103. shenpiLinshi,
  104. shenpiTeacher,
  105. getlistXiang
  106. } from '../../../utils/api_hotel.js'
  107. export default {
  108. data() {
  109. return {
  110. list:[],
  111. id:'',
  112. department:'',//身份
  113. zishunum:0,
  114. textNum:0,
  115. option:'',
  116. agreestatu:'',
  117. }
  118. },
  119. onLoad(option) {
  120. this.id=option.id
  121. this.department=option.department
  122. this.getXiang()
  123. },
  124. mounted() {
  125. },
  126. methods: {
  127. //输入审批意见
  128. input(e){
  129. this.option=e
  130. this.textNum=e.length
  131. },
  132. //详情
  133. getXiang(){
  134. let _self = this
  135. // adminMenuId身份类型,4为教职工,7为临时人员localStorage.getItem('department')
  136. // 状态,0:已拒绝,1:待审批,2:处理中,3:已同意
  137. var data="?department="+_self.department+"&id="+_self.id
  138. getlistXiang(data).then((res) => {
  139. if (res.success) {
  140. this.list=res.data
  141. this.zishunum=res.data.reasonApplication.length
  142. return;
  143. } else {
  144. uni.showToast({
  145. title: '获取记录详情失败'
  146. })
  147. }
  148. }).catch((err) => {
  149. uni.showToast({
  150. title: err.message
  151. })
  152. });
  153. },
  154. //驳回
  155. disagree(){
  156. this.agreestatu='0'
  157. if(this.department=='7'){
  158. this.shenpiLinshi()
  159. }else if(this.department=='4'){
  160. this.shenpiTeacher()
  161. }
  162. },
  163. //同意
  164. agree(){
  165. this.agreestatu='1'
  166. if(this.department=='7'){
  167. this.shenpiLinshi()
  168. }else if(this.department=='4'){
  169. this.shenpiTeacher()
  170. }
  171. },
  172. // 审批临时人员
  173. shenpiLinshi(){
  174. let _self = this
  175. this.$axios.defaults.headers.common['token'] = localStorage.getItem('token');
  176. this.$axios.defaults.headers.common['request_token'] = this.submitToken;
  177. this.$axios.defaults.headers.common['Content-Type'] ='application/json'
  178. var data={
  179. "id": _self.id, //审批表id
  180. "adminMenuId": localStorage.getItem('manager'),//1管理员,0不是管理员
  181. "status": _self.agreestatu, //审批状态 1:同意 0:拒绝
  182. "adminId": localStorage.getItem('usersId'),//管理端id
  183. "remark": _self.option ,//审批备注
  184. }
  185. shenpiLinshi(data).then((res) => {
  186. if (res.success) {
  187. uni.showToast({
  188. title: '审批成功',
  189. icon: 'success',
  190. duration: 1000
  191. })
  192. _self.getXiang()
  193. } else {
  194. }
  195. }).catch((err) => {
  196. uni.showToast({
  197. title: err.message
  198. })
  199. });
  200. },
  201. // 审批教师换课
  202. shenpiTeacher(){
  203. let _self = this
  204. this.$axios.defaults.headers.common['token'] = localStorage.getItem('token');
  205. this.$axios.defaults.headers.common['request_token'] = this.submitToken;
  206. this.$axios.defaults.headers.common['Content-Type'] ='application/json'
  207. var data={
  208. "id": _self.id, //审批表id
  209. "adminMenuId": localStorage.getItem('manager'),//1管理员,0不是管理员
  210. "status": _self.agreestatu, //审批状态 1:同意 0:拒绝
  211. "adminId": localStorage.getItem('usersId'),//管理端id
  212. "remark": _self.option ,//审批备注
  213. }
  214. shenpiTeacher(data).then((res) => {
  215. if (res.success) {
  216. uni.showToast({
  217. title: '审批成功',
  218. icon: 'success',
  219. duration: 1000
  220. })
  221. _self.getXiang()
  222. } else {
  223. }
  224. }).catch((err) => {
  225. uni.showToast({
  226. title: err.message
  227. })
  228. });
  229. },
  230. }
  231. }
  232. </script>
  233. <style>
  234. @import url("./teach_detail.css");
  235. </style>