浏览代码

修改签字注师

sangwenwei 1 年之前
父节点
当前提交
c5f1f9a3bd

+ 4 - 0
src/views/cw/reportManagement/ReportManagementList.vue

@@ -177,9 +177,13 @@
 			<vxe-column  min-width="120px" align="center" fixed="right" title="修改注师" field="signatureAnnotatorStatus" >
 				<template #default="scope">
 					<el-button @click="detailSig(scope.row)" effect="dark"
+							   v-if="scope.row.signatureAnnotatorStatus !=='0'"
 							   :type="$dictUtils.getDictLabel('cw_status_flag', scope.row.signatureAnnotatorStatus, '-')">
 						{{$dictUtils.getDictLabel("cw_status", scope.row.signatureAnnotatorStatus, '-')}}
 					</el-button>
+					<el-button v-else effect="dark" >
+						未发起
+					</el-button>
 				</template>
 			</vxe-column>
 

+ 112 - 16
src/views/cw/reportManagement/ReportSignatureForm.vue

@@ -2,7 +2,6 @@
 	<div>
 		<el-row>
 			<el-col :span="24">
-
 				<el-form :model="inputForm" ref="inputForm2" v-loading="loading" :class="method==='view'?'readonly':''"
 						 label-width="135px" @submit.native.prevent>
 					<el-divider content-position="left"><i class="el-icon-document"></i> 项目信息</el-divider>
@@ -659,20 +658,22 @@
 						</el-row>
 					</el-form>
 				</el-form>
-				<el-tabs v-model="activeName" type="border-card" @tab-click="tabHandleClick">
-					<el-tab-pane label="附件" name="enclosure" >
-						<!--        附件-->
-						<UpLoadComponent ref="enclosure"></UpLoadComponent>
-					</el-tab-pane>
-					<el-tab-pane label="签章文件" name="archiveFile">
-						<!--        签章文件-->
-						<UpLoadComponent ref="archiveFile"></UpLoadComponent>
-					</el-tab-pane>
-					<el-tab-pane label="已签章附件" name="signatureFile">
-						<!--        附件-->
-						<UpLoadComponent ref="signatureFile"></UpLoadComponent>
-					</el-tab-pane>
-				</el-tabs>
+				<el-form :disabled="true" :readonly="true">
+					<el-tabs v-model="activeName" type="border-card" @tab-click="tabHandleClick">
+						<el-tab-pane label="附件" name="enclosure" >
+							<!--        附件-->
+							<UpLoadComponent ref="enclosure" ></UpLoadComponent>
+						</el-tab-pane>
+						<el-tab-pane label="签章文件" name="archiveFile" >
+							<!--        签章文件-->
+							<UpLoadComponent ref="archiveFile" ></UpLoadComponent>
+						</el-tab-pane>
+						<el-tab-pane label="已签章附件" name="signatureFile" >
+							<!--        附件-->
+							<UpLoadComponent ref="signatureFile"></UpLoadComponent>
+						</el-tab-pane>
+					</el-tabs>
+				</el-form>
 			</el-col>
 		</el-row>
 		<ProjectRecoredChooseCom  ref="projectRecoredChooseCom" @getProject="getContract"></ProjectRecoredChooseCom>
@@ -828,6 +829,7 @@
 			},
 			'loading': {
 				handler (newVal) {
+					console.log('111',newVal)
 					this.$emit('changeLoading', newVal)
 					this.$refs.signatureFile.changeLoading(newVal)
 					this.$refs.archiveFile.changeLoading(newVal)
@@ -937,6 +939,11 @@
 						if (this.commonJS.isEmpty(this.inputForm.createDate)) {
 							this.inputForm.createDate = this.moment(new Date()).format('YYYY-MM-DD')
 						}
+						if (this.commonJS.isEmpty(data.details)) {
+							this.reportReviewService.list('1').then((data) => { this.detailDivide(data) })
+						} else {
+							this.detailDivide(data.details)
+						}
 						if (this.commonJS.isNotEmpty(data.procInsId)) {
 							this.reportReviewService.getProcessStatus(data.procInsId).then((data) => {
 								this.inputForm.taskName = data
@@ -956,11 +963,32 @@
 						} else {
 							this.method = 'false'
 						}
+						this.$refs.enclosure.newUpload(this.method, data.cwFileInfoList2, 'cwWorkContract', null, null, null, null, false)
+						this.$refs.archiveFile.newUpload('view', data.cwFileInfoList, 'cwWorkContract', null, null, null, null, false)
+						this.$refs.signatureFile.newUpload('view', data.signatureFileList, 'cwWorkContract', null, null, null, null, false)
 						this.loading = false
 					})
 				})
 			},
-
+			detailDivide (details) {
+				this.inputForm.detailFor1010 = []
+				this.inputForm.detailFor1020 = []
+				this.inputForm.detailFor1030 = []
+				details.forEach(item => {
+					if (item.sort.toString().startsWith('1010')) {
+						this.inputForm.detailFor1010.push(item)
+						this.tableKeyClient = Math.random()
+					}
+					if (item.sort.toString().startsWith('1020')) {
+						this.inputForm.detailFor1020.push(item)
+						this.tableKeyClient2 = Math.random()
+					}
+					if (item.sort.toString().startsWith('1030')) {
+						this.inputForm.detailFor1030.push(item)
+						this.tableKeyClient3 = Math.random()
+					}
+				})
+			},
 			clearClientList () {
 				// 项目直接对接联系人列表清除
 				this.inputForm.clientList = []
@@ -1013,6 +1041,11 @@
 					this.inputForm.createDate = this.moment(new Date()).format('YYYY-MM-DD')
 					// 验证报告 日期报告 类型是否出具报告 意见类型 是否为空
 					// eslint-disable-next-line no-unused-expressions
+					// 列表处理
+					this.inputForm.details = []
+					this.inputForm.detailFor1010.forEach(item => { this.inputForm.details.push(item) })
+					this.inputForm.detailFor1020.forEach(item => { this.inputForm.details.push(item) })
+					this.inputForm.detailFor1030.forEach(item => { this.inputForm.details.push(item) })
 					//根据签字注师1的人员id去查是否超过了100次
 					userService.getCount(this.inputForm.signatureAnnotator1).then((data) => {
 						if (data.accountantUserCount >= 100 && data.accountantUserFlag === 1) {
@@ -1054,6 +1087,11 @@
 						if (this.commonJS.isEmpty(this.inputForm.createDate)) {
 							this.inputForm.createDate = this.moment(new Date()).format('YYYY-MM-DD')
 						}
+						// 列表处理
+						this.inputForm.details = []
+						this.inputForm.detailFor1010.forEach(item => { this.inputForm.details.push(item) })
+						this.inputForm.detailFor1020.forEach(item => { this.inputForm.details.push(item) })
+						this.inputForm.detailFor1030.forEach(item => { this.inputForm.details.push(item) })
 						//根据签字注师1的人员id去查是否超过了100次
 						userService.getCount(this.inputForm.signatureAnnotator1).then((data) => {
 							if (data.accountantUserCount >= 100 && data.accountantUserFlag === 1) {
@@ -1079,11 +1117,64 @@
 				this.loading = true
 				if (type === 'reject' || type === 'reback') {
 					await projectReportService.queryById(this.inputForm.id).then((data) => {
+						this.commonApi.getTaskNameByProcInsId(review.procInsId).then((data) => {
+							if (data === '二级复核') { // 二级复核 进入下面操作,不是二级复核 直接驳回
+								this.reportReviewService.getHaveReportNo(this.inputForm.id).then((haveReportNo) => { // 根据报告id查询是否已经生成报告文号
+									console.log(haveReportNo)
+									if (haveReportNo === '1' || haveReportNo === 1) { // 返回值为 ’1‘,已生成报告文号,直接驳回
+										this.rejectOn(callback)
+									} else { // 返回值为 ’0‘,未生成报告文号,询问是否需要生成报告文号?是 则生成后驳回,否 则直接驳回
+										this.$confirm(`是否需要生成报告文号?`, '提示', {
+											confirmButtonText: '确定',
+											cancelButtonText: '取消',
+											type: 'warning'
+										}).then(() => { // 是  则生成报告文号后驳回
+											this.reportReviewService.saveReportNo(this.inputForm.id).then(() => {
+												this.rejectOn(callback)
+											})
+										}).catch(() => { // 否  则直接驳回
+											this.rejectOn(callback)
+										})
+									}
+								})
+							} else {
+								this.rejectOn(callback)
+							}
+						})
 						if (data.signatureAnnotatorStatus !== '4') { // status的值不等于“审核中”就弹出提示
 							this.loading = false
 							this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
 							throw new Error()
 						} else {
+							if (type === 'reject') {
+								this.reportReviewService.queryByReportId(this.inputForm.id).then((review) => {
+									console.log('review', review)
+									this.commonApi.getTaskNameByProcInsId(review.procInsId).then((data) => {
+										if (data === '二级复核') { // 二级复核 进入下面操作,不是二级复核 直接驳回
+											this.reportReviewService.getHaveReportNo(this.inputForm.id).then((haveReportNo) => { // 根据报告id查询是否已经生成报告文号
+												console.log(haveReportNo)
+												if (haveReportNo === '1' || haveReportNo === 1) { // 返回值为 ’1‘,已生成报告文号,直接驳回
+													this.rejectOn(callback)
+												} else { // 返回值为 ’0‘,未生成报告文号,询问是否需要生成报告文号?是 则生成后驳回,否 则直接驳回
+													this.$confirm(`是否需要生成报告文号?`, '提示', {
+														confirmButtonText: '确定',
+														cancelButtonText: '取消',
+														type: 'warning'
+													}).then(() => { // 是  则生成报告文号后驳回
+														this.reportReviewService.saveReportNo(this.inputForm.id).then(() => {
+															this.rejectOn(callback)
+														})
+													}).catch(() => { // 否  则直接驳回
+														this.rejectOn(callback)
+													})
+												}
+											})
+										} else {
+											this.rejectOn(callback)
+										}
+									})
+								})
+							}
 							if (type === 'reback') {
 								// 撤回
 								let param = {signatureAnnotatorStatus: '3', id: this.inputForm.id}
@@ -1113,6 +1204,11 @@
 				// 驳回
 				let param
 				this.inputForm.signatureAnnotatorStatus = '4'
+				// 列表处理
+				this.inputForm.details = []
+				this.inputForm.detailFor1010.forEach(item => { this.inputForm.details.push(item) })
+				this.inputForm.detailFor1020.forEach(item => { this.inputForm.details.push(item) })
+				this.inputForm.detailFor1030.forEach(item => { this.inputForm.details.push(item) })
 				param = {signatureAnnotatorStatus: this.inputForm.signatureAnnotatorStatus,
 					id: this.inputForm.id,
 					needUpdate2: this.inputForm.needUpdate2,