zhaoxiaoqiang
2023-09-07 e2f0865c2a1167d36208a8c41eb5f18c684c786b
编辑权益项目
3 files modified
64 ■■■■■ changed files
src/components/Tinymce/index.vue 2 ●●● patch | view | raw | blame | history
src/views/qyp-project-management/index.vue 60 ●●●●● patch | view | raw | blame | history
src/views/qyp-project-order/index.vue 2 ●●● patch | view | raw | blame | history
src/components/Tinymce/index.vue
@@ -109,7 +109,7 @@
          this.$message.error(err.message)
          return
        }
        this.initTinymce()
        this.initTinymce();
      })
    },
    initTinymce() {
src/views/qyp-project-management/index.vue
@@ -91,19 +91,19 @@
              </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>
@@ -179,7 +179,8 @@
            {
              lable: "项目链接",
              prop: "projUrl",
              align: "center"
              align: "center",
              width: "300",
            },
            {
              lable: "创建时间",
@@ -197,6 +198,7 @@
              lable: "项目描述",
              prop: "projDesc",
              align: "center",
              width: "240",
            },
            {
              lable: "",
@@ -264,8 +266,7 @@
            backFilePath:[],
            logoFilePath:[],
            titleFilePath:[],
            qyFilePath:[],
            ruleFilePath:[]
            qyFilePath:[]
          },
          rules: {
              projName: [
@@ -295,14 +296,19 @@
              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:{
@@ -315,12 +321,16 @@
              projUrl:"",
              projDesc:"",
              status:"",
              ruleContent:'',
              backFilePath:[],
              logoFilePath:[],
              titleFilePath:[],
              qyFilePath:[],
              ruleFilePath:[]
            };
            this.backFilePath = [];
            this.logoFilePath = [];
            this.titleFilePath = [];
            this.qyFilePath = [];
            this.$refs['ruleForm'].resetFields();
          }
        },
@@ -354,6 +364,7 @@
      },
      addProduct(){
        this.title = '新增项目';
        this.ruleForm.ruleContent = '';
        this.addProd = true;
        this.disabled = false;
      },
@@ -394,13 +405,13 @@
      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("创建成功");
@@ -426,12 +437,11 @@
      },
      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; 
@@ -439,9 +449,13 @@
        })
      },
      setDefaultImg(url,type){
        let backArr = [url].map((n,index)=>{
        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
      }
    }
src/views/qyp-project-order/index.vue
@@ -95,7 +95,7 @@
          @getDataList="getDataList"
          @handleSelectionChange="handleSelectionChange"
          :exportUrl="{
            url: '/qyp/order/orderExport',
            url: '/qyp/order/orderBaseExport',
            powerId: '430102',
            name: '订单列表',
          }"