send-coupon.8e70e732031f96be4a56.js
4.89 KB
webpackJsonp([8],{1:function(t,e){t.exports=iview},147:function(t,e,n){"use strict";var a=n(7),o=n(6),s=(n.n(o),n(25),n(21)),i=n.n(s),l=new a.a;e.a={components:{},name:"SendCouponPage",data:function(){return{parentUrl:"",couponId:0,couponToken:"",uidValue:"",fileName:"",showModal:!1,message:"",uploadMessage:"",isSending:!1}},created:function(){var t=this;this.$nextTick(function(){var e=i.a.parse(location.search?location.search.slice(1):"");t.parentUrl="coupon.html?"+i.a.stringify(e.param),t.couponId=e.id,t.couponToken=e.token})},methods:{manualSend:function(){var t=this;if(this.uidValue&&!this.isSending){var e=this.uidValue.replace(/,/g,",").split(",");e.length>50&&(e.length=50),e.length>0&&(this.isSending=!0,l._get("/ufoPlatform/coupon/couponSend",{couponToken:this.couponToken,uids:e.join(",")}).then(function(e){t.showModal=!0,t.message=e.message,t.isSending=!1;var n="提示信息";200!==e.code&&(n="操作失败"),t.$Modal.info({title:n,content:e.message,onOK:t.ok})}).catch(function(){t.isSending=!1,t.$Modal.info({title:"提示",content:"发送失败",onOK:t.ok})}))}},fileChange:function(){var t=document.getElementById("upload");t.files.length>0&&(this.fileName=t.files[0].name)},importSend:function(){var t=this;if(this.fileName&&!this.isSending){var e=new FormData,n=document.getElementById("upload").files[0],a={headers:{"Content-Type":"multipart/form-data"}};e.append("file",n),e.append("couponToken",this.couponToken),this.isSending=!0,this.uploadMessage="文件上传中...",l._postForm("/ufoPlatform/coupon/couponSendByImport",e,!1,a).then(function(e){t.isSending=!1,t.uploadMessage="";var n="提示信息";200!==e.code&&(n="操作失败"),t.$Modal.info({title:n,content:e.message,onOK:t.ok})}).catch(function(){t.isSending=!1,t.uploadMessage="",t.$Modal.info({title:"提示信息",content:"上传失败",onOK:t.ok})})}},ok:function(){this.showModal=!1}}}},383:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=n(384),o=n(12);Object(o.a)(a.a)},384:function(t,e,n){"use strict";function a(t){i||n(385)}var o=n(147),s=n(386),i=!1,l=n(0),r=a,c=l(o.a,s.a,!1,r,null,null);c.options.__file="src/views/send-coupon/index.vue",e.a=c.exports},385:function(t,e){},386:function(t,e,n){"use strict";var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("LayoutContent",{attrs:{breads:[{url:t.parentUrl,title:"优惠券列表"},{title:"优惠券发放"}]}},[n("Form",[n("Card",{staticClass:"manual-send-wrapper"},[n("p",{attrs:{slot:"title"},slot:"title"},[t._v("手动发放")]),t._v(" "),n("div",[n("Row",{staticClass:"manual-send-container"},[n("Col",{staticClass:"title",attrs:{span:"4"}},[t._v("\n UID"),n("span",{staticClass:"red"},[t._v("*")])]),t._v(" "),n("Col",{staticClass:"content",attrs:{span:"14"}},[n("textarea",{directives:[{name:"model",rawName:"v-model",value:t.uidValue,expression:"uidValue"}],attrs:{rows:"5",id:"txt_uids",placeholder:"请输入UID,多个UID用英文逗号分隔,单次限制输入50个UID"},domProps:{value:t.uidValue},on:{input:function(e){e.target.composing||(t.uidValue=e.target.value)}}})]),t._v(" "),n("Col",{staticClass:"button",attrs:{span:"5"}},[n("Button",{attrs:{type:"success"},on:{click:t.manualSend}},[t._v("发送")])],1)],1)],1)]),t._v(" "),n("Card",{staticClass:"import-send-wrapper"},[n("p",{attrs:{slot:"title"},slot:"title"},[t._v("批量发放")]),t._v(" "),n("div",[n("Row",{staticClass:"import-send-container"},[n("Col",{attrs:{span:"3"}},[t._v(" ")]),t._v(" "),n("Col",{attrs:{span:"4"}},[n("div",{staticClass:"button-upload"},[t._v("\n 上传文件\n "),n("form",{attrs:{id:"formUpload"}},[n("input",{attrs:{type:"file",id:"upload",accept:".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},on:{change:t.fileChange}})])]),t._v(" "),n("span",{staticClass:"file-name"},[t._v(t._s(t.fileName))])]),t._v(" "),n("Col",{attrs:{span:"2"}},[t._v(" ")]),t._v(" "),n("Col",{attrs:{span:"8"}},[t._v(" ")])],1),t._v(" "),n("Row",{staticStyle:{"margin-top":"20px"}},[n("Col",{attrs:{span:"3"}},[t._v(" ")]),t._v(" "),n("Col",{attrs:{span:"4"}},[n("a",{staticClass:"btn-download",attrs:{href:"..\\..\\common/uid_import.xlsx",target:"_blank"}},[t._v("下载样例")]),t._v(" "),n("p",[t._v("1.表头:UID")]),t._v(" "),n("p",[t._v("2.同一张券可以给同一个用户发多张")])]),t._v(" "),n("Col",{attrs:{span:"2"}},[t._v(" ")]),t._v(" "),n("Col",{attrs:{span:"8"}},[n("a",{staticStyle:{color:"red"},attrs:{href:"javascript:void(0)"}}),t._v(" "),n("p"),t._v(" "),n("p")])],1),t._v(" "),n("Row",[n("p",{staticStyle:{color:"red","text-align":"center","margin-top":"30px","font-size":"30px"}},[t._v(t._s(t.uploadMessage))])])],1)]),t._v(" "),n("div",{staticClass:"bottom"},[n("Button",{attrs:{type:"success",id:"btn_import_send"},on:{click:t.importSend}},[t._v("批量发送")])],1)],1)],1)},o=[];a._withStripped=!0;var s={render:a,staticRenderFns:o};e.a=s},8:function(t,e){t.exports=Vue}},[383]);