|
@@ -251,19 +251,29 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <!-- <el-row :gutter="20">
|
|
|
+ <el-row :gutter="20">
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="启用走马灯">
|
|
|
- <el-switch style="width: 300px" v-model="extJson.isZoetrope" active-text="启用" inactive-text="不启用"
|
|
|
- active-value="1" inactive-value="0" />
|
|
|
+ <el-switch
|
|
|
+ style="width: 300px"
|
|
|
+ v-model="extJson.isZoetrope"
|
|
|
+ active-text="启用"
|
|
|
+ inactive-text="不启用"
|
|
|
+ active-value="1"
|
|
|
+ inactive-value="0"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="18">
|
|
|
<el-form-item label="走马灯文本">
|
|
|
- <el-input type="textarea" :autosize="{ minRows: 2, maxRows: 4}" v-model="extJson.zoetropeText" />
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ :autosize="{ minRows: 2, maxRows: 4 }"
|
|
|
+ v-model="extJson.zoetropeText"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- </el-row> -->
|
|
|
+ </el-row>
|
|
|
<el-row :gutter="20">
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="订购记录">
|
|
@@ -505,47 +515,92 @@
|
|
|
</el-form-item>
|
|
|
|
|
|
<!-- <el-form-item label="活动海报">
|
|
|
- <el-upload class="avatar-uploader" :action="imgapi" :show-file-list="false"
|
|
|
- :on-success="changePromotionPicposterPhoto">
|
|
|
+ <el-upload
|
|
|
+ class="avatar-uploader"
|
|
|
+ :action="imgapi"
|
|
|
+ :show-file-list="false"
|
|
|
+ :on-success="changePromotionPicposterPhoto"
|
|
|
+ >
|
|
|
<div v-if="form.posterPhoto">
|
|
|
- <img style="float: left" :src="form.posterPhoto" class="avatar" />
|
|
|
+ <img
|
|
|
+ style="float: left"
|
|
|
+ :src="form.posterPhoto"
|
|
|
+ class="avatar"
|
|
|
+ />
|
|
|
</div>
|
|
|
<el-button v-else size="small" type="primary">
|
|
|
点击上传
|
|
|
</el-button>
|
|
|
</el-upload>
|
|
|
- <div v-if="form.posterPhoto" style="display: inline-block; color: #20a0ff; padding-left: 20px"
|
|
|
- @click="form.posterPhoto = ''">
|
|
|
+ <div
|
|
|
+ v-if="form.posterPhoto"
|
|
|
+ style="
|
|
|
+ display: inline-block;
|
|
|
+ color: #20a0ff;
|
|
|
+ padding-left: 20px;
|
|
|
+ "
|
|
|
+ @click="form.posterPhoto = ''"
|
|
|
+ >
|
|
|
删除
|
|
|
</div>
|
|
|
- </el-form-item> -->
|
|
|
- <!-- <el-form-item label="活动logo">
|
|
|
- <el-upload class="avatar-uploader" :action="imgapi" :show-file-list="false"
|
|
|
- :on-success="changePromotionPicactivityLogo">
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="活动logo">
|
|
|
+ <el-upload
|
|
|
+ class="avatar-uploader"
|
|
|
+ :action="imgapi"
|
|
|
+ :show-file-list="false"
|
|
|
+ :on-success="changePromotionPicactivityLogo"
|
|
|
+ >
|
|
|
<div v-if="form.activityLogo">
|
|
|
- <img style="float: left" :src="form.activityLogo" class="avatar" />
|
|
|
+ <img
|
|
|
+ style="float: left"
|
|
|
+ :src="form.activityLogo"
|
|
|
+ class="avatar"
|
|
|
+ />
|
|
|
</div>
|
|
|
<el-button v-else size="small" type="primary">
|
|
|
点击上传
|
|
|
</el-button>
|
|
|
</el-upload>
|
|
|
- <div v-if="form.activityLogo" style="display: inline-block; color: #20a0ff; padding-left: 20px"
|
|
|
- @click="form.activityLogo = ''">
|
|
|
+ <div
|
|
|
+ v-if="form.activityLogo"
|
|
|
+ style="
|
|
|
+ display: inline-block;
|
|
|
+ color: #20a0ff;
|
|
|
+ padding-left: 20px;
|
|
|
+ "
|
|
|
+ @click="form.activityLogo = ''"
|
|
|
+ >
|
|
|
删除
|
|
|
</div>
|
|
|
- </el-form-item> -->
|
|
|
- <!-- <el-form-item label="推广图">
|
|
|
- <el-upload class="avatar-uploader" :action="imgapi" :show-file-list="false"
|
|
|
- :on-success="changePromotionPicpromotePhoto">
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="推广图">
|
|
|
+ <el-upload
|
|
|
+ class="avatar-uploader"
|
|
|
+ :action="imgapi"
|
|
|
+ :show-file-list="false"
|
|
|
+ :on-success="changePromotionPicpromotePhoto"
|
|
|
+ >
|
|
|
<div v-if="form.promotePhoto">
|
|
|
- <img style="float: left" :src="form.promotePhoto" class="avatar" />
|
|
|
+ <img
|
|
|
+ style="float: left"
|
|
|
+ :src="form.promotePhoto"
|
|
|
+ class="avatar"
|
|
|
+ />
|
|
|
</div>
|
|
|
<el-button v-else size="small" type="primary">
|
|
|
点击上传
|
|
|
</el-button>
|
|
|
</el-upload>
|
|
|
- <div v-if="form.promotePhoto" style="display: inline-block; color: #20a0ff; padding-left: 20px"
|
|
|
- @click="form.promotePhoto = ''">
|
|
|
+ <div
|
|
|
+ v-if="form.promotePhoto"
|
|
|
+ style="
|
|
|
+ display: inline-block;
|
|
|
+ color: #20a0ff;
|
|
|
+ padding-left: 20px;
|
|
|
+ "
|
|
|
+ @click="form.promotePhoto = ''"
|
|
|
+ >
|
|
|
删除
|
|
|
</div>
|
|
|
</el-form-item> -->
|
|
@@ -644,7 +699,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { post, get } from "@/api/common";
|
|
|
+import { post, get, put } from "@/api/common";
|
|
|
function getArrayClassification(params) {
|
|
|
var options = {
|
|
|
data: params.data,
|
|
@@ -664,8 +719,6 @@ function getArrayClassification(params) {
|
|
|
return tree;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
const XEUtils = require("xe-utils");
|
|
|
const weekOptions = ["周日", "周一", "周二 ", "周三", "周四", "周五", "周六"];
|
|
|
export default {
|
|
@@ -701,7 +754,7 @@ export default {
|
|
|
templateId: 104,
|
|
|
primaryProductId: "",
|
|
|
strategyStatus: "1",
|
|
|
- extJson: {},
|
|
|
+ extJson: "",
|
|
|
maskText: "",
|
|
|
maskText2: "",
|
|
|
activityUuid: "",
|
|
@@ -712,7 +765,10 @@ export default {
|
|
|
recommendStrategyIds: [],
|
|
|
unsubscribeStrategyIds: [""],
|
|
|
linkUrl: "",
|
|
|
+ id: "",
|
|
|
},
|
|
|
+ text: {},
|
|
|
+ id: null,
|
|
|
oldform: {},
|
|
|
//扩展字段
|
|
|
extJson: {
|
|
@@ -813,144 +869,157 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
- // datetimerange(val) {
|
|
|
- // if (val) {
|
|
|
- // this.rulesform.activeStartDate = val[0];
|
|
|
- // this.rulesform.activeEndDate = val[1];
|
|
|
- // } else {
|
|
|
- // this.rulesform.activeStartDate = "";
|
|
|
- // this.rulesform.activeEndDate = "";
|
|
|
- // }
|
|
|
- // },
|
|
|
- // timerange(val) {
|
|
|
- // this.rulesform.activeStartTime = val[0];
|
|
|
- // this.rulesform.activeEndTime = val[1];
|
|
|
- // },
|
|
|
- // checkedWeeks(val) {
|
|
|
- // this.rulesform.weeks = val
|
|
|
- // .map((i) => weekOptions.findIndex((j) => j == i))
|
|
|
- // .sort()
|
|
|
- // .toString();
|
|
|
- // },
|
|
|
+ datetimerange(val) {
|
|
|
+ console.log(val);
|
|
|
+ if (val) {
|
|
|
+ this.rulesform.activeStartDate = val[0];
|
|
|
+ this.rulesform.activeEndDate = val[1];
|
|
|
+ console.log(val[1], this.rulesform, 111);
|
|
|
+ } else {
|
|
|
+ this.rulesform.activeStartDate = "";
|
|
|
+ this.rulesform.activeEndDate = "";
|
|
|
+ }
|
|
|
+ },
|
|
|
+ timerange(val) {
|
|
|
+ console.log(val);
|
|
|
+ this.rulesform.activeStartTime = val[0];
|
|
|
+ this.rulesform.activeEndTime = val[1];
|
|
|
+ },
|
|
|
+ checkedWeeks(val) {
|
|
|
+ console.log(val);
|
|
|
+ this.rulesform.weeks = val
|
|
|
+ .map((i) => weekOptions.findIndex((j) => j == i))
|
|
|
+ .sort()
|
|
|
+ .toString();
|
|
|
+ },
|
|
|
},
|
|
|
created() {
|
|
|
document.title = "编辑策略";
|
|
|
},
|
|
|
mounted() {
|
|
|
- // if (this.$route.query.id) {
|
|
|
- // get("/strategy/strategy-info/page", {
|
|
|
- // id: this.$route.query.id,
|
|
|
- // }).then((res) => {
|
|
|
- // res = res.data.list[0];
|
|
|
- // this.oldform = JSON.parse(JSON.stringify(res));
|
|
|
- // this.form = {
|
|
|
- // strategyName: res.strategyName,
|
|
|
- // strategyType: res.strategyType,
|
|
|
- // templateId: res.templateId,
|
|
|
- // strategyStatus: res.strategyStatus.toString(),
|
|
|
- // primaryProductId: res.primaryProductId,
|
|
|
- // maskText: res.maskText,
|
|
|
- // activityUuid: res.activityUuid,
|
|
|
- // activityType: res.activityType,
|
|
|
- // posterPhoto: res.posterPhoto,
|
|
|
- // activityLogo: res.activityLogo,
|
|
|
- // promotePhoto: res.promotePhoto,
|
|
|
- // recommendStrategyIds: res.recommendStrategyIds,
|
|
|
- // unsubscribeStrategyIds: res.unsubscribeStrategyIds
|
|
|
- // ? res.unsubscribeStrategyIds
|
|
|
- // : [],
|
|
|
- // viceProductIds: res.viceProductIds,
|
|
|
- // linkUrl: res.linkUrl,
|
|
|
- // directCharge: res.directCharge,
|
|
|
- // };
|
|
|
- // if (res.extJson) {
|
|
|
- // this.extJson = JSON.parse(res.extJson);
|
|
|
- // if (this.extJson.dispose) {
|
|
|
- // this.disposeVal = this.extJson.dispose.split(",");
|
|
|
- // }
|
|
|
- // }
|
|
|
- // if (res.activeStartDate) {
|
|
|
- // this.datetimerange = [res.activeStartDate, res.activeEndDate];
|
|
|
- // }
|
|
|
- // if (res.weeks) {
|
|
|
- // let checkedWeeks = res.weeks.split(",");
|
|
|
- // checkedWeeks.forEach((item) => {
|
|
|
- // this.checkedWeeks.push(weekOptions[item]);
|
|
|
- // });
|
|
|
- // }
|
|
|
- // let checkedchannel = [];
|
|
|
- // res.channelInfoDatas.forEach((item) => {
|
|
|
- // checkedchannel.push([item.firstChannelId, item.secondChannelId]);
|
|
|
- // });
|
|
|
- // this.checkedchannel = checkedchannel;
|
|
|
- // this.rulesform = {
|
|
|
- // activeStartTime: res.activeStartTime,
|
|
|
- // activeEndTime: res.activeEndTime,
|
|
|
- // strategyId: this.$route.query.id,
|
|
|
- // firstChannelId: res.firstChannelId,
|
|
|
- // secondChannelIds: res.secondChannelIds,
|
|
|
- // };
|
|
|
- // });
|
|
|
- // this.btn = "编辑保存";
|
|
|
- // }
|
|
|
- // if (this.$route.query.copyId) {
|
|
|
- // get('/strategy/strategy-info/page', {
|
|
|
- // 'id': this.$route.query.copyId
|
|
|
- // }).then(res => {
|
|
|
- // res = res.data.list[0];
|
|
|
- // this.oldform = JSON.parse(JSON.stringify(res))
|
|
|
- // this.form = {
|
|
|
- // strategyName: res.strategyName + " 副本",
|
|
|
- // strategyType: res.strategyType,
|
|
|
- // templateId: res.templateId,
|
|
|
- // strategyStatus: res.strategyStatus.toString(),
|
|
|
- // primaryProductId: res.primaryProductId,
|
|
|
- // maskText: res.maskText,
|
|
|
- // activityUuid: res.activityUuid,
|
|
|
- // activityType: res.activityType,
|
|
|
- // posterPhoto: res.posterPhoto,
|
|
|
- // activityLogo: res.activityLogo,
|
|
|
- // promotePhoto: res.promotePhoto,
|
|
|
- // recommendStrategyIds: res.recommendStrategyIds,
|
|
|
- // unsubscribeStrategyIds: res.unsubscribeStrategyIds ? res.unsubscribeStrategyIds : [],
|
|
|
- // viceProductIds: res.viceProductIds,
|
|
|
- // linkUrl: res.linkUrl
|
|
|
- // };
|
|
|
- // if (res.extJson) {
|
|
|
- // this.extJson = JSON.parse(res.extJson)
|
|
|
- // if (this.extJson.dispose) {
|
|
|
- // this.disposeVal = this.extJson.dispose.split(',')
|
|
|
- // }
|
|
|
- // }
|
|
|
- // if (res.activeStartDate) {
|
|
|
- // this.datetimerange = [res.activeStartDate, res.activeEndDate]
|
|
|
- // }
|
|
|
- // if (res.weeks) {
|
|
|
- // let checkedWeeks = res.weeks.split(",");
|
|
|
- // checkedWeeks.forEach(item => {
|
|
|
- // this.checkedWeeks.push(weekOptions[item])
|
|
|
- // })
|
|
|
- // }
|
|
|
- // let checkedchannel = [];
|
|
|
- // res.channelInfoDatas.forEach(item => {
|
|
|
- // checkedchannel.push([item.firstChannelId, item.secondChannelId])
|
|
|
- // });
|
|
|
- // this.checkedchannel = checkedchannel;
|
|
|
- // this.rulesform = {
|
|
|
- // activeStartTime: res.activeStartTime,
|
|
|
- // activeEndTime: res.activeEndTime,
|
|
|
- // strategyId: this.$route.query.id,
|
|
|
- // firstChannelId: res.firstChannelId,
|
|
|
- // secondChannelIds: res.secondChannelIds,
|
|
|
- // }
|
|
|
- // });
|
|
|
- // }
|
|
|
- // get("/product/info/page", {
|
|
|
- // pageSize: 100,
|
|
|
- // pageNum: 1,
|
|
|
- // }).then((res) => {
|
|
|
- // this.productInfoList = res.data.list;
|
|
|
- // });
|
|
|
+ // console.log(this.$route.query.ids);
|
|
|
+ if (this.$route.query.ids) {
|
|
|
+ get("/strategy/strategy-info/list", {
|
|
|
+ ids: this.$route.query.ids,
|
|
|
+ }).then((res) => {
|
|
|
+ console.log(res);
|
|
|
+ res = res.data[0];
|
|
|
+ this.oldform = JSON.parse(JSON.stringify(res));
|
|
|
+ this.form = {
|
|
|
+
|
|
|
+ strategyName: res.strategyName,
|
|
|
+ strategyType: res.strategyType,
|
|
|
+ templateId: res.templateId,
|
|
|
+ strategyStatus: res.strategyStatus.toString(),
|
|
|
+ primaryProductId: res.primaryProductId,
|
|
|
+ maskText: res.maskText,
|
|
|
+ activityUuid: res.activityUuid,
|
|
|
+ activityType: res.activityType,
|
|
|
+ posterPhoto: res.posterPhoto,
|
|
|
+ activityLogo: res.activityLogo,
|
|
|
+ promotePhoto: res.promotePhoto,
|
|
|
+ recommendStrategyIds: res.recommendStrategyIds,
|
|
|
+ unsubscribeStrategyIds: res.unsubscribeStrategyIds
|
|
|
+ ? res.unsubscribeStrategyIds
|
|
|
+ : [],
|
|
|
+ viceProductIds: res.viceProductIds,
|
|
|
+ linkUrl: res.linkUrl,
|
|
|
+ directCharge: res.directCharge,
|
|
|
+ id: res.id,
|
|
|
+ };
|
|
|
+ if (res.extJson) {
|
|
|
+ this.extJson = JSON.parse(res.extJson);
|
|
|
+ if (this.extJson.dispose) {
|
|
|
+ this.disposeVal = this.extJson.dispose.split(",");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (res.activeStartDate) {
|
|
|
+ this.datetimerange = [res.activeStartDate, res.activeEndDate];
|
|
|
+ }
|
|
|
+ if (res.weeks) {
|
|
|
+ let checkedWeeks = res.weeks.split(",");
|
|
|
+ checkedWeeks.forEach((item) => {
|
|
|
+ this.checkedWeeks.push(weekOptions[item]);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ // // let checkedchannel = [];
|
|
|
+ // console.log(res);
|
|
|
+ // res.channelInfoDatas.forEach((item) => {
|
|
|
+ // checkedchannel.push([item.firstChannelId, item.secondChannelId]);
|
|
|
+ // });
|
|
|
+ // this.checkedchannel = checkedchannel;
|
|
|
+
|
|
|
+ this.rulesform = {
|
|
|
+ activeStartTime: res.activeStartTime,
|
|
|
+ activeEndTime: res.activeEndTime,
|
|
|
+ strategyId: this.$route.query.id,
|
|
|
+ firstChannelId: res.firstChannelId,
|
|
|
+ secondChannelIds: res.secondChannelIds,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ this.btn = "编辑保存";
|
|
|
+ }
|
|
|
+ if (this.$route.query.copyId) {
|
|
|
+ get("/strategy/strategy-info/list", {
|
|
|
+ ids: this.$route.query.copyId,
|
|
|
+ }).then((res) => {
|
|
|
+ console.log(res);
|
|
|
+ res = res.data[0];
|
|
|
+ this.oldform = JSON.parse(JSON.stringify(res));
|
|
|
+ this.form = {
|
|
|
+ strategyName: res.strategyName + " 副本",
|
|
|
+ strategyType: res.strategyType,
|
|
|
+ templateId: res.templateId,
|
|
|
+ strategyStatus: res.strategyStatus.toString(),
|
|
|
+ primaryProductId: res.primaryProductId,
|
|
|
+ maskText: res.maskText,
|
|
|
+ activityUuid: res.activityUuid,
|
|
|
+ activityType: res.activityType,
|
|
|
+ posterPhoto: res.posterPhoto,
|
|
|
+ activityLogo: res.activityLogo,
|
|
|
+ promotePhoto: res.promotePhoto,
|
|
|
+ recommendStrategyIds: res.recommendStrategyIds,
|
|
|
+ unsubscribeStrategyIds: res.unsubscribeStrategyIds
|
|
|
+ ? res.unsubscribeStrategyIds
|
|
|
+ : [],
|
|
|
+ viceProductIds: res.viceProductIds,
|
|
|
+ linkUrl: res.linkUrl,
|
|
|
+ };
|
|
|
+ if (res.extJson) {
|
|
|
+ this.extJson = JSON.parse(res.extJson);
|
|
|
+ if (this.extJson.dispose) {
|
|
|
+ this.disposeVal = this.extJson.dispose.split(",");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (res.activeStartDate) {
|
|
|
+ this.datetimerange = [res.activeStartDate, res.activeEndDate];
|
|
|
+ }
|
|
|
+ if (res.weeks) {
|
|
|
+ let checkedWeeks = res.weeks.split(",");
|
|
|
+ checkedWeeks.forEach((item) => {
|
|
|
+ this.checkedWeeks.push(weekOptions[item]);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ let checkedchannel = [];
|
|
|
+ res.channelInfoDatas.forEach((item) => {
|
|
|
+ checkedchannel.push([item.firstChannelId, item.secondChannelId]);
|
|
|
+ });
|
|
|
+ this.checkedchannel = checkedchannel;
|
|
|
+ this.rulesform = {
|
|
|
+ activeStartTime: res.activeStartTime,
|
|
|
+ activeEndTime: res.activeEndTime,
|
|
|
+ strategyId: this.$route.query.id,
|
|
|
+ firstChannelId: res.firstChannelId,
|
|
|
+ secondChannelIds: res.secondChannelIds,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ }
|
|
|
+ get("/product/info/page", {
|
|
|
+ pageSize: 100,
|
|
|
+ pageNum: 1,
|
|
|
+ }).then((res) => {
|
|
|
+ this.productInfoList = res.data.list;
|
|
|
+ });
|
|
|
//获取模板列表
|
|
|
// get('/templateInfo/page', {
|
|
|
// 'pageSize': 9999,
|
|
@@ -961,203 +1030,204 @@ export default {
|
|
|
// });
|
|
|
// this.templateList = res.data.list
|
|
|
// });
|
|
|
- // get("/strategy/strategy-info/page", {
|
|
|
- // pageSize: 100,
|
|
|
- // pageNum: 1,
|
|
|
- // }).then((res) => {
|
|
|
- // this.strategyInfoNewList = res.data.list;
|
|
|
- // });
|
|
|
- // get("/channel/info/page", {
|
|
|
- // pageSize: 100,
|
|
|
- // pageNum: 1,
|
|
|
- // }).then((res) => {
|
|
|
- // this.options = getArrayClassification({
|
|
|
- // data: res.data.list,
|
|
|
- // parent: "parentId",
|
|
|
- // id: "id",
|
|
|
- // child: "children",
|
|
|
- // });
|
|
|
- // this.props = {
|
|
|
- // multiple: true,
|
|
|
- // label: "channelName",
|
|
|
- // value: "id",
|
|
|
- // };
|
|
|
- // });
|
|
|
+ get("/strategy/strategy-info/page", {
|
|
|
+ pageSize: 100,
|
|
|
+ pageNum: 1,
|
|
|
+ }).then((res) => {
|
|
|
+ this.strategyInfoNewList = res.data.list;
|
|
|
+ });
|
|
|
+ get("/channel/info/page", {
|
|
|
+ pageSize: 100,
|
|
|
+ pageNum: 1,
|
|
|
+ }).then((res) => {
|
|
|
+ this.options = getArrayClassification({
|
|
|
+ data: res.data.list,
|
|
|
+ parent: "parentId",
|
|
|
+ id: "id",
|
|
|
+ child: "children",
|
|
|
+ });
|
|
|
+ this.props = {
|
|
|
+ multiple: true,
|
|
|
+ label: "channelName",
|
|
|
+ value: "id",
|
|
|
+ };
|
|
|
+ });
|
|
|
},
|
|
|
methods: {
|
|
|
- onSubmit() {
|
|
|
- post("/strategy/strategy-info/create",this.form).then((res)=>{
|
|
|
- console.log(res);
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- // onSubmit: function (formName) {
|
|
|
- // // this.$confirm(
|
|
|
- // // "您确定编辑该策略?当前操作会影响所有上线该策略的渠道",
|
|
|
- // // "提示",
|
|
|
- // // {
|
|
|
- // // confirmButtonText: "确定",
|
|
|
- // // cancelButtonText: "取消",
|
|
|
- // // type: "warning",
|
|
|
- // // }
|
|
|
- // // )
|
|
|
- // // .then(() => {
|
|
|
- // // this.$refs[formName].validate((valid) => {
|
|
|
- // // console.log(valid);
|
|
|
- // // if (valid) {
|
|
|
- // // let ids = this.form.unsubscribeStrategyIds[0];
|
|
|
- // // this.form.unsubscribeStrategyIds =
|
|
|
- // // ids !== "" && ids !== [] && ids ? [ids] : [];
|
|
|
- // // let template = this.templateList.find((n) => {
|
|
|
- // // return n.id === this.form.templateId;
|
|
|
- // // });
|
|
|
- // // this.extJson.templateCode = template.templateCode;
|
|
|
- // // if (
|
|
|
- // // this.extJson.isMask === "1" &&
|
|
|
- // // (!this.extJson.maskText || this.extJson.maskText === "")
|
|
|
- // // ) {
|
|
|
- // // this.$message.error("遮罩文案未填写");
|
|
|
- // // return false;
|
|
|
- // // }
|
|
|
- // // // if (this.extJson.isZoetrope === '1' && (!this.extJson.zoetropeText || this.extJson
|
|
|
- // // // .zoetropeText === "")) {
|
|
|
- // // // this.$message.error('走马灯文案未填写');
|
|
|
- // // // return false
|
|
|
- // // // }
|
|
|
- // // this.form.extJson = JSON.stringify(this.extJson);
|
|
|
- // // this.rulesform.weeks = this.checkedWeeks
|
|
|
- // // .map((i) => weekOptions.findIndex((j) => j == i))
|
|
|
- // // .sort()
|
|
|
- // // .toString();
|
|
|
+ onSubmit: function (formName) {
|
|
|
+ this.$confirm(
|
|
|
+ "您确定编辑该策略?当前操作会影响所有上线该策略的渠道",
|
|
|
+ "提示",
|
|
|
+ {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }
|
|
|
+ )
|
|
|
+ .then(() => {
|
|
|
+ this.$refs[formName].validate((valid) => {
|
|
|
+ console.log(valid);
|
|
|
+ if (valid) {
|
|
|
+ console.log(1111);
|
|
|
+ // let ids = this.form.unsubscribeStrategyIds[0];
|
|
|
+ // this.form.unsubscribeStrategyIds =
|
|
|
+ // ids !== "" && ids !== [] && ids ? [ids] : [];
|
|
|
+ // let template = this.templateList.find((n) => {
|
|
|
+ // return n.id === this.form.templateId;
|
|
|
+ // });
|
|
|
+ // this.extJson.templateCode = template.templateCode;
|
|
|
+ // if (
|
|
|
+ // this.extJson.isMask === "1" &&
|
|
|
+ // (!this.extJson.maskText || this.extJson.maskText === "")
|
|
|
+ // ) {
|
|
|
+ // this.$message.error("遮罩文案未填写");
|
|
|
+ // return false;
|
|
|
+ // }
|
|
|
+ // if (this.extJson.isZoetrope === '1' && (!this.extJson.zoetropeText || this.extJson
|
|
|
+ // .zoetropeText === "")) {
|
|
|
+ // this.$message.error('走马灯文案未填写');
|
|
|
+ // return false
|
|
|
+ // }
|
|
|
+ console.log(222);
|
|
|
+ this.form.extJson = JSON.stringify(this.extJson);
|
|
|
+ this.rulesform.weeks = this.checkedWeeks
|
|
|
+ .map((i) => weekOptions.findIndex((j) => j == i))
|
|
|
+ .sort()
|
|
|
+ .toString();
|
|
|
|
|
|
- // // var array1 = JSON.parse(JSON.stringify(this.oldform));
|
|
|
- // // var array2 = JSON.parse(JSON.stringify(this.form));
|
|
|
- // // array2["activeEndDate"] = this.rulesform.activeEndDate
|
|
|
- // // ? this.rulesform.activeEndDate
|
|
|
- // // : null;
|
|
|
- // // array2["activeEndTime"] = this.rulesform.activeEndTime
|
|
|
- // // ? this.rulesform.activeEndTime
|
|
|
- // // : null;
|
|
|
- // // array2["activeStartDate"] = this.rulesform.activeStartDate
|
|
|
- // // ? this.rulesform.activeStartDate
|
|
|
- // // : null;
|
|
|
- // // array2["activeStartTime"] = this.rulesform.activeStartTime
|
|
|
- // // ? this.rulesform.activeStartTime
|
|
|
- // // : null;
|
|
|
- // // array2["weeks"] = this.rulesform.weeks;
|
|
|
- // // let text = "策略:" + this.form.strategyName;
|
|
|
- // // XEUtils.objectEach(array2, (item, key) => {
|
|
|
- // // if (item != array1[key]) {
|
|
|
- // // if (key == "extJson") {
|
|
|
- // // let ext = JSON.parse(item);
|
|
|
- // // if (array1[key]) {
|
|
|
- // // let arr = JSON.parse(array1[key]);
|
|
|
- // // XEUtils.objectEach(ext, (i, k) => {
|
|
|
- // // if (i != arr[k]) {
|
|
|
- // // text += `\n${k}:${arr[k]} 改为 ${i ? i : "空"}`;
|
|
|
- // // }
|
|
|
- // // });
|
|
|
- // // } else {
|
|
|
- // // XEUtils.objectEach(ext, (i, k) => {
|
|
|
- // // text += `\n${k}:空 改为 ${i ? i : "空"}`;
|
|
|
- // // });
|
|
|
- // // }
|
|
|
- // // } else {
|
|
|
- // // text += `\n${key}:${array1[key]} 改为 ${
|
|
|
- // // item ? item : "空"
|
|
|
- // // }`;
|
|
|
- // // }
|
|
|
- // // }
|
|
|
- // // });
|
|
|
+ var array1 = JSON.parse(JSON.stringify(this.oldform));
|
|
|
+ var array2 = JSON.parse(JSON.stringify(this.form));
|
|
|
+ array2["activeEndDate"] = this.rulesform.activeEndDate
|
|
|
+ ? this.rulesform.activeEndDate
|
|
|
+ : null;
|
|
|
+ array2["activeEndTime"] = this.rulesform.activeEndTime
|
|
|
+ ? this.rulesform.activeEndTime
|
|
|
+ : null;
|
|
|
+ array2["activeStartDate"] = this.rulesform.activeStartDate
|
|
|
+ ? this.rulesform.activeStartDate
|
|
|
+ : null;
|
|
|
+ array2["activeStartTime"] = this.rulesform.activeStartTime
|
|
|
+ ? this.rulesform.activeStartTime
|
|
|
+ : null;
|
|
|
+ array2["weeks"] = this.rulesform.weeks;
|
|
|
+ let text = "策略:" + this.form.strategyName;
|
|
|
+ console.log(333);
|
|
|
+ XEUtils.objectEach(array2, (item, key) => {
|
|
|
+ if (item != array1[key]) {
|
|
|
+ if (key == "extJson") {
|
|
|
+ let ext = JSON.parse(item);
|
|
|
+ if (array1[key]) {
|
|
|
+ let arr = JSON.parse(array1[key]);
|
|
|
+ XEUtils.objectEach(ext, (i, k) => {
|
|
|
+ if (i != arr[k]) {
|
|
|
+ text += `\n${k}:${arr[k]} 改为 ${i ? i : "空"}`;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ XEUtils.objectEach(ext, (i, k) => {
|
|
|
+ text += `\n${k}:空 改为 ${i ? i : "空"}`;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ text += `\n${key}:${array1[key]} 改为 ${
|
|
|
+ item ? item : "空"
|
|
|
+ }`;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
- // // if (this.$route.query.id) {
|
|
|
- // // post("/strategyInfoNew/savelog", {
|
|
|
- // // type: array2.activityType ? array2.activityType : 0,
|
|
|
- // // notes: text,
|
|
|
- // // strategyId: array2.id,
|
|
|
- // // strategyName: array2.strategyName,
|
|
|
- // // });
|
|
|
- // // post(
|
|
|
- // // "/strategyInfoNew/update/" + this.$route.query.id,
|
|
|
- // // this.form
|
|
|
- // // ).then((res) => {
|
|
|
- // // get("/strategy/strategy-info/page", {
|
|
|
- // // pageSize: 100,
|
|
|
- // // pageNum: 1,
|
|
|
- // // }).then((res) => {
|
|
|
- // // this.strategyInfoNewList = res.data.list;
|
|
|
- // // });
|
|
|
- // // let checkedchannel = [];
|
|
|
- // // this.checkedchannel.forEach((res) => {
|
|
|
- // // checkedchannel.push({
|
|
|
- // // firstChannelId: res[0],
|
|
|
- // // secondChannelId: res[1],
|
|
|
- // // });
|
|
|
- // // });
|
|
|
- // // this.rulesform.channelInfoDatas = checkedchannel;
|
|
|
- // // post(
|
|
|
- // // "strategyInfoNew/updateStrategyRules",
|
|
|
- // // this.rulesform
|
|
|
- // // ).then((res) => {
|
|
|
- // // // this.close()
|
|
|
- // // });
|
|
|
- // // this.$message({
|
|
|
- // // message: res.message,
|
|
|
- // // type: "success",
|
|
|
- // // duration: 3000,
|
|
|
- // // offset: 360,
|
|
|
- // // });
|
|
|
- // // setTimeout(() => {
|
|
|
- // // window.close();
|
|
|
- // // }, 1200);
|
|
|
- // // });
|
|
|
- // // } else {
|
|
|
- // // post("/strategy/strategy-info/create", this.form).then(
|
|
|
- // // (res) => {
|
|
|
- // // let params = {
|
|
|
- // // activeStartDate: "",
|
|
|
- // // activeStartTime: "00:00:00",
|
|
|
- // // activeEndDate: "",
|
|
|
- // // activeEndTime: "23:59:59",
|
|
|
- // // channelInfoDatas: [
|
|
|
- // // {
|
|
|
- // // firstChannelId: "",
|
|
|
- // // secondChannelId: "",
|
|
|
- // // },
|
|
|
- // // ],
|
|
|
- // // strategyId: "",
|
|
|
- // // weeks: "",
|
|
|
- // // };
|
|
|
+ if (this.$route.query.ids) {
|
|
|
+ // post("/strategyInfoNew/savelog", {
|
|
|
+ // type: array2.activityType ? array2.activityType : 0,
|
|
|
+ // notes: text,
|
|
|
+ // strategyId: array2.id,
|
|
|
+ // strategyName: array2.strategyName,
|
|
|
+ // });
|
|
|
+ this.id = this.$route.ids;
|
|
|
+ // console.log(this.id);
|
|
|
+ console.log(this.form);
|
|
|
+ //修改
|
|
|
+ put("/strategy/strategy-info/update", this.form).then((res) => {
|
|
|
+ get("/strategy/strategy-info/page", {
|
|
|
+ pageSize: 100,
|
|
|
+ pageNum: 1,
|
|
|
+ }).then((res) => {
|
|
|
+ this.strategyInfoNewList = res.data.list;
|
|
|
+ });
|
|
|
+ let checkedchannel = [];
|
|
|
+ this.checkedchannel.forEach((res) => {
|
|
|
+ checkedchannel.push({
|
|
|
+ firstChannelId: res[0],
|
|
|
+ secondChannelId: res[1],
|
|
|
+ });
|
|
|
+ });
|
|
|
+ this.rulesform.channelInfoDatas = checkedchannel;
|
|
|
+ // post(
|
|
|
+ // "strategyInfoNew/updateStrategyRules",
|
|
|
+ // this.rulesform
|
|
|
+ // ).then((res) => {
|
|
|
+ // // this.close()
|
|
|
+ // });
|
|
|
+ this.$message({
|
|
|
+ message: "操作成功",
|
|
|
+ type: "success",
|
|
|
+ duration: 3000,
|
|
|
+ offset: 360,
|
|
|
+ });
|
|
|
+ // setTimeout(() => {
|
|
|
+ // window.close();
|
|
|
+ // }, 1200);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ post(
|
|
|
+ "/strategy/strategy-info/create",
|
|
|
+ this.form,
|
|
|
+ this.rulesform
|
|
|
+ ).then((res) => {
|
|
|
+ let params = {
|
|
|
+ activeStartDate: "",
|
|
|
+ activeStartTime: "00:00:00",
|
|
|
+ activeEndDate: "",
|
|
|
+ activeEndTime: "23:59:59",
|
|
|
+ channelInfoDatas: [
|
|
|
+ {
|
|
|
+ firstChannelId: "",
|
|
|
+ secondChannelId: "",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ strategyId: "",
|
|
|
+ weeks: "",
|
|
|
+ };
|
|
|
+ console.log(res);
|
|
|
+ // post("strategyInfoNew/updateStrategyRules", params).then(
|
|
|
+ // (res) => {
|
|
|
+ // // this.close()
|
|
|
+ // }
|
|
|
+ // );
|
|
|
|
|
|
- // // post("strategyInfoNew/updateStrategyRules", params).then(
|
|
|
- // // (res) => {
|
|
|
- // // // this.close()
|
|
|
- // // }
|
|
|
- // // );
|
|
|
- // // this.$message({
|
|
|
- // // message: res.message,
|
|
|
- // // type: "success",
|
|
|
- // // duration: 3000,
|
|
|
- // // offset: 360,
|
|
|
- // // });
|
|
|
- // // setTimeout(() => {
|
|
|
- // // window.close();
|
|
|
- // // }, 1200);
|
|
|
- // // }
|
|
|
- // // );
|
|
|
- // // }
|
|
|
- // // } else {
|
|
|
- // // return false;
|
|
|
- // // }
|
|
|
- // // });
|
|
|
- // // })
|
|
|
- // // .catch(() => {
|
|
|
- // // this.$message({
|
|
|
- // // type: "info",
|
|
|
- // // message: "已取消",
|
|
|
- // // });
|
|
|
- // // });
|
|
|
- // },
|
|
|
+ this.$message({
|
|
|
+ message: "操作成功",
|
|
|
+ type: "success",
|
|
|
+ duration: 3000,
|
|
|
+ offset: 360,
|
|
|
+ });
|
|
|
+ setTimeout(() => {
|
|
|
+ this.$router.back();
|
|
|
+ }, 1200);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: "info",
|
|
|
+ message: "已取消",
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
changePromotionPicposterPhoto(e) {
|
|
|
// this.$set(
|
|
|
// this.form,
|
|
@@ -1180,14 +1250,14 @@ export default {
|
|
|
// );
|
|
|
},
|
|
|
handleCheckAllChange(val) {
|
|
|
- // this.checkedWeeks = val ? weekOptions : [];
|
|
|
- // this.isIndeterminate = false;
|
|
|
+ this.checkedWeeks = val ? weekOptions : [];
|
|
|
+ this.isIndeterminate = false;
|
|
|
},
|
|
|
handleCheckedCitiesChange(value) {
|
|
|
- // let checkedCount = value.length;
|
|
|
- // this.checkAll = checkedCount === this.weeksList.length;
|
|
|
- // this.isIndeterminate =
|
|
|
- // checkedCount > 0 && checkedCount < this.weeksList.length;
|
|
|
+ let checkedCount = value.length;
|
|
|
+ this.checkAll = checkedCount === this.weeksList.length;
|
|
|
+ this.isIndeterminate =
|
|
|
+ checkedCount > 0 && checkedCount < this.weeksList.length;
|
|
|
},
|
|
|
close() {
|
|
|
this.$confirm("此操作不会保存已编辑数据, 是否继续?", "提示", {
|