<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.materialTrackingUnit" label="物料跟踪单位" :rules="form.rules.materialTrackingUnitRules"></v-text-field>
  </nm-form-vuetify-drawer>
</template>
<script>
import { mixins } from 'xmanager-ui'
const { add, edit, update } = $api.materialApp.materialTrackingUnitProperty

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