批量审核 驳回

main
weitingdong 12 months ago
parent 6760314c83
commit c4e2dc8f1f
  1. 20
      src/api/leger/equipmentledger.js
  2. 52
      src/views/leger/equipmentledger.vue
  3. 114
      src/views/leger/equipmentledgerDetail.vue

@ -48,3 +48,23 @@ export const update = (row) => {
}) })
} }
export const auditing = (ids) => {
return request({
url: '/api/equipmentledger/auditing',
method: 'post',
params: {
ids,
}
})
}
export const reject = (ids) => {
return request({
url: '/api/equipmentledger/reject',
method: 'post',
params: {
ids,
}
})
}

@ -37,12 +37,12 @@
<el-button type="primary" <el-button type="primary"
size="small" size="small"
plain plain
@click="">批量审核 @click="handleAuditing">批量审核
</el-button> </el-button>
<el-button type="primary" <el-button type="primary"
size="small" size="small"
plain plain
@click="">批量驳回 @click="handleReject">批量驳回
</el-button> </el-button>
<el-button type="primary" <el-button type="primary"
size="small" size="small"
@ -51,7 +51,7 @@
</el-button> </el-button>
</template> </template>
<template #menu="{row,index,size}"> <template #menu="{row,index,size}">
<el-button @click="handleDetailSearch(row,index)" type="primary">查看</el-button> <el-button @click="handleDetailSearch(row)" type="text">查看</el-button>
<el-button @click="rowDel(row)" type="text">删除</el-button> <el-button @click="rowDel(row)" type="text">删除</el-button>
</template> </template>
</avue-crud> </avue-crud>
@ -59,7 +59,7 @@
</template> </template>
<script> <script>
import {getList, getDetail, add, update, remove} from "@/api/leger/equipmentledger"; import {getList, getDetail, add, update, remove, reject, auditing} from "@/api/leger/equipmentledger";
import {mapGetters} from "vuex"; import {mapGetters} from "vuex";
import website from "@/config/website"; import website from "@/config/website";
import {getToken} from "@/util/auth"; import {getToken} from "@/util/auth";
@ -578,6 +578,50 @@
this.$refs.crud.toggleSelection(); this.$refs.crud.toggleSelection();
}); });
}, },
handleAuditing() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("是否将选择数据审核?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return auditing(this.ids);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
});
},
handleReject() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("是否将选择数据审核?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return reject(this.ids);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
});
},
beforeOpen(done, type) { beforeOpen(done, type) {
if (["edit", "view"].includes(type)) { if (["edit", "view"].includes(type)) {
getDetail(this.form.id).then(res => { getDetail(this.form.id).then(res => {

@ -42,31 +42,36 @@
@on-load="onLoad"> @on-load="onLoad">
</avue-crud> </avue-crud>
</span> </span>
<div> <div class="container">
<span > <span >
<el-button type="primary" <el-button type="primary"
size="small" size="large"
@click="handleFormSubmit" @click="handleFormSubmit"
v-if="addUpdateShowButton"> v-if="addUpdateShowButton">
确定</el-button> 确定</el-button>
<el-button size="small" <el-button type="text"
size="large"
@click="back" @click="back"
v-if="addUpdateShowButton"> v-if="addUpdateShowButton">
取消</el-button> 取消</el-button>
<el-button size="small" <el-button type="primary"
size="small"
@click="auditing" @click="auditing"
v-if="shouldShowButton"> v-if="shouldShowButton">
审核</el-button> 审核</el-button>
<el-button size="small" <el-button type="primary"
size="small"
@click="reject" @click="reject"
v-if="shouldShowButton"> v-if="shouldShowButton">
驳回</el-button> 驳回</el-button>
<el-button size="small" <el-button type="primary"
size="small"
@click="seachToUpdate" @click="seachToUpdate"
v-if="shouldShowButton"> v-if="shouldShowButton">
修改</el-button> 修改</el-button>
<el-button size="small" <el-button type="primary"
@click="back" size="small"
@click="del"
v-if="shouldShowButton"> v-if="shouldShowButton">
删除</el-button> 删除</el-button>
</span> </span>
@ -106,13 +111,6 @@
label: '基本信息', label: '基本信息',
prop: 'information', prop: 'information',
} }
// , {
// label: '',
// prop: 'parameters',
// }, {
// label: '',
// prop: 'document',
// }
] ]
}, },
tab1_form: {}, tab1_form: {},
@ -222,6 +220,12 @@
message: "请输入系统状态", message: "请输入系统状态",
trigger: "blur" trigger: "blur"
}], }],
type: "select",
dicUrl: "/api/daf-system/dict/dictionary?code=system_state",
props: {
label: "dictValue",
value: "dictKey"
},
span: 6 span: 6
}, },
{ {
@ -395,11 +399,6 @@
{ {
label: "安装单位", label: "安装单位",
prop: "installationUnit", prop: "installationUnit",
// rules: [{
// required: true,
// message: "",
// trigger: "blur"
// }],
span: 6 span: 6
}, },
{ {
@ -609,6 +608,12 @@
// //
Submit() { Submit() {
if(this.$route.query.frameMode=="add"){ if(this.$route.query.frameMode=="add"){
this.$confirm("是否新增所填数据?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.tab1_form.checkStatus="1"
add(this.tab1_form).then(()=>{ add(this.tab1_form).then(()=>{
this.$router.push({ this.$router.push({
path: "/leger/equipmentledger", path: "/leger/equipmentledger",
@ -625,12 +630,17 @@
message: "操作失败!" message: "操作失败!"
}); });
}); });
});
}else { }else {
update(this.tab1_form).then(()=>{ this.$confirm("是否修改所填数据?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
update(this.tab1_form).then(() => {
this.$router.push({ this.$router.push({
path: "/leger/equipmentledger", path: "/leger/equipmentledger",
query: { query: {},
},
}); });
this.$message({ this.$message({
type: "success", type: "success",
@ -642,10 +652,16 @@
message: "操作失败!" message: "操作失败!"
}); });
}); });
});
} }
}, },
back() { back() {
this.$router.push({ path: "/leger/equipmentledger"}); if(this.$route.query.frameMode=="add") {
this.$router.push({path: "/leger/equipmentledger"});
}else{
this.updateToSearch();
this.SearchDetail();
}
}, },
seachToUpdate () { seachToUpdate () {
this.shouldShowButton=false; this.shouldShowButton=false;
@ -653,6 +669,12 @@
this.readonlyForm=false; this.readonlyForm=false;
this.frame_class = null; this.frame_class = null;
}, },
updateToSearch () {
this.readonlyForm=true;
this.shouldShowButton=true;
this.addUpdateShowButton=false;
this.frame_class = 'frame_class1';
},
handleChange (column) { handleChange (column) {
this.type = column this.type = column
}, },
@ -753,7 +775,6 @@
}); });
}, },
SearchDetail() { SearchDetail() {
debugger
getDetail(this.$route.query.id).then(res => { getDetail(this.$route.query.id).then(res => {
console.log(res); console.log(res);
this.tab1_form = res.data.data; this.tab1_form = res.data.data;
@ -765,8 +786,8 @@
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning"
}).then(() => { }).then(() => {
this.tab1_form.checkStatus="1" this.tab1_form.checkStatus="2"
this.Submit(); this.submitRejectOrauditing();
}); });
}, },
reject() { reject() {
@ -775,8 +796,39 @@
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning"
}).then(() => { }).then(() => {
this.tab1_form.checkStatus="2" this.tab1_form.checkStatus="3"
this.Submit(); this.submitRejectOrauditing();
});
},
submitRejectOrauditing() {
update(this.tab1_form).then(() => {
this.$router.push({
path: "/leger/equipmentledger",
query: {},
});
this.$message({
type: "success",
message: "操作成功!"
});
}).catch((error) => {
this.$message({
type: "error",
message: "操作失败!"
});
});
},
del() {
remove(this.tab1_form.id()).then(() => {
this.$message({
type: "success",
message: "操作成功!"
});
}).catch((error) => {
this.$message({
type: "error",
message: "操作失败!"
});
}); });
}, },
headerClass(){ headerClass(){
@ -807,4 +859,8 @@
outline: none; outline: none;
pointer-events: none; pointer-events: none;
} }
.container {
display: flex;
justify-content: flex-end; /* 将子元素推到容器的末端 */
}
</style> </style>

Loading…
Cancel
Save