From 97158794d69fd2beee1bf27577aa7cadea8d847d Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期三, 04 二月 2026 16:08:45 +0800
Subject: [PATCH] 优化
---
admin/src/views/business/member.vue | 79 ++++++++++++++++++++++++++++++++++++---
1 files changed, 73 insertions(+), 6 deletions(-)
diff --git a/admin/src/views/business/member.vue b/admin/src/views/business/member.vue
index df448f1..25aca5a 100644
--- a/admin/src/views/business/member.vue
+++ b/admin/src/views/business/member.vue
@@ -2,8 +2,8 @@
<TableLayout :permissions="['business:member:query']">
<!-- 鎼滅储琛ㄥ崟 -->
<el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline>
- <el-form-item label="鍚嶇О" prop="name">
- <el-input v-model="searchForm.name" style="width: 150px" placeholder="璇疯緭鍏ュ悕绉�" @keypress.enter.native="search"></el-input>
+ <el-form-item label="濮撳悕" prop="name">
+ <el-input v-model="searchForm.name" style="width: 150px" placeholder="璇疯緭鍏ュ鍚�" @keypress.enter.native="search"></el-input>
</el-form-item>
<el-form-item label="宸ュ彿" prop="code">
<el-input v-model="searchForm.code" style="width: 150px" placeholder="璇疯緭鍏ュ伐鍙�" @keypress.enter.native="search"></el-input>
@@ -24,12 +24,13 @@
></el-option>
</el-select>
</el-form-item>
- <el-form-item label="鍟嗕笟鍖栫被鍨�" prop="bustypeIds">
+ <el-form-item label="鍟嗕笟鍖栫被鍨�" prop="bustypeIdList">
<el-select
- v-model="searchForm.bustypeIds"
+ v-model="searchForm.bustypeIdList"
style="width: 150px"
placeholder="鍟嗕笟鍖栫被鍨�"
clearable
+ multiple
@change="search"
>
<el-option
@@ -122,7 +123,11 @@
</el-table-column>
<el-table-column prop="positon" label="宀椾綅" min-width="120px"></el-table-column>
<el-table-column prop="levelName" label="绛夌骇" min-width="100px"></el-table-column>
- <el-table-column prop="jobYear" label="浠庝笟骞翠唤" min-width="100px"></el-table-column>
+ <el-table-column prop="workYears" label="浠庝笟骞翠唤" min-width="100px">
+ <template slot-scope="{row}">
+ {{row.workYears}}骞�
+ </template>
+ </el-table-column>
<el-table-column prop="serveNum" label="鏈嶅姟鍟嗗満" min-width="100px">
<template slot-scope="{row}">
<span v-if="row.serveNum">{{row.serveNum}}涓�</span>
@@ -214,7 +219,7 @@
levelId:null,
fieldIdList: [],
zhanquIds:null,
- bustypeIds:null,
+ bustypeIdList:[],
type: 0
},
cateList:[]
@@ -235,6 +240,68 @@
},
methods: {
+ deleteById (row, childConfirm = true, call) {
+ this.__checkApi()
+ let message = `纭鍒犻櫎鑰佸笀鏁版嵁鍚�?`
+ if (childConfirm && row.children != null && row.children.length > 0) {
+ message = `纭鍒犻櫎鑰佸笀鏁版嵁鍚�?`
+ }
+ this.$dialog.deleteConfirm(message)
+ .then(() => {
+ this.isWorking.delete = true
+ this.api.deleteById(row[this.configData['field.id']])
+ .then(() => {
+ this.__afterDelete()
+ if (call) {
+ call()
+ }
+ })
+ .catch(e => {
+ this.$tip.apiFailed(e)
+ })
+ .finally(() => {
+ this.isWorking.delete = false
+ })
+ })
+ .catch(() => {})
+ },
+ deleteByIdInBatch (childConfirm = true, call) {
+ this.__checkApi()
+ if (this.tableData.selectedRows.length === 0) {
+ this.$tip.warning('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�')
+ return
+ }
+ let message = `纭鍒犻櫎鑰佸笀鏁版嵁鍚�?`
+ if (childConfirm) {
+ const containChildrenRows = []
+ for (const row of this.tableData.selectedRows) {
+ if (row.children != null && row.children.length > 0) {
+ containChildrenRows.push(row[this.configData['field.main']])
+ }
+ }
+ if (containChildrenRows.length > 0) {
+ message = `纭鍒犻櫎鑰佸笀鏁版嵁鍚�?`
+ }
+ }
+ this.$dialog.deleteConfirm(message)
+ .then(() => {
+ this.isWorking.delete = true
+ this.api.deleteByIdInBatch(this.tableData.selectedRows.map(row => row[this.configData['field.id']]).join(','))
+ .then(() => {
+ this.__afterDelete(this.tableData.selectedRows.length)
+ if (call) {
+ call()
+ }
+ })
+ .catch(e => {
+ this.$tip.apiFailed(e)
+ })
+ .finally(() => {
+ this.isWorking.delete = false
+ })
+ })
+ .catch(() => {})
+ },
changeStatus (e, row) {
this.working = true
this.api.updateStatus({ id: row.id, status: e })
--
Gitblit v1.9.3