批量审核 驳回

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"
size="small"
plain
@click="">批量审核
@click="handleAuditing">批量审核
</el-button>
<el-button type="primary"
size="small"
plain
@click="">批量驳回
@click="handleReject">批量驳回
</el-button>
<el-button type="primary"
size="small"
@ -51,7 +51,7 @@
</el-button>
</template>
<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>
</template>
</avue-crud>
@ -59,7 +59,7 @@
</template>
<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 website from "@/config/website";
import {getToken} from "@/util/auth";
@ -578,6 +578,50 @@
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) {
if (["edit", "view"].includes(type)) {
getDetail(this.form.id).then(res => {

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

Loading…
Cancel
Save