diff --git a/src/api/modules/process.js b/src/api/modules/process.js index 60c1525..c6d4da2 100644 --- a/src/api/modules/process.js +++ b/src/api/modules/process.js @@ -90,6 +90,14 @@ export default { data: data }) }, + // 通用流程提交 + completeTaskALL(data){ + return request({ + url: '/api/batchCompleteTask', + method: 'post', + data: data + }) + }, // 通用流程详细信息查询 getProcessDetail( data ){ return request({ @@ -116,6 +124,15 @@ export default { }) }, + // 停用流程发起 + startProcessALL(data) { + return request({ + url: '/api/batchStartProcess', + method: 'post', + data: data + + }) + }, // 保存到草稿 saveProcess(data) { return request({ diff --git a/src/assets/css/process.scss b/src/assets/css/process.scss index 3b95180..13248f5 100644 --- a/src/assets/css/process.scss +++ b/src/assets/css/process.scss @@ -97,6 +97,20 @@ word-break: break-word; max-height: 300px; overflow: auto; - +} +.no_border{ + .el-form-item .el-input__inner { + height: 40px; + line-height: 40px; + font-size: 14px; + border: none; + } +.el-form-item .el-textarea__inner{ + border: none; +} + .el-input.is-disabled .el-input__inner, + .el-textarea.is-disabled .el-textarea__inner{ + background-color: #fff; + } } diff --git a/src/components/OrgTable.vue b/src/components/OrgTable.vue index 92b63d1..6cfdf96 100644 --- a/src/components/OrgTable.vue +++ b/src/components/OrgTable.vue @@ -948,7 +948,7 @@ export default { }) if (this.maxSelected == 1) { - // debugger + // this.tableChecked = this.config.value this.isShowOrg = false } diff --git a/src/components/ProcessMixin.vue b/src/components/ProcessMixin.vue index 3376d9d..9901d1a 100644 --- a/src/components/ProcessMixin.vue +++ b/src/components/ProcessMixin.vue @@ -1,4 +1,5 @@ + diff --git a/src/views/permissionApplication/components/reportDrawer.vue b/src/views/permissionApplication/components/reportDrawer.vue new file mode 100644 index 0000000..1a0ae5c --- /dev/null +++ b/src/views/permissionApplication/components/reportDrawer.vue @@ -0,0 +1,233 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 确定 + 取消 + + + + + + + + + diff --git a/src/views/permissionApplication/components/reportTable.vue b/src/views/permissionApplication/components/reportTable.vue index 0b903c4..1309a22 100644 --- a/src/views/permissionApplication/components/reportTable.vue +++ b/src/views/permissionApplication/components/reportTable.vue @@ -1,41 +1,45 @@ - 添加报告 + 批量删除 - - - - - - - + + + + + + + - + + 编辑 删除 - - + + + + + + + + + + + + @@ -7,82 +9,17 @@ 基础信息 - - - - - - - - - - - - - - - - - - - - - - - - - - + 审批历史 - - 指派信息 - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -107,8 +41,8 @@ import processHeader from '@/components/ProcessHeader' import processFooter from '@/components/ProcessFooter' import processApprovalHistory from '@/components/ProcessApprovalHistory' import reportTable from './components/reportTable' -import {PERMISSION} from '@/utils/Enum/enum' -import orgTable from '../../components/OrgTable' + + import processMixin from "../../components/ProcessMixin"; export default { @@ -118,7 +52,6 @@ export default { reportTable, processFooter, processApprovalHistory, - orgTable }, mixins: [processMixin], data() { @@ -135,7 +68,6 @@ export default { isShowSave: false, isShowSubmit: true, formControl: false, - formControlname: false, assignForm: { oneApprove: '', twoApprove: '', @@ -152,7 +84,6 @@ export default { pageSize: 10000, pageNo: 1 }, - PERMISSION, processForm: { prcName: '' }, @@ -167,43 +98,27 @@ export default { 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: 1, - prcName:'' + prcName:'', + params:[] //处理好格式的数据 + } }, async created() { // 第一次进入此页面 需要清楚校验 if (this.$route.query.isBegin) { // if (this.$route.query.ids.split(',').length > 0) { - // this.reportList(this.$route.query.ids) + this.reportList(this.$route.query.ids) // } this.isShowSave = true this.$store.commit('setHandleProcess','') - this.handleReset() } // 如果是从草稿进入的 if (this.$route.query.isDraft) { @@ -213,26 +128,8 @@ export default { 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) - let tableData = JSON.parse(this.processOld.dataJson) - this.$set(this.applicationForm,'power',tableData[0].power) - this.$set(this.applicationForm,'applyReason',tableData[0].applyReason) - if(tableData[0].reportId){ - this.tableData=tableData - } - if(this.processOld.submitJson !== '{}'){ - let submitJson=JSON.parse(this.processOld.submitJson) - 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.applicationFormRef.clearValidate() - this.$refs.assignFormRef.clearValidate() - }) + + }) } @@ -249,28 +146,7 @@ export default { let submitJson = JSON.parse(this.processOld.submitJson) // this.applicationForm.applyReason = applyReason.applyReason this.tableData = JSON.parse(this.processOld.dataJson) - if(this.tableData.length>0){ - this.$set(this.applicationForm,'power',this.tableData[0].power) - this.$set(this.applicationForm,'applyReason',this.tableData[0].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) - //指派信息 - // ({oneApprove:this.assignForm.oneApprove,oneApproveName:this.assignForm.oneApproveName,twoApprove:this.assignForm.twoApprove,twoApproveName:this.assignForm.twoApproveName,remark:this.assignForm.remark}= JSON.parse(this.processOld.submitJson)) - // this.getProcessDetail().then(res => { - // //基础信息 - // let applyReason = JSON.parse(res.processOld.dataJson) - // res.tableData = JSON.parse(res.processOld.dataJson) - // res.applicationForm.power = res.tableData[0].power - // debugger - // res.applicationForm.applyReason = applyReason[0]?.applyReason - // - // //指派信息 - // ({oneApprove:res.assignForm.oneApprove,oneApproveName:res.assignForm.oneApproveName,twoApprove:res.assignForm.twoApprove,twoApproveName:res.assignForm.twoApproveName,remark:res.assignForm.remark}= JSON.parse(res.processOld.submitJson)) - // }) + } if (this.$route.query.type == 'yiban') { this.taskId = this.$store.getters.handleProcess.taskId @@ -282,23 +158,13 @@ export default { this.showTableD = true this.$set(this.processForm,'prcName', this.prcName) this.getProcessDetail().then((res) => { - let submitJson = JSON.parse(this.processOld.submitJson) - // this.applicationForm.applyReason = applyReason.applyReason - this.tableData = JSON.parse(this.processOld.dataJson) - this.$set(this.applicationForm,'power',this?.tableData[0].power) - this.$set(this.applicationForm,'applyReason',this?.tableData[0].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: { getV(newValue,jiaVlue) { - debugger if(jiaVlue &&jiaVlue.length > 0){ jiaVlue.forEach(item=>{ this.delData.push({ @@ -324,42 +190,7 @@ export default { }) }, - 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({ @@ -375,32 +206,54 @@ export default { }) }, handleReset() { - this.processForm.prcName = '' if(this.$route.query.taskDefinitionKey == 'reEdit'){ this.processForm.prcName = this.prcName } - this.applicationForm = { - applyReason: '', - power: '' - } - - this.assignForm = { - oneApprove: '', - twoApprove: '' - } - this.$nextTick(() => { - this.$refs.applicationFormRef.clearValidate() - this.$refs.assignFormRef.clearValidate() + }, + //判断表格数据是否完整 + JuggleTableAll(){ + let list= this.tableData.filter(item=>{ + if(!item.twoApprove || item.twoApprove=='' || item.power==''){ + return item + } }) - + if(list.length>0){ + return false + } + return true }, // 整理数据 organizeData() { - let userId = this.$store.getters.userInfo.usid - this.tableData = this.tableData.map(item => { - item = {...item, ...this.applicationForm, userId: userId} - return item + let newParams=[] + + newParams=this.tableData.map(item=>{ + let obj={} + obj={ + prcName:item.name, + prcType:item.power, + createUser:this.userId, + createUserName:this.userName, + userId:this.userId, + submitIson:'', + dataJson:'', + bpnId: this.$store.getters.handleProcess?.id + } + let submitIson={ + oneApprove:item.oneApprove, + oneApproveName:item.oneApproveName, + twoApprove:item.twoApprove, + twoApproveName:item.twoApproveName, + } + delete item['oneApprove'] + delete item['oneApproveName'] + delete item['twoApprove'] + delete item['twoApproveName'] + let dataJson=item + obj.submitIson=JSON.stringify(submitIson) + obj.dataJson=JSON.stringify(dataJson) + return obj }) + this.params=newParams }, // 保存 handleSave(){ @@ -440,66 +293,63 @@ export default { }, // 提交 handleSubmit() { - console.log(this.$store.getters.userInfo.usid, " this.$store.getters.userInfo.USID") - this.$refs.assignFormRef.validate(v => { - this.$refs.applicationFormRef.validate(m => { - this.$refs.processFormRef.validate(async z => { - if (v && m && z) { - // 过了校验 需要把数据都整合 this.tableData this.applicationForm this.assignForm - // 表格数据没有不能提交 需要提示 - if (this.tableData.length == 0) { - this.$message.warning('至少需要选择一条报告数据') - } else { - // 调用流程数据 - console.log("发送数据") - // 处理表格数据 - //如果不是第一次 - if (this.initShow) { - let flag=await this.JuggleSub(this.taskId) - if(flag){ - console.log(this.delData,"flagflagflagflag") - debugger - if(this.delData){ - this.delDatas().then(()=>{ - this.organizeData() - 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.organizeData() - 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 - }) - } + // 过了校验 需要把数据都整合 this.tableData this.applicationForm this.assignForm + // 表格数据没有不能提交 需要提示 + if (this.tableData.length == 0) { + this.$message.warning('至少需要选择一条报告数据') + } else { + // 调用流程数据 + console.log("发送数据") + // 处理表格数据 - } - } else { - this.isSendDraft().then(()=>{ - this.organizeData() - this.startProcess() + //如果不是第一次 + if (this.initShow) { + let flag= this.JuggleSub(this.taskId) + if(flag){ + console.log(this.delData,"flagflagflagflag") + + if(this.delData){ + this.delDatas().then(()=>{ + this.organizeData() + 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.organizeData() + 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.$message.warning('请检查表单填写完整') + } - }) - }) - }) + } else { + if(this.JuggleTableAll()){ + + this.organizeData() + this.startProcess() + }else{ + this.$message.warning("请把表格数据填写完整") + } + // this.isSendDraft().then(()=>{ + + // }) + } + } + }, //修改参数 changeParam() { @@ -524,24 +374,9 @@ export default { }, startProcess() { //把表单都整合到form中 - // dataJson与submitJson需要发到completeProcess - let form = {} - form = { - approveData: { - ...this.applicationForm, ...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.tableData) - 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}) + + this.$api.process.startProcessALL(this.params).then(({data}) => { + this.completeProcessALL(this.params) }) }, //获取流程详细信息 diff --git a/src/views/reportProcess/components/AuditOperation.vue b/src/views/reportProcess/components/AuditOperation.vue index b052825..70483aa 100644 --- a/src/views/reportProcess/components/AuditOperation.vue +++ b/src/views/reportProcess/components/AuditOperation.vue @@ -134,11 +134,11 @@ export default { }, methods: { handleTransfer(){ - debugger + this.$emit('handleTransfer') }, handleSubmit(type) { - debugger + if(type=='n'){ // 校验原因是否填写 this.examineForm.flag=2 diff --git a/src/views/reportProcess/components/reportForm.vue b/src/views/reportProcess/components/reportForm.vue index de72b83..7acfbe0 100644 --- a/src/views/reportProcess/components/reportForm.vue +++ b/src/views/reportProcess/components/reportForm.vue @@ -265,15 +265,36 @@ export default { this.tags=JSON.parse(this.processForm.keyContent) } if(this.processForm.labelList && typeof this.processForm.labelList[0]=='string'){ - this.form.labelList= this.processForm.labelList.map(item=>{ - return JSON.parse(item) + this.form.labelList.map(item=>{ + return this.getParentsById(cascaderOptions,item) }) } + } }, methods: { + /* +* @param list 数据列表 +* @param id 后端返回的id +**/ + getParentsById(list, id) { + for (let i in list) { + if (list[i].value == id) { + //查询到就返回该数组对象的value + return [list[i].value] + } + if (list[i].children) { + let node = this.getParentsById(list[i].children, id) + if (node !== undefined) { + //查询到把父节把父节点加到数组前面 + node.unshift(list[i].value) + return node + } + } + } + }, downFile(id){ if(this.formControl) return this.$api.report.reportDownload({reportId:'',fileId:id}).then(res=>{ @@ -293,7 +314,7 @@ export default { parts.push(item.orgCode) partsName.push(item.orgName) }) - debugger + this.qcrList = checkedList this.form.department = parts.toString() this.form.departmentName = partsName.toString() diff --git a/src/views/reportProcess/examine.vue b/src/views/reportProcess/examine.vue index c292af0..a23006c 100644 --- a/src/views/reportProcess/examine.vue +++ b/src/views/reportProcess/examine.vue @@ -93,7 +93,7 @@ export default { } }, created () { - debugger + this.taskId=this.$store.getters.handleProcess.taskId this.prcNum=this.$store.getters.handleProcess.prcNum this.prcId=this.$store.getters.handleProcess.prcId diff --git a/src/views/userCenter/processCenter/gencyProcess.vue b/src/views/userCenter/processCenter/gencyProcess.vue index 1f6affd..2898c92 100644 --- a/src/views/userCenter/processCenter/gencyProcess.vue +++ b/src/views/userCenter/processCenter/gencyProcess.vue @@ -130,7 +130,7 @@ export default { this.$store.commit('setHandleProcess',params) switch (row.prcType) { case '1' : - debugger + if (row.taskDefinitionKey == 'reEdit') { this.$router.push({ path: '/permission/launch',