|
|
@@ -0,0 +1,150 @@
|
|
|
+<template>
|
|
|
+ <div class="flex flex-center">
|
|
|
+ <div class="white-bg border radius-5 picker flex flex-center">
|
|
|
+ <span class="padding">认定年份:</span>
|
|
|
+ <el-select
|
|
|
+ v-model="query.projectYear"
|
|
|
+ @change="change($event, 1)"
|
|
|
+ class="padding-right"
|
|
|
+ style="width: 50%"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in years"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div class="white-bg border radius-5 picker flex flex-center ml-10">
|
|
|
+ <span class="padding" style="width: 60px">机构:</span>
|
|
|
+ <el-select
|
|
|
+ v-model="query.deptIds"
|
|
|
+ class="padding-right"
|
|
|
+ style="width: 80%"
|
|
|
+ @change="change($event, 2)"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in depts"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.deptName"
|
|
|
+ :value="item.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ class="white-bg border radius-5 picker flex flex-center ml-10"
|
|
|
+ style="width: 520px"
|
|
|
+ >
|
|
|
+ <span class="padding" style="width: 100px">时间选择</span>
|
|
|
+ <el-select
|
|
|
+ v-model="query.timeType"
|
|
|
+ class="padding-right"
|
|
|
+ style="width: 60%"
|
|
|
+ @change="change($event, 3)"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in types"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ <el-date-picker
|
|
|
+ v-model="query.time"
|
|
|
+ type="daterange"
|
|
|
+ format="YYYY-MM-DD"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
+ @change="change($event, 4)"
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+/**
|
|
|
+ * 顶部搜索
|
|
|
+ */
|
|
|
+export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ query: {
|
|
|
+ projectYear: '',
|
|
|
+ deptIds: '',
|
|
|
+ timeType: '',
|
|
|
+ time: ''
|
|
|
+ },
|
|
|
+ years: [],
|
|
|
+ dateType: '计划(实际)入库时间',
|
|
|
+ types: [
|
|
|
+ {
|
|
|
+ label: '计划(实际)入库时间',
|
|
|
+ value: 1
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '计划(实际)开工时间',
|
|
|
+ value: 2
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ depts: []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.init()
|
|
|
+ this.deptList()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ init() {
|
|
|
+ this.query.projectYear = new Date().getFullYear()
|
|
|
+ const count = this.query.projectYear - 2017
|
|
|
+ for (let i = 0; i <= count; i++) {
|
|
|
+ this.years.push({ value: 2017 + i })
|
|
|
+ }
|
|
|
+ this.years.reverse()
|
|
|
+ },
|
|
|
+ deptList() {
|
|
|
+ this.$api.common.deptList().then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.showOrg = true
|
|
|
+ this.depts = res.data.map(e => {
|
|
|
+ e.checked = false
|
|
|
+ return e
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ change(res, type) {
|
|
|
+ if (type === 1) {
|
|
|
+ this.query.projectYear = res
|
|
|
+ } else if (type === 2) {
|
|
|
+ this.query.deptIds = res
|
|
|
+ } else if (type === 3) {
|
|
|
+ this.query.timeType = res
|
|
|
+ } else {
|
|
|
+ if (this.query.timeType === 1) {
|
|
|
+ this.query.planCommencementTime = this.query.time.join(',')
|
|
|
+ } else {
|
|
|
+ this.query.planStorageTime = this.query.time.join(',')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$bus.emit('serach', this.query)
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.picker {
|
|
|
+ width: 200px;
|
|
|
+ :deep(.el-input__wrapper) {
|
|
|
+ box-shadow: none;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|