<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> -->
    <nm-auto-generateid v-model="form.model.nId" :value="form.model.nId" :disabled="this.isEdit_" DataBaseName="XManager_WorkOrder" EntityName="WorkMaster"></nm-auto-generateid>

    <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-checkbox v-model="form.model.isDefault" label="是否默认" :rules="form.rules.isDefaultRules"> </v-checkbox>
    <!-- <nm-unit-combobox v-model="form.model.uoMNId" :unitDataRules="form.rules.uoMNIdRules"></nm-unit-combobox> -->
    <nm-unit-combobox v-model="form.model.uoMNId" :model="form.model.uoMNId" :unitDataRules="form.rules.uoMNIdRules"></nm-unit-combobox>
  </nm-form-vuetify-drawer>
</template>
<script>
import { mixins } from 'xmanager-ui'
const { add, edit, update } = $api.materialApp.materialTemplate
// const api = $api.materialApp.materialTemplate

export default {
  mixins: [mixins.formSave],
  data() {
    return {
      uomData: [],
      returnObject: false,
      isMultiple: false,
      title: '物料模板',
      actions: { add, edit, update },
      parent: this,
      form: {
        model: {
          /** 关联id */
          nId: '',
          /** 名称 */
          name: '',
          /** 描述 */
          description: '',
          /** 是否默认 */
          isDefault: false,
          /** 物料单位id */
          uoMNId: ''
        },
        rules: {
          nIdRules: [v => !!v || '关联id is required'],
          nameRules: [],
          descriptionRules: [],
          uoMNIdRules: [v => !!v || '物料单位 is required']
        }
      },
      unitData: []
    }
  },
  methods: {},
  mounted() {}
}
</script>
