Browse Source

app转售功能

linbl 1 year ago
parent
commit
7e2004bec1

+ 21 - 3
pages.json

@@ -422,8 +422,26 @@
 				"enablePullDownRefresh": false
 			}
 
-		}
-	],
+		},
+		{
+            "path" : "pages/market/two/leader/resale",
+            "style" :
+            {
+                "navigationBarTitleText": "转售确认",
+                "enablePullDownRefresh": false
+            }
+
+        },
+		{
+            "path" : "pages/market/two/purchaser/buy/buy",
+            "style" :
+            {
+                "navigationBarTitleText": "收购商购买",
+                "enablePullDownRefresh": false
+            }
+
+        }
+    ],
 	"tabBar": {
 		"color": "#7A7E83",
 		"selectedColor": "#4581fb",
@@ -454,4 +472,4 @@
 		"navigationBarTitleText": "边民互市贸易",
 		"navigationBarBackgroundColor": "#4581fb"
 	}
-}
+}

+ 55 - 26
pages/market/one/leader/order.vue

@@ -6,15 +6,19 @@
 		<view class="goodsList">
 			<view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
 				<view class="title">{{ item.enterpriseName }}
-					<view class="state" v-if="item.enterpriseConfirm == 0">
+					<view class="state" v-if="item.peopleConfirmStatus == 0">
 						<text class="icon">&#xe830;</text>
-						<text>商家未确认</text>
+						<text>未确认</text>
 					</view>
-					<view class="state" v-if="item.enterpriseConfirm == 1">
+					<view class="state" v-if="item.peopleConfirmStatus == 1 && item.apply == 0">
 						<text class="icon" style="color: #13ce66">&#xe830;</text>
 						<text>已确认</text>
 					</view>
-					<view class="state" v-if="item.enterpriseConfirm == 2">
+					<view class="state" v-if="item.resaleStatus == 1">
+						<text class="icon" style="color: #13ce66">&#xe830;</text>
+						<text>已转售</text>
+					</view>
+					<view class="state" v-if="item.finishStatus == 3">
 						<text class="icon" style="color: #f44336">&#xe622;</text>
 						<text>已取消</text>
 					</view>
@@ -31,16 +35,19 @@
 				</view>
 				<view class="clear"></view>
 				<view class="op">
-					<view class="date">2022-12-12:12:12</view>
-					<template v-if="item.enterpriseConfirm == 1">
-						<view class="an" style="color: #f44336" v-if="user.userType == 1" @click.stop="confirmOrder(item.id)">边民确认</view>
+					<view class="date">{{ item.createTime }}</view>
+					<template v-if="item.peopleConfirmStatus == 0">
+						<view class="an" style="color: #f44336"  @click.stop="confirmOrder(item.id)">边民确认</view>
+					</template>
+					<template v-if="item.peopleConfirmStatus == 1 && item.apply == 1 && item.resaleStatus == 0">
+						<view class="an" style="color: #f44336"  @click.stop="resale(item)">订单转售</view>
 					</template>
-					<template v-if="item.enterpriseConfirm == 0">
+					<!-- <template v-if="item.peopleConfirmStatus == 0">
 						<view class="an" style="color: #f44336" v-if="user.userType == 2" @click.stop="confirm(item.id)">取消订单</view>
 					</template>
-					<template v-if="item.enterpriseConfirm == 3 || item.enterpriseConfirm == 2">
+					<template v-if="item.finishStatus == 3">
 						<view class="an" style="color: #f44336" v-if="user.userType == 2" @click.stop="del(item.id)">删除订单</view>
-					</template>
+					</template> -->
 				</view>
 			</view>
 			<view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
@@ -56,29 +63,46 @@ export default {
 			tab: [
 				{
 					name: '全部',
-					enterpriseConfirm: '',
-					apply: ''
+					peopleConfirmStatus: '',	//边民确认状态
+					apply: '',					//订单申报状态
+					finishStatus: '',			//订单完成状态
+					resaleStatus: ''			//订单转售状态
 				},
 				{
 					name: '待确认',
-					enterpriseConfirm: 0,
-					apply: 0
-				}, //enterpriseConfirm:商户确认(0=待确认,1=是,2=否)
+					peopleConfirmStatus: 0,
+					apply: 0,
+					finishStatus: 0,
+					resaleStatus: 0
+				},
 				{
 					name: '申报中',
-					enterpriseConfirm: 1,
-					apply: 0
+					peopleConfirmStatus: 1,
+					apply: 0,
+					finishStatus: 0,
+					resaleStatus: 0
 				},
 				{
 					name: '已完成',
-					enterpriseConfirm: 2,
-					apply: 1
-				}, //apply:申报[0=待申报,1=申报通过,2=申报不通过]
+					peopleConfirmStatus: 1,
+					apply: 1,
+					finishStatus: 1,
+					resaleStatus: 0
+				},
+				{
+					name: '已转售',
+					peopleConfirmStatus: 1,
+					apply: 1,
+					finishStatus: 1,
+					resaleStatus: 1
+				}/* ,
 				{
 					name: '已取消',
-					enterpriseConfirm: 3,
-					apply: ''
-				}
+					peopleConfirmStatus: '',
+					apply: '',
+					finishStatus: 3,
+					resaleStatus: ''
+				} */
 			],
 			param: {
 				pageNo: 1,
@@ -104,24 +128,29 @@ export default {
 					if (res.data.data) {
 						this.list.push(...res.data.data);
 					}
-					this.list.map(item => {
+					/* this.list.map(item => {
 						if (item.cancelPeople == 1) {
 							item.enterpriseConfirm = 3;
 						}
-					});
+					}); */
 				}
 			});
 		},
 		// 点击tab切换
 		click(e) {
 			console.log(e);
-			this.param.orderStatus = e.enterpriseConfirm;
+			this.param.peopleConfirmStatus = e.appeopleConfirmStatusply;
 			this.param.apply = e.apply;
+			this.param.finishStatus = e.finishStatus;
+			this.param.resaleStatus = e.resaleStatus;
 			this.refresh();
 		},
 		detail(item) {
 			uni.navigateTo({url: '/pages/market/one/leader/detail?id=' + item.id});
 		},
+		resale(item) {
+			uni.navigateTo({url: '/pages/market/two/leader/resale?item=' + JSON.stringify(item)});
+		},
 		// 刷新数据
 		refresh() {
 			this.loadMore = true;

+ 148 - 0
pages/market/two/leader/resale.vue

@@ -0,0 +1,148 @@
+<template>
+	<view>
+		<view class="cmain">
+			<view class="box order_detail">
+				<view class="item">
+					<text class="label">商品名称</text>
+					<text class="desc omit">{{ item.goodsNames }}</text>
+				</view>
+				<view class="item">
+					<text class="label">订单编号</text>
+					<text class="desc omit">{{ item.tradeNo }}</text>
+				</view>
+				<view class="item">
+					<text class="label">商品重量</text>
+					<text class="desc">{{ item.totalWeight }}</text>
+				</view>
+				<view class="item">
+					<text class="label">商品单位</text>
+					<text class="desc">{{ item.goodsUnit }}</text>
+				</view>
+				<view class="item">
+					<text class="label">转售金额(必填)</text>
+					<text class="desc">
+						<input type="number" v-model="order.resalePrice" placeholder="请输入(元)" />
+					</text>
+				</view>
+			</view>
+			<u-divider text="费项明细"></u-divider>
+			<view class="box">
+				<u-collapse v-for="(item,index) in feeItemLIst" :key="index">
+					<u-collapse-item :title="item.name" class="cell_title" >
+						<view class="itm">1、收费企业:{{ item.companyName }}</view>
+						<view class="itm" v-if="item.feeType ==1">2、收费类型:按交易额收取</view>
+						<view class="itm" v-if="item.feeType ==2">2、收费类型:按次收取</view>
+						<view class="itm" v-if="item.feeType ==1">3、收费%(按交易额):<span style="color: coral;">{{ item.percent }} %</span></view>
+						<view class="itm" v-if="item.feeType ==1">4、当前订单收取金额:<span style="color: coral;">{{ (item.percent * order.resalePrice)/100}} 元</span></view>
+						<view class="itm" v-if="item.feeType ==2">3、收费金额(按次收):<span style="color: coral;">{{ item.feeMoney }} 元</span></view>
+						<view class="itm" v-if="item.feeType ==2">4、当前订单收取金额:<span style="color: coral;">{{ item.feeMoney }} 元</span></view>
+						</br>
+						<view class="itm">当前费项收取金额以最后结算时为准</view>
+					</u-collapse-item>
+					<!-- <u-collapse-item title="会员有什么用?" class="cell_title">
+						<view class="itm">1、普能会员:只浏览平台信息,不可下载平台上的相关附件。</view>
+						<view class="itm">2、专业会员:上传展示产品与服务内容、上传相关附件,后台审核方可在平台展示。可下载其他专业会员上传的附件。</view>
+						<view class="itm">3、专家会员:只有专家会员才能接受评测邀请。</view>
+					</u-collapse-item>
+					<u-collapse-item title="积分如何使用?" class="cell_title"><text class="coll">获得的积分可以去线下店铺使用享受折扣哦</text></u-collapse-item>
+					<u-collapse-item title="如何申请高级会员?" class="cell_title">
+						<view class="itm">1、普能会员:只浏览平台信息,不可下载平台上的相关附件。</view>
+						<view class="itm">2、专业会员:上传展示产品与服务内容、上传相关附件,后台审核方可在平台展示。可下载其他专业会员上传的附件。</view>
+						<view class="itm">3、专家会员:只有专家会员才能接受评测邀请。</view>
+					</u-collapse-item>
+					<u-collapse-item title="如何购买产品?" class="cell_title">
+						<text class="coll">目前无法在线购买产品,如你想购买某款产品,可以去线下的店购买</text>
+					</u-collapse-item> -->
+				</u-collapse>
+			</view>
+		</view>
+		<view class="mfooter" v-if="item.resaleStatus != 1">
+			<view class="flex">
+				<view class="f">
+					<button class="btn" @click="ok()">提交</button>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			user: this.getUser(),
+			item: {},
+			order: {
+				resalePrice: '',
+				levelOneOrderId: '',
+				goodsId: '',
+				goodsName: '',
+				goodsUnit: '',
+				tradeAreaId: '',
+				tradeAreaName: '',
+			},
+			feeItemLIst: []
+		};
+	},
+	onLoad(e) {
+		if (e.item) {
+			this.item = JSON.parse(e.item);
+			this.order.levelOneOrderId = this.item.id;
+			this.order.goodsId = this.item.goodsId;
+			this.order.goodsName = this.item.goodsNames;
+			this.order.goodsUnit = this.item.goodsUnit;
+			this.order.tradeAreaId = this.item.tradeAreaId;
+			this.order.tradeAreaName = this.item.tradeAreaName;
+		}
+		console.log("this.item",this.item)
+		this.getFeeItem();
+	},
+	methods: {
+		//费项明细
+		getFeeItem(){
+			this.http.request({
+				url: '/level-two-server/app/TbFeeItem/getList',
+				success: res => {
+					this.feeItemLIst = res.data.data
+				}
+			});
+		},
+		ok() {
+			let rule = [{ name: 'resalePrice', checkType: 'notnull', errorMsg: '请输入转售金额' }];
+			if (!this.verify.check(this.order, rule)) {
+				uni.showModal({ content: this.verify.error, showCancel: false });
+				return false;
+			}
+			uni.showModal({
+				title: '提示',
+				content: '我已核对转售信息',
+				success: res => {
+					if (res.confirm) {
+						this.http.request({
+							url: '/level-two-server/app/TbOrders/addOrderByResale',
+							method: 'POST',
+							data: this.order,
+							success: res => {
+								uni.showToast({title: '提交成功'});
+								this.item.resaleStatus = 1;
+							}
+						});
+					}
+				}
+			});
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+page {
+	background-color: $pg;
+}
+.item {
+	input{
+		margin-top: 0px!important;
+	}
+	}
+
+</style>

+ 9 - 9
pages/market/two/list.vue

@@ -16,13 +16,13 @@
 					<text class="icon">&#xe8f2;</text>
 				</view>
 			</view>
-			<view class="item" v-for="(item, index) in list" :key="index">
-				<view class="title" @click="detail(item)">{{ item.createName }}</view>
-				<image @click="detail(item)" src="../../../static/news.jpg" mode="aspectFill" class="pic"></image>
+			<view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
+				<view class="title" >{{ item.createName }}</view>
+				<image src="../../../static/news.jpg" mode="aspectFill" class="pic"></image>
 				<view class="con">
-					<view class="productName omit" @click="detail(item)">{{ item.goodsName }}</view>
-					<view class="desc" @click="detail(item)">数量:{{ item.goodsQuantity }}</view>
-					<view class="btn" v-if="user.userType == 2" @click="confirm(item)">立即接单</view>
+					<view class="productName omit">{{ item.goodsName }}</view>
+					<view class="price">¥ {{ item.resalePrice }}</view>
+					<view class="icon btn" v-if="user.userType == 3" @click.stop="buy(item)">购买</view>
 				</view>
 			</view>
 			<view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
@@ -72,7 +72,7 @@ export default {
 		},
 		getData() {
 			this.http.request({
-				url: '/level-two-server/app/TbGoodsDemand/getList',
+				url: '/level-two-server/app/TbOrders/getList',
 				data: this.param,
 				loading: 'false',
 				success: res => {
@@ -88,8 +88,8 @@ export default {
 		detail(item) {
 			uni.navigateTo({ url: '/pages/market/two/detail?id=' + item.id });
 		},
-		confirm(item) {
-			uni.navigateTo({ url: '/pages/market/two/leader/confirm?item=' + JSON.stringify(item) });
+		buy(item) {
+			uni.navigateTo({ url: '/pages/market/two/purchaser/buy/buy?item=' + JSON.stringify(item) });
 		},
 		//刷新数据
 		refresh() {

+ 107 - 0
pages/market/two/purchaser/buy/buy.vue

@@ -0,0 +1,107 @@
+<template>
+	<view>
+		<view class="cmain">
+			<view class="box" style="padding: 12px; margin-top: 0px">
+				<u-steps :current="0">
+					<u-steps-item title="接单确认"></u-steps-item>
+					<u-steps-item title="收购商确认"></u-steps-item>
+					<u-steps-item title="完成交易"></u-steps-item>
+				</u-steps>
+			</view>
+			<u-divider text="需求信息"></u-divider>
+			<view class="box order_detail">
+				<view class="item">
+					<text class="label">收购商品</text>
+					<text class="desc omit">{{ item.goodsName }}</text>
+				</view>
+				<view class="item">
+					<text class="label">商品编号</text>
+					<text class="desc">{{ item.goodsNo }}</text>
+				</view>
+				<view class="item">
+					<text class="label">计价单位</text>
+					<text class="desc">{{ item.goodsUnit }}</text>
+				</view>
+				<view class="item">
+					<text class="label">商品数量</text>
+					<text class="desc">{{ item.goodsQuantity }}</text>
+				</view>
+				<view class="item">
+					<text class="label">发布时间</text>
+					<text class="desc">{{ item.createTime }}</text>
+				</view>
+				<view class="item">
+					<text class="label">订单状态</text>
+					<text class="desc">待接单</text>
+				</view>
+				<view class="item">
+					<text class="label">接单人</text>
+					<text class="desc">{{ user.name }}</text>
+				</view>
+				<view class="item">
+					<text class="label">出价金额(必填)</text>
+					<text class="desc">
+						<input type="number" v-model="order.price" placeholder="请输入(元)" />
+					</text>
+				</view>
+			</view>
+		</view>
+		<view class="mfooter">
+			<view class="flex">
+				<view class="f">
+					<button class="btn" @click="pay()">确认接单</button>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			user: this.getUser(),
+			item: {},
+			order: {}
+		};
+	},
+	onLoad(e) {
+		if (e.item) {
+			this.item = JSON.parse(e.item);
+			this.order.purchaserId = this.item.purchaserId;
+			this.order.goodsDemandId = this.item.id;
+		}
+	},
+	methods: {
+		pay() {
+			let rule = [{ name: 'price', checkType: 'notnull', errorMsg: '请输入报价' }];
+			if (!this.verify.check(this.order, rule)) {
+				uni.showModal({ content: this.verify.error, showCancel: false });
+				return false;
+			}
+			uni.showModal({
+				title: '提示',
+				content: '我已核对接单信息无误',
+				success: res => {
+					if (res.confirm) {
+						this.http.request({
+							url: '/level-two-server/app/TbDemandQuotation/quotation',
+							method: 'POST',
+							data: this.order,
+							success: res => {
+								uni.navigateTo({ url: '/pages/market/two/leader/success' });
+							}
+						});
+					}
+				}
+			});
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+page {
+	background-color: $pg;
+}
+</style>