|
|
@@ -20,49 +20,30 @@
|
|
|
<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="showComponent('edit')"
|
|
|
- v-if="[SignStatus.Unsigned, SignStatus.Refuse, SignStatus.Signed, SignStatus.Rescinded].includes(bankInfo.signstatus)">修改</Button>
|
|
|
+ <Button type="danger" round block @click="openComponent('edit')"
|
|
|
+ v-if="[SignStatus.Unsigned, SignStatus.Refuse, SignStatus.Signed].includes(bankInfo.signstatus)">修改</Button>
|
|
|
</div>
|
|
|
</template>
|
|
|
- <component ref="componentRef" v-bind="{ isedit }" :is="componentMap.get(componentId)" @closed="closeComponent"
|
|
|
- v-if="componentId" />
|
|
|
+ <component ref="componentRef" :is="componentMap.get(componentId)" @closed="closeComponent" v-if="componentId" />
|
|
|
</app-view>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { defineAsyncComponent, onActivated } from 'vue'
|
|
|
+import { onActivated, defineAsyncComponent } from 'vue'
|
|
|
import { CellGroup, Cell, Button, Empty, showFailToast } from 'vant'
|
|
|
import { fullloading, dialog } from '@/utils/vant'
|
|
|
import { useComponent } from '@/hooks/component'
|
|
|
import { getSignStatusName, SignStatus } from '@/constants/bank'
|
|
|
import { useDoCancelBankSign } from '@/business/bank'
|
|
|
import { useNavigation } from '../../../router/navigation'
|
|
|
-import { useErrorInfoStore } from '@/stores'
|
|
|
-import { shallowRef } from 'vue'
|
|
|
-import { useRequest } from '@/hooks/request'
|
|
|
-import { queryBankAccountSign } from '@/services/api/bank'
|
|
|
|
|
|
const componentMap = new Map<string, unknown>([
|
|
|
['edit', defineAsyncComponent(() => import('./components/edit/Index.vue'))],
|
|
|
])
|
|
|
|
|
|
-const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
|
|
|
- run()
|
|
|
-})
|
|
|
-
|
|
|
-const { cancelSubmit, bankInfo, formRefresh } = useDoCancelBankSign()
|
|
|
+const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => formRefresh())
|
|
|
+const { cancelSubmit, formRefresh, bankInfo } = useDoCancelBankSign()
|
|
|
const { router } = useNavigation()
|
|
|
-/// 是否为编辑
|
|
|
-const isedit = shallowRef(false)
|
|
|
-
|
|
|
-/// 查询
|
|
|
-const { run } = useRequest(queryBankAccountSign, {
|
|
|
- onSuccess: (res) => {
|
|
|
- if (res.data.length != 0) {
|
|
|
- bankInfo.value = res.data[0]
|
|
|
- }
|
|
|
- }
|
|
|
-})
|
|
|
|
|
|
const formSubmit = () => {
|
|
|
dialog({
|
|
|
@@ -72,24 +53,17 @@ const formSubmit = () => {
|
|
|
fullloading((hideLoading) => {
|
|
|
cancelSubmit().then(() => {
|
|
|
hideLoading()
|
|
|
- dialog('解约提交成功,请耐心等待审核。').then(() => {
|
|
|
+ dialog('签约提交成功,请耐心等待审核。').then(() => {
|
|
|
router.back()
|
|
|
})
|
|
|
}).catch((err) => {
|
|
|
- const { getErrorInfoByCode } = useErrorInfoStore()
|
|
|
- showFailToast(getErrorInfoByCode(Number(err)) ?? '')
|
|
|
+ showFailToast(err)
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-const showComponent = (code: string) => {
|
|
|
- isedit.value = true
|
|
|
- openComponent(code)
|
|
|
-}
|
|
|
-
|
|
|
onActivated(() => formRefresh())
|
|
|
-
|
|
|
</script>
|
|
|
|
|
|
<style lang="less">
|