
5 changed files with 424 additions and 236 deletions
@ -1,15 +1,177 @@ |
|||
<template> |
|||
<div> |
|||
定时推送设置 |
|||
<div class="app-container"> |
|||
<div class="search"> |
|||
<el-form ref="queryParams" :inline="true" :model="dataTime" class="tab-header"> |
|||
<el-form-item label="定时时间:" > |
|||
<el-date-picker |
|||
v-model="dataTime.time" |
|||
type="date" |
|||
clearable |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择日期" |
|||
/> |
|||
</el-form-item> |
|||
<el-button |
|||
type="primary" |
|||
size="small" |
|||
icon="el-icon-refresh" |
|||
@click="captruedatas()" |
|||
>设置</el-button |
|||
> |
|||
</el-form> |
|||
</div> |
|||
<div class="listconadd" style="padding: 20px;"> |
|||
<el-table :default-sort = "{prop: 'date', order: 'descending'}" :data="tableData" border style="width: 100%" > |
|||
<el-table-column label="序号" width="55px" :index="indexMethod" type="index" align="center"></el-table-column> |
|||
<el-table-column prop="enpName" label="厂家" width="100px" align="center"> |
|||
</el-table-column> |
|||
<el-table-column prop="name" label="品牌" align="center" width="100px"> |
|||
</el-table-column> |
|||
<el-table-column prop="storeName" label="门店" align="center" > |
|||
</el-table-column> |
|||
<el-table-column prop="dataDate" label="日期" sortable align="center" width="150px"> |
|||
</el-table-column> |
|||
<el-table-column prop="salesAmount" label="销售额" align="center" width="100px"> |
|||
</el-table-column> |
|||
</el-table> |
|||
|
|||
<div class="pages"> |
|||
<div class="tit" /> |
|||
<!-- 翻页 --> |
|||
<!-- <pagination |
|||
:total="queryParams.total" |
|||
:page.sync="queryParams.current" |
|||
:limit.sync="queryParams.size" |
|||
@pagination="getPageList" |
|||
/> --> |
|||
</div> |
|||
</div> |
|||
|
|||
<!-- 手动抓取数据 --> |
|||
<!-- <el-dialog |
|||
:title="dialogTitle + '数据'" |
|||
:visible.sync="captrue" |
|||
width="40%"> |
|||
<el-form :model="ruleForm" ref="ruleForm" label-width="100px" class="demo-ruleForm"> |
|||
<el-form-item label="抓取时间" required> |
|||
<el-col :span="11"> |
|||
<el-form-item > |
|||
<el-date-picker type="date" placeholder="选择日期" value-format="yyyy-MM-dd" :picker-options="pickerOptions" v-model="ruleForm.time" style="width: 100%;"></el-date-picker> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-form-item> |
|||
<el-form-item label="抓取内容" required> |
|||
<el-checkbox label="抓取实时金额" v-model="ruleForm.data.salesAmount"></el-checkbox> |
|||
<el-checkbox label="抓取采购信息" v-model="ruleForm.data.purchase"></el-checkbox> |
|||
<el-checkbox label="抓取菜品销量信息" v-model="ruleForm.data.salesDishes"></el-checkbox> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="primary" @click="submitForm()">立即抓取</el-button> |
|||
<el-button @click="resetForm()">重置</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-dialog> --> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import req from '@/api/Risk/riskIndex' |
|||
import Pagination from '@/components/pagination' |
|||
export default { |
|||
components: { |
|||
Pagination |
|||
}, |
|||
data() { |
|||
return { |
|||
dataTime:{ |
|||
time:'' |
|||
}, |
|||
tableData:[], |
|||
queryParams: { |
|||
current: 1, |
|||
size: 10, |
|||
total: 0, |
|||
params: { |
|||
|
|||
}, |
|||
}, |
|||
pickerOptions:{ |
|||
disabledDate(time){ |
|||
return time.getTime()> Date.now()- 8.64e7;// 如果没有后面的-8.64e7就是不可以选择今天的 |
|||
} |
|||
} |
|||
}; |
|||
}, |
|||
mounted() { |
|||
|
|||
}, |
|||
created() { |
|||
|
|||
|
|||
}, |
|||
methods: { |
|||
resetSearch() { |
|||
// 重置 |
|||
this.queryParams = { |
|||
total: 0, // 默认数据总数 |
|||
current: 1, // 默认开始页面 |
|||
size: 10, // 每页的数据条数 |
|||
params: { |
|||
|
|||
}, |
|||
}; |
|||
this.getPageList(); |
|||
}, |
|||
// getPageList() { |
|||
// this.tableLoading = true |
|||
// const _this=this |
|||
// listPage(this.queryParams).then((res) => { |
|||
// this.tableLoading = false |
|||
// if (res.success) { |
|||
// this.queryParams.total = res.data.total |
|||
// _this.tableData=res.data.records |
|||
// console.log(res.data.records[0].proportion[0]); |
|||
// } else { |
|||
// // 根据resp.code进行异常情况处理 |
|||
// _this.tableData = [] |
|||
// this.queryParams.total = 0 |
|||
// } |
|||
// }).catch(() => { |
|||
// this.tableLoading = false |
|||
// }) |
|||
// }, |
|||
// 序号 |
|||
indexMethod(index) { |
|||
var pagestart = (this.queryParams.current - 1) * this.queryParams.size |
|||
var pageindex = index + 1 + pagestart |
|||
return pageindex |
|||
}, |
|||
reset() { |
|||
this.form = {}; |
|||
}, |
|||
// 查询某天的数据 |
|||
dosearch() { |
|||
this.getPageList(); |
|||
}, |
|||
|
|||
// 手动抓取数据 |
|||
captruedatas(){ |
|||
req |
|||
.scheduledSave(this.dataTime) |
|||
.then(resp => { |
|||
if (resp.success) { |
|||
this.$message({ showClose: true, type: 'success', message: resp.msg }) |
|||
} else { |
|||
// 根据resp.code进行异常情况处理 |
|||
} |
|||
}) |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style> |
|||
<style scoped="scoped" > |
|||
|
|||
|
|||
</style> |
|||
|
Loading…
Reference in new issue