shop-php/public/static.dev/js/pages-product-addGoods-modifyPrice.c7659ceb.js

1 line
29 KiB
JavaScript
Raw Normal View History

2023-08-30 19:08:53 +08:00
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-product-addGoods-modifyPrice"],{1963:function(t,e,i){"use strict";i("7a82");var a=i("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(i("ade3"));i("4de4"),i("d3b7"),i("159b"),i("b64b"),i("14d9"),i("07ac");var c=i("d67f"),o=a(i("3688")),l=i("350b"),s=a(i("00b1")),r={components:{avatar:o.default},data:function(){return{popupOpenModel:!1,selectAllFlag:!1,isBatchOperation:!1,multiSpecificationList:[],addMultiSpecification:[],attrObj:"",index:0,imgName:"",batchData:{price:"",cost:"",ot_price:"",bar_code:"",weight:"",volume:"",extension_one:"",extension_two:""},a:{}}},onLoad:function(t){this.attrObj=t.code},onShow:function(){this.initData()},watch:{multiSpecificationList:{handler:function(t){t.filter((function(t){return t.select})).length==t.length?this.selectAllFlag=!0:this.selectAllFlag=!1},deep:!0},batchData:{handler:function(t){this.multiSpecificationList.bar_code=this.attrObj,(0,c.setStorage)("attrValue",this.multiSpecificationList)},deep:!0}},methods:{initData:function(){var t=this;(0,c.getStorage)("attrValue")?this.multiSpecificationList=(0,c.getStorage)("attrValue"):this.multiSpecificationList=this.attrFormat((0,c.getStorage)("modifyPriceData").template_value),this.multiSpecificationList.forEach((function(e){t.$set(e,"more_thanFlag",!1),t.$set(e,"select",!1),t.$set(e,"bar_code",t.attrObj)}))},selectImage:function(t){this.$util.uploadImageOne("upload/image",(function(e){t.image=e.data.path}))},clk:function(t){(0,c.setStorage)("attrValue",this.multiSpecificationList);var e=this.$refs.avatar;this.index=t,e.fChooseImg(1,{selWidth:"350upx",selHeight:"350upx",inner:!0})},doUpload:function(t){var e=this;uni.uploadFile({url:l.HTTP_REQUEST_URL+"/api/upload/image/field",filePath:t.path,name:"field",formData:{filename:t.path,name:e.imgName},header:(0,n.default)({},l.TOKENNAME,"Bearer "+s.default.state.app.token),success:function(t){var i=JSON.parse(t.data);e.multiSpecificationList[e.index]["image"]=i.data.path},complete:function(t){}})},getImgName:function(t){this.imgName=t},moreThan:function(t){t.more_thanFlag=!0},batchOperation:function(){var t=this;this.isBatchOperation=!0,this.multiSpecificationList.forEach((function(e){t.$set(e,"select",!1)}))},selectAll:function(){var t=this;this.selectAllFlag=!this.selectAllFlag,this.multiSpecificationList.forEach((function(e){t.selectAllFlag?t.$set(e,"select",!0):t.$set(e,"select",!1)}))},selectGoods:function(t){t.select=!t.select},openChangeModel:function(){this.multiSpecificationList.filter((function(t){return t.select})).length?this.$refs.changePopup.open():(0,c.Toast)("请选择商品")},saveBachData:function(){var t=this;Object.keys(this.batchData).forEach((function(e){t.multiSpecificationList.forEach((function(i){i.select&&(i[e]=t.batchData[e])}))})),this.isBatchOperation=!1,this.$refs.changePopup.close()},saveAttrValue:function(){(0,c.setStorage)("attrValue",this.multiSpecificationList),(0,c.navigateBack)(1)},closeChangePopup:function(){this.$refs.changePopup.close()},attrFormat:function(t){var e=[],i=[];return function(t){if(t.length>1)t.forEach((function(a,n){0===n&&(e=t[n]["detail"]);var c=[];e.forEach((function(e){t[n+1]&&t[n+1]["detail"]&&t[n+1]["detail"].forEach((function(a){var o=(0!==n?"":t[n]["value"]+"_$_")+e+"-$-"+t[n+1]["value"]+"_$_"+a;if(c.push(o),n===t.length-2){var l={image:"",price:0,cost:0,ot_price:0,bar_code:"",weight:0,volume:0,brokerage:0,brokerage_two:0};o.split("-$-").forEach((function(t,e){var i=t.split("_$_");l["detail"]||(l["detail"]={}),l["detail"][i[0]]=i.length>1?i[1]:""})),Object.values(l.detail).forEach((function(t,e){l["value"+e]=t})),i.push(l)}}))})),e=c.length?c:[]}));else{var a=[];t.forEach((function(t,e){t["detail"].forEach((function(e,c){a[c]=t["value"]+"_"+e,i[c]={image:"",price:0,cost:0,ot_price:0,bar_code:"",weight:0,volume:0,brokerage:0,brokerage_two:0,detail:(0,n.default)({},t["value"],e)},Object.values(i[c].detail).forEach((function(t,e){i[c]["value"+e]=t}))}))})),e.push(a.join("$&"))}return i}(t)}}};e.default=r},"1be0":function(t,e,i