service-fee-setting.ad571d67b9ced433ebc0.js
6.19 KB
webpackJsonp([2],{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),c=(n.n(o),n(6)),u=(n.n(c),n(3),n(151)),l=n(7),d=n(397),f=new l.a;t.a={name:"service-fee-setting",mixins:[u.a],components:{ItemDetail:d.a},data:function(){var e=this;return{data:[],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,f._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,f._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(27),a=n.n(r),i=n(22),s=n.n(i),o=n(399),c=n(151),u=n(1);n.n(u);t.a={name:"service-fee-editor",mixins:[c.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:"",max:"",rate:"",index:this.genId()})},getRule:function(){var e=this;return{enterType:e.enterType,ruleParam:{rules:e.rules.map(function(e){return{min:e.min,max:e.max,rate: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})}}}},394:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(395),a=n(12);Object(a.a)(r.a)},395:function(e,t,n){"use strict";function r(e){s||n(396)}var a=n(150),i=n(403),s=!1,o=n(0),c=r,u=o(a.a,i.a,!1,c,null,null);u.options.__file="src/views/service-fee-setting/index.vue",t.a=u.exports},396:function(e,t){},397:function(e,t,n){"use strict";function r(e){s||n(398)}var a=n(152),i=n(402),s=!1,o=n(0),c=r,u=o(a.a,i.a,!1,c,"data-v-14e5c249",null);u.options.__file="src/views/service-fee-setting/detail.vue",t.a=u.exports},398:function(e,t){},399:function(e,t,n){"use strict";function r(e){s||n(400)}var a=n(153),i=n(401),s=!1,o=n(0),c=r,u=o(a.a,i.a,!1,c,"data-v-17da6c0b",null);u.options.__file="src/views/service-fee-setting/item.vue",t.a=u.exports},400:function(e,t){},401: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"},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"},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"},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},402: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},403: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}},[394]);