Ver Fonte

编辑首页

plg há 5 meses atrás
pai
commit
18c55e881b

+ 148 - 81
src/components/EditHomeRegister.vue

@@ -44,7 +44,7 @@
           </el-col>
           <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
             <el-form-item label="是否展示详细信息" prop="isDetail">
-              <el-select v-model="ruleForm.isDetail" placeholder="请选择状态">
+              <el-select v-model="ruleForm.isDetail" placeholder="请选择否展示详细信息">
                 <el-option
                   :label="item.name"
                   :value="item.id"
@@ -84,7 +84,11 @@
                 :on-success="handleFirstPageCodeSuccess"
                 :before-upload="beforeAvatarUpload"
               >
-                <img v-if="ruleForm.firstPageCode" :src="ruleForm.firstPageCode" class="avatar" />
+                <img
+                  v-if="ruleForm.firstPageCode"
+                  :src="ruleForm.firstPageCode"
+                  class="avatar"
+                />
                 <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                 <div class="el-upload__tip" slot="tip">
                   建议上传jpg/png/jpeg文件,且不超过500kb
@@ -112,7 +116,7 @@
           </el-col>
           <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
             <el-form-item label="是否展示尾页二维码" prop="isCode">
-              <el-select v-model="ruleForm.state" placeholder="请选择是否展示尾页二维码">
+              <el-select v-model="ruleForm.isCode" placeholder="请选择是否展示尾页二维码">
                 <el-option
                   :label="item.name"
                   :value="item.id"
@@ -124,7 +128,10 @@
           </el-col>
           <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
             <el-form-item label="是否展示尾页公司名及地址" prop="isLastPageName">
-              <el-select v-model="ruleForm.isLastPageName" placeholder="请选择是否展示尾页公司名及地址">
+              <el-select
+                v-model="ruleForm.isLastPageName"
+                placeholder="请选择是否展示尾页公司名及地址"
+              >
                 <el-option
                   :label="item.name"
                   :value="item.id"
@@ -152,7 +159,8 @@
               ></el-input>
             </el-form-item>
           </el-col>
-           <el-row>
+        </el-row>
+        <el-row>
           <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
             <el-form-item label="尾页二维码" prop="lastPageCode">
               <el-upload
@@ -164,7 +172,11 @@
                 :on-success="handleLastPageCodeSuccess"
                 :before-upload="beforeAvatarUpload"
               >
-                <img v-if="ruleForm.lastPageCode" :src="ruleForm.lastPageCode" class="avatar" />
+                <img
+                  v-if="ruleForm.lastPageCode"
+                  :src="ruleForm.lastPageCode"
+                  class="avatar"
+                />
                 <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                 <div class="el-upload__tip" slot="tip">
                   建议上传jpg/png/jpeg文件,且不超过500kb
@@ -173,7 +185,6 @@
             </el-form-item>
           </el-col>
         </el-row>
-        </el-row>
       </el-form>
       <span slot="footer" class="dialog-footer">
         <el-button @click="cancle" round>取 消</el-button>
@@ -204,25 +215,6 @@ import { basePath } from "../utils/http";
 import md5 from "md5";
 export default {
   data() {
-    var validatePass = (rule, value, callback) => {
-      if (value === "") {
-        callback(new Error("请输入密码"));
-      } else if (value.length < 6) {
-        callback(new Error("密码至少6位"));
-      } else {
-        callback();
-      }
-    };
-    var validatePhone = (rule, value, callback) => {
-      let myreg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
-      if (value === "") {
-        callback(new Error("请输入手机号"));
-      } else if (!myreg.test(value)) {
-        callback(new Error("请输入正确格式"));
-      } else {
-        callback();
-      }
-    };
     return {
       action: "",
       disableFlag: false,
@@ -238,11 +230,11 @@ export default {
         { name: "是", id: "1" },
         { name: "否", id: "0" },
       ],
-      isCodeList:[
+      isCodeList: [
         { name: "是", id: "1" },
         { name: "否", id: "0" },
       ],
-      isLastPageNameList:[
+      isLastPageNameList: [
         { name: "是", id: "1" },
         { name: "否", id: "0" },
       ],
@@ -298,10 +290,10 @@ export default {
         isLastPageName: [
           { required: true, message: "是否展示尾页公司名称及地址", trigger: "change" },
         ],
-        // mail: [
-        //   { required: true, message: "请输选择邮箱", trigger: "blur" },
-        //   { type: "email", message: "请输入正确的邮箱地址", trigger: ["blur", "change"] },
-        // ],
+        mail: [
+          // { required: true, message: "请输选择邮箱", trigger: "blur" },
+          { type: "email", message: "请输入正确的邮箱地址", trigger: ["blur", "change"] },
+        ],
       },
     };
   },
@@ -317,6 +309,11 @@ export default {
     // this.ruleForm.type = "3";
   },
   methods: {
+    disableFlagStatus() {
+      setTimeout(() => {
+        this.disableFlag = false;
+      }, 1500);
+    },
     beforeAvatarUpload(file) {
       const fileName = file.name;
       const fileType = fileName.substring(fileName.lastIndexOf("."));
@@ -327,7 +324,7 @@ export default {
       }
       return true;
     },
-  
+
     //上传成功后的回调
     handleLogoSuccess(data) {
       if (data.code == 200) {
@@ -336,14 +333,14 @@ export default {
         //失败
       }
     },
-    handleFirstPageCodeSuccess(){
+    handleFirstPageCodeSuccess(data) {
       if (data.code == 200) {
         this.ruleForm.firstPageCode = basePath + "/file/show?filePath=" + data.data;
       } else {
         //失败
       }
     },
-    handleLastPageCodeSuccess(){
+    handleLastPageCodeSuccess(data) {
       if (data.code == 200) {
         this.ruleForm.lastPageCode = basePath + "/file/show?filePath=" + data.data;
       } else {
@@ -393,6 +390,7 @@ export default {
     open(val) {
       this.dialogVisible = true;
       this.isView = val;
+      this.ruleForm.channelId = val;
 
       this.$nextTick(() => {
         this.$refs["ruleForm"].clearValidate();
@@ -401,49 +399,98 @@ export default {
     edit(val) {
       this.dialogVisible = true;
       this.isView = false;
-      this.ruleForm.id = val.id;
       this.ruleForm.channelId = val.channelId;
-      this.ruleForm.avatar = val.avatar;
-      this.ruleForm.name = val.name;
-      this.ruleForm.description = val.description;
-      this.ruleForm.phone = val.phone;
-      this.ruleForm.mail = val.mail;
-      this.ruleForm.job = val.job;
-      this.ruleForm.state = val.state;
+      //报告来源
+      this.ruleForm.reportSource = val.reportSource;
+      //公司名称
+      this.ruleForm.companyName = val.companyName;
+      //是否展示详细信息
+      this.ruleForm.isDetail = val.isDetail;
+      //公司英文名称
+      this.ruleForm.companyEname = val.companyEname;
+      //网址
+      this.ruleForm.webAddress = val.webAddress;
+      //是否展示尾页二维码
+      this.ruleForm.isCode = val.isCode;
+      //是否展示尾页公司名称及地址
+      this.ruleForm.isLastPageName = val.isLastPageName;
+      // //尾页公司名称
+      this.ruleForm.lastPageName = val.lastPageName;
+      //尾页公司地址
+      this.ruleForm.lastPageAddress = val.lastPageAddress;
+      //是否删除
       this.ruleForm.isDelete = val.isDelete;
+      //主键
+      this.ruleForm.id = val.id;
+      //邮箱
+      this.ruleForm.mail = val.mail;
+      //尾页二维码
+      this.ruleForm.lastPageCode = val.lastPageCode;
+      //公司logo
+      this.ruleForm.logo = val.logo;
+      //首页二维码
+      this.ruleForm.firstPageCode = val.firstPageCode;
     },
     cancle() {
-      //清空表单
-      //   id: "",
-      //     channelId:'',
-      //     //头像
-      //     avatar: "",
-      //     //员工姓名
-      //     name: "",
-      //     //描述
-      //     description: "",
-      //     //岗位
-      //     job: "",
-      //     //邮箱
-      //     mail: "",
-      //     //手机号
-      //     phone: "",
-      //     //状态
-      //     state: "",
+      //渠道ID
+      this.ruleForm.channelId = "";
+      //报告来源
+      this.ruleForm.reportSource = "";
+      //公司名称
+      this.ruleForm.companyName = "";
+      //是否展示详细信息
+      this.ruleForm.isDetail = "";
+      //公司英文名称
+      this.ruleForm.companyEname = "";
+      //网址
+      this.ruleForm.webAddress = "";
+      //是否展示尾页二维码
+      this.ruleForm.isCode = "";
+      //是否展示尾页公司名称及地址
+      this.ruleForm.isLastPageName = "";
+      // //尾页公司名称
+      this.ruleForm.lastPageName = "";
+      //尾页公司地址
+      this.ruleForm.lastPageAddress = "";
+      //是否删除
+      this.ruleForm.isDelete = "";
+      //主键
       this.ruleForm.id = "";
-      // this.ruleForm.channelId='';
-      this.ruleForm.avatar = "";
-      this.ruleForm.name = "";
-      this.ruleForm.description = "";
-      this.ruleForm.job = "";
+      //邮箱
       this.ruleForm.mail = "";
-      this.ruleForm.phone = "";
-      this.ruleForm.state = "";
-      this.ruleForm.isDelete = "";
+      //尾页二维码
+      this.ruleForm.lastPageCode = "";
+      //公司logo
+      this.ruleForm.logo = "";
+      //首页二维码
+      this.ruleForm.firstPageCode = "";
+      //清空表单
       this.$refs["ruleForm"].clearValidate();
       this.dialogVisible = false;
     },
     submitCom() {
+      if (this.ruleForm.isLastPageName == "1") {
+        if (this.ruleForm.lastPageName == "") {
+          this.$message.error("是否展示尾页公司名称及地址选择是则尾页公司名称必填");
+          return;
+        }
+        if (this.ruleForm.lastPageAddress == "") {
+          this.$message.error("是否展示尾页公司名称及地址选择是则尾页公司地址必填");
+          return;
+        }
+      }
+
+      if (this.ruleForm.isCode == "1") {
+        if (this.ruleForm.lastPageCode == "") {
+          this.$message.error("是否展示尾页二维码选择是时尾页二维码必填");
+          return;
+        }
+      }
+
+      if (this.disableFlag) {
+        return;
+      }
+      this.disableFlag = true;
       this.$refs["ruleForm"].validate((valid) => {
         if (valid) {
           //判断是编辑还是新增
@@ -455,27 +502,48 @@ export default {
 
           //都校验通过后可以触发注册接口了
           //调用方法进行入参
+        } else {
+          this.disableFlagStatus();
         }
       });
     },
     register() {
       let that = this;
       this.$http.post(
-        `/staff/save`,
+        `/pdf/save`,
         {
-          avatar: this.ruleForm.avatar,
-          name: this.ruleForm.name,
-          description: this.ruleForm.description,
-          job: this.ruleForm.job,
-          mail: this.ruleForm.mail,
-          phone: this.ruleForm.phone,
-          state: this.ruleForm.state,
           channelId: this.ruleForm.channelId,
+          //报告来源
+          reportSource: this.ruleForm.reportSource,
+          //公司名称
+          companyName: this.ruleForm.companyName,
+          //是否展示详细信息
+          isDetail: this.ruleForm.isDetail,
+          //公司英文名称
+          companyEname: this.ruleForm.companyEname,
+          //网址
+          webAddress: this.ruleForm.webAddress,
+          //是否展示尾页二维码
+          isCode: this.ruleForm.isCode,
+          //是否展示尾页公司名称及地址
+          isLastPageName: this.ruleForm.isLastPageName,
+          // //尾页公司名称
+          lastPageName: this.ruleForm.lastPageName,
+          //尾页公司地址
+          lastPageAddress: this.ruleForm.lastPageAddress,
+          //是否删除
           isDelete: this.ruleForm.isDelete,
-          // ...this.ruleForm, //解构对象
+          //邮箱
+          mail: this.ruleForm.mail,
+          //尾页二维码
+          lastPageCode: this.ruleForm.lastPageCode,
+          //公司logo
+          logo: this.ruleForm.logo,
+          //首页二维码
+          firstPageCode: this.ruleForm.firstPageCode,
         },
         (res) => {
-          this.disableFlag = false;
+          this.disableFlagStatus();
           if (res && res.code == 200) {
             this.dialogVisible = false;
             this.$message.success(res.msg);
@@ -494,13 +562,13 @@ export default {
     editUserFun() {
       let that = this;
       this.$http.post(
-        `/staff/save`,
+        `/pdf/save`,
         {
           ...this.ruleForm,
           // ...this.ruleForm, //解构对象
         },
         (res) => {
-          this.disableFlag = false;
+          this.disableFlagStatus();
           if (res && res.code == 200) {
             this.dialogVisible = false;
             // this.$toast.success({ message: "成功" });
@@ -512,7 +580,6 @@ export default {
             this.$message.error(res.msg);
           }
           //清空缓存
-          this.cancle();
         }
       );
     },

+ 2 - 2
src/views/manage/channelManagement/contract.vue

@@ -107,13 +107,13 @@
                 @click="viewPoster(scope.row)"
                 >查看海报</el-button
               >
-              <!-- <el-button
+              <el-button
                 type="text"
                 size="small"
                 v-if="scope.row.state != 0"
                 @click="editHomeFun(scope.row)"
                 >PDF设置</el-button
-              > -->
+              >
               <el-button
                 type="text"
                 size="small"

+ 147 - 45
src/views/manage/channelManagement/editHomePage.vue

@@ -32,40 +32,49 @@
         >
           <!-- <el-table-column prop="name" label="姓名" align="center" width=""  show-overflow-tooltip>
               </el-table-column> -->
-          <el-table-column prop="name" label="报告来源" align="center" width="">
-          
+          <el-table-column prop="reportSource" label="报告来源" align="center" width="">
           </el-table-column>
-          <el-table-column prop="name" label="公司名" align="center" width="">
+          <el-table-column prop="companyName" label="公司名" align="center" width="">
           </el-table-column>
-          <el-table-column prop="description" label="是否展示详细信息" align="center" width="">
+          <el-table-column
+            prop="isDetail"
+            label="是否展示详细信息"
+            align="center"
+            width=""
+          >
           </el-table-column>
-          <el-table-column prop="job" label="公司英文名" align="center" width="">
+          <el-table-column prop="companyEname" label="公司英文名" align="center" width="">
           </el-table-column>
-          <el-table-column prop="mail" label="网址" align="center" width="">
+          <el-table-column prop="webAddress" label="网址" align="center" width="">
           </el-table-column>
-          <el-table-column prop="phone" label="邮箱" align="center" width="">
+          <el-table-column prop="mail" label="邮箱" align="center" width="">
           </el-table-column>
 
           <el-table-column
-            prop="state"
+            prop="isCode"
             label="是否展示尾页二维码"
             align="center"
-            :formatter="formatterState"
+            :formatter="formatterIsCode"
             width=""
           >
           </el-table-column>
           <el-table-column
-            prop="state"
+            prop="isLastPageName"
             label="是否展示尾页公司名称及地址"
             align="center"
-            :formatter="formatterState"
+            :formatter="formatterIsLastPageName"
+            width=""
+          >
+          </el-table-column>
+          <el-table-column prop="lastPageName" label="尾页公司名" align="center" width="">
+          </el-table-column>
+          <el-table-column
+            prop="lastPageAddress"
+            label="尾页公司地址"
+            align="center"
             width=""
           >
           </el-table-column>
-          <el-table-column prop="phone" label="尾页公司名" align="center" width="">
-        </el-table-column>
-        <el-table-column prop="phone" label="尾页公司地址" align="center" width="">
-        </el-table-column>
           <!-- <el-table-column
               prop="isDelete"
               label="删除状态"
@@ -102,7 +111,7 @@
           </el-table-column>
         </el-table>
       </div>
-<!-- 
+      <!-- 
       <el-pagination
         small
         background
@@ -119,7 +128,7 @@
     <EditHomeRegister ref="register" @search="searchTarget" />
     <el-dialog title="查看" :visible.sync="centerDialogVisible" width="60%" center>
       <div>
-        <el-row>
+        <!-- <el-row>
           <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
             <div class="user_out">
               <div class="user_out_sub" style="height: 200px">头像</div>
@@ -136,21 +145,68 @@
               </div>
             </div>
           </el-col>
-        </el-row>
+        </el-row> -->
         <el-row>
           <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
             <div class="user_out">
-              <div class="user_out_sub">个人描述</div>
+              <div class="user_out_sub">报告来源</div>
+              <div class="user_out_subNext">
+                {{ detailObj.reportSource }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">公司名称</div>
+              <div class="user_out_subNext">
+                {{ detailObj.companyName }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">公司英文名称</div>
               <div class="user_out_subNext">
-                {{ detailObj.description }}
+                {{ detailObj.companyEname }}
               </div>
             </div>
           </el-col>
           <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
             <div class="user_out">
-              <div class="user_out_sub">岗位</div>
+              <div class="user_out_sub">是否展示详细信息</div>
+              <div class="user_out_subNext">
+                <span v-if="detailObj.isDetail == '0'">否</span>
+                <span v-else-if="detailObj.isDetail == '1'">是</span>
+                <span v-else></span>
+              </div>
+            </div>
+          </el-col>
+
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub" style="height: 200px">头像</div>
               <div class="user_out_subNext">
-                {{ detailObj.job }}
+                <el-image :src="detailObj.logo" style="width: 150px; height: 150px" />
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub" style="height: 200px">首页二维码</div>
+              <div class="user_out_subNext">
+                <el-image
+                  :src="detailObj.firstPageCode"
+                  style="width: 150px; height: 150px"
+                />
+              </div>
+            </div>
+          </el-col>
+
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">网址</div>
+              <div class="user_out_subNext">
+                {{ detailObj.webAddress }}
               </div>
             </div>
           </el-col>
@@ -164,18 +220,51 @@
           </el-col>
           <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
             <div class="user_out">
-              <div class="user_out_sub">手机号</div>
+              <div class="user_out_sub" style="height: 200px">尾页二维码</div>
               <div class="user_out_subNext">
-                {{ detailObj.phone }}
+                <el-image
+                  :src="detailObj.lastPageCode"
+                  style="width: 150px; height: 150px"
+                />
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub" style="height: 200px">
+                是否展示尾页公司名及地址
+              </div>
+              <div class="user_out_subNext" style="height: 200px">
+                <span v-if="detailObj.isLastPageName == '1'">是</span>
+                <span v-else-if="detailObj.isLastPageName == '0'">否</span>
+                <span v-else></span>
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">尾页公司名</div>
+              <div class="user_out_subNext">
+                {{ detailObj.lastPageName }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">尾页公司地址</div>
+              <div class="user_out_subNext">
+                {{ detailObj.lastPageAddress }}
               </div>
             </div>
           </el-col>
 
           <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
             <div class="user_out">
-              <div class="user_out_sub">状态</div>
+              <div class="user_out_sub">是否展示尾页二维码</div>
               <div class="user_out_subNext">
-                {{ detailObj.state == "1" ? "签约" : "解约" }}
+                <span v-if="detailObj.isCode == '1'">是</span>
+                <span v-else-if="detailObj.isCode == '0'">否</span>
+                <span v-else></span>
               </div>
             </div>
           </el-col>
@@ -216,13 +305,13 @@ export default {
       type: 0,
 
       detailObj: {},
-      channelId:''
+      channelId: "",
     };
   },
   created() {},
   mounted() {
     this.userInfo = JSON.parse(oSessionStorage.getItem("userInfo"));
-    this.channelId=this.$route.query.channelId
+    this.channelId = this.$route.query.channelId;
     if (!this.userInfo) {
       //如果用户信息不存在跳转登陆页
       this.$router.push({ path: "/" });
@@ -230,6 +319,24 @@ export default {
     this.searchTarget();
   },
   methods: {
+    formatterIsLastPageName(row) {
+      if (row.isLastPageName == "0") {
+        return "否";
+      } else if (row.isLastPageName == "1") {
+        return "是";
+      } else {
+        return "";
+      }
+    },
+    formatterIsCode(row) {
+      if (row.isCode == "0") {
+        return "否";
+      } else if (row.isCode == "1") {
+        return "是";
+      } else {
+        return "";
+      }
+    },
     goBack() {
       this.$router.go(-1);
     },
@@ -261,7 +368,6 @@ export default {
       }
     },
     resetUser(index, val) {
-  
       this.$http.get(`/user/reset/${val.id}`, {}, (res) => {
         //  this.$toast.success({message:'成功'});
         if (res && res.code == 200) {
@@ -310,7 +416,7 @@ export default {
       this.$refs.register.edit(val);
     },
     deleteStaff(index, row) {
-      this.$http.delete(`/staff/delete/${row.id}`, {}, (res) => {
+      this.$http.delete(`/pdf/delete/${row.id}`, {}, (res) => {
         //  this.$toast.success({message:'成功'});
         if (res && res.code == 200) {
           this.$message.success("删除成功");
@@ -328,22 +434,18 @@ export default {
     //根据现有情况进行搜索
     searchList() {
       //  let url =``
-      this.$http.get(
-        `/pdf/find/${this.channelId}`,
-        {
-        },
-        (res) => {
-          debugger;
-          // console.log(res,'用户测试记录')
-          if (res && res.code == 200) {
-            this.tableData = res.data;
-            // this.total = res.data.totalElements;
-          } else {
-            // this.$toast.fail(res.msg);
-            this.$message.error(res.msg);
-          }
+      this.tableData = [];
+      this.$http.get(`/pdf/find/${this.channelId}`, {}, (res) => {
+        debugger;
+        // console.log(res,'用户测试记录')
+        if (res && res.code == 200) {
+          this.tableData.push(res.data);
+          // this.total = res.data.totalElements;
+        } else {
+          // this.$toast.fail(res.msg);
+          this.$message.error(res.msg);
         }
-      );
+      });
     },
     searchTarget() {
       this.pageNum = 1;