This commit is contained in:
张成
2026-03-26 10:55:13 +08:00
parent 7f3e6eb943
commit 656ecb6bc9
10 changed files with 23560 additions and 60 deletions

View File

@@ -0,0 +1,45 @@
import userServer from '@/api/subscription/user_server.js'
import planServer from '@/api/subscription/plan_server.js'
/**
* 业务用户 / 套餐关联下拉:依赖后端 GET /biz_user/all、GET /biz_plan/all
*/
export default {
data() {
return {
bizUserOptions: [],
bizPlanOptions: [],
}
},
methods: {
async loadBizRelationOptions() {
try {
const [u, p] = await Promise.all([userServer.all(), planServer.all()])
if (u && u.code === 0) {
this.bizUserOptions = Array.isArray(u.data) ? u.data : []
} else {
this.bizUserOptions = []
}
if (p && p.code === 0) {
this.bizPlanOptions = Array.isArray(p.data) ? p.data : []
} else {
this.bizPlanOptions = []
}
} catch (e) {
this.bizUserOptions = []
this.bizPlanOptions = []
}
},
bizUserLabel(row) {
if (!row || row.id == null) return ''
const name = row.name || ''
const mobile = row.mobile ? ` ${row.mobile}` : ''
return `#${row.id} ${name}${mobile}`.trim()
},
bizPlanLabel(row) {
if (!row || row.id == null) return ''
const name = row.plan_name || row.plan_code || ''
return `#${row.id} ${name}`.trim()
},
},
}