|
|
@@ -21,29 +21,34 @@
|
|
|
:options="presaleApplyDeposits" v-if="presaleApplyId" />
|
|
|
<Field v-model="formData.Qty" name="Qty" type="digit" label="采购数量" placeholder="必填"
|
|
|
:rules="formRules.Qty" />
|
|
|
- <Field label="收货信息" placeholder="请输入" @click="showAddress = true" is-link />
|
|
|
+ <Field label="收货信息" placeholder="请输入" @click="openComponent('address')" is-link />
|
|
|
</CellGroup>
|
|
|
</Form>
|
|
|
<Button type="primary" @click="formRef?.submit" round block>采购下单</Button>
|
|
|
- <app-address v-model:show="showAddress" />
|
|
|
+ <component :is="componentMap.get(componentId)" @closed="closeComponent" v-if="componentId" />
|
|
|
</app-view>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { shallowRef, computed } from 'vue'
|
|
|
+import { shallowRef, computed, defineAsyncComponent } from 'vue'
|
|
|
import { CellGroup, Cell, Button, Field, Form, FormInstance, Checkbox, Toast, FieldRule, Popup, Picker, PickerOption } from 'vant'
|
|
|
import { fullloading, dialog } from '@/utils/vant'
|
|
|
+import { useComponent } from '@/hooks/component'
|
|
|
import { useNavigation } from '@/hooks/navigation'
|
|
|
import { useWrstandardDetails } from '@/business/goods'
|
|
|
import { usePurchaseOrderDesting } from '@/business/trade'
|
|
|
import AppSelect from '@mobile/components/base/select/index.vue'
|
|
|
-import AppAddress from './components/address/index.vue'
|
|
|
import Long from 'long'
|
|
|
|
|
|
-const { getQueryStringToNumber } = useNavigation()
|
|
|
+const componentMap = new Map<string, unknown>([
|
|
|
+ ['address', defineAsyncComponent(() => import('./components/address/index.vue'))],
|
|
|
+])
|
|
|
+
|
|
|
+const { componentId, openComponent, closeComponent, closeEach } = useComponent()
|
|
|
+const { getQueryStringToNumber, beforeRouteLeave } = useNavigation()
|
|
|
+
|
|
|
const wrstandardid = getQueryStringToNumber('wrstandardid')
|
|
|
const formRef = shallowRef<FormInstance>()
|
|
|
-const showAddress = shallowRef(false)
|
|
|
|
|
|
const { details, getWrstandardDetails } = useWrstandardDetails(wrstandardid)
|
|
|
const { formData, formSubmit } = usePurchaseOrderDesting()
|
|
|
@@ -111,6 +116,7 @@ const onSubmit = () => {
|
|
|
}
|
|
|
|
|
|
getWrstandardDetails()
|
|
|
+beforeRouteLeave(() => closeEach())
|
|
|
</script>
|
|
|
|
|
|
<style lang="less">
|