shish 4 lat temu
rodzic
commit
93503a86c3

+ 245 - 12
ghsApp/src/admin/billing/affirm.vue

@@ -1,14 +1,15 @@
 <template>
   <view class="affirm-page">
+
     <view class="affirm-view overscroll">
-      <!-- 门店信息 -->
+      <!-- 花材列表 -->
       <form>
         <view class="module-com">
           <view class="commodity-view">
             <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">
+                <view class="item-info" @click="changeItemNum(item)">
                   <view class="info-line">
                     <text class="item-name">{{ item.itemName }}</text>
                     <text class="item-price">
@@ -18,14 +19,19 @@
                       </text>
                     </text>
                   </view>
-                  <view class="info-line">
-                    <text class="item-type"></text>
-                    <text class="item-count">
-                      <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>
+
+                  <view style="text-align:right;">
+                    <view class="open-bx" >
+                      <i class="iconfont iconjian" :class="delAnimationData?'animation':''" @click.stop="delItem(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" :class="addAnimationData?'animation':''" @click.stop="addItem(item)"></i>
+                    </view>
                   </view>
+
                 </view>
               </view>
             </view>
@@ -39,6 +45,23 @@
             </view>
           </view>
         </view>
+
+		<modal-module :show="currentModelShow" @cancel="addModelCancel" @click="confirmAddModel" :title="currentItemData.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="num_bx">
+						<input v-model="currentItemData.bigCount" :focus="currentItemFocus" type="number" />扎
+						<input v-model="currentItemData.smallCount" type="number" style="margin-left:24upx" />支
+					</view>
+					<view class="num_bx">
+						<input style="width: 495rpx" v-model="currentItemData.userPrice" @focus="currentItemData.userPrice = null" type="number" placeholder="每扎单价" />
+						<text>元</text>
+					</view>
+				</view>
+			</template>
+		</modal-module>
+
         <view class="module-com input-line-wrap">
 					<view class="" v-if="isBilling">
           <tui-list-cell class="line-cell" :hover="false" :arrow="false" @click="selectCustom">
@@ -101,13 +124,16 @@
 
           <tui-list-cell class="line-cell" :hover="false" :arrow="false">
             <view class="tui-title">备注</view>
-						<textarea style="height: 100rpx" v-model="form.remark" placeholder="选填"/>
+						<textarea style="height: 100rpx" v-model="form.remark" placeholder="选填" />
 					</tui-list-cell>
 
           </view>
         </view>
       </form>
     </view>
+
+
+
     <view class="under-bar">
       <view class="price-view">
         <text class="price-title" v-if="isBilling">
@@ -119,6 +145,7 @@
       <button class="admin-button-com blue middle" @click="affirmFormSubmit">开单</button>
     </view>
 
+
   </view>
 </template>
 
@@ -133,9 +160,10 @@ import appAddressGroup from "@/components/app-address-group";
 import appSendTime from "@/components/app-send-time";
 import appFormSend from "@/components/app-form-send";
 const formUtil = require("@/utils/formValidation.js");
-import { createOrder, freight,wastage,updateOrder } from "@/api/order/index";
+import { createOrder, updateOrder } from "@/api/order/index";
 import { mapActions, mapGetters } from "vuex";
 import { getUserDet} from "@/api/member";
+import ModalModule from "@/components/plugin/modal";
 export default {
   name: "BillingAffirm", // 开单确认
   components: {
@@ -147,6 +175,7 @@ export default {
     appAddressGroup,
     appSendTime,
     appFormSend,
+    ModalModule
   },
   mixins: [productMins],
   data () {
@@ -179,7 +208,10 @@ export default {
       money: "",
       modifyPrice: 0,
       showCustomer: false,
-      customInfo:{discount:1}
+      customInfo:{discount:1},
+      currentItemData: { bigCount: 0, smallCount: 0, userPrice: 0 },
+      currentItemFocus:false,
+      currentModelShow:false
     };
   },
   onLoad (option) {
@@ -222,6 +254,127 @@ export default {
   },
   methods: {
     ...mapActions(["initMerchantInfo"]),
+    //通过弹框来修改花材数据(区别于点+-号修改花材)
+		changeItemNum(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.$msg("小菊请去列表页修改")
+			}
+		},
+		addModelCancel() {
+			this.currentModelShow = false;
+			this.currentItemData = {};
+		},
+		confirmAddModel(val) {
+				if (val.index === 0) {
+					if(this.currentItemData.bigCount<=0 && this.currentItemData.smallCount<=0){
+            this.delAllEvent(this.currentItemData)
+					}
+					this.addModelCancel();
+					return false
+				}
+				//二个都不是数值
+				if(/(^[1-9]\d*$)/.test(this.currentItemData.bigCount) == false && /(^[1-9]\d*$)/.test(this.currentItemData.smallCount) == false){
+					this.delAllEvent(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();
+				}
+
+		},
+		//显示可以修改花材的弹框
+		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.$msg("小菊请去列表页修改")
+			}
+		},
+    //添加花材
+		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.$msg("小菊请去列表页修改")
+			}
+		},
     init () {
       this._getDet();
     },
@@ -447,6 +600,59 @@ export default {
                 font-size: 24upx;
               }
             }
+
+& .open-bx {
+				align-items: center;
+				& .iconfont {
+					color: #3385ff;
+					font-size: 42upx;
+				}
+
+				.position{
+					display: block;
+					width: 70upx;
+					text-align: center;
+				}
+				.iconcachu {
+					margin: 0 6px 0 20upx;
+					color: #ccc;
+					&.edit {
+						color: #3385ff;
+					}
+				}
+				& > .num {
+					display: inline-block;
+					width: 120upx;
+					height:45upx;
+					text-align:center;
+					margin: 0 8upx;
+					color: #868686;
+					border-radius: 22upx;
+					background-color: #f5f5f5;
+					padding: 3px 0;
+					font-size: 25upx;
+				}
+				.change-input {
+					width: 164upx;
+					height: 60upx;
+					line-height: 60upx;
+					text-align: center;
+					background: #ffffff;
+					border: 1px solid #dddddd;
+					border-radius: 4upx;
+					font-size: 25upx;
+				}
+				.btn-box{
+					width: 100upx;
+					height: 60upx;
+					line-height: 60upx;
+					color: #ffffff;
+					background: #3385ff;
+					text-align: center;
+					border-radius: 10upx;
+				}
+			}
+
           }
         }
       }
@@ -553,5 +759,32 @@ export default {
       width: 200upx;
     }
   }
+	.select-cmd_bx {
+		& .kc {
+			color: #999999;
+			font-size: 28upx;
+			font-weight: 400;
+			margin-bottom: 40upx;
+			text-align: center;
+			margin-top: 30upx;
+			.unit_price{
+				padding-right:25upx;
+			}
+		}
+		& .num_bx {
+			display: flex;
+			align-items: center;
+			margin-bottom: 40upx;
+			& > input {
+				width: 212upx;
+				height: 80upx;
+				border: 1px solid #dddddd;
+				border-radius: 4upx;
+				text-align: center;
+				margin-right: 24upx;
+				font-size: 40upx;
+			}
+		}
+	}
 }
 </style>

+ 20 - 34
ghsApp/src/admin/billing/index.vue

@@ -35,15 +35,15 @@
 						<template v-for="(productItem, productIndex) in classItem.child">
 							<view style="height: 160rpx" :id="`class_${classItem.classId}_${productItem.id}`" :key="productIndex">
 								<Commondity v-if="classItem.isActive"
-									:offVerifyRepertory="true"
+									:checkStock="true"
 									:pageType="pageType"
 									:info="productItem"
 									:bigCount="getSelectItemById(productItem.id, classItem.classId).bigCount"
 									:smallCount="getSelectItemById(productItem.id, classItem.classId).smallCount"
 									:userPrice="getSelectItemById(productItem.id, classItem.classId).userPrice"
-									@customNum="customNum"
+									@showAddModel="showAddModel"
 									@add="addEvent"
-									@addOneEvent="addCustomNumEvent"
+									@setInfoBeforeShowModel="groupInfoBeforeShowModel"
 									@del="delEvent"
 									@goToSpecialVariety="goToSpecialVariety"
 								></Commondity>
@@ -58,10 +58,11 @@
 			</scroll-view>
 
 		</view>
-		<modal-module :show="isModel" @cancel="modalCancel" @click="affirm" :title="customData.itemName" color="#333" :size="32" padding="30rpx 30rpx" >
+
+		<modal-module :show="isModel" @cancel="modalCancel" @click="confirmAddModel" :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><text class="unit_price"> 单价 {{ customData.price }}</text>1扎={{customData.ratio}}支</view>
+					<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="customData.bigCount" :focus="isFocus" type="number" />扎
 						<input v-model="customData.smallCount" type="number" style="margin-left:24upx" />支
@@ -73,17 +74,10 @@
 				</view>
 			</template>
 		</modal-module>
+
 		<!-- 花材不足提示框 -->
-		<modal-module
-			:show="showSubmitModel"
-			@cancel="cancelEvent"
-			@click="submitEvent"
-			:title="confirmContent"
-			color="#333"
-			:size="32"
-			padding="30rpx 30rpx"
-		>
-		</modal-module>
+		<modal-module :show="showSubmitModel" @cancel="cancelEvent" @click="submitEvent" :title="confirmContent" color="#333" :size="32" padding="30rpx 30rpx" ></modal-module>
+
 		<FooterCart :price="allPrice" :count="allCount" @confirm="confirmSelectEvent" ></FooterCart>
 	</view>
 </template>
@@ -114,12 +108,8 @@ export default {
 			isFocus: false,
 			isModel: false,
 			isSmallCount:false,//是否是小单位(支)
-			offVerifyRepertory:true,
-			customData: {
-				bigCount: 0,
-				smallCount: 0,
-				userPrice: 0,
-			},
+			checkStock:true,
+			customData: { bigCount: 0, smallCount: 0, userPrice: 0, },
 			showSubmitModel: false,
 			xjData:{},
 			xjDataInfo:{}
@@ -147,7 +137,7 @@ export default {
 				this.customData.bigCount = 0
 				this.customData.smallCount = 0
 				console.log('this.customData',this.customData)
-				this.affirm({index:0})
+				this.confirmAddModel({index:0})
 			}else{
 
 				//判断list有没有数据,没有需要初始化
@@ -179,7 +169,7 @@ export default {
 				this.customData.itemPrice = this.xjData.price
 				this.customData.userPrice = this.xjData.price
 
-				this.affirm({index:1})
+				this.confirmAddModel({index:1})
 			}
 		}
 		this.xjData = {}
@@ -197,14 +187,14 @@ export default {
 				this.$util.pageTo({url: "/admin/item/xj",query: {stock:info.stock,price: info.price,customId:this.option.customId,userPrice:info.userPrice}})
 			}
 		},
-		//自定义数量
-		customNum(info) {
+		//显示可以修改花材的弹框
+		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.customData.smallCount = this.customData.smallCount==0?null:this.customData.smallCount;
+				this.customData.bigCount = this.customData.bigCount==0?null:this.customData.bigCount;
 				if(this.customData.userPrice == null || this.customData.userPrice == 0){
 					this.customData.userPrice =	this.customData.bigPrice;
 				}else{
@@ -217,8 +207,7 @@ export default {
 			this.isModel = false;
 			this.customData = {};
 		},
-		// 取消 确认
-		affirm(val) {
+		confirmAddModel(val) {
 
 				if (val.index === 0) {
 					if(this.customData.bigCount>0 || this.customData.smallCount>0){
@@ -262,12 +251,9 @@ export default {
 
 				const { bigCount,smallCount,bigNum,bigUnit,smallNum,smallUnit,ratio} = this.customData;
 				const ratioNum = Number(ratio);
-				//超过库存时 设置为库存最大值 1
 				if (Number(bigCount) * ratioNum + Number(smallCount) > Number(bigNum) * ratioNum + Number(smallNum)) {
-					uni.showToast({
-						title: '库存只有'+bigNum,
-						icon: "none"
-					});
+					uni.showToast({ title: '数量还剩'+bigNum, icon: "none" })
+					this.$util.noStockRemind()
 				} else {
 					this.updateItemEvent(this.customData);
 					this.modalCancel();

+ 3 - 3
ghsApp/src/admin/breakage/index.vue

@@ -36,13 +36,13 @@
 						<template v-for="(productItem, productIndex) in classItem.child">
 							<view style="height: 160rpx" :id="`class_${classItem.classId}_${productItem.id}`" :key="productIndex">
 								<Commondity v-if="classItem.isActive"
-									:offVerifyRepertory="true"
+									:checkStock="true"
 									:info="productItem"
 									:bigCount="getSelectItemById(productItem.id, classItem.classId).bigCount"
 									:smallCount="getSelectItemById(productItem.id, classItem.classId).smallCount"
 									@customNum="customNum"
 									@add="addEvent"
-									@addOneEvent="addCustomNumEvent"
+									@setInfoBeforeShowModel="groupInfoBeforeShowModel"
 									@del="delEvent"
 								></Commondity>
 							</view>
@@ -109,7 +109,7 @@ export default {
 			isFocus: false,
 			isModel: false,
 			isSmallCount:false,//是否是小单位(支)
-			offVerifyRepertory:true,
+			checkStock:true,
 			customData: {
 				bigCount: 0,
 				smallCount: 0,

+ 12 - 11
ghsApp/src/admin/custom/selectCustom.vue

@@ -16,22 +16,18 @@
               </div>
               <div class="tui-msg-content">
                 <span>{{ item.visitTime.substr(5,11) }}</span>
-                <span style="margin-left:50upx;width:70upx;color:red;font-weight:500">
+                <span style="margin-left:30upx;width:70upx;color:red;font-weight:500">
                   <text v-if="item.level == 1"></text>
                   <text v-else-if="item.level == 0" style="color:#999;">{{ item.levelName }}</text>
                   <text v-else>{{ item.levelName }}</text>
                 </span>
-                <span v-if="item.debtAmount > 0" class="debt-amount">欠款:<span class="amount_num">{{item.debtAmount}}</span></span>
+                <span v-if="item.debtAmount > 0" class="debt-amount">欠款<span class="amount_num">{{parseFloat(item.debtAmount)}}</span></span>
+                <button v-if="selectStyle == 1" class="admin-button-com mini default" style="margin-left:50upx;" @click.stop="pdaKd(item)">PDA</button>
               </div>
             </div>
           </div>
           <div class="tui-msg-right">
-            <badge-module
-              type="danger"
-              :dot="item.level == 3 ? true : false"
-              v-if="item.messageNum > 0"
-              >{{ item.messageNum }}</badge-module
-            >
+            <badge-module type="danger" :dot="item.level == 3 ? true : false" v-if="item.messageNum > 0" >{{ item.messageNum }}</badge-module >
           </div>
         </tui-list-cell>
       </block>
@@ -64,7 +60,8 @@ export default {
   mixins: [list],
   data() {
     return {
-      tabIndex: 0
+      tabIndex: 0,
+      selectStyle:1
     };
   },
   onPullDownRefresh() {
@@ -87,9 +84,12 @@ export default {
 		uni.removeStorageSync('newClient');
 	},
   methods: {
+    pdaKd(custom){
+      this.$util.pageTo({url: "/admin/billing/affirm?customId="+custom.id+"&customName="+custom.name,type:2});
+    },
     selectCurrent(item){
-       
       let style = this.option.style ? this.option.style : 1
+      this.selectStyle = style
       if(style == 1){
         //点开单选客户后再选花材
         this.$util.pageTo({url: '/admin/billing/index',type:2,query: {customId: item.id,customName:item.name}})
@@ -253,9 +253,10 @@ export default {
     line-height: 1;
     color: #9397a4;
     .debt-amount{
-      margin-left:40upx;
+      margin-left:20upx;
       .amount_num{
         color:red;
+        margin-left:10rpx;
       }
     }
   }

+ 1 - 1
ghsApp/src/admin/home/me.vue

@@ -145,7 +145,7 @@
             </tui-list-cell> -->
 
             <tui-list-cell @click="pageTo({ url: '/admin/shop/sk' })" class="line-cell" :hover="false" :arrow="true">
-              <div class="tui-title">散客门店</div>
+              <div class="tui-title">零售店设置</div>
             </tui-list-cell>
 
             <tui-list-cell @click="getCustomService()" class="line-cell" :hover="false" :arrow="true">

+ 16 - 3
ghsApp/src/admin/home/workbench.vue

@@ -3,7 +3,7 @@
 		<!-- 今日概况 -->
 		<div class="user-wrap">
 			<div class="user-top">
-				<div class="app-size-28">今日概况</div><text @click="pageTo({url:'/admin/home/pda?customId=288'})">花店PDA</text>
+				<div class="app-size-28">今日概况</div>
 			</div>
 			<div class="income-amount">
 				<div>收入金额</div>
@@ -317,12 +317,25 @@ export default {
 				}else{
 					currentId = this.myShopInfo.skCustomId
 				}
-				this.$util.pageTo({url: '/admin/billing/index',query: {customId: currentId,customName:'散客开单'}})
+				let self = this
+				let levelList = ['PDA开单', '选材开单']
+				uni.showActionSheet({
+					itemList: levelList,
+					success: function (respond) {
+						let currentIndex = respond.tapIndex
+						let params = {customId: currentId,customName:'零售店'}
+						if(currentIndex == 0){
+							self.$util.pageTo({url: "/admin/billing/affirm",query: params})
+						}else{
+							self.$util.pageTo({url: "/admin/billing/index",query: params})
+						}
+					}
+				})
 			}else{
 				let that = this
 				uni.showModal({
 					title: '提示',
-					content: '请设置散客开单门店',
+					content: '请设置您的零售店',
 					cancelText: "取消",
 					confirmText: "好的",
 					success: function (res) {

+ 1 - 1
ghsApp/src/admin/shop/sk.vue

@@ -4,7 +4,7 @@
       <form @submit="formSubmit" @reset="formReset">
         <div class="module-com input-line-wrap">
           <tui-list-cell class="line-cell" :arrow="true" @click="selectCustom">
-            <div class="tui-title">散客门店:</div>
+            <div class="tui-title">零售店:</div>
             <view>{{form.customName}}</view>
           </tui-list-cell>
         </div>

+ 16 - 22
ghsApp/src/components/module/app-commodity.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="item-cmd_bx" @click="customNum(info.variety)">
+	<view class="item-cmd_bx" @click="changeItemNum(info.variety)">
 		<view class="img_bx" style="background:#eeeeee">
 			<image :src="info.cover" v-if="isImg"></image>
 		</view>
@@ -40,7 +40,7 @@
 <script>
 import { COMMODITY_TYPE } from "@/utils/declare";
 import AppImg from "@/components/app-img";
-import { autoPriceByIdApi, changePriceByIdApi } from '@/api/product/index'
+import { changePriceByIdApi } from '@/api/product/index'
 import animationMins from "@/mixins/animation";
 import allSelectInput from "@/components/module/allSelectInput";
 import allSelectInputMins from "@/mixins/allSelectInput";
@@ -86,7 +86,7 @@ export default {
 			type: Boolean,
 			default: false
 		},
-		offVerifyRepertory: {
+		checkStock: {
 			type: Boolean,
 			default: false
 		},
@@ -156,13 +156,15 @@ export default {
 		addEvents(variety) {
 			if(variety == 0 || this.pageType != 'bill'){
 				const ratio = Number(this.info.ratio);
-				if(this.offVerifyRepertory){
+				if(this.checkStock){
 					if(this.info.stock<=0){
-						this.$msg("库存不足");
+						this.$msg("库存不足")
+						this.$util.noStockRemind()
 						return
 					}
-					if (Number(this.bigCount) * ratio + Number(this.smallCount) >Number(this.info.bigNum) * ratio + Number(this.info.smallNum)) {
-						this.$msg("库存不足");
+					if (Number(this.bigCount) * ratio + Number(this.smallCount) >= Number(this.info.bigNum) * ratio + Number(this.info.smallNum)) {
+						this.$msg("库存不足")
+						this.$util.noStockRemind()
 						return
 					}
 				}
@@ -199,30 +201,22 @@ export default {
 			})
 			this.isAlterMoney = true;
 		},
-		customNum(variety) {
+		//通过弹框来修改花材数据(区别于点+-号修改花材)
+		changeItemNum(variety) {
 			//不是小菊或者是小菊但不是在开单
 			if(variety == 0 || this.pageType != 'bill'){
-				if(this.offVerifyRepertory){
+				if(this.checkStock){
 					if(this.info.stock<=0){
 						uni.showToast({title:'库存不足',icon:'none'})
 						return;
 					}
 				}
 				if(!this.bigCount && !this.smallCount){
-					let params = {
-						...this.info,
-						bigCount: this.bigCount,
-						smallCount: this.smallCount,
-						userPrice: this.userPrice,
-					};
-					this.$emit("addOneEvent", this.info,params);
+					//首次选花材
+					let params = { ...this.info, bigCount: this.bigCount, smallCount: this.smallCount, userPrice: this.userPrice, };
+					this.$emit("setInfoBeforeShowModel", this.info,params);
 				}else{
-					this.$emit("customNum", {
-						...this.info,
-						bigCount: this.bigCount,
-						smallCount: this.smallCount,
-						userPrice: this.userPrice,
-					});
+					this.$emit("showAddModel", { ...this.info, bigCount: this.bigCount, smallCount: this.smallCount, userPrice: this.userPrice, });
 				}
 			}else{
 				//去特殊品种页

+ 9 - 23
ghsApp/src/mixins/product.js

@@ -18,7 +18,8 @@ export default {
 			//id动态切换
 			scroll_into_view:"",
 			timeFun:"",
-			kdType:'notPDA'//开单方式,notPDA PDA
+			kdType:'notPDA',//开单方式,notPDA PDA
+			checkStock:true// 考虑库存,盘点不需要考虑库存
 		};
 	},
 	onLoad(options) {
@@ -333,7 +334,7 @@ export default {
 				const element = list[index];
 				if (element.id == item.id && element.classId == item.classId) {
 					has = true;
-					if(this.offVerifyRepertory){//盘点页面没有库存验证
+					if(this.checkStock){
 						if(this.isSmallCount){
 							list[index] = { ...element, smallCount: ++element.smallCount };
 						}else{
@@ -349,22 +350,7 @@ export default {
 								}
 							}else{
 
-//没有库存声音提醒
-const innerAudioContext = uni.createInnerAudioContext();
-innerAudioContext.autoplay = true;
-innerAudioContext.src = `${this.$constant.imgUrl}/noStock.mp3`;
-innerAudioContext.onPlay(() => {
-  console.log('开始播放');
-});
-innerAudioContext.onError((res) => {
-  console.log(res.errMsg);
-  console.log(res.errCode);
-});
-innerAudioContext.onPause(function() {
-	console.log('end');
-	innerAudioContext.destroy();
-});
-
+								this.$util.noStockRemind()
 
 								this.$msg("库存不足!");
 								return;
@@ -419,7 +405,7 @@ innerAudioContext.onPause(function() {
 				if (info.bigNum && info.bigNum > 0) {
 					list.push(params);
 				} else {
-					if(this.offVerifyRepertory){//盘点页面没有库存验证
+					if(this.checkStock){
 						list.push(params);
 					}else{
 						this.$msg("库存不足..");
@@ -442,7 +428,7 @@ innerAudioContext.onPause(function() {
 			this.rememberProduct()
 
 		},
-		addCustomNumEvent(item,params1,type) {
+		groupInfoBeforeShowModel(item,params1,type) {
 				const list = this.selectList;
 
 				let info = { classId: item.classId, id: item.id };
@@ -462,15 +448,15 @@ innerAudioContext.onPause(function() {
 					...info,
 					bigCount: null, //扎数
 					smallCount: null, //支数
-					autoPrice: null, //调价价格
-					userPrice: null, //调价价格
+					autoPrice: null, //自动调价
+					userPrice: null, //售价
 				};
 				list.push(params);
 				if(type!='noAdd'){
 					this.setSelectInfoByType({ type: this.pageType, info: list });
 				}
 				this.$nextTick(()=>{
-					this.customNum(params1)
+					this.showAddModel(params1)
 				})
 
 				//记忆已经选择的花材

+ 22 - 139
ghsApp/src/pages.json

@@ -135,7 +135,7 @@
 				{"path": "add","style": {"navigationBarTitleText": ""}},
 				{"path": "print","style": {"navigationBarTitleText": "云打印"}},
 				{"path": "changeShop","style": {"navigationBarTitleText": "切换门店"}},
-				{"path": "sk","style": {"navigationBarTitleText": "散客门店"}}
+				{"path": "sk","style": {"navigationBarTitleText": "零售店设置"}}
 			]
 		},
 		{
@@ -378,134 +378,42 @@
 		{
 			"root": "pagesPurchase",
 			"pages": [
-				{
-					"path": "result",
-					"style": {
-						"navigationBarTitleText": "结果"
-					}
-				},
-				{
-					"path": "add",
-					"style": {
-						"navigationBarTitleText": "新增采购单",
-						"enablePullDownRefresh": true
-					}
-				},
-				{
-					"path": "details",
-					"style": {
-						"navigationBarTitleText": "确认订单"
-					}
-				},
-				{
-					"path": "components/pageSuccess",
-					"style": {
-						"navigationBarBackgroundColor": "#ffffff",
-						"navigationBarTextStyle": "black"
-					}
-				},
-				{
-					"path": "order",
-					"style": {
-						"navigationBarTitleText": "采购订单",
-						"enablePullDownRefresh": true
-					}
-				},
-        {
-					"path": "supplier",
-					"style": {
-						"navigationBarTitleText": "供应商",
-						"enablePullDownRefresh": true
-					}
-				},
-        {
-					"path": "suppAdd",
-					"style": {
-						"navigationBarTitleText": "添加供应商",
-						"enablePullDownRefresh": true
-					}
-				},
-				{
-					"path": "info",
-					"style": {
-						"navigationBarTitleText": "订单详情",
-						"enablePullDownRefresh": true
-					}
-				}
+				{ "path": "result", "style": { "navigationBarTitleText": "结果" } },
+				{ "path": "add", "style": { "navigationBarTitleText": "新增采购单", "enablePullDownRefresh": true } },
+				{ "path": "details", "style": { "navigationBarTitleText": "确认订单" } },
+				{ "path": "components/pageSuccess", "style": { "navigationBarBackgroundColor": "#ffffff", "navigationBarTextStyle": "black" } },
+				{ "path": "order", "style": { "navigationBarTitleText": "采购订单", "enablePullDownRefresh": true } },
+       			{ "path": "supplier", "style": { "navigationBarTitleText": "供应商", "enablePullDownRefresh": true } },
+        		{ "path": "suppAdd", "style": { "navigationBarTitleText": "添加供应商", "enablePullDownRefresh": true } },
+				{ "path": "info", "style": { "navigationBarTitleText": "订单详情", "enablePullDownRefresh": true } }
 			]
 		},
 		{
 			"root": "pagesArrears",
 			"pages": [
-				{
-					"path": "list",
-					"style": {
-						"navigationBarTitleText": "客户欠款",
-						"enablePullDownRefresh": true
-					}
-				},
-				{
-					"path": "details",
-					"style": {
-						"navigationBarTitleText": "欠款明细",
-						"enablePullDownRefresh": true
-					}
-				}
+				{ "path": "list", "style": { "navigationBarTitleText": "客户欠款", "enablePullDownRefresh": true } },
+				{ "path": "details", "style": { "navigationBarTitleText": "欠款明细", "enablePullDownRefresh": true } }
 			]
 		},
 		{
 			"root": "pagesGys",
 			"pages": [
-				{
-					"path": "list",
-					"style": {
-						"navigationBarTitleText": "欠款订单",
-						"enablePullDownRefresh": true
-					}
-				},
-				{
-					"path": "details",
-					"style": {
-						"navigationBarTitleText": "结帐单",
-						"enablePullDownRefresh": true
-					}
-				}
+				{ "path": "list", "style": { "navigationBarTitleText": "欠款订单", "enablePullDownRefresh": true } },
+				{ "path": "details", "style": { "navigationBarTitleText": "结帐单", "enablePullDownRefresh": true } }
 			]
 		},
 		{
 			"root": "pagesInvite",
 			"pages": [
-				{
-					"path": "list",
-					"style": {
-						"navigationBarTitleText": "邀请开店",
-						"enablePullDownRefresh": true
-					}
-				},
-        {
-					"path": "inviteShop",
-					"style": {
-						"navigationBarTitleText": ""
-					}
-				},
-        {
-					"path": "inviteGhsShop",
-					"style": {
-						"navigationBarTitleText": ""
-					}
-				}
+				{ "path": "list", "style": { "navigationBarTitleText": "邀请开店", "enablePullDownRefresh": true } },
+        		{ "path": "inviteShop", "style": { "navigationBarTitleText": "" } },
+        		{ "path": "inviteGhsShop", "style": { "navigationBarTitleText": "" }}
 			]
 		},
 		{
 			"root": "pagesStatistics",
 			"pages": [
-				{
-					"path": "business",
-					"style": {
-						"navigationBarTitleText": "营业概况",
-						"enablePullDownRefresh": true
-					}
-				}
+				{ "path": "business", "style": { "navigationBarTitleText": "营业概况", "enablePullDownRefresh": true } }
 			]
 		},
 		{
@@ -580,36 +488,11 @@
 		"borderStyle": "black",
 		"backgroundColor": "#ffffff",
 		"list": [
-			{
-				"pagePath": "admin/home/workbench",
-				"iconPath": "static/images/common/shop-tab_no.png",
-				"selectedIconPath": "static/images/common/shop-tab.png",
-				"text": "店铺"
-			},
-			{
-				"pagePath": "admin/home/order",
-				"iconPath": "static/images/common/order-no.png",
-				"selectedIconPath": "static/images/common/order-is.png",
-				"text": "订单"
-			},
-			{
-				"pagePath": "admin/home/member",
-				"iconPath": "static/images/common/member-no.png",
-				"selectedIconPath": "static/images/common/member-is.png",
-				"text": "客户"
-			},
-			{
-				"pagePath": "admin/home/apply",
-				"iconPath": "static/images/common/category-no.png",
-				"selectedIconPath": "static/images/common/shop-apply.png",
-				"text": "应用"
-			},
-			{
-				"pagePath": "admin/home/me",
-				"iconPath": "static/images/common/user-no.png",
-				"selectedIconPath": "static/images/common/shop-me.png",
-				"text": "我的"
-			}
+			{ "pagePath": "admin/home/workbench", "iconPath": "static/images/common/shop-tab_no.png", "selectedIconPath": "static/images/common/shop-tab.png", "text": "店铺" },
+			{ "pagePath": "admin/home/order", "iconPath": "static/images/common/order-no.png", "selectedIconPath": "static/images/common/order-is.png", "text": "订单" },
+			{ "pagePath": "admin/home/member", "iconPath": "static/images/common/member-no.png", "selectedIconPath": "static/images/common/member-is.png", "text": "客户" },
+			{ "pagePath": "admin/home/apply", "iconPath": "static/images/common/category-no.png", "selectedIconPath": "static/images/common/shop-apply.png", "text": "应用" },
+			{ "pagePath": "admin/home/me", "iconPath": "static/images/common/user-no.png", "selectedIconPath": "static/images/common/shop-me.png", "text": "我的" }
 		]
 	}
 }

+ 1 - 1
ghsApp/src/pagesPurchase/add.vue

@@ -48,7 +48,7 @@
 								:itemPrice="getSelectItemById(productItem.id, classItem.classId).itemPrice"
 								@customNum="customNum"
 								@add="addEvent"
-								@addOneEvent="addCustomNumEvent"
+								@setInfoBeforeShowModel="groupInfoBeforeShowModel"
 								@del="delAllEvent"
 							></CommodityPurchase>
 							</view>

+ 1 - 1
ghsApp/src/pagesPurchase/components/CommodityPurchase.vue

@@ -127,7 +127,7 @@ export default {
           smallCount: this.smallCount,
           itemPrice: this.itemPrice
         };
-        this.$emit("addOneEvent", this.info, params, 'noAdd');
+        this.$emit("setInfoBeforeShowModel", this.info, params, 'noAdd');
       }
       this.$emit("customNum", {
         ...this.info,

+ 2 - 2
ghsApp/src/pagesStorehouse/allot/exSelect.vue

@@ -44,7 +44,7 @@
 								"
 								@customNum="customNum"
 								@add="addEvent"
-								@addOneEvent="addCustomNumEvent"
+								@setInfoBeforeShowModel="groupInfoBeforeShowModel"
 								@del="delEvent"
 							></Commondity>
 							</view>
@@ -136,7 +136,7 @@ export default {
 			],
 			isFocus: false,
 			isModel: false,
-			offVerifyRepertory: true,
+			checkStock: true,
 			isSmallCount:false,//是否是小单位(支)
 			customData: {
 				bigCount: 0,

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

@@ -55,7 +55,7 @@
 								"
 								@customNum="customNum"
 								@add="addEvent"
-								@addOneEvent="addCustomNumEvent"
+								@setInfoBeforeShowModel="groupInfoBeforeShowModel"
 								@del="delEvent"
 							></Commondity>
 							</view>
@@ -150,7 +150,7 @@ export default {
 			isLimit: false,
 			isFocus: false,
 			isSmallCount:false,//是否是小单位(支)
-			offVerifyRepertory:true,
+			checkStock:true,
 			tabIndex: 0,
 			tabs: [
 				{

+ 22 - 1
ghsApp/src/utils/util.js

@@ -284,6 +284,26 @@ export const isLogin = () => {
 	}
 	return false;
 };
+
+//没有库存时的语音播放 shish
+export const noStockRemind = () =>{
+	//没有库存声音提醒
+	const innerAudioContext = uni.createInnerAudioContext();
+	innerAudioContext.autoplay = true;
+	innerAudioContext.src = `${CONSTANT.imgUrl}/noStock.mp3`;
+	innerAudioContext.onPlay(() => {
+	console.log('开始播放');
+	});
+	innerAudioContext.onError((res) => {
+	console.log(res.errMsg);
+	console.log(res.errCode);
+	});
+	innerAudioContext.onPause(function() {
+		console.log('end');
+		innerAudioContext.destroy();
+	})
+}
+
 /**
 	* 去重
 	* 姜枫 2021.05.05
@@ -316,5 +336,6 @@ export default {
 	isString,
 	unique,
 	isMoney,
-	isNumber
+	isNumber,
+	noStockRemind
 };