浏览代码

Merge branch 'master' of http://47.101.159.18:3000/Muchinfo/MTP2.0_WEB

marymelisa 4 年之前
父节点
当前提交
b14b196ce7

+ 7 - 2
src/common/setup/table/button.ts

@@ -93,9 +93,14 @@ export function _handleBtnList(list: OperationTabMenu | undefined, hasDetail: bo
     }
     // 详情
     if (hasDetail) {
-        const len = result.value.length;
         const { openAction } = openModal('detail')
-        result.value[len - 1].push({ lable: '详情', callback: openAction, className: getClassName('') })
+        const item = { lable: '详情', callback: openAction, className: getClassName('') }
+        const len = result.value.length;
+        if (len) {
+            result.value[len - 1].push(item)
+        } else {
+            result.value = [[item]]
+        }
     }
 
 

+ 2 - 0
src/common/setup/table/interface.ts

@@ -84,4 +84,6 @@ export interface ButtonListKey {
     platinum_recharge_review_tab: string; // 千海金 充值审核
     platinum_pick_query_tab: string; // 千海金 提货查询
 
+    platinum_fixed_investment_price_query_tab: string; // 千海金 定投价查询
+
 }

+ 61 - 0
src/views/platinum/platinum_fixed_investment_price_query/compoments/filter/index.vue

@@ -0,0 +1,61 @@
+<template>
+  <!-- 过滤 -->
+  <div class="filterTable">
+    <a-space>
+      <a-date-picker v-model:value="date" />
+    </a-space>
+    <FilterOption :selectList="selectList"
+                  :inputList="inputList"
+                  :fixedBtnList="fixedBtnList" />
+    <slot></slot>
+  </div>
+</template>
+
+<script lang="ts">
+import FilterOption from '@/common/components/filter/index.vue';
+import { defineComponent, ref } from 'vue';
+import { handleFilter, InputList, SelectList } from '@/common/setup/filter';
+import { Moment } from 'moment';
+
+export default defineComponent({
+    name: 'filter-platinum_pick_query',
+    components: { FilterOption },
+    setup(props, context) {
+        const date = ref<Moment[]>();
+        const select: SelectList[] = [
+            {
+                value: undefined,
+                key: 'contracttype1',
+                placeholder: '选择商品',
+                list: [
+                    { value: 1, lable: '采购' },
+                    { value: -1, lable: '销售' },
+                ],
+            },
+        ];
+        const input: InputList[] = [];
+        const { selectList, inputList, fixedBtnList } = handleFilter(select, input, context);
+        return {
+            date,
+            selectList,
+            inputList,
+            fixedBtnList,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+.filterTable {
+    .commonPicker.ant-calendar-picker {
+        display: inline-flex;
+        padding-top: 9px;
+        padding-bottom: 6px;
+        margin-right: 10px;
+        .ant-input {
+            border: 0;
+            background: @m-grey9;
+        }
+    }
+}
+</style>;

+ 67 - 2
src/views/platinum/platinum_fixed_investment_price_query/list/tab/index.vue

@@ -1,8 +1,73 @@
 <template>
   <!-- 定投价查询 -->
-  <div>platinum_fixed_investment_price_query_tab</div>
+  <div class="platinum_fixed_investment_price_query_tab">
+    <Filter />
+    <contextMenu :contextMenuList="firstBtn">
+      <a-table :columns="columns"
+               class="topTable hiddenFirstCol"
+               :pagination="false"
+               :expandedRowKeys="expandedRowKeys"
+               :customRow="Rowclick"
+               rowKey="key"
+               :data-source="tableList">
+        <!-- 额外的展开行 -->
+        <template #expandedRowRender="{  }">
+          <BtnList :btnList="firstBtn"
+                   @onClick="btnClick" />
+        </template>
+      </a-table>
+    </contextMenu>
+    <!-- <ControlModal :selectedRow="selectedRow" /> -->
+  </div>
 </template>
 
 <script lang="ts">
-export default {};
+import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList, _getBtnList } from '@/common/export/table';
+import { ErmcpWareHouseInfo } from '@/views/information/warehouse-info/list';
+import Filter from '../../compoments/filter/index.vue';
+import { queryTableList } from './setup';
+// import ControlModal from './compoments/controlModal/index.vue';
+
+export default defineComponent({
+    name: 'platinum_fixed_investment_price_query_tab',
+    components: { Filter, contextMenu, BtnList },
+    setup() {
+        // 表头数据
+        const { columns, registerColumn, updateColumn, filteredInfo } = getTableColumns();
+        // 表格事件
+        const { expandedRowKeys, selectedRow, Rowclick, btnClick } = getTableEvent<ErmcpWareHouseInfo>({});
+        // 表格操作按钮列表
+        const [firstBtn] = _getBtnList('platinum_fixed_investment_price_query_tab', false).value;
+        // 表格列表数据
+        const { loading, tableList, queryTable } = queryTableList('in');
+        initData(() => {
+            // 获取列表数据
+            queryTable();
+            // 注册表头信息 过滤
+            registerColumn('table_pcweb_warehouse', ['warehousetype', 'warehousename', 'address']);
+            // registerColumn('table_pcweb_qhj_withdrawal_review', ['warehousetype', 'warehousename', 'address']);
+        });
+
+        // 查询
+        function search(value: any) {
+            filteredInfo.value = value;
+            // 更新表信息
+            updateColumn();
+        }
+
+        return {
+            columns,
+            filteredInfo,
+            expandedRowKeys,
+            selectedRow,
+            Rowclick,
+            firstBtn,
+            loading,
+            tableList,
+            search,
+            queryTable,
+            btnClick,
+        };
+    },
+});
 </script>

+ 51 - 0
src/views/platinum/platinum_fixed_investment_price_query/list/tab/setup.ts

@@ -0,0 +1,51 @@
+import { QueryWareHouse } from '@/services/go/ermcp/warehouse-info/index';
+import { ErmcpWareHouseInfo } from '@/services/go/ermcp/warehouse-info/interface';
+import { message } from 'ant-design-vue';
+import { ref } from 'vue';
+
+
+
+/**
+ * 获取表格列表数据
+ * @param type 
+ * @returns 
+ */
+export function queryTableList(type: string) {
+    // 加载状态
+    const loading = ref<boolean>(false);
+    // 表格数据
+    const tableList = ref<ErmcpWareHouseInfo[]>([]);
+    function queryTable() {
+        QueryWareHouse('1')
+            .then((res) => {
+                tableList.value = res.map((e, i) => {
+                    return { ...e, key: String(i) };
+                });
+                loading.value = false;
+                console.log('查询列表', tableList);
+            })
+            .catch((err) => {
+                message.error(err);
+                loading.value = false;
+            });
+    }
+    return { loading, tableList, queryTable }
+}
+
+// export function queryTableList(type: 'in' | 'out') {
+//     // 加载状态
+//     const loading = ref<boolean>(false);
+//     // 表格数据
+//     const tableList = ref<QhjAccountOutInApply[]>([]);
+//     function queryTable() {
+//         queryResultLoadingAndInfo(queryAccountInOutApply, loading)
+//             .then(res => {
+//                 //申请类型 - 1:出金 2:入金 3: 单边账调整:入金; 4:单边账调整:出金 5:外部母账户调整:入金 6:外部母账户调整:出金 7:外部子账户:入金 8:外部子账户:出金
+//                 const arr = type === 'in' ? [1, 3, 5, 7] : [2, 4, 6, 8]
+//                 tableList.value = res.filter((e: QhjAccountOutInApply) => arr.includes(e.executetype)).map((e: QhjAccountOutInApply, i: number) => {
+//                     return { ...e, key: String(i) };
+//                 });
+//             })
+//     }
+//     return { loading, tableList, queryTable }
+// }