coupon.8e70e732031f96be4a56.js
27.1 KB
webpackJsonp([3],{1:function(e,t){e.exports=iview},101:function(e,t,a){"use strict";var r=a(13),o=a.n(r),i=a(9),n=a.n(i),s=a(10),l=a.n(s),u=a(1),c=(a.n(u),a(7)),d=a(6),m=a.n(d),p=a(25),f=a(21),v=a.n(f),h=a(253),y=new c.a;t.a={name:"CouponPage",data:function(){var e=this;this.$createElement;return{filter:{id:"",name:"",status:"",time:["",""],userType:""},page:1,total:0,data:[],columns:[{title:"ID",key:"id",width:80},{title:"用户类型",key:"userType",width:180},{title:"券名称",key:"name",width:180},{title:"token",key:"token",width:180},{title:"数量",key:"couponNum",width:90},{title:"已发放",key:"sendNum",width:90},{title:"已使用",key:"useNum",width:90},{title:"使用期限",key:"useTime",width:165},{title:"优惠券说明",key:"remark",align:"center",width:150},{title:"状态",align:"center",key:"status"},{title:"操作",align:"center",width:200,render:function(t,a){var r=a.row;return t("div",[t(u.Button,{attrs:{type:"success",size:"small"},on:{click:function(){return e.onEditCoupon(r,!0,!0)}}},["查看详情"]),"未生效"===r.status||"生效中"===r.status?t(u.Button,{attrs:{type:"primary",size:"small"},on:{click:function(){return e.onEditCoupon(r)}}},["修改"]):void 0,t(u.Button,{attrs:{type:"warning",size:"small"},on:{click:function(){return e.onToRecord(r)}}},["发放记录"]),"未生效"===r.status||"生效中"===r.status?t(u.Button,{attrs:{type:"success",size:"small"},on:{click:function(){return e.onSendCoupon(r)}}},["发券"]):void 0])}}]}},created:function(){var e=this;this.$nextTick(function(){var t=v.a.parse(location.search?location.search.slice(1):""),a=t.page,r=t.id,o=t.name,i=t.status,n=t.startTime,s=t.endTime,l=t.userType;e.filter.id=r||e.filter.id,e.filter.name=o?decodeURIComponent(o):e.filter.name,e.filter.status=i?parseInt(i):e.filter.status,e.filter.time=n&&s?[m()(n),m()(s)]:e.filter.time,e.filter.userType=l||e.filter.userType,e.page=a?parseInt(a):1,e.fetchData(e.filter,e.page)})},methods:{onToRecord:function(e){var t=e.id;location.href="send-record.html?"+v.a.stringify({id:t,param:{id:this.filter.id||void 0,name:this.filter.name||void 0,status:this.filter.status||void 0,startTime:this.filter.time[0]||void 0,endTime:this.filter.time[1]||void 0,page:this.page||void 0}})},onSendCoupon:function(e){var t=e.id,a=e.token;t&&a&&(location.href="send-coupon.html?"+v.a.stringify({id:t,token:a}))},onCreated:function(){this.fetchData(this.filter)},onFilter:function(){this.fetchData(this.filter)},onClear:function(){this.$refs.filterForm.resetFields(),this.fetchData(this.filter)},onPageChange:function(e){this.fetchData(this.filter,e)},onCreateCoupon:function(){this.$refs.modalCreateCoupon.show()},onEditCoupon:function(e,t,a){var r=e.id;e.sendNum>0&&(t=!0),this.$refs.modalCreateCoupon.show(r,t,a)},onExport:function(){var e=this;return l()(n.a.mark(function t(){var a;return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e.$Loading.start(),t.next=3,y._get("/ufoPlatform/coupon/export",{param:{method:"coupon",param:y._2params(e.getParams(e.filter))}},{responseType:"blob"});case 3:a=t.sent,a instanceof Blob?(p.a.downloadBlob(a,"优惠券导出_"+m()().format("YYYY-MM-DD")+".xlsx"),e.$Loading.finish()):a&&(a.message&&e.$Message.warning(a.message),e.$Loading.error());case 5:case"end":return t.stop()}},t,e)}))()},fetchData:function(e){var t=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return l()(n.a.mark(function r(){var i,s;return n.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t.page=a,t.$Loading.start(),r.next=4,y._get("/ufoPlatform/coupon/queryCoupons",o()({page:a},t.getParams(e)));case 4:i=r.sent,console.log(t.getParams(e),i),200===i.code?(t.total=i.data.total,s=i.data.coupons,s.map(function(e){return e.userType=1===e.userType?"买家":"卖家"}),t.data=s,t.$Loading.finish()):(i.message&&t.$Message.warning(i.message),t.$Loading.error());case 7:case"end":return r.stop()}},r,t)}))()},getParams:function(e){var t=e.time[0]?m()(e.time[0]).unix():void 0,a=e.time[1]?m()(e.time[1]).unix():void 0,r=parseInt(e.status)>=0?e.status:void 0,o=m()().unix();return{id:e.id,name:e.name,status:r,startTime:t,endTime:a,curTime:o,userType:e.userType}}},components:{ModalCreateCoupon:h.a}}},102:function(e,t,a){"use strict";var r=a(9),o=a.n(r),i=a(10),n=a.n(i),s=a(27),l=a.n(s),u=a(7),c=a(6),d=a.n(c),m=a(66),p=a.n(m),f=new u.a,v={buyer:[{value:100,label:"活动券"},{value:110,label:"运费券"}],seller:[{value:100,label:"活动券"}]},h={"1-N":"现货发货",4:"预售",5:"瑕疵",6:"二手"},y={1:"指定商品",2:"全部商品",4:"特定品牌",5:"特定品类",6:"特定系列"},b={"9-N":"极速发货","9-Y":"极速寄存",4:"预售",5:"瑕疵",6:"二手",17:"海外直邮","1-N":"现货发货","1-Y":"现货寄存","3-N":"闪购发货","3-Y":"闪购寄存"},D={ufo:"UFO","h5/xianyu":"闲鱼"},g={id:0,couponName:"",couponNum:0,couponType:0,useNum:1,couponAmount:0,useLimitType:0,remark:"",productLimitValue:"",productLimitType:2,brandVal:[],category:{index:1,items:[{index:1,value:[]}]},series:{index:1,items:[{index:1,value:[]}]},excludeProductIds:"",useLimitValue:0,time:["",""],receiveTime:["",""],skupAllowTypeLabel:[],businessClientLabel:[],checkRequired:0,isCheckRequired:!1,isShowInDetail:!1};t.a={components:{},name:"ModalCreateCoupon",data:function(){var e=this;return{readonly:!1,allreadonly:!1,visiable:!1,loading:!1,posting:!0,uploadTxt:"",couponToken:"",formData:l()({userType:1},g),buyerFormDataCache:l()({userType:1},g),sellerFormDataCache:l()({userType:2},g),lastSelectType:2,excludeValCache:{2:"",3:"",4:"",5:"",6:""},allowproductLimitTypeList:y,businessClientLabelMap:D,brandList:[],categoryList:[],seriesList:[],ruleValidate:{couponType:{required:!0,validator:function(e,t,a){0===t||"0"===t?a(new Error("请选择优惠券类型")):a()}},couponName:{required:!0,max:30,message:"请输入名称"},couponNum:{type:"number",required:!0,min:1,message:"请输入数量"},couponAmount:{type:"number",required:!0,min:1,message:"请输入优惠金额"},time:{required:!0,validator:function(e,t,a){t.some(function(e){return!e})?a(new Error("请选择使用期限")):a()}},receiveTime:{required:!0,validator:function(t,a,r){if(a.some(function(e){return!e}))r(new Error("请选择领券期限"));else{(e.formData.time[1]?d()(e.formData.time[1]).unix():void 0)<(a[1]?d()(a[1]).unix():void 0)?r(new Error("请选择领券结束时间小于使用结束时间")):r()}}},remark:{required:!0,message:"请输入优惠券说明"},useLimitType:{required:!0,validator:function(t,a,r){a>=0?2===a?parseInt(e.formData.useLimitValue)>0?r():r(new Error("请输入限制金额")):r():r(new Error("请选择优惠条件"))}},productLimitValue:{required:!0,validator:function(e,t,a){var r=(t||"").split(",");t&&r.length?r.some(function(e){return!!e&&!parseInt(e)})?a(new Error("适用范围格式错误")):a():a(new Error("请输入适用范围"))}},excludeProductIds:{required:!1,validator:function(e,t,a){(t||"").split(",").some(function(e){return!!e&&!parseInt(e)})?a(new Error("适用范围格式错误")):a()}},brandVal:{required:!0,validator:function(e,t,a){t.length>0?a():a(new Error("请选择品牌"))}},category:{required:!0,validator:function(e,t,a){t.items.length>0&&t.items[0].value.length>0?a():a(new Error("请选择品类"))}},series:{required:!0,validator:function(e,t,a){t.items.length>0&&t.items[0].value.length>0?a():a(new Error("请选择系列"))}},productLimitType:{required:!0,validator:function(e,t,a){t>0?a():a(new Error("请选择类型"))}},businessClientLabel:{required:!0,validator:function(e,t,a){t.length>0?a():a(new Error("请选择购买渠道"))}}}}},computed:{allowTypeLabelList:function(){return 1===this.formData.userType?b:h},counponOptions:function(){return 1===this.formData.userType?v.buyer:v.seller},isShowDetail:function(){return 1===this.formData.userType},uploadProp:function(){return 1===this.formData.productLimitType?"productLimitValue":"excludeProductIds"},cascaderData:function(){var e={};return 5===this.formData.productLimitType?(e.prop="category",e.formData=this.formData.category,e.data=this.categoryList,e.loadData=this.loadCategoryData):6===this.formData.productLimitType&&(e.prop="series",e.formData=this.formData.series,e.data=this.seriesList,e.loadData=this.loadSeriesData),e}},methods:{show:function(e,t,a){var r=this;return n()(o.a.mark(function i(){var n,s,u,c,m,p;return o.a.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:r.readonly=t,r.allreadonly=a,r.posting=r.visiable=!0,r.$refs.formCoupon.resetFields();for(n in r.excludeValCache)r.excludeValCache[n]="";if(r.couponToken="",s=g,s.userType=1,!e){o.next=15;break}return r.loading=!0,o.next=12,f._get("/ufoPlatform/coupon/getCouponInfo",{id:e});case 12:u=o.sent,r.loading=!1,200===u.code?(c=u.data.coupon,console.log(u.data),m=u.data.productLimits,r.couponToken=c.couponToken,p=1===c.checkRequired,console.log("=====:"+p),s=l()({},g,{id:e,userType:c.userType,couponName:c.couponName,couponNum:c.couponNum,couponType:c.couponType||0,useNum:c.useNum,couponAmount:c.couponAmount,useLimitType:c.useLimitType,remark:c.remark,productLimitType:c.productLimitType,excludeProductIds:u.data.excludeProductIds,useLimitValue:c.useLimitValue,time:[d.a.unix(c.startTime).format("YYYY-MM-DD HH:mm:ss"),d.a.unix(c.endTime).format("YYYY-MM-DD HH:mm:ss")],receiveTime:[d.a.unix(c.receiveStartTime).format("YYYY-MM-DD HH:mm:ss"),d.a.unix(c.receiveEndTime).format("YYYY-MM-DD HH:mm:ss")],skupAllowTypeLabel:c.skupAllowType.split(","),businessClientLabel:c.businessClient.split(","),checkRequired:c.checkRequired,isCheckRequired:p,isShowInDetail:"Y"===u.data.showInPrdDetail}),r.setSelectItems(c.productLimitType,c.productLimitValue)):u.message&&r.$Message.warning(u.message);case 15:r.formData=s;case 16:case"end":return o.stop()}},i,r)}))()},setSelectItems:function(e,t){var a=this;return n()(o.a.mark(function r(){return o.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,a.getSelectItems(e);case 2:a.setValToSelect(e,t),a.lastSelectType=e;case 4:case"end":return r.stop()}},r,a)}))()},setValToSelect:function(e,t){switch(e){case 1:this.formData.productLimitValue=t;break;case 4:this.formData.brandVal=t.split(",").map(function(e){return parseInt(e)});break;case 5:this.formData.category=this.getFormSelectedVal(t);break;case 6:this.formData.series=this.getFormSelectedVal(t)}},getFormSelectedVal:function(e){var t={},a=e.split(",");t.index=a.length;for(var r=[],o=0;o<a.length;o++){var i={};i.index=o+1,i.value=a[o].split("-").map(function(e){return parseInt(e)}),r.push(i)}return t.items=r,t},getSelectItems:function(e){var t=this;return n()(o.a.mark(function a(){var r,i,n,s;return o.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(r={4:{url:"/ufoPlatform/brand/getBrandName",name:"brandList"},5:{url:"/ufoPlatform/productSort/getLevel1SortIdAndName",name:"categoryList"},6:{url:"/ufoPlatform/brand/getBrandName",name:"seriesList"}},r[e]){a.next=3;break}return a.abrupt("return");case 3:if(i=r[e].name,!(t[i].length>0)){a.next=6;break}return a.abrupt("return",t[i]);case 6:return a.next=8,f._get(r[e].url);case 8:n=a.sent,s=n.data,s.map(function(t){return t.label=t.text,t.value=t.id,delete t.text,delete t.id,6!=+e&&5!=+e||(t.children=[],t.loading=!1),t}),t[i]=s;case 12:case"end":return a.stop()}},a,t)}))()},loadSeriesData:function(e,t){this.loadData("seires",e,t)},loadCategoryData:function(e,t){this.loadData("category",e,t)},loadData:function(e,t,a){var r=this;return n()(o.a.mark(function i(){var n,s,l;return o.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return n={seires:{url:"/ufoPlatform/brandSeries/querySeriesByBrandId",params:{brandId:t.value}},category:{url:"/ufoPlatform/productSort/getLevel2SortBySortId",params:{sortId:t.value}}},t.loading=!0,r.next=4,f._get(n[e].url,n[e].params);case 4:s=r.sent,l=s.data,l.map(function(e){return e.label=e.text,e.value=e.id,delete e.text,delete e.id,e}),t.children=l,t.loading=!1,a();case 10:case"end":return r.stop()}},i,r)}))()},handleAdd:function(e){e.index++,e.items.push({index:e.index,value:[]})},handleRemove:function(e,t){var a=e.index;if(e.index--,t<a){e.items.splice(t-1,1);for(var r=e.items,o=t-1;o<e.index;o++)r[o].index--;e.items=r}else e.items.pop()},onOk:function(){var e=this;this.$refs.formCoupon.validate(function(t){t?e.saveData(e.formData):(e.posting=!1,e.$nextTick(function(){e.posting=!0}))})},getCheckRequired:function(e){this.formData.checkRequired=e?1:0},setIsShowInDetail:function(e){this.formData.isShowInDetail=e},changeUserType:function(e){2===e?(this.buyerFormDataCache=l()({},this.formData,{userType:1}),this.formData=this.sellerFormDataCache):(this.sellerFormDataCache=l()({},this.formData,{userType:2}),this.formData=this.buyerFormDataCache)},changeProductType:function(e){this.excludeValCache[this.lastSelectType]=this.formData.excludeProductIds,this.formData.excludeProductIds=this.excludeValCache[e],this.lastSelectType=e,this.getSelectItems(e)},getLimitVal:function(e){for(var t=this.formData[e].items,a=[],r=0;r<t.length;r++)if(t[r].value.length>0){var o=t[r].value.pop();a.push(o)}return a.join(",")},processProductLimitValue:function(e){return{1:this.formData.productLimitValue,2:"",3:"",4:this.formData.brandVal.join(","),5:this.getLimitVal("category"),6:this.getLimitVal("series")}[e]},saveData:function(e){var t=this;return n()(o.a.mark(function a(){var r,i;return o.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(console.log("post params"),console.log(e),r=t,!t.allreadonly){a.next=6;break}return t.visiable=!1,a.abrupt("return");case 6:return a.next=8,f._post("/ufoPlatform/coupon/saveOrUpdateCoupon",{id:e.id||void 0,userType:e.userType,couponName:e.couponName,couponAmount:e.couponAmount,couponNum:e.couponNum,couponType:e.couponType,useNum:e.useNum,useLimitValue:e.useLimitValue,productLimitType:e.productLimitType,productLimitValue:t.processProductLimitValue(e.productLimitType),excludeProductIds:e.excludeProductIds,remark:e.remark,useLimitType:parseInt(e.useLimitType)>=0?e.useLimitType:void 0,startTime:e.time[0]?d()(e.time[0]).unix():void 0,endTime:e.time[1]?d()(e.time[1]).unix():void 0,skupAllowType:e.skupAllowTypeLabel.join(","),businessClient:e.businessClientLabel.join(","),receiveStartTime:e.receiveTime[0]?d()(e.receiveTime[0]).unix():void 0,receiveEndTime:e.receiveTime[1]?d()(e.receiveTime[1]).unix():void 0,checkRequired:e.checkRequired,showInPrdDetail:e.isShowInDetail?"Y":"N"});case 8:i=a.sent,200===i.code?(t.$Message.success("保存成功"),t.visiable=!1,t.$emit("on-created")):(i.message&&t.$Message.warning(i.message),t.posting=!1,t.$nextTick(function(){t.posting=!0}));case 10:case"end":return a.stop()}},a,t)}))()},onBeforeUpload:function(e){var t=this;if("xlsx"!==e.name.split(".").pop().toLocaleLowerCase())return this.$Message.warning("文件格式错误"),!1;if(e.size>1048576)return this.$Message.warning("文件大小超过1M"),!1;var a=new FileReader;return a.readAsArrayBuffer(e),a.onloadstart=function(){t.uploadTxt="开始读取"},a.onprogress=function(e){t.uploadTxt="进度:"+Math.round(e.loaded/e.total*100)+"..."},a.onerror=function(){t.uploadTxt="文件读取出错"},a.onload=function(e){t.uploadTxt="";try{var a=e.target.result,r=p.a.read(a,{type:"array"}),o=r.SheetNames[0],i=r.Sheets[o],n=p.a.utils.sheet_to_json(i);t.formData[t.uploadProp]=n.map(function(e){return e["商品编码"]}).filter(function(e){return e}).join(",")}catch(e){t.uploadTxt="文件解析失败,请按照格式上传"}},!1},onExample:function(){var e=p.a.utils.book_new(),t=p.a.utils.json_to_sheet([{"商品编码":"123456"}]);p.a.utils.book_append_sheet(e,t,"优惠券适用范围示例"),p.a.writeFile(e,"优惠券适用范围示例.xlsx")}}}},250:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(251),o=a(12);Object(o.a)(r.a)},251:function(e,t,a){"use strict";function r(e){n||a(252)}var o=a(101),i=a(257),n=!1,s=a(0),l=r,u=s(o.a,i.a,!1,l,null,null);u.options.__file="src/views/coupon/index.vue",t.a=u.exports},252:function(e,t){},253:function(e,t,a){"use strict";function r(e){n||(a(254),a(255))}var o=a(102),i=a(256),n=!1,s=a(0),l=r,u=s(o.a,i.a,!1,l,"data-v-35ed785d",null);u.options.__file="src/views/coupon/components/modal-create-coupon.vue",t.a=u.exports},254:function(e,t){},255:function(e,t){},256:function(e,t,a){"use strict";var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("Modal",{attrs:{loading:e.posting,title:e.allreadonly?"查看优惠券":"创建/编辑优惠券",width:"600"},on:{"on-ok":e.onOk},model:{value:e.visiable,callback:function(t){e.visiable=t},expression:"visiable"}},[e.loading?a("Spin"):a("Form",{ref:"formCoupon",attrs:{rules:e.ruleValidate,model:e.formData,"label-width":80}},[a("FormItem",{staticClass:"form-group",attrs:{label:"优惠券类型"}}),e._v(" "),a("FormItem",{attrs:{label:"用户类型",prop:"userType"}},[a("radio-group",{on:{"on-change":e.changeUserType},model:{value:e.formData.userType,callback:function(t){e.$set(e.formData,"userType",t)},expression:"formData.userType"}},[a("radio",{attrs:{label:1,disabled:!!e.formData.id}},[e._v("买家")]),e._v(" "),a("radio",{attrs:{label:2,disabled:!!e.formData.id}},[e._v("卖家")])],1)],1),e._v(" "),a("div",{key:e.formData.userType},[a("FormItem",{attrs:{label:"优惠券类型",prop:"couponType"}},[a("Select",{staticStyle:{width:"100px"},attrs:{disabled:e.readonly},model:{value:e.formData.couponType,callback:function(t){e.$set(e.formData,"couponType",t)},expression:"formData.couponType"}},[a("Option",{attrs:{value:0}},[e._v("请选择")]),e._v(" "),e._l(e.counponOptions,function(t){return a("Option",{key:t.value,attrs:{value:t.value}},[e._v(e._s(t.label))])})],2)],1),e._v(" "),a("FormItem",{staticClass:"form-group",attrs:{label:"基本信息"}}),e._v(" "),e.couponToken?a("FormItem",{attrs:{label:"Token"}},[e._v(e._s(e.couponToken))]):e._e(),e._v(" "),a("FormItem",{attrs:{label:"名称",prop:"couponName"}},[a("Input",{staticStyle:{width:"200px"},attrs:{placeholder:"名称建议30字以内",disabled:e.allreadonly},model:{value:e.formData.couponName,callback:function(t){e.$set(e.formData,"couponName",t)},expression:"formData.couponName"}})],1),e._v(" "),a("FormItem",{attrs:{label:"数量",prop:"couponNum"}},[a("InputNumber",{staticStyle:{width:"100px"},attrs:{placeholder:"数量",disabled:e.allreadonly},model:{value:e.formData.couponNum,callback:function(t){e.$set(e.formData,"couponNum",t)},expression:"formData.couponNum"}})],1),e._v(" "),a("FormItem",{attrs:{label:"使用次数",prop:"useNum"}},[a("Input",{staticStyle:{width:"100px"},attrs:{placeholder:"使用次数",disabled:""},model:{value:e.formData.useNum,callback:function(t){e.$set(e.formData,"useNum",t)},expression:"formData.useNum"}})],1),e._v(" "),a("FormItem",{attrs:{label:"使用期限",prop:"time"}},[a("DatePicker",{staticStyle:{width:"250px"},attrs:{type:"datetimerange",disabled:e.allreadonly,placeholder:"使用期限",format:"yyyy-MM-dd HH:mm:ss"},model:{value:e.formData.time,callback:function(t){e.$set(e.formData,"time",t)},expression:"formData.time"}})],1),e._v(" "),a("FormItem",{attrs:{label:"领券期限",prop:"receiveTime"}},[a("DatePicker",{staticStyle:{width:"250px"},attrs:{type:"datetimerange",disabled:e.readonly,placeholder:"领券期限",format:"yyyy-MM-dd HH:mm:ss"},model:{value:e.formData.receiveTime,callback:function(t){e.$set(e.formData,"receiveTime",t)},expression:"formData.receiveTime"}})],1),e._v(" "),a("FormItem",{attrs:{label:"优惠券说明",prop:"remark"}},[a("Row",[a("Col",{attrs:{span:"20"}},[a("Input",{attrs:{type:"textarea",placeholder:"优惠券使用条件简介",disabled:e.allreadonly},model:{value:e.formData.remark,callback:function(t){e.$set(e.formData,"remark",t)},expression:"formData.remark"}})],1)],1)],1),e._v(" "),a("FormItem",{staticClass:"form-group",attrs:{label:"使用条件"}}),e._v(" "),a("FormItem",{staticStyle:{display:"inline-block",width:"100%"},attrs:{label:"优惠条件",prop:"useLimitType"}},[a("Select",{staticStyle:{width:"100px"},attrs:{disabled:e.readonly},model:{value:e.formData.useLimitType,callback:function(t){e.$set(e.formData,"useLimitType",t)},expression:"formData.useLimitType"}},[a("Option",{attrs:{value:0}},[e._v("无限制")]),e._v(" "),a("Option",{attrs:{value:2}},[e._v("金额")])],1),e._v(" "),2===e.formData.useLimitType?a("div",{staticStyle:{display:"inline-block"}},[e._v("\n \n 金额满:\n "),a("InputNumber",{staticStyle:{width:"100px"},attrs:{disabled:e.readonly,placeholder:"限制金额"},model:{value:e.formData.useLimitValue,callback:function(t){e.$set(e.formData,"useLimitValue",t)},expression:"formData.useLimitValue"}})],1):e._e()],1),e._v(" "),a("FormItem",{attrs:{label:"优惠金额",prop:"couponAmount"}},[a("InputNumber",{staticStyle:{width:"100px"},attrs:{placeholder:"优惠金额",disabled:e.readonly},model:{value:e.formData.couponAmount,callback:function(t){e.$set(e.formData,"couponAmount",t)},expression:"formData.couponAmount"}})],1),e._v(" "),a("FormItem",{attrs:{label:"适用范围",prop:"productLimitType"}},[a("radio-group",{on:{"on-change":e.changeProductType},model:{value:e.formData.productLimitType,callback:function(t){e.$set(e.formData,"productLimitType",t)},expression:"formData.productLimitType"}},e._l(e.allowproductLimitTypeList,function(t,r){return a("radio",{key:e.formData.userType+r,attrs:{label:+r,disabled:e.readonly}},[e._v(e._s(t))])}),1)],1),e._v(" "),a("div",{key:e.formData.productLimitType},[4===e.formData.productLimitType?a("FormItem",{attrs:{prop:"brandVal"}},[a("Select",{staticStyle:{width:"300px"},attrs:{multiple:"",disabled:e.readonly},model:{value:e.formData.brandVal,callback:function(t){e.$set(e.formData,"brandVal",t)},expression:"formData.brandVal"}},e._l(e.brandList,function(t){return a("Option",{key:t.value,attrs:{value:t.value}},[e._v(e._s(t.label))])}),1)],1):5===e.formData.productLimitType||6===e.formData.productLimitType?a("FormItem",{attrs:{prop:e.cascaderData.prop}},[e._l(e.cascaderData.formData.items,function(t){return a("Row",{key:t.index,staticClass:"add-item"},[a("Col",{attrs:{span:"16"}},[a("Cascader",{attrs:{data:e.cascaderData.data,disabled:e.readonly,"load-data":e.cascaderData.loadData},model:{value:t.value,callback:function(a){e.$set(t,"value",a)},expression:"item.value"}})],1),e._v(" "),t.index>1&&!e.readonly?a("Col",{attrs:{span:"4",offset:"1"}},[a("Button",{attrs:{type:"error",size:"small",ghost:"",icon:"md-close",shape:"circle"},on:{click:function(a){return e.handleRemove(e.cascaderData.formData,t.index)}}})],1):e._e()],1)}),e._v(" "),e.readonly?e._e():a("Row",[a("Col",{attrs:{span:"10"}},[a("Button",{attrs:{type:"dashed",long:"",icon:"md-add"},on:{click:function(t){return e.handleAdd(e.cascaderData.formData)}}},[e._v("添加项")])],1)],1)],2):e._e(),e._v(" "),a("FormItem",{attrs:{prop:e.uploadProp,label:1===e.formData.productLimitType?"":"排除商品"}},[a("Row",[a("Col",{attrs:{span:"20"}},[a("Input",{key:e.formData.productLimitType,attrs:{type:"textarea",disabled:e.readonly,placeholder:"填写商品编码,多个商品编码用英文逗号分隔"},model:{value:e.formData[e.uploadProp],callback:function(t){e.$set(e.formData,e.uploadProp,t)},expression:"formData[uploadProp]"}})],1)],1),e._v(" "),a("Poptip",{attrs:{trigger:"hover"}},[a("div",{attrs:{slot:"content"},slot:"content"},[a("p",[e._v("1.上传文件必须是xlsx文件")]),e._v(" "),a("p",[e._v("2.第一行标题栏:商品编码")]),e._v(" "),a("p",[e._v("\n 3.\n "),a("a",{attrs:{href:"javascript:;"},on:{click:e.onExample}},[e._v("下载样例")])])]),e._v(" "),a("Upload",{attrs:{action:"",format:["xlsx"],"max-size":1024,"before-upload":e.onBeforeUpload}},[a("Button",{attrs:{type:"success",size:"small",disabled:e.readonly}},[e._v("导入")]),e._v(" "),a("p",[e._v(e._s(e.uploadTxt))])],1)],1)],1)],1),e._v(" "),a("FormItem",{attrs:{label:"可用商品类型"}},[a("checkbox-group",{on:{"on-change":e.getCheckBox},model:{value:e.formData.skupAllowTypeLabel,callback:function(t){e.$set(e.formData,"skupAllowTypeLabel",t)},expression:"formData.skupAllowTypeLabel"}},e._l(e.allowTypeLabelList,function(t,r){return a("checkbox",{key:e.formData.userType+r,attrs:{label:r,disabled:e.readonly}},[e._v(e._s(t))])}),1)],1),e._v(" "),a("FormItem",{attrs:{label:"购买渠道",prop:"businessClientLabel"}},[a("checkbox-group",{on:{"on-change":e.getChannelCheckBox},model:{value:e.formData.businessClientLabel,callback:function(t){e.$set(e.formData,"businessClientLabel",t)},expression:"formData.businessClientLabel"}},e._l(e.businessClientLabelMap,function(t,r){return a("checkbox",{key:r,attrs:{label:r,disabled:e.readonly}},[e._v(e._s(t))])}),1)],1),e._v(" "),a("FormItem",{attrs:{label:"需要校验",prop:"checkRequired"}},[a("checkbox",{attrs:{disabled:e.allreadonly},on:{"on-change":e.getCheckRequired},model:{value:e.formData.isCheckRequired,callback:function(t){e.$set(e.formData,"isCheckRequired",t)},expression:"formData.isCheckRequired"}})],1),e._v(" "),e.isShowDetail?a("FormItem",{attrs:{label:"展示在详情页",prop:"isShowInDetail"}},[a("checkbox",{attrs:{disabled:e.allreadonly},on:{"on-change":e.setIsShowInDetail},model:{value:e.formData.isShowInDetail,callback:function(t){e.$set(e.formData,"isShowInDetail",t)},expression:"formData.isShowInDetail"}})],1):e._e()],1)],1)],1)},o=[];r._withStripped=!0;var i={render:r,staticRenderFns:o};t.a=i},257:function(e,t,a){"use strict";var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("LayoutContent",{attrs:{breads:[{title:"优惠券列表"}]}},[a("LayoutFilter",{on:{"on-filter":e.onFilter,"on-clear":e.onClear}},[a("Form",{ref:"filterForm",attrs:{inline:"",model:e.filter}},[a("FormItem",{attrs:{prop:"id"}},[a("Input",{attrs:{placeholder:"输入ID"},model:{value:e.filter.id,callback:function(t){e.$set(e.filter,"id",t)},expression:"filter.id"}})],1),e._v(" "),a("FormItem",{attrs:{prop:"name"}},[a("Input",{attrs:{placeholder:"输入券名称"},model:{value:e.filter.name,callback:function(t){e.$set(e.filter,"name",t)},expression:"filter.name"}})],1),e._v(" "),a("FormItem",{attrs:{prop:"status"}},[a("Select",{staticStyle:{width:"100px"},attrs:{placeholder:"选择状态"},model:{value:e.filter.status,callback:function(t){e.$set(e.filter,"status",t)},expression:"filter.status"}},[a("Option",{attrs:{value:0}},[e._v("未生效")]),e._v(" "),a("Option",{attrs:{value:1}},[e._v("生效中")]),e._v(" "),a("Option",{attrs:{value:2}},[e._v("已过期")]),e._v(" "),a("Option",{attrs:{value:3}},[e._v("已作废")])],1)],1),e._v(" "),a("FormItem",{attrs:{prop:"time"}},[a("DatePicker",{staticStyle:{width:"250px"},attrs:{type:"datetimerange",placeholder:"开始-结束时间",format:"yyyy-MM-dd HH:mm"},model:{value:e.filter.time,callback:function(t){e.$set(e.filter,"time",t)},expression:"filter.time"}})],1),e._v(" "),a("FormItem",{attrs:{prop:"userType"}},[a("Select",{staticStyle:{width:"160px"},attrs:{placeholder:"选择用户类型"},model:{value:e.filter.userType,callback:function(t){e.$set(e.filter,"userType",t)},expression:"filter.userType"}},[a("Option",{attrs:{value:1}},[e._v("买家")]),e._v(" "),a("Option",{attrs:{value:2}},[e._v("卖家")])],1)],1)],1)],1),e._v(" "),a("LayoutTools",[a("Button",{attrs:{type:"success",icon:"md-add"},on:{click:e.onCreateCoupon}},[e._v("新增优惠券")])],1),e._v(" "),a("LayoutTable",{attrs:{page:e.page,total:e.total,columns:e.columns,data:e.data},on:{"on-page-change":e.onPageChange}},[a("template",{staticClass:"btns",slot:"footer"},[a("Button",{attrs:{type:"primary",icon:"ios-cloud-download"},on:{click:e.onExport}},[e._v("导出")])],1)],2),e._v(" "),a("ModalCreateCoupon",{ref:"modalCreateCoupon",on:{"on-created":e.onCreated}})],1)},o=[];r._withStripped=!0;var i={render:r,staticRenderFns:o};t.a=i},66:function(e,t){e.exports=XLSX},8:function(e,t){e.exports=Vue}},[250]);