|
|
@@ -11,7 +11,12 @@
|
|
|
</div>
|
|
|
<div class="bodyRow timeWidth">
|
|
|
<span>发布时间</span
|
|
|
- ><input type="date" placeholder="选择时间" :max="localDay" v-model="ziliaoTime" />
|
|
|
+ ><input
|
|
|
+ type="date"
|
|
|
+ placeholder="选择时间"
|
|
|
+ :max="localDay"
|
|
|
+ v-model="ziliaoTime"
|
|
|
+ />
|
|
|
</div>
|
|
|
<div class="bodyRow">
|
|
|
<!-- <div class="contentCol1">
|
|
|
@@ -66,7 +71,7 @@
|
|
|
</select>
|
|
|
</div>
|
|
|
<div v-else>
|
|
|
- <input type="text" v-model="releaseP">
|
|
|
+ <input type="text" v-model="releaseP" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -158,7 +163,7 @@ export default {
|
|
|
modalTitle: {
|
|
|
type: String,
|
|
|
default: "编辑",
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -197,8 +202,9 @@ export default {
|
|
|
|
|
|
releaseChannel: [],
|
|
|
releasePlate: [],
|
|
|
- userId: '',
|
|
|
+ userId: "",
|
|
|
localDay: "",
|
|
|
+ noEditFlag: false,
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -218,7 +224,73 @@ export default {
|
|
|
}
|
|
|
this.localDay = year + "-" + month + "-" + day;
|
|
|
},
|
|
|
+ // 判断非空
|
|
|
+ boforeEdit: function () {
|
|
|
+ this.releaseP = (this.releaseP || '').replace(/\s/g, "");
|
|
|
+ this.mediaTitle = (this.mediaTitle || '').replace(/\s/g, "");
|
|
|
+ if (!this.ziliaoTime) {
|
|
|
+ this.noEditFlag = true;
|
|
|
+ alert("发布时间不能为空");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!this.carT) {
|
|
|
+ this.noEditFlag = true;
|
|
|
+ alert("请选择车型");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!this.releaseC) {
|
|
|
+ this.noEditFlag = true;
|
|
|
+ alert("请选择发布渠道");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!this.releaseP) {
|
|
|
+ this.noEditFlag = true;
|
|
|
+ alert("请选择平台版块");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!this.contentName1) {
|
|
|
+ this.noEditFlag = true;
|
|
|
+ alert("请选择稿件类别");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!this.contentName2) {
|
|
|
+ this.noEditFlag = true;
|
|
|
+ alert("请选择内容分类");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!this.readCount || this.readCount < 0) {
|
|
|
+ this.noEditFlag = true;
|
|
|
+ alert("请填写阅读量");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!this.goodCount || this.goodCount < 0) {
|
|
|
+ this.noEditFlag = true;
|
|
|
+ alert("请填写点赞量");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!this.bbsCount || this.bbsCount < 0) {
|
|
|
+ this.noEditFlag = true;
|
|
|
+ alert("请填写评论量");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!this.lookingCount || this.lookingCount < 0) {
|
|
|
+ this.noEditFlag = true;
|
|
|
+ alert("请填写正确的再看/转发");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!this.mediaTitle) {
|
|
|
+ this.noEditFlag = true;
|
|
|
+ alert("标题不能为空");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!this.mediaUrl) {
|
|
|
+ this.noEditFlag = true;
|
|
|
+ alert("链接不能为空");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ },
|
|
|
edit: function () {
|
|
|
+ this.noEditFlag = false;
|
|
|
let obj = {};
|
|
|
//获取资料名
|
|
|
/* let idVal = this.ziliaoId;
|
|
|
@@ -226,62 +298,65 @@ export default {
|
|
|
return item.id === idVal;
|
|
|
});
|
|
|
this.ziliaoName = obj.informationName; */
|
|
|
- //获取车系 id
|
|
|
- let nameCarS = this.carS;
|
|
|
- obj = this.carSeries.find(function (item) {
|
|
|
- return item.typeName === nameCarS;
|
|
|
- });
|
|
|
- console.log("chexi ", obj);
|
|
|
- //carTypeId 表示车系 id
|
|
|
- // this.carTypeId = obj.id;
|
|
|
+ this.boforeEdit();
|
|
|
+ if (!this.noEditFlag) {
|
|
|
+ //获取车系 id
|
|
|
+ let nameCarS = this.carS;
|
|
|
+ obj = this.carSeries.find(function (item) {
|
|
|
+ return item.typeName === nameCarS;
|
|
|
+ });
|
|
|
+ console.log("chexi ", obj);
|
|
|
+ //carTypeId 表示车系 id
|
|
|
+ // this.carTypeId = obj.id;
|
|
|
|
|
|
- //当前月份
|
|
|
- let date = new Date();
|
|
|
- let m = date.getMonth() + 1;
|
|
|
- let y = date.getFullYear();
|
|
|
- let d = y + "/" + m;
|
|
|
- let config = {
|
|
|
- url: "",
|
|
|
- data: {
|
|
|
- id: "", //主键值
|
|
|
- month: d,
|
|
|
- dealerId: this.userId,
|
|
|
- dataId: this.ziliaoId,
|
|
|
- informationName: this.ziliaoName,
|
|
|
- releaseTime: this.ziliaoTime,
|
|
|
- carService: this.carS,
|
|
|
- carType: this.carT,
|
|
|
+ //当前月份
|
|
|
+ let date = new Date();
|
|
|
+ let m = date.getMonth() + 1;
|
|
|
+ let y = date.getFullYear();
|
|
|
+ let d = y + "/" + m;
|
|
|
+ let config = {
|
|
|
+ url: "",
|
|
|
+ data: {
|
|
|
+ id: "", //主键值
|
|
|
+ month: d,
|
|
|
+ dealerId: this.userId,
|
|
|
+ dataId: this.ziliaoId,
|
|
|
+ informationName: this.ziliaoName,
|
|
|
+ releaseTime: this.ziliaoTime,
|
|
|
+ carService: this.carS,
|
|
|
+ carType: this.carT,
|
|
|
|
|
|
- //发布平台 渠道
|
|
|
- releaseMedia: this.releaseC,
|
|
|
- //发布板块
|
|
|
- releasePlate: this.releaseP,
|
|
|
+ //发布平台 渠道
|
|
|
+ releaseMedia: this.releaseC,
|
|
|
+ //发布板块
|
|
|
+ releasePlate: this.releaseP,
|
|
|
|
|
|
- draftGenre: this.contentName1,
|
|
|
+ draftGenre: this.contentName1,
|
|
|
|
|
|
- //内容分类2?
|
|
|
- contentClass: this.contentName2,
|
|
|
- articleTitle: this.mediaTitle,
|
|
|
- articleLink: this.mediaUrl,
|
|
|
+ //内容分类2?
|
|
|
+ contentClass: this.contentName2,
|
|
|
+ articleTitle: this.mediaTitle,
|
|
|
+ articleLink: this.mediaUrl,
|
|
|
|
|
|
- readCount: this.readCount,
|
|
|
- goodCount: this.goodCount,
|
|
|
- bbsCount: this.bbsCount,
|
|
|
- lookingCount: this.lookingCount,
|
|
|
- },
|
|
|
- };
|
|
|
+ readCount: this.readCount,
|
|
|
+ goodCount: this.goodCount,
|
|
|
+ bbsCount: this.bbsCount,
|
|
|
+ lookingCount: this.lookingCount,
|
|
|
+ },
|
|
|
+ };
|
|
|
|
|
|
- if (this.LinkData.id) {
|
|
|
- //编辑
|
|
|
- config.url = "/updateDealerFeedback";
|
|
|
- config.data.id = this.LinkData.id;
|
|
|
- } else {
|
|
|
- //新增
|
|
|
- config.url = "/dealerFeedback";
|
|
|
- }
|
|
|
+ if (this.LinkData.id) {
|
|
|
+ //编辑
|
|
|
+ config.url = "/updateDealerFeedback";
|
|
|
+ config.data.id = this.LinkData.id;
|
|
|
+ } else {
|
|
|
+ //新增
|
|
|
+ config.url = "/dealerFeedback";
|
|
|
+ }
|
|
|
|
|
|
- this.$emit("update", config);
|
|
|
- this.$emit("closeme");
|
|
|
+ this.$emit("update", config);
|
|
|
+ this.$emit("closeme");
|
|
|
+ }
|
|
|
},
|
|
|
//资料名称列表
|
|
|
chooseDataName: function () {
|
|
|
@@ -342,7 +417,7 @@ export default {
|
|
|
url: "/base/carTypeManager/selectCarTypeList",
|
|
|
method: "post",
|
|
|
data: {
|
|
|
- parentId: this.carTypeId || '-',
|
|
|
+ parentId: this.carTypeId || "-",
|
|
|
},
|
|
|
})
|
|
|
.then((res) => {
|
|
|
@@ -431,9 +506,10 @@ export default {
|
|
|
|
|
|
initialData: function () {
|
|
|
this.ziliaoName = this.fileName;
|
|
|
- if(this.LinkData.informationId) this.ziliaoId = this.LinkData.informationId;
|
|
|
- else{
|
|
|
- this.ziliaoId = this.$route.query.informationId;
|
|
|
+ if (this.LinkData.informationId)
|
|
|
+ this.ziliaoId = this.LinkData.informationId;
|
|
|
+ else {
|
|
|
+ this.ziliaoId = this.$route.query.informationId;
|
|
|
}
|
|
|
|
|
|
this.mediaTitle = this.LinkData.mediaTitle;
|