1.修复部分页面数据未加校验的问题

2.修复部分分页相关问题
master
x_z 3 years ago
parent fea23b6123
commit f4a1420388

@ -0,0 +1,11 @@
//封装字符串相关的方法
export function isBlank(value) {
if (value === "" || value === null || value === undefined) {
return true;
}
value = value + "";
value = value.trim();
if ("" === value || value === "string" || value === "undefined") {
return true;
}
}

@ -234,6 +234,10 @@ export default {
this.filterQuery.page = 1;
this.getList();
},
handleCurrentChange(val) {
this.filterQuery.page = val;
this.getList();
},
getList() {
this.loading = true;
getBussinessType(this.filterQuery)

@ -212,8 +212,7 @@ export default {
if (type != 2) {
this.inputQuery.genUnit = false;
}
}
,
},
//
getOrderType() {
this.orderTypeList = [];

@ -76,11 +76,11 @@
</el-table>
<el-pagination
:current-page="query.page"
:page-size="query.limit"
@current-change="handleCurrentChange"
layout="prev, pager, next"
:total="total"
:current-page="query.page"
>
</el-pagination>
@ -202,6 +202,7 @@ import {
} from "../../../api/auth/authAdmin";
import store from "../../../store/index";
import {isBlank} from "@/utils/strUtil";
const formJson = {
id: "",
@ -338,12 +339,10 @@ export default {
},
//
resetForm() {
if (this.$refs["dataForm"]) {
//
this.$refs["dataForm"].clearValidate();
//
this.$nextTick(() => {
this.$refs["dataForm"].resetFields();
}
this.$refs["dataForm"].clearValidate();
});
},
//
hideForm() {
@ -356,6 +355,7 @@ export default {
//
handleForm(index, row) {
this.formVisible = true;
this.resetForm();
this.formData = JSON.parse(JSON.stringify(formJson));
if (row !== null) {
this.formData = Object.assign({}, row);
@ -372,6 +372,26 @@ export default {
}
},
formSubmit() {
if (isBlank(this.formData.userName)) {
this.$message.error("用户账号不能为空");
return;
} else if (isBlank(this.formData.passWord)) {
this.$message.error("密码不能为空")
return;
}else if (isBlank(this.formData.checkPassword)) {
this.$message.error("请再次确认密码");
return;
} else if (isBlank(this.formData.employeeName)) {
this.$message.error("用户名称不能为空");
return;
} else if (this.formData.passWord != this.formData.checkPassword) {
this.$message.error("两次输入密码不一致");
return;
} else if (this.formData.roles.length === 0) {
this.$message.error("未指定角色!");
return;
}
this.$refs["dataForm"].validate(valid => {
if (valid) {
this.formLoading = true;
@ -424,7 +444,6 @@ export default {
});
})
.catch(() => {
this.$message.info("取消删除");
});
}
}

@ -242,6 +242,7 @@ import {
} from "../../../api/auth/authRole";
import {getBussinessType} from "../../../api/basic/bussinessType";
import {getBussinessTypeRole, updateBussinessTypeRole} from "../../../api/basic/bussinessTypeRole";
import {isBlank} from "@/utils/strUtil";
const formJson = {
id: "",
@ -435,13 +436,10 @@ export default {
},
//
resetForm() {
if (this.$refs["dataForm"]) {
//
this.$refs["dataForm"].clearValidate();
//
this.$nextTick(() => {
this.$refs["dataForm"].resetFields();
this.getList();
}
this.$refs["dataForm"].clearValidate();
});
},
//
hideForm() {
@ -451,6 +449,7 @@ export default {
},
//
handleForm(index, row) {
this.resetForm();
this.formVisible = true;
if (null != index) {
//
@ -469,37 +468,38 @@ export default {
}
},
formSubmit() {
this.$refs["dataForm"].validate(valid => {
if (valid) {
this.formLoading = true;
let data = Object.assign({}, this.formData);
authRoleSave(data, this.formName)
.then(response => {
this.formLoading = false;
if (response.code !== 20000) {
this.$message.error(response.message);
return false;
}
this.$message.success("操作成功");
this.formVisible = false;
if (this.formName === "add") {
//
if (response.data && response.data.id) {
data.id = response.data.id;
this.list.unshift(data);
}
} else {
this.list.splice(this.index, 1, data);
}
//
this.resetForm();
this.getList();
})
.catch(() => {
this.formLoading = false;
});
}
});
if (isBlank(this.formData.name)) {
this.$message.error("角色名称为必填项!");
return;
}
this.formLoading = true;
let data = Object.assign({}, this.formData);
authRoleSave(data, this.formName)
.then(response => {
this.formLoading = false;
if (response.code !== 20000) {
this.$message.error(response.message);
return false;
}
this.$message.success("操作成功");
this.formVisible = false;
if (this.formName === "add") {
//
if (response.data && response.data.id) {
data.id = response.data.id;
this.list.unshift(data);
}
} else {
this.list.splice(this.index, 1, data);
}
//
this.resetForm();
this.getList();
})
.catch(() => {
this.formLoading = false;
});
},
//
handleDel(index, row) {
@ -526,7 +526,6 @@ export default {
});
})
.catch(() => {
this.$message.info("取消删除");
});
}
},

@ -7,6 +7,7 @@
style="width: 400px"
v-model="filterQuery.key"
placeholder="请输入"
clearable
></el-input>
<el-select style="margin: 0px 15px 0px 15px;" v-model="filterQuery.bussinessStatus" clearable
@ -74,13 +75,9 @@
</el-tag>
</template>
</el-table-column>
<el-table-column label="角色" prop="role" width="120"></el-table-column>
<el-table-column label="最大用户数" prop="userMax" width="120">
</el-table-column>
<el-table-column label="当前用户数" prop="count" width="120">
</el-table-column>
<el-table-column label="角色" prop="roleName" width="120"></el-table-column>
<el-table-column label="最大用户数" prop="userMax" width="120"></el-table-column>
<el-table-column label="当前用户数" prop="currentUserCount" width="120"></el-table-column>
<el-table-column label="操作" width="120" fixed="right">
<template slot-scope="scope">
<el-button-group>
@ -152,6 +149,7 @@
size="small"
style="width: 40%"
type="number"
@change="verifyUserMax"
></el-input>
</el-form-item>
</div>
@ -299,12 +297,12 @@ export default {
},
value: "",
total: 0,
loading: false,
checkFlag: {
0: "未审核",
1: "已通过",
2: "已拒绝"
},
userflag: {
0: "禁用",
1: "正常"
@ -431,7 +429,6 @@ export default {
this.formVisible = false;
this.contractVisible = false;
},
handleSizeChange(val) {
this.filterQuery.limit = val;
this.getList();
@ -492,7 +489,12 @@ export default {
}),
(this.contractVisible = true);
},
verifyUserMax() {
if (this.formData.userMax < 0) {
this.$message.warning("最大用户数不能小于0");
this.formData.userMax = 0;
}
},
deleteDialog(row) {
this.$confirm("删除后将清空该客户下所有用户?", "提示", {
confirmButtonText: "确定",

@ -163,7 +163,7 @@
</el-col>
</el-row>
<span slot="footer" class="dialog-footer" style="margin-top: 40px">
<el-button @click="editDialogVisible = false">取消</el-button>
<el-button @click="cancelDialog"></el-button>
<el-button type="primary" @click="confirmEdit"></el-button>
</span>
</el-dialog>
@ -197,10 +197,7 @@ export default {
1: "已通过",
2: "已拒绝"
},
list: [],
addDialogVisible: false,
centerDialogVisible: false,
check: "",
checkQuery: {
@ -248,7 +245,8 @@ export default {
this.editDialogVisible = true;
},
cancelDialog() {
this.addDialogVisible = false;
this.editDialogVisible = false
this.getList();
},
handleCheckedChange(val) {
@ -265,10 +263,10 @@ export default {
checkRegister() {
this.loading = true;
check(this.checkQuery)
.then((response) => {
if (response.code === 20000) {
this.editDialogVisible = false;
this.getList();
this.$message({
type: "success",
@ -287,7 +285,6 @@ export default {
this.centerDialogVisible = true;
},
confirmEdit() {
this.ch;
this.checkRegister();
},

@ -41,8 +41,6 @@
prop="host"
width="260"
></el-table-column>
<el-table-column label="操作" width="120">
<template slot-scope="scope">
<el-button
@ -110,7 +108,6 @@
</div>
</el-dialog>
<el-pagination
:current-page="filterQuery.page"
:page-size="filterQuery.limit"
@ -122,8 +119,6 @@
</template>
<script>
import {checkPass} from "../../api/auth/register";
import {authAdminRoleList} from "../../api/auth/authAdmin";
import {
getPlatform,
updatePlatform,
@ -148,16 +143,13 @@ export default {
id: "",
name: "",
host: ""
},
check: "",
roles: [],
formRules: {
name: [{required: true, message: "请输入平台名称", trigger: "blur"}],
host: [{required: true, message: "请输入平台访问地址", trigger: "blur"}]
}
};
},
filters: {
@ -169,7 +161,6 @@ export default {
};
return statusMap[status];
}
},
methods: {
onReset() {
@ -183,6 +174,12 @@ export default {
};
this.getList();
},
resetForm() {
this.$nextTick(() => {
this.$refs["dataForm"].resetFields();
this.$refs["dataForm"].clearValidate();
});
},
formSubmit() {
this.$refs["dataForm"].validate((valid) => {
if (valid) {
@ -221,35 +218,29 @@ export default {
cancelDialog() {
this.formVisible = false;
},
handleAddClick() {
this.editType = 0;
this.formVisible = true;
this.resetForm();
this.formData = {
id: null,
name: null,
host: null
};
},
handleModifyClick(row) {
(this.formData = {
this.formData = {
id: row.id,
name: row.name,
host: row.host
}),
this.formVisible = true;
};
this.resetForm();
this.formVisible = true;
},
handleCurrentChange(val) {
this.query.page = val;
this.filterQuery.page = val;
this.getList();
},
deleteDialog(row) {
this.$confirm("确认删除该自助平台信息?", "提示", {
confirmButtonText: "确定",
@ -267,10 +258,7 @@ export default {
.catch(() => {
});
}
},
mounted() {
},
created() {

@ -4,7 +4,7 @@
<el-row>
<el-form-item class="query-form-item">
<el-input
v-model="filterQuery.batchNo"
v-model="filterQuery.companyName"
placeholder="企业名称"
></el-input>
</el-form-item>

@ -422,9 +422,7 @@ export default {
.catch(() => {
this.deleteLoading = false;
});
})
.catch(() => {
this.$message.info("取消删除");
}).catch(() => {
});
}
},

Loading…
Cancel
Save