Waitsent.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. <template>
  2. <div class="container">
  3. <div style="display: flex; justify-content: space-between; background-color: #fff;">
  4. <van-search style="width: 100%;" v-model="search" placeholder="请输入批次号" />
  5. <van-icon @click="onSearch" size="20" style="margin: 19px 8px 0 0px;" name="search" />
  6. </div>
  7. <div class="batch">
  8. <div class="batch-top">
  9. <div style="font-size: 16px;">批次号:<span style="font-size: 16px;">ff123</span></div>
  10. <div class="jindu">派送进度 10/15</div>
  11. </div>
  12. <!-- 各个运单 -->
  13. <div class="batchss" :style="batchssStyle">
  14. <div class="batch-middel">
  15. <div class="batch-middel-text">
  16. <div class="batch-middel-text-style">【xx】运单号:xxxxx</div>
  17. <div class="batch-middel-text-style">收件人:xxx</div>
  18. <div class="batch-middel-text-style">部门:</div>
  19. <div class="batch-middel-text-style">楼层:</div>
  20. <div class="batch-middel-text-style">座位号:</div>
  21. <div style="display: flex;" class="batch-middel-text-style">联系方式:138XXXX1234 <van-button
  22. style="margin-top: -5px; border-radius: 6px;" type="info" plain
  23. size="mini">拨打</van-button>
  24. </div>
  25. </div>
  26. <div style="display: flex; justify-content:space-around; padding-top: 5px;">
  27. <van-button style="width: 100px; border-radius: 6px;" size="small" plain type="info"
  28. @click="onReceiving">签收
  29. </van-button>
  30. <van-button style="width: 100px; border-radius: 6px;" size="small" plain type="danger"
  31. @click="onSureRetention">设为滞留</van-button>
  32. </div>
  33. </div>
  34. <div class="batch-middel">
  35. <div class="batch-middel-text">
  36. <div class="batch-middel-text-style">【xx】运单号:xxxxx</div>
  37. <div class="batch-middel-text-style">收件人:xxx</div>
  38. <div class="batch-middel-text-style">部门:</div>
  39. <div class="batch-middel-text-style">楼层:</div>
  40. <div class="batch-middel-text-style">座位号:</div>
  41. <div style="display: flex;" class="batch-middel-text-style">联系方式:138XXXX1234 <van-button
  42. style="margin-top: -5px; border-radius: 6px;" type="info" plain
  43. size="mini">拨打</van-button>
  44. </div>
  45. </div>
  46. <div style="display: flex; justify-content:space-around; padding-top: 5px;">
  47. <van-button style="width: 100px; border-radius: 6px;" size="small" plain type="info"
  48. @click="onReceiving">签收
  49. </van-button>
  50. <van-button style="width: 100px; border-radius: 6px;" size="small" plain type="danger"
  51. @click="onSureRetention">设为滞留</van-button>
  52. </div>
  53. </div>
  54. </div>
  55. <div @click="onUnfold" class="batch-bottom">
  56. 展开.....
  57. </div>
  58. <!-- 签收 -->
  59. <van-popup v-model="receiving" style="width: 100%; height: 85%;">
  60. <div style="font-size: 20px; text-align: center; ">派件签收</div>
  61. <van-form @submit="onSubmit">
  62. <van-field label="运单号" value="xxx" readonly />
  63. <van-field label="快件类型" value="xxx" readonly />
  64. <van-field label="快递公司" value="xxx" readonly />
  65. <van-field label="部门" value="xxx" readonly />
  66. <van-field label="座位号" value="xxx" readonly />
  67. <van-field label="收件人" value="xxx" readonly />
  68. <van-field label="楼层" value="xxx" readonly />
  69. <van-field label="联系方式" value="xxx" readonly />
  70. <van-field readonly clickable name="picker" :value="selectedOption" label="签收类型"
  71. placeholder="点击签收类型" @click="showPicker = true" />
  72. <van-popup v-model="showPicker" position="bottom">
  73. <van-picker show-toolbar :columns="options" @confirm="onConfirm" @cancel="showPicker = false" />
  74. </van-popup>
  75. <van-field v-if="wer == '他人签收'" v-model="qwe" :rules="[{ required: true }]" label="代取手机号"
  76. placeholder="请输入代取手机号" />
  77. <van-field name="uploader" label="签收照片">
  78. <template #input>
  79. <van-uploader v-model="uploader" />
  80. </template>
  81. </van-field>
  82. <div style="margin: 16px;">
  83. <van-button round block type="info" native-type="submit">签收完成</van-button>
  84. </div>
  85. </van-form>
  86. </van-popup>
  87. <!-- 设为滞留 -->
  88. <van-popup v-model="retention" style="width: 100%; height: 75%;">
  89. <div style="font-size: 20px; text-align: center; ">派件滞留</div>
  90. <van-form @submit="onSubmit">
  91. <van-field label="运单号" value="xxx" readonly />
  92. <van-field label="快件类型" value="xxx" readonly />
  93. <van-field label="快递公司" value="xxx" readonly />
  94. <van-field label="部门" value="xxx" readonly />
  95. <van-field label="座位号" value="xxx" readonly />
  96. <van-field label="收件人" value="xxx" readonly />
  97. <van-field label="楼层" value="xxx" readonly />
  98. <van-field label="联系方式" value="xxx" readonly />
  99. <van-field readonly clickable name="picker" :value="selectedRetention" label="滞留原因"
  100. placeholder="点击签收类型" @click="showRetention = true" />
  101. <van-popup v-model="showRetention" position="bottom">
  102. <van-picker show-toolbar :columns="Retention" @confirm="onRetention"
  103. @cancel="showRetention = false" />
  104. </van-popup>
  105. <van-field v-if="ert == '其他原因'" v-model="qwe" label="其他原因" :rules="[{ required: true }]"
  106. placeholder="请输入其他原因" />
  107. <div style="margin: 16px;">
  108. <van-button round block native-type="submit" type="danger">设为滞留</van-button>
  109. </div>
  110. </van-form>
  111. </van-popup>
  112. </div>
  113. </div>
  114. </template>
  115. <script>
  116. import { appOutboundInquiry } from '@/api/index'
  117. export default {
  118. name: 'waitsent',
  119. data() {
  120. return {
  121. shouldHideOverflow: true,
  122. qwe: '',
  123. search: 'SF202303221917',
  124. receiving: false,//签收
  125. retention: false,//滞留
  126. selectedOption: '', // 设置为空字符串,等待选择
  127. selectedRetention: '',
  128. value: '',
  129. options: ['本人签收', '他人签收'],
  130. Retention: ['无法联系收件人', '其他原因'],
  131. showPicker: false,
  132. showRetention: false,
  133. wer: '',
  134. ert: '',
  135. uploader: [{ url: 'https://img01.yzcdn.cn/vant/leaf.jpg' }],
  136. };
  137. },
  138. methods: {
  139. // 搜索批次号
  140. async onSearch() {
  141. console.log('111')
  142. let parmas = {
  143. dispatchBatchNo: this.search, // 批次号
  144. deliveryPeopleId: localStorage.getItem('courierId'), //派送员id
  145. isFinish: '2',//完成 1已完成 2未完成
  146. page: '1',
  147. limit: '1',
  148. }
  149. const res = await appOutboundInquiry({ ...parmas }, { emulateJSON: true })
  150. console.log(res, 'res==============')
  151. },
  152. // 签收
  153. onReceiving() {
  154. this.receiving = true;
  155. this.selectedOption = this.options[0];
  156. },
  157. // 滞留
  158. onSureRetention() {
  159. this.retention = true;
  160. },
  161. onConfirm(value) {
  162. this.selectedOption = value;
  163. this.showPicker = false;
  164. this.wer = value
  165. },
  166. onRetention(value) {
  167. this.selectedRetention = value;
  168. this.showRetention = false;
  169. this.ert = value
  170. },
  171. // 签收完成
  172. onSubmit() {
  173. },
  174. // 展开
  175. onUnfold() {
  176. this.shouldHideOverflow = !this.shouldHideOverflow;
  177. console.log(this.shouldHideOverflow, '44')
  178. }
  179. },
  180. mounted() {
  181. this.selectedOption = this.options[0]; // 默认选择第一个选项
  182. },
  183. computed: {
  184. batchssStyle() {
  185. return {
  186. overflow: this.shouldHideOverflow ? 'hidden' : 'auto',
  187. height: this.shouldHideOverflow ? '130px' : 'auto',
  188. }
  189. }
  190. }
  191. };
  192. </script>
  193. <style lang="less" scoped>
  194. * {
  195. font-size: 12px;
  196. }
  197. .batchss {
  198. height: 130px;
  199. // overflow: hidden;
  200. }
  201. .batch {
  202. background-color: #fff;
  203. margin: 10px;
  204. &-top {
  205. display: flex;
  206. justify-content: space-between;
  207. align-items: center;
  208. padding: 10px 0 6px 0;
  209. .jindu {
  210. color: #169bd5
  211. }
  212. }
  213. &-middel {
  214. height: 120px;
  215. background-color: #f2f2f2;
  216. border-radius: 12px;
  217. margin: 10px 6px;
  218. &-text {
  219. display: flex;
  220. flex-wrap: wrap;
  221. &-style {
  222. width: 165px;
  223. margin-top: 10px;
  224. }
  225. }
  226. }
  227. &-bottom {
  228. padding: 10px 4px;
  229. color: #169bd5;
  230. }
  231. }
  232. </style>