Commit e2a91f30 by 前端

提交版本功能代码

1 parent ffdd677a
...@@ -30,3 +30,21 @@ export function rebuild(data) { ...@@ -30,3 +30,21 @@ export function rebuild(data) {
params: data params: data
}) })
} }
// 生成
export function remake(data) {
return axios({
url: baseConfig.axios4.baseURL + "/reportExport/remake",
method: RequestMethods.GET,
params: data
})
}
// 刷新
export function refresh(data) {
return axios({
url: baseConfig.axios4.baseURL + "/reportExport/refresh",
method: RequestMethods.GET,
params: data
})
}
...@@ -846,7 +846,11 @@ export const downloadReportManage_reportType = [ ...@@ -846,7 +846,11 @@ export const downloadReportManage_reportType = [
{ confId: "businessDataSummary", confValue: "业务数据汇总" }, { confId: "businessDataSummary", confValue: "业务数据汇总" },
{ confId: "yanbaoMerAndPerRanking", confValue: "门店产值及个人成交排名" }, { confId: "yanbaoMerAndPerRanking", confValue: "门店产值及个人成交排名" },
{ confId: "abnormalClockWeeklySummary", confValue: "打卡异常周汇总表" }, { confId: "abnormalClockWeeklySummary", confValue: "打卡异常周汇总表" },
{ confId: "ClockMonthlySummary", confValue: "打卡月汇总表" } { confId: "ClockMonthlySummary", confValue: "打卡月汇总表" },
{
confId: "technicianConstructionOrder",
confValue: "轻改技师施工单月度汇总表"
}
] ]
// 下载报表 业务类型 // 下载报表 业务类型
......
...@@ -1316,6 +1316,12 @@ export const routerName = { ...@@ -1316,6 +1316,12 @@ export const routerName = {
parentId: "90630", parentId: "90630",
label: "重新生成", label: "重新生成",
handle: "handleGenerate" handle: "handleGenerate"
},
{
authId: "9063003",
parentId: "90630",
label: "自定义周期",
handle: "handleCustomize"
} }
], ],
component: _import("systemConfig/downloadReportManage/index") component: _import("systemConfig/downloadReportManage/index")
......
...@@ -243,7 +243,7 @@ export default { ...@@ -243,7 +243,7 @@ export default {
remark: "", remark: "",
attachmentList: [], // 附件 attachmentList: [], // 附件
bizOrderCodeList: [], // 退款申请关联业务订单号列表 bizOrderCodeList: [], // 退款申请关联业务订单号列表
approveType: 1 // 退款流程类型(1.嘀加系统审批,2.企微OA审批) approveType: 2 // 退款流程类型(1.嘀加系统审批,2.企微OA审批)
}, },
oldVal: { oldVal: {
payAmount: "" payAmount: ""
......
...@@ -36,6 +36,14 @@ ...@@ -36,6 +36,14 @@
:table-params="tableParams" :table-params="tableParams"
:get-list-api="getListApi" :get-list-api="getListApi"
:before-search-fn="beforeSearchFn"> :before-search-fn="beforeSearchFn">
<div slot="performanceFlag"
slot-scope="scope">
<el-switch v-model="scope.scope.cancelStatus"
class="switchStyle"
active-color="#2a58ad"
active-text="启用"
inactive-text="停用"></el-switch>
</div>
<div slot="auth-button" <div slot="auth-button"
slot-scope="scope"> slot-scope="scope">
<!-- 查看 --> <!-- 查看 -->
...@@ -291,10 +299,11 @@ export default { ...@@ -291,10 +299,11 @@ export default {
{ {
label: '处罚启停', label: '处罚启停',
prop: 'cancelStatus', prop: 'cancelStatus',
width: '100px', width: '150px',
formatter: (cellValue) => { addHtml: 'performanceFlag'
return this.baseData.cancelStatusOpt.find(item => item.confId === cellValue.cancelStatus)?.confValue // formatter: (cellValue) => {
} // return this.baseData.cancelStatusOpt.find(item => item.confId === cellValue.cancelStatus)?.confValue
// }
} }
] ]
}, },
......
<template>
<div>
<baseDialog :is-show.sync="dialogShow"
:config="dialogConfig.setting"
:dialog-config="dialogConfig.config"
class="detail-content-warn">
<div>
<div class="form_div">
<div class="tips">
默认为当前月份到昨日数据,可自定义周期
<el-button type="text"
class="scBtn"
@click="handleRefresh">刷新</el-button>
</div>
<el-form label-width="100px"
:inline="true"
:rules="rules"
:model="form"
ref="form">
<el-form-item label="周期:"
prop="dateRange">
<el-date-picker v-model="form.dateRange"
type="datetimerange"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
value-format="yyyy-MM-dd HH:mm"
format="yyyy-MM-dd HH:mm"
:picker-options="pickerOptions" />
<el-button type="text"
class="scBtn"
@click="handleGenerate">生成</el-button>
<div v-if="filename">
<span class="fileTips"
:title="filename">{{ filename ? (filename.length > 40 ? (filename.slice(0, 40) + '...') : filename) : '' }}</span>
<i class="el-icon-delete delBtn"
@click="handleDelete"></i>
</div>
</el-form-item>
</el-form>
</div>
<div class="footer">
<el-button @click="handleCancel">取消</el-button>
<el-button type="primary"
:disabled="btDis"
@click="handleDownload">下载</el-button>
</div>
</div>
</basedialog>
</div>
</template>
<script>
import {
remake,
refresh,
reportExport_download
} from "@api/downloadReportManage"
import { Util, deepClone } from "@/common/util"
export default {
name: "DateChooseDialog",
components: {
},
props: {
visible: {
type: Boolean,
default: false
},
paramsObj: {
type: Object,
default: {}
}
},
computed: {
dialogShow: {
get() {
return this.visible
},
set(val) {
this.$emit('dialogClose')
}
}
},
mounted() {
this.setDefaultDateRange()
},
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
dialogConfig: {
setting: {
showClose: true,
appendToBody: true,
btnList: []
},
config: {
title: "选择报表周期并下载",
width: "600px"
}
},
detailInfo: {},
loading: true,
btDis: true,
form: {
dateRange: ''
},
rules: {
dateRange: [
{ required: true, message: "请选择周期", trigger: "change" }
]
},
pickerOptions: {
disabledDate(time) {
const now = new Date()
const threeMonthsAgo = new Date()
threeMonthsAgo.setMonth(now.getMonth() - 3)
const yesterday = new Date(now)
yesterday.setDate(yesterday.getDate() - 1)
yesterday.setHours(23, 59, 59, 0)
// 只允许选择:从3个月前 到 昨天之间的时间
return time.getTime() > yesterday.getTime() || time.getTime() < threeMonthsAgo.getTime()
},
shortcuts: [{
text: '最近三个月',
onClick(picker) {
const end = new Date()
end.setDate(end.getDate() - 1) // 昨天
end.setHours(23, 59, 59)
const start = new Date()
start.setMonth(start.getMonth() - 3)
start.setDate(1)
start.setHours(0, 0, 0)
picker.$emit('pick', [start, end])
}
}]
},
filename: '',
downLoadKey: ''
}
},
methods: {
setDefaultDateRange() {
const now = new Date()
// 本月第一天
const firstDay = new Date(now.getFullYear(), now.getMonth(), 1)
firstDay.setHours(0, 0, 0, 0)
const yesterday = new Date(now)
yesterday.setDate(yesterday.getDate() - 1)
yesterday.setHours(23, 59, 0, 0)
this.form.dateRange = [firstDay, yesterday]
},
handleCancel() {
this.dialogShow = false
},
handleGenerate() {
this.$refs.form.validate(valid => {
if (valid) {
var params = {
accountName: this.userInfo.loginAccount.loginAccout,
businessType: this.paramsObj.business_type,
reportTypeName: this.paramsObj.report_type,
key: this.paramsObj.key,
startTime: Util.dateFormate(this.form.dateRange[0], 'YYYY-MM-DD HH:mm'),
endTime: Util.dateFormate(this.form.dateRange[1], 'YYYY-MM-DD HH:mm')
}
// return console.log('params', params)
remake(params).then(res => {
this.notice.okTips('操作成功')
})
}
})
},
handleRefresh() {
this.$refs.form.validate(valid => {
if (valid) {
var params = {
businessType: this.paramsObj.business_type,
reportTypeName: this.paramsObj.report_type,
key: this.paramsObj.key,
startTime: Util.dateFormate(this.form.dateRange[0], 'YYYY-MM-DD HH:mm'),
endTime: Util.dateFormate(this.form.dateRange[1], 'YYYY-MM-DD HH:mm')
}
refresh(params).then(res => {
this.notice.okTips('操作成功')
this.filename = res.filename
if (res.code === 0) {
this.btDis = false
this.downLoadKey = res.key
}
})
}
})
},
handleDelete() {
this.filename = ''
this.btDis = true // 删除文件后禁用下载按钮
},
handleDownload() {
reportExport_download({ key: this.downLoadKey }).then((result) => {
console.log(result, "result")
var url = result.list[0].url + '&accountName=' + this.userInfo.loginAccount.loginAccout
result && this.downLoadFile(url)
this.btDis = true // 只能下载一次,下载后禁用按钮
})
},
/**
* url下载文件
*
*/
downLoadFile: function (url) {
const Temp = document.createElement("a")
Temp.href = url
document.body.append(Temp)
Temp.click()
document.body.removeChild(Temp)
}
}
}
</script>
<style lang="scss" scoped>
.detail-content-warn {
.form_div {
color: #333333;
.el-form-item__content {
display: inline-block;
width: calc(100% - 150px);
line-height: 24px;
}
.el-form-item__label {
padding: 0;
line-height: 24px;
}
.el-form-item {
width: 100%;
margin-bottom: 20px;
}
.edit-sub-block {
// padding: 0 10px;
.detail-txt {
display: inline-block;
width: 200px;
vertical-align: bottom;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
::v-deep .el-form-item__content {
max-width: calc(100% - 110px);
word-break: break-all;
}
.itemDiv {
display: flex;
.halfItem {
width: 50%;
}
}
.onLineItem {
::v-deep .el-form-item__content {
max-width: 80%;
}
}
}
.imgCon {
text-align: center;
.imgSize {
width: 120px;
height: 120px;
}
}
.tips {
text-align: left;
margin: 10px 0 20px 0;
color: #333333;
}
.scBtn {
padding-left: 10px;
}
.fileTips {
font-size: 12px;
}
.delBtn {
padding-left: 10px;
cursor: pointer;
}
}
.footer {
text-align: right;
margin-top: 50px;
}
}
</style>
...@@ -4,19 +4,22 @@ ...@@ -4,19 +4,22 @@
<!-- class="order-detail" --> <!-- class="order-detail" -->
<d2-container> <d2-container>
<!-- <div class="offline-account"> --> <!-- <div class="offline-account"> -->
<div class="header" slot="header" style="padding: 10px 20px"> <div class="header"
<d2-search slot="header"
ref="showSearch" style="padding: 10px 20px">
<d2-search ref="showSearch"
class="show-search" class="show-search"
:search-form="searchForm" :search-form="searchForm"
:label-width="labelWidth" :label-width="labelWidth"
:form-data="showFormData" :form-data="showFormData" />
/>
<div class="up-btns"> <div class="up-btns">
<el-button @click="handleSearch" size="small" type="primary"> <el-button @click="handleSearch"
size="small"
type="primary">
查询 查询
</el-button> </el-button>
<el-button size="small" @click="handleReset"> 重置 </el-button> <el-button size="small"
@click="handleReset"> 重置 </el-button>
</div> </div>
</div> </div>
<!-- </d2-container> <!-- </d2-container>
...@@ -25,25 +28,43 @@ ...@@ -25,25 +28,43 @@
<d2-table-header> <d2-table-header>
<auth-button category="Button" /> <auth-button category="Button" />
</d2-table-header> </d2-table-header>
<d2-table <d2-table ref="recordTable"
ref="recordTable"
:get-list-api="getListApi" :get-list-api="getListApi"
:search-form="searchFormSearch" :search-form="searchFormSearch"
:table-params="tableParams" :table-params="tableParams"
:before-search-fn="beforeSearchFn" :before-search-fn="beforeSearchFn">
> <div slot="auth-button"
<div
slot="auth-button"
slot-scope="scope" slot-scope="scope"
v-if="scope.scope.status != -1" v-if="scope.scope.status != -1">
> <!-- <auth-button :data="scope.scope" /> -->
<auth-button :data="scope.scope" /> <!-- 下载 -->
<span style="margin-right: 10px;">
<auth-button :data="scope.scope"
:show-btn-ids="['9063001']" />
</span>
<!-- 重新生成 -->
<span style="margin-right: 10px;">
<auth-button :data="scope.scope"
:show-btn-ids="['9063002']" />
</span>
<!-- 自定义周期 -->
<span style="margin-right: 10px;"
v-if="scope.scope.report_type.includes('门店产值及个人成交排名')">
<auth-button :data="scope.scope"
:show-btn-ids="['9063003']" />
</span>
</div> </div>
<div v-else> <div v-else>
<span class="list-span">正在生成中</span> <span class="list-span">正在生成中</span>
</div> </div>
</d2-table> </d2-table>
</div> </div>
<!-- 选择报表周期及下载 -->
<dateChooseDialog :visible.sync="dateVisible"
v-if="dateVisible"
:params-obj="recordInfo"
@dialogClose="closeDateDialog" />
</d2-container> </d2-container>
</div> </div>
</template> </template>
...@@ -59,9 +80,12 @@ import { ...@@ -59,9 +80,12 @@ import {
reportExport_download, reportExport_download,
rebuild rebuild
} from "@api/downloadReportManage" } from "@api/downloadReportManage"
import dateChooseDialog from "./components/dateChooseDialog"
export default { export default {
name: "DownloadReportList", name: "DownloadReportList",
components: {}, components: {
dateChooseDialog
},
data() { data() {
return { return {
userInfo: this.$store.state.d2admin.user.info, userInfo: this.$store.state.d2admin.user.info,
...@@ -149,7 +173,9 @@ export default { ...@@ -149,7 +173,9 @@ export default {
downloadReportManage_businessType: deepClone( downloadReportManage_businessType: deepClone(
downloadReportManage_businessType downloadReportManage_businessType
) )
} },
dateVisible: false,
recordInfo: {}
} }
}, },
computed: { computed: {
...@@ -256,6 +282,17 @@ export default { ...@@ -256,6 +282,17 @@ export default {
.catch((err) => { .catch((err) => {
console.log(err) console.log(err)
}) })
},
// 自定义周期
handleCustomize(row) {
this.recordInfo = row
this.dateVisible = !this.dateVisible
},
closeDateDialog() {
this.dateVisible = !this.dateVisible
this.$refs.recordTable.refreshTable(false, true)
} }
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!