许成详 6 gadus atpakaļ
vecāks
revīzija
f21a7512e4

+ 2
- 2
config/index.js Parādīt failu

@@ -12,9 +12,9 @@ module.exports = {
12 12
     proxyTable: {
13 13
       '/api': {
14 14
         // target: 'https://dp.huiju360.com.cn/hj_operations',
15
-        // target: 'http://192.168.0.62:8080', //wf
15
+        target: 'http://192.168.0.62:8080', //wf
16 16
         // target: 'http://192.168.0.11', //ys
17
-        target: 'http://192.168.0.125:8080', //hyq
17
+        // target: 'http://192.168.0.125:8080', //hyq
18 18
         // target: 'http://dev.ycjcjy.com/', //frp
19 19
         changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
20 20
         // pathRewrite: {

+ 1
- 1
src/pages/system/cardAndCouponManager/cardManager/edit.vue Parādīt failu

@@ -138,7 +138,7 @@
138 138
             </div>
139 139
           </div>
140 140
         </li>
141
-        <li class="flex-h">
141
+        <li class="flex-h" v-if="cardInfo.SendType !== 'case' && cardInfo.SendType !== 'system'">
142 142
           <span>视频:</span>
143 143
           <div class="flex-item">
144 144
             <div style="vertical-align: middle;">

+ 11
- 3
src/pages/system/cardAndCouponManager/couponManager/edit.vue Parādīt failu

@@ -202,7 +202,7 @@
202 202
             </div>
203 203
           </div>
204 204
         </li>
205
-        <li class="flex-h">
205
+        <li class="flex-h" v-if="couponInfo.SendType !== 'case' && couponInfo.SendType !== 'system'">
206 206
           <span>视频:</span>
207 207
           <div class="flex-item">
208 208
             <div style="vertical-align: middle;">
@@ -579,11 +579,15 @@ export default {
579 579
     },
580 580
     submit () { // 保存
581 581
       if (this.$route.query.id) {
582
+        if (this.couponInfo.ValidDays) {
583
+          this.couponInfo.StartDate = undefined
584
+          this.couponInfo.EndDate = undefined
585
+        }
582 586
         this.editCoupon({
583 587
           ...this.couponInfo,
584 588
           IsAll: this.couponInfo.IsAll - 0,
585 589
           TotalCount: this.couponInfo.TotalCount - 0,
586
-          ValidDays: this.couponInfo.ValidDays || 0
590
+          ValidDays: this.couponInfo.ValidDays - 0 || 0
587 591
         }).then((res) => {
588 592
           this.$alert('操作成功', '提示', {
589 593
             confirmButtonText: '确定',
@@ -593,11 +597,15 @@ export default {
593 597
           })
594 598
         })
595 599
       } else {
600
+        if (this.couponInfo.ValidDays) {
601
+          this.couponInfo.StartDate = undefined
602
+          this.couponInfo.EndDate = undefined
603
+        }
596 604
         this.addCoupon({
597 605
           ...this.couponInfo,
598 606
           IsAll: this.couponInfo.IsAll - 0,
599 607
           TotalCount: this.couponInfo.TotalCount - 0,
600
-          ValidDays: this.couponInfo.ValidDays || 0
608
+          ValidDays: this.couponInfo.ValidDays - 0 || 0
601 609
         }).then((res) => {
602 610
           this.$alert('操作成功', '提示', {
603 611
             confirmButtonText: '确定',

+ 4
- 3
src/pages/system/cardAndCouponManager/couponManager/index.vue Parādīt failu

@@ -49,9 +49,10 @@
49 49
           label="有效期"
50 50
           width="150">
51 51
           <template slot-scope="scope">
52
-            <span style="width:100%;display:block;text-align:center;white-space: nowrap;">{{toolClass.dateFormat(scope.row.StartDate)}}</span>
53
-            <span style="width:100%;display:block;text-align:center;white-space: nowrap;">至</span>
54
-            <span style="width:100%;display:block;text-align:center;white-space: nowrap;">{{toolClass.dateFormat(scope.row.EndDate)}}</span>
52
+            <span v-if="scope.row.StartDate.substr(0, 4) !== '0001'" style="width:100%;display:block;text-align:center;white-space: nowrap;">{{toolClass.dateFormat(scope.row.StartDate)}}</span>
53
+            <span v-if="scope.row.StartDate.substr(0, 4) !== '0001'" style="width:100%;display:block;text-align:center;white-space: nowrap;">至</span>
54
+            <span v-if="scope.row.StartDate.substr(0, 4) !== '0001'" style="width:100%;display:block;text-align:center;white-space: nowrap;">{{toolClass.dateFormat(scope.row.EndDate)}}</span>
55
+            <span v-else>-</span>
55 56
           </template>
56 57
         </el-table-column>
57 58
         <el-table-column

+ 3
- 3
src/pages/system/cmsManager/bannerManager/add.vue Parādīt failu

@@ -164,14 +164,14 @@ export default {
164 164
   },
165 165
   created () {
166 166
     this.GetCourseList({ page: 1, pagesize: 100 })
167
-    this.updateLocationInfo()
167
+    this.updateLocationAllInfo()
168 168
     this.updateSystemInfo().then(() => {
169 169
       this.postData.CaseId = this.defaultCaseId
170 170
     })
171 171
   },
172 172
   computed: {
173 173
     ...mapState({
174
-      positionList: x => x.cms.location,
174
+      positionList: x => x.cms.locationAll,
175 175
       OrgId: x => x.app.user.OrgId,
176 176
       defaultCaseId: x => x.app.cases.default,
177 177
       caseList: x => x.app.cases.list
@@ -184,7 +184,7 @@ export default {
184 184
     ...mapCourseActions([
185 185
       'GetCourseList',
186 186
     ]),
187
-    ...mapCmsActions(['updateLocationInfo']),
187
+    ...mapCmsActions(['updateLocationAllInfo']),
188 188
     ...mapActions(['updateSystemInfo']),
189 189
     submit () {
190 190
       if (this.postData.ForwardType === '1') {

+ 14
- 67
src/pages/system/cmsManager/majorProjects/edit.vue Parādīt failu

@@ -6,7 +6,7 @@
6 6
           <span>对应案场:</span>
7 7
           <div class="flex-item">
8 8
             <div style="width:50%">
9
-              <el-select v-model="CaseId" placeholder="请选择" :disabled="Boolean(this.id)">
9
+              <el-select v-model="CaseId" placeholder="请选择" @change="caseChange">
10 10
                 <el-option
11 11
                   v-for="item in caseList"
12 12
                   :key="item.CaseId"
@@ -220,7 +220,7 @@ export default {
220 220
   name: '',
221 221
   data () {
222 222
     return {
223
-      id: this.$route.query.id ? this.$route.query.id : '',
223
+      id: '',
224 224
       limit: 1,
225 225
       // imgs: null,
226 226
       // detailimgs: null,
@@ -248,7 +248,7 @@ export default {
248 248
         return this.detail.CaseId || this.caseid
249 249
       },
250 250
       set (val) {
251
-        this.UpdateInfo({...this.detail, CaseId: val})
251
+        this.UpdateInfo({ ...this.detail, CaseId: val })
252 252
         this.getCourse()
253 253
       }
254 254
     },
@@ -258,40 +258,6 @@ export default {
258 258
     detailImgShow () {
259 259
       return this.detailimg || ((this.detail.CmsCaseImgs || []).filter(x => x.ImageType === 'detail')[0] || {}).CaseImageUrl
260 260
     },
261
-    // imgsArr: {
262
-    //   get () {
263
-    //     return this.imgs || (this.detail.CmsCaseImgs || []).filter(x => x.ImageType === 'cover').map(x => {
264
-    //       return {
265
-    //         url: x.CaseImageUrl,
266
-    //         response: {
267
-    //           result: {
268
-    //             url: x.CaseImageUrl
269
-    //           }
270
-    //         }
271
-    //       }
272
-    //     })
273
-    //   },
274
-    //   set (val) {
275
-    //     this.imgs = val
276
-    //   }
277
-    // },
278
-    // detailimgsArr: {
279
-    //   get () {
280
-    //     return this.detailimgs || (this.detail.CmsCaseImgs || []).filter(x => x.ImageType === 'detail').map(x => {
281
-    //       return {
282
-    //         url: x.CaseImageUrl,
283
-    //         response: {
284
-    //           result: {
285
-    //             url: x.CaseImageUrl
286
-    //           }
287
-    //         }
288
-    //       }
289
-    //     })
290
-    //   },
291
-    //   set (val) {
292
-    //     this.detailimgs = val
293
-    //   }
294
-    // },
295 261
     coursesList () {
296 262
       return (this.courses.list || []).map(x => {
297 263
         return {
@@ -313,18 +279,19 @@ export default {
313 279
     ...mapCourseActions([
314 280
       'GetCourseList',
315 281
     ]),
282
+    caseChange () {
283
+      this.selCourseList = []
284
+      this.detail.Courses = []
285
+    },
316 286
     submit () {
317
-      // const imgs = this.imgsArr.map(x => x.response.result.url).join(',')
318
-      // const detailimgs = this.detailimgsArr.map(x => x.response.result.url).join(',')
319
-
320 287
       const courseids = (this.detail.Courses || []).map(x => x.CourseId).join(',')
321 288
       if (this.id === '') {
322 289
         this.detail.OrgId = this.OrgId
323
-        this.AddCaseInfo({...this.detail, OrgId: this.OrgId, imgs: this.img, detailimgs: this.detailimg, courseids}).then(res => {
290
+        this.AddCaseInfo({ ...this.detail, OrgId: this.OrgId, imgs: this.img, detailimgs: this.detailimg, courseids }).then(res => {
324 291
           this.afterSave()
325 292
         })
326 293
       } else {
327
-        this.AddCaseInfo({...this.detail, imgs: this.img, detailimgs: this.detailimg, courseids}).then(res => {
294
+        this.AddCaseInfo({ ...this.detail, imgs: this.img, detailimgs: this.detailimg, courseids }).then(res => {
328 295
           this.afterSave()
329 296
         })
330 297
       }
@@ -342,23 +309,11 @@ export default {
342 309
     cancel () {
343 310
       this.$router.go(-1)
344 311
     },
345
-    // handlePictureCardPreview (res, file, fileList) {
346
-    //   this.imgsArr = fileList
347
-    // },
348
-    // handleRemove (file, fileList) {
349
-    //   this.imgsArr = fileList
350
-    // },
351
-    // handlePictureCardPreviewDetail (res, file, fileList) {
352
-    //   this.detailimgsArr = fileList
353
-    // },
354
-    // handleRemoveDetail (file, fileList) {
355
-    //   this.detailimgsArr = fileList
356
-    // },
357 312
     getDetail () {
358
-      this.GetCaseInfo({id: this.id})
313
+      this.GetCaseInfo({ id: this.id })
359 314
     },
360 315
     getCourse () {
361
-      this.GetCourseList({caseid: this.CaseId, page: 1, pagesize: 100})
316
+      this.GetCourseList({ caseid: this.CaseId, page: 1, pagesize: 100 })
362 317
     },
363 318
     toggleSelection (rows) {
364 319
       if (rows) {
@@ -369,15 +324,8 @@ export default {
369 324
         this.$refs.courseTable.clearSelection()
370 325
       }
371 326
     },
372
-    // exceed () {
373
-    //   this.$message({
374
-    //     message: '超过可传的图片上限',
375
-    //     type: 'info',
376
-    //     duration: 1000
377
-    //   })
378
-    // },
379 327
     addCourse () {
380
-      this.GetCourseList({caseid: this.CaseId, page: 1, pagesize: 100, callback: this.coursesShow})
328
+      this.GetCourseList({ caseid: this.CaseId, page: 1, pagesize: 100, callback: this.coursesShow })
381 329
     },
382 330
     coursesShow () {
383 331
       this.selCourseList = this.detail.Courses || []
@@ -388,14 +336,13 @@ export default {
388 336
     },
389 337
     handleSelectionChange (val) {
390 338
       this.selCourseList = val
391
-      // this.UpdateInfo({...this.detail, Courses: val})
392 339
     },
393 340
     addCourseOk () {
394
-      this.UpdateInfo({...this.detail, Courses: this.selCourseList})
341
+      this.UpdateInfo({ ...this.detail, Courses: this.selCourseList })
395 342
       this.selCourseVisible = false
396 343
     },
397 344
     deleteItem (row) {
398
-      this.UpdateInfo({...this.detail, Courses: this.detail.Courses.filter(x => x.CourseId !== row.CourseId)})
345
+      this.UpdateInfo({ ...this.detail, Courses: this.detail.Courses.filter(x => x.CourseId !== row.CourseId) })
399 346
     },
400 347
     handleImgSuccess (res, file) {
401 348
       this.img = res.result.url

+ 31
- 10
src/pages/system/cmsManager/newsManager/add.vue Parādīt failu

@@ -6,12 +6,12 @@
6 6
           <span>跳转类型:</span>
7 7
           <div class="flex-item">
8 8
             <div style="width:50%" class="radio">
9
-                <el-radio v-model="postData.ForwardType" label='1' >链接</el-radio>
10
-                <el-radio v-model="postData.ForwardType" label='0' >课程</el-radio>
9
+                <el-radio v-model="postData.ForwardType" label='url' >链接</el-radio>
10
+                <el-radio v-model="postData.ForwardType" label='course' >课程</el-radio>
11 11
             </div>
12 12
           </div>
13 13
         </li>
14
-        <li class="flex-h">
14
+        <li class="flex-h" v-if="postData.ForwardType==='url'">
15 15
           <span>链接:</span>
16 16
           <div class="flex-item">
17 17
             <div style="width:50%">
@@ -23,6 +23,21 @@
23 23
             </div>
24 24
           </div>
25 25
         </li>
26
+        <li class="flex-h" v-else>
27
+          <span>课程:</span>
28
+          <div class="flex-item">
29
+            <div style="width:50%">
30
+              <el-select v-model="postData.ForwardResourceId" placeholder="请选择课程">
31
+                <el-option
32
+                  v-for="item in courses.list"
33
+                  :key="item.CourseId"
34
+                  :label="item.CourseName"
35
+                  :value="item.CourseId">
36
+                </el-option>
37
+              </el-select>
38
+            </div>
39
+          </div>
40
+        </li>
26 41
         <li class="flex-h">
27 42
           <span>是否发布:</span>
28 43
           <div class="flex-item">
@@ -100,12 +115,14 @@
100 115
 <script>
101 116
 import { mapState, mapActions, createNamespacedHelpers } from 'vuex'
102 117
 const { mapActions: mapCmsActions } = createNamespacedHelpers('cms')
118
+const { mapState: mapCourseState, mapActions: mapCourseActions } = createNamespacedHelpers('course')
119
+
103 120
 export default {
104 121
   name: '',
105 122
   data () {
106 123
     return {
107 124
       postData: {
108
-        ForwardType: '1',
125
+        ForwardType: 'url',
109 126
         ForwardUrl: '',
110 127
         ForwardResourceId: '',
111 128
         Status: '1',
@@ -127,22 +144,26 @@ export default {
127 144
       this.postData.OrgId = this.OrgId
128 145
       this.postData.CaseId = this.CaseId
129 146
     })
130
-    this.getCourseLink().then((res) => {
131
-      console.log(JSON.stringify(res))
132
-    })
147
+    this.updateLocationAllInfo()
148
+    this.GetCourseList({ page: 1, pagesize: 10000 })
133 149
   },
134 150
   computed: {
135 151
     ...mapState({
136
-      positionList: x => x.cms.location,
152
+      positionList: x => x.cms.locationAll,
137 153
       OrgId: x => x.app.user.OrgId,
138 154
       CaseId: x => x.app.cases.default,
155
+    }),
156
+    ...mapCourseState({
157
+      courses: x => x.courseList,
139 158
     })
140 159
   },
141 160
   methods: {
161
+    ...mapCourseActions([
162
+      'GetCourseList',
163
+    ]),
142 164
     ...mapActions(['updateSystemInfo']),
143 165
     ...mapCmsActions([
144
-      'updateLocationInfo',
145
-      'getCourseLink',
166
+      'updateLocationAllInfo',
146 167
     ]),
147 168
     submit () {
148 169
       if (this.postData.ForwardType === '1') {

+ 16
- 2
src/store/cms/index.js Parādīt failu

@@ -4,12 +4,16 @@ import api from '../../util/api'
4 4
 export default {
5 5
   namespaced: true,
6 6
   state: {
7
-    location: []
7
+    location: [],
8
+    locationAll: []
8 9
   },
9 10
   mutations: {
10 11
     init (state, data) { // 这里的state对应着上面这个state
11 12
       state.location = data
12
-    }
13
+    },
14
+    initAll (state, data) { // 这里的state对应着上面这个state
15
+      state.locationAll = data
16
+    },
13 17
   },
14 18
   actions: {
15 19
     updateLocationInfo ({ commit }, payload) {
@@ -25,6 +29,16 @@ export default {
25 29
         }).catch(reject)
26 30
       })
27 31
     },
32
+    updateLocationAllInfo ({ commit }) {
33
+      return new Promise((resolve, reject) => {
34
+        ajax(api.cms.location.url, {
35
+          method: api.cms.location.method,
36
+        }).then(res => {
37
+          commit('initAll', res)
38
+          resolve(res)
39
+        }).catch(reject)
40
+      })
41
+    },
28 42
     getCourseLink ({ commit }) {
29 43
       return new Promise((resolve, reject) => {
30 44
         ajax(api.cms.getCourseLink.url, {