From 0782140a00e554ec7a1c724ecc1eb36726d994f8 Mon Sep 17 00:00:00 2001 From: odc.xiaohui <xiaohui@Q1> Date: 星期一, 22 五月 2023 11:45:18 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/views/manager/User.vue | 333 ++++++++++++++++++++++++++++++++++--------------------- 1 files changed, 204 insertions(+), 129 deletions(-) diff --git a/src/views/manager/User.vue b/src/views/manager/User.vue index 815e4cd..80785e4 100644 --- a/src/views/manager/User.vue +++ b/src/views/manager/User.vue @@ -3,8 +3,8 @@ <el-card style="height: 100%"> <template slot="header"> <el-form :inline="true" :model="queryInfo" class="demo-form-inline"> - <el-form-item label="鐢ㄦ埛鍚嶏細"> - <el-input placeholder="璇疯緭鍏�" v-model="queryInfo.nickName"></el-input> + <el-form-item label="鎵嬫満鍙凤細"> + <el-input placeholder="璇疯緭鍏�" v-model="queryInfo.userMobile"></el-input> </el-form-item> <el-form-item label="鐢ㄦ埛濮撳悕锛�"> <el-input placeholder="璇疯緭鍏�" v-model="queryInfo.realName"></el-input> @@ -14,6 +14,7 @@ </el-form-item> <el-form-item> <el-button type="primary" @click="addPublicityVisibel = true">娣诲姞</el-button> + <el-button type="primary" @click="exportList">瀵煎嚭</el-button> </el-form-item> </el-form> </template> @@ -21,29 +22,43 @@ <el-table :data="publicityList" style="width: 100%"> <el-table-column prop="nickName" label="鐢ㄦ埛鍚�" width="180" align="center"> </el-table-column> + <el-table-column prop="realName" label="鐢ㄦ埛濮撳悕" width="180" header-align="center" align="center"> </el-table-column> <el-table-column prop="userMobile" label="鎵嬫満鍙风爜" width="180" header-align="center" align="center"> </el-table-column> <el-table-column prop="ctime" label="鍒涘缓鏃堕棿" width="180" header-align="center" align="center"> </el-table-column> + <el-table-column prop="userMemo" label="澶囨敞" width="180" align="center"> + </el-table-column> <el-table-column label="鎿嶄綔" align="conter"> <template slot-scope="scope"> <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="reset(scope.row.id)">閲嶇疆瀵嗙爜</el-button>--> + + <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> + <el-popconfirm + title="纭畾鍒犻櫎鍚楋紵" + @confirm="removeuser(scope.row.id)" + > + <el-button type="text" style="margin-left: 5px;color: red" slot="reference">鍒犻櫎</el-button> + </el-popconfirm> + + </template> </el-table-column> </el-table> </template> <el-pagination @current-change="handleCurrentChange" :current-page="queryInfo.current" :page-size="queryInfo.size" - layout="prev, pager, next" :total="total"></el-pagination> + layout="prev, pager, next" :total="total"></el-pagination> </el-card> <!--娣诲姞鐢ㄦ埛寮圭獥--> <el-dialog title="鐢ㄦ埛娣诲姞" :visible.sync="addPublicityVisibel" width="50%" :before-close="addPublicityClose" - :append-to-body="true"> + :append-to-body="true"> <el-row :gutter="15"> <el-form ref="addPublicityForm" :model="addPublicityForm" :rules="rules" size="medium" label-width="100px"> @@ -64,7 +79,7 @@ </el-col> <el-col :span="12"> <el-form-item label="韬唤璇�" prop="userIdcard"> - <el-input v-model="addPublicityForm.userIdcard" clearable placeholder="璇疯緭鍏ヨ韩浠借瘉"> </el-input> + <el-input v-model="addPublicityForm.userIdcard" clearable placeholder="璇疯緭鍏ヨ韩浠借瘉"></el-input> </el-form-item> </el-col> </el-form> @@ -76,7 +91,7 @@ </el-dialog> <el-dialog title="缂栬緫" :visible.sync="detailsVisible" width="50%" :append-to-body="true" - :before-close="detailsVisibleclose"> + :before-close="detailsVisibleclose"> <el-row :gutter="15"> <el-form ref="detailsRow" :model="detailsRow" size="medium" label-width="100px"> <el-col :span="12"> @@ -93,15 +108,24 @@ </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> + <el-col :span="12"> + <el-form-item label="澶囨敞" prop="userMemo"> + <el-input v-model="detailsRow.userMemo" placeholder="璇疯緭鍏ュ娉�" clearable + :style="{ width: '100%' }"> + </el-input> + </el-form-item> </el-col> </el-form> </el-row> @@ -117,7 +141,8 @@ <script> import { getPublicityList, - addPublicityList + addPublicityList, + toManager, deleteUser } from '@/api/User' @@ -125,7 +150,7 @@ name: "User", data() { return { - + visible:false, rules: { nickName: [{ required: true, @@ -152,8 +177,7 @@ detailsVisible: false, //璇︾粏鍐呭 detailsRow: - { - } + {} , //琛ㄥ崟鎻愪氦鍐呭 addPublicityForm: { @@ -170,7 +194,8 @@ total: null, //鏌ヨ鏉′欢 queryInfo: { - nickName: '', + userMobile: '', + realName: '', current: 1, size: 10 }, @@ -201,127 +226,177 @@ }, methods: - { - //鍒犻櫎 - remove(val) { - var _this = this; - this.$confirm('纭鍒犻櫎锛�').then(() => { - _this.$http.delete('/api/user', { params: { id: val } }).then(res => { - _this.$message({ - message: '鍒犻櫎鎴愬姛', - type: 'success' + { + exportList(){ + this.$http({ + url:'/api/user/exp', + responseType: 'blob', + method: 'post', + }).then(res=>{ + console.log(res) + this.$message.success('鎿嶄綔鎴愬姛'); + let time = new Date() + let deathdate =time.toLocaleDateString() + const blob = new Blob([res.data], { + type: "application/vnd.ms-excel;charset=utf-8", + }); + if (window.navigator.msSaveBlob) { + window.navigator.msSaveBlob(blob, deathdate + ".xlsx"); + } else { + const url = window.URL.createObjectURL(blob); + const link = document.createElement("a"); + link.style.display = "none"; + link.href = url; + link.download = deathdate + ".xlsx"; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + } }) - this.search(); - }) - } - ) + }, + handleToManager(data) { + toManager(data.id).then(res => { + this.$message({ + message: '璁剧疆鎴愬姛', + type: 'success' + }) + this.search(); + }) + }, + //鏇存柊鐢ㄦ埛鐘舵�� + updateStatus(id, status) { + var _this = this; + this.$confirm('纭淇敼璐︽埛鐘舵�佸悧锛�').then(() => { + _this.$http.get('/api/user/status', {params: {id: id, status: status}}).then(res => { + _this.$message({ + message: '淇敼鎴愬姛', + type: 'success' + }) + this.search(); + }) + } + ) - }, - // //鍙戝竷/涓嬫灦 - // punlish(val, val2) { - // if (val2 == 0) { - // this.$http.get('/api/commonQuestion/release/' + val).then(res => { - // this.$message({ - // message: '鍙戝竷鎴愬姛', - // type: 'success' - // }) + }, + // //鍙戝竷/涓嬫灦 + // punlish(val, val2) { + // if (val2 == 0) { + // this.$http.get('/api/commonQuestion/release/' + val).then(res => { + // this.$message({ + // message: '鍙戝竷鎴愬姛', + // type: 'success' + // }) - // this.search(); - // } - // ) - // } - // if (val2 == 1) { - // this.$http.get('/api/commonQuestion/offline/' + val).then(res => { - // this.$message({ - // message: '涓嬫灦鎴愬姛', - // type: 'success' - // }) - // this.search(); - // } - // ); - // } - // }, + // this.search(); + // } + // ) + // } + // if (val2 == 1) { + // this.$http.get('/api/commonQuestion/offline/' + val).then(res => { + // this.$message({ + // message: '涓嬫灦鎴愬姛', + // type: 'success' + // }) + // this.search(); + // } + // ); + // } + // }, + removeuser(id){ + console.log(id) + deleteUser(id).then(res=>{ + console.log(res) + this.init() + }) + }, + //缂栬緫 + details(val) { + this.detailsVisible = true; + this.detailsRow = Object.assign({}, val); + }, + update() { + this.$http.put('/api/user', this.detailsRow).then(res => { + console.log(res) + if (res.data.code == 200){ + this.$message({ + message: '缂栬緫鎴愬姛', + type: 'success' + } + ) + this.search(); + }else { + this.$message.error(res.data.msg) + this.search(); + } - //缂栬緫 - details(val) { - this.detailsVisible = true; - this.detailsRow = Object.assign({}, val); - }, - update() { - this.$http.put('/api/user', this.detailsRow).then(res => { - this.$message({ - message: '缂栬緫鎴愬姛', - type: 'success' - } - ) - this.search(); - } - ); - this.detailsVisible = false; - }, + } + ); + this.detailsVisible = false; + }, - //閲嶇疆瀵嗙爜 - reset(val) { - this.$http.get('/api/user/resetPassword/' + val).then(res => this.$message({ - message: '閲嶇疆鎴愬姛', - type: 'success' - })); - }, - //娣诲姞 - add() { - 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: '鎿嶄綔鎴愬姛', + //閲嶇疆瀵嗙爜 + reset(val) { + this.$http.get('/api/user/resetPassword/' + val).then(res => this.$message({ + message: '閲嶇疆鎴愬姛', type: 'success' - }); - this.addPublicityForm = {}; - this.init(); - } - ) - this.addPublicityVisibel = false; - }) - }, - //鍏抽棴涔嬪墠 - addPublicityClose() { - this.addPublicityVisibel = false; - }, - detailsVisibleclose() { - this.detailsVisible = false; - }, - //鍒嗛〉鏂规硶 - handleCurrentChange(val) { - this.queryInfo.current = val; - this.search(); - }, + })); + }, + //娣诲姞 + add() { + 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; + }) + }, + //鍏抽棴涔嬪墠 + addPublicityClose() { + this.addPublicityVisibel = false; + }, + detailsVisibleclose() { + this.detailsVisible = false; + }, + //鍒嗛〉鏂规硶 + handleCurrentChange(val) { + this.queryInfo.current = val; + this.search(); + }, - //鍏叡瀹d紶鍔犺浇 - init() { - let param = {} - param.current = this.queryInfo.current - param.size = this.queryInfo.size - getPublicityList(param).then(res => { - this.publicityList = res.records; - this.total = res.total - }) - }, - //鏌ヨ - search() { - let param = {} - param.realName = this.queryInfo.realName - param.nickName = this.queryInfo.nickName - param.size = this.queryInfo.size - getPublicityList(param).then(res => { - this.publicityList = res.records; - this.total = res.total - this.current = res.current - }) - }, + //鍏叡瀹d紶鍔犺浇 + init() { + let param = {} + param.current = this.queryInfo.current + param.size = this.queryInfo.size + getPublicityList(param).then(res => { + this.publicityList = res.records; + this.total = res.total + }) + }, + //鏌ヨ + search() { + let param = {} + param.current = this.queryInfo.current + param.realName = this.queryInfo.realName + param.userMobile = this.queryInfo.userMobile + param.size = this.queryInfo.size + getPublicityList(param).then(res => { + this.publicityList = res.records; + this.total = res.total + this.current = res.current + }) + }, - } + } } </script> @@ -329,4 +404,4 @@ ::v-deep(.el-table thead) { color: #000000; } -</style> \ No newline at end of file +</style> -- Gitblit v1.8.0