huangbin 4 rokov pred
rodič
commit
b0dfb365e7

+ 20 - 1
src/router/index.ts

@@ -248,12 +248,31 @@ const routes: Array<RouteRecordRaw> = [
             {
                 path: '/inventory',
                 name: 'inventory',
-                component: () => import('@/views/search/inventory/index.vue'),
+                component: Main,
                 meta: {
                     requireAuth: true,
                 },
+                children: [
+                    {
+                        path: '/inventory/current',
+                        name: 'inventory_current',
+                        component: () => import('@/views/search/inventory/list/inventory_current/index.vue'),
+                        meta: {
+                            requireAuth: true,
+                        },
+                    },
+                    {
+                        path: '/inventory/applyrecord',
+                        name: 'inventory_applyrecord',
+                        component: () => import('@/views/search/inventory/list/inventory_applyrecord/index.vue'),
+                        meta: {
+                            requireAuth: true,
+                        },
+                    },
+                ]
             },
 
+
             {
                 path: '/purchase',
                 name: 'purchase',

+ 63 - 0
src/views/search/inventory/components/add/index.vue

@@ -0,0 +1,63 @@
+<template>
+  <!-- 新增现货合同 -->
+  <a-modal class="commonModal add-spot-contract"
+           title="新增现货合同"
+           v-model:visible="visible"
+           centered
+           :maskClosable="maskClosableFlag"
+           @cancel="cancel"
+           width="890px">
+    <template #footer>
+      <a-button key="submit"
+                class="cancelBtn"
+                @click="submit(1)">保存草稿</a-button>
+      <a-button key="submit"
+                type="primary"
+                :loading="loading"
+                @click="submit(2)">提交审核</a-button>
+    </template>
+
+  </a-modal>
+</template>
+
+<script lang="ts">
+import { defineComponent, PropType, ref, toRaw } from 'vue';
+import { closeModal } from '@/common/setup/modal/index';
+import { initData } from '@/common/methods';
+
+import { Ermcp3ContractRsp } from '@/services/go/ermcp/spot-contract/interface';
+
+export default defineComponent({
+    name: 'add-spot-contract',
+    components: {},
+    props: {
+        selectedRow: {
+            type: Object as PropType<Ermcp3ContractRsp>,
+            default: {},
+        },
+    },
+    setup(props, context) {
+        const { visible, cancel } = closeModal('spot_contract_btn_add');
+
+        const loading = ref<boolean>(false);
+
+        function submit(OperateType: 1 | 2) {
+            cancel();
+        }
+
+        initData(() => {});
+        return {
+            visible,
+            cancel,
+            submit,
+            loading,
+            maskClosableFlag: false,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+.add-spot-contract {
+}
+</style>;

+ 69 - 0
src/views/search/inventory/components/filterTable/index.vue

@@ -0,0 +1,69 @@
+<template>
+  <!-- 过滤客户资料表格 -->
+  <div class="filterTable">
+    <FilterOption :selectList="selectList"
+                  :inputList="inputList"
+                  :fixedBtnList="fixedBtnList" />
+    <slot></slot>
+  </div>
+</template>
+
+<script lang="ts">
+import FilterOption from '@/common/components/filter/index.vue';
+import { defineComponent } from 'vue';
+import { handleFilter, InputList, SelectList } from '@/common/setup/filter';
+export default defineComponent({
+    name: 'filter-spot-contract-table',
+    components: { FilterOption },
+    setup(props, context) {
+        const select: SelectList[] = [
+            {
+                value: undefined,
+                key: 'contracttype',
+                placeholder: '全部现货品种',
+                list: [
+                    { value: 1, lable: '采购' },
+                    { value: -1, lable: '销售' },
+                ],
+            },
+            {
+                value: undefined,
+                key: 'pricetype',
+                placeholder: '全部品类',
+                list: [
+                    { value: 1, lable: '一口价' },
+                    { value: 2, lable: '点价' },
+                    { value: 3, lable: '暂定价' },
+                ],
+            },
+            {
+                value: undefined,
+                key: 'pricetype',
+                placeholder: '全部品牌',
+                list: [
+                    { value: 1, lable: '一口价' },
+                    { value: 2, lable: '点价' },
+                    { value: 3, lable: '暂定价' },
+                ],
+            },
+            {
+                value: undefined,
+                key: 'pricetype',
+                placeholder: '全部仓库',
+                list: [
+                    { value: 1, lable: '一口价' },
+                    { value: 2, lable: '点价' },
+                    { value: 3, lable: '暂定价' },
+                ],
+            },
+        ];
+        const input: InputList[] = [];
+        return {
+            ...handleFilter(select, input, context),
+        };
+    },
+});
+</script>
+
+<style lang="less">
+</style>;

+ 111 - 0
src/views/search/inventory/list/inventory_applyrecord/index.vue

@@ -0,0 +1,111 @@
+<template>
+  <!-- 现货合同: 待审核-->
+  <div class="inventory_current"
+       :loading="loading">
+    <Filter @search="search">
+      <BtnList :btnList="commonBtn" />
+    </Filter>
+    <contextMenu :contextMenuList="forDataBtn">
+      <a-table :columns="columns"
+               class="topTable hiddenFirstCol"
+               :pagination="false"
+               rowKey="key"
+               :expandedRowKeys="expandedRowKeys"
+               :customRow="Rowclick"
+               :data-source="tableList">
+        <!-- 额外的展开行 -->
+        <template #expandedRowRender="{  }">
+          <BtnList :btnList="forDataBtn" />
+        </template>
+        <!-- <template #userinfotype="{ text }">
+                  <a>{{ text === '2' ? '企业' : '个人'}}</a>
+                </template> -->
+
+        <template #biztype="{ text }">
+          <a>{{ getBizTypeName(text) }}</a>
+        </template>
+
+        <template #pricetype="{ text }">
+          <a>{{ getPriceTypeName(text) }}</a>
+        </template>
+
+        <template #contracctstatus="{ text }">
+          <a>{{ getContractStatusName(text) }}</a>
+        </template>
+
+        <template #contracttype="{ text }">
+          <a>{{ getContractTypeName(text) }}</a>
+        </template>
+
+      </a-table>
+    </contextMenu>
+    <!-- 现货合同: 审核 -->
+    <Add :selectedRow="selectedRow"
+         @refresh="queryTable" />
+  </div>
+</template>
+
+<script lang="ts">
+import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList } from '@/common/export/table';
+import Filter from '../../components/filterTable/index.vue';
+import Add from '../../components/add/index.vue';
+
+import { getBizTypeName, getContractStatusName, getContractTypeName, getPriceTypeName } from '@/views/information/spot-contract/setup';
+import { Ermcp3ContractRsp, queryTableList } from '@/views/information/spot-contract/list';
+
+export default defineComponent({
+    name: 'inventory_current',
+    components: {
+        Filter,
+        contextMenu,
+        Add,
+        BtnList,
+    },
+    setup() {
+        // 表头数据
+        const { columns, registerColumn, updateColumn, filteredInfo } = getTableColumns();
+        // 表格事件
+        const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<Ermcp3ContractRsp>({});
+        // 表格操作按钮列表
+        const { commonBtn, forDataBtn } = getBtnList('inventory_current', true);
+        // 表格列表数据
+        const { loading, tableList, queryTable } = queryTableList(2);
+
+        // 查询
+        function search(value: any) {
+            filteredInfo.value = value;
+            // 更新表信息
+            updateColumn();
+        }
+
+        initData(() => {
+            // 获取列表数据
+            queryTable();
+            // 注册表头信息 过滤
+            // registerColumn('table_pcweb_delivery', getFilterTableCB);
+        });
+        return {
+            columns,
+            filteredInfo,
+            expandedRowKeys,
+            selectedRow,
+            Rowclick,
+            commonBtn,
+            forDataBtn,
+            loading,
+            tableList,
+            search,
+            queryTable,
+            getBizTypeName,
+            getPriceTypeName,
+            getContractStatusName,
+            getContractTypeName,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+.inventory_current {
+}
+</style>;

+ 111 - 0
src/views/search/inventory/list/inventory_current/index.vue

@@ -0,0 +1,111 @@
+<template>
+  <!-- 现货合同: 待审核-->
+  <div class="inventory_current"
+       :loading="loading">
+    <Filter @search="search">
+      <BtnList :btnList="commonBtn" />
+    </Filter>
+    <contextMenu :contextMenuList="forDataBtn">
+      <a-table :columns="columns"
+               class="topTable hiddenFirstCol"
+               :pagination="false"
+               rowKey="key"
+               :expandedRowKeys="expandedRowKeys"
+               :customRow="Rowclick"
+               :data-source="tableList">
+        <!-- 额外的展开行 -->
+        <template #expandedRowRender="{  }">
+          <BtnList :btnList="forDataBtn" />
+        </template>
+        <!-- <template #userinfotype="{ text }">
+                  <a>{{ text === '2' ? '企业' : '个人'}}</a>
+                </template> -->
+
+        <template #biztype="{ text }">
+          <a>{{ getBizTypeName(text) }}</a>
+        </template>
+
+        <template #pricetype="{ text }">
+          <a>{{ getPriceTypeName(text) }}</a>
+        </template>
+
+        <template #contracctstatus="{ text }">
+          <a>{{ getContractStatusName(text) }}</a>
+        </template>
+
+        <template #contracttype="{ text }">
+          <a>{{ getContractTypeName(text) }}</a>
+        </template>
+
+      </a-table>
+    </contextMenu>
+    <!-- 现货合同: 审核 -->
+    <Add :selectedRow="selectedRow"
+         @refresh="queryTable" />
+  </div>
+</template>
+
+<script lang="ts">
+import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList } from '@/common/export/table';
+import Filter from '../../components/filterTable/index.vue';
+import Add from '../../components/add/index.vue';
+
+import { getBizTypeName, getContractStatusName, getContractTypeName, getPriceTypeName } from '@/views/information/spot-contract/setup';
+import { Ermcp3ContractRsp, queryTableList } from '@/views/information/spot-contract/list';
+
+export default defineComponent({
+    name: 'inventory_current',
+    components: {
+        Filter,
+        contextMenu,
+        Add,
+        BtnList,
+    },
+    setup() {
+        // 表头数据
+        const { columns, registerColumn, updateColumn, filteredInfo } = getTableColumns();
+        // 表格事件
+        const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<Ermcp3ContractRsp>({});
+        // 表格操作按钮列表
+        const { commonBtn, forDataBtn } = getBtnList('inventory_current', true);
+        // 表格列表数据
+        const { loading, tableList, queryTable } = queryTableList(2);
+
+        // 查询
+        function search(value: any) {
+            filteredInfo.value = value;
+            // 更新表信息
+            updateColumn();
+        }
+
+        initData(() => {
+            // 获取列表数据
+            queryTable();
+            // 注册表头信息 过滤
+            // registerColumn('table_pcweb_delivery', getFilterTableCB);
+        });
+        return {
+            columns,
+            filteredInfo,
+            expandedRowKeys,
+            selectedRow,
+            Rowclick,
+            commonBtn,
+            forDataBtn,
+            loading,
+            tableList,
+            search,
+            queryTable,
+            getBizTypeName,
+            getPriceTypeName,
+            getContractStatusName,
+            getContractTypeName,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+.inventory_current {
+}
+</style>;