shish 3 vuotta sitten
vanhempi
commit
c7e17642bb

+ 3 - 4
ghsApp/src/admin/shop/selectShop.vue

@@ -81,18 +81,17 @@ export default {
       let style = this.option.style ? this.option.style : 1
       this.selectStyle = style
       if(style == 1){
-        //选择
         if(this.$util.isScanEnv()){
           this.$util.pageTo({url: '/pagesStorehouse/allot/addExDetails',type:2,query: {inShopId: item.id,inShopName:item.shopName}})
         }else{
           this.$util.pageTo({url: '/pagesStorehouse/allot/exSelect',type:2,query: {inShopId: item.id,inShopName:item.shopName}})
         }
       }else if(style == 2){
-        //用于返回的情况
         let pages = getCurrentPages();
         let prevPage = pages[ pages.length - 2 ];
-        prevPage.$vm.form.customId = item.id;
-        prevPage.$vm.form.customName = item.name;
+        prevPage.$vm.form.shopId = item.id;
+        prevPage.$vm.form.shopName = item.shopName;
+        prevPage.$vm.form.hasSelect = 1
         uni.navigateBack({})
       }
     },

+ 45 - 17
ghsApp/src/admin/stat/stock.vue

@@ -1,9 +1,12 @@
 <template>
 	<view class="app-content">
 		<view class="ex-page">
-			<view class="input-wrap_box">
-				<view>
-					<AppSearchModule placeholder="输入拼音首字母搜索" @input="searchFn"/>
+			<view class="input-wrap">
+				<view class="search-bar">
+					<app-search-module v-model="py" placeholder="输拼音首字母" @input="searchFn" />
+				</view>
+				<view style="padding:0 0upx 0 20upx;" >
+					<button class="admin-button-com middle blue" @click="allOutSelectShop()">全部出库</button>
 				</view>
 			</view>
 			<view class="top-bar" style="margin-left:115upx;">实时</view>
@@ -41,6 +44,7 @@
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
 import SelectList from "@/components/plugin/selectList";
 import { getProductDataApi } from "@/api/product/index";
+import { allOut } from "@/api/stock-out"
 import { list } from "@/mixins";
 import ShopSelect from "@/components/module/shopSelect";
 import DateSelect from "@/components/module/dateSelect";
@@ -67,24 +71,41 @@ export default {
 			storageData:[],
 			searchContent:'',
             shopId:0,
-            classItemData:[]
+            classItemData:[],
+			form:{shopId:0,shopName:'',hasSelect:0}
 		};
 	},
-	onLoad(e) {
-        this.shopId = this.getMyShopInfo.id;
-        let type = '';
-
-        let that = this
-        getProductDataApi({ type, shopId: this.shopId,status:0,requestType:'hasStock'}).then(res=>{
-            if(res.code == 1){
-                that.classItemData = res.data
-                console.log(that.classItemData)
-            }
-        })
-
+	onShow(){
+		let that = this
+		if(this.form.hasSelect == 1){
+			that.$util.confirmModal({content:'确认全部出库到'+this.form.shopName+'?'},() => {
+				that.form.hasSelect = 0
+				allOut({shopId:this.form.shopId}).then(res=>{
+					if(res.code == 1){
+						that.$msg(res.msg)
+						that.showStock()
+					}
+				})
+			})
+		}
+	},
+	onLoad() {
+		this.showStock()
 	},
 	methods: {
-		...mapActions(['setUserShopAll'])
+		allOutSelectShop(){
+			this.$util.pageTo({url: '/admin/shop/selectShop',query: {style:2}})
+		},
+		showStock(){
+			this.shopId = this.getMyShopInfo.id;
+			let type = '';
+			let that = this
+			getProductDataApi({ type, shopId: this.shopId,status:0,requestType:'hasStock'}).then(res=>{
+				if(res.code == 1){
+					that.classItemData = res.data
+				}
+			})
+		}
 	}
 };
 </script>
@@ -95,6 +116,13 @@ export default {
 	height: 100%;
 	display: flex;
 	flex-direction: column;
+	.input-wrap {
+		display: flex;
+		padding: 0upx 20upx 0upx 13upx;
+		.search-bar {
+			flex: 1;
+		}
+	}
 	.top-bar {
 		position: absolute;
 		left: 0;

+ 5 - 0
ghsApp/src/api/stock-out/index.js

@@ -0,0 +1,5 @@
+import https from '@/plugins/luch-request_0.0.7/request'
+
+export const allOut = data => {
+	return https.get('/stock-out/all-out', data)
+}

+ 1 - 1
ghsApp/src/pagesStorehouse/allot/exSelect.vue

@@ -6,7 +6,7 @@
 				<button class="admin-button-com middle blue" @click="selectFlowerNumFn()">选分类</button>
 			</view>
 			<view class="search-bar">
-				<app-search-module v-model="py" placeholder="输拼音首字母也可以搜" @input="searchFn" />
+				<app-search-module v-model="py" placeholder="输拼音首字母" @input="searchFn" />
 			</view>
 		</view>
 		<view class="scroll-middle_bx">