浏览代码

Merge remote-tracking branch 'origin/master'

jzh 10 月之前
父节点
当前提交
a00cf82816

+ 117 - 33
client/src/views/OaSystem/marketCenter/projectCheck/index.vue

@@ -10,7 +10,7 @@
         :class="{ active: currentTab === item['key'] }"
         @click="switchTabHandle(item)"
       >
-        {{ item['name'] }}
+        {{ item['name'] }}({{ item['value'] }})
       </li>
     </ul>
     <div class="tableBox">
@@ -27,17 +27,18 @@
             height: '50px'
           }"
           @selection-change="handleSelectionChange"
-          v-loading="loading"
         >
-          <el-table-column type="selection" width="55" />
+          <el-table-column v-if="currentTab === '0'" type="selection" width="55" />
           <el-table-column label="序号" width="100" align="center">
             <template #default="scope">{{ scope.$index + 1 }}</template>
           </el-table-column>
           <el-table-column :show-overflow-tooltip="true" prop="xmmc" label="项目名称" width="280" />
-          <el-table-column :show-overflow-tooltip="true" prop="xmbm" label="项目部门" width="250" />
-          <el-table-column label="项目经理" prop="xmjl" width="160" />
-          <el-table-column label="项目状态" width="120" align="center">
-            <template #default="scope">{{ getCustomerType(scope.row.xmzt) }}</template>
+          <el-table-column :show-overflow-tooltip="true" prop="xmbm" label="项目部门" width="160" />
+          <el-table-column label="项目经理" prop="xmjl" width="100" />
+          <el-table-column label="项目状态" width="100" align="center">
+            <template #default="scope">
+              {{ getDictLabel(DICT_TYPE.PROJECT_STATUS, scope.row.xmzt) }}
+            </template>
           </el-table-column>
           <el-table-column label="合同额(万元)" width="140" align="center">
             <template #default="scope">{{ scope.row.virtualAmount }}</template>
@@ -46,11 +47,11 @@
             <template #default="scope">{{ scope.row.returnAmount }}</template>
           </el-table-column>
           <el-table-column label="本年初始进度" width="140" align="center">
-            <template #default="scope">{{ scope.row.finishProgress }}</template>
+            <template #default="scope">{{ scope.row.finishProgress * 100 }}%</template>
           </el-table-column>
-          <el-table-column label="现进度" width="220" align="center">
+          <el-table-column label="现进度" width="120" align="center">
             <template #default="scope">
-              <span>{{ scope.row.reportProgress }}</span>
+              <span>{{ scope.row.reportProgress }}%</span>
             </template>
           </el-table-column>
           <el-table-column label="进度说明" width="220" align="center">
@@ -73,10 +74,14 @@
             <template #default="scope">{{ scope.row.periodCheckValue }}</template>
           </el-table-column>
           <el-table-column label="状态" width="140" align="center">
-            <template #default="scope">{{ scope.row.periodCheckValue }}</template>
-          </el-table-column>
-          <el-table-column label="操作" fixed="right" width="260">
             <template #default="scope">
+              <span :style="{ color: scope.row.reportStatus === '11' ? 'red' : '' }">
+                {{ getDictLabel(DICT_TYPE.PROJECT_REPORT_STATUS, scope.row.reportStatus) }}
+              </span>
+            </template>
+          </el-table-column>
+          <el-table-column label="操作" fixed="right" :width="currentTab === '0' ? '160' : '100'">
+            <template v-if="currentTab === '0'" #default="scope">
               <dialog-confirm
                 title="确认审核通过吗?"
                 confirmButtonText="确定"
@@ -93,6 +98,17 @@
                 驳回
               </el-button>
             </template>
+            <template v-else #default="scope">
+              <el-button
+                v-if="scope.row.reportStatus && scope.row.reportStatus !== '00'"
+                type="primary"
+                plain
+                round
+                @click="getProjectReportAuditList(scope.row)"
+              >
+                查看
+              </el-button>
+            </template>
           </el-table-column>
         </el-table>
       </div>
@@ -113,11 +129,36 @@
         </div>
       </template>
     </el-dialog>
+    <el-dialog title="审核记录" v-model="auditorVisiabled" width="600px" append-to-body>
+      <div class="timeLineBox" v-if="activities.length > 0">
+        <el-timeline style="max-width: 600px">
+          <el-timeline-item
+            v-for="(activity, index) in activities"
+            :key="index"
+            type="primary"
+            :hollow="true"
+            :timestamp="convertTimeToDate(activity.auditDate)"
+          >
+            <p>
+              <span style="margin-right: 20px">审核人:{{ activity.auditor }}</span>
+              <span>
+                状态:<span :style="{ color: activity.auditStatus === '11' ? 'red' : '' }">
+                  {{ getDictLabel(DICT_TYPE.PROJECT_REPORT_STATUS, activity.auditStatus) }}
+                </span>
+              </span>
+            </p>
+            <p> {{ activity.comments }}</p>
+          </el-timeline-item>
+        </el-timeline>
+      </div>
+      <div v-else style="text-align: center"> 暂无审核记录 </div>
+    </el-dialog>
   </div>
 </template>
 <script lang="ts" setup>
 import request from '@/config/axios'
-import { getDictOptions } from '@/utils/dict'
+import { convertTimeToDate } from '@/utils/formatTime'
+import { DICT_TYPE, getDictLabel } from '@/utils/dict'
 
 defineOptions({ name: 'ProjectCheck' })
 
@@ -126,16 +167,19 @@ const dataSource = ref([])
 type TabType = {
   name: string
   key: string
+  value: number
 }
 const currentTab = ref<string>('0')
 const tabList = ref<TabType[]>([
   {
     name: '待审核',
-    key: '0'
+    key: '0',
+    value: 0
   },
   {
     name: '已审核',
-    key: '1'
+    key: '1',
+    value: 0
   }
 ])
 const switchTabHandle = (item: TabType) => {
@@ -151,31 +195,43 @@ const tableRef: any = ref(null)
 const tableHeight: any = ref(0)
 const message = useMessage()
 
-const loading = ref(false)
-const getProjectCheckByList = async () => {
-  loading.value = true
+//待审核
+const getProjectCheckListAjax = async () => {
   const result: any = await request.get(
     {
       url: '/projectReport/list-check'
     },
     '/business'
   )
+  return result
+}
+const getProjectCheckByList = async () => {
+  const result: any = await getProjectCheckListAjax()
   dataSource.value = result ?? []
-  loading.value = false
 }
-
-const getProjectCheckedByList = async () => {
-  loading.value = true
-  const result: any = await request.get(
+const getProjectCheckByCount = async () => {
+  const result: any = await getProjectCheckListAjax()
+  result && (tabList.value[0]['value'] = result.length)
+}
+//已审核
+const getProjectCheckedListAjax = async () => {
+  return await request.get(
     {
       url: '/projectReport/list-checked'
     },
     '/business'
   )
+}
+const getProjectCheckedByList = async () => {
+  const result: any = await getProjectCheckedListAjax()
   dataSource.value = result ?? []
-  loading.value = false
 }
-
+const getProjectCheckedByCount = async () => {
+  const result: any = await getProjectCheckedListAjax()
+  result && (tabList.value[1]['value'] = result.length)
+}
+getProjectCheckByCount()
+getProjectCheckedByCount()
 const passProjectReportHandle = async (data: any) => {
   const result: any = await request.post(
     {
@@ -187,26 +243,37 @@ const passProjectReportHandle = async (data: any) => {
   if (result) {
     message.success('通过成功!')
     getProjectCheckByList()
+    getProjectCheckByCount()
+    getProjectCheckedByCount()
   }
 }
-const selections = ref<any>()
+const selections = ref<any>([])
 const passBatchProjectReportHandle = async () => {
+  if (selections.value.length === 0) {
+    message.error('请至少选择一条数据!')
+    return
+  }
   const data = selections.value.map((item) => {
     return {
       id: item['auditId'],
       reportId: item['reportId']
     }
   })
+  const sendData = {
+    passList: data
+  }
   const result: any = await request.post(
     {
       url: '/projectReport/pass-batch',
-      data
+      data: sendData
     },
     '/business'
   )
   if (result) {
     message.success('批量审核成功!')
     getProjectCheckByList()
+    getProjectCheckByCount()
+    getProjectCheckedByCount()
   }
 }
 const handleSelectionChange = (arr) => {
@@ -240,15 +307,31 @@ const rejectProjectReportHandle = async () => {
   if (result) {
     message.success('驳回成功!')
     getProjectCheckByList()
+    getProjectCheckByCount()
+    getProjectCheckedByCount()
   }
 }
-const customerType: any = ref([])
-const getCustomerType = (str) => {
-  return customerType.value.find((item) => item.value == str)?.label ?? str
-}
+const auditorVisiabled = ref<boolean>(false)
 
+//审核记录
+const activities = ref<any[]>([])
+const getProjectReportAuditList = async (row: { reportId: string }) => {
+  const result: any = await request.get(
+    {
+      url: '/projectReportAudit/list',
+      params: {
+        reportId: row.reportId
+      }
+    },
+    '/business'
+  )
+  result.reverse()
+  auditorVisiabled.value = true
+  if (result && result.length > 0) {
+    activities.value = result
+  }
+}
 onMounted(() => {
-  customerType.value = getDictOptions('customer_type')
   tableHeight.value = tableRef.value.clientHeight
   getProjectCheckByList()
 })
@@ -271,6 +354,7 @@ onMounted(() => {
 .btnBox {
   position: absolute;
   right: 20px;
+  z-index: 999;
 }
 .tabs {
   margin-bottom: 10px;

+ 26 - 15
client/src/views/OaSystem/marketCenter/projectCheckPass/index.vue

@@ -7,7 +7,7 @@
           开启填报
         </el-button>
         <el-button type="danger" v-if="status === 0" @click="archiveProjectReportPeriodHandle">
-          归档
+          结束本年度考核
         </el-button>
       </div>
     </div>
@@ -19,7 +19,7 @@
           v-for="(item, index) in tabList"
           :class="{ active: cTabIndex === index }"
           :key="index"
-          @click="switchTabHandle(item, index)"
+          @click="switchTabHandle(index)"
           >{{ item['xmbm'] }}</li
         >
       </ul>
@@ -108,7 +108,7 @@
                 <template #default="scope">{{ scope.row.returnAmount }}</template>
               </el-table-column>
               <el-table-column label="本年初始进度" width="140" align="center">
-                <template #default="scope">{{ scope.row.finishProgress }}</template>
+                <template #default="scope">{{ scope.row.finishProgress * 100 }}%</template>
               </el-table-column>
               <el-table-column label="现进度" width="120" align="center">
                 <template #default="scope">
@@ -215,6 +215,7 @@ const getProjectPassByList = async () => {
   tabList.value.push(...getRowMapByList(result, 'xmbm'))
   if (tabList.value.length === 1) {
     cTabIndex.value = 0
+    initInfoData(tabList.value[cTabIndex.value])
   }
 }
 const getRowMapByList = (arrs: any[], key: string) => {
@@ -240,10 +241,16 @@ const getRowMapByList = (arrs: any[], key: string) => {
   })
   return nArr
 }
-const switchTabHandle = (item, index) => {
-  infoList[0]['num'] = item['num1']
-  infoList[1]['num'] = item['num2']
-  infoList[2]['num'] = item['num3']
+const computedRowMap = (arr, xmbm: string) => {
+  const obj = {}
+  obj['xmbm'] = xmbm
+  obj['num1'] = arr.length
+  obj['num2'] = arr.reduce((a, b) => a + b['periodCheckValue'], 0)
+  obj['num3'] = arr.reduce((a, b) => a + b['periodValue'], 0)
+  obj['data'] = arr
+  return obj
+}
+const switchTabHandle = (index) => {
   cTabIndex.value = index
   queryParams.value = {
     xmmc: '',
@@ -252,6 +259,11 @@ const switchTabHandle = (item, index) => {
   }
   searchHandle()
 }
+const initInfoData = (item) => {
+  infoList[0]['num'] = item['num1']
+  infoList[1]['num'] = item['num2']
+  infoList[2]['num'] = item['num3']
+}
 const searchHandle = async () => {
   const result: any = await request.get(
     {
@@ -260,15 +272,12 @@ const searchHandle = async () => {
     },
     '/business'
   )
-  if (result && result.length === 0) {
-    tabList.value[cTabIndex.value]['data'] = []
-    return
-  }
+  const xmbm = tabList.value[cTabIndex.value]['xmbm']
   const nArr = result.filter((item) => {
-    return String(item['xmbm']) == tabList.value[cTabIndex.value]['xmbm']
+    return String(item['xmbm']) == xmbm
   })
-  console.log(nArr)
-  tabList.value[cTabIndex.value]['data'] = nArr
+  tabList.value[cTabIndex.value] = computedRowMap(nArr, xmbm)
+  initInfoData(tabList.value[cTabIndex.value])
 }
 const currentYear = ref<string>('')
 const status = ref<number>()
@@ -293,7 +302,8 @@ const startProjectReportPeriodHandle = async () => {
     '/business'
   )
   if (result) {
-    message.success('开启成功!')
+    message.success('结束成功!')
+    getProjectPassByList()
   }
 }
 const archiveProjectReportPeriodHandle = async () => {
@@ -305,6 +315,7 @@ const archiveProjectReportPeriodHandle = async () => {
   )
   if (result) {
     message.success('开启成功!')
+    getProjectPassByList()
   }
 }
 onMounted(() => {

+ 47 - 31
client/src/views/OaSystem/marketCenter/projectReport/index.vue

@@ -28,7 +28,6 @@
             <template #default="scope">{{ scope.$index + 1 }}</template>
           </el-table-column>
           <el-table-column :show-overflow-tooltip="true" prop="xmmc" label="项目名称" width="280" />
-          <el-table-column label="项目经理" prop="xmjl" width="100" />
           <el-table-column label="项目状态" width="120" align="center">
             <template #default="scope">
               {{ getDictLabel(DICT_TYPE.PROJECT_STATUS, scope.row.xmzt) }}
@@ -41,11 +40,11 @@
             <template #default="scope">{{ scope.row.returnAmount }}</template>
           </el-table-column>
           <el-table-column label="本年初始进度" width="140" align="center">
-            <template #default="scope">{{ scope.row.finishProgress }}</template>
+            <template #default="scope">{{ scope.row.finishProgress * 100 }}%</template>
           </el-table-column>
           <el-table-column label="现进度" width="220" align="center">
             <template #default="scope">
-              <span v-if="!scope.row.isEditor">{{ scope.row.reportProgress }}%</span>
+              <span v-if="!scope.row.isEditor">{{ scope.row.reportProgress ?? 0 }}%</span>
               <el-input
                 v-else
                 v-model="scope.row.reportProgress"
@@ -85,7 +84,13 @@
           </el-table-column>
           <el-table-column label="操作" fixed="right" width="228">
             <template #default="scope">
-              <el-button type="primary" plain round @click="getProjectReportAuditList(scope.row)">
+              <el-button
+                v-if="scope.row.reportStatus && scope.row.reportStatus !== '00'"
+                type="primary"
+                plain
+                round
+                @click="getProjectReportAuditList(scope.row)"
+              >
                 查看
               </el-button>
               <el-button
@@ -194,21 +199,24 @@ const getProjectReportByList = async () => {
 }
 const { wsCache } = useCache()
 const user = wsCache.get(CACHE_KEY.USER)
-const saveProjectReport = async (data = {}) => {
-  const sendData = {}
-  Object.assign(sendData, data)
-  sendData['reportProgress'] = data['reportProgress'] / 100
+const saveProjectReport = (data) => {
+  data['id'] = data['reportId']
   data['xmbm'] = user.user.deptName ? user.user.deptName : '部门信息'
-  const result: any = await request.post(
-    {
-      url: '/projectReport/save',
-      data
-    },
-    '/business'
-  )
-  if (result) {
-    message.success('保存成功!')
-  }
+  request
+    .post(
+      {
+        url: '/projectReport/save',
+        data
+      },
+      '/business'
+    )
+    .then((result) => {
+      if (result) {
+        message.success('保存成功!')
+        getProjectReportByList()
+      }
+      data.isEditor = !data.isEditor
+    })
 }
 
 const commitProjectReport = async (row: { reportId: string }) => {
@@ -227,25 +235,33 @@ const commitProjectReport = async (row: { reportId: string }) => {
   }
 }
 const reportProgressHandle = (row) => {
-  console.log(Number(row.reportProgress))
-  if (row.passProgress && Number(row.reportProgress) < row.passProgress * 100) {
-    ElMessage.warning('现进度不能小于审核通过进度!')
-    return
-  } else if (Number(row.reportProgress) < row.finishProgress * 100) {
-    ElMessage.warning('现进度不能小于本年初始进度!')
-    return
-  }
   if (row.reportProgress) {
-    row.periodValue = ((row.reportProgress - row.finishProgress) / 100) * row.virtualAmount
-    row.surplusValue = ((100 - row.reportProgress) / 100) * row.virtualAmount
-    row.periodCheckValue = row.shareRatio * row.periodValue
+    row.periodValue = parseFloat(
+      (((row.reportProgress - row.finishProgress) / 100) * row.virtualAmount).toFixed(2)
+    )
+    row.surplusValue = parseFloat(
+      (((100 - row.reportProgress) / 100) * row.virtualAmount).toFixed(2)
+    )
+    row.periodCheckValue = parseFloat((row.shareRatio * row.periodValue).toFixed(2))
   }
 }
-const editorHandle = (row) => {
+const editorHandle = async (row) => {
   if (row.isEditor) {
+    if (row.passProgress && Number(row.reportProgress) < row.passProgress * 100) {
+      ElMessage.warning('现进度不能小于审核通过进度!')
+      return
+    } else if (Number(row.reportProgress) < row.finishProgress * 100) {
+      ElMessage.warning('现进度不能小于本年初始进度!')
+      return
+    }
+    if (row.xmzt === 1 && row.reportProgress >= 100) {
+      ElMessage.warning('项目状态为进行中现进度的值不能大于等于100%!')
+      return
+    }
     saveProjectReport(row)
+  } else {
+    row.isEditor = !row.isEditor
   }
-  row.isEditor = !row.isEditor
 }
 const auditorVisiabled = ref<boolean>(false)
 const activities = ref<any[]>([])

+ 1 - 0
client/src/views/OaSystem/mineCenter/components/CopperModal.vue

@@ -107,6 +107,7 @@
           </template>
         </div>
       </div>
+      <p style="color: red; margin-top: 15px">请上传本人近期清晰正面露脸照片</p>
       <template #footer>
         <el-button type="primary" @click="handleOk">{{ t('cropper.okText') }}</el-button>
       </template>

+ 1 - 1
zjugis-business/src/main/java/com/zjugis/business/mapper/ProjectReportAuditMapper.java

@@ -48,6 +48,6 @@ public interface ProjectReportAuditMapper extends BaseMapperX<ProjectReportAudit
     default List<ProjectReportAudit> getPassListByUserId(String loginUserId){
         return selectList(new LambdaQueryWrapperX<ProjectReportAudit>()
                 .eq(ProjectReportAudit::getAuditorId, loginUserId)
-                .eq(ProjectReportAudit::getAuditStatus, ProjectReportStatusEnum.PASS.getValue()));
+                .ne(ProjectReportAudit::getAuditStatus, ProjectReportStatusEnum.AUDIT.getValue()));
     }
 }

+ 4 - 2
zjugis-business/src/main/java/com/zjugis/business/mapper/ProjectReportMapper.java

@@ -86,10 +86,12 @@ public interface ProjectReportMapper extends BaseMapperX<ProjectReport> {
      * 通过ID列表寻找记录
      *
      * @param reportIds
+     * @param id
      * @return
      */
-    default List<ProjectReport> getListByIds(Set<String> reportIds) {
+    default List<ProjectReport> getListByIds(Set<String> reportIds, String periodId) {
         return selectList(new LambdaQueryWrapperX<ProjectReport>()
-                .in(ProjectReport::getId, reportIds));
+                .in(ProjectReport::getId, reportIds)
+                .eq(ProjectReport::getPeriodId, periodId));
     }
 }

+ 4 - 3
zjugis-business/src/main/java/com/zjugis/business/service/impl/ProjectReportServiceImpl.java

@@ -63,7 +63,7 @@ public class ProjectReportServiceImpl implements ProjectReportService {
         Set<String> projectIds = convertSet(projectList, Project::getId);
         ProjectReportPeriod currentReportPeriod = projectReportPeriodService.getCurrentReportPeriod();
         List<ProjectReportResp> resp = ProjectReportConvert.INSTANCE.convertList(projectList);
-        if (ObjectUtil.isNotNull(currentReportPeriod)) {
+        if (ObjectUtil.isNotNull(currentReportPeriod)&& CollectionUtil.isNotEmpty(projectIds)) {
             List<ProjectReport> reportList = projectReportMapper.getReportList(projectIds, currentReportPeriod.getId());
             Map<String, ProjectReport> projectReportMap = CollectionUtils.convertMap(reportList, ProjectReport::getProjectId);
             resp.forEach(projectReportResp -> {
@@ -96,7 +96,6 @@ public class ProjectReportServiceImpl implements ProjectReportService {
                 throw exception(REPORT_IS_SUBMITTED);
             }
         }
-        entity.setReportStatus(ProjectReportStatusEnum.UNCOMMIT.getValue());
         if (StringUtils.isNotEmpty(entity.getId())) {
             projectReportMapper.updateById(entity);
         } else {
@@ -104,6 +103,7 @@ public class ProjectReportServiceImpl implements ProjectReportService {
             if (ObjectUtil.isNotNull(projectReport)) {
                 throw exception(REPORT_IS_EXISTS);
             }
+            entity.setReportStatus(ProjectReportStatusEnum.UNCOMMIT.getValue());
             entity.setReportDate(LocalDateTime.now());
             projectReportMapper.insert(entity);
         }
@@ -225,12 +225,13 @@ public class ProjectReportServiceImpl implements ProjectReportService {
 
     @Override
     public List<ProjectReportResp> getCheckedList() {
+        ProjectReportPeriod currentReportPeriod = projectReportPeriodService.getCurrentReportPeriod();
         List<ProjectReportAudit> passAuditList = projectReportAuditService.getPassListByUserId(SecurityFrameworkUtils.getLoginUserId());
         Set<String> reportIds = convertSet(passAuditList, ProjectReportAudit::getReportId);
         if(CollectionUtil.isEmpty(reportIds)){
             return null;
         }
-        List<ProjectReport> checkedList = projectReportMapper.getListByIds(reportIds);
+        List<ProjectReport> checkedList = projectReportMapper.getListByIds(reportIds,currentReportPeriod.getId());
         return ProjectReportConvert.INSTANCE.convertList01(checkedList);
     }
 

+ 6 - 0
zjugis-business/src/main/resources/templates/AttendanceNote/js/index.js

@@ -17,6 +17,11 @@
             var dataObj = {}
             trFragment.appendChild(generateTableTrHtml(listsLength))
             $(".tbody").append(trFragment)
+            let timeObj = {
+                index: listsLength,
+                startTime: "",
+                endTime: '',
+            }
             timeSelector({
                 ele: ".startTimeRange" + listsLength,
                 name: "AttendanceNoteTimeDO[" + listsLength + "]$startTimeRange",
@@ -27,6 +32,7 @@
                         z.ui.alertWarning("请先选择起始日期!")
                         return;
                     }
+                    timeObj.startTime = Date.parse(startDate + " " + val);
                 }
             })
             timeSelector({

+ 6 - 1
zjugis-business/src/main/resources/templates/Travel/js/index.js

@@ -17,6 +17,11 @@
             if (arrays.length > 0) {
                 listsLength = arrays.length + lists.length
             }
+            let timeObj = {
+                index: listsLength,
+                startTime: "",
+                endTime: '',
+            }
             timeSelector({
                 ele: ".startTimeRange" + listsLength,
                 name: "TravelTimeDO[" + listsLength + "]$startTimeRange",
@@ -27,6 +32,7 @@
                         z.ui.alertWarning("请先选择起始日期!")
                         return;
                     }
+                    timeObj.startTime = Date.parse(startDate + " " + val);
                 }
             })
             timeSelector({
@@ -87,7 +93,6 @@
             buildQjsjSeq();
             lists.push(dataObj)
         })
-        initPartners();
         $("#selectProject").click(function () {
             selectProject(null, setProject);
         })