huangbin 4 роки тому
батько
коміт
0bd59bbd58

+ 83 - 127
src/views/information/spot-contract/components/detail/index.vue

@@ -11,31 +11,22 @@
       <a-button key="submit"
                 type="primary"
                 :loading="loading"
-                @click="submit">关闭</a-button>
+                @click="cancel">关闭</a-button>
     </template>
-    <a-tabs v-model:activeKey="activeKey">
-      <a-tab-pane key="1"
-                  tab="合同详情"></a-tab-pane>
-      <a-tab-pane key="2"
-                  tab="点价记录"></a-tab-pane>
-      <a-tab-pane key="3"
-                  tab="交收记录"></a-tab-pane>
-      <a-tab-pane key="4"
-                  tab="款项记录"></a-tab-pane>
-      <a-tab-pane key="5"
-                  tab="发票记录"></a-tab-pane>
-      <a-tab-pane key="6"
-                  tab="入库记录"></a-tab-pane>
-      <a-tab-pane key="7"
-                  tab="变更记录"></a-tab-pane>
+    <a-tabs v-model:activeKey="activeKey"
+            @change="tabClick">
+      <a-tab-pane v-for="item in tabList"
+                  :key="item.key"
+                  :tab="item.name">
+      </a-tab-pane>
     </a-tabs>
     <InfoDetail :selectedRow="selectedRow"
                 v-if="activeKey == 1" />
     <div class="tableDatas"
-         v-if="activeKey == 2">
+         v-else>
       <a-table class="dialogTable"
                :columns="columns"
-               :data-source="data"
+               :data-source="tableList"
                :pagination="false">
         <template #status="{ text }">
           <span class="yellow">{{ text }}</span>
@@ -50,7 +41,7 @@
 import { defineComponent, PropType, ref } from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
 import { Ermcp3ContractRsp, QueryChangeLogReq } from '@/services/go/ermcp/spot-contract/interface';
-import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
+import { queryResultLoadingAndInfo, requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 import { QueryBusinessFp, QueryBusinessKx } from '@/services/go/ermcp/finance-review';
 import { QueryBusinessFpReq, QueryBusinessKxReq } from '@/services/go/ermcp/finance-review/interface';
 import { QueryBusinessDj, QueryBusinessJs } from '@/services/go/ermcp/business-review';
@@ -58,9 +49,9 @@ import { QueryBusinessDjReq, QueryBusinessJsReq } from '@/services/go/ermcp/busi
 import { QueryAreaStockApply } from '@/services/go/ermcp/inventory-review';
 import { QueryAreaStockApplyReq } from '@/services/go/ermcp/inventory-review/interface';
 import { QueryChangeLog } from '@/services/go/ermcp/spot-contract';
-import { handlerManagerList } from '@/common/setup/user';
 import { ErmcpLoginUserEx } from '@/services/go/ermcp/account/interface';
 import InfoDetail from '../infoDetail/index.vue';
+import { columnsPointPrice, columnsFund, columnsSettlement, columnsInvoice, columnsInWarehouse } from './setup';
 
 export default defineComponent({
     name: 'spot-contract-detail',
@@ -77,23 +68,78 @@ export default defineComponent({
     },
     setup: function(props, context) {
         const { visible, cancel } = closeModal('detail');
+
+        const tabList = [
+            { key: 1, name: '合同详情' },
+            { key: 2, name: '点价记录' },
+            { key: 3, name: '交收记录' },
+            { key: 4, name: '款项记录' },
+            { key: 5, name: '发票记录' },
+            { key: 6, name: '入库记录' },
+            { key: 7, name: '变更记录' },
+        ];
+        const activeKey = ref<number>(1);
+
         const loading = ref<boolean>(false);
-        const maskClosableFlag = ref<boolean>(false);
-        // 获取 业务账户
-        const { findManagerName } = handlerManagerList(loading, 1);
+        const columns = ref<any[]>([]);
+        const tableList = ref<any[]>([]);
 
+        function tabClick() {
+            const relatedid = props.selectedRow.spotcontractid;
+            console.log('activeKey.value', activeKey.value);
+            switch (activeKey.value) {
+                case 1:
+                    break;
+                case 2: // 点价记录
+                    queryResultLoadingAndInfo(QueryBusinessKx, loading, { relatedid }).then((res) => {
+                        columns.value = columnsPointPrice;
+                        tableList.value = res;
+                    });
+                    break;
+                case 3: // 交收记录
+                    queryResultLoadingAndInfo(QueryBusinessJs, loading, { relatedid }).then((res) => {
+                        columns.value = columnsSettlement;
+                        tableList.value = res;
+                    });
+                    break;
+                case 4: //款项记录
+                    queryResultLoadingAndInfo(QueryBusinessKx, loading, { relatedid }).then((res) => {
+                        columns.value = columnsFund;
+                        tableList.value = res;
+                    });
+                    break;
+                case 5: // 发票记录
+                    queryResultLoadingAndInfo(QueryBusinessFp, loading, { relatedid }).then((res) => {
+                        columns.value = columnsInvoice;
+                        tableList.value = res;
+                    });
+                    break;
+                case 6: // 入库记录
+                    queryResultLoadingAndInfo(QueryAreaStockApply, loading, { spotcontractid: relatedid, inouttype: '1,3' }).then((res) => {
+                        columns.value = columnsInWarehouse;
+                        tableList.value = res;
+                    });
+                    break;
+                case 7: // 变更记录
+                    queryResultLoadingAndInfo(QueryChangeLog, loading, { RelatedId: relatedid }).then((res) => {
+                        columns.value = columnsInWarehouse;
+                        tableList.value = res;
+                    });
+                    break;
+            }
+        }
         function submit() {
             cancel();
 
-            let kxParam: QueryBusinessKxReq = {
-                relatedid: props.selectedRow.spotcontractid,
-            };
-            requestResultLoadingAndInfo(QueryBusinessKx, kxParam, loading, ['款项记录请求成功', '款项记录请求失败:']).then((res) => {
-                console.log('款项记录请求成功:  \n');
-                console.log(res);
-                cancel();
-                context.emit('refresh');
-            });
+            // let kxParam: QueryBusinessKxReq = {
+            //     relatedid: props.selectedRow.spotcontractid,
+            // };
+            // requestResultLoadingAndInfo(QueryBusinessKx, kxParam, loading, ['款项记录请求成功', '款项记录请求失败:']).then((res) => {
+            //     console.log('款项记录请求成功:  \n');
+            //     console.log(res);
+            //     cancel();
+            //     context.emit('refresh');
+            // });
 
             let jsParam: QueryBusinessJsReq = {
                 relatedid: props.selectedRow.spotcontractid,
@@ -147,107 +193,17 @@ export default defineComponent({
             });
         }
 
-        const columns = [
-            {
-                title: '序号',
-                dataIndex: 'no',
-                key: 'no',
-                align: 'center',
-            },
-            {
-                title: '点价登记时间',
-                dataIndex: 'time',
-                key: 'time',
-                align: 'center',
-            },
-            {
-                title: '点价审核时间',
-                dataIndex: 'adutTime',
-                key: 'adutTime',
-                align: 'center',
-            },
-            {
-                title: '点价价格',
-                dataIndex: 'price',
-                key: 'price',
-                align: 'center',
-            },
-            {
-                title: '升贴水',
-                dataIndex: 'money',
-                key: 'money',
-                align: 'center',
-            },
-            {
-                title: '点价数量',
-                dataIndex: 'num',
-                key: 'num',
-                align: 'center',
-            },
-            {
-                title: '点价金额',
-                dataIndex: 'pointAmount',
-                key: 'pointAmount',
-                align: 'center',
-            },
-            {
-                title: '申请人',
-                dataIndex: 'apply',
-                key: 'apply',
-                align: 'center',
-            },
-            {
-                title: '审核人',
-                dataIndex: 'adutPerson',
-                key: 'adutPerson',
-                align: 'center',
-            },
-            {
-                title: '状态',
-                dataIndex: 'status',
-                key: 'status',
-                align: 'center',
-                slots: { customRender: 'status' },
-            },
-        ];
-
-        const data = [
-            {
-                key: '1',
-                no: '1',
-                time: '20-12-01 19:37',
-                adutTime: '20-12-01 20:37',
-                price: '1000.00',
-                money: '100',
-                num: '1',
-                pointAmount: '10100.00',
-                apply: 'lishunli',
-                adutPerson: 'wamgping',
-                status: '审核通过',
-            },
-            {
-                key: '2',
-                no: '2',
-                time: '20-12-01 19:37',
-                adutTime: '20-12-01 20:37',
-                price: '1000.00',
-                money: '100',
-                num: '1',
-                pointAmount: '10100.00',
-                apply: 'lishunli',
-                adutPerson: 'wamgping',
-                status: '审核驳回',
-            },
-        ];
         return {
             visible,
             cancel,
             submit,
             loading,
-            maskClosableFlag,
-            activeKey: ref('1'),
+            maskClosableFlag: false,
+            activeKey,
             columns,
-            data,
+            tableList,
+            tabList,
+            tabClick,
         };
     },
 });

+ 58 - 0
src/views/information/spot-contract/components/detail/setup.ts

@@ -0,0 +1,58 @@
+
+export const columnsPointPrice = [
+    { title: '序号', dataIndex: 'index', key: 'index', align: 'center', },
+    { title: '点价登记时间', dataIndex: 'applytime', key: 'applytime', align: 'center', },
+    { title: '点价审核时间', dataIndex: 'audittime', key: 'audittime', align: 'center', },
+    { title: '点价价格', dataIndex: 'pricedPrice', key: 'pricedPrice', align: 'center', },
+    { title: '升贴水', dataIndex: 'pricemove', key: 'pricemove', align: 'center', },
+    { title: '点价数量', dataIndex: 'pricedQty', key: 'pricedQty', align: 'center', },
+    { title: '点价金额', dataIndex: 'amount', key: 'amount', align: 'center', },
+    { title: '申请人', dataIndex: 'applyname', key: 'applyname', align: 'center', },
+    { title: '审核人', dataIndex: 'auditname', key: 'auditname', align: 'center', },
+    { title: '状态', dataIndex: 'applystatus', key: 'applystatus', align: 'center', slots: { customRender: 'status' }, },
+]
+export const columnsSettlement = [
+    { title: '序号', dataIndex: 'index', key: 'index', align: 'center', },
+    { title: '交收登记时间', dataIndex: 'applytime', key: 'applytime', align: 'center', },
+    { title: '交收审核时间', dataIndex: 'audittime', key: 'audittime', align: 'center', },
+    { title: '交收量', dataIndex: 'reckonrealqty', key: 'reckonrealqty', align: 'center', },
+    { title: '其他费用', dataIndex: 'reckonotheramount', key: 'reckonotheramount', align: 'center', },
+    { title: '调整保证金', dataIndex: 'addmargin', key: 'addmargin', align: 'center', },
+    { title: '调整金额', dataIndex: 'reckonadjustamount', key: 'reckonadjustamount', align: 'center', },
+    { title: '申请人', dataIndex: 'apply', key: 'apply', align: 'center', },
+    { title: '审核人', dataIndex: 'adutPerson', key: 'adutPerson', align: 'center', },
+    { title: '状态', dataIndex: 'applystatus', key: 'applystatus', align: 'center', slots: { customRender: 'status' }, },
+];
+export const columnsFund = [
+    { title: '序号', dataIndex: 'no', key: 'no', align: 'center', },
+    { title: '款项登记时间', dataIndex: 'applytime', key: 'applytime', align: 'center', },
+    { title: '款项审核时间', dataIndex: 'audittime', key: 'audittime', align: 'center', },
+    { title: '款项类型', dataIndex: 'kxtype', key: 'kxtype', align: 'center', },
+    { title: '金额', dataIndex: 'payamount', key: 'payamount', align: 'center', },
+    { title: '申请人', dataIndex: 'applyname', key: 'applyname', align: 'center', },
+    { title: '审核人', dataIndex: 'auditname', key: 'auditname', align: 'center', },
+    { title: '状态', dataIndex: 'applystatus', key: 'applystatus', align: 'center', slots: { customRender: 'status' }, },
+];
+export const columnsInvoice = [
+    { title: '序号', dataIndex: 'no', key: 'no', align: 'center', },
+    { title: '发票登记时间', dataIndex: 'applytime', key: 'applytime', align: 'center', },
+    { title: '发票审核时间', dataIndex: 'audittime', key: 'audittime', align: 'center', },
+    { title: '发票类型', dataIndex: 'kxtype', key: 'kxtype', align: 'center', },
+    { title: '金额', dataIndex: 'payamount', key: 'payamount', align: 'center', },
+    { title: '申请人', dataIndex: 'applyname', key: 'applyname', align: 'center', },
+    { title: '审核人', dataIndex: 'auditname', key: 'auditname', align: 'center', },
+    { title: '状态', dataIndex: 'applystatus', key: 'applystatus', align: 'center', slots: { customRender: 'status' }, },
+];
+export const columnsInWarehouse = [
+    { title: '序号', dataIndex: 'no', key: 'no', align: 'center', },
+    { title: '入库登记时间', dataIndex: 'applytime', key: 'applytime', align: 'center', },
+    { title: '入库审核时间', dataIndex: 'audittime', key: 'audittime', align: 'center', },
+    { title: '现货品种', dataIndex: 'kxtype', key: 'kxtype', align: 'center', },
+    { title: '品类', dataIndex: 'payamount', key: 'payamount', align: 'center', },
+    { title: '品牌', dataIndex: 'applyname', key: 'applyname', align: 'center', },
+    { title: '仓库', dataIndex: 'auditname', key: 'auditname', align: 'center', },
+    { title: '类型', dataIndex: 'applystatus', key: 'applystatus', align: 'center' },
+    { title: '数量', dataIndex: 'applystatus', key: 'applystatus', align: 'center' },
+];
+
+