|
@@ -2,8 +2,7 @@
|
|
|
<app-popup class="supply-demand-listing" :title="buyorsell === BuyOrSell.Sell ? '我要卖' : '我要买'" v-model:show="showModal"
|
|
<app-popup class="supply-demand-listing" :title="buyorsell === BuyOrSell.Sell ? '我要卖' : '我要买'" v-model:show="showModal"
|
|
|
:refresh="refresh">
|
|
:refresh="refresh">
|
|
|
<Form class="supply-demand-listing__form" ref="formRef" @submit="onSubmit">
|
|
<Form class="supply-demand-listing__form" ref="formRef" @submit="onSubmit">
|
|
|
- <Field name="PerformanceTemplateID" label="履约模板" placeholder="请选择" v-model="formData.PerformanceTemplateID" :rules="formRules.PerformanceTemplateID"
|
|
|
|
|
- @click="showPerformancePlan = true" is-link readonly />
|
|
|
|
|
|
|
+ <Performance ref="performanceRef" v-model="formData.PerformanceTemplateID" />
|
|
|
<Field name="FixedPrice" :rules="formRules.FixedPrice" label="挂牌价格">
|
|
<Field name="FixedPrice" :rules="formRules.FixedPrice" label="挂牌价格">
|
|
|
<template #input>
|
|
<template #input>
|
|
|
<Stepper v-model="formData.FixedPrice" theme="round" :decimal-length="2" :auto-fixed="false"
|
|
<Stepper v-model="formData.FixedPrice" theme="round" :decimal-length="2" :auto-fixed="false"
|
|
@@ -42,7 +41,6 @@
|
|
|
<Button :type="buyorsell === BuyOrSell.Sell ? 'primary' : 'danger'" block round
|
|
<Button :type="buyorsell === BuyOrSell.Sell ? 'primary' : 'danger'" block round
|
|
|
@click="formRef?.submit">确定</Button>
|
|
@click="formRef?.submit">确定</Button>
|
|
|
</template>
|
|
</template>
|
|
|
- <component :is="PerformanceTmp" v-model:show="showPerformancePlan" @change="onPerformanceTmpChange" />
|
|
|
|
|
</app-popup>
|
|
</app-popup>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -55,10 +53,9 @@ import { BuyOrSell } from '@/constants/order'
|
|
|
import { queryHoldLB } from '@/services/api/order'
|
|
import { queryHoldLB } from '@/services/api/order'
|
|
|
import { useHdWROrder } from '@/business/trade'
|
|
import { useHdWROrder } from '@/business/trade'
|
|
|
import AppPopup from '../../../../../components/base/popup/index.vue'
|
|
import AppPopup from '../../../../../components/base/popup/index.vue'
|
|
|
-import { onBeforeRouteLeave } from 'vue-router'
|
|
|
|
|
|
|
|
|
|
//import AppSelect from '../../../../../components/base/select/index.vue'
|
|
//import AppSelect from '../../../../../components/base/select/index.vue'
|
|
|
-const PerformanceTmp = defineAsyncComponent(() => import('../../../add/components/preformance/index.vue'))
|
|
|
|
|
|
|
+const Performance = defineAsyncComponent(() => import('../../../../../components/modules/performance/index.vue'))
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
|
quoteItem: {
|
|
quoteItem: {
|
|
@@ -71,15 +68,14 @@ const props = defineProps({
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
-const showPerformancePlan = shallowRef(false)
|
|
|
|
|
const { formData, listingSubmit, amount } = useHdWROrder()
|
|
const { formData, listingSubmit, amount } = useHdWROrder()
|
|
|
const accountStore = useAccountStore()
|
|
const accountStore = useAccountStore()
|
|
|
const formRef = shallowRef<FormInstance>()
|
|
const formRef = shallowRef<FormInstance>()
|
|
|
|
|
+const performanceRef = shallowRef()
|
|
|
const refresh = shallowRef(false) // 是否刷新父组件数据
|
|
const refresh = shallowRef(false) // 是否刷新父组件数据
|
|
|
const showModal = shallowRef(true)
|
|
const showModal = shallowRef(true)
|
|
|
//const dataList = shallowRef<Model.HoldLBRsp[]>([]) //现货仓单列表
|
|
//const dataList = shallowRef<Model.HoldLBRsp[]>([]) //现货仓单列表
|
|
|
const selectedRow = shallowRef<Model.HoldLBRsp>() //选中的现货仓单
|
|
const selectedRow = shallowRef<Model.HoldLBRsp>() //选中的现货仓单
|
|
|
-const performance = shallowRef<Partial<Model.PerformancePlanRsp>>({}) //选中的履约模板
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 表单验证规则
|
|
// 表单验证规则
|
|
@@ -117,16 +113,6 @@ const formRules: { [key in keyof Proto.HdWROrderReq]?: FieldRule[] } = {
|
|
|
}],
|
|
}],
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// 选择履约模板
|
|
|
|
|
-const onPerformanceTmpChange = (item: Model.PermancePlanTmpRsp) => {
|
|
|
|
|
- performance.value = item
|
|
|
|
|
- formData.PerformanceTemplateID = item.autoid
|
|
|
|
|
- if (formData.PerformanceTemplateID) {
|
|
|
|
|
- formRef.value?.validate('PerformanceTemplateID')
|
|
|
|
|
- }
|
|
|
|
|
- showPerformancePlan.value = false
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
// 选择仓单
|
|
// 选择仓单
|
|
|
// const onConfirm = (value: string) => {
|
|
// const onConfirm = (value: string) => {
|
|
|
// selectedRow.value = dataList.value.find((e) => e.wrid === value)
|
|
// selectedRow.value = dataList.value.find((e) => e.wrid === value)
|
|
@@ -136,8 +122,10 @@ const onPerformanceTmpChange = (item: Model.PermancePlanTmpRsp) => {
|
|
|
|
|
|
|
|
// 关闭弹窗
|
|
// 关闭弹窗
|
|
|
const closed = (isRefresh = false) => {
|
|
const closed = (isRefresh = false) => {
|
|
|
- refresh.value = isRefresh
|
|
|
|
|
- showModal.value = false
|
|
|
|
|
|
|
+ if (performanceRef.value?.closed()) {
|
|
|
|
|
+ refresh.value = isRefresh
|
|
|
|
|
+ showModal.value = false
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 提交挂牌
|
|
// 提交挂牌
|
|
@@ -184,16 +172,6 @@ onMounted(() => {
|
|
|
defineExpose({
|
|
defineExpose({
|
|
|
closed,
|
|
closed,
|
|
|
})
|
|
})
|
|
|
-
|
|
|
|
|
-// 离开页面前关闭组件
|
|
|
|
|
-onBeforeRouteLeave((to, from, next) => {
|
|
|
|
|
- if (showPerformancePlan.value) {
|
|
|
|
|
- showPerformancePlan.value = false
|
|
|
|
|
- next(false)
|
|
|
|
|
- } else {
|
|
|
|
|
- next()
|
|
|
|
|
- }
|
|
|
|
|
-})
|
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="less">
|
|
<style lang="less">
|