odc.xiaohui
2023-03-07 034d8675792fee6af5af592df0b69acd3ad8a215
src/views/manager/User.vue
@@ -32,7 +32,9 @@
              <el-button type="text" size="medium" @click="details(scope.row)">编辑</el-button>
<!--              <el-button type="text" size="medium" @click="reset(scope.row.id)">重置密码</el-button>-->
<!--              <el-button type="text" size="medium" @click="remove(scope.row.id)" style="color:#ff0000">删除-->
                <el-button type="text" size="medium" @click="updateStatus(scope.row.id,scope.row.status)">{{scope.row.status==1?"禁用":"启用"}}
              <el-button type="text" size="medium" @click="handleToManager(scope.row)">设为警员</el-button>
              <el-button type="text" size="medium" @click="updateStatus(scope.row.id,scope.row.status)">
                {{ scope.row.status == 1 ? "禁用" : "启用" }}
              </el-button>
            </template>
          </el-table-column>
@@ -94,13 +96,15 @@
          </el-col>
          <el-col :span="12">
            <el-form-item label="手机号码" prop="userMobile">
              <el-input v-model="detailsRow.userMobile" placeholder="请输入手机号码" clearable :style="{ width: '100%' }">
              <el-input v-model="detailsRow.userMobile" placeholder="请输入手机号码" clearable
                        :style="{ width: '100%' }">
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="身份证号" prop="userIdcard">
              <el-input v-model="detailsRow.userIdcard" placeholder="请输入身份证号" clearable :style="{ width: '100%' }">
              <el-input v-model="detailsRow.userIdcard" placeholder="请输入身份证号" clearable
                        :style="{ width: '100%' }">
              </el-input>
            </el-form-item>
          </el-col>
@@ -118,7 +122,8 @@
<script>
import {
  getPublicityList,
  addPublicityList
  addPublicityList,
  toManager
} from '@/api/User'
@@ -153,8 +158,7 @@
      detailsVisible: false,
      //详细内容
      detailsRow:
      {
      }
          {}
      ,
      //表单提交内容
      addPublicityForm: {
@@ -203,6 +207,15 @@
  },
  methods:
  {
        handleToManager(data) {
          toManager(data.id).then(res => {
            this.$message({
              message: '设置成功',
              type: 'success'
            })
            this.search();
          })
        },
    //更新用户状态
    updateStatus(id,status) {
      var _this = this;