24282 11 ヶ月 前
コミット
68d993545b

+ 9 - 7
jy-business/src/main/java/com/jy/business/payment/dao/PaymentRequestsDao.java

@@ -10,18 +10,14 @@ import com.jy.business.payment.model.table.PaymentRequestsTable;
 import com.jy.business.payment.model.vo.PaymentRequestsVo;
 import com.jy.framework.model.base.BaseDao;
 import com.jy.framework.model.base.BaseIdPo;
+import com.jy.framework.satoken.LoginContext;
 import com.jy.system.model.table.SysDeptTable;
 import com.jy.system.model.table.SysUserTable;
-import com.jy.system.service.AuthService;
-import jakarta.annotation.Resource;
 import org.springframework.stereotype.Service;
 
 @Service
 public class PaymentRequestsDao extends BaseDao<PaymentRequestsMapper, PaymentRequests> {
 
-    @Resource
-    private AuthService authService;
-
     /**
      * 请款分页
      */
@@ -51,7 +47,13 @@ public class PaymentRequestsDao extends BaseDao<PaymentRequestsMapper, PaymentRe
                 .leftJoin(su).on(pr.createUser.eq(su.id))
                 .leftJoin(ca).on(pr.capitalAccountId.eq(ca.id))
                 .where(
-                        pr.createUser.in(authService.getUserPermissionSet())
+                        pr.createUser.eq(LoginContext.getUserId()),
+                        pr.corporationId.eq(dto.getCorporationId()),
+                        pr.deptId.eq(dto.getDeptId()),
+                        pr.type.eq(dto.getType()),
+                        pr.payType.eq(dto.getPayType()),
+                        pr.approvalStatus.eq(dto.getApprovalStatus()),
+                        pr.paymentStatus.eq(dto.getPaymentStatus())
                 )
                 .orderBy(
                         pr.id.desc()
@@ -82,5 +84,5 @@ public class PaymentRequestsDao extends BaseDao<PaymentRequestsMapper, PaymentRe
     public void updateFlowStatus(String businessId, String flowStatus) {
         lambdaUpdate().eq(BaseIdPo::getId, businessId).set(PaymentRequests::getApprovalStatus, flowStatus).update();
     }
-    
+
 }

+ 25 - 0
jy-business/src/main/java/com/jy/business/payment/model/dto/PaymentRequestsSelectDto.java

@@ -15,8 +15,33 @@ import lombok.Setter;
 public class PaymentRequestsSelectDto extends BaseSelectDto {
 
     /**
+     * 归属公司
+     */
+    private Long corporationId;
+
+    /**
+     * 归属部门
+     */
+    private Long deptId;
+
+    /**
      * 请款类型
      */
     private Integer type;
 
+    /**
+     * 付款方式
+     */
+    private Integer payType;
+
+    /**
+     * 审批状态
+     */
+    private Integer approvalStatus;
+
+    /**
+     * 放款状态
+     */
+    private Integer paymentStatus;
+
 }

+ 87 - 60
jy-ui/src/views/business/payment/requests/index.vue

@@ -26,77 +26,76 @@ const dialogTitle = ref<string>('')
 const dialogVisible = ref<boolean>(false)
 
 const deptIdRef = ref<InstanceType<typeof DeptTreeSelect>>()
+const selectDeptIdRef = ref<InstanceType<typeof DeptTreeSelect>>()
+
+const disabled = ref(false)
 
 const queryConfig: FormConfigType[] = [
   {
-    type: 'input',
+    type: 'select',
     prop: 'corporationId',
-    label: '归属公司id'
+    label: '归属公司',
+    keyName: 'id',
+    labelName: 'name',
+    async option() {
+      const data = await getCorporationPageApi({ searchAll: true })
+      return data.records
+    },
   },
   {
-    type: 'input',
+    type: 'slot',
     prop: 'deptId',
-    label: '部门id'
+    label: '归属部门',
   },
   {
-    type: 'input',
+    type: 'select',
     prop: 'type',
-    label: '请款类型'
-  },
-  {
-    type: 'input',
-    prop: 'useTime',
-    label: '用款时间'
-  },
-  {
-    type: 'input',
-    prop: 'useRemark',
-    label: '用款说明'
-  },
-  {
-    type: 'input',
-    prop: 'atts',
-    label: '附件列表'
-  },
-  {
-    type: 'input',
-    prop: 'totalAmount',
-    label: '付款总金额'
-  },
-  {
-    type: 'input',
-    prop: 'documentQuantity',
-    label: '单据数量'
+    label: '请款类型',
+    dict: 'payment_requests_type'
   },
   {
-    type: 'input',
+    type: 'select',
     prop: 'payType',
-    label: '付款方式'
-  },
-  {
-    type: 'input',
-    prop: 'capitalAccountId',
-    label: '资金账户id'
-  },
-  {
-    type: 'input',
-    prop: 'accountName',
-    label: '户名'
-  },
-  {
-    type: 'input',
-    prop: 'account',
-    label: '银行账号'
+    label: '付款方式',
+    dict: 'pay_type'
   },
   {
-    type: 'input',
-    prop: 'depositBank',
-    label: '开户银行'
+    type: 'select',
+    prop: 'approvalStatus',
+    label: '审批状态',
+    option: [
+      {
+        key: 0,
+        label: '待发起'
+      },
+      {
+        key: 1,
+        label: '进行中'
+      },
+      {
+        key: 2,
+        label: '已通过'
+      },
+      {
+        key: 3,
+        label: '已驳回'
+      },
+    ]
   },
   {
-    type: 'input',
-    prop: 'correspondentNumber',
-    label: '联行号/ SWIFT Code'
+    type: 'select',
+    prop: 'paymentStatus',
+    label: '放款状态',
+    option: [
+      {
+        key: 0,
+        label: '未放款'
+      },
+      {
+        key: 1,
+        label: '已放款'
+      }
+    ]
   }
 ]
 
@@ -207,12 +206,27 @@ const columnConfig: ColumnConfigType[] = [
         },
         click(row) {
           dialogVisible.value = true
-          dialogTitle.value = '编辑'
+          dialogTitle.value = '重新发起'
+          disabled.value = false
           getDetailApi({id: row.id}).then((resp: StrAnyObj) => {
             formData.value = resp
           })
           nextTick(() => deptIdRef.value?.load())
         }
+      },
+      {
+        common: 'detail',
+        click(row) {
+          dialogVisible.value = true
+          dialogTitle.value = '详情'
+          disabled.value = true
+          nextTick(() => deptIdRef.value?.load())
+          getDetailApi({ id: row.id }).then((resp: StrAnyObj) => {
+            formData.value = resp
+            updateAmount()
+            updateDetailRemark()
+          })
+        }
       }
     ]
   }
@@ -346,6 +360,7 @@ const detailTableColumnConfig: ColumnConfigType[] = [
   },
   {
     width: 100,
+    if: () => !disabled.value,
     handleConfig: [
       {
         common: 'delete',
@@ -361,6 +376,7 @@ const detailTableColumnConfig: ColumnConfigType[] = [
 
 onMounted(() => {
   getPage()
+  selectDeptIdRef.value?.load()
 })
 
 function getPage() {
@@ -386,6 +402,10 @@ function formSubmit() {
         ElMessage.error('请款明细存在费用类型为空,无法提交')
         return
       }
+      if (!item.remark) {
+        ElMessage.error('请款明细存在款项说明为空,无法提交')
+        return
+      }
       if (!item.amount) {
         ElMessage.error('请款明细存在请款金额为空,无法提交')
         return
@@ -443,7 +463,11 @@ function updateAmount() {
 <template>
   <div>
     <el-card v-if="showQuery">
-      <a-form ref="queryRef" v-model="queryData" :config="queryConfig" :span="6"></a-form>
+      <a-form ref="queryRef" v-model="queryData" :config="queryConfig" :span="6">
+        <template #deptId>
+          <dept-tree-select ref="selectDeptIdRef" v-model="formData.deptId" />
+        </template>
+      </a-form>
     </el-card>
 
     <a-table
@@ -469,12 +493,12 @@ function updateAmount() {
         width="1400px"
         height="200px"
     >
-      <a-form ref="formRef" v-model="formData" :config="formConfig" :span="12">
+      <a-form ref="formRef" v-model="formData" :config="formConfig" :span="12"  :disabled="disabled">
         <template #deptId>
-          <dept-tree-select ref="deptIdRef" v-model="formData.deptId"/>
+          <dept-tree-select ref="deptIdRef" v-model="formData.deptId"  :disabled="disabled"/>
         </template>
         <template #atts>
-          <file-upload v-model="formData.atts"/>
+          <file-upload v-model="formData.atts"  :disabled="disabled"/>
         </template>
         <template #detailTable>
           <a-table
@@ -484,7 +508,7 @@ 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
@@ -492,6 +516,7 @@ function updateAmount() {
                   type="textarea"
                   :rows="2"
                   @change="updateDetailRemark"
+                  :disabled="disabled"
               />
             </template>
             <template #amount="scope">
@@ -500,10 +525,12 @@ function updateAmount() {
                   :min="0.01"
                   :precision="2"
                   @change="updateAmount"
+                  :disabled="disabled"
               />
             </template>
           </a-table>
           <el-button
+              v-if="!disabled"
               style="width: 100%; margin-bottom: 20px"
               type="primary"
               @click="addPaymentRequestsDetailList"