Explorar el Código

添加质控签章完成后一天内可重新复核功能,添加签章文件批量导出功能

user5 hace 1 año
padre
commit
a524d477f8

+ 8 - 0
src/api/cw/reportManagement/ProjectReportService.js

@@ -9,6 +9,14 @@ export default {
       params: params
     })
   },
+exportAllSignatureFile: function (ids) {
+	return request({
+		url: prefix + '/cwProjectReport/exportAllSignatureFile',
+		method: 'get',
+		params: {ids: ids},
+		responseType: 'blob'
+	})
+},
   saveForm: function (inputForm) {
     return request({
       url: prefix + `/cwProjectReport/saveForm`,

+ 18 - 0
src/utils/index.js

@@ -352,11 +352,29 @@ export function downloadWord (data, filename) {
 	window.URL.revokeObjectURL(href) // 释放掉blob对象
 }
 
+/**
+ * zip压缩文件下载
+ * @param data
+ * @param filename
+ */
+export function downloadZip (data, filename) {
+	var blob = new Blob([data], {type: 'application/zip,charset=utf-8'}) // application/vnd.openxmlformats-officedocument.spreadsheetml.sheet这里表示xlsx类型
+	var downloadElement = document.createElement('a')
+	var href = window.URL.createObjectURL(blob) // 创建下载的链接
+	downloadElement.href = href
+	downloadElement.download = filename // 下载后文件名
+	document.body.appendChild(downloadElement)
+	downloadElement.click() // 点击下载
+	document.body.removeChild(downloadElement) // 下载完成移除元素
+	window.URL.revokeObjectURL(href) // 释放掉blob对象
+}
+
 export default {
 	getTenantColorById,
 	getTenantNameById,
 	downloadExcel,
 	downloadWord,
+	downloadZip,
 	toLine,
 	escapeHTML,
 	hashCode,

+ 36 - 1
src/views/cw/projectRecords/ProjectRecordsAddForm.vue

@@ -157,7 +157,7 @@
                                 :rules="[
                                  {required: true, message:'报备类型不能为空', trigger:'blur'}
                   ]">
-                    <el-select v-model="inputForm.reportType" placeholder="请选择报备类型" clearable style="width: 100%;">
+                    <el-select v-model="inputForm.reportType" placeholder="请选择报备类型" clearable style="width: 100%;" @change="reportTypeChange">
                       <el-option
                         v-for="item in $dictUtils.getDictList('cw_work_client_report_type')"
                         :key="item.value"
@@ -167,6 +167,21 @@
                     </el-select>
                   </el-form-item>
                 </el-col>
+                <el-col :span="12" v-if="this.reportTypeFlag">
+                  <el-form-item label="项目分类" prop="projectClassification"
+                                :rules="[
+                                 {required: true, message:'项目分类不能为空', trigger:'blur'}
+                  ]">
+                    <el-select v-model="inputForm.projectClassification" placeholder="请选择项目分类类型" clearable style="width: 100%;">
+                      <el-option
+                        v-for="item in $dictUtils.getDictList('project_classification')"
+                        :key="item.value"
+                        :label="item.label"
+                        :value="item.value">
+                      </el-option>
+                    </el-select>
+                  </el-form-item>
+                </el-col>
                 <el-col :span="12">
                   <el-form-item label="审计期间" prop="auditYear"
                                 :rules="[
@@ -471,6 +486,7 @@
           realHeader: '',
           clientContactsName: '',
           reportType: '',
+		  projectClassification: '',
           programRow: '',
           cwProjectClientContactDTOList: []
         },
@@ -480,6 +496,7 @@
         tableKeyClient: '1',
         tableKeyContact: '2',
         visible: false,
+	    reportTypeFlag: false,
         validContactRules: {
           name: [
             {required: true, message: '姓名不可以为空'}
@@ -600,6 +617,7 @@
           realHeader: '',
           clientContactsName: '',
           reportType: '',
+			projectClassification: '',
           cwProjectClientContactDTOList: []
         }
         this.inputForm.id = id
@@ -614,6 +632,15 @@
             if (this.commonJS.isEmpty(this.inputForm.workAttachmentDtoList)) {
               this.inputForm.workAttachmentDtoList = []
             }
+            if (this.commonJS.isEmpty(data.reportType)) {
+              this.reportTypeFlag = false
+            }else{
+            	if ('10' === data.reportType){
+					this.reportTypeFlag = true
+				}else {
+					this.reportTypeFlag = false
+				}
+			}
             if (this.commonJS.isEmpty(this.inputForm.cwProjectClientContactDTOList)) {
               this.inputForm.cwProjectClientContactDTOList = []
             }
@@ -640,6 +667,14 @@
           })
         })
       },
+		reportTypeChange(value){
+      		if(value && value === '10'){
+				this.reportTypeFlag = true;
+			}else{
+				this.reportTypeFlag = false;
+			}
+		}
+		,
       // 表单提交
       save () {
         this.$refs['inputForm'].validate((valid) => {

+ 29 - 0
src/views/cw/projectRecords/ProjectRecordsForm.vue

@@ -170,6 +170,21 @@
                     </el-select>
                   </el-form-item>
                 </el-col>
+				  <el-col :span="12" v-if="this.reportTypeFlag">
+					  <el-form-item label="项目分类" prop="projectClassification"
+									:rules="[
+                                 {required: true, message:'项目分类不能为空', trigger:'blur'}
+                  ]">
+						  <el-select v-model="inputForm.projectClassification" placeholder="请选择项目分类类型" clearable style="width: 100%;">
+							  <el-option
+								  v-for="item in $dictUtils.getDictList('project_classification')"
+								  :key="item.value"
+								  :label="item.label"
+								  :value="item.value">
+							  </el-option>
+						  </el-select>
+					  </el-form-item>
+				  </el-col>
                 <el-col :span="12">
                   <el-form-item label="审计期间" prop="auditYear"
                                 :rules="[
@@ -589,6 +604,7 @@
           realHeader: '',
           clientContactsName: '',
           reportType: '',
+			projectClassification: '',
           cwProjectClientContactDTOList: [],
           cwProjectMembersDTOList: []
         },
@@ -599,6 +615,7 @@
         tableKeyClient: '1',
         tableKeyMembers: '3',
         visible: false,
+		  reportTypeFlag: false,
         invoiceList: [],
         invoiceForm: {
           no: ''
@@ -717,6 +734,8 @@
           businessTypeName: '',
           planDate: [],
           realHeader: '',
+			reportType: '',
+			projectClassification: '',
           clientContactsName: '',
           cwProjectClientContactDTOList: [],
           cwProjectMembersDTOList: []
@@ -733,6 +752,16 @@
             if (this.commonJS.isEmpty(this.inputForm.workAttachmentDtoList)) {
               this.inputForm.workAttachmentDtoList = []
             }
+        console.log(data)
+			  if (this.commonJS.isEmpty(data.reportType)) {
+				  this.reportTypeFlag = false
+			  }else{
+				  if ('10' === data.reportType){
+					  this.reportTypeFlag = true
+				  }else {
+					  this.reportTypeFlag = false
+				  }
+			  }
             if (this.commonJS.isEmpty(this.inputForm.createDate)) {
               this.inputForm.createDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
             }

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

@@ -117,7 +117,7 @@
       <vxe-toolbar :refresh="{query: refreshList}" ref="toolbarRef" export custom>
         <template #buttons>
           <el-button v-if="hasPermission('cw_work_client:info:add')" type="primary" icon="el-icon-plus" @click="start()">新建</el-button>
-          <!--          <el-button v-if="hasPermission('klg:question:del')" type="danger"   size="small" icon="el-icon-delete" @click="del()" :disabled="$refs.questionsTable && $refs.questionsTable.getCheckboxRecords().length === 0" plain>删除</el-button>-->
+		  <el-button type="warning" icon="el-icon-download" @click="exportAllSignatureFile()" :disabled="$refs.clientTable && $refs.clientTable.getCheckboxRecords().length === 0" plain>已盖章文件下载</el-button>
         </template>
 		  <template #tools>
 			  <vxe-button
@@ -156,6 +156,7 @@
           :data="dataList"
           :checkbox-config="{}">
           <vxe-column type="seq" width="60" title="序号"></vxe-column>
+			<vxe-column type="checkbox" width="60" ></vxe-column>
           <vxe-column width="100" align="center" title="单据编号" field="documentNo">
             <template #default="scope">
               <el-link  type="primary" :underline="false" v-if="hasPermission('cwProjectReport:list')" @click="view(scope.row.id)">{{scope.row.documentNo}}</el-link>
@@ -316,7 +317,15 @@
                           (scope.row.signatureType === '3' && scope.row.status3 === '4')
                           )
                           && scope.row.createById === $store.state.user.id && (this.commonJS.isEmpty(scope.row.newType) || scope.row.newType !== '1')" @click="adjustSign(scope.row)"   text type="primary" >驳回调整</el-button>
-				<!--			   	修改签字注师流程-->
+
+				  <!--			   	重新复核流程-->
+				  <el-button
+					  v-if="scope.row.reviewStatus === '5'&&(scope.row.status1 === '5' || scope.row.status3 === '5')&& (scope.row.signatureAnnotatorStatus ==='5' || scope.row.signatureAnnotatorStatus ==='0' ) && scope.row.createById === $store.state.user.id && scope.row.repetitionReviewFlag"
+					  text type="primary"
+					  @click="repetitionPushF(scope.row)"
+				  >重新复核</el-button>
+
+				  <!--			   	修改签字注师流程-->
 			    <el-button
 					v-if="scope.row.reviewStatus === '5'&&(scope.row.status1 === '5' || scope.row.status3 === '5')&& (scope.row.signatureAnnotatorStatus ==='5' || scope.row.signatureAnnotatorStatus ==='0' ) && scope.row.createById === $store.state.user.id"
 					text type="primary"
@@ -708,7 +717,8 @@
 							title: '复核及签章' + '流程详情',
 							formTitle: '复核及签章' + '流程详情',
 							businessId: row.id,
-							status: 'reback'
+							status: 'reback',
+							detail: 'view'
 						}
 					})
 				})
@@ -830,6 +840,91 @@
 			  })
 		  }
       },
+		repetitionPushF (row) {
+			this.$confirm(`是否确定对该报告重新复核?确定后原已盖章文件将被删除,已归档数据将被清除!`, '提示', {
+				confirmButtonText: '确定',
+				cancelButtonText: '取消',
+				type: 'warning'
+			}).then(() => {
+				projectReportService.rebackReviewSign(row.id).then(() => {
+					// 读取流程表单
+					let title = ' '
+					if (!row.documentNo) {
+						title = ' ' + row.projectName
+					} else {
+						title = ' ' + row.documentNo + ' - ' + row.projectName
+					}
+					console.log('row', row)
+
+					if (this.commonJS.isEmpty(row.newType) || row.newType !== '1'){
+
+						let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了` + title + '[会计-报告复核]'
+						let status = 'startAndClose'
+						if (row.reviewStatus === '3') {
+							status = 'startAndClose'
+						} else if (row.reviewStatus === '4') {
+							status = 'reapplyFlag'
+						}
+
+						taskService.getTaskDef({ procDefId: this.processDefinitionAuditId,
+							businessId: row.id,
+							businessTable: 'cw_project_report_review'}).then((data) => {
+							this.$router.push({
+								path: '/flowable/task/TaskForm',
+								query: {
+									...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
+									procDefId: this.processDefinitionAuditId,
+									procDefKey: this.procDefAuditKey,
+									title: title,
+									formType: data.formType,
+									formUrl: data.formUrl,
+									formTitle: processTitle,
+									businessTable: 'cw_project_report_review',
+									businessId: row.id,
+									isShow: 'false',
+									status: status,
+									routePath: '/cw/reportManagement/ReportManagementList'
+								}
+							})
+						})
+					} else if ( row.newType === '1') {
+						let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了` + title + '[会计-复核及签章]'
+						let status = 'startAndClose'
+						if (row.reviewStatus === '3') {
+							status = 'startAndClose'
+						} else if (row.reviewStatus === '4') {
+							status = 'reapplyFlag'
+						}
+
+						taskService.getTaskDef({ procDefId: this.processDefinitionAuditIdAndSId,
+							businessId: row.id,
+							businessTable: 'cw_project_report_review'}).then((data) => {
+							this.$router.push({
+								path: '/flowable/task/TaskForm',
+								query: {
+									...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
+									procDefId: this.processDefinitionAuditIdAndSId,
+									procDefKey: this.procDefAuditKeyAndSId,
+									title: title,
+									formType: data.formType,
+									formUrl: data.formUrl,
+									formTitle: processTitle,
+									businessTable: 'cw_project_report_review',
+									businessId: row.id,
+									isShow: 'false',
+									status: status,
+									routePath: '/cw/reportManagement/ReportManagementList'
+								}
+							})
+						})
+					}
+				}).catch(() => {
+					this.refreshList()
+					this.$message.error('签章已撤回')
+				})
+			})
+
+      },
       pushTakeNumber (row) {
         // 读取流程表单
 		let title = ' '
@@ -1710,7 +1805,31 @@
 					}
 				})
 			})
-		}
+		},
+		// 删除
+		exportAllSignatureFile (id) {
+			let ids = id || this.$refs.clientTable.getCheckboxRecords().map(item => {
+				return item.id
+			}).join(',')
+			this.$confirm(`确定下载所选项的已盖章文件吗?`, '提示', {
+				confirmButtonText: '确定',
+				cancelButtonText: '取消',
+				type: 'warning'
+			}).then(() => {
+				this.loading = true
+				projectReportService.exportAllSignatureFile(ids).then((res) => {
+					// 将二进制流文件写入excel表,以下为重要步骤
+					this.$utils.downloadZip(res, '已签章文件')
+					this.loading = false
+				}).catch(function (err) {
+					this.loading = false
+					if (err.response) {
+						console.log(err.response)
+					}
+				})
+			})
+		},
+
     }
   }
 </script>

+ 23 - 6
src/views/cw/reportManagement/reportReviewNew/ReportReviewFormNew.vue

@@ -830,6 +830,7 @@
           cwFileInfoList: [],
           servedUnitId: '',
           reviewStatus: '',
+		  repetitionReviewFlag: '',
           taskName: '',
           realHeaderName: '',
           projectMasterId1: '',
@@ -852,7 +853,8 @@
         tableKey: '',
         tableKeyClient: '1',
         tableKeyClient2: '1',
-        tableKeyClient3: '1'
+        tableKeyClient3: '1',
+		created: ''
       }
     },
     ReportCancellApplyService: null,
@@ -864,6 +866,7 @@
       this.reportCancellApplyService = new ReportCancellApplyService()
       this.reportReviewService = new ReportReviewService()
       this.commonApi = new CommonApi()
+		this.detail = this.$route.query.detail;
     },
     computed: {
       bus: {
@@ -913,8 +916,9 @@
       getKeyWatch (keyWatch) {
         this.keyWatch = keyWatch
       },
-      init (method, id) {
+      init (method, id,detail) {
         console.log('method', method)
+        console.log('detail', detail)
         this.activeName = 'enclosure'
         this.signatureName = 'archiveFile'
         this.reportCancellApplyService = new ReportCancellApplyService()
@@ -979,6 +983,7 @@
           cwFileInfoList2: [],
           servedUnitId: '',
           reviewStatus: '',
+		  repetitionReviewFlag: '',
           taskName: '',
           realHeaderName: '',
           projectMasterId1: '',
@@ -1059,7 +1064,6 @@
 
 						if (da === '三级复核及签章') {
 							if (this.commonJS.isNotEmpty(sFiles) && this.inputForm.signatureType !== '3' && this.status === 'audit') {
-								console.log('建立了')
 								// 签章按钮展示
 								this.$refs.archiveFile.newUpload('view', data.cwFileInfoList, 'cwReportSignature', null, null, null, null, false, 'audit')
 								if (this.status === 'audit' && this.commonJS.isNotEmpty(sFiles) && this.inputForm.signatureType !== '3') {
@@ -1077,6 +1081,14 @@
 							if(this.inputForm.reviewStatus !== '2' && this.inputForm.reviewStatus !== '5'){
 								// 签章按钮隐藏
 								this.$refs.archiveFile.newUpload('add', data.cwFileInfoList, 'cwWorkContract', null, null, null, null, false)
+							}else if (this.inputForm.reviewStatus === '5' && this.inputForm.repetitionReviewFlag){
+								if(this.detail === 'view'){
+									// 签章按钮隐藏
+									this.$refs.archiveFile.newUpload('view', data.cwFileInfoList, 'cwWorkContract', null, null, null, null, false)
+								}else{
+									// 如果流程已经完成且流程完成后不超过1天,数据可调整,并重新复核
+									this.$refs.archiveFile.newUpload('add', data.cwFileInfoList, 'cwWorkContract', null, null, null, null, false)
+								}
 							}else{
 								// 签章按钮隐藏
 								this.$refs.archiveFile.newUpload('view', data.cwFileInfoList, 'cwWorkContract', null, null, null, null, false)
@@ -1143,9 +1155,13 @@
         if (this.commonJS.isNotEmpty(this.inputForm.id)) {
           projectReportService.queryById(this.inputForm.id).then((data) => {
             if (this.commonJS.isNotEmpty(data.reviewStatus) && data.reviewStatus !== '0' && data.reviewStatus !== '1' && data.reviewStatus !== '3') { // 审核状态不是“未发起”或“暂存”或“撤回”,就弹出提示
-              this.loading = false
-              this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
-              throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+              if(data.reviewStatus === '5' && data.repetitionReviewFlag){
+				  this.doSubmit('start', callback)
+			  }else{
+				  this.loading = false
+				  this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+				  throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+			  }
             } else {
               this.doSubmit('start', callback)
             }
@@ -1463,6 +1479,7 @@
           industry: '',
           businessObjects: ''
         }
+        this.detail = ''
         this.reviewBys = []
         // this.$refs.uploadComponent.clearUpload()
         // this.$refs.inputForm.resetFields()

+ 2 - 1
src/views/cw/workContract/ContractFilePaperForm.vue

@@ -132,7 +132,7 @@
             <el-date-picker
               :disabled="true"
               placement="bottom-start"
-              value-format="yyyy-MM-dd"
+              value-format="YYYY-MM-DD"
               v-model="inputForm.signingDate"
               style="width: 100%"
               placeholder="选择日期">
@@ -614,6 +614,7 @@
           // 查询合同登记数据
           // console.log('this.inputForm.id', this.inputForm.id)
           contractInfoService.findById(this.inputForm.id).then((data) => {
+          	console.log(data)
             this.inputForm = this.recover(this.inputForm, data)
             const f = []
             if (data.fees !== null && data.fees !== undefined && data.fees !== '') {

+ 2 - 0
src/views/flowable/task/TaskForm.vue

@@ -395,6 +395,7 @@ export default {
 		},
 		init() {
 			this.cs = this.$route.query.cs;
+			this.detail = this.$route.query.detail;
 			this.taskSelectedTab = "form-first";
 			this.procDefId = this.$route.query.procDefId;
 			this.procDefKey = this.$route.query.procDefKey;
@@ -1506,6 +1507,7 @@ export default {
 			taskFormData: [],
 			taskDefKey: "",
 			status: "",
+			detail: "",
 			title: "",
 			businessId: "",
 			buttons: [],