Commit 006c416a by 王琦琳

Merge branch 'dev_v4.35.1-0308' into 'SAAS-V4.37.0'

上线合并

See merge request !275
2 parents 630ab7bc 75264d0a
// import request from "./request"
import RequestMethods from "./request.methods"
import axios from "@/plugin/axios/index_code"
import { baseConfig } from "@/main"
// const path = "dj.api.smartcarlife."
// 查询现有的所有excel
export function queryAllExcel(data) {
return axios({
url: baseConfig.axios4.baseURL + "/reportExport/queryAllExcel",
method: RequestMethods.GET,
params: data
})
}
// 下载
export function reportExport_download(data) {
return axios({
url: baseConfig.axios4.baseURL + "/reportExport/download",
method: RequestMethods.GET,
params: data
})
}
// 重新生成
export function rebuild(data) {
return axios({
url: baseConfig.axios4.baseURL + "/reportExport/rebuild",
method: RequestMethods.GET,
params: data
})
}
...@@ -37,6 +37,7 @@ const request = ( ...@@ -37,6 +37,7 @@ const request = (
dj: "axios", dj: "axios",
scrm: "axios2", scrm: "axios2",
merchants: "axios3", merchants: "axios3",
reportExport: "axios4",
"glsx.accounts.biz.common.pictureUpload": "common" "glsx.accounts.biz.common.pictureUpload": "common"
} }
const baseApiName = mappingName[apiName] const baseApiName = mappingName[apiName]
......
...@@ -808,3 +808,18 @@ export const sceneForInStore = [ ...@@ -808,3 +808,18 @@ export const sceneForInStore = [
{ confId: "0", confValue: "2.1" }, { confId: "0", confValue: "2.1" },
{ confId: "2", confValue: "2.2" } { confId: "2", confValue: "2.2" }
] ]
// 下载报表 报表类型
export const downloadReportManage_reportType = [
{ confId: "merchantPerformance", confValue: "门店业绩数据表" },
{ confId: "sellerPerformance", confValue: "零售人员业绩提成数据表" },
{ confId: "multiCategoryOperation", confValue: "多品类运营" },
{ confId: "multiCategoryOperationMerchant", confValue: "多品类运营-门店" }
]
// 下载报表 业务类型
export const downloadReportManage_businessType = [
{ confId: "jingpin", confValue: "精品升级" },
{ confId: "quanyi", confValue: "权益" },
{ confId: "yanbao", confValue: "延保" }
]
...@@ -262,7 +262,7 @@ export const Util = { ...@@ -262,7 +262,7 @@ export const Util = {
// return // return
const Temp = document.createElement("a") const Temp = document.createElement("a")
// Temp.href = process.env.VUE_APP_BASE_URL + '/article/export.do?articleId=' + row.id // Temp.href = process.env.VUE_APP_BASE_URL + '/article/export.do?articleId=' + row.id
url = url + "?timestamp=" + new Date().getTime() url = url + `${url.includes('?') ? '&' : '?'}` + "timestamp=" + new Date().getTime()
Temp.href = url Temp.href = url
// console.log(url) // console.log(url)
// console.log(Temp.href) // console.log(Temp.href)
......
...@@ -1048,5 +1048,30 @@ export const routerName = { ...@@ -1048,5 +1048,30 @@ export const routerName = {
} }
], ],
component: _import("systemConfig/inStoreManage/index") component: _import("systemConfig/inStoreManage/index")
},
90630: {
path: "/downloadReportManage",
name: "downloadReportManage",
meta: {
title: "下载报表",
authId: "90630",
parentId: "906",
cache: false
},
auth: [
{
authId: "9063001",
parentId: "90630",
label: "下载",
handle: "handleDownload"
},
{
authId: "9063002",
parentId: "90630",
label: "重新生成",
handle: "handleGenerate"
}
],
component: _import("systemConfig/downloadReportManage/index")
} }
} }
...@@ -237,21 +237,11 @@ export default { ...@@ -237,21 +237,11 @@ export default {
.detail-dialog { .detail-dialog {
// margin: 20px 0; // margin: 20px 0;
.flag-div { .flag-div {
// width: 100%; // height: 40rpx;
height: 40rpx; // font-family: PingFangSC-Regular;
font-family: PingFangSC-Regular; // font-weight: 400;
font-weight: 400; // font-size: 28rpx;
font-size: 28rpx; // line-height: 40rpx;
line-height: 40rpx;
// .flag-div-label {
// width: 20%;
// color: #666666;
// text-align: right;
// }
// .flag-div-detail {
// width: 70%;
// color: #333333;
// }
.label-span { .label-span {
margin-right: 10px; margin-right: 10px;
max-width: 250px; max-width: 250px;
......
<!-- 下载报表 - 列表 -->
<template>
<div>
<!-- class="order-detail" -->
<d2-container>
<!-- <div class="offline-account"> -->
<div class="header"
slot="header"
style="padding: 10px 20px;">
<d2-search ref="showSearch"
class="show-search"
:search-form="searchForm"
:labelWidth="labelWidth"
:form-data="showFormData" />
<div class="up-btns">
<el-button @click="handleSearch"
size="small"
type="primary">
查询
</el-button>
<el-button size="small"
@click="handleReset">
重置
</el-button>
</div>
</div>
<!-- </d2-container>
<d2-container> -->
<div class="d2-container-content">
<d2-table-header>
<auth-button category="Button" />
</d2-table-header>
<d2-table ref="recordTable"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn">
<div slot="auth-button"
slot-scope="scope"
v-if="scope.scope.status != -1">
<auth-button :data="scope.scope" />
</div>
<div v-else>
<span class="list-span">正在生成中</span>
</div>
</d2-table>
</div>
</d2-container>
</div>
</template>
<script>
import { Util, deepClone } from '@/common/util'
import { downloadReportManage_reportType, downloadReportManage_businessType } from '@/common/constants.js'
import { queryAllExcel, reportExport_download, rebuild } from '@api/downloadReportManage'
export default {
name: 'downloadReportList',
components: {
},
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
labelWidth: '100px',
searchForm: {
filename: '',
business_type: '',
report_type: ''
},
searchFormSearch: {},
showFormData: [{
label: '文件标题',
name: 'filename',
type: 'input',
maxlength: '50',
isClear: true
}, {
label: '报表类型',
name: 'report_type',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confValue',
optionsName: 'downloadReportManage_reportType'
}, {
label: '业务类型',
name: 'business_type',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confValue',
optionsName: 'downloadReportManage_businessType'
}],
getListApi: queryAllExcel,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
// tableOption: { width: '200px' },
tableOption: true,
tableColumns: [{
label: '文件标题',
prop: 'filename',
width: '400px'
}, {
label: '报表类型',
prop: 'report_type',
// formatter: (cellValue) => {
// return downloadReportManage_reportType.find(el => el.confId == cellValue.report_type)?.confValue
// }
}, {
label: '业务类型',
prop: 'business_type',
// formatter: (cellValue) => {
// return downloadReportManage_businessType.find(el => el.confId == cellValue.business_type)?.confValue
// }
}, {
label: '统计周期',
prop: 'statperiod',
// formatter: (cellValue) => {
// return sceneForInStore.find(el => el.confId == o)?.confValue
// }
}, {
label: '创建时间',
prop: 'created_date',
// formatter: (cellValue) => {
// return sceneForInStore.find(el => el.confId == o)?.confValue
// }
}]
},
baseData: {
downloadReportManage_reportType: deepClone(downloadReportManage_reportType),
downloadReportManage_businessType: deepClone(downloadReportManage_businessType)
},
}
},
computed: {
// ...mapState({
// dowloadList: (state) => state.d2admin.user.dowloadList
// })
},
mounted() {
this.getBaseData()
},
methods: {
// ...mapActions({
// get: 'd2admin/base/get',
// close: 'd2admin/page/close'
// }),
// ...mapActions('d2admin/user', ['actionSetDownloadList']),
async getBaseData() {
this.getOptionsList()
},
beforeSearchFn() {
return new Promise(resolve => {
this.searchFormSearch = deepClone(this.searchForm)
resolve()
})
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === 'select') {
if (this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部') {
const temp = {}
temp[this.showFormData[index].optionId] = ''
temp[this.showFormData[index].optionLabel] = '全部'
this.baseData[item.optionsName].unshift(temp)
}
this.$set(this.showFormData[index], 'optionList', this.baseData[item.optionsName])
}
})
},
handleSearch() {
this.$refs.recordTable.refreshTable(false, true)
},
handleReset() {
this.searchForm = {
filename: '',
business_type: '',
report_type: ''
}
this.$refs.recordTable.refreshTable(false, true)
},
//下载
handleDownload(row) {
reportExport_download({ key: row.key }).then((result) => {
console.log(result, 'result')
result && this.downLoadFile(result.list[0].url)
})
},
/**
* url下载文件
*
*/
downLoadFile: function (url) {
const Temp = document.createElement("a")
// url = url + `${url.includes('?') ? '&' : '?'}` + "timestamp=" + new Date().getTime()
Temp.href = url
document.body.append(Temp)
Temp.click()
document.body.removeChild(Temp)
},
// 重新生成
handleGenerate(row) {
this.$confirm('系统将自动按照对应的报表及统计时间重新生成,生成过程中不可下载,请耐心等待。是否确认重新生成?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
closeOnClickModal: false
}).then(() => {
rebuild({ key: row.key }).then(res => {
this.notice.okTips()
this.$refs.recordTable.refreshTable()
})
}).catch(err => {
console.log(err)
})
},
},
}
</script>
<style scoped>
.count-txt {
font-weight: 700;
color: #2a58ad;
margin: 0 2px;
}
.leftSpan {
display: inline-block;
box-sizing: border-box;
margin-right: 10px;
}
.list-span {
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 14px;
color: #999999;
}
</style>
...@@ -129,21 +129,11 @@ export default { ...@@ -129,21 +129,11 @@ export default {
width: 400px; width: 400px;
} }
.flag-div { .flag-div {
// width: 100%; // height: 40rpx;
height: 40rpx; // font-family: PingFangSC-Regular;
font-family: PingFangSC-Regular; // font-weight: 400;
font-weight: 400; // font-size: 28rpx;
font-size: 28rpx; // line-height: 40rpx;
line-height: 40rpx;
// .flag-div-label {
// width: 20%;
// color: #666666;
// text-align: right;
// }
// .flag-div-detail {
// width: 70%;
// color: #333333;
// }
.label-span { .label-span {
margin-right: 10px; margin-right: 10px;
max-width: 250px; max-width: 250px;
......
...@@ -54,7 +54,6 @@ ...@@ -54,7 +54,6 @@
import { Util, deepClone } from '@/common/util' import { Util, deepClone } from '@/common/util'
import { mapActions, mapState } from 'vuex' import { mapActions, mapState } from 'vuex'
import { sceneForShop, sceneForInStore } from '@/common/constants.js' import { sceneForShop, sceneForInStore } from '@/common/constants.js'
import { withdrawOrderRecordPage, rewithdraw } from '@api/withdrawalManage'
import { staffPage } from '@api/inStoreManage' import { staffPage } from '@api/inStoreManage'
import flagDialog from './components/flagDialog' import flagDialog from './components/flagDialog'
export default { export default {
......
...@@ -82,7 +82,7 @@ export default { ...@@ -82,7 +82,7 @@ export default {
merchantIdFuzzy: '', merchantIdFuzzy: '',
sceneType: '', sceneType: '',
ruleType: '', ruleType: '',
auditStatus: '' auditStatus: 1
}, },
searchFormSearch: {}, searchFormSearch: {},
showFormData: [{ showFormData: [{
...@@ -258,16 +258,13 @@ export default { ...@@ -258,16 +258,13 @@ export default {
merchantIdFuzzy: '', merchantIdFuzzy: '',
sceneType: '', sceneType: '',
ruleType: '', ruleType: '',
auditStatus: '' auditStatus: 1
} }
this.$refs.recordTable.refreshTable(false, true) this.$refs.recordTable.refreshTable(false, true)
}, },
//审核 //审核
handleReview(row) { handleReview(row) {
// row.merchantId = 44211847
// row.scene = 1
this.$router.push({ this.$router.push({
name: "examineDetail", name: "examineDetail",
query: { query: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!