Commit a33e1aba by lixiaomin

修改用户页面

parent 53160080
......@@ -11,10 +11,11 @@ export function listCustomer(query) {
}
// 查询用户详细
export function getCustomer(userId) {
export function getCustomer(query) {
return request({
url: '/system/customer/' + parseStrEmpty(userId),
method: 'get'
url: '/system/customer/',
method: 'get',
params: query
})
}
......
......@@ -74,42 +74,16 @@
<div style="margin-bottom: 20px;">消费</div>
<div>地址</div>
</div>
</div>
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="正常订单" name="first">
<el-table v-loading="loading" :data="normalOrder">
<el-table-column label="订单编号" align="center" prop=""></el-table-column>
<el-table-column label="商品数量" align="center" prop=""/>
<el-table-column label="金额" align="center" prop=""/>
<el-table-column label="城市" align="center" prop=""/>
<el-table-column label="店铺" align="center" prop=""/>
<el-table-column label="创建时间" align="center" prop=""/>
<el-table-column label="状态" align="center" prop=""/>
</el-table>
<order-table :orderList="orderList" :orderTotal="orderTotal" :loading="loading"></order-table>
</el-tab-pane>
<el-tab-pane label="取消订单" name="second">
<el-table v-loading="loading" :data="cancelOrder">
<el-table-column label="订单编号" align="center" prop=""></el-table-column>
<el-table-column label="商品数量" align="center" prop=""/>
<el-table-column label="金额" align="center" prop=""/>
<el-table-column label="城市" align="center" prop=""/>
<el-table-column label="店铺" align="center" prop=""/>
<el-table-column label="创建时间" align="center" prop=""/>
<el-table-column label="状态" align="center" prop=""/>
</el-table>
<order-table :orderList="orderList" :orderTotal="orderTotal" :loading="loading"></order-table>
</el-tab-pane>
<el-tab-pane label="退款订单" name="third">
<el-table v-loading="loading" :data="refundOrder">
<el-table-column label="订单编号" align="center" prop=""></el-table-column>
<el-table-column label="商品数量" align="center" prop=""/>
<el-table-column label="金额" align="center" prop=""/>
<el-table-column label="城市" align="center" prop=""/>
<el-table-column label="店铺" align="center" prop=""/>
<el-table-column label="创建时间" align="center" prop=""/>
<el-table-column label="状态" align="center" prop=""/>
</el-table>
<order-table :orderList="orderList" :orderTotal="orderTotal" :loading="loading"></order-table>
</el-tab-pane>
</el-tabs>
<div slot="footer" class="dialog-footer">
......@@ -122,18 +96,16 @@
<script>
import {listCustomer,getCustomer} from "@/api/system/customer";
import { VueCropper } from "vue-cropper";
import OrderTable from "./orderTable.vue";
export default {
name: "Customer",
components: { VueCropper },
components: { OrderTable },
data() {
return {
img:"/static/img/profile.473f5971.jpg",
createdTime:[],
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
......@@ -148,12 +120,6 @@ export default {
title: "",
// 是否显示弹出层
open: false,
// 退款订单
refundOrder: [],
// 正常订单
normalOrder:[],
// 取消订单
cancelOrder:[],
// 查询参数
queryParams: {
pageNum: 1,
......@@ -169,18 +135,27 @@ export default {
{value:"2",label:"无购买"},
{value:"3",label:"有复购"},
],
activeName:"first"
activeName:"first" ,
customerId:null,
orderList:[],
orderTotal:0
};
},
created() {
this.getList();
},
methods: {
handleClick(){
let tag="";
if(this.activeName=="first"){
tag="1";
}else if(this.activeName=="second"){
tag="2";
}else if(this.activeName=="third"){
tag="3";
}
this.getOrderList(this.customerId,tag);
},
/** 查询用户列表 */
getList() {
......@@ -194,11 +169,18 @@ export default {
});
},
getDetial(id){
this.customerId=id;
this.open=true;
this.title="用户信息";
getCustomer(id).then((response) => {
this.getOrderList(this.customerId,'1');
},
getOrderList(id,tag) {
this.loading = true;
getCustomer({id:id,status:tag}).then((response) => {
if(response.code=="200"){
this.form=response.data
this.orderList = response.rows;
this.orderTotal = response.total;
this.loading = false;
}
});
},
......
<template>
<div>
<el-table v-loading="loading" :data="orderList">
<el-table-column label="订单编号" align="center" prop=""></el-table-column>
<el-table-column label="商品数量" align="center" prop=""/>
<el-table-column label="金额" align="center" prop=""/>
<el-table-column label="城市" align="center" prop=""/>
<el-table-column label="店铺" align="center" prop=""/>
<el-table-column label="创建时间" align="center" prop=""/>
<el-table-column label="状态" align="center" prop=""/>
</el-table>
<pagination
v-show="orderTotal > 0"
:total="orderTotal"
:page.sync="pageNum"
:limit.sync="pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
export default {
name: "orderTable",
props: ['orderList','orderTotal','loading'],
data() {
return {
pageNum:1,
pageSize:10
}
},
methods: {
getList(){
}
}
}
</script>
\ No newline at end of file
......@@ -207,11 +207,11 @@ export default {
},
/** 搜索按钮操作 */
handleQuery() {
if(this.createdTime.length>0){
if(this.createdTime!=null && this.createdTime.length>0 ){
this.queryParams.createAtStart=this.createdTime[0];
this.queryParams.createAtEnd=this.createdTime[1];
}
if(this.payTime.length>0){
if(this.payTime!=null && this.payTime.length>0 ){
this.queryParams.payAtStart=this.payTime[0];
this.queryParams.payAtEnd=this.payTime[1];
}
......
......@@ -197,11 +197,11 @@ export default {
},
/** 搜索按钮操作 */
handleQuery() {
if(this.createdTime.length>0){
if(this.createdTime!=null && this.createdTime.length>0 ){
this.queryParams.createAtStart=this.createdTime[0];
this.queryParams.createAtEnd=this.createdTime[1];
}
if(this.payTime.length>0){
if(this.payTime!=null && this.payTime.length>0 ){
this.queryParams.payAtStart=this.payTime[0];
this.queryParams.payAtEnd=this.payTime[1];
}
......
......@@ -178,31 +178,8 @@
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:role:remove']"
>删除</el-button
>
<el-dropdown
size="mini"
@command="(command) => handleCommand(command, scope.row)"
v-hasPermi="['system:role:edit']"
>
<span class="el-dropdown-link">
<i class="el-icon-d-arrow-right el-icon--right"></i>更多
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item
command="handleDataScope"
icon="el-icon-circle-check"
v-hasPermi="['system:role:edit']"
>数据权限</el-dropdown-item
>
<el-dropdown-item
command="handleAuthUser"
icon="el-icon-user"
v-hasPermi="['system:role:edit']"
>分配用户</el-dropdown-item
>
</el-dropdown-menu>
</el-dropdown>
>删除</el-button >
</template>
</el-table-column>
</el-table>
......@@ -228,25 +205,7 @@
placeholder="请输入内容"
></el-input>
</el-form-item>
<el-row :gutter="10" class="mb8">
<el-col :span="12">
<el-form-item label="菜单权限">
<!-- <el-checkbox
v-model="menuExpand"
@change="handleCheckedTreeExpand($event, 'menu')"
>展开/折叠</el-checkbox
>
<el-checkbox
v-model="menuNodeAll"
@change="handleCheckedTreeNodeAll($event, 'menu')"
>全选/全不选</el-checkbox
>
<el-checkbox
v-model="form.menuCheckStrictly"
@change="handleCheckedTreeConnect($event, 'menu')"
>父子联动</el-checkbox
> -->
<div>
<el-tree
class="tree-border"
:data="menuOptions"
......@@ -257,89 +216,13 @@
empty-text="加载中,请稍候"
:props="defaultProps"
></el-tree>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="菜单权限">
<el-tree
class="tree-border"
:data="menuOptions"
show-checkbox
ref="menu"
node-key="id"
:check-strictly="!form.menuCheckStrictly"
empty-text="加载中,请稍候"
:props="defaultProps"
></el-tree>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<!-- 分配角色数据权限对话框 -->
<el-dialog
:title="title"
:visible.sync="openDataScope"
width="500px"
append-to-body
>
<el-form :model="form" label-width="80px">
<el-form-item label="角色名称">
<el-input v-model="form.roleName" :disabled="true" />
</el-form-item>
<el-form-item label="权限字符">
<el-input v-model="form.roleKey" :disabled="true" />
</el-form-item>
<el-form-item label="权限范围">
<el-select v-model="form.dataScope" @change="dataScopeSelectChange">
<el-option
v-for="item in dataScopeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="数据权限" v-show="form.dataScope == 2">
<el-checkbox
v-model="deptExpand"
@change="handleCheckedTreeExpand($event, 'dept')"
>展开/折叠</el-checkbox
>
<el-checkbox
v-model="deptNodeAll"
@change="handleCheckedTreeNodeAll($event, 'dept')"
>全选/全不选</el-checkbox
>
<el-checkbox
v-model="form.deptCheckStrictly"
@change="handleCheckedTreeConnect($event, 'dept')"
>父子联动</el-checkbox
>
<el-tree
class="tree-border"
:data="deptOptions"
show-checkbox
default-expand-all
ref="dept"
node-key="id"
:check-strictly="!form.deptCheckStrictly"
empty-text="加载中,请稍候"
:props="defaultProps"
></el-tree>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitDataScope">确 定</el-button>
<el-button @click="cancelDataScope">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment