Quellcode durchsuchen

入库单盘点

shish vor 3 Jahren
Ursprung
Commit
9ed0079582

+ 5 - 0
ghsApp/src/api/storehouse/stock.js

@@ -1,5 +1,10 @@
 import https from "@/plugins/luch-request_0.0.7/request";
 
+//将盘点单生成需要盘点的花材
+export const createStockInPdItem = data => {
+	return https.post("/stock-in/create-pd-item", data);
+};
+
 export const clearOutOrder = data => {
 	return https.get("/stock-out/clear", data);
 };

+ 2 - 1
ghsApp/src/pages.json

@@ -274,7 +274,8 @@
 				{ "path": "allotEx", "style": { "navigationBarTitleText": "调拨出库", "enablePullDownRefresh": true } },
 				{ "path": "exSelect", "style": { "navigationBarTitleText": "选择商品", "enablePullDownRefresh": true } },
 				{ "path": "putDetails", "style": { "navigationBarTitleText": "详情" } },
-				{ "path": "allotPut", "style": { "navigationBarTitleText": "调拨入库", "enablePullDownRefresh": true } }
+				{ "path": "allotPut", "style": { "navigationBarTitleText": "调拨入库", "enablePullDownRefresh": true } },
+				{ "path": "inSelect", "style": { "navigationBarTitleText": "入库盘点", "enablePullDownRefresh": true } }
 			]
 		},
 		{

+ 332 - 0
ghsApp/src/pagesStorehouse/allot/inSelect.vue

@@ -0,0 +1,332 @@
+<template>
+<view class="app-content">
+	<view class="order-page">
+		<view class="top-view">
+			<view class="top-row">
+				<view class="info-item">
+				</view>
+				<DateSelect class="bar" top="0" @selectDateFn="selectDateFn" defaultShowName='时间' />
+			</view>
+		</view>
+		<view class="shop-list">
+			<block v-if="!$util.isEmpty(inOrderList)">
+				<inItemData v-for="(item, index) in inOrderList" :key="index" :info="item" :isEdit="true" :isCheck="item.checked" @click="checkItemEvent" ></inItemData>
+			</block>
+			<block v-else>
+				<AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(inOrderList)" />
+			</block>
+		</view>
+		<view :class="device == 'ios' ? 'ios-bar-view':'android-bar-view'">
+			<template>
+				<view class="info-view">
+					<view class="details-select" @click="checkAll()" >
+						<button class="admin-button-com blue middle" v-if="isAllCheck">全不选</button>
+						<button class="admin-button-com blue middle" v-else>全选</button>
+					</view>
+					已选 <text class="price">{{ selectList.length }}</text>笔
+				</view>
+			</template>
+			<view class="btn-view">
+				<button :class="['admin-button-com', 'blue']" @click="confirmData">提交盘点</button>
+			</view>
+		</view>
+	</view>
+</view>
+</template>
+<script>
+import AppWrapperEmpty from "@/components/app-wrapper-empty"
+import inItemData from "./inSelectItem"
+import { getStockInListApi,createStockInPdItem } from "@/api/storehouse/stock"
+import DateSelect from "@/components/module/dateSelect"
+import ModalModule from "@/components/plugin/modal"
+import { list } from "@/mixins"
+import { mapGetters} from "vuex";
+export default {
+	components: { AppWrapperEmpty, ModalModule,inItemData,DateSelect },
+	mixins: [list],
+	data() {
+		return {
+			inOrderList: [],
+			listLoading: false,
+			isAllCheck: false,
+			isModel: false,
+			payWayindex:0,
+			payWay:0,
+			searchTime:'',
+			startTime:'',
+			endTime:'',
+			device:'android'
+		};
+	},
+	onPullDownRefresh() {
+		this.initData().then(res => {
+			uni.stopPullDownRefresh();
+		});
+	},
+	onReachBottom() {
+		if (!this.list.finished) {
+			this.initData().then(res => {
+				uni.stopPullDownRefresh();
+			});
+		} else {
+			uni.stopPullDownRefresh();
+		}
+	},
+	onLoad(){
+		this.initData().then(res => {
+			uni.stopPullDownRefresh();
+		});
+		this.device = uni.getSystemInfoSync().platform
+	},
+	computed: {
+		...mapGetters(["getLoginInfo"]),
+		selectList() {
+			let list = [];
+			if (this.inOrderList) {
+				for (const item of this.inOrderList) {
+					if (item.checked) {
+						list.push(item);
+					}
+				}
+			}
+			return list;
+		}
+	},
+	watch: {
+		selectList () {
+            if (this.selectList.length === this.inOrderList.length) {
+                this.isAllCheck = true
+            } else {
+                this.isAllCheck = false
+            }
+		}
+	},
+	methods: {
+		selectDateFn(val){
+			this.searchTime = val.searchTime
+			this.startTime = val.startTime
+			this.endTime = val.endTime
+			this.initData().then(res => {
+				uni.stopPullDownRefresh()
+			})
+		},
+		async initData() {
+            const {data: { list,moreData }} = await getStockInListApi({status:'',page: this.list.page})
+			if (moreData == 0) {
+				this.list.finished = true
+			} else {
+				++this.list.page
+			}
+            this.inOrderList = list.map(ele => {
+                return {...ele,checked: false}
+            })
+		},
+		checkAll() {
+			this.isAllCheck = !this.isAllCheck
+			if (this.isAllCheck) {
+				this.inOrderList.map(ele => { ele.checked = true })
+			} else {
+				this.inOrderList.map(ele => { ele.checked = false })
+			}
+		},
+		checkItemEvent(item) {
+			for (let index = 0; index < this.inOrderList.length; index++) {
+				const element = this.inOrderList[index].id;
+				if (element == item.id) {
+					this.$set(this.inOrderList, index, {...this.inOrderList[index],checked: !this.inOrderList[index].checked})
+					break;
+				}
+			}
+		},
+		confirmData() {
+			if (this.$util.isEmpty(this.selectList)){
+				this.$msg('请选择入库单')
+				return false
+			}
+			let ids = this.selectList.map(ele => {
+				return {id:ele.id};
+			});
+			let that = this
+			uni.showLoading({mask:true})
+			createStockInPdItem({ids:JSON.stringify(ids)}).then(res=>{
+				uni.hideLoading()
+				if(res.code == 1){
+					that.$util.pageTo({ url: '/pagesStorehouse/inventory/select?pdType=stockInPd&shopId='+this.getLoginInfo.shopId})
+				}
+			})
+		}
+	}
+};
+</script>
+<style lang="scss" scoped>
+.order-page {
+	height: 100%;
+	display: flex;
+	flex-direction: column;
+	background-color: #f9fbfc;
+	overflow: scroll;
+	.top-view {
+		padding: 30upx;
+		position:fixed;
+		width:100%;
+		background-color: #fff;
+		.top-row {
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			&:not(:last-child) {
+				margin-bottom: 10upx;
+			}
+			.header-item {
+				font-size: 24upx;
+				font-weight: 400;
+				color: #999999;
+			}
+			.info-item {
+				display: flex;
+				align-items: center;
+				.logo {
+					margin-right: 10upx;
+					width: 32upx;
+					height: 32upx;
+					border-radius: 50%;
+				}
+				.name {
+					font-size: 28upx;
+					font-weight: 600;
+					color: #333333;
+				}
+			}
+			.price-item {
+				font-size: 34upx;
+				font-weight: 600;
+				color: #333333;
+			}
+		}
+	}
+	.shop-list {
+		margin-top:98upx;
+		padding: 20upx 30upx;
+		flex: 1;
+		padding-bottom: 190upx;
+	}
+	.ios-bar-view {
+		bottom: 0;
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		padding: 0 30upx;
+		width: 100%;
+		height: 100upx;
+		background: #fff;
+		box-shadow: 0upx -1upx 6upx 0upx rgba(4, 0, 0, 0.06);
+		.info-view {
+			display: flex;
+			align-items: center;
+			color: #333;
+			font-size: 24upx;
+			.iconfont {
+				font-size: 32upx;
+				color: #dddddd;
+			}
+			.price {
+				margin: 0 3upx;
+				color: $redColor;
+				font-size: 30upx;
+			}
+			.unit {
+				margin: 0 3upx;
+				color: $redColor;
+				font-size: 30upx;
+			}
+		}
+		.btn-view {
+			display: flex;
+			.admin-button-com {
+				display: flex;
+				align-items: center;
+				justify-content: center;
+				margin: 0 6upx;
+				width: 200upx;
+				height: 70upx;
+				font-size: 30upx;
+			}
+		}
+	}
+	.android-bar-view {
+		position: fixed;
+		bottom: 0;
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		padding: 0 30upx;
+		width: 100%;
+		height: 100upx;
+		background: #fff;
+		box-shadow: 0upx -1upx 6upx 0upx rgba(4, 0, 0, 0.06);
+		.info-view {
+			display: flex;
+			align-items: center;
+			color: #333;
+			font-size: 24upx;
+			.iconfont {
+				font-size: 32upx;
+				color: #dddddd;
+			}
+			.price {
+				margin: 0 3upx;
+				color: $redColor;
+				font-size: 30upx;
+			}
+			.unit {
+				margin: 0 3upx;
+				color: $redColor;
+				font-size: 30upx;
+			}
+		}
+		.btn-view {
+			display: flex;
+			.admin-button-com {
+				display: flex;
+				align-items: center;
+				justify-content: center;
+				margin: 0 6upx;
+				width: 200upx;
+				height: 70upx;
+				font-size: 30upx;
+			}
+		}
+	}
+  .details-select {
+    margin-right: 20upx;
+    display: inline-block;
+    .iconweixuanzhong,
+    .iconxuanzhong {
+      font-size: 40upx !important;
+    }
+    .iconxuanzhong {
+      color: $mainColor !important;
+    }
+  }
+	.select-cmd_bx {
+		.num_bx {
+			margin-top:30upx;
+			margin-bottom:50upx;
+			margin-left:80upx;
+			view{
+				height: 80upx;
+				font-size: 28upx;
+			}
+			input {
+				height: 70upx;
+				border: 1upx solid #dddddd;
+				border-radius: 4upx;
+				text-align: left;
+				margin-right: 24upx;
+				font-size: 35upx;
+				width:300upx;
+			}
+		}
+	}
+}
+</style>

+ 112 - 0
ghsApp/src/pagesStorehouse/allot/inSelectItem.vue

@@ -0,0 +1,112 @@
+<template>
+	<view class="details-item" @click.stop="checkEvent">
+		<view class="details-select" v-if="isEdit">
+			<text class="iconfont iconxuanzhong" v-if="isCheck"> </text>
+			<text class="iconfont iconweixuanzhong" v-else> </text>
+		</view>
+		<view class="details-main">
+			<view class="item-header">
+				<text class="name">编号 {{info.orderSn}} </text>
+			</view>
+			<view class="item-row">
+				<view class="mark">{{ info.addTime.substr(5,11) }}</view>
+			</view>
+			<view class="item-row">
+				<view class="mark">{{ info.status == 1 ?'待入库': info.status == 2 ?'已入库':'已取消'}}</view>
+			</view>
+			<view class="item-row">
+				<view class="price">¥{{ parseFloat(info.price) }}</view>
+				<view class="price" style="border:1upx solid #67a0f7;border-radius:10upx;font-weight:normal;color:#3385FF;font-size:32upx;width:180upx;height:80upx;justify-content:center;" @click.stop="goToDetai(info)">查看明细</view>
+			</view>
+		</view>
+	</view>
+</template>
+<script>
+export default {
+	props: {
+		info: {
+			required: true
+		},
+		isEdit: {
+			type: Boolean,
+			default: false
+		},
+		isCheck: {
+			type: Boolean,
+			default: false
+		}
+	},
+	methods: {
+		checkEvent() {
+			if (this.isEdit) {
+				this.$emit("click", this.info);
+			}
+		},
+		goToDetai(item){
+			this.$util.pageTo({url: "/pagesStorehouse/allot/putDetails?orderSn="+item.orderSn})
+		}
+	}
+};
+</script>
+<style lang="scss" scoped>
+.details-item {
+	display: flex;
+	align-items: center;
+	padding: 30upx 20upx;
+	margin-bottom: 20upx;
+	background-color: #fff;
+	border-radius: 10upx;
+	.details-select {
+		margin-right: 30upx;
+		.iconfont {
+			font-size: 40upx;
+			color: #dddddd;
+		}
+		.iconxuanzhong {
+			color: $mainColor;
+		}
+	}
+	.details-main {
+		flex: 1;
+	}
+	.item-header {
+		display: flex;
+		align-items: center;
+		.logo {
+			margin-right: 20upx;
+			width: 50upx;
+			height: 50upx;
+			border-radius: 50%;
+		}
+		.name {
+			font-size: 28upx;
+			font-family: PingFang SC;
+			font-weight: 600;
+			color: #333333;
+		}
+	}
+	.item-row {
+		margin-top: 20upx;
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+
+		.mark {
+			font-size: 28upx;
+			font-weight: 400;
+			color: #666666;
+		}
+		.price {
+			display: flex;
+			align-items: center;
+			font-size: 28upx;
+			font-weight: 600;
+			color: #333333;
+			.iconfont {
+				font-size: 28upx;
+				color: #999999;
+			}
+		}
+	}
+}
+</style>

+ 5 - 1
ghsApp/src/pagesStorehouse/allot/putDetails.vue

@@ -12,9 +12,13 @@
 					<view class="cell-value"> {{ putData.updateTime?putData.updateTime.substr(5,11):'' }}</view>
 				</view>
 				<view class="info-cell">
-					<view class="cell-label"> 制单人</view>
+					<view class="cell-label"> 操作</view>
 					<view class="cell-value"> {{ putData.adminName || "" }}</view>
 				</view>
+				<view class="info-cell">
+					<view class="cell-label"> 编号</view>
+					<view class="cell-value"> {{ putData.orderSn }}</view>
+				</view>
 				<view class="info-cell" v-if="putData.debt == 1">
 					<view class="cell-label"> 结算</view>
 					<view class="cell-value"> <text style="color:red;">欠款</text></view>

+ 2 - 2
ghsApp/src/pagesStorehouse/inventory/list.vue

@@ -23,7 +23,7 @@
 		</view>
 		<div class="app-footer open_btn">
 			<div @click="getAllItem()" class="admin-button-com big default" style="margin-right:32upx;">全部花材下载</div>
-			<div @click="stockInAddEvent" class="admin-button-com big blue" style="margin-right:32upx;">入库花材盘点</div>
+			<div @click="stockInAddEvent" class="admin-button-com big blue" style="margin-right:32upx;">入库盘点</div>
 			<div @click="addEvent" class="admin-button-com big blue">新增盘点</div>
 		</div>
 	</view>
@@ -107,7 +107,7 @@ export default {
 				});
 		},
 		stockInAddEvent(){
-			this.$util.pageTo({ url: '/pagesStorehouse/inventory/select?pdType=stockInPd&shopId='+this.getLoginInfo.shopId})
+			this.$util.pageTo({ url: '/pagesStorehouse/allot/inSelect'})
 		},
 		addEvent() {
 			uni.navigateTo({url: '/pagesStorehouse/inventory/select?shopId='+this.getLoginInfo.shopId})