Commit 91eaf102 by liuguorong93

删除功能

parent 5ca7c78a
......@@ -7,3 +7,7 @@ export const getPoDogJobList = params =>
// 工作犬信息(导出url)
export const exportPoDogJobUrl = `${baseUrl}/work/export`
// 工作犬信息(删除)
export const deletePoDogJob = params =>
postJson(`${baseUrl}/work/dogDelete`, params)
......@@ -218,7 +218,30 @@ export default [
title: '警用工作犬信息管理',
isOneMenu: false,
oneMenuName: 'poDogManage',
paixu: 2
paixu: 2,
routeNames: ['poDogJobManageEdit', 'poDogJobManageAdd'],
}
},
// 警用工作犬信息管理(编辑页)
{
path: 'poDogJobManageEdit',
name: 'poDogJobManageEdit',
component: () => import('@/views/poDogJobManage/components/poDogJobManageEdit.vue'),
meta: {
title: '警用工作犬信息管理-编辑',
// 编辑新增页面此字段务必设置为true
isEditPage: true
}
},
// 警用工作犬信息管理(新增页)
{
path: 'poDogJobManageAdd',
name: 'poDogJobManageAdd',
component: () => import('@/views/poDogJobManage/components/poDogJobManageEdit.vue'),
meta: {
title: '警用工作犬信息管理-新增',
// 编辑新增页面此字段务必设置为true
isEditPage: true
}
},
// 警用退役犬信息管理(二级菜单)
......
<template>
<div>132</div>
</template>
<script>
import moment from "moment";
export default {
name: "poDogJobManageEdit",
data() {
return {
detailInfo: {
xxdjryXm: "",
xxdjryGmsfhm: "",
xxdjdwGajgmc: "",
xxdjdwGajgjgdm: "",
djsj: "",
},
userInfoJson: {},
};
},
async mounted() {
let userInfo = window.sessionStorage.getItem("userInfo");
if (userInfo) this.userInfoJson = JSON.parse(userInfo);
// 判断是新增/编辑页面
this.routeName = this.$route.name || "";
if (this.routeName === "poDogJobManageEdit") {
// 编辑
let id = this.$route.query.id || "";
this.getDetail(id);
} else {
// 新增
this.detailInfo.xxdjryXm = this.userInfoJson.userName || "";
this.detailInfo.xxdjryGmsfhm = this.userInfoJson.identitycard || "";
this.detailInfo.xxdjdwGajgmc = this.userInfoJson.unitname || "";
this.detailInfo.xxdjdwGajgjgdm = this.userInfoJson.unitcode || "";
this.detailInfo.djsj = moment().format("YYYY-MM-DD HH:mm:ss");
}
},
methods: {
getDetail(id) {},
},
};
</script>
<style scoped lang="scss">
@import "../../../assets/styles/detailContent.scss";
.requiredClass {
color: #f56c6c;
}
.sxjqClass {
/deep/ .el-form-item__label {
width: 100%;
text-align: left;
}
/deep/ .el-form-item__label:before {
vertical-align: middle;
}
/deep/ .el-form-item__content {
position: relative;
}
.labelNameClass {
display: inline-block;
vertical-align: middle;
margin-right: 8px;
}
.yuandianClass {
display: inline-block;
width: 6px;
height: 6px;
border-radius: 50%;
background: #2c5de5;
vertical-align: middle;
margin-right: 3px;
}
.numClass {
display: inline-block;
color: #2c5de5;
font-size: 14px;
vertical-align: middle;
}
.itemSxjqClass {
width: 32%;
margin-right: 5%;
}
.itemJqxphClass {
width: 50%;
margin-right: 5%;
}
.itemJqxphClass2 {
width: 87%;
margin-right: 5%;
}
.conBtnClass {
display: inline-block;
width: 16px;
height: 16px;
border-radius: 50%;
border: 1px solid #2c5de5;
line-height: 12px;
text-align: center;
color: #2c5de5;
cursor: pointer;
position: absolute;
right: 0;
bottom: 8px;
}
}
</style>
\ No newline at end of file
......@@ -278,6 +278,7 @@
import {
getPoDogJobList,
exportPoDogJobUrl,
deletePoDogJob,
} from "@/api/menuDataApi/poDogJobManageApi.js";
import { getJsonDataApi } from "@/utils/getJsonData.js";
import { getCodeName, handleDownFile } from "@/utils/mk.js";
......@@ -407,9 +408,56 @@ export default {
this.currentPage = current;
this.getLists(current);
},
addData() {},
editData() {},
deleteData() {},
addData() {
this.$router.push({ name: "poDogJobManageAdd" });
},
editData(row) {
this.$router.push({
name: "poDogJobManageEdit",
query: {
id: row.id,
},
});
},
deleteData(row) {
this.$confirm(`此操作将永久删除该数据,是否继续?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
let params = {
id: row.id,
};
deletePoDogJob(params)
.then((res) => {
if (res.code === 200 && res.success) {
this.$message({
message: "删除成功",
type: "success",
duration: 1000,
});
this.getLists(1);
return;
}
this.$message({
message: res.message,
type: "warning",
duration: 3000,
});
})
.catch(() => {
this.$message({
message: "删除失败",
type: "warning",
duration: 3000,
});
});
})
.catch(() => {
this.$message("已取消删除");
});
},
importData() {
this.showImportBox = true;
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment