service-fee-setting.29ea1638a40ec1601f0a.js 6.73 KB
webpackJsonp([1],{1:function(e,t){e.exports=iview},150:function(e,t,n){"use strict";var r=n(9),a=n.n(r),i=n(10),s=n.n(i),o=n(1),u=(n.n(o),n(6)),c=(n.n(u),n(3),n(151)),l=n(7),m=n(393),d=new l.a;t.a={name:"service-fee-setting",mixins:[c.a],components:{ItemDetail:m.a},data:function(){var e=this;return{data:[{enterType:0,ruleParam:{rules:[{min:0,max:9,rate:.04},{min:10,max:19,rate:.048},{min:20,max:49,rate:.047},{min:50,max:99,rate:.045},{min:100,rate:.04}]}},{enterType:1,ruleParam:{rules:[{min:0,max:9,rate:.05},{min:10,max:19,rate:.048},{min:20,max:49,rate:.047},{min:50,max:99,rate:.045},{min:100,rate:.04}]}},{enterType:2,ruleParam:{rules:[{min:0,max:9,rate:.06},{min:10,max:19,rate:.048},{min:20,max:49,rate:.047},{min:50,max:99,rate:.045},{min:100,rate:.04}]}}],columns:[{type:"index",width:60,align:"center"},{title:"类型",width:200,render:function(t,n){var r=n.row;return t("span",e.getType(r.enterType))}},{title:"操作",width:270,align:"center",render:function(t,n){var r=n.row;return t("div",{},[t("i-button",{props:{type:"primary",size:"small"},style:{marginLeft:"20px"},on:{click:function(){return e.onEdit(r)}}},"编辑")])}}],show:!1,selectRow:null}},created:function(){this.fetchData()},methods:{fetchData:function(){var e=this;return s()(a.a.mark(function t(){var n;return a.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e.$Loading.start(),t.next=3,d._get("/ufoPlatform/selller/rule/orderQuantity/getGoodsServiceFeeRate");case 3:n=t.sent,200===n.code?(e.data=n.data,e.$Loading.finish()):(n.message&&e.$Message.warning(n.message),e.$Loading.error());case 5:case"end":return t.stop()}},t,e)}))()},onSave:function(){var e=this;return s()(a.a.mark(function t(){var n,r;return a.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.$refs.rule.getRule(),e.selectRow=null,e.$Loading.start(),t.next=5,d._post("/ufoPlatform/selller/rule/orderQuantity/updateGoodsServiceFeeRate",n,!0);case 5:r=t.sent,200===r.code?(e.$Loading.finish(),e.$nextTick(function(){e.fetchData()})):(r.message&&e.$Message.warning(r.message),e.$Loading.error());case 7:case"end":return t.stop()}},t,e)}))()},onEdit:function(e){this.show=!0,this.selectRow=e},onCancel:function(){this.selectRow=null}}}},151:function(e,t,n){"use strict";t.a={data:function(){return{tempIndex:1}},methods:{getTitle:function(e){switch(e){case 0:return"散户平台服务费规则";case 1:return"普通商户平台服务费规则";case 2:return" 超级卖家平台服务费规则"}},getType:function(e){switch(e){case 0:return"非入驻";case 1:return"普通";case 2:return"超级"}},genId:function(){return Date.now()+this.tempIndex++}}}},152:function(e,t,n){"use strict";var r=n(47),a=n.n(r),i=n(26),s=n.n(i),o=n(395),u=n(151),c=n(1);n.n(c);t.a={name:"service-fee-editor",mixins:[u.a],props:{enterType:{type:Number,default:function(){return 0}},ruleParam:{type:Object,default:function(){return{rules:[]}}}},data:function(){return{rules:JSON.parse(s()(this.ruleParam.rules.map(this.addId))),dirty:!1}},components:{ItemDetail:o.a},mounted:function(){console.log(this.rules)},watch:{ruleParam:function(e){this.rules=JSON.parse(s()(e.rules.map(this.addId)))}},methods:{onAddClick:function(){this.rules.push({min:0,max:0,rate:0,index:this.genId()})},getRule:function(){var e=this;return{enterType:e.enterType,ruleParam:{rules:e.rules.map(function(e){return{min:Number(e.min),max:Number(e.max),rate:Number(e.rate)}})}}},onClearClick:function(){this.rules=[]},onRemoveClick:function(e){var t=e.index,n=this.rules.findIndex(function(e){return e.index===t});n>=0&&this.rules.splice(n,1)},addId:function(e){return a()({},e,{index:this.genId()})}}}},153:function(e,t,n){"use strict";t.a={name:"FeeItem",props:{index:Number,data:{type:Object,default:function(){return{min:0,max:0,rate:0}}}},methods:{onRemoveClick:function(){this.$emit("on-remove",{index:this.index})}}}},390:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(391),a=n(12);Object(a.a)(r.a)},391:function(e,t,n){"use strict";function r(e){s||n(392)}var a=n(150),i=n(399),s=!1,o=n(0),u=r,c=o(a.a,i.a,!1,u,null,null);c.options.__file="src/views/service-fee-setting/index.vue",t.a=c.exports},392:function(e,t){},393:function(e,t,n){"use strict";function r(e){s||n(394)}var a=n(152),i=n(398),s=!1,o=n(0),u=r,c=o(a.a,i.a,!1,u,"data-v-14e5c249",null);c.options.__file="src/views/service-fee-setting/detail.vue",t.a=c.exports},394:function(e,t){},395:function(e,t,n){"use strict";function r(e){s||n(396)}var a=n(153),i=n(397),s=!1,o=n(0),u=r,c=o(a.a,i.a,!1,u,"data-v-17da6c0b",null);c.options.__file="src/views/service-fee-setting/item.vue",t.a=c.exports},396:function(e,t){},397:function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("FormItem",[n("span",[e._v("订单数")]),e._v(" "),n("Input",{staticStyle:{width:"100px"},attrs:{type:"number"},model:{value:e.data.min,callback:function(t){e.$set(e.data,"min",t)},expression:"data.min"}}),e._v(" "),n("span",[e._v("-")]),e._v(" "),n("Input",{staticStyle:{width:"100px"},attrs:{type:"number"},model:{value:e.data.max,callback:function(t){e.$set(e.data,"max",t)},expression:"data.max"}}),e._v(" "),n("span",{staticStyle:{"margin-left":"10px"}},[e._v("平台服务费")]),e._v(" "),n("Input",{staticStyle:{width:"100px"},attrs:{type:"number"},model:{value:e.data.rate,callback:function(t){e.$set(e.data,"rate",t)},expression:"data.rate"}}),e._v(" "),n("Button",{key:e.index,staticStyle:{"margin-left":"10px"},attrs:{type:"error"},on:{click:e.onRemoveClick}},[e._v("X")])],1)},a=[];r._withStripped=!0;var i={render:r,staticRenderFns:a};t.a=i},398:function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("Card",{attrs:{bordered:!1,"dis-hover":!0}},[n("p",{attrs:{slot:"title"},slot:"title"},[e._v(e._s(e.getTitle(e.enterType)))]),e._v(" "),n("div",{staticStyle:{"margin-top":"10px","margin-bottom":"10px"}},[n("Button",{attrs:{type:"primary"},on:{click:e.onAddClick}},[e._v("增加")]),e._v(" "),n("Button",{attrs:{type:"warning"},on:{click:e.onClearClick}},[e._v("清空")])],1),e._v(" "),n("Form",[e._l(e.rules,function(t){return[n("ItemDetail",{key:t.index,ref:"rules",refInFor:!0,attrs:{index:t.index,data:t},on:{"on-remove":e.onRemoveClick}})]})],2)],1)},a=[];r._withStripped=!0;var i={render:r,staticRenderFns:a};t.a=i},399:function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("LayoutContent",{attrs:{breads:[{title:"平台优惠设置列表"}]}},[n("LayoutTable",{attrs:{columns:e.columns,data:e.data}}),e._v(" "),n("Modal",{on:{"on-cancel":e.onCancel,"on-ok":e.onSave},model:{value:e.show,callback:function(t){e.show=t},expression:"show"}},[n("ItemDetail",e._b({ref:"rule"},"ItemDetail",e.selectRow,!1))],1)],1)},a=[];r._withStripped=!0;var i={render:r,staticRenderFns:a};t.a=i},8:function(e,t){e.exports=Vue}},[390]);