Przeglądaj źródła

app 花材优化

shish 4 lat temu
rodzic
commit
cbbb3ba026

+ 17 - 195
ghsApp/src/admin/billing/affirm.vue

@@ -9,7 +9,7 @@
             <view class="commodity-list">
               <view class="commodity-item" v-for="(item, index) in selectList" :key="index">
                 <image class="item-icon" :src="item.cover" alt="" />
-                <view class="item-info" @click="showAddModel(item)">
+                <view class="item-info" @click="showAddModelFn(item)">
                   <view class="info-line">
                     <text class="item-name">{{ item.itemName }}</text>
                     <text class="item-price">
@@ -20,13 +20,13 @@
 
                   <view style="text-align:right;">
                     <view class="open-bx" >
-                      <i class="iconfont iconjian" @click.stop="delItem(item)" v-if="item.bigCount > 0 || item.smallCount > 0"></i>
+                      <i class="iconfont iconjian" @click.stop="reduceItemFn(item)" v-if="item.bigCount > 0 || item.smallCount > 0"></i>
                       <text class="num" >
                         <text v-if="item.bigCount > 0 || item.smallCount > 0">{{ `${item.bigCount}` }}</text>
                         <text v-if="item.smallCount > 0">/</text>
                         <text v-if="item.smallCount > 0">{{ `${item.smallCount}` }}</text>
                       </text>
-                      <i class="iconfont iconzeng" @click.stop="addItem(item)"></i>
+                      <i class="iconfont iconzeng" @click.stop="addItemFn(item)"></i>
                     </view>
                   </view>
 
@@ -41,16 +41,16 @@
           </view>
         </view>
 
-        <modal-module :show="currentModelShow" @cancel="addModelCancel" @click="confirmAddModel" :title="currentItemData.itemName" color="#333" :size="32" padding="30upx 30upx" >
+        <modal-module :show="isAddModel" @cancel="addItemModelHidden" @click="confirmAddItemModel" :title="customData.itemName" color="#333" :size="32" padding="30rpx 30rpx" >
           <template slot="customContent">
-            <view class="select-cmd_bx" v-if="currentItemData">
-              <view class="kc"><text class="unit_price">库存 {{ parseFloat(currentItemData.stock) }}</text><text class="unit_price"> 单价 {{ parseFloat(currentItemData.price) }}</text>1扎={{currentItemData.ratio}}支</view>
+            <view class="select-cmd_bx" v-if="customData">
+              <view class="kc"><text class="unit_price">库存 {{ parseFloat(customData.stock) }}</text><text class="unit_price"> 单价 {{ parseFloat(customData.price) }}</text>1扎={{customData.ratio}}支</view>
               <view class="num_bx">
-                <input v-model="currentItemData.bigCount" :focus="currentItemFocus" type="number" />扎
-                <input v-model="currentItemData.smallCount" type="number" style="margin-left:24upx" />支
+                <input v-model="customData.bigCount" :focus="isAddInputFocus" type="number" />扎
+                <input v-model="customData.smallCount" type="number" style="margin-left:24upx" />支
               </view>
               <view class="num_bx">
-                <input style="width: 495upx" v-model="currentItemData.userPrice" @focus="currentItemData.userPrice = null" type="number" placeholder="每扎单价" />
+                <input style="width: 495upx" v-model="customData.userPrice" @focus="customData.userPrice = null" type="number" placeholder="每扎单价" />
                 <text>元</text>
               </view>
             </view>
@@ -195,9 +195,8 @@ export default {
       money: "",
       showCustomer: false,
       customInfo:{discount:1},
-      currentItemData: { bigCount: 0, smallCount: 0, userPrice: 0 },
-      currentItemFocus:false,
-      currentModelShow:false,
+      customData: { bigCount: 0, smallCount: 0, userPrice: 0 },
+      isAddModel:false,
       checkStock:true,
 			xjData:{},
 			xjDataInfo:{}
@@ -237,58 +236,6 @@ export default {
 		if(!this.$util.isEmpty(uni.getStorageSync("newClient"))){
 			this.showCustomer = true;
 		}
-
-    //小菊的添加和修改,同样代码有多个地方,请搜索关键词 xj_change_code
-		if(this.xjData.hasUpdate == 1){
-			console.log('this.xjData',this.xjData)
-			console.log('this.xjDataInfo',this.xjDataInfo)
-
-			const list = this.selectList;
-
-			this.currentItemData = this.xjDataInfo
-
-			if(this.xjData.cancel == 1){
-				this.currentItemData.bigCount = 0
-				this.currentItemData.smallCount = 0
-				console.log('this.currentItemData',this.currentItemData)
-				this.confirmAddModel({index:0})
-			}else{
-
-				//判断list有没有数据,没有需要初始化
-				const list = this.selectList;
-				let has = false
-				for (let index = 0; index < list.length; index++) {
-					const element = list[index];
-					if (element.id == this.xjDataInfo.id && element.classId == this.xjDataInfo.classId) {
-						has = true
-					}
-				}
-
-				if(has == false){
-					let params = {
-						...this.xjDataInfo,
-						bigCount: null, //扎数
-						smallCount: null, //支数
-						autoPrice: null, //调价价格
-						userPrice: null, //调价价格
-					};
-					list.push(params);
-					this.setSelectInfoByType({ type: this.pageType, info: list });
-				}
-
-				this.currentItemData.bigCount = this.xjData.stock
-				this.currentItemData.smallCount = 0
-				this.currentItemData.bigPrice = this.xjData.price
-				this.currentItemData.price = this.xjData.price
-				this.currentItemData.itemPrice = this.xjData.price
-				this.currentItemData.userPrice = this.xjData.price
-
-				this.confirmAddModel({index:1})
-			}
-		}
-		this.xjData = {}
-
-
 	},
 	onUnload(){
 			uni.removeStorageSync('newClient');
@@ -303,138 +250,13 @@ export default {
   },
   methods: {
     ...mapActions(["initMerchantInfo"]),
-    //通过弹框来修改花材数据(区别于点+-号修改花材)
-		showAddModel(item) {
-      let variety = item.variety
-			//不是小菊或者是小菊但不是在开单
-			if(variety == 0 || this.pageType != 'bill'){
-				if(this.checkStock){
-					if(item.stock<=0){
-            this.$util.noStockRemind()
-						uni.showToast({title:'库存不足',icon:'none'})
-						return;
-					}
-				}
-				if(!item.bigCount && !item.smallCount){
-					let params = { ...item, bigCount: item.bigCount, smallCount: item.smallCount, userPrice: item.userPrice}
-					this.$emit("groupInfoBeforeShowModel", item,params);
-				}else{
-					this.showAddModel({ ...item, bigCount: item.bigCount, smallCount: item.smallCount, userPrice: item.userPrice })
-				}
-			}else{
-				//去特殊品种页
-				this.goToSpecialVariety(item)
-			}
-		},
-		addModelCancel() {
-			this.currentModelShow = false;
-			this.currentItemData = {};
-		},
-		confirmAddModel(val) {
-				if (val.index === 0) {
-					if(this.currentItemData.bigCount<=0 && this.currentItemData.smallCount<=0){
-            this.delCurrentItem(this.currentItemData)
-					}
-					this.addModelCancel();
-					return false
-				}
-				//二个都不是数值
-				if(/(^[1-9]\d*$)/.test(this.currentItemData.bigCount) == false && /(^[1-9]\d*$)/.test(this.currentItemData.smallCount) == false){
-					this.delCurrentItem(this.currentItemData)
-					this.addModelCancel();
-					return;
-				}
-				if(/(^[1-9]\d*$)/.test(this.currentItemData.bigCount)){
-					if(this.currentItemData.bigCount<=0){
-						uni.showToast({title:"数量要大于0",icon:"none"})
-						return;
-					}
-				}
-
-				if(/(^[1-9]\d*$)/.test(this.currentItemData.smallCount)){
-					if(this.currentItemData.smallCount<=0){
-						uni.showToast({title:"数量要大于0",icon:"none"})
-						return;
-					}
-				}
-
-				if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.currentItemData.userPrice) == false){
-					uni.showToast({title:"金额错误",icon:"none"})
-					return;
-				}
-				if(this.currentItemData.userPrice <=0){
-					uni.showToast({title:"金额要大于0",icon:"none"})
-					return;
-				}
-
-				const { bigCount,smallCount,bigNum,bigUnit,smallNum,smallUnit,ratio} = this.currentItemData;
-				const ratioNum = Number(ratio);
-				if (Number(bigCount) * ratioNum + Number(smallCount) > Number(bigNum) * ratioNum + Number(smallNum)) {
-					uni.showToast({ title: '还剩'+bigNum, icon: "none" })
-					this.$util.noStockRemind()
-				} else {
-					this.updateItemEvent(this.currentItemData);
-					this.addModelCancel();
-				}
+		reduceItemFn(item) {
+			item.bigCount--
+			this.replaceItemFn(item)
 		},
-		//显示可以修改花材的弹框
-		showAddModel(info) {
-			this.currentModelShow = true
-			this.currentItemData = info;
-			this.currentItemFocus = false;
-			this.$nextTick(()=>{
-				this.currentItemData.smallCount = this.currentItemData.smallCount==0?null:this.currentItemData.smallCount;
-				this.currentItemData.bigCount = this.currentItemData.bigCount==0?null:this.currentItemData.bigCount;
-				if(this.currentItemData.userPrice == null || this.currentItemData.userPrice == 0){
-					this.currentItemData.userPrice =	this.currentItemData.bigPrice;
-				}else{
-					this.currentItemData.userPrice =	this.currentItemData.userPrice;
-				}
-				this.currentItemFocus = true;
-			})
-		},
-    //删除花材
-		delItem(item) {
-      let variety = item.variety
-			if(variety == 0){
-				this.delEvent(item)
-			}else{
-				//去特殊品种页
-				this.goToSpecialVariety(item)
-			}
-		},
-    //添加花材
-		addItem(item) {
-      let variety = item.variety
-			if(variety == 0){
-				const ratio = Number(item.ratio);
-				if(this.checkStock){
-					if(item.stock<=0){
-						this.$msg("库存不足")
-            this.$util.noStockRemind()
-						return
-					}
-					if (Number(item.bigCount) * ratio + Number(item.smallCount) >= Number(item.bigNum) * ratio + Number(item.smallNum)) {
-						this.$msg("库存不足")
-            this.$util.noStockRemind()
-						return
-					}
-				}
-				this.addEvent(item)
-			}else{
-				//去特殊品种页
-				this.goToSpecialVariety(item)
-			}
-		},
-		//去特殊品种页,如小菊等
-		goToSpecialVariety(info){
-			this.xjDataInfo = info
-			if(info.stock <= 0){
-        this.$util.noStockRemind()
-				uni.showToast({title:"没有库存",icon:"none"})
-			}else{
-				this.$util.pageTo({url: "/admin/item/xj",query: {stock:info.stock,price: info.price,customId:this.option.customId,userPrice:info.userPrice}})
-			}
+		addItemFn (item) {
+			item.bigCount++
+			this.replaceItemFn(item)
 		},
     init () {
       this._getDet();

+ 2 - 3
ghsApp/src/admin/billing/index.vue

@@ -11,7 +11,7 @@
 
 		<view class="scroll-middle_bx">
 
-			<scroll-view scroll-y scroll-with-animation class="tab-view" :scroll-top="scrollTop" >
+			<scroll-view scroll-y scroll-with-animation class="tab-view">
 				<!--分类-->
 				<div v-for="(item, index) in globalClassItemList" :key="index" class="tab-bar-item" :class="classIndex == index ? 'active' : ''" :data-current="index" @tap.stop="swichClass(index)">
 					<text>{{ item.className || "" }}</text>
@@ -113,8 +113,7 @@ export default {
 			let customName = this.option.customName ? this.option.customName : '';
 			let orderId = this.option.orderId  ? this.option.orderId : 0
 			uni.navigateTo({url: "/admin/billing/affirm?customId="+this.option.customId+"&customName="+customName+"&orderId="+orderId})
-		},
-		scrollTop() {}
+		}
 	}
 };
 </script>

+ 15 - 112
ghsApp/src/admin/breakage/index.vue

@@ -11,7 +11,7 @@
 		
 		<view class="scroll-middle_bx">
 
-			<scroll-view scroll-y scroll-with-animation class="tab-view" :scroll-top="scrollTop" >
+			<scroll-view scroll-y scroll-with-animation class="tab-view">
 				<!--分类 start -->
 				<div v-for="(item, index) in globalClassItemList" :key="index" class="tab-bar-item" :class="classIndex == index ? 'active' : ''" :data-current="index" @tap.stop="swichClass(index)">
 					<text>{{ item.className || "" }}</text>
@@ -30,10 +30,8 @@
 								<Commondity v-if="classItem.isActive"
 									:checkStock="true"
 									:info="productItem"
-									@showAddModel="showAddModel"
-									@add="addEvent"
-									@groupDataBeforeShowModel="groupInfoBeforeShowModel"
-									@del="delEvent"
+									@showAddModelFn="showAddModelFn"
+									@replaceItemFn="replaceItemFn"
 								></Commondity>
 							</view>
 						</template>
@@ -46,17 +44,19 @@
 			</scroll-view>
 
 		</view>
-		<modal-module :show="isModel" @cancel="modalCancel" @click="wastageConfrim" :title="customData.itemName" color="#333" :size="32" padding="30upx 30upx" >
+		
+		<modal-module :show="isAddModel" @cancel="addItemModelHidden" @click="confirmAddItemModel" :title="customData.itemName" color="#333" :size="32" padding="30rpx 30rpx" >
 			<template slot="customContent">
 				<view class="select-cmd_bx" v-if="customData">
 					<view class="kc"><text class="unit_price">库存 {{ customData.stock }}</text></view>
 					<view class="num_bx">
-						<input v-model="customData.bigCount" :focus="isFocus" type="number" />扎
+						<input v-model="customData.bigCount" :focus="isAddInputFocus" type="number" />扎
 						<input v-model="customData.smallCount" type="number" style="margin-left:24upx" />支
 					</view>
 				</view>
 			</template>
 		</modal-module>
+
 		<!-- 花材不足提示框 -->
 		<modal-module
 			:show="showSubmitModel"
@@ -68,7 +68,7 @@
 			padding="30upx 30upx"
 		>
 		</modal-module>
-		<FooterCart :price="allPrice" :count="allCount" @confirm="confirmSelectEvent" ></FooterCart>
+		<FooterCart :price="allPrice" :count="allCount" @confirm="confirmToSave" ></FooterCart>
 	</view>
 </template>
 
@@ -96,8 +96,7 @@ export default {
 		return {
 			pageType: "wastage", //选择商品页面类别  用于区分不同功能的数据
 			COMMODITY_TYPE,
-			isFocus: false,
-			isModel: false,
+			isAddModel: false,
 			isSmallCount:false,//是否是小单位(支)
 			checkStock:true,
 			customData: {
@@ -123,109 +122,13 @@ export default {
 	},
 
 	methods: {
-		//自定义数量
-		showAddModel(info) {
-			this.isModel = true;
-			this.customData = info;
-			this.isFocus = false;
-			this.$nextTick(()=>{
-				this.customData.smallCount = this.customData.smallCount==0?null:this.customData.smallCount;
-				this.customData.bigCount = this.customData.bigCount==0?null:this.customData.bigCount;
-				this.isFocus = true;
-			})
-		},
-		modalCancel() {
-			this.isModel = false;
-			this.customData = {};
-		},
-		// 取消 确认
-		wastageConfrim(val) {
-
-				if (val.index === 0) {
-					if(this.customData.bigCount>0 || this.customData.smallCount>0){
-					}else{
-						this.delCurrentItem(this.customData)
-					}
-					this.modalCancel();
-					return false
-				}
-
-				//二个都不是数值
-				if(/(^[1-9]\d*$)/.test(this.customData.bigCount) == false && /(^[1-9]\d*$)/.test(this.customData.smallCount) == false){
-					this.delCurrentItem(this.customData)
-					this.modalCancel();
-					return;
-				}
-
-				if(/(^[1-9]\d*$)/.test(this.customData.bigCount)){
-					if(this.customData.bigCount<=0){
-						uni.showToast({title:"数量要大于0",icon:"none"})
-						return;
-					}
-				}
-
-				if(/(^[1-9]\d*$)/.test(this.customData.smallCount)){
-					if(this.customData.smallCount<=0){
-						uni.showToast({title:"数量要大于0",icon:"none"})
-						return;
-					}
-				}
-				 
-				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: '超过库存',icon: "none"})
-					this.customData.bigCount = 0;
-					this.customData.smallCount = 0;
-					this.delCurrentItem(this.customData)
-					this.modalCancel()
-				} else {
-					this.updateItemEvent(this.customData)
-					this.modalCancel()
-				}
-
-		},
-		cancelEvent() {
-			this.showSubmitModel = false;
-		},
-		submitEvent(val) {
-			if (val.index === 0) {
-				this.cancelEvent();
-			} else {
-				console.log(444, this.selectList);
-				uni.navigateTo({
-					url: "/admin/breakage/confirm"
-				});
-				this.cancelEvent();
-			}
-		},
-		confirmSelectEvent() {
-			if (this.selectList.length > 0) {
-
-				//因历史遗留原因,打开花材页马上点花材出现数量0或null的情况,需要过滤 shish 20210716
-				let selectList = this.selectList;
-				let list = [];
-				console.log('过滤前',selectList)
-				for (let i=0;i<selectList.length;i++){
-					if(/(^[1-9]\d*$)/.test(selectList[i].bigCount) == false && /(^[1-9]\d*$)/.test(selectList[i].smallCount) == false){
-						continue
-					}
-					list.push(selectList[i])
-				}
-				if(list.length <= 0){
-					this.$msg("请选择花材")
-					return
-				}
-				console.log('过滤后',list)
-				this.setSelectInfoByType({ type: this.pageType, info: list });
-
-				uni.navigateTo({url: "/admin/breakage/confirm"});
-			} else {
-				this.$msg("请选择花材");
+		confirmToSave() {
+			if(this.$util.isEmpty(this.selectList)){
+				this.$msg('请选择花材')
+				return false
 			}
-		},
-		scrollTop() {}
+			uni.navigateTo({url: "/admin/breakage/confirm"})
+		}
 	}
 };
 </script>

+ 0 - 1
ghsApp/src/components/plugin/modal.vue

@@ -123,7 +123,6 @@ export default {
 		}
 	},
 	mounted(){
-		console.log(this)
 	},
 	methods: {
 		handleClick(e) {

+ 13 - 8
ghsApp/src/mixins/product.js

@@ -17,7 +17,7 @@ export default {
 			//id动态切换
 			scroll_into_view:"",
 			timeFun:"",
-			kdType:'notPDA',//开单方式,notPDA PDA
+			kdType:'HIT',//点击和扫码开单,HIT SCAN
 			checkStock:true,// 考虑库存,盘点不需要考虑库存
 			isAddModel:false,
 			isAddInputFocus:false,
@@ -303,7 +303,7 @@ export default {
 				})
 			}
 
-			let commonChildList = [];
+			let filterItemData = [];
 			list.forEach(currentItem => {
 
 				//组合已记忆已选择的花材
@@ -322,14 +322,14 @@ export default {
 				let elePy = (currentItem.py && currentItem.py.toLocaleUpperCase()) || "";
 				let hasPy = elePy.indexOf(this.py.toLocaleUpperCase()) >= 0;
 				if (hasPy) {
-					if(this.$util.isEmpty(commonChildList)){
-						commonChildList = [{classId: currentItem.classId, className: currentItem.className,isActive:true,child:[currentItem]}]
+					if(this.$util.isEmpty(filterItemData)){
+						filterItemData = [{classId: currentItem.classId, className: currentItem.className,isActive:true,child:[currentItem]}]
 					}else{
-						commonChildList.forEach(res => {
+						filterItemData.forEach(res => {
 							if(res.classId==currentItem.classId){
 								res.child.push(currentItem)
 							}else{
-								commonChildList.push({classId: currentItem.classId, className: currentItem.className,isActive:true,child:[currentItem]})
+								filterItemData.push({classId: currentItem.classId, className: currentItem.className,isActive:true,child:[currentItem]})
 							}
 						})
 					}
@@ -337,7 +337,7 @@ export default {
 
 			})
 
-			let searchList = this.$util.unique(commonChildList)
+			let searchList = this.$util.unique(filterItemData)
 			this.globalClassItemList = searchList;
 			this.classIndex = 0;
 			this.scroll_into_view = 'class_'+0;
@@ -387,7 +387,7 @@ export default {
 					list[index].userPrice = item.userPrice
 				}
 			}
-			if(this.kdType != 'SCAN'){
+			if(this.kdType == 'HIT'){
 				this.$util.hitRemind()
 			}
 
@@ -401,6 +401,11 @@ export default {
 		},
 		//显示可以修改花材的弹框
 		showAddModelFn(info) {
+			if(info.bigNum <= 0 && info.smallNum <= 0){
+				this.$util.noStockRemind()
+				this.$msg('没有库存')
+				return false
+			}
 			this.isAddModel = true;
 			this.customData = info;
 			this.isAddInputFocus = false;

+ 14 - 113
ghsApp/src/pagesStorehouse/allot/exSelect.vue

@@ -4,7 +4,7 @@
 			<app-search-module v-model="py" placeholder="输字母搜索,如艾莎 as" @input="searchFn" />
 		</view>
 		<view class="scroll-middle_bx">
-			<scroll-view scroll-y scroll-with-animation class="tab-view" :scroll-top="scrollTop">
+			<scroll-view scroll-y scroll-with-animation class="tab-view">
 				<div v-for="(item, index) in globalClassItemList" :key="index" class="tab-bar-item" :class="[classIndex == index ? 'active' : '']" :data-current="index" @tap.stop="swichClass(index)">
 					<text>{{ item.className || "" }}</text>
 				</div>
@@ -24,10 +24,8 @@
 							<Commondity v-if="classItem.isActive"
 								:key="productIndex"
 								:info="productItem"
-								@showAddModel="showAddModel"
-								@add="addEvent"
-								@groupDataBeforeShowModel="groupInfoBeforeShowModel"
-								@del="delEvent"
+								@showAddModelFn="showAddModelFn"
+								@replaceItemFn="replaceItemFn"
 							></Commondity>
 							</view>
 						</template>
@@ -43,17 +41,18 @@
 				</view>
 			</block>
 		</view>
-		<modal-module :show="isModel" @cancel="modalCancel" @click="stockConfirm" :title="customData.itemName" color="#333" :size="32" padding="30rpx 30rpx" >
+		<modal-module :show="isAddModel" @cancel="addItemModelHidden" @click="confirmAddItemModel" :title="customData.itemName" color="#333" :size="32" padding="30rpx 30rpx" >
 			<template slot="customContent">
 				<view class="select-cmd_bx" v-if="customData">
 					<view class="kc"> 库存{{ customData.stock }} </view>
 					<view class="num_bx">
-						<input v-model="customData.bigCount" :focus="isFocus" type="number" />扎
+						<input v-model="customData.bigCount" :focus="isAddInputFocus" type="number" />扎
 						<input v-model="customData.smallCount"  type="number" style="margin-left:24upx"/>支
 					</view>
 				</view>
 			</template>
 		</modal-module>
+
 		<modal-module :show="showSubmitModel" @cancel="cancelEvent" @click="submitEvent" :title="confirmContent" color="#333" :size="32" padding="30rpx 30rpx" >
 		</modal-module>
 
@@ -86,8 +85,8 @@ export default {
 			COMMODITY_TYPE,
 			pageType: "allotEx",
 			tabIndex: 0,
-			isFocus: false,
-			isModel: false,
+			isAddInputFocus: false,
+			isAddModel: false,
 			checkStock: true,
 			isSmallCount:false,
 			customData: { bigCount: 0, smallCount: 0, userPrice:0 },
@@ -104,112 +103,14 @@ export default {
 		}
 	},
 	methods: {
-		//自定义数量
-		showAddModel(info) {
-			this.isModel = true;
-			this.customData = info;
-			this.$nextTick(()=>{
-				this.customData.smallCount = 	this.customData.smallCount==0?null:this.customData.smallCount;
-				this.customData.bigCount = 	this.customData.bigCount==0?null:this.customData.bigCount;
-				this.isFocus = true;
-			})
-		},
-		modalCancel() {
-			this.isModel = false;
-			this.customData = {};
-		},
-		stockConfirm(val) {
-			this.isFocus = false;
-			this.isFocusOne = false;
-			this.$nextTick(()=>{
-				//取消操作
-				if (val.index === 0) {
-					if(this.customData.bigCount>0 || this.customData.smallCount>0){
-					}else{
-						this.delCurrentItem(this.customData)
-					}
-					this.modalCancel()
-					return false
-				}
-
-				//二个都不是数值
-				if(/(^[1-9]\d*$)/.test(this.customData.bigCount) == false && /(^[1-9]\d*$)/.test(this.customData.smallCount) == false){
-					this.delCurrentItem(this.customData)
-					this.modalCancel();
-					return;
-				}
-
-				if(/(^[1-9]\d*$)/.test(this.customData.bigCount)){
-					if(this.customData.bigCount<=0){
-						uni.showToast({title:"数量要大于0",icon:"none"})
-						return;
-					}
-				}
-
-				if(/(^[1-9]\d*$)/.test(this.customData.smallCount)){
-					if(this.customData.smallCount<=0){
-						uni.showToast({title:"数量要大于0",icon:"none"})
-						return;
-					}
-				}
-
-				this.updateItemEvent(this.customData);
-				this.modalCancel();
-			})
-
-		},
-		cancelEvent() {
-			this.showSubmitModel = false;
-		},
-		submitEvent(val) {
-			if (val.index === 0) {
-				this.cancelEvent();
-			} else {
-				console.log(444, this.selectList);
-
-				uni.navigateBack({
-					delta: 1
-				});
-
-				this.cancelEvent();
-			}
-		},
-		//确认选好了
+		//确认
 		confirmOut() {
-			if (this.selectList.length > 0) {
-
-
-				//因历史遗留原因,打开花材页马上点花材出现数量0或null的情况,需要过滤 shish 20210716
-				let selectList = this.selectList;
-				let list = [];
-				console.log('过滤前',selectList)
-				for (let i=0;i<selectList.length;i++){
-					if(/(^[1-9]\d*$)/.test(selectList[i].bigCount) == false && /(^[1-9]\d*$)/.test(selectList[i].smallCount) == false){
-						continue
-					}
-					list.push(selectList[i])
-				}
-				if(list.length <= 0){
-					this.$msg("请选择花材")
-					return
-				}
-				console.log('过滤后',list)
-				this.setSelectInfoByType({ type: this.pageType, info: list });
-
-
-				uni.navigateBack({
-					delta: 1
-				});
-			}
-		},
-		change(e) {
-			if (this.tabIndex == e.index) {
-				return false;
-			} else {
-				this.tabIndex = e.index;
+			if(this.$util.isEmpty(this.selectList)){
+				this.$msg('请选择花材')
+				return false
 			}
-		},
-		scrollTop() {}
+			uni.navigateBack({ delta: 1 })			
+		}
 	}
 };
 </script>

+ 11 - 102
ghsApp/src/pagesStorehouse/inventory/select.vue

@@ -25,10 +25,8 @@
 							<Commondity v-if="classItem.isActive"
 								:key="productIndex"
 								:info="productItem"
-								@showAddModel="showAddModel"
-								@add="addEvent"
-								@groupDataBeforeShowModel="groupInfoBeforeShowModel"
-								@del="delEvent"
+								@showAddModelFn="showAddModelFn"
+								@replaceItemFn="replaceItemFn"
 							></Commondity>
 							</view>
 						</template>
@@ -42,12 +40,12 @@
 			</block>
 		</view>
 
-		<modal-module :show="isModel" @cancel="modalCancel" @click="pdConfirm" :title="customData.itemName" color="#333" :size="32" padding="30rpx 30rpx" >
+		<modal-module :show="isAddModel" @cancel="addItemModelHidden" @click="confirmAddItemModel" :title="customData.itemName" color="#333" :size="32" padding="30rpx 30rpx" >
 			<template slot="customContent">
 				<view class="select-cmd_bx" v-if="customData">
 					<view class="kc"> 库存{{ customData.stock }} </view>
 					<view class="num_bx">
-						<input v-model="customData.bigCount" :focus="isFocus" type="number" />扎
+						<input v-model="customData.bigCount" :focus="isAddInputFocus" type="number" />扎
 						<input v-model="customData.smallCount" type="number" style="margin-left:24upx"/>支
 					</view>
 				</view>
@@ -57,7 +55,7 @@
 		<modal-module :show="showSubmitModel" @cancel="cancelEvent" @click="submitEvent" :title="confirmContent" color="#333" :size="32" padding="30upx 30upx" >
 		</modal-module>
 
-		<FooterCart :offPrice="true" :price="allPrice" :count="allCount" @confirm="confirmSelectEvent"></FooterCart>
+		<FooterCart :offPrice="true" :price="allPrice" :count="allCount" @confirm="confirmToSaveItem"></FooterCart>
 
 	</view>
 </template>
@@ -87,10 +85,9 @@ export default {
 		return {
 			pageType: "inventory",
 			checkStock: false,
-			isFocus: false,
+			isAddInputFocus: false,
 			isSmallCount:false,//是否是小单位(支)
 			tabIndex: 0,
-			isModel: false,
 			customData: {
 				bigCount: 0,
 				smallCount: 0,
@@ -114,100 +111,12 @@ export default {
 		this.initData({ type,status:0});
 	},
 	methods: {
-		//自定义数量
-		showAddModel(info) {
-			this.isModel = true;
-			this.customData = info;
-			this.isFocus = false;
-			this.$nextTick(()=>{
-				this.customData.smallCount = 	this.customData.smallCount==0?null:this.customData.smallCount;
-				this.customData.bigCount = 	this.customData.bigCount==0?null:this.customData.bigCount;
-				this.isFocus = true;
-			})
-		},
-		modalCancel() {
-			this.isModel = false;
-			this.customData = {};
-		},
-		// 取消 确认
-		pdConfirm(val) {
-			this.isFocus = false;
-			this.isFocusOne = false;
-			this.$nextTick(()=>{
-				//取消
-				if (val.index === 0) {
-					if(this.customData.bigCount>0 || this.customData.smallCount>0){
-					}else{
-						this.delCurrentItem(this.customData)
-					}
-					this.modalCancel();
-					return;
-				}
-
-				//二个都不是数值
-				if(/(^[1-9]\d*$)/.test(this.customData.bigCount) == false && /(^[1-9]\d*$)/.test(this.customData.smallCount) == false){
-					this.delCurrentItem(this.customData)
-					this.modalCancel();
-					return;
-				}
-
-				if(/(^[1-9]\d*$)/.test(this.customData.bigCount)){
-					if(this.customData.bigCount<=0){
-						uni.showToast({title:"数量要大于0",icon:"none"})
-						return;
-					}
-				}
-
-				if(/(^[1-9]\d*$)/.test(this.customData.smallCount)){
-					if(this.customData.smallCount<=0){
-						uni.showToast({title:"数量要大于0",icon:"none"})
-						return;
-					}
-				}
-
-				this.updateItemEvent(this.customData);
-				this.modalCancel();
-			})
-		},
-		cancelEvent() {
-			this.showSubmitModel = false;
-		},
-		submitEvent(val) {
-			if (val.index === 0) {
-				this.cancelEvent();
-			} else {
-				uni.navigateBack({
-					delta: 1
-				});
-				this.cancelEvent();
+		confirmToSaveItem() {
+			if(this.$util.isEmpty(this.selectList)){
+				this.$msg('请选择花材')
+				return false
 			}
-		},
-		confirmSelectEvent() {
-			
-			if (this.selectList.length > 0) {
-
-				//因历史遗留原因,打开花材页马上点花材出现数量0或null的情况,需要过滤 shish 20210716
-				let selectList = this.selectList;
-				let list = [];
-				console.log('过滤前',selectList)
-				for (let i=0;i<selectList.length;i++){
-					if(/(^[1-9]\d*$)/.test(selectList[i].bigCount) == false && /(^[1-9]\d*$)/.test(selectList[i].smallCount) == false){
-						continue
-					}
-					list.push(selectList[i])
-				}
-				if(list.length <= 0){
-					this.$msg("请选择花材")
-					return
-				}
-				console.log('过滤后',list)
-				this.setSelectInfoByType({ type: this.pageType, info: list });
-
-				this.submitEvent(1);
-
-			} else {
-        		this.$msg('请选择花材')
-      		}
+			this.submitEvent(1)
 		},
 		change(e) {
 			if (this.tabIndex == e.index) {

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

@@ -73,7 +73,6 @@ export async function uniLoginFn(update,type) {
 			uni.login({
 				provider: 'weixin',
 				success: res => {
-					console.log('res',res)
 					uni.setStorageSync('code', res.code)
 					postWxCode({ code: res.code }).then(subRes => {
 						if (util.isEmpty(subRes)) {