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
133 KiB

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["package1/AI/voiceInventory"],{"0e8c":function(t,e,r){"use strict";r.r(e);var i=r("268c"),s=r.n(i);for(var c in i)["default"].indexOf(c)<0&&function(t){r.d(e,t,(function(){return i[t]}))}(c);e["default"]=s.a},"268c":function(t,e,r){"use strict";(function(t){var i=r("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var s=i(r("7eb4")),c=i(r("af34")),a=i(r("ee10")),o=r("8f59"),u=r("072a"),n=i(r("b9aa")),d=requirePlugin("WechatSI"),g=d.getRecordRecognitionManager(),l={computed:(0,o.mapState)(["shopName"]),data:function(){return{isVoice:!1,allChangeNum:0,voiceText:"",voiceText1:"",khName:[],isChangeHeight:!1,carList:new Map,remark:"",voiceGetOneData:!1,otherPay:"",noPay:0,promptImg:"",customerCategoryList:[],customerCategoryList1:[],alreadyPay:"",realAmount:0,shouldPay:"",userType:"",totalAmount:0,customTypeId:"",index:"",index1:"",recordState:!1,goodsDetail:[],temporaryList:[],zNum:0,snList:[],carList1:[],zhuImg:"",zhuImgList:[],productNum:null,prefixRule:"",numRule:"",yuedikou:0,isChangePriceOk:!1,leijiqiankuan:0,productId:"",oneGoodsId:"",showTan:!1,currentPopupIndex:0,moreData:[],goodsId:"",pageOldTemList:[],oldTemList:[],attrList:[],goodsList:[],mergeId:"",newTemList:[],pecsList:[],single:"",childrenId:"",isGenerateSnRadio:1,productPictures:[],categoryText:"",dataObj:new Map,isPlusAndMinus:!1,indexList:[],evalue:[],attributeValue:[],specifications:"",current:0,swiperDotIndex:0,zhiqianqiankuan: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}]}],temporary:[]}},filters:{sliceMsg:function(t){var e="";if("string"==typeof t){var r=JSON.parse(t);for(var i in r)e+=r[i]+"/"}return e}},onShow: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("您未授权,图片上传功能可能会出现错误")}}),t.showLoading({title:"加载中..."});var r=this,i=!1;if(1==this.merge)return this.$refs.mergePopup.close(),1==this.carList.has(this.carList1.id)?r.carList.get(r.mergeId).stockLogList.forEach((function(t,e){r.carList.get(r.carList1.id).stockLogList.forEach((function(s,c){e==c&&r.mergeId!=r.carList1.id&&(r.carList.get(r.carList1.id).stockLogList.get(c).productCount=Number(r.carList.get(r.carList1.id).stockLogList.get(c).productCount)+Number(t.productCount),i=!0,r.carList.get(r.carList1.id).productCount+=Number(t.productCount))})),0==i&&(r.carList.get(r.carList1.id).stockLogList.set(e,t),r.carList.get(r.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),r.carList.get(r.carList1.id).price1=Number(r.carList.get(r.carList1.id).productCount)*r.carList.get(r.carList1.id).purchasePrice,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&&(i=!0),""!=t.getStorageSync("khName")?this.khName=JSON.parse(t.getStorageSync("khName")):this.khName=JSON.parse(JSON.stringify(this.khName))||"",""!=this.khName&&(null!=this.khName.noEarn&&this.zhiqianqiankuan!=this.khName.noEarn&&(i=!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 c={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:[]},a=0;a<this.carList1[s].saleDetailQueryDTO.length;a++){var o=Number(this.carList1[s].saleDetailQueryDTO[a].productCount);1==c.stockLogList.has(this.carList1[s].saleDetailQueryDTO[a].attributeList)&&(o+=Number(c.stockLogList.get(this.carList1[s].saleDetailQueryDTO[a].attributeList).productCount));var u={productCount:o,name:this.carList1[s].saleDetailQueryDTO[a].name,productNum:this.carList1[s].saleDetailQueryDTO[a].productNum};c.stockLogList.set(this.carList1[s].saleDetailQueryDTO[a].attributeList,u),c.productCount+=null==this.carList1[s].saleDetailQueryDTO[a].productCount?0:Number(this.carList1[s].saleDetailQueryDTO[a].productCount),c.price1=Number(c.productCount)*this.carList1[s].purchasePrice}var n=1==this.carList1[s].isNew?this.carList1[s].id:this.carList1[s].productId;this.carList.set(n,c)}this.carList1=[]}else for(var d=0;d<this.carList1.length;d++){var g=1==this.carList1[d].isNew?this.carList1[d].id:this.carList1[d].productId;if(1==this.carList.has(this.carList1[d].id))for(var l=0;l<this.carList1[d].saleDetailQueryDTO.length;l++){if(1==this.carList.get(this.carList1[d].id).stockLogList.has(this.carList1[d].saleDetailQueryDTO[l].attributeList)){u={productCount:Number(this.carList.get(this.carList1[d].id).stockLogList.get(this.carList1[d].saleDetailQueryDTO[l].attributeList).productCount)+Number(this.carList1[d].saleDetailQueryDTO[l].productCount),name:this.carList1[d].saleDetailQueryDTO[l].name,productNum:this.carList1[d].saleDetailQueryDTO[l].productNum};this.carList.get(this.carList1[d].id).stockLogList.set(this.carList1[d].saleDetailQueryDTO[l].attributeList,u)}else{u={productCount:Number(this.carList1[d].saleDetailQueryDTO[l].productCount),name:this.carList1[d].saleDetailQueryDTO[l].name,productNum:this.carList1[d].saleDetailQueryDTO[l].productNum};this.carList.get(this.carList1[d].id).stockLogList.set(this.carList1[d].saleDetailQueryDTO[l].attributeList,u)}this.carList.get(this.carList1[d].id).productCount+=null==this.carList1[d].saleDetailQueryDTO[l].productCount?0:Number(this.carList1[d].saleDetailQueryDTO[l].productCount),this.carList.get(this.carList1[d].id).price1=Number(this.carList.get(this.carList1[d].id).productCount)*this.carList.get(this.carList1[d].id).purchasePrice}else{for(var p={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++){u={productCount:Number(this.carList1[d].saleDetailQueryDTO[L].productCount),name:this.carList1[d].saleDetailQueryDTO[L].name,productNum:this.carList1[d].saleDetailQueryDTO[L].productNum};p.stockLogList.set(this.carList1[d].saleDetailQueryDTO[L].attributeList,u),p.name=this.carList1[d].saleDetailQueryDTO[L].name,p.productCount+=null==this.carList1[d].saleDetailQueryDTO[L].productCount?0:Number(this.carList1[d].saleDetailQueryDTO[L].productCount),p.price1=Number(p.productCount)*this.carList1[d].purchasePrice}this.carList.set(g,p)}}this.$nextTick((function(){e.carList1=[],t.removeStorageSync("carList1"),t.removeStorageSync("khName"),t.removeStorageSync("hangOrder"),i&&e.getAllPrice(),""!=e.carList1?setTimeout((function(e){t.hideLoading()}),2e3):setTimeout((function(e){t.hideLoading()}),300),e.$forceUpdate()}))},onLoad:function(e){this.userType=t.getStorageSync("type"),this.getSnList(),this.getShopCategory(),this.getCustomerCategoryList(),this.getDefaultCategory(),this.getMonth()},methods:{uploadFile:function(){var e=this;t.chooseMedia({count:1,mediaType:["image"],sourceType:["album"],camera:"back",success:function(r){t.compressImage({src:r.tempFiles[0].tempFilePath,quality:50,success:function(r){t.uploadFile({url:e.tui.interfaceUrl()+"/upload/file",filePath:r.tempFilePath,name:"file",header:{"content-type":"multipart/form-data",accessToken:e.tui.getToken()},formData:{},success:function(t){var r=JSON.parse(t.data);e.promptImg=r.result,e.$forceUpdate()}})}})}})},getMonth:function(){var t=new Date,e=t.getFullYear().toString(),r=t.getMonth()+1<10?"0"+(t.getMonth()+1).toString():(t.getMonth()+1).toString(),i=t.getDate()<10?"0"+t.getDate().toString():t.getDate().toString();this.single=e+"-"+r+"-"+i},getShopCategory:function(){var t=this;this.tui.request("/app/productCategory/getCategoryOfshop","POST",{},!1,!0).then((function(e){if(200==e.code){if(t.specifiList=e.result.productAttributeOfAddVos,"尺码"==t.specifiList[0].attributeName)for(var r=function(e){for(var r=!0,i=0;i<t.defaultList[1].value.length;i++)t.defaultList[1].value[i].value==t.specifiList[0].productAttributeValueVoList[e].value&&(r=!1);t.$nextTick((function(){r&&t.defaultList[1].value.push(t.specifiList[0].productAttributeValueVoList[e])}))},i=0;i<t.specifiList[0].productAttributeValueVoList.length;i++)r(i);else for(var s=function(e){for(var r=!0,i=0;i<t.defaultList[0].value.length;i++)t.defaultList[0].value[i].value==t.specifiList[0].productAttributeValueVoList[e].value&&(r=!1);t.$nextTick((function(){r&&t.defaultList[0].value.push(t.specifiList[0].productAttributeValueVoList[e])}))},c=0;c<t.specifiList[0].productAttributeValueVoList.length;c++)s(c);if("尺码"==t.specifiList[1].attributeName)for(var a=function(e){for(var r=!0,i=0;i<t.defaultList[1].value.length;i++)t.defaultList[1].value[i].value==t.specifiList[1].productAttributeValueVoList[e].value&&(r=!1);t.$nextTick((function(){r&&t.defaultList[1].value.push(t.specifiList[1].productAttributeValueVoList[e])}))},o=0;o<t.specifiList[1].productAttributeValueVoList.length;o++)a(o);else for(var u=function(e){for(var r=!0,i=0;i<t.defaultList[0].value.length;i++)t.defaultList[0].value[i].value==t.specifiList[1].productAttributeValueVoList[e].value&&(r=!1);t.$nextTick((function(){r&&t.defaultList[0].value.push(t.specifiList[1].productAttributeValueVoList[e])}))},n=0;n<t.specifiList[1].productAttributeValueVoList.length;n++)u(n)}else t.tui.toast(e.message)})).catch((function(t){}))},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 r=0;r<t.result.length;r++){var i={categoryName:t.result[r].categoryName,categoryId:t.result[r].id,categoryPrice:""};e.customerCategoryList[r]=i,e.customerCategoryList1[r]=i}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){}))},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 r=0;r<e.result.length;r++){var i={text:"前缀:"+e.result[r].snPre+",位数:"+e.result[r].snSufLength,value:e.result[r].snPre};t.snList.push(i)}t.snName=e.result[0].snPre}}else t.tui.toast(res.message);t.$forceUpdate()})).catch((function(t){}))},startGetSn:function(){var e=this,r=this;t.showLoading({title:"加载中...",mask:!0}),r.$refs.SNDialog.close(),""!=this.prefixRule?""!=this.numRule?(this.tui.request("/app/productSn/addAndGetNewProductSn","POST",{snPre:this.prefixRule,snSufLength:this.numRule},!1,!1).then((function(i){if(200==i.code)if("货号前缀已存在!"==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("成功"),r.prefixRule="",r.numRule="",setTimeout((function(t){r.getSnList()}),1e3)):r.tui.toast(t.message),r.$forceUpdate()})).catch((function(t){}))}});else{if(r.zhuImgList!=[]&&r.zhuImgList.length>0){for(var s=0;s<r.zhuImgList.length;s++)r.upLoadFile(r.zhuImgList[s],s+1);setTimeout((function(t){r.zhuImgList=[]}),2e3)}else e.addPageGoods(e.zhuImg,i.result);r.getSnList()}else e.tui.toast(res.message)})).catch((function(t){})),this.$nextTick((function(){t.hideLoading()}))):this.tui.toast("请输入货号生成位数规则"):this.tui.toast("请输入货号生成前缀规则")},generateSn:function(t){var e=this;this.snList.length>0?this.tui.request("/app/productSn/getNewProductSn","POST",{snPre:this.snName},!1,!0).then((function(r){200==r.code?e.tui.request("/app/product/getByProductSn","post",{productSn:r.result},!1,!0).then((function(i){200==i.code&&(""!=i.result?e.generateSn(value):(e.carList.get(t).productSn=r.result,e.$forceUpdate()))})):e.tui.toast(res.message)})).catch((function(t){})):(this.zhuImg="",this.$refs.SNDialog.open("center"))},addSn:function(){this.$refs.SNDialog.open("center")},AiVoice:function(){var e=this;if(0==this.carList.size){for(var r=0;r<this.carList1.length;r++){for(var i={purchasePrice:0==this.userType?this.carList1[r].purchasePrice:"",price1:0,price:this.carList1[r].price,productCount:0,customerCategoryList:null!=this.carList1[r].customerCategoryList?this.carList1[r].customerCategoryList:this.getNewProductRule(),id:null!=this.carList1[r].productId?this.carList1[r].productId:this.carList1[r].id,isNew:this.carList1[r].isNew,productId:null==this.carList1[r].productId?"":this.carList1[r].productId,productName:this.carList1[r].productName,wholesalePrice:this.carList1[r].wholesalePrice||0,categoryName:this.carList1[r].categoryName,categoryId:this.carList1[r].categoryId,attrId:this.carList1[r].attrId,lsprice:this.carList1[r].price||0,productPicture:this.carList1[r].productPicture,productSn:this.carList1[r].productSn,stockLogList:new Map,productPictures:[],stockLogList1:[]},s=0;s<this.carList1[r].saleDetailQueryDTO.length;s++){var c=Number(this.carList1[r].saleDetailQueryDTO[s].productCount);1==i.stockLogList.has(this.carList1[r].saleDetailQueryDTO[s].attributeList)&&(c+=Number(i.stockLogList.get(this.carList1[r].saleDetailQueryDTO[s].attributeList).productCount));var a={productCount:c,name:this.carList1[r].saleDetailQueryDTO[s].name,productNum:this.carList1[r].saleDetailQueryDTO[s].productNum};i.stockLogList.set(this.carList1[r].saleDetailQueryDTO[s].attributeList,a),i.productCount+=null==this.carList1[r].saleDetailQueryDTO[s].productCount?0:Number(this.carList1[r].saleDetailQueryDTO[s].productCount),i.price1=Number(i.productCount)*this.carList1[r].purchasePrice}var o=1==this.carList1[r].isNew?this.carList1[r].id:this.carList1[r].productId;this.carList.set(o,i)}this.carList1=[]}else for(var u=0;u<this.carList1.length;u++){var n=1==this.carList1[u].isNew?this.carList1[u].id:this.carList1[u].productId;if(1==this.carList.has(this.carList1[u].id)){""==this.carList.get(this.carList1[u].id).purchasePrice&&(this.carList.get(this.carList1[u].id).purchasePrice=this.carList1[u].purchasePrice);for(var d=0;d<this.carList1[u].saleDetailQueryDTO.length;d++){if(1==this.carList.get(this.carList1[u].id).stockLogList.has(this.carList1[u].saleDetailQueryDTO[d].attributeList)){a={productCount:Number(this.carList.get(this.carList1[u].id).stockLogList.get(this.carList1[u].saleDetailQueryDTO[d].attributeList).productCount)+Number(this.carList1[u].saleDetailQueryDTO[d].productCount),name:this.carList1[u].saleDetailQueryDTO[d].name,productNum:this.carList1[u].saleDetailQueryDTO[d].productNum};this.carList.get(this.carList1[u].id).stockLogList.set(this.carList1[u].saleDetailQueryDTO[d].attributeList,a)}else{a={productCount:Number(this.carList1[u].saleDetailQueryDTO[d].productCount),name:this.carList1[u].saleDetailQueryDTO[d].name,productNum:this.carList1[u].saleDetailQueryDTO[d].productNum};this.carList.get(this.carList1[u].id).stockLogList.set(this.carList1[u].saleDetailQueryDTO[d].attributeList,a)}this.carList.get(this.carList1[u].id).productCount+=null==this.carList1[u].saleDetailQueryDTO[d].productCount?0:Number(this.carList1[u].saleDetailQueryDTO[d].productCount),this.carList.get(this.carList1[u].id).price1=Number(this.carList.get(this.carList1[u].id).productCount)*this.carList.get(this.carList1[u].id).purchasePrice}}else{for(var g={purchasePrice:0==this.userType?this.carList1[u].purchasePrice:"",price1:0,price:this.carList1[u].price,productCount:0,customerCategoryList:null!=this.carList1[u].customerCategoryList?this.carList1[u].customerCategoryList:this.getNewProductRule(),id:null!=this.carList1[u].productId?this.carList1[u].productId:this.carList1[u].id,productId:null==this.carList1[u].productId?"":this.carList1[u].productId,isNew:this.carList1[u].isNew,productName:this.carList1[u].productName,wholesalePrice:this.carList1[u].wholesalePrice||0,categoryName:this.carList1[u].categoryName,categoryId:this.carList1[u].categoryId,attrId:this.carList1[u].attrId,lsprice:this.carList1[u].price||0,productPicture:this.carList1[u].productPicture,productSn:this.carList1[u].productSn,stockLogList:new Map,stockLogList1:[],productPictures:[],name:""},l=0;l<this.carList1[u].saleDetailQueryDTO.length;l++){a={productCount:Number(this.carList1[u].saleDetailQueryDTO[l].productCount),name:this.carList1[u].saleDetailQueryDTO[l].name,productNum:this.carList1[u].saleDetailQueryDTO[l].productNum};g.stockLogList.set(this.carList1[u].saleDetailQueryDTO[l].attributeList,a),g.name=this.carList1[u].saleDetailQueryDTO[l].name,g.productCount+=null==this.carList1[u].saleDetailQueryDTO[l].productCount?0:Number(this.carList1[u].saleDetailQueryDTO[l].productCount),g.price1=Number(g.productCount)*this.carList1[u].purchasePrice}this.carList.set(n,g)}}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()}))},numData:function(t){var e=[];if("string"==typeof t){var r=JSON.parse(t);for(var i in r)e.push(r[i])}return e},checkSpec:function(t,e,r,i){if(""!=this.carList.get(e).categoryId&&null!=this.carList.get(e).categoryId){this.temporary=[e,r,t,i];this.getGategoryLowList()}else this.tui.toast("请先选择商品分类")},getScanCodeCategroyId:function(t){t="颜色"==t?0:1,this.isOpenId=t,this.goodsId=this.goodsDetail.id,this.$refs.inputDialog.open("bottom"),this.isBottom=!0},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(r){200==r.code?(t.attrList.push(r.result[e]),r.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.specifications=this.temporary[3],this.$refs.getaPopup.open()},sliceMsg:function(t){var e="";if("string"==typeof t){var r=JSON.parse(t);for(var i in r)e+=r[i]+"/"}return e},changeSpec:function(t){var e=this;return(0,a.default)(s.default.mark((function r(){var i,c,a;return s.default.wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(i=e,""!=t){r.next=4;break}return e.tui.toast("请输入要修改的规格值"),r.abrupt("return");case 4:return c=e.temporary,a=new Map,r.next=8,e.carList.get(c[0]).stockLogList.forEach((function(e,r){if("颜色"==c[2])if(i.numData(r)[0]==c[3]){var s=r.replace(c[3],t);1==a.has(s)?(c[1]=s,a.get(s).name=i.sliceMsg(s),a.get(s).productCount+=Number(e.productCount)):(c[1]=s,a.set(s,e),a.get(s).name=i.sliceMsg(s)),1!=i.carList.get(c[0]).isNew&&i.tui.request("/app/stock/productCount","post",{productId:i.carList.get(c[0]).productId,attributeList:s},!1,!0).then((function(t){200==t.code?(e.productNum=t.result,i.$forceUpdate()):i.tui.toast(t.message)})).catch((function(t){}))}else 1==a.has(r)?a.get(r).productCount+=Number(e.productCount):(a.set(r,e),a.get(r).name=i.sliceMsg(r));else if("尺码"==c[2])if(i.numData(r)[1]==c[3]){var o=r.replace(c[3],t);1==a.has(o)?(c[1]=o,a.get(o).name=i.sliceMsg(o),a.get(o).productCount+=Number(e.productCount)):(c[1]=o,a.set(o,e),a.get(o).name=i.sliceMsg(o)),1!=i.carList.get(c[0]).isNew&&i.tui.request("/app/stock/productCount","post",{productId:i.carList.get(c[0]).productId,attributeList:o},!1,!0).then((function(t){200==t.code?(e.productNum=t.result,i.$forceUpdate()):i.tui.toast(t.message)})).catch((function(t){}))}else 1==a.has(r)?a.get(r).productCount+=Number(e.productCount):(a.set(r,e),a.get(r).name=i.sliceMsg(r))}));case 8:return r.next=10,i.$nextTick((function(){e.carList.get(c[0]).stockLogList=a,e.$forceUpdate(),e.$refs.getaPopup.close()}));case 10:case"end":return r.stop()}}),r)})))()},updateCate:function(){this.carList.get(this.customTypeId).customerCategoryList=this.customerCategoryList,this.$refs.customPopup.close(),this.$forceUpdate()},delDefaultCate:function(e,r,i){var s=this,c=this.goodsDetail.attributeList[e].value[i];this.goodsDetail.attributeList[e].value.splice(i,1),this.tui.request("/app/productAttributeValue/delById","post",{attributeId:c.attributeId,value:c.value,id:c.id},!1,!0).then((function(e){200==e.code?(s.getShopCategory(),t.showToast({title:"删除成功",icon:"none"})):t.showToast({title:"删除失败",icon:"none"})})).catch((function(t){}))},handleBlur:function(t){this.categoryText=t.detail.value},inputDialogToggle:function(t){this.inputVal="",this.isOpenId=t,this.$refs.inputDialog.open("bottom")},addCustomPrice:function(t){this.customTypeId=t,this.customerCategoryList=this.carList.get(t).customerCategoryList,this.$refs.customPopup.open()},getByCondition:function(){var e=this;this.tui.request("/app/supplier/getByCondition","post",{searchStr:this.khName.consigneeName,pageNumber:1,pageSize:10},!1,!0).then((function(r){if(200==r.code)for(var i=0;i<r.result.content.length;i++)r.result.content[i].id==e.khName.id&&(e.khName.noEarn=r.result.content[i].noEarn,e.zhiqianqiankuan=r.result.content[i].noEarn);else t.showToast({title:r.message,icon:"none"})})).catch((function(t){}))},saveCheck:function(){this.pageOldTemList=this.temporaryList;for(var t=0;t<this.goodsDetail.attributeList.length;t++){this.goodsList[t].specs=[];for(var e=0;e<this.goodsDetail.attributeList[t].value.length;e++)this.goodsDetail.attributeList[t].value[e].isChecked=!1}},showPopup:function(t){this.currentPopupIndex=t,this.showTan=!0},clickGetOne:function(t){var e=this;if(this.currentPopupIndex+1<this.moreData.length){this.showTan=!1,this.voiceText="",this.voiceText1="";var r={attributeList:'{"颜色":"均色","尺码":"均码"}',productCount:Number(t.productCount)||1,productNum:t.defaultStockCount};t.productId=t.id,t.saleDetailQueryDTO=[],t.saleDetailQueryDTO.push(r);var i=[];i.push(t);var s=this.oneGoodsId;if(this.oneGoodsId){if(""!=this.carList.get(s).productSn){for(var c=0;c<i.length;c++)for(var a=0;a<i[c].stockLogList1.length;a++)""==this.carList.get(s).productName&&(this.carList.get(s).productName=i[0].productName),""==this.carList.get(s).attrId&&(this.carList.get(s).attrId=i[0].attrId),""!=this.carList.get(s).purchasePrice&&null!=this.carList.get(s).purchasePrice||(voiceData.purchasePrice?this.carList.get(s).purchasePrice=voiceData.purchasePrice:this.carList.get(s).purchasePrice=i[0].purchasePrice),""==this.carList.get(s).productPicture&&(this.carList.get(s).productPicture=i[0].productPicture),this.carList.get(s).customerCategoryRule=this.checkPriceRule(JSON.parse(i[0].customerCategoryRule)),i[c].stockLogList1[a].name=this.sliceMsg(i[c].stockLogList1[a].attributeList),0==this.carList.get(s).stockLogList.size?this.carList.get(s).stockLogList.set(i[c].stockLogList1[a].attributeList,i[c].stockLogList1[a]):1==this.carList.get(s).stockLogList.has(i[c].stockLogList1[a].attributeList)?this.carList.get(s).stockLogList.get(i[c].stockLogList1[a].attributeList).productCount+=Number(i[c].stockLogList1[a].productCount):this.carList.get(s).stockLogList.set(i[c].stockLogList1[a].attributeList,i[c].stockLogList1[a]),this.carList.get(s).productCount+=Number(i[c].stockLogList1[a].productCount);this.carList.get(s).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productNum=i[0].defaultStockCount,0==this.carList.get(s).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount&&i[0].stockLogList1.length>0&&this.carList.get(s).stockLogList.delete('{"颜色":"均色","尺码":"均码"}'),this.carList.get(s).price1=Number(this.carList.get(s).productCount)*this.carList.get(s).purchasePrice}else{var o=!1;this.carList.forEach((function(t,e){if(t.productSn==i[0].productSn)throw o=!0,that.tui.toast("该货号被页面其他商品占用,请重新输入!"),that.carList.get(s).productSn="",setTimeout((function(t){that.$forceUpdate()}),1e3),Error("被占用")})),this.$nextTick((function(){""==e.carList.get(s).productName&&(e.carList.get(s).productName=i[0].productName),e.carList.get(s).customerCategoryList=null!=i[0].customerCategoryRule?e.checkPriceRule(JSON.parse(i[0].customerCategoryRule)):null,0==o&&""==e.carList.get(s).productSn&&(e.carList.get(s).productSn=i[0].productSn),0==o&&(i[0].productId?(e.carList.get(s).id=i[0].productId,e.carList.get(s).productId=i[0].productId,e.carList.get(s).isNew=!1,s=i[0].productId):""==i[0].productSn||null==i[0].productSn?(e.carList.get(s).id=i[0].productName,s=i[0].productName):"货号"==i[0].productSn?(e.carList.get(s).productSn=i[0].productName,e.carList.get(s).id=i[0].productName,s=i[0].productName):i[0].productSn&&(e.carList.get(s).id=i[0].productSn,s=i[0].productSn))})),""!=this.carList.get(s).purchasePrice&&null!=this.carList.get(s).purchasePrice||(this.carList.get(s).purchasePrice,this.carList.get(s).purchasePrice=i[0].purchasePrice),this.carList.get(s).customerCategoryList=null!=i[0].customerCategoryRule?this.checkPriceRule(JSON.parse(i[0].customerCategoryRule)):this.getNewProductRule(),""==this.carList.get(s).productPicture&&(this.carList.get(s).productPicture=i[0].productPicture),i[0].productId&&(this.carList.get(s).attrId=i[0].attrId,this.carList.get(s).wholesalePrice=i[0].wholesalePrice,this.carList.get(s).lsPrice=i[0].lsPrice);var u=new Map;this.$nextTick((function(){e.carList.forEach((function(t,e){e!=t.id?u.set(t.id,t):u.set(e,t)})),e.carList=u})),this.$nextTick((function(){for(var t=0;t<i.length;t++)for(var r=0;r<i[t].stockLogList1.length;r++)i[t].stockLogList1[r].name=e.sliceMsg(i[t].stockLogList1[r].attributeList),0==e.carList.get(s).stockLogList.size?e.carList.get(s).stockLogList.set(i[t].stockLogList1[r].attributeList,i[t].stockLogList1[r]):1==e.carList.get(s).stockLogList.has(i[t].stockLogList1[r].attributeList)?e.carList.get(s).stockLogList.get(i[t].stockLogList1[r].attributeList).productCount+=Number(i[t].stockLogList1[r].productCount):e.carList.get(s).stockLogList.set(i[t].stockLogList1[r].attributeList,i[t].stockLogList1[r]),e.carList.get(s).productCount+=Number(i[t].stockLogList1[r].productCount);e.carList.get(s).price1=Number(e.carList.get(s).productCount)*e.carList.get(s).purchasePrice,0==e.carList.get(s).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount&&i[0].stockLogList1.length>0&&e.carList.get(s).stockLogList.delete('{"颜色":"均色","尺码":"均码"}')}))}this.$nextTick((function(){e.getAllPrice(),e.oneGoodsId=""}))}else i?(this.carList1.push(t),this.$nextTick((function(){e.AiVoice()}))):this.tui.toast("抱歉:小助手本次未识别到商品信息,请检查识别信息是否正确");setTimeout((function(){e.showTan=!0,e.currentPopupIndex+=1}),0)}else{this.showTan=!1,this.voiceText="",this.voiceText1="";var n={attributeList:'{"颜色":"均色","尺码":"均码"}',productCount:Number(t.productCount)||1,productNum:t.defaultStockCount};t.productId=t.id,t.saleDetailQueryDTO=[],t.saleDetailQueryDTO.push(n);var d=[];d.push(t);var g=this.oneGoodsId;if(this.oneGoodsId){if(""!=this.carList.get(g).productSn){for(var l=0;l<d.length;l++)for(var p=0;p<d[l].stockLogList1.length;p++)""==this.carList.get(g).productName&&(this.carList.get(g).productName=d[0].productName),""==this.carList.get(g).attrId&&(this.carList.get(g).attrId=d[0].attrId),""!=this.carList.get(g).purchasePrice&&null!=this.carList.get(g).purchasePrice||(voiceData.purchasePrice?this.carList.get(g).purchasePrice=voiceData.purchasePrice:this.carList.get(g).purchasePrice=d[0].purchasePrice),""==this.carList.get(g).productPicture&&(this.carList.get(g).productPicture=d[0].productPicture),this.carList.get(g).customerCategoryRule=this.checkPriceRule(JSON.parse(d[0].customerCategoryRule)),d[l].stockLogList1[p].name=this.sliceMsg(d[l].stockLogList1[p].attributeList),0==this.carList.get(g).stockLogList.size?this.carList.get(g).stockLogList.set(d[l].stockLogList1[p].attributeList,d[l].stockLogList1[p]):1==this.carList.get(g).stockLogList.has(d[l].stockLogList1[p].attributeList)?this.carList.get(g).stockLogList.get(d[l].stockLogList1[p].attributeList).productCount+=Number(d[l].stockLogList1[p].productCount):this.carList.get(g).stockLogList.set(d[l].stockLogList1[p].attributeList,d[l].stockLogList1[p]),this.carList.get(g).productCount+=Number(d[l].stockLogList1[p].productCount);this.carList.get(g).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productNum=d[0].defaultStockCount,0==this.carList.get(g).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount&&d[0].stockLogList1.length>0&&this.carList.get(g).stockLogList.delete('{"颜色":"均色","尺码":"均码"}'),this.carList.get(g).price1=Number(this.carList.get(g).productCount)*this.carList.get(g).purchasePrice}else{var L=!1;this.carList.forEach((function(t,e){if(t.productSn==d[0].productSn)throw L=!0,that.tui.toast("该货号被页面其他商品占用,请重新输入!"),that.carList.get(g).productSn="",setTimeout((function(t){that.$forceUpdate()}),1e3),Error("被占用")})),this.$nextTick((function(){""==e.carList.get(g).productName&&(e.carList.get(g).productName=d[0].productName),e.carList.get(g).customerCategoryList=null!=d[0].customerCategoryRule?e.checkPriceRule(JSON.parse(d[0].customerCategoryRule)):null,0==L&&""==e.carList.get(g).productSn&&(e.carList.get(g).productSn=d[0].productSn),0==L&&(d[0].productId?(e.carList.get(g).id=d[0].productId,e.carList.get(g).productId=d[0].productId,e.carList.get(g).isNew=!1,g=d[0].productId):""==d[0].productSn||null==d[0].productSn?(e.carList.get(g).id=d[0].productName,g=d[0].productName):"货号"==d[0].productSn?(e.carList.get(g).productSn=d[0].productName,e.carList.get(g).id=d[0].productName,g=d[0].productName):d[0].productSn&&(e.carList.get(g).id=d[0].productSn,g=d[0].productSn))})),""!=this.carList.get(g).purchasePrice&&null!=this.carList.get(g).purchasePrice||(d[0].purchasePrice,this.carList.get(g).purchasePrice=d[0].purchasePrice),this.carList.get(g).customerCategoryList=null!=d[0].customerCategoryRule?this.checkPriceRule(JSON.parse(d[0].customerCategoryRule)):this.getNewProductRule(),""==this.carList.get(g).productPicture&&(this.carList.get(g).productPicture=d[0].productPicture),d[0].productId&&(this.carList.get(g).attrId=d[0].attrId,this.carList.get(g).wholesalePrice=d[0].wholesalePrice,this.carList.get(g).lsPrice=d[0].lsPrice);var h=new Map;this.$nextTick((function(){e.carList.forEach((function(t,e){e!=t.id?h.set(t.id,t):h.set(e,t)})),e.carList=h})),this.$nextTick((function(){for(var t=0;t<d.length;t++)for(var r=0;r<d[t].saleDetailQueryDTO.length;r++)d[t].saleDetailQueryDTO[r].name=e.sliceMsg(d[t].saleDetailQueryDTO[r].attributeList),0==e.carList.get(g).stockLogList.size?e.carList.get(g).stockLogList.set(d[t].saleDetailQueryDTO[r].attributeList,d[t].saleDetailQueryDTO[r]):1==e.carList.get(g).stockLogList.has(d[t].saleDetailQueryDTO[r].attributeList)?e.carList.get(g).stockLogList.get(d[t].saleDetailQueryDTO[r].attributeList).productCount+=Number(d[t].saleDetailQueryDTO[r].productCount):e.carList.get(g).stockLogList.set(d[t].saleDetailQueryDTO[r].attributeList,d[t].saleDetailQueryDTO[r]),e.carList.get(g).productCount+=Number(d[t].saleDetailQueryDTO[r].productCount);e.carList.get(g).price1=Number(e.carList.get(g).productCount)*e.carList.get(g).purchasePrice,e.carList.get(g).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productNum=d[0].defaultStockCount,0==e.carList.get(g).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount&&d[0].saleDetailQueryDTO.length>0&&e.carList.get(g).stockLogList.delete('{"颜色":"均色","尺码":"均码"}')}))}this.$nextTick((function(){e.getAllPrice(),e.oneGoodsId="",e.moreData=[]}))}else d?(this.moreData=[],this.carList1.push(t),this.$nextTick((function(){e.AiVoice()}))):this.tui.toast("抱歉:小助手本次未识别到商品信息,请检查识别信息是否正确")}},setDetail:function(e){var r=this;return(0,a.default)(s.default.mark((function e(){var i,c,a,o,n,d,g,l,p,L;return s.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(i=r,""!=r.voiceText){e.next=4;break}return r.tui.toast("识别内容不能为空"),e.abrupt("return");case 4:if(c=r.trimWhitespace(r.voiceText),c=r.convertChineseToArabic(c),-1!=c.indexOf("件数")&&(c=c.replace(/件数/g,"数量:")),-1==c.indexOf("数量")&&-1==c.indexOf("名称")&&-1==c.indexOf("单价")&&-1==c.indexOf("批发价")&&(c+=","),-1!=c.indexOf("点")&&(c=r.replaceCharAfterNumber(c,"点",".")),-1!=c.indexOf(",名称")&&(c=c.replace(/,名称/g,"名称")),-1!=c.indexOf("名称,")&&(c=c.replace(/名称,/g,"名称")),-1!=c.indexOf("名称::")&&(c=c.replace(/名称::/g,"名称")),-1!=c.indexOf("名称:")&&(c=c.replace(/名称:/g,"名称")),-1!=c.indexOf("名称")&&(c=c.replace(/名称/g,",名称:")),-1!=c.indexOf(",单价")&&(c=c.replace(/,单价/g,"单价")),-1!=c.indexOf("单价,")&&(c=c.replace(/单价,/g,"单价")),-1!=c.indexOf("单价::")&&(c=c.replace(/单价::/g,"单价")),-1!=c.indexOf("单价:")&&(c=c.replace(/单价:/g,"单价")),-1!=c.indexOf("单价")&&(c=c.replace(/单价/g,",单价:")),-1!=c.indexOf(",数量")&&(c=c.replace(/,数量/g,"数量")),-1!=c.indexOf("数量,")&&(c=c.replace(/数量,/g,"数量")),-1!=c.indexOf("数量::")&&(c=c.replace(/数量::/g,"数量")),-1!=c.indexOf("数量:")&&(c=c.replace(/数量:/g,"数量")),-1!=c.indexOf("数量")&&(c=c.replace(/数量/g,",数量:")),-1!=c.indexOf(",批发价")&&(c=c.replace(/,批发价/g,"批发价")),-1!=c.indexOf("批发价,")&&(c=c.replace(/批发价,/g,"批发价")),-1!=c.indexOf("批发价::")&&(c=c.replace(/批发价::/g,"批发价")),-1!=c.indexOf("批发价:")&&(c=c.replace(/批发价:/g,"批发价")),-1!=c.indexOf("批发价")&&(c=c.replace(/批发价/g,",批发价:")),-1!=c.indexOf(",零售价")&&(c=c.replace(/,零售价/g,"零售价")),-1!=c.indexOf("零售价,")&&(c=c.replace(/零售价,/g,"零售价")),-1!=c.indexOf("零售价::")&&(c=c.replace(/零售价::/g,"零售价")),-1!=c.indexOf("零售价:")&&(c=c.replace(/零售价:/g,"零售价")),-1!=c.indexOf("零售价")&&(c=c.replace(/零售价/g,",零售价:")),c.startsWith("号")&&(c="货号"+c.substr(1)),c.startsWith("货号")||(c="货号"+c),-1!=c.indexOf("货号,")&&(c=c.replace(/货号,/g,"货号")),-1!=c.indexOf("货号::")&&(c=c.replace(/货号::/g,"货号")),-1!=c.indexOf("货号:")&&(c=c.replace(/货号:/g,"货号")),c=r.convertStringCorrectly(c),c=r.spliceMsg(c),0==c.indexOf(",")&&(c=c.substr(1)),r.getMsg=c,a=/-?\d+/g,o=!0,n=t.getStorageSync("shopId"),"1863043415453863936"!=n&&"1855423693308694528"!=n&&"1810179818189361152"!=n||-1!=c.indexOf("数量")||(o=!1),-1!=c.indexOf("色")||-1!=c.indexOf("码")||!o){e.next=69;break}for(c.startsWith("货号")||(c="货号"+c),e.prev=49,d=/货号.*?(?=货号|$)/g,c=c.match(d),g=function(t){if(1==r.voiceGetOneData){var e=r.extractInfo(c[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=r.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=r.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=r.replaceCharAfterNumber(e.lsprice,"块","."),-1!=e.lsprice.indexOf("元")&&(e.lsprice=e.lsprice.replace(/元/g,"")),e.lsprice=e.lsprice.replace(/[^0-9.]/g,"")),t==c.length-1?setTimeout((function(i){r.getOneData(e,!0,200*(t+1))}),200*(t+1)):setTimeout((function(i){r.getOneData(e,!1,200*(t+1))}),200*(t+1))}else setTimeout((function(e){-1==c[t].indexOf("数量")&&-1==c[t].indexOf("名称")&&-1==c[t].indexOf("单价")&&-1==c[t].indexOf("批发价")&&-1==c[t].indexOf(",")&&(c[t]=c[t]+",");var s=r.extractInfo(c[t]+"。");s.productSn&&(s.productSn=s.productSn.replace(/[沟勾钩]/g,"J")),s.productCount&&(s.productCount=s.productCount.match(a)),s.purchasePrice&&(s.purchasePrice=r.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=r.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=r.replaceCharAfterNumber(s.lsprice,"块","."),-1!=s.lsprice.indexOf("元")&&(s.lsprice=s.lsprice.replace(/元/g,"")),s.lsprice=s.lsprice.replace(/[^0-9.]/g,"")),r.tui.request("/app/product/getByProductSn","post",{productSn:s.productSn},!1,!0).then((function(e){if(200==e.code)if(""!=e.result)r.voiceText="",r.$refs.popup.close(),r.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId","POST",{categoryId:e.result[0].attrId},!1,!0).then((function(a){if(200==a.code){var o={attributeList:'{"颜色":"均色","尺码":"均码"}',productCount:Number(s.productCount)||1,stockCount:null};if(a.result.stock.length>0)for(var u=0;u<a.result.stock.length;u++)'{"颜色":"均色","尺码":"均码"}'==a.result.stock[u].attributeList&&(o={attributeList:'{"颜色":"均色","尺码":"均码"}',productCount:Number(s.productCount)||1,stockCount:a.result.stock[u].stockCount});s.purchasePrice&&(s.purchasePrice=r.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=r.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(o);var n=e.result;if(r.oneGoodsId){var d=r.oneGoodsId;if(n.length>0){if(""!=r.carList.get(d).productSn){for(var g=0;g<n.length;g++)for(var l=0;l<n[g].stockLogList1.length;l++)""==r.carList.get(d).productName&&(r.carList.get(d).productName=n[0].productName),""==r.carList.get(d).attrId&&(r.carList.get(d).attrId=n[0].attrId),""!=r.carList.get(d).purchasePrice&&null!=r.carList.get(d).purchasePrice||(s.purchasePrice?r.carList.get(d).purchasePrice=s.purchasePrice:r.carList.get(d).purchasePrice=n[0].purchasePrice),""==r.carList.get(d).productPicture&&(r.carList.get(d).productPicture=n[0].productPicture),r.carList.get(d).customerCategoryRule=r.checkPriceRule(JSON.parse(n[0].customerCategoryRule)),n[g].stockLogList1[l].name=r.sliceMsg(n[g].stockLogList1[l].attributeList),0==r.carList.get(d).stockLogList.size?r.carList.get(d).stockLogList.set(n[g].stockLogList1[l].attributeList,n[g].stockLogList1[l]):1==r.carList.get(d).stockLogList.has(n[g].stockLogList1[l].attributeList)?(r.carList.get(d).stockLogList.get(n[g].stockLogList1[l].attributeList).productNum=n[g].stockLogList1[l].stockCount,r.carList.get(d).stockLogList.get(n[g].stockLogList1[l].attributeList).productCount+=Number(n[g].stockLogList1[l].productCount)):r.carList.get(d).stockLogList.set(n[g].stockLogList1[l].attributeList,n[g].stockLogList1[l]),r.carList.get(d).productCount+=Number(n[g].stockLogList1[l].productCount);0==r.carList.get(d).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount&&n[0].stockLogList1.length>0&&r.carList.get(d).stockLogList.delete('{"颜色":"均色","尺码":"均码"}'),r.carList.get(d).price1=Number(r.carList.get(d).productCount)*r.carList.get(d).purchasePrice}else{var p=!1;r.carList.forEach((function(t,e){if(t.productSn==n[0].productSn)throw p=!0,i.tui.toast("该货号被页面其他商品占用,请重新输入!"),i.carList.get(d).productSn="",setTimeout((function(t){i.$forceUpdate()}),1e3),Error("被占用")})),r.$nextTick((function(){""==r.carList.get(d).productName&&(r.carList.get(d).productName=n[0].productName),r.carList.get(d).customerCategoryList=null!=n[0].customerCategoryRule?r.checkPriceRule(JSON.parse(n[0].customerCategoryRule)):null,0==p&&""==r.carList.get(d).productSn&&(r.carList.get(d).productSn=n[0].productSn),0==p&&(n[0].productId?(r.carList.get(d).id=n[0].productId,r.carList.get(d).productId=n[0].productId,r.carList.get(d).isNew=!1,d=n[0].productId):""==n[0].productSn||null==n[0].productSn?(r.carList.get(d).id=n[0].productName,d=n[0].productName):"货号"==n[0].productSn?(r.carList.get(d).productSn=n[0].productName,r.carList.get(d).id=n[0].productName,d=n[0].productName):n[0].productSn&&(r.carList.get(d).id=n[0].productSn,d=n[0].productSn))})),""!=r.carList.get(d).purchasePrice&&null!=r.carList.get(d).purchasePrice||(s.purchasePrice?r.carList.get(d).purchasePrice=s.purchasePrice:r.carList.get(d).purchasePrice=n[0].purchasePrice),r.carList.get(d).customerCategoryList=null!=n[0].customerCategoryRule?r.checkPriceRule(JSON.parse(n[0].customerCategoryRule)):r.getNewProductRule(),""==r.carList.get(d).productPicture&&(r.carList.get(d).productPicture=n[0].productPicture),n[0].productId&&(r.carList.get(d).attrId=n[0].attrId,r.carList.get(d).wholesalePrice=n[0].wholesalePrice,r.carList.get(d).lsPrice=n[0].lsPrice);var L=new Map;r.$nextTick((function(){r.carList.forEach((function(t,e){e!=t.id?L.set(t.id,t):L.set(e,t)})),r.carList=L})),r.$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=r.sliceMsg(n[t].stockLogList1[e].attributeList),0==r.carList.get(d).stockLogList.size?r.carList.get(d).stockLogList.set(n[t].stockLogList1[e].attributeList,n[t].stockLogList1[e]):1==r.carList.get(d).stockLogList.has(n[t].stockLogList1[e].attributeList)?(r.carList.get(d).stockLogList.get(n[t].stockLogList1[e].attributeList).productNum=n[t].stockLogList1[e].stockCount,r.carList.get(d).stockLogList.get(n[t].stockLogList1[e].attributeList).productCount+=Number(n[t].stockLogList1[e].productCount)):r.carList.get(d).stockLogList.set(n[t].stockLogList1[e].attributeList,n[t].stockLogList1[e]),r.carList.get(d).productCount+=Number(n[t].stockLogList1[e].productCount);r.carList.get(d).price1=Number(r.carList.get(d).productCount)*r.carList.get(d).purchasePrice,0==r.carList.get(d).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount&&n[0].stockLogList1.length>0&&r.carList.get(d).stockLogList.delete('{"颜色":"均色","尺码":"均码"}')}))}r.$nextTick((function(){r.getAllPrice(),r.oneGoodsId=""}))}else r.tui.toast("抱歉:小助手本次未识别到商品信息,请检查识别信息是否正确")}else{for(var h=0;h<n.length;h++){var m={id:"",price:n[h].price,productCount:0,customerCategoryList:null!=n[h].customerCategoryRule?r.checkPriceRule(JSON.parse(n[h].customerCategoryRule)):r.getNewProductRule(),attrId:n[h].attrId,categoryId:""==n[h].categoryId?r.categoryList.categoryId:n[h].categoryId,categoryName:""==n[h].categoryName?r.categoryList.categoryName:n[h].categoryName,wholesalePrice:s.wholesalePrice?s.wholesalePrice:n[h].wholesalePrice,purchasePrice:s.purchasePrice?s.purchasePrice:n[h].purchasePrice,isNew:null==n[h].productId,productId:n[h].productId,productName:n[h].productName,productSn:n[h].productSn,productPicture:n[h].productPicture,supplierName:n[h].supplierName,productPictures:[],saleDetailQueryDTO:[]};n[h].productId?m.id=n[h].productId:""==n[h].productSn||null==n[h].productSn?m.id=n[h].productName:"货号"==n[h].productSn?(m.productSn=n[h].productName,m.id=n[h].productName):n[h].productSn&&(m.id=n[h].productSn);for(var f=0;f<n[h].stockLogList1.length;f++){var P={attributeList:r.getAttribute(n[h].stockLogList1[f].attributeList),productCount:Number(n[h].stockLogList1[f].productCount)||Number(n[h].stockLogList1[f].productCounts),productNum:n[h].stockLogList1[f].stockCount,name:r.sliceMsg(r.getAttribute(n[h].stockLogList1[f].attributeList)),price:n[h].stockLogList1[f].purchasePrice};m.productCount+=Number(n[h].stockLogList1[f].productCount),m.saleDetailQueryDTO.push(P)}r.carList1.push(m)}t==c.length-1&&r.$nextTick((function(){setTimeout((function(t){r.AiVoice()}),300)}))}}else r.tui.toast(a.message)})).catch((function(t){}));else{if(r.voiceText="",r.voiceText1="",r.$refs.popup.close(),s.productCount){s.productCount=s.productCount[0].match(/\d+/g)}s.purchasePrice&&(s.purchasePrice=r.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=r.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=r.replaceCharAfterNumber(s.lsprice,"块","."),-1!=s.lsprice.indexOf("元")&&(s.lsprice=s.lsprice.replace(/元/g,"")),s.lsprice=s.lsprice.replace(/[^0-9.]/g,""));var a={id:s.productSn?s.productSn:(0,u.generateUUID)(),productCount:Number(s.productCount)||0,productName:s.productName,productSn:s.productSn,categoryId:r.categoryList.categoryId,categoryName:r.categoryList.categoryName,purchasePrice:s.purchasePrice||0,wholesalePrice:s.wholesalePrice||0,lsprice:s.lsprice||0,stockLogList1:[{attributeList:'{"颜色":"均色","尺码":"均码"}',productCount:Number(s.productCount)||1,stockCount:null}]},o=[];if(o.push(a),r.oneGoodsId){var n=r.oneGoodsId;if(o.length>0){if(""!=r.carList.get(n).productSn){for(var d=0;d<o.length;d++)for(var g=0;g<o[d].stockLogList1.length;g++)""==r.carList.get(n).productName&&(r.carList.get(n).productName=o[0].productName),""==r.carList.get(n).productSn&&(r.carList.get(n).productSn=o[0].productSn),""==r.carList.get(n).attrId&&(r.carList.get(n).attrId=o[0].attrId),""!=r.carList.get(n).wholesalePrice&&null!=r.carList.get(n).wholesalePrice||(r.carList.get(n).wholesalePrice=o[0].wholesalePrice),""!=r.carList.get(n).purchasePrice&&null!=r.carList.get(n).purchasePrice||(r.carList.get(n).purchasePrice=o[0].purchasePrice),""==r.carList.get(n).productPicture&&(r.carList.get(n).productPicture=o[0].productPicture),o[d].stockLogList1[g].name=r.sliceMsg(o[d].stockLogList1[g].attributeList),0==r.carList.get(n).stockLogList.size?r.carList.get(n).stockLogList.set(o[d].stockLogList1[g].attributeList,o[d].stockLogList1[g]):1==r.carList.get(n).stockLogList.has(o[d].stockLogList1[g].attributeList)?r.carList.get(n).stockLogList.get(o[d].stockLogList1[g].attributeList).productCount+=Number(o[d].stockLogList1[g].productCount):r.carList.get(n).stockLogList.set(o[d].stockLogList1[g].attributeList,o[d].stockLogList1[g]),r.carList.get(n).productCount+=Number(o[d].stockLogList1[g].productCount);0==r.carList.get(n).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount&&o[0].stockLogList1.length>0&&r.carList.get(n).stockLogList.delete('{"颜色":"均色","尺码":"均码"}'),r.carList.get(n).price1=Number(r.carList.get(n).productCount)*r.carList.get(n).purchasePrice}else{var l=!1;r.carList.forEach((function(t,e){if(t.productSn==o[0].productSn)throw l=!0,i.tui.toast("该货号被页面其他商品占用,请重新输入!"),i.carList.get(n).productSn="",setTimeout((function(t){i.$forceUpdate()}),1e3),Error("被占用")})),r.$nextTick((function(){""==r.carList.get(n).productName&&(r.carList.get(n).productName=o[0].productName),0==l&&""==r.carList.get(n).productSn&&(r.carList.get(n).productSn=o[0].productSn),0==l&&(o[0].productId?(r.carList.get(n).id=o[0].productId,r.carList.get(n).isNew=!1,n=o[0].productId):""==o[0].productSn||null==o[0].productSn?(r.carList.get(n).id=o[0].productName,n=o[0].productName):"货号"==o[0].productSn?(r.carList.get(n).productSn=o[0].productName,r.carList.get(n).id=o[0].productName,n=o[0].productName):o[0].productSn&&(r.carList.get(n).id=o[0].productSn,n=o[0].productSn))})),""!=r.carList.get(n).purchasePrice&&null!=r.carList.get(n).purchasePrice||(r.carList.get(n).purchasePrice=o[0].purchasePrice),""==r.carList.get(n).productPicture&&(r.carList.get(n).productPicture=o[0].productPicture),o[0].productId&&(r.carList.get(n).attrId=o[0].attrId,r.carList.get(n).lsPrice=o[0].lsPrice),r.carList.get(n).wholesalePrice=o[0].wholesalePrice;var p=new Map;r.$nextTick((function(){r.carList.forEach((function(t,e){e!=t.id?p.set(t.id,t):p.set(e,t)})),r.carList=p})),r.$nextTick((function(){for(var t=0;t<o.length;t++)for(var e=0;e<o[t].stockLogList1.length;e++)o[t].stockLogList1[e].name=r.sliceMsg(o[t].stockLogList1[e].attributeList),0==r.carList.get(n).stockLogList.size?r.carList.get(n).stockLogList.set(o[t].stockLogList1[e].attributeList,o[t].stockLogList1[e]):1==r.carList.get(n).stockLogList.has(o[t].stockLogList1[e].attributeList)?r.carList.get(n).stockLogList.get(o[t].stockLogList1[e].attributeList).productCount+=Number(o[t].stockLogList1[e].productCount):r.carList.get(n).stockLogList.set(o[t].stockLogList1[e].attributeList,o[t].stockLogList1[e]),r.carList.get(n).productCount+=Number(o[t].stockLogList1[e].productCount);r.carList.get(n).price1=Number(r.carList.get(n).productCount)*r.carList.get(n).purchasePrice,0==r.carList.get(n).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount&&o[0].stockLogList1.length>0&&r.carList.get(n).stockLogList.delete('{"颜色":"均色","尺码":"均码"}')}))}r.$nextTick((function(){r.getAllPrice(),r.oneGoodsId=""}))}else r.tui.toast("抱歉:小助手本次未识别到商品信息,请检查识别信息是否正确")}else{s.purchasePrice&&(s.purchasePrice=r.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=r.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<o.length;L++){var h={id:"",productCount:0,attrId:o[L].attrId,categoryId:""==o[L].categoryId?r.categoryList.categoryId:o[L].categoryId,categoryName:""==o[L].categoryName?r.categoryList.categoryName:o[L].categoryName,wholesalePrice:s.wholesalePrice?s.wholesalePrice:o[L].wholesalePrice,price:s.lsprice?s.lsprice:o[L].lsprice,purchasePrice:o[L].purchasePrice,isNew:null==o[L].productId,productId:o[L].productId,productName:o[L].productName,productSn:o[L].productSn,productPicture:o[L].productPicture,supplierName:o[L].supplierName,productPictures:[],saleDetailQueryDTO:[]};o[L].productId?h.id=o[L].productId:""==o[L].productSn||null==o[L].productSn?h.id=o[L].productName||o[L].id:"货号"==o[L].productSn?(h.productSn=o[L].productName,h.id=o[L].productName||o[L].id):o[L].productSn&&(h.id=o[L].productSn||o[L].id);for(var m=0;m<o[L].stockLogList1.length;m++){var f={attributeList:r.getAttribute(o[L].stockLogList1[m].attributeList),productCount:Number(o[L].stockLogList1[m].productCount)||Number(o[L].stockLogList1[m].productCounts),productNum:"",name:r.sliceMsg(r.getAttribute(o[L].stockLogList1[m].attributeList)),price:o[L].stockLogList1[m].purchasePrice};h.productCount+=Number(o[L].stockLogList1[m].productCount),h.saleDetailQueryDTO.push(f)}r.carList1.push(h)}t==c.length-1&&r.$nextTick((function(){setTimeout((function(t){r.AiVoice()}),300)}))}}}))}),200*(t+1))},l=0;l<c.length;l++)g(l);r.$refs.popup.close(),r.$refs.voiceBottomPopup.close(),e.next=67;break;case 58:return e.prev=58,e.t0=e["catch"](49),-1!=r.getMsg.indexOf("色,")&&(r.getMsg=r.getMsg.replace(/色,/g,"色")),-1!=r.getMsg.indexOf("色")&&(r.getMsg=r.getMsg.replace(/色/g,"色、")),-1!=r.getMsg.indexOf("件,")&&(r.getMsg=r.getMsg.replace(/件,/g,"件")),-1!=r.getMsg.indexOf("件")&&(r.getMsg=r.getMsg.replace(/件/g,"件,")),p=""==r.oneGoodsId||r.carList.get(r.oneGoodsId).isNew?{questionMsg:r.getMsg}:{productId:r.carList.get(r.oneGoodsId).productId,questionMsg:r.getMsg},e.next=67,r.tui.request("/purchaseOcrPicture/callWithMessageOfPurchase","POST",p,!1,!0).then((function(e){if(200==e.code){r.voiceText="",r.voiceText1="",r.$refs.popup.close(),r.$refs.voiceBottomPopup.close();var s=e.result.data.purchaseDetails;if(r.oneGoodsId){var c=r.oneGoodsId;if(s.length>0){if(""!=r.carList.get(c).productSn){for(var a=0;a<s.length;a++){""!=s[a].purchasePrice&&null!=s[a].purchasePrice||(s[a].purchasePrice=0),""!=s[a].wholesalePrice&&null!=s[a].wholesalePrice||(s[a].wholesalePrice=0),""!=s[a].price&&null!=s[a].price||(s[a].price=0);for(var o=0;o<s[a].stockLogList1.length;o++)""!=s[a].stockLogList1[o].productCount&&null!=s[a].stockLogList1[o].productCount||(s[a].stockLogList1[o].productCount=0),""==r.carList.get(c).productName&&(r.carList.get(c).productName=s[0].productName),""==r.carList.get(c).attrId&&(r.carList.get(c).attrId=s[0].attrId),""!=r.carList.get(c).purchasePrice&&null!=r.carList.get(c).purchasePrice||(r.carList.get(c).purchasePrice=s[0].purchasePrice),""!=r.carList.get(c).wholesalePrice&&null!=r.carList.get(c).wholesalePrice||(r.carList.get(c).wholesalePrice=s[0].wholesalePrice),""==r.carList.get(c).productPicture&&(r.carList.get(c).productPicture=s[0].productPicture),s[a].stockLogList1[o].name=r.sliceMsg(s[a].stockLogList1[o].attributeList),r.carList.get(c).stockLogList.get(s[a].stockLogList1[o].attributeList).productNum=s[a].stockLogList1[o].stockCount,0==r.carList.get(c).stockLogList.size?r.carList.get(c).stockLogList.set(s[a].stockLogList1[o].attributeList,s[a].stockLogList1[o]):1==r.carList.get(c).stockLogList.has(s[a].stockLogList1[o].attributeList)?r.carList.get(c).stockLogList.get(s[a].stockLogList1[o].attributeList).productCount+=Number(s[a].stockLogList1[o].productCount):r.carList.get(c).stockLogList.set(s[a].stockLogList1[o].attributeList,s[a].stockLogList1[o]),r.carList.get(c).productCount+=Number(s[a].stockLogList1[o].productCount)}0==r.carList.get(c).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount&&s[0].stockLogList1.length>0&&r.carList.get(c).stockLogList.delete('{"颜色":"均色","尺码":"均码"}'),r.carList.get(c).price1=Number(r.carList.get(c).productCount)*r.carList.get(c).purchasePrice}else{var u=!1;r.carList.forEach((function(t,e){if(t.productSn==s[0].productSn)throw u=!0,i.tui.toast("该货号被页面其他商品占用,请重新输入!"),i.carList.get(c).productSn="",setTimeout((function(t){i.$forceUpdate()}),2e3),Error("被占用")})),r.$nextTick((function(){""==r.carList.get(c).productName&&(r.carList.get(c).productName=s[0].productName),r.carList.get(c).customerCategoryList=r.checkPriceRule(JSON.parse(s[0].customerCategoryRule)),0==u&&""==r.carList.get(c).productSn&&(r.carList.get(c).productSn=s[0].productSn),0==u&&(s[0].productId?(r.carList.get(c).id=s[0].productId,r.carList.get(c).isNew=!1,c=s[0].productId):""==s[0].productSn||null==s[0].productSn?(r.carList.get(c).id=s[0].productName,c=s[0].productName):"货号"==s[0].productSn?(r.carList.get(c).productSn=s[0].productName,r.carList.get(c).id=s[0].productName,c=s[0].productName):s[0].productSn&&(r.carList.get(c).id=s[0].productSn,c=s[0].productSn)),r.$forceUpdate()})),""!=r.carList.get(c).purchasePrice&&null!=r.carList.get(c).purchasePrice||(r.carList.get(c).purchasePrice=s[0].purchasePrice),""==r.carList.get(c).productPicture&&(r.carList.get(c).productPicture=s[0].productPicture),s[0].productId&&(r.carList.get(c).attrId=s[0].attrId,r.carList.get(c).wholesalePrice=s[0].wholesalePrice,r.carList.get(c).lsPrice=s[0].lsPrice);var n=new Map;r.$nextTick((function(){r.carList.forEach((function(t,e){e!=t.id?n.set(t.id,t):n.set(e,t)})),r.carList=n})),r.$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=r.sliceMsg(s[t].stockLogList1[e].attributeList),0==r.carList.get(c).stockLogList.size?(s[t].stockLogList1[e].productNum=s[t].stockLogList1[e].stockCount,r.carList.get(c).stockLogList.set(s[t].stockLogList1[e].attributeList,s[t].stockLogList1[e])):1==r.carList.get(c).stockLogList.has(s[t].stockLogList1[e].attributeList)?(r.carList.get(c).stockLogList.get(s[t].stockLogList1[e].attributeList).productCount+=Number(s[t].stockLogList1[e].productCount),r.carList.get(c).stockLogList.get(s[t].stockLogList1[e].attributeList).productNum=s[t].stockLogList1[e].stockCount):(r.carList.get(c).stockLogList.set(s[t].stockLogList1[e].attributeList,s[t].stockLogList1[e]),r.carList.get(c).stockLogList.get(s[t].stockLogList1[e].attributeList).productNum=r.carList.get(c).stockLogList.get(s[t].stockLogList1[e].attributeList).stockCount),r.carList.get(c).productCount+=Number(s[t].stockLogList1[e].productCount);r.carList.get(c).price1=Number(r.carList.get(c).productCount)*r.carList.get(c).purchasePrice,0==r.carList.get(c).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount&&s[0].stockLogList1.length>0&&r.carList.get(c).stockLogList.delete('{"颜色":"均色","尺码":"均码"}')}))}r.$nextTick((function(){r.getAllPrice(),r.oneGoodsId=""}))}else r.tui.toast("抱歉:小助手本次未识别到商品信息,请检查识别信息是否正确")}else{for(var d=0;d<s.length;d++){var g={id:"",price:s[d].price,productCount:0,attrId:s[d].attrId,customerCategoryList:null==s[d].customerCategoryRule?r.getNewProductRule():r.checkPriceRule(JSON.parse(s[d].customerCategoryRule)),categoryId:""==s[d].categoryId?r.categoryList.categoryId:s[d].categoryId,categoryName:""==s[d].categoryName?r.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?g.id=s[d].productId:""==s[d].productSn||null==s[d].productSn?g.id=s[d].productName:"货号"==s[d].productSn?(g.productSn=s[d].productName,g.id=s[d].productName):s[d].productSn&&(g.id=s[d].productSn);for(var l=0;l<s[d].stockLogList1.length;l++){var p={attributeList:r.getAttribute(s[d].stockLogList1[l].attributeList),productCount:Number(s[d].stockLogList1[l].productCount)||Number(s[d].stockLogList1[l].productCounts),productNum:"",name:r.sliceMsg(r.getAttribute(s[d].stockLogList1[l].attributeList)),price:s[d].stockLogList1[l].purchasePrice};g.productCount+=Number(s[d].stockLogList1[l].productCount),g.saleDetailQueryDTO.push(p)}r.carList1.push(g)}r.$nextTick((function(){setTimeout((function(t){r.AiVoice()}),300)}))}}else t.showModal({title:"提示",content:"抱歉:小助手对"+r.getMsg+"的部分商品未识别,请检查识别信息是否正确",success:function(t){}})})).catch((function(t){r.tui.toast(t)}));case 67:e.next=76;break;case 69:return-1!=r.getMsg.indexOf("色,")&&(r.getMsg=r.getMsg.replace(/色,/g,"色")),-1!=r.getMsg.indexOf("色")&&(r.getMsg=r.getMsg.replace(/色/g,"色、")),-1!=r.getMsg.indexOf("件,")&&(r.getMsg=r.getMsg.replace(/件,/g,"件")),-1!=r.getMsg.indexOf("件")&&(r.getMsg=r.getMsg.replace(/件/g,"件,")),L=""==r.oneGoodsId||r.carList.get(r.oneGoodsId).isNew?{questionMsg:r.getMsg}:{productId:r.carList.get(r.oneGoodsId).productId,questionMsg:r.getMsg},e.next=76,r.tui.request("/purchaseOcrPicture/callWithMessageOfPurchase","POST",L,!1,!0).then((function(e){if(200==e.code){r.voiceText="",r.voiceText1="",r.$refs.popup.close(),r.$refs.voiceBottomPopup.close();var s=e.result.data.purchaseDetails;if(r.oneGoodsId){var c=r.oneGoodsId;if(s.length>0)if(""!=r.carList.get(c).productSn){for(var a=0;a<s.length;a++){""!=s[a].purchasePrice&&null!=s[a].purchasePrice||(s[a].purchasePrice=0),""!=s[a].wholesalePrice&&null!=s[a].wholesalePrice||(s[a].wholesalePrice=0),""!=s[a].price&&null!=s[a].price||(s[a].price=0);for(var o=0;o<s[a].stockLogList1.length;o++)""!=s[a].stockLogList1[o].productCount&&null!=s[a].stockLogList1[o].productCount||(s[a].stockLogList1[o].productCount=0),""==r.carList.get(c).productName&&(r.carList.get(c).productName=s[0].productName),""==r.carList.get(c).attrId&&(r.carList.get(c).attrId=s[0].attrId),""!=r.carList.get(c).purchasePrice&&null!=r.carList.get(c).purchasePrice||(r.carList.get(c).purchasePrice=s[0].purchasePrice),""!=r.carList.get(c).wholesalePrice&&null!=r.carList.get(c).wholesalePrice||(r.carList.get(c).wholesalePrice=s[0].wholesalePrice),""==r.carList.get(c).productPicture&&(r.carList.get(c).productPicture=s[0].productPicture),s[a].stockLogList1[o].name=r.sliceMsg(s[a].stockLogList1[o].attributeList),s[a].stockLogList1[o].productNum=s[a].stockLogList1[o].stockCount,0==r.carList.get(c).stockLogList.size?r.carList.get(c).stockLogList.set(s[a].stockLogList1[o].attributeList,s[a].stockLogList1[o]):1==r.carList.get(c).stockLogList.has(s[a].stockLogList1[o].attributeList)?r.carList.get(c).stockLogList.get(s[a].stockLogList1[o].attributeList).productCount+=Number(s[a].stockLogList1[o].productCount):r.carList.get(c).stockLogList.set(s[a].stockLogList1[o].attributeList,s[a].stockLogList1[o]),r.carList.get(c).productCount+=Number(s[a].stockLogList1[o].productCount)}r.$nextTick((function(){r.carList.get(c).price1=Number(r.carList.get(c).productCount)*r.carList.get(c).purchasePrice,r.getAllPrice(),r.oneGoodsId=""})),0==r.carList.get(c).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount&&s[0].stockLogList1.length>0&&r.carList.get(c).stockLogList.delete('{"颜色":"均色","尺码":"均码"}')}else{var u=!1;r.carList.forEach((function(t,e){if(t.productSn==s[0].productSn)throw u=!0,i.tui.toast("该货号被页面其他商品占用,请重新输入!"),i.carList.get(c).productSn="",setTimeout((function(t){i.$forceUpdate()}),2e3),Error("被占用")})),r.$nextTick((function(){""==r.carList.get(c).productName&&(r.carList.get(c).productName=s[0].productName),0==u&&""==r.carList.get(c).productSn&&(r.carList.get(c).productSn=s[0].productSn),0==u&&(s[0].productId?(r.carList.get(c).id=s[0].productId,r.carList.get(c).isNew=!1,c=s[0].productId):""==s[0].productSn||null==s[0].productSn?(r.carList.get(c).id=s[0].productName,c=s[0].productName):"货号"==s[0].productSn?(r.carList.get(c).productSn=s[0].productName,r.carList.get(c).id=s[0].productName,c=s[0].productName):s[0].productSn&&(r.carList.get(c).id=s[0].productSn,c=s[0].productSn)),r.$forceUpdate()})),""!=r.carList.get(c).purchasePrice&&null!=r.carList.get(c).purchasePrice||(r.carList.get(c).purchasePrice=s[0].purchasePrice),r.carList.get(c).customerCategoryList=r.checkPriceRule(JSON.parse(s[0].customerCategoryRule)),""!=r.carList.get(c).wholesalePrice&&null!=r.carList.get(c).wholesalePrice||(r.carList.get(c).wholesalePrice=s[0].wholesalePrice),""!=r.carList.get(c).lsprice&&null!=r.carList.get(c).lsprice||(r.carList.get(c).lsprice=s[0].price),""==r.carList.get(c).productPicture&&(r.carList.get(c).productPicture=s[0].productPicture),s[0].productId&&(r.carList.get(c).productId=s[0].productId,r.carList.get(c).attrId=s[0].attrId,r.carList.get(c).wholesalePrice=s[0].wholesalePrice,r.carList.get(c).lsPrice=s[0].lsPrice);var n=new Map;r.$nextTick((function(){r.carList.forEach((function(t,e){e!=t.id?n.set(t.id,t):n.set(e,t)})),r.carList=n})),r.$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=r.sliceMsg(s[t].stockLogList1[e].attributeList),0==r.carList.get(c).stockLogList.size?r.carList.get(c).stockLogList.set(s[t].stockLogList1[e].attributeList,s[t].stockLogList1[e]):1==r.carList.get(c).stockLogList.has(s[t].stockLogList1[e].attributeList)?(r.carList.get(c).stockLogList.get(s[t].stockLogList1[e].attributeList).productCount+=Number(s[t].stockLogList1[e].productCount),r.carList.get(c).stockLogList.get(s[t].stockLogList1[e].attributeList).productNum=s[t].stockLogList1[e].stockCount):(r.carList.get(c).stockLogList.set(s[t].stockLogList1[e].attributeList,s[t].stockLogList1[e]),r.carList.get(c).stockLogList.get(s[t].stockLogList1[e].attributeList).productNum=r.carList.get(c).stockLogList.get(s[t].stockLogList1[e].attributeList).stockCount),r.carList.get(c).productCount+=Number(s[t].stockLogList1[e].productCount);r.carList.get(c).price1=Number(r.carList.get(c).productCount)*r.carList.get(c).purchasePrice,0==r.carList.get(c).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount&&s[0].stockLogList1.length>0&&r.carList.get(c).stockLogList.delete('{"颜色":"均色","尺码":"均码"}')})),r.$nextTick((function(){r.getAllPrice(),r.oneGoodsId=""}))}else r.tui.toast("抱歉:小助手本次未识别到商品信息,请检查识别信息是否正确")}else{for(var d=0;d<s.length;d++){var g={id:"",price:s[d].price,productCount:0,attrId:s[d].attrId,customerCategoryList:null==s[d].customerCategoryRule?r.getNewProductRule():r.checkPriceRule(JSON.parse(s[d].customerCategoryRule)),categoryId:""==s[d].categoryId?r.categoryList.categoryId:s[d].categoryId,categoryName:""==s[d].categoryName?r.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?g.id=s[d].productId:""==s[d].productSn||null==s[d].productSn?g.id=s[d].productName:"货号"==s[d].productSn?(g.productSn=s[d].productName,g.id=s[d].productName):s[d].productSn&&(g.id=s[d].productSn);for(var l=0;l<s[d].stockLogList1.length;l++){var p={attributeList:r.getAttribute(s[d].stockLogList1[l].attributeList),productCount:Number(s[d].stockLogList1[l].productCount)||Number(s[d].stockLogList1[l].productCounts),productNum:s[d].stockLogList1[l].stockCount,name:r.sliceMsg(r.getAttribute(s[d].stockLogList1[l].attributeList)),price:s[d].stockLogList1[l].purchasePrice};g.productCount+=Number(s[d].stockLogList1[l].productCount),g.saleDetailQueryDTO.push(p)}r.carList1.push(g)}r.$nextTick((function(){setTimeout((function(t){r.AiVoice()}),300)}))}}else t.showModal({title:"提示",content:"抱歉:小助手对"+r.getMsg+"的部分商品未识别,请检查识别信息是否正确",success:function(t){}})})).catch((function(t){r.tui.toast(t)}));case 76:case"end":return e.stop()}}),e,null,[[49,58]])})))()},checkPriceRule:function(t){if(""!=this.customerCategoryList1&&null!=this.customerCategoryList1){null==t&&(t=[]);for(var e=0;e<this.customerCategoryList1.length;e++){var r=!1;if(null!=t)for(var i=0;i<t.length;i++)this.customerCategoryList1[e].categoryId==t[i].categoryId&&(r=!0);0==r&&t.push(this.customerCategoryList1[e])}}return t},getOneData:function(e,r,i){var c=this;return(0,a.default)(s.default.mark((function i(){return s.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:return i.next=2,setTimeout((function(i){c.tui.request("/app/product/getShareList","post",{categoryId:"",pageNum:1,pageSize:"1000",searchStr:e.productSn},!1,!1).then((function(i){if(200==i.code){if(""!=i.result.records)if(i.result.records.length>1){for(var s=0;s<i.result.records.length;s++)e.wholesalePrice&&(i.result.records[s].wholesalePrice=e.wholesalePrice,i.result.records[s].unitPrice=e.wholesalePrice,i.result.records[s].discountAmount=e.wholesalePrice),i.result.records[s].productCount=Number(e.productCount),e.purchasePrice&&(i.result.records[s].purchasePrice=e.purchasePrice);c.$nextTick((function(){c.moreData.push(i.result.records),c.oneData=e}))}else{c.voiceText="",c.voiceText1="",c.$refs.popup.close(),c.$refs.voiceBottomPopup.close();var a={attributeList:'{"颜色":"均色","尺码":"均码"}',productCount:Number(e.productCount)||1,stockCount:i.result.records[0].defaultStockCount};i.result.records[0].productId=i.result.records[0].id,i.result.records[0].saleDetailQueryDTO=[],i.result.records[0].saleDetailQueryDTO.push(a);var o=i.result.records;if(c.oneGoodsId){var u=c.oneGoodsId;if(o.length>0){if(""!=c.carList.get(u).productSn){for(var n=0;n<o.length;n++)for(var d=0;d<o[n].saleDetailQueryDTO.length;d++)""==c.carList.get(u).productName&&(c.carList.get(u).productName=o[0].productName),c.carList.get(u).customerCategoryList=null!=o[0].customerCategoryRule?c.checkPriceRule(JSON.parse(o[0].customerCategoryRule)):c.getNewProductRule(),""==c.carList.get(u).attrId&&(c.carList.get(u).attrId=o[0].attrId),""!=c.carList.get(u).purchasePrice&&null!=c.carList.get(u).purchasePrice||(e.purchasePrice?c.carList.get(u).purchasePrice=e.purchasePrice:c.carList.get(u).purchasePrice=o[0].purchasePrice),""==c.carList.get(u).productPicture&&(c.carList.get(u).productPicture=o[0].productPicture),o[n].saleDetailQueryDTO[d].name=c.sliceMsg(o[n].saleDetailQueryDTO[d].attributeList),0==c.carList.get(u).stockLogList.size?c.carList.get(u).stockLogList.set(o[n].saleDetailQueryDTO[d].attributeList,o[n].saleDetailQueryDTO[d]):1==c.carList.get(u).stockLogList.has(o[n].saleDetailQueryDTO[d].attributeList)?c.carList.get(u).stockLogList.get(o[n].saleDetailQueryDTO[d].attributeList).productCount+=Number(o[n].saleDetailQueryDTO[d].productCount):c.carList.get(u).stockLogList.set(o[n].saleDetailQueryDTO[d].attributeList,o[n].saleDetailQueryDTO[d]),c.carList.get(u).productCount+=Number(o[n].saleDetailQueryDTO[d].productCount);0==c.carList.get(u).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount&&o[0].saleDetailQueryDTO.length>0&&c.carList.get(u).stockLogList.delete('{"颜色":"均色","尺码":"均码"}'),c.carList.get(u).price1=Number(c.carList.get(u).productCount)*c.carList.get(u).purchasePrice}else{var g=!1;c.carList.forEach((function(t,e){if(t.productSn==o[0].productSn)throw g=!0,that.tui.toast("该货号被页面其他商品占用,请重新输入!"),that.carList.get(u).productSn="",setTimeout((function(t){that.$forceUpdate()}),2e3),Error("被占用")})),c.$nextTick((function(){""==c.carList.get(u).productName&&(c.carList.get(u).productName=o[0].productName),0==g&&""==c.carList.get(u).productSn&&(c.carList.get(u).productSn=o[0].productSn),0==g&&(o[0].productId?(c.carList.get(u).id=o[0].productId,c.carList.get(u).productId=o[0].productId,c.carList.get(u).isNew=!1,u=o[0].productId):""==o[0].productSn||null==o[0].productSn?(c.carList.get(u).id=o[0].productName,u=o[0].productName):"货号"==o[0].productSn?(c.carList.get(u).productSn=o[0].productName,c.carList.get(u).id=o[0].productName,u=o[0].productName):o[0].productSn&&(c.carList.get(u).id=o[0].productSn,u=o[0].productSn)),c.$forceUpdate()})),""!=c.carList.get(u).purchasePrice&&null!=c.carList.get(u).purchasePrice||(e.purchasePrice?c.carList.get(u).purchasePrice=e.purchasePrice:c.carList.get(u).purchasePrice=o[0].purchasePrice),""==c.carList.get(u).productPicture&&(c.carList.get(u).productPicture=o[0].productPicture),o[0].productId&&(c.carList.get(u).attrId=o[0].attrId,c.carList.get(u).wholesalePrice=o[0].wholesalePrice,c.carList.get(u).lsPrice=o[0].lsPrice);var l=new Map;c.$nextTick((function(){c.carList.forEach((function(t,e){e!=t.id?l.set(t.id,t):l.set(e,t)})),c.carList=l})),c.$nextTick((function(){for(var t=0;t<o.length;t++)for(var e=0;e<o[t].saleDetailQueryDTO.length;e++)o[t].saleDetailQueryDTO[e].name=c.sliceMsg(o[t].saleDetailQueryDTO[e].attributeList),0==c.carList.get(u).stockLogList.size?c.carList.get(u).stockLogList.set(o[t].saleDetailQueryDTO[e].attributeList,o[t].saleDetailQueryDTO[e]):1==c.carList.get(u).stockLogList.has(o[t].saleDetailQueryDTO[e].attributeList)?c.carList.get(u).stockLogList.get(o[t].saleDetailQueryDTO[e].attributeList).productCount+=Number(o[t].saleDetailQueryDTO[e].productCount):c.carList.get(u).stockLogList.set(o[t].saleDetailQueryDTO[e].attributeList,o[t].saleDetailQueryDTO[e]),c.carList.get(u).productCount+=Number(o[t].saleDetailQueryDTO[e].productCount);c.carList.get(u).price1=Number(c.carList.get(u).productCount)*c.carList.get(u).purchasePrice,c.carList.get(u).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productNum=o[0].defaultStockCount,0==c.carList.get(u).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount&&o[0].saleDetailQueryDTO.length>0&&c.carList.get(u).stockLogList.delete('{"颜色":"均色","尺码":"均码"}')}))}c.$nextTick((function(){c.getAllPrice(),c.oneGoodsId=""}))}else c.tui.toast("抱歉:小助手本次未识别到商品信息,请检查识别信息是否正确")}else{var p={id:"",price:o[0].price,productCount:0,attrId:o[0].attrId,customerCategoryList:null!=o[0].customerCategoryRule?c.checkPriceRule(JSON.parse(o[0].customerCategoryRule)):c.getNewProductRule(),categoryId:""==o[0].categoryId?c.categoryList.categoryId:o[0].categoryId,categoryName:""==o[0].categoryName?c.categoryList.categoryName:o[0].categoryName,wholesalePrice:o[0].wholesalePrice,purchasePrice:e.purchasePrice?e.purchasePrice:o[0].purchasePrice,isNew:null==o[0].productId,productId:o[0].productId,productName:o[0].productName,productSn:o[0].productSn,productPicture:o[0].productPicture,supplierName:o[0].supplierName,productPictures:[],saleDetailQueryDTO:[]};o[0].productId?p.id=o[0].productId:""==o[0].productSn||null==o[0].productSn?p.id=o[0].productName:"货号"==o[0].productSn?(p.productSn=o[0].productName,p.id=o[0].productName):o[0].productSn&&(p.id=o[0].productSn);var L={attributeList:c.getAttribute(o[0].saleDetailQueryDTO[0].attributeList),productCount:Number(o[0].saleDetailQueryDTO[0].productCount)||Number(o[0].saleDetailQueryDTO[0].productCounts),productNum:o[0].saleDetailQueryDTO[0].stockCount,name:c.sliceMsg(c.getAttribute(o[0].saleDetailQueryDTO[0].attributeList)),price:o[0].saleDetailQueryDTO[0].purchasePrice};p.productCount+=Number(o[0].saleDetailQueryDTO[0].productCount),p.saleDetailQueryDTO.push(L),c.carList1.push(p),t.showLoading({title:"加载中..."}),1==r&&c.$nextTick((function(){setTimeout((function(e){c.AiVoice(),t.hideLoading()}),300)}))}}else{c.voiceText="",c.voiceText1="",c.$refs.popup.close(),c.$refs.voiceBottomPopup.close(),e.productCount&&(e.productCount=Number(e.productCount));var h={id:e.productSn,productCount:Number(e.productCount)||0,productName:e.productName,productSn:e.productSn,customerCategoryList:c.getNewProductRule(),categoryId:c.categoryList.categoryId,categoryName:c.categoryList.categoryName,purchasePrice:e.purchasePrice||0,wholesalePrice:e.wholesalePrice||0,saleDetailQueryDTO:[{attributeList:'{"颜色":"均色","尺码":"均码"}',productCount:Number(e.productCount)||1,stockCount:null}]},m=[];if(m.push(h),c.oneGoodsId){var f=c.oneGoodsId;if(m.length>0){if(""!=c.carList.get(f).productSn){for(var P=0;P<m.length;P++)for(var y=0;y<m[P].saleDetailQueryDTO.length;y++)""==c.carList.get(f).productName&&(c.carList.get(f).productName=m[0].productName),""==c.carList.get(f).attrId&&(c.carList.get(f).attrId=m[0].attrId),c.carList.get(f).customerCategoryList=m[0].customerCategoryList,""!=c.carList.get(f).purchasePrice&&null!=c.carList.get(f).purchasePrice||(c.carList.get(f).purchasePrice=m[0].purchasePrice),""==c.carList.get(f).productPicture&&(c.carList.get(f).productPicture=m[0].productPicture),m[P].saleDetailQueryDTO[y].name=c.sliceMsg(m[P].saleDetailQueryDTO[y].attributeList),0==c.carList.get(f).stockLogList.size?c.carList.get(f).stockLogList.set(m[P].saleDetailQueryDTO[y].attributeList,m[P].saleDetailQueryDTO[y]):1==c.carList.get(f).stockLogList.has(m[P].saleDetailQueryDTO[y].attributeList)?c.carList.get(f).stockLogList.get(m[P].saleDetailQueryDTO[y].attributeList).productCount+=Number(m[P].saleDetailQueryDTO[y].productCount):c.carList.get(f).stockLogList.set(m[P].saleDetailQueryDTO[y].attributeList,m[P].saleDetailQueryDTO[y]),c.carList.get(f).productCount+=Number(m[P].saleDetailQueryDTO[y].productCount);0==c.carList.get(f).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount&&m[0].saleDetailQueryDTO.length>0&&c.carList.get(f).stockLogList.delete('{"颜色":"均色","尺码":"均码"}'),c.carList.get(f).price1=Number(c.carList.get(f).productCount)*c.carList.get(f).purchasePrice}else{var k=!1;c.carList.forEach((function(t,e){if(t.productSn==m[0].productSn)throw k=!0,that.tui.toast("该货号被页面其他商品占用,请重新输入!"),that.carList.get(f).productSn="",setTimeout((function(t){that.$forceUpdate()}),2e3),Error("被占用")})),c.$nextTick((function(){""==c.carList.get(f).productName&&(c.carList.get(f).productName=m[0].productName),c.carList.get(f).customerCategoryList=m[0].customerCategoryList,0==k&&""==c.carList.get(f).productSn&&(c.carList.get(f).productSn=m[0].productSn),0==k&&(m[0].productId?(c.carList.get(f).id=m[0].productId,c.carList.get(f).isNew=!1,f=m[0].productId):""==m[0].productSn||null==m[0].productSn?(c.carList.get(f).id=m[0].productName,f=m[0].productName):"货号"==m[0].productSn?(c.carList.get(f).productSn=m[0].productName,c.carList.get(f).id=m[0].productName,f=m[0].productName):m[0].productSn&&(c.carList.get(f).id=m[0].productSn,f=m[0].productSn)),c.$forceUpdate()})),""!=c.carList.get(f).purchasePrice&&null!=c.carList.get(f).purchasePrice||(c.carList.get(f).purchasePrice=m[0].purchasePrice),""==c.carList.get(f).productPicture&&(c.carList.get(f).productPicture=m[0].productPicture),m[0].productId&&(c.carList.get(f).attrId=m[0].attrId,c.carList.get(f).lsPrice=m[0].lsPrice),c.carList.get(f).wholesalePrice=m[0].wholesalePrice;var v=new Map;c.$nextTick((function(){c.carList.forEach((function(t,e){e!=t.id?v.set(t.id,t):v.set(e,t)})),c.carList=v})),c.$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=c.sliceMsg(m[t].saleDetailQueryDTO[e].attributeList),0==c.carList.get(f).stockLogList.size?c.carList.get(f).stockLogList.set(m[t].saleDetailQueryDTO[e].attributeList,m[t].saleDetailQueryDTO[e]):1==c.carList.get(f).stockLogList.has(m[t].saleDetailQueryDTO[e].attributeList)?c.carList.get(f).stockLogList.get(m[t].saleDetailQueryDTO[e].attributeList).productCount+=Number(m[t].saleDetailQueryDTO[e].productCount):c.carList.get(f).stockLogList.set(m[t].saleDetailQueryDTO[e].attributeList,m[t].saleDetailQueryDTO[e]),c.carList.get(f).productCount+=Number(m[t].saleDetailQueryDTO[e].productCount);c.carList.get(f).price1=Number(c.carList.get(f).productCount)*c.carList.get(f).purchasePrice,0==c.carList.get(f).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount&&m[0].saleDetailQueryDTO.length>0&&c.carList.get(f).stockLogList.delete('{"颜色":"均色","尺码":"均码"}')}))}c.$nextTick((function(){c.getAllPrice(),c.oneGoodsId=""}))}else c.tui.toast("抱歉:小助手本次未识别到商品信息,请检查识别信息是否正确")}else{for(var N=0;N<m.length;N++){var C={id:"",price:m[N].price,productCount:0,attrId:m[N].attrId,customerCategoryList:m[N].customerCategoryList,categoryId:""==m[N].categoryId?c.categoryList.categoryId:m[N].categoryId,categoryName:""==m[N].categoryName?c.categoryList.categoryName:m[N].categoryName,wholesalePrice:m[N].wholesalePrice,purchasePrice:m[N].purchasePrice,isNew:null==m[N].productId,productId:m[N].productId,productName:m[N].productName,productSn:m[N].productSn,productPicture:m[N].productPicture,supplierName:m[N].supplierName,productPictures:[],saleDetailQueryDTO:[]};m[N].productId?C.id=m[N].productId:""==m[N].productSn||null==m[N].productSn?C.id=m[N].productName:"货号"==m[N].productSn?(C.productSn=m[N].productName,C.id=m[N].productName):m[N].productSn&&(C.id=m[N].productSn);for(var b=0;b<m[N].saleDetailQueryDTO.length;b++){var T={attributeList:c.getAttribute(m[N].saleDetailQueryDTO[b].attributeList),productCount:Number(m[N].saleDetailQueryDTO[b].productCount)||Number(m[N].saleDetailQueryDTO[b].productCounts),productNum:"",name:c.sliceMsg(c.getAttribute(m[N].saleDetailQueryDTO[b].attributeList)),price:m[N].saleDetailQueryDTO[b].purchasePrice};C.productCount+=Number(m[N].saleDetailQueryDTO[b].productCount),C.saleDetailQueryDTO.push(T)}c.carList1.push(C)}t.showLoading({title:"加载中..."}),1==r&&c.$nextTick((function(){setTimeout((function(e){c.AiVoice(),t.hideLoading()}),500)}))}}setTimeout((function(t){1==r&&c.moreData.length>0&&(c.$refs.popup.close(),c.$refs.voiceBottomPopup.close(),c.$refs.oneDataPopup.open(),c.showPopup(0))}),300)}}))}),100);case 2:case"end":return i.stop()}}),i)})))()},delItemSn:function(e){var r=this;t.showModal({title:"提示",content:"确定删除此条货号规则吗?",success:function(i){i.confirm&&r.tui.request("/app/productSn/checkProductSn","post",{snPre:e.value},!1,!0).then((function(e){200==e.code?r.tui.request("/app/productSn/deleteProductSn","post",{id:e.result.id},!1,!0).then((function(e){200==e.code?(r.tui.toast("删除成功"),setTimeout((function(t){r.getSnList()}),1e3)):t.showToast({title:e.message,icon:"none"})})).catch((function(t){})):t.showToast({title:e.message,icon:"none"})})).catch((function(t){}))}})},dialogInputConfirm:function(t){if(""!=this.categoryText){this.$refs.inputDialog.close();var e={isChecked:!1,value:this.categoryText};"0"==this.isOpenId?(this.goodsDetail.attributeList[0].value.push(e),this.dataObj.set(e.value,"颜色")):"1"==this.isOpenId&&(this.goodsDetail.attributeList[1].value.push(e),this.dataObj.set(e.value,"尺码")),this.$refs.clearInput.onClear(),this.categoryText="",this.$forceUpdate()}else this.tui.toast("请输入规格值后提交")},dialogClose:function(){this.inputVal="",this.$refs.inputDialog.close(),this.$refs.clearInput.onClear(),this.categoryText=""},trimWhitespace:function(t){return t.replace(/\s+/g,"")},combination:function(t){var e=[[]];return t.map((function(t){var r=[];e.map((function(e){t.specs.map((function(t){r.push([].concat((0,c.default)(e),[t]))}))})),e=r})),e},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.$refs.clearInput.onClear(),t.categoryText=""):t.tui.toast(e.message)})).catch((function(t){}))},scanCodeAdd:function(){var e=this;t.scanCode({success:function(r){if("QR_CODE"==r.scanType){var i=n.default.decode(r.result.split(",")[1]);i==t.getStorageSync("shopId").substring("10","12")?(e.productId=n.default.decode(r.result.split(",")[0]),e.toggle("bottom",n.default.decode(r.result.split(",")[0]))):e.tui.toast("您的店铺中暂无该商品!")}else e.tui.request("/app/product/getByBarcode","POST",{barcode:r.result},!1,!0).then((function(t){200==t.code?(e.productId=t.result[0].id,""==t.result?e.tui.toast("您的店铺中暂无该商品!"):e.toggle("bottom",t.result[0].id)):e.tui.toast(r.message)})).catch((function(t){e.tui.toast(t)}))},fail:function(e){t.showToast({title:"扫描失败",icon:"none"})}})},getZhuBigImage:function(e){var r=[];r.push(e),t.previewImage({urls:r})},uploadFilePromise:function(e){var r=this;t.chooseMedia({count:1,mediaType:["image"],sourceType:["album","camera"],camera:"back",success:function(i){t.compressImage({src:i.tempFiles[0].tempFilePath,quality:50,success:function(i){t.uploadFile({url:r.tui.interfaceUrl()+"/upload/file",filePath:i.tempFilePath,name:"file",header:{"content-type":"multipart/form-data",accessToken:r.tui.getToken()},formData:{},success:function(t){r.carList.get(e[0]).productPicture="";var i=JSON.parse(t.data);r.carList.get(e[0]).productPicture=i.result,r.$forceUpdate()}})}})}})},goodsAdd:function(){t.navigateTo({url:"/package1/inventory/changeGoods1"})},mergeGoods:function(){},uploadZi:function(t){},addGategory:function(e){var r=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?(r.getGategoryList(),t.showToast({title:"添加成功",icon:"none"})):t.showToast({title:"添加失败",icon:"none"}),r.$refs.addGateDialog.close()})).catch((function(t){}))},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 r=0;r<this.evalue.length;r++)this.evalue[r]==this.temporaryList[e].name&&(this.temporaryList[e].productCount=Number(this.allChangeNum));for(var i=0;i<this.pageOldTemList.length;i++)this.temporaryList[e].attributeList==this.pageOldTemList[i].attributeList&&(this.pageOldTemList[i].productCount=Number(this.temporaryList[e].productCount));for(r=0;r<this.oldTemList.length;r++)this.temporaryList[e].attributeList==this.oldTemList[r].attributeList&&(this.oldTemList[r].productCount=Number(this.temporaryList[e].productCount))}this.isPlusAndMinus,this.temporaryChange()},maskClick:function(){},mapMinusNum:function(t){var e=this;return(0,a.default)(s.default.mark((function r(){return s.default.wrap((function(r){while(1)switch(r.prev=r.next){case 0:e.temporaryList[t].productCount--,e.temporaryChange();case 2:case"end":return r.stop()}}),r)})))()},mapPlusNum:function(t){this.temporaryList[t].productCount++,this.temporaryChange()},oneMinusNum:function(t,e){var r=this;return(0,a.default)(s.default.mark((function i(){var c;return s.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:return c=r,r.carList.get(t).productCount=0,r.carList.get(t).returnCount=0,r.carList.get(t).stockLogList.get(e).productCount<=0?r.carList.get(t).stockLogList.get(e).productCount=0:r.carList.get(t).stockLogList.get(e).productCount--,i.next=6,r.carList.get(t).stockLogList.forEach((function(e,r){e.productCount<0?c.carList.get(t).returnCount=Number(c.carList.get(t).returnCount)+Math.abs(e.productCount):c.carList.get(t).productCount=Number(c.carList.get(t).productCount)+Number(e.productCount)}));case 6:return i.next=8,r.$nextTick((function(){c.carList.get(t).price1=Number(c.carList.get(t).productCount)*c.carList.get(t).purchasePrice}));case 8:r.$forceUpdate(),r.getAllPrice();case 10:case"end":return i.stop()}}),i)})))()},onePlusNum:function(t,e){this.carList.get(t).stockLogList.get(e).productCount<0?this.carList.get(t).stockLogList.get(e).productCount=0:this.carList.get(t).stockLogList.get(e).productCount++,this.carList.get(t).productCount++,this.carList.get(t).price1=Number(this.carList.get(t).productCount)*this.carList.get(t).purchasePrice,this.getAllPrice()},yuyinChange:function(){this.isVoice=!1},numChange:function(t,e){this.linshiPrice==t.target.value?this.temporaryList[e].productCount=Number(t.target.value):(""==t.detail.value?this.temporaryList[e].productCount=Number(this.linshiPrice):0==t.detail.value?this.temporaryList[e].productCount=0:this.temporaryList[e].productCount=Number(t.detail.value),this.$forceUpdate()),this.temporaryChange()},mapnumChange:function(t,e,r){var i=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(r).productCount=Number(t.target.value):""==t.detail.value?this.carList.get(e).stockLogList.get(r).productCount=Number(this.linshiPrice):this.carList.get(e).stockLogList.get(r).productCount=Number(t.detail.value),this.carList.get(e).stockLogList.forEach((function(t,r){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)*s.carList.get(e).purchasePrice})),this.$nextTick((function(){i.getAllPrice()}))},voiceGetOne:function(){this.voiceGetOneData=!this.voiceGetOneData},obtainPrice:function(t,e,r,i){this.linshiPrice=t.target.value,"danjia"==e?this.carList.get(r).purchasePrice="":"pifa"==e?this.carList.get(r).wholesalePrice="":"lingshou"==e?(this.carList.get(r).lsprice="",this.$forceUpdate()):"danjishu"==e?(this.temporaryList[r].productCount="",this.$forceUpdate()):"zongjishu"==e?this.allChangeNum="":"shouldPay"==e?this.shouldPay="":"mapdanjishu"==e?(this.carList.get(r).stockLogList.get(i).productCount="",this.$forceUpdate()):"alreadyPay"==e&&(this.alreadyPay=""),this.$forceUpdate()},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++;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++);for(var r=0;r<this.pageOldTemList.length;r++)this.temporaryList[t].attributeList==this.pageOldTemList[r].attributeList&&(this.pageOldTemList[r].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()},minusNum:function(){this.isPlusAndMinus;for(var t=0;t<this.temporaryList.length;t++){if(0==this.evalue.length)this.temporaryList[t].productCount--;else for(var e=0;e<this.evalue.length;e++)this.evalue[e]==this.temporaryList[t].name&&this.temporaryList[t].productCount--;for(var r=0;r<this.pageOldTemList.length;r++)this.temporaryList[t].attributeList==this.pageOldTemList[r].attributeList&&(this.pageOldTemList[r].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()},goChooseGoods:function(){t.navigateTo({url:"/package1/AI/AiChangeGoods"})},longPrec:function(e,r,i){var s=this;t.showModal({title:"提示",content:"确定删除此默认规格吗?",success:function(c){t.showLoading({title:"加载中..."}),c.confirm&&s.delDefaultCate(e,r,i),setTimeout((function(e){t.hideLoading()}),500)}})},attrNameChange:function(e,r,i){var s=this;t.showLoading({title:"加载中..."}),this.goodsDetail.attributeList[e].isChecked=!this.goodsDetail.attributeList[e].isChecked,this.goodsDetail.attributeList[e].value[i].isChecked=!this.goodsDetail.attributeList[e].value[i].isChecked,-1!=this.goodsList[e].specs.indexOf(r)?this.goodsList[e].specs.splice(this.goodsList[e].specs.indexOf(r),1):this.goodsList[e].specs.push(r);for(var c=0,a=0;a<this.goodsList.length;a++)this.goodsList[a].specs.length>0&&c++;var o=[];c==this.goodsList.length&&(o=this.combination(this.goodsList)),this.evalue=[];for(var u=[],n=0;n<o.length;n++){for(var d="",g="{",l=0;l<o[n].length;l++)l!=o[n].length-1?(d+=o[n][l]+"/",g+='"'+this.dataObj.get(o[n][l])+'":"'+o[n][l]+'",'):(d+=o[n][l],g+='"'+this.dataObj.get(o[n][l])+'":"'+o[n][l]+'"');g+="}",u.push(g),this.evalue.push(d)}if(0==c&&(this.oldTemList=[],this.temporaryList=this.pageOldTemList),0==this.temporaryList.length){if(c==this.goodsList.length)for(a=0;a<u.length;a++)this.attributeList={attributeList:u[a],productCount:Number(this.temporaryNum),productNum:this.productNum,name:this.evalue[a],price:this.purchasePrice},this.temporaryList.push(this.attributeList)}else{var p=0;for(a=0;a<u.length;a++){for(n=0;n<this.temporaryList.length;n++)this.temporaryList[n].attributeList==u[a]&&(p=Number(this.temporaryList[n].productCount));this.attributeList={attributeList:u[a],productCount:p||0,productNum:this.productNum,name:this.evalue[a],price:this.purchasePrice},this.newTemList.push(this.attributeList),p=0}for(a=0;a<this.oldTemList.length;a++){var L=!0;for(n=0;n<this.newTemList.length;n++)this.oldTemList[a].attributeList==this.newTemList[n].attributeList&&(this.newTemList[n].productCount=Number(this.oldTemList[a].productCount),L=!1);this.newTemList.length>0&&L&&this.newTemList.push(this.oldTemList[a])}for(a=0;a<this.pageOldTemList.length;a++){var h=!0;for(n=0;n<this.newTemList.length;n++)this.pageOldTemList[a].attributeList==this.newTemList[n].attributeList&&(this.newTemList[n].productCount=Number(this.pageOldTemList[a].productCount),h=!1);this.newTemList.length>0&&h&&this.newTemList.push(this.pageOldTemList[a])}}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),s.$forceUpdate()})),c!=this.goodsList.length&&0==this.oldTemList.length&&0==this.pageOldTemList.length&&(this.newTemList=[],this.temporaryList=[]),0!=this.newTemList.length&&c==this.goodsList.length&&(this.temporaryList=this.newTemList,this.oldTemList=[],this.newTemList=[]),setTimeout((function(e){t.hideLoading()}),200)},clickGategroy:function(t){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=[])},change:function(){this.allChangeNum=0,this.oldTemList=[]},lunbochange:function(t){this.current=t.detail.current},toggle:function(e,r){"bottom"==e?(t.showLoading({title:"加载中..."}),this.allChangeNum=0,this.getById(r)):"typePopup"==e?(this.productId=r,this.getGategoryList(),this.$refs.typePopup.open()):"addGateDialog"==e?this.$refs.addGateDialog.open("bottom"):"mergePopup"==e?(this.mergeId=r,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="",this.$refs.voiceBottomPopup.open("bottom")):"oneGoods"==e&&(this.oneGoodsId=r,this.initRecord(),this.voiceText="",this.voiceText1="",this.$refs.popup.open("center"))},kaishi:function(){0==this.isVoice&&(this.recordState=!0,t.vibrateShort(),g.start({duration:6e4,lang:"zh_CN"}))},jieshu:function(){this.recordState=!1,g.stop()},isCharPrecededByNumber:function(t,e){var r=new RegExp("\\d".concat(e),"g");return r.test(t)},replaceCharAfterNumber:function(t,e,r){var i=new RegExp("\\d".concat(e),"g");return t.replace(i,(function(t){return t.replace(e,r)}))},isQuantityFollowsProductCode:function(t){var e=t.split("货号")[1];if(!e||-1===e.indexOf("数量"))return!1;var r=e.split("数量")[0],i=/[^\u4e00-\u9fa5]/.test(r);return!i},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:/,零售价:(.*?)。/}].forEach((function(r){var i=r.name,s=r.regex,c=t.match(s);c&&c[1]&&(e[i]=c[1].trim())})),e.productCount&&-1!=e.productCount.indexOf(",")&&(e.productCount=e.productCount.split(",")[0]),e.purchasePrice&&-1!=e.purchasePrice.indexOf(",")&&(e.purchasePrice=e.purchasePrice.split(",")[0]),e.productName&&-1!=e.productName.indexOf(",")&&(e.productName=e.productName.split(",")[0]),e.wholesalePrice&&-1!=e.wholesalePrice.indexOf(",")&&(e.wholesalePrice=e.wholesalePrice.split(",")[0]),e.lsprice&&-1!=e.lsprice.indexOf(",")&&(e.lsprice=e.lsprice.split(",")[0]),e},initRecord:function(){var e=this,r=this;g.stop(),g.onStop=function(t){var i=e.spliceMsg(e.convertChineseToArabic(t.result));i=e.removeSpacesAndCommas(i),i=e.removePunctuationAndSpaces(i),-1!=i.indexOf("点")&&(i=r.replaceCharAfterNumber(i,"点",".")),-1!=i.indexOf(",名称")&&(i=i.replace(/,名称/g,"名称")),-1!=i.indexOf("名称,")&&(i=i.replace(/名称,/g,"名称")),-1!=i.indexOf("名称")&&(i=i.replace(/名称/g,",名称:")),-1!=i.indexOf(",单价")&&(i=i.replace(/,单价/g,"单价")),-1!=i.indexOf("单价,")&&(i=i.replace(/单价,/g,"单价")),-1!=i.indexOf("单价")&&(i=i.replace(/单价/g,",单价:")),-1!=i.indexOf(",数量")&&(i=i.replace(/,数量/g,"数量")),-1!=i.indexOf("数量,")&&(i=i.replace(/数量,/g,"数量")),-1!=i.indexOf("数量")&&(i=i.replace(/数量/g,",数量:")),-1!=i.indexOf(",批发价")&&(i=i.replace(/,批发价/g,"批发价")),-1!=i.indexOf("批发价,")&&(i=i.replace(/批发价,/g,"批发价")),-1!=i.indexOf("批发价::")&&(i=i.replace(/批发价::/g,"批发价")),-1!=i.indexOf("批发价:")&&(i=i.replace(/批发价:/g,"批发价")),-1!=i.indexOf("批发价")&&(i=i.replace(/批发价/g,",批发价:")),i.startsWith("号")&&(i="货号"+i.substr(1)),i.startsWith("货号")||(i="货号"+i),-1!=i.indexOf("货号,")&&(i=i.replace(/货号,/g,"货号")),-1!=i.indexOf("货号::")&&(i=i.replace(/货号::/g,"货号")),-1!=i.indexOf("货号:")&&(i=i.replace(/货号:/g,"货号")),-1!=i.indexOf("货号")&&(i=i.replace(/货号/g,"货号:")),i=i.replace(/[沟勾钩]/g,"J"),i=e.convertStringCorrectly(i),0==i.indexOf(",")&&(i=i.substr(1)),""==r.voiceText||null==r.voiceText?(r.voiceText=i,r.voiceText1=i):(r.voiceText+="\n"+i,r.voiceText1=i+"\n"+r.voiceText1)},g.onError=function(e){"-30011"==e.retcode&&(r.isVoice=!0),"-30004"==e.retcode&&(r.isVoice=!1,t.hideToast(),t.showToast({title:"未识别到声音信息,请重新录入",icon:"none"})),"-40001"==e.retcode&&t.showToast({title:"使用次数超限制,请联系管理员!",icon:"none"})}},getAttribute:function(t){return t=t.replace(/"色"(?![^{]*": *"色")/g,'"均色"'),t=t.replace(/"码"(?![^{]*": *"码")/g,'"均码"'),t},clearText:function(){this.voiceText="",this.voiceText1=""},getText:function(t){this.voiceText=t.detail.value},convertStringCorrectly:function(t){var e=t.replace(/(\d+)十(?!\d)/g,"$10"),r=e.replace(/(\d+)十(?=\d)/g,"$1");return r},spliceMsg:function(t){return t.replace(/嗯|啊|儿|阿|恩/g,"")},convertChineseToArabic:function(t){var e={"幺":1,"一":1,"二":2,"两":2,"三":3,"四":4,"五":5,"六":6,"七":7,"八":8,"九":9,"杠":"-","刚":"-","军色":"均色","叉":"X","井":"#","时间":"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]}))},clickMerge:function(t,e){var r=this;this.carList.get(this.mergeId).stockLogList.forEach((function(e,i){r.carList.get(t).stockLogList.has(i)?r.carList.get(t).stockLogList.get(i).productCount+=Number(r.carList.get(r.mergeId).stockLogList.get(i).productCount):r.carList.get(t).stockLogList.set(i,r.carList.get(r.mergeId).stockLogList.get(i)),r.carList.get(t).productCount+=Number(r.carList.get(r.mergeId).stockLogList.get(i).productCount),r.carList.get(t).price1=Number(r.carList.get(t).productCount)*r.carList.get(t).purchasePrice})),this.carList.delete(this.mergeId),this.$forceUpdate(),this.getAllPrice(),this.$refs.mergePopup.close()},AiAddSpec:function(t){this.getById(t,1)},pictureAdd:function(e,r){var i=this;if(t.showLoading({title:"加载中...",mask:!0}),""!=e){if(this.childrenId=e,this.carList.get(e).productPictures.length>0&&"huan"!=r)return this.productPictures=this.carList.get(e).productPictures,this.$refs.showImgDiaLog.open(),void t.hideLoading();"huan"==r&&this.$refs.showImgDiaLog.close()}else this.childrenId="";t.chooseMedia({count:9,mediaType:["image"],sourceType:["album"],success:function(t){""!=i.childrenId&&(i.carList.get(i.childrenId).productPictures=[]);for(var e=0;e<t.tempFiles.length;e++)i.upLoadFile(t.tempFiles[e].tempFilePath,e+1),i.zhuImgList.push(t.tempFiles[e].tempFilePath)},fail:function(e){t.hideLoading()}}),t.hideLoading()},upLoadFile:function(e,r){var i=this;return(0,a.default)(s.default.mark((function c(){var a,o;return s.default.wrap((function(s){while(1)switch(s.prev=s.next){case 0:return a=i,o=t.getStorageSync("hiver_token"),s.next=4,t.compressImage({src:e,quality:50,success:function(e){t.uploadFile({url:a.tui.interfaceUrl()+"/upload/file",filePath:e.tempFilePath,name:"file",header:{"content-type":"multipart/form-data",accessToken:o},formData:{},success:function(t){var e=JSON.parse(t.data);if(""!=a.childrenId){var i={productPicture:e.result};a.carList.get(a.childrenId).productPictures.push(i),a.$forceUpdate()}else setTimeout((function(){a.isSnList(e.result)}),100*r)},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()}}),c)})))()},removeSpacesAndCommas:function(t){return t.replace(/[ ,,]/g,"")},getById:function(e,r){var i=this,s=this;if(t.showLoading({title:"加载中..."}),this.isBottom=!1,1==r){if(s.goodsDetail=e,s.goodsDetail.attributeList=[],this.goodsDetail.isNew){this.goodsList=[],s.goodsDetail.attributeList=this.defaultList;for(var c=0;c<s.goodsDetail.attributeList.length;c++){for(var a=0;a<s.goodsDetail.attributeList[c].value.length;a++)s.dataObj.set(s.goodsDetail.attributeList[c].value[a].value,s.goodsDetail.attributeList[c].name);s.goodsList.push({specs:[]})}this.$refs.shopPopup.open("bottom")}else s.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId","POST",{categoryId:s.goodsDetail.attrId},!1,!0).then((function(t){if(200==t.code){if(s.goodsList=[],"string"==typeof t.result.attributeAndValue){var e=JSON.parse(t.result.attributeAndValue),r=[];for(var i in e){for(var c=[],a=0;a<e[i].length;a++)c.push({value:e[i][a],isChecked:!1}),s.dataObj.set(e[i][a],i);r.push({name:i,value:c})}s.goodsDetail.attributeList=r;for(a=0;a<s.goodsDetail.attributeList.length;a++){s.goodsList.push({specs:[]})}}else s.tui.toast("失败了");s.getKCList(t.result.stock)}else s.tui.toast(t.message)})).catch((function(t){}));if(this.pageOldTemList=[],s.temporaryList=[],s.carList.size>0){var o=!1,u="";u=e.isNew?e.id:e.productId,1==s.carList.get(u).stockLogList.size&&null!=s.carList.get(u).stockLogList.get('{"颜色":"均色","尺码":"均码"}')&&void 0!=s.carList.get(u).stockLogList.get('{"颜色":"均色","尺码":"均码"}')&&(s.carList.get(u).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount=0),s.carList.forEach((function(t,r){t.stockLogList1=[],0==o&&(t.stockLogList.forEach((function(e,r){if(0==t.stockLogList1.length){var i={productCount:Number(e.productCount),name:e.name,attributeList:r,productNum:e.productNum};t.stockLogList1.push(i)}else for(var s=0;s<t.stockLogList1.length;s++)if(t.stockLogList1[s].attributeList!=r&&t.stockLogList1.length==s+1){var c={productCount:Number(e.productCount),name:e.name,attributeList:r,productNum:e.productNum};t.stockLogList1.push(c)}})),t.productId==e?(s.zNum=Number(t.productCount),s.temporaryList=t.stockLogList1,s.pageOldTemList=t.stockLogList1,s.oldTemList=t.stockLogList1,o=!0):t.isNew?t.id==e.id&&(s.zNum=Number(t.productCount),s.temporaryList=t.stockLogList1,s.pageOldTemList=t.stockLogList1,s.oldTemList=t.stockLogList1,o=!0):t.productId==e.productId&&(s.zNum=Number(t.productCount),s.temporaryList=t.stockLogList1,s.pageOldTemList=t.stockLogList1,s.oldTemList=t.stockLogList1,o=!0),t.stockLogList1=[])})),s.zNum=0}}else this.tui.request("/app/product/getById/"+e,"POST",{},!1,!0).then((function(t){if(200==t.code){if(0==t.result.delFlag)return void s.tui.toast("请将商品上架后再操作!");if(0==t.result.inStorageStatus)return void s.tui.toast("请将商品入库后再操作!");s.goodsDetail=t.result,s.goodsDetail.attributeList=i.defaultList,s.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId","POST",{categoryId:s.goodsDetail.attrId||s.categoryList.attrId},!1,!0).then((function(t){if(200==t.code){if(s.goodsList=[],"string"==typeof t.result.attributeAndValue){var r=JSON.parse(t.result.attributeAndValue),c=[];for(var a in r){for(var o=[],u=0;u<r[a].length;u++)o.push({value:r[a][u],isChecked:!1}),s.dataObj.set(r[a][u],a);c.push({name:a,value:o})}s.goodsDetail.attributeList=c;for(u=0;u<s.goodsDetail.attributeList.length;u++){s.goodsList.push({specs:[]})}}else s.tui.toast("失败了");if(i.pageOldTemList=[],s.temporaryList=[],s.carList.size>0){var n=!1;s.carList.forEach((function(t,r){t.stockLogList1=[],0==n&&(t.stockLogList.forEach((function(e,r){if(0==t.stockLogList1.length){var i={productCount:Number(e.productCount),name:e.name,attributeList:r,productNum:e.productNum};t.stockLogList1.push(i)}else for(var s=0;s<t.stockLogList1.length;s++)if(t.stockLogList1[s].attributeList!=r&&t.stockLogList1.length==s+1){var c={productCount:Number(e.productCount),name:e.name,attributeList:r,productNum:e.productNum};t.stockLogList1.push(c)}})),t.productId==e?(s.zNum=Number(t.productCount),s.temporaryList=t.stockLogList1,s.pageOldTemList=t.stockLogList1,s.oldTemList=t.stockLogList1,n=!0):t.isNew?t.id==e.id&&(s.zNum=Number(t.productCount),s.temporaryList=t.stockLogList1,s.pageOldTemList=t.stockLogList1,s.oldTemList=t.stockLogList1,n=!0):t.productId==e.productId&&(s.zNum=Number(t.productCount),s.temporaryList=t.stockLogList1,s.pageOldTemList=t.stockLogList1,s.oldTemList=t.stockLogList1,n=!0),t.stockLogList1=[])})),s.zNum=0,s.carList.get(e)&&1==s.carList.get(e).stockLogList1.length&&'{"颜色":"均色","尺码":"均码"}'==s.carList.get(e).stockLogList1[0].attributeList&&(s.carList.get(e).stockLogList1[0].productCount=0)}i.getKCList(t.result.stock)}else s.tui.toast(t.message)})).catch((function(t){}))}else i.tui.toast(t.message)})).catch((function(t){}));t.hideLoading()},changeSn:function(){},isSnList:function(e){var r=this;return(0,a.default)(s.default.mark((function i(){return s.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(1!=r.isGenerateSnRadio){i.next=5;break}return i.next=3,r.addPageGoods(e,"");case 3:i.next=13;break;case 5:if(!(r.snList.length>0)){i.next=10;break}return i.next=8,r.getNewSn(e);case 8:i.next=13;break;case 10:r.zhuImg=e,r.$refs.SNDialog.open("center"),t.hideLoading();case 13:case"end":return i.stop()}}),i)})))()},getNewSn:function(e){var r=this;this.tui.request("/app/productSn/getNewProductSn","POST",{snPre:this.snName},!1,!0).then((function(i){200==i.code?r.tui.request("/app/product/getByProductSn","post",{productSn:i.result},!1,!0).then((function(t){200==t.code&&(""!=t.result?r.generateSn(value):r.addPageGoods(e,i.result))})):(t.hideLoading(),r.tui.toast(res.message))})).catch((function(e){t.hideLoading()}))},addPageGoods:function(e,r){var i={id:r||(0,u.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:r||"",stockLogList:new Map,stockLogList1:[]};i.stockLogList.set('{"颜色":"均色","尺码":"均码"}',{name:"均色/均码",productCount:0}),this.carList.set(i.id,i),this.$forceUpdate(),t.hideLoading()},getNewProductRule:function(){var t=[];if(null!=this.customerCategoryList1&&""!=this.customerCategoryList1)for(var e=0;e<this.customerCategoryList1.length;e++){var r={categoryId:this.customerCategoryList1[e].categoryId,categoryName:this.customerCategoryList1[e].categoryName,categoryPrice:this.customerCategoryList1[e].categoryPrice};t.push(r)}else t=null;return t},getKCList:function(t){this.pecsList=t,this.$refs.shopPopup.open("bottom")},temporaryChange:function(t,e){if(""!=e&&void 0!=e){for(var r=0;r<this.pageOldTemList.length;r++)if(e.attributeList==this.pageOldTemList[r].attributeList){this.pageOldTemList[r].productCount=Number(e.productCount);break}for(var i=0;i<this.oldTemList.length;i++)if(e.attributeList==this.oldTemList[i].attributeList){this.oldTemList[i].productCount=Number(e.productCount);break}}this.zNum=0;for(var s=0;s<this.temporaryList.length;s++)this.zNum+=Number(this.temporaryList[s].productCount)||0},clickClose:function(t){this.evalue=[];for(var e=0;e<this.goodsDetail.attributeList.length;e++){this.goodsDetail.attributeList[e].isChecked=!1;for(var r=0;r<this.goodsDetail.attributeList[e].value.length;r++)this.goodsDetail.attributeList[e].value[r].isChecked=!1}this.allChangeNum=0},temporaryCheck:function(){t.showLoading({title:"加载中..."}),this.evalue=[];var e=[],r={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,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.price,productSn:this.goodsDetail.productSn,productPicture:this.goodsDetail.productPicture,supplierName:this.goodsDetail.supplierName,productPictures:[],saleDetailQueryDTO:this.temporaryList};e.push(r),this.temporaryList=[],this.oldTemList=[],this.purchasePrice="",this.zPrice="",this.zNum="";for(var i=0;i<this.goodsDetail.attributeList.length;i++){this.goodsDetail.attributeList[i].isChecked=!1;for(var s=0;s<this.goodsDetail.attributeList[i].value.length;s++)this.goodsDetail.attributeList[i].value[s].isChecked=!1}if(0==this.carList.size){for(var c=0;c<e.length;c++){for(var a={purchasePrice:0==this.userType?this.goodsDetail.purchasePrice:"",price:this.goodsDetail.price,price1:0,productCount:0,id:e[c].id,productId:e[c].id,customerCategoryList:null!=e[c].customerCategoryRule?this.checkPriceRule(e[c].customerCategoryRule):this.getNewProductRule(),wholesalePrice:this.goodsDetail.wholesalePrice,categoryName:this.goodsDetail.categoryName,categoryId:e[c].categoryId,attrId:e[c].attrId,lsprice:this.goodsDetail.price,productName:e[c].productName,productPicture:e[c].productPicture,productSn:e[c].productSn,stockLogList:new Map,productPictures:[],stockLogList1:[]},o=0;o<e[c].saleDetailQueryDTO.length;o++){var u={productCount:Number(e[c].saleDetailQueryDTO[o].productCount),name:e[c].saleDetailQueryDTO[o].name,productNum:e[c].saleDetailQueryDTO[o].productNum};e[c].saleDetailQueryDTO.length>1?u.productCount>0&&a.stockLogList.set(e[c].saleDetailQueryDTO[o].attributeList,u):a.stockLogList.set(e[c].saleDetailQueryDTO[o].attributeList,u),a.productCount+=Number(e[c].saleDetailQueryDTO[o].productCount),a.price1=Number(a.productCount)*this.goodsDetail.purchasePrice}this.carList.set(e[c].id,a)}e=[]}else{for(var n=0;n<e.length;n++)if(1==this.carList.has(e[n].id)&&(this.carList.get(e[n].id).stockLogList=new Map),1==this.carList.has(e[n].id)){this.carList.get(e[n].id)&&(this.carList.get(e[n].id).productCount=0);for(var d=0;d<e[n].saleDetailQueryDTO.length;d++){if(1==this.carList.get(e[n].id).stockLogList.has(e[n].saleDetailQueryDTO[d].attributeList)){u={productCount:Number(e[n].saleDetailQueryDTO[d].productCount),name:e[n].saleDetailQueryDTO[d].name,productNum:e[n].saleDetailQueryDTO[d].productNum};e[n].saleDetailQueryDTO.length>1?u.productCount>0&&this.carList.get(e[n].id).stockLogList.set(e[n].saleDetailQueryDTO[d].attributeList,u):this.carList.get(e[n].id).stockLogList.set(e[n].saleDetailQueryDTO[d].attributeList,u)}else{u={productCount:Number(e[n].saleDetailQueryDTO[d].productCount),name:e[n].saleDetailQueryDTO[d].name,productNum:e[n].saleDetailQueryDTO[d].productNum};e[n].saleDetailQueryDTO.length>1?u.productCount>0&&this.carList.get(e[n].id).stockLogList.set(e[n].saleDetailQueryDTO[d].attributeList,u):this.carList.get(e[n].id).stockLogList.set(e[n].saleDetailQueryDTO[d].attributeList,u)}this.carList.get(e[n].id).productCount+=Number(e[n].saleDetailQueryDTO[d].productCount),this.carList.get(e[n].id).price1=Number(this.carList.get(e[n].id).productCount)*this.carList.get(e[n].id).purchasePrice}}else{for(var g={purchasePrice:0==this.userType?this.goodsDetail.purchasePrice:"",price:this.goodsDetail.price,price1:0,productCount:0,productId:e[n].id,categoryId:e[n].categoryId,attrId:e[n].attrId,customerCategoryList:null!=e[n].customerCategoryRule?this.checkPriceRule(e[n].customerCategoryRule):this.getNewProductRule(),productName:e[n].productName,wholesalePrice:this.goodsDetail.wholesalePrice,lsprice:this.goodsDetail.price,productPicture:e[n].productPicture,stockLogList:new Map,productSn:e[n].productSn,stockLogList1:[],productPictures:[],name:""},l=0;l<e[n].saleDetailQueryDTO.length;l++){u={productCount:Number(e[n].saleDetailQueryDTO[l].productCount),name:e[n].saleDetailQueryDTO[l].name,productNum:e[n].saleDetailQueryDTO[l].productNum};e[n].saleDetailQueryDTO.length>1?u.productCount>0&&g.stockLogList.set(e[n].saleDetailQueryDTO[l].attributeList,u):g.stockLogList.set(e[n].saleDetailQueryDTO[l].attributeList,u),g.productCount+=Number(e[n].saleDetailQueryDTO[l].productCount),g.price1=g.productCount*this.goodsDetail.purchasePrice}this.carList.set(e[n].id,g)}e=[]}this.getAllPrice(),this.$refs.shopPopup.close(),this.allChangeNum=0,setTimeout((function(e){t.hideLoading()}),500)},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},checkRealPay:function(e){var r=t.getStorageSync("shopId");return"1838094297858183168"==r||"1818888277105709056"==r||"1810179818189361152"==r?0==this.isChangePriceOk?0:this.alreadyPay:0==this.isChangePriceOk?e:this.alreadyPay},sninput:function(t,e){this.carList.get(e).productSn=t.detail.value,this.$forceUpdate()},removePunctuationAndSpaces:function(t){return t.replace(/[\u3002\uff0c\uff1a\uFF0E\u3001\s,:;]/g,"")},getSnIsRepeat:function(e,r){var i=this,s=this,c=!1;if(""!=e.detail.value){this.tui.request("/app/product/getByProductSn","post",{productSn:e.detail.value},!1,!0).then((function(a){if(200==a.code){if(""!=a.result)throw c=!0,s.tui.toast("当前货号已被商品:“"+a.result[0].productName+"”占用,请重新输入"),s.carList.get(r).productSn="",s.carList.get(r).id="",setTimeout((function(t){s.$forceUpdate()}),2e3),Error("11");i.carList.forEach((function(i,a){if(i.id!=r&&i.productSn==e.detail.value)throw c=!0,t.showToast({title:"该货号被页面其他商品占用,请重新输入!",icon:"none"}),s.carList.get(r).productSn="",s.carList.get(r).id="",s.$forceUpdate(),Error("11")}))}})),this.$nextTick((function(){0==c&&(s.carList.get(r).productId?(i.carList.get(r).id=s.carList.get(r).productId,i.carList.get(r).isNew=!1,r=s.carList.get(r).productId):""==s.carList.get(r).productSn||null==s.carList.get(r).productSn?(i.carList.get(r).id=s.carList.get(r).productName,r=s.carList.get(r).productName):"货号"==s.carList.get(r).productSn?(i.carList.get(r).productSn=s.carList.get(r).productName,i.carList.get(r).id=s.carList.get(r).productName,r=s.carList.get(r).productName):s.carList.get(r).productSn&&(i.carList.get(r).id=s.carList.get(r).productSn,r=s.carList.get(r).productSn),i.$forceUpdate())}));var a=new Map;this.$nextTick((function(){i.carList.forEach((function(t,e){e!=t.id?""==t.id?a.set((0,u.generateUUID)(),t):a.set(t.id,t):a.set(e,t)})),i.carList=a}))}},getName:function(t,e){this.carList.get(e).productName=t.detail.value},noReturn:function(){this.yuedikou=0,this.alreadyPay=this.shouldPay,this.noPay=this.shouldPay-(""==this.alreadyPay?0:this.alreadyPay),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.isChangePriceOk=!0,this.linshiPrice==t.target.value?this.alreadyPay=t.target.value:Number(t.detail.value)>Number(this.shouldPay)?(this.alreadyPay=this.shouldPay,setTimeout((function(t){e.tui.toast("已付金额不能大于应付金额")}),100)):""==t.target.value?this.alreadyPay=this.linshiPrice:(this.alreadyPay=t.target.value,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)},goPopleList:function(e){t.setStorageSync("kaidanBack",!0),t.navigateTo({url:"/package1/index/peopleList?popleType="+e})},delShop:function(e){var r=this;t.showModal({title:"提示",content:"确定删除此条商品吗?",success:function(t){t.confirm&&(1==r.carList.has(e)&&r.carList.delete(e),r.getAllPrice(),r.$forceUpdate())}})},delCarData:function(t){this.temporaryList.splice(t,1),this.temporaryChange()},delShopSpec:function(e,r){var i=this;t.showModal({title:"提示",content:"确定删除此条规格吗?",success:function(t){if(t.confirm){1==i.carList.get(e).stockLogList.size?i.carList.get(e).productCount=Number(i.carList.get(e).stockLogList.get(r).productCount):i.carList.get(e).productCount-=Number(i.carList.get(e).stockLogList.get(r).productCount);var s=Number(i.carList.get(e).stockLogList.get(r).productCount);if(i.carList.get(e).stockLogList.delete(r),i.carList.get(e).price1=Number(i.carList.get(e).productCount)*i.carList.get(e).purchasePrice,0==i.carList.get(e).stockLogList.size){var c={name:"均色/均码/",productCount:s};i.carList.get(e).stockLogList.set('{"颜色":"均色","尺码":"均码"}',c)}i.getAllPrice()}i.$forceUpdate()}})},gysList:function(){var t=this,e=this;this.tui.request("/app/supplier/getByCondition","post",{searchStr:"默认供应商",pageNumber:1,pageSize:10},!1,!0).then((function(r){200==r.code?0==r.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=r.result.content[0],e.goRuku()):t.tui.toast(r.message)}))},filterEmojis:function(t){var e=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\u2600-\u27FF]|[\uD83C][\uDF00-\uDFFF]|[\uD83D][\uDC00-\uDE4F]/g.test(t);return e},goRuku:function(){var e=this;return(0,a.default)(s.default.mark((function r(){var i,c,a,o;return s.default.wrap((function(r){while(1)switch(r.prev=r.next){case 0:return i=e,c={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},a=[],o=[],r.next=6,e.carList.forEach((function(e,r){o+=1,e.customerCategoryRule=JSON.stringify(e.customerCategoryList);var s=t.getStorageSync("shopId");if(1!=i.userType||"1853332569559535619"!=s&&"1810179818189361152"!=s?1==i.userType&&(e.purchasePrice=""):e.purchasePrice=0,i.filterEmojis(e.productName))throw t.showToast({title:"第"+o.length+"款商品品名中的有非法符号,请删除",icon:"none"}),Error("11");if(""==e.productSn)throw t.showToast({title:"第"+o.length+"款商品货号必须维护",icon:"none"}),Error("11");if(e.price=e.lsprice,e.stockLogList1=[],0==e.stockLogList.size){e.productCount=1,e.price1=Number(e.productCount)*e.purchasePrice,e.stockLogList1.push({productCount:1,attributeList:'{"颜色":"均色","尺码":"均码"}'})}else e.stockLogList.forEach((function(t,r){if(t.productCount<=0)throw i.tui.toast(e.productSn+"的入库数量不能为零~"),Error("error");var s={productCount:Number(t.productCount),attributeList:r};e.stockLogList1.push(s)}));a.push(e)}));case 6:return r.next=8,e.goInventory(c,a);case 8:case"end":return r.stop()}}),r)})))()},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,r){t.navigateTo({url:"/package1/inventory/inventoryConfirm?aiinventory=1&purchase="+JSON.stringify(e)+"&purchaseDetails="+JSON.stringify(r)+"&zhiqianqiankuan="+this.zhiqianqiankuan+"&yuedikou="+this.yuedikou+"&leijiqiankuan="+this.leijiqiankuan})},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)*this.carList.get(e).purchasePrice,this.getAllPrice()},PriceAndWho:function(t,e,r){"pi"==r?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()},getAllPrice:function(){var t=this,e=this;this.shouldPay=0,this.totalAmount=0,e.leijiqiankuan=0,e.yuedikou=0,this.carList.forEach((function(t,r){e.shouldPay=e.shouldPay+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.checkRealPay(t.shouldPay-Math.abs(e.zhiqianqiankuan))):e.shouldPay<=Math.abs(e.zhiqianqiankuan)&&(e.yuedikou=e.shouldPay,e.alreadyPay=0):t.alreadyPay=t.checkRealPay(t.shouldPay),e.shouldPay=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()}))},isChange:function(t){this.isGenerateSnRadio=t},GoodsNumChange:function(t,e,r){var i=this;this.carList.get(e[0]).stockLogList.get(r).productCount=Number(t),this.carList.get(e[0]).productCount=0,this.carList.get(e[0]).stockLogList.forEach((function(t,r){i.carList.get(e[0]).productCount=Number(i.carList.get(e[0]).productCount)+Number(t.productCount),i.carList.get(e[0]).price1=Number(i.carList.get(e[0]).productCount)*i.carList.get(e[0]).purchasePrice})),i.getAllPrice()}}};e.default=l}).call(this,r("df3c")["default"])},"2c1b":function(t,e,r){},9178:function(t,e,r){"use strict";var i=r("2c1b"),s=r.n(i);s.a},b839:function(t,e,r){"use strict";r.d(e,"b",(function(){return s})),r.d(e,"c",(function(){return c})),r.d(e,"a",(function(){return i}));var i={uniIcons:function(){return Promise.all([r.e("common/vendor"),r.e("uni_modules/uni-icons/components/uni-icons/uni-icons")]).then(r.bind(null,"6bbb6"))},uniDataSelect:function(){return Promise.all([r.e("common/vendor"),r.e("uni_modules/uni-data-select/components/uni-data-select/uni-data-select")]).then(r.bind(null,"90dc"))},uGrid:function(){return Promise.all([r.e("common/vendor"),r.e("uni_modules/uview-ui/components/u-grid/u-grid")]).then(r.bind(null,"7b3c"))},uGridItem:function(){return Promise.all([r.e("common/vendor"),r.e("uni_modules/uview-ui/components/u-grid-item/u-grid-item")]).then(r.bind(null,"cb83"))},uIcon:function(){return Promise.all([r.e("common/vendor"),r.e("uni_modules/uview-ui/components/u-icon/u-icon")]).then(r.bind(null,"1608"))},uniDatetimePicker:function(){return Promise.all([r.e("common/vendor"),r.e("uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker")]).then(r.bind(null,"4632"))},uniPopup:function(){return r.e("uni_modules/uni-popup/components/uni-popup/uni-popup").then(r.bind(null,"2864"))},uniDataCheckbox:function(){return Promise.all([r.e("common/vendor"),r.e("uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox")]).then(r.bind(null,"fab5"))},uniEasyinput:function(){return r.e("uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput").then(r.bind(null,"5fa6"))}},s=function(){var t=this,e=t.$createElement,r=(t._self._c,t.__map(Array.from(t.carList),(function(e,r){var i=t.__get_orig(e),s=""!=e[1].productPictures?e[1].productPictures.length:null,c=e[1].isNew?t.carList.get(e[0]):null,a=e[1].isNew?t.carList.get(e[0]):null,o=t.__map(Array.from(e[1].stockLogList),(function(e,r){var i=t.__get_orig(e),s=t.numData(e[0]),c=t.numData(e[0]);return{$orig:i,m0:s,m1:c}}));return{$orig:i,g0:s,g1:c,g2:a,l0:o}}))),i=0==t.userType&&t.zhiqianqiankuan<0?Math.abs(t.zhiqianqiankuan):null,s=t.leijiqiankuan<0&&0==t.userType?Math.abs(t.leijiqiankuan):null,c=t.leijiqiankuan<0&&0==t.userType?Math.abs(t.leijiqiankuan):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=Array.from(t.carList);t._isMounted||(t.e0=function(e,r){var i=arguments[arguments.length-1].currentTarget.dataset,s=i.eventParams||i["event-params"];r=s.value;return t.uploadFilePromise(r)},t.e1=function(e,r){var i=arguments[arguments.length-1].currentTarget.dataset,s=i.eventParams||i["event-params"];r=s.value;return t.uploadFilePromise(r)},t.e2=function(e,r){var i=arguments[arguments.length-1].currentTarget.dataset,s=i.eventParams||i["event-params"];r=s.value;return t.getZhuBigImage(r[1].productPicture)},t.e3=function(e,r){var i=arguments[arguments.length-1].currentTarget.dataset,s=i.eventParams||i["event-params"];r=s.value;return t.uploadFilePromise(r)},t.e4=function(e,r){var i=arguments[arguments.length-1].currentTarget.dataset,s=i.eventParams||i["event-params"];r=s.value;return t.getZhuBigImage(r[1].productPicture)},t.e5=function(e,r){var i=arguments[arguments.length-1].currentTarget.dataset,s=i.eventParams||i["event-params"];r=s.value;return t.uploadFilePromise(r)},t.e6=function(e,r){var i=arguments[arguments.length-1].currentTarget.dataset,s=i.eventParams||i["event-params"];r=s.value;return t.uploadFilePromise(r)},t.e7=function(e,r){var i=arguments[arguments.length-1].currentTarget.dataset,s=i.eventParams||i["event-params"];r=s.value;return e.stopPropagation(),t.delShop(r[0])},t.e8=function(e,r){var i=arguments[arguments.length-1].currentTarget.dataset,s=i.eventParams||i["event-params"];r=s.value;return t.toggle("mergePopup",r[0])},t.e9=function(e,r){var i=arguments[arguments.length-1].currentTarget.dataset,s=i.eventParams||i["event-params"];r=s.value;return t.pictureAdd(r[0])},t.e10=function(e,r){var i=arguments[arguments.length-1].currentTarget.dataset,s=i.eventParams||i["event-params"];r=s.value;return t.getName(e,r[0])},t.e11=function(e,r){var i=arguments[arguments.length-1].currentTarget.dataset,s=i.eventParams||i["event-params"];r=s.value;return t.getName(e,r[0])},t.e12=function(e,r){var i=arguments[arguments.length-1].currentTarget.dataset,s=i.eventParams||i["event-params"];r=s.value;return e=e.target.value,t.__set_model(t.carList.get(r[0]),"productSn",e,[])},t.e13=function(e,r){var i=arguments[arguments.length-1].currentTarget.dataset,s=i.eventParams||i["event-params"];r=s.value;return t.sninput(e,r[0])},t.e14=function(e,r){var i=arguments[arguments.length-1].currentTarget.dataset,s=i.eventParams||i["event-params"];r=s.value;return t.getSnIsRepeat(e,r[0])},t.e15=function(e,r){var i=arguments[arguments.length-1].currentTarget.dataset,s=i.eventParams||i["event-params"];r=s.value;return e=e.target.value,t.__set_model(r[1],"productSn",e,[])},t.e16=function(e,r){var i=arguments[arguments.length-1].currentTarget.dataset,s=i.eventParams||i["event-params"];r=s.value;return t.generateSn(r[0])},t.e17=function(e,r){var i=arguments[arguments.length-1].currentTarget.dataset,s=i.eventParams||i["event-params"];r=s.value;return t.toggle("typePopup",r[0])},t.e18=function(e,r){var i=arguments[arguments.length-1].currentTarget.dataset,s=i.eventParams||i["event-params"];r=s.value;return t.clickCollapse(e,r[0])},t.e19=function(e,r){var i=arguments[arguments.length-1].currentTarget.dataset,s=i.eventParams||i["event-params"];r=s.value;return t.obtainPrice(e,"danjia",r[0])},t.e20=function(e,r){var i=arguments[arguments.length-1].currentTarget.dataset,s=i.eventParams||i["event-params"];r=s.value;return e=e.target.value,t.__set_model(r[1],"purchasePrice",e,[])},t.e21=function(e,r){var i=arguments[arguments.length-1].currentTarget.dataset,s=i.eventParams||i["event-params"];r=s.value;return t.PriceAndWho(e,r[0],"pi")},t.e22=function(e,r){var i=arguments[arguments.length-1].currentTarget.dataset,s=i.eventParams||i["event-params"];r=s.value;return t.obtainPrice(e,"pifa",r[0])},t.e23=function(e,r){var i=arguments[arguments.length-1].currentTarget.dataset,s=i.eventParams||i["event-params"];r=s.value;return e=e.target.value,t.__set_model(r[1],"wholesalePrice",e,[])},t.e24=function(e,r){var i=arguments[arguments.length-1].currentTarget.dataset,s=i.eventParams||i["event-params"];r=s.value;return t.PriceAndWho(e,r[0])},t.e25=function(e,r){var i=arguments[arguments.length-1].currentTarget.dataset,s=i.eventParams||i["event-params"];r=s.value;return t.obtainPrice(e,"lingshou",r[0])},t.e26=function(e,r){var i=arguments[arguments.length-1].currentTarget.dataset,s=i.eventParams||i["event-params"];r=s.value;return e=e.target.value,t.__set_model(r[1],"lsprice",e,[])},t.e27=function(e,r){var i=arguments[arguments.length-1].currentTarget.dataset,s=i.eventParams||i["event-params"];r=s.value;return t.addCustomPrice(r[0])},t.e28=function(e,r){var i=arguments[arguments.length-1].currentTarget.dataset,s=i.eventParams||i["event-params"];r=s.value;return t.toggle("oneGoods",r[0])},t.e29=function(e,r){var i=arguments[arguments.length-1].currentTarget.dataset,s=i.eventParams||i["event-params"];r=s.value;return t.AiAddSpec(r[1])},t.e30=function(e,r,i){var s=arguments[arguments.length-1].currentTarget.dataset,c=s.eventParams||s["event-params"];r=c.value,i=c.values;return e.stopPropagation(),t.delShopSpec(r[0],i[0])},t.e31=function(e,r,i){var s=arguments[arguments.length-1].currentTarget.dataset,c=s.eventParams||s["event-params"];r=c.value,i=c.values;t.checkSpec("颜色",r[0],i[0],t.numData(i[0])[0])},t.e32=function(e,r,i){var s=arguments[arguments.length-1].currentTarget.dataset,c=s.eventParams||s["event-params"];r=c.value,i=c.values;t.checkSpec("尺码",r[0],i[0],t.numData(i[0])[1])},t.e33=function(e,r,i){var s=arguments[arguments.length-1].currentTarget.dataset,c=s.eventParams||s["event-params"];r=c.value,i=c.values;return t.oneMinusNum(r[0],i[0])},t.e34=function(e,r,i){var s=arguments[arguments.length-1].currentTarget.dataset,c=s.eventParams||s["event-params"];r=c.value,i=c.values;return t.mapnumChange(e,r[0],i[0])},t.e35=function(e,r,i){var s=arguments[arguments.length-1].currentTarget.dataset,c=s.eventParams||s["event-params"];r=c.value,i=c.values;return t.obtainPrice(e,"mapdanjishu",r[0],i[0])},t.e36=function(e,r){var i=arguments[arguments.length-1].currentTarget.dataset,s=i.eventParams||i["event-params"];r=s.values;return e=e.target.value,t.__set_model(r[1],"productCount",e,[])},t.e37=function(e,r,i){var s=arguments[arguments.length-1].currentTarget.dataset,c=s.eventParams||s["event-params"];r=c.value,i=c.values;return t.onePlusNum(r[0],i[0])},t.e38=function(e){return t.$refs.addGateDialog.close()},t.e39=function(e,r){var i=arguments[arguments.length-1].currentTarget.dataset,s=i.eventParams||i["event-params"];r=s.value;return t.clickMerge(r[0])},t.e40=function(e,r){var i=arguments[arguments.length-1].currentTarget.dataset,s=i.eventParams||i["event-params"];r=s.value;return t.getZhuBigImage(r[1].productPicture)},t.e41=function(e){return t.$refs.popup.close()},t.e42=function(e){t.isChangeHeight=!0},t.e43=function(e){t.isChangeHeight=!1},t.e44=function(e){return t.$refs.voiceBottomPopup.close()}),t.$mp.data=Object.assign({},{$root:{l1:r,g3:i,g4:s,g5:c,g6:a,g7:o,l2:u}})},c=[]},ce9c:function(t,e,r){"use strict";r.r(e);var i=r("b839"),s=r("0e8c");for(var c in s)["default"].indexOf(c)<0&&function(t){r.d(e,t,(function(){return s[t]}))}(c);r("9178");var a=r("828b"),o=Object(a["a"])(s["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],void 0);e["default"]=o.exports},feb0:function(t,e,r){"use strict";(function(t,e){var i=r("47a9");r("7859");i(r("3240"));var s=i(r("ce9c"));t.__webpack_require_UNI_MP_PLUGIN__=r,e(s.default)}).call(this,r("3223")["default"],r("df3c")["createPage"])}},[["feb0","common/runtime","common/vendor"]]]);