parent
2823bcf380
commit
e06616eee1
2 changed files with 593 additions and 0 deletions
@ -0,0 +1,87 @@ |
||||
import request from '@/router/axios'; |
||||
|
||||
export const getList = (current, size, params) => { |
||||
return request({ |
||||
url: '/api/release/productioninformation/list', |
||||
method: 'get', |
||||
params: { |
||||
...params, |
||||
current, |
||||
size, |
||||
} |
||||
}) |
||||
} |
||||
|
||||
export const getDetail = (id) => { |
||||
return request({ |
||||
url: '/api/release/productioninformation/detail', |
||||
method: 'get', |
||||
params: { |
||||
id |
||||
} |
||||
}) |
||||
} |
||||
|
||||
export const remove = (ids) => { |
||||
return request({ |
||||
url: '/api/release/productioninformation/remove', |
||||
method: 'post', |
||||
params: { |
||||
ids, |
||||
} |
||||
}) |
||||
} |
||||
|
||||
export const add = (row) => { |
||||
return request({ |
||||
url: '/api/release/productioninformation/submit', |
||||
method: 'post', |
||||
data: row |
||||
}) |
||||
} |
||||
|
||||
export const update = (row) => { |
||||
return request({ |
||||
url: '/api/release/productioninformation/update', |
||||
method: 'post', |
||||
data: row |
||||
}) |
||||
} |
||||
export const auditing = (ids) => { |
||||
return request({ |
||||
url: '/api/release/productioninformation/auditing', |
||||
method: 'post', |
||||
params: { |
||||
ids, |
||||
} |
||||
}) |
||||
} |
||||
|
||||
export const reject = (ids) => { |
||||
return request({ |
||||
url: '/api/release/productioninformation/reject', |
||||
method: 'post', |
||||
params: { |
||||
ids, |
||||
} |
||||
}) |
||||
} |
||||
export const release = (ids) => { |
||||
return request({ |
||||
url: '/api/release/productioninformation/release', |
||||
method: 'post', |
||||
params: { |
||||
ids, |
||||
} |
||||
}) |
||||
} |
||||
|
||||
export const stop = (ids) => { |
||||
return request({ |
||||
url: '/api/release/productioninformation/stop', |
||||
method: 'post', |
||||
params: { |
||||
ids, |
||||
} |
||||
}) |
||||
} |
@ -0,0 +1,506 @@ |
||||
<template> |
||||
<basic-container> |
||||
<avue-tabs :option="title"/> |
||||
<avue-crud :option="option" |
||||
:table-loading="loading" |
||||
:data="data" |
||||
:page="page" |
||||
:permission="permissionList" |
||||
:header-cell-class-name="headerClass" |
||||
:before-open="beforeOpen" |
||||
v-model="form" |
||||
ref="crud" |
||||
@row-update="rowUpdate" |
||||
@row-save="rowSave" |
||||
@row-del="rowDel" |
||||
@search-change="searchChange" |
||||
@search-reset="searchReset" |
||||
@selection-change="selectionChange" |
||||
@current-change="currentChange" |
||||
@size-change="sizeChange" |
||||
@on-load="onLoad"> |
||||
<template slot="menuLeft"> |
||||
<el-button type="primary" |
||||
size="small" |
||||
plain |
||||
v-if="permission.productioninformation_delete" |
||||
@click="handleDelete">删除 |
||||
</el-button> |
||||
</template> |
||||
<template slot="menuRight"> |
||||
<el-button type="primary" |
||||
size="small" |
||||
plain |
||||
@click="$refs.crud.rowAdd()">新增</el-button> |
||||
<el-button type="primary" |
||||
size="small" |
||||
plain |
||||
@click="handleRelease">发布 |
||||
</el-button> |
||||
<el-button type="primary" |
||||
size="small" |
||||
plain |
||||
@click="handleStop">停用 |
||||
</el-button> |
||||
<el-button type="primary" |
||||
size="small" |
||||
plain |
||||
@click="handleReject">批量驳回 |
||||
</el-button> |
||||
<el-button type="primary" |
||||
size="small" |
||||
plain |
||||
@click="handleAuditing">批量审核 |
||||
</el-button> |
||||
</template> |
||||
<template #menu="{row,index,size}"> |
||||
<el-button type="text" size="small" |
||||
@click="$refs.crud.rowEdit(row,index)">编辑</el-button> |
||||
<el-button type="text" size="small" |
||||
@click="$refs.crud.rowDel(row,index)">删除</el-button> |
||||
<el-button @click="auditing(row,index)" type="text" size="small" plain>审核</el-button> |
||||
<el-button @click="reject(row,index)" type="text" size="small" plain >驳回</el-button> |
||||
</template> |
||||
</avue-crud> |
||||
</basic-container> |
||||
</template> |
||||
|
||||
<script> |
||||
import {getList, getDetail, add, update, remove} from "@/api/release/productioninformation"; |
||||
import {mapGetters} from "vuex"; |
||||
import {auditing, reject ,release ,stop} from "@/api/release/productioninformation"; |
||||
|
||||
export default { |
||||
data() { |
||||
return { |
||||
form: {}, |
||||
query: {}, |
||||
loading: true, |
||||
page: { |
||||
pageSize: 10, |
||||
currentPage: 1, |
||||
total: 0 |
||||
}, |
||||
title: { |
||||
column: [{ |
||||
label: '基本信息', |
||||
} |
||||
] |
||||
}, |
||||
button: [ |
||||
{ |
||||
type: 'primary', |
||||
icon: 'el-icon-plus', |
||||
label: '新增', |
||||
size: 'mini', |
||||
plain: true, |
||||
event: 'add', // 事件方法名 |
||||
show: true // 是否显示按钮 |
||||
} |
||||
], |
||||
selectionList: [], |
||||
option: { |
||||
height: 'auto', |
||||
calcHeight: 210, |
||||
searchShow: true, |
||||
searchMenuSpan: 6, |
||||
tip: false, |
||||
border: true, |
||||
index: false, |
||||
viewBtn: true, |
||||
selection: true, |
||||
column: [ |
||||
{ |
||||
label: "主键", |
||||
prop: "id", |
||||
hide:true, |
||||
disabled: true, |
||||
display: false, |
||||
rules: [{ |
||||
required: true, |
||||
message: "请输入主键", |
||||
trigger: "blur" |
||||
}] |
||||
}, |
||||
{ |
||||
label: "消息编码", |
||||
prop: "messageEncoding", |
||||
disabled: true, |
||||
display: false, |
||||
rules: [{ |
||||
required: true, |
||||
message: "请输入消息编码", |
||||
trigger: "blur" |
||||
}] |
||||
}, |
||||
{ |
||||
label: "消息主题", |
||||
prop: "messageTopic", |
||||
span: 20, |
||||
rules: [{ |
||||
required: true, |
||||
message: "请输入消息主题", |
||||
trigger: "blur" |
||||
}] |
||||
}, |
||||
{ |
||||
label: "消息类型", |
||||
prop: "messageType", |
||||
span: 20, |
||||
rules: [{ |
||||
required: true, |
||||
message: "请输入消息类型", |
||||
trigger: "blur" |
||||
}] |
||||
}, |
||||
{ |
||||
label: "消息等级", |
||||
prop: "messageLevel", |
||||
span: 20, |
||||
rules: [{ |
||||
required: true, |
||||
message: "请输入消息等级", |
||||
trigger: "blur" |
||||
}] |
||||
}, |
||||
{ |
||||
label: "发布人", |
||||
prop: "publisher", |
||||
span: 20, |
||||
rules: [{ |
||||
required: true, |
||||
message: "请输入发布人", |
||||
trigger: "blur" |
||||
}] |
||||
}, |
||||
{ |
||||
label: "是否停用", |
||||
prop: "isDiscontinue", |
||||
span: 20, |
||||
type: "select", |
||||
dicUrl: "/api/daf-system/dict/dictionary?code=yes_no", |
||||
props: { |
||||
label: "dictValue", |
||||
value: "dictKey" |
||||
}, |
||||
rules: [{ |
||||
required: true, |
||||
message: "请输入是否停用", |
||||
trigger: "blur" |
||||
}] |
||||
}, |
||||
{ |
||||
label: "发布时间", |
||||
prop: "releaseTime", |
||||
span: 20, |
||||
type: "date", |
||||
format: 'yyyy/MM/dd', |
||||
valueFormat: "yyyyMMdd", |
||||
rules: [{ |
||||
required: true, |
||||
message: "请输入发布时间", |
||||
trigger: "blur" |
||||
}] |
||||
}, |
||||
{ |
||||
label: "审核状态", |
||||
prop: "checkstatus", |
||||
span: 20, |
||||
value:"1", |
||||
display: false, |
||||
dicUrl: "/api/daf-system/dict/dictionary?code=check_status", |
||||
props: { |
||||
label: "dictValue", |
||||
value: "dictKey" |
||||
}, |
||||
}, |
||||
{ |
||||
label: "消息内容", |
||||
prop: "messageContent", |
||||
type:"textarea", |
||||
span: 20, |
||||
rules: [{ |
||||
required: true, |
||||
message: "请输入消息内容", |
||||
trigger: "blur" |
||||
}], |
||||
maxlength: 1000, |
||||
}, |
||||
] |
||||
}, |
||||
data: [] |
||||
}; |
||||
}, |
||||
computed: { |
||||
...mapGetters(["permission"]), |
||||
permissionList() { |
||||
return { |
||||
addBtn: false, |
||||
viewBtn: false, |
||||
delBtn: false, |
||||
editBtn: false |
||||
}; |
||||
}, |
||||
ids() { |
||||
let ids = []; |
||||
this.selectionList.forEach(ele => { |
||||
ids.push(ele.id); |
||||
}); |
||||
return ids.join(","); |
||||
} |
||||
}, |
||||
|
||||
methods: { |
||||
rowSave(row, done, loading) { |
||||
add(row).then(() => { |
||||
done(); |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!" |
||||
}); |
||||
}, error => { |
||||
window.console.log(error); |
||||
loading(); |
||||
}); |
||||
}, |
||||
rowUpdate(row, index, done, loading) { |
||||
update(row).then(() => { |
||||
done(); |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!" |
||||
}); |
||||
}, error => { |
||||
window.console.log(error); |
||||
loading(); |
||||
}); |
||||
}, |
||||
rowDel(row) { |
||||
this.$confirm("确定将选择数据删除?", { |
||||
confirmButtonText: "确定", |
||||
cancelButtonText: "取消", |
||||
type: "warning" |
||||
}) |
||||
.then(() => { |
||||
return remove(row.id); |
||||
}) |
||||
.then(() => { |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!" |
||||
}); |
||||
}); |
||||
}, |
||||
handleDelete() { |
||||
if (this.selectionList.length === 0) { |
||||
this.$message.warning("请选择至少一条数据"); |
||||
return; |
||||
} |
||||
this.$confirm("确定将选择数据删除?", { |
||||
confirmButtonText: "确定", |
||||
cancelButtonText: "取消", |
||||
type: "warning" |
||||
}) |
||||
.then(() => { |
||||
return remove(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 => { |
||||
this.form = res.data.data; |
||||
}); |
||||
} |
||||
done(); |
||||
}, |
||||
searchReset() { |
||||
this.query = {}; |
||||
this.onLoad(this.page); |
||||
}, |
||||
searchChange(params, done) { |
||||
this.query = params; |
||||
this.page.currentPage = 1; |
||||
this.onLoad(this.page, params); |
||||
done(); |
||||
}, |
||||
selectionChange(list) { |
||||
this.selectionList = list; |
||||
}, |
||||
selectionClear() { |
||||
this.selectionList = []; |
||||
this.$refs.crud.toggleSelection(); |
||||
}, |
||||
currentChange(currentPage){ |
||||
this.page.currentPage = currentPage; |
||||
}, |
||||
sizeChange(pageSize){ |
||||
this.page.pageSize = pageSize; |
||||
}, |
||||
onLoad(page, params = {}) { |
||||
this.loading = true; |
||||
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
||||
const data = res.data.data; |
||||
this.page.total = data.total; |
||||
this.data = data.records; |
||||
this.loading = false; |
||||
this.selectionClear(); |
||||
}); |
||||
}, |
||||
headerClass(){ |
||||
return 'head-style' |
||||
}, |
||||
//审核 |
||||
auditing(row) { |
||||
this.$confirm("是否将数据审核?", "提示", { |
||||
confirmButtonText: "确定", |
||||
cancelButtonText: "取消", |
||||
type: "warning" |
||||
}).then(() => { |
||||
this.form.checkstatus="2"; |
||||
this.form.id = row.id; |
||||
this.submitRejectOrauditing(); |
||||
}); |
||||
}, |
||||
//驳回 |
||||
reject(row) { |
||||
this.$confirm("是否将数据驳回?", "提示", { |
||||
confirmButtonText: "确定", |
||||
cancelButtonText: "取消", |
||||
type: "warning" |
||||
}).then(() => { |
||||
this.form.checkstatus="3" |
||||
this.form.id = row.id; |
||||
this.submitRejectOrauditing(); |
||||
}); |
||||
}, |
||||
submitRejectOrauditing() { |
||||
update(this.form).then(() => { |
||||
this.$router.push({ |
||||
path: "/release/productioninformation", |
||||
query: {}, |
||||
}); |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!" |
||||
}); |
||||
}).catch((error) => { |
||||
this.$message({ |
||||
type: "error", |
||||
message: "操作失败!" |
||||
}); |
||||
}); |
||||
}, |
||||
//批量审核 |
||||
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(); |
||||
}); |
||||
}, |
||||
//发布 |
||||
handleRelease() { |
||||
if (this.selectionList.length === 0) { |
||||
this.$message.warning("请选择至少一条数据"); |
||||
return; |
||||
} |
||||
this.$confirm("是否将选择数据发布?", { |
||||
confirmButtonText: "确定", |
||||
cancelButtonText: "取消", |
||||
type: "warning" |
||||
}) |
||||
.then(() => { |
||||
return release(this.ids); |
||||
}) |
||||
.then(() => { |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!" |
||||
}); |
||||
this.$refs.crud.toggleSelection(); |
||||
}); |
||||
}, |
||||
//停用 |
||||
handleStop() { |
||||
if (this.selectionList.length === 0) { |
||||
this.$message.warning("请选择至少一条数据"); |
||||
return; |
||||
} |
||||
this.$confirm("是否将选择数据停用?", { |
||||
confirmButtonText: "确定", |
||||
cancelButtonText: "取消", |
||||
type: "warning" |
||||
}) |
||||
.then(() => { |
||||
return stop(this.ids); |
||||
}) |
||||
.then(() => { |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!" |
||||
}); |
||||
this.$refs.crud.toggleSelection(); |
||||
}); |
||||
}, |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style> |
||||
.head-style{ |
||||
background-color: #1e9fff !important; |
||||
color: #FFFFFF !important; |
||||
} |
||||
</style> |
Loading…
Reference in new issue