|
|
@@ -31,23 +31,33 @@ export default {
|
|
|
deptId: {
|
|
|
type: String,
|
|
|
default: ''
|
|
|
+ },
|
|
|
+ year: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
type: {
|
|
|
- handler (val) {
|
|
|
+ handler(val) {
|
|
|
this.initOption(val)
|
|
|
},
|
|
|
immediate: true
|
|
|
},
|
|
|
deptId: {
|
|
|
- handler (val) {
|
|
|
+ handler(val) {
|
|
|
+ this.onLoad()
|
|
|
+ },
|
|
|
+ immediate: true
|
|
|
+ },
|
|
|
+ year: {
|
|
|
+ handler(val) {
|
|
|
this.onLoad()
|
|
|
},
|
|
|
immediate: true
|
|
|
}
|
|
|
},
|
|
|
- data () {
|
|
|
+ data() {
|
|
|
return {
|
|
|
month: '',
|
|
|
quarter: '',
|
|
|
@@ -95,9 +105,10 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- onLoad () {
|
|
|
+ onLoad() {
|
|
|
this.$api.invest.list({
|
|
|
deptId: this.deptId === null ? '' : this.deptId,
|
|
|
+ year: this.year === null ? '' : this.year,
|
|
|
month: this.month,
|
|
|
quarter: this.quarter
|
|
|
}).then(res => {
|
|
|
@@ -106,41 +117,41 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- initOption (res) {
|
|
|
+ initOption(res) {
|
|
|
this.month = ''
|
|
|
this.selectOption.length = 0
|
|
|
switch (res.value) {
|
|
|
case 1:
|
|
|
for (let i = 1; i <= 3; i++) {
|
|
|
- const item = { label: i + '月', value: i }
|
|
|
+ const item = {label: i + '月', value: i}
|
|
|
this.selectOption.push(item)
|
|
|
}
|
|
|
this.quarter = 1
|
|
|
break
|
|
|
case 2:
|
|
|
for (let i = 4; i <= 6; i++) {
|
|
|
- const item = { label: i + '月', value: i }
|
|
|
+ const item = {label: i + '月', value: i}
|
|
|
this.selectOption.push(item)
|
|
|
}
|
|
|
this.quarter = 2
|
|
|
break
|
|
|
case 3:
|
|
|
for (let i = 7; i <= 9; i++) {
|
|
|
- const item = { label: i + '月', value: i }
|
|
|
+ const item = {label: i + '月', value: i}
|
|
|
this.selectOption.push(item)
|
|
|
}
|
|
|
this.quarter = 3
|
|
|
break
|
|
|
case 4:
|
|
|
for (let i = 10; i <= 12; i++) {
|
|
|
- const item = { label: i + '月', value: i }
|
|
|
+ const item = {label: i + '月', value: i}
|
|
|
this.selectOption.push(item)
|
|
|
}
|
|
|
this.quarter = 4
|
|
|
break
|
|
|
default:
|
|
|
for (let i = 1; i <= 12; i++) {
|
|
|
- const item = { label: i + '月', value: i }
|
|
|
+ const item = {label: i + '月', value: i}
|
|
|
this.selectOption.push(item)
|
|
|
this.month = ''
|
|
|
this.quarter = ''
|
|
|
@@ -149,7 +160,7 @@ export default {
|
|
|
}
|
|
|
this.onLoad()
|
|
|
},
|
|
|
- changeMonth (res) {
|
|
|
+ changeMonth(res) {
|
|
|
this.month = res
|
|
|
this.onLoad()
|
|
|
}
|