xuqiang před 4 roky
rodič
revize
70d0d9d95a

+ 2 - 2
src/main/vue/src/plugins/http.js

@@ -6,8 +6,8 @@ let baseUrl = 'http://localhost:8080';
 switch (process.env.NODE_ENV) {
     case 'development':
         // baseUrl = 'http://localhost:8080';
-        baseUrl = 'http://wljtest.izouma.com';
-        // baseUrl = 'http://192.168.31.202:8080';
+        // baseUrl = 'http://wljtest.izouma.com';
+        baseUrl = 'http://192.168.50.190:8080';
         break;
     case 'test':
         baseUrl = 'http://localhost:8080';

+ 27 - 9
src/main/vue/src/views/performance/PerformanceEdit.vue

@@ -49,10 +49,13 @@
                             <el-col :span="11">
                                 <el-form-item prop="date" label="活动时间">
                                     <el-date-picker
-                                        v-model="item.date"
-                                        type="date"
+                                        v-model="item.data"
+                                        type="daterange"
                                         value-format="yyyy-MM-dd"
-                                        placeholder="选择日期"
+                                        start-placeholder="开始时间"
+                                        end-placeholder="结束时间"
+                                        range-separator="至"
+                                        style="width: 220px"
                                     >
                                     </el-date-picker>
                                 </el-form-item>
@@ -137,6 +140,7 @@ export default {
             this.$http
                 .get('performance/backGet/' + this.$route.query.id)
                 .then(res => {
+                    console.log(res);
                     this.formData = res;
                     if (res.programmeNum > 0) {
                         this.edit = true;
@@ -145,7 +149,6 @@ export default {
                         this.phones = res.performanceEnquiries;
                     }
                     this.dateRange = [res.startDate, res.endDate];
-
                     this.$http
                         .post(
                             '/performanceSchedule/all',
@@ -153,7 +156,17 @@ export default {
                             { body: 'json' }
                         )
                         .then(res => {
-                            this.schedules = res.content;
+                            this.schedules = res.content.map(item => {
+                                return {
+                                    content: item.content,
+                                    data: [item.date, item.endDate],
+                                    address: item.address,
+                                    performanceId: item.performanceId,
+                                    id: item.id,
+                                    createdAt: item.createdAt,
+                                    del: item.del
+                                };
+                            });
                         });
                 })
                 .catch(e => {
@@ -192,6 +205,7 @@ export default {
                         delete res.id;
                         delete res.del;
                         this.formData = res;
+                        console.log(this.formData);
                     } else {
                         this.$message.warning('暂无上一年信息');
                     }
@@ -212,6 +226,8 @@ export default {
                 { label: '已结束', value: 'END' }
             ],
             dateRange: [],
+            // dataTo: [],
+            value1: [],
             eventTimeRange: '',
             years: [],
             schedules: [],
@@ -224,11 +240,14 @@ export default {
         saveOtherJson() {
             const schedules = [...this.schedules]
                 .filter(item => {
-                    return !!item.content || !!item.date || !!item.address;
+                    return !!item.content || !!item.data || !!item.address;
                 })
                 .map(item => {
                     return {
-                        ...item,
+                        content: item.content,
+                        address: item.address,
+                        date: item.data[0],
+                        endDate: item.data[1],
                         performanceId: this.performanceId
                     };
                 });
@@ -255,7 +274,6 @@ export default {
                 .post('/performance/save', data, { body: 'json' })
                 .then(res => {
                     this.saving = false;
-
                     this.performanceId = res.id;
                     this.$nextTick(() => {
                         this.$http.post('/performanceSchedule/batchSave', {
@@ -290,7 +308,7 @@ export default {
         onAddOtherForm() {
             this.schedules.push({
                 content: '',
-                date: '',
+                data: '',
                 address: ''
             });
         },

+ 18 - 5
src/main/vue/src/views/performance/PerformanceShow.vue

@@ -64,11 +64,13 @@
                                     <el-col :span="11">
                                         <el-form-item prop="date" label="活动时间">
                                             <el-date-picker
-                                                v-model="item.date"
-                                                type="date"
+                                                v-model="item.data"
+                                                type="daterange"
                                                 value-format="yyyy-MM-dd"
-                                                placeholder="选择日期"
-                                                readonly
+                                                start-placeholder="开始时间"
+                                                end-placeholder="结束时间"
+                                                range-separator="至"
+                                                style="width: 240px"
                                             >
                                             </el-date-picker>
                                         </el-form-item>
@@ -154,7 +156,18 @@ export default {
                             { body: 'json' }
                         )
                         .then(res => {
-                            this.schedules = res.content;
+                            // console.log(res);
+                            this.schedules = res.content.map(item => {
+                                return {
+                                    content: item.content,
+                                    data: [item.date, item.endDate],
+                                    address: item.address,
+                                    performanceId: item.performanceId,
+                                    id: item.id,
+                                    createdAt: item.createdAt,
+                                    del: item.del
+                                };
+                            });
                         });
                 })
                 .catch(e => {