apply-refund.58a3fbc2d362239e466c.js
12.9 KB
webpackJsonp([6],{1:function(e,t){e.exports=iview},155:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(156),a=r(12);Object(a.a)(n.a)},156:function(e,t,r){"use strict";function n(e){d||r(157)}var a=r(68),o=r(228),d=!1,i=r(0),s=n,u=i(a.a,o.a,!1,s,"data-v-42396e14",null);u.options.__file="src/views/apply-refund/index.vue",t.a=u.exports},157:function(e,t){},158:function(e,t,r){"use strict";t.__esModule=!0,t.default=function(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}},228:function(e,t,r){"use strict";var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("LayoutContent",{attrs:{breads:[{title:"退款登记"}]}},[r("div",{staticClass:"header-container"},[r("LayoutFilter",{on:{"on-filter":e.onFilter,"on-clear":e.onClear}},[r("Form",{ref:"filterForm",attrs:{inline:"",model:e.filter}},[r("FormItem",{attrs:{prop:"uid"}},[r("Input",{attrs:{placeholder:"输入UID"},model:{value:e.filter.uid,callback:function(t){e.$set(e.filter,"uid",t)},expression:"filter.uid"}})],1),e._v(" "),r("FormItem",{attrs:{prop:"refundStatus"}},[r("Select",{staticStyle:{width:"100px"},attrs:{placeholder:"状态"},model:{value:e.filter.refundStatus,callback:function(t){e.$set(e.filter,"refundStatus",t)},expression:"filter.refundStatus"}},[r("Option",{attrs:{value:1}},[e._v("待退款")]),e._v(" "),r("Option",{attrs:{value:2}},[e._v("已退款")]),e._v(" "),r("Option",{attrs:{value:3}},[e._v("驳回退款")])],1)],1),e._v(" "),r("FormItem",{attrs:{prop:"sponsorName"}},[r("Input",{attrs:{placeholder:"退款发起人"},model:{value:e.filter.sponsorName,callback:function(t){e.$set(e.filter,"sponsorName",t)},expression:"filter.sponsorName"}})],1),e._v(" "),r("FormItem",{attrs:{prop:"time"}},[r("DatePicker",{staticStyle:{width:"280px"},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)],1)],1),e._v(" "),r("Button",{attrs:{type:"success",icon:"md-add"},on:{click:e.onCreateRefund}},[e._v("新增退款信息")])],1),e._v(" "),r("LayoutTools",{staticClass:"export-container"},[r("Button",{attrs:{type:"primary",icon:"ios-cloud-download"},on:{click:e.onExport}},[e._v("导出")])],1),e._v(" "),r("LayoutTable",{ref:"applyRefundList",attrs:{page:e.page,total:e.total,columns:e.columns,data:e.refundList,onSelect:e.onSelect},on:{"on-page-change":e.fetchData}},[r("template",{staticClass:"btns",slot:"footer"},[r("Button",{attrs:{type:"warning"},on:{click:function(t){return e.onDelete()}}},[e._v("批量删除")])],1)],2),e._v(" "),r("Modal",{attrs:{"footer-hide":!0},on:{"on-cancel":function(t){return e.handleReset("addRefundForm")}},model:{value:e.addModelShow,callback:function(t){e.addModelShow=t},expression:"addModelShow"}},[r("Form",{ref:"addRefundForm",attrs:{model:e.addRefundFormItem,"label-position":"left",rules:e.ruleValidate,"label-width":"100"}},[r("FormItem",{attrs:{label:"日期",prop:"createDate"}},[e._v("\n "+e._s(e.addRefundFormItem.createDate)+"\n ")]),e._v(" "),r("FormItem",{attrs:{label:"订单编号",prop:"orderCode"}},[r("Row",[r("Col",{attrs:{span:"10"}},[r("Input",{on:{"on-blur":e.onOrderCodeBlur},model:{value:e.addRefundFormItem.orderCode,callback:function(t){e.$set(e.addRefundFormItem,"orderCode",t)},expression:"addRefundFormItem.orderCode"}})],1),e._v(" "),r("Col",{attrs:{offset:"1",span:"13"}},[r("div",[e._v("当前订单已有"),r("span",{style:{color:"red"}},[e._v(e._s(e.refundNumber))]),e._v("条退款记录")])])],1)],1),e._v(" "),r("FormItem",{attrs:{label:"UID",prop:"uid"}},[r("Row",[r("Col",{attrs:{span:"10"}},[r("Input",{model:{value:e.addRefundFormItem.uid,callback:function(t){e.$set(e.addRefundFormItem,"uid",t)},expression:"addRefundFormItem.uid"}})],1)],1)],1),e._v(" "),r("FormItem",{attrs:{label:"退款说明",prop:"refundDesc"}},[r("Input",{model:{value:e.addRefundFormItem.refundDesc,callback:function(t){e.$set(e.addRefundFormItem,"refundDesc",t)},expression:"addRefundFormItem.refundDesc"}})],1),e._v(" "),r("FormItem",{attrs:{label:"退款类型",prop:"refundType"}},[r("Row",[r("Col",{attrs:{span:"10"}},[r("Select",{attrs:{placeholder:"退款类型"},model:{value:e.addRefundFormItem.refundType,callback:function(t){e.$set(e.addRefundFormItem,"refundType",t)},expression:"addRefundFormItem.refundType"}},[r("Option",{attrs:{value:"0"}},[e._v("无")]),e._v(" "),r("Option",{attrs:{value:"1"}},[e._v("补偿类")]),e._v(" "),r("Option",{attrs:{value:"2"}},[e._v("吃货类")]),e._v(" "),r("Option",{attrs:{value:"3"}},[e._v("打款类")])],1)],1)],1)],1),e._v(" "),r("FormItem",{attrs:{label:"退款金额",prop:"refundAmount"}},[r("Row",[r("Col",{attrs:{span:"10"}},[r("Input",{model:{value:e.addRefundFormItem.refundAmount,callback:function(t){e.$set(e.addRefundFormItem,"refundAmount",t)},expression:"addRefundFormItem.refundAmount"}})],1)],1)],1),e._v(" "),r("FormItem",{attrs:{label:"退款渠道",prop:"refundChannel"}},[r("Row",[r("Col",{attrs:{span:"10"}},[r("Select",{attrs:{placeholder:"退款渠道"},model:{value:e.addRefundFormItem.refundChannel,callback:function(t){e.$set(e.addRefundFormItem,"refundChannel",t)},expression:"addRefundFormItem.refundChannel"}},[r("Option",{attrs:{value:"1"}},[e._v("支付宝")]),e._v(" "),r("Option",{attrs:{value:"2"}},[e._v("银行卡")])],1)],1)],1)],1),e._v(" "),r("FormItem",{attrs:{label:"收款人姓名",prop:"payeeName"}},[r("Row",[r("Col",{attrs:{span:"10"}},[r("Input",{model:{value:e.addRefundFormItem.payeeName,callback:function(t){e.$set(e.addRefundFormItem,"payeeName",t)},expression:"addRefundFormItem.payeeName"}})],1)],1)],1),e._v(" "),r("FormItem",{attrs:{label:"收款人账号",prop:"payeeAccount"}},[r("Input",{model:{value:e.addRefundFormItem.payeeAccount,callback:function(t){e.$set(e.addRefundFormItem,"payeeAccount",t)},expression:"addRefundFormItem.payeeAccount"}})],1),e._v(" "),r("FormItem",{attrs:{label:"退回地址",prop:"refundAddress"}},[r("Row",[r("Col",{attrs:{span:"10"}},[r("Input",{model:{value:e.addRefundFormItem.refundAddress,callback:function(t){e.$set(e.addRefundFormItem,"refundAddress",t)},expression:"addRefundFormItem.refundAddress"}})],1)],1)],1),e._v(" "),e.operatorName?r("FormItem",{attrs:{label:"处理人"}},[e._v("\n "+e._s(e.addRefundFormItem.operatorName)+"\n ")]):e._e(),e._v(" "),r("FormItem",{attrs:{label:"打款状态"}},[e._v("\n "+e._s(e.addRefundFormItem.refundStatusName)+"\n ")]),e._v(" "),r("FormItem",[r("Button",{attrs:{type:"primary"},on:{click:function(t){return e.handleSubmit("addRefundForm")}}},[e._v("确认")]),e._v(" "),r("Button",{staticStyle:{"margin-left":"8px"},attrs:{type:"error"},on:{click:function(t){return e.handleReset("addRefundForm")}}},[e._v("取消")])],1)],1)],1)],1)},a=[];n._withStripped=!0;var o={render:n,staticRenderFns:a};t.a=o},68:function(e,t,r){"use strict";var n=r(158),a=r.n(n),o=r(9),d=r.n(o),i=r(27),s=r.n(i),u=r(10),l=r.n(u),f=r(59),m=r.n(f),c=r(45),p=r.n(c),h=r(83),v=r.n(h),g=r(36),y=r.n(g),I=r(60),F=r.n(I),_=r(21),R=(r.n(_),r(6)),b=r.n(R),w=r(7),k=r(1),C=(r.n(k),r(24)),D=new w.a;t.a={name:"ApplyRefund",data:function(){var e,t=this;this.$createElement;return{filter:{uid:"",sponsorName:"",refundStatus:"",time:[]},page:1,total:0,addModelShow:!1,addRefundFormItem:{createDate:b()().format("YYYY/MM/DD"),orderCode:"",uid:"",refundDesc:"",refundType:"",refundAmount:"",refundChannel:"",payeeName:"",payeeAccount:"",refundAddress:"",operatorName:"",refundStatusName:"待退款"},refundNumber:0,isEdit:!1,selectedIds:[],ruleValidate:{uid:[{required:!0,message:"请输入uid",trigger:"blur"}],orderCode:[{required:!0,message:"请输入订单编号",trigger:"blur"}],refundDesc:[{required:!0,message:"请输入退款说明",trigger:"blur"}],refundType:[{required:!0,message:"请选择退款类型",trigger:"blur"}],refundAmount:[{required:!0,message:"请输入退款金额",trigger:"blur"}],refundChannel:[{required:!0,message:"请选择退款渠道",trigger:"blur"}],payeeName:[{required:!0,message:"请输入收款人姓名",trigger:"blur"}],payeeAccount:[{required:!0,message:"请输入收款人账号",trigger:"blur"}]},refundList:[],columns:[{type:"selection",width:60,align:"center"},{title:"日期",key:"createDate",width:120,align:"center"},{title:"退款发起人",key:"sponsorName",width:120,align:"center"},{title:"订单号",key:"orderCode",width:160,align:"center"},{title:"UID",key:"uid",width:120,align:"center"},{title:"说明",key:"refundDesc",width:150},{title:"退款类型",key:"refundTypeName",width:100,align:"center"},{title:"金额",key:"refundAmount",width:90},{title:"退款渠道",key:"refundChannelName",width:100},{title:"收款人姓名",key:"payeeName",align:"center",width:90},{title:"收款账号",align:"center",key:"payeeAccount",width:150},{title:"商品名称",align:"center",key:"goodsName",width:165},{title:"商品尺码",key:"goodsSize",align:"center",width:100},{title:"退回地址",align:"center",key:"refundAddress",width:150},{title:"处理人",aligin:"center",key:"operatorName",width:90},{title:"状态",key:"refundStatusName",align:"center",width:100},(e={title:"备注",align:"center",key:"remark"},F()(e,"align","center"),F()(e,"width",200),e),{title:"操作",align:"center",fixed:"right",width:200,render:function(e,r){var n=r.row;return e("div",[1==n.refundStatus?e(k.Button,{attrs:{type:"success",size:"small"},on:{click:function(){return t.onEdit(n,!0,!0)}}},["编辑"]):null,1==n.refundStatus?e(k.Button,{attrs:{type:"error",size:"small"},style:"margin-left: 8px",on:{click:function(){return t.onDelete([n.id])}}},["删除"]):null])}}]}},computed:{filterParam:function(e){var t=y()(e.filter),r=v()(null),n=!0,a=!1,o=void 0;try{for(var d,i=p()(t);!(n=(d=i.next()).done);n=!0){var s=d.value;if("time"!==s)e.filter[s]&&(r[s]=e.filter[s]);else{var u=m()(e.filter.time,2),l=u[0],f=u[1];l&&f&&(r.startTime=b()(l).format("YYYY-MM-DD"),r.endTime=b()(f).format("YYYY-MM-DD"))}}}catch(e){a=!0,o=e}finally{try{!n&&i.return&&i.return()}finally{if(a)throw o}}return r}},mounted:function(){this.fetchData()},methods:{fetchData:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return l()(d.a.mark(function r(){var n;return d.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return e.page=t,e.$Loading.start(),r.next=4,D._get("/ufoPlatform/refundRecord/list",s()({page:t},e.filterParam));case 4:n=r.sent,200===n.code?(e.total=n.data.total,e.refundList=n.data.list.map(function(e){var t=e.refundStatus;return s()({},e,{_disabled:1!==t})}),e.$Loading.finish()):(n.message&&e.$Message.warning(n.message),e.$Loading.error());case 6:case"end":return r.stop()}},r,e)}))()},onFilter:function(){this.fetchData()},onOrderCodeBlur:function(){this.addRefundFormItem.orderCode&&this.fetchRefundCount(this.addRefundFormItem.orderCode)},onClear:function(){this.$refs.filterForm.resetFields(),this.fetchData()},onCreateRefund:function(){this.isEdit=!1,this.refundNumber=0,this.addModelShow=!0},fetchRefundCount:function(e){var t=this;D._get("/ufoPlatform/refundRecord/getOrderExistedCount",{orderCode:e}).then(function(e){200===e.code&&(t.refundNumber=e.data||0)})},onEdit:function(e){this.isEdit=!0;var t=y()(this.addRefundFormItem),r=e.orderCode;this.fetchRefundCount(r);var n=!0,a=!1,o=void 0;try{for(var d,i=p()(t);!(n=(d=i.next()).done);n=!0){var s=d.value;"createDate"!==s&&(this.addRefundFormItem[s]=""+(e[s]||""))}}catch(e){a=!0,o=e}finally{try{!n&&i.return&&i.return()}finally{if(a)throw o}}this.addRefundFormItem.id=e.id,this.addModelShow=!0},onSelect:function(e){this.selectedIds=e.map(function(e){return e.id})},onDelete:function(e){var t=this;this.$Modal.confirm({render:function(e){return e("div",{},"确定删除?")},onOk:function(){t.onBatchDelete(e)}})},onBatchDelete:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.selectedIds.length&&(t=this.selectedIds),t&&!t.length||D._get("/ufoPlatform/refundRecord/delete",{ids:t.join()}).then(function(t){200===t.code?(e.$Message.success(t.message),e.fetchData()):e.$Message.error(t&&t.message||"删除失败")})},handleSubmit:function(e){var t=this;this.$refs[e].validate(function(r){if(r){var n=t.addRefundFormItem,o=(n.operatorName,n.refundStatusName,a()(n,["operatorName","refundStatusName"]));D._get("/ufoPlatform/refundRecord/"+(t.isEdit?"update":"add"),o).then(function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r&&200===r.code?(t.isEdit=!1,t.fetchData(t.page),t.$refs[e].resetFields(),t.addModelShow=!1,t.$Message.success(r.message)):t.$Message.error(r.message)})}else t.$Message.error("请完善信息!")})},handleReset:function(e){this.addModelShow=!1,this.isEdit=!1,this.$refs[e].resetFields()},onExport:function(){var e=this;this.$Loading.start(),D._get("/ufoPlatform/refundRecord/export",{param:D._2params(this.filterParam)},{responseType:"blob"}).then(function(t){t instanceof Blob?(C.a.downloadBlob(t,"退款申请_"+b()().format("YYYY-MM-DD")+".xlsx"),e.$Loading.finish()):t&&(t.message&&e.$Message.warning(t.message),e.$Loading.error())})}}}},8:function(e,t){e.exports=Vue}},[155]);