|
@@ -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();
|
|
|
}
|
|
|
);
|
|
|
},
|