【修改】修改表格数据

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
+1 -7
View File
@@ -5,10 +5,4 @@ export const PERMISSION = new Esenum([
{ label: '预览', value: "1" },
{ label: '预览+下载', value: "2" }
])
// 流程状态
export const PROCESSSTATE = new Esenum(
{
COMPLETED: {name: '已完成', index: 1},
INCOMPLETED: {name: '未完成', index: 0}
}
)
-1
View File
@@ -28,7 +28,6 @@ export function formatDate (value, fmt) {
}
return fmt
} else {
console.log(typeof value)
value = value.trim()
value = value.replace('T', ' ')
return value.substr(0, fmt.length)
@@ -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()}已经存在`, '提示', {
+8 -3
View File
@@ -187,16 +187,21 @@ export default {
// assignee: treeNode[0].userId, // 转办人
// userId: this.$store.getters.userInfo.userId, // dangqian人
// pId: this.$store.getters.getHandleInfo.prcId // 流程实例
if( treeNode[0].USID == this.$store.getters.userInfo.usid){
this.$message.warning("您不能转办给自己")
}else{
this.$api.process.changeAssignee({
taskId: this.processOld.taskId,
taskId: this.taskId,
assignee: treeNode[0].USID,
userId: this.$store.getters.userInfo.usid,
pId: this.processOld.pId
pId: this.prcId
}).then(() => {
this.$message.success('转办成功')
this.$router.push({path: '/processCenter', query: {id: this.$route.query.id}})
this.$router.push({path: '/userCenter/processCenter', query: {id: this.$route.query.id}})
this.visibleTree = false
})
}
},
handleSubmit() {
// if (this.$refs.operationRef.submit()) {
+57 -36
View File
@@ -1,8 +1,8 @@
<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>
@@ -18,7 +18,7 @@
</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">
@@ -57,7 +58,8 @@
<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')"
<el-input readonly :disabled="formControl" v-model="assignForm.oneApproveName"
@click.native="handleCheck('spr1')"
placeholder="请选择一级审批人员"></el-input>
</el-form-item>
</el-col>
@@ -66,28 +68,16 @@
<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-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-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>
@@ -120,6 +110,7 @@ import reportTable from './components/reportTable'
import {PERMISSION} from '@/utils/Enum/enum'
import orgTable from '../../components/OrgTable'
import processMixin from "../../components/ProcessMixin";
export default {
name: 'launch',
components: {
@@ -132,6 +123,7 @@ export default {
mixins: [processMixin],
data() {
return {
showTableD: false,
initShow: false, // 控制审批历史是否显示 只有在不是第一次的时候才是true
treeType: '',
orgTableVal: '',
@@ -147,7 +139,8 @@ export default {
oneApprove: '',
twoApprove: '',
twoApproveName: '',
oneApproveName:''
oneApproveName: '',
remark:''
},
tableData: [],
applicationForm: {
@@ -197,7 +190,8 @@ export default {
max: 1000, message: '说明最多填写1000字符'
}]
},
prcType:1
prcType: 1,
prcName:''
}
},
created() {
@@ -212,30 +206,38 @@ export default {
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.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.prcName = this.$route.query.prcName
this.formControl = true
this.initShow = true
this.showTableD = 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.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')
@@ -279,7 +281,11 @@ export default {
},
// 获取表格列表 吧查询到的值传给子组件
reportList(ids) {
this.$api.report.reportList({ ids: ids.split(',') }).then(({ data }) => {
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']
@@ -288,11 +294,15 @@ export default {
})
},
handleReset() {
this.processForm.prcName = ''
if(this.$route.query.taskDefinitionKey == 'aid4'){
this.processForm.prcName = this.prcName
}
this.applicationForm = {
applyReason: '',
power: ''
}
this.processForm.prcName=''
this.assignForm = {
oneApprove: '',
twoApprove: ''
@@ -329,9 +339,15 @@ 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})
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()
}
@@ -351,7 +367,12 @@ export default {
//把表单都整合到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
@@ -30,9 +30,14 @@
<vxe-column show-overflow show-header-overflow field="taskBackAssignee"
title="上一处理人"></vxe-column>
<vxe-column show-overflow show-header-overflow field="creatTime" title="创建时间"></vxe-column>
<vxe-column show-overflow show-header-overflow field="overTime"
<vxe-column show-overflow show-header-overflow field="endTime"
title="完成时间"></vxe-column>
<vxe-column show-overflow show-header-overflow field="status" title="状态"></vxe-column>
<vxe-column show-overflow show-header-overflow field="status" title="状态">
<template #default="{ row }">
<span v-if="row.isEnd === '0'">未完成</span>
<span v-if="row.isEnd === '1'">已完成</span>
</template>
</vxe-column>
<vxe-column show-overflow show-header-overflow title="操作" width="200" fixed="right">
<template #default="{ row }">
<el-button @click.native.prevent="view(row)" type="text" size="small">
@@ -113,7 +118,7 @@ export default {
taskDefinitionKey: row.taskDefinitionKey,
prcNum: row.prcNum,
prcId: row.prcId,
prcName: row.prcName
prcName: row.prcName,
}
})
}else{
@@ -106,7 +106,8 @@ export default {
taskId:row.taskId,
prcNum: row.prcNum,
prcId: row.prcId,
prcName: row.prcName
prcName: row.prcName,
taskDefinitionKey: row.taskDefinitionKey
}
})
}else{
@@ -117,7 +118,8 @@ export default {
taskId:row.taskId,
prcNum: row.prcNum,
prcId: row.prcId,
prcName: row.prcName
prcName: row.prcName,
taskDefinitionKey: row.taskDefinitionKey
}
})
}
@@ -30,9 +30,14 @@
<vxe-column show-overflow show-header-overflow field="taskBackAssignee"
title="上一处理人"></vxe-column>
<vxe-column show-overflow show-header-overflow field="creatTime" title="创建时间"></vxe-column>
<vxe-column show-overflow show-header-overflow field="overTime"
<vxe-column show-overflow show-header-overflow field="endTime"
title="完成时间"></vxe-column>
<vxe-column show-overflow show-header-overflow field="status" title="状态"></vxe-column>
<vxe-column show-overflow show-header-overflow field="status" title="状态">
<template #default="{ row }">
<span v-if="row.isEnd === '0'">未完成</span>
<span v-if="row.isEnd === '1'">已完成</span>
</template>
</vxe-column>
<vxe-column show-overflow show-header-overflow title="操作" width="200" fixed="right">
<template #default="{ row }">
<el-button @click.native.prevent="view(row)" type="text" size="small">
@@ -107,6 +112,7 @@ export default {
id: this.$route.query.id,
prcNum: row.prcNum,
prcType: row.prcType,
prcId: row.prcId,
tabsName: 'MonitorProcess'
}
})
@@ -64,7 +64,12 @@
<vxe-column show-overflow show-header-overflow field="approvalOpinion"
title="审批意见"></vxe-column>
<vxe-column show-overflow show-header-overflow field="status"
title="状态"></vxe-column>
title="状态">
<template #default="{ row }">
<span v-if="row.endTime">已完成</span>
<span v-else>未完成</span>
</template>
</vxe-column>
</vxe-table>
</div>
<monitorModal ref="monitorModal" :prcId="prcId"></monitorModal>
@@ -72,18 +77,15 @@
</template>
<script>
import {PROCESSSTATE} from '@/utils/Enum/enum'
import monitorModal from './monitorModal.vue'
import ProcessMixin from "@/components/ProcessMixin";
import { formatDate } from '@/utils/date'
export default {
name: 'processDetail',
mixins: [ProcessMixin],
data () {
return {
formatDate,
PROCESSSTATE,
assigneeNewLoading: false, // 调整处理人确定loading
loginPeople: '',
// 调整处理人抽屉状态
@@ -113,7 +115,8 @@ export default {
checkIds: [],
checkList: [],
tabsName:'',
prcNum:''
prcNum:'',
prcId:''
}
},
methods: {
@@ -214,19 +217,23 @@ export default {
},
showDialog() {
if(this.checkList.length < 1){
this.$message.warning("至少选择一条数据")
this.$message.warning("请选择一条数据")
return
}else{
if(this.checkList.length > 2){
this.$message.warning("请选择一条数据")
return
}
let check=[]
check = this.checkList.filter(item=>{
if(+item.state == this.PROCESSSTATE['COMPLETED'].index){
if(item.endTime ){
return item
}
})
if(check.length > 0){
this.$message.warning("请选择状态为未完成的数据")
}else{
this.$refs.monitorModal.open(this.checkIds,this.checkList[0].id)
this.$refs.monitorModal.open(this.checkIds,this.checkList[0].taskId,this.checkList[0].assigneeId)
}
}
},
@@ -276,6 +283,7 @@ export default {
this.tabsName=this.$route.query.tabsName
this.prcType=this.$route.query.prcType
this.prcNum=this.$route.query.prcNum
this.prcId=this.$route.query.prcId
this.processNum()
this.processTable()
}
@@ -59,19 +59,23 @@ export default {
this.userList = data.records;
})
},
open(taskId,pId) {
open(taskId, pId,assigneeId) {
this.taskId = taskId
this.pId = pId
this.form.name = {
assignee: ''
}
this.assigneeId=assigneeId
this.dialogVisible = true
},
submit() {
this.$refs.form.validate((valid) => {
if (valid) {
let userId = this.form.assignee
let assignee=this.$store.getters.userInfo.usid
let assignee = this.assigneeId
if (userId == assignee) {
this.$message.warning("当前任务受理人就是您选择的")
} else {
this.$api.process.changeAssignee({
taskId: this.taskId.join(','),
assignee: assignee,
@@ -83,7 +87,7 @@ export default {
//转办完这个人还能看到这个监控流程吗
this.dialogVisible = false
})
}
}
})
}
@@ -94,6 +98,7 @@ export default {
<style lang="scss" scoped>
.dialog-footer {
margin: 20px 20px;
.el-button {
width: 80px;
height: 36px;
@@ -101,12 +106,15 @@ export default {
font-size: 14px;
}
}
::v-deep .el-dialog__footer {
padding-bottom: 20px;
}
.addModel {
padding: 20px;
}
.el-form-item {
::v-deep .el-select {
width: 300px;
@@ -32,9 +32,14 @@
<vxe-column show-overflow show-header-overflow field="taskBackAssignee"
title="上一处理人"></vxe-column>
<vxe-column show-overflow show-header-overflow field="creatTime" title="创建时间"></vxe-column>
<vxe-column show-overflow show-header-overflow field="overTime"
<vxe-column show-overflow show-header-overflow field="endTime"
title="完成时间"></vxe-column>
<vxe-column show-overflow show-header-overflow field="status" title="状态"></vxe-column>
<vxe-column show-overflow show-header-overflow field="status" title="状态">
<template #default="{ row }">
<span v-if="row.isEnd === '0'">未完成</span>
<span v-if="row.isEnd === '1'">已完成</span>
</template>
</vxe-column>
<vxe-column show-overflow show-header-overflow title="操作" width="200" fixed="right">
<template #default="{ row,index }">
<el-button type="text" size="small" @click="view(row)">
+6 -2
View File
@@ -65,6 +65,10 @@ export default {
}
</script>
<style lang="sass" scoped>
<style lang="scss" scoped>
::v-deep .el-tabs__header {
padding: 0;
position: relative;
margin: 0 14px 15px;
}
</style>