|
@@ -1,6 +1,11 @@
|
|
<template>
|
|
<template>
|
|
<div class="app-container">
|
|
<div class="app-container">
|
|
<el-form :model="form" :rules="rules" ref="form" label-width="100px">
|
|
<el-form :model="form" :rules="rules" ref="form" label-width="100px">
|
|
|
|
+ <el-form-item label="流量平台:">
|
|
|
|
+ <el-select v-model="form.platform" placeholder="请选择流量平台" :disabled="disabled()">
|
|
|
|
+ <el-option v-for="item in typeOptions" :key="item.value" :value="item.value" :label="item.label" />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
<el-form-item label="关联设备:">
|
|
<el-form-item label="关联设备:">
|
|
<el-select v-model="deviceIds" filterable multiple placeholder="请选择关联设备">
|
|
<el-select v-model="deviceIds" filterable multiple placeholder="请选择关联设备">
|
|
<el-option v-for="item in devOptions" :key="item.value" :label="item.label" :value="item.value.toString()" />
|
|
<el-option v-for="item in devOptions" :key="item.value" :label="item.label" :value="item.value.toString()" />
|
|
@@ -30,7 +35,8 @@
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="原价:" prop="price">
|
|
<el-form-item label="原价:" prop="price">
|
|
- <el-input-number v-model="form.price" :min="0" :max="500" :controls="false" :precision="2" placeholder="请输入原价" />
|
|
|
|
|
|
+ <el-input-number v-model="form.price" :min="0" :max="500" :controls="false" :precision="2"
|
|
|
|
+ placeholder="请输入原价" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="活动价:" prop="discount">
|
|
<el-form-item label="活动价:" prop="discount">
|
|
<el-input-number v-model="form.discount" :min="0" :max="500" :controls="false" :precision="2"
|
|
<el-input-number v-model="form.discount" :min="0" :max="500" :controls="false" :precision="2"
|
|
@@ -87,7 +93,7 @@ export default {
|
|
// 关联设备
|
|
// 关联设备
|
|
deviceIds: [],
|
|
deviceIds: [],
|
|
// 区分
|
|
// 区分
|
|
- typeList: this.$route.query.typeList.split(','),
|
|
|
|
|
|
+ typeList: [],
|
|
// 流量套餐
|
|
// 流量套餐
|
|
goodsOptions: [],
|
|
goodsOptions: [],
|
|
// 爱听专区
|
|
// 爱听专区
|
|
@@ -111,6 +117,14 @@ export default {
|
|
value: 1,
|
|
value: 1,
|
|
label: '否'
|
|
label: '否'
|
|
}],
|
|
}],
|
|
|
|
+ // 流量平台
|
|
|
|
+ typeOptions: [{
|
|
|
|
+ value: 0,
|
|
|
|
+ label: '树米'
|
|
|
|
+ }, {
|
|
|
|
+ value: 1,
|
|
|
|
+ label: '联通'
|
|
|
|
+ }],
|
|
// 校验
|
|
// 校验
|
|
rules: {
|
|
rules: {
|
|
price: [{
|
|
price: [{
|
|
@@ -125,17 +139,23 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
|
|
+ typeList(val) {
|
|
|
|
+ if (val[0] !== '12') {
|
|
|
|
+ this.getSceneList()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
'form.businessType'(val) {
|
|
'form.businessType'(val) {
|
|
if (val !== 5) {
|
|
if (val !== 5) {
|
|
delete this.form.sort
|
|
delete this.form.sort
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ 'form.platform'(val) {
|
|
|
|
+ this.getDevList({ type: val })
|
|
|
|
+ this.getGoodSList(val)
|
|
|
|
+ }
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
- this.typeList[0] === '12' ? [
|
|
|
|
- this.getGoodSList(),
|
|
|
|
- this.form.type = 12
|
|
|
|
- ] : this.getSceneList()
|
|
|
|
|
|
+ this.typeList = this.$route.query.typeList.split(',')
|
|
if (this.$route.query.id) {
|
|
if (this.$route.query.id) {
|
|
this.form.id = this.$route.query.id
|
|
this.form.id = this.$route.query.id
|
|
this.getList()
|
|
this.getList()
|
|
@@ -153,8 +173,8 @@ export default {
|
|
},
|
|
},
|
|
|
|
|
|
// 流量套餐
|
|
// 流量套餐
|
|
- getGoodSList() {
|
|
|
|
- goodsList().then(res => {
|
|
|
|
|
|
+ getGoodSList(e) {
|
|
|
|
+ goodsList(e).then(res => {
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
this.goodsOptions = res.data
|
|
this.goodsOptions = res.data
|
|
}
|
|
}
|
|
@@ -175,7 +195,6 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
|
|
-
|
|
|
|
// 提交
|
|
// 提交
|
|
getSubmit() {
|
|
getSubmit() {
|
|
this.$refs.form.validate((valid) => {
|
|
this.$refs.form.validate((valid) => {
|