jiangping
2025-04-14 a0436685d963dd19e0df70d1447ad5efafbfb36e
admin/src/views/business/managersSheNotice.vue
@@ -3,8 +3,8 @@
    <!-- 搜索表单 -->
    <div slot="search-form">
      <el-form ref="searchForm" :model="searchForm" label-width="100px" inline>
        <el-form-item label="人员搜索 " prop="memberName">
          <el-input v-model="searchForm.memberName" placeholder="可输入姓名/手机号/部门" @keypress.enter.native="search"></el-input>
        <el-form-item label="人员搜索 " prop="keyword">
          <el-input v-model="searchForm.keyword" placeholder="可输入姓名/手机号/部门" @keypress.enter.native="search"></el-input>
        </el-form-item>
        <section>
          <el-button type="primary" @click="search">搜索</el-button>
@@ -30,8 +30,18 @@
        <el-table-column prop="memberPhone" label="人员手机号" min-width="100px"></el-table-column>
        <el-table-column prop="memberEmail" label="人员邮箱" min-width="100px"></el-table-column>
        <el-table-column prop="companyName" label="所属部门" min-width="100px"></el-table-column>
        <el-table-column prop="isQw" label="企微通知" min-width="80px">
          <template slot-scope="{row}">
            <el-switch v-model="row.isQw"  :active-value="1" :inactive-value="0" @change="updateInfo(row)"/>
          </template>
        </el-table-column>
        <el-table-column prop="isQw" label="邮件通知" min-width="80px">
          <template slot-scope="{row}">
            <el-switch v-model="row.isEmail" :active-value="1" :inactive-value="0" @change="updateEmailInfo(row)"/>
          </template>
        </el-table-column>
        <el-table-column prop="editorName" label="操作人" min-width="100px"></el-table-column>
        <el-table-column prop="editDate" label="更新时间" min-width="100px"></el-table-column>
        <el-table-column prop="editDate" label="更新时间" min-width="150px"></el-table-column>
        <el-table-column prop="remark" label="备注" min-width="100px"></el-table-column>
        <el-table-column
          v-if="containPermissions(['business:managers:update', 'business:managers:delete'])"
@@ -71,8 +81,9 @@
  data () {
    return {
      // 搜索
      updating: false,
      searchForm: {
        memberName: '',
        keyword: '',
        type: 3
      }
    }
@@ -85,6 +96,30 @@
      'field.main': 'id'
    })
    this.search()
  },
  methods: {
    updateInfo (row) {
      const newValue = row.isQw
      row.isQw = !row.isQw
      // 开启
      this.api.updateById({ id: row.id, isQw: newValue }).then(() => {
        this.$tip.success('设置成功!')
        this.search()
      }).final(() => {
        this.updating = false
      })
    },
    updateEmailInfo (row) {
      const newValue = row.isEmail
      row.isEmail = !row.isEmail
      // 开启
      this.api.updateById({ id: row.id, isEmail: newValue }).then(() => {
        this.$tip.success('设置成功!')
        this.search()
      }).finally(() => {
        this.updating = false
      })
    }
  }
}
</script>