<template>
    <div>
        <el-dialog
          title="重新计算库存费用"
          :visible="againVisible"
          @close="close"
          width="66%">
          <el-form
            inline
            ref="queryForm"
            label-position="top"
            :model="formData">
            <el-form-item label="货主" prop="ownerCode">
                <PublicQuery
                title="货主"
                single
                cfgKey="chgWmsCustomer"
                baseUrl="/chg_web/chgweb"
                :valueField.sync="formData.ownerCode"></PublicQuery>
            </el-form-item>
            <el-form-item label="时间从" prop="dateFm">
                <el-date-picker
                v-model="formData.dateFm"
                type="datetime"
                format="yyyy-MM-dd HH:mm"
                value-format="yyyy-MM-dd 00:00:00"
                placeholder="选择日期时间">
              </el-date-picker>
            </el-form-item>
            <el-form-item label="时间到" prop="dateTo">
                <el-date-picker
                v-model="formData.dateTo"
                type="datetime"
                format="yyyy-MM-dd HH:mm"
                value-format="yyyy-MM-dd 00:00:00"
                placeholder="选择日期时间"
                >
              </el-date-picker>
            </el-form-item>
          </el-form>
          <div >
            <el-button v-auth="50600030103" type="primary" @click="submitForm">确定</el-button>
          </div>
        </el-dialog>
    </div>
</template>
<script>
export default {
  data () {
    return {
      formData: {},
    }
  },
  props: {
    againVisible: Boolean
  },
  methods: {

    // 关闭弹窗
    close () {
      this.$emit('close')
      this.$refs.queryForm.resetFields()
    },
    // 提交表单
    submitForm () {
      const data = { ...this.formData }
      this.$emit('againSubmit', data)
      this.$nextTick(() => {
        this.$refs.queryForm.resetFields()
      })
    },
  }
}
</script>
