490 lines
21 KiB
Vue
490 lines
21 KiB
Vue
<template>
|
|
<div class="bzdyStep3">
|
|
<!-- 标准调研流程-->
|
|
<ProcessHeader toggle>
|
|
<template slot="proName">标准调研流程</template>
|
|
<template slot="proNode">责任人上传调研结果</template>
|
|
</ProcessHeader>
|
|
<div class="headerTabs">
|
|
<div class="headerTabsItem" :class="active === '1' ? 'active' : ''" @click="handleTabs('1')">基础信息</div>
|
|
<div class="headerTabsItem" :class="active === '2' ? 'active' : ''" @click="handleTabs('2')">审批历史</div>
|
|
</div>
|
|
<div class="content" v-show="active === '1'">
|
|
<div style="flex: auto; overflow: auto;">
|
|
<el-form
|
|
ref="qbkwForm"
|
|
:model="form"
|
|
:rules="formRules"
|
|
class="label-input-form"
|
|
label-width="210px"
|
|
>
|
|
<ProcessTitle>
|
|
<template slot="title">基础信息</template>
|
|
</ProcessTitle>
|
|
<div class="prc-content-border" v-if="foldFormFlag === false">
|
|
<el-row :gutter="24">
|
|
<el-col :span="12">
|
|
<el-form-item label="调研标题" prop="title" class="add-form-item form-item-disabled">
|
|
<el-input
|
|
disabled
|
|
v-model="form.title"
|
|
placeholder="请输入调研标题"
|
|
clearable
|
|
></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="完成时间" prop="date" class="add-form-item form-item-disabled">
|
|
<el-date-picker
|
|
disabled
|
|
v-model="form.date"
|
|
type="date"
|
|
placeholder="请选择完成时间">
|
|
</el-date-picker>
|
|
</el-form-item>
|
|
<el-form-item label="调研模板" prop="model" class="add-form-item form-item-disabled">
|
|
<div v-if="form.modelList.length > 0" style="display: flex;">
|
|
<div v-for="(item, index) in form.modelList" class="fileClass" :key="index" style="margin-right: 5px;" @click="updateFile(item)">
|
|
{{ item.name }}
|
|
</div>
|
|
</div>
|
|
<div v-else>
|
|
- -
|
|
</div>
|
|
</el-form-item>
|
|
<el-form-item label="相关附件" prop="model" class="add-form-item form-item-disabled">
|
|
<div v-if="form.fjList.length > 0" style="display: flex;">
|
|
<div v-for="(item, index) in form.fjList" class="fileClass" :key="index" style="margin-right: 5px;" @click="updateFile(item)">
|
|
{{ item.name }}
|
|
</div>
|
|
</div>
|
|
<div v-else>
|
|
- -
|
|
</div>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
</div>
|
|
<el-button v-if="foldFormFlag === false" style="width: 100%" icon="el-icon-caret-top" @click="foldForm">隐藏基础信息</el-button>
|
|
<el-button v-if="foldFormFlag === true" style="width: 100%" icon="el-icon-caret-bottom" @click="foldForm">展开基础信息</el-button>
|
|
<ProcessTitle>
|
|
<template slot="title">调研回执</template>
|
|
</ProcessTitle>
|
|
<div class="prc-content-border">
|
|
<el-row :gutter="24">
|
|
<el-col :span="12">
|
|
<el-form-item label="调研结果" prop="fileName" class="add-form-item form-item-disabled">
|
|
<el-input
|
|
disabled
|
|
style="display: none;"
|
|
v-model="form.fileName"
|
|
clearable
|
|
></el-input>
|
|
<div v-if="form.fileName" @click="fileUpload" class="fileClass">
|
|
{{ form.fileName }}
|
|
</div>
|
|
<div v-else>
|
|
<el-button
|
|
type="primary"
|
|
class="common-button-primary"
|
|
@click="fileUpload"
|
|
size="mini">
|
|
点击上传
|
|
</el-button>
|
|
</div>
|
|
</el-form-item>
|
|
<el-form-item label="回执说明" prop="dyhz" class="add-form-item form-item-disabled">
|
|
<el-input
|
|
v-model="form.dyhz"
|
|
style="height: 150px"
|
|
type="textarea"
|
|
:autosize="{ minRows: 1, maxRows: 5}"
|
|
placeholder="请输入回执说明"
|
|
clearable
|
|
></el-input>
|
|
<!-- 用来把多行的那个标记取消掉 resize="none"-->
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
</div>
|
|
</el-form>
|
|
</div>
|
|
<el-collapse accordion>
|
|
<el-collapse-item title="意见填写">
|
|
<div style="margin: 10px 0;">
|
|
<el-input
|
|
type="textarea"
|
|
:rows="3"
|
|
resize="none"
|
|
placeholder="请输入意见"
|
|
v-model="commentText">
|
|
</el-input>
|
|
</div>
|
|
</el-collapse-item>
|
|
</el-collapse>
|
|
</div>
|
|
<div class="content" v-show="active === '2'">
|
|
<el-table
|
|
height="100%"
|
|
ref="selection"
|
|
:data="histortData"
|
|
tooltip-effect="dark"
|
|
style="width: 100%"
|
|
border
|
|
row-key="id"
|
|
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}">
|
|
<el-table-column
|
|
prop="name"
|
|
label="任务步骤"
|
|
align="center"
|
|
sortable="custom"
|
|
>
|
|
</el-table-column>
|
|
<el-table-column
|
|
prop="assignee"
|
|
label="任务受理人"
|
|
align="center"
|
|
sortable="custom"
|
|
>
|
|
</el-table-column>
|
|
<el-table-column
|
|
prop="createTime"
|
|
label="创建时间"
|
|
sortable="custom"
|
|
align="center">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.createTime ? $moment(scope.row.createTime).format('YYYY-MM-DD') : '' }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column
|
|
prop="endTime"
|
|
label="完成时间"
|
|
align="center">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.endTime ? $moment(scope.row.endTime).format('YYYY-MM-DD') : '' }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column
|
|
prop="comment"
|
|
label="审批意见"
|
|
align="center">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.commentText }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column
|
|
prop="completeFlag"
|
|
label="状态"
|
|
align="center">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.endTime ? '已完成' : '未完成'}}</span>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
</div>
|
|
<ProcessFooter
|
|
show-save
|
|
show-submit
|
|
:submitLoading="isSubmit"
|
|
:saveLoading="saveLoading"
|
|
show-transfer
|
|
@transfer="handleTransfer"
|
|
@save="handleSave"
|
|
@submit="handleSubmit"
|
|
>
|
|
</ProcessFooter>
|
|
<Role-tree
|
|
check-box
|
|
is-title="转办处理人"
|
|
:is-visible.sync="drawerModal"
|
|
@checkedRole="checkedRole"
|
|
></Role-tree>
|
|
<el-dialog width='400px' :visible.sync="fileMadel" title="上传文件">
|
|
<el-upload
|
|
class="upload-demo"
|
|
multiple
|
|
drag
|
|
:action="fileUrl"
|
|
ref="importfile"
|
|
name="file"
|
|
accept=".ZIP, .zip, .docx, .DOCX, .xls, .xlsx"
|
|
:before-upload="beginImportFile"
|
|
:on-success="importFileSuccess"
|
|
:show-file-list="true"
|
|
>
|
|
<div style="padding: 20px 0">
|
|
<i class="el-icon-upload" style="color: #3399ff"></i>
|
|
<p>点击或拖拽上传文件</p>
|
|
</div>
|
|
</el-upload>
|
|
</el-dialog>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import ProcessHeader from '../../components/ProcessHeader'
|
|
import ProcessFooter from '../../components/ProcessFooter'
|
|
import ProcessTitle from '../../components/ProcessTitle'
|
|
import {inboundLiaisonDetail,processCreateStand,saveTaskForPub,changeAssigneeNew} from 'api/process'
|
|
import axios from "axios";
|
|
|
|
export default {
|
|
name: "bzdyStep3",
|
|
data() {
|
|
return {
|
|
drawerModal: false,
|
|
foldFormFlag: false,
|
|
histortData: [],
|
|
commentText: '',
|
|
taskIds: this.$route.query.taskIds,
|
|
pId: this.$route.query.prcId,
|
|
active: '1', // 默认显示
|
|
isSubmit: false,
|
|
saveLoading: false,
|
|
form: {
|
|
dyhz: '',
|
|
title: '', // 调研标题
|
|
date: '', // 完成时间
|
|
modelList: [],
|
|
fjList: [],
|
|
fileId: '',
|
|
fileName: '',
|
|
responUserList: '',
|
|
responUserListName: '',
|
|
},
|
|
formRules: {
|
|
fileName: [
|
|
{ required: true, message: '请上传调研结果', trigger: 'change' },
|
|
],
|
|
dyhz: [
|
|
{ required: true, message: '请输入回执说明', trigger: 'change' },
|
|
]
|
|
},
|
|
json: {},
|
|
fileUrl: 'api/att/attFile/upload',
|
|
fileMadel: false,
|
|
}
|
|
},
|
|
components: {
|
|
ProcessHeader,
|
|
ProcessFooter,
|
|
ProcessTitle
|
|
},
|
|
methods: {
|
|
handleTransfer() {
|
|
this.drawerModal = true
|
|
},
|
|
checkedRole (data) {
|
|
changeAssigneeNew({
|
|
taskId: this.$route.query.taskIds, // 任务id
|
|
userId:this.$store.getters.userInfo.userId, // 委托人
|
|
assignee: data[0].id, // 被委托人
|
|
pId: this.$route.query.prcId, // 流程实例
|
|
}).then(res => {
|
|
if (res.success) {
|
|
this.drawerModal = false
|
|
this.$message.success('调整成功')
|
|
this.processNum()
|
|
this.$router.push({path:'/processCenter?tabsName=ProcessCenter'})
|
|
} else {
|
|
this.$message.warning(res.message)
|
|
}
|
|
})
|
|
},
|
|
// 请求转换流程图
|
|
processNum (row) {
|
|
axios.request({
|
|
url: '/api/lawss/activiti/getImg?_t=' + new Date().getTime(),
|
|
responseType: 'blob',
|
|
method: 'get',
|
|
params: {
|
|
prcNum: this.$route.query.prcNum
|
|
}
|
|
}).then(res => {
|
|
this.processStep = window.URL.createObjectURL(res.data)
|
|
})
|
|
},
|
|
foldForm() {
|
|
this.foldFormFlag = !this.foldFormFlag
|
|
},
|
|
getHistoryData () {
|
|
this.$http.get('lawss/activiti/get_list_by_instance', {
|
|
prcNum: this.$route.query.prcNum,
|
|
}, {}, res => {
|
|
this.histortData = res
|
|
}, e => {})
|
|
},
|
|
updateFile (item) {
|
|
window.location.href = '/api/att/attFile/downloadFile?fileId=' + item.id
|
|
},
|
|
// 导入按钮 上传之前的钩子
|
|
beginImportFile (file) {
|
|
var filename = file.name
|
|
var index1 = filename.lastIndexOf('.')
|
|
var index2 = filename.length
|
|
var fileSuffix = filename.substring(index1, index2)
|
|
// const fileSuffix = file.name.split('.')[1] // 后缀名
|
|
// 判断上传文件格式
|
|
if (fileSuffix === '.ppt' || fileSuffix === '.docx' || fileSuffix === '.DOCX' || fileSuffix === '.PPT' || fileSuffix === '.xls' || fileSuffix === '.xlsx') {
|
|
return true
|
|
} else {
|
|
this.spinShow = false
|
|
this.$message.error('文件' + file.name + '格式不正确,请上传PPT,DOCX,XLS文件')
|
|
return false
|
|
}
|
|
// 判断文件上传大小
|
|
// eslint-disable-next-line no-unreachable
|
|
if (file.size / 1024 / 1024 <= 200) {
|
|
return true
|
|
} else {
|
|
this.$message.error('文件' + file.name + '大小不超过200M')
|
|
return false
|
|
}
|
|
return true
|
|
},
|
|
// 导入标准数据成功后执行
|
|
importFileSuccess (response, file) {
|
|
if (response.ok) {
|
|
this.fileMadel = false
|
|
this.form.fileId = response.data.id
|
|
this.form.fileName = response.data.name
|
|
this.$message({
|
|
showClose: true,
|
|
message: response.message,
|
|
type: 'success'
|
|
})
|
|
}
|
|
},
|
|
fileUpload () {
|
|
this.fileMadel = true
|
|
},
|
|
handleTabs(name) {
|
|
this.active = name
|
|
},
|
|
handleSave() {
|
|
this.saveLoading = true
|
|
let _formData = new FormData()
|
|
_formData.append('taskIds', this.taskIds)
|
|
_formData.append('json', JSON.stringify({
|
|
form: this.form,
|
|
commentText: this.commentText,
|
|
}))
|
|
saveTaskForPub(_formData).then(res => {
|
|
this.saveLoading = false
|
|
this.$message.success('保存成功')
|
|
}).catch(e => {
|
|
this.saveLoading = false
|
|
})
|
|
},
|
|
handleSubmit() {
|
|
this.$refs['qbkwForm'].validate((valid) => {
|
|
if (valid) {
|
|
this.json.dyhz = this.form.dyhz
|
|
this.isSubmit = true
|
|
var json = this.json
|
|
json.commentText = this.commentText
|
|
json.fileId = this.form.fileId
|
|
json.fileName = this.form.fileName
|
|
this.$http.post('lawss/activiti/completeTask', {
|
|
json: JSON.stringify(json),
|
|
taskId: this.taskIds,
|
|
userId: this.$store.getters.userInfo.userId
|
|
}, {}, res => {
|
|
if (res.success) {
|
|
this.$message.success('提交成功')
|
|
this.$router.push('/processCenter')
|
|
}
|
|
this.isSubmit = false
|
|
})
|
|
} else {
|
|
return this.$message.warning('请完善基础信息')
|
|
}
|
|
})
|
|
},
|
|
getData() {
|
|
return new Promise((resolve, reject) => {
|
|
inboundLiaisonDetail({
|
|
taskIds: this.taskIds,
|
|
pId: this.pId
|
|
}).then(res => {
|
|
let data = JSON.parse(res.mesg)
|
|
this.form.title = data.title || data.form.title
|
|
this.form.date = data.date || data.form.date
|
|
this.json = data || data.form
|
|
this.form.fjList = data.fjList || data.form.fjList
|
|
this.form.modelList = data.modelList || data.form.modelList
|
|
this.form.responUserList = data.form.responUserList
|
|
this.form.responUserListName = data.form.responUserListName
|
|
this.form.fileName = data.form.fileName || data.fileName || ''
|
|
this.form.fileId = data.form.fileId || data.fileId || ''
|
|
this.form.dyhz = data.form.dyhz || data.dyhz || ''
|
|
}).catch(e => {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
mounted () {
|
|
this.getData()
|
|
this.getHistoryData()
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="less" scoped>
|
|
@import '~@/assets/styles/style';
|
|
.bzdyStep3 {
|
|
/deep/.el-drawer__container {
|
|
.prc-content-border {
|
|
border: none;
|
|
padding: 0 20px 0;
|
|
}
|
|
}
|
|
position: relative;
|
|
height: 100%;
|
|
.fileClass {
|
|
cursor: pointer;
|
|
}
|
|
.fileClass:hover{
|
|
color: #0c91e5;
|
|
}
|
|
.headerTabs {
|
|
height: 52px;
|
|
display: flex;
|
|
align-items: center;
|
|
position: absolute;
|
|
top: 0;
|
|
right: 10px;
|
|
.headerTabsItem {
|
|
border: 1px solid #c1c1c1;
|
|
padding: 0 5px;
|
|
height: 30px;
|
|
line-height: 30px;
|
|
cursor: pointer;
|
|
}
|
|
.active {
|
|
border: 1px solid #E6A23C;
|
|
color: #fff;
|
|
background: #E6A23C;
|
|
}
|
|
}
|
|
.content {
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: space-between;
|
|
height: calc(~'100% - 103px');
|
|
overflow: auto;
|
|
.tableTitle {
|
|
margin-bottom: 10px;
|
|
height: 30px;
|
|
line-height: 30px;
|
|
position: relative;
|
|
font-size: 13px;
|
|
font-weight: bold;
|
|
.tableButton {
|
|
position: absolute;
|
|
right: 0;
|
|
top: 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|