shish 3 жил өмнө
parent
commit
f68f63a83e

+ 9 - 8
hdApp/src/admin/goods/pdGoods.vue

@@ -38,12 +38,13 @@
         <view class="select-cmd_bx">
           <view class="kc"><text class="unit_price">库存 {{ customData.stock }}</text></view>
           <view class="num_bx"> 
-				<!-- #ifdef APP-PLUS -->
-				<input v-model="customData.bigCount" type="number" @focus="customData.bigCount = null" placeholder="数量" />
-				<!-- #endif -->
-				<!-- #ifdef MP-WEIXIN -->							
-				<input v-model="customData.bigCount" type="number" @focus="customData.bigCount = null" :focus="isAddInputFocus" placeholder="数量" />
-				<!-- #endif -->
+            <!-- #ifdef APP-PLUS -->
+            <input v-model="customData.bigCount" type="number" @focus="customData.bigCount = null" placeholder="数量" />
+            <!-- #endif -->
+            <!-- #ifdef MP-WEIXIN -->							
+            <input v-model="customData.bigCount" type="number" @focus="customData.bigCount = null" :focus="isAddInputFocus" placeholder="数量" />
+            <!-- #endif -->
+            <button style="position:absolute;top:276upx;left:230upx;" @click="customData.bigCount=99999" class="admin-button-com middle blue">盘点为零</button>
           </view>
         </view>
       </template>
@@ -266,8 +267,8 @@ page {
 	}
 	& .num_bx {
 		display: flex;
-		align-items: center;
-		margin-bottom: 40upx;
+		align-items:center;
+		margin-bottom:90upx;
     & > text{
       width:100upx;
       font-size:30upx;

+ 14 - 74
hdApp/src/admin/goods/pdGoodsConfirm.vue

@@ -49,7 +49,7 @@
 		<view class="bar-view" v-if="selectList.length>0">
 			<view class="btn-view">
 				<button class="admin-button-com big defalut" style="margin-right:60upx;" @click="gotoSelectPage">返回修改</button>
-				<button class="admin-button-com big blue" @click="confirmPop()">确认盘点</button>
+				<button class="admin-button-com big blue" @click="confirmPd()">确认盘点</button>
 			</view>
 		</view>
 	</view>
@@ -58,8 +58,7 @@
 import TuiListCell from "@/components/plugin/list-cell";
 import productMins from "@/mixins/product";
 import { mapActions, mapGetters } from "vuex";
-import { updateCheckOrderToDraftApi, savaCheckOrderDraftApi, getCheckOrderDetailApi, checkOrderApi } from "@/api/inventory";
-import {currentShop} from "@/api/shop";
+import { createGdGoods } from "@/api/pd"
 export default {
 	components: { TuiListCell },
 	mixins: [productMins],
@@ -99,73 +98,11 @@ export default {
 			]
 		};
 	},
-	onLoad(option) {
-		const { orderSn } = option;
-		if (orderSn) {
-			this.orderSn = orderSn;
-			this.initInfo();
-		}
-	this.getInfo();
-		if (!this.getMerchantInfo) {
-			this.initMerchantInfo();
-		}
-	},
-	computed: {
-		...mapGetters(["getMerchantInfo"])
-	},
 	methods: {
-		...mapActions(["initMerchantInfo"]),
-		async initInfo() {
-			const { data } = await getCheckOrderDetailApi(this.orderSn);
-			this.infoData = data;
-			const { remark, itemInfo } = data;
-			this.remark = remark;
-			this.setSelectInfoByType({
-				type: this.pageType,
-				info: itemInfo.map(ele => {
-					return {
-						...ele,
-						bigNum: Number(ele.bigNumStock),
-						smallNum: Number(ele.smallNumStock),
-						bigCount: Number(ele.bigNum),
-						smallCount: Number(ele.smallNum)
-					};
-				})
-			})
-		},
 		gotoSelectPage() {
-			uni.navigateTo({url: "/pagesStorehouse/inventory/select"})
+			uni.navigateTo({url: "/admin/goods/pdGoods"})
 		},
-		getInfo(){
-			return currentShop().then(res => {
-				this.shopInfo = res.data
-			})	
-		},
-		async saveToDraft() {
-			let api = savaCheckOrderDraftApi;
-			if (this.orderSn) {
-				api = updateCheckOrderToDraftApi;
-			}
-			let params = {
-				remark: this.remark
-			};
-			if (this.orderSn) {
-				params.orderSn = this.orderSn;
-			}
-			let formatList = this.selectList.map(ele => {
-				return {
-					bigNum: ele.bigCount,
-					smallNum: ele.smallCount,
-					productId: ele.id,
-					classId:ele.classId,itemId:ele.itemId
-				};
-			});
-			params.itemInfo = JSON.stringify(formatList);
-			const { data: { orderSn } } = await api(params);
-			this.orderSn = orderSn;
-			this.$msg("保存成功");
-		},
-		confirmPop() {
+		confirmPd() {
 			let that = this;
 			that.$util.confirmModal({content:'确认盘点?'},() => {
 				that.saveCheckOrder()
@@ -174,15 +111,18 @@ export default {
 		saveCheckOrder() {
 			let params = {remark: this.remark}
 			let formatList = this.selectList.map(ele => {
-				return { bigNum: ele.bigCount, smallNum: ele.smallCount, productId: ele.id }
-			});
+				return { num: ele.bigCount, goodsId: ele.id,name:ele.name,cover:ele.shortCover,flower:ele.flower,kindId:ele.kindId }
+			})
 			let that = this
-			params.itemInfo = JSON.stringify(formatList);
-			checkOrderApi(params).then(res=>{
+			params.goodsInfo = JSON.stringify(formatList)
+			uni.showLoading({mask:true})
+			createGdGoods(params).then(res=>{
 				if(res.code == 1){
-					that.$msg("盘点成功");
-					that.removeFromSaveDirect()
-					uni.navigateBack()
+					that.$msg("盘点成功")
+					setTimeout(function(){
+						that.removeFromSaveDirect()
+						uni.navigateBack()
+					},1500)
 				}
 			})
 		}

+ 201 - 0
hdApp/src/admin/goods/pdGoodsDetail.vue

@@ -0,0 +1,201 @@
+<template>
+	<view class="ex-page">
+		<view class="main-view overscroll">
+			<view class="space-view ex-info">
+				<view class="info-cell">
+					<view class="cell-label"> 盘点:</view>
+					<view class="cell-value"> {{ dataInfo.staffName || "" }}</view>
+				</view>
+				<view class="info-cell">
+					<view class="cell-label"> 日期:</view>
+					<view class="cell-value"> {{ dataInfo.updateTime ? dataInfo.updateTime.substr(5,11) : ''}}</view>
+				</view>
+				<view class="info-cell">
+					<view class="cell-label"> 状态:</view>
+					<view class="cell-value">{{dataInfo.status == 2 ? '已完成' : dataInfo.status == 1 ? '待盘点' : '' }}</view>
+				</view>
+				<view class="info-cell">
+					<view class="cell-label"> 备注:</view>
+					<view class="cell-value">
+						{{ dataInfo.remark || "" }}
+					</view>
+				</view>
+			</view>
+			<view class="space-view ex-table">
+				<t-table>
+					<t-tr header>
+						<t-th v-for="(item, index) in columns" :key="index" :align="item.align">
+							{{ item.name }}
+						</t-th>
+					</t-tr>
+					<t-tr v-for="(item, index) in goodsList" :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="goToStockDetail(item)">
+								<view class="icon-info">
+									<view class="info-name">
+										{{ item.name }}
+									</view>
+									<view class="info-type"></view>
+								</view>
+							</view>
+							<view v-else-if="column.custom == 'stock'" @click.stop="goToStockDetail(item)">
+								<text>{{ item.stock }}</text>
+							</view>
+							<view v-else-if="column.custom == 'inventory'" @click.stop="goToStockDetail(item)">
+								<text>{{item.num}}</text>
+							</view>
+							<view v-else-if="column.custom == 'profit'" @click.stop="goToStockDetail(item)"> </view>
+							<view v-else @click.stop="goToStockDetail(item)">{{ item[column.dataIndex] || "" }}</view>
+						</t-td>
+					</t-tr>
+				</t-table>
+			</view>
+		</view>
+		<view class="bar-view">
+			<view class="info-view">
+				<text class="price-item"></text>
+			</view>
+		</view>
+	</view>
+</template>
+<script>
+import { getPdGoodsInfo } from "@/api/pd";
+import { INVENTORY_STATUS } from "@/utils/declare";
+export default {
+components: {},
+data() {
+	return {
+		INVENTORY_STATUS,
+		orderSn: null,
+		dataInfo: {},
+		goodsList:[],
+		columns: [
+			{
+				name: "名称",
+				custom: "icon"
+			},
+			{
+				name: "盘点前",
+				custom: "stock",
+				width: 120,
+				align: "center"
+			},
+			{
+				name: "盘点后",
+				custom: "inventory",
+				color: "warn",
+				width: 120,
+				align: "center"
+			},
+			{
+				name: "盈亏数",
+				custom: "profit",
+				color: "success",
+				width: 120,
+				align: "center"
+			}
+		]
+	};
+},
+onLoad() {
+	this.initData();
+},
+methods: {
+	goToStockDetail(item){
+		this.pageTo({url: "/admin/goods/stockChange?id="+item.goodsId+'&name='+item.name})
+	},
+	async initData() {
+		let orderSn = this.option.orderSn ? this.option.orderSn : ''
+		const { data } = await getPdGoodsInfo({orderSn});
+		this.dataInfo = data.info
+		this.goodsList = data.goodsList
+	}
+}
+};
+</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;
+					}
+				}
+			}
+		}
+		.ex-table {
+			/deep/.list-icon {
+				display: flex;
+				.icon-image {
+					width:60upx;
+					height:60upx;
+					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 -1px 6upx 0upx rgba(4, 0, 0, 0.06);
+		.info-view {
+			font-size: 26upx;
+			.price-item {
+				margin: 0 10upx;
+			}
+			.red {
+				color: #f51608;
+			}
+		}
+		.btn-view {
+			display: flex;
+			.admin-button-com {
+				margin: 0 10upx;
+			}
+		}
+	}
+}
+</style>

+ 2 - 7
hdApp/src/admin/goods/pdList.vue

@@ -9,7 +9,6 @@
 					<view class="info">
 						<view class="info-order">{{ item.orderSn }}</view>
 						<view class="info-name">{{ item.remark }}</view>
-						<view class="info-name">{{ item.remark }}</view>
 						<view>
 							<text class="info-time">{{ item.updateTime ? item.updateTime.substr(5,11) : '' }}</text>
 							<text class="info-num" v-if="Number(item.bigNum) > 0">{{ `${item.bigNum}` }}扎</text>
@@ -92,14 +91,10 @@ export default {
 			}
 		},
 		addEvent() {
-			uni.navigateTo({url:'/admin/goods/pdGoods'})
+			this.pageTo({url:'/admin/goods/pdGoods'})
 		},
 		gotoDetailsEvent(item) {
-			if (item.status == INVENTORY_STATUS.DONE) {
-				uni.navigateTo({url: `/pagesStorehouse/inventory/details?orderSn=${item.orderSn}`})
-			} else {
-				uni.navigateTo({url: `/pagesStorehouse/inventory/update?orderSn=${item.orderSn}`})
-			}
+			this.pageTo({url: '/admin/goods/pdGoodsDetail?orderSn='+item.orderSn})
 		}
 	}
 };

+ 4 - 4
hdApp/src/admin/goods/stockChange.vue

@@ -62,7 +62,7 @@ export default {
 	},
 	onPullDownRefresh() {
 		this.resetList();
-		this._list().then(res => {
+		this.getChangeList().then(res => {
 			uni.stopPullDownRefresh();
 		});
 	},
@@ -71,7 +71,7 @@ export default {
 	},
 	onReachBottom() {
 		if (!this.list.finished) {
-			this._list().then((res) => {
+			this.getChangeList().then((res) => {
 				uni.stopPullDownRefresh();
 			});
 		} else {
@@ -81,9 +81,9 @@ export default {
 	methods: {
 		...mapActions(['setUserShopAll']),
 		async init() {
-			this._list();
+			this.getChangeList();
 		},
-		_list() {
+		getChangeList() {
 			return goodsStockChange({...this.params,page: this.list.page}).then(res => {
 				this.completes(res);
 			});

+ 8 - 0
hdApp/src/api/pd/index.js

@@ -1,5 +1,13 @@
 import https from "@/plugins/luch-request_0.0.7/request";
 
+export const getPdGoodsInfo = data => {
+	return https.get("/pd-goods/get-info", data);
+};
+
 export const getPdGoodsList = data => {
 	return https.get("/pd-goods/list", data);
+};
+
+export const createGdGoods = data => {
+	return https.post("/pd-goods/create-order", data);
 };

+ 2 - 1
hdApp/src/pages.json

@@ -250,7 +250,8 @@
 				{ "path": "plantCgDetail", "style": { "navigationBarTitleText": "明细" } },
 				{ "path": "pdList", "style": { "navigationBarTitleText": "商品盘点列表" } },
 				{ "path": "pdGoods", "style": { "navigationBarTitleText": "选择商品" } },
-				{ "path": "pdGoodsConfirm", "style": { "navigationBarTitleText": "确认盘点" } }
+				{ "path": "pdGoodsConfirm", "style": { "navigationBarTitleText": "确认盘点" } },
+				{ "path": "pdGoodsDetail", "style": { "navigationBarTitleText": "详情" } }
 			]
 		},
 		{

+ 0 - 1
hdApp/src/pagesStorehouse/inventory/list.vue

@@ -9,7 +9,6 @@
 					<view class="info">
 						<view class="info-order">{{ item.orderSn }}</view>
 						<view class="info-name">{{ item.remark }}</view>
-						<view class="info-name">{{ item.remark }}</view>
 						<view>
 							<text class="info-time">{{ item.updateTime ? item.updateTime.substr(5,11) : '' }}</text>
 							<text class="info-num" v-if="Number(item.bigNum) > 0">{{ `${item.bigNum}` }}扎</text>

+ 1 - 1
hdApp/src/pagesStorehouse/inventory/select.vue

@@ -217,7 +217,7 @@ export default {
 		& .num_bx {
 			display: flex;
 			align-items: center;
-			margin-bottom: 80upx;
+			margin-bottom:80upx;
 			& > input {
 				font-size:30upx;
 				width: 212upx;