<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="ownerName">
              <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="skuName">
              <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="status">
              <el-select v-model="formData.status">
                <el-option value="00" label="创建"></el-option>
                <el-option value="10" label="部分调整"></el-option>
                <el-option value="20" label="完全调整"></el-option>
                <el-option value="90" label="取消"></el-option>
                <el-option value="99" label="关闭"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item
              label="调整单号"
              prop="adNo">
              <el-input v-model="formData.adNo"></el-input>
            </el-form-item>
            <el-form-item
              label="调整时间">
              <el-date-picker
                v-model="date3"
                type="datetimerange"
                format="yyyy-MM-dd HH:mm"
                value-format="yyyy-MM-dd HH:mm:ss"
                :default-time="['00:00:00', '23:59:59']"
                range-separator="至"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
                :picker-options="pickerOptions2"
                @change="getTime3">
              </el-date-picker>
            </el-form-item>
          </el-form>
          <div class="more-query-btn">
            <el-button v-auth="50910070103" type="primary" @click="submitForm">查询</el-button>
            <el-button v-auth="50910070104" @click="resetForm('queryForm')">重置</el-button>
          </div>
        </el-dialog>
    </div>
</template>
<script>
import { time } from 'apec-fe-utils'
import { today, yesterday, week, month, twoMonths, threeMonths } from '@/config/shortcuts'
export default {
  data () {
    return {
      formData: {},
      pickerOptions2: {
        shortcuts: [today, yesterday, week, month, twoMonths, threeMonths]
      },
      date3: ''
    }
  },
  mounted () {
  },
  props: {
    moreQueryVisible: Boolean,
  },
  methods: {

    getTime3 (val) {
      this.formData.frmAdTime = val ? val[0] : ''
      this.formData.toAdTime = val ? val[1] : ''
    },

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

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

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

  }
}
</script>
