
<!-- 驳回原因用户姓名输入 -->
<template>
  <a-form
    ref="form"
    v-bind="formItemLayout"
    :form="form"
  >
    <a-form-item label="新增库存" style="padding-top:10px;">
      <a-input-number
        style="width: 100%;"
        :min="1"
        :max="10"
        v-decorator="[
          'number',
          {
            rules: [
              { required: true, message: `请填写库存!`, type: 'number' },
            ]
          }
        ]"
        :placeholder="`请填写库存!`"
      />
    </a-form-item>
    <a-form-item label="备注">
      <a-textarea
        :rows="4"
        v-decorator="[
          'remark',
          {
            rules: [
              { required: true, message: '请输入备注!', type: 'string' },
            ]
          }
        ]"
        placeholder="请输入备注!" />
    </a-form-item>
  </a-form>
</template>

<script>
import { changeStatusTwo } from '@/api/organization'
export default {
  name: 'EditRole',
  props: {
    item: {
      type: Object,
      default: () => {
          return {}
        }
    }
  },
  data: () => ({
    formItemLayout: {
      labelCol: { span: 6 },
      wrapperCol: { span: 14 }
    },
    loading: false
  }),
  beforeCreate () {
    this.form = this.$form.createForm(this)
  },
  methods: {
    onOk () {
      return new Promise(resolve => {
        this.form.validateFields((errors, values) => {
          if (!errors) {
            const params = {
              status: values.status
            }
            changeStatusTwo(this.item.order_item_id, params).then((res) => {
              this.$notification.success({
                message: '成功',
                description: '修改成功'
              })
              resolve(true)
            }).catch((err) => {
              this.$notification.error({
                message: '失败',
                description: err.message
              })
              resolve(false)
            })
          }
        })
      })
    }
  }
}
</script>

<style scoped>

</style>
