平板端快衣店
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

1 lines
193 KiB

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["package1/AI/voiceInventoryHeng"],{"83a9":function(t,e,i){"use strict";(function(t,e){var r=i("47a9");i("82ca");r(i("3240"));var s=r(i("9bcf"));t.__webpack_require_UNI_MP_PLUGIN__=i,e(s.default)}).call(this,i("3223")["default"],i("df3c")["createPage"])},"966c":function(t,e,i){"use strict";(function(t){var r=i("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var s=r(i("7eb4")),a=r(i("34cf")),o=r(i("ee10")),u=r(i("af34")),c=r(i("7ca3")),n=i("7312"),d=r(i("ec9a")),l=requirePlugin("WechatSI"),h=l.getRecordRecognitionManager(),g={props:{khName:{type:Object},zhiqianqiankuan:{type:Number,default:0},parentClosePage:{type:Function},screenWidth:{type:Number,default:0},screenHeight:{type:Number,default:0},noEarn:{type:Number,default:0}},watch:{khName:function(){this.aaaaa()}},data:function(){return{keyboardPopup:[{name:"1",value:"1"},{name:"2",value:"2"},{name:"3",value:"3"},{name:"4",value:"4"},{name:"5",value:"5"},{name:"6",value:"6"},{name:"7",value:"7"},{name:"8",value:"8"},{name:"9",value:"9"},{name:"0",value:"0"},{name:"-",value:"-"},{name:".",value:"."},{name:"×",value:"clear"},{name:"确认",value:"confirm"}],keyboardIndex:"",isFocused:"",shopttributeOfList:[],isVoice:!1,faBookShow:!1,sreachList:[],keyboard:"",allChangeNum:0,isShowinput:!0,popupText:"",voiceText:"",voiceText1:"",isChangeHeight:!1,carList:new Map,remark:"",voiceGetOneData:!1,otherPay:"",noPay:0,isFocus:!1,promptImg:"",categoryList:{},customerCategoryList:[],customerCategoryList1:[],alreadyPay:"",realAmount:0,shouldPay:0,userType:"",colorSizeNew:new Map,totalAmount:0,customTypeId:"",index:"",index1:"",recordState:!1,goodsDetail:{attributeList:{newChiMaList:[],newYanSeList:[]}},temporaryList:[],zNum:0,snList:[],carList1:[],zhuImg:"",zhuImgList:[],productNum:null,prefixRule:"",numRule:"",yuedikou:0,leijiqiankuan:0,productId:"",oneGoodsId:"",bigImg:[],showTan:!1,currentPopupIndex:0,moreData:[],changeItem:"",changeItemType:"",changeAllNum:"",goodsId:"",pageOldTemList:[],oldTemList:[],attrList:[],goodsList:[],mergeId:"",newTemList:[],categoryName:[],pecsList:[],single:"",childrenId:"",childrenIdForName:"",isGenerateSnRadio:1,productPictures:[],categoryText:"",dataObj:new Map,isPlusAndMinus:!1,indexList:[],evalue:[],keyboardNum:"",attributeValue:[],specifications:"",current:0,swiperDotIndex:0,currentAnchor:"",temporaryNum:0,isBottom:!1,isGenerateSn:[{value:"0",name:"生成"},{value:"1",name:"不生成"}],snName:"ty",defaultList:[{name:"颜色",value:[{value:"均色",checked:!1},{value:"白色",checked:!1},{value:"绿色",checked:!1},{value:"黄色",checked:!1},{value:"卡其色",checked:!1},{value:"黑色",checked:!1},{value:"浅蓝",checked:!1},{value:"蓝色",checked:!1},{value:"灰色",checked:!1},{value:"咖色",checked:!1},{value:"紫色",checked:!1},{value:"红色",checked:!1},{value:"米色",checked:!1}]},{name:"尺码",value:[{value:"均码",checked:!1},{value:"XS码",checked:!1},{value:"S码",checked:!1},{value:"M码",checked:!1},{value:"L码",checked:!1},{value:"XL码",checked:!1},{value:"2XL码",checked:!1},{value:"3XL码",checked:!1},{value:"4XL码",checked:!1},{value:"5XL码",checked:!1}]}],isImgInventory:!1,temporary:[]}},filters:{sliceMsg:function(t){var e="";if("string"==typeof t){var i=JSON.parse(t);for(var r in i)e+=i[r]+" | "}return e}},onLoad:function(t){t.img&&(this.isImgInventory=!0),this.chushihua()},methods:{aaaaa:function(){this.chushihua()},goPopleList:function(e){t.setStorageSync("kaidanBack",!0),t.navigateTo({url:"/package1/index/peopleList?popleType="+e})},chushihua:function(){var e=this;t.authorize({scope:"scope.record",success:function(){},fail:function(){this.tui.toast("您未授权,语音功能可能会出现错误")}}),t.authorize({scope:"scope.writePhotosAlbum",success:function(){},fail:function(){this.tui.toast("您未授权,图片上传功能可能会出现错误")}}),this.userType=t.getStorageSync("type"),this.getSnList(),this.getShopCategory(),this.getCustomerCategoryList(),this.getDefaultCategory(),this.getMonth(),t.showLoading({title:"加载中..."});var i=this,r=!1;if(1==this.merge)return this.$refs.mergePopup.close(),1==this.carList.has(this.carList1.id)?i.carList.get(i.mergeId).stockLogList.forEach((function(t,e){i.carList.get(i.carList1.id).stockLogList.forEach((function(s,a){e==a&&i.mergeId!=i.carList1.id&&(i.carList.get(i.carList1.id).stockLogList.get(a).productCount=Number(i.carList.get(i.carList1.id).stockLogList.get(a).productCount)+Number(t.productCount),r=!0,i.carList.get(i.carList1.id).productCount+=Number(t.productCount))})),0==r&&(i.carList.get(i.carList1.id).stockLogList.set(e,t),i.carList.get(i.carList1.id).productCount+=Number(t.productCount))})):(this.carList.get(this.mergeId).productId=this.carList1.id,this.carList.get(this.mergeId).id=this.carList1.id,this.carList.get(this.mergeId).productName=this.carList1.productName,this.carList.get(this.mergeId).productPicture=this.carList1.productPicture,this.carList.get(this.mergeId).productSn=this.carList1.productSn,this.carList.get(this.mergeId).categoryId=this.carList1.categoryId,this.carList.get(this.mergeId).wholesalePrice=this.carList1.wholesalePrice||0,this.carList.get(this.mergeId).lsprice=this.carList1.price||0,this.carList.get(this.mergeId).isNew=!1,this.carList.set(this.carList1.id,this.carList.get(this.mergeId))),this.mergeId!=this.carList1.id&&this.carList.delete(this.mergeId),i.carList.get(i.carList1.id).price1=(Number(i.carList.get(i.carList1.id).productCount)*Number(i.carList.get(i.carList1.id).purchasePrice)).toFixed(2),this.getAllPrice(),setTimeout((function(e){t.hideLoading()}),300),this.$forceUpdate(),void(this.merge=0);if(""!=t.getStorageSync("carList1")?this.carList1=JSON.parse(t.getStorageSync("carList1")):this.carList1=this.carList1,""!=this.carList1&&(r=!0),console.log("carlist11111111",this.carList1),""!=this.khName&&(null!=this.khName.noEarn&&this.zhiqianqiankuan!=this.khName.noEarn&&(r=!0),null==this.khName.noEarn?this.zhiqianqiankuan=0:this.zhiqianqiankuan=this.khName.noEarn),setTimeout((function(t){e.getByCondition()}),500),0==this.carList.size){for(var s=0;s<this.carList1.length;s++){for(var a={purchasePrice:0==this.userType?this.carList1[s].purchasePrice:"",price1:0,price:this.carList1[s].price,productCount:0,customerCategoryList:null!=this.carList1[s].customerCategoryRule?this.checkPriceRule(this.carList1[s].customerCategoryRule):this.getNewProductRule(),id:null!=this.carList1[s].productId?this.carList1[s].productId:this.carList1[s].id,isNew:this.carList1[s].isNew,productId:null==this.carList1[s].productId?"":this.carList1[s].productId,productName:this.carList1[s].productName,wholesalePrice:this.carList1[s].wholesalePrice||0,categoryName:this.carList1[s].categoryName,categoryId:this.carList1[s].categoryId,attrId:this.carList1[s].attrId,lsprice:this.carList1[s].price||0,productPicture:this.carList1[s].productPicture,productSn:this.carList1[s].productSn,productPictures:[],stockLogList:new Map,stockLogList1:[]},o=0;o<this.carList1[s].saleDetailQueryDTO.length;o++){var u=Number(this.carList1[s].saleDetailQueryDTO[o].productCount);1==a.stockLogList.has(this.carList1[s].saleDetailQueryDTO[o].attributeList)&&(u+=Number(a.stockLogList.get(this.carList1[s].saleDetailQueryDTO[o].attributeList).productCount));var c={productCount:u,name:this.carList1[s].saleDetailQueryDTO[o].name,productNum:this.carList1[s].saleDetailQueryDTO[o].productNum};a.stockLogList.set(this.carList1[s].saleDetailQueryDTO[o].attributeList,c),a.productCount+=null==this.carList1[s].saleDetailQueryDTO[o].productCount?0:Number(this.carList1[s].saleDetailQueryDTO[o].productCount),a.price1=(Number(a.productCount)*Number(this.carList1[s].purchasePrice)).toFixed(2)}var n=1==this.carList1[s].isNew?this.carList1[s].id:this.carList1[s].productId;this.carList.set(n,a)}this.carList1=[]}else for(var d=0;d<this.carList1.length;d++){var l=1==this.carList1[d].isNew?this.carList1[d].id:this.carList1[d].productId;if(1==this.carList.has(this.carList1[d].id))for(var h=0;h<this.carList1[d].saleDetailQueryDTO.length;h++){if(1==this.carList.get(this.carList1[d].id).stockLogList.has(this.carList1[d].saleDetailQueryDTO[h].attributeList)){c={productCount:Number(this.carList.get(this.carList1[d].id).stockLogList.get(this.carList1[d].saleDetailQueryDTO[h].attributeList).productCount)+Number(this.carList1[d].saleDetailQueryDTO[h].productCount),name:this.carList1[d].saleDetailQueryDTO[h].name,productNum:this.carList1[d].saleDetailQueryDTO[h].productNum};this.carList.get(this.carList1[d].id).stockLogList.set(this.carList1[d].saleDetailQueryDTO[h].attributeList,c)}else{c={productCount:Number(this.carList1[d].saleDetailQueryDTO[h].productCount),name:this.carList1[d].saleDetailQueryDTO[h].name,productNum:this.carList1[d].saleDetailQueryDTO[h].productNum};this.carList.get(this.carList1[d].id).stockLogList.set(this.carList1[d].saleDetailQueryDTO[h].attributeList,c)}this.carList.get(this.carList1[d].id).productCount+=null==this.carList1[d].saleDetailQueryDTO[h].productCount?0:Number(this.carList1[d].saleDetailQueryDTO[h].productCount),this.carList.get(this.carList1[d].id).price1=(Number(this.carList.get(this.carList1[d].id).productCount)*Number(this.carList.get(this.carList1[d].id).purchasePrice)).toFixed(2)}else{for(var g={purchasePrice:0==this.userType?this.carList1[d].purchasePrice:"",price1:0,price:this.carList1[d].price,productCount:0,customerCategoryList:null!=this.carList1[d].customerCategoryRule?this.checkPriceRule(this.carList1[d].customerCategoryRule):this.getNewProductRule(),id:null!=this.carList1[d].productId?this.carList1[d].productId:this.carList1[d].id,productId:null==this.carList1[d].productId?"":this.carList1[d].productId,isNew:this.carList1[d].isNew,productName:this.carList1[d].productName,wholesalePrice:this.carList1[d].wholesalePrice||0,categoryName:this.carList1[d].categoryName,categoryId:this.carList1[d].categoryId,attrId:this.carList1[d].attrId,lsprice:this.carList1[d].price||0,productPicture:this.carList1[d].productPicture,productSn:this.carList1[d].productSn,stockLogList:new Map,stockLogList1:[],productPictures:[],name:""},L=0;L<this.carList1[d].saleDetailQueryDTO.length;L++){c={productCount:Number(this.carList1[d].saleDetailQueryDTO[L].productCount),name:this.carList1[d].saleDetailQueryDTO[L].name,productNum:this.carList1[d].saleDetailQueryDTO[L].productNum};g.stockLogList.set(this.carList1[d].saleDetailQueryDTO[L].attributeList,c),g.name=this.carList1[d].saleDetailQueryDTO[L].name,g.productCount+=null==this.carList1[d].saleDetailQueryDTO[L].productCount?0:Number(this.carList1[d].saleDetailQueryDTO[L].productCount),g.price1=(Number(g.productCount)*Number(this.carList1[d].purchasePrice)).toFixed(2)}this.carList.set(l,g)}}this.$nextTick((function(){e.carList1=[],t.removeStorageSync("carList1"),t.removeStorageSync("khName"),t.removeStorageSync("hangOrder"),r&&e.getAllPrice(),""!=e.carList1?setTimeout((function(e){t.hideLoading()}),2e3):setTimeout((function(e){t.hideLoading()}),300),e.$forceUpdate()}))},getCustomerCategoryList:function(){var e=this;this.tui.request("/app/customerCategory/getCustomerCategoryListByShopId","POST",{shopId:t.getStorageSync("shopId")},!1,!0).then((function(t){if(200==t.code)if(t.result.length>0)for(var i=0;i<t.result.length;i++){var r={categoryName:t.result[i].categoryName,categoryId:t.result[i].id,categoryPrice:""};e.customerCategoryList[i]=r,e.customerCategoryList1[i]=r}else e.customerCategoryList=null,e.customerCategoryList1=null;else e.tui.toast(t.message)})).catch((function(t){}))},getDefaultCategory:function(){var t=this;this.tui.request("/app/productCategory/getDefaultCategory","POST",{},!1,!0).then((function(e){200==e.code?t.categoryList=e.result:t.tui.toast(e.message)})).catch((function(t){}))},getMonth:function(){var t=new Date,e=t.getFullYear().toString(),i=t.getMonth()+1<10?"0"+(t.getMonth()+1).toString():(t.getMonth()+1).toString(),r=t.getDate()<10?"0"+t.getDate().toString():t.getDate().toString();this.single=e+"-"+i+"-"+r},changeShowBtn:function(t,e){void 0==this.carList.get(t).stockLogList.get(e).isShowBtn||0==this.carList.get(t).stockLogList.get(e).isShowBtn?this.carList.get(t).stockLogList.get(e).isShowBtn=!0:this.carList.get(t).stockLogList.get(e).isShowBtn=!1,this.$forceUpdate()},clickReturnDiaLog:function(t){this.oneGoodsId=t,this.$refs.returnDialog.open("bottom")},onePecsReturnToCarList:function(){var t={attributeList:'{"颜色":"均色","尺码":"均码"}',name:"均色 | 均码",productCount:-1*Math.abs(Number(this.onePecsReturnNum)),productNum:this.carList.get(this.oneGoodsId).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productNum};this.carList.get(this.oneGoodsId).returnList.set(t.attributeList,t),this.$refs.returnDialog.close(),this.$forceUpdate(),this.carList.get(this.oneGoodsId).returnCount=Number(this.onePecsReturnNum)},getShopCategory:function(){var t=this;this.tui.request("/app/productCategory/getCategoryOfshop","POST",{},!1,!0).then((function(e){if(200==e.code){var i=e.result.productAttributeOfAddVos;t.shopttributeOfList=e.result.productAttributeOfAddVos;i[1].productAttributeValueVoList.length;for(var r,s=[],a=0;a<i[0].productAttributeValueVoList.length;a++){for(var o={name:"",value:[]},u=0;u<i[1].productAttributeValueVoList.length;u++){0==u&&(o.name=i[0].productAttributeValueVoList[a].value);var c="{";c+='"颜色":"'+i[0].productAttributeValueVoList[a].value+'",',c+='"尺码":"'+i[1].productAttributeValueVoList[u].value+'"',c+="}";var n={value:i[0].productAttributeValueVoList[a].value,name:c,kucun:"",productCount:""};o.value.push(n)}s.push(o)}for(var d=[],l=0;l<i[1].productAttributeValueVoList.length;l++)d.push(i[1].productAttributeValueVoList[l].value);r={newYanSeList:s,newChiMaList:d},t.defaultList=r}else t.tui.toast(e.message)})).catch((function(t){}))},yuyinChange:function(){this.isVoice=!1},convertStringCorrectly:function(t){var e=t.replace(/(\d+)十(?!\d)/g,"$10"),i=e.replace(/(\d+)十(?=\d)/g,"$1");return i},removePunctuationAndSpaces:function(t){return t.replace(/[\u3002\uff0c\uff1a\uFF0E\u3001\s,:;]/g,"")},isQuantityFollowsProductCode:function(t){var e=t.split("货号")[1];if(!e||-1===e.indexOf("数量"))return!1;var i=e.split("数量")[0],r=/[^\u4e00-\u9fa5]/.test(i);return!r},extractInfo:function(t){var e={};return[{name:"productSn",regex:/货号(.*?),/},{name:"productCount",regex:/,数量:(.*?),/},{name:"productCount",regex:/,数量:(.*?)。/},{name:"purchasePrice",regex:/,单价:(.*?),/},{name:"purchasePrice",regex:/,单价:(.*?)。/},{name:"productName",regex:/,名称:(.*?),/},{name:"productName",regex:/,名称:(.*?)。/},{name:"wholesalePrice",regex:/,批发价:(.*?),/},{name:"wholesalePrice",regex:/,批发价:(.*?)。/},{name:"lsprice",regex:/,零售价:(.*?),/},{name:"lsprice",regex:/,零售价:(.*?)。/},{name:"productCount1",regex:/,退:(.*?),/},{name:"productCount1",regex:/,退:(.*?)。/}].forEach((function(i){var r=i.name,s=i.regex,a=t.match(s);a&&a[1]&&(e[r]=a[1].trim())})),e.productCount&&-1!=e.productCount.indexOf(",")&&(e.productCount=e.productCount.split(",")[0]),e.productCount1&&-1!=e.productCount1.indexOf(",")&&(e.productCount="-"+e.productCount1.split(",")[0]),e.productName&&-1!=e.productName.indexOf(",")&&(e.productName=e.productName.split(",")[0]),e.purchasePrice&&-1!=e.purchasePrice.indexOf(",")&&(e.purchasePrice=e.purchasePrice.split(",")[0]),e.wholesalePrice&&-1!=e.wholesalePrice.indexOf(",")&&(e.wholesalePrice=e.wholesalePrice.split(",")[0]),e},maskClick:function(){},getByCondition:function(){var e=this;this.tui.request("/app/supplier/getByCondition","post",{searchStr:this.khName.consigneeName,pageNumber:1,pageSize:10},!1,!0).then((function(i){if(200==i.code)for(var r=0;r<i.result.content.length;r++)i.result.content[r].id==e.khName.id&&(e.zhiqianqiankuan=i.result.content[r].noEarn);else t.showToast({title:i.message,icon:"none"})})).catch((function(t){}))},handleData:function(e){for(var i=this,r=this,s=function(e){if(10!=i.carList1[e].discount&&void 0!=i.carList1[e].discount&&(i.discountType="0",i.discountCurrent="0"),i.carList1[e].saleDetailQueryDTO){if(0==i.carList.size){var s={attrId:i.carList1[e].attrId,purchasePrice:i.carList1[e].purchasePrice,price:0,buyCount:i.carList1[e].buyCount,isChangePrice:!1,isChangeReturnPrice:!1,discount:i.carList1[e].discount?i.carList1[e].discount:10,customerCategoryList:i.carList1[e].customerCategoryRule,categoryId:i.carList1[e].categoryId,unitPrice:i.carList1[e].unitPrice||0,discountAmount:i.carList1[e].discountAmount>0?i.carList1[e].discountAmount:i.carList1[e].wholesalePrice||0,returnPrice:i.carList1[e].returnPrice?i.carList1[e].returnPrice:i.carList1[e].wholesalePrice||0,disNoAmount:0,wholesalePrice:i.carList1[e].wholesalePrice,lsprice:i.carList1[e].lsprice,productCount:0,returnCount:0,productId:i.carList1[e].id,productName:i.carList1[e].productName,productPicture:i.carList1[e].productPicture,productSn:i.carList1[e].productSn,stockLogList:new Map,returnList:new Map,returnList1:[],stockLogList1:[],supplierName:i.carList1[e].supplierName},a=!1,u=!1;if(null!=s.customerCategoryList)for(var c=0;c<s.customerCategoryList.length;c++)Number(s.discountAmount)==Number(s.customerCategoryList[c].categoryPrice)&&(a=!0),Number(s.returnPrice)==Number(s.customerCategoryList[c].categoryPrice)&&(u=!0);if(a||Number(s.discountAmount)==Number(s.wholesalePrice)||Number(s.discountAmount)==Number(s.lsprice)||(s.isChangePrice=!0),u||void 0==s.returnPrice||Number(s.discountAmount)==Number(s.wholesalePrice)||Number(s.discountAmount)==Number(s.lsprice)||(s.isChangeReturnPrice=!0),null!=i.khName.categoryId&&""!=i.khName.categoryId)if(null!=s.customerCategoryList&&""!=s.customerCategoryList)for(var n=0;n<s.customerCategoryList.length;n++)i.khName.categoryId==s.customerCategoryList[n].categoryId&&(""==s.customerCategoryList[n].categoryPrice||t.getStorageSync("hangOrder")||(s.unitPrice==s.wholesalePrice&&(s.discountAmount=s.customerCategoryList[n].categoryPrice,s.unitPrice=s.customerCategoryList[n].categoryPrice),s.returnPrice==s.wholesalePrice&&(s.returnPrice=s.customerCategoryList[n].categoryPrice)));else t.getStorageSync("hangOrder")||(s.discountAmount=s.unitPrice);else t.getStorageSync("hangOrder")||(s.discountAmount=s.unitPrice);for(var d=0;d<i.carList1[e].saleDetailQueryDTO.length;d++)o={productCount:Number(i.carList1[e].saleDetailQueryDTO[d].productCount),name:i.carList1[e].saleDetailQueryDTO[d].name,productNum:void 0!=i.carList1[e].saleDetailQueryDTO[d].productNum?i.carList1[e].saleDetailQueryDTO[d].productNum:i.carList1[e].saleDetailQueryDTO[d].stockCount},i.carList1[e].saleDetailQueryDTO[d].productCount<0?(s.returnCount+=Math.abs(i.carList1[e].saleDetailQueryDTO[d].productCount),s.returnList.set(i.carList1[e].saleDetailQueryDTO[d].attributeList,o)):(s.productCount+=Number(i.carList1[e].saleDetailQueryDTO[d].productCount),s.stockLogList.set(i.carList1[e].saleDetailQueryDTO[d].attributeList,o));i.carList.set(i.carList1[e].id,s)}else if(1==i.carList.has(i.carList1[e].id)){var l=!1;if(null!=i.carList1[e].customerCategoryList)for(var h=0;h<i.carList1[e].customerCategoryList.length;h++)Number(i.carList1[e].returnPrice)==Number(i.carList1[e].customerCategoryList[h].categoryPrice)&&(l=!0);l||void 0==i.carList1[e].returnPrice||Number(i.carList1[e].returnPrice)==Number(i.carList1[e].wholesalePrice)||Number(i.carList1[e].returnPrice)==Number(i.carList1[e].lsprice)||(i.carList.get(i.carList1[e].id).isChangeReturnPrice=!0,i.carList.get(i.carList1[e].id).returnPrice=i.carList1[e].returnPrice),i.carList.get(i.carList1[e].id).productCount=0,i.carList.get(i.carList1[e].id).returnCount=0,0==i.carList1[e].saleDetailQueryDTO.length&&t.getStorageSync("KuCunBack")&&0==r.carList.get(i.carList1[e].id).returnList.size&&r.carList.delete(i.carList1[e].id),t.getStorageSync("KuCunBack")&&(r.carList.get(i.carList1[e].id).stockLogList=new Map,""==i.carList1[e].returnList||void 0==i.carList1[e].returnList?i.carList.get(i.carList1[e].id).returnList=new Map:i.carList.get(i.carList1[e].id).returnList=new Map(JSON.parse(decodeURIComponent(i.carList1[e].returnList))));for(var g=0;g<i.carList1[e].saleDetailQueryDTO.length;g++)1==i.carList.get(i.carList1[e].id).stockLogList.has(i.carList1[e].saleDetailQueryDTO[g].attributeList)?t.getStorageSync("hangOrder")?(o={productCount:Number(i.carList1[e].saleDetailQueryDTO[g].productCount),name:i.carList1[e].saleDetailQueryDTO[g].name,productNum:void 0!=i.carList1[e].saleDetailQueryDTO[g].productNum?i.carList1[e].saleDetailQueryDTO[g].productNum:i.carList1[e].saleDetailQueryDTO[g].stockCount},o.productCount>=0?i.carList.get(i.carList1[e].id).stockLogList.set(i.carList1[e].saleDetailQueryDTO[g].attributeList,o):o.productCount<0&&i.carList.get(i.carList1[e].id).returnList.set(i.carList1[e].saleDetailQueryDTO[g].attributeList,o)):t.getStorageSync("KuCunBack")?(o={productCount:Number(i.carList1[e].saleDetailQueryDTO[g].productCount),name:i.carList1[e].saleDetailQueryDTO[g].name,productNum:void 0!=i.carList1[e].saleDetailQueryDTO[g].productNum?i.carList1[e].saleDetailQueryDTO[g].productNum:i.carList1[e].saleDetailQueryDTO[g].stockCount},i.carList.get(i.carList1[e].id).stockLogList.set(i.carList1[e].saleDetailQueryDTO[g].attributeList,o)):(o={productCount:Number(i.carList.get(i.carList1[e].id).stockLogList.get(i.carList1[e].saleDetailQueryDTO[g].attributeList).productCount)+Number(i.carList1[e].saleDetailQueryDTO[g].productCount),name:i.carList1[e].saleDetailQueryDTO[g].name,productNum:void 0!=i.carList1[e].saleDetailQueryDTO[g].productNum?i.carList1[e].saleDetailQueryDTO[g].productNum:i.carList1[e].saleDetailQueryDTO[g].stockCount},o.productCount>=0?i.carList.get(i.carList1[e].id).stockLogList.set(i.carList1[e].saleDetailQueryDTO[g].attributeList,o):o.productCount<0&&i.carList.get(i.carList1[e].id).returnList.set(i.carList1[e].saleDetailQueryDTO[g].attributeList,o)):(o={productCount:Number(i.carList1[e].saleDetailQueryDTO[g].productCount),name:i.carList1[e].saleDetailQueryDTO[g].name,productNum:void 0!=i.carList1[e].saleDetailQueryDTO[g].productNum?i.carList1[e].saleDetailQueryDTO[g].productNum:i.carList1[e].saleDetailQueryDTO[g].stockCount},o.productCount>=0?i.carList.get(i.carList1[e].id).stockLogList.set(i.carList1[e].saleDetailQueryDTO[g].attributeList,o):o.productCount<0&&i.carList.get(i.carList1[e].id).returnList.set(i.carList1[e].saleDetailQueryDTO[g].attributeList,o));i.carList.get(i.carList1[e].id).returnList.forEach((function(t,i){t.productCount<0&&(r.carList.get(r.carList1[e].id).returnCount+=Math.abs(t.productCount))})),i.carList.get(i.carList1[e].id).stockLogList.forEach((function(t,i){t.productCount<0?r.carList.get(r.carList1[e].id).returnCount+=Math.abs(t.productCount):r.carList.get(r.carList1[e].id).productCount+=t.productCount}))}else{var L={attrId:i.carList1[e].attrId,purchasePrice:i.carList1[e].purchasePrice,price:0,isChangeReturnPrice:!1,isChangePrice:!1,buyCount:i.carList1[e].buyCount,discount:i.carList1[e].discount?i.carList1[e].discount:10,categoryId:i.carList1[e].categoryId,customerCategoryList:i.carList1[e].customerCategoryRule,discountAmount:i.carList1[e].discountAmount>0?i.carList1[e].discountAmount:i.carList1[e].wholesalePrice||0,returnPrice:i.carList1[e].returnPrice?i.carList1[e].returnPrice:i.carList1[e].wholesalePrice||0,disNoAmount:0,unitPrice:i.carList1[e].unitPrice||0,wholesalePrice:i.carList1[e].wholesalePrice,lsprice:i.carList1[e].lsprice,productCount:0,returnCount:0,productId:i.carList1[e].id,productName:i.carList1[e].productName,productPicture:i.carList1[e].productPicture,stockLogList:new Map,returnList:new Map,returnList1:[],stockLogList1:[],productSn:i.carList1[e].productSn,supplierName:i.carList1[e].supplierName},p=!1,m=!1;if(null!=L.customerCategoryList)for(var f=0;f<L.customerCategoryList.length;f++)Number(L.discountAmount)==Number(L.customerCategoryList[f].categoryPrice)&&(p=!0),Number(L.returnPrice)==Number(L.customerCategoryList[f].categoryPrice)&&(m=!0);if(p||Number(L.discountAmount)==Number(L.wholesalePrice)||Number(L.discountAmount)==Number(L.lsprice)||(L.isChangePrice=!0),m||Number(L.discountAmount)==Number(L.wholesalePrice)||Number(L.discountAmount)==Number(L.lsprice)||(L.isChangeReturnPrice=!0),null!=i.khName.categoryId&&""!=i.khName.categoryId)if(null!=L.customerCategoryList&&""!=L.customerCategoryList)for(var y=0;y<L.customerCategoryList.length;y++)i.khName.categoryId==L.customerCategoryList[y].categoryId&&(""==L.customerCategoryList[y].categoryPrice||t.getStorageSync("hangOrder")||(L.unitPrice==L.wholesalePrice&&(L.discountAmount=L.customerCategoryList[y].categoryPrice,L.unitPrice=L.customerCategoryList[y].categoryPrice),L.returnPrice==L.wholesalePrice&&(L.returnPrice=L.customerCategoryList[y].categoryPrice)));else t.getStorageSync("hangOrder")||(L.discountAmount=L.unitPrice);else t.getStorageSync("hangOrder")||(L.discountAmount=L.unitPrice);for(var P=0;P<i.carList1[e].saleDetailQueryDTO.length;P++)o={productCount:Number(i.carList1[e].saleDetailQueryDTO[P].productCount),name:i.carList1[e].saleDetailQueryDTO[P].name,productNum:void 0!=i.carList1[e].saleDetailQueryDTO[P].productNum?i.carList1[e].saleDetailQueryDTO[P].productNum:i.carList1[e].saleDetailQueryDTO[P].stockCount},L.name=i.carList1[e].saleDetailQueryDTO[P].name,i.carList1[e].saleDetailQueryDTO[P].productCount<0?(L.returnCount+=Math.abs(i.carList1[e].saleDetailQueryDTO[P].productCount),L.returnList.set(i.carList1[e].saleDetailQueryDTO[P].attributeList,o)):(L.productCount+=Number(i.carList1[e].saleDetailQueryDTO[P].productCount),L.stockLogList.set(i.carList1[e].saleDetailQueryDTO[P].attributeList,o));i.carList.set(i.carList1[e].id,L)}}},a=0;a<this.carList1.length;a++){var o;s(a)}this.carList1=[],this.carList.forEach((function(e,i){void 0==e.isChangePrice&&(e.isChangePrice=!1),void 0==e.isChangeReturnPrice&&(e.isChangeReturnPrice=!1),""==r.priceType?(""!=e.returnPrice&&null!=e.returnPrice&&0!=e.returnPrice||(e.returnPrice=e.isChangeReturnPrice?e.wholesalePrice:e.returnPrice),e.unitPrice?e.unitPrice=e.unitPrice:e.unitPrice=e.discountAmount>0?e.discountAmount:e.wholesalePrice):0==r.priceType?(e.unitPrice=e.isChangePrice?e.unitPrice:e.lsprice,e.discountAmount=e.isChangePrice?e.unitPrice:e.lsprice,e.returnPrice=e.isChangeReturnPrice?e.unitPrice:e.lsprice):1==r.priceType&&(e.unitPrice=e.isChangePrice?e.unitPrice:e.wholesalePrice,e.discountAmount=e.isChangePrice?e.unitPrice:e.wholesalePrice,e.returnPrice=e.isChangeReturnPrice?e.unitPrice:e.wholesalePrice),t.getStorageSync("hangOrder")||(1==r.discountType?(e.discountAmount=e.discountAmount*r.discountNum/10,e.discountAmount=Number(e.discountAmount.toFixed(2)),e.price=1e4*e.unitPrice*Number(e.productCount)*r.discountNum/10/1e4):0==r.discountType&&(e.discountAmount=e.discountAmount*e.discount/10,e.discountAmount=Number(e.discountAmount.toFixed(2))))})),e&&this.getAmountAndWho(),""==this.xsyId&&(this.xsyId=t.getStorageSync("id"),this.createByName=t.getStorageSync("nickname")),""!=this.carList1?setTimeout((function(e){t.hideLoading(),t.removeStorageSync("hangOrder"),t.removeStorageSync("KuCunBack"),t.removeStorageSync("carList1"),t.removeStorageSync("saoma"),t.removeStorageSync("clearMsg"),t.removeStorageSync("discountAll")}),2e3):(setTimeout((function(e){t.hideLoading()}),300),setTimeout((function(e){t.removeStorageSync("carList1"),t.removeStorageSync("saoma"),t.removeStorageSync("KuCunBack"),t.removeStorageSync("clearMsg"),t.removeStorageSync("discountAll"),t.removeStorageSync("hangOrder")}),2e3))},closePage:function(){this.isImgInventory&&t.navigateBack();this.carList.clear(),this.remark="",this.index="",this.alreadyPay=0,this.priceType="",this.radioType="2",this.lunbocurrent=4,this.discountType="",this.discountCurrent="3",this.temporaryList=[],this.returnPay=0,this.qiankuandikou=0,this.yuedikou=0,this.leijiqiankuan=0,this.zhiqianqiankuan=0,this.purchasePrice=0,this.zPrice=0,this.zNum=0,this.shouldPay=0,this.getMonth(),this.$emit("update:khName",[]),this.relPrice=0,this.priceOk=0,this.noPay=0,this.otherExpense=0,this.totalAmount=0,this.returnTotalAmount=0,this.saleId="",this.priceCurrent=null,this.$forceUpdate(),this.parentClosePage()},AiHandleData:function(){for(var t=this,e=this,i=function(i){if(t.carList1[i].stockLogList1)if(0==t.carList.size){var r={attrId:t.carList1[i].attrId,purchasePrice:t.carList1[i].purchasePrice,price:0,discount:10,buyCount:t.carList1[i].buyCount,isNew:t.carList1[i].isNew,customerCategoryList:null!=t.carList1[i].customerCategoryRule?JSON.parse(t.carList1[i].customerCategoryRule):null,productId:t.carList1[i].productId,categoryId:t.carList1[i].categoryId,categoryName:t.carList1[i].isNew?"默认分类":t.carList1[i].categoryName,unitPrice:t.carList1[i].wholesalePrice||0,discountAmount:t.carList1[i].wholesalePrice||0,returnPrice:t.carList1[i].wholesalePrice||0,disNoAmount:0,wholesalePrice:t.carList1[i].wholesalePrice,lsprice:t.carList1[i].price,productCount:0,id:t.carList1[i].productId,returnCount:0,productName:null==t.carList1[i].productName?t.carList1[i].productSn:t.carList1[i].productName,productPicture:t.carList1[i].productPicture||"",productPictures:t.carList1[i].productPictures||[],productSn:t.carList1[i].productSn,stockLogList:new Map,returnList:new Map,returnList1:[],stockLogList1:[],supplierName:t.carList1[i].supplierName};if(null!=t.khName.categoryId&&""!=t.khName.categoryId)if(null!=r.customerCategoryList&&""!=r.customerCategoryList)for(var a=0;a<r.customerCategoryList.length;a++)t.khName.categoryId==r.customerCategoryList[a].categoryId&&""!=r.customerCategoryList[a].categoryPrice&&(r.unitPrice==r.wholesalePrice&&(r.discountAmount=r.customerCategoryList[a].categoryPrice,r.unitPrice=r.customerCategoryList[a].categoryPrice),r.returnPrice==r.wholesalePrice&&(r.returnPrice=r.customerCategoryList[a].categoryPrice));else r.discountAmount=r.unitPrice;else r.discountAmount=r.unitPrice;for(var o=0;o<t.carList1[i].stockLogList1.length;o++)s={productCount:Number(t.carList1[i].stockLogList1[o].productCount),name:t.sliceMsg(t.carList1[i].stockLogList1[o].attributeList),productNum:t.carList1[i].stockLogList1[o].stockCount},r.stockLogList.set(t.carList1[i].stockLogList1[o].attributeList,s),t.carList1[i].stockLogList1[o].productCount<0?r.returnCount+=Math.abs(t.carList1[i].stockLogList1[o].productCount):r.productCount+=Number(t.carList1[i].stockLogList1[o].productCount);t.carList.set(t.carList1[i].productId,r)}else if(1==t.carList.has(t.carList1[i].productId)){t.carList.get(t.carList1[i].productId).productCount=0,t.carList.get(t.carList1[i].productId).returnCount=0;for(var u=0;u<t.carList1[i].stockLogList1.length;u++)1==t.carList.get(t.carList1[i].productId).stockLogList.has(t.carList1[i].stockLogList1[u].attributeList)?(s={productCount:Number(t.carList.get(t.carList1[i].productId).stockLogList.get(t.carList1[i].stockLogList1[u].attributeList).productCount)+Number(t.carList1[i].stockLogList1[u].productCount),name:t.sliceMsg(t.carList1[i].stockLogList1[u].attributeList),productNum:t.carList1[i].stockLogList1[u].stockCount},t.carList.get(t.carList1[i].productId).stockLogList.set(t.carList1[i].stockLogList1[u].attributeList,s)):(s={productCount:Number(t.carList1[i].stockLogList1[u].productCount),name:t.sliceMsg(t.carList1[i].stockLogList1[u].attributeList),productNum:t.carList1[i].stockLogList1[u].stockCount},t.carList.get(t.carList1[i].productId).stockLogList.set(t.carList1[i].stockLogList1[u].attributeList,s));t.carList.get(t.carList1[i].productId).returnList.forEach((function(t,r){t.productCount<0&&(e.carList.get(e.carList1[i].productId).returnCount+=Math.abs(t.productCount))})),t.carList.get(t.carList1[i].productId).stockLogList.forEach((function(t,r){t.productCount<0?e.carList.get(e.carList1[i].productId).returnCount+=Math.abs(t.productCount):e.carList.get(e.carList1[i].productId).productCount+=t.productCount}))}else{var n,d=(n={attrId:t.carList1[i].attrId,purchasePrice:t.carList1[i].purchasePrice,price:0,discount:10,buyCount:t.carList1[i].buyCount,categoryId:t.carList1[i].categoryId,customerCategoryList:null!=t.carList1[i].customerCategoryRule?JSON.parse(t.carList1[i].customerCategoryRule):null,categoryName:t.carList1[i].isNew?"默认分类":t.carList1[i].categoryName,productId:t.carList1[i].productId,isNew:t.carList1[i].isNew,unitPrice:t.carList1[i].wholesalePrice||0,discountAmount:t.carList1[i].wholesalePrice||0,returnPrice:t.carList1[i].wholesalePrice||0,disNoAmount:0,wholesalePrice:t.carList1[i].wholesalePrice,lsprice:t.carList1[i].price,productCount:0},(0,c.default)(n,"returnPrice",t.carList1[i].wholesalePrice||0),(0,c.default)(n,"returnCount",0),(0,c.default)(n,"id",t.carList1[i].productId),(0,c.default)(n,"productName",null==t.carList1[i].productName?t.carList1[i].productSn:t.carList1[i].productName),(0,c.default)(n,"productPicture",t.carList1[i].productPicture),(0,c.default)(n,"productPictures",t.carList1[i].productPictures||[]),(0,c.default)(n,"productSn",t.carList1[i].productSn),(0,c.default)(n,"stockLogList",new Map),(0,c.default)(n,"returnList",new Map),(0,c.default)(n,"returnList1",[]),(0,c.default)(n,"stockLogList1",[]),(0,c.default)(n,"supplierName",t.carList1[i].supplierName),n);if(null!=t.khName.categoryId&&""!=t.khName.categoryId)if(null!=d.customerCategoryList&&""!=d.customerCategoryList)for(var l=0;l<d.customerCategoryList.length;l++)t.khName.categoryId==d.customerCategoryList[l].categoryId&&""!=d.customerCategoryList[l].categoryPrice&&(d.unitPrice==d.wholesalePrice&&(d.discountAmount=d.customerCategoryList[l].categoryPrice,d.unitPrice=d.customerCategoryList[l].categoryPrice),d.returnPrice==d.wholesalePrice&&(d.returnPrice=d.customerCategoryList[l].categoryPrice));else d.discountAmount=d.unitPrice;else d.discountAmount=d.unitPrice;for(var h=0;h<t.carList1[i].stockLogList1.length;h++)s={productCount:Number(t.carList1[i].stockLogList1[h].productCount),name:t.sliceMsg(t.carList1[i].stockLogList1[h].attributeList),productNum:t.carList1[i].stockLogList1[h].stockCount},d.stockLogList.set(t.carList1[i].stockLogList1[h].attributeList,s),d.name=t.sliceMsg(t.carList1[i].stockLogList1[h].attributeList),t.carList1[i].stockLogList1[h].productCount<0?d.returnCount+=Math.abs(t.carList1[i].stockLogList1[h].productCount):d.productCount+=Number(t.carList1[i].stockLogList1[h].productCount);t.carList.set(t.carList1[i].productId,d)}},r=0;r<this.carList1.length;r++){var s;i(r)}this.$nextTick((function(){t.carList1=[],t.carList.forEach((function(t,i){void 0==t.isChangePrice&&(t.isChangePrice=!1),void 0==t.isChangeReturnPrice&&(t.isChangeReturnPrice=!1),""==e.priceType?(""!=t.returnPrice&&null!=t.returnPrice&&0!=t.returnPrice||(t.returnPrice=t.isChangeReturnPrice?t.wholesalePrice:t.returnPrice),t.unitPrice=t.discountAmount>0?t.discountAmount:t.wholesalePrice):0==e.priceType?(t.unitPrice=t.isChangePrice?t.unitPrice:t.lsprice,t.discountAmount=t.isChangePrice?t.unitPrice:t.lsprice,t.returnPrice=t.isChangeReturnPrice?t.unitPrice:t.lsprice):1==e.priceType&&(t.unitPrice=t.isChangePrice?t.unitPrice:t.wholesalePrice,t.discountAmount=t.isChangePrice?t.unitPrice:t.wholesalePrice,t.returnPrice=t.isChangeReturnPrice?t.unitPrice:t.wholesalePrice),1==e.discountType&&(t.price=(1e4*Number(t.unitPrice)*Number(t.productCount)*Number(e.discountNum)/10/1e4).toFixed(2))})),t.getAmountAndWho()}))},sliceMsg:function(t){var e="";if("string"==typeof t){var i=JSON.parse(t);for(var r in i)e+="尺码"==r?i[r]:i[r]+" | "}return e},combination:function(t){var e=[[]];return t.map((function(t){var i=[];e.map((function(e){t.specs.map((function(t){i.push([].concat((0,u.default)(e),[t]))}))})),e=i})),e},numData:function(t){var e=[];if("string"==typeof t){var i=JSON.parse(t);for(var r in i)e.push(i[r])}return e},checkSpec:function(t,e,i,r){this.temporary=[e,i,t,r];this.getGategoryLowList()},getGategoryLowList:function(){var t=this;this.attrList=[];var e="颜色"==this.temporary[2]?0:1;this.tui.request("/app/productAttribute/selectByCategoryId","POST",{categoryId:this.carList.get(this.temporary[0]).attrId},!1,!0).then((function(i){200==i.code?(t.attrList.push(i.result[e]),i.result.length>0&&(t.attributeValue=[],t.tui.request("/app/productAttributeValue/selectByAttributeId","get",{id:t.attrList[0].id},!1,!0).then((function(e){200==e.code?(t.attributeValue=e.result,t.$forceUpdate()):t.tui.toast(res.message)})).catch((function(t){}))),setTimeout((function(){t.showList=t.attrList}),1e3)):t.tui.toast(res.message)})).catch((function(t){})),this.$forceUpdate(),this.$refs.getaPopup.open()},isSnList:function(t){var e=this;return(0,o.default)(s.default.mark((function i(){var r,a;return s.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:for(r=0;r<e.defaultList.newYanSeList.length;r++)for(a=0;a<e.defaultList.newYanSeList[r].value.length;a++)e.defaultList.newYanSeList[r].value[a].productCount="";return i.next=3,e.getDefaultCategory();case 3:return i.next=5,e.addPageGoods(t,"");case 5:case"end":return i.stop()}}),i)})))()},getSnList:function(){var t=this;this.snList=[],this.snName="",this.tui.request("/app/productSn/getProductSnByShopId","POST",{},!1,!0).then((function(e){if(200==e.code){if(""!=e.result){for(var i=0;i<e.result.length;i++){var r={text:"前缀:"+e.result[i].snPre+",位数:"+e.result[i].snSufLength,value:e.result[i].snPre};t.snList.push(r)}t.snName=e.result[0].snPre}}else t.tui.toast(res.message);t.$forceUpdate()})).catch((function(t){}))},startGetSn:function(){var e=this;return(0,o.default)(s.default.mark((function i(){var r;return s.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(r=e,""!=e.prefixRule){i.next=4;break}return e.tui.toast("请输入货号生成前缀规则"),i.abrupt("return");case 4:if(""!=e.numRule){i.next=7;break}return e.tui.toast("请输入货号生成位数规则"),i.abrupt("return");case 7:return i.next=9,e.tui.request("/app/productSn/addAndGetNewProductSn","POST",{snPre:e.prefixRule,snSufLength:e.numRule},!1,!1).then((function(i){200==i.code?"货号前缀已存在!"==i.message?t.showModal({title:"提示",content:"货号已经被删除,是否重新启用?",success:function(t){t.confirm&&r.tui.request("/app/productSn/useAgainProductSn","POST",{id:i.result.id},!1,!0).then((function(t){200==t.code?(r.tui.toast("重新启用成功"),setTimeout((function(t){r.$refs.SNDialog.close(),r.getSnList(),r.generateSn(r.prefixRule),r.$forceUpdate()}),1e3)):r.tui.toast(t.message),r.$forceUpdate()})).catch((function(t){}))}}):(r.$refs.SNDialog.close(),""!=e.oneGoodsId?r.generateSn(r.prefixRule):r.addPageGoods(r.zhuImg,i.result),r.getSnList()):e.tui.toast(res.message)})).catch((function(t){}));case 9:case"end":return i.stop()}}),i)})))()},addPageGoods:function(e,i){var r={id:i||(0,n.generateUUID)(),purchasePrice:0,price:0,price1:0,categoryName:this.categoryList.categoryName,categoryId:this.categoryList.categoryId,productCount:0,productId:"",productName:"",wholesalePrice:0,customerCategoryList:this.getNewProductRule(),lsprice:0,isNew:!0,productPictures:[],productPicture:e||"",productSn:i||"",stockLogList:new Map,stockLogList1:[]};r.stockLogList.set('{"颜色":"均色","尺码":"均码"}',{name:"均色/均码",productCount:0,isShowBtn:!1}),this.$forceUpdate(),t.hideLoading(),this.AiAddSpec(r,r.id,2)},handleNumber:function(t){t=t.toString();var e=t.replace(/[^0-9.-]/g,"");if(""===e)return"0";var i="";e.startsWith("-")?(i="-",e=e.substring(1).replace(/-/g,"")):e=e.replace(/-/g,"");var r=e.split(".");r.length>1&&(e=r[0]+"."+r.slice(1).join(""));var s="",o="";if(e.includes(".")){var u=e.split("."),c=(0,a.default)(u,2);s=c[0],o=c[1]}else s=e;s=s.replace(/^0+/,""),""===s&&(s="0");var n=""===o?s:"".concat(s,".").concat(o);return"0"!==s||""!==o&&!/^0*$/.test(o)||(n="0",i=""),i+n},changeSpec:function(t){var e=this;return(0,o.default)(s.default.mark((function i(){var r,a,o;return s.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(r=e,""!=t){i.next=4;break}return e.tui.toast("请输入要修改的规格值"),i.abrupt("return");case 4:return a=e.temporary,o=new Map,i.next=8,e.carList.get(a[0]).stockLogList.forEach((function(e,i){if("颜色"==a[2])if(r.numData(i)[0]==a[3]){var s=i.replace(a[3],t);1==o.has(s)?(a[1]=s,o.get(s).name=r.sliceMsg(s),o.get(s).productCount+=Number(e.productCount)):(a[1]=s,o.set(s,e),o.get(s).name=r.sliceMsg(s)),1!=r.carList.get(a[0]).isNew&&r.tui.request("/app/stock/productCount","post",{productId:r.carList.get(a[0]).productId,attributeList:s},!1,!0).then((function(t){200==t.code?(e.productNum=t.result,r.$forceUpdate()):r.tui.toast(t.message)})).catch((function(t){}))}else 1==o.has(i)?o.get(i).productCount+=Number(e.productCount):(o.set(i,e),o.get(i).name=r.sliceMsg(i));else if("尺码"==a[2])if(r.numData(i)[1]==a[3]){var u=i.replace(a[3],t);1==o.has(u)?(a[1]=u,o.get(u).name=r.sliceMsg(u),o.get(u).productCount+=Number(e.productCount)):(a[1]=u,o.set(u,e),o.get(u).name=r.sliceMsg(u)),1!=r.carList.get(a[0]).isNew&&r.tui.request("/app/stock/productCount","post",{productId:r.carList.get(a[0]).productId,attributeList:u},!1,!0).then((function(t){200==t.code?(e.productNum=t.result,r.$forceUpdate()):r.tui.toast(t.message)})).catch((function(t){}))}else 1==o.has(i)?o.get(i).productCount+=Number(e.productCount):(o.set(i,e),o.get(i).name=r.sliceMsg(i))}));case 8:return i.next=10,r.$nextTick((function(){e.carList.get(a[0]).stockLogList=o,e.$forceUpdate(),e.$refs.getaPopup.close()}));case 10:case"end":return i.stop()}}),i)})))()},allChange:function(t){if(this.linshiPrice==t.target.value?this.allChangeNum=t.target.value:""==t.target.value?this.allChangeNum=this.linshiPrice:this.allChangeNum=t.target.value,0==this.isPlusAndMinus)for(var e=0;e<this.temporaryList.length;e++){if(0==this.evalue.length)this.temporaryList[e].productCount=Number(this.allChangeNum);else for(var i=0;i<this.evalue.length;i++)this.evalue[i]==this.temporaryList[e].name&&(this.temporaryList[e].productCount=Number(this.allChangeNum));for(var r=0;r<this.pageOldTemList.length;r++)this.temporaryList[e].attributeList==this.pageOldTemList[r].attributeList&&(this.pageOldTemList[r].productCount=Number(this.temporaryList[e].productCount));for(i=0;i<this.oldTemList.length;i++)this.temporaryList[e].attributeList==this.oldTemList[i].attributeList&&(this.oldTemList[i].productCount=Number(this.temporaryList[e].productCount))}this.isPlusAndMinus,this.temporaryChange()},plusNum:function(){this.isPlusAndMinus;for(var t=0;t<this.temporaryList.length;t++){if(0==this.evalue.length)void 0==this.temporaryList[t].productCount?this.temporaryList[t].productCount=1:this.temporaryList[t].productCount+1>this.temporaryList[t].productNum&&("1838094297858183168"==this.shopId||"1811579958284390400"==this.shopId||"1818888277105709056"==this.shopId)?this.tui.toast(this.temporaryList[t].name+"已超出可售数量",300):this.temporaryList[t].productCount++;else for(var e=0;e<this.evalue.length;e++)this.evalue[e]==this.temporaryList[t].name&&(void 0==this.temporaryList[t].productCount?this.temporaryList[t].productCount=1:this.temporaryList[t].productCount+1>this.temporaryList[t].productNum&&("1838094297858183168"==this.shopId||"1811579958284390400"==this.shopId||"1818888277105709056"==this.shopId)?this.tui.toast(this.temporaryList[t].name+"已超出可售数量",300):this.temporaryList[t].productCount++);for(var i=0;i<this.pageOldTemList.length;i++)this.temporaryList[t].attributeList==this.pageOldTemList[i].attributeList&&(this.pageOldTemList[i].productCount=Number(this.temporaryList[t].productCount));for(e=0;e<this.oldTemList.length;e++)this.temporaryList[t].attributeList==this.oldTemList[e].attributeList&&(this.oldTemList[e].productCount=Number(this.temporaryList[t].productCount))}this.temporaryChange()},plusReturnNum:function(){this.isPlusAndMinus;for(var t=0;t<this.temporaryReturnList.length;t++){if(0==this.evalue.length)void 0==this.temporaryReturnList[t].productCount?this.temporaryReturnList[t].productCount=-1:this.temporaryReturnList[t].productCount+1>0?this.temporaryReturnList[t].productCount=0:this.temporaryReturnList[t].productCount++;else for(var e=0;e<this.evalue.length;e++)this.evalue[e]==this.temporaryReturnList[t].name&&(void 0==this.temporaryReturnList[t].productCount?this.temporaryReturnList[t].productCount=-1:this.temporaryReturnList[t].productCount+1>0?this.temporaryReturnList[t].productCount=0:this.temporaryReturnList[t].productCount++);for(var i=0;i<this.pageOldTemReturnList.length;i++)this.temporaryReturnList[t].attributeList==this.pageOldTemReturnList[i].attributeList&&(this.pageOldTemReturnList[i].productCount=Number(this.temporaryReturnList[t].productCount));for(e=0;e<this.oldTemReturnList.length;e++)this.temporaryReturnList[t].attributeList==this.oldTemReturnList[e].attributeList&&(this.oldTemReturnList[e].productCount=Number(this.temporaryReturnList[t].productCount))}this.temporaryReturnChange()},getScanCodeCategroyId:function(t){this.isOpenId="颜色"==t?0:1,this.goodsId=this.goodsDetail.id,this.$refs.specDialog.open("bottom"),this.isBottom=!0},attrReturnNameChange:function(e,i,r){var s=this;t.showLoading({title:"加载中..."}),this.goodsReturnDetail.attributeList[e].isChecked=!this.goodsReturnDetail.attributeList[e].isChecked,this.goodsReturnDetail.attributeList[e].value[r].isChecked=!this.goodsReturnDetail.attributeList[e].value[r].isChecked,this.evalue=[];for(var a=[],o=0,u=this.goodsReturnDetail.attributeList[0].value;o<u.length;o++)if(u[o].isChecked)for(var c=0,n=this.goodsReturnDetail.attributeList[1].value;c<n.length;c++){var d,l="{";d=u[o].value+" | "+n[c].value,l+='"颜色":"'+u[o].value+'",',l+='"尺码":"'+n[c].value+'"',l+="}",a.push(l),this.evalue.push(d)}if(void 0==this.temporaryReturnList||0==this.temporaryReturnList.length){this.temporaryReturnList=[];for(var h=0;h<a.length;h++)this.attributeList={attributeList:a[h],productCount:Number(this.temporaryNum),productNum:null,name:this.evalue[h],price:this.purchasePrice},this.temporaryReturnList.push(this.attributeList)}else{var g=0;for(h=0;h<a.length;h++){for(var L=0;L<this.temporaryReturnList.length;L++)this.temporaryReturnList[L].attributeList==a[h]&&(g=Number(this.temporaryReturnList[L].productCount));this.attributeList={attributeList:a[h],productCount:g,productNum:null,name:this.evalue[h],price:this.purchasePrice},this.newTemReturnList.push(this.attributeList),g=0}for(h=0;h<this.oldTemReturnList.length;h++){var p=!0;for(L=0;L<this.newTemReturnList.length;L++)this.oldTemReturnList[h].attributeList==this.newTemReturnList[L].attributeList&&(this.newTemReturnList[L].productCount=Number(this.oldTemReturnList[h].productCount),p=!1);this.newTemReturnList.length>0&&p&&this.newTemReturnList.push(this.oldTemReturnList[h])}for(h=0;h<this.pageOldTemReturnList.length;h++){var m=!0;for(L=0;L<this.newTemReturnList.length;L++)this.pageOldTemReturnList[h].attributeList==this.newTemReturnList[L].attributeList&&(this.newTemReturnList[L].productCount=Number(this.pageOldTemReturnList[h].productCount),m=!1);this.newTemReturnList.length>0&&m&&this.newTemReturnList.push(this.pageOldTemReturnList[h])}}this.$nextTick((function(){for(var t=0;t<s.temporaryReturnList.length;t++)for(var e=0;e<s.pecsList.length;e++)s.temporaryReturnList[t].attributeList==s.pecsList[e].attributeList&&(s.temporaryReturnList[t].productNum=s.pecsList[e].stockCount)})),0!=this.newTemReturnList.length&&(this.temporaryReturnList=this.newTemReturnList,this.oldTemReturnList=[],this.newTemReturnList=[]),setTimeout((function(e){t.hideLoading()}),200)},attrNameChange:function(e,i,r){var s=this,a=this;if(t.showLoading({title:"加载中..."}),this.goodsDetail.isNew){-1!=this.goodsList[e].specs.indexOf(i)?this.goodsList[e].specs.splice(this.goodsList[e].specs.indexOf(i),1):this.goodsList[e].specs.push(i);for(var o=0,u=0;u<this.goodsList.length;u++)this.goodsList[u].specs.length>0&&o++;var c=[];o==this.goodsList.length&&(c=this.combination(this.goodsList)),this.evalue=[];for(var n=[],d=0;d<c.length;d++){for(var l="",h="{",g=0;g<c[d].length;g++)g!=c[d].length-1?(l+=c[d][g]+"/",h+='"'+this.dataObj.get(c[d][g])+'":"'+c[d][g]+'",'):(l+=c[d][g],h+='"'+this.dataObj.get(c[d][g])+'":"'+c[d][g]+'"');h+="}",n.push(h),this.evalue.push(l)}if(0==o&&(this.oldTemList=[],this.temporaryList=this.pageOldTemList),0==this.temporaryList.length){if(o==this.goodsList.length)for(u=0;u<n.length;u++)this.attributeList={attributeList:n[u],productCount:Number(this.temporaryNum),productNum:this.productNum,name:this.evalue[u],price:this.purchasePrice},this.temporaryList.push(this.attributeList)}else{var L=0;for(u=0;u<n.length;u++){for(d=0;d<this.temporaryList.length;d++)this.temporaryList[d].attributeList==n[u]&&(L=Number(this.temporaryList[d].productCount));this.attributeList={attributeList:n[u],productCount:L||0,productNum:this.productNum,name:this.evalue[u],price:this.purchasePrice},this.newTemList.push(this.attributeList),L=0}for(u=0;u<this.oldTemList.length;u++){var p=!0;for(d=0;d<this.newTemList.length;d++)this.oldTemList[u].attributeList==this.newTemList[d].attributeList&&(this.newTemList[d].productCount=Number(this.oldTemList[u].productCount),p=!1);this.newTemList.length>0&&p&&this.newTemList.push(this.oldTemList[u])}for(u=0;u<this.pageOldTemList.length;u++){var m=!0;for(d=0;d<this.newTemList.length;d++)this.pageOldTemList[u].attributeList==this.newTemList[d].attributeList&&(this.newTemList[d].productCount=Number(this.pageOldTemList[u].productCount),m=!1);this.newTemList.length>0&&m&&this.newTemList.push(this.pageOldTemList[u])}}this.$nextTick((function(){for(var t=0;t<a.temporaryList.length;t++)for(var e=0;e<a.pecsList.length;e++)a.temporaryList[t].attributeList==a.pecsList[e].attributeList&&(a.temporaryList[t].productNum=a.pecsList[e].stockCount),a.$forceUpdate()})),o!=this.goodsList.length&&0==this.oldTemList.length&&0==this.pageOldTemList.length&&(this.newTemList=[],this.temporaryList=[]),0!=this.newTemList.length&&o==this.goodsList.length&&(this.temporaryList=this.newTemList,this.oldTemList=[],this.newTemList=[]),setTimeout((function(e){t.hideLoading()}),200)}else{this.evalue=[];n=[];for(var f=0,y=this.goodsDetail.attributeList[0].value;f<y.length;f++)for(var P=0,b=this.goodsDetail.attributeList[1].value;P<b.length;P++){l="";var v="{";l=y[f].value+" | "+b[P].value,v+='"颜色":"'+y[f].value+'",',v+='"尺码":"'+b[P].value+'"',v+="}",n.push(v),this.evalue.push(l)}if(0==this.temporaryList.length)for(u=0;u<n.length;u++)this.attributeList={attributeList:n[u],productCount:Number(this.temporaryNum),productNum:null,name:this.evalue[u],price:this.purchasePrice},this.temporaryList.push(this.attributeList);else{var C=0;for(u=0;u<n.length;u++){for(d=0;d<this.temporaryList.length;d++)this.temporaryList[d].attributeList==n[u]&&(C=Number(this.temporaryList[d].productCount));this.attributeList={attributeList:n[u],productCount:C,productNum:null,name:this.evalue[u],price:this.purchasePrice},this.newTemList.push(this.attributeList),C=0}for(u=0;u<this.oldTemList.length;u++){var N=!0;for(d=0;d<this.newTemList.length;d++)this.oldTemList[u].attributeList==this.newTemList[d].attributeList&&(this.newTemList[d].productCount=Number(this.oldTemList[u].productCount),N=!1);this.newTemList.length>0&&N&&this.newTemList.push(this.oldTemList[u])}for(u=0;u<this.pageOldTemList.length;u++){var k=!0;for(d=0;d<this.newTemList.length;d++)this.pageOldTemList[u].attributeList==this.newTemList[d].attributeList&&(this.newTemList[d].productCount=Number(this.pageOldTemList[u].productCount),k=!1);this.newTemList.length>0&&k&&this.newTemList.push(this.pageOldTemList[u])}}0!=this.newTemList.length&&(this.temporaryList=this.newTemList,this.oldTemList=[],this.newTemList=[]),this.$nextTick((function(){for(var t=0;t<s.temporaryList.length;t++)for(var e=0;e<s.pecsList.length;e++)s.temporaryList[t].attributeList==s.pecsList[e].attributeList&&(s.temporaryList[t].productNum=s.pecsList[e].stockCount)})),setTimeout((function(e){t.hideLoading()}),200)}this.$forceUpdate()},obtainPrice:function(e,i,r,s){this.linshiPrice=e.target.value,"danjia"==i?(this.keyboard="danjia",this.isFocused=r+"purchasePrice",this.keyboardIndex=[r]):"pifa"==i?(this.keyboard="pifa",this.isFocused=r+"wholesalePrice",this.keyboardIndex=[r]):"lingshou"==i?(this.keyboard="lingshou",this.keyboardIndex=[r],this.isFocused=r+"lsprice",this.$forceUpdate()):"danjishu"==i?(this.temporaryList[r].productCount="",this.$forceUpdate()):"zongjishu"==i?this.allChangeNum="":"shouldPay"==i?(this.isFocused="shouldPay",t.hideKeyboard(),this.keyboard="shouldPay"):"mapdanjishu"==i?(this.keyboard="mapdanjishu",this.isFocused=r+s+"productCount",this.keyboardIndex=[r,s],this.$forceUpdate()):"alreadyPay"==i&&(this.isFocused="alreadyPay",t.hideKeyboard(),this.keyboard="alreadyPay"),this.$forceUpdate()},obtainPrice1:function(t,e,i,r){this.linshiPrice=t.target.value,this.popupText="","danjia"==e?(this.keyboard="danjia1",this.isFocused="purchasePrice1"):"pifa"==e?(this.keyboard="pifa1",this.isFocused="wholesalePrice1"):"lingshou"==e?(this.keyboard="lingshou1",this.isFocused="lsprice1",this.$forceUpdate()):"danjishu"==e&&(this.keyboard="danjishu1",this.isFocused=JSON.stringify(i)+JSON.stringify(r)+"danjishu1",this.keyboardIndex=[i,r]),this.$forceUpdate()},numChange:function(t,e,i){console.log(this.goodsDetail);for(var r=!1,s=0;s<this.temporaryList.length;s++)this.temporaryList[s].attributeList==this.goodsDetail.attributeList.newYanSeList[e].value[i].name&&(this.temporaryList[s].productCount=this.goodsDetail.attributeList.newYanSeList[e].value[i].productCount,r=!0);if(0==r){var a={attributeList:this.goodsDetail.attributeList.newYanSeList[e].value[i].name,productCount:this.goodsDetail.attributeList.newYanSeList[e].value[i].productCount,productNum:this.goodsDetail.attributeList.newYanSeList[e].value[i].kucun,name:this.goodsDetail.attributeList.newYanSeList[e].value[i].name,price:this.goodsDetail.purchasePrice};this.temporaryList.push(a)}this.temporaryChange()},checkCanReturn:function(e,i,r,s,a){var o=this;this.tui.request("/app/customer/getCustomerBuyHistory","POST",{productId:i,attributeList:r,customerId:s},!1,!0).then((function(i){if(200==i.code){var s=null==i.result.buyCount?0:i.result.buyCount,u=null==i.result.returnCount?0:i.result.returnCount;if(Number(s)<=0||Number(s)-Number(u)+Number(a)<0){var c={productSn:e,attributeList:r,buyCountAll:s,returnCountAll:u,returnCountAllNew:a};o.checkCanBuy.push(c)}t.hideLoading()}})).catch((function(e){t.hideLoading()}))},changessPrice:function(t){this.linshiPrice==t.target.value?this.shouldPay=t.target.value:""==t.target.value?this.shouldPay=this.linshiPrice:this.shouldPay=t.target.value,this.alreadyPay=this.shouldPay,this.noPay=this.shouldPay-this.alreadyPay},changessPrice1:function(t){this.isFocused=!1,this.alreadyPay=this.shouldPay,this.noPay=this.shouldPay-this.alreadyPay,this.changePay(this.alreadyPay)},changePrice:function(t){this.tanyishou=!0,this.priceOk=t,this.noPay=this.relPrice-this.priceOk,this.noPay=Number(this.noPay.toFixed(2)),this.leijiqiankuan=Number((Number(this.zhiqianqiankuan)-Number(this.qiankuandikou)+Number(this.yuedikou)+Number(this.noPay)).toFixed(2)),this.$forceUpdate()},changePriceStatus:function(){this.isChangeShouldPay=!1,this.isChangeReturnPay=!1,this.isChangeRelPrice=!1,this.isChangePriceOk=!1},getImg:function(t){return this.carList.get(t).productPicture},getText:function(t){this.voiceText=t.detail.value},categoryChange:function(t){for(var e=0;e<this.categoryList.length;e++)this.categoryList[e].value==t&&(this.xsyId=t,this.createByName=this.categoryList[e].text)},payTypeChange:function(t){for(var e=0;e<this.payTypeList.length;e++)this.payTypeList[e].value==t&&(this.payType=t)},clearText:function(){this.voiceText="",this.voiceText1=""},spliceMsg:function(t){return t.replace(/嗯|啊|儿|阿|恩/g,"")},mapnumChange:function(t,e,i){var r=this,s=this;this.carList.get(e).productCount=0,this.carList.get(e).returnCount=0,this.linshiPrice==t.target.value?this.carList.get(e).stockLogList.get(i).productCount=Number(t.target.value):""==t.detail.value?this.carList.get(e).stockLogList.get(i).productCount=Number(this.linshiPrice):this.carList.get(e).stockLogList.get(i).productCount=Number(t.detail.value),this.carList.get(e).stockLogList.forEach((function(t,i){t.productCount<0?s.carList.get(e).returnCount=Number(s.carList.get(e).returnCount)+Math.abs(t.productCount):s.carList.get(e).productCount=Number(s.carList.get(e).productCount)+Number(t.productCount)})),this.$nextTick((function(){s.carList.get(e).price1=(Number(s.carList.get(e).productCount)*Number(s.carList.get(e).purchasePrice)).toFixed(2)})),this.$nextTick((function(){r.getAllPrice()}))},mapnumChange1:function(t,e,i){var r=this,s=this;this.isFocused=!1,this.carList.get(e).productCount=0,this.carList.get(e).stockLogList.forEach((function(t,i){s.carList.get(e).productCount=Number(s.carList.get(e).productCount)+Number(t.productCount)})),this.$nextTick((function(){s.carList.get(e).price1=(Number(s.carList.get(e).productCount)*Number(s.carList.get(e).purchasePrice)).toFixed(2)})),this.$nextTick((function(){r.getAllPrice()}))},closeMask:function(){this.isFocused=!1,this.$refs.uKeyboard.clearText(),this.$forceUpdate()},closeMask1:function(t,e){this.carList.get(t).stockLogList.get(e).isShowBtn=!1,this.$forceUpdate()},longPrec:function(e,i){var r=this;t.showModal({title:"提示",content:"确定删除此默认规格吗?",success:function(s){t.showLoading({title:"加载中..."}),s.confirm&&r.delDefaultCate(e,i),setTimeout((function(e){t.hideLoading()}),500)}})},convertChineseToArabic:function(t){var e={"零":0,"幺":1,"一":1,"二":2,"两":2,"三":3,"四":4,"五":5,"六":6,"七":7,"八":8,"九":9,"杠":"-","刚":"-","军色":"均色","叉":"X","井":"#","时间":"10件","事件":"10件","世间":"10件","实践":"10件","实件":"10件","十件":"10件","实价":"10件","议价":"1件","衣架":"1件","景":"#","警":"#","颈":"#","括号":"货号","付":"-","负":"-","父":"-","名城":"名称","明城":"名称","名成":"名称","名程":"名称","上移":"上衣","时1":"11","时2":"12","时3":"13","时4":"14","时5":"15","时6":"16","时7":"17","时8":"18","时9":"19"};return t.replace(/(幺|零|一|二|两|三|四|五|六|七|八|九|杠|刚|军色|叉|井|时间|衣架|议价|实价|十件|事件|世间|实践|实件|景|警|颈|括号|付|负|父|名城|名程|名成|明城|上移|时1|时2|时3|时4|时5|时6|时7|时8|时9)/g,(function(t){return e[t]}))},setDetail:function(e){var i=this;return(0,o.default)(s.default.mark((function e(){var r,a,o,u,c,d,l,h,g,L;return s.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(r=i,""!=i.voiceText){e.next=4;break}return i.tui.toast("识别内容不能为空"),e.abrupt("return");case 4:if(a=i.trimWhitespace(i.voiceText),a=i.convertChineseToArabic(a),-1!=a.indexOf("件数")&&(a=a.replace(/件数/g,"数量:")),-1==a.indexOf("数量")&&-1==a.indexOf("名称")&&-1==a.indexOf("单价")&&-1==a.indexOf("批发价")&&(a+=","),-1!=a.indexOf("点")&&(a=i.replaceCharAfterNumber(a,"点",".")),-1!=a.indexOf(",名称")&&(a=a.replace(/,名称/g,"名称")),-1!=a.indexOf("名称,")&&(a=a.replace(/名称,/g,"名称")),-1!=a.indexOf("名称::")&&(a=a.replace(/名称::/g,"名称")),-1!=a.indexOf("名称:")&&(a=a.replace(/名称:/g,"名称")),-1!=a.indexOf("名称")&&(a=a.replace(/名称/g,",名称:")),-1!=a.indexOf(",单价")&&(a=a.replace(/,单价/g,"单价")),-1!=a.indexOf("单价,")&&(a=a.replace(/单价,/g,"单价")),-1!=a.indexOf("单价::")&&(a=a.replace(/单价::/g,"单价")),-1!=a.indexOf("单价:")&&(a=a.replace(/单价:/g,"单价")),-1!=a.indexOf("单价")&&(a=a.replace(/单价/g,",单价:")),-1!=a.indexOf(",数量")&&(a=a.replace(/,数量/g,"数量")),-1!=a.indexOf("数量,")&&(a=a.replace(/数量,/g,"数量")),-1!=a.indexOf("数量::")&&(a=a.replace(/数量::/g,"数量")),-1!=a.indexOf("数量:")&&(a=a.replace(/数量:/g,"数量")),-1!=a.indexOf("数量")&&(a=a.replace(/数量/g,",数量:")),-1!=a.indexOf(",批发价")&&(a=a.replace(/,批发价/g,"批发价")),-1!=a.indexOf("批发价,")&&(a=a.replace(/批发价,/g,"批发价")),-1!=a.indexOf("批发价::")&&(a=a.replace(/批发价::/g,"批发价")),-1!=a.indexOf("批发价:")&&(a=a.replace(/批发价:/g,"批发价")),-1!=a.indexOf("批发价")&&(a=a.replace(/批发价/g,",批发价:")),-1!=a.indexOf(",零售价")&&(a=a.replace(/,零售价/g,"零售价")),-1!=a.indexOf("零售价,")&&(a=a.replace(/零售价,/g,"零售价")),-1!=a.indexOf("零售价::")&&(a=a.replace(/零售价::/g,"零售价")),-1!=a.indexOf("零售价:")&&(a=a.replace(/零售价:/g,"零售价")),-1!=a.indexOf("零售价")&&(a=a.replace(/零售价/g,",零售价:")),a.startsWith("号")&&(a="货号"+a.substr(1)),a.startsWith("货号")||(a="货号"+a),-1!=a.indexOf("货号,")&&(a=a.replace(/货号,/g,"货号")),-1!=a.indexOf("货号::")&&(a=a.replace(/货号::/g,"货号")),-1!=a.indexOf("货号:")&&(a=a.replace(/货号:/g,"货号")),a=i.convertStringCorrectly(a),a=i.spliceMsg(a),0==a.indexOf(",")&&(a=a.substr(1)),i.getMsg=a,o=/-?\d+/g,u=!0,c=t.getStorageSync("shopId"),"1863043415453863936"!=c&&"1855423693308694528"!=c&&"1810179818189361152"!=c||-1!=a.indexOf("数量")||(u=!1),-1!=a.indexOf("色")||-1!=a.indexOf("码")||!u){e.next=68;break}for(a.startsWith("货号")||(a="货号"+a),e.prev=49,d=/货号.*?(?=货号|$)/g,a=a.match(d),l=function(t){if(1==i.voiceGetOneData){var e=i.extractInfo(a[t]+"。");e.productSn&&(e.productSn=e.productSn.replace(/[沟勾钩]/g,"J")),e.productCount&&(e.productCount=Number(e.productCount.replace(/[^0-9]/g,""))),e.purchasePrice&&(e.purchasePrice=i.replaceCharAfterNumber(e.purchasePrice,"块","."),-1!=e.purchasePrice.indexOf("元")&&(e.purchasePrice=e.purchasePrice.replace(/元/g,"")),e.purchasePrice=e.purchasePrice.replace(/[^0-9.]/g,"")),e.wholesalePrice&&(e.wholesalePrice=i.replaceCharAfterNumber(e.wholesalePrice,"块","."),-1!=e.wholesalePrice.indexOf("元")&&(e.wholesalePrice=e.wholesalePrice.replace(/元/g,"")),e.wholesalePrice=e.wholesalePrice.replace(/[^0-9.]/g,"")),e.lsprice&&(e.lsprice=i.replaceCharAfterNumber(e.lsprice,"块","."),-1!=e.lsprice.indexOf("元")&&(e.lsprice=e.lsprice.replace(/元/g,"")),e.lsprice=e.lsprice.replace(/[^0-9.]/g,"")),t==a.length-1?setTimeout((function(r){i.getOneData(e,!0,200*(t+1))}),200*(t+1)):setTimeout((function(r){i.getOneData(e,!1,200*(t+1))}),200*(t+1))}else setTimeout((function(e){-1==a[t].indexOf("数量")&&-1==a[t].indexOf("名称")&&-1==a[t].indexOf("单价")&&-1==a[t].indexOf("批发价")&&-1==a[t].indexOf(",")&&(a[t]=a[t]+",");var s=i.extractInfo(a[t]+"。");s.productSn&&(s.productSn=s.productSn.replace(/[沟勾钩]/g,"J")),s.productCount&&(s.productCount=s.productCount.match(o)),s.purchasePrice&&(s.purchasePrice=i.replaceCharAfterNumber(s.purchasePrice,"块","."),-1!=s.purchasePrice.indexOf("元")&&(s.purchasePrice=s.purchasePrice.replace(/元/g,"")),s.purchasePrice=s.purchasePrice.replace(/[^0-9.]/g,"")),s.wholesalePrice&&(s.wholesalePrice=i.replaceCharAfterNumber(s.wholesalePrice,"块","."),-1!=s.wholesalePrice.indexOf("元")&&(s.wholesalePrice=s.wholesalePrice.replace(/元/g,"")),s.wholesalePrice=s.wholesalePrice.replace(/[^0-9.]/g,"")),s.lsprice&&(s.lsprice=i.replaceCharAfterNumber(s.lsprice,"块","."),-1!=s.lsprice.indexOf("元")&&(s.lsprice=s.lsprice.replace(/元/g,"")),s.lsprice=s.lsprice.replace(/[^0-9.]/g,"")),i.tui.request("/app/product/getByProductSn","post",{productSn:s.productSn},!1,!0).then((function(e){if(200==e.code)if(""!=e.result)i.voiceText="",i.$refs.popup.close(),i.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId","POST",{categoryId:e.result[0].attrId},!1,!0).then((function(o){if(200==o.code){var u={attributeList:'{"颜色":"均色","尺码":"均码"}',productCount:Number(s.productCount)||1,stockCount:null};if(o.result.stock.length>0)for(var c=0;c<o.result.stock.length;c++)'{"颜色":"均色","尺码":"均码"}'==o.result.stock[c].attributeList&&(u={attributeList:'{"颜色":"均色","尺码":"均码"}',productCount:Number(s.productCount)||1,stockCount:o.result.stock[c].stockCount});s.purchasePrice&&(s.purchasePrice=i.replaceCharAfterNumber(s.purchasePrice,"块","."),-1!=s.purchasePrice.indexOf("元")&&(s.purchasePrice=s.purchasePrice.replace(/元/g,"")),s.purchasePrice=s.purchasePrice.replace(/[^0-9.]/g,"")),s.wholesalePrice&&(s.wholesalePrice=i.replaceCharAfterNumber(s.wholesalePrice,"块","."),-1!=s.wholesalePrice.indexOf("元")&&(s.wholesalePrice=s.wholesalePrice.replace(/元/g,"")),s.wholesalePrice=s.wholesalePrice.replace(/[^0-9.]/g,"")),e.result[0].productId=e.result[0].id,e.result[0].stockLogList1=[],e.result[0].stockLogList1.push(u);var n=e.result;if(i.oneGoodsId){var d=i.oneGoodsId;if(n.length>0){if(""!=i.carList.get(d).productSn){for(var l=0;l<n.length;l++)for(var h=0;h<n[l].stockLogList1.length;h++)""==i.carList.get(d).productName&&(i.carList.get(d).productName=n[0].productName),""==i.carList.get(d).attrId&&(i.carList.get(d).attrId=n[0].attrId),""!=i.carList.get(d).purchasePrice&&null!=i.carList.get(d).purchasePrice||(s.purchasePrice?i.carList.get(d).purchasePrice=s.purchasePrice:i.carList.get(d).purchasePrice=n[0].purchasePrice),""==i.carList.get(d).productPicture&&(i.carList.get(d).productPicture=n[0].productPicture),i.carList.get(d).customerCategoryRule=i.checkPriceRule(JSON.parse(n[0].customerCategoryRule)),n[l].stockLogList1[h].name=i.sliceMsg(n[l].stockLogList1[h].attributeList),0==i.carList.get(d).stockLogList.size?i.carList.get(d).stockLogList.set(n[l].stockLogList1[h].attributeList,n[l].stockLogList1[h]):1==i.carList.get(d).stockLogList.has(n[l].stockLogList1[h].attributeList)?(i.carList.get(d).stockLogList.get(n[l].stockLogList1[h].attributeList).productNum=n[l].stockLogList1[h].stockCount,i.carList.get(d).stockLogList.get(n[l].stockLogList1[h].attributeList).productCount+=Number(n[l].stockLogList1[h].productCount)):i.carList.get(d).stockLogList.set(n[l].stockLogList1[h].attributeList,n[l].stockLogList1[h]),i.carList.get(d).productCount+=Number(n[l].stockLogList1[h].productCount);0==i.carList.get(d).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount&&n[0].stockLogList1.length>0&&i.carList.get(d).stockLogList.delete('{"颜色":"均色","尺码":"均码"}'),i.carList.get(d).price1=(Number(i.carList.get(d).productCount)*Number(i.carList.get(d).purchasePrice)).toFixed(2)}else{var g=!1;i.carList.forEach((function(t,e){if(t.productSn==n[0].productSn)throw g=!0,r.tui.toast("该货号被页面其他商品占用,请重新输入!"),r.carList.get(d).productSn="",setTimeout((function(t){r.$forceUpdate()}),1e3),Error("被占用")})),i.$nextTick((function(){""==i.carList.get(d).productName&&(i.carList.get(d).productName=n[0].productName),i.carList.get(d).customerCategoryList=null!=n[0].customerCategoryRule?i.checkPriceRule(JSON.parse(n[0].customerCategoryRule)):null,0==g&&""==i.carList.get(d).productSn&&(i.carList.get(d).productSn=n[0].productSn),0==g&&(n[0].productId?(i.carList.get(d).id=n[0].productId,i.carList.get(d).productId=n[0].productId,i.carList.get(d).isNew=!1,d=n[0].productId):""==n[0].productSn||null==n[0].productSn?(i.carList.get(d).id=n[0].productName,d=n[0].productName):"货号"==n[0].productSn?(i.carList.get(d).productSn=n[0].productName,i.carList.get(d).id=n[0].productName,d=n[0].productName):n[0].productSn&&(i.carList.get(d).id=n[0].productSn,d=n[0].productSn))})),""!=i.carList.get(d).purchasePrice&&null!=i.carList.get(d).purchasePrice||(s.purchasePrice?i.carList.get(d).purchasePrice=s.purchasePrice:i.carList.get(d).purchasePrice=n[0].purchasePrice),i.carList.get(d).customerCategoryList=null!=n[0].customerCategoryRule?i.checkPriceRule(JSON.parse(n[0].customerCategoryRule)):i.getNewProductRule(),""==i.carList.get(d).productPicture&&(i.carList.get(d).productPicture=n[0].productPicture),n[0].productId&&(i.carList.get(d).attrId=n[0].attrId,i.carList.get(d).wholesalePrice=n[0].wholesalePrice,i.carList.get(d).lsPrice=n[0].lsPrice);var L=new Map;i.$nextTick((function(){i.carList.forEach((function(t,e){e!=t.id?L.set(t.id,t):L.set(e,t)})),i.carList=L})),i.$nextTick((function(){for(var t=0;t<n.length;t++)for(var e=0;e<n[t].stockLogList1.length;e++)n[t].stockLogList1[e].name=i.sliceMsg(n[t].stockLogList1[e].attributeList),0==i.carList.get(d).stockLogList.size?i.carList.get(d).stockLogList.set(n[t].stockLogList1[e].attributeList,n[t].stockLogList1[e]):1==i.carList.get(d).stockLogList.has(n[t].stockLogList1[e].attributeList)?(i.carList.get(d).stockLogList.get(n[t].stockLogList1[e].attributeList).productNum=n[t].stockLogList1[e].stockCount,i.carList.get(d).stockLogList.get(n[t].stockLogList1[e].attributeList).productCount+=Number(n[t].stockLogList1[e].productCount)):i.carList.get(d).stockLogList.set(n[t].stockLogList1[e].attributeList,n[t].stockLogList1[e]),i.carList.get(d).productCount+=Number(n[t].stockLogList1[e].productCount);i.carList.get(d).price1=(Number(i.carList.get(d).productCount)*Number(i.carList.get(d).purchasePrice)).toFixed(2),0==i.carList.get(d).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount&&n[0].stockLogList1.length>0&&i.carList.get(d).stockLogList.delete('{"颜色":"均色","尺码":"均码"}')}))}i.$nextTick((function(){i.getAllPrice(),i.oneGoodsId=""}))}else i.tui.toast("抱歉:小助手本次未识别到商品信息,请检查识别信息是否正确")}else{for(var p=0;p<n.length;p++){var m={id:"",price:n[p].price,productCount:0,customerCategoryList:null!=n[p].customerCategoryRule?i.checkPriceRule(JSON.parse(n[p].customerCategoryRule)):i.getNewProductRule(),attrId:n[p].attrId,categoryId:""==n[p].categoryId?i.categoryList.categoryId:n[p].categoryId,categoryName:""==n[p].categoryName?i.categoryList.categoryName:n[p].categoryName,wholesalePrice:s.wholesalePrice?s.wholesalePrice:n[p].wholesalePrice,purchasePrice:s.purchasePrice?s.purchasePrice:n[p].purchasePrice,isNew:null==n[p].productId,productId:n[p].productId,productName:n[p].productName,productSn:n[p].productSn,productPicture:n[p].productPicture,supplierName:n[p].supplierName,productPictures:[],saleDetailQueryDTO:[]};n[p].productId?m.id=n[p].productId:""==n[p].productSn||null==n[p].productSn?m.id=n[p].productName:"货号"==n[p].productSn?(m.productSn=n[p].productName,m.id=n[p].productName):n[p].productSn&&(m.id=n[p].productSn);for(var f=0;f<n[p].stockLogList1.length;f++){var y={attributeList:i.getAttribute(n[p].stockLogList1[f].attributeList),productCount:Number(n[p].stockLogList1[f].productCount)||Number(n[p].stockLogList1[f].productCounts),productNum:n[p].stockLogList1[f].stockCount,name:i.sliceMsg(i.getAttribute(n[p].stockLogList1[f].attributeList)),price:n[p].stockLogList1[f].purchasePrice};m.productCount+=Number(n[p].stockLogList1[f].productCount),m.saleDetailQueryDTO.push(y)}i.carList1.push(m)}t==a.length-1&&i.$nextTick((function(){setTimeout((function(t){i.AiVoice()}),300)}))}}else i.tui.toast(o.message)})).catch((function(t){}));else{if(i.voiceText="",i.voiceText1="",i.$refs.popup.close(),s.productCount){s.productCount=s.productCount[0].match(/\d+/g)}s.purchasePrice&&(s.purchasePrice=i.replaceCharAfterNumber(s.purchasePrice,"块","."),-1!=s.purchasePrice.indexOf("元")&&(s.purchasePrice=s.purchasePrice.replace(/元/g,"")),s.purchasePrice=s.purchasePrice.replace(/[^0-9.]/g,"")),s.wholesalePrice&&(s.wholesalePrice=i.replaceCharAfterNumber(s.wholesalePrice,"块","."),-1!=s.wholesalePrice.indexOf("元")&&(s.wholesalePrice=s.wholesalePrice.replace(/元/g,"")),s.wholesalePrice=s.wholesalePrice.replace(/[^0-9.]/g,""));var o={id:s.productSn?s.productSn:(0,n.generateUUID)(),productCount:Number(s.productCount)||0,productName:s.productName,productSn:s.productSn,categoryId:i.categoryList.categoryId,categoryName:i.categoryList.categoryName,purchasePrice:s.purchasePrice||0,wholesalePrice:s.wholesalePrice||0,stockLogList1:[{attributeList:'{"颜色":"均色","尺码":"均码"}',productCount:Number(s.productCount)||1,stockCount:null}]},u=[];if(u.push(o),i.oneGoodsId){var c=i.oneGoodsId;if(u.length>0){if(""!=i.carList.get(c).productSn){for(var d=0;d<u.length;d++)for(var l=0;l<u[d].stockLogList1.length;l++)""==i.carList.get(c).productName&&(i.carList.get(c).productName=u[0].productName),""==i.carList.get(c).productSn&&(i.carList.get(c).productSn=u[0].productSn),""==i.carList.get(c).attrId&&(i.carList.get(c).attrId=u[0].attrId),""!=i.carList.get(c).wholesalePrice&&null!=i.carList.get(c).wholesalePrice||(i.carList.get(c).wholesalePrice=u[0].wholesalePrice),""!=i.carList.get(c).purchasePrice&&null!=i.carList.get(c).purchasePrice||(i.carList.get(c).purchasePrice=u[0].purchasePrice),""==i.carList.get(c).productPicture&&(i.carList.get(c).productPicture=u[0].productPicture),u[d].stockLogList1[l].name=i.sliceMsg(u[d].stockLogList1[l].attributeList),0==i.carList.get(c).stockLogList.size?i.carList.get(c).stockLogList.set(u[d].stockLogList1[l].attributeList,u[d].stockLogList1[l]):1==i.carList.get(c).stockLogList.has(u[d].stockLogList1[l].attributeList)?i.carList.get(c).stockLogList.get(u[d].stockLogList1[l].attributeList).productCount+=Number(u[d].stockLogList1[l].productCount):i.carList.get(c).stockLogList.set(u[d].stockLogList1[l].attributeList,u[d].stockLogList1[l]),i.carList.get(c).productCount+=Number(u[d].stockLogList1[l].productCount);0==i.carList.get(c).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount&&u[0].stockLogList1.length>0&&i.carList.get(c).stockLogList.delete('{"颜色":"均色","尺码":"均码"}'),i.carList.get(c).price1=(Number(i.carList.get(c).productCount)*Number(i.carList.get(c).purchasePrice)).toFixed(2)}else{var h=!1;i.carList.forEach((function(t,e){if(t.productSn==u[0].productSn)throw h=!0,r.tui.toast("该货号被页面其他商品占用,请重新输入!"),r.carList.get(c).productSn="",setTimeout((function(t){r.$forceUpdate()}),1e3),Error("被占用")})),i.$nextTick((function(){""==i.carList.get(c).productName&&(i.carList.get(c).productName=u[0].productName),0==h&&""==i.carList.get(c).productSn&&(i.carList.get(c).productSn=u[0].productSn),0==h&&(u[0].productId?(i.carList.get(c).id=u[0].productId,i.carList.get(c).isNew=!1,c=u[0].productId):""==u[0].productSn||null==u[0].productSn?(i.carList.get(c).id=u[0].productName,c=u[0].productName):"货号"==u[0].productSn?(i.carList.get(c).productSn=u[0].productName,i.carList.get(c).id=u[0].productName,c=u[0].productName):u[0].productSn&&(i.carList.get(c).id=u[0].productSn,c=u[0].productSn))})),""!=i.carList.get(c).purchasePrice&&null!=i.carList.get(c).purchasePrice||(i.carList.get(c).purchasePrice=u[0].purchasePrice),""==i.carList.get(c).productPicture&&(i.carList.get(c).productPicture=u[0].productPicture),u[0].productId&&(i.carList.get(c).attrId=u[0].attrId,i.carList.get(c).lsPrice=u[0].lsPrice),i.carList.get(c).wholesalePrice=u[0].wholesalePrice;var g=new Map;i.$nextTick((function(){i.carList.forEach((function(t,e){e!=t.id?g.set(t.id,t):g.set(e,t)})),i.carList=g})),i.$nextTick((function(){for(var t=0;t<u.length;t++)for(var e=0;e<u[t].stockLogList1.length;e++)u[t].stockLogList1[e].name=i.sliceMsg(u[t].stockLogList1[e].attributeList),0==i.carList.get(c).stockLogList.size?i.carList.get(c).stockLogList.set(u[t].stockLogList1[e].attributeList,u[t].stockLogList1[e]):1==i.carList.get(c).stockLogList.has(u[t].stockLogList1[e].attributeList)?i.carList.get(c).stockLogList.get(u[t].stockLogList1[e].attributeList).productCount+=Number(u[t].stockLogList1[e].productCount):i.carList.get(c).stockLogList.set(u[t].stockLogList1[e].attributeList,u[t].stockLogList1[e]),i.carList.get(c).productCount+=Number(u[t].stockLogList1[e].productCount);i.carList.get(c).price1=(Number(i.carList.get(c).productCount)*Number(i.carList.get(c).purchasePrice)).toFixed(2),0==i.carList.get(c).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount&&u[0].stockLogList1.length>0&&i.carList.get(c).stockLogList.delete('{"颜色":"均色","尺码":"均码"}')}))}i.$nextTick((function(){i.getAllPrice(),i.oneGoodsId=""}))}else i.tui.toast("抱歉:小助手本次未识别到商品信息,请检查识别信息是否正确")}else{s.purchasePrice&&(s.purchasePrice=i.replaceCharAfterNumber(s.purchasePrice,"块","."),-1!=s.purchasePrice.indexOf("元")&&(s.purchasePrice=s.purchasePrice.replace(/元/g,"")),s.purchasePrice=s.purchasePrice.replace(/[^0-9.]/g,"")),s.wholesalePrice&&(s.wholesalePrice=i.replaceCharAfterNumber(s.wholesalePrice,"块","."),-1!=s.wholesalePrice.indexOf("元")&&(s.wholesalePrice=s.wholesalePrice.replace(/元/g,"")),s.wholesalePrice=s.wholesalePrice.replace(/[^0-9.]/g,""));for(var L=0;L<u.length;L++){var p={id:"",price:u[L].price,productCount:0,attrId:u[L].attrId,categoryId:""==u[L].categoryId?i.categoryList.categoryId:u[L].categoryId,categoryName:""==u[L].categoryName?i.categoryList.categoryName:u[L].categoryName,wholesalePrice:s.wholesalePrice?s.wholesalePrice:u[L].wholesalePrice,purchasePrice:u[L].purchasePrice,isNew:null==u[L].productId,productId:u[L].productId,productName:u[L].productName,productSn:u[L].productSn,productPicture:u[L].productPicture,supplierName:u[L].supplierName,productPictures:[],saleDetailQueryDTO:[]};u[L].productId?p.id=u[L].productId:""==u[L].productSn||null==u[L].productSn?p.id=u[L].productName||u[L].id:"货号"==u[L].productSn?(p.productSn=u[L].productName,p.id=u[L].productName||u[L].id):u[L].productSn&&(p.id=u[L].productSn||u[L].id);for(var m=0;m<u[L].stockLogList1.length;m++){var f={attributeList:i.getAttribute(u[L].stockLogList1[m].attributeList),productCount:Number(u[L].stockLogList1[m].productCount)||Number(u[L].stockLogList1[m].productCounts),productNum:"",name:i.sliceMsg(i.getAttribute(u[L].stockLogList1[m].attributeList)),price:u[L].stockLogList1[m].purchasePrice};p.productCount+=Number(u[L].stockLogList1[m].productCount),p.saleDetailQueryDTO.push(f)}i.carList1.push(p)}t==a.length-1&&i.$nextTick((function(){setTimeout((function(t){i.AiVoice()}),300)}))}}}))}),200*(t+1))},h=0;h<a.length;h++)l(h);i.$refs.popup.close(),e.next=66;break;case 57:return e.prev=57,e.t0=e["catch"](49),-1!=i.getMsg.indexOf("色,")&&(i.getMsg=i.getMsg.replace(/色,/g,"色")),-1!=i.getMsg.indexOf("色")&&(i.getMsg=i.getMsg.replace(/色/g,"色、")),-1!=i.getMsg.indexOf("件,")&&(i.getMsg=i.getMsg.replace(/件,/g,"件")),-1!=i.getMsg.indexOf("件")&&(i.getMsg=i.getMsg.replace(/件/g,"件,")),g=""==i.oneGoodsId||i.carList.get(i.oneGoodsId).isNew?{questionMsg:i.getMsg}:{productId:i.carList.get(i.oneGoodsId).productId,questionMsg:i.getMsg},e.next=66,i.tui.request("/purchaseOcrPicture/callWithMessageOfPurchase","POST",g,!1,!0).then((function(e){if(200==e.code){i.voiceText="",i.voiceText1="",i.$refs.popup.close();var s=e.result.data.purchaseDetails;if(i.oneGoodsId){var a=i.oneGoodsId;if(s.length>0){if(""!=i.carList.get(a).productSn){for(var o=0;o<s.length;o++){""!=s[o].purchasePrice&&null!=s[o].purchasePrice||(s[o].purchasePrice=0),""!=s[o].wholesalePrice&&null!=s[o].wholesalePrice||(s[o].wholesalePrice=0),""!=s[o].price&&null!=s[o].price||(s[o].price=0);for(var u=0;u<s[o].stockLogList1.length;u++)""!=s[o].stockLogList1[u].productCount&&null!=s[o].stockLogList1[u].productCount||(s[o].stockLogList1[u].productCount=0),""==i.carList.get(a).productName&&(i.carList.get(a).productName=s[0].productName),""==i.carList.get(a).attrId&&(i.carList.get(a).attrId=s[0].attrId),""!=i.carList.get(a).purchasePrice&&null!=i.carList.get(a).purchasePrice||(i.carList.get(a).purchasePrice=s[0].purchasePrice),""!=i.carList.get(a).wholesalePrice&&null!=i.carList.get(a).wholesalePrice||(i.carList.get(a).wholesalePrice=s[0].wholesalePrice),""==i.carList.get(a).productPicture&&(i.carList.get(a).productPicture=s[0].productPicture),s[o].stockLogList1[u].name=i.sliceMsg(s[o].stockLogList1[u].attributeList),i.carList.get(a).stockLogList.get(s[o].stockLogList1[u].attributeList).productNum=s[o].stockLogList1[u].stockCount,0==i.carList.get(a).stockLogList.size?i.carList.get(a).stockLogList.set(s[o].stockLogList1[u].attributeList,s[o].stockLogList1[u]):1==i.carList.get(a).stockLogList.has(s[o].stockLogList1[u].attributeList)?i.carList.get(a).stockLogList.get(s[o].stockLogList1[u].attributeList).productCount+=Number(s[o].stockLogList1[u].productCount):i.carList.get(a).stockLogList.set(s[o].stockLogList1[u].attributeList,s[o].stockLogList1[u]),i.carList.get(a).productCount+=Number(s[o].stockLogList1[u].productCount)}0==i.carList.get(a).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount&&s[0].stockLogList1.length>0&&i.carList.get(a).stockLogList.delete('{"颜色":"均色","尺码":"均码"}'),i.carList.get(a).price1=(Number(i.carList.get(a).productCount)*Number(i.carList.get(a).purchasePrice)).toFixed(2)}else{var c=!1;i.carList.forEach((function(t,e){if(t.productSn==s[0].productSn)throw c=!0,r.tui.toast("该货号被页面其他商品占用,请重新输入!"),r.carList.get(a).productSn="",setTimeout((function(t){r.$forceUpdate()}),2e3),Error("被占用")})),i.$nextTick((function(){""==i.carList.get(a).productName&&(i.carList.get(a).productName=s[0].productName),i.carList.get(a).customerCategoryList=i.checkPriceRule(JSON.parse(s[0].customerCategoryRule)),0==c&&""==i.carList.get(a).productSn&&(i.carList.get(a).productSn=s[0].productSn),0==c&&(s[0].productId?(i.carList.get(a).id=s[0].productId,i.carList.get(a).isNew=!1,a=s[0].productId):""==s[0].productSn||null==s[0].productSn?(i.carList.get(a).id=s[0].productName,a=s[0].productName):"货号"==s[0].productSn?(i.carList.get(a).productSn=s[0].productName,i.carList.get(a).id=s[0].productName,a=s[0].productName):s[0].productSn&&(i.carList.get(a).id=s[0].productSn,a=s[0].productSn)),i.$forceUpdate()})),""!=i.carList.get(a).purchasePrice&&null!=i.carList.get(a).purchasePrice||(i.carList.get(a).purchasePrice=s[0].purchasePrice),""==i.carList.get(a).productPicture&&(i.carList.get(a).productPicture=s[0].productPicture),s[0].productId&&(i.carList.get(a).attrId=s[0].attrId,i.carList.get(a).wholesalePrice=s[0].wholesalePrice,i.carList.get(a).lsPrice=s[0].lsPrice);var n=new Map;i.$nextTick((function(){i.carList.forEach((function(t,e){e!=t.id?n.set(t.id,t):n.set(e,t)})),i.carList=n})),i.$nextTick((function(){for(var t=0;t<s.length;t++)for(var e=0;e<s[t].stockLogList1.length;e++)s[t].stockLogList1[e].name=i.sliceMsg(s[t].stockLogList1[e].attributeList),0==i.carList.get(a).stockLogList.size?(s[t].stockLogList1[e].productNum=s[t].stockLogList1[e].stockCount,i.carList.get(a).stockLogList.set(s[t].stockLogList1[e].attributeList,s[t].stockLogList1[e])):1==i.carList.get(a).stockLogList.has(s[t].stockLogList1[e].attributeList)?(i.carList.get(a).stockLogList.get(s[t].stockLogList1[e].attributeList).productCount+=Number(s[t].stockLogList1[e].productCount),i.carList.get(a).stockLogList.get(s[t].stockLogList1[e].attributeList).productNum=s[t].stockLogList1[e].stockCount):(i.carList.get(a).stockLogList.set(s[t].stockLogList1[e].attributeList,s[t].stockLogList1[e]),i.carList.get(a).stockLogList.get(s[t].stockLogList1[e].attributeList).productNum=i.carList.get(a).stockLogList.get(s[t].stockLogList1[e].attributeList).stockCount),i.carList.get(a).productCount+=Number(s[t].stockLogList1[e].productCount);i.carList.get(a).price1=(Number(i.carList.get(a).productCount)*Number(i.carList.get(a).purchasePrice)).toFixed(2),0==i.carList.get(a).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount&&s[0].stockLogList1.length>0&&i.carList.get(a).stockLogList.delete('{"颜色":"均色","尺码":"均码"}')}))}i.$nextTick((function(){i.getAllPrice(),i.oneGoodsId=""}))}else i.tui.toast("抱歉:小助手本次未识别到商品信息,请检查识别信息是否正确")}else{for(var d=0;d<s.length;d++){var l={id:"",price:s[d].price,productCount:0,attrId:s[d].attrId,customerCategoryList:null==s[d].customerCategoryRule?i.getNewProductRule():i.checkPriceRule(JSON.parse(s[d].customerCategoryRule)),categoryId:""==s[d].categoryId?i.categoryList.categoryId:s[d].categoryId,categoryName:""==s[d].categoryName?i.categoryList.categoryName:s[d].categoryName,wholesalePrice:s[d].wholesalePrice,purchasePrice:s[d].purchasePrice,isNew:null==s[d].productId,productId:s[d].productId,productName:s[d].productName,productSn:s[d].productSn,productPicture:s[d].productPicture,supplierName:s[d].supplierName,productPictures:[],saleDetailQueryDTO:[]};s[d].productId?l.id=s[d].productId:""==s[d].productSn||null==s[d].productSn?l.id=s[d].productName:"货号"==s[d].productSn?(l.productSn=s[d].productName,l.id=s[d].productName):s[d].productSn&&(l.id=s[d].productSn);for(var h=0;h<s[d].stockLogList1.length;h++){var g={attributeList:i.getAttribute(s[d].stockLogList1[h].attributeList),productCount:Number(s[d].stockLogList1[h].productCount)||Number(s[d].stockLogList1[h].productCounts),productNum:"",name:i.sliceMsg(i.getAttribute(s[d].stockLogList1[h].attributeList)),price:s[d].stockLogList1[h].purchasePrice};l.productCount+=Number(s[d].stockLogList1[h].productCount),l.saleDetailQueryDTO.push(g)}i.carList1.push(l)}i.$nextTick((function(){setTimeout((function(t){i.AiVoice()}),300)}))}}else t.showModal({title:"提示",content:"抱歉:小助手对"+i.getMsg+"的部分商品未识别,请检查识别信息是否正确",success:function(t){}})})).catch((function(t){i.tui.toast(t)}));case 66:e.next=75;break;case 68:return-1!=i.getMsg.indexOf("色,")&&(i.getMsg=i.getMsg.replace(/色,/g,"色")),-1!=i.getMsg.indexOf("色")&&(i.getMsg=i.getMsg.replace(/色/g,"色、")),-1!=i.getMsg.indexOf("件,")&&(i.getMsg=i.getMsg.replace(/件,/g,"件")),-1!=i.getMsg.indexOf("件")&&(i.getMsg=i.getMsg.replace(/件/g,"件,")),L=""==i.oneGoodsId||i.carList.get(i.oneGoodsId).isNew?{questionMsg:i.getMsg}:{productId:i.carList.get(i.oneGoodsId).productId,questionMsg:i.getMsg},e.next=75,i.tui.request("/purchaseOcrPicture/callWithMessageOfPurchase","POST",L,!1,!0).then((function(e){if(200==e.code){i.voiceText="",i.voiceText1="",i.$refs.popup.close();var s=e.result.data.purchaseDetails;if(i.oneGoodsId){var a=i.oneGoodsId;if(s.length>0)if(""!=i.carList.get(a).productSn){for(var o=0;o<s.length;o++){""!=s[o].purchasePrice&&null!=s[o].purchasePrice||(s[o].purchasePrice=0),""!=s[o].wholesalePrice&&null!=s[o].wholesalePrice||(s[o].wholesalePrice=0),""!=s[o].price&&null!=s[o].price||(s[o].price=0);for(var u=0;u<s[o].stockLogList1.length;u++)""!=s[o].stockLogList1[u].productCount&&null!=s[o].stockLogList1[u].productCount||(s[o].stockLogList1[u].productCount=0),""==i.carList.get(a).productName&&(i.carList.get(a).productName=s[0].productName),""==i.carList.get(a).attrId&&(i.carList.get(a).attrId=s[0].attrId),""!=i.carList.get(a).purchasePrice&&null!=i.carList.get(a).purchasePrice||(i.carList.get(a).purchasePrice=s[0].purchasePrice),""!=i.carList.get(a).wholesalePrice&&null!=i.carList.get(a).wholesalePrice||(i.carList.get(a).wholesalePrice=s[0].wholesalePrice),""==i.carList.get(a).productPicture&&(i.carList.get(a).productPicture=s[0].productPicture),s[o].stockLogList1[u].name=i.sliceMsg(s[o].stockLogList1[u].attributeList),s[o].stockLogList1[u].productNum=s[o].stockLogList1[u].stockCount,0==i.carList.get(a).stockLogList.size?i.carList.get(a).stockLogList.set(s[o].stockLogList1[u].attributeList,s[o].stockLogList1[u]):1==i.carList.get(a).stockLogList.has(s[o].stockLogList1[u].attributeList)?i.carList.get(a).stockLogList.get(s[o].stockLogList1[u].attributeList).productCount+=Number(s[o].stockLogList1[u].productCount):i.carList.get(a).stockLogList.set(s[o].stockLogList1[u].attributeList,s[o].stockLogList1[u]),i.carList.get(a).productCount+=Number(s[o].stockLogList1[u].productCount)}i.$nextTick((function(){i.carList.get(a).price1=(Number(i.carList.get(a).productCount)*Number(i.carList.get(a).purchasePrice)).toFixed(2),i.getAllPrice(),i.oneGoodsId=""})),0==i.carList.get(a).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount&&s[0].stockLogList1.length>0&&i.carList.get(a).stockLogList.delete('{"颜色":"均色","尺码":"均码"}')}else{var c=!1;i.carList.forEach((function(t,e){if(t.productSn==s[0].productSn)throw c=!0,r.tui.toast("该货号被页面其他商品占用,请重新输入!"),r.carList.get(a).productSn="",setTimeout((function(t){r.$forceUpdate()}),2e3),Error("被占用")})),i.$nextTick((function(){""==i.carList.get(a).productName&&(i.carList.get(a).productName=s[0].productName),0==c&&""==i.carList.get(a).productSn&&(i.carList.get(a).productSn=s[0].productSn),0==c&&(s[0].productId?(i.carList.get(a).id=s[0].productId,i.carList.get(a).isNew=!1,a=s[0].productId):""==s[0].productSn||null==s[0].productSn?(i.carList.get(a).id=s[0].productName,a=s[0].productName):"货号"==s[0].productSn?(i.carList.get(a).productSn=s[0].productName,i.carList.get(a).id=s[0].productName,a=s[0].productName):s[0].productSn&&(i.carList.get(a).id=s[0].productSn,a=s[0].productSn)),i.$forceUpdate()})),""!=i.carList.get(a).purchasePrice&&null!=i.carList.get(a).purchasePrice||(i.carList.get(a).purchasePrice=s[0].purchasePrice),i.carList.get(a).customerCategoryList=i.checkPriceRule(JSON.parse(s[0].customerCategoryRule)),""!=i.carList.get(a).wholesalePrice&&null!=i.carList.get(a).wholesalePrice||(i.carList.get(a).wholesalePrice=s[0].wholesalePrice),""!=i.carList.get(a).lsprice&&null!=i.carList.get(a).lsprice||(i.carList.get(a).lsprice=s[0].price),""==i.carList.get(a).productPicture&&(i.carList.get(a).productPicture=s[0].productPicture),s[0].productId&&(i.carList.get(a).productId=s[0].productId,i.carList.get(a).attrId=s[0].attrId,i.carList.get(a).wholesalePrice=s[0].wholesalePrice,i.carList.get(a).lsPrice=s[0].lsPrice);var n=new Map;i.$nextTick((function(){i.carList.forEach((function(t,e){e!=t.id?n.set(t.id,t):n.set(e,t)})),i.carList=n})),i.$nextTick((function(){for(var t=0;t<s.length;t++)for(var e=0;e<s[t].stockLogList1.length;e++)s[t].stockLogList1[e].name=i.sliceMsg(s[t].stockLogList1[e].attributeList),0==i.carList.get(a).stockLogList.size?i.carList.get(a).stockLogList.set(s[t].stockLogList1[e].attributeList,s[t].stockLogList1[e]):1==i.carList.get(a).stockLogList.has(s[t].stockLogList1[e].attributeList)?(i.carList.get(a).stockLogList.get(s[t].stockLogList1[e].attributeList).productCount+=Number(s[t].stockLogList1[e].productCount),i.carList.get(a).stockLogList.get(s[t].stockLogList1[e].attributeList).productNum=s[t].stockLogList1[e].stockCount):(i.carList.get(a).stockLogList.set(s[t].stockLogList1[e].attributeList,s[t].stockLogList1[e]),i.carList.get(a).stockLogList.get(s[t].stockLogList1[e].attributeList).productNum=i.carList.get(a).stockLogList.get(s[t].stockLogList1[e].attributeList).stockCount),i.carList.get(a).productCount+=Number(s[t].stockLogList1[e].productCount);i.carList.get(a).price1=(Number(i.carList.get(a).productCount)*Number(i.carList.get(a).purchasePrice)).toFixed(2),0==i.carList.get(a).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount&&s[0].stockLogList1.length>0&&i.carList.get(a).stockLogList.delete('{"颜色":"均色","尺码":"均码"}')})),i.$nextTick((function(){i.getAllPrice(),i.oneGoodsId=""}))}else i.tui.toast("抱歉:小助手本次未识别到商品信息,请检查识别信息是否正确")}else{for(var d=0;d<s.length;d++){var l={id:"",price:s[d].price,productCount:0,attrId:s[d].attrId,customerCategoryList:null==s[d].customerCategoryRule?i.getNewProductRule():i.checkPriceRule(JSON.parse(s[d].customerCategoryRule)),categoryId:""==s[d].categoryId?i.categoryList.categoryId:s[d].categoryId,categoryName:""==s[d].categoryName?i.categoryList.categoryName:s[d].categoryName,wholesalePrice:s[d].wholesalePrice,purchasePrice:s[d].purchasePrice,isNew:null==s[d].productId,productId:s[d].productId,productName:s[d].productName,productSn:s[d].productSn,productPicture:s[d].productPicture,supplierName:s[d].supplierName,productPictures:[],saleDetailQueryDTO:[]};s[d].productId?l.id=s[d].productId:""==s[d].productSn||null==s[d].productSn?l.id=s[d].productName:"货号"==s[d].productSn?(l.productSn=s[d].productName,l.id=s[d].productName):s[d].productSn&&(l.id=s[d].productSn);for(var h=0;h<s[d].stockLogList1.length;h++){var g={attributeList:i.getAttribute(s[d].stockLogList1[h].attributeList),productCount:Number(s[d].stockLogList1[h].productCount)||Number(s[d].stockLogList1[h].productCounts),productNum:s[d].stockLogList1[h].stockCount,name:i.sliceMsg(i.getAttribute(s[d].stockLogList1[h].attributeList)),price:s[d].stockLogList1[h].purchasePrice};l.productCount+=Number(s[d].stockLogList1[h].productCount),l.saleDetailQueryDTO.push(g)}i.carList1.push(l)}i.$nextTick((function(){setTimeout((function(t){i.AiVoice()}),300)}))}}else t.showModal({title:"提示",content:"抱歉:小助手对"+i.getMsg+"的部分商品未识别,请检查识别信息是否正确",success:function(t){}})})).catch((function(t){i.tui.toast(t)}));case 75:case"end":return e.stop()}}),e,null,[[49,57]])})))()},getAttribute:function(t){return t=t.replace(/"色"(?![^{]*": *"色")/g,'"均色"'),t=t.replace(/"码"(?![^{]*": *"码")/g,'"均码"'),t},trimWhitespace:function(t){return t.replace(/\s+/g,"")},openPrompt:function(){this.$refs.promptPopup.open()},addGategory:function(e){var i=this;this.tui.request("/app/productCategory/batchSaveCategoryAndAttribute","post",{categoryName:this.categoryText,productAttributeOfAddVos:[{attributeName:"颜色",productAttributeValueVoList:[{isChecked:!0,value:"均色"}]},{attributeName:"尺码",productAttributeValueVoList:[{isChecked:!0,value:"均码"}]}]},!1,!1).then((function(e){200==e.code?(i.getGategoryList(),t.showToast({title:"添加成功",icon:"none"})):t.showToast({title:"添加失败",icon:"none"}),i.$refs.addGateDialog.close()})).catch((function(t){}))},delDefaultCate:function(e,i){console.log(i);for(var r="",s="",a="",o=0;o<this.shopttributeOfList.length;o++)for(var u=0;u<this.shopttributeOfList[o].productAttributeValueVoList.length;u++)this.shopttributeOfList[o].productAttributeValueVoList[u].value==i&&(r=this.shopttributeOfList[o].productAttributeValueVoList[u].attributeId,s=this.shopttributeOfList[o].productAttributeValueVoList[u].value,a=this.shopttributeOfList[o].productAttributeValueVoList[u].id);if("chima"==e){for(var c=0;c<this.goodsDetail.attributeList.newChiMaList.length;c++)this.goodsDetail.attributeList.newChiMaList[c]==i&&this.goodsDetail.attributeList.newChiMaList.splice(c,1);for(var n=0;n<this.goodsDetail.attributeList.newYanSeList.length;n++)for(var d=0;d<this.goodsDetail.attributeList.newYanSeList[n].value.length;d++)-1!=this.goodsDetail.attributeList.newYanSeList[n].value[d].name.indexOf(i)&&this.goodsDetail.attributeList.newYanSeList[n].value.splice(d,1)}if("yanse"==e)for(var l=0;l<this.goodsDetail.attributeList.newYanSeList.length;l++)this.goodsDetail.attributeList.newYanSeList[l].name==i&&this.goodsDetail.attributeList.newYanSeList.splice(l,1);""!=a&&this.tui.request("/app/productAttributeValue/delById","post",{attributeId:r,value:s,id:a},!1,!0).then((function(e){200==e.code?t.showToast({title:"删除成功",icon:"none"}):t.showToast({title:"删除失败",icon:"none"})})).catch((function(t){})),t.hideLoading()},scanCodeAdd:function(){var e=this,i=this;t.setStorageSync("saoma","1"),t.scanCode({success:function(r){if("QR_CODE"==r.scanType){r.result.split(",").length>2&&(i.attrBuilt=decodeURIComponent(r.result.split(",")[2].split("-")[0])+"-"+decodeURIComponent(r.result.split(",")[2].split("-")[1]));var s=d.default.decode(r.result.split(",")[1]);s==t.getStorageSync("shopId").substring("10","12")?(i.productId=d.default.decode(r.result.split(",")[0]),i.toggle("bottom",d.default.decode(r.result.split(",")[0])),null!=i.attrBuilt&&""!=i.attrBuilt&&"-"!=i.attrBuilt&&setTimeout((function(t){i.scanCodeAdd()}),1100)):setTimeout((function(t){i.tui.toast("您的店铺中暂无该商品!")}),1e3)}else i.tui.request("/app/product/getByBarcode","POST",{customerId:e.khName.id,barcode:r.result},!1,!0).then((function(t){if(200==t.code){if(""==t.result)i.tui.toast("您的店铺中暂无该商品!");else if(i.productId=t.result[0].id,i.toggle("bottom",t.result[0].id),item.saleDetailDTOList)for(var e=0;e<item.saleDetailDTOList.length;e++)i.carList.push(item.saleDetailDTOList[e])}else i.tui.toast(r.message)})).catch((function(t){i.tui.toast(t)}));t.vibrateLong({success:function(){console.log("震动成功")},fail:function(){console.log("震动失败")}})},fail:function(e){t.showToast({title:"扫描失败",icon:"none"})}})},clickCollapse1:function(t,e){this.carList.get(e).price1=(Number(this.carList.get(e).productCount)*Number(this.carList.get(e).purchasePrice)).toFixed(2),this.getAllPrice()},clickCollapse2:function(){this.goodsDetail.price1=(Number(this.goodsDetail.productCount)*Number(this.goodsDetail.purchasePrice)).toFixed(2)},clickCollapse:function(t,e){this.linshiPrice==t.target.value?this.carList.get(e).purchasePrice=t.target.value:""==t.detail.value?this.carList.get(e).purchasePrice=this.linshiPrice:this.carList.get(e).purchasePrice=Number(t.detail.value),this.carList.get(e).price1=(Number(this.carList.get(e).productCount)*Number(this.carList.get(e).purchasePrice)).toFixed(2),this.getAllPrice()},voiceGetOne:function(){this.voiceGetOneData=!this.voiceGetOneData},AiVoice:function(){var e=this;if(0==this.carList.size){for(var i=0;i<this.carList1.length;i++){for(var r={purchasePrice:0==this.userType?this.carList1[i].purchasePrice:"",price1:0,price:this.carList1[i].price,productCount:0,customerCategoryList:null!=this.carList1[i].customerCategoryList?this.carList1[i].customerCategoryList:this.getNewProductRule(),id:null!=this.carList1[i].productId?this.carList1[i].productId:this.carList1[i].id,isNew:this.carList1[i].isNew,productId:null==this.carList1[i].productId?"":this.carList1[i].productId,productName:this.carList1[i].productName,wholesalePrice:this.carList1[i].wholesalePrice||0,categoryName:this.carList1[i].categoryName,categoryId:this.carList1[i].categoryId,attrId:this.carList1[i].attrId,lsprice:this.carList1[i].price||0,productPicture:this.carList1[i].productPicture,productSn:this.carList1[i].productSn,stockLogList:new Map,productPictures:[],stockLogList1:[]},s=0;s<this.carList1[i].saleDetailQueryDTO.length;s++){var a=Number(this.carList1[i].saleDetailQueryDTO[s].productCount);1==r.stockLogList.has(this.carList1[i].saleDetailQueryDTO[s].attributeList)&&(a+=Number(r.stockLogList.get(this.carList1[i].saleDetailQueryDTO[s].attributeList).productCount));var o={productCount:a,name:this.carList1[i].saleDetailQueryDTO[s].name,productNum:this.carList1[i].saleDetailQueryDTO[s].productNum};r.stockLogList.set(this.carList1[i].saleDetailQueryDTO[s].attributeList,o),r.productCount+=null==this.carList1[i].saleDetailQueryDTO[s].productCount?0:Number(this.carList1[i].saleDetailQueryDTO[s].productCount),r.price1=(Number(r.productCount)*Number(this.carList1[i].purchasePrice)).toFixed(2)}var u=1==this.carList1[i].isNew?this.carList1[i].id:this.carList1[i].productId;this.carList.set(u,r)}this.carList1=[]}else for(var c=0;c<this.carList1.length;c++){var n=1==this.carList1[c].isNew?this.carList1[c].id:this.carList1[c].productId;if(1==this.carList.has(this.carList1[c].id)){""==this.carList.get(this.carList1[c].id).purchasePrice&&(this.carList.get(this.carList1[c].id).purchasePrice=this.carList1[c].purchasePrice);for(var d=0;d<this.carList1[c].saleDetailQueryDTO.length;d++){if(1==this.carList.get(this.carList1[c].id).stockLogList.has(this.carList1[c].saleDetailQueryDTO[d].attributeList)){o={productCount:Number(this.carList.get(this.carList1[c].id).stockLogList.get(this.carList1[c].saleDetailQueryDTO[d].attributeList).productCount)+Number(this.carList1[c].saleDetailQueryDTO[d].productCount),name:this.carList1[c].saleDetailQueryDTO[d].name,productNum:this.carList1[c].saleDetailQueryDTO[d].productNum};this.carList.get(this.carList1[c].id).stockLogList.set(this.carList1[c].saleDetailQueryDTO[d].attributeList,o)}else{o={productCount:Number(this.carList1[c].saleDetailQueryDTO[d].productCount),name:this.carList1[c].saleDetailQueryDTO[d].name,productNum:this.carList1[c].saleDetailQueryDTO[d].productNum};this.carList.get(this.carList1[c].id).stockLogList.set(this.carList1[c].saleDetailQueryDTO[d].attributeList,o)}this.carList.get(this.carList1[c].id).productCount+=null==this.carList1[c].saleDetailQueryDTO[d].productCount?0:Number(this.carList1[c].saleDetailQueryDTO[d].productCount),this.carList.get(this.carList1[c].id).price1=(Number(this.carList.get(this.carList1[c].id).productCount)*Number(this.carList.get(this.carList1[c].id).purchasePrice)).toFixed(2)}}else{for(var l={purchasePrice:0==this.userType?this.carList1[c].purchasePrice:"",price1:0,price:this.carList1[c].price,productCount:0,customerCategoryList:null!=this.carList1[c].customerCategoryList?this.carList1[c].customerCategoryList:this.getNewProductRule(),id:null!=this.carList1[c].productId?this.carList1[c].productId:this.carList1[c].id,productId:null==this.carList1[c].productId?"":this.carList1[c].productId,isNew:this.carList1[c].isNew,productName:this.carList1[c].productName,wholesalePrice:this.carList1[c].wholesalePrice||0,categoryName:this.carList1[c].categoryName,categoryId:this.carList1[c].categoryId,attrId:this.carList1[c].attrId,lsprice:this.carList1[c].price||0,productPicture:this.carList1[c].productPicture,productSn:this.carList1[c].productSn,stockLogList:new Map,stockLogList1:[],productPictures:[],name:""},h=0;h<this.carList1[c].saleDetailQueryDTO.length;h++){o={productCount:Number(this.carList1[c].saleDetailQueryDTO[h].productCount),name:this.carList1[c].saleDetailQueryDTO[h].name,productNum:this.carList1[c].saleDetailQueryDTO[h].productNum};l.stockLogList.set(this.carList1[c].saleDetailQueryDTO[h].attributeList,o),l.name=this.carList1[c].saleDetailQueryDTO[h].name,l.productCount+=null==this.carList1[c].saleDetailQueryDTO[h].productCount?0:Number(this.carList1[c].saleDetailQueryDTO[h].productCount),l.price1=(Number(l.productCount)*Number(this.carList1[c].purchasePrice)).toFixed(2)}this.carList.set(n,l)}}this.$nextTick((function(){e.carList1=[],t.removeStorageSync("carList1"),e.getAllPrice(),""!=e.carList1?setTimeout((function(e){t.hideLoading()}),2e3):setTimeout((function(e){t.hideLoading()}),300),e.$forceUpdate()}))},getOneData:function(e,i,r){var a=this;return(0,o.default)(s.default.mark((function r(){return s.default.wrap((function(r){while(1)switch(r.prev=r.next){case 0:return r.next=2,setTimeout((function(r){a.tui.request("/app/product/getShareList","post",{categoryId:"",pageNum:1,pageSize:"1000",searchStr:e.productSn},!1,!1).then((function(r){if(200==r.code){if(""!=r.result.records)if(r.result.records.length>1){for(var s=0;s<r.result.records.length;s++)e.wholesalePrice&&(r.result.records[s].wholesalePrice=e.wholesalePrice,r.result.records[s].unitPrice=e.wholesalePrice,r.result.records[s].discountAmount=e.wholesalePrice),r.result.records[s].productCount=Number(e.productCount),e.purchasePrice&&(r.result.records[s].purchasePrice=e.purchasePrice);a.$nextTick((function(){a.moreData.push(r.result.records),a.oneData=e}))}else{a.voiceText="",a.voiceText1="",a.$refs.popup.close();var o={attributeList:'{"颜色":"均色","尺码":"均码"}',productCount:Number(e.productCount)||1,stockCount:r.result.records[0].defaultStockCount};r.result.records[0].productId=r.result.records[0].id,r.result.records[0].saleDetailQueryDTO=[],r.result.records[0].saleDetailQueryDTO.push(o);var u=r.result.records;if(a.oneGoodsId){var c=a.oneGoodsId;if(u.length>0){if(""!=a.carList.get(c).productSn){for(var n=0;n<u.length;n++)for(var d=0;d<u[n].saleDetailQueryDTO.length;d++)""==a.carList.get(c).productName&&(a.carList.get(c).productName=u[0].productName),a.carList.get(c).customerCategoryList=null!=u[0].customerCategoryRule?a.checkPriceRule(JSON.parse(u[0].customerCategoryRule)):a.getNewProductRule(),""==a.carList.get(c).attrId&&(a.carList.get(c).attrId=u[0].attrId),""!=a.carList.get(c).purchasePrice&&null!=a.carList.get(c).purchasePrice||(e.purchasePrice?a.carList.get(c).purchasePrice=e.purchasePrice:a.carList.get(c).purchasePrice=u[0].purchasePrice),""==a.carList.get(c).productPicture&&(a.carList.get(c).productPicture=u[0].productPicture),u[n].saleDetailQueryDTO[d].name=a.sliceMsg(u[n].saleDetailQueryDTO[d].attributeList),0==a.carList.get(c).stockLogList.size?a.carList.get(c).stockLogList.set(u[n].saleDetailQueryDTO[d].attributeList,u[n].saleDetailQueryDTO[d]):1==a.carList.get(c).stockLogList.has(u[n].saleDetailQueryDTO[d].attributeList)?a.carList.get(c).stockLogList.get(u[n].saleDetailQueryDTO[d].attributeList).productCount+=Number(u[n].saleDetailQueryDTO[d].productCount):a.carList.get(c).stockLogList.set(u[n].saleDetailQueryDTO[d].attributeList,u[n].saleDetailQueryDTO[d]),a.carList.get(c).productCount+=Number(u[n].saleDetailQueryDTO[d].productCount);0==a.carList.get(c).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount&&u[0].saleDetailQueryDTO.length>0&&a.carList.get(c).stockLogList.delete('{"颜色":"均色","尺码":"均码"}'),a.carList.get(c).price1=(Number(a.carList.get(c).productCount)*Number(a.carList.get(c).purchasePrice)).toFixed(2)}else{var l=!1;a.carList.forEach((function(t,e){if(t.productSn==u[0].productSn)throw l=!0,that.tui.toast("该货号被页面其他商品占用,请重新输入!"),that.carList.get(c).productSn="",setTimeout((function(t){that.$forceUpdate()}),2e3),Error("被占用")})),a.$nextTick((function(){""==a.carList.get(c).productName&&(a.carList.get(c).productName=u[0].productName),0==l&&""==a.carList.get(c).productSn&&(a.carList.get(c).productSn=u[0].productSn),0==l&&(u[0].productId?(a.carList.get(c).id=u[0].productId,a.carList.get(c).productId=u[0].productId,a.carList.get(c).isNew=!1,c=u[0].productId):""==u[0].productSn||null==u[0].productSn?(a.carList.get(c).id=u[0].productName,c=u[0].productName):"货号"==u[0].productSn?(a.carList.get(c).productSn=u[0].productName,a.carList.get(c).id=u[0].productName,c=u[0].productName):u[0].productSn&&(a.carList.get(c).id=u[0].productSn,c=u[0].productSn)),a.$forceUpdate()})),""!=a.carList.get(c).purchasePrice&&null!=a.carList.get(c).purchasePrice||(e.purchasePrice?a.carList.get(c).purchasePrice=e.purchasePrice:a.carList.get(c).purchasePrice=u[0].purchasePrice),""==a.carList.get(c).productPicture&&(a.carList.get(c).productPicture=u[0].productPicture),u[0].productId&&(a.carList.get(c).attrId=u[0].attrId,a.carList.get(c).wholesalePrice=u[0].wholesalePrice,a.carList.get(c).lsPrice=u[0].lsPrice);var h=new Map;a.$nextTick((function(){a.carList.forEach((function(t,e){e!=t.id?h.set(t.id,t):h.set(e,t)})),a.carList=h})),a.$nextTick((function(){for(var t=0;t<u.length;t++)for(var e=0;e<u[t].saleDetailQueryDTO.length;e++)u[t].saleDetailQueryDTO[e].name=a.sliceMsg(u[t].saleDetailQueryDTO[e].attributeList),0==a.carList.get(c).stockLogList.size?a.carList.get(c).stockLogList.set(u[t].saleDetailQueryDTO[e].attributeList,u[t].saleDetailQueryDTO[e]):1==a.carList.get(c).stockLogList.has(u[t].saleDetailQueryDTO[e].attributeList)?a.carList.get(c).stockLogList.get(u[t].saleDetailQueryDTO[e].attributeList).productCount+=Number(u[t].saleDetailQueryDTO[e].productCount):a.carList.get(c).stockLogList.set(u[t].saleDetailQueryDTO[e].attributeList,u[t].saleDetailQueryDTO[e]),a.carList.get(c).productCount+=Number(u[t].saleDetailQueryDTO[e].productCount);a.carList.get(c).price1=(Number(a.carList.get(c).productCount)*Number(a.carList.get(c).purchasePrice)).toFixed(2),a.carList.get(c).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productNum=u[0].defaultStockCount,0==a.carList.get(c).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount&&u[0].saleDetailQueryDTO.length>0&&a.carList.get(c).stockLogList.delete('{"颜色":"均色","尺码":"均码"}')}))}a.$nextTick((function(){a.getAllPrice(),a.oneGoodsId=""}))}else a.tui.toast("抱歉:小助手本次未识别到商品信息,请检查识别信息是否正确")}else{var g={id:"",price:u[0].price,productCount:0,attrId:u[0].attrId,customerCategoryList:null!=u[0].customerCategoryRule?a.checkPriceRule(JSON.parse(u[0].customerCategoryRule)):a.getNewProductRule(),categoryId:""==u[0].categoryId?a.categoryList.categoryId:u[0].categoryId,categoryName:""==u[0].categoryName?a.categoryList.categoryName:u[0].categoryName,wholesalePrice:u[0].wholesalePrice,purchasePrice:e.purchasePrice?e.purchasePrice:u[0].purchasePrice,isNew:null==u[0].productId,productId:u[0].productId,productName:u[0].productName,productSn:u[0].productSn,productPicture:u[0].productPicture,supplierName:u[0].supplierName,productPictures:[],saleDetailQueryDTO:[]};u[0].productId?g.id=u[0].productId:""==u[0].productSn||null==u[0].productSn?g.id=u[0].productName:"货号"==u[0].productSn?(g.productSn=u[0].productName,g.id=u[0].productName):u[0].productSn&&(g.id=u[0].productSn);var L={attributeList:a.getAttribute(u[0].saleDetailQueryDTO[0].attributeList),productCount:Number(u[0].saleDetailQueryDTO[0].productCount)||Number(u[0].saleDetailQueryDTO[0].productCounts),productNum:u[0].saleDetailQueryDTO[0].stockCount,name:a.sliceMsg(a.getAttribute(u[0].saleDetailQueryDTO[0].attributeList)),price:u[0].saleDetailQueryDTO[0].purchasePrice};g.productCount+=Number(u[0].saleDetailQueryDTO[0].productCount),g.saleDetailQueryDTO.push(L),a.carList1.push(g),t.showLoading({title:"加载中..."}),1==i&&a.$nextTick((function(){setTimeout((function(e){a.AiVoice(),t.hideLoading()}),300)}))}}else{a.voiceText="",a.voiceText1="",a.$refs.popup.close(),e.productCount&&(e.productCount=Number(e.productCount));var p={id:e.productSn,productCount:Number(e.productCount)||0,productName:e.productName,productSn:e.productSn,customerCategoryList:a.getNewProductRule(),categoryId:a.categoryList.categoryId,categoryName:a.categoryList.categoryName,purchasePrice:e.purchasePrice||0,wholesalePrice:e.wholesalePrice||0,saleDetailQueryDTO:[{attributeList:'{"颜色":"均色","尺码":"均码"}',productCount:Number(e.productCount)||1,stockCount:null}]},m=[];if(m.push(p),a.oneGoodsId){var f=a.oneGoodsId;if(m.length>0){if(""!=a.carList.get(f).productSn){for(var y=0;y<m.length;y++)for(var P=0;P<m[y].saleDetailQueryDTO.length;P++)""==a.carList.get(f).productName&&(a.carList.get(f).productName=m[0].productName),""==a.carList.get(f).attrId&&(a.carList.get(f).attrId=m[0].attrId),a.carList.get(f).customerCategoryList=m[0].customerCategoryList,""!=a.carList.get(f).purchasePrice&&null!=a.carList.get(f).purchasePrice||(a.carList.get(f).purchasePrice=m[0].purchasePrice),""==a.carList.get(f).productPicture&&(a.carList.get(f).productPicture=m[0].productPicture),m[y].saleDetailQueryDTO[P].name=a.sliceMsg(m[y].saleDetailQueryDTO[P].attributeList),0==a.carList.get(f).stockLogList.size?a.carList.get(f).stockLogList.set(m[y].saleDetailQueryDTO[P].attributeList,m[y].saleDetailQueryDTO[P]):1==a.carList.get(f).stockLogList.has(m[y].saleDetailQueryDTO[P].attributeList)?a.carList.get(f).stockLogList.get(m[y].saleDetailQueryDTO[P].attributeList).productCount+=Number(m[y].saleDetailQueryDTO[P].productCount):a.carList.get(f).stockLogList.set(m[y].saleDetailQueryDTO[P].attributeList,m[y].saleDetailQueryDTO[P]),a.carList.get(f).productCount+=Number(m[y].saleDetailQueryDTO[P].productCount);0==a.carList.get(f).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount&&m[0].saleDetailQueryDTO.length>0&&a.carList.get(f).stockLogList.delete('{"颜色":"均色","尺码":"均码"}'),a.carList.get(f).price1=(Number(a.carList.get(f).productCount)*Number(a.carList.get(f).purchasePrice)).toFixed(2)}else{var b=!1;a.carList.forEach((function(t,e){if(t.productSn==m[0].productSn)throw b=!0,that.tui.toast("该货号被页面其他商品占用,请重新输入!"),that.carList.get(f).productSn="",setTimeout((function(t){that.$forceUpdate()}),2e3),Error("被占用")})),a.$nextTick((function(){""==a.carList.get(f).productName&&(a.carList.get(f).productName=m[0].productName),a.carList.get(f).customerCategoryList=m[0].customerCategoryList,0==b&&""==a.carList.get(f).productSn&&(a.carList.get(f).productSn=m[0].productSn),0==b&&(m[0].productId?(a.carList.get(f).id=m[0].productId,a.carList.get(f).isNew=!1,f=m[0].productId):""==m[0].productSn||null==m[0].productSn?(a.carList.get(f).id=m[0].productName,f=m[0].productName):"货号"==m[0].productSn?(a.carList.get(f).productSn=m[0].productName,a.carList.get(f).id=m[0].productName,f=m[0].productName):m[0].productSn&&(a.carList.get(f).id=m[0].productSn,f=m[0].productSn)),a.$forceUpdate()})),""!=a.carList.get(f).purchasePrice&&null!=a.carList.get(f).purchasePrice||(a.carList.get(f).purchasePrice=m[0].purchasePrice),""==a.carList.get(f).productPicture&&(a.carList.get(f).productPicture=m[0].productPicture),m[0].productId&&(a.carList.get(f).attrId=m[0].attrId,a.carList.get(f).lsPrice=m[0].lsPrice),a.carList.get(f).wholesalePrice=m[0].wholesalePrice;var v=new Map;a.$nextTick((function(){a.carList.forEach((function(t,e){e!=t.id?v.set(t.id,t):v.set(e,t)})),a.carList=v})),a.$nextTick((function(){for(var t=0;t<m.length;t++)for(var e=0;e<m[t].saleDetailQueryDTO.length;e++)m[t].saleDetailQueryDTO[e].name=a.sliceMsg(m[t].saleDetailQueryDTO[e].attributeList),0==a.carList.get(f).stockLogList.size?a.carList.get(f).stockLogList.set(m[t].saleDetailQueryDTO[e].attributeList,m[t].saleDetailQueryDTO[e]):1==a.carList.get(f).stockLogList.has(m[t].saleDetailQueryDTO[e].attributeList)?a.carList.get(f).stockLogList.get(m[t].saleDetailQueryDTO[e].attributeList).productCount+=Number(m[t].saleDetailQueryDTO[e].productCount):a.carList.get(f).stockLogList.set(m[t].saleDetailQueryDTO[e].attributeList,m[t].saleDetailQueryDTO[e]),a.carList.get(f).productCount+=Number(m[t].saleDetailQueryDTO[e].productCount);a.carList.get(f).price1=(Number(a.carList.get(f).productCount)*Number(a.carList.get(f).purchasePrice)).toFixed(2),0==a.carList.get(f).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount&&m[0].saleDetailQueryDTO.length>0&&a.carList.get(f).stockLogList.delete('{"颜色":"均色","尺码":"均码"}')}))}a.$nextTick((function(){a.getAllPrice(),a.oneGoodsId=""}))}else a.tui.toast("抱歉:小助手本次未识别到商品信息,请检查识别信息是否正确")}else{for(var C=0;C<m.length;C++){var N={id:"",price:m[C].price,productCount:0,attrId:m[C].attrId,customerCategoryList:m[C].customerCategoryList,categoryId:""==m[C].categoryId?a.categoryList.categoryId:m[C].categoryId,categoryName:""==m[C].categoryName?a.categoryList.categoryName:m[C].categoryName,wholesalePrice:m[C].wholesalePrice,purchasePrice:m[C].purchasePrice,isNew:null==m[C].productId,productId:m[C].productId,productName:m[C].productName,productSn:m[C].productSn,productPicture:m[C].productPicture,supplierName:m[C].supplierName,productPictures:[],saleDetailQueryDTO:[]};m[C].productId?N.id=m[C].productId:""==m[C].productSn||null==m[C].productSn?N.id=m[C].productName:"货号"==m[C].productSn?(N.productSn=m[C].productName,N.id=m[C].productName):m[C].productSn&&(N.id=m[C].productSn);for(var k=0;k<m[C].saleDetailQueryDTO.length;k++){var D={attributeList:a.getAttribute(m[C].saleDetailQueryDTO[k].attributeList),productCount:Number(m[C].saleDetailQueryDTO[k].productCount)||Number(m[C].saleDetailQueryDTO[k].productCounts),productNum:"",name:a.sliceMsg(a.getAttribute(m[C].saleDetailQueryDTO[k].attributeList)),price:m[C].saleDetailQueryDTO[k].purchasePrice};N.productCount+=Number(m[C].saleDetailQueryDTO[k].productCount),N.saleDetailQueryDTO.push(D)}a.carList1.push(N)}t.showLoading({title:"加载中..."}),1==i&&a.$nextTick((function(){setTimeout((function(e){a.AiVoice(),t.hideLoading()}),500)}))}}setTimeout((function(t){1==i&&a.moreData.length>0&&(a.$refs.popup.close(),a.$refs.oneDataPopup.open(),a.showPopup(0))}),300)}}))}),100);case 2:case"end":return r.stop()}}),r)})))()},showPopup:function(t){this.currentPopupIndex=t,this.showTan=!0},clickGetOne:function(t){var e=this;this.changePriceStatus();var i=this.oneGoodsId;if(this.oneGoodsId){var r=t;if(this.carList.get(i).buyCount=r.buyCount,""!=this.carList.get(i).productSn){for(var s=0;s<r.stockLogList1.length;s++)""==this.carList.get(i).productName&&(this.carList.get(i).productName=r.productName),""==this.carList.get(i).attrId&&(this.carList.get(i).attrId=r.attrId),""!=this.carList.get(i).purchasePrice&&null!=this.carList.get(i).purchasePrice||(t.purchasePrice?this.carList.get(i).purchasePrice=t.purchasePrice:this.carList.get(i).purchasePrice=r.purchasePrice),""==this.carList.get(i).productPicture&&(this.carList.get(i).productPicture=r.productPicture),this.carList.get(i).customerCategoryRule=null!=r.customerCategoryRule&&""!=r.customerCategoryRule?JSON.parse(r.customerCategoryRule):"",r.stockLogList1[s].name=this.sliceMsg(r.stockLogList1[s].attributeList),0==this.carList.get(i).stockLogList.size?this.carList.get(i).stockLogList.set(r.stockLogList1[s].attributeList,r.stockLogList1[s]):1==this.carList.get(i).stockLogList.has(r.stockLogList1[s].attributeList)?this.carList.get(i).stockLogList.get(r.stockLogList1[s].attributeList).productCount+=Number(r.stockLogList1[s].productCount):this.carList.get(i).stockLogList.set(r.stockLogList1[s].attributeList,r.stockLogList1[s]),this.carList.get(i).productCount+=Number(r.stockLogList1[s].productCount);this.carList.get(i).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productNum=r.defaultStockCount,0==this.carList.get(i).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount&&this.carList.get(i).stockLogList.size>1&&r.stockLogList1.length>0&&this.carList.get(i).stockLogList.delete('{"颜色":"均色","尺码":"均码"}'),this.carList.get(i).price1=(Number(this.carList.get(i).productCount)*Number(this.carList.get(i).purchasePrice)).toFixed(2),this.carList.get(i).price=(Number(this.carList.get(i).productCount)*Number(this.carList.get(i).discountAmount)).toFixed(2)}else{var a=!1;this.carList.forEach((function(t,e){if(t.productSn==r.productSn)throw a=!0,that.tui.toast("该货号被页面其他商品占用,请重新输入!"),that.carList.get(i).productSn="",setTimeout((function(t){that.$forceUpdate()}),1e3),Error("被占用")})),this.$nextTick((function(){if(""==e.carList.get(i).productName&&(e.carList.get(i).productName=r.productName),""==e.carList.get(i).attrId&&(e.carList.get(i).attrId=r.attrId),r.productId&&(e.carList.get(i).unitPrice=r.wholesalePrice,e.carList.get(i).discountAmount=r.wholesalePrice,e.carList.get(i).attrId=r.attrId,e.carList.get(i).wholesalePrice=r.wholesalePrice,e.carList.get(i).lsPrice=r.lsPrice),null!=e.khName.categoryId&&""!=e.khName.categoryId)if(null!=r.customerCategoryRule)for(var t=JSON.parse(r.customerCategoryRule),s=0;s<t.length;s++)e.khName.categoryId==t[s].categoryId&&""!=t[s].categoryPrice&&(e.carList.get(i).unitPrice==e.carList.get(i).wholesalePrice&&(e.carList.get(i).discountAmount=t[s].categoryPrice,e.carList.get(i).unitPrice=t[s].categoryPrice),e.carList.get(i).returnPrice==e.carList.get(i).wholesalePrice&&(e.carList.get(i).returnPrice=t[s].categoryPrice));else e.carList.get(i).discountAmount=r.wholesalePrice;else e.carList.get(i).discountAmount=r.wholesalePrice;e.carList.get(i).customerCategoryList=null!=r.customerCategoryRule&&""!=r.customerCategoryRule?JSON.parse(r.customerCategoryRule):"",0==a&&""==e.carList.get(i).productSn&&(e.carList.get(i).productSn=r.productSn),0==a&&(r.id?(e.carList.get(i).id=r.id,e.carList.get(i).productId=r.id,e.carList.get(i).isNew=!1,i=r.id):""==r.productSn||null==r.productSn?(e.carList.get(i).id=r.productName,i=r.productName):"货号"==r.productSn?(e.carList.get(i).productSn=r.productName,e.carList.get(i).id=r.productName,i=r.productName):r.productSn&&(e.carList.get(i).id=r.productSn,i=r.productSn))})),""!=this.carList.get(i).purchasePrice&&null!=this.carList.get(i).purchasePrice||(this.carList.get(i).purchasePrice,this.carList.get(i).purchasePrice=r.purchasePrice),this.carList.get(i).customerCategoryList=null!=r.customerCategoryRule&&""!=r.customerCategoryRule?JSON.parse(r.customerCategoryRule):"",""==this.carList.get(i).productPicture&&(this.carList.get(i).productPicture=r.productPicture);var o=new Map;this.$nextTick((function(){e.carList.forEach((function(t,e){e!=t.id?o.set(t.id,t):o.set(e,t)})),e.carList=o})),this.$nextTick((function(){for(var t=0;t<r.stockLogList1.length;t++)r.stockLogList1[t].name=e.sliceMsg(r.stockLogList1[t].attributeList),0==e.carList.get(i).stockLogList.size?(e.carList.get(i).stockLogList.set(r.stockLogList1[t].attributeList,r.stockLogList1[t]),e.carList.get(i).stockLogList.get(r.stockLogList1[t].attributeList).productNum=r.stockLogList1[t].stockCount):1==e.carList.get(i).stockLogList.has(r.stockLogList1[t].attributeList)?(e.carList.get(i).stockLogList.get(r.stockLogList1[t].attributeList).productNum=r.stockLogList1[t].stockCount,e.carList.get(i).stockLogList.get(r.stockLogList1[t].attributeList).productCount+=Number(r.stockLogList1[t].productCount)):e.carList.get(i).stockLogList.set(r.stockLogList1[t].attributeList,r.stockLogList1[t]),e.carList.get(i).productCount+=Number(r.stockLogList1[t].productCount);e.carList.get(i).price1=(Number(e.carList.get(i).productCount)*Number(e.carList.get(i).purchasePrice)).toFixed(2),e.carList.get(i).price=(Number(e.carList.get(i).productCount)*Number(e.carList.get(i).discountAmount)).toFixed(2),0==e.carList.get(i).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount&&e.carList.get(i).stockLogList.size>1&&r.stockLogList1.length>0&&e.carList.get(i).stockLogList.delete('{"颜色":"均色","尺码":"均码"}')}))}this.$nextTick((function(){e.getAllPrice(),e.moreData=[],e.showTan=!1,e.oneGoodsId=""}))}else if(this.currentPopupIndex+1<this.moreData.length){this.showTan=!1,this.voiceText="",this.voiceText1="";var u={attributeList:'{"颜色":"均色","尺码":"均码"}',productCount:Number(t.productCount)||0,stockCount:t.defaultStockCount};this.$nextTick((function(){t.productId=t.id,t.stockLogList1=[],t.stockLogList1.push(u);var i=t;e.oneGoodsId;i?(e.carList1.push(i),e.$nextTick((function(){e.AiHandleData()}))):e.tui.toast("抱歉:小助手本次未识别到商品信息,请检查识别信息是否正确")})),setTimeout((function(){e.showTan=!0,e.currentPopupIndex+=1}),0)}else{this.showTan=!1,this.voiceText="",this.voiceText1="";var c={attributeList:'{"颜色":"均色","尺码":"均码"}',productCount:Number(t.productCount)||1,stockCount:t.defaultStockCount};this.$nextTick((function(){t.productId=t.id,t.stockLogList1=[],t.stockLogList1.push(c);var i=t;e.oneGoodsId;i?(e.moreData=[],e.carList1.push(i),e.$nextTick((function(){e.AiHandleData()}))):e.tui.toast("抱歉:小助手本次未识别到商品信息,请检查识别信息是否正确")}))}},inputFocus:function(t){this.faBookShow=!0,this.getSreachList(t.target.value)},PriceAndWho:function(t,e,i){"pi"==i?this.linshiPrice==t.target.value?this.carList.get(e).wholesalePrice=t.target.value:""==t.detail.value?this.carList.get(e).wholesalePrice=this.linshiPrice:this.carList.get(e).wholesalePrice=Number(t.detail.value):this.linshiPrice==t.target.value?(this.carList.get(e).price=t.target.value,this.carList.get(e).lsprice=t.target.value):""==t.detail.value?(this.carList.get(e).price=this.linshiPrice,this.carList.get(e).lsprice=this.linshiPrice):(this.carList.get(e).price=Number(t.detail.value),this.carList.get(e).lsprice=Number(t.detail.value)),this.$forceUpdate()},PriceAndWho1:function(t,e,i){"pi"==i?this.carList.get(e).wholesalePrice=Number(t):(this.carList.get(e).price=Number(t),this.carList.get(e).lsprice=Number(t)),this.$forceUpdate()},valChange:function(t){"."==t&&"mapdanjishu"==this.keyboard||("-"!=t||"mapdanjishu"!=this.keyboard&&"danjia"!=this.keyboard&&"pifa"!=this.keyboard&&"lingshou"!=this.keyboard)&&(this.keyboardNum+=t,"goodsNum"==this.keyboard&&(this.goodsNum=this.keyboardNum))},backspace:function(t){this.keyboardNum=t,this.goodsNum=t},sreachName:function(t){this.faBookShow=!0,this.receiverName=t.detail.value,this.getSreachList(t.detail.value)},largeImg:function(t){if(null==t.productPicture&&null==t.productPictures||""==t.productPicture&&null==t.productPictures)this.tui.toast("暂无可展示的图片",300);else{if(this.bigImg=[],null!=t.productPicture){var e={productPicture:t.productPicture};this.bigImg.push(e)}if(null!=t.productPictures)for(var i=0;i<t.productPictures.length;i++)this.bigImg.push(t.productPictures[i]);this.$refs.imgPopup.open()}},checkName:function(t){console.log(t),this.faBookShow=!1,this.checkGoods(t),this.$forceUpdate()},checkGoods:function(t){var e=this,i=this;if(this.goodsDetail=t,console.log(this.carList),this.temporaryList=[],this.pageOldTemList=[],""!=this.carList&&(this.zNum=0,i.carList.forEach((function(e,r){r==t.id&&(i.carList.get(i.goodsDetail.id).stockLogList.forEach((function(t,e){if(i.zNum+=t.productCount,-1!=t.name.indexOf(" | "))t.name=e;else if(-1!=t.name.indexOf("/")){var r=t.name.split("/").filter((function(t){return""!==t})),s="{";s+='"颜色":"'+r[0]+'",',s+='"尺码":"'+r[1]+'"',s+="}",t.name=s,t.attributeList=s}var a={attributeList:t.name,productCount:t.productCount,productNum:t.productNum,name:t.name,price:i.goodsDetail.purchasePrice};i.temporaryList.push(a)})),i.pageOldTemList=i.temporaryList,i.oldTemList=i.temporaryList)}))),1==this.goodsDetail.isNew){if(i.goodsDetail.attributeList=this.defaultList,void 0!=i.carList.get(i.goodsDetail.id)&&i.carList.get(i.goodsDetail.id).stockLogList.size>0)for(var r=function(t){for(var e=function(e){var r="";i.carList.get(i.goodsDetail.id).stockLogList.forEach((function(s,a){a==i.goodsDetail.attributeList.newYanSeList[t].value[e].name&&(r=s.productCount)})),i.goodsDetail.attributeList.newYanSeList[t].value[e].productCount=r},r=0;r<i.goodsDetail.attributeList.newYanSeList[t].value.length;r++)e(r)},s=0;s<i.goodsDetail.attributeList.newYanSeList.length;s++)r(s);for(var a=0;a<this.goodsDetail.attributeList.length;a++){for(var o=!1,u=[],c=0;c<this.goodsDetail.attributeList[a].value.length;c++)1==this.goodsDetail.attributeList[a].value[c].isChecked&&(o=!0,u.push(this.goodsDetail.attributeList[a].value[c].value));if(o){var n={specs:[]};n.specs=u,this.goodsList.push(n)}else{this.goodsList.push({specs:[]})}o=!1,u=[]}this.changeItem="",this.changeItemType="",this.$refs.shopPopup.open("bottom")}else{this.goodsDetail.attributeList={newYanSeList:[],newChiMaList:[]},this.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId","POST",{categoryId:this.goodsDetail.attrId},!1,!0).then((function(t){if(200==t.code){if("string"==typeof t.result.attributeAndValue){var r=JSON.parse(t.result.attributeAndValue);if(1==e.colorSizeNew.has(e.goodsDetail.id)){for(var s=0;s<e.colorSizeNew.get(e.goodsDetail.id).get("颜色").length;s++)-1==r["颜色"].indexOf(e.colorSizeNew.get(e.goodsDetail.id).get("颜色")[s])&&r["颜色"].push(e.colorSizeNew.get(e.goodsDetail.id).get("颜色")[s]);for(var a=0;a<e.colorSizeNew.get(e.goodsDetail.id).get("尺码").length;a++)-1==r["尺码"].indexOf(e.colorSizeNew.get(e.goodsDetail.id).get("尺码")[a])&&r["尺码"].push(e.colorSizeNew.get(e.goodsDetail.id).get("尺码")[a])}r["尺码"].length;for(var o,u=[],c=0;c<r["颜色"].length;c++){for(var n={name:"",value:[]},d=0;d<r["尺码"].length;d++){0==d&&(n.name=r["颜色"][c]);var l="{";l+='"颜色":"'+r["颜色"][c]+'",',l+='"尺码":"'+r["尺码"][d]+'"',l+="}";for(var h={value:r["颜色"][c],name:l,kucun:"",productCount:""},g=0;g<t.result.stock.length;g++)t.result.stock[g].attributeList==l&&(h.kucun=t.result.stock[g].stockCount);n.value.push(h)}u.push(n)}var L=r["尺码"];if(o={newYanSeList:u,newChiMaList:L},e.goodsDetail.attributeList=o,void 0!=i.carList.get(i.goodsDetail.id)&&i.carList.get(i.goodsDetail.id).stockLogList.size>0)for(var p=function(t){for(var e=function(e){var r="";i.carList.get(i.goodsDetail.id).stockLogList.forEach((function(s,a){a==i.goodsDetail.attributeList.newYanSeList[t].value[e].name&&(r=s.productCount)})),i.goodsDetail.attributeList.newYanSeList[t].value[e].productCount=r},r=0;r<i.goodsDetail.attributeList.newYanSeList[t].value.length;r++)e(r)},m=0;m<i.goodsDetail.attributeList.newYanSeList.length;m++)p(m);console.log(e.goodsDetail.attributeList);for(c=0;c<e.goodsDetail.attributeList.length;c++){var f=!1,y=[];for(d=0;d<e.goodsDetail.attributeList[c].value.length;d++)1==e.goodsDetail.attributeList[c].value[d].isChecked&&(f=!0,y.push(e.goodsDetail.attributeList[c].value[d].value));if(f){var P={specs:[]};P.specs=y,e.goodsList.push(P)}else{e.goodsList.push({specs:[]})}f=!1,y=[]}}e.getKCList(t.result.stock)}else e.tui.toast(res.message)})).catch((function(t){}))}},getSreachList:function(t){var e=this;this.sreachList=[],this.tui.request("/app/product/getShareList","POST",{categoryId:"",searchStr:t,pageNum:1,pageSize:"10000",sort:"",order:""},!1,!1).then((function(t){200==t.code?e.sreachList=t.result.records:e.tui.toast(t.message)})).catch((function(t){}))},toggle:function(e,i,r){"bottom"==e?(t.showLoading({title:"加载中..."}),this.allChangeNum=0,this.getById(i)):"typePopup"==e?(this.productId=i,this.getGategoryList(),this.$refs.typePopup.open()):"typePopup1"==e?(this.productId="tanchuang",this.getGategoryList(),this.$refs.typePopup.open()):"addGateDialog"==e?this.$refs.addGateDialog.open("bottom"):"mergePopup"==e?(this.mergeId=i,this.$refs.mergePopup.open()):"center"==e?(this.initRecord(),this.voiceText="",this.voiceText1="",this.$refs.popup.open(e)):"voiceBottom"==e?(this.initRecord(),this.voiceText="",this.voiceText1=""):"oneGoods"==e&&(this.oneGoodsId=i,this.carList.get(i).stockLogList.get(r).isShowBtn=!1,this.initRecord(),this.voiceText="",this.voiceText1="",this.$refs.popup.open("center"))},showBtn:function(t){},getName:function(t,e){this.carList.get(e).productName=t.detail.value},sninput:function(t,e){this.newProductId=t.detail.value,this.carList.get(e).productSn=t.detail.value,this.$forceUpdate()},getSnIsRepeat:function(e,i){var r=this,s=this,a=!1;if(""!=e.detail.value){this.tui.request("/app/product/getByProductSn","post",{productSn:e.detail.value},!1,!0).then((function(o){if(200==o.code){if(""!=o.result)throw a=!0,s.tui.toast("当前货号已被商品:“"+o.result[0].productName+"”占用,请重新输入"),s.carList.get(i).productSn="",s.carList.get(i).id="",setTimeout((function(t){s.$forceUpdate()}),2e3),Error("11");r.carList.forEach((function(r,o){if(r.id!=i&&r.productSn==e.detail.value)throw a=!0,t.showToast({title:"该货号被页面其他商品占用,请重新输入!",icon:"none"}),s.carList.get(i).productSn="",s.carList.get(i).id="",s.$forceUpdate(),Error("11")}))}})),this.$nextTick((function(){0==a&&(console.log(s.carList.get(i)),s.carList.get(i).productId?(r.carList.get(i).id=s.carList.get(i).productId,r.carList.get(i).isNew=!1,i=s.carList.get(i).productId):""==s.carList.get(i).productSn||null==s.carList.get(i).productSn?(r.carList.get(i).id=s.carList.get(i).productName,i=s.carList.get(i).productName):"货号"==s.carList.get(i).productSn?(r.carList.get(i).productSn=s.carList.get(i).productName,r.carList.get(i).id=s.carList.get(i).productName,i=s.carList.get(i).productName):s.carList.get(i).productSn&&(r.carList.get(i).id=s.carList.get(i).productSn,i=s.carList.get(i).productSn),r.$forceUpdate())}));var o=new Map;this.$nextTick((function(){r.carList.forEach((function(t,e){e!=t.id?""==t.id?o.set((0,n.generateUUID)(),t):o.set(t.productId?t.productId:t.id,t):o.set(e,t)})),r.carList=o}))}},getOneId:function(t){this.oneGoodsId=t,this.$refs.SNDialog.open("center")},generateSn:function(t){var e=this;return(0,o.default)(s.default.mark((function i(){var r;return s.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:return r=e,i.next=3,e.tui.request("/app/productSn/getNewProductSn","POST",{snPre:t},!1,!0).then((function(e){200==e.code?r.tui.request("/app/product/getByProductSn","post",{productSn:e.result},!1,!0).then((function(i){200==i.code&&(""!=i.result?r.generateSn(t):(r.carList.has(r.oneGoodsId)?r.carList.get(r.oneGoodsId).productSn=e.result:r.goodsDetail.productSn=e.result,r.$forceUpdate()))})):r.tui.toast(e.message)})).catch((function(t){}));case 3:e.$refs.SNDialog.close(),setTimeout((function(t){e.numRule="",e.prefixRule=""}),2e3);case 5:case"end":return i.stop()}}),i)})))()},clickGategroy:function(t){"tanchuang"==this.productId?(this.goodsDetail.categoryName=t.categoryName,this.goodsDetail.categoryId=t.id):(this.carList.get(this.productId).categoryName=t.categoryName,this.carList.get(this.productId).categoryId=t.id),this.$forceUpdate(),this.$refs.typePopup.close()},changeMore:function(t){0==t.show&&(this.moreData=[])},uploadFilePromise:function(e){var i=this;t.chooseMedia({count:1,mediaType:["image"],sourceType:["album","camera"],camera:"back",success:function(r){t.compressImage({src:r.tempFiles[0].tempFilePath,quality:50,success:function(r){t.uploadFile({url:i.tui.interfaceUrl()+"/upload/file",filePath:r.tempFilePath,name:"file",header:{"content-type":"multipart/form-data",accessToken:i.tui.getToken()},formData:{},success:function(t){i.carList.get(e[0]).productPicture="";var r=JSON.parse(t.data);i.carList.get(e[0]).productPicture=r.result,i.$forceUpdate()}})}})}})},lunbochange:function(t){this.current=t.detail.current},getZhuBigImage:function(e){var i=[];i.push(e),t.previewImage({urls:i})},pictureAdd:function(e,i,r){var s=this;if(""!=r&&void 0!=r||(r=this.childrenIdForName),this.carList.get(e).stockLogList.get(r).isShowBtn=!1,t.showLoading({title:"加载中...",mask:!0}),""!=e){if(this.childrenId=e,this.childrenIdForName=r,this.carList.get(e).productPictures.length>0&&"huan"!=i)return this.productPictures=this.carList.get(e).productPictures,this.$refs.showImgDiaLog.open(),void t.hideLoading();"huan"==i&&this.$refs.showImgDiaLog.close()}else this.childrenId="",this.childrenIdForName="";t.chooseMedia({count:9,mediaType:["image"],sourceType:["album"],success:function(t){""!=s.childrenId&&(s.carList.get(s.childrenId).productPictures=[]);for(var e=0;e<t.tempFiles.length;e++)s.upLoadFile(t.tempFiles[e].tempFilePath,e+1)},fail:function(e){t.hideLoading()}}),t.hideLoading()},upLoadFile:function(e,i){var r=this;return(0,o.default)(s.default.mark((function a(){var o,u;return s.default.wrap((function(s){while(1)switch(s.prev=s.next){case 0:return o=r,u=t.getStorageSync("hiver_token"),s.next=4,t.compressImage({src:e,quality:50,success:function(e){t.uploadFile({url:o.tui.interfaceUrl()+"/upload/file",filePath:e.tempFilePath,name:"file",header:{"content-type":"multipart/form-data",accessToken:u},formData:{},success:function(t){var e=JSON.parse(t.data);if(""!=o.childrenId){var r={productPicture:e.result};o.carList.get(o.childrenId).productPictures.push(r),o.$forceUpdate()}else setTimeout((function(){o.isSnList(e.result)}),100*i)},fail:function(e){t.hideLoading(),t.showToast({title:JSON.stringify(e),icon:"none"})}})}});case 4:return s.next=6,setTimeout((function(e){t.hideLoading()}),1e3);case 6:case"end":return s.stop()}}),a)})))()},getGategoryList:function(){var t=this;this.tui.request("/app/productCategory/list","get",{},!1,!0).then((function(e){200==e.code?(t.indexList=e.result,t.categoryText=""):t.tui.toast(e.message)})).catch((function(t){}))},priceChange:function(e,i){var r=this;return(0,o.default)(s.default.mark((function a(){var o;return s.default.wrap((function(s){while(1)switch(s.prev=s.next){case 0:if(t.showLoading({title:"加载中...",mask:!0}),o=r,r.priceCurrent!=i||"0"!=r.priceCurrent&&"1"!=r.priceCurrent?(r.priceType=e,o.priceCurrent=i):(r.priceCurrent="2",r.priceType=""),null==r.khName.categoryId||""==r.khName.categoryId||"2"!=r.priceCurrent){s.next=7;break}r.carList.forEach((function(t,e){if(void 0==t.isChangePrice&&(t.isChangePrice=!1),void 0==t.isChangeReturnPrice&&(t.isChangeReturnPrice=!1),null!=t.customerCategoryList){for(var i=!1,r=0,s=!1,a=0;a<t.customerCategoryList.length;a++)t.unitPrice==t.customerCategoryList[a].categoryPrice&&(i=!0),o.khName.categoryId==t.customerCategoryList[a].categoryId&&""!=t.customerCategoryList[a].categoryPrice&&(r=t.customerCategoryList[a].categoryPrice,s=!0);!s||t.unitPrice!=t.wholesalePrice&&t.unitPrice!=t.lsprice&&!i||t.isChangePrice||(t.unitPrice=r,t.discountAmount=r),!s||t.returnPrice!=t.wholesalePrice&&t.unitPrice!=t.lsprice&&!i||t.isChangeReturnPrice||(t.returnPrice=r)}else t.isChangeReturnPrice||(t.returnPrice=t.wholesalePrice),t.isChangePrice?t.discountAmount=t.unitPrice:(t.discountAmount=t.wholesalePrice,t.unitPrice=t.wholesalePrice)})),s.next=9;break;case 7:return s.next=9,r.carList.forEach((function(t,i){o.index=t.productId||t.id,void 0==t.isChangePrice&&(t.isChangePrice=!1),void 0==t.isChangePrice&&(t.isChangeReturnPrice=!1),1!=t.isNew&&("0"!=e||t.isChangePrice?"1"!=e||t.isChangePrice||(t.discountAmount=t.wholesalePrice,t.unitPrice=t.wholesalePrice):(t.discountAmount=t.lsprice,t.unitPrice=t.lsprice),"0"!=e||t.isChangeReturnPrice?"1"!=e||t.isChangeReturnPrice||(t.returnPrice=t.wholesalePrice):t.returnPrice=t.lsprice)}));case 9:return s.next=11,r.getAmountAndWho();case 11:return s.next=13,setTimeout((function(e){t.hideLoading(),r.$forceUpdate()}),500);case 13:case"end":return s.stop()}}),a)})))()},getAmountAndWho:function(e){this.changePriceStatus();var i=this;this.carList.forEach((function(r,s){r.disNoAmount>0?r.disNoAmount:""==i.priceType?r.discountAmount>0?r.discountAmount:r.wholesalePrice:0==i.priceType?r.lsprice:1==i.priceType&&r.wholesalePrice,""!=i.discountType?t.getStorageSync("hangOrder")?(r.price=Number(r.discountAmount)*Number(r.productCount),r.price=Number(r.price.toFixed(2))):(1==i.discountType&&(r.discountAmount=Number(r.unitPrice)*(Number(i.discountNum)/10),r.discountAmount=Number(r.discountAmount.toFixed(2)),r.price=(Number(r.discountAmount)*Number(r.productCount)).toFixed(2),r.price=Number(r.price.toFixed(2))),0==i.discountType&&(r.discountAmount=Number(r.unitPrice)*(Number(r.discount)/10),r.discountAmount=Number(r.discountAmount.toFixed(2)),r.price=r.unitPrice*(r.discount/10)*Number(r.productCount),r.price=Number(r.price.toFixed(2)))):"1848276507420659713"!=i.shopId&&"1818888277105709056"!=i.shopId||!e?(r.price=Number(r.unitPrice)*(Number(r.discount)/10)*Number(r.productCount),r.price=r.price.toFixed(2)):(r.price=Number(r.discountAmount)*(Number(r.discount)/10)*Number(r.productCount),r.price=r.price.toFixed(2))})),this.$forceUpdate(),this.getAllPrice()},AiAddSpec:function(t,e,i){this.isShowinput=1!=i,t.id=e,this.checkName(t)},AiAddReturnSpec:function(t,e,i){this.carList.get(e).stockLogList.get(i).isShowBtn=!1,this.getByReturnId(t)},getById:function(t,e,i){var r=this;return(0,o.default)(s.default.mark((function a(){var o,u,c,n,d,l;return s.default.wrap((function(s){while(1)switch(s.prev=s.next){case 0:if(o=r,o.goodsDetail=t,""!=o.attrBuilt&&i){s.next=16;break}if(1!=e){s.next=11;break}if(o.goodsDetail.attributeList=[],r.goodsDetail.isNew){for(r.goodsList=[],o.goodsDetail.attributeList=r.defaultList,u=0;u<o.goodsDetail.attributeList.length;u++){for(c=0;c<o.goodsDetail.attributeList[u].value.length;c++)o.dataObj.set(o.goodsDetail.attributeList[u].value[c].value,o.goodsDetail.attributeList[u].name);n={specs:[]},o.goodsList.push(n)}r.changeItem="",r.changeItemType="",r.$refs.shopPopup.open("bottom")}else o.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId","POST",{categoryId:o.goodsDetail.attrId},!1,!0).then((function(t){if(200==t.code){if(o.goodsList=[],"string"==typeof t.result.attributeAndValue){var e=JSON.parse(t.result.attributeAndValue),i=[];for(var r in e){for(var s=[],a=0;a<e[r].length;a++)s.push({value:e[r][a],isChecked:!1}),o.dataObj.set(e[r][a],r);i.push({name:r,value:s})}o.goodsDetail.attributeList=i;for(a=0;a<o.goodsDetail.attributeList.length;a++){o.goodsList.push({specs:[]})}}else o.tui.toast("失败了");o.getKCList(t.result.stock)}else o.tui.toast(t.message)})).catch((function(t){}));r.pageOldTemList=[],o.temporaryList=[],o.carList.size>0&&(d=!1,o.carList.forEach((function(e,i){e.stockLogList1=[],0==d&&(e.stockLogList.forEach((function(t,i){if(0==e.stockLogList1.length){var r={productCount:Number(t.productCount),name:t.name,attributeList:i,productNum:t.productNum};e.stockLogList1.push(r)}else for(var s=0;s<e.stockLogList1.length;s++)if(e.stockLogList1[s].attributeList!=i&&e.stockLogList1.length==s+1){var a={productCount:Number(t.productCount),name:t.name,attributeList:i,productNum:t.productNum};e.stockLogList1.push(a)}})),1==e.stockLogList1.length&&'{"颜色":"均色","尺码":"均码"}'==e.stockLogList1[0].attributeList&&1==e.stockLogList1[0].productCount&&(e.stockLogList1[0].productCount=0),e.productId==t?(o.zNum=Number(e.productCount),o.temporaryList=e.stockLogList1,o.pageOldTemList=e.stockLogList1,o.oldTemList=e.stockLogList1,d=!0):e.isNew?e.id==t.id&&(o.zNum=Number(e.productCount),o.temporaryList=e.stockLogList1,o.pageOldTemList=e.stockLogList1,o.oldTemList=e.stockLogList1,d=!0):e.productId==t.productId&&(o.zNum=Number(e.productCount),o.temporaryList=e.stockLogList1,o.pageOldTemList=e.stockLogList1,o.oldTemList=e.stockLogList1,d=!0),e.stockLogList1=[])})),o.zNum=0),s.next=14;break;case 11:return r.pageOldTemList=[],s.next=14,r.tui.request("/app/product/getById/"+t+"?customerId="+r.khName.id,"POST",{},!1,!0).then((function(e){if(200==e.code){if(0==e.result.delFlag)return void o.tui.toast("请将商品上架后再操作!");o.goodsDetail=e.result,o.goodsDetail.unitPrice=o.goodsDetail.wholesalePrice,o.temporaryList=[],r.pageOldTemList=[],o.carList.size>0&&(o.carList.forEach((function(t,e){t.stockLogList.forEach((function(e,i){if(0==t.stockLogList1.length){var r={productCount:Number(e.productCount),name:e.name,attributeList:i,productNum:e.productNum};t.stockLogList1.push(r)}else for(var s=0;s<t.stockLogList1.length;s++)if(t.stockLogList1[s].attributeList!=i&&t.stockLogList1.length==s+1){var a={productCount:Number(e.productCount),name:e.name,attributeList:i,productNum:e.productNum};t.stockLogList1.push(a)}}))})),o.zNum=0,o.colorData=[],o.carList.get(t)&&1==o.carList.get(t).stockLogList1.length&&'{"颜色":"均色","尺码":"均码"}'==o.carList.get(t).stockLogList1[0].attributeList&&1==o.carList.get(t).stockLogList1[0].productCount&&(o.carList.get(t).stockLogList1[0].productCount=0),o.$nextTick((function(){o.carList.forEach((function(e,i){if(e.productId==t){for(var r=0;r<e.stockLogList1.length;r++){var s=e.stockLogList1[r].name;null!=s&&""!=s&&o.colorData.push(s.split(" | ")[0])}o.zNum=Number(e.productCount),o.temporaryList=e.stockLogList1,o.pageOldTemList=e.stockLogList1,o.oldTemList=e.stockLogList1}e.stockLogList1=[]}))}))),o.$nextTick((function(){r.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId","POST",{categoryId:r.goodsDetail.attrId},!1,!0).then((function(t){if(200==t.code){if(r.goodsList=[],r.pecsList=t.result.stock,"string"==typeof t.result.attributeAndValue){var e=JSON.parse(t.result.attributeAndValue),i=[];for(var s in e){var a=[];if(o.colorData.length>0)for(var u=0;u<e[s].length;u++){for(var c=!1,n=0;n<o.colorData.length;n++)c=o.colorData[n]==e[s][u];a.push({value:e[s][u],isChecked:c}),r.dataObj.set(e[s][u],s)}else for(u=0;u<e[s].length;u++)a.push({value:e[s][u],isChecked:!1}),r.dataObj.set(e[s][u],s);i.push({name:s,value:a})}o.goodsDetail.attributeList=i;for(u=0;u<o.goodsDetail.attributeList.length;u++){for(var d=[],l=0;l<o.goodsDetail.attributeList[u].value.length;l++)1==o.goodsDetail.attributeList[u].value[l].isChecked&&(!0,d.push(o.goodsDetail.attributeList[u].value[l].value));r.goodsList.push({specs:[]}),!1,d=[]}if(o.goodsDetail.attributeList.length>0)for(u=0;u<o.goodsDetail.attributeList.length;u++)for(var h=0;h<o.goodsDetail.attributeList[u].value.length;h++)1==o.goodsDetail.attributeList[u].value[h].isChecked&&(o.goodsDetail.attributeList[u].isChecked=!1,o.goodsDetail.attributeList[u].value[h].isChecked=!1,r.attrNameChange(u,o.goodsDetail.attributeList[u].value[h].value,h))}else r.tui.toast("失败了");r.getKCList(t.result.stock)}else r.tui.toast(t.message)})).catch((function(t){}))}))}else r.tui.toast(e.message)})).catch((function(t){}));case 14:s.next=20;break;case 16:return l='{"颜色":"'+o.attrBuilt.split("-")[0]+'","尺码":"'+o.attrBuilt.split("-")[1]+'"}',r.pageOldTemList=[],s.next=20,r.tui.request("/app/product/getById/"+t+"?customerId="+r.khName.id,"POST",{},!1,!0).then((function(e){if(200==e.code){if(0==e.result.delFlag)return void o.tui.toast("请将商品上架后再操作!");o.goodsDetail=e.result,o.goodsDetail.unitPrice=o.goodsDetail.wholesalePrice,o.temporaryList=[],r.pageOldTemList=[],o.carList.size>0&&(o.carList.forEach((function(t,e){t.stockLogList.forEach((function(e,i){if(0==t.stockLogList1.length){var r={productCount:Number(e.productCount),name:e.name,attributeList:i,productNum:e.productNum};t.stockLogList1.push(r)}else for(var s=0;s<t.stockLogList1.length;s++)if(t.stockLogList1[s].attributeList!=i&&t.stockLogList1.length==s+1){var a={productCount:Number(e.productCount),name:e.name,attributeList:i,productNum:e.productNum};t.stockLogList1.push(a)}}))})),o.zNum=0,o.colorData=[],o.carList.get(t)&&1==o.carList.get(t).stockLogList1.length&&'{"颜色":"均色","尺码":"均码"}'==o.carList.get(t).stockLogList1[0].attributeList&&1==o.carList.get(t).stockLogList1[0].productCount&&(o.carList.get(t).stockLogList1[0].productCount=0),o.$nextTick((function(){o.carList.forEach((function(e,i){if(e.productId==t){for(var r=0;r<e.stockLogList1.length;r++){var s=e.stockLogList1[r].name;null!=s&&""!=s&&o.colorData.push(s.split(" | ")[0])}o.zNum=Number(e.productCount),o.temporaryList=e.stockLogList1,o.pageOldTemList=e.stockLogList1,o.oldTemList=e.stockLogList1}e.stockLogList1=[]}))}))),o.$nextTick((function(){r.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId","POST",{categoryId:r.goodsDetail.attrId},!1,!0).then((function(e){if(200==e.code){if(r.goodsList=[],r.pecsList=e.result.stock,"string"==typeof e.result.attributeAndValue){var i=JSON.parse(e.result.attributeAndValue),s=[];for(var a in i){var u=[];if(o.colorData.length>0)for(var c=0;c<i[a].length;c++){for(var n=!1,d=0;d<o.colorData.length;d++)n=o.colorData[d]==i[a][c];u.push({value:i[a][c],isChecked:n}),r.dataObj.set(i[a][c],a)}else for(c=0;c<i[a].length;c++)u.push({value:i[a][c],isChecked:!1}),r.dataObj.set(i[a][c],a);s.push({name:a,value:u})}o.goodsDetail.attributeList=s;for(c=0;c<o.goodsDetail.attributeList.length;c++){for(var h=[],g=0;g<o.goodsDetail.attributeList[c].value.length;g++)1==o.goodsDetail.attributeList[c].value[g].isChecked&&(!0,h.push(o.goodsDetail.attributeList[c].value[g].value));r.goodsList.push({specs:[]}),!1,h=[]}if(o.goodsDetail.attributeList.length>0)for(c=0;c<o.goodsDetail.attributeList.length;c++)for(var L=0;L<o.goodsDetail.attributeList[c].value.length;L++)1==o.goodsDetail.attributeList[c].value[L].isChecked&&(o.goodsDetail.attributeList[c].isChecked=!1,o.goodsDetail.attributeList[c].value[L].isChecked=!1,r.attrNameChange(c,o.goodsDetail.attributeList[c].value[L].value,L))}else r.tui.toast("失败了");o.$nextTick((function(){var i=1;"1"==o.saomaotype&&(i=-1);var s=null;if(1==r.pecsList.length)l=r.pecsList[0].attributeList,s=r.pecsList[0].stockCount;else for(var a=0;a<r.pecsList.length;a++)r.pecsList[a].attributeList==l&&(s=r.pecsList[a].stockCount);if(o.carList.size>0&&o.carList.has(t)&&o.carList.get(t).stockLogList.has(l)){var u=o.carList.get(t).stockLogList.get(l).productCount;void 0!=u&&(i+=Number(u))}null==s?r.getKCList(e.result.stock):(o.attributeList={attributeList:l,productCount:i,productNum:s,name:o.attrBuilt.split("-")[0]+" | "+o.attrBuilt.split("-")[1],price:r.purchasePrice},o.temporaryList=[],o.temporaryList.push(o.attributeList),o.temporaryCheck(!0))})).catch((function(t){}))}else r.tui.toast(e.message)})).catch((function(t){}))}))}else r.tui.toast(e.message)})).catch((function(t){}));case 20:case"end":return s.stop()}}),a)})))()},keyboardConfirm:function(){this.keyboardNum=this.handleNumber(this.keyboardNum),""!=this.keyboardNum&&("shouldPay"==this.keyboard?(this.shouldPay=Number(this.keyboardNum),this.changessPrice1(this.shouldPay),this.keyboard=""):"alreadyPay"==this.keyboard?(this.alreadyPay=Number(this.keyboardNum),this.changePay1(this.alreadyPay),this.keyboard=""):"mapdanjishu"==this.keyboard?(this.carList.get(this.keyboardIndex[0]).stockLogList.get(this.keyboardIndex[1]).productCount=Number(this.keyboardNum),this.mapnumChange1(Number(this.keyboardNum),this.keyboardIndex[0],this.keyboardIndex[1]),this.keyboard=""):"danjia"==this.keyboard?(this.carList.get(this.keyboardIndex[0]).purchasePrice=Number(this.keyboardNum),this.clickCollapse1(Number(this.keyboardNum),this.keyboardIndex[0]),this.keyboard=""):"pifa"==this.keyboard?(this.carList.get(this.keyboardIndex[0]).wholesalePrice=Number(this.keyboardNum),this.keyboard=""):"lingshou"==this.keyboard&&(this.carList.get(this.keyboardIndex[0]).price=Number(this.keyboardNum),this.carList.get(this.keyboardIndex[0]).lsprice=Number(this.keyboardNum),this.keyboard="")),this.isFocused=!1,this.keyboardNum=""},shopPopupChange:function(t){0==t.show&&(this.popupText="")},clickKeyboard:function(t){"."==t?"danjishu1"!=this.keyboard&&(this.popupText+=t):"-"==t||("clear"==t?this.popupText=this.popupText.substr(0,this.popupText.length-1):(this.popupText+=t,this.popupText=this.handleNumber(this.popupText))),"danjia1"==this.keyboard?(this.goodsDetail.purchasePrice=this.popupText,this.clickCollapse2(this.popupText,"danjia1")):"pifa1"==this.keyboard?this.goodsDetail.wholesalePrice=this.popupText:"lingshou1"==this.keyboard?this.goodsDetail.lsprice=this.popupText:"danjishu1"==this.keyboard&&(this.goodsDetail.attributeList.newYanSeList[this.keyboardIndex[0]].value[this.keyboardIndex[1]].productCount=this.popupText,this.numChange(this.popupText,this.keyboardIndex[0],this.keyboardIndex[1])),"confirm"==t&&(this.isFocused=!1,this.popupText=this.handleNumber(this.popupText),"danjia1"==this.keyboard?(this.goodsDetail.purchasePrice=this.popupText,this.clickCollapse2(this.popupText,"danjia1")):"pifa1"==this.keyboard?this.goodsDetail.wholesalePrice=this.popupText:"lingshou1"==this.keyboard?this.goodsDetail.lsprice=this.popupText:"danjishu1"==this.keyboard&&(this.goodsDetail.attributeList.newYanSeList[this.keyboardIndex[0]].value[this.keyboardIndex[1]].productCount=this.popupText,this.numChange(this.popupText,this.keyboardIndex[0],this.keyboardIndex[1])),this.keyboard="",this.popupText="")},getByReturnId:function(t){var e=this;return(0,o.default)(s.default.mark((function i(){var r;return s.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:return r=e,e.pageOldTemReturnList=[],i.next=4,e.tui.request("/app/product/getById/"+t,"POST",{},!1,!0).then((function(i){if(200==i.code){if(0==i.result.delFlag)return void r.tui.toast("请将商品上架后再操作!");r.goodsReturnDetail=i.result,r.temporaryReturnList=[],e.pageOldTemReturnList=[],r.carList.size>0&&(r.carList.forEach((function(t,e){t.returnList.forEach((function(e,i){if(0==t.returnList1.length){var r={productCount:Number(e.productCount),name:e.name,attributeList:i,productNum:e.productNum};t.returnList1.push(r)}else for(var s=0;s<t.returnList1.length;s++)if(t.returnList1[s].attributeList!=i&&t.returnList1.length==s+1){var a={productCount:Number(e.productCount),name:e.name,attributeList:i,productNum:e.productNum};t.returnList1.push(a)}}))})),r.zReturnNum=0,r.$nextTick((function(){r.carList.forEach((function(e,i){e.productId==t&&(r.zReturnNum=Number(e.returnCount),r.temporaryReturnList=e.returnList1,r.pageOldTemReturnList=e.returnList1,r.oldTemReturnList=e.returnList1),e.returnList1=[]}))}))),r.$nextTick((function(){e.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId","POST",{categoryId:e.goodsReturnDetail.attrId},!1,!0).then((function(t){if(200==t.code){if(e.goodsReturnList=[],"string"==typeof t.result.attributeAndValue){var i=JSON.parse(t.result.attributeAndValue),s=[];for(var a in i){for(var o=[],u=0;u<i[a].length;u++)o.push({value:i[a][u],isChecked:!1}),e.dataObj.set(i[a][u],a);s.push({name:a,value:o})}e.goodsReturnDetail.attributeList=s;for(u=0;u<e.goodsReturnDetail.attributeList.length;u++){for(var c=[],n=0;n<e.goodsReturnDetail.attributeList[u].value.length;n++)1==e.goodsReturnDetail.attributeList[u].value[n].isChecked&&(!0,c.push(e.goodsReturnDetail.attributeList[u].value[n].value));e.goodsReturnList.push({specs:[]}),!1,c=[]}""==e.temporaryReturnList&&e.attrReturnNameChange(0,r.goodsReturnDetail.attributeList[0].value[0].value,0)}else e.tui.toast("失败了");e.getKCReturnList(t.result.stock)}else e.tui.toast(t.message)})).catch((function(t){}))}))}else e.tui.toast(i.message)})).catch((function(t){}));case 4:case"end":return i.stop()}}),i)})))()},getKCList:function(e){var i=this;this.yanseList=new Map,this.chimaList=new Map,this.pecsList=e;for(var r=function(t){var r=JSON.parse(e[t].attributeList);Object.keys(r).forEach((function(t){"颜色"==t?1!=i.yanseList.has(r[t])&&i.yanseList.set(r[t],r[t]):1!=i.chimaList.has(r[t])&&i.chimaList.set(r[t],r[t])}))},s=0;s<e.length;s++)r(s);setTimeout((function(e){i.changeItem="",i.changeItemType="",i.$refs.shopPopup.open("bottom"),t.hideLoading()}),200)},allChangeSizeNum:function(t,e){this.changeItem="chima"==t?e:e.name,this.changeAllNum="",this.changeItemType=t},delButton:function(){if(console.log(this.temporaryList),"chima"==this.changeItemType)for(var t=0;t<this.goodsDetail.attributeList.newYanSeList.length;t++)for(var e=0;e<this.goodsDetail.attributeList.newYanSeList[t].value.length;e++)-1!=this.goodsDetail.attributeList.newYanSeList[t].value[e].name.indexOf(this.changeItem)&&(""==this.goodsDetail.attributeList.newYanSeList[t].value[e].productCount&&(this.goodsDetail.attributeList.newYanSeList[t].value[e].productCount=0),this.goodsDetail.attributeList.newYanSeList[t].value[e].productCount=Number(this.goodsDetail.attributeList.newYanSeList[t].value[e].productCount)-1,this.numChange2(this.goodsDetail.attributeList.newYanSeList[t].value[e]));else for(var i=0;i<this.goodsDetail.attributeList.newYanSeList.length;i++)if(this.goodsDetail.attributeList.newYanSeList[i].name==this.changeItem)for(var r=0;r<this.goodsDetail.attributeList.newYanSeList[i].value.length;r++)-1!=this.goodsDetail.attributeList.newYanSeList[i].value[r].name.indexOf(this.changeItem)&&(""==this.goodsDetail.attributeList.newYanSeList[i].value[r].productCount&&(this.goodsDetail.attributeList.newYanSeList[i].value[r].productCount=0),this.goodsDetail.attributeList.newYanSeList[i].value[r].productCount=Number(this.goodsDetail.attributeList.newYanSeList[i].value[r].productCount)-1,this.numChange2(this.goodsDetail.attributeList.newYanSeList[i].value[r]))},addButton:function(){if("chima"==this.changeItemType)for(var t=0;t<this.goodsDetail.attributeList.newYanSeList.length;t++)for(var e=0;e<this.goodsDetail.attributeList.newYanSeList[t].value.length;e++)-1!=this.goodsDetail.attributeList.newYanSeList[t].value[e].name.indexOf(this.changeItem)&&(""==this.goodsDetail.attributeList.newYanSeList[t].value[e].productCount&&(this.goodsDetail.attributeList.newYanSeList[t].value[e].productCount=0),this.goodsDetail.attributeList.newYanSeList[t].value[e].productCount=Number(this.goodsDetail.attributeList.newYanSeList[t].value[e].productCount)+1,this.numChange2(this.goodsDetail.attributeList.newYanSeList[t].value[e]));else for(var i=0;i<this.goodsDetail.attributeList.newYanSeList.length;i++)if(this.goodsDetail.attributeList.newYanSeList[i].name==this.changeItem)for(var r=0;r<this.goodsDetail.attributeList.newYanSeList[i].value.length;r++)""==this.goodsDetail.attributeList.newYanSeList[i].value[r].productCount&&(this.goodsDetail.attributeList.newYanSeList[i].value[r].productCount=0),-1!=this.goodsDetail.attributeList.newYanSeList[i].value[r].name.indexOf(this.changeItem)&&(this.goodsDetail.attributeList.newYanSeList[i].value[r].productCount=Number(this.goodsDetail.attributeList.newYanSeList[i].value[r].productCount)+1,this.numChange2(this.goodsDetail.attributeList.newYanSeList[i].value[r]))},changeButton:function(){if("chima"==this.changeItemType)for(var t=0;t<this.goodsDetail.attributeList.newYanSeList.length;t++)for(var e=0;e<this.goodsDetail.attributeList.newYanSeList[t].value.length;e++)-1!=this.goodsDetail.attributeList.newYanSeList[t].value[e].name.indexOf(this.changeItem)&&(this.goodsDetail.attributeList.newYanSeList[t].value[e].productCount=Number(this.changeAllNum),this.numChange2(this.goodsDetail.attributeList.newYanSeList[t].value[e]));else for(var i=0;i<this.goodsDetail.attributeList.newYanSeList.length;i++)if(this.goodsDetail.attributeList.newYanSeList[i].name==this.changeItem)for(var r=0;r<this.goodsDetail.attributeList.newYanSeList[i].value.length;r++)-1!=this.goodsDetail.attributeList.newYanSeList[i].value[r].name.indexOf(this.changeItem)&&(this.goodsDetail.attributeList.newYanSeList[i].value[r].productCount=Number(this.changeAllNum),this.numChange2(this.goodsDetail.attributeList.newYanSeList[i].value[r]))},numChange2:function(t){for(var e=!1,i=0;i<this.temporaryList.length;i++)this.temporaryList[i].attributeList==t.name&&(this.temporaryList[i].productCount=t.productCount,e=!0);if(0==e){var r={attributeList:t.name,productCount:t.productCount,productNum:t.kucun,name:t.name,price:this.goodsDetail.purchasePrice};this.temporaryList.push(r)}this.temporaryChange()},getKCReturnList:function(e){var i=this;this.yanseList=new Map,this.chimaList=new Map,this.$refs.returnDialog.open("bottom"),this.pecsList=e;for(var r=function(t){var r=JSON.parse(e[t].attributeList);Object.keys(r).forEach((function(t){"颜色"==t?1!=i.yanseList.has(r[t])&&i.yanseList.set(r[t],r[t]):1!=i.chimaList.has(r[t])&&i.chimaList.set(r[t],r[t])}))},s=0;s<e.length;s++)r(s);for(var a=0;a<this.goodsReturnDetail.attributeList[0].value.length;a++)1==this.yanseList.has(this.goodsReturnDetail.attributeList[0].value[a].value)&&(this.goodsReturnDetail.attributeList[0].value[a].isKucun=!0);for(var o=0;o<this.goodsReturnDetail.attributeList[1].value.length;o++)1==this.chimaList.has(this.goodsReturnDetail.attributeList[1].value[o].value)&&(this.goodsReturnDetail.attributeList[1].value[o].isKucun=!0);setTimeout((function(e){t.hideLoading()}),200)},temporaryChange:function(t,e){if(""!=e&&void 0!=e){for(var i=0;i<this.pageOldTemList.length;i++)if(e.attributeList==this.pageOldTemList[i].attributeList){this.pageOldTemList[i].productCount=Number(e.productCount);break}for(var r=0;r<this.oldTemList.length;r++)if(e.attributeList==this.oldTemList[r].attributeList){this.oldTemList[r].productCount=Number(e.productCount);break}}this.zNum=0,console.log(this.temporaryList);for(var s=0;s<this.temporaryList.length;s++)this.zNum+=Number(this.temporaryList[s].productCount)||0},temporaryReturnChange:function(t,e){if(""!=e&&void 0!=e){for(var i=0;i<this.pageOldTemReturnList.length;i++)if(e.attributeList==this.pageOldTemReturnList[i].attributeList){this.pageOldTemReturnList[i].productCount=Number(e.productCount);break}for(var r=0;r<this.oldTemReturnList.length;r++)if(e.attributeList==this.oldTemReturnList[r].attributeList){this.oldTemReturnList[r].productCount=Number(e.productCount);break}}this.zReturnNum=0;for(var s=0;s<this.temporaryReturnList.length;s++)this.temporaryReturnList[s].productCount>0&&(this.zReturnNum+=Number(this.temporaryReturnList[s].productCount))},attrFocus:function(){this.isFocus=!0},handleBlur:function(t){this.isFocus=!1,this.categoryText=t.detail.value},inventorySubmit:function(){var e=this;0==this.carList.size?t.showToast({title:"请选择商品后再入库",icon:"none"}):""==this.khName?t.showModal({title:"提示",content:"您没有选择供应商,要使用“默认供应商”入库吗?",success:function(t){t.confirm&&e.gysList()}}):this.goRuku()},goInventory:function(e,i){t.navigateTo({url:"/package1/inventory/inventoryConfirm?aiinventory=1&purchase="+JSON.stringify(e)+"&purchaseDetails="+JSON.stringify(i)+"&zhiqianqiankuan="+this.zhiqianqiankuan+"&yuedikou="+this.yuedikou+"&leijiqiankuan="+this.leijiqiankuan})},gysList:function(){var t=this,e=this;this.tui.request("/app/supplier/getByCondition","post",{searchStr:"默认供应商",pageNumber:1,pageSize:10},!1,!0).then((function(i){200==i.code?0==i.result.content.length?e.tui.request("/app/supplier/save","post",{consigneeMobile:"",consigneeName:"默认供应商",address1:"",address:"",province:"",city:"",area:""},!1,!0).then((function(t){200==t.code&&e.gysList()})):(e.khName=i.result.content[0],setTimeout((function(t){e.goRuku()}),500)):t.tui.toast(i.message)}))},goRuku:function(){var e=this;return(0,o.default)(s.default.mark((function i(){var r,a,o,u;return s.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:return r=e,a={id:t.getStorageSync("AiInventoryId")?t.getStorageSync("AiInventoryId"):"",alreadyPay:""==e.alreadyPay?0:e.alreadyPay,noPay:""==e.noPay?0:e.noPay,shouldPay:e.shouldPay,totalAmount:e.totalAmount,remark:e.remark,purchaseTime:e.single,otherPay:""==e.otherPay?0:e.otherPay,supplierId:e.khName.id,supplierName:e.khName.consigneeName},o=[],u=[],i.next=6,e.carList.forEach((function(e,i){u+=1,e.customerCategoryRule=JSON.stringify(e.customerCategoryList);var s=t.getStorageSync("shopId");if(1!=r.userType||"1853332569559535619"!=s&&"1810179818189361152"!=s?1==r.userType&&(e.purchasePrice=""):e.purchasePrice=0,""==e.productSn)throw t.showModal({title:"提示",content:"第"+u.length+"款商品货号必须维护"}),Error("11");if(e.price=e.lsprice,e.stockLogList1=[],0==e.stockLogList.size){e.productCount=1,e.price1=(Number(e.productCount)*Number(e.purchasePrice)).toFixed(2),e.stockLogList1.push({productCount:1,attributeList:'{"颜色":"均色","尺码":"均码"}'})}else e.stockLogList.forEach((function(t,i){if(t.productCount<=0)throw r.tui.toast(e.productSn+"的入库数量不能为零~"),Error("error");var s={productCount:Number(t.productCount),attributeList:i};e.stockLogList1.push(s)}));o.push(e)}));case 6:return i.next=8,e.goInventory(a,o);case 8:case"end":return i.stop()}}),i)})))()},dialogClose:function(){this.$refs.specDialog.close(),this.categoryText=""},dialogInputConfirm:function(t){if(""!=this.categoryText){if("0"==this.isOpenId){for(var e={name:this.categoryText,value:[]},i=0;i<this.goodsDetail.attributeList.newChiMaList.length;i++){var r={kucun:"",name:'{"颜色":"'+this.categoryText+'","尺码":"'+this.goodsDetail.attributeList.newChiMaList[i]+'"}',productCount:"",value:this.categoryText};e.value.push(r)}if(this.goodsDetail.attributeList.newYanSeList.push(e),this.dataObj.set(this.categoryText,"颜色"),0==this.colorSizeNew.has(this.goodsDetail.id)){var s=new Map;s.set("颜色",[this.categoryText]),s.set("尺码",[]),this.colorSizeNew.set(this.goodsDetail.id,s)}else-1==this.colorSizeNew.get(this.goodsDetail.id).get("颜色").indexOf(this.categoryText)&&this.colorSizeNew.get(this.goodsDetail.id).get("颜色").push(this.categoryText)}else if("1"==this.isOpenId){this.goodsDetail.attributeList.newChiMaList.push(this.categoryText);for(var a=0;a<this.goodsDetail.attributeList.newYanSeList.length;a++){var o={kucun:"",name:'{"颜色":"'+this.goodsDetail.attributeList.newYanSeList[a].name+'","尺码":"'+this.categoryText+'"}',productCount:"",value:this.goodsDetail.attributeList.newYanSeList[a].name};this.goodsDetail.attributeList.newYanSeList[a].value.push(o)}if(this.dataObj.set(this.categoryText,"尺码"),0==this.colorSizeNew.has(this.goodsDetail.id)){var u=new Map;u.set("颜色",[]),u.set("尺码",[this.categoryText]),this.colorSizeNew.set(this.goodsDetail.id,u)}else-1==this.colorSizeNew.get(this.goodsDetail.id).get("尺码").indexOf(this.categoryText)&&this.colorSizeNew.get(this.goodsDetail.id).get("尺码").push(this.categoryText)}console.log(this.goodsDetail.attributeList),this.$forceUpdate(),this.dialogClose()}else this.tui.toast("请输入规格值后提交")},changeRemark:function(t){this.remark=t.detail.value},changePbAddress:function(t){this.pbAddress=t.detail.value},change:function(e){t.showLoading({title:"加载中..."}),this.linshiPrice==e.target.value?this.relPrice=e.target.value:e.detail.value>10?this.discountNum=10:e.detail.value<0?this.discountNum=0:""==e.target.value?this.discountNum=this.linshiPrice:this.discountNum=e.target.value,this.getAmountAndWho(),setTimeout((function(e){t.hideLoading()}),200)},reloadPrices:function(){var t=this;0==t.isChangeShouldPay&&(t.shouldPay=0),0==t.isChangeReturnPay&&(t.returnPay=0),this.returnTotalAmount=0,this.totalAmount=0,this.carList.forEach((function(e,i){var r=0,s=0;e.stockLogList.forEach((function(e,i){e.productCount>0&&(r+=Number(e.productCount),t.totalAmount+=Number(e.productCount)),e.productCount<0&&(s+=Number(Math.abs(e.productCount)),t.returnTotalAmount+=Number(Math.abs(e.productCount)))})),void 0!=e.returnList&&e.returnList.forEach((function(e,i){s+=Number(Math.abs(e.productCount)),t.returnTotalAmount+=Number(Math.abs(e.productCount))})),e.returnCount=s,e.productCount=r,e.price=(Number(e.productCount)*Number(e.discountAmount)).toFixed(2),0==t.isChangeShouldPay&&(t.shouldPay+=Number(r*Number(e.discountAmount))),0==t.isChangeReturnPay&&(t.returnPay+=Math.abs(Number(s))*Number(e.returnPrice))})),0==t.isChangeShouldPay&&(t.shouldPay=Number(t.shouldPay.toFixed(2))),0==t.isChangeReturnPay&&(t.returnPay=Number(t.returnPay.toFixed(2)))},xiaoshouChange:function(e){t.showLoading({title:"加载中..."}),this.linshiPrice==e.target.value?(this.shouldPay=e.target.value,this.isChangeShouldPay=!1):""==e.target.value?(this.shouldPay=this.linshiPrice,this.isChangeShouldPay=!1):(this.isChangeShouldPay=!0,this.shouldPay=e.target.value),this.getAllPrice(this.shouldPay),setTimeout((function(e){t.hideLoading()}),200)},tuihuoChange:function(e){t.showLoading({title:"加载中..."}),this.linshiPrice==e.target.value?(this.returnPay=e.target.value,this.isChangeReturnPay=!1):""==e.target.value?(this.returnPay=this.linshiPrice,this.isChangeReturnPay=!1):(this.isChangeReturnPay=!0,this.returnPay=e.target.value),this.getAllPrice(this.returnPay),setTimeout((function(e){t.hideLoading()}),200)},radioChange:function(t){this.gysName="",this.wlName="",this.kdyName="",this.lbgName="",this.radioType=t.detail.value;for(var e=0;e<this.logisticsType.length;e++)if(this.logisticsType[e].value===t.detail.value){this.lunbocurrent=e;break}},clickClose:function(){this.evalue=[],this.oldTemList=[],this.allChangeNum=0;for(var t=0;t<this.goodsDetail.attributeList.length;t++){this.goodsDetail.attributeList[t].isChecked=!1;for(var e=0;e<this.goodsDetail.attributeList[t].value.length;e++)this.goodsDetail.attributeList[t].value[e].isChecked=!1}},temporaryReturnCheck:function(){var e=this;t.showLoading({title:"加载中..."}),this.evalue=[];for(var i=this,r=[],s=[],a=0;a<this.temporaryReturnList.length;a++)0!=this.temporaryReturnList[a].productCount&&s.push(this.temporaryReturnList[a]);this.$nextTick((function(){var a={id:e.goodsReturnDetail.id,price:e.zPrice,num:e.zReturnNum,isNew:e.goodsReturnDetail.isNew,unitPrice:e.goodsReturnDetail.unitPrice,categoryId:e.goodsReturnDetail.categoryId,productName:e.goodsReturnDetail.productName,productSn:e.goodsReturnDetail.productSn,productPicture:e.goodsReturnDetail.productPicture,supplierName:e.goodsReturnDetail.supplierName,saleDetailQueryDTO:s,wholesalePrice:e.goodsReturnDetail.wholesalePrice,lsprice:e.goodsReturnDetail.price};r.push(a),e.temporaryReturnList=[],e.oldTemReturnList=[],e.purchasePrice="",e.zPrice="",e.zReturnNum="";for(var o=0;o<e.goodsReturnDetail.attributeList.length;o++){e.goodsReturnDetail.attributeList[o].isChecked=!1;for(var u=0;u<e.goodsReturnDetail.attributeList[o].value.length;u++)e.goodsReturnDetail.attributeList[o].value[u].isChecked=!1}if(0==e.carList.size){for(var c=0;c<r.length;c++){for(var n={attrId:r[c].attrId,purchasePrice:r[c].price,price:0,buyCount:r[c].buyCount,discount:10,unitPrice:r[c].unitPrice||0,customerCategoryRule:JSON.parse(r[c].customerCategoryRule),categoryId:r[c].categoryId,discountAmount:r[c].isNew?r[c].unitPrice||0:r[c].wholesalePrice||0,returnPrice:r[c].wholesalePrice||0,returnCount:0,disNoAmount:0,wholesalePrice:r[c].wholesalePrice,lsprice:r[c].lsprice,productCount:0,productId:r[c].id,productName:r[c].productName,productPicture:r[c].productPicture,productSn:r[c].productSn,stockLogList:new Map,returnList:new Map,stockLogList1:[],supplierName:r[c].supplierName},d=0;d<r[c].saleDetailQueryDTO.length;d++){var l={productCount:Number(r[c].saleDetailQueryDTO[d].productCount),name:r[c].saleDetailQueryDTO[d].name,productNum:r[c].saleDetailQueryDTO[d].productNum};n.returnList.set(r[c].saleDetailQueryDTO[d].attributeList,l),r[c].saleDetailQueryDTO[d].productCount>0?n.productCount+=Number(r[c].saleDetailQueryDTO[d].productCount):n.returnCount+=Math.abs(r[c].saleDetailQueryDTO[d].productCount)}e.carList.set(r[c].id,n)}r=[]}else{for(var h=function(t){if(1==e.carList.has(r[t].id)&&(e.carList.get(r[t].id).returnList=new Map),1==e.carList.has(r[t].id)){e.carList.get(r[t].id).returnCount=0,e.carList.get(r[t].id).returnList.forEach((function(e,s){e.productCount<0&&(i.carList.get(r[t].id).returnCount+=Math.abs(e.productCount))})),e.carList.get(r[t].id).stockLogList.forEach((function(e,s){e.productCount<0&&(i.carList.get(r[t].id).returnCount+=Math.abs(e.productCount))}));for(var s=0;s<r[t].saleDetailQueryDTO.length;s++)e.carList.get(r[t].id).returnList.has(r[t].saleDetailQueryDTO[s].attributeList),l={productCount:Number(r[t].saleDetailQueryDTO[s].productCount),name:r[t].saleDetailQueryDTO[s].name,productNum:r[t].saleDetailQueryDTO[s].productNum},e.carList.get(r[t].id).returnList.set(r[t].saleDetailQueryDTO[s].attributeList,l),r[t].saleDetailQueryDTO[s].productCount>0?e.carList.get(r[t].id).productCount+=Number(r[t].saleDetailQueryDTO[s].productCount):e.carList.get(r[t].id).returnCount+=Math.abs(r[t].saleDetailQueryDTO[s].productCount),i.carList.get(r[t].id).returnPay=(Number(i.carList.get(r[t].id).returnCount)*Number(i.carList.get(r[t].id).unitPrice)).toFixed(2)}else{for(var a={attrId:r[t].attrId,purchasePrice:r[t].price,price:0,discount:10,buyCount:r[t].buyCount,customerCategoryRule:JSON.parse(r[t].customerCategoryRule),discountAmount:r[t].isNew?r[t].unitPrice||0:r[t].wholesalePrice||0,returnPrice:r[t].wholesalePrice||0,returnCount:0,disNoAmount:0,unitPrice:r[t].unitPrice,categoryId:r[t].categoryId,wholesalePrice:r[t].wholesalePrice,lsprice:r[t].lsprice,productCount:0,productId:r[t].id,productName:r[t].productName,productPicture:r[t].productPicture,stockLogList:new Map,returnList:new Map,stockLogList1:[],productSn:r[t].productSn,supplierName:r[t].supplierName},o=0;o<r[t].saleDetailQueryDTO.length;o++)l={productCount:Number(r[t].saleDetailQueryDTO[o].productCount),name:r[t].saleDetailQueryDTO[o].name,productNum:r[t].saleDetailQueryDTO[o].productNum},a.returnList.set(r[t].saleDetailQueryDTO[o].attributeList,l),r[t].saleDetailQueryDTO[o].productCount>0?a.productCount+=Number(r[t].saleDetailQueryDTO[o].productCount):a.returnCount+=Math.abs(r[t].saleDetailQueryDTO[o].productCount);e.carList.set(r[t].id,a)}},g=0;g<r.length;g++){h(g)}r=[]}e.carList.forEach((function(t,e){1!=t.isNew&&(void 0==t.isChangePrice&&(t.isChangePrice=!1),void 0==t.isChangeReturnPrice&&(t.isChangeReturnPrice=!1),""==i.priceType?(""!=t.returnPrice&&null!=t.returnPrice&&0!=t.returnPrice||(t.returnPrice=t.isChangeReturnPrice?t.wholesalePrice:t.returnPrice),t.unitPrice=t.discountAmount>0?t.discountAmount:t.wholesalePrice):0==i.priceType?(t.unitPrice=t.isChangePrice?t.unitPrice:t.lsprice,t.discountAmount=t.isChangePrice?t.unitPrice:t.lsprice,t.returnPrice=t.isChangeReturnPrice?t.unitPrice:t.lsprice):1==i.priceType&&(t.unitPrice=t.isChangePrice?t.unitPrice:t.wholesalePrice,t.discountAmount=t.isChangePrice?t.unitPrice:t.wholesalePrice,t.returnPrice=t.isChangeReturnPrice?t.unitPrice:t.wholesalePrice))})),e.getAmountAndWho(),e.$refs.returnDialog.close(),setTimeout((function(e){t.hideLoading()}),500)}))},temporaryCheck:function(){var e=this;t.showLoading({title:"加载中..."});for(var i=0;i<this.temporaryList.length;i++)this.temporaryList[i].productCount=this.handleNumber(this.temporaryList[i].productCount);var r=[];void 0!=this.goodsDetail.purchasePrice&&(this.goodsDetail.purchasePrice=this.handleNumber(this.goodsDetail.purchasePrice)),void 0!=this.goodsDetail.wholesalePrice&&(this.goodsDetail.wholesalePrice=this.handleNumber(this.goodsDetail.wholesalePrice)),void 0!=this.goodsDetail.lsprice&&(this.goodsDetail.lsprice=this.handleNumber(this.goodsDetail.lsprice));var s={id:this.goodsDetail.productId?this.goodsDetail.productId:this.goodsDetail.id,price:0,num:this.zNum,customerCategoryRule:null!=this.goodsDetail.customerCategoryRule?this.checkPriceRule(JSON.parse(this.goodsDetail.customerCategoryRule)):null,productId:this.goodsDetail.productId,isNew:this.goodsDetail.isNew,productName:this.goodsDetail.productName,wholesalePrice:this.goodsDetail.wholesalePrice,purchasePrice:this.goodsDetail.purchasePrice,categoryName:this.goodsDetail.categoryName,categoryId:this.goodsDetail.categoryId,attrId:this.goodsDetail.attrId,lsprice:this.goodsDetail.lsprice,productSn:this.goodsDetail.productSn,productPicture:this.goodsDetail.productPicture,supplierName:this.goodsDetail.supplierName,productPictures:[],saleDetailQueryDTO:this.temporaryList};if(r.push(s),this.temporaryList=[],this.oldTemList=[],this.purchasePrice="",this.zPrice="",this.zNum="",0==this.carList.size){for(var a=0;a<r.length;a++){for(var o,u=(o={id:r[a].id,purchasePrice:0==this.userType?r[a].purchasePrice:"",price:this.goodsDetail.price,price1:0,productCount:0},(0,c.default)(o,"id",r[a].id),(0,c.default)(o,"productId",r[a].isNew?r[a].productId:r[a].id),(0,c.default)(o,"isNew",r[a].isNew),(0,c.default)(o,"customerCategoryList",null!=r[a].customerCategoryRule?this.checkPriceRule(r[a].customerCategoryRule):this.getNewProductRule()),(0,c.default)(o,"wholesalePrice",r[a].wholesalePrice),(0,c.default)(o,"categoryName",r[a].categoryName),(0,c.default)(o,"categoryId",r[a].categoryId),(0,c.default)(o,"attrId",r[a].attrId),(0,c.default)(o,"lsprice",r[a].lsprice),(0,c.default)(o,"productName",r[a].productName),(0,c.default)(o,"productPicture",r[a].productPicture),(0,c.default)(o,"productSn",r[a].productSn),(0,c.default)(o,"stockLogList",new Map),(0,c.default)(o,"productPictures",[]),(0,c.default)(o,"returnList",new Map),(0,c.default)(o,"stockLogList1",[]),o),n=0;n<r[a].saleDetailQueryDTO.length;n++){var d={productCount:Number(r[a].saleDetailQueryDTO[n].productCount),name:r[a].saleDetailQueryDTO[n].name,productNum:r[a].saleDetailQueryDTO[n].productNum};r[a].saleDetailQueryDTO.length>1?d.productCount>0&&u.stockLogList.set(r[a].saleDetailQueryDTO[n].attributeList,d):u.stockLogList.set(r[a].saleDetailQueryDTO[n].attributeList,d),u.productCount+=Number(r[a].saleDetailQueryDTO[n].productCount),u.price1=(Number(u.productCount)*Number(this.goodsDetail.purchasePrice)).toFixed(2)}this.carList.set(r[a].id,u)}r=[]}else{console.log(11111),console.log(r);for(var l=0;l<r.length;l++)if(1==this.carList.has(r[l].id)&&(this.carList.get(r[l].id).stockLogList=new Map),1==this.carList.has(r[l].id)){this.carList.get(r[l].id)&&(this.carList.get(r[l].id).productCount=0);for(var h=0;h<r[l].saleDetailQueryDTO.length;h++){if(1==this.carList.get(r[l].id).stockLogList.has(r[l].saleDetailQueryDTO[h].attributeList)){d={productCount:Number(r[l].saleDetailQueryDTO[h].productCount),name:r[l].saleDetailQueryDTO[h].name,productNum:r[l].saleDetailQueryDTO[h].productNum};r[l].saleDetailQueryDTO.length>1?d.productCount>0&&this.carList.get(r[l].id).stockLogList.set(r[l].saleDetailQueryDTO[h].attributeList,d):this.carList.get(r[l].id).stockLogList.set(r[l].saleDetailQueryDTO[h].attributeList,d)}else{d={productCount:Number(r[l].saleDetailQueryDTO[h].productCount),name:r[l].saleDetailQueryDTO[h].name,productNum:r[l].saleDetailQueryDTO[h].productNum};r[l].saleDetailQueryDTO.length>1?d.productCount>0&&this.carList.get(r[l].id).stockLogList.set(r[l].saleDetailQueryDTO[h].attributeList,d):this.carList.get(r[l].id).stockLogList.set(r[l].saleDetailQueryDTO[h].attributeList,d)}this.carList.get(r[l].id).productCount+=Number(r[l].saleDetailQueryDTO[h].productCount),this.carList.get(r[l].id).price1=(Number(this.carList.get(r[l].id).productCount)*Number(this.carList.get(r[l].id).purchasePrice)).toFixed(2)}}else{for(var g={id:r[l].id,purchasePrice:0==this.userType?this.goodsDetail.purchasePrice:"",price:this.goodsDetail.price,price1:0,productCount:0,isNew:r[l].isNew,productId:r[l].isNew?r[l].productId:r[l].id,categoryName:r[l].categoryName,categoryId:r[l].categoryId,attrId:r[l].attrId,customerCategoryList:null!=r[l].customerCategoryRule?this.checkPriceRule(r[l].customerCategoryRule):this.getNewProductRule(),productName:r[l].productName,wholesalePrice:this.goodsDetail.wholesalePrice,lsprice:this.goodsDetail.lsprice,productPicture:r[l].productPicture,stockLogList:new Map,returnList:new Map,productSn:r[l].productSn,stockLogList1:[],productPictures:[],name:""},L=0;L<r[l].saleDetailQueryDTO.length;L++){d={productCount:Number(r[l].saleDetailQueryDTO[L].productCount),name:r[l].saleDetailQueryDTO[L].name,productNum:r[l].saleDetailQueryDTO[L].productNum};r[l].saleDetailQueryDTO.length>1?d.productCount>0&&g.stockLogList.set(r[l].saleDetailQueryDTO[L].attributeList,d):g.stockLogList.set(r[l].saleDetailQueryDTO[L].attributeList,d),g.productCount+=Number(r[l].saleDetailQueryDTO[L].productCount),g.price1=(g.productCount*Number(this.goodsDetail.purchasePrice)).toFixed(2)}this.carList.set(r[l].id,g)}r=[]}this.getAllPrice(),this.$refs.shopPopup.close(),this.allChangeNum=0,setTimeout((function(i){e.popupText="",t.hideLoading()}),500)},getNewProductRule:function(){var t=[];if(null!=this.customerCategoryList1&&""!=this.customerCategoryList1)for(var e=0;e<this.customerCategoryList1.length;e++){var i={categoryId:this.customerCategoryList1[e].categoryId,categoryName:this.customerCategoryList1[e].categoryName,categoryPrice:this.customerCategoryList1[e].categoryPrice};t.push(i)}else t=null;return t},goodsAdd:function(){this.$refs.xuankucun.open()},checkPriceRule:function(t){if(""!=this.customerCategoryList1&&null!=this.customerCategoryList1){null==t&&(t=[]);for(var e=0;e<this.customerCategoryList1.length;e++){var i=!1;if(null!=t)for(var r=0;r<t.length;r++)this.customerCategoryList1[e].categoryId==t[r].categoryId&&(i=!0);0==i&&t.push(this.customerCategoryList1[e])}}return t},close:function(){this.$refs.popup.close()},onInput:function(t){var e=this;this.textareaValue=t.detail.value,this.$nextTick((function(){var t=e.$refs.textareaRef;t.scrollTop=t.scrollHeight}))},kaishi:function(){0==this.isVoice&&(this.recordState=!0,t.vibrateShort(),h.start({duration:6e4,lang:"zh_CN"}))},jieshu:function(){h.stop((function(t){t.tempFilePath&&t.duration>1e3?console.log("有效录音"):console.log("无效录音")})),this.recordState=!1},replaceCharAfterNumber:function(t,e,i){var r=new RegExp("\\d".concat(e),"g");return t.replace(r,(function(t){return t.replace(e,i)}))},removeSpacesAndCommas:function(t){return t.replace(/[ ,,]/g,"")},initRecord:function(){var e=this,i=this;h.stop(),h.onStop=function(t){var r=e.spliceMsg(e.convertChineseToArabic(t.result));r=e.removeSpacesAndCommas(r),r=e.removePunctuationAndSpaces(r),-1!=r.indexOf("点")&&(r=i.replaceCharAfterNumber(r,"点",".")),-1!=r.indexOf(",名称")&&(r=r.replace(/,名称/g,"名称")),-1!=r.indexOf("名称,")&&(r=r.replace(/名称,/g,"名称")),-1!=r.indexOf("名称")&&(r=r.replace(/名称/g,",名称:")),-1!=r.indexOf(",单价")&&(r=r.replace(/,单价/g,"单价")),-1!=r.indexOf("单价,")&&(r=r.replace(/单价,/g,"单价")),-1!=r.indexOf("单价")&&(r=r.replace(/单价/g,",单价:")),-1!=r.indexOf(",数量")&&(r=r.replace(/,数量/g,"数量")),-1!=r.indexOf("数量,")&&(r=r.replace(/数量,/g,"数量")),-1!=r.indexOf("数量")&&(r=r.replace(/数量/g,",数量:")),-1!=r.indexOf(",批发价")&&(r=r.replace(/,批发价/g,"批发价")),-1!=r.indexOf("批发价,")&&(r=r.replace(/批发价,/g,"批发价")),-1!=r.indexOf("批发价::")&&(r=r.replace(/批发价::/g,"批发价")),-1!=r.indexOf("批发价:")&&(r=r.replace(/批发价:/g,"批发价")),-1!=r.indexOf("批发价")&&(r=r.replace(/批发价/g,",批发价:")),r.startsWith("号")&&(r="货号"+r.substr(1)),r.startsWith("货号")||(r="货号"+r),-1!=r.indexOf("货号,")&&(r=r.replace(/货号,/g,"货号")),-1!=r.indexOf("货号::")&&(r=r.replace(/货号::/g,"货号")),-1!=r.indexOf("货号:")&&(r=r.replace(/货号:/g,"货号")),-1!=r.indexOf("货号")&&(r=r.replace(/货号/g,"货号:")),r=r.replace(/[沟勾钩]/g,"J"),r=e.convertStringCorrectly(r),0==r.indexOf(",")&&(r=r.substr(1)),""==i.voiceText||null==i.voiceText?(i.voiceText=r,i.voiceText1=r):(i.voiceText+="\n"+r,i.voiceText1=r+"\n"+i.voiceText1)},h.onError=function(e){"-30011"==e.retcode&&(i.isVoice=!0),"-30004"==e.retcode&&(i.isVoice=!1,t.hideToast(),t.showToast({title:"未识别到声音信息,请重新录入",icon:"none"})),"-40001"==e.retcode&&t.showToast({title:"使用次数超限制,请联系管理员!",icon:"none"})}},clickPrice:function(t,e){this.carList.get(t).stockLogList.get(e).isShowBtn=!1,this.index=t,this.wholesalePrice=this.carList.get(this.index).wholesalePrice,this.lsprice=this.carList.get(this.index).lsprice,this.$refs.inputDialog.open()},changeReturnPay:function(t){this.returnPrice=t.detail.value},changePay1:function(t){this.isFocused=!1,this.noPay=this.shouldPay-this.alreadyPay-this.yuedikou,this.noPay=this.noPay.toFixed(2),this.leijiqiankuan=(Number(this.zhiqianqiankuan)+Number(this.yuedikou)+Number(this.noPay)).toFixed(2)},changePay:function(t){var e=this;this.linshiPrice==t?this.alreadyPay=t:Number(t)>Number(this.shouldPay)?(this.alreadyPay=this.shouldPay,setTimeout((function(t){e.tui.toast("已付金额不能大于应付金额")}),100)):""==t?this.alreadyPay=this.linshiPrice:(this.alreadyPay=t,this.shouldPay-this.alreadyPay<=Math.abs(this.zhiqianqiankuan)&&this.zhiqianqiankuan<0?this.yuedikou=this.shouldPay-this.alreadyPay:this.shouldPay-this.alreadyPay>Math.abs(this.zhiqianqiankuan)&&this.zhiqianqiankuan<0&&(this.yuedikou=Math.abs(this.zhiqianqiankuan))),this.noPay=this.shouldPay-this.alreadyPay-this.yuedikou,this.noPay=this.noPay.toFixed(2),this.leijiqiankuan=(Number(this.zhiqianqiankuan)+Number(this.yuedikou)+Number(this.noPay)).toFixed(2)},changeDis:function(t,e){this.changePriceStatus();var i=this.carList.get(e);this.linshiPrice==t.target.value?i.discount=t.target.value:t.detail.value>10?i.discount=10:t.detail.value<0?i.discount=0:""==t.detail.value?i.discount=this.linshiPrice:i.discount=t.detail.value,i.discountAmount=Number(i.unitPrice)*Number(i.discount)/10,i.discountAmount=i.discountAmount.toFixed(2),i.price=Number(i.unitPrice)*(Number(i.discount)/10)*Number(i.productCount),i.price=i.price.toFixed(2),this.getAllPrice()},delCarData:function(t){this.temporaryList.splice(t,1),this.temporaryChange()},delReturnCarData:function(t){this.temporaryReturnList.splice(t,1),this.temporaryReturnChange()},delShop:function(e){var i=this;t.showModal({title:"提示",content:"确定删除此条商品吗?",success:function(r){t.showLoading({title:"加载中..."}),r.confirm&&(1==i.carList.has(e)&&i.carList.delete(e),i.$forceUpdate(),i.getAmountAndWho()),setTimeout((function(e){t.hideLoading()}),500)}})},delShopSpec:function(e,i){var r=this;this.carList.get(e).stockLogList.get(i).isShowBtn=!1,t.showModal({title:"提示",content:"确定删除此条规格吗?",success:function(t){if(t.confirm){1==r.carList.get(e).stockLogList.size?r.carList.get(e).productCount=Number(r.carList.get(e).stockLogList.get(i).productCount):r.carList.get(e).productCount-=Number(r.carList.get(e).stockLogList.get(i).productCount);Number(r.carList.get(e).stockLogList.get(i).productCount);r.carList.get(e).stockLogList.delete(i),r.carList.get(e).price1=(Number(r.carList.get(e).productCount)*Number(r.carList.get(e).purchasePrice)).toFixed(2),0==r.carList.get(e).stockLogList.size&&r.carList.delete(e),r.getAllPrice()}r.$forceUpdate()}})},delProductSpec:function(e,i){var r=this;this.carList.get(e).stockLogList.get(i).isShowBtn=!1,t.showModal({title:"提示",content:"确定删除此条商品吗?",success:function(t){t.confirm&&(r.carList.delete(e),r.getAllPrice()),r.$forceUpdate()}})},getAllPrice:function(){var t=this,e=this;this.shouldPay=0,this.totalAmount=0,e.leijiqiankuan=0,e.yuedikou=0,this.carList.forEach((function(t,i){e.shouldPay=e.shouldPay+Number(t.price1),e.totalAmount=e.totalAmount+Number(t.productCount)})),this.$nextTick((function(){parseFloat(e.zhiqianqiankuan)<0?e.shouldPay>Math.abs(e.zhiqianqiankuan)?(e.yuedikou=Math.abs(e.zhiqianqiankuan),t.alreadyPay=t.shouldPay-Math.abs(e.zhiqianqiankuan)):e.shouldPay<=Math.abs(e.zhiqianqiankuan)&&(e.yuedikou=e.shouldPay,e.alreadyPay=0):t.alreadyPay=t.shouldPay,e.shouldPay=Number(e.shouldPay).toFixed(2),e.noPay=t.shouldPay-(""==t.alreadyPay?0:t.alreadyPay)-e.yuedikou,e.noPay=e.noPay.toFixed(2),t.leijiqiankuan=(Number(t.zhiqianqiankuan)+Number(t.yuedikou)+Number(t.noPay)).toFixed(2),t.$forceUpdate()}))},clearAll:function(){var e=this;t.showModal({title:"提示",content:"确定清空全部数据吗?",success:function(i){t.showLoading({title:"加载中..."}),i.confirm&&(e.carList.clear(),e.remark="",e.index="",e.priceType="",e.radioType="2",e.lunbocurrent=4,e.discountType="",e.discountCurrent="3",e.temporaryList=[],e.returnPay=0,e.qiankuandikou=0,e.yuedikou=0,e.leijiqiankuan=0,e.purchasePrice=0,e.zPrice=0,e.zNum=0,e.shouldPay=0,e.getMonth(),e.$emit("update:khName",[]),e.relPrice=0,e.priceOk=0,e.noPay=0,e.otherExpense=0,e.totalAmount=0,e.returnTotalAmount=0,e.saleId="",e.priceCurrent=null,e.$forceUpdate()),setTimeout((function(e){t.hideLoading()}),500)}})}}};e.default=g}).call(this,i("df3c")["default"])},"9bcf":function(t,e,i){"use strict";i.r(e);var r=i("9e18"),s=i("d624");for(var a in s)["default"].indexOf(a)<0&&function(t){i.d(e,t,(function(){return s[t]}))}(a);i("f0d0");var o=i("828b"),u=Object(o["a"])(s["default"],r["b"],r["c"],!1,null,null,null,!1,r["a"],void 0);e["default"]=u.exports},"9e18":function(t,e,i){"use strict";i.d(e,"b",(function(){return s})),i.d(e,"c",(function(){return a})),i.d(e,"a",(function(){return r}));var r={uniIcons:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uni-icons/components/uni-icons/uni-icons")]).then(i.bind(null,"d3ec"))},uniDatetimePicker:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker")]).then(i.bind(null,"4902"))},uKeyboard:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uview-ui/components/u-keyboard/u-keyboard")]).then(i.bind(null,"74df"))},uniPopup:function(){return i.e("uni_modules/uni-popup/components/uni-popup/uni-popup").then(i.bind(null,"4d18"))},uniEasyinput:function(){return i.e("uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput").then(i.bind(null,"bc9c"))}},s=function(){var t=this,e=t.$createElement,i=(t._self._c,t.faBookShow?t.sreachList.length:null),r=t.__map(Array.from(t.carList),(function(e,i){var r=t.__get_orig(e),s=t.__map(Array.from(e[1].stockLogList),(function(i,r){var s=t.__get_orig(i),a=e[1].isNew&&i[1].isShowBtn&&""!=e[1].productPictures?e[1].productPictures.length:null,o=e[1].isNew?t.numData(i[0]):null,u=e[1].isNew?t.numData(i[0]):null,c=e[1].isNew?((null==e[1].purchasePrice||""==e[1].purchasePrice||void 0==e[1].purchasePrice?0:e[1].purchasePrice)*i[1].productCount).toFixed(2):null,n=e[1].isNew?null:t.numData(i[0]),d=e[1].isNew?null:t.numData(i[0]),l=e[1].isNew?null:((null==e[1].purchasePrice||""==e[1].purchasePrice||void 0==e[1].purchasePrice?0:e[1].purchasePrice)*i[1].productCount).toFixed(2);return{$orig:s,g1:a,m0:o,m1:u,g2:c,m2:n,m3:d,g3:l}}));return{$orig:r,l0:s}})),s=t.zhiqianqiankuan<0?Math.abs(t.zhiqianqiankuan):null,a=t.noPay<0&&0==t.userType?Math.abs(t.noPay):null,o=t.noPay<0&&0==t.userType?Math.abs(t.noPay):null,u=t.leijiqiankuan<0&&0==t.userType?Math.abs(t.leijiqiankuan):null,c=t.leijiqiankuan<0&&0==t.userType?Math.abs(t.leijiqiankuan):null,n=t.goodsDetail!=[]?t.__map(t.goodsDetail.attributeList.newYanSeList,(function(e,i){var r=t.__get_orig(e),s=JSON.stringify(i),a=t.__map(e.value,(function(e,i){var r=t.__get_orig(e),s=JSON.stringify(i);return{$orig:r,g10:s}}));return{$orig:r,g9:s,l2:a}})):null,d=t.snList.length,l=t.snList.length;t._isMounted||(t.e0=function(e){t.faBookShow=!1},t.e1=function(e,i,r){var s=arguments[arguments.length-1].currentTarget.dataset,a=s.eventParams||s["event-params"];i=a.value,r=a.values;return e.stopPropagation(),t.closeMask1(i[0],r[0])},t.e2=function(e,i){var r=arguments[arguments.length-1].currentTarget.dataset,s=r.eventParams||r["event-params"];i=s.value;return t.uploadFilePromise(i)},t.e3=function(e,i){var r=arguments[arguments.length-1].currentTarget.dataset,s=r.eventParams||r["event-params"];i=s.value;return t.uploadFilePromise(i)},t.e4=function(e,i){var r=arguments[arguments.length-1].currentTarget.dataset,s=r.eventParams||r["event-params"];i=s.value;return t.uploadFilePromise(i)},t.e5=function(e,i){var r=arguments[arguments.length-1].currentTarget.dataset,s=r.eventParams||r["event-params"];i=s.value;return t.getZhuBigImage(i[1].productPicture)},t.e6=function(e,i,r){var s=arguments[arguments.length-1].currentTarget.dataset,a=s.eventParams||s["event-params"];i=a.value,r=a.values;return t.changeShowBtn(i[0],r[0])},t.e7=function(e,i,r){var s=arguments[arguments.length-1].currentTarget.dataset,a=s.eventParams||s["event-params"];i=a.value,r=a.values;return e.stopPropagation(),t.delShopSpec(i[0],r[0])},t.e8=function(e,i,r){var s=arguments[arguments.length-1].currentTarget.dataset,a=s.eventParams||s["event-params"];i=a.value,r=a.values;return e.stopPropagation(),t.delProductSpec(i[0],r[0])},t.e9=function(e,i,r){var s=arguments[arguments.length-1].currentTarget.dataset,a=s.eventParams||s["event-params"];i=a.value,r=a.values;return e.stopPropagation(),t.delShopSpec(i[0],r[0])},t.e10=function(e,i,r){var s=arguments[arguments.length-1].currentTarget.dataset,a=s.eventParams||s["event-params"];i=a.value,r=a.values;return t.toggle("oneGoods",i[0],r[0])},t.e11=function(e,i){var r=arguments[arguments.length-1].currentTarget.dataset,s=r.eventParams||r["event-params"];i=s.value;return t.AiAddSpec(i[1],i[0],1)},t.e12=function(e,i,r){var s=arguments[arguments.length-1].currentTarget.dataset,a=s.eventParams||s["event-params"];i=a.value,r=a.values;return t.pictureAdd(i[0],"",r[0])},t.e13=function(e,i){var r=arguments[arguments.length-1].currentTarget.dataset,s=r.eventParams||r["event-params"];i=s.value;return t.getName(e,i[0])},t.e14=function(e,i){var r=arguments[arguments.length-1].currentTarget.dataset,s=r.eventParams||r["event-params"];i=s.value;return e=e.target.value,t.__set_model(i[1],"productName",e,[])},t.e15=function(e){t.newProductId=""},t.e16=function(e,i){var r=arguments[arguments.length-1].currentTarget.dataset,s=r.eventParams||r["event-params"];i=s.value;return e=e.target.value,t.__set_model(i[1],"productSn",e,[])},t.e17=function(e,i){var r=arguments[arguments.length-1].currentTarget.dataset,s=r.eventParams||r["event-params"];i=s.value;return t.sninput(e,i[0])},t.e18=function(e,i){var r=arguments[arguments.length-1].currentTarget.dataset,s=r.eventParams||r["event-params"];i=s.value;return t.getSnIsRepeat(e,i[0])},t.e19=function(e,i){var r=arguments[arguments.length-1].currentTarget.dataset,s=r.eventParams||r["event-params"];i=s.value;return t.getOneId(i[0])},t.e20=function(e,i,r){var s=arguments[arguments.length-1].currentTarget.dataset,a=s.eventParams||s["event-params"];i=a.value,r=a.values;t.checkSpec("颜色",i[0],r[0],t.numData(r[0])[0])},t.e21=function(e,i,r){var s=arguments[arguments.length-1].currentTarget.dataset,a=s.eventParams||s["event-params"];i=a.value,r=a.values;t.checkSpec("尺码",i[0],r[0],t.numData(r[0])[1])},t.e22=function(e,i,r){var s=arguments[arguments.length-1].currentTarget.dataset,a=s.eventParams||s["event-params"];i=a.value,r=a.values;return t.mapnumChange(e,i[0],r[0])},t.e23=function(e,i,r){var s=arguments[arguments.length-1].currentTarget.dataset,a=s.eventParams||s["event-params"];i=a.value,r=a.values;return t.obtainPrice(e,"mapdanjishu",i[0],r[0])},t.e24=function(e,i){var r=arguments[arguments.length-1].currentTarget.dataset,s=r.eventParams||r["event-params"];i=s.values;return e=e.target.value,t.__set_model(i[1],"productCount",e,[])},t.e25=function(e,i){var r=arguments[arguments.length-1].currentTarget.dataset,s=r.eventParams||r["event-params"];i=s.value;return t.clickCollapse1(e,i[0])},t.e26=function(e,i){var r=arguments[arguments.length-1].currentTarget.dataset,s=r.eventParams||r["event-params"];i=s.value;return t.obtainPrice(e,"danjia",i[0])},t.e27=function(e,i){var r=arguments[arguments.length-1].currentTarget.dataset,s=r.eventParams||r["event-params"];i=s.value;return e=e.target.value,t.__set_model(i[1],"purchasePrice",e,[])},t.e28=function(e,i){var r=arguments[arguments.length-1].currentTarget.dataset,s=r.eventParams||r["event-params"];i=s.value;return t.PriceAndWho1(e,i[0],"pi")},t.e29=function(e,i){var r=arguments[arguments.length-1].currentTarget.dataset,s=r.eventParams||r["event-params"];i=s.value;return t.obtainPrice(e,"pifa",i[0])},t.e30=function(e,i){var r=arguments[arguments.length-1].currentTarget.dataset,s=r.eventParams||r["event-params"];i=s.value;return e=e.target.value,t.__set_model(i[1],"wholesalePrice",e,[])},t.e31=function(e,i){var r=arguments[arguments.length-1].currentTarget.dataset,s=r.eventParams||r["event-params"];i=s.value;return t.PriceAndWho1(e,i[0])},t.e32=function(e,i){var r=arguments[arguments.length-1].currentTarget.dataset,s=r.eventParams||r["event-params"];i=s.value;return t.obtainPrice(e,"lingshou",i[0])},t.e33=function(e,i){var r=arguments[arguments.length-1].currentTarget.dataset,s=r.eventParams||r["event-params"];i=s.value;return e=e.target.value,t.__set_model(i[1],"lsprice",e,[])},t.e34=function(e,i){var r=arguments[arguments.length-1].currentTarget.dataset,s=r.eventParams||r["event-params"];i=s.value;return t.toggle("typePopup",i[0])},t.e35=function(e,i){var r=arguments[arguments.length-1].currentTarget.dataset,s=r.eventParams||r["event-params"];i=s.value;return t.uploadFilePromise(i)},t.e36=function(e,i){var r=arguments[arguments.length-1].currentTarget.dataset,s=r.eventParams||r["event-params"];i=s.value;return t.getZhuBigImage(i[1].productPicture)},t.e37=function(e,i){var r=arguments[arguments.length-1].currentTarget.dataset,s=r.eventParams||r["event-params"];i=s.value;return t.uploadFilePromise(i)},t.e38=function(e,i){var r=arguments[arguments.length-1].currentTarget.dataset,s=r.eventParams||r["event-params"];i=s.value;return t.uploadFilePromise(i)},t.e39=function(e,i,r){var s=arguments[arguments.length-1].currentTarget.dataset,a=s.eventParams||s["event-params"];i=a.value,r=a.values;return t.changeShowBtn(i[0],r[0])},t.e40=function(e,i,r){var s=arguments[arguments.length-1].currentTarget.dataset,a=s.eventParams||s["event-params"];i=a.value,r=a.values;return e.stopPropagation(),t.delShopSpec(i[0],r[0])},t.e41=function(e,i,r){var s=arguments[arguments.length-1].currentTarget.dataset,a=s.eventParams||s["event-params"];i=a.value,r=a.values;return e.stopPropagation(),t.delProductSpec(i[0],r[0])},t.e42=function(e,i,r){var s=arguments[arguments.length-1].currentTarget.dataset,a=s.eventParams||s["event-params"];i=a.value,r=a.values;return e.stopPropagation(),t.delShopSpec(i[0],r[0])},t.e43=function(e,i,r){var s=arguments[arguments.length-1].currentTarget.dataset,a=s.eventParams||s["event-params"];i=a.value,r=a.values;return t.toggle("oneGoods",i[0],r[0])},t.e44=function(e,i){var r=arguments[arguments.length-1].currentTarget.dataset,s=r.eventParams||r["event-params"];i=s.value;return t.AiAddSpec(i[1],i[0],1)},t.e45=function(e,i,r){var s=arguments[arguments.length-1].currentTarget.dataset,a=s.eventParams||s["event-params"];i=a.value,r=a.values;t.checkSpec("颜色",i[0],r[0],t.numData(r[0])[0])},t.e46=function(e,i,r){var s=arguments[arguments.length-1].currentTarget.dataset,a=s.eventParams||s["event-params"];i=a.value,r=a.values;t.checkSpec("尺码",i[0],r[0],t.numData(r[0])[1])},t.e47=function(e,i,r){var s=arguments[arguments.length-1].currentTarget.dataset,a=s.eventParams||s["event-params"];i=a.value,r=a.values;return t.obtainPrice(e,"mapdanjishu",i[0],r[0])},t.e48=function(e,i){var r=arguments[arguments.length-1].currentTarget.dataset,s=r.eventParams||r["event-params"];i=s.values;return e=e.target.value,t.__set_model(i[1],"productCount",e,[])},t.e49=function(e,i){var r=arguments[arguments.length-1].currentTarget.dataset,s=r.eventParams||r["event-params"];i=s.value;return t.obtainPrice(e,"danjia",i[0])},t.e50=function(e,i){var r=arguments[arguments.length-1].currentTarget.dataset,s=r.eventParams||r["event-params"];i=s.value;return e=e.target.value,t.__set_model(i[1],"purchasePrice",e,[])},t.e51=function(e,i){var r=arguments[arguments.length-1].currentTarget.dataset,s=r.eventParams||r["event-params"];i=s.value;return t.obtainPrice(e,"pifa",i[0])},t.e52=function(e,i){var r=arguments[arguments.length-1].currentTarget.dataset,s=r.eventParams||r["event-params"];i=s.value;return e=e.target.value,t.__set_model(i[1],"wholesalePrice",e,[])},t.e53=function(e,i){var r=arguments[arguments.length-1].currentTarget.dataset,s=r.eventParams||r["event-params"];i=s.value;return t.obtainPrice(e,"lingshou",i[0])},t.e54=function(e,i){var r=arguments[arguments.length-1].currentTarget.dataset,s=r.eventParams||r["event-params"];i=s.value;return e=e.target.value,t.__set_model(i[1],"lsprice",e,[])},t.e55=function(e){return t.$refs.addGateDialog.close()},t.e56=function(e){t.isChangeHeight=!0},t.e57=function(e){t.isChangeHeight=!1}),t.$mp.data=Object.assign({},{$root:{g0:i,l1:r,g4:s,g5:a,g6:o,g7:u,g8:c,l3:n,g11:d,g12:l}})},a=[]},a0fd:function(t,e,i){},d624:function(t,e,i){"use strict";i.r(e);var r=i("966c"),s=i.n(r);for(var a in r)["default"].indexOf(a)<0&&function(t){i.d(e,t,(function(){return r[t]}))}(a);e["default"]=s.a},f0d0:function(t,e,i){"use strict";var r=i("a0fd"),s=i.n(r);s.a}},[["83a9","common/runtime","common/vendor"]]]);