增加搜索条件
This commit is contained in:
@@ -39,3 +39,12 @@ export function syncLbOrderRowFromThird(data) {
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 按购买时间区间、租户 id 按日汇总生成 sum_data */
|
||||||
|
export function generateLbOrderRowDailySum(data) {
|
||||||
|
return request({
|
||||||
|
url: '/lbOrderRow/generate-daily-sum',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -79,6 +79,20 @@ export function exportLbPurchaseApply(params) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 导出同事特权开通提醒 Excel */
|
||||||
|
export function exportColleagueVip(params) {
|
||||||
|
return request({
|
||||||
|
url: '/lbPurchaseApply/exportColleagueVip',
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
applyDateStart: params.applyDateStart,
|
||||||
|
applyDateEnd: params.applyDateEnd,
|
||||||
|
tenantId: params.tenantId
|
||||||
|
},
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
/** 按申请日期区间与租户同步同事 hxrd 用户 VIP(可能较慢,依赖外部管理端) */
|
/** 按申请日期区间与租户同步同事 hxrd 用户 VIP(可能较慢,依赖外部管理端) */
|
||||||
export function syncHxrAdminColleagueVip(params) {
|
export function syncHxrAdminColleagueVip(params) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@@ -11,6 +11,12 @@
|
|||||||
<el-form-item label="卖家ID">
|
<el-form-item label="卖家ID">
|
||||||
<el-input v-model="queryParams.sellerId" clearable placeholder="卖家 id" style="width: 140px" />
|
<el-input v-model="queryParams.sellerId" clearable placeholder="卖家 id" style="width: 140px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="昵称">
|
||||||
|
<el-input v-model="queryParams.consignee" clearable placeholder="昵称" style="width: 140px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="电话">
|
||||||
|
<el-input v-model="queryParams.phone" clearable placeholder="电话" style="width: 140px" />
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="状态">
|
<el-form-item label="状态">
|
||||||
<el-input v-model="queryParams.status" clearable placeholder="状态" style="width: 100px" />
|
<el-input v-model="queryParams.status" clearable placeholder="状态" style="width: 100px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -20,6 +26,12 @@
|
|||||||
<el-option label="寄卖" :value="1" />
|
<el-option label="寄卖" :value="1" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="数据类型">
|
||||||
|
<el-select v-model="queryParams.dataType" clearable placeholder="请选择数据类型" style="width: 140px">
|
||||||
|
<el-option label="明细" value="detail_data" />
|
||||||
|
<el-option label="汇总" value="sum_data" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">查询</el-button>
|
<el-button type="primary" icon="el-icon-search" @click="handleQuery">查询</el-button>
|
||||||
<el-button icon="el-icon-delete" @click="resetQuery">清空</el-button>
|
<el-button icon="el-icon-delete" @click="resetQuery">清空</el-button>
|
||||||
@@ -30,22 +42,30 @@
|
|||||||
<el-card class="action-container" shadow="never">
|
<el-card class="action-container" shadow="never">
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="handleAdd">新增</el-button>
|
<el-button type="primary" icon="el-icon-plus" @click="handleAdd">新增</el-button>
|
||||||
<el-button type="default" icon="el-icon-refresh" style="margin-left: 10px" @click="openSyncDialog">同步订单</el-button>
|
<el-button type="default" icon="el-icon-refresh" style="margin-left: 10px" @click="openSyncDialog">同步订单</el-button>
|
||||||
|
<el-button type="default" icon="el-icon-s-data" style="margin-left: 10px" @click="openDailySumDialog">汇总天数据</el-button>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card class="table-container" shadow="never">
|
<el-card class="table-container" shadow="never">
|
||||||
<el-table v-loading="loading" :data="list" style="width: 100%">
|
<el-table v-loading="loading" :data="list" style="width: 100%">
|
||||||
<el-table-column label="订单ID" prop="id" min-width="120" show-overflow-tooltip />
|
|
||||||
<el-table-column label="订单号" prop="orderSn" min-width="140" show-overflow-tooltip />
|
<el-table-column label="订单号" prop="orderSn" min-width="140" show-overflow-tooltip />
|
||||||
<el-table-column label="租户ID" prop="tenantId" min-width="100" show-overflow-tooltip />
|
|
||||||
<el-table-column label="买家ID" prop="buyerId" min-width="100" show-overflow-tooltip />
|
<el-table-column label="买家ID" prop="buyerId" min-width="100" show-overflow-tooltip />
|
||||||
<el-table-column label="卖家ID" prop="sellerId" min-width="100" show-overflow-tooltip />
|
<el-table-column label="卖家ID" prop="sellerId" min-width="100" show-overflow-tooltip />
|
||||||
<el-table-column label="商品ID" prop="merchandiseId" min-width="100" show-overflow-tooltip />
|
|
||||||
<el-table-column label="状态" prop="status" width="72" />
|
|
||||||
<el-table-column label="总金额" prop="totalMoney" min-width="100" show-overflow-tooltip />
|
|
||||||
<el-table-column label="收货人" prop="consignee" min-width="90" show-overflow-tooltip />
|
<el-table-column label="收货人" prop="consignee" min-width="90" show-overflow-tooltip />
|
||||||
<el-table-column label="电话" prop="phone" min-width="110" show-overflow-tooltip />
|
<el-table-column label="电话" prop="phone" min-width="110" show-overflow-tooltip />
|
||||||
|
<el-table-column label="总金额" prop="totalMoney" min-width="100" show-overflow-tooltip />
|
||||||
|
<el-table-column label="当天未寄卖单数" prop="todayUnresellCount" min-width="130" align="center" />
|
||||||
|
<el-table-column label="当天交易单数" prop="todayOrderCount" min-width="120" align="center" />
|
||||||
|
<el-table-column label="是否寄卖" min-width="100" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ formatIsResellLabel(scope.row) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="状态" min-width="88" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ formatStatusLabel(scope.row) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="下单时间" prop="buyTime" min-width="150" show-overflow-tooltip />
|
<el-table-column label="下单时间" prop="buyTime" min-width="150" show-overflow-tooltip />
|
||||||
<el-table-column label="支付时间" prop="payTime" min-width="150" show-overflow-tooltip />
|
|
||||||
<el-table-column label="操作" fixed="right" width="140">
|
<el-table-column label="操作" fixed="right" width="140">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button type="text" @click="handleEdit(scope.row)">编辑</el-button>
|
<el-button type="text" @click="handleEdit(scope.row)">编辑</el-button>
|
||||||
@@ -214,6 +234,33 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-dialog title="汇总天数据" :visible.sync="dailySumDialogVisible" width="520px" @close="resetDailySumForm">
|
||||||
|
<el-form ref="dailySumFormRef" :model="dailySumForm" :rules="dailySumFormRules" label-width="110px">
|
||||||
|
<el-form-item label="购买时间" prop="buyTimeRange">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="dailySumForm.buyTimeRange"
|
||||||
|
type="datetimerange"
|
||||||
|
range-separator="至"
|
||||||
|
start-placeholder="开始时间"
|
||||||
|
end-placeholder="结束时间"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
:default-time="['00:00:00', '23:59:59']"
|
||||||
|
style="width: 100%"
|
||||||
|
clearable
|
||||||
|
@change="handleDailySumBuyTimeRangeChange"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="租户ID" prop="tenantId">
|
||||||
|
<el-input v-model="dailySumForm.tenantId" clearable placeholder="请输入租户ID" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dailySumDialogVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" :loading="dailySumSubmitLoading" @click="handleDailySumSubmit">确定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
<el-dialog title="同步订单" :visible.sync="syncDialogVisible" width="520px" @close="resetSyncForm">
|
<el-dialog title="同步订单" :visible.sync="syncDialogVisible" width="520px" @close="resetSyncForm">
|
||||||
<el-form ref="syncFormRef" :model="syncForm" :rules="syncFormRules" label-width="110px">
|
<el-form ref="syncFormRef" :model="syncForm" :rules="syncFormRules" label-width="110px">
|
||||||
<el-form-item label="购买时间" prop="buyTimeRange">
|
<el-form-item label="购买时间" prop="buyTimeRange">
|
||||||
@@ -253,6 +300,7 @@
|
|||||||
import {
|
import {
|
||||||
addLbOrderRow,
|
addLbOrderRow,
|
||||||
deleteLbOrderRow,
|
deleteLbOrderRow,
|
||||||
|
generateLbOrderRowDailySum,
|
||||||
getLbOrderRowList,
|
getLbOrderRowList,
|
||||||
syncLbOrderRowFromThird,
|
syncLbOrderRowFromThird,
|
||||||
updateLbOrderRow
|
updateLbOrderRow
|
||||||
@@ -321,6 +369,20 @@ export default {
|
|||||||
return {
|
return {
|
||||||
loading: false,
|
loading: false,
|
||||||
submitLoading: false,
|
submitLoading: false,
|
||||||
|
dailySumDialogVisible: false,
|
||||||
|
dailySumSubmitLoading: false,
|
||||||
|
dailySumForm: {
|
||||||
|
buyTimeRange: null,
|
||||||
|
tenantId: ''
|
||||||
|
},
|
||||||
|
dailySumFormRules: {
|
||||||
|
buyTimeRange: [
|
||||||
|
{ required: true, message: '请选择购买时间区间', trigger: 'change' }
|
||||||
|
],
|
||||||
|
tenantId: [
|
||||||
|
{ required: true, message: '请填写租户ID', trigger: 'blur' }
|
||||||
|
]
|
||||||
|
},
|
||||||
syncDialogVisible: false,
|
syncDialogVisible: false,
|
||||||
syncSubmitLoading: false,
|
syncSubmitLoading: false,
|
||||||
syncForm: {
|
syncForm: {
|
||||||
@@ -343,8 +405,11 @@ export default {
|
|||||||
orderSn: '',
|
orderSn: '',
|
||||||
buyerId: '',
|
buyerId: '',
|
||||||
sellerId: '',
|
sellerId: '',
|
||||||
|
consignee: '',
|
||||||
|
phone: '',
|
||||||
status: '',
|
status: '',
|
||||||
isResell: undefined
|
isResell: undefined,
|
||||||
|
dataType: ''
|
||||||
},
|
},
|
||||||
form: emptyForm(),
|
form: emptyForm(),
|
||||||
formRules: {
|
formRules: {
|
||||||
@@ -366,6 +431,17 @@ export default {
|
|||||||
const value = headers && headers['X-Tenant-Id']
|
const value = headers && headers['X-Tenant-Id']
|
||||||
return value ? String(value).trim() : ''
|
return value ? String(value).trim() : ''
|
||||||
},
|
},
|
||||||
|
formatIsResellLabel(row) {
|
||||||
|
const value = row.isResell !== undefined && row.isResell !== null
|
||||||
|
? row.isResell
|
||||||
|
: row.is_resell
|
||||||
|
return Number(value) === 1 ? '已寄卖' : '未寄卖'
|
||||||
|
},
|
||||||
|
formatStatusLabel(row) {
|
||||||
|
const value = row.status
|
||||||
|
if (Number(value) === 2) return '已完成'
|
||||||
|
return value !== undefined && value !== null ? value : ''
|
||||||
|
},
|
||||||
fetchList() {
|
fetchList() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
getLbOrderRowList(this.buildListParams())
|
getLbOrderRowList(this.buildListParams())
|
||||||
@@ -395,10 +471,13 @@ export default {
|
|||||||
orderSn: this.queryParams.orderSn || undefined,
|
orderSn: this.queryParams.orderSn || undefined,
|
||||||
buyerId: parseOptionalLong(this.queryParams.buyerId),
|
buyerId: parseOptionalLong(this.queryParams.buyerId),
|
||||||
sellerId: parseOptionalLong(this.queryParams.sellerId),
|
sellerId: parseOptionalLong(this.queryParams.sellerId),
|
||||||
|
consignee: this.queryParams.consignee || undefined,
|
||||||
|
phone: this.queryParams.phone || undefined,
|
||||||
status: parseOptionalInt(this.queryParams.status),
|
status: parseOptionalInt(this.queryParams.status),
|
||||||
isResell: this.queryParams.isResell === 0 || this.queryParams.isResell === 1
|
isResell: this.queryParams.isResell === 0 || this.queryParams.isResell === 1
|
||||||
? this.queryParams.isResell
|
? this.queryParams.isResell
|
||||||
: undefined
|
: undefined,
|
||||||
|
dataType: this.queryParams.dataType || undefined
|
||||||
}
|
}
|
||||||
Object.keys(params).forEach((key) => {
|
Object.keys(params).forEach((key) => {
|
||||||
if (params[key] === undefined || params[key] === '') delete params[key]
|
if (params[key] === undefined || params[key] === '') delete params[key]
|
||||||
@@ -416,8 +495,11 @@ export default {
|
|||||||
orderSn: '',
|
orderSn: '',
|
||||||
buyerId: '',
|
buyerId: '',
|
||||||
sellerId: '',
|
sellerId: '',
|
||||||
|
consignee: '',
|
||||||
|
phone: '',
|
||||||
status: '',
|
status: '',
|
||||||
isResell: undefined
|
isResell: undefined,
|
||||||
|
dataType: ''
|
||||||
}
|
}
|
||||||
this.fetchList()
|
this.fetchList()
|
||||||
},
|
},
|
||||||
@@ -615,6 +697,64 @@ export default {
|
|||||||
this.syncSubmitLoading = false
|
this.syncSubmitLoading = false
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
handleDailySumBuyTimeRangeChange(range) {
|
||||||
|
const normalized = this.normalizeSyncBuyTimeRange(range)
|
||||||
|
if (normalized !== range) {
|
||||||
|
this.dailySumForm.buyTimeRange = normalized
|
||||||
|
}
|
||||||
|
},
|
||||||
|
openDailySumDialog() {
|
||||||
|
this.dailySumForm = {
|
||||||
|
buyTimeRange: null,
|
||||||
|
tenantId: this.getTenantIdFromBusinessHeaders()
|
||||||
|
}
|
||||||
|
this.dailySumDialogVisible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.dailySumFormRef && this.$refs.dailySumFormRef.clearValidate()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
resetDailySumForm() {
|
||||||
|
this.dailySumForm = {
|
||||||
|
buyTimeRange: null,
|
||||||
|
tenantId: ''
|
||||||
|
}
|
||||||
|
this.$refs.dailySumFormRef && this.$refs.dailySumFormRef.resetFields()
|
||||||
|
},
|
||||||
|
handleDailySumSubmit() {
|
||||||
|
this.$refs.dailySumFormRef.validate((valid) => {
|
||||||
|
if (!valid) return
|
||||||
|
const range = this.normalizeSyncBuyTimeRange(this.dailySumForm.buyTimeRange)
|
||||||
|
if (!Array.isArray(range) || range.length !== 2 || !range[0] || !range[1]) {
|
||||||
|
this.$message.warning('请选择完整的购买时间区间')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const tenantId = String(this.dailySumForm.tenantId || '').trim()
|
||||||
|
if (!tenantId) {
|
||||||
|
this.$message.error('请填写租户ID')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const payload = {
|
||||||
|
buyTimeStart: range[0],
|
||||||
|
buyTimeEnd: range[1],
|
||||||
|
tenantId
|
||||||
|
}
|
||||||
|
this.dailySumSubmitLoading = true
|
||||||
|
generateLbOrderRowDailySum(payload)
|
||||||
|
.then((res) => {
|
||||||
|
const ok = res && (res.code === 20000 || res.code === 200 || res.success === true)
|
||||||
|
if (ok) {
|
||||||
|
this.$message.success((res && res.message) || '汇总成功')
|
||||||
|
this.dailySumDialogVisible = false
|
||||||
|
} else {
|
||||||
|
this.$message.error((res && res.message) || '汇总失败')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {})
|
||||||
|
.finally(() => {
|
||||||
|
this.dailySumSubmitLoading = false
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,6 +59,14 @@
|
|||||||
>
|
>
|
||||||
导出新人特权
|
导出新人特权
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
icon="el-icon-download"
|
||||||
|
style="margin-left: 12px"
|
||||||
|
@click="openExportColleaguePrivilegeDialog"
|
||||||
|
>
|
||||||
|
导出同事特权
|
||||||
|
</el-button>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card class="table-container" shadow="never">
|
<el-card class="table-container" shadow="never">
|
||||||
@@ -314,6 +322,45 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-dialog
|
||||||
|
title="导出同事特权"
|
||||||
|
:visible.sync="exportColleaguePrivilegeDialogVisible"
|
||||||
|
width="520px"
|
||||||
|
@close="resetExportColleaguePrivilegeDialog"
|
||||||
|
>
|
||||||
|
<el-form label-width="120px">
|
||||||
|
<el-form-item label="申请开始日期" required>
|
||||||
|
<el-date-picker
|
||||||
|
v-model="exportColleaguePrivilegeApplyDateStart"
|
||||||
|
type="date"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
clearable
|
||||||
|
placeholder="请选择开始日期"
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="申请结束日期" required>
|
||||||
|
<el-date-picker
|
||||||
|
v-model="exportColleaguePrivilegeApplyDateEnd"
|
||||||
|
type="date"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
clearable
|
||||||
|
placeholder="请选择结束日期"
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="租户ID" required>
|
||||||
|
<el-input v-model="exportColleaguePrivilegeTenantId" clearable placeholder="请输入租户ID" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="exportColleaguePrivilegeDialogVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" :loading="exportColleaguePrivilegeLoading" @click="submitExportColleaguePrivilege">
|
||||||
|
确定
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
<el-dialog title="特权推荐人列表" :visible.sync="privilegeDialogVisible" width="760px" @close="resetPrivilegeDialog">
|
<el-dialog title="特权推荐人列表" :visible.sync="privilegeDialogVisible" width="760px" @close="resetPrivilegeDialog">
|
||||||
<el-table v-loading="privilegeLoading" :data="privilegeList" style="width: 100%">
|
<el-table v-loading="privilegeLoading" :data="privilegeList" style="width: 100%">
|
||||||
<el-table-column type="index" label="#" width="60" />
|
<el-table-column type="index" label="#" width="60" />
|
||||||
@@ -336,6 +383,7 @@
|
|||||||
import {
|
import {
|
||||||
addLbPurchaseApply,
|
addLbPurchaseApply,
|
||||||
deleteLbPurchaseApply,
|
deleteLbPurchaseApply,
|
||||||
|
exportColleagueVip,
|
||||||
exportLbPurchaseApply,
|
exportLbPurchaseApply,
|
||||||
getLbPurchaseApplyList,
|
getLbPurchaseApplyList,
|
||||||
needPrivilegeRecommenders,
|
needPrivilegeRecommenders,
|
||||||
@@ -381,6 +429,11 @@ export default {
|
|||||||
exportNewcomerPrivilegeRules: {
|
exportNewcomerPrivilegeRules: {
|
||||||
applyDateRange: [{ required: true, message: '请选择申请日期范围', trigger: 'change' }]
|
applyDateRange: [{ required: true, message: '请选择申请日期范围', trigger: 'change' }]
|
||||||
},
|
},
|
||||||
|
exportColleaguePrivilegeDialogVisible: false,
|
||||||
|
exportColleaguePrivilegeLoading: false,
|
||||||
|
exportColleaguePrivilegeApplyDateStart: today,
|
||||||
|
exportColleaguePrivilegeApplyDateEnd: today,
|
||||||
|
exportColleaguePrivilegeTenantId: '',
|
||||||
privilegeDateRange: [today, today],
|
privilegeDateRange: [today, today],
|
||||||
privilegeList: [],
|
privilegeList: [],
|
||||||
queryParams: {
|
queryParams: {
|
||||||
@@ -629,6 +682,64 @@ export default {
|
|||||||
this.exportNewcomerPrivilegeTenantIdDisplay = ''
|
this.exportNewcomerPrivilegeTenantIdDisplay = ''
|
||||||
this.exportNewcomerPrivilegeLoading = false
|
this.exportNewcomerPrivilegeLoading = false
|
||||||
},
|
},
|
||||||
|
openExportColleaguePrivilegeDialog() {
|
||||||
|
const today = this.getCurrentDate()
|
||||||
|
const tenantId = this.getTenantIdFromBusinessHeaders()
|
||||||
|
if (
|
||||||
|
Array.isArray(this.privilegeDateRange) &&
|
||||||
|
this.privilegeDateRange.length === 2 &&
|
||||||
|
this.privilegeDateRange[0] &&
|
||||||
|
this.privilegeDateRange[1]
|
||||||
|
) {
|
||||||
|
this.exportColleaguePrivilegeApplyDateStart = this.privilegeDateRange[0]
|
||||||
|
this.exportColleaguePrivilegeApplyDateEnd = this.privilegeDateRange[1]
|
||||||
|
} else {
|
||||||
|
this.exportColleaguePrivilegeApplyDateStart = today
|
||||||
|
this.exportColleaguePrivilegeApplyDateEnd = today
|
||||||
|
}
|
||||||
|
this.exportColleaguePrivilegeTenantId = tenantId
|
||||||
|
this.exportColleaguePrivilegeDialogVisible = true
|
||||||
|
},
|
||||||
|
resetExportColleaguePrivilegeDialog() {
|
||||||
|
const today = this.getCurrentDate()
|
||||||
|
this.exportColleaguePrivilegeApplyDateStart = today
|
||||||
|
this.exportColleaguePrivilegeApplyDateEnd = today
|
||||||
|
this.exportColleaguePrivilegeTenantId = ''
|
||||||
|
this.exportColleaguePrivilegeLoading = false
|
||||||
|
},
|
||||||
|
submitExportColleaguePrivilege() {
|
||||||
|
const applyDateStart = this.exportColleaguePrivilegeApplyDateStart
|
||||||
|
const applyDateEnd = this.exportColleaguePrivilegeApplyDateEnd
|
||||||
|
const tenantId = (this.exportColleaguePrivilegeTenantId || '').trim()
|
||||||
|
if (!applyDateStart || !applyDateEnd) {
|
||||||
|
this.$message.warning('请选择申请开始日期与结束日期')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!tenantId) {
|
||||||
|
this.$message.warning('请输入租户ID')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.exportColleaguePrivilegeLoading = true
|
||||||
|
exportColleagueVip({ applyDateStart, applyDateEnd, tenantId })
|
||||||
|
.then((blob) => {
|
||||||
|
const safeBlob = blob instanceof Blob ? blob : new Blob([blob], {
|
||||||
|
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||||
|
})
|
||||||
|
const url = window.URL.createObjectURL(safeBlob)
|
||||||
|
const link = document.createElement('a')
|
||||||
|
link.href = url
|
||||||
|
link.download = `colleagueVip_${applyDateStart}_${applyDateEnd}_${tenantId}.xlsx`
|
||||||
|
document.body.appendChild(link)
|
||||||
|
link.click()
|
||||||
|
document.body.removeChild(link)
|
||||||
|
window.URL.revokeObjectURL(url)
|
||||||
|
this.$message.success('导出成功')
|
||||||
|
this.exportColleaguePrivilegeDialogVisible = false
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.exportColleaguePrivilegeLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
handleViewPrivilege() {
|
handleViewPrivilege() {
|
||||||
if (!Array.isArray(this.privilegeDateRange) || this.privilegeDateRange.length !== 2) {
|
if (!Array.isArray(this.privilegeDateRange) || this.privilegeDateRange.length !== 2) {
|
||||||
this.$message.warning('请选择开始日期和结束日期')
|
this.$message.warning('请选择开始日期和结束日期')
|
||||||
|
|||||||
Reference in New Issue
Block a user