Jelajahi Sumber

app修改-边民确认

linbl 1 tahun lalu
induk
melakukan
d16d3426a6
2 mengubah file dengan 102 tambahan dan 75 penghapusan
  1. 69 58
      pages/market/one/leader/members.vue
  2. 33 17
      pages/market/one/leader/order.vue

+ 69 - 58
pages/market/one/leader/members.vue

@@ -1,17 +1,28 @@
 <template>
 	<view>
 		<view class="search">
-			<u-search placeholder="输入姓名搜索" v-model="param.goodsName" bgColor="white" @search="refresh()" :animation="true" actionText="取消" @clear="refresh()"></u-search>
+			<u-search placeholder="输入姓名搜索" v-model="goodsName" bgColor="white" @search="refresh()" :animation="true"
+				actionText="取消" @clear="refresh()"></u-search>
 			<view class="clear"></view>
 		</view>
 		<view class="list">
 			<view class="item" v-for="(item, index) in list" :key="index">
 				<view class="flex">
 					<view class="f name" style="flex: 0.5">{{ item.peopleName }}</view>
-					<view class="f" v-for="(item, index) in item.items" :key="index">
-						<text class="icon" v-if="item.state == 0">&#xe631;</text>
+					<view class="f">
+						<text class="icon" v-if="item.orderStatus == 0">&#xe631;</text>
 						<text class="icon ok" v-else>&#xe631;</text>
-						<text>{{ item.name }}</text>
+						<text>订单确认</text>
+					</view>
+					<view class="f">
+						<text class="icon" v-if="item.entryStatus == 0">&#xe631;</text>
+						<text class="icon ok" v-else>&#xe631;</text>
+						<text>进境申报</text>
+					</view>
+					<view class="f">
+						<text class="icon" v-if="item.importStatus == 0">&#xe631;</text>
+						<text class="icon ok" v-else>&#xe631;</text>
+						<text>进口申报</text>
 					</view>
 				</view>
 			</view>
@@ -20,67 +31,67 @@
 </template>
 
 <script>
-export default {
-	data() {
-		return {
-			param: {},
-			list: []
-		};
-	},
-	onLoad(e) {
-		this.param.orderId = e.id
-		this.getData();
-	},
-	methods: {
-		getData() {
-			
-			this.http.request({
-				url: '/level-one-server/app/TbOrder/selectPeopleConfirmByOrderId',
-				data: this.param,
-				success: res => {
-					this.list = res.data.data
-					this.list.map(item => {
-						item.items = [
-						{ name: '订单确认', state: item.progressApply },
-						{ name: '进境申报', state: item.importApply },
-					]
-					})
-					console.log(this.list)
-				}
-			});
+	export default {
+		data() {
+			return {
+				goodsName: '',
+				list: []
+			};
 		},
-		detail(item) {
-			uni.navigateTo({ url: '/pages/market/one/leader/detail?id=' + item.id });
+		onLoad(e) {
+			console.log("订单Id", e.orderId, "组Id", e.groupId)
+			if (e.orderId && e.groupId) {
+				this.http.request({
+					url: '/level-one-server/app/TbOrder/getPeopleState',
+					data: { orderId: e.orderId, groupId: e.groupId},
+					success: res => {
+						this.list = res.data.data;
+						console.log('list', this.list);
+					}
+				});
+
+
+			}
+		},
+		methods: {
+			getData() {
+
+			}
 		}
-	}
-};
+	};
 </script>
 
 <style lang="scss">
-page {
-	background-color: $pg;
-}
-.list {
-	padding: 15px;
-	.item {
-		padding: 15px 10px 15px 10px;
-		background-color: white;
-		border-radius: 5px;
-		margin-bottom: 10px;
-		color: $font-c;
-		.f {
-			padding: 2px;
-			font-size: 14px;
-			.icon {
-				color: #c3c5c7;
+	page {
+		background-color: $pg;
+	}
+
+	.list {
+		padding: 15px;
+
+		.item {
+			padding: 15px 10px 15px 10px;
+			background-color: white;
+			border-radius: 5px;
+			margin-bottom: 10px;
+			color: $font-c;
+
+			.f {
+				padding: 2px;
+				font-size: 14px;
+
+				.icon {
+					color: #c3c5c7;
+				}
+
+				.ok {
+					color: $main-color;
+				}
 			}
-			.ok {
-				color: $main-color;
+
+			.name {
+				font-weight: bold;
 			}
 		}
-		.name {
-			font-weight: bold;
-		}
 	}
-}
 </style>

+ 33 - 17
pages/market/one/leader/order.vue

@@ -5,19 +5,21 @@
 		</view>
 		<view class="goodsList">
 			<view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
-				<view class="title">{{ item.enterpriseName }}</view>
-				<view class="state" v-if="item.enterpriseConfirm == 0">
-					<text class="icon">&#xe830;</text>
-					<text>商家未确认</text>
-				</view>
-				<view class="state" v-if="item.enterpriseConfirm == 1">
-					<text class="icon" style="color: #13ce66">&#xe830;</text>
-					<text>已确认</text>
-				</view>
-				<view class="state" v-if="item.enterpriseConfirm == 2">
-					<text class="icon" style="color: #f44336">&#xe622;</text>
-					<text>已取消</text>
+				<view class="title">{{ item.enterpriseName }}
+					<view class="state" v-if="item.enterpriseConfirm == 0">
+						<text class="icon">&#xe830;</text>
+						<text>商家未确认</text>
+					</view>
+					<view class="state" v-if="item.enterpriseConfirm == 1">
+						<text class="icon" style="color: #13ce66">&#xe830;</text>
+						<text>已确认</text>
+					</view>
+					<view class="state" v-if="item.enterpriseConfirm == 2">
+						<text class="icon" style="color: #f44336">&#xe622;</text>
+						<text>已取消</text>
+					</view>
 				</view>
+
 				<image src="../../../../static/news.jpg" mode="aspectFill" class="pic"></image>
 				<view class="con">
 					<view class="productName omit">{{ item.goodsNames }}</view>
@@ -30,8 +32,8 @@
 				<view class="clear"></view>
 				<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 == 1" @click.stop="confirm(item.id)">边民确认</view>
+					<template v-if="item.enterpriseConfirm == 1">
+						<view class="an" style="color: #f44336" v-if="user.userType == 1" @click.stop="confirmOrder(item.id)">边民确认</view>
 					</template>
 					<template v-if="item.enterpriseConfirm == 0">
 						<view class="an" style="color: #f44336" v-if="user.userType == 2" @click.stop="confirm(item.id)">取消订单</view>
@@ -110,7 +112,7 @@ export default {
 				}
 			});
 		},
-		//点击tab切换
+		// 点击tab切换
 		click(e) {
 			console.log(e);
 			this.param.orderStatus = e.enterpriseConfirm;
@@ -120,14 +122,25 @@ export default {
 		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();
 		},
-		//通知商家
+		//边民确认订单
+		confirmOrder(id) {
+			this.http.request({
+				url: '/level-one-server/app/TbPeople/confirmOrder',
+				data: { orderId: id },
+				success: resp => {
+					uni.showToast({ title: '操作成功' });
+					this.refresh();
+				}
+			});
+		},
+		// 取消订单
 		confirm(id) {
 			uni.showModal({
 				title: '提示',
@@ -187,4 +200,7 @@ export default {
 page {
 	background-color: $pg;
 }
+.state{
+	margin-right: -70px;
+}
 </style>