Commit 8923e9da by cen

fix: 修复样式

1 parent 5e899daf
...@@ -174,6 +174,36 @@ export const rangePickertwoMonthOptions = { ...@@ -174,6 +174,36 @@ export const rangePickertwoMonthOptions = {
} }
/** /**
* 时间控件-限制时间跨度不超过93天,且结束时间不能小于开始时间,且结束时间不能大于当前时间
*/
export var selectDate2 = ""
export const rangePickertwoMonthOptionsWithCurrentLimit = {
onPick({ maxDate, minDate }) {
selectDate2 = minDate ? minDate.getTime() : ""
if (maxDate) {
selectDate2 = ""
}
},
disabledDate(time) {
const currentTime = Date.now() // 当前时间
// 限制所有大于当前时间的日期不可选
if (time.getTime() > currentTime) {
return true
}
if (selectDate2 !== "") {
const ninetyThreeDays = 93 * 24 * 3600 * 1000
const minTime = selectDate2 // 开始时间即为最小时间
const maxTime = Math.min(selectDate2 + ninetyThreeDays, currentTime) // 开始时间+93天与当前时间取较小值作为最大时间
return time.getTime() < minTime || time.getTime() > maxTime
} else {
return false
}
}
}
/**
* 时间控件-限制选择30天时间范围,且不大于当前时间 * 时间控件-限制选择30天时间范围,且不大于当前时间
*/ */
export var pickerMinDate = "" // 获取开始选择时间 export var pickerMinDate = "" // 获取开始选择时间
......
...@@ -172,7 +172,8 @@ import { ...@@ -172,7 +172,8 @@ import {
yesterdayPicker, yesterdayPicker,
rangePickerOptions_30day2, rangePickerOptions_30day2,
todayEndPickerOptions, todayEndPickerOptions,
rangePickertwoMonthOptions rangePickertwoMonthOptions,
rangePickertwoMonthOptionsWithCurrentLimit
} from "@/common/format" } from "@/common/format"
export default { export default {
name: "D2Search", name: "D2Search",
...@@ -183,7 +184,9 @@ export default { ...@@ -183,7 +184,9 @@ export default {
yesterdayPicker: yesterdayPicker, yesterdayPicker: yesterdayPicker,
rangePickerOptions_30day2: rangePickerOptions_30day2, rangePickerOptions_30day2: rangePickerOptions_30day2,
todayEndPickerOptions: todayEndPickerOptions, todayEndPickerOptions: todayEndPickerOptions,
rangePickertwoMonthOptions: rangePickertwoMonthOptions rangePickertwoMonthOptions: rangePickertwoMonthOptions,
rangePickertwoMonthOptionsWithCurrentLimit:
rangePickertwoMonthOptionsWithCurrentLimit
} }
} }
}, },
......
...@@ -47,7 +47,6 @@ ...@@ -47,7 +47,6 @@
:style="{ 'margin-bottom': '22px' }" :style="{ 'margin-bottom': '22px' }"
> >
<el-select <el-select
@change="clearTableFn(1)"
:style="{ width: '432px' }" :style="{ width: '432px' }"
v-model="formData.sceneType" v-model="formData.sceneType"
placeholder="请选择" placeholder="请选择"
...@@ -65,10 +64,7 @@ ...@@ -65,10 +64,7 @@
label="品牌类型:" label="品牌类型:"
prop="category" prop="category"
> >
<el-checkbox-group <el-checkbox-group v-model="formData.category">
@change="changeChannelFn"
v-model="formData.category"
>
<el-checkbox label="1">问界</el-checkbox> <el-checkbox label="1">问界</el-checkbox>
<el-checkbox label="0">鸿蒙</el-checkbox> <el-checkbox label="0">鸿蒙</el-checkbox>
<el-checkbox label="3">通用</el-checkbox> <el-checkbox label="3">通用</el-checkbox>
...@@ -145,7 +141,7 @@ import { SCENETYPE_OPTIONS } from "../constant" ...@@ -145,7 +141,7 @@ import { SCENETYPE_OPTIONS } from "../constant"
import preview from "../components/preview" import preview from "../components/preview"
import { getList, getAccountMerchantList } from "@/api/merchant" import { getList, getAccountMerchantList } from "@/api/merchant"
import reportTrackPageMixin from "@/mixins/reportTrackPageMixin"
import textBox from "@/components/glsx-combi-form/textBox" import textBox from "@/components/glsx-combi-form/textBox"
import { addActivity, editActivity } from "@api/contentManager" import { addActivity, editActivity } from "@api/contentManager"
function debounce(func, delay) { function debounce(func, delay) {
...@@ -159,6 +155,7 @@ function debounce(func, delay) { ...@@ -159,6 +155,7 @@ function debounce(func, delay) {
} }
export default { export default {
name: "ActivityAdd", name: "ActivityAdd",
mixins: [reportTrackPageMixin],
components: { components: {
glsxPreview: preview, glsxPreview: preview,
textBox textBox
...@@ -197,7 +194,10 @@ export default { ...@@ -197,7 +194,10 @@ export default {
category: [], category: [],
activityCover: [], activityCover: [],
selectionRule: "", selectionRule: "",
dateTime: [new Date(), new Date()] dateTime: [
new Date(),
new Date(new Date().getTime() + 3600 * 1000 * 24 * 30)
]
}, },
rules: { rules: {
name: [ name: [
...@@ -220,6 +220,41 @@ export default { ...@@ -220,6 +220,41 @@ export default {
required: true, required: true,
message: "请选择日期", message: "请选择日期",
trigger: "change" trigger: "change"
},
{
validator: (rule, value, callback) => {
if (value && value.length === 2) {
const startTime = new Date(value[0]).getTime()
const endTime = new Date(value[1]).getTime()
const now = new Date().getTime()
const diffMinutes = (endTime - startTime) / (1000 * 60)
// 验证结束时间必须大于开始时间
if (endTime <= startTime) {
callback(new Error("结束时间必须大于开始时间"))
return
}
// 验证结束时间不能早于当前时间
if (endTime <= now) {
callback(new Error("结束时间不能早于当前时间"))
return
}
// 验证时间间隔必须大于等于60分钟
if (diffMinutes < 60) {
callback(
new Error("开始时间和结束时间间隔必须大于等于60分钟")
)
return
}
callback()
} else {
callback()
}
},
trigger: ["change", "blur"]
} }
] ]
}, },
...@@ -290,6 +325,7 @@ export default { ...@@ -290,6 +325,7 @@ export default {
}, },
created() {}, created() {},
mounted() { mounted() {
this.setReportTrackData(0, "activity_management_edit", {})
console.log(this.$route) console.log(this.$route)
// 编辑 // 编辑
const { id } = this.$route.query.info const { id } = this.$route.query.info
...@@ -352,6 +388,10 @@ export default { ...@@ -352,6 +388,10 @@ export default {
console.log(valid, "valid") console.log(valid, "valid")
this.$refs.channelForm.validate((cvalid) => { this.$refs.channelForm.validate((cvalid) => {
if (valid && cvalid) { if (valid && cvalid) {
if (this.formData.selectionRule.length > 5000) {
this.$message.error("评选规则内容不能超过5000个字符")
return
}
this.commitFn(type) this.commitFn(type)
} }
}) })
...@@ -391,7 +431,9 @@ export default { ...@@ -391,7 +431,9 @@ export default {
}, },
// 获取富文本框内容 // 获取富文本框内容
handleTextBoxChange(val, targetItem) { handleTextBoxChange(val, targetItem) {
console.log(val)
this.$set(this.formData, "selectionRule", val) this.$set(this.formData, "selectionRule", val)
this.$refs.channelForm.validateField("selectionRule")
}, },
handleTextBoxFocus() { handleTextBoxFocus() {
this.$refs.TextBox.setEdit(this.formData.selectionRule) this.$refs.TextBox.setEdit(this.formData.selectionRule)
......
...@@ -108,8 +108,10 @@ ...@@ -108,8 +108,10 @@
<script> <script>
import { mapActions, mapState } from "vuex" import { mapActions, mapState } from "vuex"
import reportTrackPageMixin from "@/mixins/reportTrackPageMixin"
export default { export default {
name: "ActivityDetails", name: "ActivityDetails",
mixins: [reportTrackPageMixin],
data() { data() {
return { return {
noDataImg: require("@/assets/empty-5.png"), noDataImg: require("@/assets/empty-5.png"),
...@@ -176,6 +178,7 @@ export default { ...@@ -176,6 +178,7 @@ export default {
}, },
mounted() { mounted() {
this.setReportTrackData(0, "activity_management_detail", {})
const info = this.$route.query.info const info = this.$route.query.info
console.log(info) console.log(info)
this.formData = info this.formData = info
...@@ -198,7 +201,7 @@ export default { ...@@ -198,7 +201,7 @@ export default {
params.method = params.method =
"dj.api.script.activity.award.winner.import.template.export.async" "dj.api.script.activity.award.winner.import.template.export.async"
params.moduleName = "script" params.moduleName = "script"
params.activityId = this.activeName params.activityId = this.formData.id
const list = [ const list = [
...this.dowloadList, ...this.dowloadList,
{ {
......
...@@ -55,16 +55,35 @@ ...@@ -55,16 +55,35 @@
</div> </div>
</div> </div>
<template slot="auth-button" slot-scope="scope"> <template slot="auth-button" slot-scope="scope">
<el-button type="text" @click="jumpDetail(scope.scope)"> <el-button
type="text"
@click="jumpDetail(scope.scope)"
data-event-code="activity_management_detail"
>
查看 查看
</el-button> </el-button>
<el-button type="text" @click="jumpEdit(scope.scope)"> <el-button
type="text"
@click="jumpEdit(scope.scope)"
:disabled="scope.scope.status == 1"
data-event-code="activity_management_edit"
>
编辑 编辑
</el-button> </el-button>
<el-button type="text" @click="handleAccountConfirm(scope.scope)"> <el-button
type="text"
@click="handleAccountConfirm(scope.scope)"
:disabled="scope.scope.status == 1 && scope.scope.status == 2"
data-event-code="activity_management_import"
>
导入名单 导入名单
</el-button> </el-button>
<el-button type="text" @click="handleDelete(scope.scope)"> <el-button
type="text"
@click="handleDelete(scope.scope)"
:disabled="scope.scope.status == 1"
data-event-code="activity_management_del"
>
删除 删除
</el-button> </el-button>
</template> </template>
...@@ -98,11 +117,11 @@ ...@@ -98,11 +117,11 @@
:rules="fileRules" :rules="fileRules"
label-width="120px" label-width="120px"
> >
<el-form-item label="评选周期:" prop="periodList"> <el-form-item label="评选周期:" prop="currentPeriod">
<div style="margin-bottom: 10px"> <div style="margin-bottom: 10px">
<el-select v-model="currentPeriod" placeholder="请选择"> <el-select v-model="fileForm.currentPeriod" placeholder="请选择">
<el-option <el-option
v-for="item in fileForm.periodList" v-for="item in periodList"
:key="item.id" :key="item.id"
:label="item.cycleName" :label="item.cycleName"
:value="item.id" :value="item.id"
...@@ -182,8 +201,23 @@ ...@@ -182,8 +201,23 @@
个错误,请根据以下提示修改后重新上传: 个错误,请根据以下提示修改后重新上传:
</div> </div>
<div class="err-list"> <div class="err-list">
<div v-for="(item, index) in fileForm.errors" :key="item"> <div v-if="fileForm.errors && fileForm.errors.length > 0">
{{ index + 1 }} {{ item }} <div
v-for="(item, index) in fileForm.errors"
:key="item"
v-if="index < 3"
>
{{ index + 1 }} {{ item }}
</div>
<div v-if="fileForm.errors.length > 3" style="color: #909399">
...
</div>
<el-button
type="text"
@click="exportError(fileForm.errorFileUrl)"
>
下载错误报告
</el-button>
</div> </div>
</div> </div>
</div></el-form-item </div></el-form-item
...@@ -207,11 +241,13 @@ import { ...@@ -207,11 +241,13 @@ import {
addActivityCycle, addActivityCycle,
importWinner importWinner
} from "@api/contentManager" } from "@api/contentManager"
import reportTrackPageMixin from "@/mixins/reportTrackPageMixin"
import { mapActions, mapState } from "vuex" import { mapActions, mapState } from "vuex"
import dayjs from "dayjs" import dayjs from "dayjs"
import { ACTIVITY_STATUS_OPTIONS } from "../constant" import { ACTIVITY_STATUS_OPTIONS } from "../constant"
import { Util, deepClone } from "@/common/util" import { Util, deepClone } from "@/common/util"
export default { export default {
mixins: [reportTrackPageMixin],
data() { data() {
return { return {
ACTIVITY_STATUS_OPTIONS, ACTIVITY_STATUS_OPTIONS,
...@@ -220,7 +256,7 @@ export default { ...@@ -220,7 +256,7 @@ export default {
currentRow: null, currentRow: null,
fileForm: { fileForm: {
fileName: "", fileName: "",
periodList: [] currentPeriod: ""
}, },
fileRules: { fileRules: {
fileName: [ fileName: [
...@@ -230,22 +266,11 @@ export default { ...@@ -230,22 +266,11 @@ export default {
trigger: "blur" trigger: "blur"
} }
], ],
periodList: [ currentPeriod: [
{ {
required: true, required: true,
validator: (rule, value, callback) => { message: "请选择活动周期",
console.log(value) trigger: "change"
// 检查是否所有周期都有值
const hasEmpty = value.some(
(item) => !item.cycleName || item.cycleName.trim() === ""
)
if (hasEmpty) {
callback(new Error("请填写所有评选周期"))
} else {
callback()
}
},
trigger: "blur"
} }
] ]
}, },
...@@ -254,6 +279,7 @@ export default { ...@@ -254,6 +279,7 @@ export default {
status: "", status: "",
searchdate: [new Date(), new Date()] searchdate: [new Date(), new Date()]
}, },
periodList: [],
searchFormSearch: {}, searchFormSearch: {},
showFormData: [ showFormData: [
{ {
...@@ -300,7 +326,7 @@ export default { ...@@ -300,7 +326,7 @@ export default {
], ],
getListApi: getActivityPage, getListApi: getActivityPage,
addPeriodFlag: false, addPeriodFlag: false,
currentPeriod: "", track_event_code: "activity_management",
cycleName: "", cycleName: "",
tableParams: { tableParams: {
listName: "list", listName: "list",
...@@ -422,16 +448,17 @@ export default { ...@@ -422,16 +448,17 @@ export default {
this.addPeriodFlag = false this.addPeriodFlag = false
this.notice.okTips() this.notice.okTips()
await this.activityCyclePage() await this.activityCyclePage()
this.currentPeriod = this.fileForm.periodList[0].id this.fileForm.currentPeriod = this.periodList[0].id
}) })
}, },
// 添加删除周期方法 // 添加删除周期方法
removePeriod(index) { removePeriod(index) {
this.fileForm.periodList.splice(index, 1) this.periodList.splice(index, 1)
}, },
// 上传文件,转码为base64 // 上传文件,转码为base64
importFile(e) { importFile(e) {
this.fileForm.errorFileUrl = ""
const size = e.target.files[0].size / 1024 / 1024 const size = e.target.files[0].size / 1024 / 1024
if (size < 5) { if (size < 5) {
this.$set(this.fileForm, "fileName", e.target.files[0].name) this.$set(this.fileForm, "fileName", e.target.files[0].name)
...@@ -492,7 +519,7 @@ export default { ...@@ -492,7 +519,7 @@ export default {
getActivityCyclePage({ activityId: this.currentRow.id }).then((res) => { getActivityCyclePage({ activityId: this.currentRow.id }).then((res) => {
console.log(res) console.log(res)
this.fileForm.periodList = res || [] this.periodList = res || []
}) })
}, },
handleNameBlur(index) {}, handleNameBlur(index) {},
...@@ -500,7 +527,7 @@ export default { ...@@ -500,7 +527,7 @@ export default {
this.$refs.fileRuleForm.validate((valid) => { this.$refs.fileRuleForm.validate((valid) => {
if (valid) { if (valid) {
importWinner({ importWinner({
cycleActivityId: this.currentPeriod, cycleActivityId: this.fileForm.currentPeriod,
file: this.fileInfo file: this.fileInfo
}).then((res) => { }).then((res) => {
this.notice.okTips() this.notice.okTips()
...@@ -517,6 +544,9 @@ export default { ...@@ -517,6 +544,9 @@ export default {
}, },
removeFile() { removeFile() {
this.fileForm = {} this.fileForm = {}
},
exportError(errorFileUrl) {
errorFileUrl && window.open(errorFileUrl)
} }
} }
} }
......
...@@ -198,12 +198,17 @@ export default { ...@@ -198,12 +198,17 @@ export default {
padding: 0px 20px 30px; padding: 0px 20px 30px;
} }
::v-deep .el-timeline { ::v-deep .el-timeline {
width: calc(100% - 40px);
box-sizing: border-box; box-sizing: border-box;
.el-timeline-item {
}
} }
::v-deep .el-timeline-item__node--normal { ::v-deep .el-timeline-item__node--normal {
width: 8px; width: 8px;
height: 8px; height: 8px;
background-color: #2a58ad; }
::v-deep .el-timeline-item__tail {
left: 2px;
} }
.reject-dialog { .reject-dialog {
max-height: 70vh; max-height: 70vh;
......
...@@ -18,13 +18,28 @@ ...@@ -18,13 +18,28 @@
</div> </div>
<div class="d2-container-content"> <div class="d2-container-content">
<d2-table-header title="审核列表"> <d2-table-header title="审核列表">
<el-button size="small" type="primary" @click="handleBatchExamine(1)"> <el-button
size="small"
type="primary"
@click="handleBatchExamine(1)"
data-event-code="failure_to_report_reception_pass"
>
批量通过 批量通过
</el-button> </el-button>
<el-button size="small" type="primary" @click="handleBatchExamine(2)"> <el-button
size="small"
type="primary"
@click="handleBatchExamine(2)"
data-event-code="failure_to_report_reception_all_reject"
>
批量驳回 批量驳回
</el-button> </el-button>
<el-button size="small" type="primary" @click="exportList"> <el-button
size="small"
type="primary"
@click="exportList"
data-event-code="failure_to_report_reception_export"
>
导出 导出
</el-button> </el-button>
</d2-table-header> </d2-table-header>
...@@ -54,10 +69,20 @@ ...@@ -54,10 +69,20 @@
</div> </div>
</div> </div>
<template slot="auth-button" slot-scope="scope"> <template slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleAudits(scope.scope)"> <el-button
type="text"
@click="handleAudits(scope.scope)"
data-event-code="failure_to_report_reception_audit"
v-if="scope.scope.auditStatus == '0'"
>
审核 审核
</el-button> </el-button>
<el-button type="text" @click="handleReject(scope.scope)"> <el-button
type="text"
@click="handleReject(scope.scope)"
data-event-code="failure_to_report_reception_reject"
v-if="scope.scope.auditStatus != '0'"
>
重新审核 重新审核
</el-button> </el-button>
</template> </template>
...@@ -90,6 +115,7 @@ ...@@ -90,6 +115,7 @@
</div> </div>
</template> </template>
<script> <script>
import reportTrackPageMixin from "@/mixins/reportTrackPageMixin"
import examineDialog from "./components/examineDialog" import examineDialog from "./components/examineDialog"
import auditsDialog from "./components/auditsDialog" import auditsDialog from "./components/auditsDialog"
import rejectDialog from "./components/rejectDialog" import rejectDialog from "./components/rejectDialog"
...@@ -120,6 +146,7 @@ const STATUS_OPTIONS = [ ...@@ -120,6 +146,7 @@ const STATUS_OPTIONS = [
} }
] ]
export default { export default {
mixins: [reportTrackPageMixin],
name: "FailureToReportReception", name: "FailureToReportReception",
components: { components: {
examineDialog, examineDialog,
...@@ -129,6 +156,7 @@ export default { ...@@ -129,6 +156,7 @@ export default {
data() { data() {
return { return {
STATUS_OPTIONS, STATUS_OPTIONS,
track_event_code: "failure_to_report_reception",
examineVisible: false, examineVisible: false,
auditsVisible: false, auditsVisible: false,
infos: [], infos: [],
...@@ -206,7 +234,7 @@ export default { ...@@ -206,7 +234,7 @@ export default {
type: "datePicker", type: "datePicker",
isClear: true, isClear: true,
dateType: "datetimerange", dateType: "datetimerange",
pickerOptions: "rangePickerOptions" pickerOptions: "rangePickertwoMonthOptionsWithCurrentLimit"
}, },
{ {
label: "创建日期", label: "创建日期",
...@@ -214,7 +242,7 @@ export default { ...@@ -214,7 +242,7 @@ export default {
type: "datePicker", type: "datePicker",
isClear: true, isClear: true,
pickerOptions: "rangePickerOptions" pickerOptions: "rangePickertwoMonthOptionsWithCurrentLimit"
} }
], ],
pageInfo: { pageInfo: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!