Bläddra i källkod

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

marymelisa 4 år sedan
förälder
incheckning
497c612cea

+ 52 - 0
src/common/setup/buttonPermission/index.ts

@@ -0,0 +1,52 @@
+// 按钮权限
+import { MenuItem } from '@/common/components/contextMenu/interface';
+import { openModal } from '@/common/setup/modal/index';
+import { ModalName } from '@/common/setup/modal/interface';
+import { OperationTabMenu } from '@/services/go/commonService/interface';
+import { inject, Ref } from 'vue';
+import { BtnType, MenuType } from './interface';
+
+/**
+ * 详情 按钮
+ * @param modalName 相对应的弹窗组件名
+ * @param contextMenuList 右键列表
+ */
+export function detailButton(modalName: keyof ModalName, contextMenuList: Ref<MenuItem[]>) {
+    const { openAction } = openModal(modalName);
+    contextMenuList.value.push({ lable: '详情', callback: openAction });
+}
+
+/**
+ * 权限 按钮
+ * @param modalName 相对应的弹窗组件名
+ * @param lable 按钮名
+ * @param contextMenuList 右键列表
+ */
+export function permissionButton(modalName: keyof ModalName, lable: string, contextMenuList: Ref<MenuItem[]>) {
+    const { openAction } = openModal(modalName);
+    function action() {
+        contextMenuList.value.push({ lable, callback: openAction });
+    }
+    return { action };
+}
+
+/**
+ * 判断某个按钮是否有权限
+ * @param menuType 
+ * @returns 
+ */
+export function handlePermission(menuType: keyof MenuType) {
+    const permissionData = inject('thirdMenuList') as Ref<OperationTabMenu[]>;
+    // 判断按钮是否有权限
+    function hasPermission(type: keyof BtnType): boolean {
+        let result = false;
+        if (permissionData) {
+            const btnList = permissionData.value.find((e) => e.code === menuType);
+            if (btnList && btnList.children) {
+                result = btnList.children.find((e) => e.code === type && e.type === 2) ? true : false;
+            }
+        }
+        return result;
+    }
+    return { hasPermission };
+}

+ 12 - 0
src/common/setup/buttonPermission/interface.ts

@@ -0,0 +1,12 @@
+export interface MenuType {
+    custom_info_normal: string; // 客户资料 正常
+    custom_info_disabled: string; // 客户资料 停用
+}
+
+export interface BtnType {
+    custom_info_btn_add: string; // 客户资料 添加
+    custom_info_btn_modify: string; // 客户资料 修改
+    custom_info_btn_disable: string; // 客户资料 停用
+    custom_info_btn_recover: string; // 客户资料 恢复
+    custom_info_btn_delete: string; // 客户资料 删除
+}

+ 4 - 0
src/common/setup/modal/interface.ts

@@ -12,4 +12,8 @@ export interface ModalName {
     customDetail: string; // 客户资料详情
 
     addSpotContract: string; // 新增现货合同
+    resubmitSpotContract: string; // 重新提交现货合同
+    modifySpotContract: string; // 修改现货合同
+    deleteSpotContract: string; // 删除现货合同
+    spotContractDetail: string; // 现货合同详情
 }

+ 15 - 0
src/services/go/ermcp/account/index.ts

@@ -0,0 +1,15 @@
+/** ================================= 账户管理 ================================**/
+import APP from "@/services";
+import {commonSearch_go} from "@/services/go";
+import {ErmcpBizGroupEx, ErmcpBizGroupReq} from "@/services/go/ermcp/account/interface";
+
+/**
+ * 查询业务类型分组(账户管理/账户设置) /Ermcp/QueryAccMgrBizGroupSet
+ * @constructor
+ */
+export function QueryAccMgrBizGroupSet(req: ErmcpBizGroupReq): Promise<ErmcpBizGroupEx> {
+    const userid = APP.get('userAccount').memberuserid;
+    return commonSearch_go('/Ermcp/QueryUserInfo', { req }).catch((err) => {
+        throw new Error(`查询业务类型分组: ${err.message}`);
+    });
+}

+ 43 - 0
src/services/go/ermcp/account/interface.ts

@@ -0,0 +1,43 @@
+/**
+ * 查询业务类型分组(账户管理/账户设置)
+ */
+export interface ErmcpBizGroupReq {
+    userid: number  //    用户ID
+    deliverygoodsid?: number // 现货商品id
+}
+
+/**
+ * 查询业务类型分组
+ */
+export interface ErmcpBizGroupEx {
+    acclist: ErmcpBizGroupTaAccount[] //账号列表
+    bizgroupid: number  // 业务分组id
+    biztype: number  //  业务类型 1-套保 2-套利
+    wrlist: ErmcpBizGroupSpotGoods[] // 现货商品表
+}
+
+/**
+ * 现货商品表
+ */
+export interface ErmcpBizGroupSpotGoods {
+    areauserid: number;//所属机构id
+    bizgroupid: number;//分组id
+    biztype: number;//业务类型 1-套保 2-套利
+    deliverygoodscode: string;//现货商品代码
+    deliverygoodsid: number;//现货商品id
+    deliverygoodsname: string;//现货商品名称
+    unitid: number;//现货商品单位id
+}
+
+/**
+ * 账号列表
+ */
+export interface ErmcpBizGroupTaAccount {
+    accountid: number;//账号id
+    accountname: string;//账号名称
+    areauserid: number;//所属机构id
+    bizgroupid: number;//业务分组id
+    ismain: number;//是否主账号 1-是 number;
+//-否
+}
+

+ 21 - 1
src/services/go/ermcp/goodsInfo/index.ts

@@ -2,7 +2,13 @@
 
 import APP from '@/services';
 import { commonSearch_go } from '@/services/go/index';
-import { Ermcp3Brand, Ermcp3Wrstandard, ErmcpDeliveryGoodsReq, ErmcpDeliveryGoodsRsp } from './interface';
+import {
+    Ermcp3Brand,
+    Ermcp3Wrstandard,
+    ErmcpDeliveryGoodsDetailEx,
+    ErmcpDeliveryGoodsReq,
+    ErmcpDeliveryGoodsRsp
+} from './interface';
 
 /**
  * 查询现货商品 /Ermcp3/QueryDeliveryGoods
@@ -38,3 +44,17 @@ export function QueryGoodsbrand(): Promise<Ermcp3Brand[]> {
         throw new Error(`查询商品品牌: ${err.message}`);
     });
 }
+
+/**
+ * 查询现货商品详情 /Ermcp3/QueryDeliveryGoodsDetail
+ * @param deliverygoodsid 现货商品id
+ * @constructor
+ */
+export function QueryDeliveryGoodsDetail(deliverygoodsid : number): Promise<ErmcpDeliveryGoodsDetailEx[]> {
+    const areauserid = APP.get('userAccount').memberuserid; // 所属机构id
+    return commonSearch_go('Ermcp3/QueryDeliveryGoodsDetail', { areauserid, deliverygoodsid }).catch((err) => {
+        throw new Error(`查询现货商品详情: ${err.message}`);
+    });
+}
+
+

+ 91 - 0
src/services/go/ermcp/goodsInfo/interface.ts

@@ -64,3 +64,94 @@ export interface Ermcp3Brand{
     deliverygoodsid	:number;//品种ID
 }
 
+/**
+ * 查询新货商品详情
+ */
+export interface ErmcpDeliveryGoodsDetailEx{
+    data: ErmcpDeliveryGoods;  // 现货商品信息
+    gblist: Ermcp3Brand[];     // 品牌
+    gmlist: Ermcp3Wrstandard[]; // 品类列表
+    mgList: Ermcp3MiddleGoodsDetail2[]; // 套保列表
+}
+
+/**
+ * 现货商品信息
+ */
+export interface ErmcpDeliveryGoods{
+    agreeunit	:number;//合约单位[散货时默认为1, 整装时默认为标准数量]
+    areauserid	:number;//所属机构
+    auditflag	:number;//交割是否需要审核 - number;
+//:不需要 1:需要审核 默认为number;//
+    categoryid	:number;//类别ID(SEQ_WRCATEGORY)
+    deliverygoodscode	:string;//现货品种代码
+    deliverygoodsid	:number;//现货品种ID(SEQ_DELIVERYGOODS)
+    deliverygoodsname	:string;//现货品种名称
+    deliverygoodstype	:number;//现货品种类型: 1-整装不拆分 2-散装记录明细 3:整装拆分 4:散装不记录明细
+    dgstatus	:number;//品种状态 - 作废 - number;
+//:未激活 1:正常
+    enumdicname	:string;//现货品种单位名称
+    goodsunitid	:number;//现货品种单位ID
+    isvalid	:number;//是否有效 - number;
+//:无效 1:有效
+    qtydecimalplace	:number;//成交量小数位
+    remark	:string;//备注
+    standardqty	:number;//标准数量(库位数量) [标准品特有]
+    standardqtyrange	:number;//标准数量偏差范围 [标准品特有]
+}
+
+export interface Ermcp3MiddleGoodsDetail2{
+    convertratio: number  // 套保系数(折算系数)
+    gplist: Ermcp3GoodsGroupEx[] // 关联商品组列表
+    mg: ErmcpMiddleGoodsModel[] // 套保品种
+}
+
+/**
+ * 套保品种
+ */
+export interface ErmcpMiddleGoodsModel{
+    areauserid	:number;//机构用户ID
+    createtime	:string;//修改时间
+    enumdicname	:string;//单位名称
+    evaluateratio	:number;//估价系数
+    goodsgroupid	:number;//关联期货品种ID
+    goodsunitid	:number;//单位ID
+    isvalid	:number;//状态 number;
+//-无效(停用) 1-有效(正常)
+    middlegoodscode	:string;//套保品种代码
+    middlegoodsid	:number;//套保品种ID(SEQ_ERMS_MIDDLEGOODS)
+    middlegoodsname	:string;//套保品种名称
+    modifytime	:string;//修改时间
+    needhedgeratio	:number;//套保比率
+    qtydecimalplace	:number;//数量小数位
+    relatedgoodsid	:number;//关联交易商品ID
+    relatedgoodstype	:number;//关联商品类型 - 1:期货合约 2:现货品种
+    remark	:string;//备注
+}
+
+/**
+ * 期货商品信息
+ */
+export interface Ermcp3Goods{
+    agreeunit	:number;//合约单位(合约乘数)
+    enumdicname	:string;//单位名称
+    exexchangecode	:string;//交易所代码
+    goodscode	:string;//期货商品代码
+    goodsid	:number;//期货商品id
+    goodsname	:string;//期货商品名称
+}
+
+/**
+ * 商品组信息
+ */
+export interface Ermcp3GoodsGroupEx{
+    convertratio	:number;//折算系数(品种系数)
+    enumdicname	:string;//单位名称
+    exexchangecode	:string;//交易所代码
+    glist: 	Ermcp3Goods[]
+    goodsgroupid	:number;//商品组id
+    goodsgroupname	:string;//商品组名称
+    goodsunitid	:number;//单位id
+    middlegoodsid	:number;//套保商品id
+}
+
+

+ 1 - 0
src/services/go/ermcp/spot-contract/index.ts

@@ -17,3 +17,4 @@ export function QuerySpotContract(req: Ermcp3ContractReq): Promise<Ermcp3Contrac
         throw new Error(`查询现货合同: ${err.message}`);
     });
 }
+

+ 1 - 1
src/views/information/custom/compoments/addCustom/index.vue

@@ -147,7 +147,7 @@
               </a-select-option>
               <a-select-option value="2">
                 客户二
-              </a-select-optio@/common/methods
+              </a-select-option>
             </a-select>
             <a-select class="inlineFormSelect"
                       style="width: 205px"

+ 2 - 2
src/views/information/custom/compoments/filterTable/index.vue

@@ -40,7 +40,7 @@ function handleSearch(context: SetupContext) {
         value: string;
     }
     let useType = '';
-    const userinfotype = ref<number>(0);
+    const userinfotype = ref<number | undefined>(undefined);
     function handleChange(value: Value) {
         useType = value.value;
         search();
@@ -53,7 +53,7 @@ function handleSearch(context: SetupContext) {
         nickname.value = '';
         name.value = '';
         phone.value = '';
-        userinfotype.value = 0;
+        userinfotype.value = undefined;
         useType = '';
         search();
     }

+ 76 - 84
src/views/information/custom/list/normal-use/index.vue

@@ -1,97 +1,89 @@
 <template>
-    <!-- 客户信息: 正常 -->
-    <div class="custom-normal" :loading="loading">
-        <filterCustomTable @search="search">
-            <a-button class="operBtn" v-if="hasPermission('custom_info_btn_add')" @click="openAction">新增</a-button>
-        </filterCustomTable>
-        <contextMenu :contextMenuList="contextMenuList" :tableList="customList">
-            <a-table :columns="columns" class="topTable" :pagination="false" rowKey="key" :data-source="customList">
-                <template #userinfotype="{ text }">
-                    <a>{{ text === '2' ? '企业' : '个人' }}</a>
-                </template>
-            </a-table>
-        </contextMenu>
-        <!-- 详情 -->
-        <CustomDetail />
-        <!-- 修改 -->
-        <ModifyCustom />
-        <!-- 停用 -->@/common/methods
-        <DisableCustom />
-    </div>
+  <!-- 客户信息: 正常 -->
+  <div class="custom-normal"
+       :loading="loading">
+    <filterCustomTable @search="search">
+      <a-button class="operBtn"
+                v-if="hasPermission('custom_info_btn_add')"
+                @click="addAction">新增</a-button>
+    </filterCustomTable>
+    <contextMenu :contextMenuList="contextMenuList"
+                 :tableList="customList">
+      <a-table :columns="columns"
+               class="topTable"
+               :pagination="false"
+               rowKey="key"
+               :data-source="customList">
+        <template #userinfotype="{ text }">
+          <a>{{ text === '2' ? '企业' : '个人' }}</a>
+        </template>
+      </a-table>
+    </contextMenu>
+    <!-- 新增 -->
+    <AddCustom />
+    <!-- 详情 -->
+    <CustomDetail />
+    <!-- 修改 -->
+    <ModifyCustom />
+    <!-- 停用 -->
+    <DisableCustom />
+  </div>
 </template>
 
 <script lang="ts">
-    import { defineComponent, onUnmounted, Ref, ref, watchEffect } from 'vue';
+import { defineComponent, onUnmounted, Ref, ref, watchEffect } from 'vue';
 
-    import { initData } from '@/common/methods/index';
-    import filterCustomTable from '@/views/information/custom/compoments/filterTable/index.vue';
-    import { MenuItem } from '@/common/components/contextMenu/interface';
-    import contextMenu from '@/common/components/contextMenu/index.vue';
-    import { getCustomList } from '../setup';
-    import { openModal } from '@/common/setup/modal/index';
-    import CustomDetail from '@/views/information/custom/compoments/customDetail/index.vue';
-    import ModifyCustom from '@/views/information/custom/compoments/modifyCustom/index.vue';
-    import DisableCustom from '@/views/information/custom/compoments/disableCustom/index.vue';
+import { initData } from '@/common/methods/index';
+import filterCustomTable from '@/views/information/custom/compoments/filterTable/index.vue';
+import { MenuItem } from '@/common/components/contextMenu/interface';
+import contextMenu from '@/common/components/contextMenu/index.vue';
+import { getCustomList } from '../setup';
+import { openModal } from '@/common/setup/modal/index';
+import CustomDetail from '@/views/information/custom/compoments/customDetail/index.vue';
+import ModifyCustom from '@/views/information/custom/compoments/modifyCustom/index.vue';
+import DisableCustom from '@/views/information/custom/compoments/disableCustom/index.vue';
+import AddCustom from '@/views/information/custom/compoments/addCustom/index.vue';
+import { detailButton, permissionButton, handlePermission } from '@/common/setup/buttonPermission/index';
 
-    // 处理详情
-    function handleDetail(contextMenuList: Ref<MenuItem[]>) {
-        const { openAction } = openModal('customDetail');
-        contextMenuList.value.push({ lable: '详情', callback: openAction });
-    }
-    // 处理修改
-    function handleModify(contextMenuList: Ref<MenuItem[]>) {
-        const { openAction } = openModal('modifyCustomInfo');
-        function modifyAction() {
-            contextMenuList.value.push({ lable: '修改', callback: openAction });
-        }
-        return { modifyAction };
-    }
+export default defineComponent({
+    name: 'custom-normal',
+    components: {
+        filterCustomTable,
+        contextMenu,
+        CustomDetail,
+        ModifyCustom,
+        DisableCustom,
+        AddCustom,
+    },
+    setup() {
+        const { customList, actionQuery, columns, getColumns, search, loading } = getCustomList();
+        const { hasPermission } = handlePermission('custom_info_normal');
+        const contextMenuList = ref<MenuItem[]>([]);
 
-    // 处理停用
-    function handleDisable(contextMenuList: Ref<MenuItem[]>) {
-        const { openAction } = openModal('disableCustomInfo');
-        function disableAction() {
-            contextMenuList.value.push({ lable: '停用', callback: openAction });
-        }
-        return { disableAction };
-    }
-    export default defineComponent({
-        name: 'custom-normal',
-        components: {
-            filterCustomTable,
-            contextMenu,
-            CustomDetail,
-            ModifyCustom,
-            DisableCustom,
-        },
-        setup() {
-            const { customList, actionQuery, columns, getColumns, search, loading, handlePermission } = getCustomList();
-            const { hasPermission } = handlePermission('custom_info_normal');
-            const contextMenuList = ref<MenuItem[]>([]);
+        const { openAction: addAction } = openModal('addCustomInfo');
 
-            const { openAction } = openModal('addCustomInfo');
+        detailButton('customDetail', contextMenuList);
+        const { action: modifyAction } = permissionButton('modifyCustomInfo', '修改', contextMenuList);
+        const { action: disableAction } = permissionButton('disableCustomInfo', '停用', contextMenuList);
 
-            handleDetail(contextMenuList);
-            const { modifyAction } = handleModify(contextMenuList);
-            const { disableAction } = handleDisable(contextMenuList);
-
-            const stop = watchEffect(() => {
-                hasPermission('custom_info_btn_modify') && modifyAction();
-                hasPermission('custom_info_btn_disable') && disableAction();
-            });
-            onUnmounted(() => {
-                stop();
-            });
-            initData(() => {
-                actionQuery(3);
-                getColumns();
-            });
-            return { customList, columns, search, loading, contextMenuList, hasPermission, openAction };
-        },
-    });
+        const stop = watchEffect(() => {
+            hasPermission('custom_info_btn_modify') && modifyAction();
+            hasPermission('custom_info_btn_disable') && disableAction();
+        });
+        onUnmounted(() => {
+            stop();
+        });
+        initData(() => {
+            actionQuery(3);
+            getColumns();
+        });
+        return { customList, columns, search, loading, contextMenuList, hasPermission, addAction };
+    },
+});
 </script>
 
 <style lang="less">
-    .custom-normal {
-    }</style
+.custom-normal {
+}
+</style
 >;

+ 3 - 24
src/views/information/custom/list/setup.ts

@@ -1,10 +1,9 @@
-import { OperationTabMenu } from '@/services/go/commonService/interface';
+import { ColumnType, getTableHead } from '@/services/bus/table';
 import { QueryCustomInfo } from '@/services/go/ermcp/customInfo';
 import { QueryCustomInfoType } from '@/services/go/ermcp/customInfo/interface';
 import { QueryCustomInfoEnum } from '@/services/go/ermcp/customInfo/type';
-import { ColumnType, getTableHead } from '@/services/bus/table';
 import { message } from 'ant-design-vue';
-import { inject, Ref, ref } from 'vue';
+import { ref } from 'vue';
 
 // 客户资料列表
 export function getCustomList() {
@@ -15,7 +14,6 @@ export function getCustomList() {
     // 过滤项
     const filteredInfo = ref();
     const loading = ref<boolean>(false);
-    const permissionData = inject('thirdMenuList') as Ref<OperationTabMenu[]>;
     // 获取表头
     function getColumns() {
         const list = getTableHead('table_pcweb_userinfo');
@@ -72,24 +70,5 @@ export function getCustomList() {
         getColumns();
     }
 
-    // 处理按钮是否有权限
-    type customType = 'custom_info_normal' | 'custom_info_disabled'; // 正常 | 停用
-    function handlePermission(menuType: customType) {
-        // 添加 | 修改 | 停用 | "恢复" | "删除"
-        type codeType = 'custom_info_btn_add' | 'custom_info_btn_modify' | 'custom_info_btn_disable' | 'custom_info_btn_recover' | 'custom_info_btn_delete';
-
-        // 判断按钮是否有权限
-        function hasPermission(type: codeType): boolean {
-            let result = false;
-            if (permissionData) {
-                const btnList = permissionData.value.find((e) => e.code === menuType);
-                if (btnList && btnList.children) {
-                    result = btnList.children.find((e) => e.code === type && e.type === 2) ? true : false;
-                }
-            }
-            return result;
-        }
-        return { hasPermission };
-    }
-    return { customList, actionQuery, columns, filteredInfo, getColumns, search, loading, handlePermission };
+    return { customList, actionQuery, columns, filteredInfo, getColumns, search, loading, };
 }

+ 76 - 84
src/views/information/custom/list/stop-use/index.vue

@@ -1,97 +1,89 @@
 <template>
-    <!-- 客户信息: 停用 -->
-    <div class="custom-normal" :loading="loading">
-        <filterCustomTable @search="search">
-            <a-button class="operBtn" v-if="hasPermission('custom_info_btn_add')" @click="openAction">新增</a-button>
-        </filterCustomTable>
-        <contextMenu :contextMenuList="contextMenuList" :tableList="customList">
-            <a-table :columns="columns" class="topTable" :pagination="false" rowKey="key" :data-source="customList">
-                <template #userinfotype="{ text }">
-                    <a>{{ text === '2' ? '企业' : '个人' }}</a>
-                </template>
-            </a-table>
-        </contextMenu>
-        <!-- 详情 -->
-        <CustomDetail />
-        <!-- 删除 -->
-        <DeleteCustom />
-        <!-- 恢复客户资料 -->@/common/methods
-        <RecoverCustom />
-    </div>
+  <!-- 客户信息: 停用 -->
+  <div class="custom-normal"
+       :loading="loading">
+    <filterCustomTable @search="search">
+      <a-button class="operBtn"
+                v-if="hasPermission('custom_info_btn_add')"
+                @click="addAction">新增</a-button>
+    </filterCustomTable>
+    <contextMenu :contextMenuList="contextMenuList"
+                 :tableList="customList">
+      <a-table :columns="columns"
+               class="topTable"
+               :pagination="false"
+               rowKey="key"
+               :data-source="customList">
+        <template #userinfotype="{ text }">
+          <a>{{ text === '2' ? '企业' : '个人' }}</a>
+        </template>
+      </a-table>
+    </contextMenu>
+    <!-- 新增 -->
+    <AddCustom />
+    <!-- 详情 -->
+    <CustomDetail />
+    <!-- 删除 -->
+    <DeleteCustom />
+    <!-- 恢复客户资料 -->@/common/methods
+    <RecoverCustom />
+  </div>
 </template>
 
 <script lang="ts">
-    import { defineComponent, onUnmounted, Ref, ref, watchEffect } from 'vue';
+import { defineComponent, onUnmounted, Ref, ref, watchEffect } from 'vue';
 
-    import { initData } from '@/common/methods/index';
-    import filterCustomTable from '@/views/information/custom/compoments/filterTable/index.vue';
-    import { MenuItem } from '@/common/components/contextMenu/interface';
-    import contextMenu from '@/common/components/contextMenu/index.vue';
-    import { getCustomList } from '../setup';
-    import { openModal } from '@/common/setup/modal/index';
-    import CustomDetail from '@/views/information/custom/compoments/customDetail/index.vue';
-    import DeleteCustom from '@/views/information/custom/compoments/deleteCustom/index.vue';
-    import RecoverCustom from '@/views/information/custom/compoments/recover/index.vue';
+import { initData } from '@/common/methods/index';
+import filterCustomTable from '@/views/information/custom/compoments/filterTable/index.vue';
+import { MenuItem } from '@/common/components/contextMenu/interface';
+import contextMenu from '@/common/components/contextMenu/index.vue';
+import { getCustomList } from '../setup';
+import { openModal } from '@/common/setup/modal/index';
+import CustomDetail from '@/views/information/custom/compoments/customDetail/index.vue';
+import DeleteCustom from '@/views/information/custom/compoments/deleteCustom/index.vue';
+import RecoverCustom from '@/views/information/custom/compoments/recover/index.vue';
+import AddCustom from '@/views/information/custom/compoments/addCustom/index.vue';
+import { detailButton, permissionButton, handlePermission } from '@/common/setup/buttonPermission/index';
 
-    // 处理详情
-    function handleDetail(contextMenuList: Ref<MenuItem[]>) {
-        const { openAction } = openModal('customDetail');
-        contextMenuList.value.push({ lable: '详情', callback: openAction });
-    }
-    // 处理删除
-    function handleDelete(contextMenuList: Ref<MenuItem[]>) {
-        const { openAction } = openModal('deleteCustomInfo');
-        function deleteAction() {
-            contextMenuList.value.push({ lable: '删除', callback: openAction });
-        }
-        return { deleteAction };
-    }
-    // 处理恢复
-    function handleRecover(contextMenuList: Ref<MenuItem[]>) {
-        const { openAction } = openModal('recoverCustomInfo');
-        function recoverAction() {
-            contextMenuList.value.push({ lable: '删除', callback: openAction });
-        }
-        return { recoverAction };
-    }
+export default defineComponent({
+    name: 'custom-normal',
+    components: {
+        filterCustomTable,
+        contextMenu,
+        CustomDetail,
+        DeleteCustom,
+        RecoverCustom,
+        AddCustom,
+    },
+    setup() {
+        const { customList, actionQuery, columns, getColumns, search, loading } = getCustomList();
+        const { hasPermission } = handlePermission('custom_info_normal');
+        const contextMenuList = ref<MenuItem[]>([]);
 
-    export default defineComponent({
-        name: 'custom-normal',
-        components: {
-            filterCustomTable,
-            contextMenu,
-            CustomDetail,
-            DeleteCustom,
-            RecoverCustom,
-        },
-        setup() {
-            const { customList, actionQuery, columns, getColumns, search, loading, handlePermission } = getCustomList();
-            const { hasPermission } = handlePermission('custom_info_normal');
-            const contextMenuList = ref<MenuItem[]>([]);
+        const { openAction: addAction } = openModal('addCustomInfo');
 
-            const { openAction } = openModal('addCustomInfo');
+        detailButton('customDetail', contextMenuList);
+        const { action: deleteAction } = permissionButton('deleteCustomInfo', '删除', contextMenuList);
+        const { action: recoverAction } = permissionButton('recoverCustomInfo', '恢复', contextMenuList);
 
-            handleDetail(contextMenuList);
-            const { deleteAction } = handleDelete(contextMenuList);
-            const { recoverAction } = handleRecover(contextMenuList);
-
-            const stop = watchEffect(() => {
-                hasPermission('custom_info_btn_recover') && recoverAction();
-                hasPermission('custom_info_btn_delete') && deleteAction();
-            });
-            onUnmounted(() => {
-                stop();
-            });
-            initData(() => {
-                actionQuery(4);
-                getColumns();
-            });
-            return { customList, columns, search, loading, contextMenuList, hasPermission, openAction };
-        },
-    });
+        const stop = watchEffect(() => {
+            hasPermission('custom_info_btn_recover') && recoverAction();
+            hasPermission('custom_info_btn_delete') && deleteAction();
+        });
+        onUnmounted(() => {
+            stop();
+        });
+        initData(() => {
+            actionQuery(4);
+            getColumns();
+        });
+        return { customList, columns, search, loading, contextMenuList, hasPermission, addAction };
+    },
+});
 </script>
 
 <style lang="less">
-    .custom-normal {
-    }</style
+.custom-normal {
+}
+</style
 >;

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

@@ -50,13 +50,13 @@ function handleSearch(context: SetupContext) {
     }
     // 全部合同类型
     let useType = '';
-    const contracttype = ref<number>(0);
+    const contracttype = ref<number | undefined>(undefined);
     function handleChange(value: Value) {
         useType = value.value;
         search();
     }
     // 全部定价类型
-    const pricetype = ref<number>(0);
+    const pricetype = ref<number | undefined>(undefined);
     let cachePricetype = '';
     function handlePricetype(value: Value) {
         cachePricetype = value.value;
@@ -70,9 +70,9 @@ function handleSearch(context: SetupContext) {
         contractno.value = '';
         negative.value = '';
 
-        contracttype.value = 0;
+        contracttype.value = undefined;
         useType = '';
-        pricetype.value = 0;
+        pricetype.value = undefined;
         cachePricetype = '';
         search();
     }

+ 71 - 42
src/views/information/spot-contract/list/not-commit/index.vue

@@ -1,53 +1,82 @@
 <template>
-    <!-- 现货合同: 未提交-->
-    <div class="spot-contract-not-commit">
-        <filterCustomTable @search="search">
-            <a-button class="operBtn" v-if="hasPermission('spot_contract_btn_add')" @click="openAction">新增</a-button>
-        </filterCustomTable>
-        <contextMenu :contextMenuList="contextMenuList" :tableList="spotContractList">
-            <a-table :columns="columns" class="topTable" :pagination="false" rowKey="key" :data-source="spotContractList">
-                <!-- <template #userinfotype="{ text }">
+  <!-- 现货合同: 未提交-->
+  <div class="spot-contract-not-commit">
+    <filterCustomTable @search="search">
+      <a-button class="operBtn"
+                v-if="hasPermission('spot_contract_btn_add')"
+                @click="openAction">新增</a-button>
+    </filterCustomTable>
+    <contextMenu :contextMenuList="contextMenuList"
+                 :tableList="spotContractList">
+      <a-table :columns="columns"
+               class="topTable"
+               :pagination="false"
+               rowKey="key"
+               :data-source="spotContractList">
+        <!-- <template #userinfotype="{ text }">
           <a>{{ text === '2' ? '企业' : '个人'}}</a>
         </template> -->
-            </a-table>
-        </contextMenu>
-        <!-- 新增现货合同 -->
-        <AddSpotContract />
-    </div>
+      </a-table>
+    </contextMenu>
+    <!-- 新增现货合同 -->
+    <AddSpotContract />
+  </div>
 </template>
 
 <script lang="ts">
-    import { defineComponent, ref } from 'vue';
-    import { initData } from '@/common/methods';
-    import filterCustomTable from '@/views/information/spot-contract/components/filterTable/index.vue';
-    import { getCustomList } from '../setup';
-    import { openModal } from '@/common/setup/modal/index';
-    import contextMenu from '@/common/components/contextMenu/index.vue';
-    import { MenuItem } from '@/common/components/contextMenu/interface';
-    import AddSpotContract from '@/views/information/spot-contract/components/add/index.vue';
+import { defineComponent, Ref, ref } from 'vue';
+import { initData } from '@/common/methods';
+import filterCustomTable from '@/views/information/spot-contract/components/filterTable/index.vue';
+import { getCustomList } from '../setup';
+import { openModal } from '@/common/setup/modal/index';
+import contextMenu from '@/common/components/contextMenu/index.vue';
+import { MenuItem } from '@/common/components/contextMenu/interface';
+import AddSpotContract from '@/views/information/spot-contract/components/add/index.vue';
 
-    export default defineComponent({
-        name: 'spot-contract-not-commit',
-        components: {
-            filterCustomTable,
-            contextMenu,
-            AddSpotContract,
-        },
-        setup() {
-            const { spotContractList, actionQuery, columns, getColumns, search, loading, handlePermission } = getCustomList();
-            const { hasPermission } = handlePermission('spot_contract_unsubmitted');
-            const { openAction } = openModal('addSpotContract');
-            const contextMenuList = ref<MenuItem[]>([]);
-            initData(() => {
-                actionQuery(2);
-                getColumns();
-            });
-            return { spotContractList, columns, search, contextMenuList, openAction, loading, hasPermission };
-        },
-    });
+// 处理现货合同详情
+function handleDetail(contextMenuList: Ref<MenuItem[]>) {
+    const { openAction } = openModal('spotContractDetail');
+    contextMenuList.value.push({ lable: '详情', callback: openAction });
+}
+// 重新提交现货合同
+function handleResubmit(contextMenuList: Ref<MenuItem[]>) {
+    const { openAction } = openModal('resubmitSpotContract');
+    contextMenuList.value.push({ lable: '重新提交', callback: openAction });
+}
+// 删除现货合同
+function handleDelete(contextMenuList: Ref<MenuItem[]>) {
+    const { openAction } = openModal('deleteSpotContract');
+    contextMenuList.value.push({ lable: '删除', callback: openAction });
+}
+// 修改现货合同
+function handleModify(contextMenuList: Ref<MenuItem[]>) {
+    const { openAction } = openModal('modifySpotContract');
+    contextMenuList.value.push({ lable: '修改', callback: openAction });
+}
+
+export default defineComponent({
+    name: 'spot-contract-not-commit',
+    components: {
+        filterCustomTable,
+        contextMenu,
+        AddSpotContract,
+    },
+    setup() {
+        const { spotContractList, actionQuery, columns, getColumns, search, loading, handlePermission } = getCustomList();
+        const { hasPermission } = handlePermission('spot_contract_unsubmitted');
+        const { openAction } = openModal('addSpotContract');
+        const contextMenuList = ref<MenuItem[]>([]);
+        initData(() => {
+            actionQuery(2);
+            getColumns();
+        });
+        return { spotContractList, columns, search, contextMenuList, openAction, loading, hasPermission };
+    },
+});
 </script>
 
 <style lang="less">
-    .spot-contract-not-commit {
-    }</style
+.spot-contract-not-commit {
+}
+</style
 >;