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

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["package1/billing/changeGoods1"],{2861:function(t,e,s){"use strict";var i=s("3759"),r=s.n(i);r.a},3759:function(t,e,s){},"42b8":function(t,e,s){"use strict";s.r(e);var i=s("7cef"),r=s("4d73");for(var o in r)["default"].indexOf(o)<0&&function(t){s.d(e,t,(function(){return r[t]}))}(o);s("2861");var a=s("828b"),u=Object(a["a"])(r["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],void 0);e["default"]=u.exports},"4d73":function(t,e,s){"use strict";s.r(e);var i=s("aa34"),r=s.n(i);for(var o in i)["default"].indexOf(o)<0&&function(t){s.d(e,t,(function(){return i[t]}))}(o);e["default"]=r.a},"52bc":function(t,e,s){"use strict";(function(t,e){var i=s("47a9");s("7859");i(s("3240"));var r=i(s("42b8"));t.__webpack_require_UNI_MP_PLUGIN__=s,e(r.default)}).call(this,s("3223")["default"],s("df3c")["createPage"])},"7cef":function(t,e,s){"use strict";s.d(e,"b",(function(){return r})),s.d(e,"c",(function(){return o})),s.d(e,"a",(function(){return i}));var i={uniSearchBar:function(){return Promise.all([s.e("common/vendor"),s.e("uni_modules/uni-search-bar/components/uni-search-bar/uni-search-bar")]).then(s.bind(null,"f56e"))},uniIcons:function(){return Promise.all([s.e("common/vendor"),s.e("uni_modules/uni-icons/components/uni-icons/uni-icons")]).then(s.bind(null,"6bbb6"))},uLoadmore:function(){return Promise.all([s.e("common/vendor"),s.e("uni_modules/uview-ui/components/u-loadmore/u-loadmore")]).then(s.bind(null,"9fc5"))},uniPopup:function(){return s.e("uni_modules/uni-popup/components/uni-popup/uni-popup").then(s.bind(null,"2864"))},uniDataCheckbox:function(){return Promise.all([s.e("common/vendor"),s.e("uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox")]).then(s.bind(null,"fab5"))},uKeyboard:function(){return Promise.all([s.e("common/vendor"),s.e("uni_modules/uview-ui/components/u-keyboard/u-keyboard")]).then(s.bind(null,"e056"))}},r=function(){var t=this,e=t.$createElement,s=(t._self._c,t.carList.length),i=t.__map(t.carList,(function(e,s){var i=t.__get_orig(e),r=t.__map(e.saleDetailQueryDTO,(function(e,s){var i=t.__get_orig(e),r=t._f("sliceMsg")(e.attributeList);return{$orig:i,f0:r}}));return{$orig:i,l0:r}}));t._isMounted||(t.e0=function(e){return t.$refs.goodsNumDialog.close()},t.e1=function(e){t.show=!0},t.e2=function(t){return this.$refs.carPopup.close()},t.e3=function(e){return t.$refs.showPopup.close()}),t.$mp.data=Object.assign({},{$root:{g0:s,l1:i}})},o=[]},aa34:function(t,e,s){"use strict";(function(t,i){var r=s("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=r(s("7eb4")),a=r(s("34cf")),u=r(s("ee10")),n=r(s("af34")),h={components:{},data:function(){return{indexList:[],focus:!1,pageNum:1,shopList:[],shopList1:[],show:!1,categoryId:"",searchName:"",checkbox:[],temporaryNum:0,allChangeNum:0,defaultText:0,checkCanBuy:[],oneGoodsSpec:[],goodsDetail:[],attrNameList:[],keyboard:"",oneGoodsName:"",temporaryList:[],isPlusAndMinus:!1,carList:[],zheng:"",fu:"",shopId:t.getStorageSync("shopId"),attributeList:[],purchasePrice:0,keyboardIndex:"",zPrice:0,zNum:0,goodsNum:"",storageType:"",keyboardNum:"",carNum:0,carType:0,type:"",productId:"",productNum:null,height:0,pecsList:[],pageOldTemList:[],oldTemList:[],bigImg:[],swiperDotIndex:0,goodsList:[],khId:"",customerId:"",customerName:"",evalue:[],newTemList:[],dataObj:new Map,gateType:"",yanseList:new Map,chimaList:new Map}},filters:{sliceMsg:function(t){var e="";if("string"==typeof t){var s=JSON.parse(t);for(var i in s)e+=s[i]+" | "}return e}},onReachBottom:function(){this.pageNum>=this.pages||(this.pageNum++,"search"==this.gateType?this.getShareList("search"):this.getShareList())},onLoad:function(e){var s=this;this.khId=e.khId,this.customerId=e.customerId,this.customerName=e.customerName,this.height=i.getSystemInfoSync().windowHeight,this.carList=JSON.parse(e.arr);for(var r=function(t){""!=s.carList[t].returnList&&void 0!=s.carList[t].returnList&&(s.carList[t].returnList=new Map(JSON.parse(decodeURIComponent(s.carList[t].returnList))),s.carList[t].returnList.forEach((function(e,i){for(var r=0;r<s.carList[t].saleDetailQueryDTO.length;r++)i==s.carList[t].saleDetailQueryDTO[r].attributeList&&e.productCount==s.carList[t].saleDetailQueryDTO[r].productCount&&s.carList[t].returnList.delete(i)})))},o=0;o<s.carList.length;o++)r(o);this.getGategoryList(),this.storageType=t.getStorageSync("type"),t.setStorageSync("clearMsg","1"),this.$forceUpdate()},methods:{lunbochange:function(t){this.current=t.detail.current},seeCustomCategory:function(){this.$refs.customPopup.open()},noChangeCustomPopup:function(t){0==t.show&&(this.checkCanBuy=[])},closeCustomPopup:function(){this.checkCanBuy=[],this.$refs.customPopup.close()},getGategoryList:function(){var t=this;this.tui.request("/app/productCategory/list","get",{},!1,!0).then((function(e){if(200==e.code){t.indexList=e.result;for(var s=0;s<t.indexList.length;s++)t.indexList[s].parentId=0==s;t.categoryId=t.indexList[0].id,t.getShareList()}else t.tui.toast(e.message)})).catch((function(t){}))},valChange:function(t){this.keyboardNum+=t.toString(),"goodsNum"==this.keyboard&&(this.goodsNum=this.keyboardNum)},backspace:function(t){this.keyboardNum=t,this.goodsNum=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}},chenumChange:function(t,e,s){var i=this,r=this.carList[e].saleDetailQueryDTO[s].productCount;if(this.carList[e].saleDetailQueryDTO[s].productCount=t,this.carList[e].saleDetailQueryDTO[s].productCount<0&&"散客"!=this.customerName&&this.checkCanReturn(this.carList[e].productSn,this.carList[e].id,this.carList[e].saleDetailQueryDTO[s].attributeList,this.customerId,this.carList[e].saleDetailQueryDTO[s].productCount),setTimeout((function(t){i.checkCanBuy.length>0&&i.seeCustomCategory()}),500),this.shopList.length>0)for(var o=0;o<this.shopList.length;o++)this.shopList[o].id==this.carList[e].id&&(this.shopList[o].buyCountNew+=t-r);if(this.shopList1.length>0)for(var a=0;a<this.shopList1.length;a++)this.shopList1[a].id==this.carList[e].id&&(this.shopList1[a].buyCountNew+=t-r);this.$forceUpdate(),this.carChange()},numChange:function(t,e){var s=this;t>this.temporaryList[e].productNum&&("1838094297858183168"==this.shopId||"1811579958284390400"==this.shopId||"1818888277105709056"==this.shopId)?this.tui.toast("已超出可售数量",300):(this.temporaryList[e].productCount=t,this.temporaryList[e].productCount<0&&"散客"!=this.customerName&&this.checkCanReturn(this.goodsDetail.productSn,this.goodsDetail.id,this.temporaryList[e].attributeList,this.customerId,this.temporaryList[e].productCount),setTimeout((function(t){s.checkCanBuy.length>0&&s.seeCustomCategory()}),500),this.$forceUpdate(),this.temporaryChange())},allChange:function(t){var e=this;if(this.allChangeNum=t,0==this.isPlusAndMinus)for(var s=0;s<this.temporaryList.length;s++){if(0==this.evalue.length)Number(this.allChangeNum)>this.temporaryList[s].productNum&&("1838094297858183168"==this.shopId||"1811579958284390400"==this.shopId||"1818888277105709056"==this.shopId)?this.tui.toast(this.temporaryList[s].name+"已超出可售数量",300):(this.temporaryList[s].productCount=Number(this.allChangeNum),this.temporaryList[s].productCount<0&&"散客"!=this.customerName&&this.checkCanReturn(this.goodsDetail.productSn,this.goodsDetail.id,this.temporaryList[s].attributeList,this.customerId,this.temporaryList[s].productCount));else for(var i=0;i<this.evalue.length;i++)this.evalue[i]==this.temporaryList[s].name&&(Number(this.allChangeNum)>this.temporaryList[s].productNum&&("1838094297858183168"==this.shopId||"1811579958284390400"==this.shopId||"1818888277105709056"==this.shopId)?this.tui.toast(this.temporaryList[s].name+"已超出可售数量",300):(this.temporaryList[s].productCount=Number(this.allChangeNum),this.temporaryList[s].productCount<0&&"散客"!=this.customerName&&this.checkCanReturn(this.goodsDetail.productSn,this.goodsDetail.id,this.temporaryList[s].attributeList,this.customerId,this.temporaryList[s].productCount)));for(var r=0;r<this.pageOldTemList.length;r++)this.temporaryList[s].attributeList==this.pageOldTemList[r].attributeList&&(this.pageOldTemList[r].productCount=this.temporaryList[s].productCount);for(i=0;i<this.oldTemList.length;i++)this.temporaryList[s].attributeList==this.oldTemList[i].attributeList&&(this.oldTemList[i].productCount=this.temporaryList[s].productCount)}setTimeout((function(t){e.checkCanBuy.length>0&&e.seeCustomCategory()}),500),this.isPlusAndMinus,this.temporaryChange()},plusNum:function(){this.isPlusAndMinus;for(var t=0;t<this.temporaryList.length;t++){if(0==this.evalue.length)void 0==this.temporaryList[t].productCount?this.temporaryList[t].productCount=1:this.temporaryList[t].productCount+1>this.temporaryList[t].productNum&&("1838094297858183168"==this.shopId||"1811579958284390400"==this.shopId||"1818888277105709056"==this.shopId)?this.tui.toast(this.temporaryList[t].name+"已超出可售数量",300):this.temporaryList[t].productCount++;else for(var e=0;e<this.evalue.length;e++)this.evalue[e]==this.temporaryList[t].name&&(void 0==this.temporaryList[t].productCount?this.temporaryList[t].productCount=1:this.temporaryList[t].productCount+1>this.temporaryList[t].productNum&&("1838094297858183168"==this.shopId||"1811579958284390400"==this.shopId||"1818888277105709056"==this.shopId)?this.tui.toast(this.temporaryList[t].name+"已超出可售数量",300):this.temporaryList[t].productCount++);for(var s=0;s<this.pageOldTemList.length;s++)this.temporaryList[t].attributeList==this.pageOldTemList[s].attributeList&&(this.pageOldTemList[s].productCount=this.temporaryList[t].productCount);for(e=0;e<this.oldTemList.length;e++)this.temporaryList[t].attributeList==this.oldTemList[e].attributeList&&(this.oldTemList[e].productCount=this.temporaryList[t].productCount)}this.temporaryChange()},minusNum:function(){var t=this;this.isPlusAndMinus;for(var e=0;e<this.temporaryList.length;e++){if(0==this.evalue.length)this.temporaryList[e].productCount--,this.temporaryList[e].productCount<0&&"散客"!=this.customerName&&this.checkCanReturn(this.goodsDetail.productSn,this.goodsDetail.id,this.temporaryList[e].attributeList,this.customerId,this.temporaryList[e].productCount);else for(var s=0;s<this.evalue.length;s++)this.evalue[s]==this.temporaryList[e].name&&(this.temporaryList[e].productCount--,this.temporaryList[e].productCount<0&&"散客"!=this.customerName&&this.checkCanReturn(this.goodsDetail.productSn,this.goodsDetail.id,this.temporaryList[e].attributeList,this.customerId,this.temporaryList[e].productCount));for(var i=0;i<this.pageOldTemList.length;i++)this.temporaryList[e].attributeList==this.pageOldTemList[i].attributeList&&(this.pageOldTemList[i].productCount=this.temporaryList[e].productCount);for(s=0;s<this.oldTemList.length;s++)this.temporaryList[e].attributeList==this.oldTemList[s].attributeList&&(this.oldTemList[s].productCount=this.temporaryList[e].productCount)}setTimeout((function(e){t.checkCanBuy.length>0&&t.seeCustomCategory()}),500),this.temporaryChange()},mapMinusNum:function(t,e){var s=this;if(this.carList[t].saleDetailQueryDTO[e].productCount--,this.carList[t].saleDetailQueryDTO[e].productCount<0&&"散客"!=this.customerName&&this.checkCanReturn(this.carList[t].productSn,this.carList[t].id,this.carList[t].saleDetailQueryDTO[e].attributeList,this.customerId,this.carList[t].saleDetailQueryDTO[e].productCount),setTimeout((function(t){s.checkCanBuy.length>0&&s.seeCustomCategory()}),500),this.shopList.length>0)for(var i=0;i<this.shopList.length;i++)this.shopList[i].id==this.carList[t].id&&this.shopList[i].buyCountNew--;if(this.shopList1.length>0)for(var r=0;r<this.shopList1.length;r++)this.shopList1[r].id==this.carList[t].id&&this.shopList1[r].buyCountNew--;this.carChange(),this.$forceUpdate()},mapPlusNum:function(t,e){if(this.carList[t].saleDetailQueryDTO[e].productCount++,this.shopList.length>0)for(var s=0;s<this.shopList.length;s++)this.shopList[s].id==this.carList[t].id&&this.shopList[s].buyCountNew++;if(this.shopList1.length>0)for(var i=0;i<this.shopList1.length;i++)this.shopList1[i].id==this.carList[t].id&&this.shopList1[i].buyCountNew++;this.carChange(),this.$forceUpdate()},oneMinusNum:function(t){var e=this;this.temporaryList[t].productCount--,this.temporaryList[t].productCount<0&&"散客"!=this.customerName&&this.checkCanReturn(this.goodsDetail.productSn,this.goodsDetail.id,this.temporaryList[t].attributeList,this.customerId,this.temporaryList[t].productCount),setTimeout((function(t){e.checkCanBuy.length>0&&e.seeCustomCategory()}),500),this.temporaryChange()},onePlusNum:function(t){this.temporaryList[t].productCount+1>this.temporaryList[t].productNum&&("1838094297858183168"==this.shopId||"1811579958284390400"==this.shopId||"1818888277105709056"==this.shopId)?this.tui.toast("已超出可售数量",300):(this.temporaryList[t].productCount++,this.temporaryChange())},obtainPrice:function(t,e,s,i){this.show=!0,"zongjishu"==e?this.keyboard="zongjishu":"danjishu"==e?(this.keyboard="danjishu",this.keyboardIndex=s):"chejishu"==e&&(this.keyboard="chejishu",this.keyboardIndex=[s,i])},attrNameChange:function(e,s,i){var r=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,this.evalue=[];for(var o=[],a=0,u=this.goodsDetail.attributeList[0].value;a<u.length;a++)if(u[a].isChecked)for(var n=0,h=this.goodsDetail.attributeList[1].value;n<h.length;n++)if("1822829636942434305"!=this.shopId){var c="",l="{";c=u[a].value+" | "+h[n].value,l+='"颜色":"'+u[a].value+'",',l+='"尺码":"'+h[n].value+'"',l+="}",o.push(l),this.evalue.push(c)}else if(h[n].isChecked){c="";var d="{";c=u[a].value+" | "+h[n].value,d+='"颜色":"'+u[a].value+'",',d+='"尺码":"'+h[n].value+'"',d+="}",o.push(d),this.evalue.push(c)}if(0==o.length&&(this.temporaryList=this.pageOldTemList),0==this.temporaryList.length)for(var p=0;p<o.length;p++)this.attributeList={attributeList:o[p],productCount:this.temporaryNum,productNum:null,name:this.evalue[p],price:this.purchasePrice},this.temporaryList.push(this.attributeList);else{var m=0;for(p=0;p<o.length;p++){for(var L=0;L<this.temporaryList.length;L++)this.temporaryList[L].attributeList==o[p]&&(m=this.temporaryList[L].productCount);this.attributeList={attributeList:o[p],productCount:m,productNum:null,name:this.evalue[p],price:this.purchasePrice},this.newTemList.push(this.attributeList),m=0}for(p=0;p<this.oldTemList.length;p++){var g=!0;for(L=0;L<this.newTemList.length;L++)this.oldTemList[p].attributeList==this.newTemList[L].attributeList&&(this.newTemList[L].productCount=this.oldTemList[p].productCount,g=!1);this.newTemList.length>0&&g&&this.newTemList.push(this.oldTemList[p])}for(p=0;p<this.pageOldTemList.length;p++){var f=!0;for(L=0;L<this.newTemList.length;L++)this.pageOldTemList[p].attributeList==this.newTemList[L].attributeList&&(this.newTemList[L].productCount=this.pageOldTemList[p].productCount,f=!1);this.newTemList.length>0&&f&&this.newTemList.push(this.pageOldTemList[p])}}this.$nextTick((function(){for(var t=0;t<r.temporaryList.length;t++)for(var e=0;e<r.pecsList.length;e++)r.temporaryList[t].attributeList==r.pecsList[e].attributeList&&(r.temporaryList[t].productNum=r.pecsList[e].stockCount),r.$forceUpdate()})),0!=this.newTemList.length&&(this.temporaryList=this.newTemList,this.oldTemList=[],this.newTemList=[]),setTimeout((function(e){t.hideLoading()}),200)},temporaryChange:function(t){this.zNum=0;for(var e=0;e<this.temporaryList.length;e++)this.zNum+=Number(this.temporaryList[e].productCount);this.zPrice=this.zNum*this.purchasePrice},backPrevPage:function(){var e=getCurrentPages(),s=e[e.length-2];t.setStorageSync("KuCunBack",!0);for(var i=0;i<this.carList.length;i++)""!=this.carList[i].returnList&&void 0!=this.carList[i].returnList&&(this.carList[i].returnList=encodeURIComponent(JSON.stringify(Array.from(this.carList[i].returnList.entries()))));s.$vm.carList1=this.carList,t.navigateBack({delta:1})},search:function(t){this.pageNum=1,this.shopList1=[],this.shopList=[],""==t?(this.searchName="",this.getShareList()):(this.searchName=t,this.getShareList("search"))},clearSearch:function(){this.searchName="",this.getShareList()},seeStockCount:function(t,e){this.zheng=t,this.fu=e,this.$refs.showPopup.open()},getShareList:function(t){var e=this,s={};"search"==t?(this.gateType="search",s={categoryId:"",customerId:this.customerId,searchStr:this.searchName,pageNum:this.pageNum,pageSize:"10"}):(this.gateType="",s={categoryId:this.categoryId,customerId:this.customerId,searchStr:this.searchName,pageNum:this.pageNum,pageSize:"10"});var i=this;this.tui.request("/app/product/getShareList","POST",s,!1,!1).then((function(s){if(200==s.code)if("search"==t){if(e.shopList=[],e.status="nomore",1==e.pages?e.shopList1=s.result.records:e.shopList1=[].concat((0,n.default)(e.shopList1),(0,n.default)(s.result.records)),null!=e.khId&&""!=e.khId)for(var r=0;r<e.shopList1.length;r++){if(e.shopList1[r].customPrice="",null!=e.shopList1[r].customerCategoryRule&&""!=e.shopList1[r].customerCategoryRule)for(var o=JSON.parse(e.shopList1[r].customerCategoryRule),a=0;a<o.length;a++)o[a].categoryId==e.khId&&(e.shopList1[r].customPrice=o[a].categoryPrice);if(i.carList.length>0)for(var u=0;u<i.carList.length;u++)i.carList[u].id==i.shopList1[r].id&&(i.shopList1[r].buyCountNew=i.carList[u].num,i.shopList1[r].returnList=i.carList[u].returnList)}e.pages=s.result.pages}else{if(e.shopList1=[],e.status="nomore",1==e.pages?e.shopList=s.result.records:e.shopList=[].concat((0,n.default)(e.shopList),(0,n.default)(s.result.records)),null!=e.khId&&""!=e.khId)for(var h=0;h<e.shopList.length;h++){if(e.shopList[h].customPrice="",null!=e.shopList[h].customerCategoryRule&&""!=e.shopList[h].customerCategoryRule)for(var c=JSON.parse(e.shopList[h].customerCategoryRule),l=0;l<c.length;l++)c[l].categoryId==e.khId&&(e.shopList[h].customPrice=c[l].categoryPrice);if(i.carList.length>0)for(var d=0;d<i.carList.length;d++)i.carList[d].id==i.shopList[h].id&&(i.shopList[h].buyCountNew=i.carList[d].num,i.shopList[h].returnList=i.carList[d].returnList)}e.pages=s.result.pages}else e.tui.toast(s.message)})).catch((function(t){}))},change:function(){this.oldTemList=[]},keyboardConfirm:function(){""!=this.keyboardNum&&("goodsNum"==this.keyboard?this.goodsNum=Number(this.keyboardNum):"zongjishu"==this.keyboard?this.allChange(Number(this.keyboardNum)):"danjishu"==this.keyboard?this.numChange(Number(this.keyboardNum),this.keyboardIndex):"chejishu"==this.keyboard&&this.chenumChange(Number(this.keyboardNum),this.keyboardIndex[0],this.keyboardIndex[1])),this.show=!1,this.keyboardNum=""},keyCancel:function(){this.show=!1,this.keyboardNum=""},carChange:function(t,e,s){this.carNum=0;for(var i=0;i<this.carList.length;i++){this.carList[i].num=0;for(var r=0;r<this.carList[i].saleDetailQueryDTO.length;r++)this.carList[i].num+=Number(this.carList[i].saleDetailQueryDTO[r].productCount);this.carNum+=this.carList[i].num}},toggle:function(e,s){if("carPopup"==e){this.oldList=this.carList,this.carNum=0;for(var i=0;i<this.carList.length;i++)this.carNum+=this.carList[i].num;this.$refs.carPopup.open("bottom"),this.carType=this.carList.length}else t.showLoading({title:"加载中..."}),this.productId=s.id,this.goodsList=[],this.allChangeNum=0,this.checkGoods(s)},checkGoods:function(e){var s=this;return(0,u.default)(o.default.mark((function i(){var r,a;return o.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(t.showLoading({title:"加载中..."}),r=s,r.goodsDetail=e,s.temporaryList=[],s.pageOldTemList=[],""!=s.carList)for(s.zNum=0,a=0;a<s.carList.length;a++)e.id==r.carList[a].id&&(r.carList[a].saleDetailQueryDTO.length>0?r.goodsNum=r.carList[a].saleDetailQueryDTO[0].productCount:r.goodsNum=0,r.zNum=r.carList[a].num,r.temporaryList=r.carList[a].saleDetailQueryDTO,r.pageOldTemList=r.carList[a].saleDetailQueryDTO,r.oldTemList=r.carList[a].saleDetailQueryDTO);return i.next=8,s.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId","POST",{categoryId:s.goodsDetail.attrId},!1,!0).then((function(t){if(200==t.code){if("string"==typeof t.result.attributeAndValue){var e=JSON.parse(t.result.attributeAndValue),i=[];for(var o in e){for(var a=[],u=0;u<e[o].length;u++){for(var n=0;n<s.oldTemList.length;n++)for(var h=s.oldTemList[n].name.split("/"),c=0;c<h.length;c++)h[c]==e[o][u]&&!0;for(n=0;n<s.pageOldTemList.length;n++)for(h=s.pageOldTemList[n].name.split("/"),c=0;c<h.length;c++)h[c]==e[o][u]&&!0;a.push({value:e[o][u],isChecked:!1}),r.dataObj.set(e[o][u],o),!1}i.push({name:o,value:a})}if(s.focus=!1,1==i[0].value.length&&1==i[1].value.length)s.keyboard="goodsNum",s.keyboardNum=s.goodsNum,s.show=!0,s.oneGoodsName=i[0].value[0].value+" | "+i[1].value[0].value,s.oneGoodsSpec=i,s.$refs.goodsNumDialog.open("center"),s.$nextTick((function(){s.focus=!0})),s.getKCList(t.result.stock);else{s.$refs.popup.open("bottom"),s.goodsDetail.attributeList=i;for(u=0;u<s.goodsDetail.attributeList.length;u++){var l=!1,d=[];for(n=0;n<s.goodsDetail.attributeList[u].value.length;n++)1==s.goodsDetail.attributeList[u].value[n].isChecked&&(l=!0,d.push(s.goodsDetail.attributeList[u].value[n].value));if(l){var p={specs:[]};p.specs=d,s.goodsList.push(p)}else{s.goodsList.push({specs:[]})}l=!1,d=[]}s.getKCList(t.result.stock)}""==s.temporaryList&&"1822829636942434305"!=r.shopId&&s.attrNameChange(0,s.goodsDetail.attributeList[0].value[0].value,0)}}else s.tui.toast(res.message)})).catch((function(t){}));case 8:return i.next=10,t.hideLoading();case 10:case"end":return i.stop()}}),i)})))()},handleNumber:function(t){t=t.toString();var e=t.replace(/[^0-9.-]/g,"");if(""===e)return"0";var s="";e.startsWith("-")?(s="-",e=e.substring(1).replace(/-/g,"")):e=e.replace(/-/g,"");var i=e.split(".");i.length>1&&(e=i[0]+"."+i.slice(1).join(""));var r="",o="";if(e.includes(".")){var u=e.split("."),n=(0,a.default)(u,2);r=n[0],o=n[1]}else r=e;r=r.replace(/^0+/,""),""===r&&(r="0");var h=""===o?r:"".concat(r,".").concat(o);return"0"!==r||""!==o&&!/^0*$/.test(o)||(h="0",s=""),s+h},oneGoodsToCarList:function(){var t=this;return(0,u.default)(o.default.mark((function e(){var s,i,r,a,u,n;return o.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(s=t,t.goodsNum=t.handleNumber(t.goodsNum),"1838094297858183168"!=t.shopId&&"1811579958284390400"!=t.shopId&&"1818888277105709056"!=t.shopId){e.next=6;break}if(!(t.goodsNum>t.goodsDetail.stockCount)){e.next=6;break}return t.tui.toast("已超出可售数量",1e3),e.abrupt("return");case 6:if(s.shopList.length>0)for(i=0;i<t.shopList.length;i++)t.goodsDetail.id==t.shopList[i].id&&(t.shopList[i].buyCountNew=""==t.goodsNum?0:t.goodsNum);if(t.shopList1.length>0)for(r=0;r<t.shopList1.length;r++)t.goodsDetail.id==t.shopList1[r].id&&(t.shopList1[r].buyCountNew=""==t.goodsNum?0:t.goodsNum);return t.show=!1,t.evalue=[],a=[],"",n="{",u=t.oneGoodsSpec[0].value[0].value+" | "+t.oneGoodsSpec[1].value[0].value,n+='"'+t.oneGoodsSpec[0].name+'":"'+t.oneGoodsSpec[0].value[0].value+'",',n+='"'+t.oneGoodsSpec[1].name+'":"'+t.oneGoodsSpec[1].value[0].value+'"',n+="}",a.push(n),t.evalue.push(u),e.next=21,t.$nextTick((function(){for(var e=0;e<a.length;e++)Number(t.goodsNum)<0&&"散客"!=t.customerName&&function(){var s=a[e];t.$nextTick((function(){t.checkCanReturn(t.goodsDetail.productSn,t.goodsDetail.id,s,t.customerId,t.goodsNum)}))}(),t.attributeList={attributeList:a[e],productCount:Number(t.goodsNum),productNum:0,name:t.evalue[e],price:t.goodsDetail.purchasePrice},t.temporaryList=[],t.temporaryList.push(t.attributeList);setTimeout((function(e){t.checkCanBuy.length>0&&t.seeCustomCategory()}),500)}));case 21:return e.next=23,t.$nextTick((function(){for(var e=0;e<t.temporaryList.length;e++)for(var s=0;s<t.pecsList.length;s++)t.temporaryList[e].attributeList==t.pecsList[s].attributeList&&(t.temporaryList[e].productNum=t.pecsList[s].stockCount),t.$forceUpdate()}));case 23:return e.next=25,t.$nextTick((function(){var e={attrId:t.goodsDetail.attrId,id:t.goodsDetail.id,price:t.zPrice,num:""==t.goodsNum?0:t.goodsNum,buyCount:t.goodsDetail.buyCount,customerCategoryRule:null!=t.goodsDetail.customerCategoryRule?JSON.parse(t.goodsDetail.customerCategoryRule):null,categoryId:t.goodsDetail.categoryId,productName:t.goodsDetail.productName,productSn:t.goodsDetail.productSn,returnPrice:t.goodsDetail.wholesalePrice,returnList:t.goodsDetail.returnList,productPicture:t.goodsDetail.productPicture,supplierName:t.goodsDetail.supplierName,saleDetailQueryDTO:t.temporaryList,saleDetailQueryDTO1:[],purchasePrice:t.goodsDetail.purchasePrice,unitPrice:t.goodsDetail.wholesalePrice,wholesalePrice:t.goodsDetail.wholesalePrice,lsprice:t.goodsDetail.price};if(0==t.carList.length)t.carList.push(e);else{for(var s=!0,i=0;i<t.carList.length;i++)t.carList[i].id==e.id&&(t.carList[i]=e,s=!1);s&&t.carList.push(e)}}));case 25:return e.next=27,t.$nextTick((function(){s.$refs.goodsNumDialog.close(),s.goodsNum=""}));case 27:t.$forceUpdate();case 28:case"end":return e.stop()}}),e)})))()},checkCanReturn:function(t,e,s,i,r){var o=this;this.tui.request("/app/customer/getCustomerBuyHistory","POST",{productId:e,attributeList:s,customerId:i},!1,!0).then((function(e){if(200==e.code){var i=null==e.result.buyCount?0:e.result.buyCount,a=null==e.result.returnCount?0:e.result.returnCount;if(Number(i)<=0||Number(i)-Number(a)+Number(r)<0){var u={productSn:t,attributeList:s,buyCountAll:i,returnCountAll:a,returnCountAllNew:r};o.checkCanBuy.push(u)}}})).catch((function(t){}))},largeImg:function(t){if(null==t.productPicture&&null==t.productPictures||""==t.productPicture&&null==t.productPictures)this.tui.toast("暂无可展示的图片",300);else{if(this.bigImg=[],null!=t.productPicture){var e={productPicture:t.productPicture};this.bigImg.push(e)}if(null!=t.productPictures)for(var s=0;s<t.productPictures.length;s++)this.bigImg.push(t.productPictures[s]);this.$refs.imgPopup.open()}},getKCList:function(t){var e=this;this.yanseList=new Map,this.chimaList=new Map,this.pecsList=t;for(var s=function(s){var i=JSON.parse(t[s].attributeList);Object.keys(i).forEach((function(t){"颜色"==t&&1!=e.yanseList.has(i[t])&&e.yanseList.set(i[t],i[t])}))},i=0;i<t.length;i++)s(i);for(var r=0;r<this.goodsDetail.attributeList[0].value.length;r++)1==this.yanseList.has(this.goodsDetail.attributeList[0].value[r].value)&&(this.goodsDetail.attributeList[0].value[r].isKucun=!0)},clickMask:function(){t.showToast({title:"请将商品上架或入库后再操作!",icon:"none"})},clickLeftBtn:function(t){for(var e=0;e<this.indexList.length;e++)this.indexList[e].parentId=e==t;this.categoryId=this.indexList[t].id,this.pageNum=1,this.searchName="",this.shopList1=[],this.shopList=[],this.getShareList()},changePrice:function(t){this.goodsDetail.price=this.temporaryList[0].price=t},temporaryCheck:function(){for(var t=this,e=[],s=0;s<this.temporaryList.length;s++)0!=this.temporaryList[s].productCount&&e.push(this.temporaryList[s]);this.$nextTick((function(){var s={attrId:t.goodsDetail.attrId,id:t.goodsDetail.id,price:t.zPrice,num:t.zNum,buyCount:t.goodsDetail.buyCount,categoryId:t.goodsDetail.categoryId,productName:t.goodsDetail.productName,productSn:t.goodsDetail.productSn,returnList:t.goodsDetail.returnList,returnPrice:t.goodsDetail.wholesalePrice,customerCategoryRule:null!=t.goodsDetail.customerCategoryRule?JSON.parse(t.goodsDetail.customerCategoryRule):null,productPicture:t.goodsDetail.productPicture,supplierName:t.goodsDetail.supplierName,saleDetailQueryDTO:e,saleDetailQueryDTO1:[],unitPrice:t.goodsDetail.wholesalePrice,purchasePrice:t.goodsDetail.purchasePrice,wholesalePrice:t.goodsDetail.wholesalePrice,lsprice:t.goodsDetail.price};if(0==t.carList.length)t.carList.push(s);else{for(var i=!0,r=0;r<t.carList.length;r++)t.carList[r].id==s.id&&(t.carList[r]=s,i=!1);i&&t.carList.push(s)}for(var o=0;o<t.carList.length;o++){t.carList[o].num=0;for(var a=0;a<t.carList[o].saleDetailQueryDTO.length;a++)t.carList[o].num+=t.carList[o].saleDetailQueryDTO[a].productCount;if(t.shopList.length>0)for(var u=0;u<t.shopList.length;u++)t.carList[o].id==t.shopList[u].id&&(t.shopList[u].buyCountNew=t.carList[o].num);if(t.shopList1.length>0)for(var n=0;n<t.shopList1.length;n++)t.carList[o].id==t.shopList1[n].id&&(t.shopList1[n].buyCountNew=t.carList[o].num)}t.temporaryList=[],t.oldTemList=[],t.purchasePrice="",t.zPrice="",t.zNum="";for(var h=0;h<t.goodsDetail.attributeList.length;h++){t.goodsDetail.attributeList[h].isChecked=!1;for(var c=0;c<t.goodsDetail.attributeList[h].value.length;c++)t.goodsDetail.attributeList[h].value[c].isChecked=!1}t.$refs.popup.close()}))},delShop:function(e){var s=this;t.showModal({title:"提示",content:"确定删除此条商品吗?",success:function(t){if(t.confirm){for(var i=0;i<s.carList.length;i++)s.carList[i].id==e.id&&(s.carNum-=s.carList[i].num,s.carList.splice(i,1));s.carType=s.carList.length}s.$forceUpdate()}})},delCarData:function(t){this.temporaryList.splice(t,1),this.temporaryChange()},delShopSpec:function(e,s){var i=this;t.showModal({title:"提示",content:"确定删除此条商品吗?",success:function(t){if(t.confirm){for(var r=0;r<i.carList.length;r++){for(var o=0;o<i.carList[r].saleDetailQueryDTO.length;o++)i.carList[r].id!=e||i.carList[r].saleDetailQueryDTO[o].attributeList!=s||(i.carList[r].num-=i.carList[r].saleDetailQueryDTO[o].productCount,i.carNum-=i.carList[r].saleDetailQueryDTO[o].productCount,i.carList[r].saleDetailQueryDTO.splice(o,1));0==i.carList[r].saleDetailQueryDTO.length&&i.carList.splice(r,1)}i.carType=i.carList.length}i.$forceUpdate()}})},checkPay:function(t){this.purchasePrice=t,this.$refs.inputDialog.close()},keyWordChange:function(t){var e=this;0==t.show&&(this.show=!1,this.keyboardNum="",setTimeout((function(t){e.goodsNum=""}),500))}}};e.default=h}).call(this,s("df3c")["default"],s("3223")["default"])}},[["52bc","common/runtime","common/vendor"]]]);