<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.propertyType" label="属性类型" :rules="form.rules.propertyTypeRules"></v-text-field>

    <v-text-field v-model="form.model.propertyValue" label="属性值" :rules="form.rules.propertyValueRules"></v-text-field>

    <v-text-field v-model="form.model.propertyUomNId" label="属性单位编码" :rules="form.rules.propertyUomNIdRules"></v-text-field>

    <v-text-field v-model="form.model.materialLot" label="物料批次" :rules="form.rules.materialLotRules"></v-text-field>
  </nm-form-vuetify-drawer>
</template>
<script>
import { mixins } from 'xmanager-ui'
const { add, edit, update } = $api.materialApp.materialLotProperty

export default {
  mixins: [mixins.formSave],
  data() {
    return {
      title: '物料批次属性',
      actions: { add, edit, update },
      parent: this,
      form: {
        model: {
          /** 编码 */
          nId: '',
          /** 属性类型 */
          propertyType: '',
          /** 属性值 */
          propertyValue: '',
          /** 属性单位编码 */
          propertyUomNId: '',
          /** 物料批次 */
          materialLot: '',
          /** 是否冻结 */
          isFrozen: false,
          /** 是否锁定 */
          isLocked: false
        },
        rules: {
          nIdRules: [v => !!v || '编码 is required'],
          propertyTypeRules: [],
          propertyValueRules: [],
          propertyUomNIdRules: [],
          materialLotRules: [],
          isFrozenRules: [],
          isLockedRules: []
        }
      }
    }
  }
}
</script>
