Commit 3bc9783f by lixiaomin

修改用户管理

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