huangguoce 2 месяцев назад
Родитель
Сommit
c49a60f9ab

+ 119 - 5
src/views/cw/projectReportArchive/ProjectReportArchiveList.vue

@@ -171,12 +171,25 @@
           <vxe-column min-width="150" align="center" title="罚款金额(元)" field="fineMoney"></vxe-column>
           <vxe-column min-width="150" align="center" title="创建人" field="createBy.name"></vxe-column>
           <vxe-column min-width="200" align="center" title="创建时间" field="createTime"></vxe-column>
-          <vxe-column min-width="110px" align="center" fixed="right" title="状态" field="status">
+          <vxe-column min-width="130px" align="center" fixed="right" title="状态" field="status">
             <template #default="scope">
-              <el-button @click="detail(scope.row)" effect="dark"
-                :type="$dictUtils.getDictLabel('cw_status_flag', scope.row.status, '-')">
-                {{ $dictUtils.getDictLabel("cw_status", scope.row.status, '-') }}
-              </el-button>
+              <span v-if="scope.row.status == '8'">
+                <el-button @click="voidDetail(scope.row)" effect="dark" type="danger">
+                  作废待审核
+                </el-button>
+              </span>
+              <span v-else-if="scope.row.status == '7'">
+                <el-button @click="voidDetail(scope.row)" effect="dark" type="danger">
+                  已作废
+                </el-button>
+              </span>
+              <span v-else>
+                <el-button @click="detail(scope.row)" effect="dark"
+                  :type="$dictUtils.getDictLabel('cw_status_flag', scope.row.status, '-')">
+                  {{ $dictUtils.getDictLabel("cw_status", scope.row.status, '-') }}
+                </el-button>
+              </span>
+
             </template>
           </vxe-column>
           <vxe-column min-width="100px" title="借用状态" fixed="right" align="center" field="borrowType">
@@ -219,6 +232,13 @@
                   type="primary" @click="adjust(scope.row)">驳回调整</el-button>
                 <el-button v-if="hasPermission('report:manager:edit') && scope.row.status === '5'" text type="primary"
                   @click="managerEdit(scope.row.id)">修改</el-button>
+
+                <el-button
+                  v-if="hasPermission('cwProjectReportArchive:edit') && (scope.row.createBy.id === $store.state.user.id || haveProjectIds.includes(scope.row.projectId)) && scope.row.status === '5'"
+                  text type="danger" @click="voidArchive(scope.row)">作废</el-button>
+                <el-button
+                  v-if="hasPermission('cwProjectReportArchive:edit') && (scope.row.createBy.id === $store.state.user.id || haveProjectIds.includes(scope.row.projectId)) && scope.row.status === '8'"
+                  text type="primary" @click="rebackVoidArchive(scope.row)">撤回作废</el-button>
               </div>
             </template>
           </vxe-column>
@@ -306,6 +326,12 @@ export default {
       procDefAuditKey: '',
       processDefinitionAuditIdSZ: '',
       procDefAuditKeySZ: '',
+      // 归档作废流程
+      processDefinitionAuditVoidId: '',
+      procDefAuditKeyVoid: '',
+      // 归档作废流程-苏州分部
+      procDefAuditKeyVoidIdSZ: '',
+      procDefAuditKeyVoidSZ: '',
       isAdmin: false,
       haveProjectIds: '',
       typeDictList: [
@@ -463,6 +489,18 @@ export default {
           this.procDefAuditKeySZ = data.key
         }
       })
+      processService.getByName('会计-归档作废').then((data) => {
+        if (!this.commonJS.isEmpty(data.id)) {
+          this.processDefinitionAuditVoidId = data.id
+          this.procDefAuditKeyVoid = data.key
+        }
+      })
+      processService.getByName('会计-归档作废-苏州分部').then((data) => {
+        if (!this.commonJS.isEmpty(data.id)) {
+          this.processDefinitionAuditVoidIdSZ = data.id
+          this.procDefAuditKeyVoidSZ = data.key
+        }
+      })
     },
     // 当前页
     currentChangeHandle({ currentPage, pageSize }) {
@@ -530,6 +568,66 @@ export default {
         })
       })
     },
+    // 撤回
+    rebackVoidArchive(row) {
+      this.$confirm(`确定要撤回该申请吗?`, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(async () => {
+        let data = await this.projectReportArchiveService.queryById(row.id)
+        if (data.status !== '8') { // status的值不等于“审核中”,就弹出提示
+          this.$message.error('数据已发生改变或不存在,请刷新数据')
+          this.refreshList()
+        } else {
+          let res = await processService.revokeProcIns(row.procInsId)
+          let form = {
+            status: '5',
+            id: row.id,
+            procInsId: row.originProcInsId,
+            processDefinitionId: row.originProcessDefinitionId
+          }
+          this.projectReportArchiveService.updateStatusById(form)
+          this.$message.success(res)
+          this.refreshList()
+        }
+      })
+    },
+    // 归档作废
+    voidArchive(row) {
+      // 读取流程表单
+      let title = `发起流程[会计-报告归档作废]`
+      let processTitle = ''
+      if (this.commonJS.isEmpty(row.reportNo)) {
+        processTitle = `${this.$store.state.user.name} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了无报告号 - ${row.projectName} [会计-报告归档作废]`
+      } else {
+        processTitle = `${this.$store.state.user.name} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 ${row.reportNo} - ${row.projectName} [会计-报告归档作废]`
+      }
+      let status = 'startAndCloseFiled'
+      taskService.getTaskDef({
+        procDefId: this.processDefinitionAuditVoidId,
+        businessId: row.id,
+        businessTable: 'cw_project_archive'
+      }).then((data) => {
+        this.$router.push({
+          path: '/flowable/task/TaskForm',
+          query: {
+            ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
+            procDefId: this.processDefinitionAuditVoidId,
+            procDefKey: this.procDefAuditKeyVoid,
+            title: title,
+            formType: data.formType,
+            formUrl: data.formUrl,
+            formTitle: processTitle,
+            businessTable: 'cw_project_archive',
+            businessId: row.id,
+            isShow: 'false',
+            status: status,
+            routePath: '/cw/projectReportArchive/ProjectReportArchiveList'
+          }
+        })
+      })
+    },
     // 发起项目归档
     push(row) {
       // 读取流程表单
@@ -568,6 +666,22 @@ export default {
         })
       })
     },
+    // 查看作废项目流程结果
+    voidDetail(row) {
+      if (row.status == '7') {
+        let procInsId = row.procInsId
+        let procDefId = this.processDefinitionAuditVoidId
+        officeService.queryById(this.$store.state.user.office.id).then((byId) => {
+          // 判断当前人的所属部门是否为苏州分部,根据部门的机构编码(szfb)来判断是不是苏州分部
+          if (byId.code === 'szfb') {
+            procDefId = this.processDefinitionAuditVoidIdSZ
+            this.getTaskDef(row, procInsId, procDefId)
+          } else {
+            this.getTaskDef(row, procInsId, procDefId)
+          }
+        })
+      }
+    },
     // 查看项目归档流程结果
     detail(row) {
       if (row.status !== '0' && row.status !== '1') {

Разница между файлами не показана из-за своего большого размера
+ 2142 - 0
src/views/cw/projectReportArchive/ProjectReportArchiveVoidTaskForm.vue


+ 98 - 49
src/views/cw/reportManagement/ReportManagementList.vue

@@ -193,49 +193,88 @@
 					<vxe-column width="110" align="center" title="创建时间" field="createTime"></vxe-column>
 					<vxe-column min-width="100px" align="center" fixed="right" title="报告号申请" field="applyStatus">
 						<template #default="scope">
-							<el-button @click="detailApply(scope.row)" effect="dark"
-								v-if="scope.row.applyStatus !== '0'"
-								:type="$dictUtils.getDictLabel('cw_status_flag', scope.row.applyStatus, '-')">
-								{{ $dictUtils.getDictLabel("cw_status", scope.row.applyStatus, '-') }}
-							</el-button>
-							<el-button v-else-if="scope.row.reviewStatus === '0'" effect="dark">
-								未发起
-							</el-button>
+							<div v-if="scope.row.status == '7'">
+								<el-button @click="detailApply(scope.row)" effect="dark"
+									v-if="scope.row.applyStatus !== '0'" type="danger">
+									已作废
+								</el-button>
+								<el-button @click="detailApplyReview(scope.row)" effect="dark"
+									v-if="scope.row.improperTakeCause" type="danger">
+									已作废
+								</el-button>
+							</div>
+							<div v-else>
+								<el-button @click="detailApply(scope.row)" effect="dark"
+									v-if="scope.row.applyStatus !== '0'"
+									:type="$dictUtils.getDictLabel('cw_status_flag', scope.row.applyStatus, '-')">
+									{{ $dictUtils.getDictLabel("cw_status", scope.row.applyStatus, '-') }}
+								</el-button>
+								<el-button v-else-if="scope.row.reviewStatus === '0'" effect="dark">
+									未发起
+								</el-button>
 
-							<el-button @click="detailApplyReview(scope.row)" effect="dark"
-								v-if="scope.row.improperTakeCause"
-								:type="$dictUtils.getDictLabel('cw_status_flag', scope.row.applyReviewStatus, '-')">
-								{{ $dictUtils.getDictLabel("cw_status", scope.row.applyReviewStatus, '-') }}
-							</el-button>
+								<el-button @click="detailApplyReview(scope.row)" effect="dark"
+									v-if="scope.row.improperTakeCause"
+									:type="$dictUtils.getDictLabel('cw_status_flag', scope.row.applyReviewStatus, '-')">
+									{{ $dictUtils.getDictLabel("cw_status", scope.row.applyReviewStatus, '-') }}
+								</el-button>
+							</div>
 						</template>
 					</vxe-column>
 					<vxe-column min-width="230px" align="center" fixed="right" title="复核签章状态" field="reviewStatus">
 						<template #default="scope">
-							<el-button @click="detail(scope.row)" effect="dark"
-								:type="$dictUtils.getDictLabel('cw_status_flag', scope.row.reviewStatus, '-')">
-								{{ $dictUtils.getDictLabel("cw_status", scope.row.reviewStatus, '-') }}
-							</el-button>
+							<div v-if="scope.row.status == '7'">
+								<el-button @click="detail(scope.row)" effect="dark" type="danger">
+									已作废
+								</el-button>
+
+								<el-button v-if="scope.row.signatureType === '1' && scope.row.newType === '0'"
+									@click="detailS(scope.row)" effect="dark" type="danger">
+									已作废
+								</el-button>
+								<el-button v-else-if="scope.row.signatureType === '2' && scope.row.newType === '0'"
+									@click="detailS2(scope.row)" type="danger" effect="dark">
+									已作废
+								</el-button>
+								<el-button v-else-if="scope.row.signatureType === '3' && scope.row.newType === '0'"
+									@click="detailS3(scope.row)" effect="dark" type="danger">
+									已作废
+								</el-button>
+								<el-button v-else-if="scope.row.newType === '0'" effect="dark">
+									未发起
+								</el-button>
+							</div>
+							<div v-else>
+								<el-button @click="detail(scope.row)" effect="dark"
+									:type="$dictUtils.getDictLabel('cw_status_flag', scope.row.reviewStatus, '-')">
+									{{ $dictUtils.getDictLabel("cw_status", scope.row.reviewStatus, '-') }}
+								</el-button>
+
+								<el-button v-if="scope.row.signatureType === '1' && scope.row.newType === '0'"
+									@click="detailS(scope.row)" effect="dark"
+									:type="$dictUtils.getDictLabel('cw_status_flag', scope.row.status1, '-')">
+									{{ scope.row.status1 === '5' ? '电子章已完成' : $dictUtils.getDictLabel("cw_status",
+										scope.row.status1, '-') }}
+								</el-button>
+								<el-button v-else-if="scope.row.signatureType === '2' && scope.row.newType === '0'"
+									@click="detailS2(scope.row)" effect="dark"
+									:type="$dictUtils.getDictLabel('cw_project_report_sign_status_flag', scope.row.status2, '-')">
+									{{ $dictUtils.getDictLabel("cw_project_report_sign_status", scope.row.status2, '-')
+									}}
+								</el-button>
+								<el-button v-else-if="scope.row.signatureType === '3' && scope.row.newType === '0'"
+									@click="detailS3(scope.row)" effect="dark"
+									:type="$dictUtils.getDictLabel('cw_status_flag', scope.row.status3, '-')">
+									{{ scope.row.status3 === '5' ? '实体章已完成' : $dictUtils.getDictLabel("cw_status",
+										scope.row.status3, '-') }}
+								</el-button>
+								<el-button v-else-if="scope.row.newType === '0'" effect="dark">
+									未发起
+								</el-button>
+							</div>
+
+
 
-							<el-button v-if="scope.row.signatureType === '1' && scope.row.newType === '0'"
-								@click="detailS(scope.row)" effect="dark"
-								:type="$dictUtils.getDictLabel('cw_status_flag', scope.row.status1, '-')">
-								{{ scope.row.status1 === '5' ? '电子章已完成' : $dictUtils.getDictLabel("cw_status",
-									scope.row.status1, '-') }}
-							</el-button>
-							<el-button v-else-if="scope.row.signatureType === '2' && scope.row.newType === '0'"
-								@click="detailS2(scope.row)" effect="dark"
-								:type="$dictUtils.getDictLabel('cw_project_report_sign_status_flag', scope.row.status2, '-')">
-								{{ $dictUtils.getDictLabel("cw_project_report_sign_status", scope.row.status2, '-') }}
-							</el-button>
-							<el-button v-else-if="scope.row.signatureType === '3' && scope.row.newType === '0'"
-								@click="detailS3(scope.row)" effect="dark"
-								:type="$dictUtils.getDictLabel('cw_status_flag', scope.row.status3, '-')">
-								{{ scope.row.status3 === '5' ? '实体章已完成' : $dictUtils.getDictLabel("cw_status",
-									scope.row.status3, '-') }}
-							</el-button>
-							<el-button v-else-if="scope.row.newType === '0'" effect="dark">
-								未发起
-							</el-button>
 
 						</template>
 					</vxe-column>
@@ -246,14 +285,26 @@
           </vxe-column>-->
 					<vxe-column min-width="100px" align="center" 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>
+							<div v-if="scope.row.status == '7'">
+								<el-button @click="detailSig(scope.row)" effect="dark"
+									v-if="scope.row.signatureAnnotatorStatus !== '0'" type="danger">
+									已作废
+								</el-button>
+								<el-button v-else effect="dark">
+									未发起
+								</el-button>
+							</div>
+							<div v-else>
+								<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>
+							</div>
+
 						</template>
 					</vxe-column>
 					<vxe-column min-width="100px" align="center" title="撤回签章" field="rebackStatus">
@@ -302,7 +353,8 @@
 								<el-button v-if="scope.row.applyStatus == '5'" text type="primary"
 									@click="rebackApplyAndAll(scope.row)">撤回报告号申请</el-button>
 							</div>
-							<div v-else>
+							<div
+								v-else-if="isAdmin === false && scope.row.archiveStatus != '5' && scope.row.status != '7'">
 								<el-button v-if="$dictUtils.getDictValue('report_edit_flag', 'open', '0') == 1" text
 									type="primary" @click="editApprovedAmount(scope.row.id)">审定金额修改</el-button>
 								<el-button
@@ -442,9 +494,6 @@
 								<el-button
 									v-if="hasPermission('cw:workContract:filed') && scope.row.createById === $store.state.user.id && scope.row.rebackStatus === '2'"
 									text type="primary" @click="revocation(scope.row)">撤回</el-button>
-
-
-
 							</div>
 						</template>
 					</vxe-column>