Ver Fonte

app 开单

shish há 4 anos atrás
pai
commit
0992632987

+ 48 - 49
ghsApp/src/admin/billing/affirm.vue

@@ -14,21 +14,19 @@
                     <text class="item-name">{{ item.itemName }}</text>
                     <text class="item-price">
                       <text class="unit">¥</text>
-                      <text class="price">
-                        {{ parseFloat(item.userPrice)||0 }}
-                      </text>
+                      <text class="price">{{ parseFloat(item.userPrice)||0 }}</text>
                     </text>
                   </view>
 
                   <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>
+                      <i class="iconfont iconjian" @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>
+                      <i class="iconfont iconzeng" @click.stop="addItem(item)"></i>
                     </view>
                   </view>
 
@@ -36,31 +34,28 @@
               </view>
             </view>
             <view class="summary-bar">
-              <view class="operate-view" @click="gobackEvent">
-                <text class="iconfont icongouwuche"></text>重选花材
-              </view>
-              <view class="describe-view">
-                共{{ selectList.length }}种,合计 ¥<text class="price">{{ allPrice }}</text>
-              </view>
+              <view class="operate-view" v-if="kdType == 'PDA'" @click="removeMemory(option.customId)"> <text class="iconfont iconshanchu1"></text>清除花材 </view>
+              <view class="operate-view" v-else @click="gobackEvent"><text class="iconfont icongouwuche"></text>重选花材</view>
+              <view class="describe-view">共{{ selectList.length }}种,合计 ¥<text class="price">{{ allPrice }}</text></view>
             </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>
+        <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">
@@ -87,14 +82,7 @@
 
           <tui-list-cell class="line-cell" :arrow="true" v-if="form.debt == 0">
             <div class="tui-title">收款方式</div>
-            <picker
-              mode="selector"
-              :value="form.payWay"
-              :range="payWayList"
-              range-key="name"
-              @change="payWayChange"
-              class="tui-input"
-            >
+            <picker mode="selector" :value="form.payWay" :range="payWayList" range-key="name" @change="payWayChange" class="tui-input" >
               <input v-model="form.payWay" name="payWay" type="text" hidden />
               <div style="padding:6rpx 0 6rpx 0;">{{payWayList[payWayindex].name}}</div>
             </picker>
@@ -132,8 +120,6 @@
       </form>
     </view>
 
-
-
     <view class="under-bar">
       <view class="price-view">
         <text class="price-title" v-if="isBilling">
@@ -164,6 +150,7 @@ import { createOrder, updateOrder } from "@/api/order/index";
 import { mapActions, mapGetters } from "vuex";
 import { getUserDet} from "@/api/member";
 import ModalModule from "@/components/plugin/modal";
+import { allProduct } from '@/api/product'
 export default {
   name: "BillingAffirm", // 开单确认
   components: {
@@ -211,35 +198,43 @@ export default {
       customInfo:{discount:1},
       currentItemData: { bigCount: 0, smallCount: 0, userPrice: 0 },
       currentItemFocus:false,
-      currentModelShow:false
+      currentModelShow:false,
+      checkStock:true
     };
   },
   onLoad (option) {
+    
+    allProduct().then(res=>{
+      this.allProduct = res.data.list
+    })
+
+    this.kdType = option.kdType
+
     if (!this.getMerchantInfo) {
       this.initMerchantInfo().then((data) => {
-        uni.setNavigationBarTitle({
-          title: data.name,
-        });
+        uni.setNavigationBarTitle({ title: data.name, })
       });
     } else {
-      uni.setNavigationBarTitle({
-        title: this.getMerchantInfo.name,
-      });
+      uni.setNavigationBarTitle({ title: this.getMerchantInfo.name, })
     }
     this.modifyPrice = this.allPrice.toFixed(2);
+    
     //默认自取
     this.courier(2);
-    if(option.customId){
+
+    if(Number(option.customId) > 0){
       this.form.customId = option.customId
       let that = this
       getUserDet({ id: option.customId }).then(res => {
         that.form.customName = res.data.name
         that.customInfo = res.data
+        that.$forceUpdate()
         if(res.data.discount && res.data.discount < 1){
           that.calcPrice()
         }
       })
     }
+
   },
 	onShow(){
 		if(!this.$util.isEmpty(uni.getStorageSync("newClient"))){
@@ -320,13 +315,13 @@ export default {
 				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" })
+					uni.showToast({ title: '还剩'+bigNum, icon: "none" })
 					this.$util.noStockRemind()
 				} else {
 					this.updateItemEvent(this.currentItemData);
 					this.addModelCancel();
 				}
-
+        this.calcPrice()
 		},
 		//显示可以修改花材的弹框
 		showAddModel(info) {
@@ -352,6 +347,7 @@ export default {
 			}else{
 				this.$msg("小菊请去列表页修改")
 			}
+      this.calcPrice()
 		},
     //添加花材
 		addItem(item) {
@@ -374,6 +370,7 @@ export default {
 			}else{
 				this.$msg("小菊请去列表页修改")
 			}
+      this.calcPrice()
 		},
     init () {
       this._getDet();
@@ -408,7 +405,9 @@ export default {
     },
     _getDet () {
       let data = uni.getStorageSync("modifyShopB");
-      if (this.$util.isEmpty(data)) return;
+      if (this.$util.isEmpty(data)){
+        return;
+      }
       Object.keys(this.form).forEach((i, index) => {
         this.form[i] = data[i];
       });
@@ -528,7 +527,7 @@ export default {
           this.$msg(checkRes);
         }
       } catch (error) {
-        console.log(999999, error);
+
       }
     },
     gobackEvent () {
@@ -787,4 +786,4 @@ export default {
 		}
 	}
 }
-</style>
+</style>

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

@@ -107,7 +107,7 @@ export default {
 			COMMODITY_TYPE,
 			isFocus: false,
 			isModel: false,
-			isSmallCount:false,//是否是小单位(支)
+			isSmallCount:false,//是否是小单位
 			checkStock:true,
 			customData: { bigCount: 0, smallCount: 0, userPrice: 0, },
 			showSubmitModel: false,
@@ -252,7 +252,7 @@ export default {
 				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, icon: "none" })
+					uni.showToast({ title: '还剩'+bigNum, icon: "none" })
 					this.$util.noStockRemind()
 				} else {
 					this.updateItemEvent(this.customData);

+ 3 - 8
ghsApp/src/admin/home/apply.vue

@@ -1,18 +1,12 @@
 <template>
     <view class="app-content">
         <view class="apply-content_box">
-            <view 
-                v-for="item in menuList"
-                :key="item.title"
-                class="apply-list_box">
+            <view v-for="item in menuList" :key="item.title" class="apply-list_box">
                 <view class="tit">
                     {{item.title}}
                 </view>
                 <view class="tabs-wrap">
-                    <view 
-                        v-for="s in item.list"
-                        :key="s.url"
-                        class="tabs-list">
+                    <view v-for="s in item.list" :key="s.url" class="tabs-list">
                         <view @click="pageTo(s)">
                         <view class="tabs-img">
                             <image :src="s.img" alt mode="widthFix" ></image>
@@ -53,6 +47,7 @@ export default {
                     title:'客户与门店',
                     list:[
                         {name: "门店",img: `${this.$constant.imgUrl}/ghs/home/shop.png`,url: "/admin/shop/list"},
+                        {name: "零售店设置",img: `${this.$constant.imgUrl}/ghs/home/shop.png`,url: "/admin/shop/sk"},
                         {name: "员工",img: `${this.$constant.imgUrl}/ghs/home/yggl.png`,url: "/admin/staff/list"},
                         {name: "调拨出库",img: `${this.$constant.imgUrl}/ghs/home/dbck.png`,url: "/pagesStorehouse/allot/allotEx"},
                         {name: "调拨入库",img: `${this.$constant.imgUrl}/ghs/home/dbrk.png`,url: "/pagesStorehouse/allot/allotPut"},

+ 15 - 87
ghsApp/src/admin/home/me.vue

@@ -1,9 +1,6 @@
 <template>
   <view class="me-content_box app-content">
-    <image
-      :src="`${constant.imgUrl}/ghs/me/bg.png`"
-      class="me-content_bg"
-    ></image>
+    <image :src="`${constant.imgUrl}/ghs/me/bg.png`" class="me-content_bg" ></image>
     <template v-if="!$util.isEmpty(shopInfo)">
       <view class="me-user_box">
         <view class="user-info_item">
@@ -22,10 +19,7 @@
         <view class="me-shop_content content_box">
           <view class="me-shop_top">
             <view class="shop-top_left">
-              <app-avatar-module
-                :src="shopInfo.shopImg"
-                :width="100"
-              />
+              <app-avatar-module :src="shopInfo.shopImg" :width="100" />
               <view class="top-info_box">
                 <view>
                   {{ shopInfo.shopName }}
@@ -35,23 +29,12 @@
                 </view>
               </view>
             </view>
-            <button
-              v-if="loginInfo.switchShop"
-              @click="shopShow"
-              class="admin-button-com default chang-shop_btn"
-            >
+            <button v-if="loginInfo.switchShop" @click="shopShow" class="admin-button-com default chang-shop_btn" >
               <i class="iconfont iconqiehuan1"></i>
               切换店铺
             </button>
           </view>
-          <view
-            @click="
-              pageTo({
-                url: '/pagesClient/official/renewal'
-              })
-            "
-            class="image-box"
-          >
+          <view @click=" pageTo({ url: '/pagesClient/official/renewal' }) " class="image-box" >
             <view class="dec"> 店铺服务期至: {{ shopInfo.deadline.substr(0,11) }} </view>
             <image :src="`${constant.imgUrl}/ghs/me/upgrade.png`"></image>
           </view>
@@ -62,60 +45,30 @@
             <view> <text>¥ </text> {{ shopInfo.balance }} </view>
             <view>
               可提现余额 ¥ {{ shopInfo.txBalance }}
-              <text
-                v-if="shopInfo.txBalance > 0"
-                @click="checkToApplyCash"
-                class="to-cash"
-              >提现</text>
+              <text v-if="shopInfo.txBalance > 0" @click="checkToApplyCash" class="to-cash" >提现</text>
             </view>
           </view>
         </view>
         <view class="module-com content_box user-open_bx">
           <view class="input-line-wrap">
 
-            <tui-list-cell
-              @click="pageTo({ url: '/admin/shop/changeShop' })"
-              class="line-cell"
-              :hover="false"
-              :arrow="true"
-              v-if="shopInfo.adminId == 2 || shopInfo.adminId == 497"
-            >
+            <tui-list-cell @click="pageTo({ url: '/admin/shop/changeShop' })" class="line-cell" :hover="false" :arrow="true" v-if="shopInfo.adminId == 2 || shopInfo.adminId == 497" >
               <div class="tui-title">切换门店</div>
             </tui-list-cell>
 
-            <tui-list-cell
-              @click="pageTo({ url: '/admin/shopYeChange/list' })"
-              class="line-cell"
-              :hover="false"
-              :arrow="true"
-            >
+            <tui-list-cell @click="pageTo({ url: '/admin/shopYeChange/list' })" class="line-cell" :hover="false" :arrow="true" >
               <div class="tui-title">余额明细</div>
             </tui-list-cell>
 
-            <tui-list-cell
-              @click="pageTo({ url: '/pagesStore/me/incomeExpenses' })"
-              class="line-cell"
-              :hover="false"
-              :arrow="true"
-            >
+            <tui-list-cell @click="pageTo({ url: '/pagesStore/me/incomeExpenses' })" class="line-cell" :hover="false" :arrow="true" >
               <div class="tui-title">收支明细</div>
             </tui-list-cell>
 
-            <tui-list-cell
-              @click="pageTo({ url: '/pagesStore/me/withdraw' })"
-              class="line-cell"
-              :hover="false"
-              :arrow="true"
-            >
+            <tui-list-cell @click="pageTo({ url: '/pagesStore/me/withdraw' })" class="line-cell" :hover="false" :arrow="true" >
               <div class="tui-title">提现记录</div>
             </tui-list-cell>
 
-            <tui-list-cell
-              @click="pageTo({ url: '/pagesStore/me/rechargeList' })"
-              class="line-cell"
-              :hover="false"
-              :arrow="true"
-            >
+            <tui-list-cell @click="pageTo({ url: '/pagesStore/me/rechargeList' })" class="line-cell" :hover="false" :arrow="true" >
               <div class="tui-title">充值记录</div>
             </tui-list-cell>
 
@@ -123,12 +76,7 @@
               <div class="tui-title">使用手册</div>
             </tui-list-cell>
 
-            <tui-list-cell
-              @click="pageTo({ url: '/pagesStore/me/cashSet' })"
-              class="line-cell"
-              :hover="false"
-              :arrow="true"
-            >
+            <tui-list-cell @click="pageTo({ url: '/pagesStore/me/cashSet' })" class="line-cell" :hover="false" :arrow="true" >
               <div class="tui-title">提现账号</div>
             </tui-list-cell>
 
@@ -137,19 +85,11 @@
             </tui-list-cell>
 
             <tui-list-cell @click="pageTo({ url: '/admin/shop/print' })" class="line-cell" :hover="false" :arrow="true">
-              <div class="tui-title">云打印</div>
-            </tui-list-cell>
-
-            <!-- <tui-list-cell @click="pageTo({ url: '/admin/jc/index' })" class="line-cell" :hover="false" :arrow="true">
-              <div class="tui-title">新手视频</div>
-            </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">
-              <div class="tui-title">联系客服</div>
+              <div class="tui-title">联系我们</div>
             </tui-list-cell>
 
           </view>
@@ -157,14 +97,7 @@
         <none-hd :show="no_shop_show_model" :title="MODEL_TITLE" :btnText="MODEL_BTN_TEXT" @bthClick="toFreeApply_HOME" :authShow="true" experienceFun></none-hd>
       </view>
     </template>
-    <DorpdownSelect
-      ref="dorpdownSelect"
-      :menuObj.sync="menuObj"
-      top="0px"
-      :isShowTit="false"
-      :selectItemId.sync="shopId"
-      @selectSussess="selectSussess"
-    ></DorpdownSelect>
+    <DorpdownSelect ref="dorpdownSelect" :menuObj.sync="menuObj" top="0px" :isShowTit="false" :selectItemId.sync="shopId" @selectSussess="selectSussess" ></DorpdownSelect>
   </view>
 </template>
 
@@ -175,7 +108,6 @@ import { mainMy, applyCash } from "@/api/home";
 import { toggleShop } from "@/api/common";
 import DorpdownSelect from "@/components/module/shopSelect";
 import { selectShop } from "@/mixins";
-import { getUser } from "@/utils/auth";
 import { list } from "@/mixins";
 import { mapGetters } from "vuex";
 
@@ -254,10 +186,6 @@ export default {
         this.$store.commit("setLoginInfo", {})
         this.$util.pageTo({url: "/admin/home/me",type: 3})
 
-        // this.$store.commit("setLoginInfo", {...this.getLoginInfo,shopId: data.shopId,shopAdminId: data.id})
-        // getUser(true)
-        // this.init()
-
       } finally {
         uni.hideLoading();
       }
@@ -446,4 +374,4 @@ export default {
     border-radius: 10upx;
   }
 }
-</style>
+</style>

+ 33 - 110
ghsApp/src/admin/home/workbench.vue

@@ -53,14 +53,8 @@
 
 			<!-- 散客和花店开单 -->
 			<view class="tabs-head_bx">
-				<!-- #ifdef MP-WEIXIN -->
 				<image @click="skKd()" :src="skSrc" mode="widthFix"></image>
 				<image @click="pageTo({ url: '/admin/custom/selectCustom',query: {style:1}})" :src="pfSrc" mode="widthFix" ></image>
-				<!-- #endif -->
-				<!-- #ifdef APP-PLUS -->
-				<image @click="$msg('即将开通')" :src="skSrc" mode="widthFix"></image>
-				<image @click="$msg('即将开通')" :src="pfSrc" mode="widthFix" ></image>
-				<!-- #endif -->
 			</view>
 			
 			<!-- 使用手册 -->
@@ -114,7 +108,6 @@ import noneHd from "@/components/none-hd";
 import loginModel from "@/components/login-model";
 import {appLogin} from '@/api/common'
 import { getDictionaries } from '@/api/mini'
-import { allProduct } from '@/api/product'
 import productMins from "@/mixins/product";
 export default {
 	name: "admin-workbench",
@@ -135,12 +128,7 @@ export default {
 				admin: {},
 				asset: {},
 				notice: {},
-				todayData: {
-					income:0.00,
-					order:0,
-					custom:0,
-					expend:0.00
-				}
+				todayData: { income:0.00, order:0, custom:0, expend:0.00 }
 			},
 			orderData: [
 				{ name: "待付款", url: "/admin/home/order", type: 4, query: { tabIndex: 1 }, value: 0 },
@@ -166,25 +154,14 @@ export default {
 				{ name: "总采购(元)", value: 0.00, url:'/admin/statistics/cgStat', type:1 }
 			],
 			skSrc: `${this.$constant.imgUrl}/ghs/home/sk.jpg`,
-			pfSrc: `${this.$constant.imgUrl}/ghs/home/pf.jpg`,
-			allProduct:[]
+			pfSrc: `${this.$constant.imgUrl}/ghs/home/pf.jpg`
 		};
 	},
 	onShareAppMessage(res) {
 		if (res.target.id === "shareStore") {
-			return {
-				title: "商城分享",
-				desc: "",
-				imgUrl: "",
-				path: `/admin/billing/customerPlace?shopId=${this.loginInfo.shopId}`
-			};
+			return { title: "商城分享", desc: "", imgUrl: "", path: `/admin/billing/customerPlace?shopId=${this.loginInfo.shopId}` }
 		} else if (res.target.id === "sharePay") {
-			return {
-				title: "分享收款",
-				desc: "",
-				imgUrl: "",
-				path: "pagesShare/pay"
-			};
+			return { title: "分享收款", desc: "", imgUrl: "", path: "pagesShare/pay" }
 		}
 	},
 	computed: {
@@ -194,58 +171,17 @@ export default {
 	},
 	onLoad(option) {
 
-		// #ifdef APP-PLUS
-		//pda扫码开单
-		let that = this
-		var main = plus.android.runtimeMainActivity(); //获取activity
-		var receiver = plus.android.implements('io.dcloud.feature.internal.reflect.BroadcastReceiver', {
-			onReceive: that.doReceive
-		});
-		var IntentFilter = plus.android.importClass('android.content.IntentFilter');
-		var filter = new IntentFilter();
-		filter.addAction("nlscan.action.SCANNER_RESULT"); //监听扫描
-		main.registerReceiver(receiver, filter); //注册监听
-		// #endif
-
 	},
 	onPullDownRefresh() {
 		this.init();
 		uni.stopPullDownRefresh();
 	},
 	onShow() {
-
-		//pda扫码开单才需要这个数据
-		allProduct().then(res=>{
-			this.allProduct = res.data.list
-		})
-
 	},
 	methods: {
 		...mapActions(['setUserShopAll']),
 
-		// #ifdef APP-PLUS
-		//pda扫码开单
-		doReceive(context, intent) {
-			//通过intent实例引入intent类,方便以后的'.'操作
-			plus.android.importClass(intent)
-			var productIdCode = intent.getStringExtra("SCAN_BARCODE1")
-			let that = this
-			this.allProduct.forEach(function(product,index,array){
-				if(product.id == productIdCode){
-					console.log(product)
-					that.kdType = 'PDA'
-					product.userPrice = product.bigPrice
-					that.addEvent(product)
-				}
-			});
 
-			var pages = getCurrentPages()
-			let currentRoute  = pages[pages.length-1].route;
-			if(currentRoute != 'admin/home/pda'){
-				this.$util.pageTo({url: '/admin/home/pda'})
-			}
-		},
-		// #endif
 
 		loginFun(mobile,password){
 
@@ -260,38 +196,26 @@ export default {
 					uni.setStorageSync('token', subRes.data.token)
 					uni.setStorageSync('shopId', subRes.data.admin.currentShopId)
 					getDictionaries({ token: subRes.data.token }).then(res => {
-					if (this.$util.isEmpty(res)) {
-						return false
-					}
-					this.$store.commit('setDictionariesInfo', {
-						...res.data.dict,
-						...res.data
-					})
-					this.$store.commit('setMyShopInfo', {
-						...res.data.shop,
-						...res.data
-					})
-					})
-					this.$store.commit('setLoginInfo', {
-					...subRes.data.admin,
-					...subRes.data
+						if (this.$util.isEmpty(res)) {
+							return false
+						}
+						this.$store.commit('setDictionariesInfo', { ...res.data.dict, ...res.data })
+						this.$store.commit('setMyShopInfo', { ...res.data.shop, ...res.data })
 					})
+					this.$store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
 
 					this.show_login_model = false
 
 					uni.showTabBar()
 
-					getUser(true).then(res => {
-						uni.setNavigationBarTitle({
-							title: res.name
-						})
-					})
+					getUser(true).then(res => { uni.setNavigationBarTitle({ title: res.name }) })
 
-					//获取门店信息
+					//#ifdef APP-PLUS
+					this.skCustomId = subRes.data.skCustomId
+					this.listenPDAkd()
+					// #endif
 					this.setUserShopAll()
-					
-					this.setIndex()
-
+					this.init()
 				}
 			})
 
@@ -323,11 +247,10 @@ export default {
 					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})
+							self.$util.pageTo({url: "/admin/billing/affirm",query: {customId: currentId,kdType:'PDA'}})
 						}else{
-							self.$util.pageTo({url: "/admin/billing/index",query: params})
+							self.$util.pageTo({url: "/admin/billing/index",query: {customId: currentId}})
 						}
 					}
 				})
@@ -388,21 +311,21 @@ export default {
 		},
 		getMyMall(){
 			console.log('pagesPurchase/ghsProduct?shopId='+ this.loginInfo.shopId+'&id=0&ghsShopAdminId='+this.loginInfo.shopAdminId)
-				uni.navigateToMiniProgram({
-					//姜枫-2021.04.13
-					appId: this.getappIdList.hd.miniAppId,
-					path: 'pagesPurchase/ghsProduct?shopId='+ this.loginInfo.shopId+'&id=0&ghsShopAdminId='+this.loginInfo.shopAdminId,
-					//develop 开发版 trial 体验版 release 正式版
-					envVersion: process.env.NODE_ENV === 'development' ? 'develop' : 'release',
-					extraData: {
-						'shopId': this.loginInfo.shopId,
-						'id': 0,
-						'name': '假数据',
-					},
-					success(res) {
-						// 打开成功
-					}
-				})
+			uni.navigateToMiniProgram({
+				//姜枫-2021.04.13
+				appId: this.getappIdList.hd.miniAppId,
+				path: 'pagesPurchase/ghsProduct?shopId='+ this.loginInfo.shopId+'&id=0&ghsShopAdminId='+this.loginInfo.shopAdminId,
+				//develop 开发版 trial 体验版 release 正式版
+				envVersion: process.env.NODE_ENV === 'development' ? 'develop' : 'release',
+				extraData: {
+					'shopId': this.loginInfo.shopId,
+					'id': 0,
+					'name': '假数据',
+				},
+				success(res) {
+					// 打开成功
+				}
+			})
 		},
 	}
 };

+ 0 - 2
ghsApp/src/admin/shop/list.vue

@@ -147,8 +147,6 @@
 			},
 			// 删除弹窗
 			delModalFn(item) {
-				// this.$msg('即将开通...')
-				// return false
 				this.delModalText = this.tabIndex == 0 ? '确定删除该吗?' : '确定删除该角色吗?'
 				this.operateData = item
 				this.delModal = true

+ 2 - 2
ghsApp/src/components/module/app-commodity.vue

@@ -17,8 +17,8 @@
 						</text>
 						<i class="iconfont iconzeng" :class="addAnimationData?'animation':''" @click.stop="addEvents(info.variety)"></i>
 					</view>
-					<text v-if="Number(info.stock) > Number(info.stockWarning)" style="padding-right: 55rpx">还剩 {{ info.stock }}</text>
-					<text v-else style="padding-right: 55upx;color:red;font-weight:450;">还剩 {{ info.stock }}</text>
+					<text v-if="Number(info.stock) > Number(info.stockWarning)" style="padding-right: 55rpx">还剩 {{ parseFloat(info.stock) }}</text>
+					<text v-else style="padding-right: 55upx;color:red;font-weight:450;">还剩 {{ parseFloat(info.stock) }}</text>
 				</view>
 			</view>
 			<view class="num-open_bx flex-space" v-if="type == COMMODITY_TYPE.CHANGE">

+ 80 - 11
ghsApp/src/mixins/globalMixins.js

@@ -4,6 +4,7 @@ import { pageTo, isLogin } from '@/utils/util.js'
 import { getUser, uniLoginFn } from '@/utils/auth'
 import { postWxCode, getDictionaries } from '@/api/mini'
 import { getStaffApi,appReGetLoginInfo } from '@/api/common'
+import { allProduct } from '@/api/product'
 export default {
 	data() {
 		return {
@@ -20,7 +21,11 @@ export default {
       MODEL_TITLE: '您还没有开店',
       MODEL_BTN_TEXT: '申请',
       EXPER_AUTH_SHOW: false,
-      show_login_model:false
+      show_login_model:false,
+      //所有花材列表
+      allProduct:[],
+      //零售店对应的id
+      skCustomId:0
 		}
 	},
 	computed: {
@@ -37,7 +42,6 @@ export default {
 		}
     uni.setStorageSync('currentQuery', JSON.stringify(option))
 
-
 		if(this.$util.isEmpty(this.getLoginInfo)){
 
       // #ifdef MP-WEIXIN
@@ -91,16 +95,15 @@ export default {
         uni.hideTabBar()
       }else{
         appReGetLoginInfo().then(subRes=>{
-          store.commit('setLoginInfo', {
-            ...subRes.data.admin,
-            ...subRes.data
-          })
+          store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
+          uni.showTabBar()
+          this.skCustomId = subRes.data.skCustomId
+          this.listenPDAkd()
+          this.setUserShopAll()
+          if (this.init) {
+            this.init()
+          }
         })
-        uni.showTabBar()
-				this.setUserShopAll()
-				if (this.init) {
-					this.init()
-				}
       }
       // #endif 
 
@@ -129,6 +132,72 @@ export default {
 	},
 	methods: {
     ...mapActions(['setUserShopAll']),
+
+    // #ifdef APP-PLUS
+    //监听pda扫码开单
+    listenPDAkd(){
+
+          console.log('!!!!!!!!!!!!!!!!!!!!!!!PDA扫码发起了一次监听动作!!!!!!!!!!!!!!!!!!!!!')
+
+          //pda扫码开单前准备好所有花材
+          allProduct().then(res=>{
+            this.allProduct = res.data.list
+          })
+
+          this.checkStock = true
+
+          let that = this
+          var main = plus.android.runtimeMainActivity(); //获取activity
+          var receiver = plus.android.implements('io.dcloud.feature.internal.reflect.BroadcastReceiver', {
+            onReceive: that.listenPDAkdReceive
+          });
+          var IntentFilter = plus.android.importClass('android.content.IntentFilter');
+          var filter = new IntentFilter();
+          filter.addAction("nlscan.action.SCANNER_RESULT"); //监听扫描
+          main.registerReceiver(receiver, filter); //注册监听
+
+    },
+		//接收pda扫码
+		listenPDAkdReceive(context, intent) {
+
+			//通过intent实例引入intent类,方便以后的'.'操作
+			plus.android.importClass(intent)
+			var productIdCode = intent.getStringExtra("SCAN_BARCODE1")
+			let that = this
+			this.allProduct.forEach(function(product,index,array){
+				if(product.id == productIdCode){
+					that.kdType = 'PDA'
+					product.userPrice = product.bigPrice
+
+          //已经选择过的花材,先从storage取出,/admin/billing/affirm 页面的selectList才有数据
+          if(uni.getStorageSync('selectList'+that.pageType+'_custom_'+that.option.customId)){
+            let currentInfo = uni.getStorageSync('selectList'+that.pageType+'_custom_'+that.option.customId)
+            if(!that.$util.isEmpty(currentInfo)){
+              currentInfo.forEach((currentItem,currentIndex,currentArray)=>{
+                let currentId = currentItem.id
+                that.allProduct.forEach(function(product,index,array){
+                  if(product.id == currentId){
+                    currentArray[currentIndex].bigPrice = product.bigPrice
+                    currentArray[currentIndex].smallPrice = product.smallPrice
+                  }
+                })
+              })
+              that.setSelectInfoByType({ type: that.pageType, info: currentInfo })
+            }
+          }
+
+          that.option.customId = that.skCustomId
+					that.addEvent(product)
+				}
+			})
+			var pages = getCurrentPages()
+			let currentRoute  = pages[pages.length-1].route;
+			if(currentRoute != 'admin/billing/affirm'){
+				this.$util.pageTo({url: "/admin/billing/affirm",query:{customId:that.skCustomId,kdType:'PDA'}})
+			}
+		},
+		// #endif
+
     toFreeApply_HOME () {
       let status = ''
         if (uni.getStorageSync('HOME_STATUS_STROAGE_SHOW') == '0') {

+ 30 - 54
ghsApp/src/mixins/product.js

@@ -11,7 +11,6 @@ export default {
 			py: "", //拼音搜索条件
 			type: "", //库存预警时,固定为waring,其他情况不传或者传空
 			autoLoad: true, //自动获取商品信息
-			isLimit: true, //选择数量不能大于库存限制
 			allFilterProductInfo:'',
 			filterProductInfo:'',
 			top_list:'',
@@ -117,14 +116,14 @@ export default {
 		//修改花材
 		if(this.option.modifyProductKey){
 			if(uni.getStorageSync('selectList'+this.option.modifyProductKey)){
-				//this.setSelectInfoByType({ type: this.pageType, info: uni.getStorageSync('selectList'+this.option.modifyProductKey) })
-				//uni.removeStorageSync('selectList'+this.option.modifyProductKey)
+				//由于价格会变化,所以在initData()重新载入已经选择的花材
 			}
 		}else if(this.pageType == 'bill' && !this.$util.isEmpty(this.option.customId)){
 			if(uni.getStorageSync('selectList'+this.pageType+'_custom_'+this.option.customId)){
-				//this.setSelectInfoByType({ type: this.pageType, info: uni.getStorageSync('selectList'+this.pageType+'_custom_'+this.option.customId) })
+				//由于价格会变化,所以在initData()重新载入已经选择的花材
 			}			
 		}else{
+			//盘点和报损等不需要考虑价格
 			if(uni.getStorageSync('selectList'+this.pageType)){
 				this.setSelectInfoByType({ type: this.pageType, info: uni.getStorageSync('selectList'+this.pageType) })
 			}
@@ -198,19 +197,13 @@ export default {
 					if(uni.getStorageSync('selectList'+this.option.modifyProductKey)){
 						let currentInfo = uni.getStorageSync('selectList'+this.option.modifyProductKey)
 						if(!this.$util.isEmpty(currentInfo)){
-
 							currentInfo.forEach((currentItem,currentIndex,currentArray)=>{
 								let currentId = currentItem.id
 								if(directList[currentId]){
 									currentArray[currentIndex].bigPrice = directList[currentId].bigPrice
 									currentArray[currentIndex].smallPrice = directList[currentId].smallPrice
-									let bPrice = currentItem.bigCount * Number(directList[currentId].bigPrice)
-									let sPrice = currentItem.smallCount * Number(directList[currentId].smallPrice)
-									let currentUserPrice =  (bPrice+sPrice).toFixed(2)
-									//currentArray[currentIndex].userPrice = currentUserPrice
 								}
 							})
-
 							this.setSelectInfoByType({ type: this.pageType, info:  currentInfo})
 							uni.removeStorageSync('selectList'+this.option.modifyProductKey)
 						}
@@ -224,10 +217,6 @@ export default {
 								if(directList[currentId]){
 									currentArray[currentIndex].bigPrice = directList[currentId].bigPrice
 									currentArray[currentIndex].smallPrice = directList[currentId].smallPrice
-									let bPrice = currentItem.bigCount * Number(directList[currentId].bigPrice)
-									let sPrice = currentItem.smallCount * Number(directList[currentId].smallPrice)
-									let currentUserPrice =  (bPrice+sPrice).toFixed(2)
-									//currentArray[currentIndex].userPrice = currentUserPrice
 								}
 							})
 							this.setSelectInfoByType({ type: this.pageType, info: currentInfo })
@@ -235,7 +224,6 @@ export default {
 					}			
 				}
 
-
 				this.classIndex = 0;
 				this.scroll_into_view = 'class_0';
 				this.scrollPushList();
@@ -322,26 +310,31 @@ export default {
 			}
 			return info;
 		},
-
-		/**
-		 * 添加花材
-		 */
+		//添加花材
 		addEvent(item) {
 			console.log('新增花材',item)
 			const list = this.selectList;
 			let has = false;
+			//这一段代码的意思将重复花材数量合在一起,代码需要优化
 			for (let index = 0; index < list.length; index++) {
 				const element = list[index];
 				if (element.id == item.id && element.classId == item.classId) {
 					has = true;
 					if(this.checkStock){
-						if(this.isSmallCount){
-							list[index] = { ...element, smallCount: ++element.smallCount };
+						console.log(1109988)
+						if (element.bigCount < item.bigNum) {
+							if(this.isSmallCount){
+								list[index] = { ...element, smallCount: ++element.smallCount };
+							}else{
+								list[index] = { ...element, bigCount: ++element.bigCount };
+							}
 						}else{
-							list[index] = { ...element, bigCount: ++element.bigCount };
+							this.$util.noStockRemind()
+							this.$msg("库存不足!");
+							return;
 						}
 					}else{
-						if (this.isLimit) {
+						if (this.checkStock) {
 							if (element.bigCount < item.bigNum) {
 								if(this.isSmallCount){
 									list[index] = { ...element, smallCount: ++element.smallCount };
@@ -349,9 +342,7 @@ export default {
 									list[index] = { ...element, bigCount: ++element.bigCount };
 								}
 							}else{
-
 								this.$util.noStockRemind()
-
 								this.$msg("库存不足!");
 								return;
 							}
@@ -362,50 +353,34 @@ export default {
 								list[index] = { ...element, bigCount: ++element.bigCount };
 							}
 						}
-						if (this.isLimit) {
+						if (this.checkStock) {
 							const { bigCount, smallCount } = list[index];
-							//超过库存时 设置为库存最大值
 							const ratio = Number(item.ratio);
 							if (Number(bigCount) * ratio + Number(smallCount) >Number(item.bigNum) * ratio + Number(item.smallNum)) {
-								list[index].bigCount = Number(item.bigNum);
-								list[index].smallCount = Number(item.smallNum);
-								this.$msg("库存不足。");
+								this.$util.noStockRemind()
+								this.$msg("库存不足!!");
 							}
 						}
 					}
 					break;
 				}
 			}
+			//没有在selectList添加过的花材直接添加
 			if (!has) {
-				let info = { classId: item.classId, id: item.id };
-
+				let info = {}
 				if(this.kdType == 'notPDA'){
-
-					const classInfo =
-						this.productInfoList &&
-						this.productInfoList.find(element => {
-							return element.classId == item.classId && element.child;
-						});
+					const classInfo = this.productInfoList && this.productInfoList.find(element => { return element.classId == item.classId && element.child })
 					if (classInfo) {
-						info = classInfo.child.find(ele => {
-							return ele.id == item.id;
-						});
+						info = classInfo.child.find(ele => { return ele.id == item.id });
 					}
-
 				}else if(this.kdType == 'PDA'){
 					info = item
 				}
-
-				let params = {
-					...info,
-					bigCount: this.isSmallCount?0:1, //扎数
-					smallCount: this.isSmallCount?1:0, //支数
-					autoPrice: 0 //调价价格
-				};
-				if (info.bigNum && info.bigNum > 0) {
+				let params = { ...info, bigCount: 1, smallCount: 0 }
+				if (info.bigNum && info.bigNum >= 1) {
 					list.push(params);
 				} else {
-					if(this.checkStock){
+					if(this.checkStock == false){
 						list.push(params);
 					}else{
 						this.$msg("库存不足..");
@@ -413,6 +388,7 @@ export default {
 					}
 				}
 			}
+
 			//点加号时增加花材补充userPrice字段 shish 20210728
 			list.forEach(function(product,index,array){
 				if(product.id == item.id){
@@ -420,7 +396,7 @@ export default {
 						array[index].userPrice = Number(product.bigPrice)
 					}
 				}
-			});
+			})
 
 			this.setSelectInfoByType({ type: this.pageType, info: list });
 
@@ -535,7 +511,7 @@ export default {
 					const { bigCount, smallCount } = list[index];
 					//超过库存时 设置为库存最大值
 					const ratio = Number(item.ratio);
-					if (this.isLimit) {
+					if (this.checkStock) {
 						if (
 							Number(bigCount) * ratio + Number(smallCount) >
 							Number(item.bigNum) * ratio + Number(item.smallNum)
@@ -711,4 +687,4 @@ export default {
 			}
 		}
 	}
-}
+}

+ 1 - 1
ghsApp/src/mixins/productContrapose.js

@@ -11,7 +11,7 @@ export default {
 			py: "", //拼音搜索条件
 			type: "", //库存预警时,固定为waring,其他情况不传或者传空
 			autoLoad: true, //自动获取商品信息
-			isLimit: true, //选择数量不能大于库存限制
+			checkStock: true, //选择数量不能大于库存限制
 			filterProductInfoContrapose:[],
 			allFilterProductInfoContrapose:[],
 			isMore:true,

+ 1 - 1
ghsApp/src/mixins/ptProductContrapose.js

@@ -9,7 +9,7 @@ export default {
 			py: "", //拼音搜索条件
 			type: "", //库存预警时,固定为waring,其他情况不传或者传空
 			autoLoad: true, //自动获取商品信息
-			isLimit: true, //选择数量不能大于库存限制
+			checkStock: true, //选择数量不能大于库存限制
 			filterProductInfoContrapose:[],
 			allFilterProductInfoContrapose:[],
 			isMore:true,

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

@@ -147,7 +147,7 @@ export default {
 	data() {
 		return {
 			pageType: "inventory",
-			isLimit: false,
+			checkStock: false,
 			isFocus: false,
 			isSmallCount:false,//是否是小单位(支)
 			checkStock:true,