

<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="dtCD">
          <el-input v-model="form.model.dtCD" clearable />
        </el-form-item>

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

        <el-form-item label="终端编码：" prop="inCD">
          <el-input v-model="form.model.inCD" clearable />
        </el-form-item>

        <el-form-item label="终端名称：" prop="inNm">
          <el-input v-model="form.model.inNm" clearable />
        </el-form-item>

        <el-form-item label="产品编码：" prop="productCD">
          <el-input v-model="form.model.productCD" clearable />
        </el-form-item>

        <el-form-item label="产品名称：" prop="productNm">
          <el-input v-model="form.model.productNm" clearable />
        </el-form-item>

        <el-form-item label="结账年月：" prop="date">
          <!-- <el-input v-model="form.model.date" clearable /> -->
          <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="count">
          <el-input v-model="form.model.count" clearable />
        </el-form-item>

        <el-form-item label="促销码：" prop="erpItemNumber">
          <el-input v-model="form.model.erpItemNumber" clearable />
        </el-form-item>

        <el-form-item label="促销码说明：" prop="erpItemDesc">
          <el-input v-model="form.model.erpItemDesc" clearable />
        </el-form-item>
        <!-- 
        <el-form-item label="销量类型：" prop="saleType">
          <el-input v-model="form.model.saleType" clearable />
        </el-form-item> -->

        <el-form-item label="销量类型：" prop="saleType">
          <nm-select v-model="form.model.saleType" v-bind="select" clearable />
        </el-form-item>

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

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

export default {
  mixins: [mixins.formSave],
  data() {
    return {
      title: '进销存月度核销结账模板-协议终端核销用',
      actions: { add, edit, update },
      form: {
        model: {
          /** 经销商编码 */
          dtCD: '',

          /** 经销商名称 */
          dtNm: '',

          /** 终端编码 */
          inCD: '',

          /** 终端名称 */
          inNm: '',

          /** 产品编码 */
          productCD: '',

          /** 产品名称 */
          productNm: '',

          /** 结账年月(6位数字) */
          date: '',

          /** 出库总销量 */
          count: '',

          /** 促销码 */
          erpItemNumber: '',

          /** 促销码说明 */
          erpItemDesc: '',

          /** 销量类型 */
          saleType: '',
        },
        rules: {},
      },
      select: {
        method: this.queryOptions,
      },
    }
  },
  methods: {
    //状态选择
    queryOptions() {
      return new Promise((resolve) => {
        resolve([
          {
            label: '全部',
            value: '-1',
          },
          {
            label: '正常销量',
            value: 0,
          },
          {
            label: '赠酒',
            value: 1,
          },
        ])
      })
    },
  },
}
</script>
