panhui преди 6 години
родител
ревизия
552bedc02d
променени са 3 файла, в които са добавени 499 реда и са изтрити 317 реда
  1. 243 243
      src/main/vue/package-lock.json
  2. 75 65
      src/main/vue/src/components/MultiUpload.vue
  3. 181 9
      src/main/vue/src/pages/ProductInfoTicket.vue

Файловите разлики са ограничени, защото са твърде много
+ 243 - 243
src/main/vue/package-lock.json


+ 75 - 65
src/main/vue/src/components/MultiUpload.vue

@@ -1,12 +1,12 @@
 <template>
     <section>
         <el-upload
-            list-type="picture-card"
-            :action="url"
-            :on-preview="handlePictureCardPreview"
-            :on-remove="handleRemove"
-            :on-success="handleSuccess"
-            :file-list="fileList">
+                   list-type="picture-card"
+                   :action="url"
+                   :on-preview="handlePictureCardPreview"
+                   :on-remove="handleRemove"
+                   :on-success="handleSuccess"
+                   :file-list="fileList">
             <i class="el-icon-plus"></i>
             <div slot="tip" class="el-upload__tip">
                 <slot></slot>
@@ -18,73 +18,83 @@
     </section>
 </template>
 <script>
-    import {imageUrlPrefix} from '../config'
+import { imageUrlPrefix } from '../config';
 
-    const baseUrl = process.env.NODE_ENV === 'production' ? '../' : 'http://localhost:8080';
-    export default {
-        created() {
-            this.updateFileList(this.value);
-        },
-        props: {
-            value: Array,
-            usePrefix: {
-                type: Boolean,
-                default: true
-            },
-            prefix: {
-                type: String,
-                default: imageUrlPrefix
+const baseUrl =
+    process.env.NODE_ENV === 'production' ? '../' : 'http://localhost:8080';
+export default {
+    created() {
+        this.updateFileList(this.value);
+    },
+    props: {
+        value: {
+            type: Array,
+            default: () => {
+                return [];
             },
-            url: {
-                type: String,
-                default: baseUrl + '/assets/uploadFile'
-            }
         },
-        data() {
-            return {
-                dialogImageUrl: '',
-                dialogVisible: false,
-                fileList: []
+        usePrefix: {
+            type: Boolean,
+            default: true,
+        },
+        prefix: {
+            type: String,
+            default: imageUrlPrefix,
+        },
+        url: {
+            type: String,
+            default: baseUrl + '/assets/uploadFile',
+        },
+    },
+    data() {
+        return {
+            dialogImageUrl: '',
+            dialogVisible: false,
+            fileList: [],
+        };
+    },
+    methods: {
+        handleRemove(file, fileList) {
+            this.$emit('input', fileList.map(i => i.value));
+        },
+        handlePictureCardPreview(file) {
+            this.dialogImageUrl = file.url;
+            this.dialogVisible = true;
+        },
+        handleSuccess(response, file, fileList) {
+            if (response.data instanceof Array) {
+                file.value = response.data[0];
+            } else if (response.data instanceof String) {
+                file.value = response.data;
             }
+            this.$emit('input', fileList.map(i => i.value));
         },
-        methods: {
-            handleRemove(file, fileList) {
-                this.$emit('input', fileList.map(i => i.value));
-            },
-            handlePictureCardPreview(file) {
-                this.dialogImageUrl = file.url;
-                this.dialogVisible = true;
-            },
-            handleSuccess(response, file, fileList) {
-                if (response.data instanceof Array) {
-                    file.value = response.data[0];
-                } else if (response.data instanceof String) {
-                    file.value = response.data;
-                }
-                this.$emit('input', fileList.map(i => i.value));
-            },
-            updateFileList(list) {
-                this.fileList = list.map(i => {
-                    if (this.usePrefix && i && i.indexOf(this.prefix) === -1 && i.indexOf('http') === -1) {
-                        return {
-                            value: i,
-                            url: this.prefix + i
-                        }
-                    }
+        updateFileList(list) {
+            this.fileList = list.map(i => {
+                if (
+                    this.usePrefix &&
+                    i &&
+                    i.indexOf(this.prefix) === -1 &&
+                    i.indexOf('http') === -1
+                ) {
                     return {
                         value: i,
-                        url: i
-                    }
-                })
-            }
+                        url: this.prefix + i,
+                    };
+                }
+                return {
+                    value: i,
+                    url: i,
+                };
+            });
         },
-        watch: {
-            value(val) {
-                this.updateFileList(val);
-            }
-        }
-    }
+    },
+    watch: {
+        value(val) {
+            this.updateFileList(val);
+        },
+    },
+};
 </script>
 <style lang="less" scoped>
-
 </style>

+ 181 - 9
src/main/vue/src/pages/ProductInfoTicket.vue

@@ -46,6 +46,9 @@
                     </div>
                 </template>
             </el-form-item>
+            <el-form-item label="">
+                <el-button type="primary" plain size="small" @click="showTicket=true">选择途牛门票</el-button>
+            </el-form-item>
             <!-- 选择途牛门票 -->
             <el-form-item prop="ticketId" label="票ID">
                 <el-input v-model="formData.ticketId" :disabled="'ticketId'==subColumn"></el-input>
@@ -65,9 +68,6 @@
             <el-form-item prop="salePrice" label="sale价">
                 <el-input v-model="formData.salePrice" :disabled="'salePrice'==subColumn"></el-input>
             </el-form-item>
-            <!-- <el-form-item prop="priceLowFlag" label="价格预警">
-                <el-input v-model="formData.priceLowFlag" :disabled="'priceLowFlag'==subColumn"></el-input>
-            </el-form-item> -->
             <el-form-item prop="remark" label="备注">
                 <el-input v-model="formData.remark" :disabled="'remark'==subColumn"></el-input>
             </el-form-item>
@@ -75,18 +75,106 @@
                 <el-switch v-model="formData.shelfFlag" active-color="#13ce66" inactive-color="#ff4949" :disabled="'shelfFlag'==subColumn">
                 </el-switch>
             </el-form-item>
-            <!-- <el-form-item prop="packageIds" label="导航包ids">
-                <el-input v-model="formData.packageIds" :disabled="'packageIds'==subColumn"></el-input>
-            </el-form-item>
-            <el-form-item prop="productIds" label="商品Ids">
-                <el-input v-model="formData.productIds" :disabled="'productIds'==subColumn"></el-input>
-            </el-form-item> -->
             <el-form-item>
                 <el-button @click="onSave" :loading="$store.state.fetchingData" type="primary">保存</el-button>
                 <el-button @click="onDelete" v-if="formData.id" type="danger">删除</el-button>
                 <el-button @click="$router.go(-1)">取消</el-button>
             </el-form-item>
         </el-form>
+
+        <el-dialog
+                   title="选择门票"
+                   :visible.sync="showTicket"
+                   width="800px">
+
+            <el-row class="search">
+                <el-input v-model="searchKey" placeholder="请输入内容" clearable></el-input>
+                <el-button type="primary" @click="scenicList">搜索</el-button>
+            </el-row>
+
+            <el-table
+                      :data="tableData2"
+                      style="width: 100%" height='50vh' v-loading='loading'>
+                <el-table-column type="expand">
+                    <template slot-scope="props">
+                        <el-table
+                                  :data="props.row.ticketList"
+                                  style="width: 100%" border @row-click='chooseTick'>
+                            <el-table-column
+                                             prop="productName"
+                                             label="票名称">
+                            </el-table-column>
+                            <el-table-column
+                                             prop="salePrice"
+                                             label="售价"
+                                             width="70">
+                            </el-table-column>
+                            <el-table-column
+                                             prop="webPrice"
+                                             label="网络价格"
+                                             width="90">
+                            </el-table-column>
+                        </el-table>
+                    </template>
+                </el-table-column>
+                <el-table-column
+                                 prop="scenicName"
+                                 label="景点名称"
+                                 width="180">
+                </el-table-column>
+                <el-table-column
+                                 prop="address"
+                                 label="景点地址"
+                                 width="180">
+                </el-table-column>
+                <el-table-column
+                                 prop="bizTime"
+                                 label="开门时间">
+                </el-table-column>
+            </el-table>
+
+            <el-dialog
+                       width="50%"
+                       title="门票信息"
+                       :visible.sync="showDetail"
+                       append-to-body>
+                <div style="height:50vh;overflow-y:auto">
+                    <el-form label-width="80px">
+                        <el-form-item label="门票名称">
+                            <span>{{ticketDetail.productName}}</span>
+                        </el-form-item>
+                        <el-form-item label="景区名称">
+                            <span>{{chooseSicenInfo.scenicName}}</span>
+                        </el-form-item>
+                        <el-form-item label="门票ID">
+                            <span>{{ticketDetail.productId}}</span>
+                        </el-form-item>
+                        <el-form-item label="景区ID">
+                            <span>{{ticketDetail.scenicId}}</span>
+                        </el-form-item>
+                        <el-form-item label="重要信息">
+                            <span style="line-height:16px;" v-html="ticketDetail.smsMessage"></span>
+                        </el-form-item>
+
+                        <el-form-item label="售价">
+                            <span style="line-height:16px;" v-html="ticketDetail.webPrice"></span>
+                        </el-form-item>
+                        <el-form-item label="网络价格">
+                            <span style="line-height:16px;" v-html="ticketDetail.salePrice"></span>
+                        </el-form-item>
+                        <el-form-item label="提示">
+                            <span style="line-height:16px;" v-html="ticketDetail.info"></span>
+                        </el-form-item>
+
+                    </el-form>
+                </div>
+                <div slot="footer" class="dialog-footer">
+                    <el-button @click="showDetail = false">取 消</el-button>
+                    <el-button type="primary" @click="chooseInfo">选择门票</el-button>
+                </div>
+
+            </el-dialog>
+        </el-dialog>
     </div>
 </template>
 <script>
@@ -109,6 +197,7 @@ export default {
                 })
                 .then(res => {
                     if (res.success) {
+                        res.data.image = res.data.image.split(',');
                         this.formData = res.data;
 
                         if (this.$route.query.column) {
@@ -144,6 +233,10 @@ export default {
     },
     data() {
         return {
+            tableData2: [],
+            showTicket: false,
+            showDetail: false,
+            ticketDetail: {},
             saving: false,
             formData: {
                 typeFlag: 0,
@@ -174,9 +267,80 @@ export default {
             landmarkIdOptions: [],
             subColumn: '',
             subValue: '',
+            searchKey: '',
+            loading: false,
         };
     },
+    computed: {
+        chooseSicenInfo() {
+            var info = {};
+            var list = [...this.tableData2];
+            if (this.ticketDetail.productId && list.length > 0) {
+                list.forEach(item => {
+                    if (item.scenicId == 'poi' + this.ticketDetail.scenicId) {
+                        info = item;
+                    }
+                });
+            }
+            return info;
+        },
+    },
     methods: {
+        chooseInfo() {
+            this.formData.ticketId = this.ticketDetail.productId;
+            this.formData.scenicId = this.chooseSicenInfo.scenicId;
+            this.formData.scenicName = this.chooseSicenInfo.scenicName;
+            this.formData.ticketName = this.ticketDetail.productName;
+            this.showTicket = false;
+            this.showDetail = false;
+        },
+        scenicList() {
+            this.tableData2 = [];
+            this.loading = true;
+            this.$http
+                .get({
+                    url: '/tuniuopenapi/scenicList',
+                    data: {
+                        key: this.searchKey,
+                    },
+                })
+                .then(res => {
+                    this.loading = false;
+                    if (res.data.data.totalCount) {
+                        this.tableData2 = res.data.data.rows;
+                    } else {
+                        this.$message.warning({
+                            message: '暂无数据',
+                        });
+                    }
+                });
+        },
+        chooseSicen(row, tips) {
+            console.log(row, tips);
+        },
+        chooseTick(row, column, event) {
+            this.loading = true;
+            this.$http
+                .get({
+                    url: '/tuniuopenapi/ticketDetail',
+                    data: {
+                        productId: row.productId,
+                    },
+                })
+                .then(res => {
+                     this.loading = false;
+                    if (res.data.success) {
+                        // res.data.data.scenicName=''
+                        this.ticketDetail = res.data.data;
+                        this.showDetail = true;
+                    }
+                    else{
+                         this.$message.warning({
+                            message: res.data.msg,
+                        });
+                    }
+                });
+        },
         onSave() {
             this.$refs.form.validate(valid => {
                 if (valid) {
@@ -233,4 +397,12 @@ export default {
 };
 </script>
 <style lang="less" scoped>
+.search {
+    display: flex;
+
+    .el-input {
+        flex-grow: 1;
+        margin-right: 10px;
+    }
+}
 </style>

Някои файлове не бяха показани, защото твърде много файлове са промени