huangbin 4 lat temu
rodzic
commit
c4f472b133

+ 1 - 0
src/views/report/interface.ts

@@ -9,4 +9,5 @@ export interface TypeAndTime {
     cycletype: number//      周期类型 - 0:日 1:月 2:季 3:年 4:周 5:全报表【原值】
     cycletime: string//      周期时间 日(YYYYMMDD) 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYMMDD周内任意一天) 全(0)【原值】
     userid?: number// 
+    sumfields?: string//              汇总维度(逗号隔开) 1-品种 2-品类 3-品牌 4-仓库
 }

+ 5 - 5
src/views/report/inventory-report/list/category/index.vue

@@ -21,8 +21,8 @@ import Filter from '../../components/filterTable/index.vue';
 import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList } from '@/common/export/table';
 import { queryTableList } from '../../../setup';
 import { handleInitTypeAndTime } from '@/views/report/setup';
-import { qryAreaSpotplReport } from '@/services/go/ermcp/report';
-import { Ermcp3AreaSpotPLReport } from '@/services/go/ermcp/report/interface';
+import { qryAreaSpotplReport, qryAreaStockReport } from '@/services/go/ermcp/report';
+import { Ermcp3AreaSpotPLReport, Ermcp3AreaStockReport } from '@/services/go/ermcp/report/interface';
 import { TypeAndTime } from '@/views/report/interface';
 
 export default defineComponent({
@@ -40,16 +40,16 @@ export default defineComponent({
         // // 表格操作按钮列表
         // const { commonBtn, forDataBtn } = getBtnList('warehouse_info_normal', true);
         // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList<Ermcp3AreaSpotPLReport>(qryAreaSpotplReport);
+        const { loading, tableList, queryTable } = queryTableList<Ermcp3AreaStockReport>(qryAreaStockReport);
         initData(() => {
             const { getInitTime, getInitType } = handleInitTypeAndTime();
             // 获取列表数据
-            queryTable({ cycletype: getInitType(), cycletime: getInitTime() });
+            queryTable({ cycletype: getInitType(), cycletime: getInitTime() }, { sumfields: '2' });
             // 注册表头信息 过滤
             registerColumn('table_pcweb_warehouse_category_report', []);
         });
         function update(value: TypeAndTime) {
-            queryTable(value);
+            queryTable(value, { sumfields: '2' });
         }
         // 查询
         function search(value: any) {

+ 5 - 5
src/views/report/inventory-report/list/warehouse/index.vue

@@ -21,8 +21,8 @@ import Filter from '../../components/filterTable/index.vue';
 import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList } from '@/common/export/table';
 import { queryTableList } from '../../../setup';
 import { handleInitTypeAndTime } from '@/views/report/setup';
-import { qryAreaSpotplReport } from '@/services/go/ermcp/report';
-import { Ermcp3AreaSpotPLReport } from '@/services/go/ermcp/report/interface';
+import { qryAreaSpotplReport, qryAreaStockReport } from '@/services/go/ermcp/report';
+import { Ermcp3AreaSpotPLReport, Ermcp3AreaStockReport } from '@/services/go/ermcp/report/interface';
 import { TypeAndTime } from '@/views/report/interface';
 
 export default defineComponent({
@@ -40,16 +40,16 @@ export default defineComponent({
         // // 表格操作按钮列表
         // const { commonBtn, forDataBtn } = getBtnList('warehouse_info_normal', true);
         // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList<Ermcp3AreaSpotPLReport>(qryAreaSpotplReport);
+        const { loading, tableList, queryTable } = queryTableList<Ermcp3AreaStockReport>(qryAreaStockReport);
         initData(() => {
             const { getInitTime, getInitType } = handleInitTypeAndTime();
             // 获取列表数据
-            queryTable({ cycletype: getInitType(), cycletime: getInitTime() });
+            queryTable({ cycletype: getInitType(), cycletime: getInitTime() }, { sumfields: '4' });
             // 注册表头信息 过滤
             registerColumn('table_pcweb_warehouse_category_report', []);
         });
         function update(value: TypeAndTime) {
-            queryTable(value);
+            queryTable(value, { sumfields: '4' });
         }
         // 查询
         function search(value: any) {

+ 4 - 1
src/views/report/setup.ts

@@ -91,11 +91,14 @@ export function queryTableList<T>(fn: Function) {
     const loading = ref<boolean>(false);
     // 表格数据
     const tableList = ref<T[]>([]);
-    function queryTable(value: TypeAndTime) {
+    function queryTable(value: TypeAndTime, otherParam?: object) {
         const param: FinanceReportReq = {
             querytype: 1,
             ...value
         }
+        if (otherParam) {
+            Object.assign(param, otherParam)
+        }
         queryResultLoadingAndInfo(fn, loading, param).then(res => {
             const result = res?.map((e: T, i: number) => {
                 return { ...e, key: String(i) };