|
|
@@ -3,15 +3,18 @@
|
|
|
<div class="tools">
|
|
|
<span class="text-df">结转日期:</span>
|
|
|
<el-date-picker
|
|
|
+ :clearable="false"
|
|
|
v-model="date"
|
|
|
size="mini"
|
|
|
type="datetimerange"
|
|
|
- value-format="yyyy-MM-dd hh:mm:ss"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
+ :default-time="['00:00:00', '23:59:59']"
|
|
|
range-separator="至"
|
|
|
start-placeholder="开始日期"
|
|
|
end-placeholder="结束日期">
|
|
|
</el-date-picker>
|
|
|
- <el-button size="mini" type="primary" @click="search">搜索</el-button>
|
|
|
+ <el-button icon="el-icon-search" size="mini" type="primary" @click="search()">搜索</el-button>
|
|
|
+ <el-button icon="el-icon-refresh" size="mini" @click="clear()">清空</el-button>
|
|
|
<el-button size="mini" type="primary" @click="exportExcel">导出</el-button>
|
|
|
<!--<el-button size="mini" type="primary" @click="print">打印</el-button>-->
|
|
|
</div>
|
|
|
@@ -50,6 +53,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { getReport, reportExport } from '@/api/inventory/inventory'
|
|
|
+import dayjs from 'dayjs'
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
|
@@ -61,6 +65,9 @@ export default {
|
|
|
tableData: []
|
|
|
}
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ this.clear()
|
|
|
+ },
|
|
|
methods: {
|
|
|
tableRowClassName({row, rowIndex}) {
|
|
|
if (rowIndex === this.tableData.length - 1) {
|
|
|
@@ -90,6 +97,13 @@ export default {
|
|
|
search () {
|
|
|
this.page = 1
|
|
|
this.getDataList()
|
|
|
+ },
|
|
|
+ clear() {
|
|
|
+ this.date = [
|
|
|
+ dayjs().startOf('month').format('YYYY-MM-DD HH:mm:ss'),
|
|
|
+ dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss')
|
|
|
+ ];
|
|
|
+ this.search();
|
|
|
},
|
|
|
exportExcel () {
|
|
|
if (!this.date || !this.date.length) {
|