Browse Source

一级市场订单确认及取消修改

linbl 1 year ago
parent
commit
1a0d1137fb
2 changed files with 26 additions and 47 deletions
  1. 21 42
      pages/market/one/leader/order.vue
  2. 5 5
      pages/market/one/merchant/order/list.vue

+ 21 - 42
pages/market/one/leader/order.vue

@@ -5,7 +5,7 @@
 		</view>
 		<view class="goodsList">
 			<view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
-				<view class="title">广西京东自营店南宁分店</view>
+				<view class="title">{{ item.enterpriseName }}]</view>
 				<view class="state" v-if="item.enterpriseConfirm == 0">
 					<text class="icon">&#xe830;</text>
 					<text>商家未确认</text>
@@ -14,7 +14,7 @@
 					<text class="icon" style="color: #13ce66">&#xe830;</text>
 					<text>已确认</text>
 				</view>
-				<view class="state" v-if="item.enterpriseConfirm == 3">
+				<view class="state" v-if="item.enterpriseConfirm == 2">
 					<text class="icon" style="color: #f44336">&#xe622;</text>
 					<text>已取消</text>
 				</view>
@@ -22,17 +22,16 @@
 				<view class="con">
 					<view class="productName omit">{{ item.goodsNames }}</view>
 					<view class="desc omit">
-						<text>50吨</text>
+						<text>重量 {{ item.totalWeight }}</text>
 						<text>{{ item.tradeAreaName }}</text>
 					</view>
-					<view class="price">¥ {{ item.price }}</view>
+					<view class="price">¥ {{ item.totalPrice }}</view>
 				</view>
 				<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 == 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" v-if="user.userType == 2" @click.stop="confirm(item.id)">取消订单</view>
 					</template>
 				</view>
 			</view>
@@ -122,43 +121,23 @@ export default {
 			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/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();
-								}
-							});
-						}
+		confirm(id) {
+			uni.showModal({
+				title: '提示',
+				content: '是否确认取消订单?',
+				success: res => {
+					if (res.confirm) {
+						this.http.request({
+							url: '/level-one-server/app/TbOrder/cancelOrder',
+							data: { orderId: id },
+							success: resp => {
+								uni.showToast({ title: '操作成功' });
+								this.refresh();
+							}
+						});
 					}
-				});
-			}
+				}
+			});
 		}
 	},
 	//下拉刷新

+ 5 - 5
pages/market/one/merchant/order/list.vue

@@ -31,8 +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" @click.stop="confirm(item.id, 2, '确认拒绝?')">取消订单</view>
-						<view class="an" style="color: #4581fb" @click.stop="confirm(item.goodsId, 1, '确认接单?')">确认订单</view>
+						<view class="an" style="color: #f44336" @click.stop="confirm(item.id, item.goodsId, 2, '确认拒绝?')">取消订单</view>
+						<view class="an" style="color: #4581fb" @click.stop="confirm(item.id, item.goodsId, 1, '确认接单?')">确认订单</view>
 					</template>
 				</view>
 			</view>
@@ -91,7 +91,7 @@ export default {
 			this.getData();
 		}, 
 		// 商家确认
-		confirm(id, status, content) {
+		confirm(id, goodsId, status, content) {
 			//enterprise_confirm:'商铺确认情况[0=待确认,1=已确认,2=拒绝]'
 			uni.showModal({
 				title: '提示',
@@ -99,8 +99,8 @@ export default {
 				success: res => {
 					if (res.confirm) {
 						this.http.request({
-							url: '/level-one-server/app/TbGoodsTransit/updateEnterpriseConfirm',
-							data: { id: id, enterpriseConfirm: status },
+							url: '/level-one-server/app/TbOrder/updateEnterpriseConfirm',
+							data: { id: id, goodsId: goodsId, enterpriseConfirm: status },
 							method: 'POST',
 							success: resp => {
 								uni.showToast({ title: '操作成功' });