Просмотр исходного кода

储存字典表里的shop、修改BUG盘点

jf 5 лет назад
Родитель
Сommit
a3ed1c2f68

+ 4 - 0
ghsApp/src/App.vue

@@ -25,6 +25,10 @@ export default {
 					...res.data.dict,
 					...res.data
 				})
+				store.commit('setMyShopInfo', {
+					...res.data.shop,
+					...res.data
+				})
 			})
 		}
 		// #endif

+ 9 - 9
ghsApp/src/pagesStatistics/business.vue

@@ -4,14 +4,14 @@
 			<view class="business-info">
 				<view class="amount-view">
 					<text class="amount-label">账户余额</text>
-					<view 
+					<view
 						v-if="loginInfo.super"
 						class="amount-btn">
-						<DorpdownSelect 
-							:menuObj.sync="menuObj"  
+						<DorpdownSelect
+							:menuObj.sync="menuObj"
 							top="0px"
 							:selectItemId.sync="shopId"
-							@selectSussess="selectSussess"></DorpdownSelect>	
+							@selectSussess="selectSussess"></DorpdownSelect>
 					</view>
 				</view>
 				<view class="price-view">
@@ -146,7 +146,7 @@
 								<view class="item-right">
 									<!-- <text class="iconfont iconxiangyou"> </text> -->
 								</view>
-							</view>	
+							</view>
 							<view class="list-item" >
 								<view class="item-left">
 									<view class="content-row">
@@ -161,10 +161,10 @@
 								<view class="item-right">
 									<!-- <text class="iconfont iconxiangyou"> </text> -->
 								</view>
-							</view>	
+							</view>
 						</template>
 					</view>
-					
+
 				</view>
 			</view>
 		</template>
@@ -433,8 +433,8 @@ export default {
 				display: flex;
 				align-items: center;
 				justify-content: center;
-			// 	// padding: 0px 17px;
-				width: 165upx;
+			 	 padding: 0px 17px;
+				//width: 165upx;
 				height: 44upx;
 				& /deep/ .select-title {
 					color: #FFFFFF;

+ 5 - 3
ghsApp/src/pagesStorehouse/inventory/list.vue

@@ -21,12 +21,14 @@
 						<view class="info-order">{{ item.orderSn }}</view>
 						<view class="info-name">{{ item.remark }}</view>
 						<view style="margin-bottom: 10rpx">
-							<text v-if="item.bigNum >= 0">数量:{{ `${item.bigNum}/` }}</text>
-							<text>{{ item.smallNum }}</text>件
+							<text class="info-time">人员:{{ item.adminName }}</text>
+						</view>
+						<view style="margin-bottom: 10rpx">
+							<text class="info-time" style="margin: 0">数量:{{item.bigNum}}/</text>
+							<text class="info-time" style="margin: 0">{{ item.smallNum }}</text>件
 						</view>
 						<view>
 							<text class="info-time">时间:{{ item.updateTime }}</text>
-
 						</view>
 					</view>
 					<view

+ 33 - 42
ghsApp/src/pagesStorehouse/inventory/select.vue

@@ -7,12 +7,12 @@
 				@search="searchFn"
 			/>
 		</view>
-		<app-tabs
-			:tabs="tabs"
-			:currentTab="tabIndex"
-			@change="change"
-			itemWidth="50%"
-		/>
+<!--		<app-tabs-->
+<!--			:tabs="tabs"-->
+<!--			:currentTab="tabIndex"-->
+<!--			@change="change"-->
+<!--			itemWidth="50%"-->
+<!--		/>-->
 		<view class="scroll-middle_bx">
 			<scroll-view
 				scroll-y
@@ -84,6 +84,7 @@
 								"
 								@customNum="customNum"
 								@add="addEvent"
+								@addOneEvent="addCustomNumEvent"
 								@del="delEvent"
 							></Commondity>
 						</template>
@@ -117,12 +118,14 @@
 				<view class="select-cmd_bx" v-if="customData">
 					<view class="kc"> 库存{{ customData.stock }} </view>
 					<view class="num_bx">
-						<input v-model="customData.bigCount" type="number" />扎
-						<input
-							v-model="customData.smallCount"
-							type="number"
-							style="margin-left:24upx"
-						/>支
+						<allMoreSelectInput
+							:isActive="isActive" :isFocus="isFocus" :value="customData.bigCount"
+							:isActiveOne="isActiveOne" :isFocusOne="isFocusOne" :valueOne="customData.smallCount"
+							@deleteInputVal="deleteInputVal" @initAllInput="initAllInput" @moveAllInput="moveAllInput"
+							@deleteInputValOne="deleteInputValOne" @initAllInputOne="initAllInputOne" @moveAllInputOne="moveAllInputOne">
+						</allMoreSelectInput>
+<!--						<input v-model="customData.bigCount" type="number" />扎-->
+<!--						<input v-model="customData.smallCount" type="number" style="margin-left:24upx"/>支-->
 					</view>
 				</view>
 			</template>
@@ -153,6 +156,8 @@ import Commondity from "@/components/module/app-commodity";
 import FooterCart from "@/components/module/app-footer-cart";
 import ModalModule from "@/components/plugin/modal";
 import productMins from "@/mixins/product";
+import allMoreSelectInput from "@/components/module/allMoreSelectInput";
+import allMoreSelectInputMins from "@/mixins/allMoreSelectInput";
 export default {
 	name: "allotEx", // 开单
 	components: {
@@ -161,9 +166,10 @@ export default {
 		AppWrapperEmpty,
 		Commondity,
 		ModalModule,
-		FooterCart
+		FooterCart,
+		allMoreSelectInput
 	},
-	mixins: [productMins],
+	mixins: [productMins,allMoreSelectInputMins],
 	data() {
 		return {
 			pageType: "inventory",
@@ -202,42 +208,28 @@ export default {
 		customNum(info) {
 			this.isModel = true;
 			this.customData = info;
+			this.$nextTick(()=>{
+				this.initAllInput();
+			})
 		},
 		modalCancel() {
 			this.isModel = false;
 			this.customData = {};
 		}, // 取消 确认
 		affirm(val) {
-			if (val.index === 0) {
-				this.modalCancel();
-			} else {
-				const {
-					bigCount,
-					smallCount,
-					bigNum,
-					bigUnit,
-					smallNum,
-					smallUnit,
-					ratio
-				} = this.customData;
-				const ratioNum = Number(ratio);
-
-				//超过库存时 设置为库存最大值
-				if (
-					Number(bigCount) * ratioNum + Number(smallCount) >
-					Number(bigNum) * ratioNum + Number(smallNum)
-				) {
-					uni.showToast({
-						title: `库存只有${bigNum}${bigUnit}${smallNum}${smallUnit}`,
-						icon: "none"
-					});
-					this.customData.bigCount = bigNum;
-					this.customData.smallCount = smallNum;
+			this.isFocus = false;
+			this.isFocusOne = false;
+			this.$nextTick(()=>{
+				if(this.customData.bigCount==0 && this.customData.smallCount==0){
+					this.delAllEvent(this.customData)}
+				if (val.index === 0) {
+					this.modalCancel();
 				} else {
 					this.updateItemEvent(this.customData);
 					this.modalCancel();
 				}
-			}
+			})
+
 		},
 		cancelEvent() {
 			this.showSubmitModel = false;
@@ -246,8 +238,7 @@ export default {
 			if (val.index === 0) {
 				this.cancelEvent();
 			} else {
-				console.log(444, this.selectList);
-
+				// console.log(444, this.selectList);
 				uni.navigateBack({
 					delta: 1
 				});

+ 8 - 2
ghsApp/src/store/modules/login.js

@@ -1,7 +1,8 @@
 export default {
 	state: {
 		loginInfo: {},
-		dictionariesInfo:{}
+		dictionariesInfo:{},
+		myShopInfo:{},
 	},
 	getters: {
 		getLoginInfo(state) {
@@ -10,15 +11,20 @@ export default {
 		getDictionariesInfo(state) {
 			return state.dictionariesInfo || {}
 		},
+		getMyShopInfo(state) {
+			return state.myShopInfo || {}
+		},
 	},
 	mutations: {
 		setLoginInfo(state, payload) {
 			state.loginInfo = payload
 		},
 		setDictionariesInfo(state, payload) {
-			console.log('payload',payload)
 			state.dictionariesInfo = payload
 		},
+		setMyShopInfo(state, payload) {
+			state.myShopInfo = payload
+		},
 	}
 	// ,
 	// actions: {

+ 4 - 0
ghsApp/src/utils/auth.js

@@ -106,6 +106,10 @@ export async function wxLoginFn(update) {
 									...res.data.dict,
 									...res.data
 								})
+							store.commit('setMyShopInfo', {
+								...res.data.shop,
+								...res.data
+							})
 						})
 					store.commit('setLoginInfo', {
 						...subRes.data.admin,