shish 3 years ago
parent
commit
0f47c7ce8d

+ 3 - 3
ghsApp/src/pages.json

@@ -328,7 +328,7 @@
 				{ "path": "wcOrder", "style": { "navigationBarTitleText": "外采", "enablePullDownRefresh": true } },
        			{ "path": "supplier", "style": { "navigationBarTitleText": "供货商", "enablePullDownRefresh": true } },
 				{ "path": "jdSupplier", "style": { "navigationBarTitleText": "供货商", "enablePullDownRefresh": true } },
-				{ "path": "localSupplier", "style": { "navigationBarTitleText": "外采供货商", "enablePullDownRefresh": true } },
+				{ "path": "localSupplier", "style": { "navigationBarTitleText": "附近供货商", "enablePullDownRefresh": true } },
         		{ "path": "suppAdd", "style": { "navigationBarTitleText": "添加供货商", "enablePullDownRefresh": true } },
 				{ "path": "info", "style": { "navigationBarTitleText": "订单详情", "enablePullDownRefresh": true } },
 				{ "path": "refundList", "style": { "navigationBarTitleText": "记录", "enablePullDownRefresh": true } },
@@ -349,8 +349,8 @@
 		{
 			"root": "pagesGys",
 			"pages": [
-				{ "path": "list", "style": { "navigationBarTitleText": "待结订单", "enablePullDownRefresh": true } },
-				{ "path": "details", "style": { "navigationBarTitleText": "待结订单", "enablePullDownRefresh": true } }
+				{ "path": "list", "style": { "navigationBarTitleText": "赊账单", "enablePullDownRefresh": true } },
+				{ "path": "details", "style": { "navigationBarTitleText": "赊账单", "enablePullDownRefresh": true } }
 			]
 		},
 		{

+ 2 - 1
ghsApp/src/pagesPurchase/add.vue

@@ -166,7 +166,8 @@ export default {
 				this.$msg('请选择花材')
 				return false
 			}
-			this.$util.pageTo({url:'/pagesPurchase/details?ghsId='+this.option.ghsId+'&ghsName='+this.option.ghsName,type:2})
+			let location = this.option.location ? this.option.location : 0
+			this.$util.pageTo({url:'/pagesPurchase/details?ghsId='+this.option.ghsId+'&ghsName='+this.option.ghsName+'&location='+location,type:2})
 		}
 	}
 };

+ 16 - 4
ghsApp/src/pagesPurchase/details.vue

@@ -126,7 +126,8 @@
 					¥ <text class="large">{{ modifyPrice }}</text>
 				</text>
 			</view>
-			<button class="admin-button-com blue big" @click="formSubmit(0)">下一步</button>
+			<button v-if="location == 0" class="admin-button-com blue big" @click="formSubmit(0)">下一步</button>
+			<button v-else class="admin-button-com blue big" @click="formSubmit(1)">保存入库</button>
 		</view>
 	</view>
 </view>
@@ -173,12 +174,16 @@ export default {
 			modifyPrice:0,
 			totalFreight:0,
 			perKgFreight:0,
+			location:0
 		};
 	},
 	onLoad() {
 		if(this.myShopInfo.cgModel == 1){
 			this.form.avgKgWeight = this.myShopInfo.cgPerCost
 		}
+		if(this.option.location){
+			this.location = this.option.location
+		}
 		this.initData();
 	},
 	onShow(){
@@ -328,7 +333,7 @@ export default {
 		},
 		formSubmitFun(inType){
 			let that = this;
-			let title = '确认直接入库?'
+			let title = '确认入库?'
 			if(inType == 0){
 				title = '确认提交?'
 			}
@@ -358,9 +363,16 @@ export default {
 			let params = {...formData,modifyPrice:this.modifyPrice,cgModel:this.myShopInfo.cgModel,ghsId:this.option.ghsId,inType:inType}
 			createPurchaseOrderApi(params).then(res=>{
 				uni.hideLoading()
+				that.removeFromSaveDirect()
 				if(res.code == 1 && res.data.orderSn){
-					that.removeFromSaveDirect()
-					that.$util.pageTo({url: "/pagesPurchase/components/pageSuccess?orderSn="+res.data.orderSn+"&id="+res.data.id+"&status="+res.data.status,type:2})
+					if(that.location == 0){
+						that.$util.pageTo({url: "/pagesPurchase/components/pageSuccess?orderSn="+res.data.orderSn+"&id="+res.data.id+"&status="+res.data.status,type:2})
+					}else{
+						that.$msg('入库成功')
+						setTimeout(function(){
+							uni.navigateBack({})
+						},1300)
+					}
 				}
 			})
 		},

+ 1 - 2
ghsApp/src/pagesPurchase/jdSupplier.vue

@@ -96,8 +96,7 @@ export default {
       this.pageTo({url: '/pagesGys/details?id='+item.id})
 		},
     goToCg (item) {
-      this.pageTo({url: '/pagesPurchase/add?ghsId='+item.id+'&ghsName='+item.name,type:2})
-      //this.pageTo({url: '/pagesPurchase/bookProduct?ghsId='+item.id+'&ghsName='+item.name,type:2})
+      this.pageTo({url: '/pagesPurchase/add?ghsId='+item.id+'&ghsName='+item.name+'&location='+item.location,type:2})
     }
   }
 }

+ 2 - 3
ghsApp/src/pagesPurchase/localSupplier.vue

@@ -22,7 +22,7 @@
             <view class="store_btn">
               <view class="btn_entrance" @click.stop="pageTo({ url: '/admin/clear/list?ghsId'+item.id})"> 结账记录 </view>
               <view class="btn_entrance" @click.stop="getDebtList()"> 欠款变动明细 </view>
-              <view class="btn_entrance" @click.stop="pageTo({url:'/pagesPurchase/order?ghsId='+item.id})">采购记录</view>
+              <view class="btn_entrance" @click.stop="pageTo({url:'/pagesPurchase/wcOrder?ghsId='+item.id})">采购记录</view>
               <view class="cg-button">采购</view>
             </view>
 
@@ -96,8 +96,7 @@ export default {
       this.pageTo({url: '/pagesGys/details?id='+item.id})
 		},
     goToCg (item) {
-      this.pageTo({url: '/pagesPurchase/add?ghsId='+item.id+'&ghsName='+item.name,type:2})
-      //this.pageTo({url: '/pagesPurchase/bookProduct?ghsId='+item.id+'&ghsName='+item.name,type:2})
+      this.pageTo({url: '/pagesPurchase/add?ghsId='+item.id+'&ghsName='+item.name+'&location='+item.location,type:2})
     }
   }
 }

+ 9 - 3
ghsApp/src/pagesPurchase/supplier.vue

@@ -25,7 +25,7 @@
             <view class="store_btn">
               <view class="btn_entrance" @click.stop="pageTo({ url: '/admin/clear/list?ghsId'+item.id})"> 结账记录 </view>
               <view class="btn_entrance" @click.stop="getDebtList()"> 欠款变动明细 </view>
-              <view class="btn_entrance" @click.stop="pageTo({url:'/pagesPurchase/order?ghsId='+item.id})">采购记录</view>
+              <view class="btn_entrance" @click.stop="cgList(item)">采购记录</view>
               <view class="cg-button">采购</view>
             </view>
 
@@ -92,6 +92,13 @@ export default {
     }) 
   },
   methods: {
+    cgList(item){
+      if(item.location && item.location == 1){
+        this.pageTo({url:'/pagesPurchase/wcOrder?ghsId='+item.id})
+      }else{
+        this.pageTo({url:'/pagesPurchase/order?ghsId='+item.id})
+      }
+    },
 		changeTabEvent(info) {
 			const { index } = info;
 			if (this.tabIndex == index) {
@@ -125,8 +132,7 @@ export default {
       this.pageTo({url: '/pagesGys/details?id='+item.id})
 		},
     goToCg (item) {
-      this.pageTo({url: '/pagesPurchase/add?ghsId='+item.id+'&ghsName='+item.name,type:2})
-      //this.pageTo({url: '/pagesPurchase/bookProduct?ghsId='+item.id+'&ghsName='+item.name,type:2})
+      this.pageTo({url: '/pagesPurchase/add?ghsId='+item.id+'&ghsName='+item.name+'&location='+item.location,type:2})
     }
   }
 }