|
@@ -62,7 +62,7 @@
|
|
|
<el-button v-if="row.enable == 0" type="danger" size="mini" @click="handleDisable(row)">停用</el-button>
|
|
|
<el-button v-else type="danger" size="mini" @click="handleDisable(row)">启用</el-button>
|
|
|
<el-button v-if="row.enable == 1" type="danger" size="mini" @click="form_delete(row)">删除</el-button>
|
|
|
- <el-button type="warning" size="mini" @click="handleHistory(row)">历史数据</el-button>
|
|
|
+ <!-- <el-button type="warning" size="mini" @click="handleHistory(row)">历史数据</el-button> -->
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -249,7 +249,7 @@
|
|
|
<el-row >
|
|
|
<el-col :span="10">
|
|
|
<el-form-item label="日期:" prop="dateFormat" >
|
|
|
- <el-date-picker ref="inputDatetime" style="width: 280px;" v-model="getdataHistory.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
|
|
|
+ <el-date-picker ref="date" style="width: 280px;" v-model="getdataHistory.parammaps.date" class="date" type="month" format="yyyy-MM" value-format="yyyy-MM"/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<!-- <el-col :span="8">
|
|
@@ -382,7 +382,7 @@ export default {
|
|
|
selTime: '',
|
|
|
pastureName: Cookies.get('pasturename'),
|
|
|
departName: '',
|
|
|
- inputDatetime:['','']
|
|
|
+ date:''
|
|
|
}
|
|
|
},
|
|
|
myHeight:document.documentElement.clientHeight - 85- 200,
|
|
@@ -521,26 +521,18 @@ export default {
|
|
|
searchHistory() {
|
|
|
this.listLoading = true
|
|
|
this.getdataHistory.offset = 1
|
|
|
- if (this.getdataHistory.parammaps.inputDatetime.length < 1) {
|
|
|
- this.c.parammaps.inputDatetime = ''
|
|
|
- this.getdataHistory.parammaps.startTime = ''
|
|
|
- this.getdataHistory.parammaps.stopTime = ''
|
|
|
- } else {
|
|
|
- this.getdataHistory.parammaps.startTime = parseTime(this.getdataHistory.parammaps.inputDatetime[0], '{y}-{m}-{d}')
|
|
|
- this.getdataHistory.parammaps.stopTime = parseTime(this.getdataHistory.parammaps.inputDatetime[1], '{y}-{m}-{d}')
|
|
|
- }
|
|
|
this.getHistory();
|
|
|
},
|
|
|
+ formatDate(date) {
|
|
|
+ const year = date.getFullYear();
|
|
|
+ const month = ('0' + (date.getMonth() + 1)).slice(-2);
|
|
|
+ return `${year}-${month}`;
|
|
|
+ },
|
|
|
+
|
|
|
// 查查看历史数据
|
|
|
handleHistory(row) {
|
|
|
this.historyVisible = true;
|
|
|
- const start = new Date()
|
|
|
- const end = new Date()
|
|
|
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
|
|
|
- this.getdataHistory.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
|
|
|
- this.getdataHistory.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
|
|
|
- this.getdataHistory.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
|
|
|
- this.getdataHistory.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
|
|
|
+ this.getdataHistory.parammaps.date = this.formatDate(new Date());
|
|
|
this.getdataHistory.parammaps.cardNumber = row.cardNumber;
|
|
|
this.getdataHistory.parammaps.id = row.id;
|
|
|
this.getHistory();
|
|
@@ -661,7 +653,7 @@ export default {
|
|
|
row.status = status
|
|
|
},
|
|
|
form_reset() {
|
|
|
- this.temp = { inputDatetime: parseTime(new Date(), '{y}-{m}-{d}'), dateFormat: parseTime(new Date(), '{y}-{m}-{d}'), assetName: '', assetId: '', deptName: '', pastureName: '', pastureId: Cookies.get('pastureid'), cardNumber: '', cardType: '内部', cardAmount: '', rechargeNum: '' }
|
|
|
+ this.temp = { date: parseTime(new Date(), '{y}-{m}-{d}'), dateFormat: parseTime(new Date(), '{y}-{m}-{d}'), assetName: '', assetId: '', deptName: '', pastureName: '', pastureId: Cookies.get('pastureid'), cardNumber: '', cardType: '内部', cardAmount: '', rechargeNum: '' }
|
|
|
},
|
|
|
form_add() {
|
|
|
this.form_reset()
|
|
@@ -704,7 +696,7 @@ export default {
|
|
|
dateFormat: this.temp.dateFormat,
|
|
|
departmentId: this.temp.departmentId,
|
|
|
deptName: this.temp.departmentName,
|
|
|
- inputDatetime: this.temp.inputDatetime,
|
|
|
+ date: this.temp.date,
|
|
|
pastureId: this.temp.pastureId,
|
|
|
pastureName: this.temp.pastureName,
|
|
|
rechargeNum: this.temp.rechargeNum
|
|
@@ -765,7 +757,7 @@ export default {
|
|
|
dateFormat: this.temp.dateFormat,
|
|
|
departmentId: this.temp.departmentId,
|
|
|
deptName: this.temp.departmentName,
|
|
|
- inputDatetime: this.temp.inputDatetime,
|
|
|
+ date: this.temp.date,
|
|
|
pastureId: this.temp.pastureId,
|
|
|
pastureName: this.temp.pastureName,
|
|
|
rechargeNum: this.temp.rechargeNum
|