Search.vue 2.89 KB
Newer Older
“lixuyan”'s avatar
“lixuyan” committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
<template>
  <el-form ref="form" :inline="true" :model="form" class="demo-form-inline working-hours-summary" label-width="90px">
    <el-form-item v-if="activeName==='product'" label="关键字: ">
      <el-input v-model="form.aoName" placeholder="AO号/AO名称模糊检索" class="el-input--small" clearable="clearable" />
    </el-form-item>
    <el-form-item v-if="activeName==='temp'" label="关键字: ">
      <el-input v-model="form.keyWord" placeholder="任务编号/内容模糊查询" class="el-input--small" clearable="clearable" />
    </el-form-item>
    <el-form-item label="完成时间: ">
      <el-date-picker
        v-model="form.actualEnd"
        type="daterange"
        size="small"
        range-separator="至"
        start-placeholder="开始日期"
        end-placeholder="结束日期"
        format="yyyy-MM-dd"
        value-format="yyyy-MM-dd 00:00:00"
      />
    </el-form-item>
    <el-form-item label="工时状态: ">
      <el-select v-model="form.state" clearable placeholder="请选择工时状态" class="input-with-select el-input--small">
        <el-option
          v-for="item in workStatusOptions"
          :key="item.value"
          :label="item.label"
          :value="item.value"
        />
      </el-select>
    </el-form-item>
    <el-form-item label="是否确认: ">
      <el-select v-model="form.isConfirmCode" clearable placeholder="请选择确认状态" class="input-with-select el-input--small">
        <el-option
          label="已确认"
          value="Y"
        />
        <el-option
          label="未确认"
          value="N"
        />
      </el-select>
    </el-form-item>
    <el-form-item>
      <el-button type="primary" class="el-button--small" @click="onSubmit">查询</el-button>
      <el-button type="default " class="el-button--small" @click="resetForm">重置</el-button>
    </el-form-item>
  </el-form>
</template>
<script>
export default {
  props: {
    activeName: {
      type: String,
      default: 'product'
    }
  },
  data() {
    return {
      workStatusOptions: [
        { label: '己审核', value: 'Audited' },
        { label: '待审核', value: 'Pending_Review' },
        { label: '审核中', value: 'TF_Reviewing' }
      ],
      form: {
        keyWord: '',
        state: 'Audited', // 工时状态
        aoName: '', // 关键字
        actualEnd: '', // 结束时间,
        isConfirmCode: 'N'
      }
    }
  },
  mounted() {
    this.$emit('init', this.form)
  },
  methods: {
    // 重置
    resetForm() {
      this.form = {
        keyWord: '',
        state: '', // 工时状态
        aoName: '', // 关键字
        actualEnd: '', // 结束时间
        isConfirmCode: ''
      }
“lixuyan”'s avatar
“lixuyan” committed
86
      this.$emit('init', this.form)
“lixuyan”'s avatar
“lixuyan” committed
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
    },
    // 查询
    onSubmit() {
      this.$emit('init', this.form)
    }
  }
}
</script>

<style lang='scss'>
.working-hours-summary{
.el-form-item{
  margin-bottom: 10px!important;
}
}
</style>