teach_detail.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. <template>
  2. <view class="content">
  3. <!-- 申请类型 -->
  4. <view class="request_type">
  5. <text class="type_title" v-if="department=='4'">临时人员</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">{{list.orgName}}
  41. <!-- <template v-if="list.orgName=='0'">其他</template>
  42. <template v-if="list.orgName=='1'">学生</template>
  43. <template v-if="list.orgName=='4'">教职工</template>
  44. <template v-if="list.orgName=='5'">校友</template>
  45. <template v-if="list.orgName=='6'">访客</template>
  46. <template v-if="list.orgName=='7'">临时人员</template> -->
  47. </view>
  48. </uni-forms-item>
  49. <view class="form-line"></view>
  50. <uni-forms-item label="提交人" name="companyName" required>
  51. <view class="uni-input">
  52. {{list.usersName}}
  53. </view>
  54. </uni-forms-item>
  55. <view class="form-line"></view>
  56. <uni-forms-item label="房间数量" name="companyName" required>
  57. <view class="uni-input">
  58. {{list.houseCount}}
  59. </view>
  60. </uni-forms-item>
  61. <view class="form-line" v-if="department=='4'"></view>
  62. <uni-forms-item label="换课老师" name="companyName" required v-if="department=='4'">
  63. <view class="uni-input">
  64. {{list.changeUsersName}}
  65. </view>
  66. </uni-forms-item>
  67. </uni-forms>
  68. </view>
  69. <!-- 申请备注 -->
  70. <view class="request_remark">
  71. <uni-forms-item label="申请原因" name="companyName" required>
  72. </uni-forms-item>
  73. <view class="liyou">{{list.reasonApplication}}</view>
  74. <text class="textsrea-txt">{{zishunum}}</text>
  75. </view>
  76. <view class="request_remark" style="height: 100%;">
  77. <view class="submit-start" style="color: rgba(0, 0, 0, 1);">附件:</view>
  78. <view class="submit-start" style="color: rgba(0, 0, 0, 1);">
  79. <!-- {{item.imageUrl!=null&&item.imageUrl!=''}}3{{(item.imageUrl).split(',')}} -->
  80. <text v-if="list.imageUrl!=null&&list.imageUrl!=''">
  81. <image @click.stop="clickImg2(item2)" style="color: rgba(0, 97, 255, 1);width: 200rpx;height: 200rpx;margin-left: 20rpx;" :src="item2" v-for="(item2,index2) in (list.imageUrl).split(',')" :key="index2">
  82. </image>
  83. </text>
  84. </view>
  85. </view>
  86. <!-- 审批记录 -->
  87. <view class="request_list" v-if="list.status==0 || list.status==3">
  88. <view class="list_title">审批记录</view>
  89. <!-- 几级审批 -->
  90. <view style="position: absolute;margin-top: 110rpx;background: rgba(255, 255, 255, 1);height: 30%;">
  91. <view>
  92. <image class="item_image"></image>
  93. <view class="item_title">提交申请</view>
  94. <view class="item_name">{{list.usersName}}</view>
  95. <view class="item_time">{{list.submissionTime}}</view>
  96. <view class="item_line" v-if="list.approverName || list.secondaryApproverName"></view>
  97. </view>
  98. <view v-if="list.secondaryApproverName">
  99. <image class="item_image"></image>
  100. <view class="item_title">{{list.secondaryExamineAndApproveRemark}}</view>
  101. <view class="item_name">{{list.secondaryApproverName}}</view>
  102. <view class="item_time">{{list.secondaryExamineAndApproveTime}}</view>
  103. <view class="item_line" v-if="list.approverName"></view>
  104. </view>
  105. <view v-if="list.approverName">
  106. <image class="item_image"></image>
  107. <view class="item_title">{{list.examineAndApproveRemark}}</view>
  108. <view class="item_name">{{list.approverName}}</view>
  109. <view class="item_time">{{list.examineAndApproveTime}}</view>
  110. </view>
  111. </view>
  112. </view>
  113. <!-- 审批意见 -->
  114. <view class="option_title" v-if="list.status==1 || list.status==2">审批意见</view>
  115. <view class="request_list" v-if="list.status==1 || list.status==2">
  116. <uni-easyinput type="textarea" v-model="option" placeholder="请输入审批意见" @input="input"></uni-easyinput>
  117. <text class="textsrea-txt" style="">{{textNum}}/800</text>
  118. </view>
  119. <view class="submit-disagree" v-if="list.status==1 || list.status==2" @click="disagree()">驳回</view>
  120. <view class="submit-agree" v-if="list.status==1 || list.status==2" @click="agree()">同意</view>
  121. </view>
  122. </template>
  123. <script>
  124. import {
  125. shenpiLinshi,
  126. shenpiTeacher,
  127. getlistXiang
  128. } from '../../../utils/api_hotel.js'
  129. export default {
  130. data() {
  131. return {
  132. list:[],
  133. id:'',
  134. department:'',//身份
  135. zishunum:0,
  136. textNum:0,
  137. option:'',
  138. agreestatu:'',
  139. }
  140. },
  141. onLoad(option) {
  142. this.id=option.id
  143. this.department=option.department
  144. this.getXiang()
  145. },
  146. mounted() {
  147. },
  148. methods: {
  149. //点击放大图片
  150. clickImg2(item2) {
  151. // console.log(item.srcUrl)
  152. uni.previewImage({
  153. urls: [item2], //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了
  154. current: '', // 当前显示图片的http链接,默认是第一个
  155. success: function(res) {},
  156. fail: function(res) {},
  157. complete: function(res) {},
  158. })
  159. },
  160. //输入审批意见
  161. input(e){
  162. this.option=e
  163. this.textNum=e.length
  164. },
  165. //详情
  166. getXiang(){
  167. let _self = this
  168. // adminMenuId身份类型,4为教职工,7为临时人员localStorage.getItem('department')
  169. // 状态,0:已拒绝,1:待审批,2:处理中,3:已同意
  170. var data="?department="+_self.department+"&id="+_self.id
  171. getlistXiang(data).then((res) => {
  172. if (res.success) {
  173. _self.list=res.data
  174. _self.zishunum=res.data.reasonApplication.length
  175. return;
  176. } else {
  177. uni.showToast({
  178. title: '获取记录详情失败'
  179. })
  180. }
  181. }).catch((err) => {
  182. uni.showToast({
  183. title: err.message
  184. })
  185. });
  186. },
  187. //驳回
  188. disagree(){
  189. this.agreestatu='0'
  190. if(this.department=='7'){
  191. this.shenpiLinshi()
  192. }else if(this.department=='4'){
  193. this.shenpiTeacher()
  194. }
  195. },
  196. //同意
  197. agree(){
  198. this.agreestatu='1'
  199. if(this.department=='7'){
  200. this.shenpiLinshi()
  201. }else if(this.department=='4'){
  202. this.shenpiTeacher()
  203. }
  204. },
  205. // 审批临时人员
  206. shenpiLinshi(){
  207. let _self = this
  208. this.$axios.defaults.headers.common['token'] = localStorage.getItem('token');
  209. this.$axios.defaults.headers.common['request_token'] = this.submitToken;
  210. this.$axios.defaults.headers.common['Content-Type'] ='application/json'
  211. var data={
  212. "id": _self.id, //审批表id
  213. "adminMenuId": localStorage.getItem('adminMenuId'),//
  214. "status": _self.agreestatu, //审批状态 1:同意 0:拒绝
  215. "adminId": localStorage.getItem('adminId'),//管理端id
  216. "remark": _self.option ,//审批备注
  217. }
  218. shenpiLinshi(data).then((res) => {
  219. if (res.success) {
  220. uni.showToast({
  221. title: '审批成功',
  222. icon: 'success',
  223. duration: 1500
  224. })
  225. setTimeout(function(){
  226. _self.getXiang()
  227. },1500);
  228. } else {
  229. uni.showToast({
  230. title: res.message,
  231. duration: 1500
  232. })
  233. }
  234. }).catch((err) => {
  235. uni.showToast({
  236. title: err.message
  237. })
  238. });
  239. },
  240. // 审批教师换课
  241. shenpiTeacher(){
  242. let _self = this
  243. this.$axios.defaults.headers.common['token'] = localStorage.getItem('token');
  244. this.$axios.defaults.headers.common['request_token'] = this.submitToken;
  245. this.$axios.defaults.headers.common['Content-Type'] ='application/json'
  246. var data={
  247. "id": _self.id, //审批表id
  248. "adminMenuId": localStorage.getItem('adminMenuId'),//1管理员,0不是管理员
  249. "status": _self.agreestatu, //审批状态 1:同意 0:拒绝
  250. "adminId": localStorage.getItem('adminId'),//管理端id
  251. "remark": _self.option ,//审批备注
  252. }
  253. shenpiTeacher(data).then((res) => {
  254. if (res.success) {
  255. uni.showToast({
  256. title: '审批成功',
  257. icon: 'success',
  258. duration: 1500
  259. })
  260. setTimeout(function(){
  261. _self.getXiang()
  262. },1500);
  263. } else {
  264. uni.showToast({
  265. title: res.message,
  266. duration: 1500
  267. })
  268. }
  269. }).catch((err) => {
  270. uni.showToast({
  271. title: err.message
  272. })
  273. });
  274. },
  275. }
  276. }
  277. </script>
  278. <style>
  279. @import url("./teach_detail.css");
  280. </style>