政策法规资料入库流程

This commit is contained in:
zyn
2023-10-26 16:16:57 +08:00
parent 2755663693
commit 6bfb113d38
12 changed files with 700 additions and 4 deletions
+9
View File
@@ -1101,3 +1101,12 @@ export function processLawsTopicParticipation (data) {
data
})
}
// 政策法规资料入库流程
export function processLawsRegulatoryInformation (data) {
return axios({
url: '/api/lawss/sarLawsTopic/processLawsRegulatoryInformation',
method: 'post',
data
})
}
@@ -4,7 +4,7 @@
:editable="editable"
:disabled="disabled"
:clearable="clearable"
:placeholder="placeholder"
:placeholder="placeholder || defaultPlaceholder"
value-format="yyyy-MM-dd"
@input="handleChange">
</el-datePicker>
@@ -35,10 +35,13 @@ export default {
editable: {
type: Boolean,
default: false
},
placeholder: {
type: String
}
},
computed: {
placeholder () {
defaultPlaceholder () {
return `请选择${this.label}`
},
},
@@ -126,6 +126,7 @@
}"
v-model="form.informationFile"
:allowType="['.pdf', '.PDF', '.doc','.DOC', '.docx','.DOCX', '.pptx', '.PPTX', '.ppt', '.PPT', '.xls','.XLS', '.xlsx','.XLSX', '.pdg', '.PDG', '.zip']"
:size="100"
></customFile>
<el-form-item label="可下载者" prop="viewableBy" label-width="150px" class="add-form-item">
<el-input
@@ -193,7 +194,7 @@ export default {
{type: 'string', max: 500, message: '资料归属部门不能超过500个字符', trigger: 'change'}
],
author: [
{type: 'string', max: 500, message: '资料归属部门不能超过500个字符', trigger: 'change'}
{type: 'string', max: 500, message: '作者不能超过500个字符', trigger: 'change'}
],
}
const form = {
@@ -128,6 +128,10 @@ export default {
label: "政策课题参会流程",
value: "31"
},
{
label: "政策法规资料入库流程",
value: "32"
},
],
formDisableFlag: false,
pickerOptions: {
@@ -0,0 +1,51 @@
<template>
<el-timeline>
<el-form
ref="userForm"
:model="roleForm"
:rules="roleRules"
class="label-input-form">
<TimeLineFormItem
prop="applyUserName"
timestamp="起草"
title="起草人"
:id.sync="roleForm.applyUserId"
:name.sync="roleForm.applyUserName"
disabled />
<TimeLineFormItem
prop="approverName"
timestamp="批准"
title="批准人"
:id.sync="roleForm.approverId"
:name.sync="roleForm.approverName"
:disabled="disabled"
/>
</el-form>
</el-timeline>
</template>
<script>
import TimeLineFormItem from '@/components/hzwlComponents/TimeLineFormItem'
export default {
name: "PersonInfo",
components: {
TimeLineFormItem
},
props: {
roleForm: {
type: Object
},
roleRules: {
type: Object
},
disabled: {
type: Boolean,
default: false
}
},
}
</script>
<style scoped>
</style>
@@ -0,0 +1,553 @@
<template>
<div class="wrapper">
<ProcessHeader toggle>
<template slot="proName">政策法规资料入库流程</template>
<template slot="proNode">{{ title }}</template>
</ProcessHeader>
<div class="headerTabs">
<div class="headerTabsItem" :class="active === '1' ? 'active' : ''" @click="handleTabs('1')">基础信息</div>
<div v-if="!showProcess" class="headerTabsItem" :class="active === '2' ? 'active' : ''" @click="handleTabs('2')">人员信息</div>
<div v-else class="headerTabsItem" :class="active === '3' ? 'active' : ''" @click="handleTabs('3')">审批历史</div>
</div>
<div class="content">
<el-form v-if="reloadForm"
ref="form"
:model="form"
:rules="rules"
class="label-input-form"
label-width="210px"
>
<div v-show="active === '1'">
<ProcessTitle>
<template slot="title">基础信息</template>
</ProcessTitle>
<div class="prc-content-border">
<el-row :gutter="24">
<el-col :span="12">
<SelectMultipleFormItem label="1级资料分类"
title="1级资料分类"
prop="firstType"
v-model="form.firstType"
:options="dict.firstMaterialType || []"
:disabled="disabled">
</SelectMultipleFormItem>
<SelectMultipleFormItem label="3级资料分类"
title="3级资料分类"
prop="thirdType"
v-model="form.thirdType"
:options="dict.thirdMaterialType || []"
:disabled="disabled">
</SelectMultipleFormItem>
<InputFormItem label="资料名称"
prop="name"
v-model="form.name"
:disabled="disabled">
</InputFormItem>
<InputFormItem label="作者"
prop="author"
v-model="form.author"
:disabled="disabled">
</InputFormItem>
<InputFormItem label="资料说明"
prop="description"
v-model="form.description"
:disabled="disabled">
</InputFormItem>
</el-col>
<el-col :span="12">
<SelectMultipleFormItem label="2级资料分类"
title="2级资料分类"
prop="secondType"
v-model="form.secondType"
:options="dict.secondMaterialType || []"
:disabled="disabled">
</SelectMultipleFormItem>
<SelectMultipleFormItem label="4级资料分类"
title="4级资料分类"
prop="fourthType"
v-model="form.fourthType"
:options="dict.fourthMaterialType || []"
:disabled="disabled">
</SelectMultipleFormItem>
<InputFormItem label="资料归属部门"
prop="department"
v-model="form.department"
:disabled="disabled">
</InputFormItem>
<DatePickerFormItem label="上传时间"
prop="uploadTime"
v-model="form.uploadTime"
placeholder="系统自动生成"
disabled>
</DatePickerFormItem>
<UploadFormItem
label="资料文件"
prop="informationFile"
:ids.sync="form.informationFile"
:names.sync="form.informationFileName"
accept='.pdf, .PDF, .doc, .DOC, .docx, .DOCX, .pptx, .PPTX, .ppt, .PPT, .xls, .XLS, .xlsx, .XLSX, .pdg, .PDG, .zip'
:size="100"
:disabled="disabled">
</UploadFormItem>
</el-col>
</el-row>
</div>
<ReceiptDescription v-model="form.commentText" prop="commentText" title="回执说明"></ReceiptDescription>
</div>
<div class="block" style="padding-top: 20px;" v-show="active === '2'">
<PersonInfo ref="roleForm" :roleForm="roleForm" :roleRules="roleRules" :disabled="disabled"></PersonInfo>
</div>
<div class="block" style="padding-top: 20px;" v-show="active === '3'">
<ApprovalHistory :data="processData" :loading="processLoading"></ApprovalHistory>
</div>
</el-form>
</div>
<ProcessFooter
v-if="showProcessFooter"
:show-transfer="showTransfer"
:show-over2="showOver2"
:show-save="showSave"
:show-submit="showSubmit"
:submitLoading="footerLoading"
:saveLoading="footerLoading"
@over2="handleOver"
@transfer="handleTransfer"
@save="handleSave"
@submit="handleApprove"
>
</ProcessFooter>
<!-- 福田全公司选人解决方案 -->
<Role-tree
check-box
:is-title="drawerTitle"
:is-visible.sync="drawerModal"
@checkedRole="checkedRole"
:nodeList="nodeList"
></Role-tree>
</div>
</template>
<script>import ProcessTitle from '@/pages/processCenter/pages/components/ProcessTitle'
import ProcessHeader from '@/pages/processCenter/pages/components/ProcessHeader'
import ProcessFooter from '@/pages/processCenter/pages/components/ProcessFooter'
import ReceiptDescription from "@/components/hzwlComponents/ReceiptDescription";
import ApprovalHistory from "@/components/hzwlComponents/ApprovalHistory";
import InputFormItem from '@/components/hzwlComponents/InputFormItem'
import SelectMultipleFormItem from '@/components/hzwlComponents/SelectMultipleFormItem'
import DatePickerFormItem from '@/components/hzwlComponents/DatePickerFormItem'
import UploadFormItem from '@/components/hzwlComponents/UploadFormItem'
import PersonInfo from "./components/PersonInfo";
import { saveTaskFirst, queryTaskFirst, inboundLiaisonDetail, taskDel, saveTaskForPub, changeAssigneeNew, processLawsRegulatoryInformation } from 'api/process'
export default {
name: "policyRegulatoryMaterials",
components: {
ProcessTitle,
ProcessHeader,
ProcessFooter,
ReceiptDescription,
ApprovalHistory,
InputFormItem,
SelectMultipleFormItem,
DatePickerFormItem,
UploadFormItem,
PersonInfo
},
data () {
const form = {
firstType: '',
secondType: '',
thirdType: '',
fourthType: '',
name: '',
department: '',
author: '',
uploadTime: '',
description: '',
informationFile: '',
informationFileName: '',
commentText: ''
}
const rules = {
firstType: [
{required: true, message: '1级资料分类不能为空', trigger: 'change'}
],
secondType: [
{required: true, message: '2级资料分类不能为空', trigger: 'change'}
],
thirdType: [
{required: true, message: '3级资料分类不能为空', trigger: 'change'}
],
fourthType: [
{required: true, message: '4级资料分类不能为空', trigger: 'change'}
],
name: [
{required: true, type: 'string', message: '资料名称不能为空', trigger: 'change'},
{type: 'string', max: 500, message: '资料名称不能超过500个字符', trigger: 'change'}
],
department: [
{required: true, type: 'string', message: '资料归属部门不能为空', trigger: 'change'},
{type: 'string', max: 500, message: '资料归属部门不能超过500个字符', trigger: 'change'}
],
author: [
{type: 'string', max: 500, message: '作者不能超过500个字符', trigger: 'change'}
],
}
const roleForm = {
applyUserId: this.$store.getters.userInfo.userId,
applyUserName: this.$store.getters.userInfo.userName,
approverId: '',
approverName: ''
}
const roleRules = {
approverName: [
{required: true, message: '请选择批准人', trigger: 'change'},
]
}
return {
title: '起草',
active: '1',
disabled: false,
footerLoading: false,
reloadForm: true,
form,
rules,
roleForm,
roleRules,
// 审批历史
processData: [],
processLoading: false,
showProcess: false,
// 底部按钮
showProcessFooter: true,
showTransfer: false, // 转办
showOver2: false, // 驳回
showSave: true, // 保存
showSubmit: true, // 提交
// 福田全公司选人解决方案
drawerModal: false,
drawerTitle: '',
nodeList: [],
dict: {}
}
},
created() {
this.getDicTypeListCode()
this.setAuth()
this.getData()
this.processTable()
},
methods: {
handleTabs (tab) {
this.active = tab
},
setAuth () {
switch (this.$route.params.type) {
case 'step1':
this.title = '起草'
break
case 'step1_1':
this.title = '重新起草'
break
case 'step2':
this.title = '批准'
break
}
switch (this.$route.params.type) {
case 'step1':
this.disabled = false
this.showProcessFooter = true // 底部显隐
this.showProcess = false // 审批历史
this.showTransfer = false // 转办
this.showOver2 = false // 驳回
this.showSave = true // 保存
this.showSubmit = true // 提交
break
case 'step1_1':
if (this.$route.query.disabledXX) {
this.disabled = true
this.showProcessFooter = false
} else {
this.disabled = false
this.showProcessFooter = true
}
this.showProcess = true
this.showTransfer = false
this.showOver2 = false
this.showSave = true
this.showSubmit = true
this.approval = false
break
case 'step2':
this.disabled = true
this.showProcessFooter = true
this.showProcess = true
this.showTransfer = true
this.showOver2 = true
this.showSave = false
this.showSubmit = true
break
}
},
getData () {
const { bpnId, taskIds, prcId } = this.$route.query
if (taskIds) {
inboundLiaisonDetail({
taskIds,
pId: prcId
}).then(res => {
if (res) {
this.reloadForm = false
const processForm = JSON.parse(res.mesg)
this.form = JSON.parse(JSON.stringify(processForm))
this.roleForm = {
applyUserId: processForm.applyUserId,
applyUserName: processForm.applyUserName,
approverId: processForm.approverId,
approverName: processForm.approverName
}
this.$nextTick(() => {
this.reloadForm = true
})
}
})
return;
}
// 根据草稿查询流程详情
if(bpnId) {
queryTaskFirst({ bpnId }).then(res => {
this.reloadForm = false
let mes = JSON.parse(res.mes)
this.$set(this, 'form', mes.form)
this.roleForm = mes.roleForm
this.$nextTick(() => {
this.reloadForm = true
})
})
}
},
// 审批历史
processTable () {
if (this.$route.query.prcNum) {
this.$http.get('lawss/activiti/get_list_by_instance', {
prcNum: this.$route.query.prcNum
}, {
loading: 'processLoading',
_this: this
}, res => {
this.$set(this, 'processData', res)
}, e => {})
}
},
//保存
handleSave() {
this.footerLoading = true
let _formData = new FormData()
_formData.append('prcType', '32')
if (this.$route.query.taskIds) {
// 流程保存
_formData.append('taskIds', this.$route.query.taskIds)
_formData.append('json', JSON.stringify(this.form))
saveTaskForPub(_formData).then(res => {
this.$message.success('保存成功')
}).finally(e => {
this.footerLoading = false
})
} else {
_formData.append('id', this.$route.query.bpnId || '') // 草稿id
_formData.append('createUser', this.$store.getters.userInfo.userId)
_formData.append('createUserName', this.$store.getters.userInfo.uName)
_formData.append('prcName', '政策法规资料入库流程')
_formData.append('json', JSON.stringify({
taskInfo: '起草',
form: this.form,
roleForm: this.roleForm,
}))
// 保存草稿
saveTaskFirst(_formData).then(res => {
this.$message.success('保存成功')
this.$router.replace({
path: this.$route.path,
query: {
prcType: '32',
bpnId: res.result
}
})
}).finally(e => {
this.footerLoading = false
})
}
},
handleTransfer() {
this.drawerModal = true
this.drawerTitle = '转办处理人'
},
// 转办
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.$router.push({path:'/processCenter?tabsName=ProcessCenter'})
} else {
this.$message.warning(res.message)
}
})
},
// 驳回
handleOver(){
this.form.approvalOpinion = 1
this.handleSubmit()
},
handleApprove(){
// 通过
this.form.approvalOpinion = 0
this.handleSubmit()
},
// 提交
handleSubmit() {
this.addRule()
this.$refs['form'].validate((valid) => {
if (valid) {
this.$refs['roleForm'].$refs['userForm'].validate((valid) => {
if (valid) {
this.submit()
}else {
this.$message.warning('请检查人员信息表单是否填写完整')
}
})
} else {
this.$message.warning('请检查基础信息表单是否填写完整')
}
})
},
addRule () {
if (this.form.approvalOpinion === 0) {
this.rules.commentText = [ { required: false } ]
this.$refs.form.clearValidate('commentText')
}else {
this.rules.commentText = [ { required: true, message: '审批意见不能为空' } ]
}
this.rules = { ...this.rules }
},
async submit () {
this.footerLoading = true
const json = JSON.stringify(Object.assign(this.form, this.roleForm));
let completeTaskQuery = {
taskIds: this.$route.query.taskIds,
userId : this.$store.getters.userInfo.userId,
json
}
if (!this.$route.query.taskIds) {
// 起草
const startProcessRollBackQuery = {
createUser: this.$store.getters.userInfo.userId,
createUserName: this.$store.getters.userInfo.userName,
type: '32',
json
}
const res = await this.$http._post('lawss/activiti/startProcessRollBack', startProcessRollBackQuery)
if(!res.ok) {
this.$message.error(res.message)
this.footerLoading = false
return
}
completeTaskQuery.taskIds = res.data
}
const completeTaskRes = await this.$http._post('lawss/activiti/completeTask', completeTaskQuery)
if (!completeTaskRes.success) {
this.$message.error(completeTaskRes.message)
this.footerLoading = false
return
}
if (this.$route.query.bpnId !== '') {
// 删除草稿
taskDel({ id: this.$route.query.bpnId })
}
if(this.form.approvalOpinion === 1){
this.$message.warning("驳回成功")
this.footerLoading = false
await this.$router.push({path:'/processCenter?tabsName=ProcessCenter'})
} else {
if (this.$route.params.type === 'step2') {
this.processCreate(json)
} else {
this.$message.success(completeTaskRes.message)
this.footerLoading = false
await this.$router.push({path:'/processCenter?tabsName=ProcessCenter'})
}
}
},
// 流程入库
processCreate (json) {
const _formData = new FormData()
_formData.append('infoJson', json)
processLawsRegulatoryInformation(_formData).then(res => {
if (res.result === '操作成功' || res.data === '入库成功') {
this.$message.success(res.data)
setTimeout(() => {
this.$router.push({ name: 'ProcessCenter' })
}, 100)
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.footerLoading = false
})
},
getDicTypeListCode () {
this.$http._getData('sys/dictype/getDicTypeListCode').then(res => {
this.dict = { ...res.data }
})
},
}
}
</script>
<style scoped lang="less">
.wrapper{
position: relative;
height: 100%;
}
.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;
}
</style>
@@ -207,7 +207,7 @@ export default {
showProcessFooter: true,
showTransfer: true, // 转办
showOver2: true, // 驳回
showSave: true, // 报错
showSave: true, // 保存
showSubmit: true, // 提交
approval: false, // 同意
reloadForm: true,
@@ -402,6 +402,10 @@ export default {
//政策课题参会流程
const params = { type: 'step1' }
this.toProcessDetailForParams('policyTopicParticipation', row, params)
} else if(prcType === '32'){
// 政策法规资料入库流程
const params = { type: 'step1' }
this.toProcessDetailForParams('policyRegulatoryMaterials', row, params)
}
} else {
this.$message.warning('当前流程未全部办理完成,无法查看')
@@ -184,6 +184,21 @@
</div>
</el-card>
</div>
<div class="process-name">
<el-card shadow="hover" v-btn-permission="'344c9c97b581400718451e8b8a319382'">
<div class="card-box" @click="handleCreateProcess('32')">
<div class="card-top">
<div class="card-top-left">
<img :src="getImg(Math.floor(Math.random() * 6))">
</div>
<div class="card-top-right">
<div class="card-top-right-text">政策法规资料入库流程</div>
<div class="card-top-right-line"></div>
</div>
</div>
</div>
</el-card>
</div>
<div class="process-name">
<el-card shadow="hover" v-btn-permission="'f01a55435ba41dfe0a4bf99428b9e5c2'">
<div class="card-box" @click="handleCreateProcess('13')">
@@ -638,6 +653,15 @@ export default {
}
})
break
case '32':
// 政策法规资料入库流程
this.$router.push({
name: 'policyRegulatoryMaterials',
params: {
type: 'step1'
}
})
break
}
},
checkPermission(permissionIdArray) {
@@ -2340,6 +2340,29 @@ export default {
})
}
break
case '32': {
let type = ''
switch (row.taskInfo) {
case '批准':
type = 'step2'
break
case '重新起草':
type = 'step1_1'
break
}
this.$router.push({
name: 'policyRegulatoryMaterials',
query: {
taskIds: row.taskIds,
prcId: row.prcId,
prcNum: row.prcNum,
prcName: row.prcName,
prcType: row.prcType
},
params: { type }
})
}
break
}
},
...mapMutations(['setProcess', 'setHandleInfo']),
@@ -975,6 +975,7 @@ export default {
}
})
break
// 政策课题参会流程
case '31':
this.$router.push({
name: 'policyTopicParticipation',
@@ -988,6 +989,20 @@ export default {
}
})
break
// 政策法规资料入库流程
case '32':
this.$router.push({
name: 'policyRegulatoryMaterials',
query: {
prcType: '32',
processName: '政策法规资料入库流程',
bpnId: id,
},
params: {
type: 'step1'
}
})
break
}
},
...mapMutations(['setProcess', 'setHandleInfo']),
+9
View File
@@ -2090,6 +2090,15 @@ const routes = [
title: '政策课题参会流程'
}
},
{
path: '/policyRegulatoryMaterials/:type',
name: 'policyRegulatoryMaterials',
component: () => import('@/pages/processCenter/pages/creatProcess/policyRegulatoryMaterials'),
meta: {
requireAuth: true,
title: '政策法规资料入库流程'
}
},
{
path: '/zcchStep1',
name: 'zcchStep1',