huangbin 4 년 전
부모
커밋
97f9222d76

+ 20 - 10
src/views/order/financing_manager/components/financing_manager_apply_order/index.vue

@@ -15,20 +15,20 @@
       <!-- 额外的展开行 -->
       <template v-if="btnList.length"
                 #expandedRowRender="{ record }">
-        <BtnList :btnList="btnList"
+        <BtnList :btnList="handleBtnList(btnList, record)"
                  :record="record"
                  class="btn-list-sticky"
                  @click="openComponent" />
       </template>
-        <!-- 类型 -->
-        <template #financetype="{ record }">
-            <a>{{ getFinanceTypeName(record.financetype) }}</a>
-        </template>
+      <!-- 类型 -->
+      <template #financetype="{ record }">
+        <a>{{ getFinanceTypeName(record.financetype) }}</a>
+      </template>
 
-        <!-- 状态 -->
-        <template #applystatus="{ text }">
-            <a>{{ getApplyStatusFinanceName(text) }}</a>
-        </template>
+      <!-- 状态 -->
+      <template #applystatus="{ text }">
+        <a>{{ getApplyStatusFinanceName(text) }}</a>
+      </template>
 
       <template #createtime="{ record }">
         <a>{{ formatTime(record.createtime) }}</a>
@@ -52,7 +52,8 @@ import { ComposeOrderTableParam } from '@/common/setup/table/interface';
 import { formatTime } from '@/common/methods';
 import Bus from '@/utils/eventBus/index';
 import { expandIcon } from '@/common/setup/table/clolumn';
-import {getApplyStatusFinanceName, getFinanceTypeName} from "@/common/constants/enumsName";
+import { getApplyStatusFinanceName, getFinanceTypeName } from '@/common/constants/enumsName';
+import { BtnList as BtnListType } from '@/common/components/btnList/interface';
 
 export default defineComponent({
     name: enumOrderComponents.financing_manager_apply_order,
@@ -77,6 +78,14 @@ export default defineComponent({
         Bus.$on('financing_manager', () => {
             queryTableAction();
         });
+        function handleBtnList(btnList: BtnListType[], item: WrFinanceBuyApply) {
+            const { applystatus } = item;
+            if (applystatus === 1) {
+                return btnList.filter((e) => e.code === ModalEnum.financing_manager_apply_cancel);
+            } else {
+                return [];
+            }
+        }
         return {
             ...handleComposeOrderTable<WrFinanceBuyApply>(param),
             loading,
@@ -85,6 +94,7 @@ export default defineComponent({
             expandIcon,
             getFinanceTypeName,
             getApplyStatusFinanceName,
+            handleBtnList,
         };
     },
 });

+ 24 - 10
src/views/order/financing_manager/components/financing_manager_contract/index.vue

@@ -15,20 +15,20 @@
       <!-- 额外的展开行 -->
       <template v-if="btnList.length"
                 #expandedRowRender="{ record }">
-        <BtnList :btnList="btnList"
+        <BtnList :btnList="handleBtnList(btnList, record)"
                  :record="record"
                  class="btn-list-sticky"
                  @click="openComponent" />
       </template>
-        <!-- 类型 -->
-        <template #financetype="{ text }">
-            <a>{{ getFinanceTypeName(record.financetype) }}</a>
-        </template>
+      <!-- 类型 -->
+      <template #financetype="{ record }">
+        <a>{{ getFinanceTypeName(record.financetype) }}</a>
+      </template>
 
-        <!-- 状态 -->
-        <template #scfcontractstatus="{ text }">
-            <a>{{ getContractName(text) }}</a>
-        </template>
+      <!-- 状态 -->
+      <template #scfcontractstatus="{ text }">
+        <a>{{ getContractName(text) }}</a>
+      </template>
       <template #createtime="{ record }">
         <a>{{ formatTime(record.createtime) }}</a>
       </template>
@@ -50,7 +50,8 @@ import { handleComposeOrderTable } from '@/common/setup/table/compose';
 import { ComposeOrderTableParam } from '@/common/setup/table/interface';
 import { formatTime } from '@/common/methods';
 import { expandIcon } from '@/common/setup/table/clolumn';
-import {getContractName, getFinanceTypeName} from "@/common/constants/enumsName";
+import { getContractName, getFinanceTypeName } from '@/common/constants/enumsName';
+import { BtnList as BtnListType } from '@/common/components/btnList/interface';
 
 export default defineComponent({
     name: enumOrderComponents.financing_manager_contract,
@@ -72,6 +73,18 @@ export default defineComponent({
             tableName: 'table_pcweb_financing_manage_bottom_contract',
             recordList: getRecordItemTab(),
         };
+        function handleBtnList(btnList: BtnListType[], item: WrScfContract) {
+            const { remainwrpositionqty, interestdebt } = item;
+            let result: BtnListType[] = btnList;
+            if (interestdebt === 0) {
+                // 费用欠款”不为0时出现“支付欠款”按钮
+                result = btnList.filter((e) => e.code !== ModalEnum.financing_manager_contract_pay_arrears);
+            } else if (remainwrpositionqty === 0) {
+                // “剩余数量”不为0时出现“回购仓单”按钮
+                result = btnList.filter((e) => e.code !== ModalEnum.financing_manager_contract_repurchase_warrant);
+            }
+            return result;
+        }
         return {
             ...handleComposeOrderTable<WrScfContract>(param),
             loading,
@@ -80,6 +93,7 @@ export default defineComponent({
             expandIcon,
             getContractName,
             getFinanceTypeName,
+            handleBtnList,
         };
     },
 });