新增违规类型配置
This commit is contained in:
@@ -53,4 +53,65 @@ export const update = query => {
|
|||||||
method: 'post',
|
method: 'post',
|
||||||
params: query
|
params: query
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
// 违规类型列表接口
|
||||||
|
export const pageFun = query => {
|
||||||
|
return request({
|
||||||
|
url: '/admin/familyMember/violation/page',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
};
|
||||||
|
// 违规类型列表接口
|
||||||
|
export const listFun = query => {
|
||||||
|
return request({
|
||||||
|
url: '/admin/familyMember/violation/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
};
|
||||||
|
// 违规类型添加接口
|
||||||
|
export const addFun = query => {
|
||||||
|
return request({
|
||||||
|
url: '/admin/familyMember/violation/add',
|
||||||
|
method: 'post',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
};
|
||||||
|
// 编辑
|
||||||
|
export const updateFun = query => {
|
||||||
|
return request({
|
||||||
|
url: '/admin/familyMember/violation/update',
|
||||||
|
method: 'post',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
};
|
||||||
|
// 删除
|
||||||
|
export const delFun = query => {
|
||||||
|
return request({
|
||||||
|
url: '/admin/familyMember/violation/del',
|
||||||
|
method: 'post',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
};
|
||||||
|
// 添加违规记录
|
||||||
|
export const addRecord = query => {
|
||||||
|
return request({
|
||||||
|
url: '/admin/familyMember/violation/addRecord',
|
||||||
|
method: 'post',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
};
|
||||||
|
// 违规类查询
|
||||||
|
export const listRecord = query => {
|
||||||
|
return request({
|
||||||
|
url: '/admin/familyMember/violation/listRecord',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
};
|
||||||
|
// 导出
|
||||||
|
export const exportFamilyMember = query => {
|
||||||
|
window.location.href = `/admin/family/manage/exportFamilyMember?${genQueryParam(query)}`;
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
@@ -33,7 +33,7 @@
|
|||||||
>查询</el-button
|
>查询</el-button
|
||||||
>
|
>
|
||||||
<!-- 导出按钮 -->
|
<!-- 导出按钮 -->
|
||||||
<el-button class="primary" type="primary" @click="getData()"
|
<el-button class="primary" type="primary" @click="exportFamilyMemberFun()"
|
||||||
>导出</el-button
|
>导出</el-button
|
||||||
>
|
>
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
}}</template>
|
}}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="是否违规">
|
<el-table-column align="center" label="是否违规">
|
||||||
<template v-slot="scope">{{ scope.row.enable ? "是" : "否" }}</template>
|
<template v-slot="scope">{{ scope.row.violationNum }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="操作" width="300">
|
<el-table-column align="center" label="操作" width="300">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
@@ -83,10 +83,11 @@
|
|||||||
>违规警告</el-button
|
>违规警告</el-button
|
||||||
>
|
>
|
||||||
<el-button
|
<el-button
|
||||||
@click="dialogTableVisible = true"
|
@click="listRecordFun(scope.row)"
|
||||||
class="primary"
|
class="primary"
|
||||||
type="primary"
|
type="primary"
|
||||||
size="default"
|
size="default"
|
||||||
|
:disabled="scope.row.violationNum == 0 ? 'disabled' : ''"
|
||||||
>警告详情</el-button
|
>警告详情</el-button
|
||||||
>
|
>
|
||||||
</template>
|
</template>
|
||||||
@@ -164,9 +165,9 @@
|
|||||||
<el-select v-model="violationObj.nowValue" placeholder="请选择">
|
<el-select v-model="violationObj.nowValue" placeholder="请选择">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in violationObj.options"
|
v-for="item in violationObj.options"
|
||||||
:key="item.value"
|
:key="item.id"
|
||||||
:label="item.label"
|
:label="item.type"
|
||||||
:value="item.value"
|
:value="item.id"
|
||||||
>
|
>
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
@@ -175,7 +176,9 @@
|
|||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click="violationDialog = false">取消</el-button>
|
<el-button @click="violationDialog = false">取消</el-button>
|
||||||
<el-button type="primary" @click="add()"> 确认 </el-button>
|
<el-button type="primary" @click="add(violationObj)">
|
||||||
|
确认
|
||||||
|
</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@@ -195,7 +198,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { pageFamilyMember } from "@/api/nobleman/nobleman";
|
import {
|
||||||
|
pageFamilyMember,
|
||||||
|
listFun,
|
||||||
|
addRecord,
|
||||||
|
listRecord,
|
||||||
|
exportFamilyMember,
|
||||||
|
} from "@/api/nobleman/nobleman";
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { dateFormat } from "@/utils/system-helper";
|
import { dateFormat } from "@/utils/system-helper";
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@@ -224,7 +233,8 @@ export default {
|
|||||||
nick: "",
|
nick: "",
|
||||||
time: "",
|
time: "",
|
||||||
nowValue: "",
|
nowValue: "",
|
||||||
options: [{ value: "选项1", label: "黄金糕" }],
|
options: [],
|
||||||
|
familyMemberId: null,
|
||||||
},
|
},
|
||||||
// 分页
|
// 分页
|
||||||
total: 10, //总页数
|
total: 10, //总页数
|
||||||
@@ -234,6 +244,9 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getData();
|
this.getData();
|
||||||
|
listFun().then((res) => {
|
||||||
|
this.violationObj.options = res.data;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 查询接口
|
// 查询接口
|
||||||
@@ -261,14 +274,92 @@ export default {
|
|||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 导出
|
||||||
|
exportFamilyMemberFun() {
|
||||||
|
this.loading = true;
|
||||||
|
let time = this.inquire.time;
|
||||||
|
let startTime = "";
|
||||||
|
let endTime = "";
|
||||||
|
if (time && time.length > 0) {
|
||||||
|
startTime = dateFormat(this.inquire.time[0], "yyyy-MM-dd hh:mm:ss");
|
||||||
|
endTime = dateFormat(this.inquire.time[1], "yyyy-MM-dd hh:mm:ss");
|
||||||
|
}
|
||||||
|
exportFamilyMember({
|
||||||
|
erbanNo: this.inquire.userId,
|
||||||
|
familyName: this.inquire.nick,
|
||||||
|
startDate: startTime,
|
||||||
|
endDate: endTime,
|
||||||
|
pageNum: this.currentPage,
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
}).then((res) => {
|
||||||
|
});
|
||||||
|
},
|
||||||
// 违规警告
|
// 违规警告
|
||||||
warnClick(val) {
|
warnClick(val) {
|
||||||
console.log(val.row);
|
console.log(val.row);
|
||||||
var obj = val.row;
|
var obj = val.row;
|
||||||
this.violationObj.id = val.row.erbanNo;
|
this.violationObj.id = val.row.erbanNo;
|
||||||
this.violationObj.nick = val.row.nick;
|
this.violationObj.nick = val.row.nick;
|
||||||
|
this.violationObj.familyMemberId = val.row.familyMemberId;
|
||||||
this.violationDialog = true;
|
this.violationDialog = true;
|
||||||
},
|
},
|
||||||
|
add(val) {
|
||||||
|
var num = this.violationObj.options.map((item, i) => {
|
||||||
|
return this.violationObj.nowValue == item.id ? i : null;
|
||||||
|
});
|
||||||
|
let time = dateFormat(this.violationObj.time, "yyyy-MM-dd hh:mm:ss");
|
||||||
|
addRecord({
|
||||||
|
familyMemberId: this.violationObj.familyMemberId,
|
||||||
|
violationId: this.violationObj.nowValue,
|
||||||
|
date: time,
|
||||||
|
content: this.violationObj.options[num].content,
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
ElMessage({
|
||||||
|
showClose: true,
|
||||||
|
message: res.message,
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
this.getData();
|
||||||
|
this.violationDialog = false;
|
||||||
|
} else {
|
||||||
|
ElMessage({
|
||||||
|
showClose: true,
|
||||||
|
message: res.message,
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
listRecordFun(val) {
|
||||||
|
let time = this.inquire.time;
|
||||||
|
let startTime = "";
|
||||||
|
let endTime = "";
|
||||||
|
if (time && time.length > 0) {
|
||||||
|
startTime = dateFormat(this.inquire.time[0], "yyyy-MM-dd hh:mm:ss");
|
||||||
|
endTime = dateFormat(this.inquire.time[1], "yyyy-MM-dd hh:mm:ss");
|
||||||
|
}
|
||||||
|
listRecord({
|
||||||
|
familyMemberId: val.familyMemberId,
|
||||||
|
startTime: startTime,
|
||||||
|
endTime: endTime,
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
ElMessage({
|
||||||
|
showClose: true,
|
||||||
|
message: res.message,
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
this.dialogTableVisible = true;
|
||||||
|
} else {
|
||||||
|
ElMessage({
|
||||||
|
showClose: true,
|
||||||
|
message: res.message,
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
// 分页导航
|
// 分页导航
|
||||||
handleSizeChange() {
|
handleSizeChange() {
|
||||||
this.getData();
|
this.getData();
|
||||||
|
@@ -10,9 +10,9 @@
|
|||||||
border
|
border
|
||||||
style="width: 100%; margin-top: 25px"
|
style="width: 100%; margin-top: 25px"
|
||||||
>
|
>
|
||||||
<el-table-column prop="x" align="center" label="违规类型" />
|
<el-table-column prop="type" align="center" label="违规类型" />
|
||||||
<el-table-column prop="x" align="center" label="警告内容" />
|
<el-table-column prop="content" align="center" label="警告内容" />
|
||||||
<el-table-column align="center" label="操作" >
|
<el-table-column align="center" label="操作">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-button
|
<el-button
|
||||||
@click="ediClick(scope)"
|
@click="ediClick(scope)"
|
||||||
@@ -100,7 +100,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import {} from "@/api/nobleman/nobleman";
|
import { pageFun, updateFun, delFun, addFun } from "@/api/nobleman/nobleman";
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { dateFormat } from "@/utils/system-helper";
|
import { dateFormat } from "@/utils/system-helper";
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@@ -125,6 +125,7 @@ export default {
|
|||||||
addObj: {
|
addObj: {
|
||||||
violationType: "",
|
violationType: "",
|
||||||
violationContent: "",
|
violationContent: "",
|
||||||
|
id: null,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -134,10 +135,88 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
// 查询接口
|
// 查询接口
|
||||||
getData() {
|
getData() {
|
||||||
// this.loading = true;
|
this.loading = true;
|
||||||
// this.total = res.data.total;
|
pageFun({
|
||||||
// this.tableData = res.data.rows;
|
pageNum: this.currentPage,
|
||||||
// this.loading = false;
|
pageSize: this.pageSize,
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
this.total = res.data.total;
|
||||||
|
this.tableData = res.data.rows;
|
||||||
|
this.loading = false;
|
||||||
|
} else {
|
||||||
|
ElMessage({
|
||||||
|
showClose: true,
|
||||||
|
message: res.message,
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 新增
|
||||||
|
add() {
|
||||||
|
this.titleDialog = "新增违规类型";
|
||||||
|
this.addObj.violationType = "";
|
||||||
|
this.addObj.violationContent = "";
|
||||||
|
this.addObj.types = 1;
|
||||||
|
this.addDialog = true;
|
||||||
|
},
|
||||||
|
// 编辑
|
||||||
|
ediClick(val) {
|
||||||
|
this.titleDialog = "编辑违规类型";
|
||||||
|
this.addObj.violationType = val.row.type;
|
||||||
|
this.addObj.violationContent = val.row.content;
|
||||||
|
this.addObj.id = val.row.id;
|
||||||
|
this.addObj.types = 2;
|
||||||
|
this.addDialog = true;
|
||||||
|
},
|
||||||
|
// 二次确认新增&编辑
|
||||||
|
addDialogClick() {
|
||||||
|
if (this.addObj.types == 1) {
|
||||||
|
addFun({
|
||||||
|
type: this.addObj.violationType,
|
||||||
|
content: this.addObj.violationContent,
|
||||||
|
id: this.addObj.id,
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
ElMessage({
|
||||||
|
showClose: true,
|
||||||
|
message: res.message,
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
this.getData();
|
||||||
|
this.addDialog = false;
|
||||||
|
} else {
|
||||||
|
ElMessage({
|
||||||
|
showClose: true,
|
||||||
|
message: res.message,
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
updateFun({
|
||||||
|
type: this.addObj.violationType,
|
||||||
|
content: this.addObj.violationContent,
|
||||||
|
id: this.addObj.id,
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
ElMessage({
|
||||||
|
showClose: true,
|
||||||
|
message: res.message,
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
this.getData();
|
||||||
|
this.addDialog = false;
|
||||||
|
} else {
|
||||||
|
ElMessage({
|
||||||
|
showClose: true,
|
||||||
|
message: res.message,
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 删除按钮
|
// 删除按钮
|
||||||
del(val) {
|
del(val) {
|
||||||
@@ -146,26 +225,24 @@ export default {
|
|||||||
},
|
},
|
||||||
// 二次确认删除
|
// 二次确认删除
|
||||||
delClick() {
|
delClick() {
|
||||||
|
delFun({ id: this.delDate.id }).then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
ElMessage({
|
||||||
|
showClose: true,
|
||||||
|
message: res.message,
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
this.getData();
|
||||||
|
} else {
|
||||||
|
ElMessage({
|
||||||
|
showClose: true,
|
||||||
|
message: res.message,
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
this.delDialog = false;
|
this.delDialog = false;
|
||||||
},
|
},
|
||||||
// 新增
|
|
||||||
add() {
|
|
||||||
this.titleDialog = "新增违规类型";
|
|
||||||
this.addObj.violationType = "";
|
|
||||||
this.addObj.violationContent = "";
|
|
||||||
this.addDialog = true;
|
|
||||||
},
|
|
||||||
// 编辑
|
|
||||||
ediClick(val) {
|
|
||||||
this.titleDialog = "编辑违规类型";
|
|
||||||
this.addObj.violationType = "1";
|
|
||||||
this.addObj.violationContent = "1";
|
|
||||||
this.addDialog = true;
|
|
||||||
},
|
|
||||||
// 二次确认新增&编辑
|
|
||||||
addDialogClick() {
|
|
||||||
this.addDialog = false;
|
|
||||||
},
|
|
||||||
// 分页导航
|
// 分页导航
|
||||||
handleSizeChange() {
|
handleSizeChange() {
|
||||||
this.getData();
|
this.getData();
|
||||||
|
Reference in New Issue
Block a user