export const setUpdateForm = (self, title, st) => {
  let 客服反馈 = [
    { name: 'ids', hidden: true },
    {
      name: 'st',
      hidden: true,
      type: 'number',
      value: st,
      label: 'st',
    },
    {
      name: 'feedbackDate',
      label: '反馈时间',
      type: 'date',
      format: 'YYYY-MM-DD HH:mm',
      required: true,
      showTime: true,
      labelCol: { span: 8 },
      wrapperCol: { span: 16 },
      value: self.moment().format('YYYY-MM-DD HH:mm'),
    },
    {
      name: 'address',
      label: '实时地点',
      type: 'input',
      //  required: true,
      value: '',
      labelCol: { span: 8 },
      wrapperCol: { span: 16 },
    },
    {
      name: 'feedbackContent',
      span: 24,
      labelCol: { span: 4 },
      wrapperCol: { span: 20 },
      value: '',
      required: true,
      label: '反馈内容',
      type: 'textarea',
    },
    {
      name: 'feedbackPicture',
      itemHeight: 'auto',
      label: '反馈图片',
      span: 24,
      labelCol: { span: 4 },
      wrapperCol: { span: 20 },
      scopedSlots: { customRender: 'photo' },
      value: '',
    },
  ]
  let 异常登记 = [
    { name: 'ids', hidden: true },
    {
      name: 'st',
      hidden: true,
      type: 'number',
      value: st,
      label: 'st',
    },
    {
      name: 'abnormalTime',
      label: '异常发生时间',
      type: 'date',
      format: 'YYYY-MM-DD HH:mm',
      required: true,
      showTime: true,
      labelCol: { span: 8 },
      wrapperCol: { span: 16 },
      value: self.moment().format('YYYY-MM-DD HH:mm'),
    },
    {
      name: 'abnormalType',
      label: '异常类型 ',
      type: 'select',
      required: true,
      get options() {
        return self.options.ABNORMAL_TYPE
        // 异常类型 ABNORMAL_TYPE   异常事件 ABNORMAL_EVENT
      },
      labelCol: { span: 8 },
      wrapperCol: { span: 16 },
    },
    {
      name: 'abnormalCase',
      label: '异常事件',
      type: 'select',
      required: true,
      labelCol: { span: 8 },
      wrapperCol: { span: 16 },
      get options() {
        return self.options.ABNORMAL_EVENT
      },
    },
    {
      name: 'customerComplain',
      label: '客户投诉',
      type: 'select',
      required: true,
      value: 1,
      labelCol: { span: 8 },
      wrapperCol: { span: 16 },
      options: [
        {
          label: '是',
          value: 1,
        },
        {
          label: '否',
          value: 0,
        },
      ],
    },
    {
      name: 'content',
      span: 24,
      labelCol: { span: 4 },
      wrapperCol: { span: 20 },
      required: true,
      label: '异常内容',
      type: 'textarea',
    },
    {
      name: 'pictureUrl',
      itemHeight: 'auto',
      label: '异常图片',
      span: 24,
      labelCol: { span: 4 },
      wrapperCol: { span: 20 },
      scopedSlots: { customRender: 'photo' },
      value: '',
    },
  ]
  return eval(title)
}

//启运登记
export const setStartShipRegisterItems = (self, st) => {
  return [
    {
      name: 'ids',
      hidden: true,
      label: 'ids',
    },
    {
      name: 'st',
      hidden: true,
      type: 'number',
      value: st,
      label: 'st',
    },
    {
      name: 'signDate',
      label: '签到时间',
      type: 'date',
      format: 'YYYY-MM-DD HH:mm',
      showTime: true,
      labelCol: { span: 8 },
      wrapperCol: { span: 16 },
      value: self.moment().format('YYYY-MM-DD HH:mm'),
    },
    {
      name: 'startShipDate',
      label: '启运时间',
      type: 'date',
      format: 'YYYY-MM-DD HH:mm',
      required: true,
      showTime: true,
      labelCol: { span: 8 },
      wrapperCol: { span: 16 },
      value: self.moment().format('YYYY-MM-DD HH:mm'),
    },
    {
      name: 'memo',
      span: 24,
      labelCol: { span: 4 },
      wrapperCol: { span: 20 },
      value: '',
      label: '备注',
      type: 'textarea',
    },
    {
      name: 'goodsPicUrl',
      itemHeight: 'auto',
      label: '货物照片',
      span: 24,
      labelCol: { span: 4 },
      wrapperCol: { span: 20 },
      scopedSlots: { customRender: 'photo' },
      value: '',
    },
  ]
}

//送达确认
export const setDeliveryForm = (self, st) => {
  return [
    { name: 'ids', hidden: true, label: 'ids' },
    {
      name: 'st',
      hidden: true,
      type: 'number',
      value: st,
      label: 'st',
    },
    {
      name: 'signDate',
      label: '签到时间',
      type: 'date',
      format: 'YYYY-MM-DD HH:mm',
      labelCol: { span: 8 },
      wrapperCol: { span: 16 },
      value: self.moment().format('YYYY-MM-DD HH:mm'),
    },
    {
      name: 'deliveryDate',
      label: '送达时间',
      type: 'date',
      format: 'YYYY-MM-DD HH:mm',
      required: true,
      labelCol: { span: 8 },
      wrapperCol: { span: 16 },
      // value: self.moment().format('YYYY-MM-DD HH:mm'),
    },
    {
      name: 'signPerson',
      label: '签收人',
      type: 'input',
      labelCol: { span: 8 },
      wrapperCol: { span: 16 },
    },
    {
      name: 'deliveryStatus',
      label: '配送状态',
      type: 'select',
      required: true,
      value: 30,
      get options() {
        return self.options.DELIVERY_STATUS
      },
      labelCol: { span: 8 },
      wrapperCol: { span: 16 },
    },
    {
      name: 'deliveryFailureReason',
      label: '配送失败原因',
      type: 'select',
      hidden: true,
      get options() {
        return self.options.DELIVERY_FAILURE_REASON
      },
      labelCol: { span: 8 },
      wrapperCol: { span: 16 },
    },
    {
      name: 'deliveryStrandedReason',
      label: '送达滞留原因',
      type: 'select',
      hidden: true,
      labelCol: { span: 8 },
      wrapperCol: { span: 16 },
      get options() {
        return self.options.DELIVERY_STRANDED_REASON
      },
    },
    {
      name: 'memo',
      span: 24,
      labelCol: { span: 4 },
      wrapperCol: { span: 20 },
      label: '备注',
      type: 'textarea',
    },
    {
      name: 'goodsPicUrl',
      itemHeight: 'auto',
      label: '货物图片',
      span: 24,
      labelCol: { span: 4 },
      wrapperCol: { span: 20 },
      scopedSlots: { customRender: 'photo' },
      value: '',
    },
    {
      name: 'returnOrderPicUrl',
      itemHeight: 'auto',
      label: '回单照片',
      span: 24,
      labelCol: { span: 4 },
      wrapperCol: { span: 20 },
      scopedSlots: { customRender: 'photo2' },
      value: '',
    },
  ]
}
