许成详 6 年前
父节点
当前提交
f21a7512e4

+ 2
- 2
config/index.js 查看文件

12
     proxyTable: {
12
     proxyTable: {
13
       '/api': {
13
       '/api': {
14
         // target: 'https://dp.huiju360.com.cn/hj_operations',
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
         // target: 'http://192.168.0.11', //ys
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
         // target: 'http://dev.ycjcjy.com/', //frp
18
         // target: 'http://dev.ycjcjy.com/', //frp
19
         changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
19
         changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
20
         // pathRewrite: {
20
         // pathRewrite: {

+ 1
- 1
src/pages/system/cardAndCouponManager/cardManager/edit.vue 查看文件

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

+ 11
- 3
src/pages/system/cardAndCouponManager/couponManager/edit.vue 查看文件

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

+ 4
- 3
src/pages/system/cardAndCouponManager/couponManager/index.vue 查看文件

49
           label="有效期"
49
           label="有效期"
50
           width="150">
50
           width="150">
51
           <template slot-scope="scope">
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
           </template>
56
           </template>
56
         </el-table-column>
57
         </el-table-column>
57
         <el-table-column
58
         <el-table-column

+ 3
- 3
src/pages/system/cmsManager/bannerManager/add.vue 查看文件

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

+ 14
- 67
src/pages/system/cmsManager/majorProjects/edit.vue 查看文件

6
           <span>对应案场:</span>
6
           <span>对应案场:</span>
7
           <div class="flex-item">
7
           <div class="flex-item">
8
             <div style="width:50%">
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
                 <el-option
10
                 <el-option
11
                   v-for="item in caseList"
11
                   v-for="item in caseList"
12
                   :key="item.CaseId"
12
                   :key="item.CaseId"
220
   name: '',
220
   name: '',
221
   data () {
221
   data () {
222
     return {
222
     return {
223
-      id: this.$route.query.id ? this.$route.query.id : '',
223
+      id: '',
224
       limit: 1,
224
       limit: 1,
225
       // imgs: null,
225
       // imgs: null,
226
       // detailimgs: null,
226
       // detailimgs: null,
248
         return this.detail.CaseId || this.caseid
248
         return this.detail.CaseId || this.caseid
249
       },
249
       },
250
       set (val) {
250
       set (val) {
251
-        this.UpdateInfo({...this.detail, CaseId: val})
251
+        this.UpdateInfo({ ...this.detail, CaseId: val })
252
         this.getCourse()
252
         this.getCourse()
253
       }
253
       }
254
     },
254
     },
258
     detailImgShow () {
258
     detailImgShow () {
259
       return this.detailimg || ((this.detail.CmsCaseImgs || []).filter(x => x.ImageType === 'detail')[0] || {}).CaseImageUrl
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
     coursesList () {
261
     coursesList () {
296
       return (this.courses.list || []).map(x => {
262
       return (this.courses.list || []).map(x => {
297
         return {
263
         return {
313
     ...mapCourseActions([
279
     ...mapCourseActions([
314
       'GetCourseList',
280
       'GetCourseList',
315
     ]),
281
     ]),
282
+    caseChange () {
283
+      this.selCourseList = []
284
+      this.detail.Courses = []
285
+    },
316
     submit () {
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
       const courseids = (this.detail.Courses || []).map(x => x.CourseId).join(',')
287
       const courseids = (this.detail.Courses || []).map(x => x.CourseId).join(',')
321
       if (this.id === '') {
288
       if (this.id === '') {
322
         this.detail.OrgId = this.OrgId
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
           this.afterSave()
291
           this.afterSave()
325
         })
292
         })
326
       } else {
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
           this.afterSave()
295
           this.afterSave()
329
         })
296
         })
330
       }
297
       }
342
     cancel () {
309
     cancel () {
343
       this.$router.go(-1)
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
     getDetail () {
312
     getDetail () {
358
-      this.GetCaseInfo({id: this.id})
313
+      this.GetCaseInfo({ id: this.id })
359
     },
314
     },
360
     getCourse () {
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
     toggleSelection (rows) {
318
     toggleSelection (rows) {
364
       if (rows) {
319
       if (rows) {
369
         this.$refs.courseTable.clearSelection()
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
     addCourse () {
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
     coursesShow () {
330
     coursesShow () {
383
       this.selCourseList = this.detail.Courses || []
331
       this.selCourseList = this.detail.Courses || []
388
     },
336
     },
389
     handleSelectionChange (val) {
337
     handleSelectionChange (val) {
390
       this.selCourseList = val
338
       this.selCourseList = val
391
-      // this.UpdateInfo({...this.detail, Courses: val})
392
     },
339
     },
393
     addCourseOk () {
340
     addCourseOk () {
394
-      this.UpdateInfo({...this.detail, Courses: this.selCourseList})
341
+      this.UpdateInfo({ ...this.detail, Courses: this.selCourseList })
395
       this.selCourseVisible = false
342
       this.selCourseVisible = false
396
     },
343
     },
397
     deleteItem (row) {
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
     handleImgSuccess (res, file) {
347
     handleImgSuccess (res, file) {
401
       this.img = res.result.url
348
       this.img = res.result.url

+ 31
- 10
src/pages/system/cmsManager/newsManager/add.vue 查看文件

6
           <span>跳转类型:</span>
6
           <span>跳转类型:</span>
7
           <div class="flex-item">
7
           <div class="flex-item">
8
             <div style="width:50%" class="radio">
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
             </div>
11
             </div>
12
           </div>
12
           </div>
13
         </li>
13
         </li>
14
-        <li class="flex-h">
14
+        <li class="flex-h" v-if="postData.ForwardType==='url'">
15
           <span>链接:</span>
15
           <span>链接:</span>
16
           <div class="flex-item">
16
           <div class="flex-item">
17
             <div style="width:50%">
17
             <div style="width:50%">
23
             </div>
23
             </div>
24
           </div>
24
           </div>
25
         </li>
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
         <li class="flex-h">
41
         <li class="flex-h">
27
           <span>是否发布:</span>
42
           <span>是否发布:</span>
28
           <div class="flex-item">
43
           <div class="flex-item">
100
 <script>
115
 <script>
101
 import { mapState, mapActions, createNamespacedHelpers } from 'vuex'
116
 import { mapState, mapActions, createNamespacedHelpers } from 'vuex'
102
 const { mapActions: mapCmsActions } = createNamespacedHelpers('cms')
117
 const { mapActions: mapCmsActions } = createNamespacedHelpers('cms')
118
+const { mapState: mapCourseState, mapActions: mapCourseActions } = createNamespacedHelpers('course')
119
+
103
 export default {
120
 export default {
104
   name: '',
121
   name: '',
105
   data () {
122
   data () {
106
     return {
123
     return {
107
       postData: {
124
       postData: {
108
-        ForwardType: '1',
125
+        ForwardType: 'url',
109
         ForwardUrl: '',
126
         ForwardUrl: '',
110
         ForwardResourceId: '',
127
         ForwardResourceId: '',
111
         Status: '1',
128
         Status: '1',
127
       this.postData.OrgId = this.OrgId
144
       this.postData.OrgId = this.OrgId
128
       this.postData.CaseId = this.CaseId
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
   computed: {
150
   computed: {
135
     ...mapState({
151
     ...mapState({
136
-      positionList: x => x.cms.location,
152
+      positionList: x => x.cms.locationAll,
137
       OrgId: x => x.app.user.OrgId,
153
       OrgId: x => x.app.user.OrgId,
138
       CaseId: x => x.app.cases.default,
154
       CaseId: x => x.app.cases.default,
155
+    }),
156
+    ...mapCourseState({
157
+      courses: x => x.courseList,
139
     })
158
     })
140
   },
159
   },
141
   methods: {
160
   methods: {
161
+    ...mapCourseActions([
162
+      'GetCourseList',
163
+    ]),
142
     ...mapActions(['updateSystemInfo']),
164
     ...mapActions(['updateSystemInfo']),
143
     ...mapCmsActions([
165
     ...mapCmsActions([
144
-      'updateLocationInfo',
145
-      'getCourseLink',
166
+      'updateLocationAllInfo',
146
     ]),
167
     ]),
147
     submit () {
168
     submit () {
148
       if (this.postData.ForwardType === '1') {
169
       if (this.postData.ForwardType === '1') {

+ 16
- 2
src/store/cms/index.js 查看文件

4
 export default {
4
 export default {
5
   namespaced: true,
5
   namespaced: true,
6
   state: {
6
   state: {
7
-    location: []
7
+    location: [],
8
+    locationAll: []
8
   },
9
   },
9
   mutations: {
10
   mutations: {
10
     init (state, data) { // 这里的state对应着上面这个state
11
     init (state, data) { // 这里的state对应着上面这个state
11
       state.location = data
12
       state.location = data
12
-    }
13
+    },
14
+    initAll (state, data) { // 这里的state对应着上面这个state
15
+      state.locationAll = data
16
+    },
13
   },
17
   },
14
   actions: {
18
   actions: {
15
     updateLocationInfo ({ commit }, payload) {
19
     updateLocationInfo ({ commit }, payload) {
25
         }).catch(reject)
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
     getCourseLink ({ commit }) {
42
     getCourseLink ({ commit }) {
29
       return new Promise((resolve, reject) => {
43
       return new Promise((resolve, reject) => {
30
         ajax(api.cms.getCourseLink.url, {
44
         ajax(api.cms.getCourseLink.url, {