| | |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <el-dialog title="编辑" :visible.sync="detailsVisible" width="50%" :append-to-body="true" |
| | | :before-close="detailsVisibleclose"> |
| | | <el-row :gutter="15"> |
| | | <el-form ref="detailsRow" :model="detailsRow" size="medium" |
| | | label-width="100px"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="用户名" prop="nickName"> |
| | | <el-input v-model="detailsRow.nickName" placeholder="请输入用户名" clearable |
| | | :style="{ width: '100%' }"> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="用户姓名" prop="realName"> |
| | | <el-input v-model="detailsRow.realName" placeholder="请输入用户姓名" clearable |
| | | :style="{ width: '100%' }"> |
| | | </el-input> |
| | | </el-form-item> |
| | | </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> |
| | | </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> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-form> |
| | | </el-row> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="detailsVisible = false">取 消</el-button> |
| | | <el-button type="primary" @click="update">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog title="编辑" :visible.sync="detailsVisible" width="50%" :append-to-body="true" |
| | | :before-close="detailsVisibleclose"> |
| | | <el-row :gutter="15"> |
| | | <el-form ref="detailsRow" :model="detailsRow" size="medium" label-width="100px"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="用户名" prop="nickName"> |
| | | <el-input v-model="detailsRow.nickName" placeholder="请输入用户名" clearable :style="{ width: '100%' }"> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="用户姓名" prop="realName"> |
| | | <el-input v-model="detailsRow.realName" placeholder="请输入用户姓名" clearable :style="{ width: '100%' }"> |
| | | </el-input> |
| | | </el-form-item> |
| | | </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> |
| | | </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> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-form> |
| | | </el-row> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="detailsVisible = false">取 消</el-button> |
| | | <el-button type="primary" @click="update">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | </div> |
| | | </template> |
| | |
| | | data() { |
| | | return { |
| | | |
| | | rules: { |
| | | rules: { |
| | | nickName: [{ |
| | | required: true, |
| | | message: '请输入用户名 ', |
| | | trigger: 'blur' |
| | | }], |
| | | realName: [{ |
| | | realName: [{ |
| | | required: true, |
| | | message: '请输入用户姓名', |
| | | trigger: 'blur' |
| | |
| | | message: '请输入手机号 ', |
| | | trigger: 'blur' |
| | | }], |
| | | userIdcard: [{ |
| | | userIdcard: [{ |
| | | required: true, |
| | | message: '请输入身份证 ', |
| | | trigger: 'blur' |
| | | }], |
| | | }, |
| | | }, |
| | | //详细内容弹框 |
| | | detailsVisible: false, |
| | | //详细内容 |
| | | detailsRow: |
| | | { |
| | | } |
| | | detailsRow: |
| | | { |
| | | } |
| | | , |
| | | //表单提交内容 |
| | | addPublicityForm: { |
| | |
| | | { |
| | | //删除 |
| | | remove(val) { |
| | | this.$http.delete('/api/user', { params: { id: val } }).then(res => { |
| | | this.$message({ |
| | | message: '删除成功', |
| | | type: 'success' |
| | | var _this = this; |
| | | this.$confirm('确认删除?').then(() => { |
| | | _this.$http.delete('/api/user', { params: { id: val } }).then(res => { |
| | | _this.$message({ |
| | | message: '删除成功', |
| | | type: 'success' |
| | | }) |
| | | this.search(); |
| | | }) |
| | | } |
| | | ) |
| | | |
| | | this.search(); |
| | | }) |
| | | }, |
| | | // //发布/下架 |
| | | // punlish(val, val2) { |
| | |
| | | //编辑 |
| | | details(val) { |
| | | this.detailsVisible = true; |
| | | this.detailsRow = Object.assign({}, val); |
| | | this.detailsRow = Object.assign({}, val); |
| | | }, |
| | | update(){ |
| | | this.$http.put('/api/user',this.detailsRow).then(res => {this.$message({ |
| | | message: '编辑成功', |
| | | type: 'success'} |
| | | update() { |
| | | this.$http.put('/api/user', this.detailsRow).then(res => { |
| | | this.$message({ |
| | | message: '编辑成功', |
| | | type: 'success' |
| | | } |
| | | ) |
| | | this.search();} |
| | | ); |
| | | this.detailsVisible =false; |
| | | this.search(); |
| | | } |
| | | ); |
| | | this.detailsVisible = false; |
| | | }, |
| | | |
| | | //重置密码 |
| | |
| | | }, |
| | | //添加 |
| | | add() { |
| | | this.$refs.addPublicityForm.validate(async (vaild) => { |
| | | this.$refs.addPublicityForm.validate(async (vaild) => { |
| | | if (!vaild) return this.$message.error('输入有误') |
| | | let param = null; |
| | | param = this.addPublicityForm; |
| | | addPublicityList(param).then(res => { |
| | | this.$message({ |
| | | message: '操作成功', |
| | | type: 'success' |
| | | }); |
| | | this.addPublicityForm={}; |
| | | this.init(); |
| | | } |
| | | ) |
| | | this.addPublicityVisibel = false; |
| | | let param = null; |
| | | param = this.addPublicityForm; |
| | | addPublicityList(param).then(res => { |
| | | this.$message({ |
| | | message: '操作成功', |
| | | type: 'success' |
| | | }); |
| | | this.addPublicityForm = {}; |
| | | this.init(); |
| | | } |
| | | ) |
| | | this.addPublicityVisibel = false; |
| | | }) |
| | | }, |
| | | //关闭之前 |