diff --git a/src/api/modules/process.js b/src/api/modules/process.js index c6d4da2..bc71ac8 100644 --- a/src/api/modules/process.js +++ b/src/api/modules/process.js @@ -98,6 +98,7 @@ export default { data: data }) }, + // 通用流程详细信息查询 getProcessDetail( data ){ return request({ @@ -142,6 +143,16 @@ export default { }) }, + // quan保存到草稿 + saveProcessALL(data) { + return request({ + url: '/api/batchSaveTaskFirst', + method: 'post', + data: data + + }) + }, + // 判断当前人是不是审批人 // /selectTask jugeProcess(data) { diff --git a/src/components/ProcessMixin.vue b/src/components/ProcessMixin.vue index aff50e6..f8b372b 100644 --- a/src/components/ProcessMixin.vue +++ b/src/components/ProcessMixin.vue @@ -161,6 +161,16 @@ }) }) }, + //保存到草稿 + saveProcessALL(param){ + return new Promise((resolve,reject)=> { + this.$api.process.saveProcessALL(param).then(res => { + resolve() + }).catch(()=>{ + reject() + }) + }) + }, // 获取草稿详细信息 getDraftDetail(){ let dataId=this.$store.getters.handleProcess.dataId diff --git a/src/views/Report/ReportDetail.vue b/src/views/Report/ReportDetail.vue index a774c10..87da887 100644 --- a/src/views/Report/ReportDetail.vue +++ b/src/views/Report/ReportDetail.vue @@ -337,7 +337,7 @@ export default { .preview-content { //margin: 0 14px 0 13px; padding-bottom: 11px; - + overflow: auto; img { max-width: 100% !important; } diff --git a/src/views/Report/ReportList.vue b/src/views/Report/ReportList.vue index 2c9452d..5932ed0 100644 --- a/src/views/Report/ReportList.vue +++ b/src/views/Report/ReportList.vue @@ -304,12 +304,14 @@ export default { } // 有预览权限的时候是否还让继续申请 let temp=this.checkList.filter(item =>{ - if(+item.power == 1 || +item.power == 2){ + if( +item.power == 2){ return item.name } }) + console.log(temp) if(temp.length>0) { - this.$message.warning("当前选择的"+temp.toString()+"已经有权限,无须申请!") + let name=temp.map(item=>item.name) + this.$message.warning("当前选择的"+name.join(',')+"已经有权限,无须申请!") return } diff --git a/src/views/permissionApplication/launch.vue b/src/views/permissionApplication/launch.vue index 239d9a5..01fce42 100644 --- a/src/views/permissionApplication/launch.vue +++ b/src/views/permissionApplication/launch.vue @@ -44,7 +44,7 @@ import reportTable from './components/reportTable' import processMixin from "../../components/ProcessMixin"; - +import { PERMISSION } from '@/utils/Enum/enum' export default { name: 'launch', components: { @@ -56,6 +56,7 @@ export default { mixins: [processMixin], data() { return { + PERMISSION, delData:[], showTableD: false, initShow: false, // 控制审批历史是否显示 只有在不是第一次的时候才是true @@ -127,8 +128,20 @@ export default { 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.dataId= this.$store.getters.handleProcess?.dataId + this.getProcessDetail().then(res => { + let powerName='' + let dataJson=JSON.parse(this.processOld.dataJson) + if(dataJson.power){ + this.PERMISSION.forEach(item=>{ + if(item.value == dataJson.power){ + powerName=item.label + } + }) + } + let submitJson = JSON.parse(this.processOld.submitJson) + // this.applicationForm.applyReason = applyReason.applyReason + this.tableData.push({...dataJson,...submitJson,powerName:powerName}) }) @@ -141,11 +154,16 @@ export default { 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 powerName='' + this.PERMISSION.forEach(item=>{ + if(item.value == JSON.parse(this.processOld.dataJson).power ){ + powerName=item.label + } + }) let submitJson = JSON.parse(this.processOld.submitJson) // this.applicationForm.applyReason = applyReason.applyReason - this.tableData = JSON.parse(this.processOld.dataJson) + this.tableData.push({...JSON.parse(this.processOld.dataJson),...JSON.parse(this.processOld.submitJson),powerName:powerName}) } if (this.$route.query.type == 'yiban') { @@ -156,16 +174,17 @@ export default { this.formControl = true this.initShow = true this.showTableD = true - this.$set(this.processForm,'prcName', this.prcName) - this.getProcessDetail().then((res) => { - let dataJson = JSON.parse(this.processOld.dataJson) - let submitJson = JSON.parse(this.processOld.submitJson) - - this.tableData[0]=dataJson - this.tableData[0].oneApproveName=submitJson.oneApproveName - this.tableData[0].twoApproveName=submitJson.twoApproveName - this.$set(this,'tableData',this.tableData) + await this.getProcessDetail() + let powerName='' + this.PERMISSION.forEach(item=>{ + if(item.value == JSON.parse(this.processOld.dataJson).power ){ + powerName=item.label + } }) + let submitJson = JSON.parse(this.processOld.submitJson) + // this.applicationForm.applyReason = applyReason.applyReason + this.tableData.push({...JSON.parse(this.processOld.dataJson),...submitJson,powerName:powerName}) + } }, methods: { @@ -185,18 +204,6 @@ export default { // this.tableData=newValue; // this.delData=jiaVlue }, - // 真删除接口 - delDatas(){ - - return new Promise((resolve,reject)=>{ - this.$api.permissionProcess.deletReport({powerApplyList:this.delData}).then(()=>{ - resolve() - }) - - }) - - }, - // 获取表格列表 吧查询到的值传给子组件 reportList(ids) { this.$api.report.reportList({ @@ -262,30 +269,20 @@ export default { obj.dataJson=JSON.stringify({...dataJson, createUser:this.userId, createUserName:this.userName}) return obj }) + if (this.initShow){ + debugger + newParams[0].taskId=this.taskId + } this.params=newParams }, // 保存 handleSave(){ this.saveLoading = true - if(this.tableData.length > 0){ + // 处理表格数据 this.organizeData() - }else{ - this.tableData=[{...this.applicationForm}] - } - 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.saveProcessALL(this.params).then( ()=>{ this.saveLoading = false this.$message['success']('保存成功') @@ -316,15 +313,7 @@ export default { let flag= this.JuggleSub(this.taskId) if(flag){ 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.completeProcess(this.params[0]) } } else { if(this.JuggleTableAll()){ diff --git a/src/views/userCenter/processCenter.vue b/src/views/userCenter/processCenter.vue index ab1f876..bf7d14d 100644 --- a/src/views/userCenter/processCenter.vue +++ b/src/views/userCenter/processCenter.vue @@ -40,6 +40,28 @@
+ + + + + + + + +
+ 取消 + 确定 +
+
@@ -54,26 +76,63 @@ import tabs from '../userCenter/processCenter/tabs.vue' }, data() { return { + approveForm:{}, + approveFormRules:{ + approvalOpinion:[{ + required:true, + message:'请填写审批意见' + }] + }, + dialogVisible:false, form: { prcNum:'', prcName:'' }, + checkList:[], isShowbtn:this.$store.getters.activeTab =='' || this.$store.getters.activeTab =='first' } }, created () { }, mounted () { - this.$bus.$on('clearForm',()=>{ this.form={} }); this.$bus.$on('handleClick',(data)=>{ console.log(data) - console.log("jjjjdata") + this.checkList=data }); }, methods: { + cancel(){ + this.dialogVisible=false + }, + submitForm(){ + this.$refs.examineForm.validate(v=>{ + if(v){ + this.checkList= this.checkList.map(item=>{ + item.flag=2 + item.approvalOpinion = this.approveForm.approvalOpinion + return item + }) + this.completeProcessALL(this.checkList).then(res=>{ + + }) + } + }) + }, + allAgree(type){ + if(this.checkList.length>0){ + if(type=='no'){ + this.dialogVisible=true + }else{ + + } + }else{ + this.$message.warning("请至少选择一条数据") + } + + }, //查询 search() { console.log(this.form) @@ -171,5 +230,15 @@ import tabs from '../userCenter/processCenter/tabs.vue' } } +.add-form-item{ + margin-top: 20px; +} +.approveForm{ + position: relative; +} +.done{ + margin: 10px; + text-align: right; +} diff --git a/src/views/userCenter/processCenter/taskDraft.vue b/src/views/userCenter/processCenter/taskDraft.vue index 767a313..29ea3af 100644 --- a/src/views/userCenter/processCenter/taskDraft.vue +++ b/src/views/userCenter/processCenter/taskDraft.vue @@ -125,6 +125,22 @@ export default { isDraft: 1, } });break; + case '2' : + this.$router.push({ + path: '/permission/launch', + query: { + id: this.$route.query.id, + isDraft: 1, + } + });break; + case '3' : + this.$router.push({ + path: '/permission/launch', + query: { + id: this.$route.query.id, + isDraft: 1, + } + });break; case '4' : this.$router.push({ path: '/reportprocess/launch', @@ -132,7 +148,8 @@ export default { id: this.$route.query.id, isDraft: 1 } - }) + });break; + } }, },