
<template>
  <nm-form-dialog ref="form" v-bind="form" v-on="on" :visible.sync="visible_">
    <el-row>
      <el-col :span="20" :offset="1">

        <el-form-item label="经销商名称：" prop="storeId">
          <el-input v-model="form.model.storeId" clearable />
        </el-form-item>

        <el-form-item label="经销商编码：" prop="storeCode">
          <el-input v-model="form.model.storeCode" clearable />
        </el-form-item>

        <el-form-item label="政策名称：" prop="name">
          <el-input v-model="form.model.name" clearable />
        </el-form-item>

        <el-form-item label="开始时间：" prop="startDate">
          <el-date-picker v-model="form.model.startDate" type="date" placeholder="6位数字" value-format="yyyyMMdd"></el-date-picker>
        </el-form-item>

        <el-form-item label="结束时间：" prop="endDate">
          <el-date-picker v-model="form.model.endDate" type="date" placeholder="6位数字" value-format="yyyyMMdd"></el-date-picker>
        </el-form-item>

        <el-form-item label="最大终端数：" prop="maxTerminal">
          <el-input v-model="form.model.maxTerminal" clearable />
        </el-form-item>

        <el-form-item label="TPM编码：" prop="tpmNumber">
          <el-input v-model="form.model.tpmNumber" clearable />
        </el-form-item>

      </el-col>
    </el-row>
  </nm-form-dialog>
</template>
<script>
import { mixins } from 'dcms-ui'

const { add, edit, update } = $api.tPM.awardPolicy

export default {
  mixins: [mixins.formSave],
  data() {
    return {
      title: '渠道政策关系',
      actions: { add, edit, update },
      form: {
        model: {
          StoreId: '',
          StoreCode: '',
          Name: '',
          StartDate: '',
          EndDate: '',
          MaxTerminal: '',
          TPMNumber: '',
        },
        rules: {},
      },
      select: {
        method: this.queryOptions,
      },
    }
  },
  methods: {
    //状态选择
    queryOptions() {
      return new Promise((resolve) => {
        resolve([
          {
            label: '全部',
            value: '-1',
          },
          {
            label: '正常销量',
            value: 0,
          },
          {
            label: '赠酒',
            value: 1,
          },
        ])
      })
    },
  },
}
</script>
