shish 1 年間 前
コミット
5590eca308

+ 1 - 3
ghsApp/src/admin/shop/myShop.vue

@@ -12,9 +12,7 @@
 						<t-tr v-for="(item, inIndex) in shopData.list" :key="inIndex">
 							<t-td>
 								<view style="color:black;font-size:30upx;">
-								{{item.merchantName}}
-								<text v-if="item.shopName == '首店'"></text>
-								<text v-else style="margin-left:10upx;">{{item.shopName}}</text>
+									<text style="margin-left:10upx;">{{item.shopName}}</text>
 								</view>
 							</t-td>
 							<t-td><button class="admin-button-com middle blue" style="margin-left:30upx;" @click="selectShopFn(item.id)">进入此店</button></t-td>

+ 6 - 1
ghsApp/src/api/storehouse/stock.js

@@ -1,7 +1,12 @@
 import https from "@/plugins/luch-request_0.0.7/request";
 
+
+export const getStockInFullInfo = data => {
+	return https.get("/stock-in/get-full-info", data);
+};
+
 export const oneKeyStockOut = data => {
-	return https.get("/stock-out/one-key-stock-out", data);
+	return https.post("/stock-out/one-key-stock-out", data);
 };
 
 export const stockOutPrint = data => {

+ 1 - 0
ghsApp/src/pages.json

@@ -332,6 +332,7 @@
 				{ "path": "allotEx", "style": { "navigationBarTitleText": "调拨出库", "enablePullDownRefresh": true } },
 				{ "path": "exSelect", "style": { "navigationBarTitleText": "选择商品", "enablePullDownRefresh": true } },
 				{ "path": "putDetails", "style": { "navigationBarTitleText": "详情" } },
+				{ "path": "modifyDetails", "style": { "navigationBarTitleText": "修改数量" } },
 				{ "path": "allotPut", "style": { "navigationBarTitleText": "调拨入库", "enablePullDownRefresh": true } },
 				{ "path": "inSelect", "style": { "navigationBarTitleText": "请选择入库单", "enablePullDownRefresh": true } }
 			]

+ 2 - 1
ghsApp/src/pagesStorehouse/allot/addExDetails.vue

@@ -183,7 +183,8 @@ export default {
 				return {
 					productId: ele.id,
 					bigNum: ele.bigCount,
-					smallNum: ele.smallCount
+					smallNum: ele.smallCount,
+          name:ele.name,
 				};
 			});
 			formData.itemInfo = JSON.stringify(itemInfo);

+ 270 - 0
ghsApp/src/pagesStorehouse/allot/modifyDetails.vue

@@ -0,0 +1,270 @@
+<template>
+		<view class="ex-page">
+		<view class="main-view overscroll">
+			<view class="space-view ex-table">
+				<block v-if="!$util.isEmpty(inStockList)">
+					<t-table :headerBackgroundColor="'#F0F2F6'">
+						<t-tr header>
+							<t-th align="center">名称</t-th>
+							<t-th align="center">入库数</t-th>
+							<t-th align="center">实调</t-th>
+							<t-th align="center">变化</t-th>
+							<t-th align="center">实时库存</t-th>
+						</t-tr>
+						<t-tr v-for="(item, index) in inStockList" :key="index">
+							<t-td>
+								<text style="color:black;">{{ item.itemName }}</text>
+							</t-td>
+							<t-td>
+								<text style="color:black;"> {{ item.itemNum }}</text>
+							</t-td>
+							<t-td>
+								<input v-model="item.actPutNum" @focus="clearItem(item)" @input="modifyImte(item)" type="number" style="height:50upx;border:1upx solid black;color:black;font-size:28upx;" />
+							</t-td>
+							<t-td>
+								<text style="color:black;">{{ item.changeNum }}</text>
+							</t-td>
+							<t-td>
+								<text style="color:green;"> {{ item.currentStock }}</text>
+							</t-td>
+						</t-tr>
+					</t-table>
+				</block>
+				<block v-else>
+					<AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(inStockList)" />
+				</block>
+			</view>
+		</view>
+		<view class="bar-view">
+			<view class="btn-view">
+				<button class="admin-button-com middle" @click="goBack()" v-if="stockInfo.status == 2"> 返回 </button>
+				<button class="admin-button-com middle blue" @click="putOut()" v-if="stockInfo.status == 2"> 一键出库到 </button>
+				<button class="admin-button-com middle blue" @click="pitchShop(0,'',inStockList)" v-if="stockInfo.status == 2"> 一键回调 </button>
+			</view>
+		</view>
+
+		<uni-popup ref="selectFlowerNumRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
+			<view style="font-size:30upx;font-weight:bold;margin:35upx 0 25upx 15upx;">请选择门店:</view>
+			<view style="display:flex;padding:20upx;height:auto;justify-content:space-around;align-items:center;flex-wrap:wrap;max-height:100vh;overflow:auto;">
+				<button v-for="(item, index) in list.data" :key="index" v-if="Number(currentShopId)!=Number(item.id)" class="admin-button-com middle" @tap.stop="pitchShop(item.id,item.shopName,inStockList)">{{item.shopName}}</button>
+			</view>
+			<view style="height:160upx;"> </view>
+		</uni-popup>
+
+	</view>
+</template>
+<script>
+import { PUT_STATUS } from "@/utils/declare";
+import { getList } from "@/api/shop";
+import { getStockInFullInfo, confirmOrderApi,cancelOrder,oneKeyStockOut } from "@/api/storehouse/stock";
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import { mapGetters } from "vuex";
+import { list } from "@/mixins";
+export default {
+	components: { AppWrapperEmpty },
+	data() {
+		return {
+			PUT_STATUS,
+			orderSn: "",
+			stockInfo:{},
+			inStockList:{},
+			currentShopId:0
+		};
+	},
+	mixins: [list],
+	onLoad(options) {
+		const { orderSn } = options;
+		if (orderSn) {
+			this.orderSn = orderSn;
+			this.initData();
+		}
+		this.currentShopId = this.getMyShopInfo.id
+	},
+	computed: {
+		...mapGetters(["getMyShopInfo"]),
+	},
+	methods: {
+		modifyImte(item){
+			item.changeNum = item.actPutNum - item.itemNum
+			item.changeNum = Number(item.changeNum)>0 ? '+'+item.changeNum : item.changeNum
+		},
+		clearItem(item){
+			item.actPutNum = ''
+			this.$forceUpdate()
+		},
+		pitchShop(inShopId,inShopName,inStockList){
+			let that = this
+			let content = '确认出库到'+inShopName+'?'
+			if(inShopId == 0){
+				content = '确认一键回调?'
+			}
+			this.$refs.selectFlowerNumRef.close()
+			const changeList = inStockList.map(ele => { 
+				return { productId: ele.productId, actPutNum:ele.actPutNum,itemName:ele.itemName}
+			})
+			this.$util.confirmModal({content:content},() => {
+				oneKeyStockOut({inShopId:inShopId,orderSn:this.stockInfo.orderSn,changeList:JSON.stringify(changeList)}).then(res=>{
+					if(res.code == 1){
+						that.$msg(res.msg)
+						setTimeout(() => {
+							uni.navigateBack()	
+						}, 1500)
+					}
+				})
+			})
+		},
+		init(){
+			this.getShopList()
+		},
+		getShopList() {
+			return getList({
+				search: "",
+				type:this.tabIndex,
+				page: this.list.page,
+				pageSize: 100,
+			}).then((res) => {
+				if (this.$util.isEmpty(res.data)){
+					return false;
+				}
+				this.completes(res);
+			});
+		},
+		goBack(){
+			uni.navigateBack({delta:1})
+		},
+		putOut(){
+			this.$refs.selectFlowerNumRef.open('bottom')
+		},
+		async initData() {
+			const { data } = await getStockInFullInfo({orderSn:this.orderSn})
+			this.inStockList = data.list?data.list:[]
+			this.stockInfo = data.info?data.info:{}
+		},
+		getItemStatusName(status) {
+			let name = "";
+			switch (status) {
+				case PUT_STATUS.CONFIRM:
+					name = "待收货";
+					break;
+				case PUT_STATUS.DONE:
+					name = "已入库";
+					break;
+				case PUT_STATUS.CANCEL:
+					name = "已取消";
+					break;
+
+				default:
+					break;
+			}
+			return name;
+		},
+		confirmPutEvent(){
+			let that = this;
+			that.$util.confirmModal({content:'确认入库?'},() => {
+				that.putEvent();
+			})
+		},
+		async putEvent() {
+			uni.showLoading({mask:true})
+			await confirmOrderApi(this.orderSn)
+			uni.hideLoading()
+			await this.initData();
+			wx.showToast({ title: "入库成功" })
+		},
+		cancelPutEvent(){
+			let that = this;
+			that.$util.confirmModal({content:'确定取消?'},() => {
+				that.cancelEvent();
+			})
+		},
+		async cancelEvent(){
+			await cancelOrder(this.orderSn)
+			await this.initData()
+			wx.showToast({ title: "已取消" })
+		}
+	}
+};
+</script>
+<style lang="scss" scoped>
+.ex-page {
+	height: 100%;
+	display: flex;
+	flex-direction: column;
+	.main-view {
+		flex: 1;
+		background-color: #f9fbfc;
+		.space-view {
+			margin-top: 15upx;
+			background-color: #fff;
+		}
+		.ex-info {
+			padding: 30upx;
+			.info-cell {
+				display: flex;
+				align-items: center;
+				font-size: 28upx;
+				&:not(:first-child) {
+					margin-top: 20upx;
+				}
+				.cell-label {
+					width: 110upx;
+					color: #666666;
+				}
+				.cell-value {
+					margin-left: 40upx;
+					color: #333;
+					&.warning {
+						color: #ffaf1d;
+					}
+					&.success {
+						color: #27c325;
+					}
+				}
+			}
+		}
+		.ex-table {
+			::v-deep.list-icon {
+				display: flex;
+				.icon-image {
+					width: 80upx;
+					height: 80upx;
+					margin-right: 20upx;
+				}
+				.icon-info {
+					display: flex;
+					flex-direction: column;
+					justify-content: space-around;
+					.info-name {
+						font-size: 28upx;
+						font-weight: bold;
+						color: #333333;
+					}
+					.info-type {
+						font-size: 24upx;
+						color: #666666;
+					}
+				}
+			}
+		}
+	}
+	.bar-view {
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		padding: 0 30upx;
+		width: 100%;
+		height: 100upx;
+		box-shadow: 0upx -1upx 6upx 0upx rgba(4, 0, 0, 0.06);
+		.btn-view {
+			display: flex;
+			justify-content: space-around;
+			align-items: center;
+			width:100%;
+		}
+	}
+	.info-view {
+		font-size:29upx;
+		margin-left:30upx;
+	}
+}
+</style>

+ 56 - 25
ghsApp/src/pagesStorehouse/allot/putDetails.vue

@@ -36,6 +36,11 @@
 					</view>
 				</view>
 			</view>
+			<view class="info-view">
+				数量:{{ sumCount }}
+				<text style="margin-left:30upx;">成本价:¥{{inStockData.price?parseFloat(inStockData.price):0}}</text>
+				<text style="margin-left:30upx;color:red;" v-if="inStockData.callbackTime>0">一键回调过{{inStockData.callbackTime}}次</text>
+			</view>
 			<view class="space-view ex-table">
 				<block v-if="!$util.isEmpty(inStockData.itemInfo)">
 					<t-table :headerBackgroundColor="'#F0F2F6'">
@@ -46,25 +51,25 @@
 						</t-tr>
 						<t-tr v-for="(item, index) in inStockData.itemInfo" :key="index">
 							<t-td v-for="(column, colIndex) in columns" :key="colIndex" :align="column.align" :color="column.color" >
-								<view v-if="column.custom == 'icon'" class="list-icon" @click.stop="pageTo({url:'/admin/item/detail',query:{id: item.productId}})">
+								<view v-if="column.custom == 'icon'" style="color:black;" class="list-icon" @click.stop="pageTo({url:'/admin/item/detail',query:{id: item.productId}})">
 									<view class="icon-info">
 										<view class="info-name">
 											{{ item.itemName }}
 										</view>
 									</view>
 								</view>
-								<view v-else-if="column.custom == 'stock'">
+								<view v-else-if="column.custom == 'stock'" style="color:black;">
 									<text v-if="Number(item.bigNumStock)>0">{{ item.bigNumStock }}扎</text>
 									<text v-if="Number(item.smallNumStock)>0">{{ item.smallNumStock }}支</text>
 								</view>
-								<view v-else-if="column.custom == 'put'">
+								<view v-else-if="column.custom == 'put'" style="color:black;">
 									<text v-if="Number(item.bigNum)>0"> {{ item.bigNum }}扎</text>
 									<text v-if="Number(item.smallNum)>0">{{ item.smallNum }}支</text>
 								</view>
-								<view v-else-if="column.custom == 'itemPrice'">
+								<view v-else-if="column.custom == 'itemPrice'" style="color:black;">
 									<text> ¥{{ item.itemPrice?parseFloat(item.itemPrice):0 }}</text>
 								</view>
-								<view v-else>
+								<view v-else style="color:black;">
 									{{ item[column.dataIndex] || "" }}
 								</view>
 							</t-td>
@@ -77,18 +82,21 @@
 			</view>
 		</view>
 		<view class="bar-view">
-			<view class="info-view">数量:{{ sumCount }}&nbsp;&nbsp;&nbsp;成本价:¥{{inStockData.price?parseFloat(inStockData.price):0}}</view>
 			<view class="btn-view">
-				<button class="admin-button-com middle" @click="putOut()"> 全部出库 </button>
-				<button class="admin-button-com middle" @click="cancelPutEvent" v-if="inStockData.status == 1"> 取消入库 </button>
-				<button class="admin-button-com middle" @click="confirmPutEvent" v-if="inStockData.status == 1"> 确认入库 </button>
+				<button class="admin-button-com middle" @click="goBack()" v-if="inStockData.status == 2"> 返回 </button>
+				<button class="admin-button-com middle blue" @click="putOut()" v-if="inStockData.status == 2"> 一键出库到 </button>
+				<button class="admin-button-com middle blue" @click="pitchShop(0,'',inStockData)" v-if="inStockData.status == 2"> 一键回调 </button>
+				<button class="admin-button-com middle blue" @click="modifyPut()" v-if="inStockData.status == 2"> 修改数量 </button>
+				<button class="admin-button-com middle blue" @click="cancelPutEvent" v-if="inStockData.status == 1"> 取消入库 </button>
+				<button class="admin-button-com middle blue" @click="confirmPutEvent" v-if="inStockData.status == 1"> 确认入库 </button>
 			</view>
 		</view>
 		<uni-popup ref="selectFlowerNumRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
-			<view style="font-size:30upx;font-weight:bold;margin:20upx 0 15upx 15upx;">请选择门店:</view>
-			<view style="display:flex;padding:20upx;height:auto;justify-content: space-between;align-items:center;flex-wrap:wrap;max-height:100vh;overflow:auto;">
-				<button v-for="(item, index) in list.data" class="admin-button-com middle" @tap.stop="pitchShop(item,inStockData)">{{item.shopName}}</button>
+			<view style="font-size:30upx;font-weight:bold;margin:35upx 0 25upx 15upx;">请选择门店:</view>
+			<view style="display:flex;padding:20upx;height:auto;justify-content:space-around;align-items:center;flex-wrap:wrap;max-height:100vh;overflow:auto;">
+				<button v-for="(item, index) in list.data" v-if="Number(currentShopId)!=Number(item.id)" class="admin-button-com middle" @tap.stop="pitchShop(item.id,item.shopName,inStockData)">{{item.shopName}}</button>
 			</view>
+			<view style="height:160upx;"> </view>
 		</uni-popup>
 	</view>
 </template>
@@ -97,6 +105,7 @@ import { PUT_STATUS } from "@/utils/declare";
 import { getList } from "@/api/shop";
 import { getStockInDetailApi, confirmOrderApi,cancelOrder,oneKeyStockOut } from "@/api/storehouse/stock";
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import { mapGetters } from "vuex";
 import { list } from "@/mixins";
 export default {
 	components: { AppWrapperEmpty },
@@ -109,8 +118,9 @@ export default {
 				{ name: "名称", custom: "icon" },
 				{ name: "库存", custom: "stock", width: 120, align: "center" },
 				{ name: "入库数", custom: "put", width: 120, align: "center" },
-				{ name: "成本", custom: "itemPrice", width: 120, align: "center" },
-			]
+				{ name: "单扎成本", custom: "itemPrice", width: 120, align: "center" },
+			],
+			currentShopId:0
 		};
 	},
 	mixins: [list],
@@ -120,8 +130,14 @@ export default {
 			this.orderSn = orderSn;
 			this.initData();
 		}
+		this.currentShopId = this.getMyShopInfo.id;
+		console.log(this.currentShopId)
+	},
+	onShow(){
+
 	},
 	computed: {
+		...mapGetters(["getMyShopInfo"]),
 		sumCount() {
 			let big = 0;
 			let small = 0;
@@ -148,11 +164,21 @@ export default {
 		}
 	},
 	methods: {
-		pitchShop(info,inStockData){
+		goBack(){
+			uni.navigateBack({delta:1})
+		},
+		modifyPut(){
+			this.$util.pageTo({url: "/pagesStorehouse/allot/modifyDetails?orderSn="+this.orderSn})
+		},
+		pitchShop(inShopId,inShopName,inStockData){
 			let that = this
+			let content = '确认出库到'+inShopName+'?'
+			if(inShopId == 0){
+				content = '确认一键回调?'
+			}
 			this.$refs.selectFlowerNumRef.close()
-			this.$util.confirmModal({content:'确认出库到'+info.shopName+'?'},() => {
-				oneKeyStockOut({inShopId:info.id,orderSn:inStockData.orderSn}).then(res=>{
+			this.$util.confirmModal({content:content},() => {
+				oneKeyStockOut({inShopId:inShopId,orderSn:inStockData.orderSn}).then(res=>{
 					if(res.code == 1){
 						that.$msg(res.msg)
 						setTimeout(() => {
@@ -177,9 +203,12 @@ export default {
 				}
 				this.completes(res);
 			});
+		},
+		cancelPutIn(){
+
 		},
 		putOut(){
-			this.$refs.selectFlowerNumRef.open('top')
+			this.$refs.selectFlowerNumRef.open('bottom')
 		},
 		async initData() {
 			try {
@@ -301,17 +330,19 @@ export default {
 		padding: 0 30upx;
 		width: 100%;
 		height: 100upx;
-
 		box-shadow: 0upx -1upx 6upx 0upx rgba(4, 0, 0, 0.06);
-		.info-view {
-			font-size: 26upx;
-		}
 		.btn-view {
 			display: flex;
-			.admin-button-com {
-				margin: 0 10upx;
-			}
+			justify-content: space-around;
+			align-items: center;
+			width:100%;
 		}
 	}
+	.info-view {
+		font-size:29upx;
+		margin-left:30upx;
+		padding-top:20upx;
+		padding-bottom:10upx;
+	}
 }
 </style>