24282 11 månader sedan
förälder
incheckning
7e5140665e

+ 7 - 0
jy-business/src/main/java/com/jy/business/payment/dao/PaymentRequestsDetailDao.java

@@ -7,10 +7,17 @@ import com.jy.system.service.AuthService;
 import jakarta.annotation.Resource;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 @Service
 public class PaymentRequestsDetailDao extends BaseDao<PaymentRequestsDetailMapper, PaymentRequestsDetail> {
 
     @Resource
     private AuthService authService;
 
+    // 获取明细列表
+    public List<PaymentRequestsDetail> getListByPaymentRequestsId(Long paymentRequestsId) {
+        return lambdaQuery().eq(PaymentRequestsDetail::getPaymentRequestsId, paymentRequestsId).list();
+    }
+
 }

+ 8 - 0
jy-business/src/main/java/com/jy/business/payment/model/vo/PaymentRequestsVo.java

@@ -1,9 +1,12 @@
 package com.jy.business.payment.model.vo;
 
 import com.jy.business.payment.model.entity.PaymentRequests;
+import com.jy.business.payment.model.entity.PaymentRequestsDetail;
 import lombok.Getter;
 import lombok.Setter;
 
+import java.util.List;
+
 /**
  * 请款列表查询返回值实体
  *
@@ -34,4 +37,9 @@ public class PaymentRequestsVo extends PaymentRequests {
      */
     private String capitalAccountName;
 
+    /**
+     * 请款明细
+     */
+    private List<PaymentRequestsDetail> paymentRequestsDetailList;
+
 }

+ 3 - 0
jy-business/src/main/java/com/jy/business/payment/service/impl/PaymentRequestsServiceImpl.java

@@ -48,6 +48,9 @@ public class PaymentRequestsServiceImpl implements PaymentRequestsService {
     public PaymentRequestsVo getDetail(Long id) {
         PaymentRequestsVo vo = paymentRequestsDao.getDetail(id);
         AssertUtil.notNull(vo, "未知数据");
+
+        List<PaymentRequestsDetail> list = paymentRequestsDetailDao.getListByPaymentRequestsId(id);
+        vo.setPaymentRequestsDetailList(list);
         return vo;
     }
 

+ 31 - 0
jy-flow/src/main/java/com/jy/flow/controller/ExecuteController.java

@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jy.flow.adapter.AbstractWarmFlowAdapter;
 import com.jy.flow.dto.FlowHisTaskDto;
 import com.jy.flow.dto.FlowTaskDto;
+import com.jy.flow.dto.WarmFlowHandleDto;
 import com.jy.flow.service.ExecuteService;
 import com.jy.flow.service.HhDefService;
 import com.jy.flow.vo.FlowTaskVo;
@@ -23,12 +24,14 @@ import com.jy.system.model.entity.SysRole;
 import com.jy.system.model.entity.SysUser;
 import com.jy.system.model.vo.SysUserVo;
 import com.warm.flow.core.FlowFactory;
+import com.warm.flow.core.dto.FlowParams;
 import com.warm.flow.core.entity.HisTask;
 import com.warm.flow.core.entity.Instance;
 import com.warm.flow.core.entity.Node;
 import com.warm.flow.core.entity.Task;
 import com.warm.flow.core.entity.User;
 import com.warm.flow.core.enums.CooperateType;
+import com.warm.flow.core.enums.SkipType;
 import com.warm.flow.core.enums.UserType;
 import com.warm.flow.core.service.HisTaskService;
 import com.warm.flow.core.service.InsService;
@@ -42,6 +45,7 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -279,6 +283,33 @@ public class ExecuteController {
         return sysUserDao.listByIds(Arrays.asList(ids));
     }
 
+    /**
+     * 办理流程
+     */
+    @PostMapping("/handle")
+    public void handle(@RequestBody WarmFlowHandleDto dto) {
+        Integer handleType = dto.getHandleType();
+        String skipType = switch (handleType) {
+            case 1 -> SkipType.PASS.getKey();
+            case 2 -> SkipType.REJECT.getKey();
+            default -> null;
+        };
+
+        FlowParams flowParams = FlowParams.build()
+                .skipType(skipType)
+                .handler(LoginContext.getUserId().toString())
+                .nodeCode(dto.getNodeCode())
+                .message(dto.getMessage())
+                .permissionFlag(AbstractWarmFlowAdapter.permissionList())
+                .setFlowStatus("");
+
+        if (handleType == 3) {
+            taskService.termination(dto.getTaskId(), flowParams);
+        } else {
+            taskService.skip(dto.getTaskId(), flowParams);
+        }
+
+    }
 
     private String getName(String id) {
         Map<Long, String> userMap = StreamUtils.toMap(sysUserDao.list(), SysUser::getId, SysUser::getNickname);

+ 30 - 0
jy-flow/src/main/java/com/jy/flow/dto/WarmFlowHandleDto.java

@@ -0,0 +1,30 @@
+package com.jy.flow.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class WarmFlowHandleDto {
+
+    /**
+     * 任务id
+     */
+    private Long taskId;
+
+    /**
+     * 处理类型
+     */
+    private Integer handleType;
+
+    /**
+     * 审批意见
+     */
+    private String message;
+
+    /**
+     * 流程跳转节点
+     */
+    private String nodeCode;
+
+}

+ 1 - 0
jy-flow/src/main/java/com/jy/flow/mapper/xml/WarmFLowMapper.xml

@@ -82,6 +82,7 @@
         LEFT JOIN flow_instance i on t.instance_id = i.id
         <where>
             t.node_type = 1
+            and t.del_flag = 0
             <if test="task.permissionList != null and task.permissionList.size > 0">
                 AND uu.processed_by in
                 <foreach item="permission" collection="task.permissionList" open="(" separator="," close=")">

+ 5 - 0
jy-ui/src/api/flow/execute.ts

@@ -10,3 +10,8 @@ export function getToDoPageApi(params: StrAnyObj): Promise<PageType<StrAnyObj>>
 export function getDoneListApi(id: string): Promise<PageType<StrAnyObj>> {
   return request.get(`/flow/execute/doneList/${id}`)
 }
+
+// 办理
+export function handleApi(data: StrAnyObj): Promise<void> {
+  return request.post(`/flow/execute/handle`, data)
+}

+ 7 - 2
jy-ui/src/views/business/payment/requests/flowDetail.vue

@@ -20,11 +20,13 @@ const props = withDefaults(
 )
 
 watch(
-  props.businessId,
+  () => props.businessId,
   () => {
     nextTick(() => deptIdRef.value?.load())
     getDetailApi({ id: props.businessId }).then((resp: StrAnyObj) => {
       formData.value = resp
+      updateAmount()
+      updateDetailRemark()
     })
   },
   { immediate: true }
@@ -161,6 +163,7 @@ const detailTableColumnConfig: ColumnConfigType[] = [
   },
   {
     width: 100,
+    if: () => !props.disabled,
     handleConfig: [
       {
         common: 'delete',
@@ -209,13 +212,14 @@ function updateAmount() {
         :card="false"
       >
         <template #expenseType="scope">
-          <a-select v-model="scope.row.expenseType" dict="expense_type" />
+          <a-select v-model="scope.row.expenseType" dict="expense_type" :disabled="disabled" />
         </template>
         <template #remark="scope">
           <a-input
             v-model="scope.row.remark"
             type="textarea"
             :rows="2"
+            :disabled="disabled"
             @change="updateDetailRemark"
           />
         </template>
@@ -224,6 +228,7 @@ function updateAmount() {
             v-model="scope.row.amount"
             :min="0.01"
             :precision="2"
+            :disabled="disabled"
             @change="updateAmount"
           />
         </template>

+ 43 - 88
jy-ui/src/views/flow/taskTodo/index.vue

@@ -4,27 +4,18 @@ import { FormConfigType } from '@/components/AForm/type'
 import { ToolbarConfigType } from '@/components/AToolbar/type'
 import { ColumnConfigType } from '@/components/ATable/type'
 import { StrAnyObj, StrAnyObjArr } from '@/typings'
-import { useHandleData } from '@/utils/useHandleData'
-import { getPageApi, getDetailApi, addApi, editApi, deleteApi } from '@/api/system/config'
-import { getDoneListApi, getToDoPageApi } from '@/api/flow/execute'
+import { getDoneListApi, getToDoPageApi, handleApi } from '@/api/flow/execute'
 import { getChartApi } from '@/api/flow/definition'
-import { Comment } from '@element-plus/icons-vue'
-import { nextTick } from 'vue'
 
 const modules = import.meta.glob('@/views/**/*.vue')
 
 const queryRef = ref<InstanceType<typeof AForm>>()
-const formRef = ref<InstanceType<typeof AForm>>()
 
 const showQuery = ref<boolean>(true)
 const pageTotal = ref<number>(0)
 
 const queryData = ref<StrAnyObj>({ pageNum: 1, pageSize: 10 })
 const tableData = ref<StrAnyObjArr>([])
-const formData = ref<StrAnyObj>({})
-
-const dialogTitle = ref<string>('')
-const dialogVisible = ref<boolean>(false)
 
 const chartVisible = ref(false)
 const imgUrl = ref('')
@@ -32,10 +23,12 @@ const imgUrl = ref('')
 const doneListVisible = ref(false)
 const doneList = ref([])
 
+const handleData = ref({})
+
 const handleVisible = ref(false)
 const handleComponent = ref(null)
 const businessId = ref(null)
-const handleDisabled = ref(true)
+const taskId = ref(null)
 
 const queryConfig: FormConfigType[] = [
   {
@@ -74,14 +67,6 @@ const toolbarConfig: ToolbarConfigType[] = [
       getPage()
     }
   }
-  // {
-  //   common: 'add',
-  //   permissions: 'sysConfig:add',
-  //   click() {
-  //     dialogVisible.value = true
-  //     dialogTitle.value = '新增'
-  //   }
-  // }
 ]
 
 const columnConfig: ColumnConfigType[] = [
@@ -132,6 +117,7 @@ const columnConfig: ColumnConfigType[] = [
             return
           }
           businessId.value = row.businessId
+          taskId.value = row.id
           handleComponent.value = markRaw(defineAsyncComponent(module))
           handleVisible.value = true
         }
@@ -158,41 +144,6 @@ const columnConfig: ColumnConfigType[] = [
   }
 ]
 
-const formConfig: FormConfigType[] = [
-  {
-    type: 'input',
-    prop: 'name',
-    label: '参数名称',
-    rule: [{ required: true, message: '参数名称不能为空', trigger: 'blur' }]
-  },
-  {
-    type: 'input',
-    prop: 'code',
-    label: '参数编码',
-    rule: [{ required: true, message: '参数编码不能为空', trigger: 'blur' }]
-  },
-  {
-    type: 'input',
-    prop: 'value',
-    label: '参数值',
-    rule: [{ required: true, message: '参数键值不能为空', trigger: 'blur' }]
-  },
-  {
-    type: 'radio',
-    prop: 'builtin',
-    label: '系统内置',
-    dict: 'yes_no',
-    rule: [{ required: true, message: '系统内置不能为空', trigger: 'blur' }]
-  },
-  {
-    type: 'input',
-    prop: 'remark',
-    label: '备注',
-    itemType: 'textarea',
-    rows: 5
-  }
-]
-
 const doneListColumnConfig: ColumnConfigType[] = [
   {
     prop: 'nodeName',
@@ -217,6 +168,21 @@ const doneListColumnConfig: ColumnConfigType[] = [
   }
 ]
 
+const handleConfig: FormConfigType[] = [
+  {
+    type: 'input',
+    itemType: 'textarea',
+    label: '审批意见',
+    prop: 'message',
+    rows: 5
+  },
+  {
+    type: 'slot',
+    label: '审批类型',
+    prop: 'handle'
+  }
+]
+
 onMounted(() => {
   getPage()
 })
@@ -228,27 +194,14 @@ function getPage() {
   })
 }
 
-function formSubmit() {
-  formRef.value?.validate(() => {
-    if (formData.value.id) {
-      editApi(formData.value).then(() => {
-        dialogVisible.value = false
-        ElMessage.success('修改成功')
-        getPage()
-      })
-    } else {
-      addApi(formData.value).then(() => {
-        dialogVisible.value = false
-        ElMessage.success('新增成功')
-        getPage()
-      })
-    }
+function handle(handleType) {
+  const message = handleData.value.message
+  handleApi({ taskId: taskId.value, handleType, message }).then(() => {
+    getPage()
+    ElMessage.success('办理成功')
+    this.handleVisible = false
   })
 }
-
-function formClosed() {
-  formRef.value?.resetFields()
-}
 </script>
 
 <template>
@@ -270,21 +223,23 @@ function formClosed() {
     >
     </a-table>
 
-    <a-dialog
-      v-model="dialogVisible"
-      :title="dialogTitle"
-      @submit="formSubmit"
-      @closed="formClosed"
-    >
-      <a-form ref="formRef" v-model="formData" :config="formConfig" :span="24"> </a-form>
-    </a-dialog>
-
-    <a-dialog title="办理" v-model="handleVisible" width="1200px" :footer="false">
-      <component :is="handleComponent" :businessId="businessId" />
-      <template #footer>
-        <el-button @click="handleVisible = false">取 消</el-button>
-        <el-button type="primary" @click="submit">通 过</el-button>
-      </template>
+    <a-dialog title="" v-model="handleVisible" width="1200px" :footer="false">
+      <el-card shadow="always">
+        <template #header>流程明细</template>
+        <component :is="handleComponent" :businessId="businessId" />
+      </el-card>
+
+      <el-card shadow="always" style="margin-top: 20px">
+        <template #header>办理参数</template>
+        <a-form v-model="handleData" :config="handleConfig" :span="24">
+          <template #handle>
+            <el-button type="primary" @click="handle(1)">通 过</el-button>
+            <el-button type="primary" @click="handle(2)">回 退</el-button>
+            <el-button type="primary" @click="handle(3)">拒 绝</el-button>
+            <el-button @click="handleVisible = false">关 闭</el-button>
+          </template>
+        </a-form>
+      </el-card>
     </a-dialog>
 
     <a-dialog title="流程图" v-model="chartVisible" width="1200px" :footer="false">