Browse Source

bug修改

wangfei 6 years ago
parent
commit
90cd7f3cee

+ 11
- 6
src/pages/system/caseManager/caseAreaManager/index.vue View File

@@ -57,8 +57,10 @@
57 57
           </template>
58 58
         </el-table-column>
59 59
         <el-table-column
60
-          prop="CaseName"
61
-          label="案场">
60
+          label="案场" >
61
+          <template slot-scope="scope">
62
+            <span>{{getCaseName(scope.row.CaseId)}}</span>
63
+          </template>
62 64
         </el-table-column>
63 65
         <el-table-column label="操作">
64 66
           <template slot-scope="scope">
@@ -117,7 +119,7 @@ export default {
117 119
       set (val) {
118 120
         this.postData.caseid = val
119 121
       }
120
-    }
122
+    },
121 123
   },
122 124
   methods: {
123 125
     search () { // 搜索
@@ -125,14 +127,17 @@ export default {
125 127
       this.currentList = []
126 128
       this.getList()
127 129
     },
130
+    getCaseName (caseid) {
131
+      return (this.cases.filter(x => x.CaseId === caseid)[0] || {}).CaseName
132
+    },
128 133
     getList () { // 获取列表
129 134
       this.$ajax(this.$api.caseManager.getCaseAreaList.url, {
130 135
         method: this.$api.caseManager.getCaseAreaList.method,
131 136
         queryData: { ...this.postData, caseid: this.CaseId }
132 137
       }).then(res => {
133
-        for (var n = 0; n < res.list.length; n++) {
134
-          res.list[n].CaseName = this.cases.filter(x => x.CaseId === res.list[n].CaseId)[0].CaseName
135
-        }
138
+        // for (var n = 0; n < res.list.length; n++) {
139
+        //   res.list[n].CaseName = this.cases.filter(x => x.CaseId === res.list[n].CaseId)[0].CaseName
140
+        // }
136 141
         this.currentList = res.list
137 142
         this.postData.page = res.page
138 143
         this.total = res.pagenum

+ 18
- 4
src/pages/system/caseManager/caseInfo/addCase/index.vue View File

@@ -16,7 +16,7 @@
16 16
           </div>
17 17
         </li>
18 18
         <li class="flex-h">
19
-          <span>案场地址:</span>
19
+          <span>案场地址:<em>*</em></span>
20 20
           <div class="flex-item">
21 21
             <div>
22 22
               <el-input
@@ -57,7 +57,7 @@
57 57
           </div>
58 58
         </li>
59 59
         <li class="flex-h">
60
-          <span>案场头像:</span>
60
+          <span>案场头像:<em>*</em></span>
61 61
           <div class="flex-item">
62 62
             <div>
63 63
               <!-- <a class="formImg">
@@ -176,14 +176,28 @@ export default {
176 176
       if (this.postData.CaseName === '') {
177 177
         this.$message({
178 178
           type: 'error',
179
-          message: '案场名称不能为空'
179
+          message: '请填写案场名称!'
180
+        })
181
+        return false
182
+      }
183
+      if (this.postData.CaseAddress === '') {
184
+        this.$message({
185
+          type: 'error',
186
+          message: '请填写案场地址!'
187
+        })
188
+        return false
189
+      }
190
+      if (this.postData.CaseIcon === '') {
191
+        this.$message({
192
+          type: 'error',
193
+          message: '请上传案场图片!'
180 194
         })
181 195
         return false
182 196
       }
183 197
       if (this.postData.Coordinate === '') {
184 198
         this.$message({
185 199
           type: 'error',
186
-          message: '案场经纬度不能为空'
200
+          message: '案场在地图上的位置不明确,请在地图上抓取地址获取经纬度!'
187 201
         })
188 202
         return false
189 203
       }

+ 18
- 4
src/pages/system/caseManager/caseInfo/editCase/index.vue View File

@@ -15,7 +15,7 @@
15 15
           </div>
16 16
         </li>
17 17
         <li class="flex-h">
18
-          <span>案场地址:</span>
18
+          <span>案场地址:<em>*</em></span>
19 19
           <div class="flex-item">
20 20
             <div>
21 21
               <el-input
@@ -53,7 +53,7 @@
53 53
           </div>
54 54
         </li>
55 55
         <li class="flex-h">
56
-          <span>案场头像:</span>
56
+          <span>案场头像:<em>*</em></span>
57 57
           <div class="flex-item">
58 58
             <div>
59 59
               <!-- <a class="formImg">
@@ -183,14 +183,28 @@ export default {
183 183
       if (this.postData.CaseName === '') {
184 184
         this.$message({
185 185
           type: 'error',
186
-          message: '案场名称不能为空'
186
+          message: '请填写案场名称!'
187
+        })
188
+        return false
189
+      }
190
+      if (this.postData.CaseAddress === '') {
191
+        this.$message({
192
+          type: 'error',
193
+          message: '请填写案场地址!'
194
+        })
195
+        return false
196
+      }
197
+      if (this.postData.CaseIcon === '') {
198
+        this.$message({
199
+          type: 'error',
200
+          message: '请上传案场图片!'
187 201
         })
188 202
         return false
189 203
       }
190 204
       if (this.postData.Coordinate === '') {
191 205
         this.$message({
192 206
           type: 'error',
193
-          message: '案场经纬度不能为空'
207
+          message: '案场在地图上的位置不明确,请在地图上抓取地址获取经纬度!'
194 208
         })
195 209
         return false
196 210
       }

+ 4
- 0
src/pages/system/caseManager/caseInfo/index.vue View File

@@ -48,6 +48,7 @@
48 48
 
49 49
 <script>
50 50
 import tableSearch from '@/components/tableSearch/index'
51
+import { mapActions } from 'vuex'
51 52
 
52 53
 export default {
53 54
   name: '',
@@ -71,6 +72,9 @@ export default {
71 72
     })
72 73
   },
73 74
   methods: {
75
+    ...mapActions([
76
+      'updateSystemInfo',
77
+    ]),
74 78
     pplConcerned (index, row) { // 相关人员
75 79
       this.$router.push({name: 'pplConcerned', query: {id: row.CaseId}})
76 80
     },

+ 1
- 0
src/pages/system/caseManager/caseTableManager/add.vue View File

@@ -9,6 +9,7 @@
9 9
               <el-input
10 10
                 placeholder="请输入名称"
11 11
                 v-model="postData.TableNo"
12
+                maxlength="6"
12 13
                 clearable>
13 14
               </el-input>
14 15
             </div>

+ 1
- 0
src/pages/system/caseManager/caseTableManager/edit.vue View File

@@ -9,6 +9,7 @@
9 9
               <el-input
10 10
                 placeholder="请输入名称"
11 11
                 v-model="postData.TableNo"
12
+                maxlength="6"
12 13
                 clearable>
13 14
               </el-input>
14 15
             </div>

+ 34
- 23
src/pages/system/cmsManager/bannerManager/add.vue View File

@@ -77,7 +77,7 @@
77 77
         <li class="flex-h">
78 78
           <span>图片:</span>
79 79
           <div class="flex-item">
80
-            <el-upload
80
+            <!-- <el-upload
81 81
               :action="$api.file.image.url"
82 82
               :limit='limit'
83 83
               list-type="picture-card"
@@ -89,7 +89,15 @@
89 89
             </el-upload>
90 90
             <el-dialog :visible.sync="dialogVisible">
91 91
               <img width="100%" :src="imgs" alt="">
92
-            </el-dialog>
92
+            </el-dialog> -->
93
+            <el-upload
94
+              class="avatar-uploader"
95
+              :action='$api.file.image.url'
96
+              :show-file-list="false"
97
+              :on-success="handleAvatarSuccess">
98
+              <img v-if="postData.ImageUrl" :src="postData.ImageUrl" class="avatar">
99
+              <i v-else class="el-icon-plus avatar-uploader-icon"></i>
100
+            </el-upload>
93 101
           </div>
94 102
         </li>
95 103
         <!-- <li class="flex-h">
@@ -192,13 +200,13 @@ export default {
192 200
       }
193 201
       this.postData.OrgId = this.OrgId
194 202
       this.postData.ForwardType === '1' ? this.postData.ForwardType = 'url' : this.postData.ForwardType = 'course'
195
-      this.postData.ImageUrl = ''
196
-      for (let i = 0; i < this.imgsArr.length; i++) {
197
-        this.postData.ImageUrl += this.imgsArr[i].response.result.url + ','
198
-      }
199
-      if (this.postData.ImageUrl) {
200
-        this.postData.ImageUrl = this.postData.ImageUrl.substr(0, this.postData.ImageUrl.length - 1)
201
-      }
203
+      // this.postData.ImageUrl = ''
204
+      // for (let i = 0; i < this.imgsArr.length; i++) {
205
+      //   this.postData.ImageUrl += this.imgsArr[i].response.result.url + ','
206
+      // }
207
+      // if (this.postData.ImageUrl) {
208
+      //   this.postData.ImageUrl = this.postData.ImageUrl.substr(0, this.postData.ImageUrl.length - 1)
209
+      // }
202 210
       this.$ajax(this.$api.cms.addImage.url, {
203 211
         method: this.$api.cms.addImage.method,
204 212
         data: this.postData
@@ -218,21 +226,24 @@ export default {
218 226
     cancel () {
219 227
       this.$router.go(-1)
220 228
     },
221
-    handlePictureCardPreview (res, file, fileList) {
222
-      this.imgs = res.result.url
223
-      this.dialogVisible = false
224
-      this.imgsArr = fileList
225
-    },
226
-    handleRemove (file, fileList) {
227
-      this.imgsArr = fileList
229
+    // handlePictureCardPreview (res, file, fileList) {
230
+    //   this.imgs = res.result.url
231
+    //   this.dialogVisible = false
232
+    //   this.imgsArr = fileList
233
+    // },
234
+    // handleRemove (file, fileList) {
235
+    //   this.imgsArr = fileList
236
+    // },
237
+    // exceed () {
238
+    //   this.$message({
239
+    //     message: '超过可传的图片上限',
240
+    //     type: 'info',
241
+    //     duration: 1000
242
+    //   })
243
+    // }
244
+    handleAvatarSuccess (res, file) {
245
+      this.postData.ImageUrl = res.result.url
228 246
     },
229
-    exceed () {
230
-      this.$message({
231
-        message: '超过可传的图片上限',
232
-        type: 'info',
233
-        duration: 1000
234
-      })
235
-    }
236 247
   }
237 248
 }
238 249
 </script>

+ 45
- 34
src/pages/system/cmsManager/bannerManager/edit.vue View File

@@ -77,7 +77,7 @@
77 77
         <li class="flex-h">
78 78
           <span>图片:</span>
79 79
           <div class="flex-item">
80
-            <el-upload
80
+            <!-- <el-upload
81 81
               :action="$api.file.image.url"
82 82
               :limit='limit'
83 83
               list-type="picture-card"
@@ -89,7 +89,15 @@
89 89
             </el-upload>
90 90
             <el-dialog :visible.sync="dialogVisible">
91 91
               <img width="100%" :src="imgs" alt="">
92
-            </el-dialog>
92
+            </el-dialog> -->
93
+            <el-upload
94
+              class="avatar-uploader"
95
+              :action='$api.file.image.url'
96
+              :show-file-list="false"
97
+              :on-success="handleAvatarSuccess">
98
+              <img v-if="postData.ImageUrl" :src="postData.ImageUrl" class="avatar">
99
+              <i v-else class="el-icon-plus avatar-uploader-icon"></i>
100
+            </el-upload>
93 101
           </div>
94 102
         </li>
95 103
         <!-- <li class="flex-h">
@@ -187,13 +195,13 @@ export default {
187 195
       this.postData.OrgId = this.OrgId
188 196
       this.postData.CaseId = this.CaseId
189 197
       this.postData.ForwardType === '1' ? this.postData.ForwardType = 'url' : this.postData.ForwardType = 'course'
190
-      this.postData.ImageUrl = ''
191
-      for (let i = 0; i < this.imgsArr.length; i++) {
192
-        this.postData.ImageUrl += this.imgsArr[i].response.result.url + ','
193
-      }
194
-      if (this.postData.ImageUrl) {
195
-        this.postData.ImageUrl = this.postData.ImageUrl.substr(0, this.postData.ImageUrl.length - 1)
196
-      }
198
+      // this.postData.ImageUrl = ''
199
+      // for (let i = 0; i < this.imgsArr.length; i++) {
200
+      //   this.postData.ImageUrl += this.imgsArr[i].response.result.url + ','
201
+      // }
202
+      // if (this.postData.ImageUrl) {
203
+      //   this.postData.ImageUrl = this.postData.ImageUrl.substr(0, this.postData.ImageUrl.length - 1)
204
+      // }
197 205
       this.$ajax(this.$api.cms.editImage.url, {
198 206
         method: this.$api.cms.editImage.method,
199 207
         data: this.postData,
@@ -226,37 +234,40 @@ export default {
226 234
         console.log(res)
227 235
         res.Status = res.Status + ''
228 236
         res.ForwardType === 'url' ? res.ForwardType = '1' : res.ForwardType = '0'
229
-        let imgsArr = []
230
-        let item = {
231
-          url: res.ImageUrl,
232
-          response: {
233
-            result: {
234
-              url: res.ImageUrl
235
-            }
236
-          }
237
-        }
238
-        imgsArr.push(item)
239
-        this.imgsArr = imgsArr
237
+        // let imgsArr = []
238
+        // let item = {
239
+        //   url: res.ImageUrl,
240
+        //   response: {
241
+        //     result: {
242
+        //       url: res.ImageUrl
243
+        //     }
244
+        //   }
245
+        // }
246
+        // imgsArr.push(item)
247
+        // this.imgsArr = imgsArr
240 248
         this.postData = res
241 249
       }).catch(msg => {
242 250
 
243 251
       })
244 252
     },
245
-    handlePictureCardPreview (res, file, fileList) {
246
-      this.imgs = res.result.url
247
-      this.dialogVisible = false
248
-      this.imgsArr = fileList
249
-    },
250
-    handleRemove (file, fileList) {
251
-      this.imgsArr = fileList
253
+    // handlePictureCardPreview (res, file, fileList) {
254
+    //   this.imgs = res.result.url
255
+    //   this.dialogVisible = false
256
+    //   this.imgsArr = fileList
257
+    // },
258
+    // handleRemove (file, fileList) {
259
+    //   this.imgsArr = fileList
260
+    // },
261
+    // exceed () {
262
+    //   this.$message({
263
+    //     message: '超过可传的图片上限',
264
+    //     type: 'info',
265
+    //     duration: 1000
266
+    //   })
267
+    // }
268
+    handleAvatarSuccess (res, file) {
269
+      this.postData.ImageUrl = res.result.url
252 270
     },
253
-    exceed () {
254
-      this.$message({
255
-        message: '超过可传的图片上限',
256
-        type: 'info',
257
-        duration: 1000
258
-      })
259
-    }
260 271
   }
261 272
 }
262 273
 </script>

+ 93
- 60
src/pages/system/cmsManager/majorProjects/edit.vue View File

@@ -44,7 +44,7 @@
44 44
         <li class="flex-h">
45 45
           <span>图片:</span>
46 46
           <div class="flex-item">
47
-            <el-upload
47
+            <!-- <el-upload
48 48
               :action="$api.file.image.url"
49 49
               list-type="picture-card"
50 50
               :limit='limit'
@@ -53,13 +53,22 @@
53 53
               :on-remove="handleRemove"
54 54
               :on-exceed="exceed">
55 55
               <i class="el-icon-plus"></i>
56
+            </el-upload> -->
57
+            <!-- 单选 -->
58
+            <el-upload
59
+              class="avatar-uploader"
60
+              :action='$api.file.image.url'
61
+              :show-file-list="false"
62
+              :on-success="handleImgSuccess">
63
+              <img v-if="imgShow" :src="imgShow" class="avatar">
64
+              <i v-else class="el-icon-plus avatar-uploader-icon"></i>
56 65
             </el-upload>
57 66
           </div>
58 67
         </li>
59 68
         <li class="flex-h">
60 69
           <span>详细图片:</span>
61 70
           <div class="flex-item">
62
-            <el-upload
71
+            <!-- <el-upload
63 72
               :action='$api.file.image.url'
64 73
               list-type="picture-card"
65 74
               :limit='limit'
@@ -68,6 +77,15 @@
68 77
               :on-remove="handleRemoveDetail"
69 78
               :on-exceed="exceed">
70 79
               <i class="el-icon-plus"></i>
80
+            </el-upload> -->
81
+            <!-- 单选 -->
82
+            <el-upload
83
+              class="avatar-uploader"
84
+              :action='$api.file.image.url'
85
+              :show-file-list="false"
86
+              :on-success="handleDetailImgSuccess">
87
+              <img v-if="detailImgShow" :src="detailImgShow" class="avatar">
88
+              <i v-else class="el-icon-plus avatar-uploader-icon"></i>
71 89
             </el-upload>
72 90
           </div>
73 91
         </li>
@@ -200,8 +218,10 @@ export default {
200 218
     return {
201 219
       id: '',
202 220
       limit: 1,
203
-      imgs: null,
204
-      detailimgs: null,
221
+      // imgs: null,
222
+      // detailimgs: null,
223
+      img: '',
224
+      detailimg: '',
205 225
       selCourseVisible: false,
206 226
       selCourseList: [],
207 227
     }
@@ -228,40 +248,46 @@ export default {
228 248
         this.getCourse()
229 249
       }
230 250
     },
231
-    imgsArr: {
232
-      get () {
233
-        return this.imgs || (this.detail.CmsCaseImgs || []).filter(x => x.ImageType === 'cover').map(x => {
234
-          return {
235
-            url: x.CaseImageUrl,
236
-            response: {
237
-              result: {
238
-                url: x.CaseImageUrl
239
-              }
240
-            }
241
-          }
242
-        })
243
-      },
244
-      set (val) {
245
-        this.imgs = val
246
-      }
251
+    imgShow () {
252
+      return this.img || ((this.detail.CmsCaseImgs || []).filter(x => x.ImageType === 'cover')[0] || {}).CaseImageUrl
247 253
     },
248
-    detailimgsArr: {
249
-      get () {
250
-        return this.detailimgs || (this.detail.CmsCaseImgs || []).filter(x => x.ImageType === 'detail').map(x => {
251
-          return {
252
-            url: x.CaseImageUrl,
253
-            response: {
254
-              result: {
255
-                url: x.CaseImageUrl
256
-              }
257
-            }
258
-          }
259
-        })
260
-      },
261
-      set (val) {
262
-        this.detailimgs = val
263
-      }
254
+    detailImgShow () {
255
+      return this.detailimg || ((this.detail.CmsCaseImgs || []).filter(x => x.ImageType === 'detail')[0] || {}).CaseImageUrl
264 256
     },
257
+    // imgsArr: {
258
+    //   get () {
259
+    //     return this.imgs || (this.detail.CmsCaseImgs || []).filter(x => x.ImageType === 'cover').map(x => {
260
+    //       return {
261
+    //         url: x.CaseImageUrl,
262
+    //         response: {
263
+    //           result: {
264
+    //             url: x.CaseImageUrl
265
+    //           }
266
+    //         }
267
+    //       }
268
+    //     })
269
+    //   },
270
+    //   set (val) {
271
+    //     this.imgs = val
272
+    //   }
273
+    // },
274
+    // detailimgsArr: {
275
+    //   get () {
276
+    //     return this.detailimgs || (this.detail.CmsCaseImgs || []).filter(x => x.ImageType === 'detail').map(x => {
277
+    //       return {
278
+    //         url: x.CaseImageUrl,
279
+    //         response: {
280
+    //           result: {
281
+    //             url: x.CaseImageUrl
282
+    //           }
283
+    //         }
284
+    //       }
285
+    //     })
286
+    //   },
287
+    //   set (val) {
288
+    //     this.detailimgs = val
289
+    //   }
290
+    // },
265 291
     coursesList () {
266 292
       return (this.courses.list || []).map(x => {
267 293
         return {
@@ -284,16 +310,17 @@ export default {
284 310
       'GetCourseList',
285 311
     ]),
286 312
     submit () {
287
-      const imgs = this.imgsArr.map(x => x.response.result.url).join(',')
288
-      const detailimgs = this.detailimgsArr.map(x => x.response.result.url).join(',')
313
+      // const imgs = this.imgsArr.map(x => x.response.result.url).join(',')
314
+      // const detailimgs = this.detailimgsArr.map(x => x.response.result.url).join(',')
315
+
289 316
       const courseids = (this.detail.Courses || []).map(x => x.CourseId).join(',')
290 317
       if (this.id === '') {
291 318
         this.detail.OrgId = this.OrgId
292
-        this.AddCaseInfo({...this.detail, OrgId: this.OrgId, imgs, detailimgs, courseids}).then(res => {
319
+        this.AddCaseInfo({...this.detail, OrgId: this.OrgId, imgs: this.img, detailimgs: this.detailimg, courseids}).then(res => {
293 320
           this.afterSave()
294 321
         })
295 322
       } else {
296
-        this.AddCaseInfo({...this.detail, imgs, detailimgs, courseids}).then(res => {
323
+        this.AddCaseInfo({...this.detail, imgs: this.img, detailimgs: this.detailimg, courseids}).then(res => {
297 324
           this.afterSave()
298 325
         })
299 326
       }
@@ -311,18 +338,18 @@ export default {
311 338
     cancel () {
312 339
       this.$router.go(-1)
313 340
     },
314
-    handlePictureCardPreview (res, file, fileList) {
315
-      this.imgsArr = fileList
316
-    },
317
-    handleRemove (file, fileList) {
318
-      this.imgsArr = fileList
319
-    },
320
-    handlePictureCardPreviewDetail (res, file, fileList) {
321
-      this.detailimgsArr = fileList
322
-    },
323
-    handleRemoveDetail (file, fileList) {
324
-      this.detailimgsArr = fileList
325
-    },
341
+    // handlePictureCardPreview (res, file, fileList) {
342
+    //   this.imgsArr = fileList
343
+    // },
344
+    // handleRemove (file, fileList) {
345
+    //   this.imgsArr = fileList
346
+    // },
347
+    // handlePictureCardPreviewDetail (res, file, fileList) {
348
+    //   this.detailimgsArr = fileList
349
+    // },
350
+    // handleRemoveDetail (file, fileList) {
351
+    //   this.detailimgsArr = fileList
352
+    // },
326 353
     getDetail () {
327 354
       this.GetCaseInfo({id: this.id})
328 355
     },
@@ -338,13 +365,13 @@ export default {
338 365
         this.$refs.courseTable.clearSelection()
339 366
       }
340 367
     },
341
-    exceed () {
342
-      this.$message({
343
-        message: '超过可传的图片上限',
344
-        type: 'info',
345
-        duration: 1000
346
-      })
347
-    },
368
+    // exceed () {
369
+    //   this.$message({
370
+    //     message: '超过可传的图片上限',
371
+    //     type: 'info',
372
+    //     duration: 1000
373
+    //   })
374
+    // },
348 375
     addCourse () {
349 376
       this.GetCourseList({caseid: this.CaseId, page: 1, pagesize: 100, callback: this.coursesShow})
350 377
     },
@@ -365,7 +392,13 @@ export default {
365 392
     },
366 393
     deleteItem (row) {
367 394
       this.UpdateInfo({...this.detail, Courses: this.detail.Courses.filter(x => x.CourseId !== row.CourseId)})
368
-    }
395
+    },
396
+    handleImgSuccess (res, file) {
397
+      this.img = res.result.url
398
+    },
399
+    handleDetailImgSuccess (res, file) {
400
+      this.detailimg = res.result.url
401
+    },
369 402
   },
370 403
   mounted () {
371 404
     this.getCourse()

+ 35
- 23
src/pages/system/cmsManager/newsManager/add.vue View File

@@ -62,7 +62,7 @@
62 62
         <li class="flex-h">
63 63
           <span>图片:</span>
64 64
           <div class="flex-item">
65
-            <el-upload
65
+            <!-- <el-upload
66 66
               :action="$api.file.image.url"
67 67
               :limit='limit'
68 68
               list-type="picture-card"
@@ -74,7 +74,16 @@
74 74
             </el-upload>
75 75
             <el-dialog :visible.sync="dialogVisible">
76 76
               <img width="100%" :src="imgs" alt="">
77
-            </el-dialog>
77
+            </el-dialog> -->
78
+            <!-- 单选 -->
79
+            <el-upload
80
+              class="avatar-uploader"
81
+              :action='$api.file.image.url'
82
+              :show-file-list="false"
83
+              :on-success="handleAvatarSuccess">
84
+              <img v-if="postData.ImageUrl" :src="postData.ImageUrl" class="avatar">
85
+              <i v-else class="el-icon-plus avatar-uploader-icon"></i>
86
+            </el-upload>
78 87
           </div>
79 88
         </li>
80 89
         <li style="text-align:center">
@@ -148,13 +157,13 @@ export default {
148 157
       }
149 158
       this.postData.ForwardType === '1' ? this.postData.ForwardType = 'url' : this.postData.ForwardType = 'course'
150 159
       this.postData.locationids = this.postData.LocationIds.join(',')
151
-      this.postData.ImageUrl = ''
152
-      for (let i = 0; i < this.imgsArr.length; i++) {
153
-        this.postData.ImageUrl += this.imgsArr[i].response.result.url + ','
154
-      }
155
-      if (this.postData.ImageUrl) {
156
-        this.postData.ImageUrl = this.postData.ImageUrl.substr(0, this.postData.ImageUrl.length - 1)
157
-      }
160
+      // this.postData.ImageUrl = ''
161
+      // for (let i = 0; i < this.imgsArr.length; i++) {
162
+      //   this.postData.ImageUrl += this.imgsArr[i].response.result.url + ','
163
+      // }
164
+      // if (this.postData.ImageUrl) {
165
+      //   this.postData.ImageUrl = this.postData.ImageUrl.substr(0, this.postData.ImageUrl.length - 1)
166
+      // }
158 167
       this.$ajax(this.$api.cms.addNews.url, {
159 168
         method: this.$api.cms.addNews.method,
160 169
         data: this.postData
@@ -174,21 +183,24 @@ export default {
174 183
     cancel () {
175 184
       this.$router.go(-1)
176 185
     },
177
-    handlePictureCardPreview (res, file, fileList) {
178
-      this.imgs = res.result.url
179
-      this.dialogVisible = false
180
-      this.imgsArr = fileList
181
-    },
182
-    handleRemove (file, fileList) {
183
-      this.imgsArr = fileList
186
+    // handlePictureCardPreview (res, file, fileList) {
187
+    //   this.imgs = res.result.url
188
+    //   this.dialogVisible = false
189
+    //   this.imgsArr = fileList
190
+    // },
191
+    // handleRemove (file, fileList) {
192
+    //   this.imgsArr = fileList
193
+    // },
194
+    // exceed () {
195
+    //   this.$message({
196
+    //     message: '超过可传的图片上限',
197
+    //     type: 'info',
198
+    //     duration: 1000
199
+    //   })
200
+    // }
201
+    handleAvatarSuccess (res, file) {
202
+      this.postData.ImageUrl = res.result.url
184 203
     },
185
-    exceed () {
186
-      this.$message({
187
-        message: '超过可传的图片上限',
188
-        type: 'info',
189
-        duration: 1000
190
-      })
191
-    }
192 204
   }
193 205
 }
194 206
 </script>

+ 47
- 36
src/pages/system/cmsManager/newsManager/edit.vue View File

@@ -62,7 +62,7 @@
62 62
         <li class="flex-h">
63 63
           <span>图片:</span>
64 64
           <div class="flex-item">
65
-            <el-upload
65
+            <!-- <el-upload
66 66
               :action="$api.file.image.url"
67 67
               :limit='limit'
68 68
               list-type="picture-card"
@@ -74,7 +74,15 @@
74 74
             </el-upload>
75 75
             <el-dialog :visible.sync="dialogVisible">
76 76
               <img width="100%" :src="imgs" alt="">
77
-            </el-dialog>
77
+            </el-dialog> -->
78
+            <el-upload
79
+              class="avatar-uploader"
80
+              :action='$api.file.image.url'
81
+              :show-file-list="false"
82
+              :on-success="handleAvatarSuccess">
83
+              <img v-if="postData.ImageUrl" :src="postData.ImageUrl" class="avatar">
84
+              <i v-else class="el-icon-plus avatar-uploader-icon"></i>
85
+            </el-upload>
78 86
           </div>
79 87
         </li>
80 88
         <li style="text-align:center">
@@ -144,13 +152,13 @@ export default {
144 152
       }
145 153
       this.postData.ForwardType === '1' ? this.postData.ForwardType = 'url' : this.postData.ForwardType = 'course'
146 154
       this.postData.locationids = this.postData.LocationIds.join(',')
147
-      this.postData.ImageUrl = ''
148
-      for (let i = 0; i < this.imgsArr.length; i++) {
149
-        this.postData.ImageUrl += this.imgsArr[i].response.result.url + ','
150
-      }
151
-      if (this.postData.ImageUrl) {
152
-        this.postData.ImageUrl = this.postData.ImageUrl.substr(0, this.postData.ImageUrl.length - 1)
153
-      }
155
+      // this.postData.ImageUrl = ''
156
+      // for (let i = 0; i < this.imgsArr.length; i++) {
157
+      //   this.postData.ImageUrl += this.imgsArr[i].response.result.url + ','
158
+      // }
159
+      // if (this.postData.ImageUrl) {
160
+      //   this.postData.ImageUrl = this.postData.ImageUrl.substr(0, this.postData.ImageUrl.length - 1)
161
+      // }
154 162
       this.$ajax(this.$api.cms.editNews.url, {
155 163
         method: this.$api.cms.editNews.method,
156 164
         urlData: {
@@ -173,21 +181,21 @@ export default {
173 181
     cancel () {
174 182
       this.$router.go(-1)
175 183
     },
176
-    handlePictureCardPreview (res, file, fileList) {
177
-      this.imgs = res.result.url
178
-      this.dialogVisible = false
179
-      this.imgsArr = fileList
180
-    },
181
-    handleRemove (file, fileList) {
182
-      this.imgsArr = fileList
183
-    },
184
-    exceed () {
185
-      this.$message({
186
-        message: '超过可传的图片上限',
187
-        type: 'info',
188
-        duration: 1000
189
-      })
190
-    },
184
+    // handlePictureCardPreview (res, file, fileList) {
185
+    //   this.imgs = res.result.url
186
+    //   this.dialogVisible = false
187
+    //   this.imgsArr = fileList
188
+    // },
189
+    // handleRemove (file, fileList) {
190
+    //   this.imgsArr = fileList
191
+    // },
192
+    // exceed () {
193
+    //   this.$message({
194
+    //     message: '超过可传的图片上限',
195
+    //     type: 'info',
196
+    //     duration: 1000
197
+    //   })
198
+    // },
191 199
     getDetail () {
192 200
       this.$ajax(this.$api.cms.newsDetail.url, {
193 201
         method: this.$api.cms.newsDetail.method,
@@ -203,22 +211,25 @@ export default {
203 211
           return previousValue
204 212
         }, [])
205 213
         console.log(res.LocationIds)
206
-        let imgsArr = []
207
-        let item = {
208
-          url: res.ImageUrl,
209
-          response: {
210
-            result: {
211
-              url: res.ImageUrl
212
-            }
213
-          }
214
-        }
215
-        imgsArr.push(item)
216
-        this.imgsArr = imgsArr
214
+        // let imgsArr = []
215
+        // let item = {
216
+        //   url: res.ImageUrl,
217
+        //   response: {
218
+        //     result: {
219
+        //       url: res.ImageUrl
220
+        //     }
221
+        //   }
222
+        // }
223
+        // imgsArr.push(item)
224
+        // this.imgsArr = imgsArr
217 225
         this.postData = res
218 226
       }).catch(msg => {
219 227
 
220 228
       })
221
-    }
229
+    },
230
+    handleAvatarSuccess (res, file) {
231
+      this.postData.ImageUrl = res.result.url
232
+    },
222 233
   }
223 234
 }
224 235
 </script>

+ 2
- 3
src/pages/system/courseManager/fiveA/edit.vue View File

@@ -149,13 +149,12 @@ export default {
149 149
           id: this.$route.query.id
150 150
         }
151 151
       }).then(res => {
152
-        console.log(res)
153 152
         let imgsArr = []
154 153
         let item = {
155
-          url: res.ImageUrl,
154
+          url: res.TypeImg,
156 155
           response: {
157 156
             result: {
158
-              url: res.ImageUrl
157
+              url: res.TypeImg
159 158
             }
160 159
           }
161 160
         }

+ 37
- 21
src/pages/system/goodsManager/goodManager/edit.vue View File

@@ -33,7 +33,8 @@
33 33
           <span>商品图片:</span>
34 34
           <div class="flex-item">
35 35
             <div style="width:50%">
36
-              <el-upload
36
+              <!-- 多选 -->
37
+              <!-- <el-upload
37 38
                 :action="$api.file.image.url"
38 39
                 :limit='limit'
39 40
                 list-type="picture-card"
@@ -42,6 +43,15 @@
42 43
                 :on-remove="handleRemove"
43 44
                 :on-exceed="exceed">
44 45
                 <i class="el-icon-plus"></i>
46
+              </el-upload> -->
47
+              <!-- 单选 -->
48
+              <el-upload
49
+                class="avatar-uploader"
50
+                :action='$api.file.image.url'
51
+                :show-file-list="false"
52
+                :on-success="handleAvatarSuccess">
53
+                <img v-if="Image" :src="Image" class="avatar">
54
+                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
45 55
               </el-upload>
46 56
             </div>
47 57
           </div>
@@ -105,7 +115,7 @@ export default {
105 115
   name: '',
106 116
   data () {
107 117
     return {
108
-      limit: 2,
118
+      limit: 1,
109 119
       dialogVisible: false,
110 120
       infoSpecs: null,
111 121
     }
@@ -128,23 +138,28 @@ export default {
128 138
       },
129 139
       set (val) {
130 140
         this.UpdateInfo({...this.detail, CaseId: val})
141
+        this.detail.TypeId = ''
131 142
         this.GetGoodTypes({ pagesize: 1000, caseid: this.Case })
132 143
         this.GetGoodSpecs({ pagesize: 1000, caseid: this.Case })
133 144
       }
134 145
     },
135 146
     detailSpecs: {
136 147
       get () {
148
+        console.log(this.infoSpecs || (this.detail.Specs || []).map(x => x.SpecId))
137 149
         return this.infoSpecs || (this.detail.Specs || []).map(x => x.SpecId)
138 150
       },
139 151
       set (val) {
140 152
         this.infoSpecs = val
141 153
       },
142 154
     },
143
-    imgsArr () {
144
-      return (this.detail.Images || []).map(x => {
145
-        return {...x, url: x.url || x.ImgUrl}
146
-      })
147
-    },
155
+    // imgsArr () {
156
+    //   return (this.detail.Images || []).map(x => {
157
+    //     return {...x, url: x.url || x.ImgUrl}
158
+    //   })
159
+    // },
160
+    Image () {
161
+      return ((this.detail.Images || [])[0] || {}).ImgUrl
162
+    }
148 163
   },
149 164
   methods: {
150 165
     ...mapGoodsActions([
@@ -183,19 +198,22 @@ export default {
183 198
     cancel () {
184 199
       this.$router.go(-1)
185 200
     },
186
-    handlePictureCardPreview (res, file, fileList) {
187
-      this.detail.Images = fileList
201
+    // handlePictureCardPreview (res, file, fileList) {
202
+    //   this.detail.Images = fileList
203
+    // },
204
+    // handleRemove (file, fileList) {
205
+    //   this.detail.Images = fileList
206
+    // },
207
+    // exceed () {
208
+    //   this.$message({
209
+    //     message: '超过可传的图片上限',
210
+    //     type: 'info',
211
+    //     duration: 1000
212
+    //   })
213
+    // },
214
+    handleAvatarSuccess (res, file) {
215
+      this.UpdateInfo({...this.detail, Images: [{ImgUrl: res.result.url}]})
188 216
     },
189
-    handleRemove (file, fileList) {
190
-      this.detail.Images = fileList
191
-    },
192
-    exceed () {
193
-      this.$message({
194
-        message: '超过可传的图片上限',
195
-        type: 'info',
196
-        duration: 1000
197
-      })
198
-    }
199 217
   },
200 218
   created () {
201 219
     this.GetGoodTypes({ pagesize: 1000, caseid: this.Case })
@@ -203,8 +221,6 @@ export default {
203 221
     const { id } = this.$route.query
204 222
     if (id && id !== '') {
205 223
       this.GetGoodsByID({ id: id })
206
-    } else {
207
-      this.SetNull()
208 224
     }
209 225
   }
210 226
 }

+ 3
- 0
src/pages/system/goodsManager/goodManager/index.vue View File

@@ -140,6 +140,7 @@ export default {
140 140
       'GetGoodsList',
141 141
       'GetGoodTypes',
142 142
       'DelGoods',
143
+      'SetNull',
143 144
     ]),
144 145
     getTypeName (typeid) {
145 146
       return (this.types.list.filter(x => x.TypeId === typeid)[0] || {}).TypeName
@@ -167,6 +168,7 @@ export default {
167 168
     },
168 169
     handleEdit (index, row) {
169 170
       // 编辑
171
+      this.SetNull()
170 172
       this.$router.push({ name: 'editGoods', query: { id: row.GoodsId } })
171 173
     },
172 174
     handleDelete (index, row) {
@@ -194,6 +196,7 @@ export default {
194 196
       this.getList()
195 197
     },
196 198
     addRole () {
199
+      this.SetNull()
197 200
       this.$router.push({ name: 'editGoods' })
198 201
     },
199 202
   },

+ 9
- 3
src/pages/system/goodsManager/goodsTypeManager/index.vue View File

@@ -41,6 +41,9 @@
41 41
         <el-table-column
42 42
           prop="CaseName"
43 43
           label="所属案场">
44
+          <template slot-scope="scope">
45
+            <span>{{getCaseName(scope.row.CaseId)}}</span>
46
+          </template>
44 47
         </el-table-column>
45 48
         <el-table-column label="操作">
46 49
           <template slot-scope="scope">
@@ -107,14 +110,17 @@ export default {
107 110
       this.currentList = []
108 111
       this.getList()
109 112
     },
113
+    getCaseName (caseid) {
114
+      return (this.cases.filter(x => x.CaseId === caseid)[0] || {}).CaseName
115
+    },
110 116
     getList () { // 获取列表
111 117
       this.$ajax(this.$api.goodsManager.getGoodsTypeList.url, {
112 118
         method: this.$api.goodsManager.getGoodsTypeList.method,
113 119
         queryData: { ...this.postData, caseid: this.CaseId }
114 120
       }).then(res => {
115
-        for (var n = 0; n < res.list.length; n++) {
116
-          res.list[n].CaseName = this.cases.filter(x => x.CaseId === res.list[n].CaseId)[0].CaseName
117
-        }
121
+        // for (var n = 0; n < res.list.length; n++) {
122
+        //   res.list[n].CaseName = this.cases.filter(x => x.CaseId === res.list[n].CaseId)[0].CaseName
123
+        // }
118 124
         this.currentList = res.list
119 125
         this.postData.page = res.page
120 126
         this.total = res.pagenum

+ 27
- 0
src/pages/system/systemSet/userManager/add.vue View File

@@ -14,6 +14,14 @@
14 14
             </div>
15 15
           </div>
16 16
         </li>
17
+        <li class="flex-h" style="padding: 0;margin: 0;">
18
+          <span></span>
19
+          <div class="flex-item">
20
+            <div style="min-height: 0;">
21
+              <span style="font-size:10px;color:#bbb;">默认密码:123456</span>
22
+            </div>
23
+          </div>
24
+        </li>
17 25
         <li class="flex-h">
18 26
           <span>用户头像:</span>
19 27
           <div class="flex-item">
@@ -216,6 +224,25 @@ export default {
216 224
           message: '手机号不能为空'
217 225
         })
218 226
         return false
227
+      } else {
228
+        var myreg = /^[1][3,4,5,6,7,8][0-9]{9}$/
229
+        if (!myreg.test(this.postData.Phone)) {
230
+          this.$message({
231
+            type: 'error',
232
+            message: '请输入正确的手机号!'
233
+          })
234
+          return false
235
+        }
236
+      }
237
+      if (this.postData.Email !== '') {
238
+        var emailreg = new RegExp('^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$')
239
+        if (!emailreg.test(this.postData.Email)) {
240
+          this.$message({
241
+            type: 'error',
242
+            message: '邮箱格式不正确!'
243
+          })
244
+          return false
245
+        }
219 246
       }
220 247
       if (this.postData.BelongCaseId === '') this.postData.BelongCaseId = this.CaseId
221 248
       this.$ajax(this.$api.systemSet.addUser.url, {

+ 27
- 0
src/pages/system/systemSet/userManager/edit.vue View File

@@ -14,6 +14,14 @@
14 14
             </div>
15 15
           </div>
16 16
         </li>
17
+        <li class="flex-h" style="padding: 0;margin: 0;">
18
+          <span></span>
19
+          <div class="flex-item">
20
+            <div style="min-height: 0;">
21
+              <span style="font-size:10px;color:#bbb;">默认密码:123456</span>
22
+            </div>
23
+          </div>
24
+        </li>
17 25
         <li class="flex-h">
18 26
           <span>用户头像:</span>
19 27
           <div class="flex-item">
@@ -234,6 +242,25 @@ export default {
234 242
           message: '手机号不能为空'
235 243
         })
236 244
         return false
245
+      } else {
246
+        var myreg = /^[1][3,4,5,6,7,8][0-9]{9}$/
247
+        if (!myreg.test(this.postData.Phone)) {
248
+          this.$message({
249
+            type: 'error',
250
+            message: '请输入正确的手机号!'
251
+          })
252
+          return false
253
+        }
254
+      }
255
+      if (this.postData.Email !== '') {
256
+        var emailreg = new RegExp('^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$')
257
+        if (!emailreg.test(this.postData.Email)) {
258
+          this.$message({
259
+            type: 'error',
260
+            message: '邮箱格式不正确!'
261
+          })
262
+          return false
263
+        }
237 264
       }
238 265
       if (this.postData.BelongCaseId === '') this.postData.BelongCaseId = this.BelongCaseId
239 266
       if (this.postData.TagIds === '') this.postData.TagIds = this.TagIds.join(',')

+ 3
- 3
src/pages/system/systemSet/userManager/index.vue View File

@@ -76,12 +76,12 @@
76 76
         <el-table-column
77 77
           prop="WorkNo"
78 78
           label="工号"
79
-          width="200">
79
+          width="150">
80 80
         </el-table-column>
81 81
         <el-table-column
82 82
           prop="Phone"
83 83
           label="手机号"
84
-          width="150">
84
+          width="200">
85 85
         </el-table-column>
86 86
         <el-table-column
87 87
           prop="UserTypeNames"
@@ -231,7 +231,7 @@ export default {
231 231
       })
232 232
     },
233 233
     resetPasswd (index, row) { // 重置密码
234
-      this.$confirm('确认重置此用户密码?', '提示', {
234
+      this.$confirm('确认重置此用户密码为:123456?', '提示', {
235 235
         confirmButtonText: '确定',
236 236
         cancelButtonText: '取消',
237 237
         type: 'warning'