فهرست منبع

fix: 费用名称、客户账单、费用明细

lyc 5 روز پیش
والد
کامیت
634871a36c

+ 12 - 2
src/api/accountPeriod/accountPeriod.ts

@@ -2,7 +2,7 @@
 import http from '@/http/http'
 import { UploadFileParams } from '@/types/utils';
 import { Idparams, ResultInterface } from '../base/BaseDataModel';
-import { CustomerBillWithDetailDto, AccountPeriodDto, AccountPeriodParam, CustomerBillParam, AccountPeriodStatus, TmpReceiveParam, TmpReceiveDto, TmpReceiveStatusParam, TmpReceiveDtoAdd, TransferAccountsParams, BatchEditTmpReceive } from './accountPeriodModel';
+import { CustomerBillWithDetailDto, AccountPeriodDto, AccountPeriodParam, CustomerBillParam, AccountPeriodStatus, TmpReceiveParam, TmpReceiveDto, TmpReceiveStatusParam, TmpReceiveDtoAdd, TransferAccountsParams, BatchEditTmpReceive, CustomerBillReportEndTimeParam } from './accountPeriodModel';
 
 enum Api {
     list = '/api/accountPeriod/list',
@@ -16,7 +16,8 @@ enum Api {
     tmpReceiveStatus = '/api/tmpReceive/changeStatus',
     transferred = '/api/tmpReceive/transferred',
     summaryDownload = '/api/customerBillReport/summaryDownload',
-    batchEditTmpReceive = '/api/accountPeriod/batchEdit'
+    batchEditTmpReceive = '/api/accountPeriod/batchEdit',
+    billReportEndTimeStatus = '/api/billReportEndTime/billReportEndTimeStatus',
 }
 
 /**
@@ -61,6 +62,15 @@ export const api_customerBillList = async (parms: CustomerBillParam) => {
     return await http.post<ResultInterface<CustomerBillWithDetailDto>>(Api.customerBillList, parms)
 }
 
+/**
+ * 客户账单列表
+ * @param parms 
+ * @returns 
+ */
+export const api_billReportEndTimeStatus = async (parms: CustomerBillReportEndTimeParam) => {
+    return await http.post(Api.billReportEndTimeStatus, parms)
+}
+
 /**
  * 客户账期是否启用/停用
  * @param parms 

+ 14 - 0
src/api/accountPeriod/accountPeriodModel.ts

@@ -189,6 +189,20 @@ export interface CustomerBillParam extends PageParams {
     isInterceptCustomers?: boolean
 }
 
+/**
+ * 客户账单报表截止时间记录
+ */
+export interface CustomerBillReportEndTimeParam {
+    /**
+     * 客户账单编号
+     */
+    customerBillIdList: number[];
+    /**
+     * 状态 0: 新增 1:锁定 2:解锁
+     */
+    status: number;
+}
+
 /**
  * 客户账单返回值
  */

+ 2 - 0
src/api/usermoneysum/apiUserMoneySumModel.ts

@@ -37,6 +37,8 @@ export interface UserMoneyDetailParam extends PageParams {
      * 消费记录 0 否 1: 是
      */
     consumeFlag?: 0 | 1; 
+    reportBatchQuery?: boolean//上周期收货订单
+    lastCycleOrder?: boolean//报表账单分批查询
 }
 
 // 费用费项明细查询参数

+ 39 - 1
src/composables/accountPeriod/useCustomerBill.ts

@@ -4,7 +4,7 @@ import { useDropDownData } from '@/hooks/useDropDownData';
 import { ref, reactive, computed, onBeforeMount, unref, Ref } from 'vue';
 import { useQueryList } from '@/hooks/useQueryList';
 import { useEleFormValidate } from '@/hooks/useEleFormValidate';
-import { api_customerBillList, api_customerBillReportDownload } from '@/api/accountPeriod/accountPeriod';
+import { api_billReportEndTimeStatus, api_customerBillList, api_customerBillReportDownload } from '@/api/accountPeriod/accountPeriod';
 import { resCodeSuccess } from '@/utils/useReturnData';
 import { ListIitem } from '@/api/base/BaseDataModel';
 import { formatDate, getCurrentDateAndPretDate } from '@/utils/dateTimeStr';
@@ -13,6 +13,7 @@ import { usePersonnel } from '@/store/list_personnel';
 import { useApiDownTemplate } from '@/hooks/useApiDownTemplate';
 import { isArrayLength } from '@/utils/is';
 import { useMessage } from '@/hooks/useMessage';
+import { ReportEndTimeStatus } from '@/type/BaseEnum';
 
 const { createMessage } = useMessage()
 /**
@@ -126,6 +127,7 @@ function useCustomerBill(customerBillOptions: BasicTableProps, customerBillTable
                 customerId: row.customerId,
                 periodBeginDate: row.periodBeginDate,
                 periodEndDate: row.periodEndDate,
+                customerBillId: row.id,
             },
             params: {
                 customerId: row.customerId,
@@ -181,6 +183,40 @@ function useCustomerBill(customerBillOptions: BasicTableProps, customerBillTable
         const targetData = Array.from(summaryData, ([currencyCode, data]) => ({ currencyCode, ...data }));
         unref(summaryShowRef)?.show(targetData)
     }
+    // 获取表格选中账单id的数据
+    const getCheckboxRecords = () => {
+        const $table = unref(customerBillTableRef)
+        if(!$table) return []
+        const checkData = $table.getCheckboxRecords()
+        const customerBillIdList = checkData.map(item => item.id)
+        return customerBillIdList.filter(item => item)
+    }
+    // 结账锁定
+    const onClosingLockBtn = async () => {
+        const customerBillIdList = getCheckboxRecords()
+        if (!isArrayLength<number>(customerBillIdList)) {
+            createMessage.warning('请勾选需要锁定的数据!')
+            return
+        }
+        const res = await api_billReportEndTimeStatus({ customerBillIdList, status: ReportEndTimeStatus.LOCKING })
+        if (resCodeSuccess(res)) {
+            createMessage.success('操作成功')
+            searchBtn()
+        }
+    }
+    // 重算解锁
+    const onRecalculateUnlockBtn = async () => {
+        const customerBillIdList = getCheckboxRecords()
+        if (!isArrayLength<number>(customerBillIdList)) {
+            createMessage.warning('请勾选需要解锁的数据!')
+            return
+        }
+        const res = await api_billReportEndTimeStatus({ customerBillIdList, status: ReportEndTimeStatus.UNLOCK })
+        if (resCodeSuccess(res)) {
+            createMessage.success('操作成功')
+            searchBtn()
+        }
+    }
     
     return {
         customerBillFormRef,
@@ -200,6 +236,8 @@ function useCustomerBill(customerBillOptions: BasicTableProps, customerBillTable
         reportDownloadBtn,
         customerBillReportLoading,
         summaryBtn,
+        onClosingLockBtn,
+        onRecalculateUnlockBtn,
         currencyList,
         summaryShowRef
     }

+ 15 - 1
src/composables/accountPeriod/useCustomerBillModel.ts

@@ -1,5 +1,6 @@
 
 import type { BasicTableProps, VxeGridInstance, VxeTableDataRow, VxeTableDefines } from '@/components/VxeTable';
+import { ReportEndTimeStatus } from '@/type/BaseEnum';
 import { formatDate } from '@/utils/dateTimeStr';
 import { isArrayLength } from '@/utils/is';
 import { ref, reactive, unref, watchEffect } from 'vue';
@@ -23,6 +24,18 @@ function useCustomerBillModel() {
         columnConfig: {
             resizable: true
         },
+        cellClassName: ({ row, column }) => {
+            if (column.field == 'orderDeadline') {
+                switch (row.reportEndTimeStatus) {
+                    case ReportEndTimeStatus.ADD://新增(正常黑色)
+                        return 'class-orderDeadline-black'
+                    case ReportEndTimeStatus.LOCKING://锁定(绿色)
+                        return 'class-orderDeadline-green'
+                    case ReportEndTimeStatus.UNLOCK://解锁(红色)
+                        return 'class-orderDeadline-red'
+                }
+            }
+        },
         columns: [
             { type: "checkbox", width: 45 },
             { field: 'customerName', title: '客户名称', minWidth: 170, showOverflow: false },
@@ -47,6 +60,7 @@ function useCustomerBillModel() {
                 //     return formatDate(new Date(row.payDate))
                 // } 
             },
+            { field: 'orderDeadline', title: '出账截止时间', width: 150 },
             { field: 'currencyCode', title: '币种', width: 80, showOverflow: false, slots: { default: 'currencyList' } },
             { field: 'openingBalance', title: '期初余额', width: 90 },
             { field: 'payment', title: '本期付款(+)', width: 100 },
@@ -66,7 +80,7 @@ function useCustomerBillModel() {
         if(isArrayLength(list)) {
             const tableMergeCells:  VxeTableDefines.MergeOptions<any>[] = []
             list.forEach((item, index) => {
-                tableMergeCells.push({ row: index, col: 9, rowspan: 1, colspan: 7 })
+                tableMergeCells.push({ row: index, col: 10, rowspan: 1, colspan: 7 })
             })
             customerBillGridOptions.mergeCells = tableMergeCells
         } else {

+ 21 - 1
src/composables/userMoneySumDetail/userMoneySumDetail.ts

@@ -67,6 +67,8 @@ function userMoneySumDetailList(usermoneyGridOptions: BasicTableProps) {
         reportQueryDateType: 0,//时间类型 1 充值时间 0 创建时间
         salesmanId: undefined,//账期类型
         accountPeriod: undefined,//业务员
+        reportBatchQuery: false,//报表账单分批查询
+        lastCycleOrder: false,//上周期收货订单
         consumeFlag: 1,
         pageNum: 1,
         pageSize: 10,
@@ -90,6 +92,7 @@ function userMoneySumDetailList(usermoneyGridOptions: BasicTableProps) {
         inputMultiOrders: '',//单号文本框1
         inputOrders: '',//单号文本框2
         reportType: 0,//报表类型
+        customerBillId: undefined,//标识客户账单的账单id
     })
     // 操作类别
     const actionOptions: ActionOptions[] = [
@@ -129,6 +132,10 @@ function userMoneySumDetailList(usermoneyGridOptions: BasicTableProps) {
             history.state.periodBeginDate = undefined
             history.state.periodEndDate = undefined
         }
+        if (state.customerBillId) {
+            dealData.customerBillId = state.customerBillId
+            history.state.customerBillId = undefined
+        }
     }
     onBeforeMount(() => {
         initStartAndEndDates()
@@ -178,8 +185,10 @@ function userMoneySumDetailList(usermoneyGridOptions: BasicTableProps) {
         dealData.reportType = 0
         hanlClearOrderIdList()
         for (const key of Object.keys(queryUserMoneySumDetailForm)) {
-            if (isBoolean(queryUserMoneySumDetailForm[key])) {
+            if (key == 'validData' && isBoolean(queryUserMoneySumDetailForm[key])) {
                 queryUserMoneySumDetailForm[key] = true;
+            } else if (isBoolean(queryUserMoneySumDetailForm[key])) {
+                queryUserMoneySumDetailForm[key] = false;
             } else if (isArray(queryUserMoneySumDetailForm[key])) {
                 queryUserMoneySumDetailForm[key] = [];
             } else {
@@ -190,6 +199,7 @@ function userMoneySumDetailList(usermoneyGridOptions: BasicTableProps) {
         queryUserMoneySumDetailForm.total = 0
         queryUserMoneySumDetailForm.reportQueryDateType = 0
         queryUserMoneySumDetailForm.consumeFlag = 1
+        dealData.customerBillId = undefined
         initStartAndEndDates()
     }
 
@@ -296,6 +306,11 @@ function userMoneySumDetailList(usermoneyGridOptions: BasicTableProps) {
     const { sizeChange, currentChange, searchBtn, resetBtn, listParams } = useQueryList<UserMoneyDetailParam>(initList, resetParams, queryUserMoneySumDetailForm)
     const exportBillBtn = async () => {
         const params = await flatDate()
+        // 判断时间类型为收货时间且客户账单id为空提示
+        if (params.reportQueryDateType === 1 && !dealData.customerBillId) {
+            createMessage.warning('按收货日期导出费用,请从相应账单跳转!')
+            return false
+        }
         // 导出币种默认值
         if (!params.currencyCode) params.currencyCode = "CNY"
         if (!isNumber(params.reportQueryDateType)) {
@@ -341,6 +356,10 @@ function userMoneySumDetailList(usermoneyGridOptions: BasicTableProps) {
             }
         }
     }
+    // 分期导出change事件
+    const changeReportBatchQuery = (val) => {
+        if (!val) queryUserMoneySumDetailForm.lastCycleOrder = false
+    }
     // 平账
     const hanleBalanced = async (data) => {
         const res = await api_UserBalance(data)
@@ -462,6 +481,7 @@ function userMoneySumDetailList(usermoneyGridOptions: BasicTableProps) {
         accountPeriodTypeList,
         allPaymentPlatformList,
         getFeeTotalAmount,
+        changeReportBatchQuery,
     }
 }
 

+ 18 - 0
src/style.scss

@@ -215,6 +215,10 @@ input[type=number]::-webkit-outer-spin-button {
     /* 显示省略号 */
 }
 
+.font-bold {
+    font-weight: bold;
+}
+
 .cursor {
     cursor: pointer;
 }
@@ -363,4 +367,18 @@ input[type=number]::-webkit-outer-spin-button {
 // 
 .class-profit {
     color: red;
+}
+
+// 客户账单
+.class-orderDeadline-black {
+    color: black;
+}
+.class-orderDeadline-green {
+    color: green;
+}
+.class-orderDeadline-red {
+    color: red;
+}
+.bill-actions-btn {
+  margin: 8px 4px;
 }

+ 18 - 0
src/type/BaseEnum.ts

@@ -208,4 +208,22 @@ export enum MoneySumAction {
      * 退款
      */
     REFUND = 3
+}
+
+/**
+ * 客户账单的状态
+ */
+export enum ReportEndTimeStatus {
+    /**
+     * 新增
+     */
+    ADD = 0,
+    /**
+     * 锁定
+     */
+    LOCKING = 1,
+    /**
+     * 解锁
+     */
+    UNLOCK = 2
 }

+ 1 - 1
src/utils/is.ts

@@ -92,7 +92,7 @@ export function isObjectKeys(row: Recordable) {
 /**
  * 判断是否为数组且length大于0
  */
-export function isArrayLength(arr: Recordable): arr is Array<Recordable> {
+export function isArrayLength<T = Recordable>(arr: Recordable): arr is Array<T> {
     return arr && Array.isArray(arr) && arr.length > 0;
 }
 

+ 55 - 11
src/views/accountPeriod/customerBill.vue

@@ -139,16 +139,6 @@
         >
           重置
         </el-button>
-        <el-button
-          v-permission="['sys:customerBill:list']"
-          plain
-          type="success"
-          :loading="customerBillReportLoading"
-          :icon="Tickets"
-          @click="summaryBtn"
-        >
-          汇总
-        </el-button>
         <el-button
           v-permission="['sys:customerBill:summaryDownload']"
           plain
@@ -159,6 +149,55 @@
         >
           报表下载
         </el-button>
+        <el-dropdown class="bill-actions">
+          <el-button plain>
+            操作
+            <el-icon class="el-icon--right">
+              <arrow-down />
+            </el-icon>
+          </el-button>
+          <template #dropdown>
+            <div class="bill-actions-btn">
+              <el-button
+                v-permission="['sys:customerBill:list']"
+                style="width: 100%;"
+                plain
+                type="success"
+                :loading="customerBillReportLoading"
+                :icon="Tickets"
+                @click="summaryBtn"
+              >
+                汇总
+              </el-button>
+            </div>
+            <div class="bill-actions-btn">
+              <el-button
+                v-permission="['sys:billReportEndTime:changeStaus']"
+                style="width: 100%;"
+                plain
+                type="warning"
+                :loading="customerBillReportLoading"
+                :icon="Tickets"
+                @click="onClosingLockBtn"
+              >
+                结账锁定
+              </el-button>
+            </div>
+            <div class="bill-actions-btn">
+              <el-button
+                v-permission="['sys:billReportEndTime:changeStaus']"
+                style="width: 100%;"
+                plain
+                type="primary"
+                :loading="customerBillReportLoading"
+                :icon="Tickets"
+                @click="onRecalculateUnlockBtn"
+              >
+                重算解锁
+              </el-button>
+            </div>
+          </template>
+        </el-dropdown>
       </el-form-item>
     </el-form>
     <!-- 列表 -->
@@ -246,7 +285,7 @@
   <CustomerBillSummary ref="summaryShowRef" />
 </template>
 <script lang="ts" setup name="customerBill">
-import { Search, RefreshRight, Download, Tickets } from "@element-plus/icons-vue";
+import { Search, RefreshRight, Download, Tickets, ArrowDown } from "@element-plus/icons-vue";
 import BaseSelect from "@/components/QuerySelect/BaseSelect.vue";
 import { VxeBasicTable } from "@/components/VxeTable";
 import { useCustomerBill } from "@/composables/accountPeriod/useCustomerBill";
@@ -275,6 +314,8 @@ const {
   reportDownloadBtn,
   customerBillReportLoading,
   summaryBtn,
+  onClosingLockBtn,
+  onRecalculateUnlockBtn,
   currencyList,
   summaryShowRef
 } = useCustomerBill(customerBillGridOptions, customerBillTableRef);
@@ -310,5 +351,8 @@ const {
   .customer-checkbox-search {
     margin-right: 10px; 
   }
+  .bill-actions {
+    margin-left: 12px;
+  }
 }
 </style>

+ 8 - 0
src/views/customerfeeset/AddandEditCustomerFeeSetDetail.vue

@@ -16,6 +16,14 @@
           :model="customerFeeSetParams.feeBasicData"
           class="fesset-from"
         >
+          <el-form-item
+            label="费用名称:"
+            style="min-width: 135px;"
+          >
+            <div class="single-line primary-color">
+              {{ baseData.baseFeeset.feeSetName }}
+            </div>
+          </el-form-item>
           <el-form-item
             label="产品名称:"
             style="min-width: 135px;"

+ 23 - 1
src/views/userMoneyDetail/userMoneyDetailList.vue

@@ -250,6 +250,24 @@
               placeholder="支付方式"
             />
           </el-form-item>
+          <el-form-item class="usermoneysum-search">
+            <el-checkbox
+              v-model="queryUserMoneySumDetailForm.reportBatchQuery"
+              label="分批导出"
+              border
+              @change="changeReportBatchQuery"
+            />
+          </el-form-item>
+          <el-form-item
+            v-show="queryUserMoneySumDetailForm.reportBatchQuery"
+            class="usermoneysum-search"
+          >
+            <el-checkbox
+              v-model="queryUserMoneySumDetailForm.lastCycleOrder"
+              label="上期收货订单"
+              border
+            />
+          </el-form-item>
         </template>
         <template #button>
           <el-button
@@ -370,7 +388,8 @@ const {
   getSalesmanUsesList,
   accountPeriodTypeList,
   allPaymentPlatformList,
-  getFeeTotalAmount
+  getFeeTotalAmount,
+  changeReportBatchQuery
 } = userMoneySumDetailList(usermoneyGridOptions)
 
 // daterange 时间范围
@@ -389,6 +408,9 @@ const { defaultTime, isSelectDisabled, selectCalendar } = useTimeRange(62)
   .usermoneysum-search {
     width: 162px;
     margin-right: 11px;
+    .el-checkbox {
+      width: 100%;
+    }
   }
 
   .usermoneysum-date-search {