Jelajahi Sumber

Merge remote-tracking branch 'origin/master'

ljy121 1 tahun lalu
induk
melakukan
7191f2f3c9

+ 10 - 6
client/src/views/OaSystem/personnelManagement/ProjectStatistics/projectTable.vue

@@ -44,6 +44,7 @@ const loading = ref(false)
 const dataSource = ref([])
 const pageNo = ref(1)
 const pageTotal = ref(0)
+const searchValue = ref<any>({})
 
 const tableRef: any = ref(null)
 const tableHeight: any = ref(0)
@@ -51,6 +52,7 @@ onMounted(() => {
   tableHeight.value = tableRef.value.clientHeight
   // 接收查询事件
   PubsubService.subscribe('xmgstj-form-onSearch', (params) => {
+    pageNo.value = 1
     getDataSource(params)
   })
   getDataSource()
@@ -62,16 +64,19 @@ const jumpToDetail = (row: any) => {
 }
 // 获取数据
 const getDataSource = (params?) => {
+  if (params) {
+    searchValue.value = params
+  }
   loading.value = true
   request
     .get({
       url: '/adm/reportWorkloadStatistics/query-workload-statistics',
       params: {
-        year: params?.year ?? moment().format('YYYY'),
-        month: params?.month ?? moment().format('M'),
-        userId: params?.userId ?? '',
-        deptId: params?.deptId ?? '', // 暂不做多选
-        projectName: params?.projectName ?? '',
+        year: params?.year ?? moment(searchValue.value.year).format('YYYY'),
+        month: params?.month ?? moment(searchValue.value.month).format('M'),
+        userId: params?.userId ?? searchValue.value.userId ?? '',
+        deptId: params?.deptId ?? searchValue.value.deptId ?? '', // 暂不做多选
+        projectName: params?.projectName ?? searchValue.value.projectName ?? '',
         pageNo: pageNo.value,
         pageSize: 20
       }
@@ -82,7 +87,6 @@ const getDataSource = (params?) => {
       const { list, total } = res
       dataSource.value = list
       pageTotal.value = total
-      pageNo.value = 1
     })
     .catch(() => {
       ElMessage.error('查询失败,请稍后重试!')

+ 2 - 1
client/src/views/OaSystem/personnelManagement/components/AmountOfWork.vue

@@ -166,7 +166,8 @@ const getAllProject = async () => {
       url: `/project/page`,
       params: {
         pageSize: -1,
-        userId: userInfo.id ?? ''
+        userId: userInfo.id ?? '',
+        xmzList: [1, 4] // 仅可对进行中和已验收的项目进行填报
       }
     },
     '/business'

+ 34 - 6
client_h5/src/pages/myLogs/Daily/MyLogs.vue

@@ -54,8 +54,13 @@ const formatter = (day: any) => {
     // 如果未到,不做处理
     day.topInfo = "";
   } else if (logObj.value[date]) {
-    day.topInfo = "已填";
-    day.className = "filled-in";
+    if (logObj.value[date].isTemp) {
+      day.topInfo = "暂存";
+      day.className = "not-fill";
+    } else {
+      day.topInfo = "已填";
+      day.className = "filled-in";
+    }
   } else if (!dayOfWorkObj.value[date]?.isWorkday && !logObj.value[date]) {
     // 如果是休息日且未填
     day.topInfo = "";
@@ -72,11 +77,34 @@ const formatter = (day: any) => {
 const { push } = useRouter();
 const jumpDetail = (day: any) => {
   const date = moment(day).format("YYYY-MM-DD");
-  if (logObj.value[date]) {
-    const detail = logObj.value[date];
-    push(`/logsDetail?id=${detail.id}`);
+  const detail = logObj.value[date];
+
+  if (detail) {
+    if (detail.isTemp) {
+      push({
+        path: "/daily",
+        query: {
+          id: detail.id,
+          detail: JSON.stringify({
+            ...detail,
+            comments: [],
+          }),
+        },
+      });
+    } else {
+      push({
+        path: "/logsDetail",
+        query: {
+          id: detail.id,
+          detail: JSON.stringify({
+            ...detail,
+            comments: [],
+          }),
+        },
+      });
+    }
   } else {
-    push(`/daily?date=${day}`);
+    push(`/daily?date=${date}`);
   }
 };
 </script>

+ 55 - 8
client_h5/src/pages/myLogs/Daily/index.vue

@@ -24,9 +24,14 @@
     <div class="title">接收人</div>
     <SelectUser v-model="formData.receiveUserIds" />
     <div class="blank-line"></div>
-    <van-button round type="primary" block class="send-btn" @click="onSubmit"
-      >发送</van-button
-    >
+    <div class="send-btn-group">
+      <van-button type="success" block class="send-btn" @click="onSubmit(true)"
+        >暂存</van-button
+      >
+      <van-button type="primary" block class="send-btn" @click="onSubmit(false)"
+        >发送</van-button
+      >
+    </div>
   </div>
 </template>
 <script lang="ts" setup>
@@ -71,12 +76,21 @@ const route = useRoute();
 onMounted(async () => {
   // 查看有没有传日期进来
   const query: any = route.query;
+
+  // 查一下有没有传id进来,有的话就是数据回填
+  if (query.id && query.detail) {
+    const dailyDetail = JSON.parse(route.query.detail as string);
+    receiveData(dailyDetail);
+    return;
+  }
+
   if (query.date) {
     today.value = moment(query.date).format("YYYY-MM-DD");
   }
 
   // 检查一下今天是否已经填了
-  await isFillLog();
+  const fillLog = await isFillLog();
+  if (fillLog) return;
 
   // 回填历史接收人
   const receiveUser = await http.getReceiveUser();
@@ -85,6 +99,24 @@ onMounted(async () => {
   await getIsWorkDays();
 });
 
+// 回填暂存数据
+const receiveData = (dailyDetail: any) => {
+  formData.reportContent = dailyDetail.reportContent;
+  formData.reportYear = dailyDetail.reportYear;
+  formData.reportMonth = dailyDetail.reportMonth;
+  formData.reportWeek = dailyDetail.reportWeek;
+  today.value = moment(dailyDetail.reportStartDate).format("YYYY-MM-DD");
+  // 加个定时器回填接收人和工时
+  const timer = setTimeout(() => {
+    formData.receiveUserIds = dailyDetail.receiveIds;
+    formData.weeklyWorkloadList = dailyDetail.workload.map((work: any) => ({
+      projectId: work.projectId,
+      workTime: work.workTime,
+    }));
+    clearTimeout(timer);
+  }, 1000);
+};
+
 // 判断一下今天是否已经填了,如果是填了的就跳转到详情页
 const isFillLog = async () => {
   const searchList = await http.getMonthLogList(
@@ -98,8 +130,23 @@ const isFillLog = async () => {
       moment(today.value).format("YYYY-MM-DD")
   );
   if (searchLog) {
-    push(`/logsDetail?id=${searchLog.id}`);
+    if (searchLog.isTemp) {
+      receiveData(searchLog);
+      return true;
+    } else {
+      replace({
+        path: "/logsDetail",
+        query: {
+          id: searchLog.id,
+          detail: JSON.stringify({
+            ...searchLog,
+            comments: [], // 就不传那么多东西过去了,反正详情页面也会查询评论
+          }),
+        },
+      });
+    }
   }
+  return false;
 };
 
 // 日历
@@ -122,8 +169,8 @@ const projectChange = (data: any) => {
 };
 
 // 提交
-const { push } = useRouter();
-const onSubmit = async () => {
+const { push, replace } = useRouter();
+const onSubmit = async (isTemp: boolean) => {
   const userInfo = getUserInfo();
   const params: IReport = {
     ...formData,
@@ -132,7 +179,7 @@ const onSubmit = async () => {
     deptId: userInfo.deptId ?? "",
     reportStartDate: moment(today.value).valueOf(),
     reportEndDate: moment(today.value).valueOf(),
-    isTemp: false,
+    isTemp,
   };
   const submitCheck = onSubmitCheck(params);
   if (!submitCheck.success) {

+ 34 - 5
client_h5/src/pages/myLogs/Weekly/MyLogs.vue

@@ -126,10 +126,16 @@ const initPageList = () => {
       if (item.isLog.length > 0) {
         const isLog = item.isLog[0];
         item.id = isLog.id;
-        item.icon = statusObj[0].icon;
-        item.color = statusObj[0].color;
-        item.bgColor = statusObj[0].bgColor;
-        item.type = statusObj[0].type;
+        const isTemp = isLog.isTemp;
+        // 如果不是暂存
+        if (!isTemp) {
+          item.icon = statusObj[0].icon;
+          item.color = statusObj[0].color;
+          item.bgColor = statusObj[0].bgColor;
+          item.type = statusObj[0].type;
+        } else {
+          item.type = "暂存";
+        }
       }
       // 如果未到
       if (moment(item.startDate).isAfter(moment())) {
@@ -149,12 +155,35 @@ const statusObj = [
   { type: "未填", icon: "cross", color: "#F85638", bgColor: "#F8EAEA" },
   { type: "待填", icon: "edit", color: "#1B80EB", bgColor: "#DDEDFD" },
   { type: "未到", icon: "ellipsis", color: "#BDC7CE", bgColor: "#F2F6FA" },
+  { type: "暂存", icon: "cross", color: "#F85638", bgColor: "#F8EAEA" },
 ];
 // 跳转到周报填写或详情页面
 const { push } = useRouter();
 const goToWeeklyPage = (item: any) => {
   if (item.id) {
-    push(`/logsDetail?id=${item.id}`);
+    if (item.type == "暂存") {
+      push({
+        path: "/weekly",
+        query: {
+          id: item.id,
+          detail: JSON.stringify({
+            ...item.isLog[0],
+            comments: [],
+          }),
+        },
+      });
+    } else {
+      push({
+        path: "/logsDetail",
+        query: {
+          id: item.id,
+          detail: JSON.stringify({
+            ...item.isLog[0],
+            comments: [],
+          }),
+        },
+      });
+    }
   } else if (item.type == "未到") {
     showToast({
       message: "还未到这周!",

+ 53 - 56
client_h5/src/pages/myLogs/Weekly/index.vue

@@ -30,9 +30,14 @@
     <div class="title">接收人</div>
     <SelectUser v-model="formData.receiveUserIds" />
     <div class="blank-line"></div>
-    <van-button round type="primary" block class="send-btn" @click="onSubmit"
-      >发送</van-button
-    >
+    <div class="send-btn-group">
+      <van-button type="success" block class="send-btn" @click="onSubmit(true)"
+        >暂存</van-button
+      >
+      <van-button type="primary" block class="send-btn" @click="onSubmit(false)"
+        >发送</van-button
+      >
+    </div>
   </div>
 </template>
 <script lang="ts" setup>
@@ -92,8 +97,14 @@ const formData = reactive<FormData>({
 
 const route = useRoute();
 onMounted(async () => {
-  // 查看有没有传日期进来
   const query: any = route.query;
+  // 查一下有没有传id进来,有的话就是数据回填
+  if (query.id && query.detail) {
+    const weekDetail = JSON.parse(route.query.detail as string);
+    receiveData(weekDetail);
+    return;
+  }
+  // 查看有没有传日期进来
   if (query.startDate && query.endDate) {
     thisWeek.value = `${moment(query.startDate).format(
       "YYYY/MM/DD"
@@ -115,48 +126,28 @@ onMounted(async () => {
   formData.receiveUserIds = receiveUser;
 });
 
-// 判断一下本周是否已经填了,如果是填了的就跳转到详情页
-// const isFillLog = async () => {
-//   const date = thisWeek.value.split(" ~ ");
-//   let searchList = await http.getMonthLogList(
-//     "weekly",
-//     moment(date[1]).format("YYYY"),
-//     moment(date[1]).format("M")
-//   );
-//   // 以防万一
-//   if (searchList.length == 0) {
-//     searchList = await http.getMonthLogList(
-//       "weekly",
-//       moment(date[0]).format("YYYY"),
-//       moment(date[0]).format("M")
-//     );
-//   }
-//   const searchLog = searchList.find(
-//     (item: any) =>
-//       moment(item.reportEndDate).format("YYYY-MM-DD") ==
-//       moment(date[1]).format("YYYY-MM-DD")
-//   );
-
-//   if (searchLog) {
-//     push(`/logsDetail?id=${searchLog.id}`);
-//   }
-// };
+// 回填暂存数据
+const receiveData = (weekDetail: any) => {
+  formData.reportContent = weekDetail.reportContent;
+  formData.reportYear = weekDetail.reportYear;
+  formData.reportMonth = weekDetail.reportMonth;
+  formData.reportWeek = weekDetail.reportWeek;
+  thisWeek.value = `${moment(weekDetail.reportStartDate).format(
+    "YYYY/MM/DD"
+  )} ~ ${moment(weekDetail.reportEndDate).format("YYYY/MM/DD")}`;
+  // 加个定时器回填接收人和工时
+  const timer = setTimeout(() => {
+    formData.receiveUserIds = weekDetail.receiveIds;
+    formData.weeklyWorkloadList = weekDetail.workload.map((work: any) => ({
+      projectId: work.projectId,
+      workTime: work.workTime,
+    }));
+    clearTimeout(timer);
+  }, 1000);
+};
 
 // 日历
 const calendarShow = ref(false);
-// const onConfirm = async (values: any) => {
-//   const [start, end] = values;
-//   thisWeek.value = `${moment(start).format("YYYY/MM/DD")} ~ ${moment(
-//     end
-//   ).format("YYYY/MM/DD")}`;
-//   calendarShow.value = false;
-//   // 获取当日详情
-//   await getIsWorkDays();
-// };
-
-// 可选择的最小日期,一个月之前,最大日期:今天
-// const minDate = moment().subtract(2, "months").toDate();
-// const maxDate = moment().toDate();
 
 // 工作量改变
 const projectChange = (data: any) => {
@@ -166,7 +157,7 @@ const projectChange = (data: any) => {
 
 // 提交
 const { push, replace } = useRouter();
-const onSubmit = async () => {
+const onSubmit = async (isTemp: boolean) => {
   const date = thisWeek.value.split(" ~ ");
   const userInfo = getUserInfo();
   const params: IReport = {
@@ -176,7 +167,7 @@ const onSubmit = async () => {
     deptId: userInfo.deptId ?? "",
     reportStartDate: moment(date[0]).valueOf(),
     reportEndDate: moment(date[1]).valueOf(),
-    isTemp: false,
+    isTemp,
   };
   const submitCheck = onSubmitCheck(params);
   if (!submitCheck.success) {
@@ -252,17 +243,23 @@ const thisWeekLog = async () => {
       log.reportMonth == formData.reportMonth
   );
   if (thisWeekLogs.length > 0) {
-    // push(`/logsDetail?id=${thisWeekLogs[0].id}`);
-    replace({
-      path: "/logsDetail",
-      query: {
-        id: thisWeekLogs[0].id,
-        detail: JSON.stringify({
-          ...thisWeekLogs[0],
-          comments: [], // 就不传那么多东西过去了,反正详情页面也会查询评论
-        }),
-      },
-    });
+    // 如何获取到的是暂存数据
+    if (thisWeekLogs[0].isTemp) {
+      receiveData(thisWeekLogs[0]);
+      return;
+    } else {
+      // 否则跳到详情页
+      replace({
+        path: "/logsDetail",
+        query: {
+          id: thisWeekLogs[0].id,
+          detail: JSON.stringify({
+            ...thisWeekLogs[0],
+            comments: [], // 就不传那么多东西过去了,反正详情页面也会查询评论
+          }),
+        },
+      });
+    }
   }
 };
 </script>

+ 1 - 0
client_h5/src/pages/myLogs/http.ts

@@ -31,6 +31,7 @@ export const http = {
     const params = {
       pageSize: -1,
       userId: userInfo.id ?? "",
+      xmzList: [1, 4], // 仅可对进行中和已验收的项目进行填报
     };
     const result: any = await request.get(api.project, { params });
     return result.msg == "success" ? result.data.records : [];

+ 8 - 3
client_h5/src/pages/myLogs/page.scss

@@ -4,8 +4,8 @@
   padding: 10px 10px;
   overflow-y: scroll;
   box-sizing: border-box;
-  >.container-content {
-    height: calc( 100% - 90px);
+  > .container-content {
+    height: calc(100% - 90px);
     overflow-y: auto;
   }
   .timer {
@@ -33,12 +33,17 @@
     }
   }
 
-  .send-btn {
+  .send-btn-group {
     position: absolute;
     bottom: 20px;
     left: 50%;
     transform: translateX(-50%);
     width: 90%;
+    display: flex;
+    justify-content: space-between;
+    .send-btn {
+      width: 48%;
+    }
   }
 
   // 详情样式们

+ 1 - 1
zjugis-business/src/main/resources/templates/Staff/index.ftl

@@ -441,7 +441,7 @@ styles=[ '/flow/css/formCommon.css','/OwCommon/OwCommon.css' ]>
                                 </div>
                                 <div class="z-comp-checkbox" name="createReqVO$v5">
                                     <div class="z-checkbox-item <#if (formEntity.zjjy!)? contains(",5,")>checked</#if>"
-                                         value="5"><i></i>个人简历
+                                         value="5"><i></i>离职证明
                                     </div>
                                 </div>
                                 <div class="z-comp-checkbox" name="createReqVO$v6">

+ 1 - 0
zjugis-workflow/src/main/java/com/zjugis/z_workflow/controller/IFlowOpinionController.java

@@ -211,6 +211,7 @@ public class IFlowOpinionController extends BaseController {
             // 设置状态
             MapUtils.findAndThen(stringIActivityInstanceMap, iFlowOpinion.getActivityInstanceId(), iActivityInstance -> {
                 iFlowOpinion.setStatus(iActivityInstance.getStatus());
+                iFlowOpinion.setUserId(iActivityInstance.getUserId());
             });
         });
         return CommonResult.success(flowOpinions);