中航光电热表web
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

429 lines
12 KiB

8 months ago
<template>
7 months ago
<basic-container>
<!-- 重点工作管理 -->
3 weeks ago
<avue-crud :option="option" :table-loading="loading" :data="data" v-model="form" v-model:page="page" ref="crud"
@search-change="searchChange" @search-reset="searchReset" @current-change="currentChange"
@size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad" @sort-change="sortChange">
7 months ago
<template #menu-left>
3 weeks ago
<el-button type="primary" @click="handleAdd" v-if="permission.managementOfKeyTasks_add">
新增
</el-button>
</template>
<template #menu-right>
<el-button type="primary" @click="setRole" v-if="permission.managementOfKeyTasks_configRole">
配置节点
</el-button>
7 months ago
</template>
<template #menu="{ row }">
3 weeks ago
<el-button type="text" @click="handleView(row)" v-if="permission.managementOfKeyTasks_details">
详情
</el-button>
<el-button type="text" v-if="(row.approvalStatus != 8 &&row.approvalStatus != 1)&& permission.managementOfKeyTasks_edit"
3 weeks ago
@click="handleEdit(row)">
修改
</el-button>
3 weeks ago
<el-button type="text" v-if="row.approvalStatus == 0 && permission.managementOfKeyTasks_sendChenck"
@click="sendReview(row)">
发送审核
</el-button>
<el-button type="text" v-if="row.approvalStatus == 1 && permission.managementOfKeyTasks_review"
@click="checkRow(row)">
审核
</el-button>
3 weeks ago
<el-button type="text" v-if="
(row.approvalStatus == 0 || row.approvalStatus == 2) &&
permission.managementOfKeyTasks_del
" @click="deleteRow(row)">
删除
</el-button>
</template>
<!-- 项目开始时间 -->
<template #projectStartTime="scope">
{{ scope.row.projectStartTime ? scope.row.projectStartTime.substring(0, 10) : '' }}
</template>
<template #projectDesiredEnd="scope">
{{ scope.row.projectDesiredEnd ? scope.row.projectDesiredEnd.substring(0, 10) : '' }}
7 months ago
</template>
</avue-crud>
6 months ago
<!-- 新增弹窗 -->
3 weeks ago
<add-dialog v-if="addDialogVisible" :title="title" :visible="addDialogVisible" :rowItem="rowItem"
@close="closeDialog"></add-dialog>
7 months ago
<!-- 审核弹窗 -->
3 weeks ago
<review v-if="checkDialog" :showDialog="checkDialog" @closeDialog="closeDialog" :rowItem="rowItem"></review>
<!-- 各节点配置 -->
<configRole :showDialog="configRoleDialog" v-if="configRoleDialog" @closeDialog="closeDialog"></configRole>
<!-- 选择审批人 -->
<assignDaialog :showDialog="reviewUserShow" v-if="reviewUserShow" :updateRow="rowItem" @closeDialog="closeDialog">
</assignDaialog>
7 months ago
</basic-container>
8 months ago
</template>
<script>
import {
getProcessList,
updateProcess,
delProcess,
3 weeks ago
} from '@/api/flowManagement/index';
5 months ago
import AddDialog from './addDialog.vue';
import review from './review.vue';
import milestoneDialog from './milestoneDialog.vue';
import { getDictionary } from '@/api/system/dict';
import { mapGetters } from 'vuex';
3 weeks ago
import configRole from './configRole.vue';
import assignDaialog from './assignDaialog.vue';
8 months ago
export default {
3 weeks ago
components: { AddDialog, review, milestoneDialog, configRole, assignDaialog },
7 months ago
data() {
return {
// 状态
// 0-立项待提交、1-立项待审核、2-立项审批不通过、3-项目进行中、
// 4-项目待核查、5-项目核查不通过、6-项目待核准、7-项目核准不通过、
// 8-项目已核准
3 weeks ago
reviewUserShow: false,
configRoleDialog: false,
5 months ago
addDialogVisible: false, // 新增弹窗显隐控制
title: '新增',
7 months ago
loading: false,
checkDialog: false,
subTitle: '执行',
7 months ago
detailForm: {},
checkForm: {},
6 months ago
detailListSelectList: [],
7 months ago
checkRules: {
checkResult: [{ required: true, message: '请选择审核结果', trigger: 'blur' }],
7 months ago
},
executeDialog: false,
data: [],
form: {},
6 months ago
existingFiles: [], // 已有附件列表
addForm: {},
query: {},
7 months ago
page: {
pageSize: 10,
currentPage: 1,
total: 0,
},
option: {
columnSort: true,
tip: false,
expand: false,
rowKey: 'id',
height: 'auto',
align: 'center',
7 months ago
calcHeight: 32,
simplePage: false,
searchShow: true,
searchMenuSpan: 12,
7 months ago
searchIcon: true,
searchIndex: 3,
tree: false,
border: true,
2 months ago
index: true,
selection: false,
7 months ago
viewBtn: false,
delBtn: false,
editBtn: false,
editBtnText: '修改',
7 months ago
addBtn: false,
labelWidth: 120,
menu: true,
menuWidth: 190,
7 months ago
dialogWidth: 600,
dialogClickModal: false,
searchEnter: true,
excelBtn: true,
gridBtn: false,
searchShowBtn: false,
showOverflowTooltip: true,
searchLabelPosition: 'left',
7 months ago
searchGutter: 24,
searchSpan: 6,
menuAlign: 'left',
7 months ago
gridBtn: false,
searchMenuPosition: 'right',
addBtnIcon: ' ',
viewBtnIcon: ' ',
delBtnIcon: ' ',
editBtnIcon: ' ',
7 months ago
searchShowBtn: false,
column: [
{
2 months ago
label: '项目编号',
prop: 'paCode',
7 months ago
overflow: true,
search: true,
sortable: 'custom',
3 weeks ago
width: 120,
7 months ago
},
{
label: '项目名称',
prop: 'projectName',
7 months ago
overflow: true,
search: true,
sortable: 'custom',
3 weeks ago
width: 120,
7 months ago
},
{
label: '项目负责人',
prop: 'projectHead',
7 months ago
overflow: true,
search: false,
searchLabelWidth: 100,
width: 120,
sortable: 'custom',
7 months ago
},
{
label: '项目开始时间',
prop: 'projectStartTime',
7 months ago
overflow: true,
search: false,
width: 130,
sortable: 'custom',
7 months ago
},
{
label: '项目预期结束时间',
prop: 'projectDesiredEnd',
7 months ago
overflow: true,
search: false,
width: 140,
sortable: 'custom',
7 months ago
},
{
label: '制单人',
prop: 'touchingMan',
7 months ago
overflow: true,
search: false,
sortable: 'custom',
3 weeks ago
width: 100,
7 months ago
},
{
label: '制单部门',
prop: 'touchingDept',
3 weeks ago
width: 120,
7 months ago
overflow: true,
search: false,
sortable: 'custom',
7 months ago
},
{
label: '制单时间',
prop: 'touchingTime',
3 weeks ago
width: 150,
7 months ago
overflow: true,
search: false,
sortable: 'custom',
7 months ago
},
3 weeks ago
{
label: '审核人',
prop: 'approvalManName',
overflow: true,
search: false,
sortable: 'custom',
width: 100,
},
7 months ago
{
label: '状态',
prop: 'approvalStatus',
sortable: 'custom',
7 months ago
overflow: true,
search: false,
type: 'select',
dicUrl: '/blade-system/dict/dictionary?code=flow_status',
props: {
label: 'dictValue',
value: 'dictKey',
},
7 months ago
},
],
},
rowItem: {}, //存储每一行的数据
executeResultList: [], //执行结果
checkResultList: [], //核查结果
gradeList: [], //评价等级
7 months ago
};
},
computed: {
...mapGetters(['permission']),
},
mounted() {
this.getExecuteResult();
},
7 months ago
methods: {
3 weeks ago
setRole() {
this.configRoleDialog = true;
},
getExecuteTypeText(type) {
const item = this.executeResultList.find(item => item.dictKey === type);
console.log('item', item);
return item ? item.dictValue : '';
},
// 获取执行类型 flow_project_executeResult
getExecuteResult() {
getDictionary({ code: 'flow_project_executeResult' }).then(res => {
this.executeResultList = res.data.data;
});
},
getGrade() {
getDictionary({ code: 'flow_project_grade' }).then(res => {
this.gradeList = res.data;
});
},
closeDialog(type) {
this.checkDialog = false;
this.addDialogVisible = false;
this.executeDialog = false;
3 weeks ago
this.configRoleDialog = false;
this.reviewUserShow = false
// if (type) {
this.onLoad(this.page, this.query);
// }
6 months ago
},
7 months ago
handleAdd() {
this.title = '新增';
this.rowItem = {};
5 months ago
this.addDialogVisible = true;
7 months ago
},
// 查看详情
handleView(row) {
this.title = '详情';
this.rowItem = row;
5 months ago
this.addDialogVisible = true;
7 months ago
},
// 修改
handleEdit(row) {
this.rowItem = row;
this.title = '修改';
5 months ago
this.addDialogVisible = true;
7 months ago
},
// 删除
deleteRow(row) {
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(res => {
delProcess({ ids: row.id }).then(res => {
this.$message.success('删除成功');
this.onLoad(this.page, this.query);
});
});
7 months ago
},
5 months ago
7 months ago
// 审核立项
checkRow(row) {
7 months ago
this.checkDialog = true;
this.rowItem = row;
7 months ago
},
3 weeks ago
// 发送审核
sendReview(row) {
this.reviewUserShow = true;
this.rowItem = row;
6 months ago
},
5 months ago
searchReset() {
this.query = {};
this.onLoad(this.page, this.query);
5 months ago
},
searchChange(params, done) {
this.query = params;
this.page.currentPage = 1;
this.onLoad(this.page, params);
done();
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
this.onLoad(this.page, this.query);
5 months ago
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
this.onLoad(this.page, this.query);
5 months ago
},
refreshChange() {
this.onLoad(this.page, this.query);
},
sortChange({ prop, order }) {
this.query.descs = undefined;
this.query.ascs = undefined;
let orderByFieldKey = order === 'descending' ? 'descs' : 'ascs';
this.query[orderByFieldKey] = !prop
? undefined
: prop.replace(/([a-z])([A-Z0-9])/g, '$1_$2').toUpperCase();
// // 重新加载数据
this.onLoad(this.page, this.query);
},
5 months ago
onLoad(page, params = {}) {
this.loading = true;
getProcessList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(
res => {
const records = res.data.data.records;
this.data = records.map(item => {
3 weeks ago
item.approvalStatus = item.approvalStatus + '';
if (item.stoneList && Array.isArray(item.stoneList)) {
item.stoneList = item.stoneList.map(stone => ({
...stone,
executeTypeText: this.getExecuteTypeText(stone.executeType),
}));
}
return item;
});
5 months ago
this.loading = false;
this.page.total = res.data.data.total;
}
);
7 months ago
},
},
};
8 months ago
</script>
6 months ago
<style scoped>
.attachment-list {
margin-top: 10px;
padding: 10px;
border: 1px solid #ebeef5;
6 months ago
border-radius: 4px;
background-color: #fafafa;
6 months ago
}
.attachment-list h4 {
margin: 0 0 10px 0;
font-size: 14px;
color: #606266;
}
.attachment-list ul {
margin: 0;
padding: 0;
list-style-type: none;
}
.attachment-list li {
display: flex;
align-items: center;
justify-content: space-between;
padding: 8px 0;
border-bottom: 1px solid #ebeef5;
6 months ago
}
.attachment-list li:last-child {
border-bottom: none;
}
.attachment-list a {
color: #409eff;
6 months ago
text-decoration: none;
}
.attachment-list a:hover {
color: #66b1ff;
text-decoration: underline;
}
</style>