<template>
  <nm-form-vuetify-drawer ref="form" v-bind="form" v-on="on" :parent="parent" :title="title" placement="left" :visible.sync="visible_">
    <v-text-field v-model="form.model.nId" label="编码" :rules="form.rules.nIdRules"></v-text-field>

    <v-text-field v-model="form.model.name" label="名称" :rules="form.rules.nameRules"></v-text-field>

    <v-text-field v-model="form.model.description" label="描述" :rules="form.rules.descriptionRules"></v-text-field>

    <!-- <v-text-field v-model="form.model.materialGroupParents" label="物料组父级" :rules="form.rules.materialGroupParentsRules"></v-text-field> -->
  </nm-form-vuetify-drawer>
</template>
<script>
import { mixins } from 'xmanager-ui'
const { add, edit, update } = $api.materialApp.materialGroup

export default {
  mixins: [mixins.formSave],
  data() {
    return {
      title: '物料组',
      actions: { add, edit, update },
      parent: this,
      form: {
        model: {
          /** 编码 */
          nId: '',
          /** 名称 */
          name: '',
          /** 描述 */
          description: '',
          /** 物料组父级 */
          materialGroupParents: ''
        },
        rules: {
          nIdRules: [v => !!v || '编码 is required'],
          nameRules: [],
          descriptionRules: [],
          materialGroupParentsRules: []
        }
      }
    }
  }
}
</script>
