|
@@ -15,13 +15,19 @@
|
|
|
<!-- 额外的展开行 -->
|
|
<!-- 额外的展开行 -->
|
|
|
<template v-if="btnList.length"
|
|
<template v-if="btnList.length"
|
|
|
#expandedRowRender="{ record }">
|
|
#expandedRowRender="{ record }">
|
|
|
- <BtnList :btnList="btnList"
|
|
|
|
|
|
|
+ <BtnList :btnList="handleBtnList(record, btnList)"
|
|
|
:record="record"
|
|
:record="record"
|
|
|
class="btn-list-sticky"
|
|
class="btn-list-sticky"
|
|
|
@click="openComponent" />
|
|
@click="openComponent" />
|
|
|
</template>
|
|
</template>
|
|
|
- <template #createtime="{ record }">
|
|
|
|
|
- <a>{{ formatTime(record.createtime) }}</a>
|
|
|
|
|
|
|
+ <template #applytime="{ text }">
|
|
|
|
|
+ <span>{{ formatTime(text) }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #buyorsell="{ text }">
|
|
|
|
|
+ <span>{{ getBuyOrSellName(text) }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #applystatus="{ text }">
|
|
|
|
|
+ <span>{{ getScfContractStatusName(text) }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
</a-table>
|
|
</a-table>
|
|
|
<component :is="componentId"
|
|
<component :is="componentId"
|
|
@@ -49,7 +55,11 @@ import { TradeMode } from '@/common/constants/enumCommon';
|
|
|
import { BtnListType } from '@/common/components/btnList/interface';
|
|
import { BtnListType } from '@/common/components/btnList/interface';
|
|
|
import { columns } from './setup';
|
|
import { columns } from './setup';
|
|
|
import { queryTjmdTransferApply } from '@/services/go/Tjmd';
|
|
import { queryTjmdTransferApply } from '@/services/go/Tjmd';
|
|
|
-import { QueryTjmdTransferApplyReq } from '@/services/go/Tjmd/interface';
|
|
|
|
|
|
|
+import { QueryTjmdTransferApplyReq, QueryTjmdTransferApplyRsp } from '@/services/go/Tjmd/interface';
|
|
|
|
|
+import Bus from '@/utils/eventBus/index';
|
|
|
|
|
+import { ref } from 'vue';
|
|
|
|
|
+import { ApplyType } from '@/common/constants/enumCommon';
|
|
|
|
|
+import { getBuyOrSellName, getScfContractStatusName } from '@/common/constants/enumsName';
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
|
name: 'commodity_contract_bargain',
|
|
name: 'commodity_contract_bargain',
|
|
@@ -60,12 +70,14 @@ export default defineComponent({
|
|
|
// commodity_contract_summary_deal_closed: defineAsyncComponent(() => import('./components/commodity_contract_summary_deal_closed/index.vue')),
|
|
// commodity_contract_summary_deal_closed: defineAsyncComponent(() => import('./components/commodity_contract_summary_deal_closed/index.vue')),
|
|
|
},
|
|
},
|
|
|
setup() {
|
|
setup() {
|
|
|
|
|
+ // 类型 1-我的申请 2-对方申请
|
|
|
|
|
+ const margainType = ref<number>(ApplyType.my);
|
|
|
// 表格列表数据
|
|
// 表格列表数据
|
|
|
- const { loading, tableList, queryTable } = queryTableList<QueryTradePositionRsp>();
|
|
|
|
|
|
|
+ const { loading, tableList, queryTable } = queryTableList<QueryTjmdTransferApplyRsp>();
|
|
|
// 交割商品
|
|
// 交割商品
|
|
|
handleDeliveryRelation();
|
|
handleDeliveryRelation();
|
|
|
// 获取列表数据
|
|
// 获取列表数据
|
|
|
- const queryTableAction = (applytype: 1 | 2) => {
|
|
|
|
|
|
|
+ const queryTableAction = (applytype: ApplyType) => {
|
|
|
const param: QueryTjmdTransferApplyReq = {
|
|
const param: QueryTjmdTransferApplyReq = {
|
|
|
applytype,
|
|
applytype,
|
|
|
};
|
|
};
|
|
@@ -76,12 +88,22 @@ export default defineComponent({
|
|
|
queryFn: () => queryTableAction(1),
|
|
queryFn: () => queryTableAction(1),
|
|
|
recordList: getRecordItemTab(),
|
|
recordList: getRecordItemTab(),
|
|
|
};
|
|
};
|
|
|
-
|
|
|
|
|
- function handleBtnList(record: QueryTradePositionRsp, btnList: BtnListType[]) {
|
|
|
|
|
- if (findGoodsTradeModeById(record.goodsid) === TradeMode.DiaoQi) {
|
|
|
|
|
- return btnList.filter((e) => e.code === 'commodity_contract_summary_deal_closed');
|
|
|
|
|
|
|
+ // 切换 我的申请和对方申请
|
|
|
|
|
+ Bus.$onOnly('bargain', (value: ApplyType) => {
|
|
|
|
|
+ margainType.value = value;
|
|
|
|
|
+ queryTableAction(value);
|
|
|
|
|
+ });
|
|
|
|
|
+ function handleBtnList(record: QueryTjmdTransferApplyRsp, btnList: BtnListType[]) {
|
|
|
|
|
+ if (record.applystatus === 1) {
|
|
|
|
|
+ if (margainType.value === ApplyType.my) {
|
|
|
|
|
+ // 我的申请
|
|
|
|
|
+ return btnList.filter((e) => e.code === 'commodity_contract_bargain_cancel_order');
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 对方的申请
|
|
|
|
|
+ return btnList.filter((e) => e.code !== 'commodity_contract_bargain_cancel_order');
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
- return btnList.filter((e) => e.code !== 'commodity_contract_summary_deal_closed');
|
|
|
|
|
|
|
+ return [];
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
return {
|
|
return {
|
|
@@ -92,6 +114,8 @@ export default defineComponent({
|
|
|
formatTime,
|
|
formatTime,
|
|
|
expandIcon,
|
|
expandIcon,
|
|
|
handleBtnList,
|
|
handleBtnList,
|
|
|
|
|
+ getBuyOrSellName,
|
|
|
|
|
+ getScfContractStatusName,
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|