进件修改

This commit is contained in:
2026-01-17 09:40:18 +08:00
parent 6535b6f580
commit 2bd52f85b9
8 changed files with 151 additions and 78 deletions

View File

@@ -115,7 +115,7 @@
<script setup>
import {
onLoad
onLoad,onShow
} from '@dcloudio/uni-app'
import {
computed,
@@ -293,10 +293,14 @@
const options=reactive({})
onLoad(async (opt) => {
Object.assign(options,opt)
if(opt.type=='addBranch'){
})
onShow(async()=>{
if(options.type=='addBranch'){
// 添加分店
const res = await await shopInfoApi.getShopDetail({
id: opt.id
id: options.id
})
form.isHeadShop=0
form.mainId=res.id
@@ -306,10 +310,10 @@
})
return
}else{
if (opt.id) {
if (options.id) {
rules.accountName.required = false
const res = await await shopInfoApi.getShopDetail({
id: opt.id
id: options.id
})
for (let key in form) {
form[key] = res[key]
@@ -323,7 +327,6 @@
})
}
}
})
watchEffect(()=>{
console.log(form.shopType)

View File

@@ -18,7 +18,7 @@
</up-radio-group>
</up-form-item>
</template>
</view>
<template v-if="form.channel=='poly'">
<view class="container">
@@ -122,26 +122,25 @@
</view>
<view class="u-flex u-row-between">
<text class="font-bold">商户号</text>
<text class="">{{form.shopDirectMerchant.merchantCode}}</text>
<text class="">{{mainEntryManagerRes.merchantCode}}</text>
</view>
<view class="u-flex u-row-between u-m-t-24">
<text class="font-bold">商户类型</text>
<text class="">{{returnType(form.shopDirectMerchant.userType)}}</text>
<text class="">{{returnType(mainEntryManagerRes.userType)}}</text>
</view>
<view class="status">
<view class="u-flex u-row-between ">
<text class="font-bold">支付宝进件状态</text>
<view class="state"
:class="returnStatusClass(form.shopDirectMerchant.alipayStatus)">
{{returnStatusLabel(form.shopDirectMerchant.alipayStatus)}}
<view class="state" :class="returnStatusClass(mainEntryManagerRes.alipayStatus)">
{{returnStatusLabel(mainEntryManagerRes.alipayStatus)}}
</view>
</view>
<view v-if="form.shopDirectMerchant.alipayStatus==='SIGN'" class="u-m-t-16">
<my-button @click="showCode(form.shopDirectMerchant,'aliPay')">查看签约码</my-button>
<view v-if="mainEntryManagerRes.alipayStatus==='SIGN'" class="u-m-t-16">
<my-button @click="showCode(mainEntryManagerRes,'aliPay')">查看签约码</my-button>
</view>
<view class="u-m-t-14" v-if="form.shopDirectMerchant.alipayErrorMsg">
<view class="u-m-t-14" v-if="mainEntryManagerRes.alipayErrorMsg">
<up-alert title="拒绝原因" type="error"
:description="form.shopDirectMerchant.alipayErrorMsg"></up-alert>
:description="mainEntryManagerRes.alipayErrorMsg"></up-alert>
</view>
</view>
@@ -150,27 +149,27 @@
<view class="u-flex u-row-between">
<text class="font-bold">微信进件状态</text>
<view class="state"
:class="returnStatusClass(form.shopDirectMerchant.wechatStatus)">
{{returnStatusLabel(form.shopDirectMerchant.wechatStatus)}}
:class="returnStatusClass(mainEntryManagerRes.wechatStatus)">
{{returnStatusLabel(mainEntryManagerRes.wechatStatus)}}
</view>
</view>
<view v-if="form.shopDirectMerchant.wechatStatus==='SIGN'" class="u-m-t-16">
<my-button @click="showCode(form.shopDirectMerchant,'wx')">查看签约码</my-button>
<view v-if="mainEntryManagerRes.wechatStatus==='SIGN'" class="u-m-t-16">
<my-button @click="showCode(mainEntryManagerRes,'wx')">查看签约码</my-button>
</view>
</view>
<view class="u-m-t-14" v-if="form.shopDirectMerchant.wechatErrorMsg">
<view class="u-m-t-14" v-if="mainEntryManagerRes.wechatErrorMsg">
<up-alert title="拒绝原因" type="error"
:description="form.shopDirectMerchant.wechatErrorMsg"></up-alert>
:description="mainEntryManagerRes.wechatErrorMsg"></up-alert>
</view>
</view>
<view class="u-flex u-row-between u-m-t-24">
<text class="font-bold">最后提交时间</text>
<text class="">{{form.shopDirectMerchant.updateTime}}</text>
<text class="">{{mainEntryManagerRes.updateTime}}</text>
</view>
<view class="u-flex u-row-between u-m-t-24">
<text class="font-bold">创建时间</text>
<text class="">{{form.shopDirectMerchant.createTime}}</text>
<text class="">{{mainEntryManagerRes.createTime}}</text>
</view>
</view>
</template>
@@ -255,7 +254,7 @@
// url: '/entryManager/add/add?shopId=' + query.shopId
// })
// } else {
// form.shopDirectMerchant = mainEntryManagerRes.value
// mainEntryManagerRes = mainEntryManagerRes.value
// }
// }
// })
@@ -370,7 +369,7 @@
const form = reactive({
shopId: 0,
channel: "native",
relatedLicenceNo: "",
relatedId: "",
nativeMerchantDTO: {
wechatMerchantId: "",
alipayMerchantId: "",
@@ -431,8 +430,8 @@
const mainEntryManagerRes = ref(null)
const shopInfo = ref(null)
const shopMerchant=ref(null)
const shopMerchant = ref(null)
async function init() {
const shopInfoRes = await shopInfoApi.getShopDetail({
id: query.shopId
@@ -453,20 +452,27 @@
shopMerchantApi.shopMerchant({
shopId: query.shopId
}).then(res => {
if(res){
if (res) {
if (res.shopDirectMerchant) {
useInfo.value = 1
} else {
useInfo.value = 0
}
shopMerchant.value=res
shopMerchant.value = res
if (res.relatedId == shopInfo.value.id) {
useInfo.value = 0
}
if (mainEntryManagerRes.value && res.relatedId == mainEntryManagerRes.value.shopId) {
useInfo.value = 1
}
Object.assign(form, res)
}
loadingFinish.value=true
loadingFinish.value = true
})
}
const loadingFinish=ref(false)
const loadingFinish = ref(false)
onLoad((opt) => {
query.shopId = opt.shopId
form.shopId = opt.shopId
@@ -479,6 +485,7 @@
res = await shopMerchantApi.editShopMerchant({
shopId: form.shopId,
channel: form.channel,
relatedId:shopInfo.value.id,
polyMerchantDTO: {
storeId: form.polyMerchantDTO.storeId,
merchantName: form.polyMerchantDTO.merchantName,
@@ -487,24 +494,27 @@
}
})
} else {
if (useInfo.value == 1) {
//使用主店
}
res = await shopMerchantApi.editShopMerchant({
shopId: form.shopId,
channel: form.channel,
relatedLicenceNo: form.relatedLicenceNo,
nativeMerchantDTO: {
wechatMerchantId: form.nativeMerchantDTO.wechatMerchantId,
alipayMerchantId: form.nativeMerchantDTO.alipayMerchantId,
alipayAuthInfo: {
user_id: form.nativeMerchantDTO.alipayAuthInfo.user_id,
open_id: form.nativeMerchantDTO.alipayAuthInfo.open_id,
auth_app_id: form.nativeMerchantDTO.alipayAuthInfo.auth_app_id,
app_auth_token: form.nativeMerchantDTO.alipayAuthInfo.app_auth_token,
expires_in: form.nativeMerchantDTO.alipayAuthInfo.expires_in,
app_refresh_token: form.nativeMerchantDTO.alipayAuthInfo.app_refresh_token,
re_expires_in: form.nativeMerchantDTO.alipayAuthInfo.re_expires_in,
order_no: form.nativeMerchantDTO.alipayAuthInfo.order_no,
}
}
relatedId: useInfo.value == 1 ? mainEntryManagerRes.value.shopId : query.shopId,
// nativeMerchantDTO: {
// wechatMerchantId: form.nativeMerchantDTO.wechatMerchantId,
// alipayMerchantId: form.nativeMerchantDTO.alipayMerchantId,
// alipayAuthInfo: {
// user_id: form.nativeMerchantDTO.alipayAuthInfo.user_id,
// open_id: form.nativeMerchantDTO.alipayAuthInfo.open_id,
// auth_app_id: form.nativeMerchantDTO.alipayAuthInfo.auth_app_id,
// app_auth_token: form.nativeMerchantDTO.alipayAuthInfo.app_auth_token,
// expires_in: form.nativeMerchantDTO.alipayAuthInfo.expires_in,
// app_refresh_token: form.nativeMerchantDTO.alipayAuthInfo.app_refresh_token,
// re_expires_in: form.nativeMerchantDTO.alipayAuthInfo.re_expires_in,
// order_no: form.nativeMerchantDTO.alipayAuthInfo.order_no,
// }
// }
})
}
@@ -518,7 +528,7 @@
}
function submit() {
if (form.channel == 'native' && !entryManagerRes.value) {
if (useInfo.value == 0 && form.channel == 'native' && !entryManagerRes.value) {
return uni.$u.toast('您还未申请进件,清先申请进件')
}
refForm.value.validate().then(valid => {
@@ -538,16 +548,25 @@
console.log('key', key)
rules[key].required = newval == 'poly' ? true : false;
}
if (newval == 'poly') {
form.polyMerchantDTO =shopMerchant.value.polyMerchantDTO|| {
storeId: "",
merchantName: "",
appId: "",
appSecret: "",
payPassword: "",
wechatSmallAppid: "",
alipaySmallAppid: "",
}
}
})
watch(() => useInfo.value, (newval) => {
console.log('newval',newval);
console.log('newval', newval);
if (newval) {
form.shopDirectMerchant = mainEntryManagerRes.value||(shopMerchant.value?(shopMerchant.value.shopDirectMerchant):null )
form.nativeMerchantDTO = null
} else {
form.shopDirectMerchant = null
form.nativeMerchantDTO = entryManagerRes.value
}
})
</script>
@@ -612,4 +631,8 @@
}
}
}
:deep(.u-alert__content__desc) {
word-break: break-all;
}
</style>