2025-03-23 09:18:42 +08:00
|
|
|
|
<!--
|
|
|
|
|
|
* @Descripttion:
|
|
|
|
|
|
* @version:
|
|
|
|
|
|
* @Author: kBank
|
|
|
|
|
|
* @Date: 2023-02-23 15:59:57
|
|
|
|
|
|
-->
|
|
|
|
|
|
<template>
|
|
|
|
|
|
<div class="page">
|
|
|
|
|
|
<!-- <topBar v-if="topList.length > 0"
|
|
|
|
|
|
:topList="topList"
|
|
|
|
|
|
:moren="moren"></topBar> -->
|
|
|
|
|
|
<div class="topbox">
|
|
|
|
|
|
<div
|
|
|
|
|
|
v-for="(item, index) in topList"
|
|
|
|
|
|
:key="index"
|
2025-09-17 17:52:03 +08:00
|
|
|
|
class="levelList_i"
|
|
|
|
|
|
:class="tabActive == item.id ? 'act' : ''"
|
2025-03-23 09:18:42 +08:00
|
|
|
|
@click.prevent="handleLink(item.id)"
|
|
|
|
|
|
>
|
|
|
|
|
|
{{ item.name }}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <div class="main_a"> -->
|
|
|
|
|
|
<div class="main">
|
|
|
|
|
|
<div v-show="tabActive == 0">
|
2025-04-01 23:46:26 +08:00
|
|
|
|
<div class="tit">{{ '基本信息' }}</div>
|
2025-09-17 17:52:03 +08:00
|
|
|
|
<div class="xian" />
|
2025-03-23 09:18:42 +08:00
|
|
|
|
<el-form
|
2025-09-17 17:52:03 +08:00
|
|
|
|
ref="ruleForm"
|
2025-03-23 09:18:42 +08:00
|
|
|
|
:model="ruleForm"
|
|
|
|
|
|
:rules="rules"
|
|
|
|
|
|
label-width="auto"
|
|
|
|
|
|
class="demo-ruleForm"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
<el-col :span="8">
|
2025-04-01 23:46:26 +08:00
|
|
|
|
<el-form-item :label="'活动名称'" prop="actName">
|
2025-03-23 09:18:42 +08:00
|
|
|
|
<el-input
|
|
|
|
|
|
v-model="ruleForm.actName"
|
2025-09-17 17:52:03 +08:00
|
|
|
|
clearable
|
2025-03-23 09:18:42 +08:00
|
|
|
|
:disabled="lookOver"
|
2025-09-17 17:52:03 +08:00
|
|
|
|
/>
|
2025-03-23 09:18:42 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
<el-col :span="16">
|
2025-04-01 23:46:26 +08:00
|
|
|
|
<el-form-item :label="'活动说明'" prop="actExplain">
|
2025-03-23 09:18:42 +08:00
|
|
|
|
<!-- <el-input clearable
|
|
|
|
|
|
type="textarea"
|
|
|
|
|
|
v-model="ruleForm.actExplain"
|
|
|
|
|
|
:disabled="lookOver"></el-input> -->
|
|
|
|
|
|
<editor
|
|
|
|
|
|
ref="sptwEditor"
|
|
|
|
|
|
v-model="ruleForm.actExplain"
|
2025-09-17 17:52:03 +08:00
|
|
|
|
:read-only="lookOver"
|
2025-03-23 09:18:42 +08:00
|
|
|
|
:min-height="196"
|
2025-09-17 17:52:03 +08:00
|
|
|
|
:upload-url="uploadImgUrl"
|
2025-03-23 09:18:42 +08:00
|
|
|
|
/>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
<el-col :span="8">
|
2025-04-01 23:46:26 +08:00
|
|
|
|
<el-form-item :label="'活动封面'" prop="actCover">
|
2025-03-23 09:18:42 +08:00
|
|
|
|
<imageUpload v-model="ruleForm.actCover" />
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
<el-col :span="8">
|
2025-04-01 23:46:26 +08:00
|
|
|
|
<el-form-item :label="'活动时间'" prop="ruleFormTime">
|
2025-03-23 09:18:42 +08:00
|
|
|
|
<el-date-picker
|
|
|
|
|
|
v-model="ruleForm.ruleFormTime"
|
2025-09-17 17:52:03 +08:00
|
|
|
|
:disabled="lookOver"
|
2025-09-23 17:27:11 +08:00
|
|
|
|
value-format="yyyy-MM-dd"
|
2025-09-23 17:32:54 +08:00
|
|
|
|
type="daterange"
|
2025-04-01 23:46:26 +08:00
|
|
|
|
:range-separator="'至'"
|
|
|
|
|
|
:start-placeholder="'开始日期'"
|
|
|
|
|
|
:end-placeholder="'结束日期'"
|
2025-09-17 17:52:03 +08:00
|
|
|
|
@change="changeTime"
|
|
|
|
|
|
/>
|
2025-03-23 09:18:42 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
<el-col :span="8">
|
2025-04-01 23:46:26 +08:00
|
|
|
|
<el-form-item :label="'展示时间'" prop="ruleFormTime1">
|
2025-03-23 09:18:42 +08:00
|
|
|
|
<el-date-picker
|
|
|
|
|
|
v-model="ruleForm.ruleFormTime1"
|
2025-09-17 17:52:03 +08:00
|
|
|
|
:disabled="lookOver"
|
2025-09-23 17:27:11 +08:00
|
|
|
|
value-format="yyyy-MM-dd"
|
|
|
|
|
|
type="daterange"
|
2025-04-01 23:46:26 +08:00
|
|
|
|
:range-separator="'至'"
|
|
|
|
|
|
:start-placeholder="'开始日期'"
|
|
|
|
|
|
:end-placeholder="'结束日期'"
|
2025-09-17 17:52:03 +08:00
|
|
|
|
@change="changeTime1"
|
|
|
|
|
|
/>
|
2025-03-23 09:18:42 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
2025-09-17 17:52:03 +08:00
|
|
|
|
<directUpdata v-show="tabActive == 2" ref="directUpdata" />
|
2025-09-23 16:57:32 +08:00
|
|
|
|
|
2025-03-23 09:18:42 +08:00
|
|
|
|
</div>
|
2025-09-17 17:52:03 +08:00
|
|
|
|
<div v-show="controlType != 4" class="footer">
|
|
|
|
|
|
<el-button size="small" class="cancelBtn" @click="$router.back()">
|
|
|
|
|
|
{{ '取消' }}</el-button>
|
|
|
|
|
|
<el-button size="small" class="sureBtn" @click="submit('ruleForm')">
|
|
|
|
|
|
{{ '确认' }}</el-button>
|
2025-03-23 09:18:42 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<!-- </div> -->
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
2025-09-17 17:52:03 +08:00
|
|
|
|
import Editor from '@/components/Editor'
|
2025-03-23 09:18:42 +08:00
|
|
|
|
|
2025-09-17 17:52:03 +08:00
|
|
|
|
import * as api from '@/api/giftGoods.js'
|
|
|
|
|
|
import topBar from '@/components/topBar'
|
|
|
|
|
|
import ImageUpload from '@/components/ImageUpload'
|
|
|
|
|
|
import directUpdata from '@/views/marketing/directGifts/directUpdata'
|
2025-03-23 09:18:42 +08:00
|
|
|
|
export default {
|
2025-09-23 16:57:32 +08:00
|
|
|
|
name: 'AddDirectPushUpgrade',
|
2025-03-23 09:18:42 +08:00
|
|
|
|
components: {
|
|
|
|
|
|
ImageUpload,
|
|
|
|
|
|
directUpdata,
|
2025-09-17 17:52:03 +08:00
|
|
|
|
Editor
|
2025-03-23 09:18:42 +08:00
|
|
|
|
},
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
|
|
|
|
|
tabActive: 0,
|
|
|
|
|
|
topList: [
|
|
|
|
|
|
{
|
2025-04-01 23:46:26 +08:00
|
|
|
|
name: '基本信息',
|
2025-09-17 17:52:03 +08:00
|
|
|
|
id: 0
|
2025-03-23 09:18:42 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2025-04-01 23:46:26 +08:00
|
|
|
|
name: '直推升级',
|
2025-09-17 17:52:03 +08:00
|
|
|
|
id: 2
|
|
|
|
|
|
}
|
2025-03-23 09:18:42 +08:00
|
|
|
|
],
|
2025-09-17 17:52:03 +08:00
|
|
|
|
uploadImgUrl: process.env.VUE_APP_BASE_API + '/system/upload',
|
2025-03-23 09:18:42 +08:00
|
|
|
|
ruleForm: {
|
|
|
|
|
|
checked1: false,
|
|
|
|
|
|
checked2: false,
|
|
|
|
|
|
checked3: false,
|
|
|
|
|
|
levelList: [],
|
|
|
|
|
|
realList: [],
|
|
|
|
|
|
centerList: [],
|
|
|
|
|
|
goalMemberConfigList: [],
|
|
|
|
|
|
ruleFormTime: [],
|
2025-09-17 17:52:03 +08:00
|
|
|
|
ruleFormTime1: []
|
2025-03-23 09:18:42 +08:00
|
|
|
|
},
|
|
|
|
|
|
rules: {
|
|
|
|
|
|
actName: [
|
2025-09-17 17:52:03 +08:00
|
|
|
|
{ required: true, message: '请输入活动名称', trigger: 'blur' }
|
2025-03-23 09:18:42 +08:00
|
|
|
|
],
|
|
|
|
|
|
actExplain: [
|
2025-09-17 17:52:03 +08:00
|
|
|
|
{ required: true, message: '请输入活动说明', trigger: 'blur' }
|
2025-03-23 09:18:42 +08:00
|
|
|
|
],
|
|
|
|
|
|
actCover: [
|
2025-09-17 17:52:03 +08:00
|
|
|
|
{ required: true, message: '请上传活动封面', trigger: 'change' }
|
2025-03-23 09:18:42 +08:00
|
|
|
|
],
|
|
|
|
|
|
ruleFormTime: [
|
2025-09-17 17:52:03 +08:00
|
|
|
|
{ required: true, message: '请选择活动时间', trigger: 'change' }
|
2025-03-23 09:18:42 +08:00
|
|
|
|
],
|
|
|
|
|
|
ruleFormTime1: [
|
2025-09-17 17:52:03 +08:00
|
|
|
|
{ required: true, message: '请选择展示时间', trigger: 'change' }
|
|
|
|
|
|
]
|
2025-03-23 09:18:42 +08:00
|
|
|
|
},
|
|
|
|
|
|
lookOver: false,
|
|
|
|
|
|
gradeList: [],
|
|
|
|
|
|
awardsList: [],
|
|
|
|
|
|
registList: [],
|
2025-09-17 17:52:03 +08:00
|
|
|
|
pkId: '',
|
2025-03-23 09:18:42 +08:00
|
|
|
|
repurchaseCouponsShowList: [],
|
2025-09-17 17:52:03 +08:00
|
|
|
|
controlType: '',
|
|
|
|
|
|
addData: {}
|
|
|
|
|
|
}
|
2025-03-23 09:18:42 +08:00
|
|
|
|
},
|
|
|
|
|
|
mounted() {
|
2025-09-17 17:52:03 +08:00
|
|
|
|
this.getData()
|
2025-03-23 09:18:42 +08:00
|
|
|
|
// (1=新增,2=修改,3=删除)4查看
|
|
|
|
|
|
if (
|
|
|
|
|
|
this.$route.query.controlType == 4 ||
|
|
|
|
|
|
this.$route.query.controlType == 3
|
|
|
|
|
|
) {
|
2025-09-17 17:52:03 +08:00
|
|
|
|
this.lookOver = true
|
2025-03-23 09:18:42 +08:00
|
|
|
|
} else {
|
2025-09-17 17:52:03 +08:00
|
|
|
|
this.lookOver = false
|
2025-03-23 09:18:42 +08:00
|
|
|
|
}
|
2025-09-17 17:52:03 +08:00
|
|
|
|
this.controlType = this.$route.query.controlType
|
|
|
|
|
|
this.pkId = this.$route.query.pkId || ''
|
2025-03-23 09:18:42 +08:00
|
|
|
|
if (this.pkId) {
|
2025-09-17 17:52:03 +08:00
|
|
|
|
this.getDetails()
|
2025-03-23 09:18:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
if (this.$route.query.data) {
|
2025-09-17 17:52:03 +08:00
|
|
|
|
this.addData = JSON.parse(this.$route.query.data)
|
|
|
|
|
|
this.getDetails1()
|
2025-03-23 09:18:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
2025-09-24 10:54:40 +08:00
|
|
|
|
splitDate(date) {
|
|
|
|
|
|
return date.split(' ')[0]
|
|
|
|
|
|
},
|
2025-03-23 09:18:42 +08:00
|
|
|
|
getDetails() {
|
|
|
|
|
|
api
|
|
|
|
|
|
.recommendDetail({
|
2025-09-17 17:52:03 +08:00
|
|
|
|
activityId: this.pkId
|
2025-03-23 09:18:42 +08:00
|
|
|
|
})
|
|
|
|
|
|
.then((res) => {
|
2025-09-17 17:52:03 +08:00
|
|
|
|
this.addData = res.data
|
|
|
|
|
|
this.$set(this.ruleForm, 'actName', res.data.activityParam.actName)
|
2025-03-23 09:18:42 +08:00
|
|
|
|
this.$set(
|
|
|
|
|
|
this.ruleForm,
|
2025-09-17 17:52:03 +08:00
|
|
|
|
'actExplain',
|
2025-03-23 09:18:42 +08:00
|
|
|
|
res.data.activityParam.actExplain
|
2025-09-17 17:52:03 +08:00
|
|
|
|
)
|
|
|
|
|
|
this.$set(this.ruleForm, 'actCover', res.data.activityParam.actCover)
|
|
|
|
|
|
this.ruleForm.pkId = res.data.activityParam.pkId
|
|
|
|
|
|
this.ruleForm.actStartDate = res.data.activityParam.actStartDate
|
|
|
|
|
|
this.ruleForm.actEndDate = res.data.activityParam.actEndDate
|
|
|
|
|
|
this.ruleForm.disStartDate = res.data.activityParam.disStartDate
|
|
|
|
|
|
this.ruleForm.disEndDate = res.data.activityParam.disEndDate
|
2025-09-24 10:54:40 +08:00
|
|
|
|
const actStartDate = this.splitDate(res.data.activityParam.actStartDate)
|
|
|
|
|
|
const actEndDate = this.splitDate(res.data.activityParam.actEndDate)
|
|
|
|
|
|
const disStartDate = this.splitDate(res.data.activityParam.disStartDate)
|
|
|
|
|
|
const disEndDate = this.splitDate(res.data.activityParam.disEndDate)
|
2025-09-17 17:52:03 +08:00
|
|
|
|
this.$set(this.ruleForm, 'ruleFormTime', [
|
2025-09-24 10:54:40 +08:00
|
|
|
|
actStartDate,
|
|
|
|
|
|
actEndDate
|
2025-09-17 17:52:03 +08:00
|
|
|
|
])
|
|
|
|
|
|
this.$set(this.ruleForm, 'ruleFormTime1', [
|
2025-09-24 10:54:40 +08:00
|
|
|
|
disStartDate,
|
|
|
|
|
|
disEndDate
|
2025-09-17 17:52:03 +08:00
|
|
|
|
])
|
|
|
|
|
|
const arr1 = []
|
|
|
|
|
|
const arr2 = []
|
|
|
|
|
|
const arr3 = []
|
2025-03-23 09:18:42 +08:00
|
|
|
|
res.data.activityParam.goalMemberConfigList.forEach((item) => {
|
|
|
|
|
|
if (item.memberType == 1) {
|
2025-09-17 17:52:03 +08:00
|
|
|
|
arr1.push(item.pkLevel)
|
2025-03-23 09:18:42 +08:00
|
|
|
|
} else if (item.memberType == 2) {
|
2025-09-17 17:52:03 +08:00
|
|
|
|
arr2.push(item.pkLevel)
|
2025-03-23 09:18:42 +08:00
|
|
|
|
} else if (item.memberType == 3) {
|
2025-09-17 17:52:03 +08:00
|
|
|
|
arr3.push(item.pkLevel)
|
2025-03-23 09:18:42 +08:00
|
|
|
|
}
|
2025-09-17 17:52:03 +08:00
|
|
|
|
})
|
|
|
|
|
|
this.$set(this.ruleForm, 'levelList', arr1)
|
|
|
|
|
|
this.$set(this.ruleForm, 'realList', arr2)
|
|
|
|
|
|
this.$set(this.ruleForm, 'centerList', arr3)
|
2025-03-23 09:18:42 +08:00
|
|
|
|
|
|
|
|
|
|
this.$refs.directUpdata.getPage(
|
2025-09-17 17:52:03 +08:00
|
|
|
|
this.addData.recommendUpgradeList || ''
|
|
|
|
|
|
)
|
|
|
|
|
|
this.$refs.directUpdata.getPages(this.addData.authorityList || '')
|
2025-03-23 09:18:42 +08:00
|
|
|
|
|
2025-09-17 17:52:03 +08:00
|
|
|
|
const that = this
|
2025-03-23 09:18:42 +08:00
|
|
|
|
setTimeout(() => {
|
2025-09-17 17:52:03 +08:00
|
|
|
|
that.getCheck()
|
|
|
|
|
|
}, 50)
|
|
|
|
|
|
})
|
2025-03-23 09:18:42 +08:00
|
|
|
|
},
|
|
|
|
|
|
getDetails1() {
|
2025-09-17 17:52:03 +08:00
|
|
|
|
this.$set(this.ruleForm, 'actName', this.addData.activityParam.actName)
|
2025-03-23 09:18:42 +08:00
|
|
|
|
this.$set(
|
|
|
|
|
|
this.ruleForm,
|
2025-09-17 17:52:03 +08:00
|
|
|
|
'actExplain',
|
2025-03-23 09:18:42 +08:00
|
|
|
|
this.addData.activityParam.actExplain
|
2025-09-17 17:52:03 +08:00
|
|
|
|
)
|
|
|
|
|
|
this.$set(this.ruleForm, 'actCover', this.addData.activityParam.actCover)
|
|
|
|
|
|
this.$set(this.ruleForm, 'ruleFormTime', [
|
2025-09-24 10:54:40 +08:00
|
|
|
|
this.splitDate(this.addData.activityParam.actStartDate),
|
|
|
|
|
|
this.splitDate(this.addData.activityParam.actEndDate)
|
2025-09-17 17:52:03 +08:00
|
|
|
|
])
|
|
|
|
|
|
this.$set(this.ruleForm, 'ruleFormTime1', [
|
2025-09-24 10:54:40 +08:00
|
|
|
|
this.splitDate(this.addData.activityParam.disStartDate),
|
|
|
|
|
|
this.splitDate(this.addData.activityParam.disEndDate)
|
2025-09-17 17:52:03 +08:00
|
|
|
|
])
|
|
|
|
|
|
const arr1 = []
|
|
|
|
|
|
const arr2 = []
|
|
|
|
|
|
const arr3 = []
|
2025-03-23 09:18:42 +08:00
|
|
|
|
this.addData.activityParam.goalMemberConfigList.forEach((item) => {
|
|
|
|
|
|
if (item.memberType == 1) {
|
2025-09-17 17:52:03 +08:00
|
|
|
|
arr1.push(item.pkLevel)
|
2025-03-23 09:18:42 +08:00
|
|
|
|
} else if (item.memberType == 2) {
|
2025-09-17 17:52:03 +08:00
|
|
|
|
arr2.push(item.pkLevel)
|
2025-03-23 09:18:42 +08:00
|
|
|
|
} else if (item.memberType == 3) {
|
2025-09-17 17:52:03 +08:00
|
|
|
|
arr3.push(item.pkLevel)
|
2025-03-23 09:18:42 +08:00
|
|
|
|
}
|
2025-09-17 17:52:03 +08:00
|
|
|
|
})
|
|
|
|
|
|
this.$set(this.ruleForm, 'levelList', arr1)
|
|
|
|
|
|
this.$set(this.ruleForm, 'realList', arr2)
|
|
|
|
|
|
this.$set(this.ruleForm, 'centerList', arr3)
|
2025-03-23 09:18:42 +08:00
|
|
|
|
|
2025-09-17 17:52:03 +08:00
|
|
|
|
this.$refs.directUpdata.getPage(this.addData.recommendUpgradeList || '')
|
|
|
|
|
|
this.$refs.directUpdata.getPages(this.addData.authorityList || '')
|
2025-03-23 09:18:42 +08:00
|
|
|
|
|
2025-09-17 17:52:03 +08:00
|
|
|
|
const that = this
|
2025-03-23 09:18:42 +08:00
|
|
|
|
setTimeout(() => {
|
2025-09-17 17:52:03 +08:00
|
|
|
|
that.getCheck()
|
|
|
|
|
|
}, 500)
|
2025-03-23 09:18:42 +08:00
|
|
|
|
},
|
|
|
|
|
|
// 切换tab
|
|
|
|
|
|
handleLink(id) {
|
2025-09-17 17:52:03 +08:00
|
|
|
|
this.tabActive = id
|
2025-03-23 09:18:42 +08:00
|
|
|
|
},
|
|
|
|
|
|
// 单选
|
|
|
|
|
|
getCheck() {
|
2025-09-17 17:52:03 +08:00
|
|
|
|
const arr1 = []
|
|
|
|
|
|
const arr2 = []
|
|
|
|
|
|
const arr3 = []
|
2025-03-23 09:18:42 +08:00
|
|
|
|
// 等级
|
|
|
|
|
|
this.ruleForm.levelList.forEach((item) => {
|
|
|
|
|
|
arr1.push({
|
|
|
|
|
|
memberType: 1,
|
2025-09-17 17:52:03 +08:00
|
|
|
|
pkLevel: item
|
|
|
|
|
|
})
|
|
|
|
|
|
})
|
2025-03-23 09:18:42 +08:00
|
|
|
|
// 奖衔
|
|
|
|
|
|
this.ruleForm.realList.forEach((item) => {
|
|
|
|
|
|
arr2.push({
|
|
|
|
|
|
memberType: 2,
|
2025-09-17 17:52:03 +08:00
|
|
|
|
pkLevel: item
|
|
|
|
|
|
})
|
|
|
|
|
|
})
|
2025-03-23 09:18:42 +08:00
|
|
|
|
// 权限
|
|
|
|
|
|
this.ruleForm.centerList.forEach((item) => {
|
|
|
|
|
|
arr3.push({
|
|
|
|
|
|
memberType: 3,
|
2025-09-17 17:52:03 +08:00
|
|
|
|
pkLevel: item
|
|
|
|
|
|
})
|
|
|
|
|
|
})
|
|
|
|
|
|
this.ruleForm.goalMemberConfigList = [...arr1, ...arr2, ...arr3]
|
2025-03-23 09:18:42 +08:00
|
|
|
|
// 单选全选全取消
|
|
|
|
|
|
if (this.ruleForm.levelList.length == this.gradeList.length) {
|
2025-09-17 17:52:03 +08:00
|
|
|
|
this.ruleForm.checked1 = true
|
2025-03-23 09:18:42 +08:00
|
|
|
|
} else {
|
2025-09-17 17:52:03 +08:00
|
|
|
|
this.ruleForm.checked1 = false
|
2025-03-23 09:18:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
if (this.ruleForm.realList.length == this.awardsList.length) {
|
2025-09-17 17:52:03 +08:00
|
|
|
|
this.ruleForm.checked2 = true
|
2025-03-23 09:18:42 +08:00
|
|
|
|
} else {
|
2025-09-17 17:52:03 +08:00
|
|
|
|
this.ruleForm.checked2 = false
|
2025-03-23 09:18:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
if (this.ruleForm.centerList.length == this.registList.length) {
|
2025-09-17 17:52:03 +08:00
|
|
|
|
this.ruleForm.checked3 = true
|
2025-03-23 09:18:42 +08:00
|
|
|
|
} else {
|
2025-09-17 17:52:03 +08:00
|
|
|
|
this.ruleForm.checked3 = false
|
2025-03-23 09:18:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
// 全选
|
|
|
|
|
|
getCheckTit(val, index) {
|
|
|
|
|
|
// 等级
|
|
|
|
|
|
if (index == 1 && val) {
|
|
|
|
|
|
this.ruleForm.levelList = this.gradeList.map((item) => {
|
2025-09-17 17:52:03 +08:00
|
|
|
|
return item.pkId
|
|
|
|
|
|
})
|
2025-03-23 09:18:42 +08:00
|
|
|
|
} else if (index == 1 && !val) {
|
2025-09-17 17:52:03 +08:00
|
|
|
|
this.ruleForm.levelList = []
|
2025-03-23 09:18:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
// 奖衔
|
|
|
|
|
|
if (index == 2 && val) {
|
|
|
|
|
|
this.ruleForm.realList = this.awardsList.map((item) => {
|
2025-09-17 17:52:03 +08:00
|
|
|
|
return item.pkId
|
|
|
|
|
|
})
|
2025-03-23 09:18:42 +08:00
|
|
|
|
} else if (index == 2 && !val) {
|
2025-09-17 17:52:03 +08:00
|
|
|
|
this.ruleForm.realList = []
|
2025-03-23 09:18:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
// 权限
|
|
|
|
|
|
if (index == 3 && val) {
|
|
|
|
|
|
this.ruleForm.centerList = this.registList.map((item) => {
|
2025-09-17 17:52:03 +08:00
|
|
|
|
return item.value
|
|
|
|
|
|
})
|
2025-03-23 09:18:42 +08:00
|
|
|
|
} else if (index == 3 && !val) {
|
2025-09-17 17:52:03 +08:00
|
|
|
|
this.ruleForm.centerList = []
|
2025-03-23 09:18:42 +08:00
|
|
|
|
}
|
2025-09-17 17:52:03 +08:00
|
|
|
|
this.getCheck()
|
2025-03-23 09:18:42 +08:00
|
|
|
|
},
|
|
|
|
|
|
changeTime(val) {
|
2025-09-17 17:52:03 +08:00
|
|
|
|
this.ruleForm.actStartDate = val[0]
|
|
|
|
|
|
this.ruleForm.actEndDate = val[1]
|
2025-03-23 09:18:42 +08:00
|
|
|
|
},
|
|
|
|
|
|
changeTime1(val) {
|
2025-09-17 17:52:03 +08:00
|
|
|
|
this.ruleForm.disStartDate = val[0]
|
|
|
|
|
|
this.ruleForm.disEndDate = val[1]
|
2025-03-23 09:18:42 +08:00
|
|
|
|
},
|
|
|
|
|
|
getData() {
|
|
|
|
|
|
api.awardsList().then((res) => {
|
2025-09-17 17:52:03 +08:00
|
|
|
|
this.awardsList = res.rows
|
|
|
|
|
|
})
|
2025-03-23 09:18:42 +08:00
|
|
|
|
api.gradeList().then((res) => {
|
2025-09-17 17:52:03 +08:00
|
|
|
|
this.gradeList = res.rows
|
|
|
|
|
|
})
|
2025-03-23 09:18:42 +08:00
|
|
|
|
api.registerPowerState().then((res) => {
|
2025-09-17 17:52:03 +08:00
|
|
|
|
this.registList = res.data
|
|
|
|
|
|
})
|
2025-03-23 09:18:42 +08:00
|
|
|
|
},
|
|
|
|
|
|
submit() {
|
2025-09-17 17:52:03 +08:00
|
|
|
|
this.$refs['ruleForm'].validate((valid) => {
|
2025-03-23 09:18:42 +08:00
|
|
|
|
if (valid) {
|
2025-09-17 17:52:03 +08:00
|
|
|
|
const obj = Object.assign(
|
2025-03-23 09:18:42 +08:00
|
|
|
|
{},
|
|
|
|
|
|
{
|
|
|
|
|
|
controlType: this.controlType,
|
2025-09-24 10:54:40 +08:00
|
|
|
|
activityParam: {
|
|
|
|
|
|
...this.ruleForm,
|
|
|
|
|
|
actStartDate: this.ruleForm.actStartDate + ' 00:00:00',
|
|
|
|
|
|
actEndDate: this.ruleForm.actEndDate + ' 23:59:59',
|
|
|
|
|
|
disStartDate: this.ruleForm.disStartDate + ' 00:00:00',
|
|
|
|
|
|
disEndDate: this.ruleForm.disEndDate + ' 23:59:59'
|
|
|
|
|
|
},
|
2025-03-23 09:18:42 +08:00
|
|
|
|
recommendUpgradeList:
|
|
|
|
|
|
this.$refs.directUpdata.recommendUpgradeList,
|
2025-09-23 16:57:32 +08:00
|
|
|
|
authorityList: this.$refs.directUpdata.form.waresAuthorityList
|
2025-03-23 09:18:42 +08:00
|
|
|
|
}
|
2025-09-17 17:52:03 +08:00
|
|
|
|
)
|
|
|
|
|
|
api.directRuleConfigSubmit(obj).then((res) => {
|
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
|
this.$message({
|
|
|
|
|
|
message: res.msg || '操作成功',
|
|
|
|
|
|
type: 'success'
|
|
|
|
|
|
})
|
|
|
|
|
|
this.$router.back()
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
2025-03-23 09:18:42 +08:00
|
|
|
|
}
|
2025-09-17 17:52:03 +08:00
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-03-23 09:18:42 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
.page {
|
|
|
|
|
|
padding: 20px;
|
|
|
|
|
|
background: #f9f9f9;
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
.main_a {
|
|
|
|
|
|
height: calc(100vh - 144px);
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
}
|
|
|
|
|
|
.main {
|
|
|
|
|
|
background: #ffffff;
|
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
// height: calc(100vh - 124px);
|
|
|
|
|
|
box-shadow: 0px 2px 20px 0px rgba(238, 238, 238, 0.5);
|
|
|
|
|
|
}
|
|
|
|
|
|
::v-deep .el-select {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
.footer {
|
|
|
|
|
|
height: 68px;
|
|
|
|
|
|
background: #ffffff;
|
|
|
|
|
|
box-shadow: 0px -3px 20px 0px rgba(204, 204, 204, 0.5);
|
|
|
|
|
|
// margin: 0 20px;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
.thebtn1 {
|
|
|
|
|
|
background: #3181e5;
|
|
|
|
|
|
color: #ffffff;
|
|
|
|
|
|
padding: 9px 45px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.thebtn2 {
|
|
|
|
|
|
background: #cccccc;
|
|
|
|
|
|
color: #ffffff;
|
|
|
|
|
|
padding: 9px 45px;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
.tit {
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
|
color: #333333;
|
|
|
|
|
|
padding: 0 20px;
|
|
|
|
|
|
border-left: 5px solid #c8161d;
|
|
|
|
|
|
margin: 20px 0 10px 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
.xian {
|
|
|
|
|
|
height: 1px;
|
|
|
|
|
|
background: rgba(0, 0, 0, 0.1);
|
|
|
|
|
|
}
|
|
|
|
|
|
.demo-ruleForm {
|
|
|
|
|
|
padding: 20px 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
::v-deep .el-date-editor--datetimerange {
|
|
|
|
|
|
width: auto !important;
|
|
|
|
|
|
}
|
|
|
|
|
|
.flexed {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
}
|
|
|
|
|
|
.flexed_l {
|
|
|
|
|
|
margin-right: 20px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.topbox {
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
padding: 0px 0 15px 0;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
// background: skyblue;
|
|
|
|
|
|
.levelList_i {
|
|
|
|
|
|
margin-left: 20px;
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
padding: 0 5px;
|
|
|
|
|
|
width: 88px;
|
|
|
|
|
|
height: 34px;
|
|
|
|
|
|
border-radius: 17px;
|
|
|
|
|
|
border: 1px solid #cccccc;
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
font-family: MicrosoftYaHei;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
line-height: 32px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.act {
|
|
|
|
|
|
color: #ffffff;
|
|
|
|
|
|
background: #c8161d;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
::v-deep .el-form-item {
|
|
|
|
|
|
margin-bottom: 20px !important;
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|