Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
fanlin
2021-07-20 18:03:03 +08:00
5 changed files with 604 additions and 3 deletions
@@ -0,0 +1,556 @@
<template>
<div class="bzdyStep1-1">
<!-- 标准调研流程-->
<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">
<el-row :gutter="24">
<el-col :span="12">
<el-form-item label="调研标题" prop="title" class="add-form-item form-item-disabled">
<el-input
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
v-model="form.date"
type="date"
placeholder="请选择完成时间">
</el-date-picker>
</el-form-item>
<el-form-item label="调研模板" prop="modelName" class="add-form-item form-item-disabled">
<el-input
disabled
style="display: none;"
v-model="form.modelName"
clearable
></el-input>
<div v-if="form.modelName" @click="fileUpload" class="fileClass">
{{ form.modelName }}
</div>
<div v-else>
<el-button
type="primary"
class="common-button-primary"
@click="fileUpload"
size="mini">
点击上传
</el-button>
</div>
</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'">
<div class="block" style="padding-top: 20px;">
<el-timeline>
<el-form
ref="Form"
:model="roleForm"
:rules="roleFormRules"
class="label-input-form">
<el-timeline-item timestamp="发起流程" placement="top" :color="roleForm.startUser ? '#66b1ff' : ''">
<el-card>
<el-form-item prop="startUserName" style="margin-bottom: 0">
<h4>流程发起人</h4>
<div style="margin-top: 10px;width: 300px;">
<el-input v-model="roleForm.startUser" style="display: none;"></el-input>
<el-input v-model="roleForm.startUserName" placeholder="流程发起人" disabled></el-input>
</div>
</el-form-item>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="选择部门责任人" placement="top" :color="roleForm.dockUserName ? '#66b1ff' : ''">
<el-card>
<el-form-item prop="dockUserName" style="margin-bottom: 0">
<h4>责任部门对接人</h4>
<div style="margin-top: 10px;width: 300px;">
<el-input v-model="roleForm.dockUserList" style="display: none;"></el-input>
<el-input v-model="roleForm.dockUserName" placeholder="选择责任人" @click.native="choiceZRRS">
</el-input>
</div>
</el-form-item>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="审批" placement="top" :color="roleForm.ministerUser ? '#66b1ff' : ''">
<el-card>
<el-form-item prop="ministerUserName" style="margin-bottom: 0">
<h4>标准法规部部长</h4>
<div style="margin-top: 10px;width: 300px;">
<el-input v-model="roleForm.ministerUser" style="display: none;"></el-input>
<el-input v-model="roleForm.ministerUserName" placeholder="选择标准法规部部长" @click.native="choiceZRR('ministerUser', '选择标准法规部部长', roleForm.ministerUser)"></el-input>
</div>
</el-form-item>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="审定" placement="top" :color="roleForm.directorUser ? '#66b1ff' : ''">
<el-card>
<el-form-item prop="directorUserName" style="margin-bottom: 0">
<h4>技术管理中心主任</h4>
<div style="margin-top: 10px;width: 300px;">
<el-input v-model="roleForm.directorUser" style="display: none;"></el-input>
<el-input v-model="roleForm.directorUserName" placeholder="选择技术管理中心主任" @click.native="choiceZRR('directorUser', '选择技术管理中心主任', roleForm.directorUser)"></el-input>
</div>
</el-form-item>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="批准人" placement="top" :color="roleForm.presidentUser ? '#66b1ff' : ''">
<el-card>
<el-form-item prop="presidentUserName" style="margin-bottom: 0">
<h4>工程研究总院院长</h4>
<div style="margin-top: 10px;width: 300px;">
<el-input v-model="roleForm.presidentUser" style="display: none;"></el-input>
<el-input v-model="roleForm.presidentUserName" placeholder="选择工程研究总院院长" @click.native="choiceZRR('presidentUser', '选择工程研究总院院长', roleForm.presidentUser)"></el-input>
</div>
</el-form-item>
</el-card>
</el-timeline-item>
</el-form>
</el-timeline>
</div>
</div>
<ProcessFooter
show-save
show-submit
:submitLoading="isSubmit"
:saveLoading="saveLoading"
@save="handleSave"
@submit="handleSubmit"
>
</ProcessFooter>
<el-drawer
title="选择责任部门对接人"
:visible.sync="modalshowflag2"
:wrapperClosable="false"
size="800px">
<el-tree
v-if="modalshowflag2"
style="height: 100%; overflow: auto;"
node-key="id"
class="filter-tree"
:data="treeData"
:props="defaultProps"
:default-checked-keys="nodeList2"
highlight-current
check-strictly
default-expand-all
:expand-on-click-node="false"
show-checkbox
ref="tree2">
</el-tree>
<div id="roleFormButton2" class="demo-drawer-footer">
<el-button class="common-button-primary" size="mini" icon="el-icon-check" type="primary" @click="saveUserInfo2">确定</el-button>
<el-button class="common-button-default" size="mini" icon="el-icon-close" @click="cancleUserInfo2">取消</el-button>
</div>
</el-drawer>
<el-drawer
:title="drawerTitle"
:visible.sync="modalshowflag"
:wrapperClosable="false"
size="800px">
<el-tree
v-if="modalshowflag"
node-key="id"
style="height: 100%; overflow: auto;"
class="filter-tree"
:data="treeData"
:props="defaultProps"
:default-checked-keys="nodeList"
highlight-current
check-strictly
@check="drawerCheck"
default-expand-all
:expand-on-click-node="false"
show-checkbox
ref="tree">
</el-tree>
<div id="roleFormButton" class="demo-drawer-footer">
<el-button class="common-button-primary" size="mini" icon="el-icon-check" type="primary" @click="saveUserInfo">确定</el-button>
<el-button class="common-button-default" size="mini" icon="el-icon-close" @click="cancleUserInfo">取消</el-button>
</div>
</el-drawer>
<el-dialog width='400px' :visible.sync="fileMadel" title="上传文件">
<el-upload
multiple
drag
:action="fileUrl"
ref="importfile"
name="file"
accept=".ZIP, .zip, .docx, .DOCX, .xls, .xlsx"
:before-upload="beginImportFile"
:on-success="importFileSuccess"
:show-file-list="false"
>
<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 { saveTaskFirst, queryTaskFirst } from 'api/process'
export default {
name: "bzdyStep1-1",
data() {
return {
commentText: '',
roleRow: {},
nodeList: [],
type: '',
defaultProps: {
children: 'children',
label: 'name'
},
treeData: [], // 人员数据
modalshowflag: false, // drawer开关
drawerTitle: '', //drawer标题
textarea: '', // 意见
title: '', // 新增编辑抽屉标题
ListModel: false, // 新增编辑抽屉开关
active: '1', // 默认显示
isSubmit: false,
saveLoading: false,
form: {
title: '', // 调研标题
date: '', // 完成时间
model: '', // 上传模板
modelName: ''
},
formRules: {
title: [
{ required: true, message: '请输入调研标题', trigger: 'blur' },
],
date: [
{ type: 'date', required: true, message: '请选择完成时间', trigger: 'change' }
],
modelName: [
{ required: true, message: '请上传调研结果', trigger: 'change' },
]
},
roleForm: {
startUserName: this.$store.getters.userInfo.userName,
startUser: this.$store.getters.userInfo.userId,
dockUserList: '',
responUserList: '',
ministerUser: '',
directorUser: '',
presidentUser: '',
dockUserName: '',
responUserListName: '',
ministerUserName: '',
directorUserName: '',
presidentUserName: ''
},
roleFormRules: {
dockUserName: [
{ required: true, message: '请选择责任部门对接人', trigger: 'change' },
],
ministerUserName: [
{ required: true, message: '请选择标准法规部部长', trigger: 'change' },
],
directorUserName: [
{ required: true, message: '请选择技术管理中心主任', trigger: 'change' },
],
presidentUserName: [
{ required: true, message: '请选择工程研究院院长', trigger: 'change' },
]
},
fileUrl: 'api/att/attFile/upload',
fileMadel: false,
nodeList2: [],
modalshowflag2: false,
}
},
components: {
ProcessHeader,
ProcessFooter,
ProcessTitle
},
methods: {
getData () {
queryTaskFirst({
bpnId: this.$route.query.bpnId
}).then(res => {
let mes = JSON.parse(res.mes)
mes.form.date = new Date(this.$moment(mes.form.date).format('YYYY-MM-DD'))
this.form = mes.form
this.roleForm = mes.roleForm
this.commentText = mes.commentText
})
},
choiceZRRS () {
this.nodeList2 = []
if ( this.roleForm.dockUserList.length > 0) {
this.nodeList2 = this.roleForm.dockUserList.split(',')
}
this.modalshowflag2 = true
},
saveUserInfo2 () {
var idList = ''
var nameList = ''
this.$refs.tree2.getCheckedNodes().concat(this.$refs.tree2.getHalfCheckedNodes()).forEach( item => {
if (nameList.length > 0) {
nameList += ','
idList += ','
}
idList += item.id
nameList += item.name
})
this.roleForm.dockUserList = idList
this.roleForm.dockUserName = nameList
this.modalshowflag2 = false
},
cancleUserInfo2 () {
this.modalshowflag2 = false
},
// 导入按钮 上传之前的钩子
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'|| fileSuffix === '.pdf'|| fileSuffix === '.PDF'|| fileSuffix === '.jpg'|| fileSuffix === '.JPG'|| fileSuffix === '.png'|| fileSuffix === '.PNG') {
return true
} else {
this.spinShow = false
this.$message.error('文件' + file.name + '格式不正确,请上传PPT,DOCX,XLS,PDF文件或图片')
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.model = response.data.id
this.form.modelName = response.data.name
this.$message({
showClose: true,
message: response.message,
type: 'success'
})
}
},
fileUpload () {
this.fileMadel = true
},
saveUserInfo () {
if (this.type === 'dockUser') {
this.roleForm.dockUser = this.roleRow.id
this.roleForm.dockUserName = this.roleRow.name
} else if (this.type === 'ministerUser') {
this.roleForm.ministerUser = this.roleRow.id
this.roleForm.ministerUserName = this.roleRow.name
} else if (this.type === 'directorUser') {
this.roleForm.directorUser = this.roleRow.id
this.roleForm.directorUserName = this.roleRow.name
} else if (this.type === 'presidentUser') {
this.roleForm.presidentUser = this.roleRow.id
this.roleForm.presidentUserName = this.roleRow.name
}
this.modalshowflag = false
},
cancleUserInfo () {
this.modalshowflag = false
},
drawerCheck (data) {
var getlist = this.$refs.tree.getCheckedNodes().concat(this.$refs.tree.getHalfCheckedNodes());
if(getlist.length == 1) {
this.roleRow = getlist[0]
}else {
this.$refs.tree.setCheckedKeys([data.id]);
this.roleRow = this.$refs.tree.getCheckedNodes()[0]
}
},
choiceZRR (type, title, id) {
this.nodeList = []
this.nodeList.push(id)
this.type = type
this.drawerTitle = title
this.modalshowflag = true
},
getTree () {
this.$http.get('SarInstitution/institution/institutionAndUser', {}, {}, res=> {
this.treeData = res.data
})
},
handleTabs(name) {
this.active = name
},
handleSave() {
this.saveLoading = true
let _formData = new FormData()
_formData.append('id', this.bpnId || '')
_formData.append('createUser', this.$store.getters.userInfo.userId)
_formData.append('createUserName', this.$store.getters.userInfo.userName)
_formData.append('prcType', '2')
_formData.append('json', JSON.stringify({
form: this.form,
roleForm: this.roleForm
}))
saveTaskFirst(_formData).then(res => {
this.saveLoading = false
this.$message.success('保存成功')
this.bpnId = res.result
}).catch(e => {
this.saveLoading = false
})
},
handleSubmit() {
this.$refs['qbkwForm'].validate((valid) => {
if (valid) {
this.$refs['Form'].validate((valid) => {
if (valid) {
this.isSubmit = true
this.$http.get('lawss/activiti/startProcess', {
type: '2'
}, {}, res => {
if (res.ok) {
var json = Object.assign(this.form, this.roleForm)
json.commentText = this.commentText
this.$http.post('lawss/activiti/completeTask', {
json: JSON.stringify(json),
taskId: res.data,
userId: this.$store.getters.userInfo.userId
}, {}, res => {
if (res.success) {
this.$message.success('流程发起成功')
this.$router.push('/processCenter')
}
this.isSubmit = false
})
} else {
this.isSubmit = false
this.$message.warning('流程启动失败')
}
})
} else {
return this.$message.warning('请完善人员信息')
}
})
} else {
return this.$message.warning('请完善基础信息')
}
})
}
},
mounted () {
this.getData()
this.getTree()
}
}
</script>
<style lang="less" scoped>
@import '~@/assets/styles/style';
.bzdyStep1-1 {
/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>
@@ -96,7 +96,7 @@
</el-form-item>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="选择部门责任人" placement="top" :color="roleForm.dockUser ? '#66b1ff' : ''">
<el-timeline-item timestamp="选择部门责任人" placement="top" :color="roleForm.dockUserName ? '#66b1ff' : ''">
<el-card>
<el-form-item prop="dockUserName" style="margin-bottom: 0">
<h4>责任部门对接人</h4>
@@ -230,6 +230,7 @@
import ProcessHeader from '../../components/ProcessHeader'
import ProcessFooter from '../../components/ProcessFooter'
import ProcessTitle from '../../components/ProcessTitle'
import { saveTaskFirst } from 'api/process'
export default {
name: "bzdyStep1",
@@ -419,7 +420,26 @@ export default {
handleTabs(name) {
this.active = name
},
handleSave() {},
handleSave() {
this.saveLoading = true
let _formData = new FormData()
_formData.append('id', this.bpnId || '')
_formData.append('createUser', this.$store.getters.userInfo.userId)
_formData.append('createUserName', this.$store.getters.userInfo.userName)
_formData.append('prcType', '2')
_formData.append('json', JSON.stringify({
form: this.form,
roleForm: this.roleForm,
commentText: this.commentText
}))
saveTaskFirst(_formData).then(res => {
this.saveLoading = false
this.$message.success('保存成功')
this.bpnId = res.result
}).catch(e => {
this.saveLoading = false
})
},
handleSubmit() {
this.$refs['qbkwForm'].validate((valid) => {
if (valid) {
@@ -75,7 +75,6 @@
</el-collapse>
</div>
<ProcessFooter
show-save
show-submit
:submitLoading="isSubmit"
:saveLoading="saveLoading"
@@ -82,6 +82,9 @@
align="center"
width="180"
>
<template slot-scope="scope">
{{ scope.row.prcName || getPrcName(scope.row.prcType) }}
</template>
</el-table-column>
<el-table-column
prop="prcName"
@@ -210,6 +213,20 @@ export default {
},
dealWith (row) { // 办理
//草稿办理待开发
const { prcType, id } = row
switch (prcType) {
// 法规入库及评估流程
case '2':
this.$router.push({
name: 'bzdyStep1-1',
query: {
type: '2',
processName: '标准调研流程',
bpnId: id
}
})
break
}
},
...mapMutations(['setProcess', 'setHandleInfo']),
...mapActions(['setMenu'])