Shannon_mu 3 vuotta sitten
vanhempi
commit
89648c9919

+ 5 - 5
operationSupport/src/components/Tinymce/index.vue

@@ -139,9 +139,10 @@ export default {
                         this.$message.error(res.msg);
                     }
                 });
-            } else {
-                this.$message({type:'warning',message:'只能复制纯文本或图片',duration:3000});
-            }
+            } 
+            // else {
+            //     this.$message({type:'warning',message:'只能复制纯文本或图片',duration:3000});
+            // }
 
             return;
             new Promise((resolve) => {
@@ -186,8 +187,7 @@ export default {
                 menubar: false,
                 plugins: plugins,
                 //只保留标签
-                valid_elements: 'img[src],div,span,e',
-                extended_valid_elements: 'img[src],div,span,e',
+                valid_elements: 'img[src],span[style],div,em,p,strong,blockquote',
                 end_container_on_empty_block: true,
                 powerpaste_word_import: 'clean',
                 code_dialog_height: 450,

+ 18 - 3
operationSupport/src/views/businessManagement/InvestmentResources/index.vue

@@ -50,8 +50,8 @@
 
                 <template slot-scope="scope" slot="opt">
                     <div class="opt">
-                        <el-tooltip class="item" effect="light" placement="bottom" content="编辑">
-                            <i class="zoniot_font zoniot-icon-bianji" @click="addOrEdit('edit', scope.row)"></i>
+                        <el-tooltip class="item" effect="light" placement="bottom" content="招商方案">
+                            <i class="zoniot_font zoniot-icon-bianji" @click="programme(scope.row)"></i>
                         </el-tooltip>
                     </div>
                 </template>
@@ -150,7 +150,22 @@ export default {
                 })
                 .catch(() => {});
         },
-        addOrEdit() {}
+        programme(row) {
+            new Promise((resolve) => {
+                this.$store.dispatch('addPopup', {
+                    url: '/businessManagement/InvestmentResources/stepPage/programme.vue',
+                    width: '650px',
+                    height: '700px',
+                    props: {
+                        callback: resolve,
+                        row
+                    },
+                    title: '招商方案'
+                });
+            }).then(() => {
+                this.mixins_search();
+            });
+        }
     },
     watch: {
         currentId(newValue, oldValue) {

+ 187 - 0
operationSupport/src/views/businessManagement/InvestmentResources/stepPage/programme.vue

@@ -0,0 +1,187 @@
+<template>
+    <el-form ref="form" :model="formData" :rules="formRules" label-width="90px">
+        <div class="formContent-item_title">物业信息</div>
+        <el-col :span="12"><el-form-item label="房屋地址:"> xxxx </el-form-item></el-col>
+        <el-col :span="12"><el-form-item label="房屋编号:"> xxxx </el-form-item></el-col>
+        <el-col :span="12"><el-form-item label="房屋类型:"> xxxx </el-form-item></el-col>
+        <el-col :span="12"><el-form-item label="租售类型:"> xxxx </el-form-item></el-col>
+        <el-col :span="12"><el-form-item label="租售状态:"> xxxx </el-form-item></el-col>
+        <el-col :span="12"><el-form-item label="建筑面积:"> xxxx </el-form-item></el-col>
+        <div class="formContent-item_title">招商信息</div>
+        <el-form-item label="招商标题" prop="title">
+            <el-input v-model="formData.title" placeholder="请输入招商标题"></el-input>
+        </el-form-item>
+        <el-form-item label="月租金额" prop="monthlyRent">
+            <el-input v-model="formData.monthlyRent" placeholder="请输入月租金额"></el-input>
+        </el-form-item>
+        <el-form-item label="出售金额" prop="sell">
+            <el-input v-model="formData.sell" placeholder="请输入出售金额"></el-input>
+        </el-form-item>
+        <el-form-item label="房屋图片" prop="pictureUrl">
+            <div class="clickUpload">
+                <div class="clickUpText" v-for="item in fileType" :key="item">
+                    <video v-if="typeVideo(item)" :src="item"></video>
+                    <img v-else class="dataImg" :src="item" />
+                </div>
+                <div class="clickUpText">
+                    <div class="addImg" @click="clickFile('uploadImg')"><i class="el-icon-plus ashText"></i></div>
+                </div>
+                <el-upload
+                    style="display: none"
+                    :headers="token"
+                    ref="uploadImg"
+                    limit="3"
+                    action="/sc-community/upload/uploadFile"
+                    :on-success="uploadsuccess"
+                    :before-upload="beforeAvatarUpload"
+                    :auto-upload="true"
+                    name="file"
+                >
+                </el-upload>
+            </div>
+        </el-form-item>
+        <el-form-item label="房屋视频" prop="videoUrl">
+            <div class="clickUpload">
+                <div class="clickUpText" v-for="item in fileType" :key="item">
+                    <video v-if="typeVideo(item)" :src="item"></video>
+                    <img v-else class="dataImg" :src="item" />
+                </div>
+                <div class="clickUpText">
+                    <div class="addImg" @click="clickFile('uploadVideo')"><i class="el-icon-plus ashText"></i></div>
+                </div>
+                <el-upload
+                    style="display: none"
+                    :headers="token"
+                    ref="uploadVideo"
+                    limit="3"
+                    action="/sc-community/upload/uploadFile"
+                    :on-success="uploadsuccess"
+                    :before-upload="beforeAvatarUpload"
+                    :auto-upload="true"
+                    name="file"
+                >
+                </el-upload>
+            </div>
+        </el-form-item>
+        <el-form-item label="招商描述" prop="userId">
+            <tinymce v-model="formData.description" ref="endit" :height="150" />
+        </el-form-item>
+    </el-form>
+</template>
+<script >
+// Tinymce 富文本编辑器
+import Tinymce from '@/components/Tinymce';
+export default {
+    components: { Tinymce },
+    props: ['params'],
+    data() {
+        return {
+            formData: {
+                houseId: '',
+                description: '',
+                monthlyRent: '',
+                pictureUrl: '',
+                videoUrl: '',
+                sell: '',
+                title: ''
+            },
+            findUser: [],
+            formRules: {
+                monthlyRent: [this.$valid.inputRequired('月租金额')],
+                sell: [this.$valid.inputRequired('出售金额')],
+                title: [this.$valid.inputRequired('招商标题')]
+                // monthlyRent: [this.$valid.inputRequired('月租金额')],
+                // monthlyRent: [this.$valid.inputRequired('月租金额')],
+            }
+        };
+    },
+    methods: {
+        submit() {
+            this.$refs.form.validate((valid) => {
+                if (valid) {
+                    var loading = this.$loading();
+                    this.$http
+                        .post('/sc-community/merchants/edit', this.formData)
+                        .then(({ status, msg }) => {
+                            if (status == 0) {
+                                this.$message.success(msg);
+                                this.params.callback();
+                                this.$emit('close');
+                            } else {
+                                this.$message.error(msg);
+                            }
+                            loading.close();
+                        })
+                        .catch(() => {
+                            loading.close();
+                        });
+                }
+            });
+        },
+        uploadsuccess(response, file, fileList) {
+            this.$refs.uploadBox.clearFiles();
+            if (0 === response.status) {
+                this.fileType.push(response.data);
+            }
+        },
+        beforeAvatarUpload(file) {
+            // const isVIDEO = file.type === 'video/mp4';
+            // if (!isVIDEO) {
+            //     this.$message.error('上传mp4视频!');
+            // }
+            // return isVIDEO;
+        },
+        typeVideo(str) {
+            let type = str.slice(str.lastIndexOf('.') + 1, str.length);
+            let videoType = ['mp4'];
+            return videoType.includes(type);
+        },
+        clickFile(name) {
+            // this.$refs['uploaduserlogo'].$refs['upload-inner'].handleClick();
+            this.$refs[name].$children[0].$refs.input.click();
+        }
+    },
+    created() {
+        // this.params.house.map((item) => {
+        //     this.formData.houseIds.push(item.houseId);
+        // });
+    }
+};
+</script>
+<style lang="scss" scoped>
+.formContent-item_title {
+    clear: both;
+}
+
+.clickUpload {
+    display: flex;
+    .clickUpText {
+        height: 76px;
+        width: 76px;
+        border: 1px solid #e0e1e3;
+        box-sizing: border-box;
+        background: white;
+        border-radius: 5px;
+        margin-right: 5px;
+        z-index: 1;
+        img.dataImg {
+            width: 100%;
+            height: 100%;
+            object-fit: cover;
+            border-radius: 5px;
+        }
+        .addImg {
+            line-height: 76px;
+            text-align: center;
+            cursor: pointer;
+            & > i {
+                font-size: 30px;
+            }
+        }
+        video {
+            width: 100%;
+            height: 100%;
+        }
+    }
+}
+</style>

+ 84 - 0
operationSupport/src/views/businessManagement/InvestmentResources/uploadList.vue

@@ -0,0 +1,84 @@
+<template>
+    <div class="clickUpload">
+        <div class="clickUpText" v-for="item in fileType" :key="item">
+            <video v-if="typeVideo(item)" :src="item"></video>
+            <img v-else class="dataImg" :src="item" />
+        </div>
+        <div class="clickUpText">
+            <div class="addImg" @click="clickFile('uploadVideo')"><i class="el-icon-plus ashText"></i></div>
+        </div>
+        <el-upload
+            style="display: none"
+            :headers="token"
+            ref="uploadVideo"
+            limit="3"
+            action="/sc-community/upload/uploadFile"
+            :on-success="uploadsuccess"
+            :before-upload="beforeAvatarUpload"
+            :auto-upload="true"
+            name="file"
+        >
+        </el-upload>
+    </div>
+</template>
+<script>
+export default {
+    methods: {
+        uploadsuccess(response, file, fileList) {
+            this.$refs.uploadBox.clearFiles();
+            if (0 === response.status) {
+                this.fileType.push(response.data);
+            }
+        },
+        beforeAvatarUpload(file) {
+            // const isVIDEO = file.type === 'video/mp4';
+            // if (!isVIDEO) {
+            //     this.$message.error('上传mp4视频!');
+            // }
+            // return isVIDEO;
+        },
+        typeVideo(str) {
+            let type = str.slice(str.lastIndexOf('.') + 1, str.length);
+            let videoType = ['mp4'];
+            return videoType.includes(type);
+        },
+        clickFile(name) {
+            // this.$refs['uploaduserlogo'].$refs['upload-inner'].handleClick();
+            this.$refs[name].$children[0].$refs.input.click();
+        }
+    }
+};
+</script>
+<style lang="scss" scoped>
+.clickUpload {
+    display: flex;
+    .clickUpText {
+        height: 76px;
+        width: 76px;
+        border: 1px solid #e0e1e3;
+        box-sizing: border-box;
+        background: white;
+        border-radius: 5px;
+        margin-right: 5px;
+        z-index: 1;
+        img.dataImg {
+            width: 100%;
+            height: 100%;
+            object-fit: cover;
+            border-radius: 5px;
+        }
+        .addImg {
+            line-height: 76px;
+            text-align: center;
+            cursor: pointer;
+            & > i {
+                font-size: 30px;
+            }
+        }
+        video {
+            width: 100%;
+            height: 100%;
+        }
+    }
+}
+</style>