开通同事特权
This commit is contained in:
@@ -64,3 +64,18 @@ export function syncHxrAdminUserVip(params) {
|
|||||||
skipResponseNormalize: true
|
skipResponseNormalize: true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 按申请日期区间与租户同步同事 hxrd 用户 VIP(可能较慢,依赖外部管理端) */
|
||||||
|
export function syncHxrAdminColleagueVip(params) {
|
||||||
|
return request({
|
||||||
|
url: '/lbPurchaseApply/syncHxrAdminColleagueVip',
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
applyDateStart: params.applyDateStart,
|
||||||
|
applyDateEnd: params.applyDateEnd,
|
||||||
|
tenantId: params.tenantId
|
||||||
|
},
|
||||||
|
timeout: 120000,
|
||||||
|
skipResponseNormalize: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -78,6 +78,12 @@ service.interceptors.request.use(
|
|||||||
config.headers[key] = safe
|
config.headers[key] = safe
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
if (config.tenantId) {
|
||||||
|
const tenantHeader = coerceBusinessHeaderValueForXHR('X-Tenant-Id', config.tenantId)
|
||||||
|
if (tenantHeader !== '') {
|
||||||
|
config.headers['X-Tenant-Id'] = tenantHeader
|
||||||
|
}
|
||||||
|
}
|
||||||
return config
|
return config
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
|
|||||||
@@ -48,6 +48,9 @@
|
|||||||
<el-button type="success" icon="el-icon-present" style="margin-left: 12px" @click="openNewcomerVipDialog">
|
<el-button type="success" icon="el-icon-present" style="margin-left: 12px" @click="openNewcomerVipDialog">
|
||||||
开通新人特权
|
开通新人特权
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button type="success" icon="el-icon-present" style="margin-left: 12px" @click="openColleagueVipDialog">
|
||||||
|
开通同事特权
|
||||||
|
</el-button>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card class="table-container" shadow="never">
|
<el-card class="table-container" shadow="never">
|
||||||
@@ -229,6 +232,45 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-dialog
|
||||||
|
title="开通同事特权"
|
||||||
|
:visible.sync="colleagueVipDialogVisible"
|
||||||
|
width="520px"
|
||||||
|
@close="resetColleagueVipDialog"
|
||||||
|
>
|
||||||
|
<el-form label-width="120px">
|
||||||
|
<el-form-item label="申请开始日期" required>
|
||||||
|
<el-date-picker
|
||||||
|
v-model="colleagueVipApplyDateStart"
|
||||||
|
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="colleagueVipApplyDateEnd"
|
||||||
|
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="colleagueVipTenantId" clearable placeholder="请输入租户ID" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="colleagueVipDialogVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" :loading="colleagueVipSubmitLoading" @click="handleConfirmColleagueVip">
|
||||||
|
确定
|
||||||
|
</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" />
|
||||||
@@ -254,6 +296,7 @@ import {
|
|||||||
getLbPurchaseApplyList,
|
getLbPurchaseApplyList,
|
||||||
needPrivilegeRecommenders,
|
needPrivilegeRecommenders,
|
||||||
parseLbPurchaseApplyFromOrderInfo,
|
parseLbPurchaseApplyFromOrderInfo,
|
||||||
|
syncHxrAdminColleagueVip,
|
||||||
syncHxrAdminUserVip,
|
syncHxrAdminUserVip,
|
||||||
updateLbPurchaseApply
|
updateLbPurchaseApply
|
||||||
} from '@/api/lb-purchase-apply'
|
} from '@/api/lb-purchase-apply'
|
||||||
@@ -269,6 +312,11 @@ export default {
|
|||||||
newcomerVipApplyDateRange: [today, today],
|
newcomerVipApplyDateRange: [today, today],
|
||||||
newcomerVipMaxOrder: null,
|
newcomerVipMaxOrder: null,
|
||||||
newcomerVipTenantIdDisplay: '',
|
newcomerVipTenantIdDisplay: '',
|
||||||
|
colleagueVipDialogVisible: false,
|
||||||
|
colleagueVipSubmitLoading: false,
|
||||||
|
colleagueVipApplyDateStart: today,
|
||||||
|
colleagueVipApplyDateEnd: today,
|
||||||
|
colleagueVipTenantId: '',
|
||||||
loading: false,
|
loading: false,
|
||||||
submitLoading: false,
|
submitLoading: false,
|
||||||
parseAiLoading: false,
|
parseAiLoading: false,
|
||||||
@@ -638,6 +686,65 @@ export default {
|
|||||||
this.newcomerVipTenantIdDisplay = ''
|
this.newcomerVipTenantIdDisplay = ''
|
||||||
this.newcomerVipSubmitLoading = false
|
this.newcomerVipSubmitLoading = false
|
||||||
},
|
},
|
||||||
|
openColleagueVipDialog() {
|
||||||
|
const today = this.getCurrentDate()
|
||||||
|
const tenantId = this.getTenantIdFromBusinessHeaders()
|
||||||
|
if (
|
||||||
|
Array.isArray(this.privilegeDateRange) &&
|
||||||
|
this.privilegeDateRange.length === 2 &&
|
||||||
|
this.privilegeDateRange[0] &&
|
||||||
|
this.privilegeDateRange[1]
|
||||||
|
) {
|
||||||
|
this.colleagueVipApplyDateStart = this.privilegeDateRange[0]
|
||||||
|
this.colleagueVipApplyDateEnd = this.privilegeDateRange[1]
|
||||||
|
} else {
|
||||||
|
this.colleagueVipApplyDateStart = today
|
||||||
|
this.colleagueVipApplyDateEnd = today
|
||||||
|
}
|
||||||
|
this.colleagueVipTenantId = tenantId
|
||||||
|
this.colleagueVipDialogVisible = true
|
||||||
|
},
|
||||||
|
resetColleagueVipDialog() {
|
||||||
|
const today = this.getCurrentDate()
|
||||||
|
this.colleagueVipApplyDateStart = today
|
||||||
|
this.colleagueVipApplyDateEnd = today
|
||||||
|
this.colleagueVipTenantId = ''
|
||||||
|
this.colleagueVipSubmitLoading = false
|
||||||
|
},
|
||||||
|
handleConfirmColleagueVip() {
|
||||||
|
const applyDateStart = this.colleagueVipApplyDateStart
|
||||||
|
const applyDateEnd = this.colleagueVipApplyDateEnd
|
||||||
|
const tenantId = (this.colleagueVipTenantId || '').trim()
|
||||||
|
if (!applyDateStart || !applyDateEnd) {
|
||||||
|
this.$message.warning('请选择申请开始日期与结束日期')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!tenantId) {
|
||||||
|
this.$message.warning('请输入租户ID')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.colleagueVipSubmitLoading = true
|
||||||
|
syncHxrAdminColleagueVip({
|
||||||
|
applyDateStart,
|
||||||
|
applyDateEnd,
|
||||||
|
tenantId
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
const ok = res && (res.success === true || res.code === 200 || res.code === 20000)
|
||||||
|
if (ok) {
|
||||||
|
this.$message.success((res && res.message) || '同步成功')
|
||||||
|
this.colleagueVipDialogVisible = false
|
||||||
|
} else {
|
||||||
|
this.$message.error((res && (res.message || res.msg)) || '同步失败')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
// 错误提示由 @/utils/request 响应拦截器统一展示
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.colleagueVipSubmitLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
handleConfirmNewcomerVip() {
|
handleConfirmNewcomerVip() {
|
||||||
const tenantId = this.getTenantIdFromBusinessHeaders()
|
const tenantId = this.getTenantIdFromBusinessHeaders()
|
||||||
if (!tenantId) {
|
if (!tenantId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user