MrShi
6 天以前 97158794d69fd2beee1bf27577aa7cadea8d847d
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 })