DetailInfo.js 1.64 KB
import newApi from '~/packageUsedCar/api'

// packageUsedCar/pages/deliveryNote/components/DetailInfo/DetailInfo.js
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/'
Component({
  properties: {
    detail: {
      type: Object,
      value: {},
      observer: function(val) {
        if (val.deliveryOrderId) this.getDeliveryOrderOpLog()
      }
    }
  },
  data: {
    OP_TYPE: {
      1: '创建交付工单',
      2: '确认客户到店',
      3: '确认客户提车'
    },
    PAYMENT_STATUS: {
      0: '待支付',
      1: '已结清'
    },
    logList: [],
    carInfo: [
      { label: '车型名称', key: 'vehicleTitle' },
      { label: '车牌号', key: 'licensePlate' },
      { label: '车架号', key: 'vin' },
      { label: '当前位置', key: 'currentLocation', hasLine: true },
      { label: '客户姓名', key: 'buyerName' },
      { label: '联系方式', key: 'buyerContact' },
      { label: '提车地址', key: 'pickupAddress' },
      { label: '成交时间', key: 'transactionTime', hasLine: true },
      { label: '保管人姓名', key: 'custodianName' },
      { label: '车辆保管人电话', key: 'custodianPhone' },
      { label: '交付专员', key: 'handlerName' },
      { label: '交付专员电话', key: 'handlerPhone' }
    ],
    IMG_URL
  },
  methods: {
    async getDeliveryOrderOpLog() {
      const { deliveryOrderId } = this.data.detail
      try {
        const data = await newApi.getDeliveryOrderOpLog({ deliveryOrderId })
        this.setData({
          logList: data
        })
      } catch (error) {
        console.error('获取操作日志失败:', error)
      }
    }
  }
})