Browse Source

修改支付运费

web100 2 years ago
parent
commit
cc041a68bd

+ 11 - 0
api/tabBar/shoppingCart.js

@@ -46,4 +46,15 @@ export function payPrepay(params) {
 		method: 'GET',
 		params
 	})
+}
+///api/blade-sales-part/order/update
+//删除
+export function update(ids) {
+	return http.request({
+		url: '/blade-sales-part/order/remove',
+		method: 'POST',
+		params:{
+			ids:ids
+		}
+	})
 }

+ 23 - 9
pages/tabBar/shoppingCart.vue

@@ -286,12 +286,22 @@ import { registerRuntimeCompiler } from "vue"
 					this.dataList[index].list[ind].goodsNum = val.value
 				}
 				let data = []
+				// for (let item of this.companyValue) {
+				// 	for (let ite of this.dataList) {
+				// 		if (item == ite.name) {
+				// 			for (let it of ite.list) {
+				// 				data.push(it)
+				// 			}
+				// 		}
+				// 	}
+				// }、
 				for (let item of this.companyValue) {
 					for (let ite of this.dataList) {
 						if (item == ite.name) {
-							for (let it of ite.list) {
-								data.push(it)
-							}
+							data.push({
+								name: item,
+								list: ite.list
+							})
 						}
 					}
 				}
@@ -299,17 +309,21 @@ import { registerRuntimeCompiler } from "vue"
 				this.totalFreight = 0
 				let num = 0
 				for (let item of data) {
-					this.totalPrice += Number(item.price) * Number(item.goodsNum)
-					num += Number(item.goodsNum)
-					if (Number(item.goodsNum) == 1) {
+					let num1 = 0
+					for (let items of item.list) {
+						this.totalPrice += Number(items.price) * Number(items.goodsNum)
+						num += Number(items.goodsNum)
+						num1 += Number(items.goodsNum)
+					}
+					if (num1 == 1) {
 						this.totalFreight += 5
 					}
 
 				}
-				console.log('num',num);
-				if(num>1){
+			
+				/* if(num>1){
 					this.totalFreight = 0
-				}
+				} */
 				this.totalFreight = this.totalFreight.toFixed(2)
 				this.totalPrice = this.totalPrice.toFixed(2)
 				this.selectedProduct = data

+ 23 - 9
pages/views/salesSlip/obligation.vue

@@ -1,5 +1,18 @@
 <template>
 	<view>
+		<view style="background-color: #fff;padding: 20rpx;border-radius: 20rpx;">
+			<view>
+<!-- 				<view>
+					<view style="display: flex;width: 580rpx;" v-if="!editDel" @click="clickAddress">
+						<u-icon name="map"></u-icon>
+						<u--text :text="addres.belongtoarea + addres.detailedAddress" size="28rpx" lines="1"></u--text>
+					</view>
+				</view> -->
+				<view style="display: flex;justify-content: flex-end;">
+					<view @click="editDel = !editDel">{{editDel?'取消':'编辑'}}</view>
+				</view>
+			</view>
+		</view>
 		<u-checkbox-group v-model="companyValue" placement="column" @change="companyChange">
 			<view class="collection" v-for="(item,index) in dataList" :key="index">
 				<view>
@@ -25,7 +38,7 @@
 					</view>
 					<view v-if="editDel">
 						<u-icon name="minus-circle-fill" color="#ff0000" size="52rpx"
-							@click="deleteGoods(ites.id)"></u-icon>
+							@click="deleteGoods(ite.id)"></u-icon>
 					</view>
 				</view>
 			</view>
@@ -56,7 +69,8 @@
 		generateOrder,
 		payPrepay,
 		shoppingCartUpdate,
-		getCorpsAddr
+		getCorpsAddr,
+		update
 	} from '@/api/tabBar/shoppingCart.js'
 import { registerRuntimeCompiler } from "vue"
 import { logo } from '../../../common/setting'
@@ -113,13 +127,13 @@ import { logo } from '../../../common/setting'
 		},
 		methods: {
 			deleteGoods(val) {
+				console.log(val);
+				
 				uni.showLoading({
 					title: '加载中',
 					mask: true
 				});
-				shoppingCartUpdate({
-					ids: val
-				}).then(res => {
+				update(val).then(res => {
 					uni.showToast({
 						title: "删除成功",
 						icon: 'none'
@@ -152,14 +166,14 @@ import { logo } from '../../../common/setting'
 							}
 						}
 					}
-				}
+				};
+				
+				console.log(data.join(","));
 				uni.showLoading({
 					title: '加载中',
 					mask: true
 				});
-				shoppingCartUpdate({
-					ids: data.join(',')
-				}).then(res => {
+				update(data.join(",")).then(res => {
 					uni.showToast({
 						title: "删除成功",
 						icon: 'none'

+ 42 - 44
pages/views/salesSlip/orderDetails.vue

@@ -34,7 +34,7 @@
 				</u-cell-group>
 				<view class="textBox">
 					<view>订单编号:</view>
-					<view>{{form.ordNo}}</view>
+					<view>{{form.srcOrdNo}}</view>
 				</view>
 				<view class="textBox">
 					<view>下单时间:</view>
@@ -42,7 +42,7 @@
 				</view>
 				<view class="textBox">
 					<view>商品金额:</view>
-					<view>{{form.totalMoney}}</view>
+					<view>{{form.salesAmount}}</view>
 				</view>
 			</view>
 		</view>
@@ -93,11 +93,11 @@
 				</view> -->
 				<view class="textBox">
 					<view>本次付款:</view>
-					<view>{{form.salesAmount}}</view>
+					<view>{{form.totalMoney}}</view>
 				</view>
 			</view>
 		</view>
-		<view style="height: 160rpx;"></view>
+		<view style="height: 160rpx;"></view> 
 		<view v-if="isDisabled"
 			style="width: 100%;position: fixed;bottom: 0;background-color: #fff;border-top: 1rpx solid #ccc;padding-bottom: env(safe-area-inset-bottom);z-index: 10;">
 			<view style="width: 100%;display: flex;font-size: 24rpx;height: 80rpx;">
@@ -169,18 +169,19 @@
 				console.log(234324324);
 				this.form = res.data
 				console.log(this.form);
-				if (this.form.status == '已发货') {
+				if (this.form.status == '已发货' ) {
 					_this.isDisabled = true;
 					_this.order = "确认收货";
 				} else if (this.form.status == '录入' || this.form.status == '退款中' || this.form.status == '已取消' ||
-					this.form.status == '退款请核' || this.form.status == '已收货' || this.form.status == '待发货' || this
-					.form.status == '待确认') {
+					this.form.status == '退款请核' ||  this.form.status == '待发货' || this.form.status == '待确认') {
 					_this.order = "申请退款";
 					_this.isDisabled = true;
 				} else {
 					_this.isDisabled = false;
 				}
-
+				if(this.form.status == '退款请核'){
+					_this.isDisabled = false
+				}
 				uni.hideLoading();
 			}).catch(err => {
 				uni.hideLoading();
@@ -202,7 +203,7 @@
 								title: '退款中',
 								mask: true
 							});
-
+							
 							checkOrder({
 								id: _this.form.id,
 								pageLabel: "销售订单",
@@ -237,41 +238,38 @@
 				console.log(123);
 				if (this.order == "申请退款") {
 					this.requestRefund()
-				}
-				// if (this.order == "申请退款") {
-				// 	uni.showLoading({
-				// 		title: '退款中',
-				// 		mask: true
-				// 	});
-				// 	checkOrder({
-				// 		id: this.form.id,
-				// 		pageLabel: "销售订单",
-				// 		pageStatus: "this.$store.getters.domSaleStatus",
-				// 		url: "/tirePartsMall/salesManagement/saleOrder/index",
-				// 	}).then(res => {
-				// 		uni.showToast({
-				// 			icon: "none",
-				// 			title: '提交申请成功',
-				// 			mask: true
-				// 		});
-				// 		let _this = this
-				// 		setTimeout(function() {
-				// 			// appDetail({
-				// 			// 	id: res.data.id
-				// 			// }).then(res => {
-				// 			// 	this.form = res.data
-				// 			// 	console.log(this.form);
-				// 			// }).catch(err => {
-				// 			// 	uni.hideLoading();
-				// 			// })
-				// 			if (res.code == 200) {
-				// 				_this.isDisabled = false
-				// 			}
-				// 			uni.hideLoading();
-				// 		}, 1000);
-				// 	})
-				// } 
-				else {
+					// uni.showLoading({
+					// 	title: '退款中',
+					// 	mask: true
+					// });
+					// checkOrder({
+					// 	id: this.form.id,
+					// 	pageLabel: "销售订单",
+					// 	pageStatus: "this.$store.getters.domSaleStatus",
+					// 	url: "/tirePartsMall/salesManagement/saleOrder/index",
+					// }).then(res => {
+					// 	uni.showToast({
+					// 		icon: "none",
+					// 		title: '提交申请成功',
+					// 		mask: true
+					// 	});
+					// 	let _this = this
+					// 	setTimeout(function() {
+					// 		// appDetail({
+					// 		// 	id: res.data.id
+					// 		// }).then(res => {
+					// 		// 	this.form = res.data
+					// 		// 	console.log(this.form);
+					// 		// }).catch(err => {
+					// 		// 	uni.hideLoading();
+					// 		// })
+					// 		if (res.code == 200) {
+					// 			_this.isDisabled = false
+					// 		}
+					// 		uni.hideLoading();
+					// 	}, 1000);
+					// })
+				} else {
 					//确认收货
 					let this_ = this
 					uni.showModal({