Преглед на файлове

Merge remote-tracking branch 'origin/master'

yu.jie преди 4 години
родител
ревизия
b597937f14

+ 1 - 2
src/common/methods/table/interface.ts

@@ -15,6 +15,7 @@ export interface ColumnType {
     render?: Function;
 }
 export interface TableKey {
+    table_pcweb_aggregate_profit_and_loss: "string; // 报表-库存报表"
     table_pcweb_application_record: "string; // 库存查询-申请记录"
     table_pcweb_business_aduit_dj: "string; // 业务审核-点价"
     table_pcweb_business_aduit_js: "string; // 业务审核-交收"
@@ -36,11 +37,9 @@ export interface TableKey {
     table_pcweb_purchase_all: "string; // 采购_全部"
     table_pcweb_purchase_pointprice: "string; // 采购_待点价"
     table_pcweb_purchase_settle: "string; // 采购_履约交收"
-    table_pcweb_report_expose: "string; // 报表-敞口报表"
     table_pcweb_report_fincial_invoice_day: "string; // 报表-财务报表-发票-日报表"
     table_pcweb_report_fincial_month: "string; // 报表-财务报表-月报表"
     table_pcweb_report_fincial_payment_day: "string; // 报表-财务报表-款项-日报表"
-    table_pcweb_report_spot: "string; // 报表-现货报表"
     table_pcweb_report_spot_detail_day: "string; // 现货日报表-详情"
     table_pcweb_report_spot_detail_month: "string; // 现货月报表-详情"
     table_pcweb_sales_all: "string; // 销售_全部"

+ 6 - 2
src/common/setup/user/index.ts

@@ -13,9 +13,13 @@ import { Ref, ref } from "vue";
  */
 export function handlerManagerList(loading: Ref<boolean>, type: 1 | 2 | 3, isFilter = false) {
     const tableList = ref<ErmcpLoginUserEx[]>([]);
-    function queryTable() {
+    function queryTable(): Promise<ErmcpLoginUserEx[]> {
         return queryResultLoadingAndInfo(QueryAccMgrLoginUser, loading, type)
-            .then(res => tableList.value = isFilter ? res.filter((e: ErmcpLoginUserEx) => e.accountstatus === 4) : res)
+            .then(res => {
+                const result = isFilter ? res.filter((e: ErmcpLoginUserEx) => e.accountstatus === 4) : res
+                tableList.value = result
+                return result
+            })
     }
     /**
      * 根据code 查找业务员、跟单员对应的名字

+ 38 - 0
src/router/index.ts

@@ -591,6 +591,44 @@ const routes: Array<RouteRecordRaw> = [
                     },
                 ]
             },
+            {
+                path: '/sum_pl_report',
+                name: 'sum_pl_report',
+                component: Main,
+                meta: {
+                    requireAuth: true,
+                },
+                redirect: { name: 'sum_pl_report_sum_pl' },
+                children: [
+                    {
+                        path: '/sum_pl_report/sum_pl',
+                        name: 'sum_pl_report_sum_pl',
+                        component: () => import('@/views/report/sum_pl_report/list/sum_pl_report/index.vue'),
+                        meta: {
+                            requireAuth: true,
+                        },
+                    },
+                ]
+            },
+            {
+                path: '/future_report',
+                name: 'future_report',
+                component: Main,
+                meta: {
+                    requireAuth: true,
+                },
+                redirect: { name: 'future_report_future' },
+                children: [
+                    {
+                        path: '/future_report/future',
+                        name: 'future_report_future',
+                        component: () => import('@/views/report/future_report/list/future_report/index.vue'),
+                        meta: {
+                            requireAuth: true,
+                        },
+                    },
+                ]
+            },
         ],
     },
     {

+ 12 - 4
src/services/go/ermcp/report/index.ts

@@ -19,7 +19,9 @@ import {
  * @param req.querytype  查询类型 1-日报表 2-周期报表 3-日报表(指定时间段[开始交易日,结束交易日]) 4-日报表明细
  */
 export function qryAreaExpourseReport(req: AreaExpourseReportReq): Promise<Ermcp3ExpourseReport[]> {
-    req.userid = getUserId()
+    if (!req.userid) {
+        req.userid = getUserId()
+    }
     return commonSearch_go('/Ermcp3/QryAreaExpourseReport', req).catch((err) => {
         throw new Error(`查询敞口报表: ${err.message}`);
     });
@@ -29,7 +31,9 @@ export function qryAreaExpourseReport(req: AreaExpourseReportReq): Promise<Ermcp
  *  查询现货报表 /Ermcp3/QryAreaSpotplReport
  */
 export function qryAreaSpotplReport(req: AreaSpotplReportReq): Promise<Ermcp3AreaSpotPLReport[]> {
-    req.userid = getUserId()
+    if (!req.userid) {
+        req.userid = getUserId()
+    }
     return commonSearch_go('/Ermcp3/QryAreaSpotplReport', req).catch((err) => {
         throw new Error(`查询现货报表: ${err.message}`);
     });
@@ -40,7 +44,9 @@ export function qryAreaSpotplReport(req: AreaSpotplReportReq): Promise<Ermcp3Are
  * @param req
  */
 export function qryAreaStockReport(req: AreaStockReportReq): Promise<Ermcp3AreaStockReport[]> {
-    req.userid = getUserId()
+    if (!req.userid) {
+        req.userid = getUserId()
+    }
     return commonSearch_go('/Ermcp3/QryAreaStockReport', req).catch((err) => {
         throw new Error(`查询库存报表: ${err.message}`);
     });
@@ -51,7 +57,9 @@ export function qryAreaStockReport(req: AreaStockReportReq): Promise<Ermcp3AreaS
  * @param req
  */
 export function qryFinanceReport(req: FinanceReportReq): Promise<Ermcp3FinanceReport[]> {
-    req.userid = getUserId()
+    if (!req.userid) {
+        req.userid = getUserId()
+    }
     return commonSearch_go('/Ermcp3/QryFinanceReport', req).catch((err) => {
         throw new Error(`查询财务报表: ${err.message}`);
     });

+ 38 - 3
src/views/report/components/filter/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <!-- 过滤客户资料表格 -->
+  <!-- 报表通用过滤 -->
   <div class="filterTable">
     <div class="filter-custom-table">
       <a-select label-in-value
@@ -22,6 +22,17 @@
                        @change="timeChange"
                        :format="dateFormat" />
       </a-space>
+      <a-select label-in-value
+                class="conditionSelect"
+                style="width: 120px"
+                v-model:value="selectedUser"
+                @change="userChange"
+                placeholder="请选择报表类型">
+        <a-select-option v-for="item in userList"
+                         :key="item.value">
+          {{item.lable}}
+        </a-select-option>
+      </a-select>
       <slot></slot>
     </div>
   </div>
@@ -29,22 +40,46 @@
 
 <script lang="ts">
 import FilterOption from '@/common/components/filter/index.vue';
-import { defineComponent } from 'vue';
+import { initData } from '@/common/methods';
+import { SelectOption } from '@/common/setup/filter/interface';
+import { handlerManagerList } from '@/common/setup/user';
+import { getUserId } from '@/services/bus/account';
+import { getUserName } from '@/services/bus/user';
+import { defineComponent, ref } 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);
+        const { selectedReportType, reportType, reportTypeChange, isMonth, timeChange, dateFormat, time, selectedUser, userChange } = handleReprotType(context);
+        const loading = ref<boolean>(false);
+        // 交易用户
+        const userList = ref<SelectOption[]>([]);
+        const { queryTable } = handlerManagerList(loading, 2);
+        initData(() => {
+            queryTable().then((res) => {
+                userList.value.length = 0;
+                userList.value.push({ value: getUserId(), lable: getUserName() });
+                res.forEach((e) => {
+                    e.userlist.forEach((el) => {
+                        // userList.value.push({ value: el.loginid, lable: `${el.loginname}-${el.logincode}` });
+                        userList.value.push({ value: el.loginid, lable: el.loginname });
+                    });
+                });
+            });
+        });
         return {
             reportType,
             selectedReportType,
             dateFormat,
             timeChange,
             reportTypeChange,
+            selectedUser,
+            userChange,
             isMonth,
             time,
+            userList,
         };
     },
 });

+ 89 - 0
src/views/report/future_report/components/filterTable/index.vue

@@ -0,0 +1,89 @@
+<template>
+  <!-- 过滤客户资料表格 -->
+  <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 { 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: 'inventory-filter-table',
+    components: { FilterOption, Filter },
+    setup(props, context) {
+        function update(value: TypeAndTime) {
+            context.emit('update', value);
+        }
+        const select: SelectList[] = [
+            {
+                value: undefined,
+                key: 'userId',
+                placeholder: '全部交易用户',
+                list: [],
+            },
+            {
+                value: undefined,
+                key: 'warehousetype',
+                placeholder: '全部套保品种',
+                list: [],
+            },
+        ];
+        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 {
+            selectList,
+            inputList,
+            fixedBtnList,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+</style>;
+

+ 81 - 0
src/views/report/future_report/list/future_report/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_warehouse_category_report', []);
+        });
+        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>;

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

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

+ 9 - 2
src/views/report/setup.ts

@@ -1,4 +1,5 @@
 import { queryResultLoadingAndInfo } from '@/common/methods/request/resultInfo'
+import { getUsrId } from '@/services/bus/user'
 import { FinanceReportReq } from "@/services/go/ermcp/report/interface"
 import moment, { Moment } from "moment"
 import { ref, SetupContext } from "vue"
@@ -12,6 +13,8 @@ export function handleReprotType(context: SetupContext) {
     const dateFormat = ref<reportCyleTimeType>(reportCyleTimeType.day)
     // 时间
     const time = ref<Moment>(getInitTime());
+    // 交易用户
+    const selectedUser = ref<Value>({ key: getUsrId() })
     // 周期类型与时间类型 一对一的关系
     const timeMap = new Map([
         [reportCycleType.day, reportCyleTimeType.day],
@@ -45,6 +48,10 @@ export function handleReprotType(context: SetupContext) {
     function timeChange() {
         update()
     }
+    // 交易用户变更
+    function userChange() {
+        update()
+    }
     // 根据周期类型 格式化时间
     function formateTime() {
         return moment(time.value).format(getFomateType())
@@ -55,10 +62,10 @@ export function handleReprotType(context: SetupContext) {
     }
     // 通知上层更新数据
     function update() {
-        const param = { cycletype: selectedReportType.value.key, cycletime: formateTime() }
+        const param = { cycletype: selectedReportType.value.key, cycletime: formateTime(), userid: selectedUser.value.key }
         context.emit('update', param)
     }
-    return { selectedReportType, reportType, isMonth, reportTypeChange, dateFormat, time, timeChange, }
+    return { selectedReportType, reportType, isMonth, reportTypeChange, dateFormat, time, timeChange, selectedUser, userChange }
 }
 
 export function handleInitTypeAndTime() {

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

@@ -19,7 +19,7 @@
 <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 { queryTableList } from '@/views/report/setup';
 import { handleInitTypeAndTime } from '@/views/report/setup';
 import { qryAreaSpotplReport } from '@/services/go/ermcp/report';
 import { Ermcp3AreaSpotPLReport } from '@/services/go/ermcp/report/interface';

+ 89 - 0
src/views/report/sum_pl_report/components/filterTable/index.vue

@@ -0,0 +1,89 @@
+<template>
+  <!-- 过滤客户资料表格 -->
+  <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 { 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: 'exposure-filter-table',
+    components: { FilterOption, Filter },
+    setup(props, context) {
+        function update(value: TypeAndTime) {
+            context.emit('update', value);
+        }
+        const select: SelectList[] = [
+            {
+                value: undefined,
+                key: 'userId',
+                placeholder: '全部交易用户',
+                list: [],
+            },
+            {
+                value: undefined,
+                key: 'warehousetype',
+                placeholder: '全部套保品种',
+                list: [],
+            },
+        ];
+        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 {
+            selectList,
+            inputList,
+            fixedBtnList,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+</style>;
+

+ 80 - 0
src/views/report/sum_pl_report/list/sum_pl_report/index.vue

@@ -0,0 +1,80 @@
+<template>
+  <!-- 汇总损益报表 -->
+  <div class="exposure_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 '@/views/report/setup';
+import { TypeAndTime } from '@/views/report/interface';
+import { handleInitTypeAndTime } from '@/views/report/setup';
+import { Ermcp3ArealSumPL, Ermcp3ExpourseReport } from '@/services/go/ermcp/report/interface';
+import { qryAreaExpourseReport, qryAreaSumPL } from '@/services/go/ermcp/report';
+export default defineComponent({
+    name: 'sum_pl_report',
+    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<Ermcp3ArealSumPL>(qryAreaSumPL);
+        initData(() => {
+            const { getInitTime, getInitType } = handleInitTypeAndTime();
+            // 获取列表数据
+            queryTable({ cycletype: getInitType(), cycletime: getInitTime() });
+            // 注册表头信息 过滤
+            registerColumn('table_pcweb_exposure_report', []);
+        });
+        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">
+.exposure-report {
+}
+</style>;

Файловите разлики са ограничени, защото са твърде много
+ 96 - 425
swagger-to-ts/index.js


Някои файлове не бяха показани, защото твърде много файлове са промени