瀏覽代碼

门票选择

suochencheng 7 年之前
父節點
當前提交
03fd0d219f

+ 103 - 80
src/main/vue/src/pages/ProductInfo.vue

@@ -30,7 +30,7 @@
                 <multi-upload v-model="formData.image" :disabled="'image'==subColumn"></multi-upload>
                 <multi-upload v-model="formData.image" :disabled="'image'==subColumn"></multi-upload>
             </el-form-item>
             </el-form-item>
             <el-form-item prop="productContent" label="详情">
             <el-form-item prop="productContent" label="详情">
-                <el-input v-model="formData.productContent" :disabled="'productContent'==subColumn"></el-input>
+                <rich-text :height="500" v-model="formData.productContent" :noImage="true"></rich-text>
             </el-form-item>
             </el-form-item>
             <el-form-item prop="stockNum" label="数量">
             <el-form-item prop="stockNum" label="数量">
                 <el-input type="number" v-model="formData.stockNum" :disabled="'stockNum'==subColumn"></el-input>
                 <el-input type="number" v-model="formData.stockNum" :disabled="'stockNum'==subColumn"></el-input>
@@ -89,7 +89,8 @@
     </div>
     </div>
 </template>
 </template>
 <script>
 <script>
-import formValidator from '../formValidator'
+import formValidator from '../formValidator';
+import RichText from '../components/RichText';
 
 
 export default {
 export default {
     created() {
     created() {
@@ -99,46 +100,51 @@ export default {
         }
         }
 
 
         if (this.$route.query.id) {
         if (this.$route.query.id) {
-            this.$http.get({
-                url: '/productInfo/getOne',
-                data: {
-                    id: this.$route.query.id
-                }
-            }).then(res => {
-                if (res.success) {
-
+            this.$http
+                .get({
+                    url: '/productInfo/getOne',
+                    data: {
+                        id: this.$route.query.id,
+                    },
+                })
+                .then(res => {
+                    if (res.success) {
+                        if (res.data.image) {
+                            res.data.image = res.data.image.split(',');
+                        }
 
 
-                    this.formData = res.data;
+                        this.formData = res.data;
 
 
-                    if (this.$route.query.column) {
-                        this.formData[this.subColumn] = this.subValue;
-                    }
+                        if (this.$route.query.column) {
+                            this.formData[this.subColumn] = this.subValue;
+                        }
 
 
-                     this.formData.shelfFlag =
+                        this.formData.shelfFlag =
                             this.formData.shelfFlag == 'Y' ? true : false;
                             this.formData.shelfFlag == 'Y' ? true : false;
-                }
-            })
+                    }
+                });
         } else {
         } else {
             if (this.$route.query.column) {
             if (this.$route.query.column) {
                 this.formData[this.subColumn] = this.subValue;
                 this.formData[this.subColumn] = this.subValue;
             }
             }
         }
         }
 
 
-
-
-
-        this.$http.get({
-            url: '/landMark/all'
-        }).then(res => {
-            if (res.success) {
-
-                if (res.data.length > 0) {
-                    res.data.forEach(item => {
-                        this.landmarkIdOptions.push({ label: item.mapName, value: item.id });
-                    })
+        this.$http
+            .get({
+                url: '/landMark/noMapAll',
+            })
+            .then(res => {
+                if (res.success) {
+                    if (res.data.length > 0) {
+                        res.data.forEach(item => {
+                            this.landmarkIdOptions.push({
+                                label: item.mapName,
+                                value: item.id,
+                            });
+                        });
+                    }
                 }
                 }
-            }
-        });
+            });
     },
     },
     data() {
     data() {
         return {
         return {
@@ -146,32 +152,37 @@ export default {
             formData: {
             formData: {
                 typeFlag: 0,
                 typeFlag: 0,
             },
             },
-            rules: {
-            },
-            typeFlagOptions: [{
-                value: 0,
-                label: '门票'
-            }, {
-                value: 1,
-                label: '导航包'
-            }, {
-                value: 2,
-                label: '实物券'
-            }, {
-                value: 3,
-                label: '优惠券'
-            }, {
-                value: 4,
-                label: '组合商品'
-            }],
+            rules: {},
+            typeFlagOptions: [
+                {
+                    value: 0,
+                    label: '门票',
+                },
+                {
+                    value: 1,
+                    label: '导航包',
+                },
+                {
+                    value: 2,
+                    label: '实物券',
+                },
+                {
+                    value: 3,
+                    label: '优惠券',
+                },
+                {
+                    value: 4,
+                    label: '组合商品',
+                },
+            ],
             landmarkIdOptions: [],
             landmarkIdOptions: [],
             subColumn: '',
             subColumn: '',
             subValue: '',
             subValue: '',
-        }
+        };
     },
     },
     methods: {
     methods: {
         onSave() {
         onSave() {
-            this.$refs.form.validate((valid) => {
+            this.$refs.form.validate(valid => {
                 if (valid) {
                 if (valid) {
                     this.submit();
                     this.submit();
                 } else {
                 } else {
@@ -182,39 +193,51 @@ export default {
         submit() {
         submit() {
             var data = JSON.parse(JSON.stringify(this.formData));
             var data = JSON.parse(JSON.stringify(this.formData));
 
 
-             data.shelfFlag = this.formData.shelfFlag ? 'Y' : 'N';
-             
-            this.$http.post({
-                url: this.formData.id ? '/productInfo/update' : '/productInfo/save',
-                data: data
-            }).then(res => {
-                if (res.success) {
-                    this.$message.success('成功');
-                    this.$router.go(-1);
-                } else {
-                    this.$message.warning('失败')
-                }
-            });
+            data.shelfFlag = this.formData.shelfFlag ? 'Y' : 'N';
+
+            this.$http
+                .post({
+                    url: this.formData.id
+                        ? '/productInfo/update'
+                        : '/productInfo/save',
+                    data: data,
+                })
+                .then(res => {
+                    if (res.success) {
+                        this.$message.success('成功');
+                        this.$router.go(-1);
+                    } else {
+                        this.$message.warning('失败');
+                    }
+                });
         },
         },
         onDelete() {
         onDelete() {
-            this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' }).then(() => {
-                return this.$http.post({
-                    url: '/productInfo/del',
-                    data: { id: this.formData.id }
-                })
-            }).then(() => {
-                this.$message.success('删除成功');
-                this.$router.go(-1);
-            }).catch(action => {
-                if (action === 'cancel') {
-                    this.$message.info('删除取消');
-                } else {
-                    this.$message.error('删除失败');
-                }
+            this.$alert('删除将无法恢复,确认要删除么?', '警告', {
+                type: 'error',
             })
             })
+                .then(() => {
+                    return this.$http.post({
+                        url: '/productInfo/del',
+                        data: { id: this.formData.id },
+                    });
+                })
+                .then(() => {
+                    this.$message.success('删除成功');
+                    this.$router.go(-1);
+                })
+                .catch(action => {
+                    if (action === 'cancel') {
+                        this.$message.info('删除取消');
+                    } else {
+                        this.$message.error('删除失败');
+                    }
+                });
         },
         },
-    }
-}
+    },
+    components: {
+        RichText,
+    },
+};
 </script>
 </script>
 <style lang="less" scoped>
 <style lang="less" scoped>
 </style>
 </style>

+ 15 - 8
src/main/vue/src/pages/ProductInfoTicket.vue

@@ -30,7 +30,7 @@
                 <multi-upload v-model="formData.image" :disabled="'image'==subColumn"></multi-upload>
                 <multi-upload v-model="formData.image" :disabled="'image'==subColumn"></multi-upload>
             </el-form-item>
             </el-form-item>
             <el-form-item prop="productContent" label="详情">
             <el-form-item prop="productContent" label="详情">
-                <el-input v-model="formData.productContent" :disabled="'productContent'==subColumn"></el-input>
+                <rich-text :height="500" v-model="formData.productContent" :noImage="true"></rich-text>
             </el-form-item>
             </el-form-item>
             <el-form-item prop="stockNum" label="数量">
             <el-form-item prop="stockNum" label="数量">
                 <el-input type="number" v-model="formData.stockNum" :disabled="'stockNum'==subColumn"></el-input>
                 <el-input type="number" v-model="formData.stockNum" :disabled="'stockNum'==subColumn"></el-input>
@@ -98,7 +98,7 @@
                 <el-table-column type="expand">
                 <el-table-column type="expand">
                     <template slot-scope="props">
                     <template slot-scope="props">
                         <el-table
                         <el-table
-                                  :data="props.row.ticketList"
+                                  :data="props.row.disTickets"
                                   style="width: 100%" border @row-click='chooseTick'>
                                   style="width: 100%" border @row-click='chooseTick'>
                             <el-table-column
                             <el-table-column
                                              prop="productName"
                                              prop="productName"
@@ -179,6 +179,7 @@
 </template>
 </template>
 <script>
 <script>
 import formValidator from '../formValidator';
 import formValidator from '../formValidator';
+import RichText from '../components/RichText';
 
 
 export default {
 export default {
     created() {
     created() {
@@ -197,7 +198,9 @@ export default {
                 })
                 })
                 .then(res => {
                 .then(res => {
                     if (res.success) {
                     if (res.success) {
-                        res.data.image = res.data.image.split(',');
+                        if (res.data.image) {
+                            res.data.image = res.data.image.split(',');
+                        }
                         this.formData = res.data;
                         this.formData = res.data;
 
 
                         if (this.$route.query.column) {
                         if (this.$route.query.column) {
@@ -216,7 +219,7 @@ export default {
 
 
         this.$http
         this.$http
             .get({
             .get({
-                url: '/landMark/all',
+                url: '/landMark/noMapAll',
             })
             })
             .then(res => {
             .then(res => {
                 if (res.success) {
                 if (res.success) {
@@ -291,6 +294,8 @@ export default {
             this.formData.scenicId = this.chooseSicenInfo.scenicId;
             this.formData.scenicId = this.chooseSicenInfo.scenicId;
             this.formData.scenicName = this.chooseSicenInfo.scenicName;
             this.formData.scenicName = this.chooseSicenInfo.scenicName;
             this.formData.ticketName = this.ticketDetail.productName;
             this.formData.ticketName = this.ticketDetail.productName;
+            this.formData.webPrice = this.ticketDetail.webPrice;
+            this.formData.salePrice = this.ticketDetail.salePrice;
             this.showTicket = false;
             this.showTicket = false;
             this.showDetail = false;
             this.showDetail = false;
         },
         },
@@ -328,14 +333,13 @@ export default {
                     },
                     },
                 })
                 })
                 .then(res => {
                 .then(res => {
-                     this.loading = false;
+                    this.loading = false;
                     if (res.data.success) {
                     if (res.data.success) {
                         // res.data.data.scenicName=''
                         // res.data.data.scenicName=''
                         this.ticketDetail = res.data.data;
                         this.ticketDetail = res.data.data;
                         this.showDetail = true;
                         this.showDetail = true;
-                    }
-                    else{
-                         this.$message.warning({
+                    } else {
+                        this.$message.warning({
                             message: res.data.msg,
                             message: res.data.msg,
                         });
                         });
                     }
                     }
@@ -394,6 +398,9 @@ export default {
                 });
                 });
         },
         },
     },
     },
+    components: {
+        RichText,
+    },
 };
 };
 </script>
 </script>
 <style lang="less" scoped>
 <style lang="less" scoped>

+ 1 - 1
src/main/webapp/WEB-INF/html/admin.html

@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=referrer content=origin><title>管理后台</title><link rel=icon href=/static/favicon.ico><script src=/static/polyfill.min.js></script><script src=/static/fontawesome-v5.2.0.js></script><link href=/static/css/admin.ab35bc8e10d2b19bfa8f6b0f333cacf7.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.4ede708334227e92e7c0.js></script><script type=text/javascript src=/static/js/vendor.63bd2210bd34a6f1a686.js></script><script type=text/javascript src=/static/js/admin.4bd222a77c02c0aa4704.js></script></body></html>
+<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=referrer content=origin><title>管理后台</title><link rel=icon href=/static/favicon.ico><script src=/static/polyfill.min.js></script><script src=/static/fontawesome-v5.2.0.js></script><link href=/static/css/admin.a614cde63cf57ddbd5893ec1004cbf0f.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.1167c57943e80b195216.js></script><script type=text/javascript src=/static/js/vendor.63bd2210bd34a6f1a686.js></script><script type=text/javascript src=/static/js/admin.f48b5791207902f406e5.js></script></body></html>

+ 1 - 1
src/main/webapp/WEB-INF/html/loginAdmin.html

@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=referrer content=origin><title>管理后台</title><link rel=icon href=/static/favicon.ico><script src=/static/polyfill.min.js></script><link href=/static/css/loginAdmin.46a5161090cd0d8998f220733fc576f0.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.4ede708334227e92e7c0.js></script><script type=text/javascript src=/static/js/vendor.63bd2210bd34a6f1a686.js></script><script type=text/javascript src=/static/js/loginAdmin.92bea3e4f526a6f1f18a.js></script></body></html>
+<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=referrer content=origin><title>管理后台</title><link rel=icon href=/static/favicon.ico><script src=/static/polyfill.min.js></script><link href=/static/css/loginAdmin.46a5161090cd0d8998f220733fc576f0.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.1167c57943e80b195216.js></script><script type=text/javascript src=/static/js/vendor.63bd2210bd34a6f1a686.js></script><script type=text/javascript src=/static/js/loginAdmin.92bea3e4f526a6f1f18a.js></script></body></html>