<template>
  <a-form
    ref="form"
    v-bind="formItemLayout"
    :form="form"
  >
    <a-form-item label="备注信息">
      <a-input
        v-decorator="[
          'express_no',
          {
            rules: [
              { required: false, message: '请输入备注信息!', type: 'string' },
            ]
          }
        ]"
        type="textarea"
        placeholder="请输入备注信息" />

    </a-form-item>
  </a-form>
</template>

<script>
// import { setOrderDeliver } from '@/api/order'
import { getExpressCommonList } from '@/api/express'

export default {
  name: 'Deliver',
  props: {
    order: {
      type: Object,
      default: null
    }
  },
  data: () => ({
    formItemLayout: {
      labelCol: { span: 6 },
      wrapperCol: { span: 14 }
    },
    btnLabelCol: {
      offset: 6,
      span: 14
    },
    loading: false,
    expressList: []
  }),
  beforeCreate () {
    this.form = this.$form.createForm(this)
  },
  created () {
    getExpressCommonList(this.order.order_no).then(res => {
      this.expressList = res
    })
  },
  methods: {
    onOk () {
      return new Promise(resolve => {
        this.form.validateFields((errors, values) => {
          if (!errors) {
            // setOrderDeliver(this.order.order_no, values).then(() => {
            //   this.$notification.success({
            //     message: '成功',
            //     description: '发货成功'
            //   })
            //   resolve(true)
            // }).catch(() => {
            //   resolve(false)
            // })
          }
        })
      })
    }
  }
}
</script>

<style scoped>

</style>
