detail.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <view class="common-page" style="padding: 0;padding-bottom: 130rpx;">
  3. <InfoCard :detail="detail" type="recycle" />
  4. <TrackForm @submit="onSubmitTrack" class="mt-20" />
  5. <TrackRecord :records="records" class="mt-20" />
  6. <view class="fixed-bottom">
  7. <u-button type="warning" size="large" @click="onClaim">一键理赔</u-button>
  8. <u-button type="primary" size="large" @click="onFinish">完成</u-button>
  9. </view>
  10. </view>
  11. </template>
  12. <script setup>
  13. import { ref } from 'vue'
  14. import { onLoad } from '@dcloudio/uni-app'
  15. import InfoCard from '@/pages/order/components/info-card.vue'
  16. import TrackForm from '@/pages/order/components/track-form.vue'
  17. import TrackRecord from '@/pages/order/components/track-record.vue'
  18. const detail = ref({})
  19. const records = ref([])
  20. const getDetail = async (code) => {
  21. try {
  22. const res = await uni.$u.http.get('/app/workorder/detail', { params: { type: 'recycle', waybillCode: code } })
  23. if (res?.code === 200 && res?.data) {
  24. detail.value = res.data
  25. return
  26. }
  27. } catch (e) {}
  28. detail.value = {
  29. waybillCode: code || 'YT54454654564',
  30. orderId: '5622225',
  31. taskTypeName: '书单不符',
  32. taskTypeExt: '快速理赔',
  33. orderStatusName: '已到货-待到货审核',
  34. taskDetail: '书单不符',
  35. createUser: 'zzz',
  36. createTime: '2026-05-11 15:00:00',
  37. imageUrl: '/static/img/book.png',
  38. taskStatusName: '待处理'
  39. }
  40. records.value = [
  41. { time: '2025-02-11 16:00:00', user: 'aaa', statusText: '完成' }
  42. ]
  43. }
  44. const onSubmitTrack = (payload) => {
  45. records.value.unshift({
  46. time: uni.$u.timeFormat(new Date(), 'yyyy-mm-dd hh:MM:ss'),
  47. user: '我',
  48. content: payload.content,
  49. statusText: payload.content ? payload.content : '更新'
  50. })
  51. }
  52. const onClaim = () => {
  53. uni.$u.toast('已触发一键理赔')
  54. }
  55. const onFinish = () => {
  56. uni.$u.toast('任务已完成')
  57. }
  58. onLoad((options) => {
  59. getDetail(options.waybillCode)
  60. })
  61. </script>
  62. <style lang="scss" scoped>
  63. .mt-20 {
  64. margin-top: 20rpx;
  65. }
  66. </style>