|
@@ -140,7 +140,8 @@
|
|
<vxe-column title="操作" width="200px" fixed="right" align="center">
|
|
<vxe-column title="操作" width="200px" fixed="right" align="center">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-button v-if="hasPermission('sys:workContract:view')" type="text" icon="el-icon-view" size="small" @click="view(scope.row.id)">查看</el-button>
|
|
<el-button v-if="hasPermission('sys:workContract:view')" type="text" icon="el-icon-view" size="small" @click="view(scope.row.id)">查看</el-button>
|
|
- <el-button v-if="hasPermission('sys:workContract:edit') && scope.row.status !== '2' && scope.row.status !== '5'" type="text" icon="el-icon-edit" size="small" @click="edit(scope.row)">修改</el-button>
|
|
|
|
|
|
+ <el-button v-if="hasPermission('sys:workContract:edit') && scope.row.status !== '2' && scope.row.status !== '5' && scope.row.createId === create && scope.row.createId !== '1'" type="text" icon="el-icon-edit" size="small" @click="edit(scope.row)">修改</el-button>
|
|
|
|
+ <el-button v-if="hasPermission('sys:workContract:edit') && scope.row.status === '5' && scope.row.createId === '1'" type="text" icon="el-icon-edit" size="small" @click="editForm(scope.row.id)">修改</el-button>
|
|
<el-button v-if="hasPermission('sys:workContract:del') && (scope.row.status === '1' || scope.row.status === '3')" type="text" icon="el-icon-delete" size="small" @click="del(scope.row.id)">删除</el-button>
|
|
<el-button v-if="hasPermission('sys:workContract:del') && (scope.row.status === '1' || scope.row.status === '3')" type="text" icon="el-icon-delete" size="small" @click="del(scope.row.id)">删除</el-button>
|
|
<el-button v-if="hasPermission('sys:workContract:back') && scope.row.status === '2'" type="text" icon="el-icon-back" size="small" @click="reback(scope.row)">撤回</el-button>
|
|
<el-button v-if="hasPermission('sys:workContract:back') && scope.row.status === '2'" type="text" icon="el-icon-back" size="small" @click="reback(scope.row)">撤回</el-button>
|
|
</template>
|
|
</template>
|
|
@@ -198,7 +199,8 @@
|
|
},
|
|
},
|
|
processDefinitionId: '',
|
|
processDefinitionId: '',
|
|
procDefKey: '',
|
|
procDefKey: '',
|
|
- loading: false
|
|
|
|
|
|
+ loading: false,
|
|
|
|
+ create: ''
|
|
}
|
|
}
|
|
},
|
|
},
|
|
workContractService: null,
|
|
workContractService: null,
|
|
@@ -221,12 +223,16 @@
|
|
computed: {
|
|
computed: {
|
|
userName () {
|
|
userName () {
|
|
return JSON.parse(localStorage.getItem('user')).name
|
|
return JSON.parse(localStorage.getItem('user')).name
|
|
|
|
+ },
|
|
|
|
+ user () {
|
|
|
|
+ this.create = JSON.parse(localStorage.getItem('user')).id
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
// 获取数据列表
|
|
// 获取数据列表
|
|
refreshList () {
|
|
refreshList () {
|
|
|
|
+ console.log('user', this.user)
|
|
this.loading = true
|
|
this.loading = true
|
|
this.workContractService.list({
|
|
this.workContractService.list({
|
|
'current': this.tablePage.currentPage,
|
|
'current': this.tablePage.currentPage,
|
|
@@ -240,7 +246,6 @@
|
|
this.loading = false
|
|
this.loading = false
|
|
})
|
|
})
|
|
this.processService.getByName('合同登记新建').then(({data}) => {
|
|
this.processService.getByName('合同登记新建').then(({data}) => {
|
|
- console.log(data)
|
|
|
|
if (!this.commonJS.isEmpty(data.id)) {
|
|
if (!this.commonJS.isEmpty(data.id)) {
|
|
this.processDefinitionId = data.id
|
|
this.processDefinitionId = data.id
|
|
this.procDefKey = data.key
|
|
this.procDefKey = data.key
|
|
@@ -265,12 +270,10 @@
|
|
add () {
|
|
add () {
|
|
this.start()
|
|
this.start()
|
|
},
|
|
},
|
|
- // 新增
|
|
|
|
|
|
+ // 详情
|
|
detail (row) {
|
|
detail (row) {
|
|
// eslint-disable-next-line eqeqeq
|
|
// eslint-disable-next-line eqeqeq
|
|
if (!this.commonJS.isEmpty(row.status) && row.status != '1') {
|
|
if (!this.commonJS.isEmpty(row.status) && row.status != '1') {
|
|
- console.log(row.procInsId)
|
|
|
|
- console.log(row.processDefinitionId)
|
|
|
|
this.taskService.getTaskDef({
|
|
this.taskService.getTaskDef({
|
|
procInsId: row.procInsId,
|
|
procInsId: row.procInsId,
|
|
procDefId: row.processDefinitionId
|
|
procDefId: row.processDefinitionId
|
|
@@ -289,16 +292,19 @@
|
|
},
|
|
},
|
|
// 修改
|
|
// 修改
|
|
edit (row) {
|
|
edit (row) {
|
|
- // row.id || this.$refs.workContractTable.getCheckboxRecords().map(item => {
|
|
|
|
- // return item.id
|
|
|
|
- // })[0]
|
|
|
|
- // this.$refs.workContractForm2.init('edit', id)
|
|
|
|
if (row.status === '3' || row.status === '4') {
|
|
if (row.status === '3' || row.status === '4') {
|
|
- this.start2(row)
|
|
|
|
|
|
+ this.editWithClose(row)
|
|
} else {
|
|
} else {
|
|
- this.start1(row)
|
|
|
|
|
|
+ this.editWithHold(row)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ // 管理员修改
|
|
|
|
+ editForm (id) {
|
|
|
|
+ id = id || this.$refs.workClientTable.getCheckboxRecords().map(item => {
|
|
|
|
+ return item.id
|
|
|
|
+ })[0]
|
|
|
|
+ this.$refs.workContractForm2.init('edit', id)
|
|
|
|
+ },
|
|
// 查看
|
|
// 查看
|
|
view (id) {
|
|
view (id) {
|
|
this.$refs.workContractForm2.init('view', id)
|
|
this.$refs.workContractForm2.init('view', id)
|
|
@@ -333,6 +339,7 @@
|
|
// 读取流程表单
|
|
// 读取流程表单
|
|
let tabTitle = `发起流程【合同登记新建】`
|
|
let tabTitle = `发起流程【合同登记新建】`
|
|
let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [合同登记新建]`
|
|
let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [合同登记新建]`
|
|
|
|
+ let contractTitle = '合同【' + this.searchForm.name + '】登记待审批'
|
|
this.taskService.getTaskDef({ procDefId: this.processDefinitionId,
|
|
this.taskService.getTaskDef({ procDefId: this.processDefinitionId,
|
|
status: 'startAndHold'}).then((data) => {
|
|
status: 'startAndHold'}).then((data) => {
|
|
this.$router.push({
|
|
this.$router.push({
|
|
@@ -346,12 +353,13 @@
|
|
formUrl: data.data.formUrl,
|
|
formUrl: data.data.formUrl,
|
|
formTitle: processTitle,
|
|
formTitle: processTitle,
|
|
businessId: 'false',
|
|
businessId: 'false',
|
|
- isShow: false
|
|
|
|
|
|
+ isShow: false,
|
|
|
|
+ contractTitle: contractTitle
|
|
}
|
|
}
|
|
})
|
|
})
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- start1 (row) {
|
|
|
|
|
|
+ editWithHold (row) {
|
|
// 读取流程表单
|
|
// 读取流程表单
|
|
let tabTitle = `发起流程【合同登记新建】`
|
|
let tabTitle = `发起流程【合同登记新建】`
|
|
let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [合同登记新建]`
|
|
let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [合同登记新建]`
|
|
@@ -376,7 +384,7 @@
|
|
})
|
|
})
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- start2 (row) {
|
|
|
|
|
|
+ editWithClose (row) {
|
|
// 读取流程表单
|
|
// 读取流程表单
|
|
let tabTitle = `发起流程【合同登记新建】`
|
|
let tabTitle = `发起流程【合同登记新建】`
|
|
let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [合同登记新建]`
|
|
let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [合同登记新建]`
|
|
@@ -409,13 +417,12 @@
|
|
taskId: row.procInsId,
|
|
taskId: row.procInsId,
|
|
type: 'warning'
|
|
type: 'warning'
|
|
}).then(() => {
|
|
}).then(() => {
|
|
- console.log(row)
|
|
|
|
- this.taskService.backNodes(row.procInsId).then(({data}) => {
|
|
|
|
|
|
+ this.taskService.backNodes(row.taskId).then(({data}) => {
|
|
let backNodes = data
|
|
let backNodes = data
|
|
if (backNodes.length > 0) {
|
|
if (backNodes.length > 0) {
|
|
let backTaskDefKey = backNodes[0].taskDefKey
|
|
let backTaskDefKey = backNodes[0].taskDefKey
|
|
this.taskService.back({
|
|
this.taskService.back({
|
|
- taskId: row.procInsId,
|
|
|
|
|
|
+ taskId: row.taskId,
|
|
backTaskDefKey: backTaskDefKey,
|
|
backTaskDefKey: backTaskDefKey,
|
|
isShow: false,
|
|
isShow: false,
|
|
...this.auditForm
|
|
...this.auditForm
|