shish hace 3 años
padre
commit
854313647e

+ 1 - 1
ghsApp/src/admin/item/list.vue

@@ -280,7 +280,7 @@ export default {
 			})
 			})
 		},
 		},
 		sendStock(){
 		sendStock(){
-			this.pageTo({url: '/admin/item/sendStock?id='+this.currentInfo.id+'&price='+this.currentInfo.price+'&stock='+this.currentInfo.stock,type:2})
+			this.pageTo({url: '/admin/item/sendStock?id='+this.currentInfo.id+'&price='+this.currentInfo.price+'&stock='+this.currentInfo.stock+'&name='+this.currentInfo.name,type:2})
 		},
 		},
 		downloadImg(){
 		downloadImg(){
 			let that = this
 			let that = this

+ 6 - 3
ghsApp/src/admin/item/sendStock.vue

@@ -52,7 +52,7 @@
 	import { mapGetters } from "vuex";
 	import { mapGetters } from "vuex";
 	import { getSonList,delMsItem } from "@/api/item"
 	import { getSonList,delMsItem } from "@/api/item"
 	import { batchChangePrice } from '@/api/product'
 	import { batchChangePrice } from '@/api/product'
-	import { checkOrderApi } from "@/api/inventory";
+	import { sendItemStock } from "@/api/inventory";
 	export default {
 	export default {
 		name: "sendStock",
 		name: "sendStock",
 		components: {
 		components: {
@@ -176,7 +176,10 @@
 					this.$msg('请填写数量和价格')
 					this.$msg('请填写数量和价格')
 					return false
 					return false
 				}
 				}
-	
+				if(this.remain<0){
+					this.$msg('超过库存总数量')
+					return false
+				}
 				this.$util.confirmModal({content:'确认分配?'},() => {
 				this.$util.confirmModal({content:'确认分配?'},() => {
 					uni.showLoading({mask:true})
 					uni.showLoading({mask:true})
 					let jsonPriceList = JSON.stringify(priceList);
 					let jsonPriceList = JSON.stringify(priceList);
@@ -185,7 +188,7 @@
 
 
 							let jsonStock = JSON.stringify(stockList);
 							let jsonStock = JSON.stringify(stockList);
 							let name = this.option.name ? this.option.name : ''
 							let name = this.option.name ? this.option.name : ''
-							checkOrderApi({changeType:'add',pdType:'',itemInfo:jsonStock,remark:name+'分配增加库存'}).then(res => {
+							sendItemStock({pdType:'',itemInfo:jsonStock,remark:name+'分配增加库存'}).then(res => {
 								if(res.code == 1){
 								if(res.code == 1){
 									this.$msg(res.msg)
 									this.$msg(res.msg)
 									setTimeout(function(){
 									setTimeout(function(){

+ 4 - 3
ghsApp/src/api/inventory/index.js

@@ -7,9 +7,10 @@ export const getCheckOrderListApi = data => {
 	return https.get("/check-order/list", data);
 	return https.get("/check-order/list", data);
 };
 };
 
 
-/** *
- * 编辑草稿 ,保存入库
- */
+export const sendItemStock = async data => {
+	return https.post("/check-order/send-stock", data);
+};
+
 export const updateCheckOrderApi = async data => {
 export const updateCheckOrderApi = async data => {
 	return https.post("/check-order/update-order", data);
 	return https.post("/check-order/update-order", data);
 };
 };