shish 2 yıl önce
ebeveyn
işleme
dc0613b9cb

+ 41 - 2
ghsApp/src/admin/book/itemCustom.vue

@@ -83,8 +83,8 @@
 					<button class="admin-button-com big blue" style="width:420upx;" @click="loanStock()">借库存</button>
 				</view>
 				<view style="margin-top:6upx;">
-					<button class="admin-button-com big default" style="margin-right:20upx;width:200upx;" @click="">加库存</button>
-					<button class="admin-button-com big default" style="width:200upx;" @click="">减库存</button>
+					<button class="admin-button-com big default" style="margin-right:20upx;width:200upx;" @click="addStockBook()">加库存</button>
+					<button class="admin-button-com big default" style="width:200upx;" @click="delStockBook()">减库存</button>
 				</view>
 				<view style="margin-top:6upx;">
 					<button class="admin-button-com big default" style="width:420upx;" @click="getStockDetail()">库存明细</button>
@@ -105,6 +105,7 @@
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
 import SelectList from "@/components/plugin/selectList";
 import { getBookItemCustomList,goOnFn,toBoxFn,goOffFn,cancelBoxFn } from "@/api/book"
+import { bookAddStockFn,bookDelStockFn } from "@/api/inventory"
 import { list } from "@/mixins";
 import ShopSelect from "@/components/module/shopSelect";
 import DateSelect from "@/components/module/dateSelect";
@@ -167,6 +168,44 @@ export default {
 			this.$refs.actRef.close()
 			this.$util.pageTo({ url: "/admin/book/itemCustomBookCgChange?id="+this.currentItem.id+'&customId='+this.currentItem.customId+'&itemId='+this.currentItem.itemId+'&customName='+this.currentItem.customName+'&itemName='+this.currentItem.name})
 		},
+		delStockBook(){
+			let that = this
+			if(Number(this.currentNum)<=0){
+				this.$msg('请填写数量')
+				return false
+			}
+			this.$refs.actRef.close()
+			this.$util.confirmModal({content:'确认减少'+this.currentNum+'份'},() => {
+				bookDelStockFn({bookItemCustomId:this.currentItem.id,num:this.currentNum,itemId:this.currentItem.itemId}).then(res=>{
+					that.currentNum = ''
+					if(res.code == 1){
+						that.$msg('减少成功')
+						setTimeout(() => {
+							that.getStatList()
+						}, 1000)
+					}
+				})
+			})
+		},
+		addStockBook(){
+			let that = this
+			if(Number(this.currentNum)<=0){
+				this.$msg('请填写数量')
+				return false
+			}
+			this.$refs.actRef.close()
+			this.$util.confirmModal({content:'确认增加'+this.currentNum+'份'},() => {
+				bookAddStockFn({bookItemCustomId:this.currentItem.id,num:this.currentNum,itemId:this.currentItem.itemId}).then(res=>{
+					that.currentNum = ''
+					if(res.code == 1){
+						that.$msg('添加成功')
+						setTimeout(() => {
+							that.getStatList()
+						}, 1000)
+					}
+				})
+			})
+		},
 		loanStock(){
 			this.$refs.actRef.close()
 			this.$util.pageTo({ url: "/admin/item/loan?itemId="+this.currentItem.itemId+'&bookItemCustomId='+this.currentItem.id})

+ 0 - 16
ghsApp/src/admin/order/statBook.vue

@@ -146,7 +146,6 @@ export default {
 		};
 	},
 	onPullDownRefresh() {
-		this.resetList();
 		this.getStatList().then(res => {
 			uni.stopPullDownRefresh()
 		});
@@ -206,21 +205,6 @@ export default {
 		goAction(item){
 			this.currentItem = item
 			this.$refs.actRef.open('center')
-		},
-		onNum(){
-
-		},
-		outNum(){
-
-		},
-		toSj(){
-
-		},
-		toBox(){
-
-		},
-		cancelBox(){
-
 		},
 		cancelAct(){
 			this.$refs.actRef.close()

+ 8 - 0
ghsApp/src/api/inventory/index.js

@@ -1,5 +1,13 @@
 import https from "@/plugins/luch-request_0.0.7/request";
 
+export const bookDelStockFn = data => {
+	return https.get("/check-order/book-del-stock", data);
+};
+
+export const bookAddStockFn = data => {
+	return https.get("/check-order/book-add-stock", data);
+};
+
 export const loanFn = data => {
 	return https.get("/check-order/loan", data);
 };

+ 3 - 3
ghsApp/src/pages.json

@@ -466,7 +466,7 @@
 			"pages": [
 				{"path": "itemOrder","style": {"navigationBarTitleText": "订单列表"}},
 				{"path": "bookSet","style": {"navigationBarTitleText": "预订开关"}},
-				{"path": "statBook","style": {"navigationBarTitleText": "预订汇总"}},
+				{"path": "statBook","style": {"navigationBarTitleText": "预订汇总","enablePullDownRefresh": true}},
 				{"path": "statKhBook","style": {"navigationBarTitleText": "详情"}},
 				{"path": "freight","style": {"navigationBarTitleText": "运费设置"}}
 			]
@@ -483,9 +483,9 @@
 				{"path": "index","style": {"navigationBarTitleText": "城市批发教程"}},
 				{"path": "jdIndex","style": {"navigationBarTitleText": "基地和昆明批发教程"}},
 				{"path": "detail","style": {"navigationBarTitleText": ""}},
-				{"path": "itemCustom","style": {"navigationBarTitleText": "明细"}},
+				{"path": "itemCustom","style": {"navigationBarTitleText": "明细","enablePullDownRefresh": true}},
 				{"path": "itemCustomDetail","style": {"navigationBarTitleText": "供货信息"}},
-				{"path": "custom","style": {"navigationBarTitleText": "预订客户"}},
+				{"path": "custom","style": {"navigationBarTitleText": "预订客户","enablePullDownRefresh": true}},
 				{"path": "globalBookChange","style": {"navigationBarTitleText": "变动"}},
 				{"path": "globalBookCgChange","style": {"navigationBarTitleText": "变动"}},
 				{"path": "globalBookOnChange","style": {"navigationBarTitleText": "变动"}},