<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.fmSku"
              :textField.sync="formData.fmSkuName">
              </PublicQuery>
            </el-form-item>
            <el-form-item
              label="目标商品"
              prop="skuName">
              <PublicQuery
              title="目标商品"
              baseUrl="/rep_web/repweb"
              cfgKey="repWmsSku"
              :valueField.sync="formData.toSku"
              :textField.sync="formData.toSkuName">
              </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="20" label="移动中"></el-option>
                <el-option value="30" label="部分移动"></el-option>
                <el-option value="40" 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="tfNo">
              <el-input v-model="formData.tfNo"></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="50910060103" type="primary" @click="submitForm">查询</el-button>
            <el-button v-auth="50910060104" @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.fromtfTime = val ? val[0] : ''
      this.formData.totfTime = val ? val[1] : ''
    },

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

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

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

  }
}
</script>
