1;帐分快照-页面

This commit is contained in:
wangshuai 2024-08-18 09:09:14 +08:00
parent 66a1be326a
commit 872e3f0b57
1 changed files with 383 additions and 0 deletions

View File

@ -0,0 +1,383 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="结算时间" prop="start_time">
<el-date-picker
v-model="timeRange1"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="expireTimeOPtion"
align="right">
</el-date-picker>
</el-form-item>
<el-form-item label="账号" prop="account">
<el-input
v-model="queryParams.account"
placeholder="请输入账号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<!-- <el-row :gutter="10" class="mb8">-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="primary"-->
<!-- plain-->
<!-- icon="el-icon-plus"-->
<!-- size="mini"-->
<!-- @click="handleAdd"-->
<!-- v-hasPermi="['system:info:add']"-->
<!-- >新增</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="success"-->
<!-- plain-->
<!-- icon="el-icon-edit"-->
<!-- size="mini"-->
<!-- :disabled="single"-->
<!-- @click="handleUpdate"-->
<!-- v-hasPermi="['system:info:edit']"-->
<!-- >修改</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- plain-->
<!-- icon="el-icon-delete"-->
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="handleDelete"-->
<!-- v-hasPermi="['system:info:remove']"-->
<!-- >删除</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- size="mini"-->
<!-- @click="handleExport"-->
<!-- v-hasPermi="['system:info:export']"-->
<!-- >导出</el-button>-->
<!-- </el-col>-->
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
<!-- </el-row>-->
<el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" type="index" width="50" >
<template slot-scope="scope">
{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column label="账号" align="center" prop="account" />
<el-table-column label="账户名" align="center" prop="accountName" />
<el-table-column label="代理账号" align="center" prop="noGrantTotal" />
<el-table-column label="安全帐分快照" align="center" prop="isGrantTotal" />
<el-table-column label="普通帐分快照" align="center" prop="orderTotal" />
<el-table-column label="快照时间" align="center" prop="time" />
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-mouse"-->
<!-- @click="export1(scope.row)"-->
<!-- >导出</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改店铺单日历史信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="店铺id" prop="storeId">
<el-input v-model="form.storeId" placeholder="请输入店铺id" />
</el-form-item>
<el-form-item label="昨日订单量" prop="lastOrderNum">
<el-input v-model="form.lastOrderNum" placeholder="请输入昨日订单量" />
</el-form-item>
<el-form-item label="昨日好评量" prop="lastPositiveReviewsNum">
<el-input v-model="form.lastPositiveReviewsNum" placeholder="请输入昨日好评量" />
</el-form-item>
<el-form-item label="昨日五星量" prop="lastFiveStarReviewsNum">
<el-input v-model="form.lastFiveStarReviewsNum" placeholder="请输入昨日五星量" />
</el-form-item>
<el-form-item label="昨日回访量" prop="lastReturnVisitNum">
<el-input v-model="form.lastReturnVisitNum" placeholder="请输入昨日回访量" />
</el-form-item>
<el-form-item label="昨日回访比50%" prop="lastReturnVisitRate">
<el-input v-model="form.lastReturnVisitRate" placeholder="请输入昨日回访比50%" />
</el-form-item>
<el-form-item label="今日回访量" prop="todayReturnVisitNum">
<el-input v-model="form.todayReturnVisitNum" placeholder="请输入今日回访量" />
</el-form-item>
<el-form-item label="评分" prop="score">
<el-input v-model="form.score" placeholder="请输入评分" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="open1" width="800px" append-to-body>
<el-form ref="form1" :model="form1" label-width="150px">
<el-form-item label="导出时段" prop="start_time">
<el-date-picker
v-model="timeRange1"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="expireTimeOPtion"
align="right">
</el-date-picker>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitExport"> </el-button>
<el-button @click="cancel1"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listInfo1, getInfo, delInfo, addInfo, updateInfo } from "@/api/statistics/excel";
export default {
name: "Info",
data() {
return {
expireTimeOPtion: {
disabledDate(time) {
let curDate = (new Date()).getTime();
let date1 = 16 * 24 * 3600 * 1000;
let date2 = curDate-date1;
return time.getTime() > Date.now()-8.64e7 || time.getTime() < date2;
// return time.getTime() > Date.now() - 8.64e7; //-8.64e7
}
},
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
infoList: [],
//
title: "",
//
open: false,
open1: false,
timeRange1: [new Date(new Date()-(24*60*60*1000)),new Date(new Date()-(24*60*60*1000))],
queryParams1: {
storeId: undefined,
storeName: undefined,
expStartTime: undefined,
expEndTime: undefined
},
//
queryParams: {
pageNum: 1,
pageSize: 10,
storeId: null,
lastOrderNum: null,
lastPositiveReviewsNum: null,
lastFiveStarReviewsNum: null,
lastReturnVisitNum: null,
lastReturnVisitRate: null,
todayReturnVisitNum: null,
score: null,
expStartTime: null,
expEndTime: null,
account: null
},
//
form: {},
form1: {},
//
rules: {
timeRange1: [
{ required: true, message: "时间不能为空", trigger: "blur" }
]
}
};
},
created() {
this.getList();
},
methods: {
/** 查询店铺单日历史信息列表 */
getList() {
this.loading = true;
listInfo1(this.queryParams).then(response => {
this.infoList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
cancel1() {
this.open1 = false;
this.reset1();
},
reset1() {
this.timeRange1 = ['',''];
this.form1= {};
this.resetForm("form1");
},
export1(row) {
this.open1 = true;
this.form1.id = row.storeId;
this.form1.name = row.storeName;
},
submitExport: function() {
if(this.timeRange1==undefined || this.timeRange1.length == 0){
this.$modal.msgSuccess("请填写时段!");
return
}
this.form1.exportStartTime = this.timeRange1[0]
this.form1.exportEndTime = this.timeRange1[1]
this.$refs["form1"].validate(valid => {
if (valid) {
this.queryParams1.expStartTime = this.form1.exportStartTime;
this.queryParams1.expEndTime = this.form1.exportEndTime;
this.queryParams1.storeId = this.form1.id;
this.queryParams1.storeName = this.form1.name;
this.handleExport(this.queryParams1);
this.cancel1();
}
});
},
//
reset() {
this.form = {
id: null,
storeId: null,
lastOrderNum: null,
lastPositiveReviewsNum: null,
lastFiveStarReviewsNum: null,
lastReturnVisitNum: null,
lastReturnVisitRate: null,
todayReturnVisitNum: null,
score: null,
createTime: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.queryParams.expStartTime = this.timeRange1[0];
this.queryParams.expEndTime = this.timeRange1[1];
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.timeRange1 = [new Date(new Date()-(24*60*60*1000)),new Date(new Date()-(24*60*60*1000))];
this.queryParams.account=undefined;
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加店铺单日历史信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getInfo(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改店铺单日历史信息";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateInfo(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addInfo(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除店铺单日历史信息编号为"' + ids + '"的数据项?').then(function() {
return delInfo(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
// handleExport() {
// this.download('system/info/export', {
// ...this.queryParams
// }, `info_${new Date().getTime()}.xlsx`)
// }
handleExport(data) {
this.download('excel/info/export', {
...this.queryParams1
}, data.storeName+`_${new Date().getTime()}.xlsx`)
}
}
};
</script>