rk
20 小时以前 38d111cb6defedff3bf06314ca30d22a01faae22
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
<template>
  <GlobalWindow
    :title="title"
    :visible.sync="visible"
    width="100%"
  >
    <TableLayout :permissions="['business:cases:query']">
      <!-- 搜索表单 -->
      <el-form class="table-search-formCur" ref="searchForm" id="curSearchForm" 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>
        <el-form-item label="工号" prop="code">
          <el-input v-model="searchForm.code" style="width: 150px" placeholder="请输入工号" @keypress.enter.native="search"></el-input>
        </el-form-item>
        <el-form-item label="战区" prop="zhanquIds">
          <el-select
              v-model="searchForm.zhanquIds"
              style="width: 150px"
              placeholder="战区"
              clearable
              @change="search"
          >
            <el-option
                v-for="item in cateList.filter(item=>{return item.type==0})"
                :key="item.id"
                :value="item.id"
                :label="item.name"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="商业化类型" prop="bustypeIds">
          <el-select
              v-model="searchForm.bustypeIds"
              style="width: 150px"
              placeholder="商业化类型"
              clearable
              @change="search"
          >
            <el-option
                v-for="item in cateList.filter(item=>{return item.type==1})"
                :key="item.id"
                :value="item.id"
                :label="item.name"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="擅长领域" prop="fieldIdList">
          <el-select
              v-model="searchForm.fieldIdList"
              style="width: 150px"
              placeholder="擅长领域"
              clearable
              multiple
              @change="search"
          >
            <el-option
                v-for="item in cateList.filter(item=>{return item.type==2})"
                :key="item.id"
                :value="item.id"
                :label="item.name"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="老师等级" prop="levelId">
          <el-select
              v-model="searchForm.levelId"
              style="width: 150px"
              placeholder="老师等级"
              clearable
              @change="search"
          >
            <el-option
                v-for="item in cateList.filter(item=>{return item.type==3})"
                :key="item.id"
                :value="item.id"
                :label="item.name"
            ></el-option>
          </el-select>
        </el-form-item>
          <el-form-item label="状态" prop="status">
            <el-select
                v-model="searchForm.status"
                placeholder="状态"
                clearable
                style="width: 150px"
                @change="search"
            >
              <el-option :key="0" :value="0" label="启用"></el-option>
              <el-option :key="1" :value="1" label="禁用"></el-option>
            </el-select>
          </el-form-item>
        <section>
          <el-button type="primary" @click="search">搜索</el-button>
          <el-button @click="reset">重置</el-button>
        </section>
      </el-form>
      <!-- 表格和分页 -->
      <template v-slot:table-wrap>
<!--        <ul class="toolbar" v-permissions="['business:cases:create', 'business:cases:delete']">
          <li><el-button type="primary" @click="$refs.operaCasesWindow.open('新建案例',null)" icon="el-icon-plus" v-permissions="['business:cases:create']">新建</el-button></li>
          <li><el-button type="primary" icon="el-icon-refresh" v-permissions="['business:cases:create']" @click="$refs.OperaCasesImportWindow.open('案例导入')">批量导入</el-button></li>
          <li><el-button type="danger" @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:cases:delete']">删除</el-button></li>
        </ul>-->
        <el-table
            :height="tableHeight"
            v-loading="isWorking.search"
            :data="tableData.list"
            border
            :cell-class-name="setRowClassName"
            stripe
            @selection-change="handleSelectionChange"
        >
          <el-table-column  prop="imgurl" label="图片" min-width="100px">
            <template slot-scope="{row}">
              <el-image v-if="row.fullImgurl" style="width: 50px; height: 50px; margin-right: 10px" :src="row.fullImgurl"
                        :preview-src-list="[row.fullImgurl]">
              </el-image>
            </template>
          </el-table-column>
          <el-table-column prop="code" label="工号" min-width="100px"></el-table-column>
          <el-table-column prop="name" label="姓名" min-width="100px"></el-table-column>
          <el-table-column prop="sex" label="性别" min-width="100px">
            <template slot-scope="{row}">
              <span v-if="row.sex ==0">男</span>
              <span v-if="row.sex ==1">女</span>
            </template>
          </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="serveNum" label="服务商场" min-width="100px">
            <template slot-scope="{row}">
              <span v-if="row.serveNum">{{row.serveNum}}个</span>
            </template>
          </el-table-column>
          <el-table-column prop="caseNum" label="标杆案例" min-width="100px">
            <template slot-scope="{row}">
              <span >{{row.caseNum || 0}}个</span>
            </template>
          </el-table-column>
          <el-table-column prop="busTypeNames" label="商业化类型" min-width="200px">
            <template slot-scope="{row}">
              <div v-if="row.typeList && row.typeList.length">
                <div style="display:inline-block;" v-for="(item,index) in row.typeList">{{item.name||''}} <span v-if="index < row.typeList.length-1" style="display:inline-block;padding: 0px 3px;">/</span></div>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="areaNames" label="服务战区" min-width="200px">
            <template slot-scope="{row}">
              <div v-if="row.zqList && row.zqList.length">
                <div style="display:inline-block;" v-for="(item,index) in row.zqList">{{item.name||''}} <span v-if="index < row.zqList.length-1" style="display:inline-block;padding: 0px 3px;">/</span></div>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="fieldNames" label="擅长领域" min-width="200px">
            <template slot-scope="{row}">
              <div v-if="row.fieldList && row.fieldList.length">
                <div style="display:inline-block;" v-for="(item,index) in row.fieldList">{{item.name||''}} <span v-if="index < row.fieldList.length-1" style="display:inline-block;padding: 0px 3px;">/</span></div>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="fee" label="费用标准(元/周)" min-width="130px"></el-table-column>
          <el-table-column label="状态"  >
            <template slot-scope="{row}">
              <span class="orange" v-if="row.status==0"  >启用</span>
              <span class="red"  v-if="row.status==1">禁用</span>
            </template>
          </el-table-column>
          <el-table-column label="是否删除"  >
            <template slot-scope="{row}">
              <span class="red" v-if="row.deleted==1"  >已删除</span>
              <span class="green"  v-else>未删除</span>
            </template>
          </el-table-column>
        </el-table>
        <pagination
            @size-change="handleSizeChange"
            @current-change="handlePageChange"
            :pagination="tableData.pagination"
        >
        </pagination>
      </template>
    </TableLayout>
    <template  v-slot:footer>
      <el-button @click="visible=false">返回</el-button>
    </template>
  </GlobalWindow>
</template>
 
<script>
import BaseTable from '@/components/base/BaseTable'
import TableLayout from '@/layouts/TableLayout'
import Pagination from '@/components/common/Pagination'
import GlobalWindow from '@/components/common/GlobalWindow'
import { findAll as memberList } from '@/api/business/member'
export default {
  name: 'OperaMemberListWindow',
  extends: BaseTable,
  components: { GlobalWindow, TableLayout, Pagination },
  data () {
    return {
      title: '',
      visible: false,
      tableHeight: null,
      searchForm: {
        name: '',
        containDeleted: 1,
        queryFlag: 1,
        code: '',
        status: null,
        levelId: null,
        fieldIdList: [],
        zhanquIds: null,
        bustypeIds: null,
        type: 0
      },
      cateList: []
    }
  },
  created () {
    this.config({
      api: '/business/member',
      'field.id': 'id'
    })
    window.addEventListener('resize', () => {
      this.getTableHeight()
    })
  },
  methods: {
    getTableHeight () {
      this.$nextTick(() => {
        this.tableHeight = window.innerHeight - 180;
        if(document.getElementById('curSearchForm')){
          this.tableHeight = this.tableHeight - document.getElementById('curSearchForm').clientHeight
        }
      })
 
    },
    loadMemberList () {
      memberList({
      }).then(res => {
        this.memberList = res
      })
    },
    setRowClassName({row, rowIndex}) {
      if (row.deleted == 1) {
        return 'warning-row'
      }
      return '' // 如果不需要任何特殊样式,返回空字符串或 null
    },
    open (title, importId) {
      this.title = title
      this.visible = true
      this.getTableHeight()
      this.tableData = {
        // 已选中的数据
        selectedRows: [],
        // 排序的字段
        sorts: [],
        // 当前页数据
        list: [],
        // 分页
        pagination: {
          pageIndex: 1,
          pageSize: 10,
          total: 0
        }
      }
      this.searchForm.importId = importId
      this.search()
    }
  }
}
</script>
<style scoped lang="scss">
/deep/ .window__body {
  overflow-y: hidden !important;
}
.table-content .table-wrap .el-table{
  overflow-y: hidden !important;
}
</style>
<style  >
.success-row {
  background: #f0f9eb  !important; /* 浅绿色背景 */
}
.warning-row {
  background: rgba(161, 14, 14, 0.35)  !important; /* 浅红色背景 */
}
</style>