中航光电热表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.

614 lines
19 KiB

6 months ago
<template>
5 months ago
<basic-container>
<!-- 重点工作管理 -->
<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"
>
5 months ago
<template #menu-left>
<el-button type="primary" @click="handleAdd">新增</el-button>
5 months ago
</template>
<template #menu="{ row }">
<el-button type="text" @click="handleView(row)">详情</el-button>
<el-button type="text" v-if="row.approvalStatus == 1" @click="handleEdit(row)"
>修改</el-button
>
<el-button type="text" v-if="row.approvalStatus == 1" @click="checkRow(row)"
>审核</el-button
>
<el-button type="text" v-if="row.approvalStatus == 1" @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) : '' }}
5 months ago
</template>
3 months ago
<!-- 列表嵌套表格 -->
5 months ago
<template #expand="{ row }">
3 months ago
<el-table :data="row.stoneList">
4 months ago
<el-table-column label="里程碑计划" align="center" prop="milestonePlan"></el-table-column>
<el-table-column
label="里程碑负责人"
align="center"
prop="milestoneMan"
></el-table-column>
<el-table-column
label="里程碑输出物"
align="center"
prop="outputMaterial"
></el-table-column>
<el-table-column
label="里程碑节点"
width="200"
align="center"
prop="milestoneNode"
></el-table-column>
<el-table-column align="center" label="执行类型" prop="executeType"></el-table-column>
4 months ago
<el-table-column align="center" label="状态" prop="statusTitle"></el-table-column>
<el-table-column align="center" label="延期时间" prop="delayTime"></el-table-column>
<el-table-column
align="center"
label="核查结果"
prop="checkResultTitle"
></el-table-column>
4 months ago
<el-table-column align="center" label="核查人" prop="checkMan.userName"></el-table-column>
<el-table-column align="center" label="评价等级" prop="gradeTitle"></el-table-column>
<el-table-column align="center" label="评价人" prop="gradeMan.userName"></el-table-column>
<el-table-column align="center" label="业务领导评价" prop="evaluate"></el-table-column>
5 months ago
<el-table-column label="操作">
<template #default="scope">
<el-button
type="text"
v-if="scope.row.status == 3"
@click="executeRow(row, scope.row)"
>执行</el-button
>
<el-button type="text" v-if="scope.row.status == 4" @click="auditRow(row, scope.row)"
>核查</el-button
>
<el-button
type="text"
v-if="scope.row.status == 6"
@click="examineRow(row, scope.row)"
>核准</el-button
>
6 months ago
</template>
5 months ago
</el-table-column>
</el-table>
</template>
</avue-crud>
4 months ago
<!-- 新增弹窗 -->
<add-dialog
v-if="addDialogVisible"
:title="title"
:visible="addDialogVisible"
:rowItem="rowItem"
@close="closeDialog"
></add-dialog>
5 months ago
<!-- 审核弹窗 -->
<review
v-if="checkDialog"
:showDialog="checkDialog"
@closeDialog="closeDialog"
:rowItem="rowItem"
></review>
5 months ago
<!-- 执行/核查/核准弹窗 -->
<el-dialog append-to-body :title="subTitle" v-model="executeDialog">
4 months ago
<el-form :model="executeForm" :rules="executeRules" ref="executeForm" label-width="100">
5 months ago
<el-form-item label="项目名称">
<el-input disabled v-model="detailForm.projectName"></el-input>
</el-form-item>
<el-form-item label="项目负责人">
<el-input disabled v-model="detailForm.projectHead.userName"></el-input>
</el-form-item>
<el-form-item label="里程碑计划">
<el-input disabled v-model="executeForm.milestonePlan"></el-input>
</el-form-item>
<el-form-item label="里程碑负责人">
<el-input disabled v-model="executeForm.milestoneMan.userName"></el-input>
</el-form-item>
<el-form-item label="项目目标">
4 months ago
<el-input disabled v-model="executeForm.fmProjectApplication.projectTarget"></el-input>
5 months ago
</el-form-item>
<el-form-item label="预期效果">
4 months ago
<el-input disabled v-model="executeForm.fmProjectApplication.desiredResult"></el-input>
5 months ago
</el-form-item>
<el-form-item label="项目背景">
4 months ago
<el-input disabled v-model="executeForm.fmProjectApplication.projectBackcloth"></el-input>
5 months ago
</el-form-item>
<el-form-item label="里程碑节点">
<el-input disabled v-model="executeForm.milestoneNode"></el-input>
</el-form-item>
<el-form-item label="执行类型" prop="executeResult">
<el-select
:disabled="subTitle == '核查' || subTitle == '核准'"
v-model="executeForm.executeResult"
>
5 months ago
<el-option label="延期" :value="1"></el-option>
<el-option label="终止" :value="2"></el-option>
<el-option label="完成" :value="3"></el-option>
</el-select>
</el-form-item>
<el-form-item label="延期时间" v-if="executeForm.executeResult == 1">
<el-date-picker
:disabled="subTitle == '核查' || subTitle == '核准'"
style="width: 100%"
v-model="executeForm.delayTime"
type="datetime"
placeholder="选择日期时间"
/>
5 months ago
</el-form-item>
<el-form-item label="里程碑描述" prop="milestoneMemo">
<el-input
:disabled="subTitle == '核查' || subTitle == '核准'"
type="textarea"
v-model="executeForm.milestoneMemo"
></el-input>
5 months ago
</el-form-item>
<el-form-item label="里程碑进展" prop="evolve">
<el-input
:disabled="subTitle == '核查' || subTitle == '核准'"
type="textarea"
v-model="executeForm.evolve"
></el-input>
5 months ago
</el-form-item>
<el-form-item label="下一步计划" prop="lastPlan">
<el-input
:disabled="subTitle == '核查' || subTitle == '核准'"
type="textarea"
v-model="executeForm.lastPlan"
></el-input>
5 months ago
</el-form-item>
<el-form-item
label="附件"
v-if="subTitle == '执行' || subTitle == '核查' || subTitle == '核准'"
>
<el-upload
class="upload-demo"
action="https://jsonplaceholder.typicode.com/posts/"
:on-preview="handlePreview"
:on-remove="handleRemove"
:before-remove="beforeRemove"
multiple
:limit="3"
:on-exceed="handleExceed"
:file-list="fileList"
>
5 months ago
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">不能上传 exe 附件且不超过 20M</div>
</el-upload>
4 months ago
<div v-if="subTitle == '核查' || subTitle == '核准'" class="attachment-list">
<h4>附件下载</h4>
<ul>
<li v-for="(file, index) in existingFiles" :key="index">
<a href="javascript:void(0)" @click="downloadFile(file)">{{ file.name }}</a>
<el-button type="text" size="small" @click="removeExistingFile(index)"
>删除</el-button
>
4 months ago
</li>
</ul>
</div>
5 months ago
</el-form-item>
<el-form-item label="核查人" v-if="subTitle == '执行'">
<el-select v-model="executeForm.userId">
<el-option label="审核人一" value="1"></el-option>
<el-option label="审核人二" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item label="核查结果" v-if="subTitle == '核查'">
<el-select v-model="executeForm.checkResult">
<el-option label="通过" value="1"></el-option>
<el-option label="不通过" value="2"></el-option>
</el-select>
</el-form-item>
4 months ago
<el-form-item label="审核人" v-if="subTitle == '核查' && executeForm.checkResult == 1">
5 months ago
<el-select v-model="executeForm.userId">
<el-option label="审核人一" value="1"></el-option>
<el-option label="审核人二" value="2"></el-option>
</el-select>
</el-form-item>
<div v-if="subTitle == '核准'" style="color: #ffc300; margin-bottom: 10px">
评价等级分为:(95以上节点推进超前完成质量高)(85-95节点推进正常质量较好)(75-84节点推进轻微拖期完成质量一般)(75以下进展滞后完成质量较差)
</div>
<el-form-item v-if="subTitle == '核准'" label="评价分数">
<el-input v-model="executeForm.score"></el-input>
</el-form-item>
<el-form-item v-if="subTitle == '核准'" label="评语">
<el-input type="textarea" v-model="executeForm.evaluate"></el-input>
</el-form-item>
4 months ago
4 months ago
<el-form-item label="审核意见" prop="checkOpinion" label-width="80px">
<el-input
type="textarea"
placeholder="请输入审核意见"
v-model="checkForm.checkOpinion"
></el-input>
4 months ago
</el-form-item>
5 months ago
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="executeDialog = false"> </el-button>
<el-button type="primary" @click="submitExecute"> </el-button>
</span>
</template>
</el-dialog>
</basic-container>
6 months ago
</template>
<script>
import {
getProcessList,
addProcess,
updateProcess,
delProcess,
} from '../../api/flowManagement/index';
3 months ago
import AddDialog from './addDialog.vue';
import review from './review.vue';
6 months ago
export default {
components: { AddDialog, review },
5 months ago
data() {
return {
// 状态
// 0-立项待提交、1-立项待审核、2-立项审批不通过、3-项目进行中、
// 4-项目待核查、5-项目核查不通过、6-项目待核准、7-项目核准不通过、
// 8-项目已核准
3 months ago
addDialogVisible: false, // 新增弹窗显隐控制
title: '新增',
5 months ago
loading: false,
checkDialog: false,
subTitle: '执行',
5 months ago
detailForm: {},
checkForm: {},
4 months ago
detailListSelectList: [],
5 months ago
checkRules: {
checkResult: [{ required: true, message: '请选择审核结果', trigger: 'blur' }],
5 months ago
},
executeDialog: false,
executeForm: {},
executeRules: {
executeResult: [{ required: true, message: '请选择执行类型', trigger: 'blur' }],
milestoneMemo: [{ required: true, message: '请填写里程碑描述', trigger: 'blur' }],
evolve: [{ required: true, message: '请填写里程碑进展', trigger: 'blur' }],
lastPlan: [{ required: true, message: '请填写下一步计划', trigger: 'blur' }],
5 months ago
},
data: [],
form: {},
4 months ago
existingFiles: [], // 已有附件列表
addForm: {},
5 months ago
page: {
pageSize: 10,
currentPage: 1,
total: 0,
},
option: {
columnSort: true,
tip: false,
expand: true,
rowKey: 'id',
height: 'auto',
align: 'center',
5 months ago
calcHeight: 32,
simplePage: false,
searchShow: true,
searchMenuSpan: 6,
searchIcon: true,
searchIndex: 3,
tree: false,
border: true,
index: false,
selection: false,
5 months ago
viewBtn: false,
delBtn: false,
editBtn: false,
editBtnText: '修改',
5 months ago
addBtn: false,
labelWidth: 120,
menu: true,
menuWidth: 190,
5 months ago
dialogWidth: 600,
dialogClickModal: false,
searchEnter: true,
excelBtn: true,
gridBtn: false,
searchShowBtn: false,
showOverflowTooltip: true,
searchLabelPosition: 'left',
5 months ago
searchGutter: 24,
searchSpan: 6,
menuAlign: 'left',
5 months ago
gridBtn: false,
searchMenuPosition: 'right',
addBtnIcon: ' ',
viewBtnIcon: ' ',
delBtnIcon: ' ',
editBtnIcon: ' ',
5 months ago
searchShowBtn: false,
column: [
{
label: '单据号',
prop: 'paCode',
5 months ago
overflow: true,
search: true,
},
{
label: '项目名称',
prop: 'projectName',
5 months ago
overflow: true,
search: true,
},
{
label: '项目负责人',
prop: 'projectHead',
5 months ago
overflow: true,
search: true,
searchLabelWidth: 100,
5 months ago
},
{
label: '项目开始时间',
prop: 'projectStartTime',
5 months ago
overflow: true,
search: false,
},
{
label: '项目预期结束时间',
prop: 'projectDesiredEnd',
5 months ago
overflow: true,
search: false,
},
{
label: '制单人',
prop: 'touchingMan',
5 months ago
overflow: true,
search: false,
},
{
label: '制单部门',
prop: 'touchingDept',
5 months ago
overflow: true,
search: false,
},
{
label: '制单时间',
prop: 'touchingTime',
5 months ago
overflow: true,
search: false,
},
{
label: '状态',
prop: 'approvalStatus',
5 months ago
overflow: true,
search: false,
type: 'select',
dicUrl: '/blade-system/dict/dictionary?code=flow_status',
props: {
label: 'dictValue',
value: 'dictKey',
},
5 months ago
},
],
},
rowItem: {}, //存储每一行的数据
5 months ago
};
},
mounted() {},
5 months ago
methods: {
closeDialog(type) {
this.checkDialog = false;
this.addDialogVisible = false
if (type) {
this.onLoad(this.page, this.query);
4 months ago
}
4 months ago
},
5 months ago
handleAdd() {
this.title = '新增';
this.rowItem = {}
3 months ago
this.addDialogVisible = true;
5 months ago
},
// 查看详情
handleView(row) {
this.title = '详情';
this.rowItem = row;
3 months ago
this.addDialogVisible = true;
5 months ago
},
// 修改
handleEdit(row) {
this.rowItem = row;
this.title = '修改';
3 months ago
this.addDialogVisible = true;
5 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);
});
});
5 months ago
},
3 months ago
5 months ago
// 审核立项
checkRow(row) {
5 months ago
this.checkDialog = true;
this.rowItem = row;
5 months ago
},
//确定审核立项
submitCheck() {
this.$refs.checkForm.validate(valid => {
5 months ago
if (valid) {
let query = {
id: this.rowItem.id,
approvalStatus: this.checkForm.checkResult == 1 ? 3 : 2,
};
updateProcess(query).then(res => {
this.checkDialog = false;
this.onLoad(this.page, this.query);
});
5 months ago
}
});
},
// 执行
executeRow(row, detail) {
this.executeForm = {};
this.detailForm = row;
this.subTitle = '执行';
5 months ago
this.executeDialog = true;
},
// 确定执行
submitExecute() {
this.$refs.executeForm.validate(valid => {
5 months ago
if (valid) {
this.executeDialog = false;
}
});
},
// 核查
auditRow(row, detail) {
this.subTitle = '核查';
5 months ago
this.detailForm = row;
this.executeForm = detail;
this.executeForm.checkResult = '';
4 months ago
// 模拟加载已有附件
this.existingFiles = [
{ name: '项目计划书.pdf', url: '#' },
{ name: '进度报告.docx', url: '#' },
4 months ago
];
5 months ago
this.executeDialog = true;
},
// 核准
examineRow(row, detail) {
this.subTitle = '核准';
5 months ago
this.detailForm = row;
this.executeForm = detail;
4 months ago
// 模拟加载已有附件
this.existingFiles = [
{ name: '项目计划书.pdf', url: '#' },
{ name: '进度报告.docx', url: '#' },
{ name: '验收单.xlsx', url: '#' },
4 months ago
];
5 months ago
this.executeDialog = true;
},
4 months ago
// 下载附件
downloadFile(file) {
const link = document.createElement('a');
link.href = file.url;
link.download = file.name;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
},
// 删除已有附件
removeExistingFile(index) {
this.$confirm('确定删除该附件?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
this.existingFiles.splice(index, 1);
this.$message.success('删除成功');
})
.catch(() => {});
4 months ago
},
3 months ago
searchReset() {
this.query = {};
this.onLoad(this.page, this.query);
3 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);
3 months ago
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
this.onLoad(this.page, this.query);
3 months ago
},
refreshChange() {
this.onLoad(this.page, this.query);
},
onLoad(page, params = {}) {
this.loading = true;
getProcessList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(
res => {
this.data = res.data.data.records;
this.loading = false;
this.page.total = res.data.data.total;
}
);
5 months ago
},
},
};
6 months ago
</script>
4 months ago
<style scoped>
.attachment-list {
margin-top: 10px;
padding: 10px;
border: 1px solid #ebeef5;
4 months ago
border-radius: 4px;
background-color: #fafafa;
4 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;
4 months ago
}
.attachment-list li:last-child {
border-bottom: none;
}
.attachment-list a {
color: #409eff;
4 months ago
text-decoration: none;
}
.attachment-list a:hover {
color: #66b1ff;
text-decoration: underline;
}
</style>