<template>
    <div>
        <el-dialog
          title="高级查询"
          :visible="moreQueryVisible"
          @close="close"
          width="66%">
          <el-form
            inline
            ref="queryForm"
            label-position="top"
            :model="formData">
            <el-form-item
              label="货主"
              prop="ownerCode">
              <PublicQuery
              title="货主"
              baseUrl="/rep_web/repweb"
              cfgKey="repWmsCustomer"
              :valueField.sync="formData.ownerCode"
              :textField.sync="formData.ownerName">
              </PublicQuery>
            </el-form-item>
            <el-form-item
              label="商品"
              prop="skuCode">
              <PublicQuery
              title="商品"
              baseUrl="/rep_web/repweb"
              cfgKey="repWmsSku"
              :valueField.sync="formData.skuCode"
              :textField.sync="formData.skuName">
              </PublicQuery>
            </el-form-item>
            <el-form-item
              label="批次号"
              prop="lotNum">
              <el-input v-model="formData.lotNum"></el-input>
            </el-form-item>
            <el-form-item
              label="过期食品"
              prop="isExpired">
              <el-select v-model="formData.isExpired">
                <el-option label="是" value="Y"></el-option>
                 <el-option label="否" value="N"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item
              label="距离失效日期天数从"
              prop="fmExpiryDays">
              <el-input v-model="formData.fmExpiryDays"></el-input>
            </el-form-item>
            <el-form-item
              label="距离失效日期天数到"
              prop="toExpiryDays">
              <el-input v-model="formData.toExpiryDays"></el-input>
            </el-form-item>
          </el-form>
          <div class="more-query-btn">
            <el-button v-auth="50930030103" type="primary" @click="submitForm">查询</el-button>
            <el-button v-auth="50930030104" @click="resetForm('queryForm')">重置</el-button>
          </div>
        </el-dialog>
    </div>
</template>
<script>
export default {
  data () {
    return {
      formData: {}
    }
  },
  mounted () {
  },
  props: {
    moreQueryVisible: Boolean,
  },
  methods: {

    // 关闭弹窗
    close () {
      this.$emit('close')
    },

    // 提交表单
    submitForm () {
      this.$emit('toGetList', this.formData)
      this.$refs['queryForm'].resetFields()
    },

    // 重置表单
    resetForm () {
      this.$refs['queryForm'].resetFields()
    },

  }
}
</script>
