diff --git a/src/views/super/Ranking/Purchase.vue b/src/views/super/Ranking/Purchase.vue index 38e5687..25a0a71 100644 --- a/src/views/super/Ranking/Purchase.vue +++ b/src/views/super/Ranking/Purchase.vue @@ -31,10 +31,8 @@ - - + @@ -163,7 +161,7 @@ export default { unit_price: '', unit_num: '', cost: '', - date: '', + date: [], start_date: '', end_date: '', }, @@ -199,17 +197,24 @@ export default { this.currentPage = 1 this.getData() }, - 'form.date'(newVal) { - if (Array.isArray(newVal) && newVal.length === 2) { - this.form.start_date = this.formatDateTime(new Date(newVal[0])); - this.form.end_date = this.formatDateTime(new Date(newVal[1])); - } else { - this.form.start_date = ''; - this.form.end_date = ''; - } - } + // 'form.date'(newVal) { + // if (Array.isArray(newVal) && newVal.length === 2) { + // this.form.start_date = this.formatDateTime(new Date(newVal[0])); + // this.form.end_date = this.formatDateTime(new Date(newVal[1])); + // } else { + // this.form.start_date = ''; + // this.form.end_date = ''; + // } + // } }, methods: { + testClick(e) { + this.$nextTick(() => { + // this.$set(this.form, "date", [e[0], e[1]]); + this.$set(this.form, "start_date", e[0]); + this.$set(this.form, "end_date", e[1]); + }); + }, getData(){ if (this.type == 'purchase') { this.getPurchase() @@ -379,7 +384,7 @@ export default { this.dialogVisible = true; this.$nextTick(()=>{ this.form = { ...row }; - this.form.date = [row.start_date, row.end_date] + this.$set(this.form,'date', [row.start_date, row.end_date]) this.$forceUpdate(); }) },