| | |
| | | this.$message.error(err.message) |
| | | return |
| | | } |
| | | this.initTinymce() |
| | | this.initTinymce(); |
| | | }) |
| | | }, |
| | | initTinymce() { |
| | |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="项目背景图" v-if="addProd" ref="backFilePath" prop="backFilePath"> |
| | | <uploadImg v-if="addProd" @sendList="imgSet($event,'backFilePath')" :disabled="disabled" :defaultList="ruleForm.backFilePath"></uploadImg> |
| | | <uploadImg v-if="addProd" @sendList="imgSet($event,'backFilePath')" :disabled="disabled" :defaultList="backFilePath"></uploadImg> |
| | | </el-form-item> |
| | | <el-form-item label="项目宣传标语" ref="logoFilePath" prop="logoFilePath"> |
| | | <uploadImg v-if="addProd" @sendList="imgSet($event,'logoFilePath')" :disabled="disabled" :defaultList="ruleForm.logoFilePath"></uploadImg> |
| | | <uploadImg v-if="addProd" @sendList="imgSet($event,'logoFilePath')" :disabled="disabled" :defaultList="logoFilePath"></uploadImg> |
| | | </el-form-item> |
| | | <el-form-item label="项目优惠券图片" ref="titleFilePath" prop="titleFilePath"> |
| | | <uploadImg v-if="addProd" @sendList="imgSet($event,'titleFilePath')" :disabled="disabled" :defaultList="ruleForm.titleFilePath"></uploadImg> |
| | | <uploadImg v-if="addProd" @sendList="imgSet($event,'titleFilePath')" :disabled="disabled" :defaultList="titleFilePath"></uploadImg> |
| | | </el-form-item> |
| | | <el-form-item label="会员权益" ref="qyFilePath"> |
| | | <uploadImg v-if="addProd" @sendList="imgSet($event,'qyFilePath')" :disabled="disabled" :defaultList="ruleForm.qyFilePath"></uploadImg> |
| | | <uploadImg v-if="addProd" @sendList="imgSet($event,'qyFilePath')" :disabled="disabled" :defaultList="qyFilePath"></uploadImg> |
| | | </el-form-item> |
| | | <el-form-item label="活动规则" prop="ruleContent"> |
| | | <tinymce v-model="ruleForm.ruleContent" :disabled="disabled" :height="300" /> |
| | | <tinymce v-if="addProd" v-model="ruleForm.ruleContent" :disabled="disabled" :height="300" /> |
| | | </el-form-item> |
| | | <el-form-item style="text-align:right;" v-if="!disabled"> |
| | | <el-button type="primary" @click="submitForm('ruleForm')">保存</el-button> |
| | |
| | | { |
| | | lable: "项目链接", |
| | | prop: "projUrl", |
| | | align: "center" |
| | | align: "center", |
| | | width: "300", |
| | | }, |
| | | { |
| | | lable: "创建时间", |
| | |
| | | lable: "项目描述", |
| | | prop: "projDesc", |
| | | align: "center", |
| | | width: "240", |
| | | }, |
| | | { |
| | | lable: "", |
| | |
| | | backFilePath:[], |
| | | logoFilePath:[], |
| | | titleFilePath:[], |
| | | qyFilePath:[], |
| | | ruleFilePath:[] |
| | | qyFilePath:[] |
| | | }, |
| | | rules: { |
| | | projName: [ |
| | |
| | | qyFilePath: [ |
| | | { required: true, trigger: 'change' ,validator: qyFilePathImage } |
| | | ], |
| | | ruleFilePath: [ |
| | | { required: true, trigger: 'change',validator: ruleFilePathImage } |
| | | ], |
| | | // ruleFilePath: [ |
| | | // { required: true, trigger: 'change',validator: ruleFilePathImage } |
| | | // ], |
| | | ruleContent:[ |
| | | { required: true, message: '请输入活动规则', trigger: 'blur', } |
| | | ] |
| | | }, |
| | | title:"新增项目" |
| | | title:"新增项目", |
| | | backFilePath:[], |
| | | logoFilePath:[], |
| | | titleFilePath:[], |
| | | qyFilePath:[], |
| | | ruleFilePath:[] |
| | | } |
| | | }, |
| | | watch:{ |
| | |
| | | projUrl:"", |
| | | projDesc:"", |
| | | status:"", |
| | | ruleContent:'', |
| | | backFilePath:[], |
| | | logoFilePath:[], |
| | | titleFilePath:[], |
| | | qyFilePath:[], |
| | | ruleFilePath:[] |
| | | }; |
| | | this.backFilePath = []; |
| | | this.logoFilePath = []; |
| | | this.titleFilePath = []; |
| | | this.qyFilePath = []; |
| | | this.$refs['ruleForm'].resetFields(); |
| | | } |
| | | }, |
| | |
| | | }, |
| | | addProduct(){ |
| | | this.title = '新增项目'; |
| | | this.ruleForm.ruleContent = ''; |
| | | this.addProd = true; |
| | | this.disabled = false; |
| | | }, |
| | |
| | | submitForm(formName) { |
| | | this.$refs[formName].validate((valid) => { |
| | | if (valid) { |
| | | let {backFilePath,logoFilePath,titleFilePath,qyFilePath,ruleFilePath,projId} = this.ruleForm; |
| | | let {backFilePath,logoFilePath,titleFilePath,qyFilePath,projId} = this.ruleForm; |
| | | let method = {projectUpdata,projectAdd}; |
| | | let data = {}; |
| | | if(projId){ |
| | | data = {...this.ruleForm,backFilePath:backFilePath[0],logoFilePath:logoFilePath[0],titleFilePath:titleFilePath[0],qyFilePath:qyFilePath[0],ruleFilePath:ruleFilePath[0]} |
| | | data = {...this.ruleForm}; |
| | | }else{ |
| | | data = {...this.ruleForm,backFilePath:backFilePath[0],logoFilePath:logoFilePath[0],titleFilePath:titleFilePath[0],qyFilePath:qyFilePath[0],ruleFilePath:ruleFilePath[0]} |
| | | data = {...this.ruleForm,backFilePath:backFilePath[0],logoFilePath:logoFilePath[0],titleFilePath:titleFilePath[0],qyFilePath:qyFilePath[0]} |
| | | } |
| | | method[projId?"projectUpdata":"projectAdd"](data).then(res=>{ |
| | | this.$message.success("创建成功"); |
| | |
| | | }, |
| | | getProductDetail(projId,type){ |
| | | projectDtl({projId:projId}).then(({body})=>{ |
| | | let {backFilePath,logoFilePath,titleFilePath,qyFilePath,ruleFilePath} = body; |
| | | body.backFilePath = this.setDefaultImg(backFilePath,'backFilePath'); |
| | | body.logoFilePath = this.setDefaultImg(logoFilePath,'logoFilePath'); |
| | | body.titleFilePath = this.setDefaultImg(titleFilePath,"titleFilePath"); |
| | | body.qyFilePath =qyFilePath? this.setDefaultImg(qyFilePath,"qyFilePath"):[]; |
| | | body.ruleFilePath = this.setDefaultImg(ruleFilePath,"ruleFilePath"); |
| | | let {backFilePath,logoFilePath,titleFilePath,qyFilePath} = body; |
| | | this.backFilePath = this.setDefaultImg(backFilePath,'backFilePath'); |
| | | this.logoFilePath = this.setDefaultImg(logoFilePath,'backFilePath'); |
| | | this.titleFilePath = this.setDefaultImg(titleFilePath,'titleFilePath'); |
| | | this.qyFilePath = this.setDefaultImg(qyFilePath,'backFilePath'); |
| | | this.ruleForm = body; |
| | | this.$nextTick(()=>{ |
| | | this.addProd = true; |
| | |
| | | }) |
| | | }, |
| | | setDefaultImg(url,type){ |
| | | let backArr = [url].map((n,index)=>{ |
| | | return {url:n,filePath:n,uid:type+index,fileId:type+index,fileName:n,name:n}; |
| | | }); |
| | | let backArr = []; |
| | | if(url){ |
| | | backArr = [url].map((n,index)=>{ |
| | | return {url:n,filePath:n,uid:type+index,fileId:type+index,fileName:n,name:n}; |
| | | }); |
| | | } |
| | | |
| | | return backArr |
| | | } |
| | | } |
| | |
| | | @getDataList="getDataList" |
| | | @handleSelectionChange="handleSelectionChange" |
| | | :exportUrl="{ |
| | | url: '/qyp/order/orderExport', |
| | | url: '/qyp/order/orderBaseExport', |
| | | powerId: '430102', |
| | | name: '订单列表', |
| | | }" |