diff --git a/src/api/lb-order-row.js b/src/api/lb-order-row.js
index 290948b..35d06bc 100644
--- a/src/api/lb-order-row.js
+++ b/src/api/lb-order-row.js
@@ -39,3 +39,12 @@ export function syncLbOrderRowFromThird(data) {
data
})
}
+
+/** 按购买时间区间、租户 id 按日汇总生成 sum_data */
+export function generateLbOrderRowDailySum(data) {
+ return request({
+ url: '/lbOrderRow/generate-daily-sum',
+ method: 'post',
+ data
+ })
+}
diff --git a/src/api/lb-purchase-apply.js b/src/api/lb-purchase-apply.js
index 5c1a0ea..7d93c51 100644
--- a/src/api/lb-purchase-apply.js
+++ b/src/api/lb-purchase-apply.js
@@ -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(可能较慢,依赖外部管理端) */
export function syncHxrAdminColleagueVip(params) {
return request({
diff --git a/src/views/lb-business/order-manage/index.vue b/src/views/lb-business/order-manage/index.vue
index cce9304..95f207e 100644
--- a/src/views/lb-business/order-manage/index.vue
+++ b/src/views/lb-business/order-manage/index.vue
@@ -11,6 +11,12 @@
+
+
+
+
+
+
@@ -20,6 +26,12 @@
+
+
+
+
+
+
查询
清空
@@ -30,22 +42,30 @@
新增
同步订单
+ 汇总天数据
-
-
-
-
-
+
+
+
+
+
+ {{ formatIsResellLabel(scope.row) }}
+
+
+
+
+ {{ formatStatusLabel(scope.row) }}
+
+
-
编辑
@@ -214,6 +234,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
@@ -253,6 +300,7 @@
import {
addLbOrderRow,
deleteLbOrderRow,
+ generateLbOrderRowDailySum,
getLbOrderRowList,
syncLbOrderRowFromThird,
updateLbOrderRow
@@ -321,6 +369,20 @@ export default {
return {
loading: 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,
syncSubmitLoading: false,
syncForm: {
@@ -343,8 +405,11 @@ export default {
orderSn: '',
buyerId: '',
sellerId: '',
+ consignee: '',
+ phone: '',
status: '',
- isResell: undefined
+ isResell: undefined,
+ dataType: ''
},
form: emptyForm(),
formRules: {
@@ -366,6 +431,17 @@ export default {
const value = headers && headers['X-Tenant-Id']
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() {
this.loading = true
getLbOrderRowList(this.buildListParams())
@@ -395,10 +471,13 @@ export default {
orderSn: this.queryParams.orderSn || undefined,
buyerId: parseOptionalLong(this.queryParams.buyerId),
sellerId: parseOptionalLong(this.queryParams.sellerId),
+ consignee: this.queryParams.consignee || undefined,
+ phone: this.queryParams.phone || undefined,
status: parseOptionalInt(this.queryParams.status),
isResell: this.queryParams.isResell === 0 || this.queryParams.isResell === 1
? this.queryParams.isResell
- : undefined
+ : undefined,
+ dataType: this.queryParams.dataType || undefined
}
Object.keys(params).forEach((key) => {
if (params[key] === undefined || params[key] === '') delete params[key]
@@ -416,8 +495,11 @@ export default {
orderSn: '',
buyerId: '',
sellerId: '',
+ consignee: '',
+ phone: '',
status: '',
- isResell: undefined
+ isResell: undefined,
+ dataType: ''
}
this.fetchList()
},
@@ -615,6 +697,64 @@ export default {
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
+ })
+ })
}
}
}
diff --git a/src/views/lb-business/purchase-apply/index.vue b/src/views/lb-business/purchase-apply/index.vue
index 583c988..8f0cdf1 100644
--- a/src/views/lb-business/purchase-apply/index.vue
+++ b/src/views/lb-business/purchase-apply/index.vue
@@ -59,6 +59,14 @@
>
导出新人特权
+
+ 导出同事特权
+
@@ -314,6 +322,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -336,6 +383,7 @@
import {
addLbPurchaseApply,
deleteLbPurchaseApply,
+ exportColleagueVip,
exportLbPurchaseApply,
getLbPurchaseApplyList,
needPrivilegeRecommenders,
@@ -381,6 +429,11 @@ export default {
exportNewcomerPrivilegeRules: {
applyDateRange: [{ required: true, message: '请选择申请日期范围', trigger: 'change' }]
},
+ exportColleaguePrivilegeDialogVisible: false,
+ exportColleaguePrivilegeLoading: false,
+ exportColleaguePrivilegeApplyDateStart: today,
+ exportColleaguePrivilegeApplyDateEnd: today,
+ exportColleaguePrivilegeTenantId: '',
privilegeDateRange: [today, today],
privilegeList: [],
queryParams: {
@@ -629,6 +682,64 @@ export default {
this.exportNewcomerPrivilegeTenantIdDisplay = ''
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() {
if (!Array.isArray(this.privilegeDateRange) || this.privilegeDateRange.length !== 2) {
this.$message.warning('请选择开始日期和结束日期')