(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["goods~server"],{"19d3":function(t,e,r){"use strict";r.d(e,"e",(function(){return i})),r.d(e,"b",(function(){return a})),r.d(e,"a",(function(){return c})),r.d(e,"d",(function(){return u})),r.d(e,"c",(function(){return s}));var n=r("b775"),o={list:"/goods.service/list",all:"/goods.service/all",add:"/goods.service/add",edit:"/goods.service/edit",delete:"/goods.service/delete"};function i(t){return Object(n["b"])({url:o.list,method:"get",params:t})}function a(t){return Object(n["b"])({url:o.all,method:"get",params:t})}function c(t){return Object(n["b"])({url:o.add,method:"post",data:t})}function u(t){return Object(n["b"])({url:o.edit,method:"post",data:t})}function s(t){return Object(n["b"])({url:o.delete,method:"post",data:t})}},"1da1":function(t,e,r){"use strict";r.d(e,"a",(function(){return o}));r("d3b7");function n(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function o(t){return function(){var e=this,r=arguments;return new Promise((function(o,i){var a=t.apply(e,r);function c(t){n(a,o,i,c,u,"next",t)}function u(t){n(a,o,i,c,u,"throw",t)}c(void 0)}))}}},"88bc":function(t,e,r){(function(e){var r=1/0,n=9007199254740991,o="[object Arguments]",i="[object Function]",a="[object GeneratorFunction]",c="[object Symbol]",u="object"==typeof e&&e&&e.Object===Object&&e,s="object"==typeof self&&self&&self.Object===Object&&self,l=u||s||Function("return this")();function f(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function d(t,e){var r=-1,n=t?t.length:0,o=Array(n);while(++r0&&r(c)?e>1?w(c,e-1,r,n,o):h(o,c):n||(o[o.length]=c)}return o}function L(t,e){return t=Object(t),j(t,e,(function(e,r){return r in t}))}function j(t,e,r){var n=-1,o=e.length,i={};while(++n-1&&t%1==0&&t<=n}function F(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function A(t){return!!t&&"object"==typeof t}function N(t){return"symbol"==typeof t||A(t)&&g.call(t)==c}var T=O((function(t,e){return null==t?{}:L(t,d(w(e,1),x))}));t.exports=T}).call(this,r("c8ba"))},"967a":function(t,e,r){"use strict";r.d(e,"f",(function(){return i})),r.d(e,"b",(function(){return a})),r.d(e,"d",(function(){return c})),r.d(e,"a",(function(){return u})),r.d(e,"e",(function(){return s})),r.d(e,"c",(function(){return l}));var n=r("b775"),o={list:"/setting.delivery/list",all:"/setting.delivery/all",detail:"/setting.delivery/detail",add:"/setting.delivery/add",edit:"/setting.delivery/edit",delete:"/setting.delivery/delete"};function i(t){return Object(n["b"])({url:o.list,method:"get",params:t})}function a(t){return Object(n["b"])({url:o.all,method:"get",params:t})}function c(t){return Object(n["b"])({url:o.detail,method:"get",params:t})}function u(t){return Object(n["b"])({url:o.add,method:"post",data:t})}function s(t){return Object(n["b"])({url:o.edit,method:"post",data:t})}function l(t){return Object(n["b"])({url:o.delete,method:"post",data:t})}},c7eb:function(t,e,r){"use strict";r.d(e,"a",(function(){return o}));r("a4d3"),r("e01a"),r("b636"),r("d28b"),r("944a"),r("fb6a"),r("b0c0"),r("0c47"),r("23dc"),r("3410"),r("131a"),r("d3b7"),r("3ca3"),r("159b"),r("ddb0");var n=r("53ca");function o(){ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ o=function(){return e};var t,e={},r=Object.prototype,i=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",s=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function d(t,e,r,n){var o=e&&e.prototype instanceof b?e:b,i=Object.create(o.prototype),c=new S(n||[]);return a(i,"_invoke",{value:G(t,r,c)}),i}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var v="suspendedStart",y="suspendedYield",g="executing",p="completed",m={};function b(){}function _(){}function w(){}var L={};f(L,u,(function(){return this}));var j=Object.getPrototypeOf,O=j&&j(j(F([])));O&&O!==r&&i.call(O,u)&&(L=O);var D=w.prototype=b.prototype=Object.create(L);function x(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function r(o,a,c,u){var s=h(t[o],t,a);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==Object(n["a"])(f)&&i.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,c,u)}),(function(t){r("throw",t,c,u)})):e.resolve(f).then((function(t){l.value=t,c(l)}),(function(t){return r("throw",t,c,u)}))}u(s.arg)}var o;a(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}})}function G(e,r,n){var o=v;return function(i,a){if(o===g)throw Error("Generator is already running");if(o===p){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=k(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===v)throw o=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=g;var s=h(e,r,n);if("normal"===s.type){if(o=n.done?p:y,s.arg===m)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=p,n.method="throw",n.arg=s.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=h(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function F(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),s=i.call(a,"finallyLoc");if(u&&s){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:F(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}},e1fe:function(t,e,r){"use strict";var n=r("5530"),o=(r("4de4"),r("d81d"),r("d3b7"),r("3ca3"),r("159b"),r("ddb0"),r("2ef0")),i=r.n(o),a=r("8243"),c=r("d084"),u=r("2e1c"),s=r("19d3"),l=r("967a");e["a"]={goodsId:null,formData:{goods:{},categoryList:[],deliveryList:[],serviceList:[],defaultServiceIds:[],userGradeList:[],defaultUserGradeValue:{},dealer:{levelList:[{name:"一级佣金",value:"first_money"},{name:"二级佣金",value:"second_money"},{name:"三级佣金",value:"third_money"}]}},getFromData:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this.goodsId=e,new Promise((function(r,n){Promise.all([t.getGoodsDetail(e),t.getCategoryList(),t.getDeliveryList(),t.getServiceList(),t.getUserGradeList()]).then((function(){t.setDefaultData(),r({formData:t.formData})}))}))},getGoodsDetail:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return!!e&&new Promise((function(r,n){c["e"]({goodsId:e}).then((function(e){t.formData.goods=e.data.goodsInfo,r()}))}))},getFieldsValue:function(){var t=this.formData.goods;t.categorys=this.formatCategoryIds(t.categoryIds);var e=i.a.pick(t,["goods_type","goods_name","categorys","goods_no","sort","is_brand","is_new","paihang","remaizhishu","status","spec_type","deduct_stock_type","is_restrict","content","selling_point","serviceIds","sales_initial","is_points_gift","is_points_discount","is_enable_grade","is_alone_grade","is_ind_dealer","dealer_money_type","first_money","second_money","third_money","cmmdty_model","is_check","goods_source","delivery_time","is_in_store","remark","is_use_jd_stock"]);return Object(n["a"])({},e)},getFieldsValue2:function(){var t=this.formData.goods,e={};if(10==t.goods_type&&(e["delivery_id"]=t["delivery_id"],e["is_ind_delivery_type"]=t["is_ind_delivery_type"],e["delivery_type"]=t["delivery_type"]),10==t.spec_type){var r=i.a.pick(t.skuList[0],["goods_price","line_price","cost_price","stock_num","goods_weight"]);e=Object(n["a"])(Object(n["a"])({},e),r)}return 1==t.is_restrict&&(e["restrict_total"]=t["restrict_total"],e["restrict_single"]=t["restrict_single"]),e},formatCategoryIds:function(t){return t.map((function(t){return{value:t}}))},getCategoryList:function(){var t=this;return new Promise((function(e,r){a["a"].getCategoryTreeSelect().then((function(r){t.formData.categoryList=r,e()}))}))},getDeliveryList:function(){var t=this;return new Promise((function(e,r){l["b"]().then((function(r){t.formData.deliveryList=r.data.list,e()}))}))},getServiceList:function(){var t=this;return new Promise((function(e,r){s["b"]().then((function(r){t.formData.serviceList=r.data.list,e()}))}))},getUserGradeList:function(){var t=this;return new Promise((function(e,r){u["a"]({status:1}).then((function(r){t.formData.userGradeList=r.data.list,e()}))}))},setDefaultData:function(){this.setDefaultServiceIds(),this.setDefaultUserGradeValue()},setDefaultServiceIds:function(){var t=this.formData.serviceList;if(!this.goodsId){var e=t.filter((function(t){return t.is_default}));this.formData.defaultServiceIds=e.map((function(t){return t.service_id}))}},setDefaultUserGradeValue:function(){var t=this.formData.userGradeList,e=this.goodsId&&this.formData.goods.alone_grade_equity?this.formData.goods.alone_grade_equity:{},r={};t.forEach((function(t){r[t.grade_id]=e[t.grade_id]||t.equity.discount})),this.formData.defaultUserGradeValue=Object(n["a"])({},r)}}}}]);