li.shaoyi 2 gadi atpakaļ
vecāks
revīzija
8334299392
27 mainītis faili ar 386 papildinājumiem un 289 dzēšanām
  1. 3 1
      src/business/position/index.ts
  2. 1 1
      src/packages/gstj/views/order/list/components/goodsorder/history/Index.vue
  3. 1 1
      src/packages/gstj/views/order/list/components/goodsorder/list/Index.vue
  4. 1 1
      src/packages/gstj/views/order/list/components/goodstrade/history/Index.vue
  5. 1 1
      src/packages/gstj/views/order/list/components/goodstrade/list/Index.vue
  6. 1 1
      src/packages/gstj/views/order/position/components/goods/close/Index.vue
  7. 158 0
      src/packages/mobile/components/modules/delivery/index.vue
  8. 77 0
      src/packages/mobile/components/modules/delivery/warehouse-receipt.vue
  9. 1 1
      src/packages/mobile/views/order/list/components/goodsorder/history/Index.vue
  10. 1 1
      src/packages/mobile/views/order/list/components/goodsorder/list/Index.vue
  11. 1 1
      src/packages/mobile/views/order/list/components/goodstrade/history/Index.vue
  12. 1 1
      src/packages/mobile/views/order/list/components/goodstrade/list/Index.vue
  13. 21 23
      src/packages/mobile/views/order/position/components/goods/close/Index.vue
  14. 30 0
      src/packages/mobile/views/order/position/components/goods/delivery16/index.vue
  15. 18 20
      src/packages/mobile/views/order/position/components/goods/delivery50/index.vue
  16. 8 6
      src/packages/mobile/views/order/position/components/goods/list/Index.vue
  17. 41 86
      src/packages/mobile/views/order/position/components/transfer/delivery/Index.vue
  18. 0 132
      src/packages/mobile/views/order/position/components/transfer/delivery/trade/Index.vue
  19. 8 4
      src/packages/mobile/views/spot/add/components/buy/index.vue
  20. 6 1
      src/packages/mobile/views/spot/add/components/buy/warehouse-receipt.vue
  21. 1 1
      src/packages/mobile/views/transfer/delisting/Index.vue
  22. 1 1
      src/packages/pc/components/modules/delivery/index.vue
  23. 1 1
      src/packages/qxst/views/order/list/components/goodsorder/history/Index.vue
  24. 1 1
      src/packages/qxst/views/order/list/components/goodsorder/list/Index.vue
  25. 1 1
      src/packages/qxst/views/order/list/components/goodstrade/history/Index.vue
  26. 1 1
      src/packages/qxst/views/order/list/components/goodstrade/list/Index.vue
  27. 1 1
      src/packages/qxst/views/order/position/components/goods/close/Index.vue

+ 3 - 1
src/business/position/index.ts

@@ -11,8 +11,9 @@ import quoteSocket from '@/services/websocket/quote'
 export const usePosition = (...tradeMode: number[]) => {
 export const usePosition = (...tradeMode: number[]) => {
     const store = usePositionStore()
     const store = usePositionStore()
     const subscribe = quoteSocket.createSubscribe()
     const subscribe = quoteSocket.createSubscribe()
+    const { positionComputedList, loading } = store.$toRefs()
 
 
-    const positionList = computed(() => store.positionComputedList.filter((e) => tradeMode.length ? tradeMode.includes(e.trademode) : true))
+    const positionList = computed(() => positionComputedList.value.filter((e) => tradeMode.length ? tradeMode.includes(e.trademode) : true))
 
 
     // 获取持仓数量
     // 获取持仓数量
     const getOrderQty = (buyOrSell: BuyOrSell, code?: string | number) => {
     const getOrderQty = (buyOrSell: BuyOrSell, code?: string | number) => {
@@ -28,6 +29,7 @@ export const usePosition = (...tradeMode: number[]) => {
     onUnmounted(() => subscribe.stop())
     onUnmounted(() => subscribe.stop())
 
 
     return {
     return {
+        loading,
         positionList,
         positionList,
         getOrderQty
         getOrderQty
     }
     }

+ 1 - 1
src/packages/gstj/views/order/list/components/goodsorder/history/Index.vue

@@ -88,7 +88,7 @@ const componentMap = new Map<string, unknown>([
 ])
 ])
 
 
 const formData = reactive<Model.HisTradeOrderDetailReq>({
 const formData = reactive<Model.HisTradeOrderDetailReq>({
-    tradeMode: '50',
+    tradeMode: '50,16'
 })
 })
 
 
 const { loading, pageIndex, pageCount, run } = useRequest(queryHisTradeOrderDetail, {
 const { loading, pageIndex, pageCount, run } = useRequest(queryHisTradeOrderDetail, {

+ 1 - 1
src/packages/gstj/views/order/list/components/goodsorder/list/Index.vue

@@ -79,7 +79,7 @@ const { componentRef, componentId, openComponent, closeComponent } = useComponen
 const { loading, pageIndex, pageCount, run } = useRequest(queryTradeOrderDetail, {
 const { loading, pageIndex, pageCount, run } = useRequest(queryTradeOrderDetail, {
     params: {
     params: {
         pagesize: 20,
         pagesize: 20,
-        tradeMode: '50'
+        tradeMode: '50,16'
     },
     },
     onSuccess: (res) => {
     onSuccess: (res) => {
         if (pageIndex.value === 1) {
         if (pageIndex.value === 1) {

+ 1 - 1
src/packages/gstj/views/order/list/components/goodstrade/history/Index.vue

@@ -93,7 +93,7 @@ const componentMap = new Map<string, unknown>([
 ])
 ])
 
 
 const formData = reactive<Model.HisTradeDetailReq>({
 const formData = reactive<Model.HisTradeDetailReq>({
-    tradeMode: '50'
+    tradeMode: '50,16'
 })
 })
 
 
 const { loading, pageIndex, pageCount, run } = useRequest(queryHisTradeDetail, {
 const { loading, pageIndex, pageCount, run } = useRequest(queryHisTradeDetail, {

+ 1 - 1
src/packages/gstj/views/order/list/components/goodstrade/list/Index.vue

@@ -76,7 +76,7 @@ const { componentRef, componentId, openComponent, closeComponent } = useComponen
 const { loading, pageIndex, pageCount, run } = useRequest(queryTradeDetail, {
 const { loading, pageIndex, pageCount, run } = useRequest(queryTradeDetail, {
     params: {
     params: {
         pagesize: 20,
         pagesize: 20,
-        tradeMode: '50'
+        tradeMode: '50,16'
     },
     },
     onSuccess: (res) => {
     onSuccess: (res) => {
         if (pageIndex.value === 1) {
         if (pageIndex.value === 1) {

+ 1 - 1
src/packages/gstj/views/order/position/components/goods/close/Index.vue

@@ -39,7 +39,7 @@
                 </CellGroup>
                 </CellGroup>
             </div>
             </div>
             <template #footer>
             <template #footer>
-                <Button type="primary" block round @click="onCloseSumit">转让</Button>
+                <Button block square type="danger" @click="onCloseSumit">转让</Button>
             </template>
             </template>
         </app-view>
         </app-view>
     </app-modal>
     </app-modal>

+ 158 - 0
src/packages/mobile/components/modules/delivery/index.vue

@@ -0,0 +1,158 @@
+<!-- 交收操作 -->
+<template>
+    <app-modal direction="right" height="100%" v-model:show="showModal" :refresh="refresh">
+        <app-view class="g-form">
+            <template #header>
+                <app-navbar title="交收" @back="closed" />
+            </template>
+            <Form ref="formRef" class="g-form__container" @submit="onSubmit">
+                <CellGroup title="持仓信息" inset v-if="$slots.header">
+                    <slot name="header"></slot>
+                </CellGroup>
+                <CellGroup title="交收信息" inset>
+                    <Field name="wrstandardname" label="点选仓单" placeholder="请选择" :rules="formRules.wrstandardname"
+                        v-model="checkedRow.wrstandardname" @click="showWarehouseReceipt = true" is-link readonly />
+                    <template v-if="checkedRow.deliverygoodsid">
+                        <Field label="持有人" v-model="checkedRow.username" readonly />
+                        <Field label="仓库" v-model="checkedRow.warehousename" readonly />
+                        <Field label="数量" v-model="checkedRow.avalidqty" readonly />
+                    </template>
+                </CellGroup>
+                <CellGroup inset>
+                    <Field name="DeliveryQty" type="digit" :rules="formRules.DeliveryQty" label="交收数量">
+                        <template #input>
+                            <Stepper v-model="formData.DeliveryQty" theme="round" button-size="22" :min="0" :max="maxQty"
+                                :auto-fixed="false" integer />
+                        </template>
+                    </Field>
+                    <Field label="升贴水">
+                        <template #input>
+                            {{ discount.toFixed(2) }}
+                        </template>
+                    </Field>
+                    <slot name="form" :discount="discount" :qty="formData.DeliveryQty ?? 0"></slot>
+                </CellGroup>
+            </Form>
+            <template #footer>
+                <Button block square type="danger" @click="formRef?.submit">提交</Button>
+            </template>
+        </app-view>
+        <component :is="WarehouseReceipt" v-model:show="showWarehouseReceipt" :goods-id="goodsId" @change="onChange" />
+    </app-modal>
+</template>
+
+<script lang="ts" setup>
+import { reactive, shallowRef, computed, defineAsyncComponent } from 'vue'
+import { v4 } from 'uuid'
+import { CellGroup, Button, FieldRule, Form, Field, Stepper, FormInstance } from 'vant'
+import { dialog, fullloading } from '@/utils/vant'
+import { ClientType } from '@/constants/client'
+import { deliveryOrder } from '@/services/api/trade'
+import { useAccountStore } from '@/stores'
+import moment from 'moment'
+import AppModal from '@/components/base/modal/index.vue'
+
+const props = defineProps({
+    goodsId: {
+        type: Number,
+        required: true,
+    },
+    total: {
+        type: Number,
+        required: true,
+    }
+})
+
+const WarehouseReceipt = defineAsyncComponent(() => import('./warehouse-receipt.vue'))
+
+const accountStore = useAccountStore()
+const showModal = shallowRef(true)
+const refresh = shallowRef(false) // 是否刷新父组件数据
+const formRef = shallowRef<FormInstance>()
+const checkedRow = shallowRef<Partial<Model.WrDeliveryAvalidHoldLBRsp>>({}) //选中的点选仓单
+const showWarehouseReceipt = shallowRef(false)
+
+const formData = reactive<Partial<Proto.DeliveryOrderReq>>({
+    ClientType: ClientType.Web,
+    AccountID: accountStore.currentAccountId,
+    XGoodsID: props.goodsId
+})
+
+// 可选最大交收数量
+const maxQty = computed(() => {
+    const avalidqty = checkedRow.value.avalidqty ?? 0
+    const enableqty = props.total
+    return avalidqty > enableqty ? enableqty : avalidqty
+})
+
+// 升贴水
+const discount = computed(() => (checkedRow.value.pricemove ?? 0) * (formData.DeliveryQty ?? 0))
+
+// 表单验证规则
+const formRules: { [key: string]: FieldRule[] } = {
+    wrstandardname: [{
+        message: '请选择点选仓单',
+        validator: () => {
+            return !!checkedRow.value.deliverygoodsid
+        }
+    }],
+    DeliveryQty: [{
+        message: '请输入交收数量',
+        validator: () => {
+            return !!formData.DeliveryQty
+        }
+    }],
+}
+
+// 选择现货仓单
+const onChange = (item: Model.WrDeliveryAvalidHoldLBRsp) => {
+    checkedRow.value = item
+    showWarehouseReceipt.value = false
+}
+
+const onSubmit = () => {
+    dialog({
+        message: '确认要交收吗?',
+        showCancelButton: true,
+    }).then(() => {
+        fullloading((hideLoading) => {
+            const item = checkedRow.value
+            formData.DeliveryGoodsID = item.deliverygoodsid
+            formData.XQty = formData.DeliveryQty
+            formData.DeliveryOrderDetail = {
+                AccountID: item.accountid, // 对手方账号
+                Qty: formData.DeliveryQty, // 点选数量
+                LadingBillID: item.ladingbillid,// 提单ID
+                SubNum: item.subnum, // 提单子单号
+                WRFactorTypeID: item.wrfactortypeid, // 仓单要素类型ID
+            }
+            formData.ClientSerialNo = v4()
+            formData.ClientOrderTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
+
+            deliveryOrder({
+                data: formData
+            }).then(() => {
+                hideLoading('交收成功')
+
+            }).catch((err) => {
+                hideLoading(err, 'fail')
+            })
+        })
+    })
+}
+
+// 关闭弹窗
+const closed = (isRefresh = false) => {
+    if (showWarehouseReceipt.value) {
+        showWarehouseReceipt.value = false
+    } else {
+        refresh.value = isRefresh
+        showModal.value = false
+    }
+}
+
+// 暴露组件属性给父组件调用
+defineExpose({
+    closed,
+})
+</script>

+ 77 - 0
src/packages/mobile/components/modules/delivery/warehouse-receipt.vue

@@ -0,0 +1,77 @@
+<template>
+    <app-modal direction="right" height="100%">
+        <app-view class="g-form">
+            <template #header>
+                <app-navbar title="选择点选仓单" @back="closed" />
+            </template>
+            <RadioGroup class="g-form__container" v-model="checkedRow" v-if="dataList.length">
+                <CellGroup v-for="(item, index) in dataList" :key="index" @click="onChange(item)" inset>
+                    <Cell>
+                        <template #title>
+                            <Radio :name="item" checked-color="#ee0a24">
+                                <ul style="margin-left: .2rem;">
+                                    <li>
+                                        <span>持有人:</span>
+                                        <span>{{ item.username }}</span>
+                                    </li>
+                                    <li>
+                                        <span>商品:</span>
+                                        <span>{{ item.wrstandardname }}</span>
+                                    </li>
+                                    <li>
+                                        <span>仓库:</span>
+                                        <span>{{ item.warehousename }}</span>
+                                    </li>
+                                    <li>
+                                        <span>数量:</span>
+                                        <span>{{ item.avalidqty }}</span>
+                                    </li>
+                                    <li>
+                                        <span>升贴水:</span>
+                                        <span>{{ item.pricemove }}</span>
+                                    </li>
+                                </ul>
+                            </Radio>
+                        </template>
+                    </Cell>
+                </CellGroup>
+            </RadioGroup>
+            <Empty description="暂无数据" v-else />
+        </app-view>
+    </app-modal>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef } from 'vue'
+import { RadioGroup, Radio, Cell, CellGroup, Empty } from 'vant'
+import { useRequest } from '@/hooks/request'
+import { queryWrDeliveryAvalidHoldLB } from '@/services/api/transfer'
+import AppModal from '@/components/base/modal/index.vue'
+
+const props = defineProps({
+    goodsId: {
+        type: Number,
+        required: true,
+    },
+})
+
+const emit = defineEmits(['update:show', 'change'])
+const checkedRow = shallowRef<Model.WrDeliveryAvalidHoldLBRsp>()
+
+const { dataList } = useRequest(queryWrDeliveryAvalidHoldLB, {
+    params: {
+        goodsid: props.goodsId,
+    },
+})
+
+// 选择仓单
+const onChange = (item: Model.WrDeliveryAvalidHoldLBRsp) => {
+    checkedRow.value = item
+    emit('change', item)
+}
+
+// 关闭弹窗
+const closed = () => {
+    emit('update:show', false)
+}
+</script>

+ 1 - 1
src/packages/mobile/views/order/list/components/goodsorder/history/Index.vue

@@ -88,7 +88,7 @@ const componentMap = new Map<string, unknown>([
 ])
 ])
 
 
 const formData = reactive<Model.HisTradeOrderDetailReq>({
 const formData = reactive<Model.HisTradeOrderDetailReq>({
-    tradeMode: '50',
+    tradeMode: '50,16',
 })
 })
 
 
 const { loading, pageIndex, pageCount, run } = useRequest(queryHisTradeOrderDetail, {
 const { loading, pageIndex, pageCount, run } = useRequest(queryHisTradeOrderDetail, {

+ 1 - 1
src/packages/mobile/views/order/list/components/goodsorder/list/Index.vue

@@ -79,7 +79,7 @@ const { componentRef, componentId, openComponent, closeComponent } = useComponen
 const { loading, pageIndex, pageCount, run } = useRequest(queryTradeOrderDetail, {
 const { loading, pageIndex, pageCount, run } = useRequest(queryTradeOrderDetail, {
     params: {
     params: {
         pagesize: 20,
         pagesize: 20,
-        tradeMode: '50'
+        tradeMode: '50,16'
     },
     },
     onSuccess: (res) => {
     onSuccess: (res) => {
         if (pageIndex.value === 1) {
         if (pageIndex.value === 1) {

+ 1 - 1
src/packages/mobile/views/order/list/components/goodstrade/history/Index.vue

@@ -93,7 +93,7 @@ const componentMap = new Map<string, unknown>([
 ])
 ])
 
 
 const formData = reactive<Model.HisTradeDetailReq>({
 const formData = reactive<Model.HisTradeDetailReq>({
-    tradeMode: '50'
+    tradeMode: '50,16'
 })
 })
 
 
 const { loading, pageIndex, pageCount, run } = useRequest(queryHisTradeDetail, {
 const { loading, pageIndex, pageCount, run } = useRequest(queryHisTradeDetail, {

+ 1 - 1
src/packages/mobile/views/order/list/components/goodstrade/list/Index.vue

@@ -76,7 +76,7 @@ const { componentRef, componentId, openComponent, closeComponent } = useComponen
 const { loading, pageIndex, pageCount, run } = useRequest(queryTradeDetail, {
 const { loading, pageIndex, pageCount, run } = useRequest(queryTradeDetail, {
     params: {
     params: {
         pagesize: 20,
         pagesize: 20,
-        tradeMode: '50'
+        tradeMode: '50,16'
     },
     },
     onSuccess: (res) => {
     onSuccess: (res) => {
         if (pageIndex.value === 1) {
         if (pageIndex.value === 1) {

+ 21 - 23
src/packages/mobile/views/order/position/components/goods/close/Index.vue

@@ -3,16 +3,16 @@
     <app-modal direction="right" height="100%" v-model:show="showModal" :refresh="refresh">
     <app-modal direction="right" height="100%" v-model:show="showModal" :refresh="refresh">
         <app-view class="g-form">
         <app-view class="g-form">
             <template #header>
             <template #header>
-                <app-navbar title="订单持仓 - 转让" @back="closed" />
+                <app-navbar title="转让" @back="closed" />
             </template>
             </template>
-            <div class="order-detail__container g-form__container">
-                <CellGroup title="持仓信息">
+            <Form ref="formRef" class="g-form__container" @submit="onCloseSumit">
+                <CellGroup title="持仓信息" inset>
                     <Cell title="商品代码/名称" :value="`${selectedRow.goodscode}/${selectedRow.goodsname}`" />
                     <Cell title="商品代码/名称" :value="`${selectedRow.goodscode}/${selectedRow.goodsname}`" />
                     <Cell title="持仓方向" :value="getBuyOrSellName(selectedRow.buyorsell)" />
                     <Cell title="持仓方向" :value="getBuyOrSellName(selectedRow.buyorsell)" />
                     <Cell title="持仓金额" :value="formatDecimal(selectedRow.curholderamount)" />
                     <Cell title="持仓金额" :value="formatDecimal(selectedRow.curholderamount)" />
-                    <Cell title="持仓数量" :value="formatDecimal(selectedRow.curpositionqty)" />
-                    <Cell title="冻结数量" :value="formatDecimal(selectedRow.frozenqty)" />
-                    <Cell title="可用数量" :value="formatDecimal(selectedRow.enableqty)" />
+                    <Cell title="持仓数量" :value="selectedRow.curpositionqty" />
+                    <Cell title="冻结数量" :value="selectedRow.frozenqty" />
+                    <Cell title="可用数量" :value="selectedRow.enableqty" />
                     <Cell title="持仓均价" :value="formatDecimal(selectedRow.averageprice)" />
                     <Cell title="持仓均价" :value="formatDecimal(selectedRow.averageprice)" />
                     <Cell title="参考损益">
                     <Cell title="参考损益">
                         <template #value>
                         <template #value>
@@ -20,26 +20,24 @@
                         </template>
                         </template>
                     </Cell>
                     </Cell>
                 </CellGroup>
                 </CellGroup>
-                <CellGroup title="转让信息">
+                <CellGroup title="转让信息" inset>
                     <Cell title="当前价" :value="handleNumberValue(quote?.last)" />
                     <Cell title="当前价" :value="handleNumberValue(quote?.last)" />
-                    <Form class="goods-close__form" ref="formRef" @submit="onCloseSumit" v-if="props">
-                        <Field name="OrderPrice" :rules="formRules.OrderPrice" label="转让价格">
-                            <template #input>
-                                <Stepper v-model="formData.OrderPrice" theme="round" button-size="22" :min="0"
-                                    :decimal-length="selectedRow.decimalplace" :auto-fixed="false" />
-                            </template>
-                        </Field>
-                        <Field name="OrderQty" :rules="formRules.OrderQty" label="转让数量">
-                            <template #input>
-                                <Stepper v-model="formData.OrderQty" theme="round" button-size="22" :min="0"
-                                    :max="selectedRow.enableqty" :auto-fixed="false" integer />
-                            </template>
-                        </Field>
-                    </Form>
+                    <Field name="OrderPrice" :rules="formRules.OrderPrice" label="转让价格">
+                        <template #input>
+                            <Stepper v-model="formData.OrderPrice" theme="round" button-size="22" :min="0"
+                                :decimal-length="selectedRow.decimalplace" :auto-fixed="false" />
+                        </template>
+                    </Field>
+                    <Field name="OrderQty" :rules="formRules.OrderQty" label="转让数量">
+                        <template #input>
+                            <Stepper v-model="formData.OrderQty" theme="round" button-size="22" :min="0"
+                                :max="selectedRow.enableqty" :auto-fixed="false" integer />
+                        </template>
+                    </Field>
                 </CellGroup>
                 </CellGroup>
-            </div>
+            </Form>
             <template #footer>
             <template #footer>
-                <Button type="primary" block round @click="onCloseSumit">转让</Button>
+                <Button block square type="danger" @click="onCloseSumit">转让</Button>
             </template>
             </template>
         </app-view>
         </app-view>
     </app-modal>
     </app-modal>

+ 30 - 0
src/packages/mobile/views/order/position/components/goods/delivery16/index.vue

@@ -0,0 +1,30 @@
+<!-- 我的订单- 订单持仓 - 交收 -->
+<template>
+    <Delivery ref="deliveryRef" v-bind="{ goodsId: selectedRow.goodsid, total: selectedRow.enableqty }">
+        <template #header>
+            <Cell title="商品代码/名称" :value="`${selectedRow.goodscode}/${selectedRow.goodsname}`" />
+            <Cell title="持仓数量" :value="selectedRow.curpositionqty" />
+            <Cell title="可用数量" :value="selectedRow.enableqty" />
+        </template>
+    </Delivery>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef, PropType } from 'vue'
+import { Cell } from 'vant'
+import Delivery from '../../../../../../components/modules/delivery/index.vue'
+
+defineProps({
+    selectedRow: {
+        type: Object as PropType<Model.TradePositionRsp>,
+        required: true,
+    }
+})
+
+const deliveryRef = shallowRef()
+
+// 暴露组件属性给父组件调用
+defineExpose({
+    closed: () => deliveryRef.value?.closed(),
+})
+</script>

+ 18 - 20
src/packages/mobile/views/order/position/components/goods/delivery/Index.vue → src/packages/mobile/views/order/position/components/goods/delivery50/index.vue

@@ -3,16 +3,16 @@
     <app-modal direction="right" height="100%" v-model:show="showModal" :refresh="refresh">
     <app-modal direction="right" height="100%" v-model:show="showModal" :refresh="refresh">
         <app-view class="g-form">
         <app-view class="g-form">
             <template #header>
             <template #header>
-                <app-navbar title="订单持仓 - 交收" @back="closed" />
+                <app-navbar title="交收" @back="closed" />
             </template>
             </template>
-            <div class="order-detail__container g-form__container">
-                <CellGroup title="持仓信息">
+            <Form ref="formRef" class="g-form__container" @submit="onDeliverySumit">
+                <CellGroup title="持仓信息" inset>
                     <Cell title="商品代码/名称" :value="`${selectedRow.goodscode}/${selectedRow.goodsname}`" />
                     <Cell title="商品代码/名称" :value="`${selectedRow.goodscode}/${selectedRow.goodsname}`" />
                     <Cell title="持仓方向" :value="getBuyOrSellName(selectedRow.buyorsell)" />
                     <Cell title="持仓方向" :value="getBuyOrSellName(selectedRow.buyorsell)" />
                     <Cell title="持仓金额" :value="formatDecimal(selectedRow.marketamount)" />
                     <Cell title="持仓金额" :value="formatDecimal(selectedRow.marketamount)" />
-                    <Cell title="持仓数量" :value="formatDecimal(selectedRow.curpositionqty)" />
-                    <Cell title="冻结数量" :value="formatDecimal(selectedRow.frozenqty)" />
-                    <Cell title="可用数量" :value="formatDecimal(selectedRow.enableqty)" />
+                    <Cell title="持仓数量" :value="selectedRow.curpositionqty" />
+                    <Cell title="冻结数量" :value="selectedRow.frozenqty" />
+                    <Cell title="可用数量" :value="selectedRow.enableqty" />
                     <Cell title="持仓均价" :value="formatDecimal(selectedRow.averageprice)" />
                     <Cell title="持仓均价" :value="formatDecimal(selectedRow.averageprice)" />
                     <Cell title="参考损益">
                     <Cell title="参考损益">
                         <template #value>
                         <template #value>
@@ -20,23 +20,21 @@
                         </template>
                         </template>
                     </Cell>
                     </Cell>
                 </CellGroup>
                 </CellGroup>
-                <CellGroup title="交收信息">
+                <CellGroup title="交收信息" inset>
                     <Cell title="交收对手方" :value="selectedRow.matchname" />
                     <Cell title="交收对手方" :value="selectedRow.matchname" />
-                    <Form class="goods-close__form" ref="formRef" @submit="onDeliverySumit" v-if="props">
-                        <Field name="DeliveryLot" type="digit" :rules="formRules.DeliveryLot" label="交收数量">
-                            <template #input>
-                                <Stepper v-model="formData.DeliveryLot" theme="round" button-size="22" :min="0"
-                                    :max="selectedRow.enableqty" :auto-fixed="false" integer />
-                            </template>
-                        </Field>
-                        <Field name="DeliveryInfo" v-model="formData.DeliveryInfo" type="textarea" autosize clearable
-                            :rules="formRules.DeliveryInfo" maxlength="50" label="交收信息" placeholder="请输入交收信息">
-                        </Field>
-                    </Form>
+                    <Field name="DeliveryLot" type="digit" :rules="formRules.DeliveryLot" label="交收数量">
+                        <template #input>
+                            <Stepper v-model="formData.DeliveryLot" theme="round" button-size="22" :min="0"
+                                :max="selectedRow.enableqty" :auto-fixed="false" integer />
+                        </template>
+                    </Field>
+                    <Field name="DeliveryInfo" v-model="formData.DeliveryInfo" type="textarea" autosize clearable
+                        :rules="formRules.DeliveryInfo" maxlength="50" label="交收信息" placeholder="请输入交收信息">
+                    </Field>
                 </CellGroup>
                 </CellGroup>
-            </div>
+            </Form>
             <template #footer>
             <template #footer>
-                <Button type="primary" block round @click="onDeliverySumit">交收</Button>
+                <Button block square type="danger" @click="onDeliverySumit">提交</Button>
             </template>
             </template>
         </app-view>
         </app-view>
     </app-modal>
     </app-modal>

+ 8 - 6
src/packages/mobile/views/order/position/components/goods/list/Index.vue

@@ -17,7 +17,7 @@
                     <ul>
                     <ul>
                         <li>
                         <li>
                             <span>持有数量</span>
                             <span>持有数量</span>
-                            <span>{{ formatDecimal(item.curpositionqty) }}</span>
+                            <span>{{ item.curpositionqty }}</span>
                         </li>
                         </li>
                         <li>
                         <li>
                             <span>持仓均价</span>
                             <span>持仓均价</span>
@@ -25,7 +25,7 @@
                         </li>
                         </li>
                         <li>
                         <li>
                             <span>冻结数量</span>
                             <span>冻结数量</span>
-                            <span>{{ formatDecimal(item.frozenqty) }}</span>
+                            <span>{{ item.frozenqty }}</span>
                         </li>
                         </li>
                         <li>
                         <li>
                             <span>持仓金额</span>
                             <span>持仓金额</span>
@@ -33,7 +33,7 @@
                         </li>
                         </li>
                         <li>
                         <li>
                             <span>可用数量</span>
                             <span>可用数量</span>
-                            <span>{{ formatDecimal(item.enableqty) }}</span>
+                            <span>{{ item.enableqty }}</span>
                         </li>
                         </li>
                         <li>
                         <li>
                             <span>参考损益</span>
                             <span>参考损益</span>
@@ -45,7 +45,8 @@
                 </div>
                 </div>
                 <div class="g-order-list__btnbar" v-if="item.enableqty">
                 <div class="g-order-list__btnbar" v-if="item.enableqty">
                     <Button size="small" @click="showComponent('close', item)" round>转让</Button>
                     <Button size="small" @click="showComponent('close', item)" round>转让</Button>
-                    <Button size="small" @click="showComponent('delivery', item)" round>交收</Button>
+                    <Button size="small" @click="showComponent(item.trademode === 16 ? 'delivery16' : 'delivery50', item)"
+                        round>交收</Button>
                 </div>
                 </div>
             </div>
             </div>
         </div>
         </div>
@@ -66,10 +67,11 @@ import eventBus from '@/services/bus'
 
 
 const componentMap = new Map<string, unknown>([
 const componentMap = new Map<string, unknown>([
     ['close', defineAsyncComponent(() => import('../close/Index.vue'))],
     ['close', defineAsyncComponent(() => import('../close/Index.vue'))],
-    ['delivery', defineAsyncComponent(() => import('../delivery/Index.vue'))]
+    ['delivery50', defineAsyncComponent(() => import('../delivery50/index.vue'))],
+    ['delivery16', defineAsyncComponent(() => import('../delivery16/index.vue'))]
 ])
 ])
 
 
-const { positionList, loading } = usePosition(50)
+const { positionList, loading } = usePosition(50, 16)
 const selectedRow = shallowRef<Model.TradePositionRsp>()
 const selectedRow = shallowRef<Model.TradePositionRsp>()
 const pullRefreshRef = shallowRef()
 const pullRefreshRef = shallowRef()
 
 

+ 41 - 86
src/packages/mobile/views/order/position/components/transfer/delivery/Index.vue

@@ -1,62 +1,35 @@
 <!-- 我的持仓-转让持仓-交收 -->
 <!-- 我的持仓-转让持仓-交收 -->
 <template>
 <template>
-    <app-modal direction="right" height="100%" v-model:show="showModal" :refresh="refresh">
-        <app-view class="g-form">
-            <template #header>
-                <app-navbar title="交收申请" @back="closed" />
-            </template>
-            <app-pull-refresh ref="pullRefreshRef" v-model:loading="loading" v-model:error="error"
-                v-model:pageIndex="pageIndex" :page-count="pageCount" @refresh="run">
-                <div class="g-order-list">
-                    <div class="g-order-list__box" v-for="(item, index) in dataList" :key="index">
-                        <div class="g-order-list__titlebar">
-                            <div class="left">
-                                <h4>{{ item.username }}</h4>
-                                <span>{{ item.warehousename }}</span>
-                            </div>
-                        </div>
-                        <div class="g-order-list__content">
-                            <ul>
-                                <li>
-                                    <span>商品</span>
-                                    <span>{{ item.wrstandardname }}</span>
-                                </li>
-                                <li>
-                                    <span>升贴水</span>
-                                    <span>{{ item.pricemove }}</span>
-                                </li>
-                                <li>
-                                    <span>数量</span>
-                                    <span>{{ item.avalidqty }}</span>
-                                </li>
-                            </ul>
-                        </div>
-                        <div class="g-order-list__btnbar">
-                            <Button size="small" @click="showComponent('trade', item)" round>点选</Button>
-                        </div>
-                    </div>
-                </div>
-            </app-pull-refresh>
-            <template #footer>
-                <component ref="componentRef" v-bind="{ detail, selectedRow }" :is="componentMap.get(componentId)"
-                    @closed="closeComponent" v-if="componentId" />
-            </template>
-        </app-view>
-    </app-modal>
+    <Delivery ref="deliveryRef" v-bind="{ goodsId: selectedRow.goodsid, total: selectedRow.buycurpositionqty }">
+        <template #header>
+            <Cell title="商品代码/名称" :value="`${selectedRow.goodscode}/${selectedRow.goodsname}`" />
+            <Cell title="持仓数量" :value="selectedRow.buycurpositionqty" />
+            <Cell title="可用数量" :value="enableqty" />
+        </template>
+        <template #form="{ qty, discount }">
+            <Field label="总货款">
+                <template #input>
+                    {{ payment(qty).toFixed(2) }}
+                </template>
+            </Field>
+            <Field label="剩余货款">
+                <template #input>
+                    {{ available(qty, discount).toFixed(2) }}
+                </template>
+            </Field>
+            <Field label="已付定金">
+                <template #input>
+                    {{ deposit(qty).toFixed(2) }}
+                </template>
+            </Field>
+        </template>
+    </Delivery>
 </template>
 </template>
 
 
 <script lang="ts" setup>
 <script lang="ts" setup>
-import { shallowRef, PropType, defineAsyncComponent } from 'vue'
-import { Button } from 'vant'
-import { useComponent } from '@/hooks/component'
-import { useRequest } from '@/hooks/request'
-import { queryWrDeliveryAvalidHoldLB } from '@/services/api/transfer'
-import AppModal from '@/components/base/modal/index.vue'
-import AppPullRefresh from '../../../../../../components/base/pull-refresh/index.vue'
-
-const componentMap = new Map<string, unknown>([
-    ['trade', defineAsyncComponent(() => import('./trade/Index.vue'))], // 交收
-])
+import { shallowRef, PropType, computed } from 'vue'
+import { Cell, Field } from 'vant'
+import Delivery from '../../../../../../components/modules/delivery/index.vue'
 
 
 const props = defineProps({
 const props = defineProps({
     selectedRow: {
     selectedRow: {
@@ -65,46 +38,28 @@ const props = defineProps({
     }
     }
 })
 })
 
 
-const showModal = shallowRef(true)
-const refresh = shallowRef(false) // 是否刷新父组件数据
-const error = shallowRef(false)
-const pullRefreshRef = shallowRef()
-const dataList = shallowRef<Model.WrDeliveryAvalidHoldLBRsp[]>([])
-const detail = shallowRef<Model.WrDeliveryAvalidHoldLBRsp>()
+const deliveryRef = shallowRef()
 
 
-const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
-    refresh.value = true
-    pullRefreshRef.value?.refresh()
-})
+// 可用数量
+const enableqty = computed(() => props.selectedRow.buycurpositionqty - props.selectedRow.buyfrozenqty)
 
 
-const { loading, pageIndex, pageCount, run } = useRequest(queryWrDeliveryAvalidHoldLB, {
-    params: {
-        pagesize: 20,
-        goodsid: props.selectedRow.goodsid,
-    },
-    onSuccess: (res) => {
-        if (pageIndex.value === 1) {
-            dataList.value = []
-        }
-        dataList.value.push(...res.data)
-    },
-    onError: () => {
-        error.value = true
-    }
-})
+// 总货款
+const payment = (qty: number) => {
+    return props.selectedRow.presaleprice * qty
+}
 
 
-// 关闭弹窗
-const closed = () => {
-    showModal.value = false
+// 已付定金
+const deposit = (qty: number) => {
+    return payment(qty) * props.selectedRow.transferdepositratio
 }
 }
 
 
-const showComponent = (componentName: string, row: Model.WrDeliveryAvalidHoldLBRsp) => {
-    detail.value = row
-    openComponent(componentName)
+// 剩余货款
+const available = (qty: number, discount: number) => {
+    return payment(qty) - deposit(qty) + discount
 }
 }
 
 
 // 暴露组件属性给父组件调用
 // 暴露组件属性给父组件调用
 defineExpose({
 defineExpose({
-    closed,
+    closed: () => deliveryRef.value?.closed(),
 })
 })
 </script>
 </script>

+ 0 - 132
src/packages/mobile/views/order/position/components/transfer/delivery/trade/Index.vue

@@ -1,132 +0,0 @@
-<template>
-    <app-modal direction="right" height="100%" v-model:show="showModal" :refresh="refresh">
-        <app-view class="g-form">
-            <template #header>
-                <app-navbar title="点选" @back="closed" />
-            </template>
-            <Form ref="formRef" class="g-form__container" @submit="onSubmit">
-                <CellGroup inset>
-                    <Cell title="商品代码/名称" :value="`${detail.wrstandardcode}/${detail.wrstandardname}`" />
-                    <Cell title="仓库" :value="detail.warehousename" />
-                    <Cell title="升贴水" :value="discount.toFixed(2)" />
-                    <Cell title="数量" :value="detail.avalidqty" />
-                    <Cell title="总货款" :value="payment.toFixed(2)" />
-                    <Cell title="已付定金" :value="deposit.toFixed(2)" />
-                    <Cell title="剩余货款" :value="available.toFixed(2)" />
-                    <Field name="DeliveryQty" :rules="formRules.DeliveryQty" label="点选数量">
-                        <template #input>
-                            <Stepper v-model="formData.DeliveryQty" theme="round" button-size="22"
-                                :max="selectedRow.buycurpositionqty" :auto-fixed="false" integer />
-                        </template>
-                    </Field>
-                </CellGroup>
-            </Form>
-            <template #footer>
-                <div class="g-form__footer">
-                    <Button block square type="danger" @click="formRef?.submit">提交</Button>
-                </div>
-            </template>
-        </app-view>
-    </app-modal>
-</template>
-
-<script lang="ts" setup>
-import { shallowRef, reactive, PropType, computed } from 'vue'
-import { v4 } from 'uuid'
-import { CellGroup, Cell, Form, Field, Stepper, Button, FieldRule, FormInstance } from 'vant'
-import { fullloading, dialog } from '@/utils/vant'
-import { ClientType } from '@/constants/client'
-import { deliveryOrder } from '@/services/api/trade'
-import { useAccountStore } from '@/stores'
-import moment from 'moment'
-import AppModal from '@/components/base/modal/index.vue'
-
-const props = defineProps({
-    detail: {
-        type: Object as PropType<Model.WrDeliveryAvalidHoldLBRsp>,
-        required: true
-    },
-    selectedRow: {
-        type: Object as PropType<Model.MineTradePositionExsRsp>,
-        required: true
-    },
-})
-
-const accountStore = useAccountStore()
-const formRef = shallowRef<FormInstance>()
-const refresh = shallowRef(false) // 是否刷新父组件数据
-const showModal = shallowRef(true)
-
-const formData = reactive<Partial<Proto.DeliveryOrderReq>>({
-    ClientType: ClientType.Web,
-    AccountID: accountStore.currentAccountId,
-    XGoodsID: props.detail.goodsid,
-    DeliveryGoodsID: props.detail.deliverygoodsid,
-})
-
-// 升贴水
-const discount = computed(() => {
-    return props.detail.pricemove * (formData.DeliveryQty ?? 0)
-})
-
-// 总货款
-const payment = computed(() => {
-    return props.selectedRow.presaleprice * (formData.DeliveryQty ?? 0)
-})
-
-// 剩余货款
-const available = computed(() => {
-    return payment.value - deposit.value + discount.value
-})
-
-// 已付定金
-const deposit = computed(() => {
-    return payment.value * props.selectedRow.transferdepositratio
-})
-
-// 表单验证规则
-const formRules: { [key in keyof Proto.DeliveryOrderReq]?: FieldRule[] } = {
-    DeliveryQty: [{
-        message: '请输入数量',
-        validator: () => {
-            return !!formData.DeliveryQty
-        }
-    }],
-}
-
-// 提交摘牌
-const onSubmit = () => {
-    formData.ClientSerialNo = v4()
-    formData.ClientOrderTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
-    formData.XQty = formData.DeliveryQty
-    formData.DeliveryOrderDetail = {
-        AccountID: props.detail.accountid, // 对手方账号
-        Qty: formData.DeliveryQty, // 点选数量
-        LadingBillID: props.detail.ladingbillid,// 提单ID
-        SubNum: props.detail.subnum, // 提单子单号
-        WRFactorTypeID: props.detail.wrfactortypeid, // 仓单要素类型ID
-    }
-
-    fullloading((hideLoading) => {
-        deliveryOrder({
-            data: formData
-        }).then(() => {
-            hideLoading()
-            dialog('提交成功').then(() => closed(true))
-        }).catch((err) => {
-            hideLoading(err, 'fail')
-        })
-    })
-}
-
-// 关闭弹窗
-const closed = (isRefresh = false) => {
-    refresh.value = isRefresh
-    showModal.value = false
-}
-
-// 暴露组件属性给父组件调用
-defineExpose({
-    closed,
-})
-</script>

+ 8 - 4
src/packages/mobile/views/spot/add/components/buy/index.vue

@@ -4,10 +4,9 @@
             <CellGroup inset>
             <CellGroup inset>
                 <Performance ref="performanceRef" tmptype="0,2" name="PerformanceTemplateID"
                 <Performance ref="performanceRef" tmptype="0,2" name="PerformanceTemplateID"
                     v-model="formData.PerformanceTemplateID" />
                     v-model="formData.PerformanceTemplateID" />
-                <Field name="WRFactorTypeId" label="现货仓单" placeholder="请选择" v-model="selectedRow.wrfactortypeid"
+                <Field name="WRFactorTypeId" label="现货仓单" placeholder="请选择" v-model="selectedRow.wrstandardname"
                     :rules="formRules.WRFactorTypeId" @click="showWarehouseReceipt = true" is-link readonly />
                     :rules="formRules.WRFactorTypeId" @click="showWarehouseReceipt = true" is-link readonly />
                 <template v-if="selectedRow.wrfactortypeid">
                 <template v-if="selectedRow.wrfactortypeid">
-                    <Field label="商品" v-model="selectedRow.wrstandardname" readonly />
                     <Field label="仓库" v-model="selectedRow.warehousename" readonly />
                     <Field label="仓库" v-model="selectedRow.warehousename" readonly />
                     <Field label="可用量">
                     <Field label="可用量">
                         <template #input>
                         <template #input>
@@ -127,7 +126,12 @@ const formSubmit = () => {
 
 
 // 离开页面前关闭组件
 // 离开页面前关闭组件
 onBeforeRouteLeave((to, from, next) => {
 onBeforeRouteLeave((to, from, next) => {
-    const flag = performanceRef.value?.closed()
-    next(flag)
+    if (showWarehouseReceipt.value) {
+        showWarehouseReceipt.value = false
+        next(false)
+    } else {
+        const flag = performanceRef.value?.closed()
+        next(flag)
+    }
 })
 })
 </script>
 </script>

+ 6 - 1
src/packages/mobile/views/spot/add/components/buy/warehouse-receipt.vue

@@ -2,7 +2,7 @@
     <app-modal direction="right" height="100%">
     <app-modal direction="right" height="100%">
         <app-view class="g-form">
         <app-view class="g-form">
             <template #header>
             <template #header>
-                <app-navbar title="选择现货仓单" />
+                <app-navbar title="选择现货仓单" @back="closed" />
             </template>
             </template>
             <RadioGroup class="g-form__container" v-model="checkedRow" v-if="dataList.length">
             <RadioGroup class="g-form__container" v-model="checkedRow" v-if="dataList.length">
                 <CellGroup v-for="(item, index) in dataList" :key="index" @click="onChange(item)" inset>
                 <CellGroup v-for="(item, index) in dataList" :key="index" @click="onChange(item)" inset>
@@ -48,4 +48,9 @@ const onChange = (item: Model.HoldLBRsp) => {
     checkedRow.value = item
     checkedRow.value = item
     emit('change', item)
     emit('change', item)
 }
 }
+
+// 关闭弹窗
+const closed = () => {
+    emit('update:show', false)
+}
 </script>
 </script>

+ 1 - 1
src/packages/mobile/views/transfer/delisting/Index.vue

@@ -1,7 +1,7 @@
 <template>
 <template>
     <app-view>
     <app-view>
         <template #header>
         <template #header>
-            <app-navbar :title="detail ? `${detail.goodscode}/${detail.goodsname}` : '转让列表'" />
+            <app-navbar :title="detail ? `${detail.goodscode}/${detail.goodsname}` : '买卖大厅'" />
         </template>
         </template>
         <app-pull-refresh ref="pullRefreshRef" v-model:loading="loading" v-model:error="error" v-model:pageIndex="pageIndex"
         <app-pull-refresh ref="pullRefreshRef" v-model:loading="loading" v-model:error="error" v-model:pageIndex="pageIndex"
             :page-count="pageCount" @refresh="run">
             :page-count="pageCount" @refresh="run">

+ 1 - 1
src/packages/pc/components/modules/delivery/index.vue

@@ -100,7 +100,7 @@ const discount = computed(() => {
     return dataList.value.reduce((pre, cur) => pre + cur.deliveryLot * cur.pricemove, 0)
     return dataList.value.reduce((pre, cur) => pre + cur.deliveryLot * cur.pricemove, 0)
 })
 })
 
 
-// 最大交收数量
+// 可选最大交收数量
 const maxQty = (index: number) => {
 const maxQty = (index: number) => {
     const item = dataList.value[index]
     const item = dataList.value[index]
     const count = dataList.value.reduce((pre, cur, i) => i === index ? pre : pre + cur.deliveryLot, 0) // 计算已点选数量
     const count = dataList.value.reduce((pre, cur, i) => i === index ? pre : pre + cur.deliveryLot, 0) // 计算已点选数量

+ 1 - 1
src/packages/qxst/views/order/list/components/goodsorder/history/Index.vue

@@ -88,7 +88,7 @@ const componentMap = new Map<string, unknown>([
 ])
 ])
 
 
 const formData = reactive<Model.HisTradeOrderDetailReq>({
 const formData = reactive<Model.HisTradeOrderDetailReq>({
-    tradeMode: '50',
+    tradeMode: '50,16'
 })
 })
 
 
 const { loading, pageIndex, pageCount, run } = useRequest(queryHisTradeOrderDetail, {
 const { loading, pageIndex, pageCount, run } = useRequest(queryHisTradeOrderDetail, {

+ 1 - 1
src/packages/qxst/views/order/list/components/goodsorder/list/Index.vue

@@ -79,7 +79,7 @@ const { componentRef, componentId, openComponent, closeComponent } = useComponen
 const { loading, pageIndex, pageCount, run } = useRequest(queryTradeOrderDetail, {
 const { loading, pageIndex, pageCount, run } = useRequest(queryTradeOrderDetail, {
     params: {
     params: {
         pagesize: 20,
         pagesize: 20,
-        tradeMode: '50'
+        tradeMode: '50,16'
     },
     },
     onSuccess: (res) => {
     onSuccess: (res) => {
         if (pageIndex.value === 1) {
         if (pageIndex.value === 1) {

+ 1 - 1
src/packages/qxst/views/order/list/components/goodstrade/history/Index.vue

@@ -93,7 +93,7 @@ const componentMap = new Map<string, unknown>([
 ])
 ])
 
 
 const formData = reactive<Model.HisTradeDetailReq>({
 const formData = reactive<Model.HisTradeDetailReq>({
-    tradeMode: '50'
+    tradeMode: '50,16'
 })
 })
 
 
 const { loading, pageIndex, pageCount, run } = useRequest(queryHisTradeDetail, {
 const { loading, pageIndex, pageCount, run } = useRequest(queryHisTradeDetail, {

+ 1 - 1
src/packages/qxst/views/order/list/components/goodstrade/list/Index.vue

@@ -76,7 +76,7 @@ const { componentRef, componentId, openComponent, closeComponent } = useComponen
 const { loading, pageIndex, pageCount, run } = useRequest(queryTradeDetail, {
 const { loading, pageIndex, pageCount, run } = useRequest(queryTradeDetail, {
     params: {
     params: {
         pagesize: 20,
         pagesize: 20,
-        tradeMode: '50'
+        tradeMode: '50,16'
     },
     },
     onSuccess: (res) => {
     onSuccess: (res) => {
         if (pageIndex.value === 1) {
         if (pageIndex.value === 1) {

+ 1 - 1
src/packages/qxst/views/order/position/components/goods/close/Index.vue

@@ -39,7 +39,7 @@
                 </CellGroup>
                 </CellGroup>
             </div>
             </div>
             <template #footer>
             <template #footer>
-                <Button type="primary" block round @click="onCloseSumit">转让</Button>
+                <Button block square type="danger" @click="onCloseSumit">转让</Button>
             </template>
             </template>
         </app-view>
         </app-view>
     </app-modal>
     </app-modal>