inTeam.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. <template>
  2. <view class="center">
  3. <view v-for="(item,index) in applyList" class="fleet">
  4. <u-swipe-action>
  5. <u-swipe-action-item :options="options1" :disabled="item.status == '已申请'" @click="delInfo(item)">
  6. <view class="flex">
  7. <view class="fleet_img">
  8. <u--image class="flex-end" :showLoading="true" :src="item.driverPortrait" width="60px"
  9. height="60px" shape='circle'>
  10. </u--image>
  11. </view>
  12. <view class="fleet_right flex">
  13. <view class="driver_info">
  14. <view class="driver_name">
  15. {{item.driverNickname}}
  16. </view>
  17. <view class="fleet_name">
  18. {{item.fleetName}}
  19. </view>
  20. </view>
  21. <view class="fleet_btn">
  22. <view class="fleet_invite btn1" @click="auditSubmit(item,1)" v-if="item.status =='已申请'">
  23. 拒绝
  24. </view>
  25. <view class="fleet_invite btn2" @click="auditSubmit(item,2)" v-if="item.status =='已申请'">
  26. 通过
  27. </view>
  28. <view class="btn3" v-else>{{item.status == '已加入' ? "已通过" : item.status}}</view>
  29. </view>
  30. </view>
  31. </view>
  32. </u-swipe-action-item>
  33. </u-swipe-action>
  34. <!-- <view class="fleet_img">
  35. <u--image class="flex-end" :showLoading="true" :src="item.driverPortrait" width="60px" height="60px"
  36. shape='circle'>
  37. </u--image>
  38. </view>
  39. <view class="fleet_right">
  40. <view class="flex">
  41. <view class="fleet_name">
  42. {{item.driverNickname}}
  43. </view>
  44. <view class="fleet_invite" @click="refuse(item)" v-if="item.status =='已申请'">拒绝</view>
  45. <view class="fleet_invite" @click="accept(item)" v-if="item.status =='已申请'">通过</view>
  46. <view class="fleet_invite" v-else>{{item.status == '已加入' ? "已通过" : item.status}}</view>
  47. </view>
  48. <view>
  49. {{item.fleetName}}
  50. </view>
  51. </view> -->
  52. </view>
  53. <u-modal :show="auditShow" :title="alertTitle" :closeOnClickOverlay='true' :showCancelButton='true'
  54. confirmColor='#2772FB' @confirm="confirmClick" @close="cancelClick" @cancel="cancelClick"></u-modal>
  55. <u-toast ref="uToast"></u-toast>
  56. </view>
  57. </template>
  58. <script>
  59. export default {
  60. data() {
  61. return {
  62. commonId: "",
  63. applyList: [],
  64. options1: [{
  65. text: '删除',
  66. style: {
  67. width: '145rpx',
  68. // height:'180rpx',
  69. backgroundColor: '#FE5C5C',
  70. }
  71. }],
  72. auditShow: false,
  73. alertTitle: "",
  74. btnSign: "",
  75. btnInfo: {}
  76. }
  77. },
  78. onShow() {
  79. },
  80. onLoad() {
  81. this.commonId = uni.getStorageSync("firstAuthentication").commonId
  82. this.read() //已读接口
  83. this.getList()
  84. },
  85. methods: {
  86. delInfo(item) {
  87. this.$request.baseRequest('post', '/fleetMemberInfo/api/listDelete', {
  88. id: item.id
  89. }).then(res => {
  90. if (res.code == 200) {
  91. this.$refs.uToast.show({
  92. type: 'success',
  93. message: "删除成功!",
  94. })
  95. this.getList()
  96. }
  97. })
  98. .catch(res => {
  99. uni.$u.toast(res.message);
  100. });
  101. },
  102. read() {
  103. this.$request.baseRequest('post', '/fleetMemberInfo/api/read', {
  104. commonId: this.commonId,
  105. readFlag: 1
  106. }).then(res => {})
  107. .catch(res => {
  108. uni.$u.toast(res.message);
  109. });
  110. },
  111. auditSubmit(item, num) {
  112. if (num == 1) {
  113. this.auditShow = true
  114. this.alertTitle = "确定拒绝该申请?"
  115. } else {
  116. this.auditShow = true
  117. this.alertTitle = "确定通过该申请?"
  118. }
  119. this.btnInfo = item
  120. this.btnSign = num
  121. },
  122. cancelClick() {
  123. this.auditShow = false
  124. },
  125. confirmClick() {
  126. if (this.btnSign = 1) {
  127. this.refuse()
  128. } else {
  129. this.accept()
  130. }
  131. this.auditShow = false
  132. },
  133. refuse() {
  134. this.$request.baseRequest('post', '/fleetMemberInfo/api/editFleetMemberInfo', {
  135. examineFlag: 2,
  136. id: this.btnInfo.id
  137. }).then(res => {
  138. if (res.code == 200) {
  139. this.$refs.uToast.show({
  140. type: 'success',
  141. message: "拒绝成功!",
  142. // complete() {
  143. // uni.$u.route("pages/riders/myTeam")
  144. // }
  145. })
  146. this.getList()
  147. }
  148. })
  149. .catch(res => {
  150. uni.$u.toast(res.message);
  151. });
  152. },
  153. accept(item) {
  154. this.$request.baseRequest('post', '/fleetMemberInfo/api/editFleetMemberInfo', {
  155. examineFlag: 1,
  156. id: this.btnInfo.id
  157. }).then(res => {
  158. if (res.code == 200) {
  159. this.$refs.uToast.show({
  160. type: 'success',
  161. message: "通过成功!",
  162. // complete() {
  163. // uni.$u.route("pages/riders/myTeam")
  164. // }
  165. })
  166. this.getList()
  167. }
  168. })
  169. .catch(res => {
  170. uni.$u.toast(res.message);
  171. });
  172. },
  173. getList() {
  174. this.$request.baseRequest('get', '/fleetMemberInfo/selectFleetMemberInfo', {
  175. commonId: this.commonId,
  176. flag: 1,
  177. pageSize: 10,
  178. currentPage: 1
  179. }).then(res => {
  180. if (res.code == 200) {
  181. this.applyList = res.data.records
  182. }
  183. })
  184. .catch(res => {
  185. uni.$u.toast(res.message);
  186. });
  187. }
  188. }
  189. }
  190. </script>
  191. <style lang="scss" scoped>
  192. .center {
  193. padding: 30rpx 0;
  194. }
  195. .fleet {
  196. // padding: 0 30rpx;
  197. margin: 40rpx 0;
  198. padding-bottom: 40rpx;
  199. border-bottom: 1px solid #E6E6E6;
  200. .fleet_img {
  201. width: 20%;
  202. margin-left: 30rpx;
  203. }
  204. .fleet_right {
  205. // margin-top: 20rpx;
  206. width: 80%;
  207. .driver_info {
  208. width: 50%;
  209. .driver_name {
  210. width: 50%;
  211. color: #333333;
  212. font-size: 34rpx;
  213. font-weight: 600;
  214. margin-top: 10rpx;
  215. }
  216. .fleet_name {
  217. color: #BABABA;
  218. font-size: 26rpx;
  219. margin-top: 10rpx;
  220. }
  221. }
  222. .fleet_btn {
  223. justify-content: flex-end;
  224. width: 50%;
  225. display: flex;
  226. line-height: 60rpx;
  227. margin-right: 30rpx;
  228. .fleet_invite {
  229. padding: 10rpx 30rpx;
  230. height: 60rpx;
  231. line-height: 60rpx;
  232. margin-left: 10rpx;
  233. border-radius: 35px;
  234. color: #fff;
  235. margin-top: 20rpx;
  236. }
  237. .btn1 {
  238. background-color: #FE5C5C;
  239. }
  240. .btn2 {
  241. background-color: #2772FB;
  242. }
  243. .btn3 {
  244. margin: 30rpx 70rpx 0 0;
  245. color: #BABABA;
  246. font-size: 26rpx;
  247. }
  248. }
  249. }
  250. }
  251. </style>