提交 89a6f7ae authored 作者: 龙菲's avatar 龙菲

对接审核管理的查看详情、审核接口;修复角色管理模块缺陷

上级 b24f538e
......@@ -9,15 +9,15 @@ export function getFlowListPagePer(data) {
})
}
// 通过流程id查询流程详情
export function getFlowDetailById(params) {
export function getFlowDetailById(id) {
return request({
url: '/bizFlow/detailById',
url: '/bizFlow/detailById?id=' + id,
method: 'get',
params
})
}
// 查询流程关联的文物详情(手动添加的文物详情)
// 查询流程关联的文物详情(手动添加的文物详情),用于驳回时重提
export function getFlowCulturalRelicDetail(params) {
return request({
url: '/bizFlow/flowCulturalRelicDetail',
......@@ -27,7 +27,7 @@ export function getFlowCulturalRelicDetail(params) {
}
// 查询流程关联的展览详情(手动添加的展览详情)
// 查询流程关联的展览详情(手动添加的展览详情),用于驳回时重提
export function getFlowExhibitionDetail(params) {
return request({
url: '/bizFlow/flowExhibitionDetail',
......@@ -36,7 +36,7 @@ export function getFlowExhibitionDetail(params) {
})
}
// 带权限分页查询流程关联的文物信息
// 带权限分页查询流程关联的文物信息,用于需要切换文物的分页时
export function getListFlowCulturalRelicByPage(data) {
return request({
url: '/bizFlow/listFlowCulturalRelicByPage',
......@@ -53,4 +53,14 @@ export function getListByPagePer(data) {
method: 'post',
data
})
}
\ No newline at end of file
}
// 审批
export function putFlowCheck(data) {
return request({
url: '/bizFlow/check',
method: 'put',
data
})
}
......@@ -6,7 +6,7 @@
</template>
<script>
import { mapGetters } from "vuex";
import { mapGetters, mapActions } from "vuex";
export default {
name: "DictText",
props: {
......@@ -43,9 +43,12 @@ export default {
},
async created() {
const { name, dictValue } = this;
await this.$store.dispatch("dict/getDictList", [name]);
await this.getDictList([name]);
this.dictText = this.dicts[name][dictValue];
},
methods: {
...mapActions("dict", ["getDictList"]),
},
};
</script>
<style scoped lang="scss"></style>
......@@ -165,9 +165,6 @@ export default {
showThemeColor: false,
};
},
mounted() {
console.log(this.themeType);
},
methods: {
handleEnterTabItem(item) {
if (item.name == "展览展示") {
......
......@@ -44,19 +44,28 @@
export default {
name: "TableOperation",
props: {
// 操作的按钮配置
operations: {
type: Array,
},
// 点击的行对应的数据
rawData: {
type: Object,
},
// 删除时提示的标题
deleteTitle: {
type: String,
},
// 是否禁用
disabled: {
type: Boolean,
default: false,
},
// 是否隐藏
hidden: {
type: Boolean,
default: false,
},
},
data() {
return {
......@@ -70,6 +79,7 @@ export default {
editPassword: "el-icon-lock",
approval: "el-icon-s-check",
view3D: "three",
reSubmit: "el-icon-upload2",
},
};
},
......
// 关于审核的常量
export const APPROVAL_STATUS = {
PENDING_APPROVAL: {
// 关于审核的常量和字典
export const checkStatus = [
{
value: 0,
desc: '待审核'
label: '审核中',
icon: 'el-icon-edit-outline',
tagType: 'primary',
stepType: '',
},
PASSED: {
{
value: 1,
desc: '已通过'
label: '已通过',
icon: "el-icon-check",
tagType: 'success',
stepType: 'success'
},
FAILED: {
{
value: -2,
label: '已驳回',
icon: 'el-icon-close',
tagType: 'danger',
stepType: 'error'
},
{
value: -1,
desc: '未通过'
label: '待提交',
type: 'wait',
tagType: 'warning',
stepType: 'el-icon-warning'
}
}
\ No newline at end of file
]
// 关于审核的常量
export const APPROVAL_STATUS = {
PENDING_APPROVAL: {
value: 0,
desc: '待审核'
},
PASSED: {
value: 1,
desc: '已通过'
},
FAILED: {
value: -1,
desc: '未通过'
}
}
\ No newline at end of file
// 关于展览的常量
// 关于展览的一些常量和字典
export const THEME_TYPE = {
NORMAL_STYLE: {
......@@ -14,4 +14,31 @@ export const THEME_TYPE = {
value: '3',
desc: '红色文化'
}
}
\ No newline at end of file
}
// export const themeTypeCode = {
// 1: '默认主题',
// 2: '中国风',
// 3: '红色主题'
// }
// 关于审核的常量和字典
export const themeType = [
{
value: 1,
label: '默认主题',
},
{
value: 2,
label: '中国风',
},
{
value: 3,
label: '红色主题',
}
]
export const SOURCE_TYPE = {
展览: 'biz_exhibition',
文物: 'biz_cultural_relic'
}
\ No newline at end of file
// 本文件提供前端定义的字典值的翻译功能
// 增加时先引入,后在allList中添加
import { checkStatus } from "./approval"
import { themeType } from "./display"
const constantsTool = {
allList: { checkStatus, themeType },
// 获取label
getLabelByValue(dictName, value) {
const list = constantsTool.allList[dictName]
if (!list) {
return ''
}
const item = list.find((item) => {
return item.value == value
})
if (!item) {
return ''
}
return item.label
},
// 获取字典列表
getList(dictName) {
return constantsTool.allList[dictName]
},
// 获取icon
getIconByValue(dictName, value) {
const list = constantsTool.allList[dictName]
if (!list) {
return ''
}
const item = list.find((item) => {
return item.value == value
})
if (!item) {
return ''
}
return item.icon
},
// 获取Type,用于展示tag状态 等
getTagTypeByValue(dictName, value) {
const list = constantsTool.allList[dictName]
if (!list) {
return ''
}
const item = list.find((item) => {
return item.value == value
})
if (!item) {
return ''
}
return item.tagType
},
// 获取Type,用于展示tag状态 等
getStepTypeByValue(dictName, value) {
const list = constantsTool.allList[dictName]
if (!list) {
return ''
}
const item = list.find((item) => {
return item.value == value
})
if (!item) {
return ''
}
return item.stepType
},
}
export default constantsTool
\ No newline at end of file
......@@ -112,7 +112,10 @@
@click.native="handleSubmitPwd"
>保存</el-button
>
<el-button type="primary" size="mini" @click.native="handleCancelChangePwd"
<el-button
type="primary"
size="mini"
@click.native="handleCancelChangePwd"
>取消</el-button
>
</el-form-item>
......@@ -218,7 +221,7 @@ export default {
},
async logout() {
let res = await this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
this.$router.push(`/login`);
},
handleShowUserInfo() {
......
......@@ -5,7 +5,9 @@ import {
} from '@/utils/index'
import { file } from '@/utils/file'
import * as echarts from 'echarts';
import constantsTool from '@/contants/index'
Vue.prototype.$getFullUrl = getFullUrl //获取文件的完整链接
Vue.prototype.$echarts = echarts //Echarts
Vue.prototype.$file = file //文件操作
\ No newline at end of file
Vue.prototype.$file = file //文件操作
Vue.prototype.$constantsTool = constantsTool //前端定义的常量操作
\ No newline at end of file
......@@ -942,111 +942,6 @@ export default {
.catch((err) => {
this.submitLoading = false;
});
// if (!that.dialogForm.exhibitionId) {
// this.loadingText = "正在处理展览数据...请耐心等待";
// const params = {
// ...this.dialogForm,
// exhibitionUnits: unitData,
// };
// params.literature = this.literatureIdArr.join(",");
// params.status = this.dialogForm.status ? 1 : 0;
// params.crIds = this.crIds.join(",");
// params.bvIds = this.vrIds.join(",");
// params.displayCharacter = 1; //传布展
// params.submitFlag = submitFlag;
// addDisplay(params)
// .then((res) => {
// if (res.code == 0) {
// setTimeout(() => {
// this.$emit("refresh");
// this.reload();
// this.submitLoading = false;
// this.$message.success("新增展览成功!");
// }, 1000);
// }
// })
// .catch((err) => {
// this.submitLoading = false;
// });
// } else {
// this.loadingText = "正在处理展览数据...请耐心等待";
// const {
// exhibitionId,
// title,
// type,
// keyword,
// intro,
// themeType,
// remark,
// faceImage,
// faceImageUrl,
// images,
// audios,
// videos,
// regionCode,
// deptId,
// displayCharacter,
// } = this.dialogForm;
// let literature = this.literatureIdArr.join(",");
// let crIds = this.crIds.join(",");
// let bvIds = this.vrIds.join(",");
// let status = this.dialogForm.status ? 1 : 0;
// // return;
// const params = {
// exhibitionId,
// title,
// type,
// keyword,
// intro,
// themeType,
// remark,
// audios,
// deptId,
// faceImage,
// faceImageUrl,
// images,
// regionCode,
// videos,
// status,
// literature,
// crIds,
// bvIds,
// displayCharacter,
// exhibitionUnits: unitData,
// };
// // 处理馆藏单位
// if (params.deptId instanceof Array) {
// params.deptId = params.deptId[params.deptId.length - 1];
// }
// if (deleteFileArr.length > 0) {
// await deleteFiles(deleteFileArr);
// }
// params.submitFlag = submitFlag;
// editDisplay(params)
// .then(async (res) => {
// let deleteRes;
// // console.log(res);
// // return
// if (res.code == 0) {
// this.$emit("refresh");
// this.reload();
// setTimeout(() => {
// this.loadingText = "上传完毕";
// this.submitLoading = false;
// this.$message.success("修改成功!");
// }, 1000);
// }
// })
// .catch((err) => {
// console.log("err", err);
// this.submitLoading = false;
// });
// }
}
});
},
......
......@@ -4,6 +4,7 @@
top="3vh"
:before-close="handleClose"
lock-scroll
width="65vw"
>
<div class="title" slot="title">
<div class="divider"></div>
......@@ -18,17 +19,24 @@
:name="item"
>
<ApprovalInfo
:info="aprrovalInfo"
:info="approvalInfo"
:flowId="detail.id"
:isShowApprovalForm="prviewType == 'approval'"
v-if="item == '流程详情'"
/>
<CulturalRelicBaseInfo
:info="culturalRelicBaseInfo"
:info="culturalRelicDetailVo"
v-if="item == '文物基本信息'"
/>
<CulturalRelicTable :crList="crList" v-if="item == '文物列表'" />
<DisplayBaseInfo :info="displayInfo" v-if="item == '展览基本信息'" />
<DisplayRender :info="displayInfo" v-if="item == '效果预览'" />
<CulturalRelicTable
:crList="culturalRelicPageVo"
v-if="item == '文物列表'"
/>
<DisplayBaseInfo
:info="exhibitionDetailVo"
v-if="item == '展览基本信息'"
/>
<DisplayRender :info="exhibitionDetailVo" v-if="item == '效果预览'" />
</el-tab-pane>
</el-tabs>
</div>
......@@ -58,7 +66,7 @@ export default {
type: String,
default: "view",
},
aprrovalInfo: {
detail: {
type: Object,
default: () => ({}),
},
......@@ -67,13 +75,13 @@ export default {
...mapGetters(["dicts"]),
tabs() {
const tabs = ["流程详情"];
const { sourceType, addWay } = this.aprrovalInfo;
const { sourceType, addWay } = this.detail;
switch (sourceType) {
case "展览":
case "展览展示":
tabs.push("展览基本信息", "效果预览");
break;
case "文物":
if (addWay == "单个") {
if (addWay == "手动添加") {
tabs.push("文物基本信息");
} else {
tabs.push("文物列表");
......@@ -82,17 +90,89 @@ export default {
}
return tabs;
},
approvalInfo() {
if (!this.detail) {
return {};
}
const {
title,
addWay,
sourceType,
createTime,
deptName,
checkStatus,
remark,
createName,
checkDetailList,
culturalRelicDetailVo,
culturalRelicPageVo,
exhibitionDetailVo,
} = this.detail;
const approvalInfo = {
title,
addWay,
sourceType,
createTime,
deptName,
checkStatus,
remark,
createName,
checkDetailList,
};
return approvalInfo;
},
culturalRelicDetailVo() {
if (!this.detail) {
return {};
}
const { culturalRelicDetailVo } = this.detail;
return culturalRelicDetailVo;
},
culturalRelicPageVo() {
if (!this.detail) {
return {};
}
const { culturalRelicPageVo } = this.detail;
return culturalRelicPageVo;
},
culturalRelicPageVo() {
if (!this.detail) {
return {};
}
const { culturalRelicPageVo } = this.detail;
return culturalRelicPageVo;
},
exhibitionDetailVo() {
if (!this.detail) {
return {};
}
const { exhibitionDetailVo } = this.detail;
return exhibitionDetailVo;
},
},
data() {
return {
visible: false,
activeName: "流程详情",
culturalRelicBaseInfo: cr, //单个文物的信息
crList,
displayInfo: display,
// approvalInfo: {}, //传给ApprovalInfo组件的
// culturalRelicDetailVo: {}, //传给CulturalRelicBaseInfo组件的
// culturalRelicPageVo: {}, //传给CulturalRelicTable组件的
// exhibitionDetailVo: {}, //传给DisplayBaseInfo和DisplayRender组件的
};
},
created() {
// this.init();
},
methods: {
init() {
// this.culturalRelicDetailVo = culturalRelicPageVo;
// this.culturalRelicPageVo = culturalRelicPageVo;
// this.exhibitionDetailVo = exhibitionDetailVo;
},
handleClose(done) {
this.visible = false;
this.activeName = "流程详情";
......
......@@ -31,22 +31,39 @@
<el-form-item>
<el-button
size="mini"
style="margin:0; width: 100%"
style="margin: 0 10px 0; width: calc((100% - 20px) / 2)"
type="primary"
icon="el-icon-check"
@click.native="handleCheck"
>确定</el-button
>
<el-button
size="mini"
style="margin: 0; width: calc((100% - 20px) / 2)"
type="primary"
icon="el-icon-close"
@click.native="handleCancel"
plain
>取消</el-button
>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { putFlowCheck } from "@/api/approval";
export default {
props: {
// 流程id
flowId: {
type: String,
default: "",
},
},
data() {
return {
checkStatus: 1,
checkStatus: 1, //1同意 -2驳回
dialogForm: {
remark: "", //驳回意见
},
......@@ -62,48 +79,33 @@ export default {
};
},
methods: {
async handleCheck() {
handleCheck() {
const { checkStatus } = this;
if (checkStatus == -2) {
this.$refs.form.validate(async (valid) => {
if (valid) {
this.dialogLoading = true;
const params = {
sourceId: this.displayDetail.exhibitionId,
checkStatus,
remark: this.dialogForm.remark,
sourceType: "biz_exhibition",
sourceName: this.displayDetail.title,
};
let res = await postCheck(params);
if (res.code == 0) {
this.$message.success("操作成功!");
this.handleClose();
this.$emit("refresh");
this.$refs.form.resetFields();
}
this.dialogLoading = false;
this.popoverVisible = false;
const { remark } = this.dialogForm;
this.submit(checkStatus, remark);
}
});
} else {
this.dialogLoading = true;
const params = {
sourceId: this.displayDetail.exhibitionId,
checkStatus,
remark: this.dialogForm.remark,
sourceType: "biz_exhibition",
sourceName: this.displayDetail.title,
};
let res = await postCheck(params);
if (res.code == 0) {
this.$message.success("操作成功!");
this.handleClose();
this.$emit("refresh");
this.$refs.form.resetFields();
}
this.dialogLoading = false;
this.popoverVisible = false;
this.submit(checkStatus);
}
},
async submit(checkStatus, remark) {
const params = {
checkStatus,
remark,
id: this.flowId,
};
if (!remark) {
params.remark = "";
}
let res = await postCheck(params);
if (res.code == 0) {
this.$message.success("操作成功!");
this.$refs.form.resetFields();
}
},
},
......
......@@ -7,37 +7,57 @@
:label="item.label"
v-for="(item, index) in approvleTableTitle"
:key="index"
>{{ info[item.prop] }}</el-descriptions-item
>
<span v-if="item.prop === 'checkStatus'">
<el-tag
size="mini"
:type="
$constantsTool.getTagTypeByValue('checkStatus', info[item.prop])
"
>
{{
$constantsTool.getLabelByValue("checkStatus", info[item.prop])
}}
</el-tag>
</span>
<span v-else>{{ info[item.prop] }}</span>
</el-descriptions-item>
</el-descriptions>
</el-card>
<el-card shadow="hover" class="card">
<h3>详细流程节点</h3>
<el-steps :active="historyChecks.length">
<el-steps
:active="info.checkDetailList.length"
align-center
v-if="info.checkDetailList.length > 0"
>
<el-step
v-for="(item, index) in historyChecks"
:title="getStepTitle(item)"
v-for="(item, index) in info.checkDetailList"
:title="item.statusName"
:description="item.remark"
:status="
$constantsTool.getStepTypeByValue('checkStatus', item.status)
"
:key="index"
:icon="getStepIcon(item)"
:icon="$constantsTool.getIconByValue('checkStatus', item.status)"
>
<div slot="description">
<div class="name">{{ item.createName }}</div>
<div class="name">{{ item.optUserName }}</div>
<div class="time">{{ item.createTime }}</div>
<div class="desc">{{ item.remark }}</div>
</div>
</el-step>
</el-steps>
<span v-else></span>
</el-card>
<el-card v-if="isShowApprovalForm">
<h3>请审批</h3>
<ApprovalForm />
<h3>请审批</h3>
<ApprovalForm :flowId="flowId" />
</el-card>
</div>
</template>
<script>
import { approvleTableTitle } from "../../config";
import { historyChecks } from "../../mock";
import ApprovalForm from "./ApprovalForm.vue";
export default {
name: "AprrovalInfo",
......@@ -50,6 +70,10 @@ export default {
type: Object,
default: () => ({}),
},
flowId: {
type: String,
default: "",
},
// 是否展示审核的表单
isShowApprovalForm: {
type: Boolean,
......@@ -69,30 +93,25 @@ export default {
}
};
},
getStepIcon(item) {
return (item) => {
switch (item.checkStatus) {
case 0:
return "el-icon-s-promotion";
case 1:
return "el-icon-s-claim";
case -2:
return "el-icon-circle-close";
}
};
},
},
data() {
return {
approvleTableTitle,
historyChecks, //mock历史记录,后期通过后端接口返
};
},
mounted() {
console.log(this.info);
},
};
</script>
<style lang="scss" scoped>
.card {
margin-bottom: 20px;
.name {
}
.status {
}
}
</style>
......@@ -8,15 +8,18 @@
v-for="(item, index) in crTabletitle"
:key="index"
>
<el-image
class="image"
v-if="item.prop == 'faceImagePressUrl'"
:src="info['faceImagePressUrl']"
fit="contain"
:preview-src-list="[info['faceImageUrl']]"
>
</el-image>
<div v-else-if="item.prop == 'imagesVo' && info.imagesVo.length > 0">
<div v-if="item.prop == 'faceImagePressUrl'">
<el-image
v-if="info['faceImagePressUrl']"
class="image"
:src="info['faceImagePressUrl']"
fit="contain"
:preview-src-list="[info['faceImageUrl']]"
>
</el-image>
<span v-else></span>
</div>
<div v-else-if="item.prop == 'imagesVo'">
<el-image
v-for="(v, i) in info['imagesVo']"
:key="i"
......@@ -26,6 +29,7 @@
:preview-src-list="imgsList"
>
</el-image>
<span v-if="info['imagesVo'].length == 0"></span>
</div>
<div v-else-if="item.prop == 'videosVo'">
<VideoPlayer
......@@ -34,6 +38,7 @@
:key="i"
:src="v.url"
/>
<span v-if="info['videosVo'].length == 0"></span>
</div>
<div v-else-if="item.prop == 'audiosVo'">
<AudioPlayer
......@@ -42,9 +47,15 @@
:url="v.url"
ref="AudioPlayer"
/>
<span v-if="info['audiosVo'].length == 0"></span>
</div>
<div v-else-if="item.prop == 'literatureVo'">
<el-table stripe border :data="info['literatureVo']">
<el-table
stripe
border
:data="info['literatureVo']"
v-if="info['literatureVo'].length > 0"
>
<el-table-column prop="name" label="名称"></el-table-column>
<el-table-column prop="authors" label="作者"></el-table-column>
<el-table-column prop="source" label="来源"></el-table-column>
......@@ -54,6 +65,7 @@
</template>
</el-table-column>
</el-table>
<span v-if="info['literatureVo'].length == 0"></span>
</div>
<div v-else-if="item.prop === 'intro'" v-html="info['intro']"></div>
<span v-else>{{ info[item.prop] || "无" }}</span>
......
......@@ -8,14 +8,38 @@
v-for="(item, index) in displayTabletitle"
:key="index"
>
<el-image
class="image"
v-if="item.prop == 'faceImagePressUrl'"
:src="info['faceImagePressUrl']"
fit="contain"
:preview-src-list="[info['faceImageUrl']]"
>
</el-image>
<div v-if="item.prop == 'intro'">
<span v-if="info['intro']">{{ info["intro"] }}</span>
<span v-else></span>
</div>
<!-- 展览类型 -->
<div v-else-if="item.prop === 'type'">
<DictText
name="displayType"
:dictValue="info['type']"
v-if="info['type']"
/>
<span v-else></span>
</div>
<!-- 模板主题 -->
<div v-else-if="item.prop == 'themeType'">
<span v-if="info['themeType']">{{
$constantsTool.getLabelByValue("themeType", info["themeType"])
}}</span>
<span v-else></span>
</div>
<div v-else-if="item.prop == 'faceImagePressUrl'">
<el-image
v-if="info['faceImagePressUrl']"
class="image"
:src="info['faceImagePressUrl']"
fit="contain"
:preview-src-list="[info['faceImageUrl']]"
>
</el-image>
<span v-else></span>
</div>
<div v-else-if="item.prop == 'imagesVo'">
<div v-if="info['imagesVo'].length > 0">
<el-image
......@@ -28,7 +52,7 @@
>
</el-image>
</div>
<span v-else>暂无音频</span>
<span v-else></span>
</div>
<div v-else-if="item.prop == 'videosVo'">
<div v-if="info['videosVo'].length > 0">
......@@ -39,7 +63,7 @@
:src="v.url"
/>
</div>
<span v-else>暂无音频</span>
<span v-else></span>
</div>
<div v-else-if="item.prop == 'audiosVo'">
<div v-if="info['audiosVo'].length > 0">
......@@ -50,7 +74,7 @@
ref="AudioPlayer"
/>
</div>
<span v-else>暂无音频</span>
<span v-else></span>
</div>
<div v-else-if="item.prop == 'literatureVo'">
<div v-if="info['literatureVo'].length > 0">
......@@ -71,9 +95,7 @@
v-else-if="item.prop === 'intro'"
:richText="info['intro']"
></RichTextShow>
<div v-else-if="item.prop === 'type'">
<DictText name="displayType" :dictValue="info['type']" />
</div>
<span v-else>{{ info[item.prop] || "无" }}</span>
</el-descriptions-item>
</el-descriptions>
......
// 展览的展示字段
export const displayTabletitle = [{
prop: "title",
label: "标题",
......@@ -93,34 +94,40 @@ export const operates = {
columnAlign: "center",
}
// export const approvalOperations = [
// {
// type: 'approval',
// title: '审批'
// }
// ]
export const viewButton = {
type: 'view',
title: '查看详情'
}
export const approvalButton = {
type: 'approval',
title: '审批'
}
// export const viewOperations = [{
// type: 'view',
// title: '查看详情'
// }
// ]
export const reSubmitButtton = {
type: 'reSubmit',
title: '重新上传'
}
export const operations = [
{
type: 'view',
title: '查看详情'
},
{
type: 'approval',
title: '审批'
}
]
// export const operations = [
// {
// type: 'view',
// title: '查看详情'
// },
// {
// type: 'approval',
// title: '审批'
// },
// {
// type: 'reSubmit',
// title: '重新上传'
// }
// ]
// 文物的展示字段
export const crTabletitle = [{
prop: "name",
label: "名称",
......@@ -149,11 +156,11 @@ export const crTabletitle = [{
columnAlign: 'center',
isCulturalRelicType: true
},
{
prop: "createId",
label: "创建人",
columnAlign: 'center',
},
// {
// prop: "createId",
// label: "创建人",
// columnAlign: 'center',
// },
{
prop: "createTime",
label: "创建时间",
......@@ -265,6 +272,8 @@ export const importOperations = [{
title: '删除记录及文物'
},]
// 审批列表的展示字段
export const approvleTableTitle = [
{
prop: "title",
......@@ -290,10 +299,9 @@ export const approvleTableTitle = [
prop: "checkStatus",
label: "审核状态",
columnAlign: 'center',
isStatus: true
},
{
prop: "createUser",
prop: "createName",
label: "创建人",
columnAlign: 'center',
},
......
......@@ -9,17 +9,35 @@
:operates="operates"
v-loading="loading"
>
<template v-slot:status="data">
<el-tag type="primary" v-if="data.scope.status == 0"> 待审核 </el-tag>
<el-tag type="success" v-if="data.scope.status == 1"> 已通过 </el-tag>
<el-tag type="danger" v-if="data.scope.status == -2"> 已驳回 </el-tag>
<template v-slot:checkStatus="data">
<el-tag type="primary" v-if="data.scope.checkStatus == 0">
{{
$constantsTool.getLabelByValue(
"checkStatus",
data.scope.checkStatus
)
}}
</el-tag>
<el-tag type="success" v-if="data.scope.checkStatus == 1">
{{
$constantsTool.getLabelByValue(
"checkStatus",
data.scope.checkStatus
)
}}
</el-tag>
<el-tag type="danger" v-if="data.scope.checkStatus == -2">
{{
$constantsTool.getLabelByValue(
"checkStatus",
data.scope.checkStatus
)
}}
</el-tag>
</template>
<!-- <template v-slot:displayType="data">
{{ dicts.displayType[data.scope.type] }}
</template> -->
<template v-slot:operates="scope">
<TableOperation
:operations="operations"
:operations="getOperation(scope.scope.row)"
:rawData="scope.scope.row"
@handleOperation="handleOperation"
>
......@@ -40,7 +58,7 @@
</el-pagination>
<PreviewDialog
ref="PreviewDialog"
:aprrovalInfo="aprrovalInfo"
:detail="aprrovalDetail"
:prviewType="prviewType"
:dicts="dicts"
@handleClose="handleClosePreviewDialog"
......@@ -51,10 +69,16 @@
<script>
import PreviewDialog from "./components/PreviewDialog.vue";
import { approvleTableTitle, operates, operations } from "./config";
import { getFlowListPagePer } from "@/api/approval";
import {
approvleTableTitle,
operates,
viewButton,
approvalButton,
reSubmitButtton,
} from "./config";
import { getFlowListPagePer, getFlowDetailById } from "@/api/approval";
import { mapGetters } from "vuex";
import { approvalData } from "./mock";
import { operations } from "../boutique/config";
export default {
components: {
PreviewDialog,
......@@ -90,32 +114,38 @@ export default {
],
},
{
prop: "status",
prop: "checkStatus",
type: "select",
label: "审核状态",
selectOptions: [
{
label: "已审核",
value: "true",
},
{
label: "待审核",
value: "false",
},
],
selectOptions: this.$constantsTool.getList("checkStatus"),
},
],
loading: false,
previewDialogVisible: false, //预览可见性
aprrovalInfo: {}, //审核的相关信息
aprrovalDetail: {}, //审核的相关信息
prviewType: "view", //预览类型,view-查看详情,approval-审批
operates,
operations,
// operations,
approvleTableTitle,
};
},
computed: {
...mapGetters(["dicts"]),
...mapGetters(["dicts", "userInfo"]),
getOperation(row) {
return (row) => {
return [viewButton, approvalButton, reSubmitButtton];
// const isAdmin = roles.find(item=>{
// return
// })
// 管理员2种
// 1 查看详情和审批
// 2 查看详情 管理员操作——已审核、被驳回的条目能够操作的
// 普通人2种
// 1 查看详情
// 2 重传-当被驳回时
};
},
},
async created() {
await this.$store.dispatch("dict/getDictList", ["displayType"]);
......@@ -128,8 +158,6 @@ export default {
reset() {
this.loadData();
},
// 加载表格数据
async loadData(form) {
this.loading = true;
const params = {
......@@ -144,12 +172,31 @@ export default {
this.loading = false;
},
async handleOperation(value, row) {
console.log(value, row);
handleOperation(value, row) {
const { type } = value;
if (type == "view" || type == "approval") {
this.viewOrApproval(type, row);
} else {
// 重新上传
this.resubmit(row);
}
},
// 编辑或者审核,(都要查看详情,审核多了个表单)
async viewOrApproval(type, row) {
this.prviewType = type;
this.aprrovalInfo = row;
this.$refs.PreviewDialog.visible = true;
const { id } = row;
const res = await getFlowDetailById(id);
if (res.code == 0) {
this.aprrovalDetail = res.data;
this.$refs.PreviewDialog.visible = true;
} else {
return;
}
},
resubmit(row) {
const { addWay, sourceType } = row;
// const isMultiCr = addWay==''
},
// 多选
......
......@@ -6,7 +6,8 @@
:before-close="handleClose"
top="5vh"
lock-scroll
v-loading="loading" element-loading-background="rgba(0, 0, 0, 0.5)"
v-loading="loading"
element-loading-background="rgba(0, 0, 0, 0.5)"
>
<div class="title" slot="title">
<div class="divider"></div>
......@@ -14,7 +15,7 @@
</div>
<div class="dialog-content">
<el-form
size="mini"
size="mini"
:model="dialogForm"
class="basic-info"
:rules="rules"
......@@ -40,14 +41,18 @@
:data="allRole"
show-checkbox
check-on-click-node
check-strictly
node-key="id"
@check="roleParentTreeCheck"
ref="roleParentTree"
highlight-current
:props="{ label: 'name' }"
check-strictly
:default-checked-keys="[dialogForm.pid]"
:default-expanded-keys="[dialogForm.pid]"
>
<!-- <span slot-scope="{ node, data }">
{{ data.id }}
</span> -->
</el-tree>
</el-form-item>
<el-form-item label="菜单权限" :label-width="formLabelWidth">
......@@ -80,7 +85,7 @@
></el-button>
</div>
</el-dialog>
</template>
</template>
<script>
import {
......@@ -141,14 +146,14 @@ export default {
},
},
data() {
var validatePid = (rule, value, callback)=>{
var validatePid = (rule, value, callback) => {
let arr = this.$refs.roleParentTree.getCheckedKeys(); // 在此获取选中的树形数据
if (arr.length == 0 || !arr) {
callback(new Error("请选择所属角色"));
} else {
callback();
}
}
if (arr.length == 0 || !arr) {
callback(new Error("请选择所属角色"));
} else {
callback();
}
};
return {
dialogForm: {},
formLabelWidth: "100px",
......@@ -171,14 +176,14 @@ export default {
pid: [
{
required: true,
validator:validatePid,
validator: validatePid,
// message: "请选择所属角色",
trigger: "blur",
},
],
},
allRole: [],
loading:false
loading: false,
};
},
......@@ -192,11 +197,13 @@ export default {
handleSubmit() {
this.$refs.dialogForm.validate(async (valid) => {
if (valid) {
this.loading = true
this.loading = true;
const { name, remark } = this.dialogForm;
let status = this.status ? 1 : 0;
let permissions = this.$refs.menuPermisionTree.getCheckedKeys();
const checkedKeys = this.$refs.menuPermisionTree.getCheckedKeys();
const halfCheckedKeys =
this.$refs.menuPermisionTree.getHalfCheckedKeys(); //半选中的也要传到后台
const permissions = [...checkedKeys, ...halfCheckedKeys];
const params = {
name,
status,
......@@ -208,7 +215,6 @@ export default {
let pid = parentIdArr.toString();
params.pid = pid;
}
// return
if (this.dialogForm.id) {
params.id = this.dialogForm.id;
let res = await upadateRole(params);
......@@ -216,17 +222,15 @@ export default {
this.$message.success("修改成功!");
this.reload();
}
this.loading = false
this.loading = false;
} else {
params.dataScope = "5"; //默认数据权限为自己
// return
let res = await addRole(params);
if (res.code == 0) {
this.$message.success("添加成功!");
this.reload();
}
this.loading = false
this.loading = false;
}
}
});
......@@ -290,11 +294,31 @@ export default {
this.$refs.roleParentTree.setCheckedKeys([node.id]);
}
},
// checkNode(node) {
// if (!node.checked) {
// // this.check(node);
// // debugger;
// this.$refs.menuPermisionTree.setChecked(node.id, true);
// // node.checked = true;
// if (node.parent) {
// this.checkNode(node.parent);
// }
// }
// },
// handleCheckPermissonChange(data, checked) {
// // 检查子节点
// if (data.children) {
// data.children.forEach((child) => {
// this.checkNode(child);
// });
// }
// },
},
};
</script>
<style lang='scss' scoped>
<style lang="scss" scoped>
.title {
display: flex;
margin-bottom: 16px;
......@@ -320,4 +344,4 @@ export default {
display: flex;
justify-content: flex-end;
}
</style>
\ No newline at end of file
</style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论