【新增】增加报告上传流程

This commit is contained in:
zhoulingpo
2023-05-05 09:30:28 +08:00
parent cd4ee9f5ba
commit 75280806fc
8 changed files with 1078 additions and 3 deletions
+26 -1
View File
@@ -43,7 +43,20 @@
.el-form-item .el-input__inner {
height: 40px;
line-height: 40px;
font-size: 15px;
font-size: 14px;
}
.el-date-editor.el-input{
width: 100%;
.el-input__inner{
padding-left: 15px !important;
}
}
.el-cascader {
width: 100%;
.el-input__inner{
height: 40px !important;
line-height: 40px !important;
}
}
.el-select{
width: 100%;
@@ -57,6 +70,18 @@
line-height: 40px;
}
}
.is-diable{
.ti-input{
background-color: #F5F7FA;
border-color: #E4E7ED;
color: #C0C4CC;
cursor: not-allowed;
.ti-new-tag-input{
cursor: not-allowed;
}
}
}
}
.blurcolor{
color: #1890FF ;
+29
View File
@@ -0,0 +1,29 @@
const routes = [
// 报告管理
{
path: '/reportprocess',
name: 'Layout',
component: () => import('../../views/Layout.vue'),
children: [
// 报告列表
{
path: 'launch',
name: 'urlIndex',
component: () => import('../../views/reportProcess/launch'),
meta: {
crumb: ['上传报告']
}
},
{
path: 'examine',
name: 'urlIndex',
component: () => import('../../views/reportProcess/examine'),
meta: {
crumb: ['报告审批']
}
}
]
}
]
export default routes
+11 -1
View File
@@ -115,6 +115,9 @@ export default {
this.getMarket().then((resx)=>{
this.$store.commit('setMarketpre', resx)
this.$router.push({ path: '/report/list', query: { id: 'AEHJB8YNJ3' } })
}).catch((resx)=>{
this.$store.commit('setMarketpre', resx)
this.$router.push({ path: '/report/list', query: { id: 'AEHJB8YNJ3' } })
})
}).catch(_ => {
@@ -132,8 +135,15 @@ export default {
getMarket () {
return new Promise((resolve,reject)=>{
this.$api.setting.getOneSetting("水印前缀").then(res=>{
resolve(res.data.configValue)
if(res.data){
resolve(res.data.configValue)
}else{
resolve('')
}
})
}).catch(()=>{
reject('')
})
}
}
+6 -1
View File
@@ -35,9 +35,14 @@ export default {
//获取水印前缀
loadMark(){
this.$api.setting.getAllSetting().then(res=>{
if(res.data){
if(res.data.length>0){
this.formData=res.data
console.log(res.data.data,"res.data.data")
}else{
this.formData=[{
configKey:'水印前缀',
configValue:''
}]
}
})
},
@@ -0,0 +1,137 @@
<template>
<div class="AuditOperationBox">
<el-form
ref="examineForm"
:model="examineForm"
:rules="examineFormRules"
size="medium"
class="label-input-form prc-content-border">
<!-- <el-row :gutter="24">-->
<!-- <el-col :span="9">-->
<!-- <el-form-item label="选择赋权时间:" prop="date"-->
<!-- label-width="132px" class="add-form-item"-->
<!-- :class="{'form-item-disabled': formdisableflag}">-->
<!-- <el-date-picker-->
<!-- v-model="examineForm.date"-->
<!-- type="date"-->
<!-- placeholder="选择赋权时间">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<el-row :gutter="24">
<el-col :span="24">
<el-form-item label="审批结果:" prop="flag"
label-width="132px" class="add-form-item"
:class="{'form-item-disabled': formdisableflag}">
<el-radio-group :disabled="formdisableflag" v-model="examineForm.flag" >
<el-radio :label="'1'">同意</el-radio>
<el-radio :label="'2'">不同意</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="24">
<el-form-item :prop="!formdisableflag?'approvalOpinion':''" label-width="132px" class="add-form-item">
<template slot="label">审批意见:</template>
<el-input :disabled="formdisableflag" :maxlength='1000'
v-model="examineForm.approvalOpinion"
placeholder="请输入审批意见"
:autosize="{ minRows: 2, maxRows: 4}"
type="textarea"
/>
</el-form-item>
</el-col>
</el-row>
<!-- <el-row :gutter="24">-->
<!-- <el-col :span="24">-->
<!-- <el-form-item label="附件" prop="entStandText" label-width="132px" class="add-form-item"-->
<!-- :class="{'form-item-disabled': formdisableflag}">-->
<!-- <el-button-->
<!-- size="small"-->
<!-- class="form-upload-btn"-->
<!-- icon="el-icon-upload"-->
<!-- @click="clickButtonToUpload('approvalFile')"-->
<!-- >-->
<!-- {{ examineForm.approvalFile === 'null' || examineForm.approvalFile === '' ||-->
<!-- examineForm.approvalFile == null ? '点击上传' : '查看已上传的文件' }}-->
<!-- </el-button>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
</el-form>
</div>
</template>
<script>
export default {
name: 'AuditOperation',
props: {
isDisable:{
type:Boolean,
default:false
},
examine:{
type:Object
}
},
data () {
return {
examineForm: {
planReasonFile: '',
oldName: '',
flag: '1',
approvalOpinion: ''
},
examineFormRules: {
flag: [
{ required: true, message: '审核结果不能为空', trigger: 'change' }
],
approvalOpinion: [
{ type: 'string', max: 500, message: '审批意见不能超过500个字符', trigger: 'blur' }
]
},
formdisableflag: false
}
},
created () {
// 判断穿过来的query里的参数 是不是查看
if (this.isDisable) {
this.examineForm = this.examine
this.formdisableflag = true
}
},
methods: {
/** 在提交表单的校验 通过继续执行 */
submit () {
this.isSubmit = false
this.$refs.examineForm.validate((valid) => {
if (valid) {
this.isSubmit = true
return true
} else {
this.$message.warning('请检查表单是否填写正确')
return false
}
})
}
}
}
</script>
<style scoped>
.AssignButton {
font-size: 18px;
}
.AssignButton:hover {
cursor: pointer;
}
</style>
@@ -0,0 +1,281 @@
<template>
<div>
<el-form ref="processFormRef" :model="form" label-width="150px"
:rules="processFormRule" class="label-input-form" size="medium">
<el-row>
<el-col :span="9">
<el-form-item label="流程名称:" prop="prcName">
<el-input :disabled="formControl || formControlname" v-model="form.prcName"
placeholder="请输入流程名称"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="9">
<el-form-item label="报告名称:" prop="name">
<el-input :disabled="formControl" v-model="form.name"
placeholder="请输入报告名称"></el-input>
</el-form-item>
</el-col>
<el-col :span="9" :offset="6" >
<el-form-item label="报告年份:" prop="year">
<el-date-picker :disabled="formControl" v-model="form.year" type="year" value-format="yyyy" placeholder="请选择报告年份"
prefix-icon="null" :picker-options="pickerOptions" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="9">
<el-form-item label="报告所属部门:" prop="department">
<el-input :disabled="formControl" v-model="form.department" placeholder="请选择报告所属部门" maxlength="100" ></el-input>
</el-form-item>
</el-col>
<el-col :span="9" :offset="6">
<el-form-item label="报告涉密等级:" prop="confidentialLevel">
<el-select :disabled="formControl" v-model="form.confidentialLevel" placeholder="请选择报告涉密等级">
<el-option v-for="item in confidentialLevelOptions" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="9">
<el-form-item label="关键词:" prop="tags">
<vue-tags-input :disabled="formControl" :class="{'is-diable':formControl}" placeholder="请输入关键词" v-model="form.tags" :tags="tags"
:avoid-adding-duplicates="false" @tags-changed="newTags =>{
if(newTags[newTags.length - 1].text.length <= 20){
if(tags.length < 10){
tags = newTags
}else{
this.$message({type:'error',message:'关键词数量不能超过10个'})
tags = newTags.slice(0,-1)
}
}
else{
this.$message({type:'error',message:'单个关键词不能超过20个字'})
tags = newTags.slice(0,-1)
}
}" />
</el-form-item>
</el-col>
<el-col :span="9" :offset="6">
<el-form-item label="报告隐私等级:" prop="privacyLevelOptions">
<el-select :disabled="formControl" v-model="form.privacyLevelOptions" placeholder="请选择报告隐私等级">
<el-option v-for="item in privacyLevelOptions" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="9">
<el-form-item label="标签:" prop="department">
<el-cascader :disabled="formControl" width="100%" v-model="form.labelList" :options="cascaderOptions" filterable
:props="{ checkStrictly: true }" clearable placeholder="请选择标签">
<template slot-scope="{ node, data }">
<span :title="data.label">{{ data.label }}</span>
</template>
</el-cascader>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="18">
<el-form-item label="内容摘要:" prop="mainContent">
<el-input :disabled="formControl" v-model="form.mainContent" placeholder="请填写内容摘要" type="textarea" maxlength="500"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="9">
<el-form-item label="上传报告:" required>
<el-upload action="#" :http-request="(params) => uploadFile(params)" :show-file-list="false"
:before-upload="beforeUploadFile">
<el-button :disabled="formControl" >选择文件</el-button>
</el-upload>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="9">
<el-form-item label="权限设置:" required>
<el-button :disabled="formControl">选择文件</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</template>
<script>
import { fileType } from '@/utils/fileType'
import VueTagsInput from '@johmun/vue-tags-input';
export default {
components:{
VueTagsInput
},
props:{
formControl:{
type:Boolean,
default:false
},
formControlname:{
type:Boolean,
default:false
},
processForm:{
type:Object
}
},
data(){
return {
confidentialLevelOptions:[],
cascaderOptions: [],
privacyLevelOptions: [],
tags:[],
pickerOptions: {
disabledDate(time) {
return time.getFullYear() > new Date().getFullYear() + 1 || time.getFullYear() < new Date().getFullYear() - 10;
},
},
form:{
},
processFormRule:{
prcName:[
{
required:true,
message:"流程名称不能为空",
trigger:'change'
},{
max:100,
message:"流程名称不能超过100字符",
trigger:'change'
}
],
name: [{
required:true,
message:"报告名称不能为空",
trigger:'change'
},{
max:100,
message:"报告名称不能超过100字符",
trigger:'change'
}],
mainContent: [{
max:500,
message:"内容摘要不能超过500字符",
trigger:'change'
}],
year: [{
required:true,
message:"报告年份不能为空",
trigger:'change'
}],
reportUserIdList:[
{
required:true,
message:"权限不能为空",
trigger:'change'
}
],
fileName:[
{
required:true,
message:"报告文件不能为空", trigger:'change'
}
]
}
}
},
methods:{
//用递归方式去除children
getTreeData(data) {
for (var i = 0; i < data.length; i++) {
if (data[i].children.length < 1) {
// children若为空数组,则将children设为undefined
data[i].children = undefined;
} else {
// children若不为空数组,则继续 递归调用 本方法
this.getTreeData(data[i].children);
}
}
return data;
},
updateList(){
this.$api.report.labelList().then(res => {
this.cascaderOptions=this.getTreeData(res.data)
})
this.$forceUpdate()
},
// 上传文件
uploadFile(params) {
let fd = new FormData();
fd.append('file', params.file);
this.$api.report.reportUploadFile(fd).then(({ data }) => {
this.form.fileName = data.name;
this.form.fileId = data.key;
})
},
// 上传文件前
beforeUploadFile(file) {
let realFileType = file.name.split('.')[file.name.split('.').length - 1];
const isType = (
file.type === fileType.pdf || file.type === fileType.xls || file.type === fileType.xlsx || file.type === fileType.doc || file.type === fileType.docx || file.type === fileType.ppt || file.type === fileType.pptx
|| realFileType === 'pdf' || realFileType === 'xls' || realFileType === 'xlsx' || realFileType === 'doc' || realFileType === 'docx' || realFileType === 'ppt' || realFileType === 'pptx'
);
const isSize = file.size / 1024 / 1024 < 200;
if (!isType) {
this.$message.error('仅能上传 pdfxlsxlsxdocdocxpptpptx 格式文件');
}
if (!isSize) {
this.$message.error('您最大可上传200M文件');
}
return isType && isSize;
},
submit(){
let flag
this.$refs.processFormRef.validate(v=>{
flag=v
return v
})
return flag
}
},
mounted() {
this.updateList()
}
}
</script>
<style lang="scss" scoped>
::v-deep .ti-input {
border-radius: 4px;
border: 1px solid #DCDFE6;
min-height: 40px;
line-height: 40px;
.ti-new-tag-input{
padding-left: 5px;
}
.ti-new-tag-input::placeholder {
color: #C0C4CC;
font-size: 14px;
}
.ti-new-tag-input:-ms-input-placeholder {
color: #C0C4CC;
font-size: 14px;
}
.ti-new-tag-input:-moz-placeholder {
color: #C0C4CC;
font-size: 14px;
}
}
::v-deep .vue-tags-input :focus{
border: 1px solid #1890ff;
}
</style>
+195
View File
@@ -0,0 +1,195 @@
<script src="../../api/modules/process.js"></script>
<template>
<!-- 此页面主要展示审核和已完成-->
<div class="process">
<div class="process_box">
<process-header v-if="$route.query.type !== 'yiban'" :title="'权限审批'" :proceesNum="prcNum"></process-header>
<process-header v-else :title="'已办流程'" :proceesNum="prcNum"></process-header>
<div class="procedure">
<div class="process_content">
<span class="base_title">基础信息</span>
<report-form :form-control="true" :form-controlname="true"
:process-form="processForm"></report-form>
</div>
<div class="process_content">
<span class="base_title">审批历史</span>
<process-approval-history :prcNum="prcNum"></process-approval-history>
</div>
<!-- v-if="$route.query.type !=='yiban'"-->
<div class="process_content" v-if="$route.query.type !=='yiban'">
<span class="base_title">审核信息</span>
<audit-operation ref="operationRef" :examine="submitjson" :is-disable="disabled"></audit-operation>
</div>
</div>
<process-footer
v-if="!disabled"
showCancel
:show-transfer="isShowTran"
:show-submit="isShowSubmit"
:submitLoading="isSubmit"
:TransferLoading="tranLoading"
@transfer="handleTransfer"
@submit="handleSubmit"
></process-footer>
<!-- <process-choose-tree-->
<!-- dialog-model-->
<!-- :visible.sync="visibleTree"-->
<!-- :maxSelected="1"-->
<!-- :config="{value: '',valueName:''}"-->
<!-- @confirm="handleDblClick"-->
<!-- ></process-choose-tree>-->
<processChooseTree :visible.sync="visibleTree" title="人员列表" dialog-model :config="{
value: '',
valueName: ''
}" :workNumFlag="true" :maxSelected="1" @confirm="handleDblClick"></processChooseTree>
</div>
</div>
</template>
<script>
import processHeader from '@/components/ProcessHeader'
import processFooter from '@/components/ProcessFooter'
import processChooseTree from '../../components/OrgTable'
import processApprovalHistory from '@/components/ProcessApprovalHistory'
import auditOperation from './components/AuditOperation'
import reportTable from './components/reportForm'
import { PERMISSION } from '@/utils/Enum/enum'
import processMixin from "../../components/ProcessMixin";
import reportForm from "./components/reportForm";
export default {
name: 'launch',
mixins: [processMixin],
components: {
processHeader,
reportTable,
processFooter,
processApprovalHistory,
auditOperation,
processChooseTree,
reportForm
},
data () {
return {
processFormRule: {
prcName: [{
required: true,
message: '请输入流程名称',
trigger: 'change'
},{
max: 100,
message: '申请原因最多填写100字符',
trigger: 'change'
}]
},
processForm: { prcName : ''},
visibleTree: false,
isSubmit: false,
tranLoading: false,
isShowTran: true,
isShowSubmit: true,
formControl: true,
disabled:false,
assignForm: {},
tableData: [],
applicationForm: {
power:'',
applyReason:''
},
q: {
pageSize: 10000,
pageNo: 1
},
PERMISSION,
submitjson:{},
prcType:1
}
},
created () {
this.taskId=this.$store.getters.handleProcess.taskId
this.prcNum=this.$store.getters.handleProcess.prcNum
this.prcId=this.$store.getters.handleProcess.prcId
this.prcName=this.$store.getters.handleProcess.prcName
this.$set(this.processForm,'prcName',this.prcName)
let params={
prcId: this.prcId,
prcType: this.prcType
}
if(this.$route.query.type=='yiban'){
this.disabled=true
}
this.getProcessDetail(params).then(res=>{
this.processForm = JSON.parse(this.processOld.dataJson)
this.disabled=false
this.formControl= true
if(this.$route.query.type=='yiban'){
this.disabled=true
// this.submitjson=JSON.parse(res.processOld.submitJson)
}else{
}
})
},
methods: {
// 转办
handleTransfer() {
this.visibleTree = true
},
// 选择转办
handleDblClick(treeNode) {
this.JuggleSub(this.taskId).then(res=> {
if(res){
if( treeNode[0].USID == this.$store.getters.userInfo.usid){
this.$message.warning("您不能转办给自己")
}else{
this.$api.process.changeAssignee({
taskId: this.taskId,
assignee: treeNode[0].USID,
userId: this.$store.getters.userInfo.usid,
pId: this.prcId
}).then(() => {
this.$message.success('转办成功')
this.$router.push({path: '/userCenter/processCenter', query: {id: this.$route.query.id}})
this.visibleTree = false
})
}
}
})
// taskId: this.$store.getters.getHandleInfo.taskId, // 任务id
// assignee: treeNode[0].userId, // 转办人
// userId: this.$store.getters.userInfo.userId, // dangqian人
// pId: this.$store.getters.getHandleInfo.prcId // 流程实例
},
handleSubmit() {
this.JuggleSub(this.taskId).then(res=> {
if(res){
let submit = JSON.parse(this.processOld.submitJson)
let dataJson = this.processOld.dataJson
let submitJson = JSON.stringify({...submit, ...this.$refs.operationRef.examineForm})
this.completeProcess({
dataJson,
submitJson,
taskId: this.taskId,
userId: this.$store.getters.userInfo.usid,
prcType: this.prcType
})
}
})
// if (this.$refs.operationRef.submit()) {
// 通过了校验 需要整合参数 拿到原来的dataJson 再把新添加的增进去 在拼成dataJson
}
}
}
</script>
<style scoped>
</style>
+393
View File
@@ -0,0 +1,393 @@
<template>
<div class="process">
<div class="process_box">
<process-header v-if="$route.query.isBegin || $route.query.isDraft" :title="'发起流程'"></process-header>
<process-header v-else-if="$route.query.type == 'yiban'" :title="'已办流程'" :proceesNum="prcNum"></process-header>
<process-header v-else :title="'发起人修改'" :proceesNum="prcNum"></process-header>
<div class="procedure">
<div class="process_content">
<span class="base_title">基础信息</span>
<report-form ref="basMes" :form-control="formControl" :form-controlname="formControlname"
:process-form="processForm"></report-form>
</div>
<div class="process_content" v-if="initShow">
<span class="base_title">审批历史</span>
<process-approval-history :prcNum="prcNum"></process-approval-history>
</div>
<div class="process_content">
<span class="base_title">指派信息</span>
<el-form ref="assignFormRef" :model="assignForm" label-width="150px"
:rules="assignFormRules" class="label-input-form" size="medium">
<el-row>
<el-col :span="9">
<el-form-item label="选择一级审批人员:" prop="oneApprove">
<el-input readonly :disabled="formControl" v-model="assignForm.oneApproveName"
@click.native="handleCheck('spr1')"
placeholder="请选择一级审批人员"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="9">
<el-form-item label="选择二级审批人员:" prop="twoApprove">
<el-input readonly :disabled="formControl" v-model="assignForm.twoApproveName"
@click.native="handleCheck('spr2')"
placeholder="请选择二级审批人员"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="说明:" prop="remark">
<el-input type="textarea" :disabled="formControl" v-model="assignForm.remark" placeholder="请输入说明"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</div>
<process-footer
v-if="!formControl"
showCancel
:show-save="isShowSave"
:show-submit="isShowSubmit"
:submitLoading="isSubmit"
:resetLoading="saveLoading"
@save="handleSave"
@submit="handleSubmit"
></process-footer>
<orgTable :visible.sync="visibleOrgTable" title="人员列表" dialog-model :config="{
value: orgTableVal,
valueName: orgTableValName
}" :workNumFlag="true" :maxSelected="1" @confirm="isTreeOk"></orgTable>
</div>
</div>
</template>
<script>
import processHeader from '@/components/ProcessHeader'
import processFooter from '@/components/ProcessFooter'
import processApprovalHistory from '@/components/ProcessApprovalHistory'
import reportTable from './components/reportForm'
import {PERMISSION} from '@/utils/Enum/enum'
import orgTable from '../../components/OrgTable'
import processMixin from "../../components/ProcessMixin";
import reportForm from "./components/reportForm";
export default {
name: 'launch',
components: {
processHeader,
reportTable,
processFooter,
processApprovalHistory,
orgTable,
reportForm
},
mixins: [processMixin],
data() {
return {
showTableD: false,
initShow: false, // 控制审批历史是否显示 只有在不是第一次的时候才是true
treeType: '',
orgTableVal: '',
orgTableValName: '',
visibleOrgTable: false,
isSubmit: false,
saveLoading: false,
isShowSave: false,
isShowSubmit: true,
formControl: false,
formControlname: false,
assignForm: {
oneApprove: '',
twoApprove: '',
twoApproveName: '',
oneApproveName: '',
remark:''
},
processForm: {
prcName: '',
privacyLevel: '',
},
processFormRule: {
prcName: [{
required: true,
message: '请输入流程名称',
trigger: 'change'
}, {
max: 100,
message: '申请原因最多填写100字符',
trigger: 'change'
}]
},
applicationFormRule: {
applyReason: [{
max: 500, message: '申请原因最多填写500字符'
}],
power: [{
required: true,
message: '请选择申请权限'
}]
},
assignFormRules: {
oneApprove: [{
required: true,
message: '请选择一级审批人员',
trigger: 'change'
}],
twoApprove: [{
required: true,
message: '请选择二级审批人员',
trigger: 'change'
}],
remark: [{
max: 500, message: '说明最多填写500字符'
}]
},
prcType: 2,
prcName:''
}
},
async created() {
// 第一次进入此页面 需要清楚校验
if (this.$route.query.isBegin) {
// if (this.$route.query.ids.split(',').length > 0) {
// this.reportList(this.$route.query.ids)
// }
this.isShowSave = true
this.$store.commit('setHandleProcess','')
this.handleReset()
}
// 如果是从草稿进入的
if (this.$route.query.isDraft) {
this.isShowSave = true
this.taskId = this.$store.getters.handleProcess?.taskId
this.prcNum = this.$store.getters.handleProcess?.prcNum
this.prcId = this.$store.getters.handleProcess?.prcId
this.prcName = this.$store.getters.handleProcess?.prcName
this.getDraftDetail().then(res => {
this.$set(this.processForm,'prcName', this.prcName)
if(this.processOld.submitJson !== '{}'){
let submitJson=JSON.parse(this.processOld.submitJson)
this.processForm=JSON.parse(this.processOld.dataJson)
this.$set(this.assignForm,'oneApprove',submitJson.oneApprove)
this.$set(this.assignForm,'oneApproveName',submitJson.oneApproveName)
this.$set(this.assignForm,'twoApprove',submitJson.twoApprove)
this.$set(this.assignForm,'twoApproveName',submitJson.twoApproveName)
this.$set(this.assignForm,'remark',submitJson.remark)
}
this.$nextTick(()=>{
this.$refs.processFormRef.clearValidate()
this.$refs.assignFormRef.clearValidate()
})
})
}
if (this.$route.query.taskDefinitionKey == 'aid4' ) {
this.taskId = this.$store.getters.handleProcess.taskId
this.prcNum = this.$store.getters.handleProcess.prcNum
this.prcId = this.$store.getters.handleProcess.prcId
this.prcName = this.$store.getters.handleProcess.prcName
this.prcName = JSON.stringify(this.prcName)
this.initShow = true
this.formControlname = true
this.$set(this.processForm,'prcName',this.$route.query.prcName)
await this.getProcessDetail()
let submitJson = JSON.parse(this.processOld.submitJson)
// this.applicationForm.applyReason = applyReason.applyReason
this.processForm=JSON.parse(this.processOld.dataJson)
this.$set(this.assignForm,'oneApprove',submitJson.oneApprove)
this.$set(this.assignForm,'oneApproveName',submitJson.oneApproveName)
this.$set(this.assignForm,'twoApprove',submitJson.twoApprove)
this.$set(this.assignForm,'twoApproveName',submitJson.twoApproveName)
this.$set(this.assignForm,'remark',submitJson.remark)
}
if (this.$route.query.type == 'yiban') {
this.taskId = this.$store.getters.handleProcess.taskId
this.prcNum = this.$store.getters.handleProcess.prcNum
this.prcId = this.$store.getters.handleProcess.prcId
this.prcName = this.$store.getters.handleProcess.prcName
this.formControl = true
this.initShow = true
this.showTableD = true
this.$set(this.processForm,'prcName', this.prcName)
this.getProcessDetail().then((res) => {
let submitJson = JSON.parse(this.processOld.submitJson)
this.processForm=JSON.parse(this.processOld.dataJson)
// this.applicationForm.applyReason = applyReason.applyReason
this.$set(this.assignForm,'oneApprove',submitJson.oneApprove)
this.$set(this.assignForm,'oneApproveName',submitJson.oneApproveName)
this.$set(this.assignForm,'twoApprove',submitJson.twoApprove)
this.$set(this.assignForm,'twoApproveName',submitJson.twoApproveName)
this.$set(this.assignForm,'remark',submitJson.remark)
})
}
},
methods: {
handleReset() {
this.processForm.prcName = ''
if(this.$route.query.taskDefinitionKey == 'aid4'){
this.processForm.prcName = this.prcName
}
this.applicationForm = {
applyReason: '',
power: ''
}
this.assignForm = {
oneApprove: '',
twoApprove: ''
}
this.$nextTick(() => {
this.$refs.applicationFormRef.clearValidate()
this.$refs.assignFormRef.clearValidate()
})
},
handleCheck(name) {
if (this.formControl) {
return false
}
this.treeType = name
this.orgTableVal = ''
this.orgTableValName = ''
if (name === 'spr1') {
this.orgTableVal = this.assignForm.oneApprove ? this.assignForm.oneApprove : ''
this.orgTableValName = this.assignForm.oneApproveName ? this.assignForm.oneApproveName : ''
} else {
this.orgTableVal = this.assignForm.twoApprove ? this.assignForm.twoApprove : ''
this.orgTableValName = this.assignForm.twoApproveName ? this.assignForm.twoApproveName : ''
}
this.visibleOrgTable = true
},
// 树点击
isTreeOk(checkedList) {
// console.log(checkedList)
const parts = []
const partsName = []
console.log(checkedList, '0009999')
checkedList.map((item, index) => {
parts.push(item.userId || item.USID)
partsName.push(item.uname)
})
this.qcrList = checkedList
if (this.treeType === 'spr1') {
this.assignForm.oneApprove = parts.toString()
this.assignForm.oneApproveName = partsName.toString()
} else if (this.treeType === 'spr2') {
this.assignForm.twoApprove = parts.toString()
this.assignForm.twoApproveName = partsName.toString()
}
// console.log(this.assignForm.name1Id, this.assignForm.name2Id)
},
// 获取表格列表 吧查询到的值传给子组件
reportList(ids) {
this.$api.permissionProcess.getReportLisy({
pageSize:1000,
pageNo:1,
ids: ids.split(',')
}).then(({data}) => {
this.tableData = data.records.map(item => {
item.reportId = item['id']
delete item['id']
return item
})
})
},
// 保存
handleSave(){
this.saveLoading = true
let submitJson = JSON.stringify({...this.assignForm, userId: this.$store.getters.userInfo.usid,approvalOpinion:this.assignForm.remark})
let dataJson = JSON.stringify(this.tableData)
let params = {
prcName: this.processForm.prcName,
userId: this.$store.getters.userInfo.usid,
prcType: this.prcType,
createUserName: this.$store.getters.userInfo.usname,
createUser: this.$store.getters.userInfo.usid,
submitJson,
dataJson,
id: this.$store.getters.handleProcess?.id
}
this.saveProcess(params).then(
()=>{
this.saveLoading = false
this.$message['success']('保存成功')
this.$router.push({
path: "/userCenter/processCenter",
query: {
id: 'AEHJB8YNJ3'
}
})
}
).catch(()=>{
this.saveLoading = false
})
},
// 提交
handleSubmit() {
console.log(this.$store.getters.userInfo.usid, " this.$store.getters.userInfo.USID")
this.$refs.assignFormRef.validate(async v => {
debugger
let z=this.$refs.basMes.submit()
if (v && z) {
//如果不是第一次
if (this.initShow) {
let flag=await this.JuggleSub(this.taskId)
if(flag){
let dataJson = JSON.stringify(this.tableData)
let submitJson = JSON.stringify({...this.assignForm, userId: this.$store.getters.userInfo.usid,approvalOpinion:this.assignForm.remark})
this.completeProcess({
dataJson,
submitJson,
taskId: this.taskId,
userId: this.$store.getters.userInfo.usid,
prcType: this.prcType
})
}
} else {
this.startProcess()
}
} else {
this.$message.warning('请检查表单填写完整')
}
})
},
startProcess() {
//把表单都整合到form中
// dataJson与submitJson需要发到completeProcess
let form = {}
form = {
approveData: {
...this.processForm, ...this.assignForm,
userId: this.$store.getters.userInfo.usid
}, dataMsg: this.tableData
}
form.approvalOpinion = this.assignForm.remark
form.prcType = this.prcType
form.prcName = this.processForm.prcName
form.userId = this.$store.getters.userInfo.usid
form.bpnId = this.$store.getters.handleProcess?.id
//...this.applicationForm,...this.processForm,
let dataJson = JSON.stringify(this.processForm)
let submitJson = JSON.stringify({...this.assignForm, userId: this.$store.getters.userInfo.usid,approvalOpinion:this.assignForm.remark})
this.$api.process.startProcess(form).then(({data}) => {
this.completeProcess({dataJson, submitJson, taskId: data.result, userId: form.userId, prcType: this.prcType})
})
},
//获取流程详细信息
}
}
</script>
<style scoped>
</style>