li.shaoyi il y a 3 ans
Parent
commit
6ccff82fe8

+ 8 - 3
src/packages/mobile/views/purchase/detail/index.vue

@@ -26,8 +26,7 @@
                 <Field name="DepositID" label="支付方式" :rules="formRules.DepositID" is-link
                     v-if="selectedDate?.presaleapplyid">
                     <template #input>
-                        <app-select v-model="formData.DepositID" :options="presaleApplyDeposits"
-                            @confirm="formRef?.validate('DepositID')" />
+                        <app-select :options="presaleApplyDeposits" @confirm="onDepositChange" />
                     </template>
                 </Field>
                 <Field label="参考价" v-if="selectedDate">
@@ -150,7 +149,7 @@ const deposit = computed(() => {
     const { Qty = 0, DepositID } = formData.value
     const { presaleapplydeposits } = details.value
     const { unitprice = 0 } = selectedDate.value ?? {}
-    const apply = presaleapplydeposits?.find((e) => e.depositid === DepositID) // 选中的支付方式
+    const apply = presaleapplydeposits?.find((e) => e.depositid === DepositID?.toString()) // 选中的支付方式
 
     if (apply) {
         return (unitprice * apply.depositrate * Qty).toFixed(2)
@@ -231,6 +230,12 @@ const onMonthChange = (value: string) => {
     formRef.value?.validate('PresaleApplyID')
 }
 
+// 切换支付方式
+const onDepositChange = (value: string) => {
+    formData.value.DepositID = Long.fromString(value)
+    formRef.value?.validate('DepositID')
+}
+
 // 更新表单数据
 const updateForm = (formValue: Proto.SpotPresaleDestingOrderReq) => {
     formData.value = formValue

+ 1 - 1
src/types/model/goods.d.ts

@@ -119,7 +119,7 @@ declare namespace Model {
             wrstandardname: string; // 现货商品名称
         };
         presaleapplydeposits: {
-            depositid: number; // 自增ID autoid
+            depositid: string; // 自增ID autoid
             depositrate: number; // 定金比例
             discountamount: number; // 优惠金额(每吨)
             presaleapplyid: string; // 预售申请ID(184+Unix秒时间戳(10位)+xxxxxx)

+ 1 - 1
src/types/proto/trade.d.ts

@@ -10,7 +10,7 @@ declare global {
             AccountID: number; // 资金账号,必填
             PresaleApplyID: Long; // 预售申请ID,必填
             Qty: number; // 预售数量,必填
-            DepositID: number; // 定金方式,THJ_PresaleApplyDeposit表ID,必填
+            DepositID: Long; // 定金方式,THJ_PresaleApplyDeposit表ID,必填
             THJDeliveryMode: number; // 交割方式,必填1:平台仓储2:自提
             ContactName: string; // 联系人姓名,THJDeliveryMode=2,3时必填
             ContactInfo: string; // 联系方式,THJDeliveryMode=2,3时必填