|
@@ -1,114 +0,0 @@
|
1
|
|
-<template>
|
2
|
|
- <div class="subPage">
|
3
|
|
- <form class="mainForm">
|
4
|
|
- <ul>
|
5
|
|
- <li class="flex-h">
|
6
|
|
- <!-- <span>选择案场:</span> -->
|
7
|
|
- <div class="flex-item">
|
8
|
|
- <div style="width:50%">
|
9
|
|
- <el-select v-model="CaseId" placeholder="请选择">
|
10
|
|
- <el-option
|
11
|
|
- v-for="item in cases"
|
12
|
|
- :key="item.CaseId"
|
13
|
|
- :label="item.CaseName"
|
14
|
|
- :value="item.CaseId">
|
15
|
|
- </el-option>
|
16
|
|
- </el-select>
|
17
|
|
- </div>
|
18
|
|
- </div>
|
19
|
|
- </li>
|
20
|
|
- <li class="flex-h">
|
21
|
|
- <span>渠道名:</span>
|
22
|
|
- <div class="flex-item">
|
23
|
|
- <div style="width:50%">
|
24
|
|
- <el-input
|
25
|
|
- placeholder="请输入渠道名"
|
26
|
|
- v-model="postData.ChannelName"
|
27
|
|
- clearable>
|
28
|
|
- </el-input>
|
29
|
|
- </div>
|
30
|
|
- </div>
|
31
|
|
- </li>
|
32
|
|
- <li style="text-align:center">
|
33
|
|
- <el-button type="primary" size="mini" @click="submit">保存</el-button>
|
34
|
|
- <el-button type="danger" size="mini" @click="cancel">取消</el-button>
|
35
|
|
- </li>
|
36
|
|
- </ul>
|
37
|
|
- </form>
|
38
|
|
- </div>
|
39
|
|
-</template>
|
40
|
|
-
|
41
|
|
-<script>
|
42
|
|
-import { mapState } from 'vuex'
|
43
|
|
-export default {
|
44
|
|
- name: '',
|
45
|
|
- data () {
|
46
|
|
- return {
|
47
|
|
- postData: {
|
48
|
|
- ChannelId: '', // 渠道id
|
49
|
|
- ChannelName: '', // 渠道名称
|
50
|
|
- CaseId: '', // 案场id
|
51
|
|
- OrgId: '', // 机构id
|
52
|
|
- }
|
53
|
|
- }
|
54
|
|
- },
|
55
|
|
- computed: {
|
56
|
|
- ...mapState({
|
57
|
|
- cases: x => x.app.cases.list,
|
58
|
|
- defaultCaseId: x => x.app.cases.default,
|
59
|
|
- OrgId: x => x.app.user.OrgId,
|
60
|
|
- }),
|
61
|
|
- CaseId: {
|
62
|
|
- get () {
|
63
|
|
- return this.postData.CaseId === '' ? this.defaultCaseId || '' : this.postData.CaseId
|
64
|
|
- },
|
65
|
|
- set (val) {
|
66
|
|
- this.postData.CaseId = val
|
67
|
|
- }
|
68
|
|
- }
|
69
|
|
- },
|
70
|
|
- created () {
|
71
|
|
- this.getChannelInfo()
|
72
|
|
- },
|
73
|
|
- components: {},
|
74
|
|
- methods: {
|
75
|
|
- getChannelInfo () {
|
76
|
|
- this.$ajax(this.$api.channelManager.getChannelInfo.url, {
|
77
|
|
- method: this.$api.channelManager.getChannelInfo.method,
|
78
|
|
- urlData: { channelId: this.$route.query.id }
|
79
|
|
- }).then(res => {
|
80
|
|
- this.postData = res
|
81
|
|
- })
|
82
|
|
- },
|
83
|
|
- submit () { // 提交数据
|
84
|
|
- if (this.postData.ChannelName === '') {
|
85
|
|
- this.$message({
|
86
|
|
- type: 'error',
|
87
|
|
- message: '渠道名称不能为空'
|
88
|
|
- })
|
89
|
|
- return false
|
90
|
|
- }
|
91
|
|
- this.postData.OrgId = this.OrgId
|
92
|
|
- if (this.postData.CaseId === '') this.postData.CaseId = this.CaseId
|
93
|
|
- this.$ajax(this.$api.channelManager.editChannel.url, {
|
94
|
|
- method: this.$api.channelManager.editChannel.method,
|
95
|
|
- data: this.postData
|
96
|
|
- }).then(res => {
|
97
|
|
- this.$message({
|
98
|
|
- type: 'success',
|
99
|
|
- message: '操作成功'
|
100
|
|
- })
|
101
|
|
- this.$router.push({ name: 'channelList' })
|
102
|
|
- })
|
103
|
|
- },
|
104
|
|
- cancel () {
|
105
|
|
- this.$router.push({ name: 'channelList' })
|
106
|
|
- }
|
107
|
|
- },
|
108
|
|
- mounted () { }
|
109
|
|
-}
|
110
|
|
-</script>
|
111
|
|
-
|
112
|
|
-<!-- Add "scoped" attribute to limit CSS to this component only -->
|
113
|
|
-<style lang="scss" scoped>
|
114
|
|
-</style>
|