提交 cac1397a 作者: 毛细亚

更新企微侧边栏

上级 c446a18e
...@@ -1453,3 +1453,17 @@ export function useRightList(data) { ...@@ -1453,3 +1453,17 @@ export function useRightList(data) {
}) })
}) })
} }
// 发送邮件
export function sendEmail(data) {
return new Promise((resolve, reject) => {
cross_systemRequest({
system: 'zhangyou',
api: '/api/operator_task/sendEmail',
params: data
}).then((res) => {
resolve(res)
}).catch((error) => {
reject(error)
})
})
}
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
> >
<div> <div>
<el-form ref="ruleForm" :model="ruleForm" label-width="100px" class="content"> <el-form ref="ruleForm" :model="ruleForm" label-width="100px" class="content">
<el-form-item label="选择角色"> <el-form-item label="选择角色:">
<el-select v-model="ruleForm.role_id" placeholder="请选择角色" style="width:90%;margin-bottom:10px;" @change="selectRole"> <el-select v-model="ruleForm.role_id" placeholder="请选择角色" style="width:90%;margin-bottom:10px;" @change="selectRole">
<el-option <el-option
v-for="(item,index) in roleList" v-for="(item,index) in roleList"
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="活动类型"> <el-form-item label="活动类型:">
<el-select v-model="ruleForm.gift_type" placeholder="请选择" style="width:90%;margin-bottom:10px;" @change="giftTypeResult"> <el-select v-model="ruleForm.gift_type" placeholder="请选择" style="width:90%;margin-bottom:10px;" @change="giftTypeResult">
<el-option <el-option
v-for="(item,index) in giftTypeList" v-for="(item,index) in giftTypeList"
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 活动类型为角色累充的时候 活动可以多选其他的都为单选 --> <!-- 活动类型为角色累充的时候 活动可以多选其他的都为单选 -->
<el-form-item label="选择活动" prop="rule_id"> <el-form-item label="选择活动:" prop="rule_id">
<el-select v-model="ruleForm.rule_id" :disabled="activeList.length==0" placeholder="请选择" style="width:90%;margin-bottom:10px;" :multiple="ruleForm.gift_type==1 || ruleForm.gift_type == 4 || ruleForm.gift_type== 5 " clearable @change="activeListResult"> <el-select v-model="ruleForm.rule_id" :disabled="activeList.length==0" placeholder="请选择" style="width:90%;margin-bottom:10px;" :multiple="ruleForm.gift_type==1 || ruleForm.gift_type == 4 || ruleForm.gift_type== 5 " clearable @change="activeListResult">
<el-option <el-option
v-for="(item,index) in activeList" v-for="(item,index) in activeList"
...@@ -56,11 +56,11 @@ ...@@ -56,11 +56,11 @@
</el-form> </el-form>
<!-- 申请礼包 --> <!-- 申请礼包 -->
<!-- 角色累充 --> <!-- 角色累充 -->
<roleRecharge v-if="showGiftDetails && (ruleForm.gift_type==1 || ruleForm.gift_type==4 || ruleForm.gift_type==5) && roleActiveInfo.length>0" :show.sync="showGiftDetails" :request-loading="requestLoading" :active-info="roleActiveInfo" :gift-info="giftDetailsInfo" title="礼包详情" /> <roleRecharge v-if="showGiftDetails && (ruleForm.gift_type==1 || ruleForm.gift_type==4 || ruleForm.gift_type==5) && roleActiveInfo.length>0" :show.sync="showGiftDetails" :request-loading="requestLoading" :active-info="roleActiveInfo" :task_id="task_id" :gift-info="giftDetailsInfo" title="礼包详情" />
<!-- 时间段累充 和 单日累充 积分关的情况 --> <!-- 时间段累充 和 单日累充 积分关的情况 -->
<roleTimeRecharge v-if="showGiftDetails && (ruleForm.gift_type==2 || (ruleForm.gift_type==3 && activeInfo.exchange_score_status==2 ) ) && activeInfo.id " :change-date="changeDate" :request-loading="requestLoading" :show.sync="showGiftDetails" :active-info="activeInfo" :gift-info="giftDetailsInfo" title="礼包详情" @changeDateResult="changeDateResult" @giftDetailsInfo="requestDetailsInfo" /> <roleTimeRecharge v-if="showGiftDetails && (ruleForm.gift_type==2 || (ruleForm.gift_type==3 && activeInfo.exchange_score_status==2 ) ) && activeInfo.id " :change-date="changeDate" :request-loading="requestLoading" :task_id="task_id" :show.sync="showGiftDetails" :active-info="activeInfo" :gift-info="giftDetailsInfo" title="礼包详情" @changeDateResult="changeDateResult" @giftDetailsInfo="requestDetailsInfo" />
<!-- 单日累充 积分开的情况 --> <!-- 单日累充 积分开的情况 -->
<oneDayCharge v-if="showGiftDetails && ruleForm.gift_type==3 && activeInfo.exchange_score_status==1 && activeInfo.id" :show.sync="showGiftDetails" :request-loading="requestLoading" :active-info="activeInfo" :change-date="changeDate" :gift-info="giftDetailsInfo" title="礼包详情" @changeDateResult="changeDateResult" @giftDetailsInfo="requestDetailsInfo" /> <oneDayCharge v-if="showGiftDetails && ruleForm.gift_type==3 && activeInfo.exchange_score_status==1 && activeInfo.id" :show.sync="showGiftDetails" :task_id="task_id" :request-loading="requestLoading" :active-info="activeInfo" :change-date="changeDate" :gift-info="giftDetailsInfo" title="礼包详情" @changeDateResult="changeDateResult" @giftDetailsInfo="requestDetailsInfo" />
</div> </div>
</el-drawer> </el-drawer>
</template> </template>
...@@ -79,8 +79,8 @@ ...@@ -79,8 +79,8 @@
oneDayCharge, // 单日累充 oneDayCharge, // 单日累充
roleTimeRecharge // 角色时间段累充 roleTimeRecharge // 角色时间段累充
}, },
// type 3:image 4:video // type 3:image 4:video task_id // 账号任务点击礼包申请过来传递的任务id member_id // 我的任务 任务详情 点击 礼包申请的时候 需要用到任务详情的 member_id,这时候需要传递过来
props: ['show', 'width', 'title'], props: ['show', 'width', 'title', 'task_id','member_id'],
data() { data() {
return { return {
roleList: [], roleList: [],
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
export default { export default {
name: 'confirmLayer', name: 'confirmLayer',
// type 3:image 4:video // type 3:image 4:video
props: ['show', 'width', 'title', 'activeInfo', 'remark'], props: ['show', 'width', 'title', 'activeInfo', 'remark','task_id'],
data() { data() {
return { return {
loading: false loading: false
...@@ -104,6 +104,7 @@ ...@@ -104,6 +104,7 @@
role_id, role_id,
remark: this.remark, remark: this.remark,
recharge_date: this.activeInfo[0].recharge_date || '', recharge_date: this.activeInfo[0].recharge_date || '',
task_id: this.task_id || null,
create_user: this.cser_name, create_user: this.cser_name,
rule: rule rule: rule
} }
......
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
<el-button class="btn" size="small" @click="close">取 消</el-button> <el-button class="btn" size="small" @click="close">取 消</el-button>
</span> </span>
<!-- 确认弹窗 --> <!-- 确认弹窗 -->
<confirmLayer v-if="showConfirmLayer" :remark="remark" :active-info="[activeInfo]" :show.sync="showConfirmLayer" title="请核对申请奖品信息" @close="close" /> <confirmLayer v-if="showConfirmLayer" :remark="remark" :task_id="task_id" :active-info="[activeInfo]" :show.sync="showConfirmLayer" title="请核对申请奖品信息" @close="close" />
</div> </div>
</el-drawer> </el-drawer>
</template> </template>
...@@ -142,7 +142,7 @@ export default { ...@@ -142,7 +142,7 @@ export default {
components: { components: {
confirmLayer confirmLayer
}, },
props: ['show', 'width', 'title', 'info', 'body', 'giftInfo', 'activeInfo', 'changeDate','requestLoading'], props: ['show', 'width', 'title', 'info', 'body', 'giftInfo', 'activeInfo', 'changeDate','requestLoading','task_id'],
data() { data() {
return { return {
remark: '', remark: '',
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<el-button size="small" class="btn" @click="close">取 消</el-button> <el-button size="small" class="btn" @click="close">取 消</el-button>
</span> </span>
<!-- 确认弹窗 --> <!-- 确认弹窗 -->
<confirmLayer :is-submit="isSubmit" :remark="remark" :active-info="activeInfo" :show.sync="showConfirmLayer" title="请核对申请奖品信息" @close="close" /> <confirmLayer :is-submit="isSubmit" :remark="remark" :task_id="task_id" :active-info="activeInfo" :show.sync="showConfirmLayer" title="请核对申请奖品信息" @close="close" />
</div> </div>
</el-drawer> </el-drawer>
</template> </template>
...@@ -72,7 +72,7 @@ export default { ...@@ -72,7 +72,7 @@ export default {
components: { components: {
confirmLayer confirmLayer
}, },
props: ['show', 'width', 'title', 'info', 'body', 'giftInfo', 'activeInfo','requestLoading'], props: ['show', 'width', 'title', 'info', 'body', 'giftInfo', 'activeInfo','requestLoading','task_id'],
data() { data() {
return { return {
isSubmit: false, isSubmit: false,
...@@ -121,6 +121,7 @@ export default { ...@@ -121,6 +121,7 @@ export default {
role_id, role_id,
remark: this.remark, remark: this.remark,
recharge_date: this.activeInfo[0].recharge_date || '', recharge_date: this.activeInfo[0].recharge_date || '',
task_id: this.task_id || null,
create_user: this.cser_name, create_user: this.cser_name,
rule: rule rule: rule
} }
......
...@@ -247,6 +247,7 @@ ...@@ -247,6 +247,7 @@
<confirmLayer <confirmLayer
v-if="showConfirmLayer" v-if="showConfirmLayer"
:remark="remark" :remark="remark"
:task_id="task_id"
:active-info="[activeInfo]" :active-info="[activeInfo]"
:show.sync="showConfirmLayer" :show.sync="showConfirmLayer"
title="请核对申请奖品信息" title="请核对申请奖品信息"
...@@ -266,7 +267,7 @@ export default { ...@@ -266,7 +267,7 @@ export default {
components: { components: {
confirmLayer confirmLayer
}, },
props: ['show', 'width', 'title', 'info', 'body', 'giftInfo', 'activeInfo', 'changeDate','requestLoading'], props: ['show', 'width', 'title', 'info', 'body', 'giftInfo', 'activeInfo', 'changeDate','requestLoading','task_id'],
data() { data() {
return { return {
remark: '', remark: '',
......
<!--
* @Description: 发送邮件弹窗组件
* @Date: 2025-10-15
-->
<template>
<el-dialog
:visible.sync="dialogVisible"
title="发送邮件"
width="300px"
:close-on-click-modal="false"
:before-close="handleClose"
append-to-body
>
<el-form
ref="emailForm"
:model="formData"
:rules="formRules"
label-width="80px"
class="email-form"
>
<el-form-item label="邮件标题:" prop="email_title">
<el-input
v-model="formData.email_title"
placeholder="请输入邮件标题"
maxlength="100"
show-word-limit
clearable
/>
</el-form-item>
<el-form-item label="邮件内容:" prop="email_content">
<el-input
v-model="formData.email_content"
type="textarea"
:rows="8"
placeholder="请输入邮件内容"
maxlength="1000"
show-word-limit
clearable
/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="handleClose">取消</el-button>
<el-button
type="primary"
:loading="sending"
@click="handleConfirm"
size="small"
>确定</el-button>
</div>
</el-dialog>
</template>
<script>
import { sendEmail } from '@/api/game'
export default {
name: 'SendEmailDialog',
props: {
// 控制弹窗显示
visible: {
type: Boolean,
default: false
},
// 任务ID
taskId: {
type: [String, Number],
required: true
}
},
data() {
return {
// 弹窗显示状态
dialogVisible: false,
// 发送中状态
sending: false,
// 表单数据
formData: {
email_title: '',
email_content: ''
},
// 表单验证规则
formRules: {
email_title: [
{ required: true, message: '请输入邮件标题', trigger: 'blur' },
{ min: 1, max: 100, message: '邮件标题长度在 1 到 100 个字符', trigger: 'blur' }
],
email_content: [
{ required: true, message: '请输入邮件内容', trigger: 'blur' },
{ min: 1, max: 1000, message: '邮件内容长度在 1 到 1000 个字符', trigger: 'blur' }
]
}
}
},
watch: {
visible(val) {
this.dialogVisible = val
if (!val) {
// 关闭时重置表单
this.resetForm()
}
}
},
methods: {
/**
* 关闭弹窗
*/
handleClose() {
this.dialogVisible = false
this.$emit('update:visible', false)
this.resetForm()
},
/**
* 重置表单
*/
resetForm() {
this.formData = {
email_title: '',
email_content: ''
}
// 清除表单验证
this.$nextTick(() => {
this.$refs.emailForm && this.$refs.emailForm.clearValidate()
})
},
/**
* 确认发送邮件
*/
handleConfirm() {
// 表单验证
this.$refs.emailForm.validate((valid) => {
if (valid) {
this.sendEmailRequest()
} else {
console.log('表单验证失败')
return false
}
})
},
/**
* 发送邮件请求
*/
async sendEmailRequest() {
try {
this.sending = true
const params = {
id: this.taskId,
email_title: this.formData.email_title,
email_content: this.formData.email_content
}
const res = await sendEmail(params)
if (res.status_code === 1) {
this.$message({
message: res.msg || '邮件发送成功',
type: 'success'
})
// 通知父组件发送成功
this.$emit('send-success')
// 关闭弹窗
this.handleClose()
}
} catch (error) {
console.error('发送邮件失败:', error)
} finally {
this.sending = false
}
}
}
}
</script>
<style lang="scss" scoped>
.email-form {
::v-deep .el-form-item {
margin-bottom: 22px;
}
::v-deep .el-textarea__inner {
resize: vertical;
font-family: inherit;
}
::v-deep .el-input__count {
background-color: transparent;
}
}
.dialog-footer {
text-align: right;
padding: 10px 20px 0;
border: none;
.el-button {
min-width: 80px;
}
}
</style>
...@@ -221,6 +221,27 @@ ...@@ -221,6 +221,27 @@
</div> </div>
</div> </div>
</div> </div>
<!-- 发送邮件按钮 -->
<!-- -->
<el-button
v-if="kfhList.length == 0 && assionInfo?.email?.is_send_email == 1 && !assionInfo?.email?.send_status && assionInfo.status != 3"
type="primary"
size="small"
style="margin-top: 20px; margin-right: 10px"
@click="showEmailDialog = true"
>发送邮件</el-button>
<!-- 礼包申请按钮 单日申请礼包任务和累充礼包申请时显示 -->
<!-- v-if="(assionInfo.plan_type == 19 || assionInfo.plan_type == 21) && assionInfo.status != 3" -->
<el-button
v-if="(assionInfo.plan_type == 19 || assionInfo.plan_type == 21) && assionInfo.status != 3"
type="primary"
size="small"
style="margin-top: 20px; margin-right: 10px"
:loading="loading"
@click="giftApply()"
>礼包申请</el-button>
<!-- 完成任务按钮 -->
<el-button <el-button
v-if="kfhList.length == 0 && taskDetails.status != 3 && !is_finished" v-if="kfhList.length == 0 && taskDetails.status != 3 && !is_finished"
type="primary" type="primary"
...@@ -228,6 +249,7 @@ ...@@ -228,6 +249,7 @@
style="margin-top: 20px" style="margin-top: 20px"
@click="showLayer = true" @click="showLayer = true"
>完成任务</el-button> >完成任务</el-button>
</div> </div>
</div> </div>
</el-drawer> </el-drawer>
...@@ -301,6 +323,24 @@ ...@@ -301,6 +323,24 @@
</el-form> </el-form>
</div> </div>
</layer> </layer>
<!-- 发送邮件弹窗 -->
<SendEmailDialog
:visible.sync="showEmailDialog"
:task-id="assionInfo.id"
@send-success="handleEmailSendSuccess"
/>
<!-- 礼包申请弹窗 -->
<applyGift
v-if="showApplyGift"
:show.sync="showApplyGift"
:member_id="assionInfo.member_id"
title="礼包申请"
width="25%"
:task_id="task_id"
@requestData="handleGiftApplySuccess"
/>
</div> </div>
</template> </template>
<script> <script>
...@@ -315,13 +355,17 @@ ...@@ -315,13 +355,17 @@
} from '@/api/game' } from '@/api/game'
import { memberBindExternalUser } from '@/api/works' import { memberBindExternalUser } from '@/api/works'
import layer from '@/components/dialog.vue' import layer from '@/components/dialog.vue'
import SendEmailDialog from './SendEmailDialog.vue'
import applyGift from '@/views/components/giftRecord/applyGift.vue'
export default { export default {
computed: { computed: {
...mapState('game', ['taskDetails']), ...mapState('game', ['taskDetails']),
...mapState('user', ['userInfo']) ...mapState('user', ['userInfo'])
}, },
components: { components: {
layer layer,
SendEmailDialog,
applyGift
}, },
props: ['show'], props: ['show'],
data() { data() {
...@@ -337,6 +381,9 @@ ...@@ -337,6 +381,9 @@
assionInfo: {}, assionInfo: {},
current: 0, current: 0,
showLayer: false, showLayer: false,
showEmailDialog: false, // 控制发送邮件弹窗显示
showApplyGift: false, // 控制礼包申请弹窗显示
task_id: null, // 礼包申请任务ID
dialogRemake: '', dialogRemake: '',
webForm: { webForm: {
trace_result: '', trace_result: '',
...@@ -541,7 +588,38 @@ ...@@ -541,7 +588,38 @@
} catch (error) { } catch (error) {
this.loading = false this.loading = false
} }
},
/**
* 处理邮件发送成功的回调
* 设置任务的邮件发送状态为已发送
*/
handleEmailSendSuccess() {
// 标记任务已发送邮件
this.assionInfo.send_status = 1
// 可以选择刷新任务详情
// this.requestTaskDetails()
},
/**
* 显示礼包申请弹窗
* @param {Object} item - 任务信息对象,包含任务ID
*/
giftApply() {
this.task_id = this.assionInfo.id || null
this.showApplyGift = true
},
/**
* 处理礼包申请完成后的回调
* 关闭弹窗并显示成功提示
*/
handleGiftApplySuccess() {
this.showApplyGift = false
this.$message({
message: '礼包申请已提交',
type: 'success'
})
} }
} }
} }
</script> </script>
......
...@@ -76,9 +76,11 @@ ...@@ -76,9 +76,11 @@
</div> </div>
</div> </div>
<div class="btns rowFlex allCenter" style="margin-top: 20px"> <div class="btns rowFlex allCenter" style="margin-top: 20px">
<el-button :disabled="item.status == 3" :loading="remarkLoading" <el-button size="small" :disabled="item.status == 3" :loading="remarkLoading"
@click="saveRemak(item, index)">保存</el-button> @click="saveRemak(item, index)">保存</el-button>
<el-button type="primary" :disabled="item.status == 3" :loading="taskLoading" <!-- 单日申请礼包任务才展示礼包申请按钮 v-if="item.plan_type == 19 || item.plan_type == 21" 新增 累充礼包申请时 和 单日礼包申请一样 显示 礼包申请按钮 -->
<el-button type="primary" size="small" v-if="item.plan_type == 19 || item.plan_type == 21" :loading="taskLoading" @click="giftApply(item)">礼包申请</el-button>
<el-button type="primary" size="small" :disabled="item.status == 3" :loading="taskLoading"
@click="completeTask(item, index)">保存并完成任务</el-button> @click="completeTask(item, index)">保存并完成任务</el-button>
</div> </div>
</el-collapse-item> </el-collapse-item>
...@@ -92,6 +94,15 @@ ...@@ -92,6 +94,15 @@
</div> </div>
</div> </div>
</div> </div>
<!-- 礼包申请弹窗 -->
<applyGift
v-if="showApplyGift"
:show.sync="showApplyGift"
title="礼包申请"
width="25%"
:task_id="task_id"
@requestData="handleGiftApplySuccess"
/>
</div> </div>
</template> </template>
<script> <script>
...@@ -99,10 +110,12 @@ ...@@ -99,10 +110,12 @@
import { mapState } from 'vuex' import { mapState } from 'vuex'
import textEditor from '@/components/textEditor.vue' import textEditor from '@/components/textEditor.vue'
import noContent from '@/components/noContent.vue' import noContent from '@/components/noContent.vue'
import applyGift from '@/views/components/giftRecord/applyGift.vue'
export default { export default {
components: { components: {
textEditor, textEditor,
noContent, noContent,
applyGift
}, },
data() { data() {
return { return {
...@@ -131,6 +144,8 @@ ...@@ -131,6 +144,8 @@
showLayer: false, showLayer: false,
taskLoading: false, taskLoading: false,
remarkLoading: false, remarkLoading: false,
showApplyGift: false,
task_id: null,
pageInfo: { pageInfo: {
page: 0, page: 0,
page_size: 20, page_size: 20,
...@@ -190,6 +205,24 @@ ...@@ -190,6 +205,24 @@
this.searchconditionError() this.searchconditionError()
}, },
methods: { methods: {
/**
* 显示礼包申请弹窗
*/
giftApply(item) {
this.task_id = item.id || null
this.showApplyGift = true
},
/**
* 处理礼包申请完成后的回调
* 关闭弹窗并显示成功提示
*/
handleGiftApplySuccess() {
this.showApplyGift = false
this.$message({
message: '礼包申请已提交',
type: 'success'
})
},
searchcondition() { searchcondition() {
const data = { const data = {
type: 'dictionaries', type: 'dictionaries',
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论