Commit 3bc9783f by lixiaomin

修改用户管理

parent a33e1aba
......@@ -28,7 +28,7 @@
<el-table v-loading="loading" :data="customerList">
<el-table-column label="用户" align="center" prop="userName">
<template slot-scope="scope">
<a @click="getDetial(scope.row.id)" style="color: blue">{{ scope.row.userName }}</a>
<a @click="getDetial(scope.row)" style="color: blue">{{ scope.row.userName }}</a>
</template>
</el-table-column>
<el-table-column label="手机号" align="center" prop="phoneNumber"/>
......@@ -57,33 +57,33 @@
</el-col>
</el-row>
<!-- 添加或修改人员配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
<el-dialog :title="title" :visible.sync="open" width="1100px" append-to-body>
<div style="display: flex;align-items: center;">
<div>
<img v-bind:src="img" class="img-circle img-lg" />
</div>
<div style="margin-left: 20px;">
<div style="margin-bottom: 20px;">
<span>姓名</span>
<span>{{userName}}</span>
</div>
<div>
<span>电话</span>
<span>{{phoneNumber}}</span>
</div>
</div>
<div style="margin-left: 50px;">
<div style="margin-bottom: 20px;">消费</div>
<div style="margin-bottom: 20px;">共{{orderCount}}单,消费{{amount}}元</div>
<div>地址</div>
</div>
</div>
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="正常订单" name="first">
<order-table :orderList="orderList" :orderTotal="orderTotal" :loading="loading"></order-table>
<order-table :orderList="orderList" :orderTotal="orderTotal" :orderLoading="orderLoading" @getOrderList="getOrderList"></order-table>
</el-tab-pane>
<el-tab-pane label="取消订单" name="second">
<order-table :orderList="orderList" :orderTotal="orderTotal" :loading="loading"></order-table>
<order-table :orderList="orderList" :orderTotal="orderTotal" :orderLoading="orderLoading" @getOrderList="getOrderList"></order-table>
</el-tab-pane>
<el-tab-pane label="退款订单" name="third">
<order-table :orderList="orderList" :orderTotal="orderTotal" :loading="loading"></order-table>
<order-table :orderList="orderList" :orderTotal="orderTotal" :orderLoading="orderLoading" @getOrderList="getOrderList"></order-table>
</el-tab-pane>
</el-tabs>
<div slot="footer" class="dialog-footer">
......@@ -105,11 +105,7 @@ export default {
img:"/static/img/profile.473f5971.jpg",
createdTime:[],
// 遮罩层
loading: true,
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
loading: true,
// 显示搜索条件
showSearch: true,
// 总条数
......@@ -138,7 +134,15 @@ export default {
activeName:"first" ,
customerId:null,
orderList:[],
orderTotal:0
orderTotal:0,
tag:"",
orderPageNum:1,
orderPageSize: 10,
userName:"",
phoneNumber:"",
orderCount:"",
amount:"",
orderLoading: true,
};
},
......@@ -147,15 +151,26 @@ export default {
},
methods: {
handleClick(){
let tag="";
if(this.activeName=="first"){
tag="1";
this.tag="1";
}else if(this.activeName=="second"){
tag="2";
this.tag="2";
}else if(this.activeName=="third"){
tag="3";
this.tag="3";
}
this.getOrderList(this.customerId,tag);
this.orderPageNum=1;
this.pageSize=10;
this.orderLoading=true;
this.getOrderList(this.orderPageNum,this.pageSize,this.customerId,this.tag);
},
getOrderList(pageNum,pageSize,id,tag) {
getCustomer({'id':id,'status':tag,'pageNum':pageNum,'pageSize':pageSize}).then((response) => {
if(response.code=="200"){
this.orderList = response.rows;
this.orderTotal = response.total;
this.orderLoading=false;
}
});
},
/** 查询用户列表 */
getList() {
......@@ -168,21 +183,19 @@ export default {
}
});
},
getDetial(id){
this.customerId=id;
getDetial(row){
this.orderLoading=true;
this.customerId=row.id;
this.userName=row.userName;
this.phoneNumber=row.phoneNumber;
this.amount=row.amount;
this.orderCount=row.orderCount;
this.open=true;
this.title="用户信息";
this.getOrderList(this.customerId,'1');
},
getOrderList(id,tag) {
this.loading = true;
getCustomer({id:id,status:tag}).then((response) => {
if(response.code=="200"){
this.orderList = response.rows;
this.orderTotal = response.total;
this.loading = false;
}
});
this.orderPageNum=1;
this.pageSize=10;
this.activeName="first";
this.getOrderList(this.orderPageNum,this.pageSize,this.customerId,'1');
},
// 取消按钮
cancel() {
......
<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 v-loading="orderLoading" :data="orderList">
<el-table-column label="订单编号" align="center" prop="orderNo"></el-table-column>
<el-table-column label="商品数量" align="center" prop="goodsNum"/>
<el-table-column label="金额" align="center" prop="amount"/>
<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="createdAt"/>
<el-table-column label="订单状态" align="center" prop="state">
<template slot-scope="scope">{{formatterState(scope.row.state)}}</template>
</el-table-column>
</el-table>
<pagination
v-show="orderTotal > 0"
......@@ -21,17 +23,50 @@
<script>
export default {
name: "orderTable",
props: ['orderList','orderTotal','loading'],
props: ['orderList','orderTotal','orderLoading'],
data() {
return {
pageNum:1,
pageSize:10
pageNum: 1,
pageSize: 10
}
},
methods: {
getList(){
}
this.$emit("getOrderList",this.pageNum,this.pageSize)
},
formatterState(state){
if(state == 0){
return "创建未校验";
}else if(state == 1){
return "未支付";
}else if(state == 2){
return "已支付";
}else if(state == 3){
return "支付制作中";
}else if(state == 4){
return "制作完成未取";
}else if(state == 5){
return "取餐中";
}else if(state == 6){
return "正常完成";
}else if(state == 7){
return "未支付取消";
}else if(state == 8){
return "支付后制作前取消";
}else if(state == 9){
return "制作中取消";
}else if(state == 10){
return "制作完成取消";
}else if(state == 11){
return "已退款";
}else if(state == 12){
return "部分退款";
}else if(state == 13){
return "待取超时";
}else if(state == 50){
return "其他人工干预状态";
}
},
}
}
</script>
\ No newline at end of file
......@@ -74,48 +74,8 @@
size="mini"
@click="handleAdd"
v-hasPermi="['system:role:add']"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:role:edit']"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:role:remove']"
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:role:export']"
>导出</el-button
>
>新增</el-button>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
......@@ -123,7 +83,6 @@
:data="roleList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="角色编号" prop="roleId" width="120" />
<el-table-column
label="角色名称"
......
......@@ -146,7 +146,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import Second from '../../../components/Crontab/second.vue';
export default {
name: "User",
dicts: ["sys_normal_disable", "sys_user_sex"],
//dicts: ["sys_normal_disable", "sys_user_sex"],
// components: { TreeselectSecond },
data() {
return {
......@@ -169,7 +169,7 @@ export default {
// 是否显示弹出层
open: false,
// 默认密码
initPassword: undefined,
//initPassword: undefined,
// 角色选项
roleOptions: [],
// 表单参数
......@@ -203,9 +203,9 @@ export default {
},
created() {
this.getList();
this.getConfigKey("sys.user.initPassword").then((response) => {
this.initPassword = response.msg;
});
// this.getConfigKey("sys.user.initPassword").then((response) => {
// this.initPassword = response.msg;
// });
},
methods: {
formatterRoles(roleList){
......@@ -291,7 +291,7 @@ export default {
this.roleOptions = response.roles;
this.open = true;
this.title = "添加人员";
this.form.password = this.initPassword;
//this.form.password = this.initPassword;
}
});
},
......
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