|
|
@@ -14,22 +14,22 @@
|
|
|
</div>
|
|
|
<div class="bank-sign__empty" v-else>
|
|
|
<Empty description="您还未添加签约账户" />
|
|
|
- <Button type="danger" @click="openComponent('edit')" round>添加签约账户</Button>
|
|
|
+ <Button type="danger" @click="showComponent(false)" round>添加签约账户</Button>
|
|
|
</div>
|
|
|
<template #footer>
|
|
|
<div class="g-form__footer inset" v-if="bankInfo">
|
|
|
<Button type="warning" round block @click="formSubmit"
|
|
|
v-if="bankInfo.signstatus === SignStatus.Signed">解约</Button>
|
|
|
- <Button type="danger" round block @click="openComponent('edit')"
|
|
|
+ <Button type="danger" round block @click="showComponent(true)"
|
|
|
v-if="[SignStatus.Unsigned, SignStatus.Refuse, SignStatus.Signed].includes(bankInfo.signstatus)">修改</Button>
|
|
|
</div>
|
|
|
</template>
|
|
|
- <component ref="componentRef" :is="componentMap.get(componentId)" @closed="closeComponent" v-if="componentId" />
|
|
|
+ <component ref="componentRef" v-bind="{ isedit }" :is="componentMap.get(componentId)" @closed="closeComponent" v-if="componentId" />
|
|
|
</app-view>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { onActivated, defineAsyncComponent } from 'vue'
|
|
|
+import { onActivated, defineAsyncComponent, ref } from 'vue'
|
|
|
import { CellGroup, Cell, Button, Empty, showFailToast } from 'vant'
|
|
|
import { fullloading, dialog } from '@/utils/vant'
|
|
|
import { useComponent } from '@/hooks/component'
|
|
|
@@ -44,6 +44,8 @@ const componentMap = new Map<string, unknown>([
|
|
|
const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => formRefresh())
|
|
|
const { cancelSubmit, formRefresh, bankInfo } = useDoCancelBankSign()
|
|
|
const { router } = useNavigation()
|
|
|
+/// 是否修改
|
|
|
+const isedit = ref(false)
|
|
|
|
|
|
const formSubmit = () => {
|
|
|
dialog({
|
|
|
@@ -63,6 +65,11 @@ const formSubmit = () => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+const showComponent = (isEdit: boolean) => {
|
|
|
+ isedit.value = isEdit
|
|
|
+ openComponent('edit')
|
|
|
+}
|
|
|
+
|
|
|
onActivated(() => formRefresh())
|
|
|
</script>
|
|
|
|