li.shaoyi hai 1 ano
pai
achega
9552bad8b9

+ 9 - 6
src/packages/mobile/components/modules/delivery/index.vue

@@ -10,8 +10,9 @@
                     <slot name="header"></slot>
                 </CellGroup>
                 <CellGroup title="交收信息" inset>
-                    <Field name="wrstandardname" label="点选仓单" placeholder="请选择" input-align="right" :rules="formRules.wrstandardname"
-                        v-model="checkedRow.wrstandardname" @click="showWarehouseReceipt = true" is-link readonly />
+                    <Field name="wrstandardname" label="点选仓单" placeholder="请选择" input-align="right"
+                        :rules="formRules.wrstandardname" v-model="checkedRow.wrstandardname"
+                        @click="showWarehouseReceipt = true" is-link readonly />
                     <template v-if="checkedRow.deliverygoodsid">
                         <Cell title="持有人" :value="checkedRow.username" />
                         <Cell title="仓库" :value="checkedRow.warehousename" />
@@ -73,6 +74,7 @@ const refresh = shallowRef(false) // 是否刷新父组件数据
 const formRef = shallowRef<FormInstance>()
 const checkedRow = shallowRef<Partial<Model.WrDeliveryAvalidHoldLBRsp>>({}) //选中的点选仓单
 const showWarehouseReceipt = shallowRef(false)
+const quote = futuresStore.getGoodsQuote(props.goodsId) // 商品实时盘面
 
 const formData = reactive<Partial<Proto.DeliveryOrderReq>>({
     ClientType: ClientType.Web,
@@ -92,8 +94,7 @@ const { data: deliveryRelation } = useRequest(queryDeliveryRelation, {
 
 // 数量步长
 const qtyStep = computed(() => {
-    const quote = futuresStore.getGoodsQuote(props.goodsId)
-    const { agreeunit = 1 } = quote.value ?? {}
+    const { agreeunit = 0 } = quote.value ?? {}
     const { mindeliveryqty = 0, rratio1 = 0, rratio2 = 0 } = deliveryRelation.value ?? {}
     if (rratio2 && rratio1) {
         return agreeunit * mindeliveryqty * (rratio2 / rratio1)
@@ -120,9 +121,11 @@ const formRules: { [key: string]: FieldRule[] } = {
         }
     }],
     DeliveryQty: [{
-        message: '请输入交收数量',
         validator: () => {
-            return !!formData.DeliveryQty
+            if (formData.DeliveryQty) {
+                return formData.DeliveryQty % qtyStep.value === 0 ? true : '数量只能是' + qtyStep.value + '的整数倍'
+            }
+            return '请输入交收数量'
         }
     }],
 }

+ 1 - 1
src/packages/mobile/views/order/delivery/components/online/detail/Index.vue

@@ -1,6 +1,6 @@
 <!-- 交收提货-点选交收单-详情 -->
 <template>
-    <app-modal direction="right-top" height="100%" v-model:show="showModal">
+    <app-modal direction="right-top" height="100%" width="100%" v-model:show="showModal">
         <app-view class="g-form">
             <template #header>
                 <app-navbar title="点选交收单" @back="closed" />

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

@@ -43,7 +43,8 @@
         <div class="app-delivery__empty" v-else>暂无数据</div>
         <template #footer>
             <div class="app-delivery__details">
-                <slot name="footer" :discount="discount" :qty="qty" :qtyStep="qtyStep" :goodunit="deliveryRelation?.enumdicname ?? ''"></slot>
+                <slot name="footer" :discount="discount" :qty="qty" :qtyStep="qtyStep"
+                    :goodunit="deliveryRelation?.enumdicname ?? ''"></slot>
             </div>
             <div class="app-delivery__btnbar">
                 <el-button type="info" @click="onCancel(false)">取消</el-button>
@@ -84,6 +85,7 @@ const show = ref(true)
 const refresh = ref(false)
 const loading = ref(false)
 const dataList = ref<(Model.WrDeliveryAvalidHoldLBRsp & { deliveryLot: number })[]>([])
+const quote = futuresStore.getGoodsQuote(props.goodsId) // 商品实时盘面
 
 useRequest(queryWrDeliveryAvalidHoldLB, {
     params: {
@@ -109,8 +111,7 @@ const { data: deliveryRelation } = useRequest(queryDeliveryRelation, {
 
 // 数量步长
 const qtyStep = computed(() => {
-    const quote = futuresStore.getGoodsQuote(props.goodsId)
-    const { agreeunit = 1 } = quote.value ?? {}
+    const { agreeunit = 0 } = quote.value ?? {}
     const { mindeliveryqty = 0, rratio1 = 0, rratio2 = 0 } = deliveryRelation.value ?? {}
     if (rratio2 && rratio1) {
         return agreeunit * mindeliveryqty * (rratio2 / rratio1)
@@ -140,7 +141,7 @@ const onCancel = (isRefresh = false) => {
 }
 
 const onSubmit = async () => {
-    if (dataList.value.some((e) => e.deliveryLot)) {
+    if (qty.value && qty.value % qtyStep.value === 0) {
         loading.value = true
         const errMessage: string[] = []
         for (let i = 0; i < dataList.value.length; i++) {