Преглед на файлове

Merge remote-tracking branch 'origin/master'

jzh преди 1 година
родител
ревизия
c8cd02b66a

+ 1 - 1
client/.env.base

@@ -4,7 +4,7 @@ NODE_ENV=development
 VITE_DEV=true
 
 # 请求路径
-VITE_BASE_URL='http://localhost:48080'
+VITE_BASE_URL='http://10.10.10.7:18080'
 # VITE_BASE_URL='http://10.10.9.168:48080'
 # 上传路径
 VITE_UPLOAD_URL='/infra/file/upload'

+ 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%;
+    }
   }
 
   // 详情样式们

+ 19 - 0
zjugis-business/src/main/java/com/zjugis/business/service/impl/ContractServiceImpl.java

@@ -12,8 +12,12 @@ import com.zjugis.business.bean.request.InfoRequest;
 import com.zjugis.business.bean.response.*;
 import com.zjugis.business.constants.ContractConstants;
 import com.zjugis.business.constants.FlowStatusConstants;
+import com.zjugis.business.flow.commoncost.service.CommonCostService;
+import com.zjugis.business.flow.travelcost.service.TravelCostService;
 import com.zjugis.business.flow.usemoney.controller.vo.UseMoneyBondVO;
+import com.zjugis.business.flow.usemoney.controller.vo.UseMoneyDeptRespVO;
 import com.zjugis.business.flow.usemoney.service.UseMoneyDetailService;
+import com.zjugis.business.flow.usemoney.service.UseMoneyService;
 import com.zjugis.business.mapper.ContractMapper;
 import com.zjugis.business.mapper.ProjectMapper;
 import com.zjugis.business.service.*;
@@ -69,6 +73,15 @@ public class ContractServiceImpl implements ContractService{
     @Autowired
     private ProjectService projectService;
 
+    @Autowired
+    private UseMoneyService useMoneyService;
+
+    @Autowired
+    TravelCostService travelCostService;
+
+    @Autowired
+    CommonCostService commonCostService;
+
     @Autowired
     private ProjectAmountService projectAmountService;
 
@@ -208,6 +221,12 @@ public class ContractServiceImpl implements ContractService{
         resp.setPaymentCost(cost.getPaymentCost());
         resp.setReimbursementCost(cost.getReimbursementCost());
         resp.setTravelCost(cost.getTravelCost());
+        UseMoneyDeptRespVO paymentCost = useMoneyService.getDataByDeptId(new ArrayList<>(deptPermissions.getDeptIds()));
+        BigDecimal commonCost = commonCostService.getPaymentCost(infoRequest.getYear(), deptPermissions.getDeptIds());
+        BigDecimal travelCost = travelCostService.getTravelCost(infoRequest.getYear(), deptPermissions.getDeptIds());
+        resp.setPaymentCost(paymentCost.getAmount());
+        resp.setTravelCost(travelCost);
+        resp.setReimbursementCost(commonCost);
         return resp;
     }
 

+ 24 - 3
zjugis-business/src/main/resources/templates/FlowContractInvoice/js/apply.js

@@ -42,7 +42,7 @@
             data: {},
             success: function (res) {
                 if (res && res.length > 0) {
-                    selecttree("[name='lpr']", res, clickLpr, allowChildClick)
+                    selecttree("[name='lpr']", res, clickLpr, allowChildClick,null,setLpr);
                 }
             },
             error: function () {
@@ -50,6 +50,13 @@
         })
     }
 
+    function setLpr(){
+        var id = $("[name='contractInvoice$lprId']").val();
+        if(id){
+            z.ui.selecttree("[name='lpr']").setValue(id);
+        }
+    }
+
     function clickLpr(even, treeId, treeNode) {
         if (treeNode.type === 3) {
             $("[name='contractInvoice$lpr']").val(treeNode.name);
@@ -565,7 +572,7 @@
             data: {},
             success: function (res) {
                 if(res && res.code === 0 && res.data.length > 0){
-                    selecttree("[name='invoiceCompany']",res.data,clickInvoiceCompany)
+                    selecttree("[name='invoiceCompany']",res.data,clickInvoiceCompany,null,null,setInvoiceCompany)
                 }
             },
             error: function () {
@@ -573,6 +580,13 @@
         })
     }
 
+    function setInvoiceCompany(){
+        var id = $("[name='contractInvoice$invoiceCompanyId']").val();
+        if(id){
+            z.ui.selecttree("[name='invoiceCompany']").setValue(id);
+        }
+    }
+
     function clickInvoiceCompany(even, treeId, treeNode) {
         $("[name='contractInvoice$invoiceCompany']").val(treeNode.name);
         $("[name='contractInvoice$invoiceCompanyId']").val(treeNode.id);
@@ -585,7 +599,7 @@
             data: {},
             success: function (res) {
                 if(res && res.code === 0 && res.data.length > 0){
-                    selecttree("[name='payCompany']",res.data,clickPayCompany)
+                    selecttree("[name='payCompany']",res.data,clickPayCompany,null,null,setPayCompany);
                 }
             },
             error: function () {
@@ -593,6 +607,13 @@
         })
     }
 
+    function setPayCompany(){
+        var id = $("[name='contractInvoice$payCompanyId']").val();
+        if(id){
+            z.ui.selecttree("[name='payCompany']").setValue(id);
+        }
+    }
+
     function clickPayCompany(even, treeId, treeNode) {
         $("[name='contractInvoice$payCompany']").val(treeNode.name);
         $("[name='contractInvoice$payCompanyId']").val(treeNode.id);

+ 0 - 47
zjugis-business/src/main/resources/templates/FlowContractSub/js/outsourcingApply.js

@@ -15,7 +15,6 @@
     function initData(){
         initClient();
         initAssignee()
-        initAreaManager();
     }
 
     function bindGenerateSerial(){
@@ -119,52 +118,6 @@
 
 
 
-    function initAreaManager(){
-        z.ui.ajax({
-            type: "get",
-            url: "/common/user-tree",
-            data: {},
-            success: function (res) {
-                if(res && res.length > 0){
-                    // selecttree("[name='areaManager']",res,onClear,clickAreaManager,setAreaManager,allowUserClick,{ "Y": "s", "N": "s" })
-                    selecttree("[name='areaManager']",res,clickAreaManager,allowUserClick,onClear,setAreaManager)
-                }
-            },
-            error: function () {
-            }
-        })
-    }
-
-    function onClear(){
-        $("[name='contractSub$areaManagerId']").val('');
-        $("[name='contractSub$areaManager']").val('');
-    }
-
-    function setAreaManager(){
-        var ids = $("[name='contractSub$areaManagerId']").val();
-        if(ids){
-            z.ui.selecttree("[name='areaManager']").setValue(ids.split(","));
-        }
-    }
-
-    // function clickAreaManager(even, treeId, treeNode) {
-    //         var ids = [];
-    //         var names = [];
-    //         var nodes =  z.ui.selecttree("[name='areaManager']").tree.getCheckedNodes();
-    //         for(var i in nodes){
-    //             ids.push(nodes[i].id);
-    //             names.push(nodes[i].name);
-    //         }
-    //         if(ids.length > 0){
-    //             $("[name='contractSub$areaManagerId']").val(ids.join(","));
-    //             $("[name='contractSub$areaManager']").val(names.join(","));
-    //         }
-    // }
-
-    function clickAreaManager(even, treeId, treeNode) {
-        $("[name='contractSub$areaManagerId']").val(treeNode.id);
-        $("[name='contractSub$areaManager']").val(treeNode.name);
-    }
 
     function clickClient(even, treeId, treeNode) {
         $("[name='contractSub$customerName']").val(treeNode.name);

+ 1 - 51
zjugis-business/src/main/resources/templates/FlowContractSub/js/subcontractApply.js

@@ -14,8 +14,7 @@
 
     function initData(){
         initClient();
-        initAssignee()
-        initAreaManager();
+        initAssignee();
     }
 
     function bindGenerateSerial(){
@@ -117,55 +116,6 @@
         })
     }
 
-
-
-    function initAreaManager(){
-        z.ui.ajax({
-            type: "get",
-            url: "/common/user-tree",
-            data: {},
-            success: function (res) {
-                if(res && res.length > 0){
-                    // selecttree("[name='areaManager']",res,onClear,clickAreaManager,setAreaManager,allowUserClick,{ "Y": "s", "N": "s" })
-                    selecttree("[name='areaManager']",res,clickAreaManager,allowUserClick,onClear,setAreaManager)
-                }
-            },
-            error: function () {
-            }
-        })
-    }
-
-    function onClear(){
-        $("[name='contractSub$areaManagerId']").val('');
-        $("[name='contractSub$areaManager']").val('');
-    }
-
-    function setAreaManager(){
-        var ids = $("[name='contractSub$areaManagerId']").val();
-        if(ids){
-            z.ui.selecttree("[name='areaManager']").setValue(ids.split(","));
-        }
-    }
-
-    // function clickAreaManager(even, treeId, treeNode) {
-    //         var ids = [];
-    //         var names = [];
-    //         var nodes =  z.ui.selecttree("[name='areaManager']").tree.getCheckedNodes();
-    //         for(var i in nodes){
-    //             ids.push(nodes[i].id);
-    //             names.push(nodes[i].name);
-    //         }
-    //         if(ids.length > 0){
-    //             $("[name='contractSub$areaManagerId']").val(ids.join(","));
-    //             $("[name='contractSub$areaManager']").val(names.join(","));
-    //         }
-    // }
-
-    function clickAreaManager(even, treeId, treeNode) {
-        $("[name='contractSub$areaManagerId']").val(treeNode.id);
-        $("[name='contractSub$areaManager']").val(treeNode.name);
-    }
-
     function clickClient(even, treeId, treeNode) {
         $("[name='contractSub$customerName']").val(treeNode.name);
         $("[name='contractSub$customerId']").val(treeNode.id);

+ 49 - 6
zjugis-business/src/main/resources/templates/FlowProject/js/apply.js

@@ -186,7 +186,7 @@
       data: {},
       success: function (res) {
         if (res && res.code === 0 && res.data.length > 0) {
-          selecttree("[name='area']", res.data, clickArea)
+          selecttree("[name='area']", res.data, clickArea,null,null,setArea)
         }
       },
       error: function () {
@@ -194,6 +194,13 @@
     })
   }
 
+  function setArea(){
+    var id = $("[name='project$xzqdm']").val();
+    if(id){
+      z.ui.selecttree("[name='area']").setValue(id);
+    }
+  }
+
   function initXmjlAndXsry() {
     z.ui.ajax({
       type: "get",
@@ -201,8 +208,8 @@
       data: {},
       success: function (res) {
         if (res && res.length > 0) {
-          selecttree("[name='xmjl']", res, clickXmjl, allowChildClick)
-          selecttree("[name='xsry']", res, clickXsry, allowChildClick);
+          selecttree("[name='xmjl']", res, clickXmjl, allowChildClick,null,null,setXmjl)
+          selecttree("[name='xsry']", res, clickXsry, allowChildClick,null,null,setXsry);
         }
       },
       error: function () {
@@ -210,6 +217,20 @@
     })
   }
 
+  function setXmjl(){
+    var id = $("[name='project$xmjlId']").val();
+    if(id){
+      z.ui.selecttree("[name='xmjl']").setValue(id);
+    }
+  }
+
+  function setXsry(){
+    var id = $("[name='project$xsryId']").val();
+    if(id){
+      z.ui.selecttree("[name='xsry']").setValue(id);
+    }
+  }
+
   function initBelongCompany() {
     z.ui.ajax({
       type: "get",
@@ -217,7 +238,7 @@
       data: {},
       success: function (res) {
         if (res && res.data.length > 0) {
-          selecttree("[name='belongCompany']", res.data, clickBelongCompany)
+          selecttree("[name='belongCompany']", res.data, clickBelongCompany,null,null,setBelongCompany)
         }
       },
       error: function () {
@@ -225,6 +246,13 @@
     })
   }
 
+  function setBelongCompany(){
+    var id = $("[name='project$belongCompanyid']").val();
+    if(id){
+      z.ui.selecttree("[name='belongCompany']").setValue(id);
+    }
+  }
+
   function addProjectMilestone(){
     var trFragment = document.createDocumentFragment();
     let tbody = document.querySelectorAll('.tbody tr')
@@ -457,7 +485,7 @@
       data: {},
       success: function (res) {
         if (res && res.length > 0) {
-          selecttree("[name='zrbm']", res, clickZrbm)
+          selecttree("[name='zrbm']", res, clickZrbm,null,null,setZrbm)
         }
       },
       error: function () {
@@ -465,6 +493,14 @@
     })
   }
 
+  function setZrbm(){
+    var id = $("[name='project$zrbmId']").val();
+    if(id){
+      z.ui.selecttree("[name='zrbm']").setValue(id);
+    }
+  }
+
+
   function detailReadonly(i, isBool = true,prefix) {
     if (isBool) {
       $("#delBtn_" + i).css("display", "none");
@@ -496,7 +532,7 @@
       data: {},
       success: function (res) {
         if (res && res.code === 0 && res.data.length > 0) {
-          selecttree("[name='projectType']", res.data, clickProjectType)
+          selecttree("[name='projectType']", res.data, clickProjectType,null,null,setProjectType);
         }
       },
       error: function () {
@@ -504,6 +540,13 @@
     })
   }
 
+  function setProjectType(){
+    var id = $("[name='project$projectTypeId']").val();
+    if(id){
+      z.ui.selecttree("[name='projectType']").setValue(id);
+    }
+  }
+
   function clickXmjl(even, treeId, treeNode) {
     if (treeNode.type === 3) {
       $("[name='project$xmjl']").val(treeNode.name);

+ 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);