inTeam.vue 6.5 KB

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