优化进件切换进件信息

This commit is contained in:
gyq
2026-01-17 10:37:37 +08:00
parent 042dacec98
commit 92c3a45049
4 changed files with 74 additions and 30 deletions

View File

@@ -311,13 +311,14 @@ const longTime = ref('2099-12-31')
const wxProvinceCode = ref('')
// 获取进件详情
async function getDetailAjax(shopId: string, licenceNo: string) {
async function getDetailAjax(shopId: string) {
try {
const res: any = await entryManagerDetail({
shopId: shopId,
licenceNo: licenceNo
shopId: shopId
})
form.value = res
if (res && res.shopId) {
form.value = res
}
} catch (error) {
console.log(error);
}
@@ -325,8 +326,6 @@ async function getDetailAjax(shopId: string, licenceNo: string) {
// 获取containerDomInfo信息
function getContainerDomInfo() {
console.log('getContainerDomInfo');
containerDomInfo.value = containerRef.value?.getBoundingClientRect() ?? {}
}
@@ -336,14 +335,18 @@ onMounted(() => {
getContainerDomInfo()
window.addEventListener('resize', debouncedCheckWidth)
const type = route.query.type
const shopId: string = String(route.query.shopId ?? '')
const licenceNo: string = String(route.query.licenceNo ?? '')
if (shopId && licenceNo) {
formType.value = 'editor'
getDetailAjax(shopId, licenceNo)
if (shopId) {
getDetailAjax(shopId)
}
if (licenceNo && type && type == 'editor') {
formType.value = 'editor'
}
const type = route.query.type
if (type && type == 'check') {
formType.value = 'check'
}

View File

@@ -11,7 +11,7 @@
<el-input v-model="form.appId" placeholder="请输入appId" :style="inputStyle"></el-input>
</el-form-item>
<el-form-item label="appSecret" prop="appSecret">
<el-input type="textarea" rows="4" v-model="form.appSecret" placeholder="请输入appSecret"
<el-input type="textarea" :rows="4" v-model="form.appSecret" placeholder="请输入appSecret"
:style="inputStyle"></el-input>
</el-form-item>
<el-form-item>

View File

@@ -1,6 +1,12 @@
<template>
<div class="row mt14">
<el-form label-width="150" label-position="left" v-loading="loading">
<el-form-item label="信息来源" v-if="isHeadShop != 1">
<el-radio-group :model-value="typeValue" @change="typeValueChange">
<el-radio label="进件信息" :value="route.query.shopId"></el-radio>
<el-radio label="复用主店信息" :value="route.query.mainId" v-if="mainInfo && mainInfo.shopId"></el-radio>
</el-radio-group>
</el-form-item>
<template v-if="!form.shopId">
<el-form-item label-width="0">
<el-text>您还未申请进件</el-text>
@@ -10,9 +16,6 @@
</el-form-item>
</template>
<template v-else>
<el-form-item label="信息来源" v-if="shopId != mainInfo.shopId">
<el-tag disable-transitions>复用主店信息</el-tag>
</el-form-item>
<el-form-item label="商户号">
<el-text>{{ form.merchantCode }}</el-text>
</el-form-item>
@@ -47,7 +50,7 @@
<el-form-item label="创建时间">
<el-text>{{ form.createTime }}</el-text>
</el-form-item>
<el-form-item v-if="shopId == mainInfo.shopId">
<el-form-item v-if="typeValue == shopId">
<el-button link type="primary"
v-if="form.wechatStatus == 'INIT' || form.wechatStatus == 'AUDIT' || form.wechatStatus == 'SIGN' || form.alipayStatus == 'INIT' || form.alipayStatus == 'AUDIT' || form.alipayStatus == 'SIGN'"
@click="checkStatusHandle()">查询</el-button>
@@ -74,13 +77,13 @@
<script setup>
import { ref, onMounted } from 'vue'
import { useRoute, useRouter } from 'vue-router';
import { shopMerchantGet, getMainMerchant, shopMerchantPut } from '@/api/common'
import { shopMerchantGet, getMainMerchant, shopMerchantPut, entryManagerDetail } from '@/api/common'
import singCodeDialog from '@/views/applyments/components/singCodeDialog.vue';
const singCodeDialogRef = ref(null)
const route = useRoute()
const router = useRouter()
const shopId = route.query.shopId
const shopId = ref(route.query.shopId)
const userTypeList = ref([
{
value: '0',
@@ -148,6 +151,7 @@ function statusListFilter(status) {
const loading = ref(false)
const form = ref({})
// 查询状态
async function checkStatusHandle() {
try {
@@ -168,10 +172,12 @@ async function checkStatusHandle() {
const mainInfo = ref({})
async function headShopApplmentInfo() {
try {
const res = await getMainMerchant({
shopId: route.query.mainId
})
mainInfo.value = res
if (route.query.mainId) {
const res = await getMainMerchant({
shopId: route.query.mainId
})
mainInfo.value = res
}
} catch (error) {
console.log(error);
}
@@ -180,9 +186,9 @@ async function headShopApplmentInfo() {
// 跳转进件逻辑处理
const mainDialogVisable = ref(false)
const mainDialogVisableLoading = ref(false)
const isHeadShop = ref(route.query.isHeadShop)
async function toApplyment() {
let shopType = route.query.shopType
let isHeadShop = route.query.isHeadShop
if (shopType == 'chain' || shopType == 'join') {
if (isHeadShop == 1) {
toApplymentRouter()
@@ -202,7 +208,7 @@ async function toApplyment() {
// 跳转进件
function toApplymentRouter() {
router.push({ name: 'applyment_in', query: { shopId: shopId } });
router.push({ name: 'applyment_in', query: { shopId: shopId.value } });
}
// 复用主店的进件信息
@@ -210,8 +216,8 @@ async function shopMerchantPutAjax() {
try {
mainDialogVisableLoading.value = true
await shopMerchantPut({
shopId: shopId,
relatedLicenceNo: mainInfo.value.licenceNo,
shopId: shopId.value,
relatedId: mainInfo.value.shopId,
nativeMerchantDTO: {
wechatMerchantId: mainInfo.value.wechatMerchantId,
alipayMerchantId: mainInfo.value.alipayMerchantId,
@@ -237,22 +243,56 @@ function toDetail(type) {
router.push({
name: 'applyment_in',
query: {
shopId: form.value.shopId,
shopId: shopId.value,
licenceNo: businessLicenceInfo.licenceNo,
type: type
}
})
}
// 切换进件类型
const typeValue = ref('')
async function typeValueChange(e) {
await ElMessageBox.confirm('确定要切换进件类型吗?', '注意').then(async () => {
try {
try {
loading.value = true
await shopMerchantPut({
shopId: shopId.value,
relatedId: e,
})
typeValue.value = e
updateData()
} catch (error) {
console.log(error)
loading.value = false
}
} catch (error) {
console.log(error);
}
}).catch(() => { })
}
// 刷新进件数据
async function updateData() {
try {
loading.value = true
const res = await shopMerchantGet({
shopId: shopId
shopId: shopId.value
})
form.value = (res && res.shopDirectMerchant) ? res.shopDirectMerchant
: ''
if (res && res.shopDirectMerchant) {
form.value = res.shopDirectMerchant
typeValue.value = res.relatedId
} else {
typeValue.value = shopId.value
const applymentRes = await entryManagerDetail({ shopId: shopId.value })
if (applymentRes && applymentRes.shopId) {
form.value = applymentRes
} else {
form.value = ''
}
}
} catch (error) {
console.log(error);
}
@@ -261,6 +301,7 @@ async function updateData() {
onMounted(() => {
updateData()
headShopApplmentInfo()
})
</script>

View File

@@ -115,7 +115,7 @@
<el-dropdown-menu>
<el-dropdown-item v-if="scope.row.isHeadShop == 1" :command="0">添加分店</el-dropdown-item>
<el-dropdown-item :command="{ row: scope.row, command: 1 }">
三方配置
支付配置
</el-dropdown-item>
<el-dropdown-item :command="2">续费记录</el-dropdown-item>
<el-dropdown-item :command="3">前往店铺</el-dropdown-item>