浏览代码

修改现货合同

huangbin 4 年之前
父节点
当前提交
b4ca622428

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

@@ -24,6 +24,7 @@ export interface ComposeTableParam {
     menuType: keyof ButtonListKey,  // 操作按钮列表key
     tableName: keyof TableKey, // 表头key
     tableFilterKey: string[], // 表格过滤字段
+    tableFilterCB?: Function, // 表格过滤字段回调函数
     isDetail: boolean,  // 是否需要详情
 }
 

+ 12 - 16
src/views/information/spot-contract/components/add/index.vue

@@ -420,8 +420,7 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, PropType, ref, watchEffect } from 'vue';
-import { closeModal } from '@/common/setup/modal/index';
+import { defineComponent, PropType, ref } from 'vue';
 import { addContractReq } from './setup';
 import { getUserName, getUsrId } from '@/services/bus/user';
 import { getGoodsList } from '@/services/bus/goods';
@@ -436,6 +435,7 @@ import { ErmcpLoginUser } from '@/services/go/ermcp/account/interface';
 import { handlerManagerList } from '@/common/setup/user';
 import { getUploadImg } from '@/common/setup/upload';
 import UploadImg from '@/common/components/uploadImg/index.vue';
+import { _closeModal } from '@/common/setup/modal/modal';
 
 export default defineComponent({
     name: 'add-spot-contract',
@@ -447,7 +447,7 @@ export default defineComponent({
         },
     },
     setup(props, context) {
-        const { visible, cancel } = closeModal('spot_contract_btn_add');
+        const { visible, cancel } = _closeModal(context);
         const { sendReq } = addContractReq();
         const loading = ref<boolean>(false);
 
@@ -476,17 +476,14 @@ export default defineComponent({
         // 现货商品列表
         const goodsList = ref<Goods[]>([]);
         const { getFirstImg, uploadImgAction } = getUploadImg();
-        watchEffect(() => {
-            if (visible.value) {
-                queryCustomList();
-                getDeliveryGoods();
-                queryTradeManager();
-                goodsList.value = getGoodsList();
-                queryBusinessManager().then(() => {
-                    businesserList.value = getBusinesserOrMerchandiser('22');
-                    merchandiserList.value = getBusinesserOrMerchandiser('23');
-                });
-            }
+
+        queryCustomList();
+        getDeliveryGoods();
+        queryTradeManager();
+        goodsList.value = getGoodsList();
+        queryBusinessManager().then(() => {
+            businesserList.value = getBusinesserOrMerchandiser('22');
+            merchandiserList.value = getBusinesserOrMerchandiser('23');
         });
         function submit(OperateType: 1 | 2) {
             validateAction<FormState>(formRef, formState).then((param) => {
@@ -515,8 +512,7 @@ export default defineComponent({
                 param.ContractAttachment = getFirstImg();
                 sendReq(param, loading, OperateType)
                     .then((res) => {
-                        context.emit('refresh');
-                        closeAction();
+                        cancel(true);
                     })
                     .catch((err) => {});
             });

+ 4 - 11
src/views/information/spot-contract/components/delete/index.vue

@@ -16,21 +16,19 @@
                 :loading="loading"
                 @click="submit">确认删除</a-button>
     </template>
-    <InfoDetail :selectedRow="selectedRow"
-                :businessManager="businessManager" />
+    <InfoDetail :selectedRow="selectedRow" />
 
   </a-modal>
 </template>
 
 <script lang="ts">
 import { defineComponent, PropType, ref } from 'vue';
-import { closeModal } from '@/common/setup/modal/index';
 import { Ermcp3ContractRsp } from '@/services/go/ermcp/spot-contract/interface';
 import { Modal } from 'ant-design-vue';
 import { orderContractControl } from '@/views/information/spot-contract/components/setup';
 import { GldErmcpSpotContractOperateReq } from '@/services/proto/spotcontract/interface';
 import InfoDetail from '../infoDetail/index.vue';
-import { ErmcpLoginUserEx } from '@/services/go/ermcp/account/interface';
+import { _closeModal } from '@/common/setup/modal/modal';
 
 export default defineComponent({
     name: 'delete-spot-contract',
@@ -42,13 +40,9 @@ export default defineComponent({
             type: Object as PropType<Ermcp3ContractRsp>,
             default: {},
         },
-        businessManager: {
-            type: Array as PropType<ErmcpLoginUserEx[]>,
-            default: [],
-        },
     },
     setup(props, context) {
-        const { visible, cancel } = closeModal('spot_contract_btn_delete');
+        const { visible, cancel } = _closeModal(context);
         const loading = ref<boolean>(false);
         const maskClosableFlag = ref<boolean>(false);
         // 获取 业务账户
@@ -67,8 +61,7 @@ export default defineComponent({
                     orderContractControl(params, loading)
                         .then((res) => {
                             // 通知上层  刷新数据
-                            context.emit('refresh');
-                            cancel();
+                            cancel(true);
                         })
                         .catch((err) => {});
                 },

+ 26 - 37
src/views/information/spot-contract/components/detail/index.vue

@@ -22,7 +22,6 @@
       </a-tab-pane>
     </a-tabs>
     <InfoDetail :selectedRow="selectedRow"
-                :businessManager="businessManager"
                 v-if="activeKey == 1" />
     <div class="tableDatas"
          v-else>
@@ -60,8 +59,7 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, PropType, ref, watchEffect } from 'vue';
-import { closeModal } from '@/common/setup/modal/index';
+import { defineComponent, PropType, ref } from 'vue';
 import { Ermcp3ContractRsp } from '@/services/go/ermcp/spot-contract/interface';
 import { queryResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 import { QueryBusinessFp, QueryBusinessKx } from '@/services/go/ermcp/finance-review';
@@ -75,6 +73,7 @@ import { getTableColumns } from '@/common/setup/table';
 import { invoiceStatusName } from '@/views/manage/finance-review/setup';
 import { getPlanContractType } from '@/views/business/plan/setup';
 import { InOutTypeName } from '@/views/manage/inventory-review/setup';
+import { _closeModal } from '@/common/setup/modal/modal';
 
 export default defineComponent({
     name: 'spot-contract-detail',
@@ -84,13 +83,9 @@ export default defineComponent({
             type: Object as PropType<Ermcp3ContractRsp>,
             default: {},
         },
-        businessManager: {
-            type: Array as PropType<ErmcpLoginUserEx[]>,
-            default: [],
-        },
     },
     setup: function(props, context) {
-        const { visible, cancel } = closeModal('detail');
+        const { visible, cancel } = _closeModal(context);
         const tabList = ref<{ key: number; name: string }[]>([]);
 
         const activeKey = ref<number>(1);
@@ -99,36 +94,30 @@ export default defineComponent({
         const tableList = ref<any[]>([]);
         // 表头数据
         const { columns, registerColumn } = getTableColumns();
-        watchEffect(() => {
-            if (visible.value && props.selectedRow.contracctstatus) {
-                // 审核拒绝和未提交不显示后面的选项
-
-                console.log(props.selectedRow.contracctstatus);
 
-                tabList.value = [0, 4, 6].includes(props.selectedRow.contracctstatus)
-                    ? [{ key: 1, name: '合同详情' }]
-                    : props.selectedRow.contracttype === 1
-                    ? [
-                          { key: 1, name: '合同详情' },
-                          { key: 2, name: '点价记录' },
-                          { key: 3, name: '交收记录' },
-                          { key: 4, name: '款项记录' },
-                          { key: 5, name: '发票记录' },
-                          { key: 6, name: '入库记录' },
-                          { key: 8, name: '变更记录' },
-                      ]
-                    : [
-                          { key: 1, name: '合同详情' },
-                          { key: 2, name: '点价记录' },
-                          { key: 3, name: '交收记录' },
-                          { key: 4, name: '款项记录' },
-                          { key: 5, name: '发票记录' },
-                          { key: 7, name: '出库记录' },
-                          { key: 8, name: '变更记录' },
-                      ];
-                activeKey.value = 1;
-            }
-        });
+        // 审核拒绝和未提交不显示后面的选项
+        tabList.value = [0, 4, 6].includes(props.selectedRow.contracctstatus)
+            ? [{ key: 1, name: '合同详情' }]
+            : props.selectedRow.contracttype === 1
+            ? [
+                  { key: 1, name: '合同详情' },
+                  { key: 2, name: '点价记录' },
+                  { key: 3, name: '交收记录' },
+                  { key: 4, name: '款项记录' },
+                  { key: 5, name: '发票记录' },
+                  { key: 6, name: '入库记录' },
+                  { key: 8, name: '变更记录' },
+              ]
+            : [
+                  { key: 1, name: '合同详情' },
+                  { key: 2, name: '点价记录' },
+                  { key: 3, name: '交收记录' },
+                  { key: 4, name: '款项记录' },
+                  { key: 5, name: '发票记录' },
+                  { key: 7, name: '出库记录' },
+                  { key: 8, name: '变更记录' },
+              ];
+        activeKey.value = 1;
         function tabClick() {
             const relatedid = props.selectedRow.spotcontractid;
             switch (activeKey.value) {

+ 11 - 23
src/views/information/spot-contract/components/infoDetail/index.vue

@@ -8,13 +8,12 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, PropType, ref, watchEffect } from 'vue';
+import { defineComponent, PropType } from 'vue';
 import { Ermcp3ContractRsp } from '@/services/go/ermcp/spot-contract/interface';
 import { formatValue } from '@/common/methods';
-import { ErmcpLoginUserEx } from '@/services/go/ermcp/account/interface';
 import Detail from '../common-detail/index.vue';
 import { Des, handleDesList } from '@/common/components/commonDes';
-import { handlerManagerList } from '@/common/setup/user';
+import { businessManager, findManagerName } from '../../list/setup';
 
 export default defineComponent({
     name: 'spot-contract-info-detail',
@@ -24,30 +23,19 @@ export default defineComponent({
             type: Object as PropType<Ermcp3ContractRsp>,
             default: {},
         },
-        businessManager: {
-            type: Array as PropType<ErmcpLoginUserEx[]>,
-            default: [],
-        },
     },
     setup(props, context) {
-        const loading = ref<boolean>(false);
         // 预览附件
         const { desList, getDesList } = handleDesList();
-        // 获取 业务账户
-        const { findManagerName } = handlerManagerList(loading, 1);
-        watchEffect(() => {
-            if (props.selectedRow.contracctstatus) {
-                const data = props.selectedRow;
-                const list = [
-                    { label: '保证金', value: formatValue(data.contractmargin) },
-                    { label: '业务员', value: formatValue(findManagerName(data.saleuserid, props.businessManager)) },
-                    { label: '跟单员', value: formatValue(findManagerName(data.meruserid, props.businessManager)) },
-                    { label: '交易用户', value: formatValue(data.tradeusername) },
-                    { label: '备注', value: formatValue(data.remark) },
-                ];
-                getDesList(list);
-            }
-        });
+        const data = props.selectedRow;
+        const list = [
+            { label: '保证金', value: formatValue(data.contractmargin) },
+            { label: '业务员', value: formatValue(findManagerName(data.saleuserid, businessManager.value)) },
+            { label: '跟单员', value: formatValue(findManagerName(data.meruserid, businessManager.value)) },
+            { label: '交易用户', value: formatValue(data.tradeusername) },
+            { label: '备注', value: formatValue(data.remark) },
+        ];
+        getDesList(list);
         return {
             desList,
         };

+ 41 - 46
src/views/information/spot-contract/components/modify/index.vue

@@ -411,8 +411,7 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, PropType, ref, watchEffect } from 'vue';
-import { closeModal } from '@/common/setup/modal/index';
+import { defineComponent, PropType, ref } from 'vue';
 import { getUserName, getUsrId } from '@/services/bus/user';
 import { getGoodsList } from '@/services/bus/goods';
 import { Goods } from '@/services/go/ermcp/goodsInfo/interface';
@@ -428,6 +427,7 @@ import { ErmcpLoginUser } from '@/services/go/ermcp/account/interface';
 import { handlerManagerList } from '@/common/setup/user';
 import { getUploadImg } from '@/common/setup/upload';
 import UploadImg from '@/common/components/uploadImg/index.vue';
+import { _closeModal } from '@/common/setup/modal/modal';
 
 export default defineComponent({
     name: 'spot_contract_btn_modify',
@@ -439,7 +439,7 @@ export default defineComponent({
     },
     components: { UploadImg },
     setup(props, context) {
-        const { visible, cancel } = closeModal('spot_contract_btn_modify');
+        const { visible, cancel } = _closeModal(context);
         const loading = ref<boolean>(false);
         const { sendReq } = addContractReq();
         const { formState, businessType } = handleFromState();
@@ -468,48 +468,44 @@ export default defineComponent({
         // 现货商品列表
         const goodsList = ref<Goods[]>([]);
         const { uploadImgAction, uploadImgList, handleImg } = getUploadImg();
-        watchEffect(() => {
-            if (visible.value) {
-                queryCustomList();
-                getDeliveryGoods();
-                goodsList.value = getGoodsList();
-                queryBusinessManager().then(() => {
-                    businesserList.value = getBusinesserOrMerchandiser('22');
-                    merchandiserList.value = getBusinesserOrMerchandiser('23');
-                });
-                queryTradeManager();
-                mergeTwoObj(formState, props.selectedRow);
-                isSell.value = formState.ContractType === 1 ? false : true;
-                const { deliverygoodsid, qty, price, wrstandardid, spotgoodsbrandid, currencyid, attachment, deliverystartdate, deliveryenddate, startdate, enddate } = props.selectedRow;
-                if (deliverygoodsid) {
-                    deliveryGoodsChange(deliverygoodsid);
-                    if (wrstandardid) {
-                        WrStandardChange(wrstandardid);
-                        formState.WrStandardID = wrstandardid;
-                        formState.SpotGoodsBrandID = spotgoodsbrandid;
-                    }
-                }
-                formState.Qty = qty.toString();
-                formState.Price = price.toString();
-                formState.CurrencyID = currencyid;
-                formState.ContractAttachment = attachment;
-                if (deliverystartdate) {
-                    deliveryDate.value.push(moment(deliverystartdate));
-                }
-                if (deliveryenddate) {
-                    deliveryDate.value.push(moment(deliveryenddate));
-                }
-                if (startdate) {
-                    priceDate.value.push(moment(startdate));
-                }
-                if (enddate) {
-                    priceDate.value.push(moment(enddate));
-                }
-                if (attachment) {
-                    uploadImgList.value = handleImg(attachment);
-                }
-            }
+        queryCustomList();
+        getDeliveryGoods();
+        goodsList.value = getGoodsList();
+        queryBusinessManager().then(() => {
+            businesserList.value = getBusinesserOrMerchandiser('22');
+            merchandiserList.value = getBusinesserOrMerchandiser('23');
         });
+        queryTradeManager();
+        mergeTwoObj(formState, props.selectedRow);
+        isSell.value = formState.ContractType === 1 ? false : true;
+        const { deliverygoodsid, qty, price, wrstandardid, spotgoodsbrandid, currencyid, attachment, deliverystartdate, deliveryenddate, startdate, enddate } = props.selectedRow;
+        if (deliverygoodsid) {
+            deliveryGoodsChange(deliverygoodsid);
+            if (wrstandardid) {
+                WrStandardChange(wrstandardid);
+                formState.WrStandardID = wrstandardid;
+                formState.SpotGoodsBrandID = spotgoodsbrandid;
+            }
+        }
+        formState.Qty = qty.toString();
+        formState.Price = price.toString();
+        formState.CurrencyID = currencyid;
+        formState.ContractAttachment = attachment;
+        if (deliverystartdate) {
+            deliveryDate.value.push(moment(deliverystartdate));
+        }
+        if (deliveryenddate) {
+            deliveryDate.value.push(moment(deliveryenddate));
+        }
+        if (startdate) {
+            priceDate.value.push(moment(startdate));
+        }
+        if (enddate) {
+            priceDate.value.push(moment(enddate));
+        }
+        if (attachment) {
+            uploadImgList.value = handleImg(attachment);
+        }
         function submit() {
             validateAction<FormState>(formRef, formState).then((param) => {
                 const id = getUsrId();
@@ -536,8 +532,7 @@ export default defineComponent({
 
                 sendReq(param, loading, 2)
                     .then((res) => {
-                        context.emit('refresh');
-                        cancel();
+                        cancel(true);
                     })
                     .catch((err) => {});
             });

+ 8 - 2
src/views/information/spot-contract/list/setup.ts

@@ -1,3 +1,4 @@
+import { handlerManagerList } from '@/common/setup/user';
 import { QuerySpotContract } from '@/services/go/ermcp/spot-contract/index';
 import { Ermcp3ContractRsp } from '@/services/go/ermcp/spot-contract/interface';
 import { message } from 'ant-design-vue';
@@ -8,8 +9,8 @@ type EnumType = 1 | 2 | 3 | 4;
 
 /**
  * 获取表格列表数据
- * @param type 
- * @returns 
+ * @param type
+ * @returns
  */
 export function queryTableList(type: EnumType) {
     // 加载状态
@@ -33,3 +34,8 @@ export function queryTableList(type: EnumType) {
     return { loading, tableList, queryTable }
 }
 
+// 获取 业务账户
+const { tableList, queryTable, findManagerName } = handlerManagerList(ref<boolean>(false), 1);
+
+export { tableList as businessManager, queryTable as queryBusinessManager, findManagerName };
+

+ 109 - 116
src/views/information/spot-contract/list/unsubmitted/index.vue

@@ -3,149 +3,143 @@
   <div class="spot-contract-not-commit"
        :loading="loading">
     <filterCustomTable @search="updateColumn">
-      <BtnList :btnList="commonBtn" />
+      <BtnList :btnList="firstBtn"
+               @click="openComponent" />
     </filterCustomTable>
-    <contextMenu :contextMenuList="forDataBtn">
-      <a-table :columns="columns"
-               class="topOrderTable"
-               :pagination="false"
-               :expandedRowKeys="expandedRowKeys"
-               :customRow="Rowclick"
-               rowKey="key"
-               :data-source="tableList"
-               :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }">
-        <!-- 额外的展开行 -->
-        <template #expandedRowRender="{  }">
-          <BtnList :btnList="forDataBtn" />
-        </template>
-        <!-- <template #userinfotype="{ text }">
-                          <a>{{ text === '2' ? '企业' : '个人'}}</a>
-                        </template> -->
-        <template #biztype="{ text }">
-          <a>{{ getBizTypeName(text) }}</a>
-        </template>
+    <a-table :columns="columns"
+             class="topOrderTable"
+             :pagination="false"
+             :expandedRowKeys="expandedRowKeys"
+             :customRow="Rowclick"
+             rowKey="key"
+             :data-source="tableList"
+             :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }">
+      <!-- 额外的展开行 -->
+      <template #expandedRowRender="{ record }">
+        <BtnList :btnList="secondBtn"
+                 :record="record"
+                 @click="openComponent" />
+      </template>
+      <template #biztype="{ text }">
+        <a>{{ getBizTypeName(text) }}</a>
+      </template>
 
-        <template #pricetype="{ text }">
-          <a>{{ getPriceTypeName(text) }}</a>
-        </template>
+      <template #pricetype="{ text }">
+        <a>{{ getPriceTypeName(text) }}</a>
+      </template>
 
-        <template #contracctstatus="{ text }">
-          <a>{{ getContractStatusName(text) }}</a>
-        </template>
+      <template #contracctstatus="{ text }">
+        <a>{{ getContractStatusName(text) }}</a>
+      </template>
 
-        <template #contracttype="{ text }">
-          <a>{{ getContractTypeName(text) }}</a>
-        </template>
-        <!-- 对手方 -->
-        <template #negative="{ record }">
-          <a>{{ record.contracttype === 1 ? record.sellusername : record.buyusername }}</a>
-        </template>
-        <!-- 点假期 -->
-        <template #startdate="{ record }">
-          <a>{{ formatValue(formatTime(record.startdate, "d") + '--' + formatTime(record.enddate, "d")) }}</a>
-        </template>
-        <!-- 交收期 -->
-        <template #deliverystartdate="{ record }">
-          <a>{{ formatValue(formatTime(record.deliverystartdate, "d") + '--' +
+      <template #contracttype="{ text }">
+        <a>{{ getContractTypeName(text) }}</a>
+      </template>
+      <!-- 对手方 -->
+      <template #negative="{ record }">
+        <a>{{ record.contracttype === 1 ? record.sellusername : record.buyusername }}</a>
+      </template>
+      <!-- 点假期 -->
+      <template #startdate="{ record }">
+        <a>{{ formatValue(formatTime(record.startdate, "d") + '--' + formatTime(record.enddate, "d")) }}</a>
+      </template>
+      <!-- 交收期 -->
+      <template #deliverystartdate="{ record }">
+        <a>{{ formatValue(formatTime(record.deliverystartdate, "d") + '--' +
                         formatTime(record.deliveryenddate, "d")) }}</a>
-        </template>
-        <!-- 业务员 -->
-        <template #saleuserid="{ record }">
-          <a>{{ findManagerName(record.saleuserid) }}</a>
-        </template>
+      </template>
+      <!-- 业务员 -->
+      <template #saleuserid="{ record }">
+        <a>{{ findManagerName(record.saleuserid) }}</a>
+      </template>
 
-        <!-- 跟单员 -->
-        <template #meruserid="{ record }">
-          <a>{{ findManagerName(record.meruserid) }}</a>
-        </template>
-      </a-table>
+      <!-- 跟单员 -->
+      <template #meruserid="{ record }">
+        <a>{{ findManagerName(record.meruserid) }}</a>
+      </template>
+    </a-table>
+    <!-- 右键 -->
+    <contextMenu :contextMenu="contextMenu"
+                 @cancel="closeContext"
+                 :list="secondBtn">
     </contextMenu>
-    <!-- 新增现货合同 -->
-    <AddSpotContract @refresh="queryTable" />
-    <!-- 现货合同: 详情 -->
-    <SpotContractDeatil :selectedRow="selectedRow"
-                        :businessManager="businessManager"
-                        @refresh="queryTable" />
-    <!-- 现货合同: 修改 -->
-    <ModifySpotContract :selectedRow="selectedRow"
-                        @refresh="queryTable" />
-    <!-- 现货合同: 删除 -->
-    <DeleteSpotContract :selectedRow="selectedRow"
-                        :businessManager="businessManager"
-                        @refresh="queryTable" />
+    <component :is="componentId"
+               v-if="componentId"
+               :selectedRow="selectedRow"
+               @cancel="closeComponent"></component>
   </div>
 </template>
 
 <script lang="ts">
-import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList } from '@/common/export/table';
-import { AddSpotContract, SpotContractDeatil, filterCustomTable, ModifySpotContract, DeleteSpotContract } from '../../components';
+import { defineComponent, _getBtnList } from '@/common/export/table';
+import { filterCustomTable } from '../../components';
 
-import { queryTableList, Ermcp3ContractRsp } from '../index';
-import { Column, ColumnType } from '@/common/setup/table';
+import { Column, ColumnType, queryTableList } from '@/common/setup/table';
 import { formatTime, formatValue } from '@/common/methods';
-import { handlerManagerList } from '@/common/setup/user';
-import { reactive } from '@vue/reactivity';
+import { queryBusinessManager, findManagerName } from '../setup';
 import { getPriceTypeName, getBizTypeName, getContractStatusName, getContractTypeName } from '@/common/constants/enumsName';
+import BtnList from '@/common/components/btnList/index.vue';
+import contextMenu from '@/common/components/contextMenu/temp.vue';
+import { defineAsyncComponent } from 'vue';
+import { ModalEnum } from '@/common/constants/modalNameEnum';
+import { ComposeTableParam, handleComposeTable } from '@/common/setup/table/compose';
+import { Ermcp3ContractRsp } from '@/services/go/ermcp/spot-contract/interface';
+import { QuerySpotContract } from '@/services/go/ermcp/spot-contract';
+
+const Add = defineAsyncComponent(() => import('../../components/add/index.vue'));
+const Detail = defineAsyncComponent(() => import('../../components/detail/index.vue'));
+const Modify = defineAsyncComponent(() => import('../../components/modify/index.vue'));
+const Delete = defineAsyncComponent(() => import('../../components/delete/index.vue'));
 
 export default defineComponent({
     name: 'spot-contract-not-commit',
     components: {
         filterCustomTable,
         contextMenu,
-        AddSpotContract,
-        SpotContractDeatil,
-        ModifySpotContract,
-        DeleteSpotContract,
+        [ModalEnum.detail]: Detail,
+        [ModalEnum.spot_contract_btn_add]: Add,
+        [ModalEnum.spot_contract_btn_modify]: Modify,
+        [ModalEnum.spot_contract_btn_delete]: Delete,
         BtnList,
     },
     setup() {
-        // 表头数据
-        const { columns, registerColumn, updateColumn } = getTableColumns();
-        // 表格事件
-        const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<Ermcp3ContractRsp>({});
-        // 表格操作按钮列表
-        const { commonBtn, forDataBtn } = getBtnList('spot_contract_unsubmitted', true);
         // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList(1);
-        console.log(loading);
-        const a = reactive({ name: 'hello' });
-        console.log(a);
-
-        // 获取 业务账户
-        const { tableList: businessManager, queryTable: queryBusinessManager, findManagerName } = handlerManagerList(loading, 1);
-
-        initData(() => {
-            // 获取列表数据
-            queryTable();
-            // 注册表头信息 过滤
-            registerColumn('table_pcweb_delivery', ['contracttype', 'pricetype', 'contractno'], (e: Column, item: ColumnType, filtered: any) => {
-                if (e.columntitle === '对手方') {
-                    item.onFilter = (value: string, record: Ermcp3ContractRsp) => {
-                        if (record.contracttype === 1) {
-                            //采购方
-                            return record.sellusername.includes(value);
-                        } else {
-                            // 销售
-                            return record.buyusername.includes(value);
-                        }
-                    };
-                    item.filteredValue = filtered.negative || null;
-                }
-            });
+        const { loading, tableList, queryTable } = queryTableList<Ermcp3ContractRsp>();
+        // 获取列表数据
+        const queryTableAction = () => {
+            queryTable(QuerySpotContract, { querytype: 1 });
+            // 获取 业务账户
             queryBusinessManager();
-        });
-        return {
-            columns,
+        };
+        // 表格过滤回调函数,处理特殊字段
+        const tableFilterCB = (e: Column, item: ColumnType, filtered: any) => {
+            if (e.columntitle === '对手方') {
+                item.onFilter = (value: string, record: Ermcp3ContractRsp) => {
+                    if (record.contracttype === 1) {
+                        //采购方
+                        return record.sellusername.includes(value);
+                    } else {
+                        // 销售
+                        return record.buyusername.includes(value);
+                    }
+                };
+                item.filteredValue = filtered.negative || null;
+            }
+        };
+        // 表格通用逻辑
+        const param: ComposeTableParam = {
+            queryFn: queryTableAction,
+            menuType: 'spot_contract_unsubmitted',
+            tableName: 'table_pcweb_delivery',
+            tableFilterKey: ['contracttype', 'pricetype', 'contractno'],
+            tableFilterCB,
+            isDetail: true,
+        };
 
-            expandedRowKeys,
-            selectedRow,
-            Rowclick,
-            commonBtn,
-            forDataBtn,
+        return {
+            ...handleComposeTable<Ermcp3ContractRsp>(param),
             loading,
             tableList,
-            updateColumn,
-            queryTable,
             getBizTypeName,
             getPriceTypeName,
             getContractStatusName,
@@ -153,7 +147,6 @@ export default defineComponent({
             formatTime,
             formatValue,
             findManagerName,
-            businessManager,
         };
     },
 });