【修改】修改表格数据

This commit is contained in:
zhoulingpo
2023-04-25 18:04:35 +08:00
parent fc43422f22
commit d34c375f20
12 changed files with 306 additions and 249 deletions
@@ -122,7 +122,7 @@ export default {
}
})
this.checkList = this.checkList.filter(item => {
return ids.indexOf(item.id) === -1
return ids.indexOf(item.reportId) === -1
})
if (name.length > 0) {
this.$alert(`报告${name.toString()}已经存在`, '提示', {
+29 -24
View File
@@ -153,20 +153,20 @@ export default {
if(this.$route.query.type=='yiban'){
this.disabled=true
}
this.getProcessDetail(params).then(res=>{
this.tableData = JSON.parse(this.processOld.dataJson)
this.applicationForm.power = this.tableData[0].power
this.applicationForm.applyReason = this.tableData[0].applyReason
this.processForm.prcName = this.prcName
this.disabled=false
this.formControl= true
if(this.$route.query.type=='yiban'){
this.disabled=true
this.submitjson=JSON.parse(this.processOld.submitJson)
}else{
this.getProcessDetail(params).then(res=>{
this.tableData = JSON.parse(this.processOld.dataJson)
this.applicationForm.power = this.tableData[0].power
this.applicationForm.applyReason = this.tableData[0].applyReason
this.processForm.prcName = this.prcName
this.disabled=false
this.formControl= true
if(this.$route.query.type=='yiban'){
this.disabled=true
this.submitjson=JSON.parse(this.processOld.submitJson)
}else{
}
})
}
})
},
@@ -187,16 +187,21 @@ export default {
// assignee: treeNode[0].userId, // 转办人
// userId: this.$store.getters.userInfo.userId, // dangqian人
// pId: this.$store.getters.getHandleInfo.prcId // 流程实例
this.$api.process.changeAssignee({
taskId: this.processOld.taskId,
assignee: treeNode[0].USID,
userId: this.$store.getters.userInfo.usid,
pId: this.processOld.pId
}).then(() => {
this.$message.success('转办成功')
this.$router.push({path: '/processCenter', query: {id: this.$route.query.id}})
this.visibleTree = false
})
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
})
}
},
handleSubmit() {
// if (this.$refs.operationRef.submit()) {
@@ -204,7 +209,7 @@ export default {
let submit = JSON.parse(this.processOld.submitJson)
let dataJson = this.processOld.dataJson
let submitJson = JSON.stringify({...submit, ...this.$refs.operationRef.examineForm})
this.completeProcess({
this.completeProcess({
dataJson,
submitJson,
taskId: this.taskId,
+134 -113
View File
@@ -1,24 +1,24 @@
<template>
<div class="process">
<div class="process_box">
<process-header v-if="initShow" :title="'发起流程'"></process-header>
<process-header v-else :title="'发起人修改'" :proceesNum="prcNum"></process-header>
<process-header v-if="initShow" :title="'发起人修改'" :proceesNum="prcNum"></process-header>
<process-header v-else :title="'发起流程'"></process-header>
<div class="procedure">
<div class="process_content">
<span class="base_title">基础信息</span>
<el-form ref="processFormRef" :model="processForm" label-width="150px"
:rules="processFormRule" class="label-input-form" size="medium">
: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="processForm.prcName"
<el-form-item label="流程名称:" prop="prcName">
<el-input :disabled="formControl || formControlname" v-model="processForm.prcName"
placeholder="请输入流程名称"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-row>
<report-table v-model="tableData" @updateTable="(newValue)=>{tableData=newValue}"></report-table>
<report-table v-model="tableData" @updateTable="(newValue)=>{tableData=newValue}" :disabled="showTableD"></report-table>
</el-row>
<el-row>
<el-form ref="applicationFormRef" :model="applicationForm" label-width="150px"
@@ -27,7 +27,8 @@
<el-row>
<el-col :span="9">
<el-form-item label="申请原因:" prop="applyReason">
<el-input :disabled="formControl" type="textarea" v-model="applicationForm.applyReason" placeholder="请输入申请原因"></el-input>
<el-input :disabled="formControl" type="textarea" v-model="applicationForm.applyReason"
placeholder="请输入申请原因"></el-input>
</el-form-item>
</el-col>
<el-col :span="9" :offset="6">
@@ -53,73 +54,63 @@
<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">
: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 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')"
<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-input v-model="assignForm.twoApprove" placeholder="请选择二级审批人员"></el-input>-->
<!-- <el-select v-model="assignForm.twoApprove"-->
<!-- class="icon-auth"-->
<!-- multiple-->
<!-- collapse-tags-->
<!-- @change="changeSelect"-->
<!-- @visible-change="changeSelect"-->
<!-- placeholder="请选择">-->
<!-- <el-checkbox class="check-all" v-model="checked" @change="selectAll">全选</el-checkbox>-->
<!-- <template v-for="item in userList">-->
<!-- <el-option :label="item.USNAME" :value="item.USID" :key="item.USID"></el-option>-->
<!-- </template>-->
<!-- </el-select>-->
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24" >
<el-col :span="24">
<el-form-item label="说明:">
<el-input type="textarea" v-model="assignForm.remark" placeholder="请输入说明"></el-input>
<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-reset="isShowReset"
:show-submit="isShowSubmit"
:submitLoading="isSubmit"
:resetLoading="resetLoading"
@reset="handleReset"
@submit="handleSubmit"
></process-footer>
<orgTable :visible.sync="visibleOrgTable" title="人员列表" dialog-model :config="{
<process-footer
v-if="!formControl"
showCancel
:show-reset="isShowReset"
:show-submit="isShowSubmit"
:submitLoading="isSubmit"
:resetLoading="resetLoading"
@reset="handleReset"
@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>
}" :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/reportTable'
import { PERMISSION } from '@/utils/Enum/enum'
import {PERMISSION} from '@/utils/Enum/enum'
import orgTable from '../../components/OrgTable'
import processMixin from "../../components/ProcessMixin";
export default {
name: 'launch',
components: {
@@ -130,8 +121,9 @@ export default {
orgTable
},
mixins: [processMixin],
data () {
data() {
return {
showTableD: false,
initShow: false, // 控制审批历史是否显示 只有在不是第一次的时候才是true
treeType: '',
orgTableVal: '',
@@ -146,13 +138,14 @@ export default {
assignForm: {
oneApprove: '',
twoApprove: '',
twoApproveName:'',
oneApproveName:''
twoApproveName: '',
oneApproveName: '',
remark:''
},
tableData: [],
applicationForm: {
applyReason:'',
power:''
applyReason: '',
power: ''
},
q: {
pageSize: 10000,
@@ -160,14 +153,14 @@ export default {
},
PERMISSION,
processForm: {
prcName:''
prcName: ''
},
processFormRule: {
prcName: [{
required: true,
message: '请输入流程名称',
trigger: 'change'
},{
}, {
max: 100,
message: '申请原因最多填写100字符',
trigger: 'change'
@@ -197,68 +190,77 @@ export default {
max: 1000, message: '说明最多填写1000字符'
}]
},
prcType:1
prcType: 1,
prcName:''
}
},
created () {
created() {
// 第一次进入此页面 需要清楚校验
if (this.$route.query.ids) {
if(this.$route.query.ids.split(',').length>0){
if (this.$route.query.ids.split(',').length > 0) {
this.reportList(this.$route.query.ids)
}
this.handleReset()
}
if(this.$route.query.taskDefinitionKey == 'aid4'){
this.taskId=this.$route.query.taskId
if (this.$route.query.taskDefinitionKey == 'aid4') {
this.taskId = this.$route.query.taskId
this.prcNum = this.$route.query.prcNum
this.prcId = this.$route.query.prcId
this.prcName = this.$route.query.prcName
this.initShow = true
this.formControlname=true
this.getProcessDetail().then(res =>{
this.formControlname = true
this.getProcessDetail().then(res => {
//基础信息
this.applicationForm.applyReason = JSON.parse(this.processOld.dataJson).applyReason
this.applicationForm.power = JSON.parse(this.processOld.dataJson).power
this.tableData = JSON.parse(this.processOld.dataJson)
this.processForm.prcName = JSON.parse(this.processOld.dataJson).prcName
this.applicationForm.power = this.tableData[0].power
this.applicationForm.applyReason = this.tableData[0].applyReason
this.processForm.prcName = this.prcName
debugger
//指派信息
this.assignForm=JSON.parse(this.processOld.submitJson)
({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))
})
}
if(this.$route.query.type=='yiban'){
this.taskId=this.$route.query.taskId
this.prcNum = this.$route.query.prcNum
this.prcId = this.$route.query.prcId
this.formControl = true
this.getProcessDetail().then(()=>{
this.applicationForm.applyReason = JSON.parse(this.processOld.dataJson).applyReason
this.applicationForm.power = JSON.parse(this.processOld.dataJson).power
this.tableData = JSON.parse(this.processOld.dataJson).dataMsg
this.processForm.prcName = JSON.parse(this.processOld.dataJson).prcName
//指派信息
this.assignForm=JSON.parse(this.processOld.submitJson)
})
if (this.$route.query.type == 'yiban') {
this.taskId = this.$route.query.taskId
this.prcNum = this.$route.query.prcNum
this.prcId = this.$route.query.prcId
this.prcName = this.$route.query.prcName
this.formControl = true
this.initShow = true
this.showTableD = true
this.getProcessDetail().then(() => {
this.tableData = JSON.parse(this.processOld.dataJson)
this.applicationForm.power = this.tableData[0].power
this.applicationForm.applyReason = this.tableData[0].applyReason
this.processForm.prcName = this.prcName
//指派信息
// ({ name: a.name, age: a.age } = b)
this.assignForm = JSON.parse(this.processOld.submitJson)
})
}
console.log(this.PERMISSION, 'ddd')
},
methods: {
handleCheck (name) {
if(this.initShow){
handleCheck(name) {
if (this.initShow) {
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:''
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.orgTableVal = this.assignForm.twoApprove ? this.assignForm.twoApprove : ''
this.orgTableValName = this.assignForm.twoApproveName ? this.assignForm.twoApproveName : ''
}
this.visibleOrgTable = true
},
// 树点击
isTreeOk (checkedList) {
isTreeOk(checkedList) {
// console.log(checkedList)
const parts = []
const partsName = []
@@ -278,26 +280,34 @@ export default {
// console.log(this.assignForm.name1Id, this.assignForm.name2Id)
},
// 获取表格列表 吧查询到的值传给子组件
reportList (ids) {
this.$api.report.reportList({ ids: ids.split(',') }).then(({ data }) => {
this.tableData = data.records.map(item=>{
item.reportId=item['id']
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
})
})
},
handleReset () {
this.applicationForm = {
applyReason:'',
power:''
handleReset() {
this.processForm.prcName = ''
if(this.$route.query.taskDefinitionKey == 'aid4'){
this.processForm.prcName = this.prcName
}
this.processForm.prcName=''
this.applicationForm = {
applyReason: '',
power: ''
}
this.assignForm = {
oneApprove: '',
twoApprove: ''
}
this.$nextTick(()=>{
this.$nextTick(() => {
this.$refs.applicationFormRef.clearValidate()
this.$refs.assignFormRef.clearValidate()
})
@@ -306,17 +316,17 @@ export default {
// 整理数据
organizeData() {
let userId = this.$store.getters.userInfo.usid
this.tableData=this.tableData.map(item=>{
item = {...item, ... this.applicationForm,userId:userId}
this.tableData = this.tableData.map(item => {
item = {...item, ...this.applicationForm, userId: userId}
return item
})
},
// 提交
handleSubmit () {
console.log( this.$store.getters.userInfo.usid," this.$store.getters.userInfo.USID")
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(z =>{
this.$refs.processFormRef.validate(z => {
if (v && m && z) {
// 过了校验 需要把数据都整合 this.tableData this.applicationForm this.assignForm
// 表格数据没有不能提交 需要提示
@@ -328,12 +338,18 @@ export default {
// 处理表格数据
this.organizeData()
//如果不是第一次
if(this.initShow){
let dataJson=JSON.stringify({...this.applicationForm,...this.processForm,dataMsg:this.tableData})
let submitJson=JSON.stringify(this.assignForm)
this.completeProcess({dataJson,submitJson,taskId:this.taskId,userId:this.$store.getters.userInfo.usid,prcType:this.prcType})
}else{
this.startProcess()
if (this.initShow) {
let dataJson = JSON.stringify(this.tableData)
let submitJson = JSON.stringify({...this.assignForm, userId: this.$store.getters.userInfo.usid})
this.completeProcess({
dataJson,
submitJson,
taskId: this.taskId,
userId: this.$store.getters.userInfo.usid,
prcType: this.prcType
})
} else {
this.startProcess()
}
}
} else {
@@ -344,23 +360,28 @@ export default {
})
},
//修改参数
changeParam(){
changeParam() {
},
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 = {
approveData: {
...this.applicationForm, ...this.processForm, ...this.assignForm,
userId: this.$store.getters.userInfo.usid
}, dataMsg: this.tableData
}
form.prcType= this.prcType
form.prcName= this.processForm.prcName
form.userId= this.$store.getters.userInfo.usid
form.prcType = this.prcType
form.prcName = this.processForm.prcName
form.userId = this.$store.getters.userInfo.usid
//...this.applicationForm,...this.processForm,
let dataJson=JSON.stringify(this.tableData)
let submitJson=JSON.stringify({...this.assignForm,userId:this.$store.getters.userInfo.usid})
this.$api.process.startProcess(form).then( ({data}) =>{
this.completeProcess({dataJson,submitJson,taskId:data.result,userId:form.userId,prcType: this.prcType})
let dataJson = JSON.stringify(this.tableData)
let submitJson = JSON.stringify({...this.assignForm, userId: this.$store.getters.userInfo.usid})
this.$api.process.startProcess(form).then(({data}) => {
this.completeProcess({dataJson, submitJson, taskId: data.result, userId: form.userId, prcType: this.prcType})
})
},
//获取流程详细信息