Browse Source

公章外借申请

jzh 1 year ago
parent
commit
491342e9c4

+ 33 - 0
client_h5/src/pages/officialSealOuter/index.scss

@@ -0,0 +1,33 @@
+.van-cell-group {
+  margin: 0px;
+}
+.van-overlay {
+  background: rgba(0,0,0,0.3);
+}
+.add_btn {
+  background-color: #1989fa;
+  padding: 5px 10px;
+  border: 0px;
+  outline: none;
+  font-size: 13px;
+  color: #fff;
+  border-radius: 2px;
+}
+.detail-popup {
+  >.title {
+    font-size: 15px;
+    padding-left: 10px;
+  }
+  >.fixed-btn {
+    padding: 15px;
+  }
+}
+  :deep(.van-swipe-cell__right) {
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    justify-content: center;
+    >button {
+      height: 50%;
+    }
+  }

+ 188 - 0
client_h5/src/pages/officialSealOuter/index.vue

@@ -0,0 +1,188 @@
+<template>
+  <flow-form :data="formData" @submit="submitNextActivity">
+    <card title="基础信息" style="height: auto">
+      <van-form required="true" ref="form">
+        <van-cell-group inset>
+          <van-field
+              v-model="formData.userNickname"
+              name="申请人"
+              label="申请人"
+              placeholder="申请人"
+              readonly
+              :rules="[{ required: true, message: '未获取申请人' }]"
+          />
+          <van-field
+              v-model="formData.deptName"
+              name="所在部门"
+              label="所在部门"
+              placeholder="所在部门"
+              readonly
+              :rules="[{ required: true, message: '请填写所在部门' }]"
+          />
+          <van-field
+              v-model="formData.createTimeC"
+              name="申请时间"
+              label="申请时间"
+              placeholder="申请时间"
+              readonly
+              :rules="[{ required: true, message: '未获取申请时间' }]"
+          />
+          <van-field
+              v-model="formData.officialSealOuterApplyNo"
+              name="申请单号"
+              label="申请单号"
+              placeholder="申请单号"
+              readonly
+              :rules="[{ required: true, message: '未获取申请单号' }]"
+          />
+
+          <van-field
+              v-model="formData.officialSealApplyReason"
+              name="申请事由"
+              label="申请事由"
+              placeholder="申请事由"
+              readonly
+              :rules="[{ required: true, message: '未获取申请事由' }]"
+          />
+          <van-field
+              v-model="formData.officialSealUseTypeText"
+              name="用章类型"
+              label="用章类型"
+              placeholder="用章类型"
+              readonly
+              :rules="[{ required: true, message: '未获取用章类型' }]"
+          />
+          <van-field
+              v-model="formData.officialSealNameText"
+              name="公章名称"
+              label="公章名称"
+              placeholder="公章名称"
+              readonly
+              :rules="[{ required: true, message: '未获取公章名称' }]"
+          />
+          <van-field
+              v-model="formData.planOuterDate"
+              name="外带时间"
+              label="外带时间"
+              placeholder="外带时间"
+              readonly
+              :rules="[{ required: true, message: '未获取外带时间' }]"
+          />
+          <van-field
+              v-model="formData.planReturnDate"
+              name="预计归还时间"
+              label="预计归还时间"
+              placeholder="预计归还时间"
+              readonly
+              :rules="[{ required: true, message: '未获取预计归还时间' }]"
+          />
+          <van-field
+              v-model="formData.realOuterDate"
+              name="实际借出时间"
+              label="实际借出时间"
+              placeholder="实际借出时间"
+              readonly
+              :rules="[{ required: true, message: '未获取实际借出时间' }]"
+          />
+          <van-field
+              v-model="formData.realReturnDate"
+              name="实际归还时间"
+              label="实际归还时间"
+              placeholder="实际归还时间"
+              readonly
+              :rules="[{ required: true, message: '未获取实际归还时间' }]"
+          />
+        </van-cell-group>
+      </van-form>
+    </card>
+  </flow-form>
+</template>
+
+<script setup lang="ts">
+import {useRoute} from 'vue-router';
+import {FlowDTO, getNextActivity} from '@/service/flow';
+import reqest from "@/utils/request";
+import DateTimeRange from '@/components/dateTimeRange.vue';
+import FlowForm from '@/components/flowForm.vue';
+import Card from '@/components/card.vue';
+import CardCell from '@/components/cardCell.vue';
+import {Checkbox, CheckboxGroup} from 'vant';
+import {DICT_TYPE, getDictLabel} from "@/utils/dict";
+
+
+const route = useRoute();
+const form = ref(null);
+
+interface FormDataType {
+}
+
+const formData = ref<FormDataType>({})
+
+const {activityInstanceId, participant, flowInstanceId, read} = route.query as {
+  activityInstanceId: string;
+  participant: string;
+  flowInstanceId: string;
+  read: string;
+};
+const activityData: FlowDTO = {
+  activityInstanceId,
+  participantId: participant,
+  flowOpinion: ''
+}
+const submitNextActivity = async (NextActivity: () => Promise<any>) => {
+  NextActivity();
+};
+
+const jsonToFormData = (json: any): FormData | null => {
+  const keys: string[] = Object.keys(json)
+  if (keys.length > 0) {
+    const formData = new FormData();
+    keys.forEach((key) => {
+      formData.append(key, (json[key] instanceof Object) ? JSON.stringify(json[key]) : json[key]);
+    });
+    return formData;
+  }
+  return null;
+}
+
+
+function formatDate(timestamp: number) {
+  const date = new Date(timestamp);
+  const year = date.getFullYear();
+  let month = (1 + date.getMonth()).toString();
+  month = month.length > 1 ? month : '0' + month;
+  let day = date.getDate().toString();
+  day = day.length > 1 ? day : '0' + day;
+  return `${year}-${month}-${day}`;
+}
+
+
+/** 初始化表单数据 */
+const initFormData = async () => {
+  const result = await reqest.get(`/business/officialSealOuter/mobileAdd?flowInstanceId=${flowInstanceId}`)
+  formData.value = result.data
+  formData.value.createTimeC = formatDate(formData.value.createTime)
+
+
+  formData.value.officialSealUseTypeText = getDictLabel(DICT_TYPE.WF_SEAL_TYPE, formData.value.officialSealUseType);
+  formData.value.officialSealNameText = getDictLabel(DICT_TYPE.WF_SEAL_NAME, formData.value.officialSealName);
+}
+
+
+/** 初始化 */
+onMounted(() => {
+  initFormData()
+})
+</script>
+
+<style lang="scss" scoped>
+@import "./index.scss";
+
+::v-deep .van-field__label {
+  width: auto;
+}
+
+::v-deep .van-field__control {
+  text-align: right;
+}
+</style>

+ 10 - 0
zjugis-business/src/main/java/com/zjugis/business/flow/officialSeal/controller/OfficialSealOuterController.java

@@ -3,6 +3,8 @@ package com.zjugis.business.flow.officialSeal.controller;
 
 import com.zjugis.business.flow.officialSeal.service.OfficialSealOuterService;
 import com.zjugis.business.flow.officialSeal.vo.OfficialSealOuterVO;
+import com.zjugis.business.flow.officialSeal.vo.OfficialSealUseVO;
+import com.zjugis.framework.common.pojo.CommonResult;
 import com.zjugis.framework.workflow.model.BaseController;
 import com.zjugis.framework.workflow.workflow.WorkFlow;
 import io.swagger.v3.oas.annotations.Parameter;
@@ -44,6 +46,14 @@ public class OfficialSealOuterController extends BaseController{
         return resultPage(map);
     }
 
+    /**
+     * 调岗申请表单生成 vue
+     */
+    @GetMapping("/mobileAdd")
+    public CommonResult<OfficialSealOuterVO> mobileAdd(String activityTemplateId, String flowInstanceId, String userId){
+        return CommonResult.success(officialSealOuterService.flowAdd(flowInstanceId, userId));
+    }
+
 
     /**
      * 创建公章外带申请流程

+ 1 - 1
zjugis-business/src/main/java/com/zjugis/business/flow/officialSeal/controller/OfficialSealUseController.java

@@ -48,7 +48,7 @@ public class OfficialSealUseController extends BaseController{
     }
 
     /**
-     * 调岗申请表单生成 vue
+     * 创建公章表单生成 vue
      */
     @GetMapping("/mobileAdd")
     public CommonResult<OfficialSealUseVO> mobileAdd(String activityTemplateId, String flowInstanceId, String userId){

+ 1 - 0
zjugis-business/src/main/java/com/zjugis/business/flow/officialSeal/service/OfficialSealOuterService.java

@@ -44,4 +44,5 @@ public interface OfficialSealOuterService {
      */
     Map<String, Object> getFormParams(String flowInstanceId, String userId);
 
+    OfficialSealOuterVO flowAdd(String flowInstanceId, String userId);
 }

+ 7 - 1
zjugis-business/src/main/java/com/zjugis/business/flow/officialSeal/service/OfficialSealOuterServiceImpl.java

@@ -33,6 +33,7 @@ import static com.zjugis.framework.common.exception.util.ServiceExceptionUtil.ex
 
 /**
  * 用章申请
+ *
  * @Author:zjq
  * @Date:2024-02-27
  */
@@ -50,7 +51,6 @@ public class OfficialSealOuterServiceImpl implements OfficialSealOuterService {
     private AdminUserApi adminUserApi;
 
 
-
     @Override
     public String createOfficialSeal(OfficialSealOuterVO createReqVO) {
         // 插入
@@ -112,6 +112,12 @@ public class OfficialSealOuterServiceImpl implements OfficialSealOuterService {
         return createModelMap();
     }
 
+    @Override
+    public OfficialSealOuterVO flowAdd(String flowInstanceId, String userId) {
+        OfficialSealOuterDO entity = findByInstanceId(flowInstanceId);
+        return OfficialSealOuterConvert.INSTANCE.convert(entity);
+    }
+
     private Map<String, Object> createModelMap() {
         Map<String, Object> map = new HashMap<>();
         map.put("formEntity", new HashMap<>());

+ 3 - 1
zjugis-business/src/main/java/com/zjugis/business/flow/officialSeal/vo/OfficialSealOuterVO.java

@@ -60,7 +60,7 @@ public class OfficialSealOuterVO {
      * 公章申请单号
      */
 
-    private String officialSealApplyNo;
+    private String officialSealOuterApplyNo;
 
     /**
      * 用章类型(字典表)
@@ -102,5 +102,7 @@ public class OfficialSealOuterVO {
     @TableField("REAL_RETURN_DATE")
     private LocalDate realReturnDate;
 
+    private LocalDateTime createTime;
+
 
 }