|
|
@@ -51,32 +51,39 @@
|
|
|
</div>
|
|
|
<div class="g-order-list__btnbar">
|
|
|
<Button size="small" @click="showComponent('detail', item)" round>详情</Button>
|
|
|
- <Button size="small" round>补充</Button>
|
|
|
- <Button size="small" round>交收</Button>
|
|
|
- <Button size="small" round>转让</Button>
|
|
|
+ <Button size="small" @click="showComponent('supplement', item)" round>补充</Button>
|
|
|
+ <Button size="small" @click="showComponent('delivery', item)" round>交收</Button>
|
|
|
+ <Button size="small" @click="showComponent('closeholder', item)" round>转让</Button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <component ref="componentRef" v-bind="{ selectedRow }" :is="componentMap.get(componentId)" @closed="closeComponent"
|
|
|
+ v-if="componentId" />
|
|
|
</app-view>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
|
-import { shallowRef, onMounted, onUnmounted, computed } from 'vue'
|
|
|
+import { shallowRef, onMounted, onUnmounted, computed, defineAsyncComponent } from 'vue'
|
|
|
import { BuyOrSell } from '@/constants/order'
|
|
|
import { formatDate, formatDecimal, parsePercent, handleNumberValue } from '@/filters'
|
|
|
import { getGoodsUnitName } from '@/constants/unit'
|
|
|
import { useComponent } from '@/hooks/component'
|
|
|
import { useRequest } from '@/hooks/request'
|
|
|
import { querySBYJMyOrders } from '@/services/api/order'
|
|
|
+import { Button } from 'vant'
|
|
|
|
|
|
const dataList = shallowRef<Model.SBYJMyOrderRsp[]>([])
|
|
|
const selectedRow = shallowRef<Model.SBYJMyOrderRsp>()
|
|
|
const error = shallowRef(false)
|
|
|
|
|
|
-const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
|
|
|
- // pullRefreshRef.value?.refresh()
|
|
|
-})
|
|
|
+ const componentMap = new Map<string, unknown>([
|
|
|
+ ['detail', defineAsyncComponent(() => import('../detail/index.vue'))], // 详情
|
|
|
+ ['supplement', defineAsyncComponent(() => import('./components/supplement-deposit/index.vue'))], // 补充
|
|
|
+ ['delivery', defineAsyncComponent(() => import('./components/market-order-delivery/index.vue'))], // 交收
|
|
|
+ ['closeholder', defineAsyncComponent(() => import('./components/close-holder/index.vue'))], // 转让
|
|
|
+])
|
|
|
+const { componentRef, componentId, openComponent, closeComponent } = useComponent()
|
|
|
|
|
|
const { loading, pageIndex, pageCount, run } = useRequest(querySBYJMyOrders, {
|
|
|
onSuccess: (res) => {
|