shish 2 лет назад
Родитель
Сommit
85b0fc717d

+ 4 - 0
ghsApp/src/api/purchase/index.js

@@ -1,5 +1,9 @@
 import https from "@/plugins/luch-request_0.0.7/request";
 
+export const batchConfirm = data => {
+	return https.post("/purchase/batch-confirm", data);
+};
+
 export const getLsRunningOrderNum = data => {
 	return https.post("/purchase-order/get-ls-running-order-num", data);
 };

+ 40 - 8
ghsApp/src/pagesGys/details.vue

@@ -13,6 +13,11 @@
 			</view>
 		</view>
 		<view scroll-y class="shop-list">
+			<view>
+				<button :class="[confirm == -1 ? 'blue' : 'default']" class="admin-button-com middle" @click="showOrderList(-1)">全部</button>
+				<button :class="[confirm == 0 ? 'blue' : 'default']" class="admin-button-com middle" style="margin-left:30upx;" @click="showOrderList(0)">待确认</button>
+				<button :class="[confirm == 1 ? 'blue' : 'default']" class="admin-button-com middle" style="margin-left:30upx;" @click="showOrderList(1)">已确认</button>
+			</view>
 			<block v-if="!$util.isEmpty(detailsList)">
 				<DetailsItem v-for="(item, index) in detailsList" :key="index" :info="item" :isEdit="true" :isCheck="item.checked" @click="checkItemEvent" ></DetailsItem>
 			</block>
@@ -27,13 +32,14 @@
 						<button class="admin-button-com blue middle" v-if="isAllCheck">全不选</button>
 						<button class="admin-button-com blue middle" v-else>全选</button>
 					</view>
-					已选 <text class="price">{{ selectList.length }}</text> 笔,
+					<text class="price">{{ selectList.length }}</text>笔,
 					<text class="unit">¥</text>
 					<text class="price">{{ parseFloat(selectTotalAmount) }}</text>
 				</view>
 			</template>
 			<view class="btn-view">
-				<button :class="['admin-button-com', 'blue']" @click="clearSelectedOrder" >结账</button>
+				<button class="admin-button-com default middle" @click="confirmOrder()">确认</button>
+				<button class="admin-button-com blue middle" @click="clearSelectedOrder">结账</button>
 			</view>
 		</view>
 
@@ -61,6 +67,7 @@
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
 import DetailsItem from "./detailsItem";
 import { getDebtList,clearOrderApi } from "@/api/gys/index";
+import { batchConfirm } from "@/api/purchase";
 import ModalModule from "@/components/plugin/modal";
 import DateSelect from "@/components/module/dateSelect";
 export default {
@@ -80,7 +87,8 @@ export default {
 			endTime:'',
 			payWayData:{name:"线下微信",id:0},
 			payWayList:[{name:"线下微信",id:0},{name:"现金",id:4},{name:"线下支付宝",id:1},{name:"银行卡",id:5}],
-			payWay:0
+			payWay:0,
+			confirm:-1
 		};
 	},
 	onPullDownRefresh() {
@@ -106,7 +114,6 @@ export default {
 					}
 				}
 			}
-			console.log(list)
 			return list;
 		},
 		selectTotalAmount() {
@@ -133,6 +140,10 @@ export default {
 		}
 	},
 	methods: {
+		showOrderList(status){
+			this.confirm = status
+			this.initData()
+		},
 		init(){
 
 		},
@@ -159,7 +170,7 @@ export default {
 		async initData() {
 			try {
 				this.listLoading = true;
-				const { data: { ghsInfo, num, totalAmount, list } } = await getDebtList({id:this.option.id,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime});
+				const { data: { ghsInfo, num, totalAmount, list } } = await getDebtList({id:this.option.id,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,confirm:this.confirm})
 				this.ghsInfo = ghsInfo;
 				this.totalAmount = totalAmount;
 				this.num = num;
@@ -200,6 +211,26 @@ export default {
 				}
 			}
 		},
+		confirmOrder(){
+			if (this.$util.isEmpty(this.selectList)) {
+				this.$msg("请选择订单");
+				return;
+			}
+			let ids = this.selectList.map(ele => {
+				return {id:ele.id};
+			});
+			let params = {
+				id:JSON.stringify(ids),
+				ghsId:this.ghsInfo.id
+			}
+			let that = this;
+			this.$util.confirmModal({content:'全部确认?'},() => {
+				batchConfirm(params).then(res=>{
+					that.initData()
+					that.$msg(res.msg)
+				})
+			})
+		},
 		confirmClear(val) {
 			if(val.index == 0){
 				this.showClearModel = false
@@ -227,6 +258,7 @@ export default {
 				uni.showLoading({mask:true})
 				clearOrderApi(params).then(ret=>{
 					uni.hideLoading()
+					that.showClearModel = false
 					if(ret.code == 1){
 						that.$msg('结账成功')
 						setTimeout(function(){
@@ -252,6 +284,7 @@ export default {
 		width:100%;
 		padding: 30upx;
 		background-color: #fff;
+		z-index:9999;
 		.top-row {
 			display: flex;
 			justify-content: space-between;
@@ -318,7 +351,6 @@ export default {
 				font-size: 30upx;
 			}
 			.unit {
-				margin: 0 3upx;
 				color: $redColor;
 				font-size: 30upx;
 			}
@@ -330,9 +362,9 @@ export default {
 				align-items:center;
 				justify-content:center;
 				margin:0 10upx;
-				width:200upx;
+				width:140upx;
 				height:84upx;
-				font-size: 32upx;
+				font-size:26upx;
 			}
 		}
 	}

+ 5 - 1
ghsApp/src/pagesGys/detailsItem.vue

@@ -6,7 +6,11 @@
 		</view>
 		<view class="details-main">
 			<view class="item-header">
-				<text class="name">{{info.orderSn}} </text>
+				<text class="name">
+					{{info.orderSn}}
+					<text v-if="info.confirm == 0" style="color:#524343;margin-left:20upx;font-weight:normal;">待确认</text>
+					<text v-else style="color:#3385FF;margin-left:20upx;font-weight:normal;">已确认</text>
+				</text>
 			</view>
 			<view class="item-row">
 				<view class="mark">{{ info.addTime.substr(2,14) }}