helpPeople.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. <template>
  2. <view class="container">
  3. <!-- 输入框区域 -->
  4. <view class="search">
  5. <img src="../../static/images/repairsImg/search.png" />
  6. <input type="text" placeholder="请输入搜索内容" v-model="searchValue" />
  7. </view>
  8. <!-- 协作人区域 -->
  9. <view class="body">
  10. <!-- 每一个协作人区域 -->
  11. <view class="body_item" v-for="item in list" :key="item.id" @click="change(item)">
  12. <radio color="#6FB6B8" :checked="item.checked" />
  13. <img src="../../static/images/repairsImg/photo.png" />
  14. <view class="item_info">
  15. <view class="info_msg">
  16. {{ item.name }}
  17. <view class="msg_work">{{ item.work }}</view>
  18. </view>
  19. <view class="info_phone">{{ item.phone }}</view>
  20. </view>
  21. <view class="item_type color_type" v-if="item.type === 1">接单中</view>
  22. <view class="item_type color_type2" v-if="item.type === 2">订单饱和</view>
  23. <view class="item_type color_type3" v-if="item.type === 3">停止接单</view>
  24. </view>
  25. </view>
  26. <view class="btn" v-if="checkList.length" @click="handleDispatch">确认派单</view>
  27. </view>
  28. </template>
  29. <script>
  30. export default {
  31. data() {
  32. return {
  33. // 搜索框绑定数据
  34. searchValue: '',
  35. // 协作人列表
  36. list: [
  37. {
  38. id: 1,
  39. name: '张三',
  40. phone: '13659856958',
  41. work: '电工',
  42. type: 1,
  43. checked: false
  44. },
  45. {
  46. id: 2,
  47. name: '李四',
  48. phone: '13659856958',
  49. work: '电工',
  50. type: 2,
  51. checked: false
  52. },
  53. {
  54. id: 3,
  55. name: '张三',
  56. phone: '13659856958',
  57. work: '电工',
  58. type: 3,
  59. checked: false
  60. },
  61. {
  62. id: 4,
  63. name: '张三',
  64. phone: '13659856958',
  65. work: '电工',
  66. type: 1,
  67. checked: false
  68. },
  69. {
  70. id: 5,
  71. name: '李四',
  72. phone: '13659856958',
  73. work: '电工',
  74. type: 2,
  75. checked: false
  76. },
  77. {
  78. id: 6,
  79. name: '张三',
  80. phone: '13659856958',
  81. work: '电工',
  82. type: 3,
  83. checked: false
  84. }
  85. ],
  86. // 选中列表
  87. checkList: [],
  88. type: null
  89. }
  90. },
  91. onLoad(options) {
  92. console.log(options)
  93. if (options.type) {
  94. this.type = options.type
  95. uni.setNavigationBarTitle({
  96. title: '派单'
  97. })
  98. }
  99. },
  100. methods: {
  101. // 确认派单按钮回调
  102. handleDispatch() {
  103. if (this.type) {
  104. uni.showModal({
  105. title: '提示',
  106. content: '确定把单派给此员工吗?',
  107. success: (res) => {
  108. if (res.confirm) {
  109. uni.showToast({
  110. title: '派单成功',
  111. icon: 'none'
  112. })
  113. setTimeout(() => {
  114. uni.reLaunch({
  115. url: '/pagesRepairs/box/box'
  116. })
  117. }, 1500)
  118. }
  119. }
  120. })
  121. } else {
  122. uni.$emit('addCheckList', {
  123. data: this.checkList
  124. })
  125. uni.navigateBack(1)
  126. }
  127. },
  128. // 点击每一个协作人的回调
  129. change(item) {
  130. item.checked = !item.checked
  131. let temList = []
  132. temList = this.list.filter((item) => {
  133. return item.checked
  134. })
  135. this.checkList = temList
  136. }
  137. }
  138. }
  139. </script>
  140. <style lang="scss" scoped>
  141. .container {
  142. font-size: 32rpx;
  143. .search {
  144. display: flex;
  145. align-items: center;
  146. margin: 30rpx auto 30rpx;
  147. width: 690rpx;
  148. height: 80rpx;
  149. border-radius: 4rpx;
  150. background-color: #f2f2f2;
  151. img {
  152. margin: 0 20rpx;
  153. width: 40rpx;
  154. height: 40rpx;
  155. }
  156. input {
  157. flex: 1;
  158. padding: 10rpx;
  159. }
  160. }
  161. .body {
  162. height: 810rpx;
  163. border-top: 1rpx solid #e5e5e5;
  164. overflow-y: auto;
  165. .body_item {
  166. display: flex;
  167. align-items: center;
  168. padding: 0 30rpx;
  169. height: 162rpx;
  170. border-bottom: 1rpx solid #e5e5e5;
  171. img {
  172. margin: 0 24rpx 0 27rpx;
  173. width: 82rpx;
  174. height: 82rpx;
  175. border-radius: 50%;
  176. }
  177. .item_info {
  178. display: flex;
  179. flex-direction: column;
  180. .info_msg {
  181. display: flex;
  182. align-items: center;
  183. font-size: 32rpx;
  184. font-weight: bold;
  185. .msg_work {
  186. display: flex;
  187. justify-content: center;
  188. align-items: center;
  189. margin-left: 13rpx;
  190. padding: 0 10rpx;
  191. height: 32rpx;
  192. color: #6fb6b8;
  193. font-size: 24rpx;
  194. font-weight: 400;
  195. border-radius: 7rpx;
  196. border: 1rpx solid #6fb6b8;
  197. }
  198. }
  199. .info_phone {
  200. margin-top: 10rpx;
  201. color: #808080;
  202. // font-size: 28rpx;
  203. }
  204. }
  205. .item_type {
  206. margin-left: auto;
  207. // font-size: 24rpx;
  208. }
  209. .color_type {
  210. color: #6fb6b8;
  211. }
  212. .color_type2 {
  213. color: #1e7dfb;
  214. }
  215. .color_type3 {
  216. color: #ff5733;
  217. }
  218. }
  219. }
  220. .btn {
  221. position: absolute;
  222. bottom: 66rpx;
  223. display: flex;
  224. justify-content: center;
  225. align-items: center;
  226. margin: 0 30rpx;
  227. width: 690rpx;
  228. height: 100rpx;
  229. color: #fff;
  230. font-size: 32rpx;
  231. border-radius: 12rpx;
  232. background-color: #6fb6b8;
  233. }
  234. }
  235. </style>