zhou.xiaoning 2 lat temu
rodzic
commit
7ed85efd48

+ 1 - 1
src/packages/sbyj/views/order/list/components/close-holder/index.vue

@@ -40,7 +40,7 @@
 
 <script lang="ts" setup>
 import { shallowRef, PropType, onMounted,onUnmounted, computed, reactive } from 'vue'
-import { CellGroup, Cell, Button, Stepper, Field, Form, FormInstance, FieldRule } from 'vant'
+import { CellGroup, Cell, Button, Stepper, Field, Form, FormInstance, FieldRule, RadioGroup, Radio } from 'vant'
 import { fullloading } from '@/utils/vant'
 import AppModal from '@/components/base/modal/index.vue'
 import { formatDate, formatDecimal, parsePercent } from '@/filters'

+ 1 - 1
src/packages/sbyj/views/order/list/components/market-order-delivery/index.vue

@@ -40,7 +40,7 @@
 
 <script lang="ts" setup>
 import { shallowRef, PropType, onMounted, computed, reactive } from 'vue'
-import { CellGroup, Cell, Button, Stepper, Field, Form, FormInstance, FieldRule } from 'vant'
+import { CellGroup, Cell, Button, Stepper, Field, Form, FormInstance, FieldRule, RadioGroup, Radio } from 'vant'
 import { fullloading } from '@/utils/vant'
 import AppModal from '@/components/base/modal/index.vue'
 import { formatDate, formatDecimal, parsePercent } from '@/filters'

+ 14 - 7
src/packages/sbyj/views/order/list/index.vue

@@ -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) => {