helpPeople.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  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. .search {
  143. display: flex;
  144. align-items: center;
  145. margin: 30rpx auto 30rpx;
  146. width: 690rpx;
  147. height: 80rpx;
  148. border-radius: 4rpx;
  149. background-color: #f2f2f2;
  150. img {
  151. margin: 0 20rpx;
  152. width: 40rpx;
  153. height: 40rpx;
  154. }
  155. input {
  156. flex: 1;
  157. padding: 10rpx;
  158. }
  159. }
  160. .body {
  161. height: 810rpx;
  162. border-top: 1rpx solid #e5e5e5;
  163. overflow-y: auto;
  164. .body_item {
  165. display: flex;
  166. align-items: center;
  167. padding: 0 30rpx;
  168. height: 162rpx;
  169. border-bottom: 1rpx solid #e5e5e5;
  170. img {
  171. margin: 0 24rpx 0 27rpx;
  172. width: 82rpx;
  173. height: 82rpx;
  174. border-radius: 50%;
  175. }
  176. .item_info {
  177. display: flex;
  178. flex-direction: column;
  179. .info_msg {
  180. display: flex;
  181. align-items: center;
  182. font-size: 32rpx;
  183. font-weight: bold;
  184. .msg_work {
  185. display: flex;
  186. justify-content: center;
  187. align-items: center;
  188. margin-left: 13rpx;
  189. padding: 0 10rpx;
  190. height: 32rpx;
  191. color: #6fb6b8;
  192. font-size: 24rpx;
  193. font-weight: 400;
  194. border-radius: 7rpx;
  195. border: 1rpx solid #6fb6b8;
  196. }
  197. }
  198. .info_phone {
  199. margin-top: 10rpx;
  200. color: #808080;
  201. font-size: 28rpx;
  202. }
  203. }
  204. .item_type {
  205. margin-left: auto;
  206. font-size: 24rpx;
  207. }
  208. .color_type {
  209. color: #6fb6b8;
  210. }
  211. .color_type2 {
  212. color: #1e7dfb;
  213. }
  214. .color_type3 {
  215. color: #ff5733;
  216. }
  217. }
  218. }
  219. .btn {
  220. position: absolute;
  221. bottom: 66rpx;
  222. display: flex;
  223. justify-content: center;
  224. align-items: center;
  225. margin: 0 30rpx;
  226. width: 690rpx;
  227. height: 100rpx;
  228. color: #fff;
  229. font-size: 32rpx;
  230. border-radius: 12rpx;
  231. background-color: #6fb6b8;
  232. }
  233. }
  234. </style>