丽知中台报表更新

This commit is contained in:
hyt 2024-11-06 10:07:29 +08:00
parent 240ae5dd2e
commit ad7189b2b7
5 changed files with 188 additions and 159 deletions

View File

@ -1,100 +1,115 @@
import request from "@/utils/request";
import request from '@/utils/request'
export function authApi(tl,as,dj,url = '',data){
return request({
url: 'kangarooDataCenterV3/entranceController/option' + url,
headers: {
tl:tl,
as:as,
dj:dj,
},
method: 'post',
data: data
})
export function authApi(tl, as, dj, url = '', data) {
return request({
url: 'kangarooDataCenterV3/entranceController/option' + url,
headers: {
tl: tl,
as: as,
dj: dj
},
method: 'post',
data: data
})
}
//登录
export function loginToken(data) {
return request({
url: "/Api/Token/CreateToken",
method: "post",
data,
});
url: '/Api/Token/CreateToken',
method: 'post',
data
})
}
export function downFilesBasedFileNameFileTypeAPI(data) {
return request({
url: `/kangarooDataCenterV3/entranceController/option/downFilesBasedFileNameFileType?filename=${data}`,
method: 'get',
responseType: 'blob' // 设置返回类型为 blob
})
}
//token认证
export function CheckToken(data) {
return request({
url: "Api/Base/CheckToken",
method: "post",
data,
});
url: 'Api/Base/CheckToken',
method: 'post',
data
})
}
//组织机构列表
export function GetOrganTree(data) {
return request({
url: "OrganManage/GetOrganTree",
method: "post",
data,
});
url: 'OrganManage/GetOrganTree',
method: 'post',
data
})
}
//上传文件管理器
export function UploadFiles(data, onUploadProgress) {
return request({
url: "/Api/Attachments/UploadToMinio",
method: "post",
url: '/Api/Attachments/UploadToMinio',
method: 'post',
data,
onUploadProgress,
});
onUploadProgress
})
}
//上传服务器本地
export function UploadFilesLocal(data, onUploadProgress) {
return request({
url: "/api/Attachments/UploadFiles",
method: "post",
url: '/api/Attachments/UploadFiles',
method: 'post',
data,
onUploadProgress,
});
onUploadProgress
})
}
// 上传列表
export function UploadList(data, onUploadProgress) {
return request({
url: "/api/Attachments/GetFileList",
method: "post",
url: '/api/Attachments/GetFileList',
method: 'post',
data,
onUploadProgress,
});
onUploadProgress
})
}
export function DownloadFiles(data) {
return request({
url: "/Api/Attachments/DownloadFiles",
method: "post",
url: '/Api/Attachments/DownloadFiles',
method: 'post',
data,
responseType: "blob",
});
responseType: 'blob'
})
}
// 查看
export function downloadFromMinio(data) {
return request({
url: "/api/Attachments/DownloadFromMinio",
method: "post",
url: '/api/Attachments/DownloadFromMinio',
method: 'post',
data,
responseType: "blob",
});
responseType: 'blob'
})
}
//获取token
export function getToken(data) {
return request({
url: "/Api/Token/CreateToken",
method: "post",
data,
});
url: '/Api/Token/CreateToken',
method: 'post',
data
})
}
export function commonFun(url, data) {
return request({
url: url,
method: "post",
data,
});
method: 'post',
data
})
}

View File

@ -5,47 +5,47 @@
<div class="search">
<div class="datepickBox" style="">
<el-date-picker
v-model="queryCriteria.businessDate_start"
type="date"
placeholder="出库日期-开始"
value-format="yyyy-MM-dd"
v-model="queryCriteria.businessDate_start"
type="date"
placeholder="出库日期-开始"
value-format="yyyy-MM-dd"
>
</el-date-picker>
</div>
<div class="datepickBox" style="">
<el-date-picker
v-model="queryCriteria.businessDate_end"
type="date"
placeholder="出库日期-结束"
value-format="yyyy-MM-dd"
v-model="queryCriteria.businessDate_end"
type="date"
placeholder="出库日期-结束"
value-format="yyyy-MM-dd"
>
</el-date-picker>
</div>
<div class="datepickBox" style="">
<el-date-picker
v-model="queryCriteria.successfulTradeDate_start"
type="date"
placeholder="交易成功开始时间"
value-format="yyyy-MM-dd"
v-model="queryCriteria.successfulTradeDate_start"
type="date"
placeholder="交易成功开始时间"
value-format="yyyy-MM-dd"
>
</el-date-picker>
</div>
<div class="datepickBox" style="">
<el-date-picker
v-model="queryCriteria.successfulTradeDate_end"
type="date"
placeholder="交易成功结束时间"
value-format="yyyy-MM-dd"
v-model="queryCriteria.successfulTradeDate_end"
type="date"
placeholder="交易成功结束时间"
value-format="yyyy-MM-dd"
>
</el-date-picker>
</div>
<!-- TOB销售-库存 -->
<div class="chunk">
<el-date-picker
v-model="queryCriteria.newPushDate"
type="date"
placeholder="TOB库存推送时间"
value-format="yyyy-MM-dd"
v-model="queryCriteria.newPushDate"
type="date"
placeholder="TOB库存推送时间"
value-format="yyyy-MM-dd"
>
</el-date-picker>
</div>
@ -55,10 +55,10 @@
<div class="radio">
<el-select v-model="queryCriteria.newstate" placeholder="TOB出库同步成功">
<el-option
v-for="item in stateOptions"
:key="item.value"
:label="item.label"
:value="item.value"
v-for="item in stateOptions"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
@ -72,10 +72,10 @@
<!-- TOB销售-确认收入 -->
<div class="chunk">
<el-date-picker
v-model="queryCriteria.def5"
type="date"
placeholder="TOB确认收入推送时间"
value-format="yyyy-MM-dd"
v-model="queryCriteria.def5"
type="date"
placeholder="TOB确认收入推送时间"
value-format="yyyy-MM-dd"
>
</el-date-picker>
</div>
@ -85,10 +85,10 @@
<div class="radio">
<el-select v-model="queryCriteria.newState4" placeholder="TOB确认收入交易成功-红">
<el-option
v-for="item in stateOptions"
:key="item.value"
:label="item.label"
:value="item.value"
v-for="item in stateOptions"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
@ -107,41 +107,41 @@
</div>
<div>
<el-button
type="primary"
@click="query"
:loading="loading"
size="small"
style=" margin: 5px 5px"
type="primary"
@click="query"
:loading="loading"
size="small"
style=" margin: 5px 5px"
>查询
</el-button>
<el-button
type="primary"
@click="downLoad"
:loading="loading"
size="small"
style=" margin: 5px 5px"
>excel导出
</el-button>
<el-button
type="warning"
@click="reset"
:loading="loading"
size="small"
style="margin: 5px 5px"
type="primary"
@click="downLoad"
:loading="loading"
size="small"
style=" margin: 5px 5px"
>excel导出
</el-button>
<el-button
type="warning"
@click="reset"
:loading="loading"
size="small"
style="margin: 5px 5px"
>重置
</el-button>
</div>
<!-- 主体内容-->
<div class="main">
<baseNewTable
:tableData="mainTableData"
:tableColumn="mainTableColumn"
:tableLoading="tableLoading"
:tableDataMergeList="tableDataMergeList"
:pageModel="pageModel"
@pageSizeChange="(val) => pageSizeChange(val, pageModel)"
@pageChange="(val) => pageChange(val, pageModel)"
exportEventName="ToB库存报表"
:tableData="mainTableData"
:tableColumn="mainTableColumn"
:tableLoading="tableLoading"
:tableDataMergeList="tableDataMergeList"
:pageModel="pageModel"
@pageSizeChange="(val) => pageSizeChange(val, pageModel)"
@pageChange="(val) => pageChange(val, pageModel)"
exportEventName="ToB库存报表"
>
</baseNewTable>
</div>
@ -363,20 +363,21 @@ export default {
methods: {
async downLoad() {
let params = {
...this.queryCriteria,
};
...this.queryCriteria
}
this.openLoading('detail')
const res = await authApi("tocofsSaleoutServiceImplReport", "tocofsSaleoutServiceImplReport", "exportToCSalesReportExcel", "", params);
const res = await authApi('tocofsSaleoutServiceImplReport', 'tocofsSaleoutServiceImplReport', 'exportToCSalesReportExcel', '', params)
if (res.status == 200) {
const response = await downFilesBasedFileNameFileTypeAPI(res.attribute)
// console.log(res)
const url = window.URL.createObjectURL(new Blob([response]), {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'});
const response = await downFilesBasedFileNameFileTypeAPI(res.msg)
const blob = new Blob([response]);
const url = window.URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'TOB销售核对表.xlsx'); //
link.setAttribute('download', 'TOB销售核对表.xlsx');
document.body.appendChild(link);
link.click();
window.URL.revokeObjectURL(url); //
}
return
@ -501,8 +502,8 @@ export default {
raw: true
}
let grid = XLSX.utils.table_to_book(
document.querySelector(boxId),
gatherData
document.querySelector(boxId),
gatherData
)
let workbook = XLSX.write(grid, {
bookType: 'xlsx',
@ -511,10 +512,10 @@ export default {
})
try {
FileSaver.saveAs(
new Blob([workbook], {
type: 'application/octet-stream'
}),
excelName + '.xlsx'
new Blob([workbook], {
type: 'application/octet-stream'
}),
excelName + '.xlsx'
)
} catch (e) {
if (typeof console !== 'undefined') console.log(e, workbook)
@ -541,8 +542,8 @@ export default {
item.newstate4 = this.dist_state[item.newstate4]
})
this.mainTableData = this.dataDispose(
res.attribute.list,
this.tableDataMergeList
res.attribute.list,
this.tableDataMergeList
)
this.tableLoading = false
},
@ -574,10 +575,10 @@ export default {
}
})
Object.keys(sortObj)
.sort()
.forEach((key) => {
newArr = [...newArr, ...sortObj[key]]
})
.sort()
.forEach((key) => {
newArr = [...newArr, ...sortObj[key]]
})
//
newArr.forEach((item) => {
transformedArray.forEach((key) => {
@ -596,7 +597,7 @@ export default {
})
//
tempObj[keyValue][0][`${key[key.length - 1]}Length`] =
tempObj[keyValue].length
tempObj[keyValue].length
if (key.length === 1) {
result = [...tempObj[keyValue], ...result]

View File

@ -369,17 +369,24 @@ export default {
methods: {
async downLoad() {
let params = {
...this.queryCriteria,
...this.queryCriteria
}
this.openLoading('detail')
const response = await authApi('tocofsSaleoutServiceImplReport', 'tocofsSaleoutServiceImplReport', 'exportToCSalesReportExcel', '', params)
const url = window.URL.createObjectURL(new Blob([response]), { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' })
const link = document.createElement('a')
link.href = url
link.setAttribute('download', 'TOB销售核对报表.xlsx') //
document.body.appendChild(link)
link.click()
const res = await authApi('tocofsSaleoutServiceImplReport', 'tocofsSaleoutServiceImplReport', 'exportToCReturnReportExcel', '', params)
if (res.status == 200) {
const response = await downFilesBasedFileNameFileTypeAPI(res.msg)
const blob = new Blob([response]);
const url = window.URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'TOB退货核对表.xlsx');
document.body.appendChild(link);
link.click();
window.URL.revokeObjectURL(url); //
}
return
},
reset() {
this.pageModel.pageNum = 1

View File

@ -404,20 +404,23 @@ export default {
methods: {
async downLoad() {
let params = {
...this.queryCriteria,
...this.pageModel,
pageSize: 9999,
pageNum: 1
...this.queryCriteria
}
this.openLoading('detail')
const response = await authApi('tocofsSaleoutServiceImplReport', 'tocofsSaleoutServiceImplReport', 'exportToCReturnReportExcel', '', params)
const url = window.URL.createObjectURL(new Blob([response]), { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' })
const link = document.createElement('a')
link.href = url
link.setAttribute('download', 'TOC退货核对报表.xlsx') //
document.body.appendChild(link)
link.click()
const res = await authApi('tocofsSaleoutServiceImplReport', 'tocofsSaleoutServiceImplReport', 'exportToCSalesReportExcel', '', params)
if (res.status == 200) {
const response = await downFilesBasedFileNameFileTypeAPI(res.msg)
const blob = new Blob([response]);
const url = window.URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'TOC销售核对表.xlsx');
document.body.appendChild(link);
link.click();
window.URL.revokeObjectURL(url); //
}
return
},
reset() {
this.pageModel.pageNum = 1

View File

@ -402,20 +402,23 @@ export default {
methods: {
async downLoad() {
let params = {
...this.queryCriteria,
...this.pageModel,
pageSize: 9999,
pageNum: 1
...this.queryCriteria
}
this.openLoading('detail')
const response = await authApi('tocofsSaleoutServiceImplReport', 'tocofsSaleoutServiceImplReport', 'exportToCSalesReportExcel', '', params)
const url = window.URL.createObjectURL(new Blob([response]), { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' })
const link = document.createElement('a')
link.href = url
link.setAttribute('download', 'TOC销售核对报表.xlsx') //
document.body.appendChild(link)
link.click()
const res = await authApi('tocofsSaleoutServiceImplReport', 'tocofsSaleoutServiceImplReport', 'exportToCReturnReportExcel', '', params)
if (res.status == 200) {
const response = await downFilesBasedFileNameFileTypeAPI(res.msg)
const blob = new Blob([response]);
const url = window.URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'TOC退货核对表.xlsx');
document.body.appendChild(link);
link.click();
window.URL.revokeObjectURL(url); //
}
return
},
reset() {
this.pageModel.pageNum = 1;