|
@@ -12,11 +12,11 @@
|
|
<el-input v-model="form.name" placeholder="请输入活动名称" />
|
|
<el-input v-model="form.name" placeholder="请输入活动名称" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
- <el-form-item label="活动类型:" prop="activityType">
|
|
|
|
|
|
+ <el-form-item label="活动类型:">
|
|
<el-select
|
|
<el-select
|
|
v-model="form.platformName"
|
|
v-model="form.platformName"
|
|
placeholder="请选择活动类型"
|
|
placeholder="请选择活动类型"
|
|
- :disabled="disabledActivity"
|
|
|
|
|
|
+ :disabled="hasId"
|
|
>
|
|
>
|
|
<el-option
|
|
<el-option
|
|
v-for="item in platformNames"
|
|
v-for="item in platformNames"
|
|
@@ -94,13 +94,13 @@
|
|
<span v-if="disabledActivity">{{ scope.row.goodName }}</span>
|
|
<span v-if="disabledActivity">{{ scope.row.goodName }}</span>
|
|
<el-select
|
|
<el-select
|
|
v-else
|
|
v-else
|
|
- v-model="scope.row.goodId"
|
|
|
|
|
|
+ v-model="scope.row.goodName"
|
|
placeholder="请选择活动权益"
|
|
placeholder="请选择活动权益"
|
|
:disabled="disabledActivity"
|
|
:disabled="disabledActivity"
|
|
>
|
|
>
|
|
<el-option
|
|
<el-option
|
|
v-for="item in form.platformName === platformNames[1]
|
|
v-for="item in form.platformName === platformNames[1]
|
|
- ? aaaa[scope.row.deviceId]
|
|
|
|
|
|
+ ? addDeviceAcitivty[scope.row.deviceId]
|
|
: serviceTimeOptions"
|
|
: serviceTimeOptions"
|
|
:key="
|
|
:key="
|
|
form.platformName === platformNames[1]
|
|
form.platformName === platformNames[1]
|
|
@@ -179,7 +179,9 @@ export default {
|
|
|
|
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- aaaa: {},
|
|
|
|
|
|
+ hasId: false,
|
|
|
|
+ initId: null,
|
|
|
|
+ addDeviceAcitivty: {},
|
|
// 表单
|
|
// 表单
|
|
deviceRespListTemp: [],
|
|
deviceRespListTemp: [],
|
|
form: {
|
|
form: {
|
|
@@ -204,14 +206,7 @@ export default {
|
|
trigger: "change",
|
|
trigger: "change",
|
|
},
|
|
},
|
|
],
|
|
],
|
|
- activityType: [
|
|
|
|
- {
|
|
|
|
- type: "array",
|
|
|
|
- required: true,
|
|
|
|
- message: "请选择活动类型",
|
|
|
|
- trigger: "change",
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
|
|
+
|
|
timeList: [
|
|
timeList: [
|
|
{
|
|
{
|
|
required: true,
|
|
required: true,
|
|
@@ -240,7 +235,7 @@ export default {
|
|
for (var i = 0; i < val.length; i++) {
|
|
for (var i = 0; i < val.length; i++) {
|
|
var deviceId = val[i].deviceId;
|
|
var deviceId = val[i].deviceId;
|
|
if (this.deviceRespListTemp[i].deviceId != val[i].deviceId) {
|
|
if (this.deviceRespListTemp[i].deviceId != val[i].deviceId) {
|
|
- let a = this.aaaa[`${deviceId}`];
|
|
|
|
|
|
+ let a = this.addDeviceAcitivty[`${deviceId}`];
|
|
if (a == null || a.length == 0) {
|
|
if (a == null || a.length == 0) {
|
|
this.getGoodList(deviceId);
|
|
this.getGoodList(deviceId);
|
|
}
|
|
}
|
|
@@ -269,7 +264,7 @@ export default {
|
|
|
|
|
|
"form.platformName": {
|
|
"form.platformName": {
|
|
handler(val) {
|
|
handler(val) {
|
|
- if (!this.disabledActivity) {
|
|
|
|
|
|
+ if (!this.$route.query.id) {
|
|
for (let i in this.form.deviceRespList) {
|
|
for (let i in this.form.deviceRespList) {
|
|
if (this.form.deviceRespList[i].goodId != null) {
|
|
if (this.form.deviceRespList[i].goodId != null) {
|
|
this.form.deviceRespList[i].goodId = null;
|
|
this.form.deviceRespList[i].goodId = null;
|
|
@@ -295,6 +290,7 @@ export default {
|
|
mounted() {
|
|
mounted() {
|
|
this.getDevList();
|
|
this.getDevList();
|
|
if (this.$route.query.id) {
|
|
if (this.$route.query.id) {
|
|
|
|
+ this.hasId = true;
|
|
this.getDetail();
|
|
this.getDetail();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -310,7 +306,7 @@ export default {
|
|
|
|
|
|
goodList(param).then((res) => {
|
|
goodList(param).then((res) => {
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
- this.aaaa[`${deviceId}`] = res.data;
|
|
|
|
|
|
+ this.addDeviceAcitivty[`${deviceId}`] = res.data;
|
|
this.form.deviceRespList = this.form.deviceRespList.filter((i) => i);
|
|
this.form.deviceRespList = this.form.deviceRespList.filter((i) => i);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -319,7 +315,6 @@ export default {
|
|
// 详情
|
|
// 详情
|
|
getDetail() {
|
|
getDetail() {
|
|
detail(this.$route.query.id).then((res) => {
|
|
detail(this.$route.query.id).then((res) => {
|
|
- console.log("gasdfasdfqwerqr====" + JSON.stringify(res));
|
|
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
res.data.platformName =
|
|
res.data.platformName =
|
|
res.data.platformId === 1
|
|
res.data.platformId === 1
|
|
@@ -371,6 +366,14 @@ export default {
|
|
|
|
|
|
// 确定
|
|
// 确定
|
|
getSubmit() {
|
|
getSubmit() {
|
|
|
|
+ // 解决选择数据和展现数据的字段不一致的问题
|
|
|
|
+ this.form.deviceRespList.map((i) => {
|
|
|
|
+ if (i.goodId == null) {
|
|
|
|
+ i.goodId = i.goodName;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ console.log("gasdfasdfqwerqr==22==" + JSON.stringify(this.form));
|
|
submit(this.form).then((res) => {
|
|
submit(this.form).then((res) => {
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
this.$message.success("提交成功!");
|
|
this.$message.success("提交成功!");
|