fix: avoid hidden region filter for pay commodities

This commit is contained in:
zhx 2026-06-24 12:34:40 +08:00
parent ac269eb996
commit 64c69cb26d

View File

@ -47,7 +47,7 @@
</el-option> </el-option>
</el-select> </el-select>
<el-select <el-select
v-if="selectedApp.appCode === 'ASWAT'" v-if="isRegionProductApp"
v-model="listQuery.regionId" v-model="listQuery.regionId"
v-loading="loading" v-loading="loading"
:placeholder="$t('pages.payApplication.placeholder.region')" :placeholder="$t('pages.payApplication.placeholder.region')"
@ -103,7 +103,7 @@
class="filter-item" class="filter-item"
type="primary" type="primary"
icon="el-icon-edit" icon="el-icon-edit"
:disabled="!listQuery.regionId" :disabled="isRegionProductApp && !listQuery.regionId"
@click="createCommodity" @click="createCommodity"
> >
{{ $t('pages.payApplication.action.add') }} {{ $t('pages.payApplication.action.add') }}
@ -214,6 +214,9 @@ export default {
} }
}, },
computed: { computed: {
isRegionProductApp() {
return this.selectedApp && this.selectedApp.appCode === 'ASWAT'
},
shelfStatusOptions() { shelfStatusOptions() {
return this.shelfStatus.map(item => ({ return this.shelfStatus.map(item => ({
...item, ...item,
@ -307,11 +310,14 @@ export default {
that.loading = true that.loading = true
regionConfigTable({ 'sysOrigin': that.selectedApp.appCode }).then(res => { regionConfigTable({ 'sysOrigin': that.selectedApp.appCode }).then(res => {
that.regions = res.body || [] that.regions = res.body || []
that.selectedRegion = that.regions[0] that.selectedRegion = that.isRegionProductApp ? that.regions[0] : null
that.listQuery.regionId = that.selectedRegion ? that.selectedRegion.id : '' that.listQuery.regionId = that.selectedRegion ? that.selectedRegion.id : ''
that.loading = false that.loading = false
that.loadOpenCountry(that.listQuery.regionId) that.loadOpenCountry(that.listQuery.regionId)
}).catch(er => { }).catch(er => {
that.regions = []
that.selectedRegion = null
that.listQuery.regionId = ''
that.loading = false that.loading = false
that.loadOpenCountry() that.loadOpenCountry()
}) })
@ -363,7 +369,7 @@ export default {
'selectApp': this.selectedApp, 'selectApp': this.selectedApp,
'payCountryIds': this.listQuery.payCountryId ? [this.listQuery.payCountryId] : [] 'payCountryIds': this.listQuery.payCountryId ? [this.listQuery.payCountryId] : []
} }
if (this.selectedApp.appCode === 'ASWAT') { if (this.isRegionProductApp && this.selectedRegion) {
this.selectedEditFrom.regionId = this.selectedRegion.id this.selectedEditFrom.regionId = this.selectedRegion.id
this.selectedEditFrom.regionName = this.selectedRegion.regionName this.selectedEditFrom.regionName = this.selectedRegion.regionName
} }
@ -375,7 +381,7 @@ export default {
that.selectedEditFrom = Object.assign({}, row) that.selectedEditFrom = Object.assign({}, row)
that.selectedEditFrom.selectApp = this.selectedApp that.selectedEditFrom.selectApp = this.selectedApp
that.selectedEditFrom.country = that.getEditFromCountry(row) that.selectedEditFrom.country = that.getEditFromCountry(row)
if (this.selectedApp.appCode === 'ASWAT') { if (this.isRegionProductApp && this.selectedRegion) {
this.selectedEditFrom.regionId = this.selectedRegion.id this.selectedEditFrom.regionId = this.selectedRegion.id
this.selectedEditFrom.regionName = this.selectedRegion.regionName this.selectedEditFrom.regionName = this.selectedRegion.regionName
} }