selectionWorkers.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <template>
  2. <view class="z-popup">
  3. <view class="zhuangtaitubiao" style="justify-content: flex-start !important">
  4. <view class="title">接收确认</view>
  5. <view class="row">
  6. <view class="label">客户名称:</view>
  7. <view class="value">{{ detail.userName }}</view>
  8. </view>
  9. <view class="row">
  10. <view class="label">客户电话:</view>
  11. <view class="value">{{ detail.userMobile }}</view>
  12. </view>
  13. <view class="row">
  14. <view class="label">客户地址:</view>
  15. <view class="value">{{ detail.address }}</view>
  16. </view>
  17. <view class="row">
  18. <view class="label">选择小工:</view>
  19. <view class="value price">
  20. <checkbox-group @change="changeXz" style="width: 100%">
  21. <label
  22. v-for="(item, index) in workerList"
  23. :key="index"
  24. style="width: 50%; display: inline-block; margin-bottom: 20rpx"
  25. >
  26. <checkbox :value="item.workerId" :checked="item.isSelect" />{{ item.workerName }}
  27. </label>
  28. </checkbox-group>
  29. </view>
  30. </view>
  31. <view class="kakakakak">
  32. <u-button text="取消"></u-button>
  33. <view style="min-width: 30rpx" @click="quxiao"></view>
  34. <u-button type="primary" text="确认接收" @click="querenss"></u-button>
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. export default {
  41. props: {
  42. detail: {
  43. type: Object,
  44. default: () => ({})
  45. },
  46. type: {
  47. type: [String, Number],
  48. default: 0
  49. },
  50. callback: {
  51. type: Function,
  52. default: () => {}
  53. }
  54. },
  55. data() {
  56. return {
  57. workerList: [],
  58. checkboxValues: []
  59. }
  60. },
  61. mounted() {
  62. this.getBrandList()
  63. },
  64. methods: {
  65. getBrandList() {
  66. if (this?.detail?.id) {
  67. this.$api
  68. .post('/pg/order/base/slave/worker/team', {
  69. orderBaseId: this?.detail?.id
  70. })
  71. .then(res => {
  72. this.workerList = res.data
  73. })
  74. }
  75. },
  76. changeXz(v) {
  77. this.checkboxValues = v.target.value
  78. },
  79. querenss() {
  80. if (this.type == 1) {
  81. // 接单
  82. this.$modal({
  83. title: '接单确认',
  84. content: '确认接单?'
  85. })
  86. .then(() => {
  87. this.$api
  88. .post('/pg/order/base/rece', {
  89. orderBaseId: this.detail.id,
  90. workerList: this.checkboxValues.join(',')
  91. })
  92. .then(res => {
  93. this.callback?.()
  94. })
  95. })
  96. .catch(() => {})
  97. } else if (this.type == 2) {
  98. // 抢单
  99. this.$modal({
  100. title: '抢单确认',
  101. content: '确认抢单?'
  102. })
  103. .then(() => {
  104. this.$api
  105. .post('/pg/order/base/qd', {
  106. orderBaseId: this.detail.id,
  107. workerList: this.checkboxValues.join(',')
  108. })
  109. .then(res => {
  110. this.callback?.()
  111. })
  112. })
  113. .catch(() => {})
  114. } else if (this.type == 3) {
  115. // 更换
  116. this.$modal({
  117. title: '更换小工确认',
  118. content: '确认更换?'
  119. })
  120. .then(() => {
  121. this.$api
  122. .post('/pg/order/base/change/slave/worker/team', {
  123. orderBaseId: this.detail.id,
  124. workerList: this.checkboxValues.join(',')
  125. })
  126. .then(res => {
  127. this.callback?.()
  128. })
  129. })
  130. .catch(() => {})
  131. }
  132. },
  133. quxiao() {
  134. this.callback?.()
  135. }
  136. }
  137. }
  138. </script>
  139. <style scoped lang="scss">
  140. .z-popup {
  141. position: fixed;
  142. background: rgba(0, 0, 0, 0.2);
  143. width: 100%;
  144. height: 100vh;
  145. z-index: 1000000000;
  146. left: 0;
  147. right: 0;
  148. top: 0;
  149. bottom: 0;
  150. transition: top 0.5s;
  151. box-sizing: border-box;
  152. padding: 60rpx;
  153. display: flex;
  154. justify-content: center;
  155. align-items: center;
  156. .zhuangtaitubiao {
  157. width: 100%;
  158. height: auto;
  159. box-sizing: border-box;
  160. padding: 30rpx;
  161. background: #fff;
  162. border-radius: 20rpx;
  163. margin-bottom: 50rpx;
  164. display: flex;
  165. justify-content: center;
  166. align-items: center;
  167. flex-direction: column;
  168. }
  169. .title {
  170. font-size: 28rpx;
  171. font-weight: bold;
  172. align-items: left;
  173. }
  174. .row {
  175. display: flex;
  176. align-items: left;
  177. margin-top: 30rpx;
  178. width: 100%;
  179. .label {
  180. color: $sec-font;
  181. min-width: 160rpx;
  182. }
  183. .price {
  184. width: 100%;
  185. }
  186. }
  187. .kakakakak {
  188. width: 100%;
  189. height: auto;
  190. display: flex;
  191. justify-content: space-between;
  192. align-items: center;
  193. margin-top: 40rpx;
  194. }
  195. }
  196. </style>