huangbin il y a 4 ans
Parent
commit
a080f48e47

+ 21 - 3
src/views/order/performance_information/components/performance_information_buy_performance/index.vue

@@ -13,9 +13,8 @@
              rowKey="key"
              :data-source="tableList">
       <!-- 额外的展开行 -->
-      <template v-if="btnList.length"
-                #expandedRowRender="{ record }">
-        <BtnList :btnList="btnList"
+      <template #expandedRowRender="{ record }">
+        <BtnList :btnList="handleBtn(btnList, record)"
                  :record="record"
                  class="btn-list-sticky"
                  @click="openComponent" />
@@ -56,6 +55,7 @@ import { getRecordItemTab } from '@/common/setup/order/orderData';
 import { handleComposeOrderTable } from '@/common/setup/table/compose';
 import { ComposeOrderTableParam } from '@/common/setup/table/interface';
 import { expandIcon } from '@/common/setup/table/clolumn';
+import { BtnList as BtnListType } from '@/common/components/btnList/interface';
 import { getPaymentTypeName, getPerformanceStatusName, getPerformanceTypeName } from '@/common/constants/enumsName';
 export default defineComponent({
     name: enumOrderComponents.performance_information_buy_performance,
@@ -83,6 +83,23 @@ export default defineComponent({
             tableName: 'table_pcweb_spot_trade_bottom_performance_info_buy',
             recordList: getRecordItemTab(),
         };
+        function handleBtn(btnList: BtnListType[], record: WrPerformancePlan): BtnListType[] {
+            //  performancestatus: number;//履约状态 - 1:初始化 2:正常 3:处理错误 4:违约待处理 5:违约处理中 6:完成 7.违约已完成 8:释放冻结失败 9:超时待处理 1number;
+            const { curstepname, performancestatus } = record;
+            let result: ModalEnum[] = [];
+            if (performancestatus === 1) {
+                result = [ModalEnum.performance_information_buy_performance_breach_contract, ModalEnum.performance_information_buy_performance_settlement];
+            } else if (performancestatus === 2) {
+                if (curstepname === '买方支付') {
+                    result = [ModalEnum.performance_information_buy_performance_pay, ModalEnum.performance_information_buy_performance_extension, ModalEnum.performance_information_buy_performance_breach_contract, ModalEnum.performance_information_buy_performance_detail];
+                } else if (curstepname === '货款溢短') {
+                    result = [ModalEnum.performance_information_buy_performance_extension, ModalEnum.performance_information_buy_performance_breach_contract, ModalEnum.performance_information_buy_performance_detail];
+                } else if (curstepname === '卖方发票') {
+                    result = [ModalEnum.performance_information_buy_performance_extension, ModalEnum.performance_information_buy_performance_breach_contract, ModalEnum.performance_information_buy_performance_detail];
+                }
+            }
+            return btnList.filter((e) => result.includes(e.code as ModalEnum));
+        }
         return {
             ...handleComposeOrderTable<WrPerformancePlan>(param),
             loading,
@@ -91,6 +108,7 @@ export default defineComponent({
             getPerformanceStatusName,
             getPaymentTypeName,
             expandIcon,
+            handleBtn,
         };
     },
 });