|
|
@@ -27,6 +27,9 @@
|
|
|
</template>
|
|
|
</Field>
|
|
|
</CellGroup>
|
|
|
+ <CellGroup inset>
|
|
|
+ <Cell title="交易时间" :value="`${param326} - ${param327}`" />
|
|
|
+ </CellGroup>
|
|
|
</Form>
|
|
|
<template #footer>
|
|
|
<div class="g-form__footer">
|
|
|
@@ -40,12 +43,15 @@
|
|
|
<script lang="ts" setup>
|
|
|
import { shallowRef, PropType, onMounted, computed, reactive } from 'vue'
|
|
|
import { CellGroup, Cell, Button, Stepper, Field, Form, FormInstance, FieldRule, RadioGroup, Radio } from 'vant'
|
|
|
-import { BuyOrSell } from '@/constants/order'
|
|
|
import { fullloading } from '@/utils/vant'
|
|
|
import { handleRequestBigNumber, parsePercent, formatDecimal } from '@/filters'
|
|
|
-import AppModal from '@/components/base/modal/index.vue'
|
|
|
-import { marketOrderDeliveryApply } from '@/services/api/trade'
|
|
|
+import { BuyOrSell } from '@/constants/order'
|
|
|
import { getGoodsUnitName } from '@/constants/unit'
|
|
|
+import { getServerTime } from '@/services/api/common'
|
|
|
+import { marketOrderDeliveryApply } from '@/services/api/trade'
|
|
|
+import { useUserStore } from '@/stores'
|
|
|
+import AppModal from '@/components/base/modal/index.vue'
|
|
|
+import moment from 'moment'
|
|
|
|
|
|
const props = defineProps({
|
|
|
selectedRow: {
|
|
|
@@ -54,6 +60,10 @@ const props = defineProps({
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+const userStore = useUserStore()
|
|
|
+const param326 = userStore.getSystemParamValue('326')
|
|
|
+const param327 = userStore.getSystemParamValue('327')
|
|
|
+
|
|
|
const formData = reactive<Proto.MarketOrderDeliveryApplyReq>({ HoldDetails: [] })
|
|
|
const formRef = shallowRef<FormInstance>()
|
|
|
const showModal = shallowRef(true)
|
|
|
@@ -106,14 +116,31 @@ const onSubmit = () => {
|
|
|
DeliveryQty: orderQty.value // 交收接口要的是数量不是手数,所以不用除以agreeunit
|
|
|
}]
|
|
|
|
|
|
- fullloading((hideLoading) => {
|
|
|
- marketOrderDeliveryApply({
|
|
|
- data: formData
|
|
|
- }).then(() => {
|
|
|
- hideLoading('提交成功', 'success')
|
|
|
- closed(true)
|
|
|
- }).catch((err) => {
|
|
|
- hideLoading(err, 'fail')
|
|
|
+ fullloading(async (hideLoading) => {
|
|
|
+ getServerTime().then((res) => {
|
|
|
+ if (param326 && param327) {
|
|
|
+ const n = moment(res.data)
|
|
|
+ const s = moment(param326, 'HH:mm')
|
|
|
+ const e = moment(param327, 'HH:mm')
|
|
|
+
|
|
|
+ // 任务 #6055
|
|
|
+ if (n.isSameOrAfter(s) && n.isBefore(e)) {
|
|
|
+ marketOrderDeliveryApply({
|
|
|
+ data: formData
|
|
|
+ }).then(() => {
|
|
|
+ hideLoading('提交成功', 'success')
|
|
|
+ closed(true)
|
|
|
+ }).catch((err) => {
|
|
|
+ hideLoading(err, 'fail')
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ hideLoading('提交失败:不在交易时间内', 'fail')
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ hideLoading('交易时间错误,请联系管理员', 'fail')
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ hideLoading('服务器时间错误', 'fail')
|
|
|
})
|
|
|
})
|
|
|
}
|