Przeglądaj źródła

提前录采购单

shish 3 lat temu
rodzic
commit
d28984bda4

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

@@ -1,5 +1,9 @@
 import https from "@/plugins/luch-request_0.0.7/request";
 
+export const confirmPutIn = data => {
+	return https.get("/purchase-order/confirm-put-in", data);
+};
+
 export const printAll = data => {
 	return https.get("/purchase-order/print-all", data);
 };

+ 29 - 24
ghsApp/src/pagesPurchase/components/pageSuccess.vue

@@ -5,31 +5,34 @@
 			<view class="result-view">
 				<view class="iconfont iconchenggong"></view>
 				<view class="result-title">采购成功</view>
-				<view style="margin-left:150upx;">
-					<view class="flex title">
-						确认销售价:
-					</view>
-					<view class="flex title">
-						<text style="font-size:30upx;font-weight:bold;color:red;">
-							红色为进货价,<text style="color:blue;">蓝色为成本价(含运费)</text>
-						</text>
-					</view>
-					<checkbox-group @change="checkboxChange">
-						<view v-for="(res,i) in flowersList" :key="i">
-							<view class="product-area">
-								<view class="first-area">
-									<text class="name">{{res.name}}</text>
-									<text class="cost">¥{{costList[res.id]?parseFloat(costList[res.id]):0}}</text>
-									<text class="cgPrice">¥{{res.cost?parseFloat(res.cost):0}}</text>
-									<input type="digit" v-model="res.autoPrice" placeholder="花店价" @focus="priceFocus(i,res)" @input="modifyPrice(i,res)" />
-									<input type="digit" v-model="res.autoSkPrice" placeholder="散客价" @focus="skPriceFocus(i,res)" @input="modifySkPrice(res)" />
+
+				<template v-if="status != 3">
+					<view style="margin-left:150upx;">
+						<view class="flex title">
+							确认销售价:
+						</view>
+						<view class="flex title">
+							<text style="font-size:30upx;font-weight:bold;color:red;">
+								红色为进货价,<text style="color:blue;">蓝色为成本价(含运费)</text>
+							</text>
+						</view>
+						<checkbox-group @change="checkboxChange">
+							<view v-for="(res,i) in flowersList" :key="i">
+								<view class="product-area">
+									<view class="first-area">
+										<text class="name">{{res.name}}</text>
+										<text class="cost">¥{{costList[res.id]?parseFloat(costList[res.id]):0}}</text>
+										<text class="cgPrice">¥{{res.cost?parseFloat(res.cost):0}}</text>
+										<input type="digit" v-model="res.autoPrice" placeholder="花店价" @focus="priceFocus(i,res)" @input="modifyPrice(i,res)" />
+										<input type="digit" v-model="res.autoSkPrice" placeholder="散客价" @focus="skPriceFocus(i,res)" @input="modifySkPrice(res)" />
+									</view>
 								</view>
 							</view>
-						</view>
-					</checkbox-group>
-				</view>
+						</checkbox-group>
+					</view>
+					<button class="admin-button-com big blue" style="width:40vh;margin-top:50upx;" @click="commitChange">确认修改</button>
+				</template>
 
-				<button class="admin-button-com big blue" style="width:40vh;margin-top:50upx;" @click="commitChange">确认修改</button>
 				<button class="admin-button-com big default" style="width:40vh;margin-top:30upx;" @click="goBackFn">返回首页</button>
 
 			</view>
@@ -45,14 +48,16 @@ export default {
 			flowersItemInfo:'',
 			flowersList:[],
 			productList:[],
-			costList:[]
+			costList:[],
+			status:0
 		};
 	},
 	onShow(){
   		this.flowersItemInfo  = uni.getStorageSync('flowersItemInfo');
 		this.getList();
 	},
-	onLoad(e){
+	onLoad(){
+		this.status = this.option.status ? Number(this.option.status) : 0
 	},
 	onUnload(){
 		uni.removeStorageSync('flowersItemInfo');

+ 23 - 22
ghsApp/src/pagesPurchase/details.vue

@@ -129,8 +129,8 @@
 					¥ <text class="large">{{ modifyPrice }}</text>
 				</text>
 			</view>
-			<button class="admin-button-com default big" @click="laterSubmit">稍后入库</button>
-			<button class="admin-button-com blue big" @click="formSubmit">提交入库</button>
+			<button class="admin-button-com default big" @click="formSubmit(0)">稍后入库</button>
+			<button class="admin-button-com blue big" @click="formSubmit(1)">提交入库</button>
 		</view>
 	</view>
 </view>
@@ -319,13 +319,28 @@ export default {
 			this.form.province = e.provinceName;
 			this.form.city = e.cityName;
 		},
-		formSubmitFun(){
+		formSubmit(inType) {
+			let rules = [ { name: "itemInfo", rule: ["minLength", 1], msg: ["请选择花材"] } ]
+			let formData = this.form;
+			formData.itemInfo = this.selectList;
+			let checkRes = form.validation(formData, rules);
+			if (!checkRes) {
+				this.formSubmitFun(inType);
+			} else {
+				this.$msg(checkRes);
+			}
+		},
+		formSubmitFun(inType){
 			let that = this;
-			that.$util.confirmModal({content:'确认提交?'},() => {
-				that.confirmFn();
+			let title = '确认直接入库?'
+			if(inType == 0){
+				title = '确认稍后入库?'
+			}
+			that.$util.confirmModal({content:title},() => {
+				that.confirmFn(inType);
 			})
 		},
-		confirmFn() {
+		confirmFn(inType) {
 			let that = this
 			const { orderSn } = this.option;
 			let formData = this.form;
@@ -344,30 +359,16 @@ export default {
 			})
 			formData.itemInfo = JSON.stringify(itemInfo)
 			uni.showLoading({mask:true})
-			let params = {...formData,modifyPrice:this.modifyPrice,cgModel:this.myShopInfo.cgModel,ghsId:this.option.ghsId}
+			let params = {...formData,modifyPrice:this.modifyPrice,cgModel:this.myShopInfo.cgModel,ghsId:this.option.ghsId,inType:inType}
 			createPurchaseOrderApi(params).then(res=>{
 				uni.hideLoading()
 				if(res.code == 1 && res.data.orderSn){
 					uni.setStorageSync('flowersItemInfo', itemInfo)
 					that.removeFromSaveDirect()
-					that.$util.pageTo({url: "/pagesPurchase/components/pageSuccess",type:2,query: {orderSn: res.data.orderSn,id:res.data.id}})
+					that.$util.pageTo({url: "/pagesPurchase/components/pageSuccess?orderSn="+res.data.orderSn+"&id="+res.data.id+"&status="+res.data.status,type:2})
 				}
 			})
 		},
-		laterSubmit(){
-			this.$msg('开发中')
-		},
-		formSubmit(e) {
-			let rules = [ { name: "itemInfo", rule: ["minLength", 1], msg: ["请选择花材"] } ]
-			let formData = this.form;
-			formData.itemInfo = this.selectList;
-			let checkRes = form.validation(formData, rules);
-			if (!checkRes) {
-				this.formSubmitFun();
-			} else {
-				this.$msg(checkRes);
-			}
-		},
 		goBackFn() {
 			this.pageTo({url: '/pagesPurchase/add?ghsId='+this.option.ghsId+'&ghsName='+this.option.ghsName,type:2})
 		}

+ 25 - 33
ghsApp/src/pagesPurchase/info.vue

@@ -17,7 +17,7 @@
 			<view class="bills-info_box content-box">
 				<view class="order-info_box">
 					<view>订单日期:</view>
-					<view>{{ detailInfo.addTime }}</view>
+					<view>{{ detailInfo.addTime?detailInfo.addTime.substr(5,11):'' }}</view>
 				</view>
 				<view class="order-info_box">
 					<view>订单编码:</view>
@@ -32,19 +32,11 @@
 				</view>
 				<view class="order-info_box">
 					<view>入库日期:</view>
-					<view>{{ detailInfo.entryTime }}</view>
+					<view>{{ detailInfo.entryTime?detailInfo.entryTime.substr(5,11):'' }}</view>
 				</view>
 				<view class="order-info_box">
 					<view>状态:</view>
-					<view>{{ 
-						detailInfo.status==1?'待付款'
-						:detailInfo.status==2?'待配送'
-						:detailInfo.status==3?'配送中'
-						:detailInfo.status==4?'已签收'
-						:detailInfo.status==5?'已入库'
-						:detailInfo.status==6?'已取消'
-						:'已退款'
-						 }}</view>
+					<view>{{ detailInfo.status==1?'待确认' :detailInfo.status==2?'待发货' :detailInfo.status==3?'待入库' :detailInfo.status==4?'已入库' :'已取消' }}</view>
 				</view>
 
 				<view v-if="detailInfo.refund == 2" class="order-info_box">
@@ -71,13 +63,13 @@
 					<view class="price" v-if="detailInfo.clearId > 0">
 					<button @click="pageTo({url: '/admin/clear/info',query: {id: detailInfo.clearId}})" class="admin-button-com">查看结账单</button>
 					</view>
-					<view v-if="detailInfo.clearId == 0">--</view>          
+					<view v-if="detailInfo.clearId == 0"></view>          
 				</view>
 			</view>
 
 			<view class="title">
 				商品信息 
-				<text @click="goRefund(detailInfo)" style="float:right;font-weight:normal;color:#3385FF;margin-right:20upx;">申请退款</text>
+				<text @click="goRefund(detailInfo)" v-if="detailInfo.status == 4" style="float:right;font-weight:normal;color:#3385FF;margin-right:20upx;">申请退款</text>
 				<text @click="printAllLabel(detailInfo)" style="float:right;font-weight:normal;color:#3385FF;margin-right:100upx;">打全部标签</text>
 			</view>
 			<view class="module-com content-box">
@@ -200,10 +192,15 @@
 			</view>
 
 		</view>
+
+		<view class="app-footer open_btn">
+			<view v-if="detailInfo.status == 3" @click="confirmIn()" class="admin-button-com big blue">确认入库</view>
+		</view>
+
 	</view>
 </template>
 <script>
-import { getPurchaseDetailApi,updateRemark,printAll,printItem } from "@/api/purchase";
+import { getPurchaseDetailApi,updateRemark,printAll,printItem,confirmPutIn } from "@/api/purchase";
 import productMins from "@/mixins/product";
 import TuiListCell from "@/components/plugin/list-cell";
 export default {
@@ -225,6 +222,20 @@ export default {
 		};
 	},
 	methods: {
+		confirmIn(){
+			let that = this
+			that.$util.confirmModal({content:'确认现在入库?'},() => {
+				uni.showLoading({mask:true})
+				confirmPutIn({id:that.detailInfo.id}).then(res=>{
+					uni.hideLoading()
+					if(res.code == 1){
+						if(res.data.status == 4){
+							that.$util.pageTo({url: "/pagesPurchase/components/pageSuccess?orderSn="+res.data.orderSn+"&id="+res.data.id+"&status="+res.data.status,type:2})
+						}
+					}
+				})
+			})
+		},
 		goRefund(info){
 			this.$util.pageTo({url:'/pagesPurchase/refund?orderSn='+info.orderSn})
 		},
@@ -476,23 +487,4 @@ export default {
 		}
 	}
 }
-.app-footer {
-	display: flex;
-	align-items: center;
-	justify-content: flex-end;
-	& .admin-button-com {
-		padding: 0;
-		margin-right: 15upx;
-		width: 140upx;
-		height: 70upx;
-		line-height: 70upx;
-		text-align: center;
-		color: #3385ff;
-		border: 1upx solid #3385ff;
-		&.active{
-			color: #666666;
-			border: 1upx solid #ccc;
-		}
-	}
-}
 </style>