|
|
|
@ -5,7 +5,7 @@
|
|
|
|
|
style="
|
|
|
|
|
width: 60%;
|
|
|
|
|
margin-top: 35px;
|
|
|
|
|
margin-left:20%;
|
|
|
|
|
margin-left: 20%;
|
|
|
|
|
margin-bottom: 35px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
"
|
|
|
|
@ -24,7 +24,7 @@
|
|
|
|
|
:model="inputQuery"
|
|
|
|
|
:rules="rules"
|
|
|
|
|
ref="inputQuery"
|
|
|
|
|
style="margin-left: 20%;"
|
|
|
|
|
style="margin-left: 20%"
|
|
|
|
|
>
|
|
|
|
|
<el-row :gutter="20">
|
|
|
|
|
<el-col :span="4">
|
|
|
|
@ -141,7 +141,6 @@
|
|
|
|
|
</div>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="10" v-if="registerConfigMap.companyCheckStatus">
|
|
|
|
|
|
|
|
|
|
<el-form-item prop="companyName">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="inputQuery.companyName"
|
|
|
|
@ -166,7 +165,6 @@
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
<el-col :span="10" v-if="!registerConfigMap.companyCheckStatus">
|
|
|
|
@ -193,8 +191,7 @@
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-row :gutter="20" v-if="registerConfigMap.udplatCheckStatus">
|
|
|
|
|
<el-col :span="1">
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1"> </el-col>
|
|
|
|
|
<el-col :span="10">
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-checkbox v-model="udplatEnable">
|
|
|
|
@ -210,7 +207,6 @@
|
|
|
|
|
</div>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="10">
|
|
|
|
|
|
|
|
|
|
<el-form-item prop="udplatCompanyName">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="inputQuery.udplatCompanyName"
|
|
|
|
@ -236,7 +232,6 @@
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="3">
|
|
|
|
|
<!--<el-button-->
|
|
|
|
@ -251,7 +246,6 @@
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <el-row :gutter="20">-->
|
|
|
|
|
<!-- <el-col :span="4">-->
|
|
|
|
|
<!-- <div class="register-text">-->
|
|
|
|
@ -299,11 +293,12 @@
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="10">
|
|
|
|
|
<el-form-item prop="bussinessStatus">
|
|
|
|
|
<el-select :disabled="true"
|
|
|
|
|
size="small"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
v-model="inputQuery.bussinessStatus"
|
|
|
|
|
placeholder="企业类型"
|
|
|
|
|
<el-select
|
|
|
|
|
:disabled="true"
|
|
|
|
|
size="small"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
v-model="inputQuery.bussinessStatus"
|
|
|
|
|
placeholder="企业类型"
|
|
|
|
|
>
|
|
|
|
|
<!-- <el-option label="医院" value="1"></el-option>-->
|
|
|
|
|
<el-option label="经营企业" value="2"></el-option>
|
|
|
|
@ -441,16 +436,15 @@
|
|
|
|
|
icon="search"
|
|
|
|
|
style="margin-top: 20px; width: 200px"
|
|
|
|
|
@click="onSubmit('inputQuery')"
|
|
|
|
|
>提交
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
>提交
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</div>
|
|
|
|
|
</el-form>
|
|
|
|
|
</el-card>
|
|
|
|
|
<div style="color: #2d3a4b; text-align: center">
|
|
|
|
|
<a href="http://www.xmglxp.com" style="color: #000000; font-size: 12px"
|
|
|
|
|
>厦门高立新鹏软件科技有限公司 13459286066</a
|
|
|
|
|
>厦门高立新鹏软件科技有限公司 13459286066</a
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="color: #2d3a4b; text-align: center">
|
|
|
|
@ -468,7 +462,6 @@
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-dialog
|
|
|
|
|
title="注册成功"
|
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
@ -482,21 +475,24 @@
|
|
|
|
|
<el-row :gutter="20" class="el-row" type="flex">
|
|
|
|
|
<el-col :span="20" class="el-col" type="flex">
|
|
|
|
|
<div class="text item">
|
|
|
|
|
<span>您的注册信息已提交,等待审核,请牢记您的账号密码,方便登录系统。</span>
|
|
|
|
|
<span
|
|
|
|
|
>您的注册信息已提交,等待审核,请牢记您的账号密码,方便登录系统。</span
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row :gutter="20" class="el-row" type="flex" style="margin-top: 20px">
|
|
|
|
|
|
|
|
|
|
<el-row
|
|
|
|
|
:gutter="20"
|
|
|
|
|
class="el-row"
|
|
|
|
|
type="flex"
|
|
|
|
|
style="margin-top: 20px"
|
|
|
|
|
>
|
|
|
|
|
<el-col :span="10" class="el-col" type="flex">
|
|
|
|
|
<div class="text item">
|
|
|
|
|
<span>{{ this.acoountInfo }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="10" class="el-col" type="flex">
|
|
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="10" class="el-col" type="flex"> </el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
</el-form>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
@ -511,11 +507,13 @@
|
|
|
|
|
<!-- 确定-->
|
|
|
|
|
<!-- </el-button>-->
|
|
|
|
|
|
|
|
|
|
<el-button class="tag-read" type="primary" size="mini"
|
|
|
|
|
v-clipboard:copy="acoountInfo"
|
|
|
|
|
>复制
|
|
|
|
|
<el-button
|
|
|
|
|
class="tag-read"
|
|
|
|
|
type="primary"
|
|
|
|
|
size="mini"
|
|
|
|
|
v-clipboard:copy="acoountInfo"
|
|
|
|
|
>复制
|
|
|
|
|
</el-button>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
@ -526,7 +524,9 @@ import { getCheckcode, register } from "@/api/login";
|
|
|
|
|
import {
|
|
|
|
|
getCompany,
|
|
|
|
|
modifyCompany,
|
|
|
|
|
getRefid, checkCompany, getRegisterConfig,
|
|
|
|
|
getRefid,
|
|
|
|
|
checkCompany,
|
|
|
|
|
getRegisterConfig,
|
|
|
|
|
} from "@/api/system/company";
|
|
|
|
|
import {
|
|
|
|
|
provinceAndCityData,
|
|
|
|
@ -536,14 +536,13 @@ import {
|
|
|
|
|
CodeToText,
|
|
|
|
|
TextToCode,
|
|
|
|
|
} from "element-china-area-data";
|
|
|
|
|
import Clipboard from 'clipboard';
|
|
|
|
|
import {BASE_URL} from "@/config/app";
|
|
|
|
|
import {getBasicUnitMaintains} from "@/api/basic/basicUnitMaintain"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import Clipboard from "clipboard";
|
|
|
|
|
import { BASE_URL } from "@/config/app";
|
|
|
|
|
import { getBasicUnitMaintains } from "@/api/basic/basicUnitMaintain";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
// 确认密码
|
|
|
|
|
let validatePass2 = (rule, value, callback) => {
|
|
|
|
|
if (value === "") {
|
|
|
|
|
callback(new Error("请再次输入密码"));
|
|
|
|
@ -553,6 +552,48 @@ export default {
|
|
|
|
|
callback();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
// 限制输入中文
|
|
|
|
|
const validateName = (rule, value, callback) => {
|
|
|
|
|
if (/^[\u4e00-\u9fa5]+$/.test(value) === false) {
|
|
|
|
|
callback(new Error("请输入中文"));
|
|
|
|
|
} else {
|
|
|
|
|
// 校验通过
|
|
|
|
|
callback();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
//限制输入字母数字
|
|
|
|
|
const validatePass = (rule, value, callback) => {
|
|
|
|
|
if (
|
|
|
|
|
/^(?![0-9]+$)(?![a-zA-Z]+$)[a-zA-Z0-9]{8,20}$/.test(value) === false
|
|
|
|
|
) {
|
|
|
|
|
callback(new Error("密码包含字母和数字且在8-20之间"));
|
|
|
|
|
} else {
|
|
|
|
|
// 校验通过
|
|
|
|
|
callback();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
//输入正确的手机号码格式
|
|
|
|
|
const validatePhone = (rule, value, callback) => {
|
|
|
|
|
if (/^1[3-9]\d{9}$/.test(value) === false) {
|
|
|
|
|
callback(new Error("请输入正确的电话号码"));
|
|
|
|
|
} else {
|
|
|
|
|
// 校验通过
|
|
|
|
|
callback();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
//限制输入正确的邮箱
|
|
|
|
|
const validateEmail = (rule, value, callback) => {
|
|
|
|
|
if (
|
|
|
|
|
/^([a-zA-Z0-9]+[_|_|.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|_|.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/.test(
|
|
|
|
|
value
|
|
|
|
|
) === false
|
|
|
|
|
) {
|
|
|
|
|
callback(new Error("请输入正确的邮箱地址"));
|
|
|
|
|
} else {
|
|
|
|
|
// 校验通过
|
|
|
|
|
callback();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
return {
|
|
|
|
|
inputQuery: {
|
|
|
|
|
nickName: null,
|
|
|
|
@ -589,42 +630,63 @@ export default {
|
|
|
|
|
acoountInfo: "账号:" + "------" + "\n密码:" + "-----",
|
|
|
|
|
rules: {
|
|
|
|
|
nickName: [
|
|
|
|
|
{required: true, message: "请输入用户名称", trigger: "blur"},
|
|
|
|
|
{ required: true, message: "请输入用户名称", trigger: "blur" },
|
|
|
|
|
{ min: 2, max: 8, message: "用户名称在2-8个字符", trigger: "blur" },
|
|
|
|
|
{ validator: validateName, trigger: "blur" },
|
|
|
|
|
],
|
|
|
|
|
password: [
|
|
|
|
|
{ required: true, message: "请输入密码", trigger: "blur" },
|
|
|
|
|
{ validator: validatePass, trigger: "blur" },
|
|
|
|
|
],
|
|
|
|
|
password: [{required: true, message: "请输入密码", trigger: "blur"}],
|
|
|
|
|
realName: [
|
|
|
|
|
{required: true, message: "请输入负责人姓名", trigger: "blur"},
|
|
|
|
|
{ required: true, message: "请输入负责人姓名", trigger: "blur" },
|
|
|
|
|
{ validator: validateName, trigger: "blur" },
|
|
|
|
|
],
|
|
|
|
|
tel: [{required: true, message: "请输入联系电话", trigger: "blur"},
|
|
|
|
|
tel: [
|
|
|
|
|
{ required: true, message: "请输入联系电话", trigger: "blur" },
|
|
|
|
|
{ validator: validatePhone, trigger: "blur" },
|
|
|
|
|
// { pattern:/^((0\d{2,3}-\d{7,8})|(1[3584]\d{9}))$/, message: "请输入正确的电话号码", trigger: "blur" }
|
|
|
|
|
],
|
|
|
|
|
mobile: [{required: true, message: "请输入手机号码", trigger: "blur"},
|
|
|
|
|
mobile: [
|
|
|
|
|
{ required: true, message: "请输入手机号码", trigger: "blur" },
|
|
|
|
|
// { pattern:/^0{0,1}(13[0-9]|15[7-9]|153|156|18[7-9])[0-9]{8}$/, message: "请输入正确的手机号", trigger: "blur" }
|
|
|
|
|
{ validator: validatePhone, trigger: "blur" },
|
|
|
|
|
],
|
|
|
|
|
confirmPassword: [
|
|
|
|
|
{required: true, message: "请确认密码", trigger: "blur"},
|
|
|
|
|
{validator: validatePass2, trigger: "blur"},
|
|
|
|
|
{ required: true, message: "请确认密码", trigger: "blur" },
|
|
|
|
|
{ validator: validatePass2, trigger: "blur" },
|
|
|
|
|
],
|
|
|
|
|
checkCode: [
|
|
|
|
|
{required: true, message: "请输入手机验证码", trigger: "blur"},
|
|
|
|
|
{ required: true, message: "请输入手机验证码", trigger: "blur" },
|
|
|
|
|
],
|
|
|
|
|
email: [
|
|
|
|
|
{ required: true, message: "请输入邮箱", trigger: "blur" },
|
|
|
|
|
{
|
|
|
|
|
validator: validateEmail,
|
|
|
|
|
trigger: "blur",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
email: [{required: true, message: "请输入邮箱", trigger: "blur"}],
|
|
|
|
|
companyName: [
|
|
|
|
|
{required: true, message: "请输入企业名称", trigger: "blur"},
|
|
|
|
|
{ required: true, message: "请输入企业名称", trigger: "blur" },
|
|
|
|
|
],
|
|
|
|
|
udplatCompanyName: [
|
|
|
|
|
{required: this.udplatEnable, message: "请输入阳光采购平台企业名称", trigger: "blur"},
|
|
|
|
|
{
|
|
|
|
|
required: this.udplatEnable,
|
|
|
|
|
message: "请输入阳光采购平台企业名称",
|
|
|
|
|
trigger: "blur",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
creditNum: [
|
|
|
|
|
{required: true, message: "请输入统一社会信用号", trigger: "blur"},
|
|
|
|
|
{ required: true, message: "请输入统一社会信用号", trigger: "blur" },
|
|
|
|
|
],
|
|
|
|
|
area: [{required: true, message: "请选择所属地区", trigger: "blur"}],
|
|
|
|
|
area: [{ required: true, message: "请选择所属地区", trigger: "blur" }],
|
|
|
|
|
detailAddr: [
|
|
|
|
|
{required: true, message: "请输入详细地址", trigger: "blur"},
|
|
|
|
|
{ required: true, message: "请输入详细地址", trigger: "blur" },
|
|
|
|
|
{ mix: 1, max: 30, message: "请输入详细地址", trigger: "blur" },
|
|
|
|
|
],
|
|
|
|
|
bussinessStatus: [
|
|
|
|
|
{required: true, message: "请选择企业类型", trigger: "blur"},
|
|
|
|
|
{ required: true, message: "请选择企业类型", trigger: "blur" },
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
registerConfigMap: {
|
|
|
|
@ -635,13 +697,16 @@ export default {
|
|
|
|
|
formData: {
|
|
|
|
|
account: "",
|
|
|
|
|
password: "",
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.registerConfig();
|
|
|
|
|
this.uploadUrl = process.env.VUE_APP_BASE_API + "/udiwms/upload/register/file";
|
|
|
|
|
this.fileUrl = process.env.VUE_APP_BASE_API + "/udiwms/image/register/file/getImage?type=image1&name=";
|
|
|
|
|
this.uploadUrl =
|
|
|
|
|
process.env.VUE_APP_BASE_API + "/udiwms/upload/register/file";
|
|
|
|
|
this.fileUrl =
|
|
|
|
|
process.env.VUE_APP_BASE_API +
|
|
|
|
|
"/udiwms/image/register/file/getImage?type=image1&name=";
|
|
|
|
|
// this.getData();
|
|
|
|
|
this.headers = {
|
|
|
|
|
ADMIN_ID: store.getters.adminId,
|
|
|
|
@ -656,7 +721,7 @@ export default {
|
|
|
|
|
if (valid) {
|
|
|
|
|
if (this.registerConfigMap.companyCheckStatus) {
|
|
|
|
|
if (this.$isBlank(this.inputQuery.companyName)) {
|
|
|
|
|
this.$message.error('企业名称不能为空');
|
|
|
|
|
this.$message.error("企业名称不能为空");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -673,11 +738,14 @@ export default {
|
|
|
|
|
this.formData = {
|
|
|
|
|
account: response.data,
|
|
|
|
|
password: this.inputQuery.password,
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
this.formVisible = true;
|
|
|
|
|
|
|
|
|
|
this.acoountInfo = "账号:" + this.formData.account + "\n密码:" + this.formData.password;
|
|
|
|
|
|
|
|
|
|
this.acoountInfo =
|
|
|
|
|
"账号:" +
|
|
|
|
|
this.formData.account +
|
|
|
|
|
"\n密码:" +
|
|
|
|
|
this.formData.password;
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(response.message);
|
|
|
|
|
}
|
|
|
|
@ -689,7 +757,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
formDefine() {
|
|
|
|
|
this.formVisible = false;
|
|
|
|
|
this.$router.push({path: "../login"});
|
|
|
|
|
this.$router.push({ path: "../login" });
|
|
|
|
|
},
|
|
|
|
|
getData() {
|
|
|
|
|
this.loading = true;
|
|
|
|
@ -714,7 +782,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
checkCompanyName() {
|
|
|
|
|
if (this.$isBlank(this.inputQuery.companyName)) {
|
|
|
|
|
this.$message.error('企业名称不能为空');
|
|
|
|
|
this.$message.error("企业名称不能为空");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
let tQuery = {
|
|
|
|
@ -753,40 +821,46 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
handleChange(value) {
|
|
|
|
|
this.inputQuery.area = CodeToText[value[0]];
|
|
|
|
|
if (CodeToText[value[1]] != null && CodeToText[value[1]] != ""
|
|
|
|
|
&& CodeToText[value[1]] != "undefined") {
|
|
|
|
|
if (
|
|
|
|
|
CodeToText[value[1]] != null &&
|
|
|
|
|
CodeToText[value[1]] != "" &&
|
|
|
|
|
CodeToText[value[1]] != "undefined"
|
|
|
|
|
) {
|
|
|
|
|
this.inputQuery.area += CodeToText[value[1]];
|
|
|
|
|
}
|
|
|
|
|
if (CodeToText[value[2]] != null && CodeToText[value[2]] != ""
|
|
|
|
|
&& CodeToText[value[2]] != "undefined") {
|
|
|
|
|
if (
|
|
|
|
|
CodeToText[value[2]] != null &&
|
|
|
|
|
CodeToText[value[2]] != "" &&
|
|
|
|
|
CodeToText[value[2]] != "undefined"
|
|
|
|
|
) {
|
|
|
|
|
this.inputQuery.area += CodeToText[value[2]];
|
|
|
|
|
}
|
|
|
|
|
this.inputQuery.areaCode = value.toString();
|
|
|
|
|
},
|
|
|
|
|
copy() {
|
|
|
|
|
|
|
|
|
|
let sel = this;
|
|
|
|
|
let clipboard = new Clipboard('.tag-read');
|
|
|
|
|
let clipboard = new Clipboard(".tag-read");
|
|
|
|
|
|
|
|
|
|
clipboard.on('success', e => {
|
|
|
|
|
clipboard.on("success", (e) => {
|
|
|
|
|
// 释放内存
|
|
|
|
|
clipboard.destroy();
|
|
|
|
|
});
|
|
|
|
|
clipboard.on('error', e => {
|
|
|
|
|
clipboard.on("error", (e) => {
|
|
|
|
|
// 不支持复制
|
|
|
|
|
// 释放内存
|
|
|
|
|
clipboard.destroy()
|
|
|
|
|
clipboard.destroy();
|
|
|
|
|
});
|
|
|
|
|
this.$confirm("账号已复制,请牢记自己的账号密码!是否跳转登录", "提示", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
|
type: "warning",
|
|
|
|
|
}).then(() => {
|
|
|
|
|
// this.formVisible = false;
|
|
|
|
|
// this.$router.push({path: "../login"});
|
|
|
|
|
sel.formDefine();
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
.then(() => {
|
|
|
|
|
// this.formVisible = false;
|
|
|
|
|
// this.$router.push({path: "../login"});
|
|
|
|
|
sel.formDefine();
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {});
|
|
|
|
|
},
|
|
|
|
|
selectOne(event) {
|
|
|
|
|
this.inputQuery.companyName = event.name;
|
|
|
|
@ -802,7 +876,6 @@ export default {
|
|
|
|
|
this.fromOptions = [];
|
|
|
|
|
let cQuery = {
|
|
|
|
|
key: query,
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
getBasicUnitMaintains(cQuery)
|
|
|
|
|
.then((response) => {
|
|
|
|
@ -829,23 +902,29 @@ export default {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
uploadHandleRemove(file, fileList) {
|
|
|
|
|
},
|
|
|
|
|
uploadHandlePreview(file) {
|
|
|
|
|
},
|
|
|
|
|
uploadHandleRemove(file, fileList) {},
|
|
|
|
|
uploadHandlePreview(file) {},
|
|
|
|
|
uploadHandleExceed(files, fileList) {
|
|
|
|
|
this.$message.warning(`当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
|
|
|
|
|
this.$message.warning(
|
|
|
|
|
`当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
|
|
|
|
|
files.length + fileList.length
|
|
|
|
|
} 个文件`
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
uploadOnchange(file, fileList) {
|
|
|
|
|
let fileName = file.name;
|
|
|
|
|
let uid = file.uid
|
|
|
|
|
let uid = file.uid;
|
|
|
|
|
let pos = fileName.lastIndexOf(".");
|
|
|
|
|
let lastName = fileName.substring(pos, fileName.length);
|
|
|
|
|
if (lastName.toLowerCase() !== ".jpg" && lastName.toLowerCase() !== ".png") {
|
|
|
|
|
if (
|
|
|
|
|
lastName.toLowerCase() !== ".jpg" &&
|
|
|
|
|
lastName.toLowerCase() !== ".png"
|
|
|
|
|
) {
|
|
|
|
|
this.$message.error("上传文件只能是 .jpg,.png 格式");
|
|
|
|
|
for (let i = 0; i < fileList.length; i++) {//从list删除
|
|
|
|
|
for (let i = 0; i < fileList.length; i++) {
|
|
|
|
|
//从list删除
|
|
|
|
|
if (fileList[i].uid === uid) {
|
|
|
|
|
fileList.splice(i, 1)
|
|
|
|
|
fileList.splice(i, 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
@ -856,7 +935,7 @@ export default {
|
|
|
|
|
this.$message.error("上传文件大小不能超过 30MB");
|
|
|
|
|
for (let i = 0; i < fileList.length; i++) {
|
|
|
|
|
if (fileList[i].uid === uid) {
|
|
|
|
|
fileList.splice(i, 1)
|
|
|
|
|
fileList.splice(i, 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -869,8 +948,7 @@ export default {
|
|
|
|
|
this.$message.error("文件上传失败:" + response.message);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
uploadHandleError() {
|
|
|
|
|
},
|
|
|
|
|
uploadHandleError() {},
|
|
|
|
|
openFile(path) {
|
|
|
|
|
window.open(this.fileUrl + path);
|
|
|
|
|
},
|
|
|
|
|