|
|
@@ -1,21 +1,45 @@
|
|
|
<!-- 商品订单-交收 -->
|
|
|
<template>
|
|
|
- <app-table :data="dataList" v-model:columns="tableColumns" :loading="loading">
|
|
|
+ <app-table :data="dataList" v-model:columns="tableColumns" :loading="loading" :row-key="rowKey"
|
|
|
+ :expand-row-keys="expandKeys" @row-click="rowClick">
|
|
|
<!-- 申请时间 -->
|
|
|
<template #reqtime="{ value }">
|
|
|
{{ formatDate(value) }}
|
|
|
</template>
|
|
|
+ <!-- 展开行 -->
|
|
|
+ <template #expand="{ row }">
|
|
|
+ <div class="buttonbar">
|
|
|
+ <el-button type="danger" v-if="[1, 2].includes(row.orderstatus)" size="small" @click="showComponent('cancel', row)">撤销</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template #footer>
|
|
|
+ <component ref="componentRef" v-bind="{ selectedRow }" :is="componentMap.get(componentId)"
|
|
|
+ @closed="closeComponent" v-if="componentId" />
|
|
|
+ </template>
|
|
|
</app-table>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { shallowRef } from 'vue'
|
|
|
+import { shallowRef, defineAsyncComponent } from 'vue'
|
|
|
import { useRequest } from '@/hooks/request'
|
|
|
import { queryMineTradeGoodsDeliveryOfflines } from '@/services/api/transfer'
|
|
|
-import AppTable from '@pc/components/base/table/index.vue'
|
|
|
import { formatDate } from '@/filters'
|
|
|
+import { useComponent } from '@/hooks/component'
|
|
|
+import { useComposeTable } from '@pc/components/base/table'
|
|
|
+import AppTable from '@pc/components/base/table/index.vue'
|
|
|
+
|
|
|
+const componentMap = new Map<string, unknown>([
|
|
|
+ ['cancel', defineAsyncComponent(() => import('./cancel/index.vue'))], // 补足定金
|
|
|
+])
|
|
|
+
|
|
|
+const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
|
|
|
+ run()
|
|
|
+})
|
|
|
+
|
|
|
+const { loading, dataList, run } = useRequest(queryMineTradeGoodsDeliveryOfflines)
|
|
|
+
|
|
|
+const { rowKey, expandKeys, selectedRow, rowClick } = useComposeTable<Model.MineTradeGoodsDeliveryOfflinesRsp>({ rowKey: 'deliveryorderid' })
|
|
|
|
|
|
-const { loading, dataList } = useRequest(queryMineTradeGoodsDeliveryOfflines)
|
|
|
|
|
|
const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
|
{ prop: 'goodsnamedisplay', label: '订单合约' },
|
|
|
@@ -29,4 +53,9 @@ const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
|
{ prop: 'matchusername', label: '对手方' },
|
|
|
{ prop: 'reqtime', label: '申请时间' }
|
|
|
])
|
|
|
+
|
|
|
+const showComponent = (componentName: string, row?: Model.MineTradeGoodsDeliveryOfflinesRsp) => {
|
|
|
+ selectedRow.value = row
|
|
|
+ openComponent(componentName)
|
|
|
+}
|
|
|
</script>
|