|
|
@@ -216,15 +216,14 @@
|
|
|
</el-col>
|
|
|
<!-- 审核阶段:渲染可编辑版本 -->
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="项目经理1" prop="projectMasterName" :rules="[
|
|
|
- ]">
|
|
|
+ <el-form-item label="项目经理1" prop="projectMasterName" :rules="isUserOnly ? [] : [{ required: true, message: '请选择项目经理1', trigger: 'blur' }]">
|
|
|
<!-- <UserSelectSignatory style="width: 100%" ref="userSelect1" :disabled="status === 'audit' || status === 'taskFormDetail'"-->
|
|
|
<!-- :readonly="true" :limit='1' :modelValue="inputForm.projectMasterId"-->
|
|
|
<!-- @update:modelValue='(value) => {changeSignatory1(value)}'></UserSelectSignatory>-->
|
|
|
- <el-input @blur="changeSignatory1(inputForm.projectMasterName)" @click="openUserDia2" :disabled="status !== 'audit'"
|
|
|
+ <el-input @blur="changeSignatory1(inputForm.projectMasterName)" @click="openUserDia2" :disabled="status !== 'audit' || isUserOnly"
|
|
|
v-model="inputForm.projectMasterName" placeholder="请选择项目经理1" @clear="clearUser2" clearable>
|
|
|
<template #suffix>
|
|
|
- <el-button style="background-color: white;color: #1b1e25;border-color: white;" type="primary" :disabled="status !== 'audit'"
|
|
|
+ <el-button style="background-color: white;color: #1b1e25;border-color: white;" type="primary" :disabled="status !== 'audit' || isUserOnly"
|
|
|
slot="append" icon="el-icon-search" @click.stop="openUserDia2">
|
|
|
</el-button>
|
|
|
</template>
|
|
|
@@ -234,15 +233,14 @@
|
|
|
|
|
|
|
|
|
<el-col :span="12" >
|
|
|
- <el-form-item label="项目经理2" prop="realHeaderName" :disabled="false" :rules="[
|
|
|
- ]">
|
|
|
+ <el-form-item label="项目经理2" prop="realHeaderName" :disabled="false" :rules="isUserOnly ? [] : [{ required: true, message: '请选择项目经理2', trigger: 'blur' }]">
|
|
|
<!-- <UserSelectSignatory style="width: 100%" ref="userSelect2" :disabled="status === 'audit' || status === 'taskFormDetail'"-->
|
|
|
<!-- :readonly="true" :limit='1' :modelValue="inputForm.realHeader"-->
|
|
|
<!-- @update:modelValue='(value) => {changeSignatory2(value)}'></UserSelectSignatory>-->
|
|
|
- <el-input @blur="changeSignatory2(inputForm.realHeader)" @click="openUserDia3" :disabled="status !== 'audit'"
|
|
|
+ <el-input @blur="changeSignatory2(inputForm.realHeader)" @click="openUserDia3" :disabled="status !== 'audit' || isUserOnly"
|
|
|
v-model="inputForm.realHeaderName" placeholder="请选择项目经理2" @clear="clearUser3" clearable>
|
|
|
<template #suffix>
|
|
|
- <el-button style="background-color: white;color: #1b1e25;border-color: white;" type="primary" :disabled="status !== 'audit'"
|
|
|
+ <el-button style="background-color: white;color: #1b1e25;border-color: white;" type="primary" :disabled="status !== 'audit' || isUserOnly"
|
|
|
slot="append" icon="el-icon-search" @click.stop="openUserDia3">
|
|
|
</el-button>
|
|
|
</template>
|
|
|
@@ -251,6 +249,25 @@
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
+ <!-- 审核阶段:渲染可编辑版本 -->
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item
|
|
|
+ label="项目执行人"
|
|
|
+ prop="projectExecutorName"
|
|
|
+ :rules="isProjectExecutorOnly ? [] : [{ required: true, message: '请选择项目执行人', trigger: 'blur' }]"
|
|
|
+ >
|
|
|
+ <el-input @click="openProjectExecutorDia1" :disabled="status !== 'audit' || isProjectExecutorOnly"
|
|
|
+ v-model="inputForm.projectExecutorName" placeholder="请选择项目执行人" @clear="clearUser2" clearable>
|
|
|
+ <template #suffix>
|
|
|
+ <el-button style="background-color: white;color: #1b1e25;border-color: white;" type="primary" :disabled="status !== 'audit' || isProjectExecutorOnly"
|
|
|
+ slot="append" icon="el-icon-search" @click.stop="openProjectExecutorDia1">
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="创建人" prop="createBy.name" :rules="[
|
|
|
]">
|
|
|
@@ -397,6 +414,7 @@
|
|
|
<ContractNameForm ref="contractNameForm"></ContractNameForm>
|
|
|
<CwClientPageForm ref="cwClientPageForm" @getProgram="getProgram"></CwClientPageForm>
|
|
|
<user-select1 ref="userSelect1" @doSubmit="selectUser1"></user-select1>
|
|
|
+ <user-select1 ref="selectProjectExecutorUser" @doSubmit="selectProjectExecutorUser"></user-select1>
|
|
|
<user-select2 ref="userSelect2" @doSubmit="selectUser2"></user-select2>
|
|
|
<user-select3 ref="userSelect3" @doSubmit="selectUser3"></user-select3>
|
|
|
</div>
|
|
|
@@ -407,6 +425,7 @@ import UpLoadComponent from '@/views/common/UpLoadComponent'
|
|
|
import SelectUserTree from '@/views/utils/treeUserSelect'
|
|
|
import SelectTree from '@/components/treeSelect/treeSelect.vue'
|
|
|
import UserSelect from '@/components/userSelect'
|
|
|
+import CommonApi from '@/api/cw/common/CommonApi'
|
|
|
// 所有 Service 都按普通对象导入(小写变量名)
|
|
|
import projectRecordsService from '@/api/cw/projectRecords/ProjectRecordsService'
|
|
|
import enterpriseSearchService from '@/api/cw/common/EnterpriseSearchService'
|
|
|
@@ -422,6 +441,7 @@ import ProjectReportService from "@/api/cw/reportManagement/ProjectReportService
|
|
|
import CwFinanceInvoiceService from "@/api/cw/invoice/CwFinanceInvoiceService";
|
|
|
import UserSelect2 from "@/views/utils/UserTreeSelectBySignatureScribe.vue";
|
|
|
import UserSelect1 from "@/views/utils/UserTreeSelect.vue";
|
|
|
+import SelectProjectExecutorUser from "@/views/utils/UserTreeSelect.vue";
|
|
|
import CwClientPageForm from "@/views/cw/projectRecords/CwClientPageForm.vue";
|
|
|
import UserSelect3 from "@/views/utils/UserTreeSelectBySignatureScribe.vue";
|
|
|
import CwProjectBusinessTypeService from "@/api/cw/projectBusinessType/CwProjectBusinessTypeService";
|
|
|
@@ -467,6 +487,8 @@ export default {
|
|
|
planEndDate: '',
|
|
|
projectMasterId: '',
|
|
|
projectMasterName: '',
|
|
|
+ projectExecutor: '',
|
|
|
+ projectExecutorName: '',
|
|
|
projectLeaderId: '',
|
|
|
projectLeaderName: '',
|
|
|
procInsId: '',
|
|
|
@@ -530,17 +552,21 @@ export default {
|
|
|
},
|
|
|
isReport: false,
|
|
|
ifCheck: true,
|
|
|
+ isUserOnly: true,
|
|
|
+ isProjectExecutorOnly: true,
|
|
|
// ✅ 核心修复:所有 Service 都直接赋值,彻底删掉所有 new!
|
|
|
projectRecordsService: projectRecordsService,
|
|
|
enterpriseSearchService: enterpriseSearchService,
|
|
|
workClientService: workClientService,
|
|
|
contractInfoService: contractInfoService,
|
|
|
projectReportService: ProjectReportService,
|
|
|
- cwFinanceInvoiceService: CwFinanceInvoiceService
|
|
|
+ cwFinanceInvoiceService: CwFinanceInvoiceService,
|
|
|
+ commonApi: null
|
|
|
}
|
|
|
},
|
|
|
created () {
|
|
|
// 无需任何初始化,data 里已赋值完成
|
|
|
+ this.commonApi = new CommonApi()
|
|
|
},
|
|
|
computed: {
|
|
|
bus: {
|
|
|
@@ -580,6 +606,7 @@ export default {
|
|
|
UserSelectSignatory,
|
|
|
CwProjectBusinessTypeService,
|
|
|
UserSelect1,
|
|
|
+ SelectProjectExecutorUser,
|
|
|
UserSelect2,
|
|
|
UserSelect3,
|
|
|
},
|
|
|
@@ -617,6 +644,8 @@ export default {
|
|
|
planEndDate: '',
|
|
|
projectMasterId: '',
|
|
|
projectMasterName: '',
|
|
|
+ projectExecutor: '',
|
|
|
+ projectExecutorName: '',
|
|
|
projectLeaderName: '',
|
|
|
projectLeaderId: '',
|
|
|
procInsId: '',
|
|
|
@@ -650,7 +679,7 @@ export default {
|
|
|
this.loading = true
|
|
|
console.log(123456)
|
|
|
console.log(this.inputForm.id)
|
|
|
- projectRecordsService.queryById(this.inputForm.id).then((data) => {
|
|
|
+ projectRecordsService.queryById(this.inputForm.id).then(async (data) => {
|
|
|
this.$refs.uploadComponent.clearUpload()
|
|
|
this.inputForm = this.recover(this.inputForm, data)
|
|
|
this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
|
|
|
@@ -695,6 +724,21 @@ export default {
|
|
|
if (this.commonJS.isEmpty(this.inputForm.projectMoney)) {
|
|
|
this.inputForm.projectMoney = ''
|
|
|
}
|
|
|
+
|
|
|
+ await this.commonApi.getTaskNameByProcInsId(this.inputForm.procInsId).then((data) => {
|
|
|
+ if (this.commonJS.isNotEmpty(data)) {
|
|
|
+ if (data === '项目经理审核') {
|
|
|
+ this.isProjectExecutorOnly = false
|
|
|
+ this.isUserOnly = true
|
|
|
+ }else if (data === '项目分管领导审核') {
|
|
|
+ this.isUserOnly = false
|
|
|
+ this.isProjectExecutorOnly = true
|
|
|
+ } else {
|
|
|
+ this.isProjectExecutorOnly = true
|
|
|
+ this.isUserOnly = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
this.checkProject()
|
|
|
// this.preInvoice()
|
|
|
this.loading = false
|
|
|
@@ -737,7 +781,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
// 表单提交
|
|
|
- doSubmit (status, callback) {
|
|
|
+ async doSubmit (status, callback) {
|
|
|
if (status === 'save') {
|
|
|
console.log("进入暂存提交方法")
|
|
|
console.log("进入暂存提交方法", callback)
|
|
|
@@ -771,8 +815,8 @@ export default {
|
|
|
// 审核同意
|
|
|
if (this.commonJS.isEmpty(this.inputForm.projectMasterId) && this.commonJS.isEmpty(this.inputForm.realHeader)) {
|
|
|
this.loading = false
|
|
|
- this.$message.error('“项目经理1”与“项目经理2”至少填写一项')
|
|
|
- throw new Error('“项目经理1”与“项目经理2”至少填写一项')
|
|
|
+ this.$message.error('请选择项目经理')
|
|
|
+ throw new Error('请选择项目经理')
|
|
|
} else {
|
|
|
if (this.inputForm.projectMasterName === this.inputForm.realHeaderName) {
|
|
|
this.loading = false
|
|
|
@@ -782,7 +826,36 @@ export default {
|
|
|
}
|
|
|
this.inputForm.agreeDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
|
|
|
this.inputForm.agreeUserId = this.$store.state.user.id
|
|
|
- this.inputForm.status = '5'
|
|
|
+ // 审核同意
|
|
|
+ await this.commonApi.getTaskNameByProcInsId(this.inputForm.procInsId).then((data) => {
|
|
|
+ if (this.commonJS.isNotEmpty(data)) {
|
|
|
+ if (data === '项目经理审核') {
|
|
|
+ this.inputForm.status = '5'
|
|
|
+
|
|
|
+ if(!this.inputForm.projectExecutor){
|
|
|
+ this.loading = false
|
|
|
+ this.$message.error('请选择项目执行人后,提交审核')
|
|
|
+ throw new Error()
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.inputForm.status = '2'
|
|
|
+
|
|
|
+ if("张宁" !== this.inputForm.realHeaderName && "孙文宝" !== this.inputForm.realHeaderName && "范百顺" !== this.inputForm.realHeaderName && "潘中" !== this.inputForm.realHeaderName){
|
|
|
+ this.inputForm.assignee = this.inputForm.realHeader
|
|
|
+ }
|
|
|
+
|
|
|
+ if("张宁" !== this.inputForm.projectMasterName && "孙文宝" !== this.inputForm.projectMasterName && "范百顺" !== this.inputForm.projectMasterName && "潘中" !== this.inputForm.projectMasterName){
|
|
|
+ this.inputForm.assignee = this.inputForm.projectMasterId
|
|
|
+ }
|
|
|
+ if(!this.inputForm.assignee){
|
|
|
+ this.loading = false
|
|
|
+ this.$message.error('项目经理中,请选择一个非所长人员')
|
|
|
+ throw new Error()
|
|
|
+ }
|
|
|
+ console.log("下一节点审核人为:",this.inputForm.assignee)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
} else if (status === 'reapply') {
|
|
|
this.inputForm.status = '2'
|
|
|
}
|
|
|
@@ -1294,6 +1367,14 @@ export default {
|
|
|
this.inputForm.projectLeaderId = user[0].id
|
|
|
this.inputForm.projectLeaderName = user[0].name
|
|
|
},
|
|
|
+ selectProjectExecutorUser(user) {
|
|
|
+ console.log(user[0].name)
|
|
|
+ this.inputForm.projectExecutor = user[0].id
|
|
|
+ this.inputForm.projectExecutorName = user[0].name
|
|
|
+ },
|
|
|
+ openProjectExecutorDia1() {
|
|
|
+ this.$refs.selectProjectExecutorUser.init()
|
|
|
+ },
|
|
|
|
|
|
openUserDia2() {
|
|
|
this.$refs.userSelect2.init()
|