huangbin %!s(int64=4) %!d(string=hai) anos
pai
achega
a4c2515272

+ 12 - 4
src/router/index.ts

@@ -551,12 +551,20 @@ const routes: Array<RouteRecordRaw> = [
                 meta: {
                     requireAuth: true,
                 },
-                redirect: { name: 'inventory_report_inventory' },
+                redirect: { name: 'inventory_report_inventory_category' },
                 children: [
                     {
-                        path: '/inventory_report/inventory',
-                        name: 'inventory_report_inventory',
-                        component: () => import('@/views/report/inventory-report/list/inventory_report_inventory/index.vue'),
+                        path: '/inventory_report/category',
+                        name: 'inventory_report_inventory_category',
+                        component: () => import('@/views/report/inventory-report/list/category/index.vue'),
+                        meta: {
+                            requireAuth: true,
+                        },
+                    },
+                    {
+                        path: '/inventory_report/warehouse',
+                        name: 'inventory_report_warehouse',
+                        component: () => import('@/views/report/inventory-report/list/warehouse/index.vue'),
                         meta: {
                             requireAuth: true,
                         },

+ 6 - 7
src/services/go/ermcp/report/index.ts

@@ -1,19 +1,18 @@
 /***********************   报表相关 *********************/
+import { getUserId } from "@/services/bus/account";
+import { commonSearch_go } from "@/services/go";
 import {
     AreaExpourseReportReq,
     AreaSpotplReportReq, AreaStockReportReq, Ermcp3AreaSpotPLReport, Ermcp3AreaStockReport, Ermcp3ExpourseReport,
     Ermcp3FinanceReport, FinanceReportReq
 } from "@/services/go/ermcp/report/interface";
-import {getUserId} from "@/services/bus/account";
-import APP from "@/services";
-import {commonSearch_go} from "@/services/go";
 
 /**
  * 查询敞口报表 /Ermcp3/QryAreaExpourseReport
  * @param req.userid
  * @param req.querytype  查询类型 1-日报表 2-周期报表 3-日报表(指定时间段[开始交易日,结束交易日]) 4-日报表明细
  */
-export function qryAreaExpourseReport(req: AreaExpourseReportReq): Promise<Ermcp3ExpourseReport>{
+export function qryAreaExpourseReport(req: AreaExpourseReportReq): Promise<Ermcp3ExpourseReport[]> {
     req.userid = getUserId()
     return commonSearch_go('/Ermcp3/QryAreaExpourseReport', req).catch((err) => {
         throw new Error(`查询敞口报表: ${err.message}`);
@@ -23,7 +22,7 @@ export function qryAreaExpourseReport(req: AreaExpourseReportReq): Promise<Ermcp
 /**
  *  查询现货报表 /Ermcp3/QryAreaSpotplReport
  */
-export function qryAreaSpotplReport(req: AreaSpotplReportReq): Promise<Ermcp3AreaSpotPLReport>{
+export function qryAreaSpotplReport(req: AreaSpotplReportReq): Promise<Ermcp3AreaSpotPLReport[]> {
     req.userid = getUserId()
     return commonSearch_go('/Ermcp3/QryAreaSpotplReport', req).catch((err) => {
         throw new Error(`查询现货报表: ${err.message}`);
@@ -34,7 +33,7 @@ export function qryAreaSpotplReport(req: AreaSpotplReportReq): Promise<Ermcp3Are
  * 查询库存报表 /Ermcp3/QryAreaStockReport
  * @param req
  */
-export function qryAreaStockReport(req: AreaStockReportReq): Promise<Ermcp3AreaStockReport>{
+export function qryAreaStockReport(req: AreaStockReportReq): Promise<Ermcp3AreaStockReport[]> {
     req.userid = getUserId()
     return commonSearch_go('/Ermcp3/QryAreaStockReport', req).catch((err) => {
         throw new Error(`查询库存报表: ${err.message}`);
@@ -45,7 +44,7 @@ export function qryAreaStockReport(req: AreaStockReportReq): Promise<Ermcp3AreaS
  * 查询财务报表 /Ermcp3/QryFinanceReport
  * @param req
  */
-export function qryFinanceReport(req: FinanceReportReq): Promise<Ermcp3FinanceReport>{
+export function qryFinanceReport(req: FinanceReportReq): Promise<Ermcp3FinanceReport[]> {
     req.userid = getUserId()
     return commonSearch_go('/Ermcp3/QryFinanceReport', req).catch((err) => {
         throw new Error(`查询财务报表: ${err.message}`);

+ 190 - 190
src/services/go/ermcp/report/interface.ts

@@ -12,70 +12,70 @@ export interface AreaExpourseReportReq {
 /**
  *  敞口报表 信息返回
  */
-export interface Ermcp3ExpourseReport{
-    accountid	:number;//期货账户ID (作废, 默认为number;
-//)
-    accountname	:string;//机构名称
-    arbitrageqty	:number;//套利量
-    areauserid	:number;//所属机构\交易用户ID
-    begindate	:string;//开始交易日
-    buyfutureqty	:number;//买入期货数量
-    buyplanqty	:number;//采购计划数量
-    buypricedqty	:number;//采购合同已定价数量
-    cycletime	:string;//周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(number;
-//)【原值】
-    cycletype	:number;//周期类型 - 1:月 2:季 3:年 4:周 5:全报表【原值】
-    diffexposure	:number;//变动量(套保敞口)
-    difffutuqty	:number;//变动量(期货)
-    diffhedgeqty	:number;//变动量(现货应套保总量)
-    diffmgqtya	:number;//套保变动量
-    diffmgqtyb	:number;//套利变动量
-    diffqty	:number;//变动量(总敞口)
-    diffspotqty	:number;//变动量(现货)
-    enddate	:string;//结束交易日
-    enumdicname	:string;//单位名称
-    hedgeqty	:number;//套保量
-    mgneedhedgeratio	:number;//套保比例(套保品的)
-    middlegoodsid	:number;//套保品种ID
-    middlegoodsname	:string;//套保商品名称
-    middlgoodscode	:string;//套保商品代码
-    needarbitrageqty	:number;//应套利量
-    needarbitrageratio	:number;//套利比例(套保品的)
-    needhedgeexposoure	:number;//应套保敞口(套保敞口)
-    needhedgeqty	:number;//应套保量
-    needhedgeratio	:number;//应套保敞口比例
-    oriarbitrageqty	:number;//期初套利量
-    oribuyfutureqty	:number;//期初买入期货数量
-    oribuyplanqty	:number;//期初采购计划数量
-    oribuypricedqty	:number;//期初采购合同已定价数量
-    orihedgeqty	:number;//期初套保量
-    orineedarbitrageqty	:number;//期初应套利量
-    orineedhedgeexposoure	:number;//期初应套保敞口
-    orineedhedgeqty	:number;//期初应套保量
-    orisellfutureqty	:number;//期初卖出期货数量
-    orisellplanqty	:number;//期初销售计划数量
-    orisellpricedqty	:number;//期初销售合同已定价数量
-    oritotalexposure	:number;//期初实时总敞口
-    oritotalfutureqty	:number;//期初期货头寸总量
-    oritotalneedhedgeqty	:number;//期初应套保总量
-    oritotalspotqty	:number;//期初现货头寸总量
-    reckondate	:string;//日照时期(yyyyMMdd)
-    sellfutureqty	:number;//卖出期货数量
-    sellplanqty	:number;//销售计划数量
-    sellpricedqty	:number;//销售合同已定价数量
-    totalexposure	:number;//实时总敞口(总敞口)
-    totalfutureqty	:number;//期货头寸总量(期货总量)
-    totalhedgeratio	:number;//敞口比例
-    totalneedhedgeqty	:number;//应套保总量(现货应套保总量)
-    totalspotqty	:number;//现货头寸总量
-    unitid	:number;//单位id
-    updatetime	:string;//更新时间
+export interface Ermcp3ExpourseReport {
+    accountid: number;//期货账户ID (作废, 默认为number;
+    //)
+    accountname: string;//机构名称
+    arbitrageqty: number;//套利量
+    areauserid: number;//所属机构\交易用户ID
+    begindate: string;//开始交易日
+    buyfutureqty: number;//买入期货数量
+    buyplanqty: number;//采购计划数量
+    buypricedqty: number;//采购合同已定价数量
+    cycletime: string;//周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(number;
+    //)【原值】
+    cycletype: number;//周期类型 - 1:月 2:季 3:年 4:周 5:全报表【原值】
+    diffexposure: number;//变动量(套保敞口)
+    difffutuqty: number;//变动量(期货)
+    diffhedgeqty: number;//变动量(现货应套保总量)
+    diffmgqtya: number;//套保变动量
+    diffmgqtyb: number;//套利变动量
+    diffqty: number;//变动量(总敞口)
+    diffspotqty: number;//变动量(现货)
+    enddate: string;//结束交易日
+    enumdicname: string;//单位名称
+    hedgeqty: number;//套保量
+    mgneedhedgeratio: number;//套保比例(套保品的)
+    middlegoodsid: number;//套保品种ID
+    middlegoodsname: string;//套保商品名称
+    middlgoodscode: string;//套保商品代码
+    needarbitrageqty: number;//应套利量
+    needarbitrageratio: number;//套利比例(套保品的)
+    needhedgeexposoure: number;//应套保敞口(套保敞口)
+    needhedgeqty: number;//应套保量
+    needhedgeratio: number;//应套保敞口比例
+    oriarbitrageqty: number;//期初套利量
+    oribuyfutureqty: number;//期初买入期货数量
+    oribuyplanqty: number;//期初采购计划数量
+    oribuypricedqty: number;//期初采购合同已定价数量
+    orihedgeqty: number;//期初套保量
+    orineedarbitrageqty: number;//期初应套利量
+    orineedhedgeexposoure: number;//期初应套保敞口
+    orineedhedgeqty: number;//期初应套保量
+    orisellfutureqty: number;//期初卖出期货数量
+    orisellplanqty: number;//期初销售计划数量
+    orisellpricedqty: number;//期初销售合同已定价数量
+    oritotalexposure: number;//期初实时总敞口
+    oritotalfutureqty: number;//期初期货头寸总量
+    oritotalneedhedgeqty: number;//期初应套保总量
+    oritotalspotqty: number;//期初现货头寸总量
+    reckondate: string;//日照时期(yyyyMMdd)
+    sellfutureqty: number;//卖出期货数量
+    sellplanqty: number;//销售计划数量
+    sellpricedqty: number;//销售合同已定价数量
+    totalexposure: number;//实时总敞口(总敞口)
+    totalfutureqty: number;//期货头寸总量(期货总量)
+    totalhedgeratio: number;//敞口比例
+    totalneedhedgeqty: number;//应套保总量(现货应套保总量)
+    totalspotqty: number;//现货头寸总量
+    unitid: number;//单位id
+    updatetime: string;//更新时间
 }
 
 /**
  * 查询现货报表
  */
-export interface AreaSpotplReportReq{
+export interface AreaSpotplReportReq {
     userid: number,  //       用户ID
     querytype: number, //     查询类型 1-报表 2-报表明细
     cycletime: string,//      周期时间 日(YYYYMMDD) 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYMMDD周内任意一天) 全(0)【原值】
@@ -89,67 +89,67 @@ export interface AreaSpotplReportReq{
 /**
  * 查询现货报表返回
  */
-export interface Ermcp3AreaSpotPLReport{
-    accountid	:number;//期货账户ID (作废, 默认为number;
-//)
-    accountname	:string;//机构名称
-    actualpl	:number;//现货损益
-    areauserid	:number;//所属机构\交易用户ID
-    begindate	:string;//开始交易日
-    biztype	:number;//业务类型 - 1:套保 2:套利
-    brandname	:string;//品牌名称
-    curamount	:number;//期末额
-    curaverageprice	:number;//期末均价
-    curbuyamount	:number;//期末采购总额
-    curbuyqty	:number;//期末采购总量
-    curmarketvalue	:number;//参考市值(期末市值)
-    curqty	:number;//期末量
-    currencyid	:number;//结算币种ID【原值】
-    currencyname	:string;//币种名称
-    cursellamount	:number;//期末销售总额
-    cursellqty	:number;//期末销售总量
-    curspotprice	:number;//参考市价(最新价)
-    cycletime	:string;//周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(number;
-//)【原值】
-    cycletype	:number;//周期类型 - 1:月 2:季 3:年 4:周 5:全报表【原值】
-    deliverygoodscode	:string;//现货商品代码
-    deliverygoodsid	:number;//现货品种ID
-    deliverygoodsname	:string;//现货商品名称
-    enddate	:string;//结束交易日
-    enumdicname	:string;//现货商品单位名称
-    floatpl	:number;//浮动损益
-    goodsunitid	:number;//现货商品单位id
-    oriamount	:number;//期初额
-    oriaverageprice	:number;//期初均价
-    oribuyamount	:number;//期初采购总额
-    oribuyqty	:number;//期初采购总量
-    oriqty	:number;//期初量
-    orisellamount	:number;//期初销售总额
-    orisellqty	:number;//期初销售总量
-    reckondate	:string;//日照时期(yyyyMMdd)
-    spotgoodsbrandid	:number;//现货品牌ID
-    todaybuyamount	:number;//今日采购额(今采购额)
-    todaybuyaverageprice	:number;//今日采购均价
-    todaybuyqty	:number;//今日采购量(今采购量)
-    todayinqty	:number;//今日入库量(今入库量)
-    todayoutqty	:number;//今日出库量(今出库量)
-    todaysellamount	:number;//今日销售额(今销售额)
-    todaysellaverageprice	:number;//今日销售均价
-    todaysellqty	:number;//今日销售量(今销售量)
-    unitid	:number;//品类单位id
-    unitidname	:string;//品类单位名称
-    updatetime	:string;//更新时间
-    wrfactortypeid	:number;//仓单要素类型ID(212+Unix秒时间戳(1number;
-//位)+xxxxxx)
-    wrstandardcode	:string;//品类代码
-    wrstandardid	:number;//现货品类ID
-    wrstandardname	:string;//品类名称
+export interface Ermcp3AreaSpotPLReport {
+    accountid: number;//期货账户ID (作废, 默认为number;
+    //)
+    accountname: string;//机构名称
+    actualpl: number;//现货损益
+    areauserid: number;//所属机构\交易用户ID
+    begindate: string;//开始交易日
+    biztype: number;//业务类型 - 1:套保 2:套利
+    brandname: string;//品牌名称
+    curamount: number;//期末额
+    curaverageprice: number;//期末均价
+    curbuyamount: number;//期末采购总额
+    curbuyqty: number;//期末采购总量
+    curmarketvalue: number;//参考市值(期末市值)
+    curqty: number;//期末量
+    currencyid: number;//结算币种ID【原值】
+    currencyname: string;//币种名称
+    cursellamount: number;//期末销售总额
+    cursellqty: number;//期末销售总量
+    curspotprice: number;//参考市价(最新价)
+    cycletime: string;//周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(number;
+    //)【原值】
+    cycletype: number;//周期类型 - 1:月 2:季 3:年 4:周 5:全报表【原值】
+    deliverygoodscode: string;//现货商品代码
+    deliverygoodsid: number;//现货品种ID
+    deliverygoodsname: string;//现货商品名称
+    enddate: string;//结束交易日
+    enumdicname: string;//现货商品单位名称
+    floatpl: number;//浮动损益
+    goodsunitid: number;//现货商品单位id
+    oriamount: number;//期初额
+    oriaverageprice: number;//期初均价
+    oribuyamount: number;//期初采购总额
+    oribuyqty: number;//期初采购总量
+    oriqty: number;//期初量
+    orisellamount: number;//期初销售总额
+    orisellqty: number;//期初销售总量
+    reckondate: string;//日照时期(yyyyMMdd)
+    spotgoodsbrandid: number;//现货品牌ID
+    todaybuyamount: number;//今日采购额(今采购额)
+    todaybuyaverageprice: number;//今日采购均价
+    todaybuyqty: number;//今日采购量(今采购量)
+    todayinqty: number;//今日入库量(今入库量)
+    todayoutqty: number;//今日出库量(今出库量)
+    todaysellamount: number;//今日销售额(今销售额)
+    todaysellaverageprice: number;//今日销售均价
+    todaysellqty: number;//今日销售量(今销售量)
+    unitid: number;//品类单位id
+    unitidname: string;//品类单位名称
+    updatetime: string;//更新时间
+    wrfactortypeid: number;//仓单要素类型ID(212+Unix秒时间戳(1number;
+    //位)+xxxxxx)
+    wrstandardcode: string;//品类代码
+    wrstandardid: number;//现货品类ID
+    wrstandardname: string;//品类名称
 }
 
 /**
  * 查询库存报表请求
  */
-export interface AreaStockReportReq{
+export interface AreaStockReportReq {
     userid: number //                用户ID
     querytype: number //             查询类型 1-报表 2-报表明细
     cycletime: string //             周期时间 日(YYYYMMDD) 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYMMDD周内任意一天) 全(0)【原值】
@@ -165,47 +165,47 @@ export interface AreaStockReportReq{
 /**
  * 查询库存报表返回
  */
-export interface Ermcp3AreaStockReport{
-    begindate	:string;//开始交易日
-    brandname	:string;//品牌名称
-    curstock	:number;//期末库存量
-    cycletime	:string;//周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(number;
-//)【原值】
-    cycletype	:number;//周期类型 - 1:月 2:季 3:年 4:周 5:全报表【原值】
-    deliverygoodscode	:string;//现货品种代码
-    deliverygoodsid	:number;//现货品种id
-    deliverygoodsname	:string;//现货品种名称
-    diffqty	:number;//库存变化量 = 期末 - 期初
-    enddate	:string;//结束交易日
-    enumdicname	:string;//单位名称
-    goodsunitid	:number;//现货单位id
-    oristock	:number;//期初库存量
-    reckondate	:string;//日照时期(yyyyMMdd)
-    spotgoodsbrandid	:number;//现货品牌ID
-    todaybuyinqty	:number;//今采购入库量
-    todayproduceinqty	:number;//今内部入库量
-    todayproduceoutqty	:number;//今内部出库量
-    todayselloutqty	:number;//今销售出库量
-    unbuyinqty	:number;//采购未入库量(数据库未找到相关字段?)
-    unitid	:number;//品类单位id
-    unselloutqty	:number;//销售未出库量(数据库未找到相关字段?)
-    updatetime	:string;//更新时间
-    userid	:number;//机构ID
-    username	:string;//机构名称
-    warehousecode	:string;//仓库代码
-    warehouseinfoid	:string;//仓库ID
-    warehousename	:string;//仓库名称
-    warehousetype	:number;//仓库类型 - 1 厂库 2 自有库 3 合作库
-    wrstandardcode	:string;//品类代码
-    wrstandardid	:number;//品类ID
-    wrstandardname	:string;//品类名称
+export interface Ermcp3AreaStockReport {
+    begindate: string;//开始交易日
+    brandname: string;//品牌名称
+    curstock: number;//期末库存量
+    cycletime: string;//周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(number;
+    //)【原值】
+    cycletype: number;//周期类型 - 1:月 2:季 3:年 4:周 5:全报表【原值】
+    deliverygoodscode: string;//现货品种代码
+    deliverygoodsid: number;//现货品种id
+    deliverygoodsname: string;//现货品种名称
+    diffqty: number;//库存变化量 = 期末 - 期初
+    enddate: string;//结束交易日
+    enumdicname: string;//单位名称
+    goodsunitid: number;//现货单位id
+    oristock: number;//期初库存量
+    reckondate: string;//日照时期(yyyyMMdd)
+    spotgoodsbrandid: number;//现货品牌ID
+    todaybuyinqty: number;//今采购入库量
+    todayproduceinqty: number;//今内部入库量
+    todayproduceoutqty: number;//今内部出库量
+    todayselloutqty: number;//今销售出库量
+    unbuyinqty: number;//采购未入库量(数据库未找到相关字段?)
+    unitid: number;//品类单位id
+    unselloutqty: number;//销售未出库量(数据库未找到相关字段?)
+    updatetime: string;//更新时间
+    userid: number;//机构ID
+    username: string;//机构名称
+    warehousecode: string;//仓库代码
+    warehouseinfoid: string;//仓库ID
+    warehousename: string;//仓库名称
+    warehousetype: number;//仓库类型 - 1 厂库 2 自有库 3 合作库
+    wrstandardcode: string;//品类代码
+    wrstandardid: number;//品类ID
+    wrstandardname: string;//品类名称
 }
 
 /**
  * 查询财务报表请求
  */
-export interface FinanceReportReq{
-    userid: number //        用户ID
+export interface FinanceReportReq {
+    userid?: number //        用户ID
     querytype: number //     查询类型 1-报表 2-报表明细
     cycletype: number//      周期类型 - 0:日 1:月 2:季 3:年 4:周 5:全报表【原值】
     cycletime: string//      周期时间 日(YYYYMMDD) 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYMMDD周内任意一天) 全(0)【原值】
@@ -215,45 +215,45 @@ export interface FinanceReportReq{
 /**
  * 财务报表回应
  */
-export interface Ermcp3FinanceReport{
-    accountname	:string;//机构名称
-    areauserid	:number;//所属机构\交易用户ID
-    begindate	:string;//开始交易日
-    biztype	:number;//业务类型 - 1:套保 2:套利
-    brandname	:string;//品牌名称
-    buypreinvoicedamount	:number;//采购预收票额(预收票额)
-    buyprepaidamount	:number;//采购预付款额(预付货款额)
-    buytodayinvoiceamount	:number;//采购今收票额(今收票额)
-    buytodayrefundamount	:number;//采购今收退款额(今收退款额)
-    buytodaysettleamount	:number;//采购今付款额(今付货款额)
-    buyuninvoicedamount	:number;//采购应收票额(应收票额)
-    buyunpaidamount	:number;//采购应付款额(应付货款额)
-    currencyid	:number;//结算币种ID
-    currencyname	:string;//币种名称
-    cycletime	:string;//周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(number;
-//)【原值】
-    cycletype	:number;//周期类型 - 1:月 2:季 3:年 4:周 5:全报表【原值】
-    deliverygoodscode	:string;//现货品种代码
-    deliverygoodsid	:number;//现货品种ID
-    deliverygoodsname	:string;//现货品种名称
-    enddate	:string;//结束交易日
-    reckondate	:string;//日照时期(yyyyMMdd)
-    sellpreinvoicedamount	:number;//销售预开票额(预开票额)
-    sellprepaidamount	:number;//销售预收款额(预收货款额)
-    selltodayinvoiceamount	:number;//销售今开票额(今开票额)
-    selltodayrefundamount	:number;//销售今付退款额(今付退款额)
-    selltodaysettleamount	:number;//销售今收款额(今收货款额)
-    selluninvoicedamount	:number;//销售应开票额(应开票额)
-    sellunpaidamount	:number;//销售应收款额(应收货款额)
-    spotgoodsbrandid	:number;//现货品牌ID
-    todaypaysum	:number;//今付款合计
-    todayreceivesum	:number;//今收款合计
-    updatetime	:string;//更新时间
-    wrfactortypeid	:number;//仓单要素类型ID(212+Unix秒时间戳(1number;
-//位)+xxxxxx)
-    wrstandardcode	:string;//品类代码
-    wrstandardid	:number;//现货商品ID
-    wrstandardname	:string;//品类名称
+export interface Ermcp3FinanceReport {
+    accountname: string;//机构名称
+    areauserid: number;//所属机构\交易用户ID
+    begindate: string;//开始交易日
+    biztype: number;//业务类型 - 1:套保 2:套利
+    brandname: string;//品牌名称
+    buypreinvoicedamount: number;//采购预收票额(预收票额)
+    buyprepaidamount: number;//采购预付款额(预付货款额)
+    buytodayinvoiceamount: number;//采购今收票额(今收票额)
+    buytodayrefundamount: number;//采购今收退款额(今收退款额)
+    buytodaysettleamount: number;//采购今付款额(今付货款额)
+    buyuninvoicedamount: number;//采购应收票额(应收票额)
+    buyunpaidamount: number;//采购应付款额(应付货款额)
+    currencyid: number;//结算币种ID
+    currencyname: string;//币种名称
+    cycletime: string;//周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(number;
+    //)【原值】
+    cycletype: number;//周期类型 - 1:月 2:季 3:年 4:周 5:全报表【原值】
+    deliverygoodscode: string;//现货品种代码
+    deliverygoodsid: number;//现货品种ID
+    deliverygoodsname: string;//现货品种名称
+    enddate: string;//结束交易日
+    reckondate: string;//日照时期(yyyyMMdd)
+    sellpreinvoicedamount: number;//销售预开票额(预开票额)
+    sellprepaidamount: number;//销售预收款额(预收货款额)
+    selltodayinvoiceamount: number;//销售今开票额(今开票额)
+    selltodayrefundamount: number;//销售今付退款额(今付退款额)
+    selltodaysettleamount: number;//销售今收款额(今收货款额)
+    selluninvoicedamount: number;//销售应开票额(应开票额)
+    sellunpaidamount: number;//销售应收款额(应收货款额)
+    spotgoodsbrandid: number;//现货品牌ID
+    todaypaysum: number;//今付款合计
+    todayreceivesum: number;//今收款合计
+    updatetime: string;//更新时间
+    wrfactortypeid: number;//仓单要素类型ID(212+Unix秒时间戳(1number;
+    //位)+xxxxxx)
+    wrstandardcode: string;//品类代码
+    wrstandardid: number;//现货商品ID
+    wrstandardname: string;//品类名称
 }
 
 

+ 54 - 0
src/views/report/components/filter/index.vue

@@ -0,0 +1,54 @@
+<template>
+  <!-- 过滤客户资料表格 -->
+  <div class="filterTable">
+    <div class="filter-custom-table">
+      <a-select label-in-value
+                class="conditionSelect"
+                style="width: 120px"
+                v-model:value="selectedReportType"
+                @change="reportTypeChange"
+                placeholder="请选择报表类型">
+        <a-select-option v-for="item in reportType"
+                         :key="item.value">
+          {{item.lable}}
+        </a-select-option>
+      </a-select>
+      <a-space direction="vertical">
+        <a-month-picker v-model:value="time"
+                        v-if="isMonth()" />
+        <a-date-picker v-model:value="time"
+                       v-else
+                       @change="timeChange"
+                       :format="dateFormat" />
+      </a-space>
+      <slot></slot>
+    </div>
+  </div>
+</template>
+
+<script lang="ts">
+import FilterOption from '@/common/components/filter/index.vue';
+import { defineComponent } from 'vue';
+import { handleReprotType } from '../../setup';
+
+export default defineComponent({
+    name: 'report-common-filter-table',
+    components: { FilterOption },
+    setup(props, context) {
+        const { selectedReportType, reportType, reportTypeChange, isMonth, timeChange, dateFormat, time } = handleReprotType(context);
+        return {
+            reportType,
+            selectedReportType,
+            dateFormat,
+            timeChange,
+            reportTypeChange,
+            isMonth,
+            time,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+</style>;
+

+ 17 - 0
src/views/report/enum.ts

@@ -0,0 +1,17 @@
+// 报表周期类型 
+export enum reportCycleType {
+    day, // 日
+    month, // 月
+    season, // 季
+    year, // 年
+    week, // 周
+}
+
+// 报表周期时间格式类型
+export enum reportCyleTimeType {
+    day = 'YYYYMMDD', // 日
+    month = 'YYYYMM', // 月
+    season = 'YYYYQ', // 季
+    year = 'YYYY', // 年
+    week = 'YYYYMMDD' // 周
+}

+ 8 - 39
src/views/report/exposure-report/components/filterTable/index.vue

@@ -1,55 +1,29 @@
 <template>
   <!-- 过滤客户资料表格 -->
-  <div class="filterTable">
-    <div class="filter-custom-table">
-      <a-select label-in-value
-                class="conditionSelect"
-                style="width: 120px"
-                v-model:value="selectedReportType"
-                @change="update"
-                placeholder="请选择报表类型">
-        <a-select-option v-for="item in reportType"
-                         :key="item.value">
-          {{item.lable}}
-        </a-select-option>
-      </a-select>
-      <a-space direction="vertical">
-        <a-date-picker v-model:value="date"
-                       @change="update"
-                       :format="dateFormat" />
-      </a-space>
-      <!-- <FilterOption :selectList="selectList"
+  <Filter @update="update">
+    <!-- <FilterOption :selectList="selectList"
                     :inputList="[]"
                     :fixedBtnList="fixedBtnList" /> -->
-    </div>
-  </div>
+  </Filter>
 </template>
 
 <script lang="ts">
 import FilterOption from '@/common/components/filter/index.vue';
 import { defineComponent } from 'vue';
-import { handleReprotType } from '../../../setup';
 import { ref } from 'vue';
-import { Moment } from 'moment';
-import moment from 'moment';
 import { handleFilter, SelectList } from '@/common/setup/filter';
-import { initData } from '@/common/methods';
 import { handlerManagerList } from '@/common/setup/user';
 import { QueryMiddleGoodsDetail } from '@/services/go/ermcp/goodsInfo';
 import { SelectOption } from '@/common/setup/filter/interface';
+import Filter from '../../../components/filter/index.vue';
+import { TypeAndTime } from '@/views/report/interface';
 
 export default defineComponent({
     name: 'exposure-filter-table',
-    components: { FilterOption },
+    components: { FilterOption, Filter },
     setup(props, context) {
-        const { selectedReportType, reportType } = handleReprotType();
-
-        const dateFormat = 'YYYYMMDD';
-        const date = ref<Moment>(moment(new Date(), 'YYYYMMDD'));
-
-        function update() {
-            const obj = { type: selectedReportType.value.key, date: moment(date.value).format(dateFormat) };
-            context.emit('update', obj);
+        function update(value: TypeAndTime) {
+            context.emit('update', value);
         }
         const select: SelectList[] = [
             {
@@ -102,14 +76,9 @@ export default defineComponent({
         //     });
         // });
         return {
-            reportType,
-            selectedReportType,
             selectList,
             inputList,
             fixedBtnList,
-            date,
-            dateFormat,
-            update,
         };
     },
 });

+ 10 - 6
src/views/report/exposure-report/list/exposure_report/index.vue

@@ -19,8 +19,11 @@
 <script lang="ts">
 import Filter from '../../components/filterTable/index.vue';
 import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList } from '@/common/export/table';
-import { queryTableList } from './setup';
-import moment from 'moment';
+import { queryTableList } from '../../../setup';
+import { TypeAndTime } from '@/views/report/interface';
+import { handleInitTypeAndTime } from '@/views/report/setup';
+import { Ermcp3ExpourseReport } from '@/services/go/ermcp/report/interface';
+import { qryAreaExpourseReport } from '@/services/go/ermcp/report';
 export default defineComponent({
     name: 'exposure-report',
     components: {
@@ -36,15 +39,16 @@ export default defineComponent({
         // // 表格操作按钮列表
         // const { commonBtn, forDataBtn } = getBtnList('warehouse_info_normal', true);
         // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList();
+        const { loading, tableList, queryTable } = queryTableList<Ermcp3ExpourseReport>(qryAreaExpourseReport);
         initData(() => {
+            const { getInitTime, getInitType } = handleInitTypeAndTime();
             // 获取列表数据
-            queryTable(moment().format('YYYYMMDD'));
+            queryTable({ cycletype: getInitType(), cycletime: getInitTime() });
             // 注册表头信息 过滤
             registerColumn('table_pcweb_finance_report', []);
         });
-        function update(value: { type: '1' | '2' | '3'; date: string }) {
-            queryTable(value.date);
+        function update(value: TypeAndTime) {
+            queryTable(value);
         }
         // 查询
         function search(value: any) {

+ 0 - 29
src/views/report/exposure-report/list/exposure_report/setup.ts

@@ -1,29 +0,0 @@
-import { queryResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
-import { QueryExposureDayReport } from '@/services/go/ermcp/exposure-report/index';
-import { QueryExposureDayReportRsp } from '@/services/go/ermcp/exposure-report/interface';
-import { QueryFinanceDayReportRsp } from '@/services/go/ermcp/finance-report/interface';
-import { ref } from 'vue';
-
-
-/**
- * 获取表格列表数据
- * @param type 
- * @returns 
- */
-export function queryTableList() {
-    // 加载状态
-    const loading = ref<boolean>(false);
-    // 表格数据
-    const tableList = ref<QueryExposureDayReportRsp[]>([]);
-
-    function queryTable(tradedate: string) {
-        queryResultLoadingAndInfo(QueryExposureDayReport, loading, tradedate).then(res => {
-            tableList.value = res.map((e: QueryFinanceDayReportRsp, i: number) => {
-                return { ...e, key: String(i) };
-            });
-        })
-    }
-    return { loading, tableList, queryTable }
-}
-
-

+ 9 - 40
src/views/report/finance-report/components/filterTable/index.vue

@@ -1,55 +1,29 @@
 <template>
   <!-- 过滤客户资料表格 -->
-  <div class="filterTable">
-    <div class="filter-custom-table">
-      <a-select label-in-value
-                class="conditionSelect"
-                style="width: 120px"
-                v-model:value="selectedReportType"
-                @change="update"
-                placeholder="请选择报表类型">
-        <a-select-option v-for="item in reportType"
-                         :key="item.value">
-          {{item.lable}}
-        </a-select-option>
-      </a-select>
-      <a-space direction="vertical">
-        <a-date-picker v-model:value="date"
-                       @change="update"
-                       :format="dateFormat" />
-      </a-space>
-      <!-- <FilterOption :selectList="selectList"
+  <Filter @update="update">
+    <!-- <FilterOption :selectList="selectList"
                     :inputList="[]"
                     :fixedBtnList="fixedBtnList" /> -->
-    </div>
-  </div>
+  </Filter>
 </template>
 
 <script lang="ts">
 import FilterOption from '@/common/components/filter/index.vue';
 import { defineComponent } from 'vue';
-import { handleReprotType } from '../../../setup';
 import { ref } from 'vue';
-import { Moment } from 'moment';
-import moment from 'moment';
 import { handleFilter, SelectList } from '@/common/setup/filter';
-import { initData } from '@/common/methods';
 import { handlerManagerList } from '@/common/setup/user';
 import { QueryMiddleGoodsDetail } from '@/services/go/ermcp/goodsInfo';
 import { SelectOption } from '@/common/setup/filter/interface';
+import Filter from '../../../components/filter/index.vue';
+import { TypeAndTime } from '@/views/report/interface';
 
 export default defineComponent({
-    name: 'finance-filter-table',
-    components: { FilterOption },
+    name: 'exposure-filter-table',
+    components: { FilterOption, Filter },
     setup(props, context) {
-        const { selectedReportType, reportType } = handleReprotType();
-
-        const dateFormat = 'YYYYMMDD';
-        const date = ref<Moment>(moment(new Date(), 'YYYYMMDD'));
-
-        function update() {
-            const obj = { type: selectedReportType.value.key, date: moment(date.value).format(dateFormat) };
-            context.emit('update', obj);
+        function update(value: TypeAndTime) {
+            context.emit('update', value);
         }
         const select: SelectList[] = [
             {
@@ -102,14 +76,9 @@ export default defineComponent({
         //     });
         // });
         return {
-            reportType,
-            selectedReportType,
             selectList,
             inputList,
             fixedBtnList,
-            date,
-            dateFormat,
-            update,
         };
     },
 });

+ 10 - 6
src/views/report/finance-report/list/finance_report_finance/index.vue

@@ -19,8 +19,11 @@
 <script lang="ts">
 import Filter from '../../components/filterTable/index.vue';
 import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList } from '@/common/export/table';
-import { queryTableList } from './setup';
-import moment from 'moment';
+import { queryTableList } from '../../../setup';
+import { TypeAndTime } from '@/views/report/interface';
+import { handleInitTypeAndTime } from '@/views/report/setup';
+import { Ermcp3FinanceReport } from '@/services/go/ermcp/report/interface';
+import { qryFinanceReport } from '@/services/go/ermcp/report';
 
 export default defineComponent({
     name: 'finance-report',
@@ -37,15 +40,16 @@ export default defineComponent({
         // // 表格操作按钮列表
         // const { commonBtn, forDataBtn } = getBtnList('warehouse_info_normal', true);
         // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList();
+        const { loading, tableList, queryTable } = queryTableList<Ermcp3FinanceReport>(qryFinanceReport);
         initData(() => {
+            const { getInitTime, getInitType } = handleInitTypeAndTime();
             // 获取列表数据
-            queryTable(moment().format('YYYYMMDD'), '1');
+            queryTable({ cycletype: getInitType(), cycletime: getInitTime() });
             // 注册表头信息 过滤
             registerColumn('table_pcweb_report_expose', []);
         });
-        function update(value: { type: '1' | '2' | '3'; date: string }) {
-            queryTable(value.date, value.type);
+        function update(value: TypeAndTime) {
+            queryTable(value);
         }
         // 查询
         function search(value: any) {

+ 0 - 41
src/views/report/finance-report/list/finance_report_finance/setup.ts

@@ -1,41 +0,0 @@
-import { queryResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
-import { QueryFinanceDayReport, QueryFinanceMonthReport } from '@/services/go/ermcp/finance-report';
-import { QueryFinanceDayReportRsp } from '@/services/go/ermcp/finance-report/interface';
-import { ref } from 'vue';
-
-
-/**
- * 获取表格列表数据
- * @param type 
- * @returns 
- */
-export function queryTableList() {
-    // 加载状态
-    const loading = ref<boolean>(false);
-    // 表格数据
-    const tableList = ref<QueryFinanceDayReportRsp[]>([]);
-
-    function queryTable(tradedate: string, type: '1' | '2' | '3') {
-        let fn: any = QueryFinanceDayReport
-        switch (type) {
-            case '1':
-                fn = QueryFinanceDayReport
-                break;
-            case '2':
-                fn = QueryFinanceDayReport
-                break;
-            case '3':
-                fn = QueryFinanceMonthReport
-                break;
-        }
-        queryResultLoadingAndInfo(fn, loading, tradedate).then(res => {
-            const result = res?.map((e: QueryFinanceDayReportRsp, i: number) => {
-                return { ...e, key: String(i) };
-            });
-            tableList.value = result ? result : []
-        })
-    }
-    return { loading, tableList, queryTable }
-}
-
-

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

@@ -0,0 +1,11 @@
+import { reportCycleType } from './enum';
+
+export interface Value {
+    key: reportCycleType;
+    label?: string;
+}
+
+export interface TypeAndTime {
+    cycletype: number//      周期类型 - 0:日 1:月 2:季 3:年 4:周 5:全报表【原值】
+    cycletime: string//      周期时间 日(YYYYMMDD) 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYMMDD周内任意一天) 全(0)【原值】
+}

+ 67 - 21
src/views/report/inventory-report/components/filterTable/index.vue

@@ -1,39 +1,84 @@
 <template>
   <!-- 过滤客户资料表格 -->
-  <div class="filterTable">
-    <FilterOption :selectList="selectList"
-                  :inputList="inputList"
-                  :fixedBtnList="fixedBtnList" />
-    <slot></slot>
-  </div>
+  <Filter @update="update">
+    <!-- <FilterOption :selectList="selectList"
+                    :inputList="[]"
+                    :fixedBtnList="fixedBtnList" /> -->
+  </Filter>
 </template>
 
 <script lang="ts">
 import FilterOption from '@/common/components/filter/index.vue';
 import { defineComponent } from 'vue';
-import { handleFilter, InputList, SelectList } from '@/common/setup/filter';
+import { ref } from 'vue';
+import { handleFilter, SelectList } from '@/common/setup/filter';
+import { handlerManagerList } from '@/common/setup/user';
+import { QueryMiddleGoodsDetail } from '@/services/go/ermcp/goodsInfo';
+import { SelectOption } from '@/common/setup/filter/interface';
+import Filter from '../../../components/filter/index.vue';
+import { TypeAndTime } from '@/views/report/interface';
+
 export default defineComponent({
-    name: 'business-review-filter-table',
-    components: { FilterOption },
+    name: 'inventory-filter-table',
+    components: { FilterOption, Filter },
     setup(props, context) {
+        function update(value: TypeAndTime) {
+            context.emit('update', value);
+        }
         const select: SelectList[] = [
             {
                 value: undefined,
-                key: 'contracttype',
-                placeholder: '全部合同类型',
-                list: [
-                    { value: 1, lable: '采购' },
-                    { value: -1, lable: '销售' },
-                ],
+                key: 'userId',
+                placeholder: '全部交易用户',
+                list: [],
+            },
+            {
+                value: undefined,
+                key: 'warehousetype',
+                placeholder: '全部套保品种',
+                list: [],
             },
         ];
-        const input: InputList[] = [
-            { value: '', placeholder: '模糊搜索对手方', key: 'buyusernameOrsellusername' },
-            { value: '', placeholder: '模糊搜索合同编号', key: 'contractno' },
-            { value: '', placeholder: '模糊搜索现货品种', key: 'deliverygoodsname' },
-        ];
+        const loading = ref<boolean>(false);
+        // 交易用户
+        const { tableList: userList, queryTable } = handlerManagerList(loading, 2);
+        const { selectList, inputList, fixedBtnList, updateSelected } = handleFilter(select, [], context);
+        // 获取交易用户
+        function getUserList() {
+            return queryTable().then(() => {
+                const result: SelectOption[] = [];
+                userList.value.forEach((e) => {
+                    e.userlist.forEach((el) => {
+                        result.push({ value: el.loginid, lable: `${el.loginname}-${el.logincode}` });
+                    });
+                });
+                return result;
+            });
+        }
+        // 获取套保品种
+        function getTBList() {
+            return QueryMiddleGoodsDetail().then((res) => {
+                const result: SelectOption[] = [];
+                res.forEach((e) => {
+                    const { isvalid, middlegoodsname, middlegoodsid } = e.mg;
+                    if (isvalid) {
+                        result.push({ value: middlegoodsid, lable: middlegoodsname });
+                    }
+                });
+                return result;
+            });
+        }
+        // initData(() => {
+        //     Promise.all([getUserList(), getTBList()]).then((res) => {
+        //         select[0].list = res[0]; // 交易用户
+        //         select[1].list = res[1]; // 套保品种
+        //         updateSelected(select);
+        //     });
+        // });
         return {
-            ...handleFilter(select, input, context),
+            selectList,
+            inputList,
+            fixedBtnList,
         };
     },
 });
@@ -41,3 +86,4 @@ export default defineComponent({
 
 <style lang="less">
 </style>;
+

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

@@ -0,0 +1,81 @@
+<template>
+  <!-- 库存报表(品类) -->
+  <div class="spot-report"
+       :loading="loading">
+    <Filter @update="update"></Filter>
+    <contextMenu :contextMenuList="forDataBtn">
+      <a-table :columns="columns"
+               class="topTable hiddenFirstCol"
+               :pagination="false"
+               :expandedRowKeys="expandedRowKeys"
+               :customRow="Rowclick"
+               rowKey="key"
+               :data-source="tableList">
+      </a-table>
+    </contextMenu>
+  </div>
+</template>
+
+<script lang="ts">
+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 { TypeAndTime } from '@/views/report/interface';
+
+export default defineComponent({
+    name: 'inventory_report_inventory_category',
+    components: {
+        Filter,
+        contextMenu,
+        BtnList,
+    },
+    setup() {
+        // 表头数据
+        const { columns, registerColumn, updateColumn, filteredInfo } = getTableColumns();
+        // 表格事件
+        const { expandedRowKeys, selectedRow, Rowclick, btnClick } = getTableEvent<any>({});
+        // // 表格操作按钮列表
+        // const { commonBtn, forDataBtn } = getBtnList('warehouse_info_normal', true);
+        // 表格列表数据
+        const { loading, tableList, queryTable } = queryTableList<Ermcp3AreaSpotPLReport>(qryAreaSpotplReport);
+        initData(() => {
+            const { getInitTime, getInitType } = handleInitTypeAndTime();
+            // 获取列表数据
+            queryTable({ cycletype: getInitType(), cycletime: getInitTime() });
+            // 注册表头信息 过滤
+            registerColumn('table_pcweb_report_spot', []);
+        });
+        function update(value: TypeAndTime) {
+            queryTable(value);
+        }
+        // 查询
+        function search(value: any) {
+            filteredInfo.value = value;
+            // 更新表信息
+            updateColumn();
+        }
+
+        return {
+            columns,
+            filteredInfo,
+            expandedRowKeys,
+            selectedRow,
+            Rowclick,
+            loading,
+            tableList,
+            search,
+            queryTable,
+            btnClick,
+            update,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+.spot-report {
+}
+</style>;

+ 0 - 43
src/views/report/inventory-report/list/inventory_report_inventory/index.vue

@@ -1,43 +0,0 @@
-<template>
-  <!-- 库存报表-->
-  <div class="inventory-report"
-       :loading="loading">
-    <Filter @search="search"></Filter>
-    <contextMenu :contextMenuList="forDataBtn">
-      <!-- <a-table :columns="columns"
-               class="topTable hiddenFirstCol"
-               :pagination="false"
-               :expandedRowKeys="expandedRowKeys"
-               :customRow="Rowclick"
-               rowKey="key"
-               :data-source="tableList"> -->
-      <!-- 额外的展开行 -->
-      <!-- <template #expandedRowRender="{ record }">
-                    <BtnList :btnList="record.btnList"/>
-                </template> -->
-      <!-- </a-table> -->
-    </contextMenu>
-  </div>
-</template>
-
-<script lang="ts">
-import Filter from '../../components/filterTable/index.vue';
-import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList } from '@/common/export/table';
-
-export default defineComponent({
-    name: 'inventory-report',
-    components: {
-        Filter,
-        contextMenu,
-        BtnList,
-    },
-    setup() {
-        return {};
-    },
-});
-</script>
-
-<style lang="less">
-.inventory-report {
-}
-</style>;

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

@@ -0,0 +1,81 @@
+<template>
+  <!-- 库存报表(品类) -->
+  <div class="spot-report"
+       :loading="loading">
+    <Filter @update="update"></Filter>
+    <contextMenu :contextMenuList="forDataBtn">
+      <a-table :columns="columns"
+               class="topTable hiddenFirstCol"
+               :pagination="false"
+               :expandedRowKeys="expandedRowKeys"
+               :customRow="Rowclick"
+               rowKey="key"
+               :data-source="tableList">
+      </a-table>
+    </contextMenu>
+  </div>
+</template>
+
+<script lang="ts">
+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 { TypeAndTime } from '@/views/report/interface';
+
+export default defineComponent({
+    name: 'inventory_report_warehouse',
+    components: {
+        Filter,
+        contextMenu,
+        BtnList,
+    },
+    setup() {
+        // 表头数据
+        const { columns, registerColumn, updateColumn, filteredInfo } = getTableColumns();
+        // 表格事件
+        const { expandedRowKeys, selectedRow, Rowclick, btnClick } = getTableEvent<any>({});
+        // // 表格操作按钮列表
+        // const { commonBtn, forDataBtn } = getBtnList('warehouse_info_normal', true);
+        // 表格列表数据
+        const { loading, tableList, queryTable } = queryTableList<Ermcp3AreaSpotPLReport>(qryAreaSpotplReport);
+        initData(() => {
+            const { getInitTime, getInitType } = handleInitTypeAndTime();
+            // 获取列表数据
+            queryTable({ cycletype: getInitType(), cycletime: getInitTime() });
+            // 注册表头信息 过滤
+            registerColumn('table_pcweb_report_spot', []);
+        });
+        function update(value: TypeAndTime) {
+            queryTable(value);
+        }
+        // 查询
+        function search(value: any) {
+            filteredInfo.value = value;
+            // 更新表信息
+            updateColumn();
+        }
+
+        return {
+            columns,
+            filteredInfo,
+            expandedRowKeys,
+            selectedRow,
+            Rowclick,
+            loading,
+            tableList,
+            search,
+            queryTable,
+            btnClick,
+            update,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+.spot-report {
+}
+</style>;

+ 95 - 13
src/views/report/setup.ts

@@ -1,17 +1,99 @@
-import { ref } from "vue"
+import { queryResultLoadingAndInfo } from '@/common/methods/request/resultInfo'
+import { FinanceReportReq } from "@/services/go/ermcp/report/interface"
+import moment, { Moment } from "moment"
+import { ref, SetupContext } from "vue"
+import { reportCycleType, reportCyleTimeType } from "./enum"
+import { TypeAndTime, Value } from "./interface"
 
-interface Value {
-    key?: string;
-    label?: string;
-}
-
-export function handleReprotType() {
-    const selectedReportType = ref<Value>({ key: '1' })
+export function handleReprotType(context: SetupContext) {
+    // 选中的周期类型
+    const selectedReportType = ref<Value>({ key: reportCycleType.day })
+    // 时间格式化类型
+    const dateFormat = ref<reportCyleTimeType>(reportCyleTimeType.day)
+    // 时间
+    const time = ref<Moment>(getInitTime());
+    // 周期类型与时间类型 一对一的关系
+    const timeMap = new Map([
+        [reportCycleType.day, reportCyleTimeType.day],
+        [reportCycleType.month, reportCyleTimeType.month],
+        [reportCycleType.year, reportCyleTimeType.year],
+        [reportCycleType.week, reportCyleTimeType.week],
+    ])
     // 报表类型
-    const reportType = ref<{ value: string, lable: string }[]>([
-        { value: '1', lable: '日报表' },
-        { value: '2', lable: '周报表' },
-        { value: '3', lable: '月报表' },
+    const reportType = ref<{ value: number, lable: string }[]>([
+        { value: reportCycleType.day, lable: '日报表' },
+        { value: reportCycleType.week, lable: '周报表' },
+        { value: reportCycleType.month, lable: '月报表' },
     ])
-    return { selectedReportType, reportType }
+    // 初始化时间
+    function getInitTime() {
+        return moment(new Date(), dateFormat.value)
+    }
+    function getFomateType(): reportCyleTimeType {
+        const { key } = selectedReportType.value
+        const temp = timeMap.get(key)
+        return temp ? temp : reportCyleTimeType.day
+    }
+    // 周期类型变更
+    function reportTypeChange() {
+        time.value = getInitTime()
+        dateFormat.value = getFomateType()
+        update()
+
+    }
+    // 时间变更
+    function timeChange() {
+        update()
+    }
+    // 根据周期类型 格式化时间
+    function formateTime() {
+        return moment(time.value).format(getFomateType())
+    }
+    // 是否为 月报表
+    function isMonth() {
+        return selectedReportType.value.key === reportCycleType.month
+    }
+    // 通知上层更新数据
+    function update() {
+        const param = { cycletype: selectedReportType.value.key, cycletime: formateTime() }
+        context.emit('update', param)
+    }
+    return { selectedReportType, reportType, isMonth, reportTypeChange, dateFormat, time, timeChange, }
+}
+
+export function handleInitTypeAndTime() {
+    // 初始化时间
+    function getInitTime() {
+        return moment(new Date()).format(reportCyleTimeType.day)
+    }
+    // 初始化类型
+    function getInitType() {
+        return reportCycleType.day
+    }
+    return { getInitTime, getInitType }
+}
+
+/**
+ * 获取表格列表数据
+ * @param type 
+ * @returns 
+ */
+export function queryTableList<T>(fn: Function) {
+    // 加载状态
+    const loading = ref<boolean>(false);
+    // 表格数据
+    const tableList = ref<T[]>([]);
+    function queryTable(value: TypeAndTime) {
+        const param: FinanceReportReq = {
+            querytype: 1,
+            ...value
+        }
+        queryResultLoadingAndInfo(fn, loading, param).then(res => {
+            const result = res?.map((e: T, i: number) => {
+                return { ...e, key: String(i) };
+            });
+            tableList.value = result ? result : []
+        })
+    }
+    return { loading, tableList, queryTable }
 }

+ 8 - 39
src/views/report/spot-report/components/filterTable/index.vue

@@ -1,55 +1,29 @@
 <template>
   <!-- 过滤客户资料表格 -->
-  <div class="filterTable">
-    <div class="filter-custom-table">
-      <a-select label-in-value
-                class="conditionSelect"
-                style="width: 120px"
-                v-model:value="selectedReportType"
-                @change="update"
-                placeholder="请选择报表类型">
-        <a-select-option v-for="item in reportType"
-                         :key="item.value">
-          {{item.lable}}
-        </a-select-option>
-      </a-select>
-      <a-space direction="vertical">
-        <a-date-picker v-model:value="date"
-                       @change="update"
-                       :format="dateFormat" />
-      </a-space>
-      <!-- <FilterOption :selectList="selectList"
+  <Filter @update="update">
+    <!-- <FilterOption :selectList="selectList"
                     :inputList="[]"
                     :fixedBtnList="fixedBtnList" /> -->
-    </div>
-  </div>
+  </Filter>
 </template>
 
 <script lang="ts">
 import FilterOption from '@/common/components/filter/index.vue';
 import { defineComponent } from 'vue';
-import { handleReprotType } from '../../../setup';
 import { ref } from 'vue';
-import { Moment } from 'moment';
-import moment from 'moment';
 import { handleFilter, SelectList } from '@/common/setup/filter';
-import { initData } from '@/common/methods';
 import { handlerManagerList } from '@/common/setup/user';
 import { QueryMiddleGoodsDetail } from '@/services/go/ermcp/goodsInfo';
 import { SelectOption } from '@/common/setup/filter/interface';
+import Filter from '../../../components/filter/index.vue';
+import { TypeAndTime } from '@/views/report/interface';
 
 export default defineComponent({
     name: 'exposure-filter-table',
-    components: { FilterOption },
+    components: { FilterOption, Filter },
     setup(props, context) {
-        const { selectedReportType, reportType } = handleReprotType();
-
-        const dateFormat = 'YYYYMMDD';
-        const date = ref<Moment>(moment(new Date(), 'YYYYMMDD'));
-
-        function update() {
-            const obj = { type: selectedReportType.value.key, date: moment(date.value).format(dateFormat) };
-            context.emit('update', obj);
+        function update(value: TypeAndTime) {
+            context.emit('update', value);
         }
         const select: SelectList[] = [
             {
@@ -102,14 +76,9 @@ export default defineComponent({
         //     });
         // });
         return {
-            reportType,
-            selectedReportType,
             selectList,
             inputList,
             fixedBtnList,
-            date,
-            dateFormat,
-            update,
         };
     },
 });

+ 10 - 6
src/views/report/spot-report/list/spot_report/index.vue

@@ -19,8 +19,11 @@
 <script lang="ts">
 import Filter from '../../components/filterTable/index.vue';
 import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList } from '@/common/export/table';
-import { queryTableList } from './setup';
-import moment from 'moment';
+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 { TypeAndTime } from '@/views/report/interface';
 
 export default defineComponent({
     name: 'spot-report',
@@ -37,15 +40,16 @@ export default defineComponent({
         // // 表格操作按钮列表
         // const { commonBtn, forDataBtn } = getBtnList('warehouse_info_normal', true);
         // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList();
+        const { loading, tableList, queryTable } = queryTableList<Ermcp3AreaSpotPLReport>(qryAreaSpotplReport);
         initData(() => {
+            const { getInitTime, getInitType } = handleInitTypeAndTime();
             // 获取列表数据
-            queryTable(moment().format('YYYYMMDD'), '1');
+            queryTable({ cycletype: getInitType(), cycletime: getInitTime() });
             // 注册表头信息 过滤
             registerColumn('table_pcweb_report_spot', []);
         });
-        function update(value: { type: '1' | '2' | '3'; date: string }) {
-            queryTable(value.date, value.type);
+        function update(value: TypeAndTime) {
+            queryTable(value);
         }
         // 查询
         function search(value: any) {

+ 0 - 42
src/views/report/spot-report/list/spot_report/setup.ts

@@ -1,42 +0,0 @@
-import { queryResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
-import { QueryFinanceDayReportRsp } from '@/services/go/ermcp/finance-report/interface';
-import { QuerySpotDayReport, QuerySpotMonthReport } from '@/services/go/ermcp/spot-report';
-import { QuerySpotDayReportRsp } from '@/services/go/ermcp/spot-report/interface';
-import { ref } from 'vue';
-
-
-/**
- * 获取表格列表数据
- * @param type 
- * @returns 
- */
-export function queryTableList() {
-    // 加载状态
-    const loading = ref<boolean>(false);
-    // 表格数据
-    const tableList = ref<QuerySpotDayReportRsp[]>([]);
-
-    function queryTable(tradedate: string, type: '1' | '2' | '3') {
-        let fn: any = QuerySpotDayReport
-        switch (type) {
-            case '1':
-                fn = QuerySpotDayReport
-                break;
-            case '2':
-                fn = QuerySpotDayReport
-                break;
-            case '3':
-                fn = QuerySpotMonthReport
-                break;
-        }
-        queryResultLoadingAndInfo(fn, loading, tradedate).then(res => {
-            const result = res?.map((e: QueryFinanceDayReportRsp, i: number) => {
-                return { ...e, key: String(i) };
-            });
-            tableList.value = result ? result : []
-        })
-    }
-    return { loading, tableList, queryTable }
-}
-
-