Browse Source

下单优化

shish 1 year ago
parent
commit
f86210b975
1 changed files with 27 additions and 4 deletions
  1. 27 4
      hdApp/src/admin/billing/affirmGhs.vue

+ 27 - 4
hdApp/src/admin/billing/affirmGhs.vue

@@ -247,9 +247,20 @@
 				<text class="price-title">合计</text>
 				<text class="price-number">¥<text class="large">{{ modifyPrice}}</text></text>
 			</view>
-			<button class="admin-button-com blue big" @click="affirmFormSubmit">提交</button>
+			<button class="admin-button-com blue big" @click="affirmFormSubmit(0)">提交</button>
 		</view>
 
+		<uni-popup ref="selectFlowerNumRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
+			<view style="font-size:30upx;margin:30upx 0 10upx 30upx;width:80vw;font-weight:bold;">以下库存不足,是否要提交?</view>
+			<view v-if="!$util.isEmpty(lackList)" style="display:flex;padding:10upx 20upx 20upx 30upx;height:auto;justify-content: space-between;align-items:center;flex-wrap:wrap;max-height:80vh;overflow:auto;width:80vw;font-size:30upx;">
+				<view v-for="(item, index) in lackList" :key="index" style="width:100%;margin-top:10upx;">{{ item.name }} 剩{{item.stock}}个</view>
+			</view>
+			<view style="width:80vw;margin:20upx 0 20upx 0;display:flex;align-items: center; justify-content: center;">
+				<button class="admin-button-com big blue" style="width:260upx;" @click="closeRemind()">取消</button>
+				<button class="admin-button-com big blue" style="width:260upx;" @click="affirmFormSubmit(1)">提交</button>
+			</view>
+		</uni-popup>
+
 	</view>
 </template>
 
@@ -342,7 +353,8 @@ export default {
 			wlList:[],
 			wlSelData: {id:0,name:''},
 			needAddPackCost:false,
-			transCost:[]
+			transCost:[],
+			lackList:[]
 		};
 	},
 	onLoad() {
@@ -421,6 +433,10 @@ export default {
 			this.form.wlId = this.wlSelData.id
 			this.form.wlName = this.wlSelData.name
 		},
+		closeRemind(){
+			this.$refs.selectFlowerNumRef.close()
+			this.lackList = []
+		},
 		changeTransType(num){
 			let that = this
 			this.form.transType = num
@@ -717,7 +733,7 @@ export default {
 				uni.redirectTo({ url: url })
 			});
 		},
-		affirmFormSubmit(){
+		affirmFormSubmit(direct){
 			const product = this.selectList.map(ele => {
 				return { productId: ele.id, bigNum: ele.bigCount, smallNum: ele.smallCount,classId:ele.classId,itemId:ele.itemId,weight:ele.weight };
 			})
@@ -749,7 +765,9 @@ export default {
 				hbId: this.form.hbId,
 				wlName:this.form.wlName,
 				xj:JSON.stringify(xj),
-				itemTotalAmount:itemTotalAmount
+				itemTotalAmount:itemTotalAmount,
+				version:10,
+				direct:direct
 			}
 			let self = this;
 			self.$util.confirmModal({content:'确认提交?'},() => {
@@ -757,6 +775,11 @@ export default {
 				createOrder(params).then(res => {
 					if(res.code == 1){
 						uni.hideLoading()
+						if(res.data.hasLackError && res.data.hasLackError == 1){
+							this.lackList = res.data.lackList ? res.data.lackList : []
+							this.$refs.selectFlowerNumRef.open('center')
+							return true
+						}
 						const {orderSn,realPrice,id} = res.data
 						self.pageTo({url: '/pagesPurchase/wechatPay',query:{orderSn,realPrice,id}, type: 2})
 						setTimeout(() => {