shish há 2 anos atrás
pai
commit
a2129c731e
3 ficheiros alterados com 114 adições e 1084 exclusões
  1. 97 375
      ghsApp/src/admin/jh/list.vue
  2. 9 0
      ghsApp/src/api/jh/index.js
  3. 8 709
      ghsApp/src/mixins/jh.js

+ 97 - 375
ghsApp/src/admin/jh/list.vue

@@ -16,41 +16,43 @@
                   </view>
               </view>
               <view class="scroll-middle_bx">
-                  <scroll-view scroll-y scroll-with-animation class="tab-view" :scroll-top="scrollTop">
-                      <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 style="text-align: center;">{{ item.className || "" }}</text>
-                      </div>
-                  </scroll-view>
-                      <scroll-view scroll-y class="right-box" :scroll-into-view="scroll_into_view" scroll-with-animation="true"
-                              @scroll="scroll_detail" lower-threshold="100" @scrolltolower="scroll_bottom">
-  
-                      <block v-if="!$util.isEmpty(globalClassItemList)">
-                          <view class="item_list_bx selectAll" v-for="(classItem, classIndex) in globalClassItemList" :key="classIndex" :id="`class_${classIndex}`">
-                              <view class="item_list_title"> {{ classItem.className }}</view>
-                              <view v-if="classItem.child && !$util.isEmpty(classItem.child)">
-                                  <template v-for="(productItem, productIndex) in classItem.child">
-                                      <view style="height:255upx" :id="`class_${classIndex}`" :key="productIndex">
-                                          <ItemStock v-if="classItem.isActive" :info="productItem" @moreAction="moreAction" 
-                                          @doPrintLabel="doPrintLabel" @cancelDiscountFn="cancelDiscountFn" @cancelFullOff="cancelFullOff"
-                                          :ref="`productRef${productItem.id}`" @hideChangeFn="hideChangeFn" 
-                                          @cancelPreSellFn="cancelPreSellFn" @breakSingleItem="breakSingleItem">
-                                          </ItemStock>
-                                      </view>
-                                  </template>
-                              </view>
-                              <view v-else>
-                                  <view style="height:260upx;text-align:center;color:#CCCCCC;position: relative;">
-                                      <view style="position: absolute;margin:auto;top:130upx;left:0;right:0;bottom:0;">暂无花材</view>
-                                  </view>
-                              </view>
-                          </view>
-                      </block>
-                      <block v-else>
-                          <view style="width:100%">
-                              <app-wrapper-empty  title="加载中" :is-empty="$util.isEmpty(globalClassItemList)" />
-                          </view>
-                      </block>
-                  </scroll-view>
+                <scroll-view scroll-y scroll-with-animation class="tab-view" :scroll-top="scrollTop">
+                    <div v-for="(item, index) in globalJhClassList" :key="index" class="tab-bar-item" :class="[classIndex == index ? 'active' : '']" :data-current="index" @tap.stop="swichClass(index,item)">
+                        <text style="text-align: center;">{{ item.name || "" }}</text>
+                    </div>
+                </scroll-view>
+
+                <scroll-view scroll-y class="right-box" :scroll-into-view="scroll_into_view" scroll-with-animation="true"
+                            @scroll="scrolling" lower-threshold="100" @scrolltolower="scrollBottom">
+
+                    <block v-if="!$util.isEmpty(globalJhList)">
+                        <view class="item_list_bx selectAll">
+                            <view class="item_list_title"></view>
+                            <view v-if="!$util.isEmpty(globalJhList)">
+                                <template v-for="(productItem, productIndex) in globalJhList">
+                                    <view style="height:255upx" :key="productIndex">
+                                        <ItemStock :info="productItem" @moreAction="moreAction" 
+                                        @doPrintLabel="doPrintLabel" @cancelDiscountFn="cancelDiscountFn" @cancelFullOff="cancelFullOff"
+                                        :ref="`productRef${productItem.id}`" @hideChangeFn="hideChangeFn" 
+                                        @cancelPreSellFn="cancelPreSellFn" @breakSingleItem="breakSingleItem">
+                                        </ItemStock>
+                                    </view>
+                                </template>
+                            </view>
+                            <view v-else>
+                                <view style="height:260upx;text-align:center;color:#CCCCCC;position: relative;">
+                                    <view style="position: absolute;margin:auto;top:130upx;left:0;right:0;bottom:0;">暂无花材</view>
+                                </view>
+                            </view>
+                        </view>
+                    </block>
+                    <block v-else>
+                        <view style="width:100%">
+                            <app-wrapper-empty  title="加载中" :is-empty="$util.isEmpty(globalJhList)" />
+                        </view>
+                    </block>
+                </scroll-view>
+
               </view>
           </view>
   
@@ -77,10 +79,11 @@
               </div>
           </template>
           </modal-module>
+
           <uni-popup ref="selectFlowerNumRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
               <view style="display:flex;padding:20upx;height:auto;justify-content: space-between;align-items:center;flex-wrap:wrap;max-height:100vh;overflow:auto;">
   
-                  <view v-for="(item, index) in globalClassItemList" :key="index" @tap.stop="changeClass(index)" style="margin-bottom:20upx;margin-left:3upx;">
+                  <view v-for="(item, index) in globalJhList" :key="index" @tap.stop="changeClass(index,item)" style="margin-bottom:20upx;margin-left:3upx;">
                   <image :src="item.classCover" style="width:120upx;height:120upx;border-radius:10upx;"></image>
                   <view style="margin-top:5upx;overflow: hidden;white-space: nowrap;width:120upx;text-align:center;">{{item.className}}</view>
                   </view>
@@ -97,7 +100,6 @@
                   <view style="width:100vw;margin-top:8upx;"><button @click="orderRecord()">下单记录</button></view>
                   <view style="width:100vw;margin-top:8upx;"><button @click="copyCreate()">复制新建</button></view>
                   <view style="width:100vw;margin-top:8upx;"><button @click="onStockChange()">路上库存变动</button></view>
-                  <view style="width:100vw;margin-top:8upx;"><button @click="sendStock()">分配库存</button></view>
                   <view style="width:100vw;margin-top:8upx;"><button @click="shareItem()">打开分享(批发)</button></view>
                   <view style="width:100vw;margin-top:8upx;"><button @click="getHdPosterFn()">分享海报(批发)</button></view>
                   <view style="width:100vw;margin-top:8upx;"><button @click="getSkPosterFn()">分享海报(零售)</button></view>
@@ -128,7 +130,8 @@
   import jhMins from "@/mixins/jh";
   import { mapGetters } from "vuex";
   import { getWeixinId } from "@/api/invite";
-  import { print,cancelDiscountPrice,cancelPreSell,delStatusUpdate,cancelFullOffFn } from '@/api/product';
+  import { getJhClassMenu,getJhList } from "@/api/jh";
+  import { print,cancelDiscountPrice,cancelPreSell } from '@/api/product';
   import { getHdPoster,getSkPoster,breakItem,changeFrontHide,applyAuth } from '@/api/item'
   import uniPopup from '@/uni_modules/uni-popup/components/uni-popup/uni-popup.vue';
   import ModalModule from "@/components/plugin/modal"
@@ -160,7 +163,13 @@
               posterUrl:'',
               breakNum:'',
               breakFocus:false,
-              breakShow:false
+              breakShow:false,
+              classIndex: 0,
+              globalJhClassList:[],
+                globalJhList:[],
+                page:1,
+                currentClassId:0,
+                finishGetJh:0
           };
       },
       computed:{
@@ -168,344 +177,57 @@
           ...mapGetters({ loginInfo: "getLoginInfo",dictInfo:"getDictionariesInfo" })
       },
       onLoad() {
-          this.initItem()
-          let that = this
-          getWeixinId().then(res => {
-              that.getAppIdList = res.data
-          })
+
+        let that = this
+        getWeixinId().then(res => {
+            that.getAppIdList = res.data
+        })
+
+        getJhClassMenu().then(res=>{
+            if(res.code == 1){
+                that.globalJhClassList = res.data.list ? res.data.list : []
+                if(!this.$util.isEmpty(that.globalJhClassList)){
+                    let current = that.globalJhClassList[0]
+                    that.currentClassId = current.id
+                    that.getJhList()
+                }
+            }
+        })
       },
       methods: {
-          initItem(){
-              this.shopId = this.getMyShopInfo.id;
-              let type = '';
-              if(this.option.delStatus){
-                  this.delStatus = this.option.delStatus
-              }
-              let requestType = this.option.warning && this.option.warning == 1 ? 'warning' : 'itemList'
-              this.initData({ type, shopId: this.shopId,status:this.status,delStatus:this.delStatus,requestType:requestType}).then(res=>{
-                  uni.hideLoading()
-              })
-          },
-          refreshItem(){
-              uni.showLoading({mask:true})
-              this.py = ''
-              this.initItem()
-          },
-          hideChangeFn(item,status){
-              let that = this
-              changeFrontHide({id:item.id,status:status}).then(res=>{
-                  if(res.code == 1){
-                      that.$refs[`productRef${item.id}`][0].frontHide = status
-                  }
-              })
-          },
-          breakSingleItem(item){
-              let that = this
-              this.breakNum = 1
-              that.$util.confirmModal({content:'确定拆1份?'},() => {
-                  that.breakAction()
-              })
-          },
-          breakMore(){
-              this.closeRightShow()
-              this.breakShow = true
-              this.breakNum = null
-              setTimeout(x => {
-                  this.$nextTick(() => this.setBreakFocus())
-              }, 200)
-          },
-          breakAction(){
-              let that = this
-              breakItem({breakNum:that.breakNum,id:that.currentInfo.id}).then(res=>{
-                  if(res.code == 1){
-                      that.breakShow = false
-                      that.breakFocus = false
-                      that.$msg(res.msg)
-                  }
-              })
-          },
-          breakConfirm(val){
-              let that=this;
-              if (val.index == 0) {
-                  that.breakShow = false
-                  that.breakFocus = false
-                  return false
-              }
-              if (this.breakNum == null) {
-                  that.$msg('请填写数量')
-                  that.breakFocus = true
-                  return false
-              }
-              if (Number(this.breakNum) <= 0) {
-                  that.$msg('数量不能小于1')
-                  that.breakFocus = true
-                  return false
-              }
-              that.$util.confirmModal({content:'确认拆'+that.breakNum+'份?'},() => {
-                  that.breakAction()
-              })
-          },
-          setBreakFocus(){
-              this.breakFocus = true
-          },
-          cancelPreSellFn(item){
-              let that = this
-              this.$util.confirmModal({content:'确认取消预售?'},() => {
-                  cancelPreSell({id:item.id}).then(res=>{
-                      if(res.code == 1){
-                          that.$msg(res.msg)
-                      }
-                  })
-              })
-          },
-          cancelDiscountFn(item){
-              let that = this
-              this.$util.confirmModal({content:'确认取消特价?'},() => {
-                  cancelDiscountPrice({id:item.id}).then(res=>{
-                      if(res.code == 1){
-                          that.$msg(res.msg)
-                      }
-                  })
-              })
-          },
-          cancelFullOff(item){
-              let that = this
-              this.$util.confirmModal({content:'确认取消满减?'},() => {
-                  cancelFullOffFn({id:item.id}).then(res=>{
-                      if(res.code == 1){
-                          that.$msg(res.msg)
-                      }
-                  })
-              })
-          },
-          closePoster(){
-              this.$refs.posterShow.close()
-          },
-          getHdPosterFn(){
-              this.closeRightShow()
-              let that = this
-              uni.showLoading({mask:true})
-              getHdPoster({id:this.currentInfo.id}).then(res=>{
-                  uni.hideLoading()
-                  if(res.code == 1){
-                      that.posterUrl = res.data.imgUrl
-                      that.$refs.posterShow.open('top')
-                  }
-              })
-          },
-          getSkPosterFn(){
-              this.closeRightShow()
-              let that = this
-              uni.showLoading({mask:true})
-              getSkPoster({id:this.currentInfo.id}).then(res=>{
-                  uni.hideLoading()
-                  if(res.code == 1){
-                      that.posterUrl = res.data.imgUrl
-                      that.$refs.posterShow.open('top')
-                  }
-              })
-          },
-          sendStock(){
-              this.pageTo({url: '/admin/item/sendStock?id='+this.currentInfo.id+'&price='+this.currentInfo.price+'&stock='+this.currentInfo.stock+'&name='+this.currentInfo.name,type:2})
-          },
-          downloadImg(){
-              let that = this
-              uni.downloadFile({
-                  url: this.posterUrl,
-                  success: (res) => {
-                      if (res.statusCode === 200) {
-                          uni.saveImageToPhotosAlbum({
-                          filePath: res.tempFilePath,
-                          success: function (data) {
-                              that.$refs.posterShow.close()
-                              uni.showToast({title:'保存成功'})
-                          }
-                          });
-                      }
-                  }
-              });
-          },
-          changeClass(index){
-              this.$refs.selectFlowerNumRef.close()
-              this.swichClass(index)
-          },
-          selectFlowerNumFn(){
-              this.$refs.selectFlowerNumRef.open('top')
-          },
-          blur() {
-              this.printFocus = false
-          },
-          doPrintLabel(id,type){
-              this.printItemId = id
-              this.printType = type
-              this.printLabelShow = true
-              this.printNum = null
-              setTimeout(x => {
-                  this.$nextTick(() => this.setFocus())
-              }, 200)
-          },
-          setFocus() {
-              this.printFocus = true
-          },
-          dialogInputConfirm(val) {
-              let that=this;
-              if (val.index == 0) {
-                  that.printLabelShow = false
-                  that.printFocus = false
-                  return
-              }
-              let currentNum = this.printNum
-              let itemId = this.printItemId
-              if (currentNum == null) {
-                  that.$msg('请填写数量')
-                  that.printFocus = true
-                  return
-              }
-              if (currentNum <= 0) {
-                  that.$msg('数量不能小于1')
-                  that.printFocus = true
-                  return
-              }
-              if (itemId == 0) {
-                  that.$msg('打印的花材id出错')
-                  that.printLabelShow = false
-                  that.printFocus = false
-                  return
-              }
-              print({id:itemId,num:currentNum,type:this.printType}).then(res=>{
-                  if(res.code == 1){
-                      that.printLabelShow = false
-                      that.printFocus = false
-                      uni.showToast({ title: '操作成功', duration: 1500 })
-                  } else if(res.code == 0){
-                      that.printLabelShow = false
-                      that.printFocus = false
-                      that.$msg(res.msg)
-                  }
-              })
-          },
-          closeRightShow(){
-              this.$refs.rightShowMore.close()
-          },
-          costChange(){
-              this.closeRightShow()
-              this.pageTo({url: '/admin/changePrice/costChangeList?id='+this.currentInfo.id})
-          },
-          ptAuth(){
-              let that = this
-              that.$util.confirmModal({content:'确认申请?'},() => {
-                  applyAuth({id:this.currentInfo.id}).then(res=>{
-                      if(res.code == 1){
-                          that.closeRightShow()
-                          that.$msg('已提交申请')
-                      }
-                  })
-              })
-          },
-          delItem(){
-              let that = this
-              that.$util.confirmModal({content:'确认删除?'},() => {
-                  delStatusUpdate({id:this.currentInfo.id,delStatus:1}).then(res=>{
-                      if(res.code == 1){
-                          that.closeRightShow()
-                          that.$msg('删除成功')
-                      }
-                  })
-              })
-          },
-          onStockChange(){
-              this.closeRightShow()
-              this.pageTo({url: '/pagesStorehouse/stockWarn/onStockChange?id='+this.currentInfo.id+'&name='+this.currentInfo.name})
-          },
-          priceChange(){
-              this.closeRightShow()
-              this.pageTo({url: '/admin/changePrice/changeList?id='+this.currentInfo.id})
-          },
-          varietyManage(){
-              this.closeRightShow()
-              this.pageTo({url: "/admin/item/xjSelect?itemId="+this.currentInfo.id})
-          },
-          copyCreate(){
-              this.closeRightShow()
-              this.pageTo({url: '/admin/item/copy?id='+this.currentInfo.id})
-          },
-          orderRecord(){
-              this.closeRightShow()
-              this.pageTo({url: "/admin/order/itemOrder?productId="+this.currentInfo.id})
-          },
-          preSell(){
-              this.closeRightShow()
-              this.pageTo({url: "/admin/item/presell?id="+this.currentInfo.id})
-          },
-          moreAction(item){
-              this.currentInfo = item
-              this.$refs.rightShowMore.open('top')
-          },
-          shareItem() {
-              let that = this
-              let id = this.currentInfo.id
-              this.closeRightShow()
-              // #ifdef MP-WEIXIN
-              console.log('admin/ghsProduct/detail?shopId='+ that.loginInfo.shopId+'&id=0&ghsShopAdminId='+that.loginInfo.shopAdminId+'&id='+id)
-              uni.navigateToMiniProgram({
-                  //姜枫-2021.04.13
-                  appId: that.getAppIdList.hd.miniAppId,
-                  path: 'admin/ghsProduct/detail?shopId='+ that.loginInfo.shopId+'&ghsShopAdminId='+that.loginInfo.shopAdminId+'&id='+id,
-                  //develop 开发版 trial 体验版 release 正式版
-                  envVersion: process.env.NODE_ENV === 'development' ? 'develop' : 'release',
-                  extraData: {
-                      'shopId': that.loginInfo.shopId,
-                      'id': 0,
-                      'name':'',
-                  },
-                  success (res) {
-                  }
-              })
-              // #endif
-              // #ifdef APP-PLUS
-              if(plus.runtime.isApplicationExist({pname:'com.tencent.mm',action:'weixin://'})){
-                  var sweixin
-                  plus.share.getServices(function(s){
-                      for (var i = 0; i < s.length; i++) {
-                          var t = s[i];
-                          if (t.id == 'weixin') {
-                              sweixin = t;
-                          }
-                      }
-                      let miniOriginalId = that.dictInfo.miniOriginalId && that.dictInfo.miniOriginalId.current && that.dictInfo.miniOriginalId.current.hd ? that.dictInfo.miniOriginalId.current.hd : ''
-                      if (sweixin) { //&& sweixin.nativeClient
-                          sweixin.launchMiniProgram({
-                              id: miniOriginalId,
-                              path: 'admin/ghsProduct/detail?shopId='+ that.loginInfo.shopId+'&ghsShopAdminId='+that.loginInfo.shopAdminId+'&id='+id,
-                              type: 0
-                          });
-                      } else {
-                          that.$msg('没有找到微信服务');
-                          return false;
-                      }
-                  }, function(e){
-                      that.$msg("没有找到微信服务哦")
-                      //that.$msg("获取微信失败:" + e.message)
-                      //console.log(JSON.stringify(e));
-                  });
-              }else{
-                  this.$msg("请安装微信,再打开小程序")
-                  return false
-              }
-              // #endif
-          },
-          affirm(val) {
-              if (val.index === 0) {
-                  this.modalCancel();
-              } else {
-              }
-          },
-          scrollTop() {},
-          initProductInfo() {
-              this.globalClassItemListContrapose = [];
-              this.page = 1;
-              this.isMore = true;
-          }
+        getJhList(){
+            if(this.finishGetJh == 1){
+                return false
+            }
+            let that = this
+            getJhList({classId:that.currentClassId,page:that.page}).then(res=>{
+                if(res.code == 1){
+                    that.globalJhList = that.page == 1 ? res.data.list : that.globalJhList.concat(res.data.list)
+                    if(res.data.moreData == 1){
+                        that.page++
+                    }else{
+                        that.finishGetJh = 1
+                    }
+                }
+            })
+        },
+		swichClass(cur,item) {
+			this.classIndex = cur
+            this.page = 1
+            this.currentClassId = item.id
+            this.finishGetJh = 0
+            this.getJhList()
+		},
+		scrollBottom(){
+            this.getJhList()
+        },
+        scrolling(){
+
+        },
+        changeClass(index,item){
+            this.$refs.selectFlowerNumRef.close()
+            this.swichClass(index,item)
+        }
       }
   };
   </script>

+ 9 - 0
ghsApp/src/api/jh/index.js

@@ -0,0 +1,9 @@
+import https from '@/plugins/luch-request_0.0.7/request'
+
+export const getJhClassMenu = data => {
+	return https.get('/jh-class/get-menu', data)
+}
+
+export const getJhList = data => {
+	return https.get('/jh/list', data)
+}

+ 8 - 709
ghsApp/src/mixins/jh.js

@@ -1,730 +1,29 @@
-import { getProductDataApi,getStockInItem } from "@/api/product";
 import { mapGetters, mapActions } from "vuex";
 import { copyObject } from "@/utils/util"
-import { allProduct } from '@/api/product'
 export default {
 	data() {
 		return {
-			selectJobType: "bill",//业务类型,开单、采购、损耗、盘点
-			selectJobId:0,//业务类型对应的主体ID等
-			isCut:false,
-			productInfoList: [], //商品信息
-			classIndex: 0, //当前商品类别下标
-			py: "", //拼音搜索条件
-			type: "", //库存预警时,固定为waring,其他情况不传或者传空
-			autoLoad: true, //自动获取商品信息
-			allFilterProductInfo:'',
-			globalClassItemList:'',
-			top_list:'',
-			//id动态切换
-			scroll_into_view:"",
-			timeFun:"",
-			kdType:'HIT',//点击和扫码开单,HIT SCAN
-			checkStock:true,// 考虑库存,盘点不需要考虑库存
-			isAddModel:false,
-			isAddInputFocus:false,
-			customData: { bigCount: 0, smallCount: 0, userPrice: 0 },
-			globalItemList:[],
-			//当前页面默认使用的单位 0大单位 1小单位
-			globalUnitType:0,
-			globalAllProduct:[],
-			calc:'add'
-		};
-	},
-	onLoad(options) {
-		const { selectJobType } = options;
-		if (selectJobType) {
-			this.selectJobType = selectJobType;
+
 		}
 	},
-	onUnload() {},
+	onLoad() {
+
+	},
+	onUnload(){
+
+	},
 	computed: {
-		...mapGetters(["getSelectInfo"]),
-		//当前页面选中的商品列表
-		selectList() {
-			let selectInfo = this.getSelectInfo;
-			return selectInfo[this.selectJobType+'_'+this.selectJobId] || []
-		},
-		scrollClassId() {
-			const curClass = this.productInfoList[this.classIndex];
-			if (curClass) {
-				return `class_${curClass.classId}`;
-			}
-			return "";
-		},
-		allPrice() {
-			let price = 0;
-			if (this.selectList) {
-				for (const item of this.selectList) {
-					const itemInfo = this.getSelectItemById(item.id, item.classId);
-					if (itemInfo && !this.$util.isEmpty(itemInfo.bigPrice) && !this.$util.isEmpty(itemInfo.smallPrice)) {
-						if(item.userPrice>0){
-							if(Number(item.bigCount) > 0){
-								price += Number(item.bigCount) * Number(itemInfo.userPrice);
-							}
-							if(Number(item.smallCount) > 0){
-								price += Number(item.smallCount) * Number(itemInfo.userPrice);	
-							}
-						}else{
-							if(Number(item.bigCount) > 0){
-								price += Number(item.bigCount) * Number(itemInfo.bigPrice);
-							}
-							if(Number(item.smallCount) > 0){
-								price += Number(item.smallCount) * Number(itemInfo.smallPrice);	
-							}
-						}
-					}
-				}
-			}
-			return Math.round(price * 100) / 100;
-		},
-		//选择商品总数
-		allCount() {
-			let bigLength = 0;
-			let smallLength = 0;
-			let weight = 0
-			if (this.selectList) {
-				for (const item of this.selectList) {
-					bigLength += Number(item.bigCount)
-					smallLength += Number(item.smallCount)
-					let thisWeight = item.weight ? item.weight : 0
-					let currentWeight = Number(thisWeight)*Number(item.bigCount)
-					weight = Number(weight) + Number(currentWeight)
-				}
-				weight = weight.toFixed(2)
-				weight = parseFloat(weight)
-			}
-			return {bigLength:bigLength,smallLength:smallLength,weight:weight};
-		},
-		//当前选中商品列表中是否有没有库存的商品
-		hasNoStock() {
-			let has = false;
-			if (this.selectList) {
-				for (const item of this.selectList) {
-					const {
-						bigCount,
-						smallCount,
-						bigNum,
-						smallNum,
-						ratio
-					} = item;
-					const ratioNum = Number(ratio);
-					if (
-						Number(bigCount) * ratioNum + Number(smallCount) >
-						Number(bigNum) * ratioNum + Number(smallNum)
-					) {
-						has = true;
-						break;
-					}
-				}
-			}
-			return has;
-		}
+
 	},
 	onShow(){
 
 	},
 	methods: {
-		...mapActions(["setSelectInfo", "reSetSelectInfo"]),
 		init(){
-			if (this.autoLoad) {
-				this.initData();
-			}
-		},
-		//放到仓库
-		pushToSave(selectData){
-			this.setSelectInfo({ selectJobType: this.selectJobType, info: selectData,selectJobId:this.selectJobId })
-			uni.setStorageSync('selectList_'+this.selectJobType+'_target_'+this.selectJobId, selectData)
-		},
-		//询问是否删除缓存
-		removeFromSave(){
-			let that = this
-			that.$util.confirmModal({content:'确认清除花材?'},() => {
-				that.removeFromSaveDirect()
-				that.$msg('已清除')
-            })
-		},
-		//直接删除缓存
-		removeFromSaveDirect(){
-			let that = this
-
-			uni.removeStorageSync('selectList_'+that.selectJobType+'_target_'+that.selectJobId)
-			that.reSetSelectInfo({selectJobType:that.selectJobType,selectJobId:that.selectJobId})
 
-			//删除多颜色
-			//console.log(that.selectJobType+that.selectJobId)
-			if(that.selectJobType == 'bill'){
-				uni.removeStorageSync("xj"+that.selectJobId)
-			}
-
-			if(!this.$util.isEmpty(this.globalClassItemList)){
-				this.globalClassItemList.forEach((item,index,arr) =>{
-					if(!this.$util.isEmpty(arr[index].child)){
-						arr[index].child.forEach((ele,i,son)=>{
-							arr[index].child[i].bigCount = 0;
-							arr[index].child[i].smallCount = 0;
-							arr[index].child[i].userPrice = 0;
-						})
-					}
-				})
-				this.$forceUpdate()
-			}
-		},
-		//请求商品数据
-		async initData(extendInfo) {
-			let params = {type: this.type,customId:this.option.customId}
-			if (extendInfo) {
-				params = { ...params, ...extendInfo };
-			}
-			//区分获取正常花材和当天入库花材
-			let hostFn = extendInfo && extendInfo.pdType && extendInfo.pdType == 'stockInPd' ? getStockInItem : getProductDataApi;
-			const { data } = await hostFn(params);
-			let currentClassItem = data.classItem ? data.classItem : []
-			let currentItemList = data.itemList ? data.itemList : []
-
-			this.globalItemList = currentItemList
-
-			this.productInfoList = currentClassItem
-
-			let currentInfo = uni.getStorageSync('selectList_'+this.selectJobType+'_target_'+this.selectJobId)
-			if(!this.$util.isEmpty(currentInfo)){
-				this.setSelectInfo({ selectJobType: this.selectJobType, info: currentInfo,selectJobId:this.selectJobId })
-			}
-			this.classIndex = 0;
-			this.scroll_into_view = 'class_0';
-			this.scrollPushList();
 		},
-		//滚动或切换分类 获取更多数据
-		scrollPushList(){
-
-			//涉及记住花材的代码和流程,请全项目搜索关键词remember_item
-			//将已选的花材按classId_productId键名组合
-			let selectListData = []
-			if(!this.$util.isEmpty(this.selectList)){
-				this.selectList.forEach((i)=>{
-					selectListData[i.id] = i
-				})
-			}
-
-			let list = copyObject(this.productInfoList);
-			let classList = [];
-			for (let i=0;i<list.length;i++){
-
-				//将已选的花材数量和价格组合到总列表里
-				if(!this.$util.isEmpty(list[i].child)){
-					let currentChildren = list[i].child
-					for(let x=0;x<currentChildren.length;x++){
-						let currentProduct = currentChildren[x]
-						let currentPId = currentProduct.id
-						let selectProduct = selectListData[currentPId] || []
-						if(!this.$util.isEmpty(selectProduct)){
-							list[i].child[x].bigCount = selectProduct.bigCount || 0
-							list[i].child[x].userPrice = selectProduct.userPrice || 0
-							list[i].child[x].smallCount = selectProduct.smallCount || 0
-						}else{
-							list[i].child[x].bigCount = 0
-							list[i].child[x].userPrice = 0
-							list[i].child[x].smallCount = 0
-						}
-					}
-				}
-				
-				if(i==0){
-					classList.push({...list[i],isActive:true});
-				}else if(i == 1){
-					if(list[0].child && list[0].child.length >= 5){
-						classList.push({...list[i],isActive:false});	
-					}else{
-						classList.push({...list[i],isActive:true});
-					}
-				}else{
-					classList.push({...list[i],isActive:false});
-				}
-
-			}
-			this.globalClassItemList = classList
-		},
-		//搜索对应花材
 		searchFn() {
-			let list = this.globalItemList
-			if(this.$util.isEmpty(this.py)){
-				this.globalClassItemList = '';
-				this.classIndex = 0;
-				this.scroll_into_view = 'class_'+0;
-				this.scrollPushList();
-				return
-			}
-
-			var reg = /^[0-9a-zA-Z]*$/g
-			let notChinese = reg.test(this.py) == true ? true : false
-
-			//大于等于2个字符才开始搜索 shish 20210622
-			if(this.py.length <=1){
-				return
-			}
-			//颜色花材太多,搜索时会卡住,所以设置输入第三个字母时才搜索
-			if(this.py.indexOf('fs') == 0 && this.py.length <= 2){
-				return
-			}
-			if(this.py.indexOf('粉色') == 0 && this.py.length <= 2){
-				return
-			}
-			if(this.py.indexOf('hs') == 0 && this.py.length <= 2){
-				return
-			}
-			if(this.py.indexOf('红色') == 0 && this.py.length <= 2){
-				return
-			}
-			if(this.py.indexOf('黄色') == 0 && this.py.length <= 2){
-				return
-			}
-			if(this.py.indexOf('zs') == 0 && this.py.length <= 2){
-				return
-			}
-			if(this.py.indexOf('紫色') == 0 && this.py.length <= 2){
-				return
-			}
-			if(this.py.indexOf('ls') == 0 && this.py.length <= 2){
-				return
-			}
-			if(this.py.indexOf('绿色') == 0 && this.py.length <= 2){
-				return
-			}
-			if(this.py.indexOf('bs') == 0 && this.py.length <= 2){
-				return
-			}
-			if(this.py.indexOf('白色') == 0 && this.py.length <= 2){
-				return
-			}
-			if(this.py.indexOf('cs') == 0 && this.py.length <= 2){
-				return
-			}
-			if(this.py.indexOf('橙色') == 0 && this.py.length <= 2){
-				return
-			}
-			if(this.py.indexOf('银色') == 0 && this.py.length <= 2){
-				return
-			}
-			if(this.py.indexOf('yj') == 0 && this.py.length <= 2){
-				return
-			}
-
-			//涉及记住花材的代码和流程,请全项目搜索关键词remember_item
-			//将已选的花材按productId键名组合
-			let selectListData = []
-			if(!this.$util.isEmpty(this.selectList)){
-				this.selectList.forEach((i)=>{
-					selectListData[i.id] = i
-				})
-			}
-
-			let filterItemData = [];
-			list.forEach(currentItem => {
-
-				//组合已记忆已选择的花材
-				let currentPId = currentItem.id
-				let selectProduct = selectListData[currentPId] || []
-				if(!this.$util.isEmpty(selectProduct)){
-					currentItem.bigCount = selectProduct.bigCount || 0
-					currentItem.userPrice = selectProduct.userPrice || 0
-					currentItem.smallCount = selectProduct.smallCount || 0
-				}else{
-					currentItem.bigCount = 0
-					currentItem.userPrice = 0
-					currentItem.smallCount = 0
-				}
-				let has = false
-				if (notChinese){
-					let elePy = (currentItem.py && currentItem.py.toLocaleUpperCase()) || "";
-					has = elePy.indexOf(this.py.toLocaleUpperCase()) >= 0 ? true : false
-				}else{
-					has = currentItem.name && currentItem.name.indexOf(this.py) >= 0 ? true : false
-				}
-				if (has) {
-					if(this.$util.isEmpty(filterItemData)){
-						filterItemData = [{classId: currentItem.classId, className: currentItem.className,isActive:true,child:[currentItem]}]
-					}else{
-						filterItemData.forEach(res => {
-							if(res.classId==currentItem.classId){
-								res.child.push(currentItem)
-							}else{
-								filterItemData.push({classId: currentItem.classId, className: currentItem.className,isActive:true,child:[currentItem]})
-							}
-						})
-					}
-				}
-			})
 
-			let searchList = this.$util.unique(filterItemData)
-			this.globalClassItemList = searchList;
-			this.classIndex = 0;
-			this.scroll_into_view = 'class_'+0;
-		},
-		//获取当前选中商品总价
-		getSelectItemPrice(item) {
-			let price = 0;
-			const { bigCount, smallCount, bigPrice, smallPrice } = item;
-			let sum =
-				Number(bigCount) * Number(bigPrice) +
-				Number(smallCount) * Number(smallPrice);
-			price = Math.round(sum * 100) / 100;
-			return price;
-		},
-		//通过id获取当前选中的商品信息
-		getSelectItemById(id, classId) {
-			let info = { bigCount: null, smallCount: null, autoPrice: null, itemPrice: null }
-			const item = this.selectList && this.selectList.find(ele => { return ele.id == id && ele.classId == classId })
-			if (item) {
-				info = { ...item, bigCount: Number(item.bigCount), smallCount: Number(item.smallCount), autoPrice: Number(item.autoPrice), itemPrice: Number(item.itemPrice)}
-			}
-			return info;
-		},
-		//添加删除和修改花材
-		//multiple 0一个一个加减 1弹框方式,多个加减
-		//calc 当multiple=0时,add表示加,sub表示减
-		replaceItemFn(product,multiple=0,calc='add',scan=0) {
-			let item = copyObject(product)
-			if(multiple == 0){
-				if(Number(item.smallCount)>0){
-					if(calc == 'add'){
-						item.smallCount++
-					}
-					if(calc == 'sub'){
-						item.smallCount--
-					}
-				}else{
-					if(calc == 'add'){
-						item.bigCount++
-					}
-					if(calc == 'sub'){
-						item.bigCount--
-					}					
-				}
-			}
-
-			const list = this.selectList
-
-			let index = list.findIndex(element => element.id == item.id)
-
-			//扫码数量累加
-			if(index != -1 && scan == 1){
-				item.bigCount = parseInt(Number(item.bigCount)+Number(list[index].bigCount))
-				item.smallCount = parseInt(Number(item.smallCount)+Number(list[index].smallCount))
-			}
-
-			//扫码会出现负数
-			if(Number(item.bigCount)<0 || Number(item.smallCount)<0){
-				return false
-			}
-
-			if(this.checkStock){
-				let currentCount = Number(item.bigCount) * item.ratio + Number(item.smallCount)
-				currentCount = currentCount.toFixed(2)
-				let currentNum = Number(item.bigNum) * item.ratio + Number(item.smallNum)
-				currentNum = currentNum.toFixed(2)
-				console.log(currentCount+' '+currentNum)
-				if (Number(currentCount) > Number(currentNum)) {
-					console.log('库存不足。。。')
-					this.$util.noStockRemind()
-					this.$msg("库存不足哦")
-					return
-				}
-			}
-
-			if(index == -1){
-				if(this.$util.isEmpty(item.userPrice) || Number(item.userPrice) == 0){
-					item.userPrice = item.bigPrice
-				}
-				list.push(item)			
-			}else{
-				if(item.bigCount <= 0 && item.smallCount <= 0){
-					//删除花材
-					list.splice(index,1)
-				}else{
-					list[index].bigCount = item.bigCount
-					list[index].smallCount = item.smallCount
-					list[index].userPrice = item.userPrice
-				}
-			}
-			//点击要响声
-			if(this.kdType == 'HIT' && multiple ==0){
-				this.$util.hitRemind()
-			}
-			//扫码要响声
-			if(scan == 1){
-				this.$util.hitRemind()
-			}
-			
-			//数据放到仓库永久存放
-			this.pushToSave(list)
-
-			this.itemNumPriceRefresh()
-
-
-		},
-		listenScanItem(){
-			let that = this
-			// #ifdef APP-PLUS
-			//避免重复,每次进来先移除全局自定义事件监听器
-			uni.$off('listenGetScanCode')
-			uni.$on('listenGetScanCode',function(data){
-				that.takeItem(data.code)
-			})
-			// #endif
-			allProduct().then(res=>{
-				if(res.code == 1){
-					that.globalAllProduct = res.data.list
-					console.log('载入最新花材...')
-				}
-			})
-    	},
-		takeItem(code){
-			if(this.$util.isEmpty(code)){
-				return false
-			}
-			let current = null
-			let unitPrice = 0
-			let unitName = ''
-			//花材
-			current = this.globalAllProduct.find(function(val){
-				return Number(val.itemId) == Number(code)
-			})
-			if(current == undefined){
-				return false
-			}
-			if(this.$util.isEmpty(current)){
-				return false
-			}
-			unitName = current.bigUnit
-			unitPrice = current.bigPrice
-			let num = this.calc == 'add' ? 1 : -1
-			let params = {...current,unitName:unitName,userPrice:unitPrice,bigCount:num,smallCount:0}
-			this.replaceItemFn(params,1,'add',1)
-		},
-		//大小单位切换
-		switchGlobalUnitType(){
-			if(this.globalUnitType == 0){
-				this.globalUnitType = 1
-				this.customData.userPrice = parseFloat(this.customData.smallPrice)
-				this.customData.bigCount = null
-			}else{
-				this.globalUnitType = 0
-				this.customData.userPrice = parseFloat(this.customData.bigPrice)
-				this.customData.smallCount = null
-			}
-		},
-		//显示可以修改花材的弹框
-		showAddModelFn(info) {
-
-			if(info && info.variety == 1 && this.selectJobType == 'bill'){
-				let curPage = getCurrentPages();
-				let route = curPage[curPage.length - 1].route;
-				if(route == 'admin/billing/affirm'){
-					this.$msg('多颜色花材,请返回修改')
-					return false
-				}
-			}
-
-			if(info.bigNum <= 0 && info.smallNum <= 0){
-				if(this.checkStock){
-					this.$util.noStockRemind()
-					this.$msg('库存不足哦..')
-					return false
-				}
-			}
-
-			//弹框时默认显示的单位
-			if(Number(info.smallCount)>0){
-				this.globalUnitType = 1
-			}else{
-				this.globalUnitType = 0
-			}
-
-			this.isAddModel = true;
-			this.customData = copyObject(info)
-			this.isAddInputFocus = 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;
-				if(this.selectJobType == 'bill'){
-					if(this.customData.userPrice == null || this.customData.userPrice == 0){
-						this.customData.userPrice =	parseFloat(this.customData.bigPrice)
-					}
-				}else{
-					this.customData.userPrice = this.customData.userPrice==0 ? null : parseFloat(this.customData.userPrice)
-				}
-				this.isAddInputFocus = true;
-			})
-		},
-		confirmAddItemModel(val) {
-			if (val.index === 0) {
-				this.addItemModelHidden();
-				return false
-			}
-
-			//二个都不是数值
-			if(/(^[1-9]\d*$)/.test(this.customData.bigCount) == false && /(^[1-9]\d*$)/.test(this.customData.smallCount) == false){
-				uni.showToast({title:"请填写数值",icon:"none"})
-				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;
-				}
-			}
-			//只有开单和采购需要使用价格
-			if(this.selectJobType == 'bill' || this.selectJobType == 'purchase'){
-				if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.customData.userPrice) == false){
-					uni.showToast({title:"金额错误",icon:"none"})
-					return;
-				}
-				if(this.customData.userPrice <=0){
-					uni.showToast({title:"金额要大于0",icon:"none"})
-					return;
-				}
-			}
-			this.replaceItemFn(this.customData,1)
-			this.addItemModelHidden()			
-		},
-		addItemModelHidden() {
-			this.isAddModel = false;
-			this.customData = {};
-		},
-		itemNumPriceRefresh(){
-			//涉及记住花材的代码和流程,请全项目搜索关键词remember_item
-			//将已选的花材按classId_productId键名组合
-			let selectListData = []
-			if(!this.$util.isEmpty(this.selectList)){
-				this.selectList.forEach((i)=>{
-					selectListData[i.id] = i
-				})
-			}
-			let upList = this.globalClassItemList;
-			if(this.$util.isEmpty(upList)){
-				return false
-			}
-			for (let i=0;i<upList.length;i++){
-				//将已选的花材数量和价格组合到总列表里
-				if(!this.$util.isEmpty(upList[i].child)){
-					let currentChildren = upList[i].child
-					for(let x=0;x<currentChildren.length;x++){
-						let currentProduct = currentChildren[x]
-						let currentPId = currentProduct.id
-						let selectProduct = selectListData[currentPId] || []
-						if(!this.$util.isEmpty(selectProduct)){
-							upList[i].child[x].bigCount = selectProduct.bigCount || 0
-							upList[i].child[x].userPrice = selectProduct.userPrice || 0
-							upList[i].child[x].smallCount = selectProduct.smallCount || 0
-						}else{
-							upList[i].child[x].bigCount = 0
-							upList[i].child[x].userPrice = 0
-							upList[i].child[x].smallCount = 0
-						}
-					}
-				}
-			}
-			//如果没用copyObject,在APP端搜索花材时,加花材数量不变化
-			let o = copyObject(upList)
-			this.globalClassItemList = o
-		},
-		//切换左侧商品类别
-		swichClass(cur) {
-			this.isCut = true;
-			this.globalClassItemList[cur].isActive = true;
-			if(cur==this.globalClassItemList.length-1){
-				this.globalClassItemList[cur-1].isActive = true;
-			}
-			if(cur!=0&&cur!=this.globalClassItemList.length-1){
-				this.globalClassItemList[cur-1].isActive = true;
-				this.globalClassItemList[cur+1].isActive = true;
-				if(this.globalClassItemList[cur+1].child.length<5 && cur<this.globalClassItemList.length-3){
-					this.globalClassItemList[cur+2].isActive = true;
-				}
-			}
-			this.scroll_into_view = '';
-			this.$nextTick(()=>{
-				this.scroll_into_view = 'class_'+cur;
-				this.classIndex = cur;
-			})
-			//解决最后一个 ***来回*** 问题 (由于点击左侧导航,右侧锚点位置信息变化,此时滚动事件也随之滚动。)
-			uni.setStorageSync("resolve","last");
-			setTimeout(()=>{ uni.removeStorageSync("resolve") },400)
-		},
-		//滚动商品监听
-		scroll_detail(options){
-			if(this.isCut) {
-				this.isCut = false
-				return
-			}
-			//options为滚动信息,options.detail.scrollTop  值为相对于scroll-view。
-			if(!uni.getStorageSync("resolve")){
-				this.get_node_details(options);
-			};
-		},
-		//获取商品节点信息
-		get_node_details(options){
-			//获得实例
-			const query = uni.createSelectorQuery().in(this);
-			//获取多个节点方式
-			query.selectAll(".selectAll").boundingClientRect(data=>{
-				this.top_list = data.map(item=>{
-					return Math.ceil(item.top);
-				});
-				this.async_detail_msg(options);
-			}).exec();
-		},
-		async_detail_msg(options){
-			//options为滚动信息,options.detail.scrollTop  值为相对于scroll-view
-			let top_page = options.detail.scrollTop + this.top_list[0];
-			for(let i = 0;i < this.top_list.length; i++){
-				let node1 = this.top_list[i];
-				let node2 = this.top_list[i+1];
-				if(node2 && top_page >= node1 && top_page < node2){
-					this.classIndex = i;
-					if(this.globalClassItemList[this.classIndex]){
-						this.globalClassItemList[this.classIndex].isActive = true;
-					}
-					if(this.globalClassItemList[this.classIndex+1]){
-						this.globalClassItemList[this.classIndex+1].isActive = true;
-					}
-					if(this.globalClassItemList[this.classIndex+1].child.length<5){
-						if(this.globalClassItemList[this.classIndex+2]){
-							this.globalClassItemList[this.classIndex+2].isActive = true;
-						}
-					}
-					break;
-				}else if(node2 && top_page === node2){
-					this.classIndex = i + 1;
-					if(this.globalClassItemList[this.classIndex]){
-						this.globalClassItemList[this.classIndex].isActive = true;
-					}
-					if(this.globalClassItemList[this.classIndex+1]){
-						this.globalClassItemList[this.classIndex+1].isActive = true;
-					}
-					if(this.globalClassItemList[this.classIndex+1].child.length<5){
-						if(this.globalClassItemList[this.classIndex+2]){
-							this.globalClassItemList[this.classIndex+2].isActive = true;
-						}
-					}
-					break;
-				}
-			}
-		},
-		scroll_bottom(){
-			this.classIndex = this.globalClassItemList.length-1
-			this.globalClassItemList[this.classIndex].isActive = true;
-			if(!this.$util.isEmpty(this.globalClassItemList[this.classIndex+1]) && this.globalClassItemList[this.classIndex+1].child.length<5){
-				this.globalClassItemList[this.classIndex+2].isActive = true;
-			}
 		}
 	}
 }