| 12345678910 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/module/app-commodity"],{"5ada":function(e,t,i){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=i("7602"),o=i("7adc"),r=c(i("fca4")),u=c(i("f01d"));function c(e){return e&&e.__esModule?e:{default:e}}function s(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function l(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?s(Object(i),!0).forEach((function(t){a(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):s(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function a(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var f=function(){Promise.all([i.e("common/vendor"),i.e("components/app-img")]).then(function(){return resolve(i("cb3c"))}.bind(null,i)).catch(i.oe)},d=function(){i.e("components/module/allSelectInput").then(function(){return resolve(i("2d69"))}.bind(null,i)).catch(i.oe)},h={name:"Commodity",components:{AppImg:f,allSelectInput:d},mixins:[r.default,u.default],props:{info:{required:!0,type:Object,default:function(){return{}}},type:{type:String,default:n.COMMODITY_TYPE.COMMON},bigCount:{type:Number,default:0},scrollTop:{type:Number,default:0},smallCount:{type:Number,default:0},userPrice:{type:Number,default:0},autoPrice:{},offPrice:{type:Boolean,default:!1},isActive:{type:Boolean,default:!1},offVerifyRepertory:{type:Boolean,default:!1},isAlterPrice:{type:Boolean,default:!1}},data:function(){return{COMMODITY_TYPE:n.COMMODITY_TYPE,isImg:!1,isAlterMoney:!1,isAloneAllActive:!1,isAloneAllFocus:!1,isShowSucceed:!1,changeAutoPrice:"",showPrice:0,oldPrice:0,ifFocus:!1}},created:function(){},mounted:function(){var e=this;setTimeout((function(){e.isImg=!0}),100),2==this.info.priceLabel&&(this.changeAutoPrice=this.info.price),this.showPrice=1==this.info.priceLabel?null:this.info.price,this.oldPrice=(Number(this.info.cost)+Number(this.info.addPrice)).toFixed(2)},methods:{deleteInputVal:function(){this.isAloneAllActive=!1,this.changeAutoPrice=""},moveAllInput:function(e){var t=this;this.isAloneAllActive=!1,this.isAloneAllFocus=!1,this.changeAutoPrice=e||0,this.isAlterMoney&&(this.isAlterMoney=!1,(0,o.changePriceByIdApi)({productId:this.info.id,price:this.changeAutoPrice}).then((function(e){1==e.code?(t.showPrice=e.data.price,t.isShowSucceed=!0,setTimeout((function(){t.isShowSucceed=!1}),1e3)):t.$msg(e.msg)})))},addEvents:function(e){if(0==e){var t=Number(this.info.ratio);if(this.offVerifyRepertory){if(this.info.stock<=0)return void this.$msg("库存不足");if(Number(this.bigCount)*t+Number(this.smallCount)>Number(this.info.bigNum)*t+Number(this.info.smallNum))return void this.$msg("库存不足")}this.animationFun("add"),this.$emit("add",this.info)}else this.$emit("goToSpecialVariety",this.info)},delEvent:function(e){0==e?(this.animationFun("del"),this.$emit("del",this.info)):this.$emit("goToSpecialVariety",this.info)},changePriceEvent:function(e){var t=this;(0,o.changePriceByIdApi)({productId:this.info.id,price:this.showPrice}).then((function(e){1==e.code?(t.showPrice=e.data.price,t.isShowSucceed=!0,setTimeout((function(){t.isShowSucceed=!1}),1e3)):t.$msg(e.msg)})),this.isAlterMoney=!0},customNum:function(t){if(0==t){if(this.offVerifyRepertory&&this.info.stock<=0)return void e.showToast({title:"库存不足",icon:"none"});if(this.bigCount||this.smallCount)this.$emit("customNum",l(l({},this.info),{},{bigCount:this.bigCount,smallCount:this.smallCount,userPrice:this.userPrice}));else{var i=l(l({},this.info),{},{bigCount:this.bigCount,smallCount:this.smallCount,userPrice:this.userPrice});this.$emit("addOneEvent",this.info,i)}}else this.$emit("goToSpecialVariety",this.info)}}};t.default=h}).call(this,i("f3be")["default"])},a198:function(e,t,i){"use strict";var n=i("d703"),o=i.n(n);o.a},b27a:function(e,t,i){"use strict";var n;i.d(t,"b",(function(){return o})),i.d(t,"c",(function(){return r})),i.d(t,"a",(function(){return n}));var o=function(){var e=this,t=e.$createElement,i=(e._self._c,e.type==e.COMMODITY_TYPE.COMMON?Number(e.info.discountPrice):null),n=e.type==e.COMMODITY_TYPE.COMMON?Number(e.info.discountPrice):null,o=e.type==e.COMMODITY_TYPE.COMMON?Number(e.info.price):null,r=e.type==e.COMMODITY_TYPE.COMMON?Number(e.info.stock):null,u=e.type==e.COMMODITY_TYPE.COMMON?Number(e.info.stockWarning):null,c=e.type==e.COMMODITY_TYPE.CHANGE?Number(e.oldPrice):null,s=e.type==e.COMMODITY_TYPE.CHANGE?Number(e.showPrice):null,l=e.type==e.COMMODITY_TYPE.CHANGE?Number(e.showPrice):null,a=e.type==e.COMMODITY_TYPE.CHANGE&&c>s&&l>0?(10*(Number(e.showPrice)/Number(e.oldPrice)).toFixed(2)).toFixed(1):null;e._isMounted||(e.e0=function(t){e.showPrice=null}),e.$mp.data=Object.assign({},{$root:{m0:i,m1:n,m2:o,m3:r,m4:u,m5:c,m6:s,m7:l,g0:a}})},r=[]},d703:function(e,t,i){},e36c:function(e,t,i){"use strict";i.r(t);var n=i("b27a"),o=i("e9ab");for(var r in o)["default"].indexOf(r)<0&&function(e){i.d(t,e,(function(){return o[e]}))}(r);i("a198");var u,c=i("0095"),s=Object(c["a"])(o["default"],n["b"],n["c"],!1,null,"6700ef4d",null,!1,n["a"],u);t["default"]=s.exports},e9ab:function(e,t,i){"use strict";i.r(t);var n=i("5ada"),o=i.n(n);for(var r in n)["default"].indexOf(r)<0&&function(e){i.d(t,e,(function(){return n[e]}))}(r);t["default"]=o.a}}]);
- ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
- 'components/module/app-commodity-create-component',
- {
- 'components/module/app-commodity-create-component':(function(module, exports, __webpack_require__){
- __webpack_require__('f3be')['createComponent'](__webpack_require__("e36c"))
- })
- },
- [['components/module/app-commodity-create-component']]
- ]);
|