Browse Source

更新订单

李书文 1 year ago
parent
commit
306084d50c
4 changed files with 273 additions and 145 deletions
  1. 19 1
      pages.json
  2. 105 0
      pages/market/one/leader/detail.vue
  3. 19 0
      pages/market/one/leader/members.vue
  4. 130 144
      pages/market/one/leader/order.vue

+ 19 - 1
pages.json

@@ -302,7 +302,25 @@
 			}
 
 		}
-	],
+	    ,{
+            "path" : "pages/market/one/leader/detail",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "订单详情",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/market/one/leader/members",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "订单边民",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+    ],
 	"tabBar": {
 		"color": "#7A7E83",
 		"selectedColor": "#4581fb",

+ 105 - 0
pages/market/one/leader/detail.vue

@@ -0,0 +1,105 @@
+<template>
+	<view>
+		<view class="cmain">
+			<view class="box order_detail" style="margin-top: 0px">
+				<u-divider text="订单信息"></u-divider>
+				<view class="item" style="padding-top: 0px">
+					<text class="label">订单编号</text>
+					<text class="desc">13454334567</text>
+				</view>
+				<view class="item">
+					<text class="label">申报单号</text>
+					<text class="desc">13454334567</text>
+				</view>
+				<view class="item">
+					<text class="label">商家名称</text>
+					<text class="desc">胡椒粉</text>
+				</view>
+				<view class="item">
+					<text class="label">联系号码</text>
+					<text class="desc">元/kg</text>
+				</view>
+				<view class="item">
+					<text class="label">商品名称</text>
+					<text class="desc">元/kg</text>
+				</view>
+				<view class="item">
+					<text class="label">计价单位</text>
+					<text class="desc">元/kg</text>
+				</view>
+				<view class="item">
+					<text class="label">净重</text>
+					<text class="desc">34吨</text>
+				</view>
+				<view class="item">
+					<text class="label">毛重</text>
+					<text class="desc">35吨</text>
+				</view>
+				<view class="item">
+					<text class="label">价格</text>
+					<text class="desc">400000元</text>
+				</view>
+				<view class="item">
+					<text class="label">边民</text>
+					<text class="desc">查看</text>
+				</view>
+				<view class="item">
+					<text class="label">发布时间</text>
+					<text class="desc">2023-07-20 11:38</text>
+				</view>
+				<view class="item">
+					<text class="label">下单时间</text>
+					<text class="desc">2023-07-20 11:38</text>
+				</view>
+				<view class="item">
+					<text class="label">购买边民组</text>
+					<text class="desc">貔貅互助组</text>
+				</view>
+				<view class="item">
+					<text class="label">确认时间</text>
+					<text class="desc">2023-07-20 11:38</text>
+				</view>
+				<view class="item">
+					<text class="label">进境时间</text>
+					<text class="desc">2023-07-20 11:38</text>
+				</view>
+				<view class="item">
+					<text class="label">进口时间</text>
+					<text class="desc">2023-07-20 11:38</text>
+				</view>
+				<view class="item">
+					<text class="label">出互市区时间</text>
+					<text class="desc">2023-07-20 11:38</text>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			item: {}
+		};
+	},
+	onLoad(e) {
+		if (e.id) {
+			this.http.request({
+				url: '/level-one-server/app/TbOrder/getById?id=' + e.id,
+				success: res => {
+					this.item = res.data.data;
+					console.log('asd:' + JSON.stringify(res));
+				}
+			});
+		}
+	},
+	methods: {}
+};
+</script>
+
+<style lang="scss">
+page {
+	background-color: $pg;
+}
+</style>

+ 19 - 0
pages/market/one/leader/members.vue

@@ -0,0 +1,19 @@
+<template>
+	<view>
+		
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				
+			};
+		}
+	}
+</script>
+
+<style lang="scss">
+
+</style>

+ 130 - 144
pages/market/one/leader/order.vue

@@ -8,7 +8,7 @@
 				<view class="title">广西京东自营店南宁分店</view>
 				<view class="state" v-if="item.enterpriseConfirm == 0">
 					<text class="icon">&#xe830;</text>
-					<text>确认</text>
+					<text>商家未确认</text>
 				</view>
 				<view class="state" v-if="item.enterpriseConfirm == 1">
 					<text class="icon" style="color: #13ce66">&#xe830;</text>
@@ -20,7 +20,7 @@
 				</view>
 				<image src="../../../../static/news.jpg" mode="aspectFill" class="pic"></image>
 				<view class="con">
-					<view class="productName omit">{{item.goodsNames}}</view>
+					<view class="productName omit">{{ item.goodsNames }}</view>
 					<view class="desc omit">
 						<text>50吨</text>
 						<text>{{ item.tradeAreaName }}</text>
@@ -31,12 +31,8 @@
 				<view class="op">
 					<view class="date">2022-12-12:12:12</view>
 					<template v-if="item.enterpriseConfirm == 0">
-						<view class="an" style="color: #f44336" v-if="user.userType == 2"
-							@click.stop="confirm(item.id, 2,item.enterpriseConfirm)">取消订单</view>
-						<view class="an" style="color: #4581fb" v-if="user.userType == 3"
-							@click.stop="confirm(item.id, 1)">确认订单</view>
-						<!-- <view class="an" style="color: #f44336" @click.stop="confirm(item.id, 2, '确认拒绝?')">取消订单</view>
-						<view class="an" style="color: #4581fb" @click.stop="confirm(item.id, 1, '确认接单?')">确认订单</view> -->
+						<view class="an" style="color: #f44336" v-if="user.userType == 2" @click.stop="confirm(item.id, 2, item.enterpriseConfirm)">取消订单</view>
+						<view class="an" style="color: #4581fb" v-if="user.userType == 3" @click.stop="confirm(item.id, 1)">确认订单</view>
 					</template>
 				</view>
 			</view>
@@ -47,153 +43,143 @@
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-				tab: [{
-						name: '全部',
-						enterpriseConfirm: '',
-						apply: ''
-					},
-					{
-						name: '待确认',
-						enterpriseConfirm: 0,
-						apply: 0
-					}, //enterpriseConfirm:商户确认(0=待确认,1=是,2=否)
-					{
-						name: '申报中',
-						enterpriseConfirm: 1,
-						apply: 0
-					},
-					{
-						name: '已完成',
-						enterpriseConfirm: 2,
-						apply: 1
-					}, //apply:申报[0=待申报,1=申报通过,2=申报不通过]
-					{
-						name: '已取消',
-						enterpriseConfirm: 3,
-						apply: ''
-					}
-				],
-				param: {
-					pageNo: 1,
-					pageSize: 10
+export default {
+	data() {
+		return {
+			tab: [
+				{
+					name: '全部',
+					enterpriseConfirm: '',
+					apply: ''
+				},
+				{
+					name: '待确认',
+					enterpriseConfirm: 0,
+					apply: 0
+				}, //enterpriseConfirm:商户确认(0=待确认,1=是,2=否)
+				{
+					name: '申报中',
+					enterpriseConfirm: 1,
+					apply: 0
 				},
-				list: [],
-				loadMore: true,
-				user: this.getUser()
-			};
+				{
+					name: '已完成',
+					enterpriseConfirm: 2,
+					apply: 1
+				}, //apply:申报[0=待申报,1=申报通过,2=申报不通过]
+				{
+					name: '已取消',
+					enterpriseConfirm: 3,
+					apply: ''
+				}
+			],
+			param: {
+				pageNo: 1,
+				pageSize: 10
+			},
+			list: [],
+			loadMore: true,
+			user: this.getUser()
+		};
+	},
+	onLoad() {
+		this.getData();
+	},
+	methods: {
+		getData() {
+			this.http.request({
+				url: '/level-one-server/app/TbOrder/getList',
+				loading: 'false',
+				data: this.param,
+				success: res => {
+					this.loadMore = parseInt(res.data.pageCount) > this.param.pageNo;
+					if (res.data.data) {
+						this.list.push(...res.data.data);
+					}
+					this.list.map(item => {
+						if (item.cancelPeople == 1) {
+							item.enterpriseConfirm = 3;
+						}
+					});
+				}
+			});
 		},
-		onLoad() {
+		//点击tab切换
+		click(e) {
+			console.log(e);
+			this.param.orderStatus = e.enterpriseConfirm;
+			this.param.apply = e.apply;
+			this.refresh();
+		},
+		detail(item) {
+			uni.navigateTo({url: '/pages/market/one/leader/detail?id=' + item.id});
+		},
+		//刷新数据
+		refresh() {
+			this.loadMore = true;
+			this.param.pageNo = 1;
+			this.list = [];
 			this.getData();
 		},
-		methods: {
-			getData() {
-				this.http.request({
-					url: '/level-one-server/app/TbOrder/getList',
-					loading: 'false',
-					data: this.param,
+		//通知商家
+		confirm(id, type, enterpriseConfirm) {
+			if (type == 1) {
+				uni.showModal({
+					title: '提示',
+					content: '是否确认接单?',
 					success: res => {
-						this.loadMore = parseInt(res.data.pageCount) > this.param.pageNo;
-						if (res.data.data) {
-							this.list.push(...res.data.data);
+						if (res.confirm) {
+							this.http.request({
+								url: '/level-one-server/app/TbGoodsTransit/updateEnterpriseConfirm',
+								data: { id: id, enterpriseConfirm: 1 },
+								method: 'POST',
+								success: resp => {
+									uni.showToast({ title: '操作成功' });
+									this.refresh();
+								}
+							});
 						}
-						this.list.map(item => {
-							if(item.cancelPeople==1){
-								item.enterpriseConfirm = 3
-							}
-						})
 					}
 				});
-			},
-			//点击tab切换
-			click(e) {
-				console.log(e)
-				this.param.orderStatus = e.enterpriseConfirm;
-				this.param.apply = e.apply
-				this.refresh();
-			},
-			detail(item) {
-				uni.navigateTo({
-					url: '/pages/market/one/merchant/order/detail?id=' + item.id
-				});
-			},
-			//刷新数据
-			refresh() {
-				this.loadMore = true;
-				this.param.pageNo = 1;
-				this.list = [];
-				this.getData();
-			},
-			//通知商家 
-			confirm(id, type, enterpriseConfirm) {
-				if (type == 1) {
-					uni.showModal({
-						title: '提示',
-						content: '是否确认接单?',
-						success: res => {
-							if (res.confirm) {
-								this.http.request({
-									// url: '/level-one-server/app/TbGoodsTransit/update',
-									url: '/level-one-server/app/TbGoodsTransit/updateEnterpriseConfirm',
-									data: {
-										id: id,
-										enterpriseConfirm: 1
-									},
-									method: 'POST',
-									success: resp => {
-										uni.showToast({
-											title: '操作成功'
-										});
-										this.refresh();
-									}
-								});
-							}
-						}
-					});
-				} else {
-					uni.showModal({
-						title: '提示',
-						content: '是否确认取消订单?',
-						success: res => {
-							if (res.confirm) {
-								this.http.request({
-									url: '/level-one-server/app/TbOrder/cancelOrder',
-									data: { orderId: id,orderStatus: enterpriseConfirm },
-									success: resp => {
-										uni.showToast({
-											title: '操作成功'
-										});
-										this.refresh();
-									}
-								});
-							}
+			} else {
+				uni.showModal({
+					title: '提示',
+					content: '是否确认取消订单?',
+					success: res => {
+						if (res.confirm) {
+							this.http.request({
+								url: '/level-one-server/app/TbOrder/cancelOrder',
+								data: { orderId: id, orderStatus: enterpriseConfirm },
+								success: resp => {
+									uni.showToast({ title: '操作成功' });
+									this.refresh();
+								}
+							});
 						}
-					});
-				}
-
-			}
-		},
-		//下拉刷新
-		onPullDownRefresh() {
-			setTimeout(() => {
-				this.refresh();
-				uni.stopPullDownRefresh();
-			}, 1000);
-		},
-		//上拉加载
-		onReachBottom() {
-			if (this.loadMore) {
-				this.param.pageNo++;
-				this.getData();
+					}
+				});
 			}
 		}
-	};
+	},
+	//下拉刷新
+	onPullDownRefresh() {
+		setTimeout(() => {
+			this.refresh();
+			uni.stopPullDownRefresh();
+		}, 1000);
+	},
+	//上拉加载
+	onReachBottom() {
+		if (this.loadMore) {
+			this.param.pageNo++;
+			this.getData();
+		}
+	}
+};
 </script>
 
 <style lang="scss">
-	page {
-		background-color: $pg;
-	}
-</style>
+page {
+	background-color: $pg;
+}
+</style>