许成详 6 years ago
parent
commit
ea757e2790

+ 55
- 47
src/pages/system/marketingActivities/activitiesList/index.vue View File

@@ -1,34 +1,36 @@
1 1
 <template>
2 2
   <div class="subPage">
3
-    <div class="title">
4
-      活动列表
3
+    <div class="system-table-search">
4
+      <div class="flex-h">
5
+        <div class="flex-item flex-h">
6
+          <el-button size="mini" type="success" @click="redirection('addActivities')">新增活动</el-button>
7
+        </div>
8
+        <!-- <ul>
9
+          <li>
10
+            <el-select v-model="CaseId" placeholder="请选择">
11
+              <el-option
12
+                key=""
13
+                label="所有案场"
14
+                value="">
15
+              </el-option>
16
+              <el-option
17
+                v-for="item in cases"
18
+                :key="item.CaseId"
19
+                :label="item.CaseName"
20
+                :value="item.CaseId">
21
+              </el-option>
22
+            </el-select>
23
+          </li>
24
+        </ul> -->
25
+        <el-button
26
+          size="mini"
27
+          type="primary" @click="clickList">搜索</el-button>
28
+      </div>
29
+      <div class="moreFilter"></div>
5 30
     </div>
6
-    <div class="head-div">
7
-      每页数量/条
8
-      <template>
9
-        <el-select v-model="postData.pageSize" placeholder="请选择">
10
-          <el-option
11
-            v-for="item in options"
12
-            :key="item.value"
13
-            :label="item.label"
14
-            :value="item.value">
15
-          </el-option>
16
-        </el-select>
17
-      </template>
18
-    </div>
19
-    <!-- 包含 按钮的div -->
20
-    <div class="button-div">
21
-      <el-row>
22
-        <el-button type="warning" style="float: right;">重置</el-button>
23
-        <el-button type="primary" style="float: right; margin-right: 10px;" @click="clickList">查询</el-button>
24
-        <el-button type="success" style="float: right;" @click="redirection('addActivities')">新增</el-button>
25
-      </el-row>
26
-    </div>
27
-    <div class="content">
28
-      <template>
29
-        <el-table
31
+    <div class="system-table-box">
32
+      <el-table
30 33
           :data="tableData"
31
-          border
32 34
           style="width: 100%">
33 35
           <el-table-column
34 36
             prop="CaseName"
@@ -37,8 +39,7 @@
37 39
           </el-table-column>
38 40
           <el-table-column
39 41
             prop="ActivityName"
40
-            label="活动名称"
41
-            width="180">
42
+            label="活动名称">
42 43
           </el-table-column>
43 44
           <el-table-column
44 45
             prop="ActivityType"
@@ -70,29 +71,36 @@
70 71
           </el-table-column>
71 72
           <el-table-column
72 73
             prop="address"
73
-            label="操作">
74
+            label="操作"
75
+            width="200">
74 76
             <template slot-scope="scope">
75
-              <div v-if="scope.row.Status === 0">
76
-                <a href="#" @click="disable(scope.row.ActivityId)">停用</a>&nbsp;&nbsp;<a href="#" @click="delet(scope.row.ActivityId)">删除</a>
77
-              </div>
78
-              <div v-else>
79
-                <a href="#" @click="normal(scope.row.ActivityId)">启用</a>
80
-              </div>
77
+              <el-button
78
+                v-if="scope.row.Status === 0"
79
+                size="mini"
80
+                type="danger"
81
+                @click="delet(scope.row.ActivityId)">删除</el-button>
82
+              <el-button
83
+                v-if="scope.row.Status === 0"
84
+                size="mini"
85
+                type="warning"
86
+                @click="disable(scope.row.ActivityId)">停用</el-button>
87
+              <el-button
88
+                v-else
89
+                size="mini"
90
+                type="success"
91
+                @click="normal(scope.row.ActivityId)">启用</el-button>
81 92
             </template>
82 93
           </el-table-column>
83 94
         </el-table>
84
-      </template>
85
-    </div>
86
-    <div class="block">
87
-      <el-pagination
88
-        @size-change="handleSizeChange"
89
-        @current-change="handleCurrentChange"
90
-        :current-page.sync="currentPage2"
91
-        :page-size="Number(value)"
92
-        layout="prev, pager, next, jumper"
93
-        :total="total">
94
-      </el-pagination>
95 95
     </div>
96
+    <el-pagination
97
+      @size-change="handleSizeChange"
98
+      @current-change="handleCurrentChange"
99
+      :current-page.sync="currentPage2"
100
+      :page-size="Number(value)"
101
+      layout="prev, pager, next, jumper"
102
+      :total="total">
103
+    </el-pagination>
96 104
   </div>
97 105
 </template>
98 106
 <script>

+ 67
- 97
src/pages/system/marketingActivities/addActivities/index.vue View File

@@ -1,82 +1,72 @@
1 1
 <template>
2 2
   <div class="subPage">
3
-    <div class="content">
4
-      <div class="input-div">
5
-        <div style="float: left; font-size: 20px;">
6
-          活动名称:
7
-        </div>
8
-        <div style="float: left; margin-left: 30px;">
9
-          <template>
10
-            <el-input v-model="activityName" placeholder="请输入内容" style="width: 300px;"></el-input>
11
-          </template>
12
-        </div>
13
-      </div>
14
-      <div class="input-div">
15
-        <div style="float: left; font-size: 20px;">
16
-          活动类型:
17
-        </div>
18
-        <div style="float: left; margin-left: 30px;">
19
-          <template>
20
-            <el-select v-model="regValue" placeholder="请选择" style="width: 300px;">
21
-              <el-option
22
-                v-for="item in regOptions"
23
-                :key="item.regValue"
24
-                :label="item.label"
25
-                :value="item.regValue">
26
-              </el-option>
27
-            </el-select>
28
-          </template>
29
-        </div>
30
-      </div>
31
-      <div class="input-div">
32
-        <div style="float: left; font-size: 20px;">
33
-          赠券卡券:
34
-        </div>
35
-        <div style="float: left; margin-left: 30px;">
36
-          <template>
37
-            <el-select v-model="giftValue" placeholder="请选择" style="width: 300px;">
38
-              <el-option
39
-                v-for="item in giftOptions"
40
-                :key="item.giftValue"
41
-                :label="item.label"
42
-                :value="item.giftValue">
43
-              </el-option>
44
-            </el-select>
45
-          </template>
46
-        </div>
47
-      </div>
48
-      <div class="input-div">
49
-        <div style="float: left; font-size: 20px;">
50
-           赠券数量:
51
-        </div>
52
-        <div style="float: left; margin-left: 30px;">
53
-          <template>
54
-            <el-input v-model="giftNum" placeholder="请输入内容" style="width: 300px;"></el-input>
55
-          </template>
56
-        </div>
57
-      </div>
58
-      <div class="input-div">
59
-        <div style="float: left; font-size: 20px;">
60
-          活动描述:
61
-        </div>
62
-        <div style="float: left; margin-left: 30px;">
63
-          <template>
64
-            <el-input
65
-              type="textarea"
66
-              :rows="10"
67
-              placeholder="请输入内容"
68
-              v-model="desc" style="width: 300px; height: 200px;">
69
-            </el-input>
70
-          </template>
71
-        </div>
72
-      </div>
73
-      <div class="input-div">
74
-        <el-row>
75
-          <el-button type="warning" style="float: right;" @click="redirection('activitiesList')">返回</el-button>
76
-          <el-button type="primary" style="float: right; margin-right: 10px;" @click="submitData">提交</el-button>
77
-        </el-row>
78
-      </div>
79
-    </div>
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-input v-model="activityName" placeholder="请输入内容"></el-input>
10
+            </div>
11
+          </div>
12
+        </li>
13
+        <li class="flex-h">
14
+          <span>活动类型:</span>
15
+          <div class="flex-item">
16
+            <div>
17
+              <el-select v-model="regValue" placeholder="请选择">
18
+                <el-option
19
+                  v-for="item in regOptions"
20
+                  :key="item.regValue"
21
+                  :label="item.label"
22
+                  :value="item.regValue">
23
+                </el-option>
24
+              </el-select>
25
+            </div>
26
+          </div>
27
+        </li>
28
+        <li class="flex-h">
29
+          <span>赠券卡券:</span>
30
+          <div class="flex-item">
31
+            <div>
32
+              <el-select v-model="giftValue" placeholder="请选择">
33
+                <el-option
34
+                  v-for="item in giftOptions"
35
+                  :key="item.giftValue"
36
+                  :label="item.label"
37
+                  :value="item.giftValue">
38
+                </el-option>
39
+              </el-select>
40
+            </div>
41
+          </div>
42
+        </li>
43
+        <li class="flex-h">
44
+          <span>赠券数量:</span>
45
+          <div class="flex-item">
46
+            <div style="width:50%">
47
+              <el-input v-model="giftNum" placeholder="请输入内容"></el-input>
48
+            </div>
49
+          </div>
50
+        </li>
51
+        <li class="flex-h">
52
+          <span>活动描述:</span>
53
+          <div class="flex-item">
54
+            <div>
55
+              <el-input
56
+                type="textarea"
57
+                :rows="10"
58
+                placeholder="请输入内容"
59
+                v-model="desc">
60
+              </el-input>
61
+            </div>
62
+          </div>
63
+        </li>
64
+        <li style="text-align:center">
65
+          <el-button type="warning" size="mini" @click="redirection('activitiesList')">返回</el-button>
66
+          <el-button type="primary" size="mini" @click="submitData">提交</el-button>
67
+        </li>
68
+      </ul>
69
+    </form>
80 70
   </div>
81 71
 </template>
82 72
 <script>
@@ -120,16 +110,13 @@ export default {
120 110
     giftData: {
121 111
       get () {
122 112
         let jsonData = this.$data.giftList
123
-        console.log('请求到的:' + this.$data.giftList)
124 113
         let data = []
125 114
         for (let i = 0; i < jsonData.length; i++) {
126 115
           let tempData = []
127 116
           tempData.giftValue = jsonData[i].CouponId
128 117
           tempData.label = jsonData[i].CouponName
129
-          console.log('卡券编号:' + tempData.giftValue + ' ' + tempData.label)
130 118
           data.push(tempData)
131 119
         }
132
-        console.log('giftData 数据:')
133 120
         return data
134 121
       }
135 122
     }
@@ -141,22 +128,6 @@ export default {
141 128
     submitData () { // 提交数据
142 129
       // 判断是否提交成功
143 130
       // 提交成功,跳转页面
144
-      // let subData = []
145
-      // subData.activityName = this.$data.activityName
146
-      // subData.activityType = this.$data.regValue
147
-      // let obj = []
148
-      // obj.giftValue = this.$data.giftValue
149
-      // obj.giftNum = this.$data.giftNum
150
-      // obj.desc = this.$data.desc
151
-      // subData.resourceDesc = obj
152
-
153
-      // console.log(subData)
154
-
155
-      // let obj = []
156
-      // obj.giftValue = this.$data.giftValue
157
-      // obj.giftNum = this.$data.giftNum
158
-      // obj.desc = this.$data.desc
159
-
160 131
       let tempGiftOptions = this.$data.giftOptions
161 132
       let tempGiftValue = this.$data.giftValue
162 133
       for (let i = 0; i < tempGiftOptions.length; i++) {
@@ -166,7 +137,6 @@ export default {
166 137
         }
167 138
       }
168 139
       let jsonString = '{"giftValue":"' + this.$data.giftValue + '","giftLabel":"' + this.$data.giftLabel + '","giftNum":"' + this.$data.giftNum + '","desc":"' + this.$data.desc + '"}'
169
-
170 140
       this.$ajax(this.$api.marketingActivities.addMarketing.url, {
171 141
         method: this.$api.marketingActivities.addMarketing.method,
172 142
         queryData: {activityName: this.$data.activityName, activityType: this.$data.regValue, resourceDesc: jsonString, CaseId: this.defaultCaseId}