From b195c95d3a37995f6ff2aaa8038173660ec49d76 Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期五, 05 一月 2024 18:43:05 +0800
Subject: [PATCH] 接口联调
---
src/views/unifiedManage/userManage/index.vue | 159 ++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 126 insertions(+), 33 deletions(-)
diff --git a/src/views/unifiedManage/userManage/index.vue b/src/views/unifiedManage/userManage/index.vue
index fdd4b29..13dbccd 100644
--- a/src/views/unifiedManage/userManage/index.vue
+++ b/src/views/unifiedManage/userManage/index.vue
@@ -16,21 +16,28 @@
<div class="body">
<div class="body-card">
<div class="list-view">
- <TableCommonView
- ref="tableListRef"
- :table-list="tableList"
- :show-summary="showSummary"
- @selClientClick="selClientClick"
- @selMasterClick="selMasterClick"
- @selCommonClick="selCommonClick"
- @getSelectArray="getSelectArray"
- @selTableCol="selTableCol"
- >
+ <TableCommonView ref="tableListRef" :table-list="tableList" @selTableCol="selTableCol">
<template slot="tableButton">
- <el-table-column label="鎿嶄綔" width="90">
+ <el-table-column label="鎿嶄綔" width="120">
<template slot-scope="scope">
<el-button @click="viewClick(scope.row)" type="text" size="small">鏌ョ湅</el-button>
- <el-button @click="approveClick(scope.row)" type="text" size="small">瀹℃牳</el-button>
+ <el-button
+ v-if="scope.row.status == 0 || scope.row.status == 3"
+ @click="changeStatusClick(scope.row, 1)"
+ type="text"
+ size="small"
+ >鍚敤</el-button
+ >
+ <el-button
+ v-else-if="scope.row.status == 1"
+ @click="changeStatusClick(scope.row, 0)"
+ type="text"
+ size="small"
+ >绂佺敤</el-button
+ >
+ <el-button v-else-if="scope.row.status == 2" @click="approveClick(scope.row)" type="text" size="small"
+ >瀹℃牳</el-button
+ >
<el-button @click="editClick(scope.row)" type="text" size="small">缂栬緫</el-button>
</template>
</el-table-column>
@@ -42,69 +49,141 @@
</div>
</div>
</div>
- <!-- 鏂板缓/缂栬緫 -->
- <!-- <AddSubOrderDialog v-if="editConfig.visible" :edit-common-config="editConfig" /> -->
+ <!-- 鏌ョ湅/缂栬緫 -->
+ <EditUserInfo v-if="editConfig.visible" :edit-common-config="editConfig" />
+ <!-- 瀹℃牳 -->
+ <ReviewDialog v-if="reviewConfig.visible" :edit-common-config="reviewConfig" />
</div>
</template>
<script>
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
+import EditUserInfo from "@/views/unifiedManage/userManage/components/EditUserInfo"
+import ReviewDialog from "@/views/unifiedManage/userManage/components/ReviewDialog"
+import { listUser, changeStatus } from "@/api/unifiedManage/userManage"
export default {
name: "UserManage",
props: {},
mixins: [pageMixin],
- components: {},
+ components: { EditUserInfo, ReviewDialog },
computed: {},
data() {
return {
tableList: {},
tableColumn: [
- { label: "搴忓彿", prop: "number", default: true },
- { label: "鐢ㄦ埛鍚�", prop: "client_name" },
- { label: "鎵嬫満鍙�", prop: "signTime" }, // 绛剧害鏃ユ湡
- { label: "鍏徃鍚嶇О", prop: "serviceContractType" },
- { label: "鑱旂郴浜哄鍚�", prop: "serviceContractStatus" },
- { label: "閭", prop: "member_name" },
- { label: "琛屼笟", prop: "productName", isProductName: true },
- { label: "鍦板尯", prop: "startTime" },
- { label: "鐘舵��", prop: "endTime" }
+ { label: "鐢ㄦ埛鍚�", prop: "username", default: true },
+ { label: "鎵嬫満鍙�", prop: "phone" },
+ { label: "鍏徃鍚嶇О", prop: "companyName" },
+ { label: "鑱旂郴浜哄鍚�", prop: "nickName" },
+ { label: "閭", prop: "companyEmail" },
+ { label: "琛屼笟", prop: "industry" },
+ { label: "鍦板尯", prop: "region" },
+ { label: "鐘舵��", prop: "status", isCallMethod: true, getCallMethod: this.getStatus }
],
- showCol: ["搴忓彿", "鐢ㄦ埛鍚�", "鎵嬫満鍙�", "鍏徃鍚嶇О", "鑱旂郴浜哄鍚�", "閭", "琛屼笟", "鍦板尯", "鐘舵��"]
+ showCol: ["鐢ㄦ埛鍚�", "鎵嬫満鍙�", "鍏徃鍚嶇О", "鑱旂郴浜哄鍚�", "閭", "琛屼笟", "鍦板尯", "鐘舵��"],
+ editConfig: {
+ visible: false,
+ title: "鏌ョ湅",
+ infomation: {}
+ },
+ reviewConfig: {
+ visible: false,
+ infomation: {}
+ },
+ obj: {
+ page: 1,
+ pageSize: 15,
+ keyword: "",
+ useType: 1
+ }
}
},
created() {
this.setTable()
+ this.getData()
},
methods: {
+ // 鑾峰彇鍒楄〃鍊�
+ getData() {
+ this.obj.pageSize = this.pagerOptions.pageSize
+ this.obj.page = this.pagerOptions.currPage
+ listUser(this.obj).then((res) => {
+ console.log(res)
+ this.tableList.tableInfomation = res.data.list || []
+ this.pagerOptions.totalCount = res.data.total
+ })
+ },
+ // 鎼滅储
+ onFilterSearch(val) {
+ this.obj.keyword = val
+ this.pagerOptions.currPage = 1
+ this.getData()
+ },
// 鏌ョ湅
viewClick(row) {
console.log(row)
+ this.editConfig.visible = true
+ this.editConfig.title = "鏌ョ湅"
+ this.editConfig.form = row
},
// 瀹℃牳
approveClick(row) {
console.log(row)
+ this.reviewConfig.visible = true
+ this.reviewConfig.title = "鐢ㄦ埛瀹℃牳"
+ this.reviewConfig.infomation = { ...row }
+ },
+ // 鍋滅敤
+ changeStatusClick(row, status) {
+ if (status === 0) {
+ this.$confirm("鏄惁绂佺敤姝ょ敤鎴�?", "鎻愮ず", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning"
+ })
+ .then(() => {
+ this.changeStatus(row, status)
+ })
+ .catch(() => {})
+ } else {
+ this.changeStatus(row, status)
+ }
+ },
+ // 鍚敤/绂佺敤
+ changeStatus(row, status) {
+ changeStatus({
+ status: status,
+ userId: row.id
+ }).then((res) => {
+ console.log(res)
+ let messageStr = status === 0 ? "绂佺敤鎴愬姛" : "鍚敤鎴愬姛"
+ this.$message.success(messageStr)
+ this.getData()
+ })
},
// 缂栬緫
editClick(row) {
console.log(row)
+ this.editConfig.visible = true
+ this.editConfig.title = "缂栬緫"
+ this.editConfig.form = { ...row }
},
// 鍒楄〃鍒濆鍖�
setTable() {
this.tableList = {
selectIndex: true,
- tableInfomation: [],
+ tableInfomation: [
+ {
+ username: "娴嬭瘯",
+ status: 1
+ }
+ ],
allcol: [],
showcol: this.showCol,
tableColumn: this.setColumnVisible(this.showCol)
}
this.tableList.allcol = this.tableList.tableColumn.filter((ele) => !ele.default).map((ele) => ele.label)
- this.searchOptions = []
- for (let i = 0; i < this.tableList.tableColumn.length; i++) {
- const label = this.tableList.tableColumn[i].label
- const value = this.tableList.tableColumn[i].prop
- this.searchOptions.push({ value: value, label: label })
- }
},
setColumnVisible(showCol) {
return this.tableColumn.map((ele) => {
@@ -117,6 +196,20 @@
selTableCol(val) {
this.showcol = val
this.tableList.tableColumn = this.setColumnVisible(val)
+ },
+ // 鐘舵��
+ getStatus(val) {
+ return val === 0
+ ? "绂佺敤"
+ : val === 1
+ ? "鍚敤涓�"
+ : val === 2
+ ? "寰呭鏍�"
+ : val === 3
+ ? "寰呭惎鐢�"
+ : val === 4
+ ? "宸叉嫆缁�"
+ : ""
}
}
}
@@ -143,7 +236,7 @@
.body-card {
background-color: #fff;
border-radius: 12px;
- height: 100%;
+ height: calc(100% - 10px);
overflow: hidden;
}
.list-view {
--
Gitblit v1.8.0