Преглед на файлове

修改前端页面功能和bug

oyq28 преди 2 години
родител
ревизия
686b827bf1

+ 3 - 3
imcs-bt-fe/imcs-bt-fe/uni-mall/pages/device/device.vue

@@ -37,21 +37,21 @@
 						id: 1,
 						id: 1,
 						address: "泥城扩路镇223号,三层",
 						address: "泥城扩路镇223号,三层",
 						status: "1",
 						status: "1",
-						pic: "http://yanxuan.nosdn.127.net/c1c62211a17b71a634fa0c705d11fb42.png"
+						pic: "../../static/images/device_bg.png"
 					},
 					},
 					{
 					{
 						name: "果奶机02",
 						name: "果奶机02",
 						id: 1,
 						id: 1,
 						address: "泥城扩路镇223号,三层",
 						address: "泥城扩路镇223号,三层",
 						status: "2",
 						status: "2",
-						pic: "http://yanxuan.nosdn.127.net/c1c62211a17b71a634fa0c705d11fb42.png"
+						pic: "../../static/images/device_bg.png"
 					},
 					},
 					{
 					{
 						name: "果奶机03",
 						name: "果奶机03",
 						id: 1,
 						id: 1,
 						address: "泥城扩路镇223号,三层",
 						address: "泥城扩路镇223号,三层",
 						status: "3",
 						status: "3",
-						pic: "http://yanxuan.nosdn.127.net/c1c62211a17b71a634fa0c705d11fb42.png"
+						pic: "../../static/images/device_bg.png"
 					}
 					}
 				],
 				],
 				queryParams: util.initQueryParams(),
 				queryParams: util.initQueryParams(),

+ 59 - 37
imcs-bt-fe/imcs-bt-fe/uni-mall/pages/device/deviceDetail.vue

@@ -17,19 +17,38 @@
 		</view>
 		</view>
 		<view class="a-section a-topic">
 		<view class="a-section a-topic">
 			<view class="m-menu">
 			<view class="m-menu">
-				<navigator class="item" v-for="(item, index) in statisticsList" :key="index" :url="item.url">
-					<text class="val">{{item.value}}</text>
-					<text class="txt">{{item.name}}</text>
+				<navigator class="item">
+					<text class="val">{{statistics.todayNum}}</text>
+					<text class="txt">今日订单</text>
+				</navigator>	
+				<navigator class="item">
+					<text class="val">{{statistics.exceptNum}}</text>
+					<text class="txt">异常订单</text>
+				</navigator>
+				<navigator class="item">	
+					<text class="val">{{statistics.errMsgNum}}</text>
+					<text class="txt">异常消息</text>
+				</navigator>
+				<navigator class="item">
+					<text class="val">{{statistics.todayAmount}}</text>
+					<text class="txt">今日销售总额</text>
+				</navigator>
+				<navigator class="item">
+					<text class="val">{{statistics.sevenAmount}}</text>
+					<text class="txt">最近七天销售总额</text>
+				</navigator>	
+				<navigator class="item">
+					<text class="val">{{statistics.sevenNum}}</text>
+					<text class="txt">最近七天订单</text>
 				</navigator>
 				</navigator>
 			</view>
 			</view>
 		</view>
 		</view>
 		<view class="a-section material">
 		<view class="a-section material">
-			<text>操作</text>
-			<navigator :url="'../material/material?id='+item.id" v-for="(item, index) in materialList" :key="item.id">
+			<navigator :url="'../material/material?id='+device.id">
 				<view class="h">
 				<view class="h">
-					<view class="l">{{item.name}}</view>
+					<view class="l">料筒物料</view>
 					<view class="r">
 					<view class="r">
-						{{item.content}}
+						<image class="icon" src="/static/images/go.png" />
 					</view>
 					</view>
 				</view>
 				</view>
 			</navigator>
 			</navigator>
@@ -60,25 +79,14 @@
 					status: "1",
 					status: "1",
 					pic_url: "http://yanxuan.nosdn.127.net/c1c62211a17b71a634fa0c705d11fb42.png"
 					pic_url: "http://yanxuan.nosdn.127.net/c1c62211a17b71a634fa0c705d11fb42.png"
 				},
 				},
-				statisticsList: [{
-					name: "今日订单",
-					value: "3"
-				}, {
-					name: "异常订单",
-					value: "1"
-				}, {
-					name: "异常消息",
-					value: "1"
-				}, {
-					name: "今日销售总额",
-					value: "500.00"
-				}, {
-					name: "最近七天销售总额",
-					value: "500.00"
-				}, {
-					name: "最近七天订单",
-					value: "500"
-				}],
+				statistics: {
+					"sevenAmount": "0.00",
+					"exceptNum": "0",
+					"sevenNum": "0",
+					"todayNum": "0",
+					"todayAmount": "0.00",
+					"errMsgNum": "0"
+				},
 				materialList: [{
 				materialList: [{
 					id: 1,
 					id: 1,
 					name: "料筒物料",
 					name: "料筒物料",
@@ -90,30 +98,41 @@
 				}]
 				}]
 			}
 			}
 		},
 		},
-	    methods: {
-			getDeviceDetail(){
+		methods: {
+			getDeviceDetail() {
 				let that = this;
 				let that = this;
 				util.request(api.DeviceDetail, {
 				util.request(api.DeviceDetail, {
 					equId: this.$route.query.id
 					equId: this.$route.query.id
-				},'GET','application/json').then(function(res) {
+				}, 'GET', 'application/json').then(function(res) {
 					if (res.code === 0) {
 					if (res.code === 0) {
 						that.device = res.data;
 						that.device = res.data;
 					}
 					}
 				});
 				});
 			},
 			},
-			getMaterialData(){
+			getStatistics() {
+				let that = this;
+				util.request(api.OrderStatistic, {
+					equId: this.$route.query.id
+				}, 'GET', 'application/json').then(function(res) {
+					if (res.code === 0) {
+						that.statistics = res.data;
+					}
+				});
+			},
+			getMaterialData() {
 				let that = this;
 				let that = this;
 				util.request(api.MaterialList, {
 				util.request(api.MaterialList, {
 					equId: this.$route.query.id
 					equId: this.$route.query.id
-				},'GET','application/json').then(function(res) {
-					if (res.errno === 0) {
+				}, 'GET', 'application/json').then(function(res) {
+					if (res.code === 0) {
 						that.materialList = res.data;
 						that.materialList = res.data;
 					}
 					}
 				});
 				});
 			},
 			},
-			onLoad: function() {				
+			onLoad: function() {
 				this.getDeviceDetail();
 				this.getDeviceDetail();
 				this.getMaterialData();
 				this.getMaterialData();
+				this.getStatistics();
 			}
 			}
 		}
 		}
 	}
 	}
@@ -242,13 +261,11 @@
 
 
 	.m-menu .item .val {
 	.m-menu .item .val {
 		font-size: 50rpx;
 		font-size: 50rpx;
-		padding: 40rpx;
-		margin-left: 33%;
+		padding: 40rpx;		
 	}
 	}
 
 
 	.m-menu .item .txt {
 	.m-menu .item .txt {
-		font-size: 25rpx;
-		margin-left: 33%;
+		font-size: 25rpx;		
 	}
 	}
 
 
 	.material {
 	.material {
@@ -285,4 +302,9 @@
 		height: 60rpx;
 		height: 60rpx;
 		line-height: 60rpx;
 		line-height: 60rpx;
 	}
 	}
+    .icon {
+		margin: 30rpx auto 0 auto;
+		width: 40rpx;
+		height: 40rpx;
+	}
 </style>
 </style>

+ 9 - 9
imcs-bt-fe/imcs-bt-fe/uni-mall/pages/index/index.vue

@@ -85,7 +85,7 @@
 			</view>
 			</view>
 		</view>
 		</view>
 
 
-		<view class="a-section a-popular" v-if="device.length > 0">
+		<view class="a-section a-popular" v-if="topics.length > 0">
 			<view class="h">
 			<view class="h">
 				<view>
 				<view>
 					<navigator url="../device/device">
 					<navigator url="../device/device">
@@ -220,21 +220,21 @@
 						id: 1,
 						id: 1,
 						address: "泥城扩路镇223号,三层",
 						address: "泥城扩路镇223号,三层",
 						status: "1",
 						status: "1",
-						pic: "http://yanxuan.nosdn.127.net/c1c62211a17b71a634fa0c705d11fb42.png"
+						pic: "../../static/images/device_bg.png"
 					},
 					},
 					{
 					{
 						name: "果奶机02",
 						name: "果奶机02",
 						id: 1,
 						id: 1,
 						address: "泥城扩路镇223号,三层",
 						address: "泥城扩路镇223号,三层",
 						status: "2",
 						status: "2",
-						pic: "http://yanxuan.nosdn.127.net/c1c62211a17b71a634fa0c705d11fb42.png"
+						pic: "../../static/images/device_bg.png"
 					},
 					},
 					{
 					{
 						name: "果奶机03",
 						name: "果奶机03",
 						id: 1,
 						id: 1,
 						address: "泥城扩路镇223号,三层",
 						address: "泥城扩路镇223号,三层",
 						status: "3",
 						status: "3",
-						pic: "http://yanxuan.nosdn.127.net/c1c62211a17b71a634fa0c705d11fb42.png"
+						pic: "../../static/images/device_bg.png"
 					},
 					},
 				],
 				],
 				channel: [{
 				channel: [{
@@ -266,7 +266,7 @@
 						id: 4,
 						id: 4,
 						name: "今日订单",
 						name: "今日订单",
 						sort_order: 4,
 						sort_order: 4,
-						url: "/pages/ucenter/order/order?id=4",
+						url: "/pages/ucenter/order/order?type=1",
 						val: "3"
 						val: "3"
 					},
 					},
 					{
 					{
@@ -310,7 +310,7 @@
 				if (that.hotGoods.length) {
 				if (that.hotGoods.length) {
 					util.request(api.IndexUrlHotGoods).then(function(res) {
 					util.request(api.IndexUrlHotGoods).then(function(res) {
 						if (res.errno === 0) {
 						if (res.errno === 0) {
-							that.hotGoods = res.data.hotGoodsList
+							//that.hotGoods = res.data.hotGoodsList
 						}
 						}
 					});
 					});
 				}
 				}
@@ -332,7 +332,7 @@
 				if (that.brands.length) {
 				if (that.brands.length) {
 					util.request(api.IndexUrlBrand).then(function(res) {
 					util.request(api.IndexUrlBrand).then(function(res) {
 						if (res.errno === 0) {
 						if (res.errno === 0) {
-							that.brands = res.data.brandList
+							//that.brands = res.data.brandList
 						}
 						}
 					});
 					});
 				}
 				}
@@ -346,14 +346,14 @@
 				if (!that.banner.length) {
 				if (!that.banner.length) {
 					util.request(api.IndexUrlBanner).then(function(res) {
 					util.request(api.IndexUrlBanner).then(function(res) {
 						if (res.errno === 0) {
 						if (res.errno === 0) {
-							that.banner = res.data.banner
+							//that.banner = res.data.banner
 						}
 						}
 					});
 					});
 				}
 				}
 				if (!that.channel.length) {
 				if (!that.channel.length) {
 					util.request(api.IndexUrlChannel).then(function(res) {
 					util.request(api.IndexUrlChannel).then(function(res) {
 						if (res.errno === 0) {
 						if (res.errno === 0) {
-							that.channel = res.data.channel
+							//that.channel = res.data.channel
 						}
 						}
 					});
 					});
 				}
 				}

+ 14 - 1
imcs-bt-fe/imcs-bt-fe/uni-mall/pages/material/material.vue

@@ -263,7 +263,20 @@
 			},
 			},
 			editClose(){
 			editClose(){
 				this.editShow = false
 				this.editShow = false
-			}
+			},
+			getMaterialData() {
+				let that = this;
+				util.request(api.MaterialList, {
+					equId: this.$route.query.id
+				}, 'GET', 'application/json').then(function(res) {
+					if (res.code === 0) {
+						that.records = res.data;
+					}
+				});
+			},
+			onLoad: function() {
+				this.getMaterialData();
+			} 
 		}
 		}
 	}
 	}
 </script>
 </script>

+ 10 - 4
imcs-bt-fe/imcs-bt-fe/uni-mall/pages/ucenter/order/order.vue

@@ -25,7 +25,8 @@
 			</view>
 			</view>
 		</picker>
 		</picker>
 
 
-		<view class="picker">
+		<view class="picker" style="position: relative;">
+			<view class="label" v-if="this.$route.query.type">今日订单</view>
 			<view class="fb-type">
 			<view class="fb-type">
 				<text>{{range[0]}} - {{range[1]}}</text>
 				<text>{{range[0]}} - {{range[1]}}</text>
 				<button type="primary" @click="onShowDatePicker('range')">选择日期范围</button>
 				<button type="primary" @click="onShowDatePicker('range')">选择日期范围</button>
@@ -61,7 +62,7 @@
 				<view class="h">
 				<view class="h">
 					<view class="l">设备名称:{{item.deviceName||''}}</view>
 					<view class="l">设备名称:{{item.deviceName||''}}</view>
 				</view>
 				</view>
-				<view class="h" v-if="item.errorMsg">
+				<view class="h" v-if="item.errorMsg && item.status==2">
 					<view class="l">异常原因:{{item.errorMsg}}</view>
 					<view class="l">异常原因:{{item.errorMsg}}</view>
 				</view>
 				</view>
 				<view class="b" v-if="false">
 				<view class="b" v-if="false">
@@ -192,6 +193,10 @@
 			},
 			},
 			getOrderList() {
 			getOrderList() {
 				let that = this;
 				let that = this;
+				let type = this.$route.query.type;
+				if(type=="1"){
+					that.range=[util.getNowDate(0), util.getNowDate(1)];					
+				}
 				if (that.index2 > 0) {
 				if (that.index2 > 0) {
 					that.queryParams.model.orderEquId = that.index2;
 					that.queryParams.model.orderEquId = that.index2;
 				} else {
 				} else {
@@ -216,7 +221,7 @@
 						that.orderList = that.orderList.concat(res.data.records);
 						that.orderList = that.orderList.concat(res.data.records);
 						//that.page = res.data.currentPage + 1
 						//that.page = res.data.currentPage + 1
 						that.totalPages = res.data.pages
 						that.totalPages = res.data.pages
-						that.orderCount = res.data.total;
+						that.orderCount = res.data.total
 					}
 					}
 				});
 				});
 			},
 			},
@@ -242,7 +247,7 @@
 			}
 			}
 			this.getOrderList()
 			this.getOrderList()
 		},
 		},
-		onShow: function(options) {
+		onShow: function(options) {			
 			this.getOrderList();
 			this.getOrderList();
 		}
 		}
 	}
 	}
@@ -430,4 +435,5 @@
 		line-height: 50rpx;
 		line-height: 50rpx;
 		font-size: 28rpx;
 		font-size: 28rpx;
 	}
 	}
+	
 </style>
 </style>

+ 19 - 27
imcs-bt-fe/imcs-bt-fe/uni-mall/pages/ucenter/order/orderDetail.vue

@@ -1,23 +1,29 @@
 <template>
 <template>
 	<view class="container">
 	<view class="container">
 		<view class="orders" v-if="msgList.length>0">	
 		<view class="orders" v-if="msgList.length>0">	
-			<navigator class="order" v-for="(item, index) in msgList" :key="item.id">	
+			<view class="order" v-for="(item, index) in msgList" :key="item.id">	
 				<view class="h">
 				<view class="h">
 					<view class="l">消息时间:{{item.createTime||''}}</view>
 					<view class="l">消息时间:{{item.createTime||''}}</view>
-					<view class="r">{{item.status==='0'?'待处理':'已处理'}}</view>
+					<view class="r">{{item.workStatus===0?'待处理':'已处理'}}</view>
 				</view>
 				</view>
 				<view class="h">
 				<view class="h">
+					<view class="l">订单编号:{{item.id||''}}</view>					
+				</view>
+				<view class="h">
+					<view class="l">会员名称:{{item.orderMemberName||''}}</view>
+				</view>	
+				<view class="h" v-if="item.status">
 					<view class="l">异常原因:【{{item.type}}】{{item.content}}</view>
 					<view class="l">异常原因:【{{item.type}}】{{item.content}}</view>
 				</view>				
 				</view>				
-				<view class="b" v-if="item.status==='0'">
+				<view class="b" v-if="item.status>1">
 					<view class="l"></view>
 					<view class="l"></view>
 					<view class="r">
 					<view class="r">
 						<button class="btn" :data-order-index="index" @click.stop.prevent="payOrder"
 						<button class="btn" :data-order-index="index" @click.stop.prevent="payOrder"
 							>处理</button>
 							>处理</button>
 					</view>
 					</view>
 				</view>
 				</view>
-			</navigator>				
-		</view>		
+			</view>
+		</view>
 	</view>
 	</view>
 </template>
 </template>
 
 
@@ -27,19 +33,7 @@
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
-				msgList: [{
-					id: '1',					
-					createTime: '2021-07-04 12:13',
-					status: '0',	
-					type: '异常',				
-					content: '设备报警/订单异常' 
-				}, {
-					id: '2',					
-					createTime: '2021-08-06 16:25',
-					status: '1',
-					type: '缺料',
-					content: '缺少物料'
-				}],
+				msgList: [],
 				page: 1,
 				page: 1,
 				size: 10,
 				size: 10,
 				totalPages: 1
 				totalPages: 1
@@ -48,13 +42,11 @@
 		methods: {
 		methods: {
 			getMsgList() {
 			getMsgList() {
 				let that = this;
 				let that = this;
-
-				util.request(api.MsgList, {
-					page: that.page,
-					size: that.size
-				}, 'GET').then(function(res) {
-					if (res.errno === 0) {
-						//that.MsgList = that.MsgList.concat(res.data.data)
+				util.request(api.OrderDetail, {
+					id: this.$route.query.id
+				},'GET','application/json').then(function(res) {
+					if (res.code === 0) {
+						that.msgList = that.msgList.concat(res.data)
 						//that.page = res.data.currentPage + 1
 						//that.page = res.data.currentPage + 1
 						//that.totalPages = res.data.totalPages
 						//that.totalPages = res.data.totalPages
 					}
 					}
@@ -77,8 +69,8 @@
 		onReachBottom: function() {
 		onReachBottom: function() {
 			this.getMsgList()
 			this.getMsgList()
 		},
 		},
-		onShow: function(options) {
-			//this.getMsgList();
+		onLoad: function(options) {
+			this.getMsgList();
 		}
 		}
 	}
 	}
 </script>
 </script>

BIN
imcs-bt-fe/imcs-bt-fe/uni-mall/static/images/device_bg.png


+ 3 - 2
imcs-bt-fe/imcs-bt-fe/uni-mall/utils/api.js

@@ -60,8 +60,9 @@ module.exports = {
 
 
 	RegionList: 'region/list', //获取区域列表
 	RegionList: 'region/list', //获取区域列表
 
 
-	OrderList: 'equOrders', //订单列表
-	OrderDetail: 'order/detail', //订单详情
+	OrderList: 'equOrders', //订单列表	
+	OrderDetail: 'orderDetails', //订单详情
+	OrderStatistic: 'orderStatistics',
 	OrderCancel: 'order/cancelOrder', //取消订单
 	OrderCancel: 'order/cancelOrder', //取消订单
 	OrderConfirm: 'order/confirmOrder', //确认收货
 	OrderConfirm: 'order/confirmOrder', //确认收货
 	
 	

+ 12 - 2
imcs-bt-fe/imcs-bt-fe/uni-mall/utils/util.js

@@ -181,6 +181,15 @@ const utils = {
 			})
 			})
 		})
 		})
 	},
 	},
+	getNowDate: function(num) {
+		let date = new Date(); 
+		date.setTime(date.getTime()+24*60*60*1000 * num );
+		let d = date.getDate();
+		d = d < 10 ? ('0' + d) : d;
+		let m = date.getMonth() + 1;
+		m = m  <10 ?  ('0' + m) : m;
+		return date.getFullYear()+"-" + m + "-" + d;
+	},
 	tuiJsonp: function(url, callback, callbackname) {
 	tuiJsonp: function(url, callback, callbackname) {
 		// #ifdef H5
 		// #ifdef H5
 		window[callbackname] = callback;
 		window[callbackname] = callback;
@@ -276,7 +285,7 @@ const utils = {
 		} else {
 		} else {
 			return "";
 			return "";
 		}
 		}
-	},
+	},	
 	getDistance: function(lat1, lng1, lat2, lng2) {
 	getDistance: function(lat1, lng1, lat2, lng2) {
 		function Rad(d) {
 		function Rad(d) {
 			return d * Math.PI / 180.0;
 			return d * Math.PI / 180.0;
@@ -514,5 +523,6 @@ module.exports = {
 	login: utils.login,
 	login: utils.login,
 	loginH5: utils.loginH5,
 	loginH5: utils.loginH5,
 	randomNum: utils.randomNum,
 	randomNum: utils.randomNum,
-	initQueryParams: utils.initQueryParams
+	initQueryParams: utils.initQueryParams,
+	getNowDate: utils.getNowDate
 }
 }