浏览代码

业务采购

liucong 4 年之前
父节点
当前提交
d769ec0304

+ 2 - 4
src/common/setup/buttonPermission/interface.ts

@@ -1,12 +1,11 @@
 export interface MenuType {
     custom_info_normal: string; // 客户资料 正常
     custom_info_disabled: string; // 客户资料 停用
-
+    purchase_pending: string;
     spot_contract_unsubmitted: string; // 现货合同 未提交
     spot_contract_checkpending: string; // 现货合同 待审核
     spot_contract_performance: string; // 现货合同 履约中
     spot_contract_finished: string; // 现货合同 已完成
-
 }
 
 export interface BtnType {
@@ -23,5 +22,4 @@ export interface BtnType {
     spot_contract_btn_finish: string; // 现货合同 正常完结
     spot_contract_btn_check: string; // 现货合同 审核
     spot_contract_btn_cancel: string; // 现货合同 撤销
-
-}
+}

+ 2 - 2
src/common/setup/modal/interface.ts

@@ -21,5 +21,5 @@ export interface ModalName {
     spotContractCancel: string; // 现货合同 撤销
 
     addGoods: string; // 新增商品
-
-}
+    purchase_pending_someprice: string; //点价登记
+}

+ 12 - 7
src/views/business/purchase/setup.ts

@@ -14,7 +14,7 @@ export function handlePurchase() {
     // ========================loading========================
     const loading = ref<boolean>(false);
     // ========================获取列表数据========================
-    let purchaseList = ref<Ermcp3SellBuyContract[] | []>([]);
+    let customList = ref<Ermcp3SellBuyContract[] | []>([]);
     function queryPurchase() {
         const AreaUserID = APP.get('userAccount').memberuserid; // 所属机构id
         const req: SellBuyContractReq = {
@@ -24,7 +24,7 @@ export function handlePurchase() {
             userid: getUserId(), // 用户ID
         };
         QueryPurchase(req).then((res) => {
-            purchaseList.value = res;
+            customList.value = res;
         });
     }
 
@@ -51,19 +51,24 @@ export function handlePurchase() {
         queryPurchase();
         getColumns();
     });
-    return { loading, purchaseList, columns };
+    return { loading, customList, columns };
 }
 
 // 按钮权限与功能组件
 export function btnAndComp() {
-    const { hasPermission } = handlePermission('custom_info_normal');
+    // 传入父及的code 得到当前1234级的整个权限
+    const { hasPermission } = handlePermission('purchase_pending');
+    // 配置右键菜单列表
     const contextMenuList = ref<MenuItem[]>([]);
+    // 打开新增页的弹窗 返回打开弹窗的方法
     const { openAction: addAction } = openModal('addCustomInfo');
+    // 创建详情页并写入右键菜单列表(每个页面都有,写死)
     detailButton('customDetail', contextMenuList);
-    const { action: deleteAction } = permissionButton('deleteCustomInfo', '删除', contextMenuList);
-    const { action: recoverAction } = permissionButton('recoverCustomInfo', '恢复', contextMenuList);
+    // 通过code跟弹窗建立联系 返回写入右键的方法
+    const { action: deleteAction } = permissionButton('purchase_pending_someprice', '点价登记', contextMenuList);
+
     const stop = watchEffect(() => {
-        hasPermission('custom_info_btn_recover') && recoverAction();
+        // 判断是否有权限 有就写入
         hasPermission('custom_info_btn_delete') && deleteAction();
     });
     return {