chunk-6473e5ac.f0b808f8.js 11 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6473e5ac"],{"0a8b":function(e,t,r){"use strict";r("db83")},"77b5":function(e,t,r){"use strict";r("9d77")},"9d77":function(e,t,r){},"9dba":function(e,t,r){"use strict";r.r(t);var n=function(){var e=this,t=e._self._c;return t("div",[t("el-drawer",{attrs:{visible:e.showDtail,size:"750px","custom-class":"order-draw-wrap",direction:"ltr"},on:{"update:visible":function(t){e.showDtail=t},close:e.closeTrigger}},[e.$util.isEmpty(e.orderInfo)?e._e():t("div",{staticClass:"order-manage-wrap"},[t("div",[t("div",[t("div",{staticClass:"accounts-list"},[e._v(" 退款方式 "),t("div",{staticClass:"accounts-center"},[1==e.refundType?t("div",[t("el-button",{attrs:{type:"primary"},on:{click:function(t){e.refundType=1}}},[e._v("退货并退款")]),t("el-button",{staticStyle:{"margin-left":"20px"},on:{click:function(t){e.refundType=2}}},[e._v("仅退款")])],1):t("div",[t("el-button",{on:{click:function(t){e.refundType=1}}},[e._v("退货并退款")]),t("el-button",{staticStyle:{"margin-left":"20px"},attrs:{type:"primary"},on:{click:function(t){e.refundType=2}}},[e._v("仅退款")])],1)])])]),t("div",[1==e.refundType?t("div",{staticClass:"refund-item-list"},[t("div",{staticClass:"refund-label"},[e._v("选择花材")]),t("div",e._l(e.product,(function(r,n){return t("div",{key:n,staticClass:"list"},[t("div",{staticClass:"flex list-title"},[t("span",{staticClass:"product-name"},[e._v(e._s(r.name))]),t("span",{staticClass:"product-num"},[e._v(e._s(""+parseFloat(r.xhNum))+e._s(r.xhUnitName))]),t("span",{staticClass:"product-price"},[e._v(e._s(""+parseFloat(r.xhUnitPrice))+"元/"+e._s(r.xhUnitName))])]),t("div",{staticClass:"flex list-val",staticStyle:{"font-size":"18px","font-weight":"bold"}},[t("input",{directives:[{name:"model",rawName:"v-model",value:r.refundCount,expression:"res.refundCount"}],attrs:{type:"text",placeholder:"退货数","placeholder-style":"color:#CCCCCC"},domProps:{value:r.refundCount},on:{input:function(t){t.target.composing||e.$set(r,"refundCount",t.target.value)}}}),t("span",{staticStyle:{"margin-left":"10px"}},[e._v(e._s(r.xhUnitName))]),t("span",{staticStyle:{color:"green","margin-left":"20px"}},[e._v("可退"+e._s(Number(r.xhNum)-Number(r.refundNum))+e._s(r.xhUnitName))])])])})),0)]):e._e(),Number(e.orderInfo.packCost)>0||Number(e.orderInfo.sendCost)>0?t("div",{staticClass:"refund-item-list"},[t("div",{staticClass:"refund-label"},[e._v("其他可退:")]),t("div",[Number(e.orderInfo.packCost)>0?t("div",{staticClass:"list"},[t("div",{staticClass:"flex list-title"},[t("span",{staticClass:"product-name"},[e._v("打包费")]),t("span",{staticClass:"product-num"},[e._v(e._s(e.orderInfo.packCost?parseFloat(e.orderInfo.packCost):0)+"元")])]),t("div",{staticClass:"flex list-val",staticStyle:{"font-size":"17px","font-weight":"bold"}},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.orderInfo.refundPackCostAmount,expression:"orderInfo.refundPackCostAmount"}],attrs:{type:"digit",placeholder:"金额","placeholder-style":"color:#CCCCCC"},domProps:{value:e.orderInfo.refundPackCostAmount},on:{input:function(t){t.target.composing||e.$set(e.orderInfo,"refundPackCostAmount",t.target.value)}}}),t("span",{staticStyle:{"margin-left":"10px"}},[e._v("元")]),t("span",{staticStyle:{color:"green","margin-left":"20px"}},[e._v("可退"+e._s(parseFloat((Number(e.orderInfo.packCost)-Number(e.orderInfo.refundPackCost)).toFixed(2)))+"元")])])]):e._e(),Number(e.orderInfo.sendCost)>0?t("div",{staticClass:"list"},[t("div",{staticClass:"flex list-title"},[t("span",{staticClass:"product-name"},[e._v("运费")]),t("span",{staticClass:"product-num"},[e._v(e._s(e.orderInfo.sendCost?parseFloat(e.orderInfo.sendCost):0)+"元")])]),t("div",{staticClass:"flex list-val",staticStyle:{"font-size":"17px","font-weight":"bold"}},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.orderInfo.refundSendCostAmount,expression:"orderInfo.refundSendCostAmount"}],attrs:{type:"digit",placeholder:"金额","placeholder-style":"color:#CCCCCC"},domProps:{value:e.orderInfo.refundSendCostAmount},on:{input:function(t){t.target.composing||e.$set(e.orderInfo,"refundSendCostAmount",t.target.value)}}}),t("span",{staticStyle:{"margin-left":"10px"}},[e._v("元")]),t("span",{staticStyle:{color:"green","margin-left":"20px"}},[e._v("可退"+e._s(parseFloat((Number(e.orderInfo.sendCost)-Number(e.orderInfo.refundSendCost)).toFixed(2)))+"元")])])]):e._e()])]):e._e()]),t("div",[t("div",{staticClass:"accounts-list"},[e._v(" 退款原因 "),t("div",{staticClass:"accounts-center"},[t("el-button",{class:[0==e.cause?"active-button":""],attrs:{size:"small"},on:{click:function(t){e.cause=0}}},[e._v("质量问题")]),t("el-button",{class:[1==e.cause?"active-button":""],staticStyle:{"margin-left":"20px"},attrs:{size:"small"},on:{click:function(t){e.cause=1}}},[e._v("多开错开")]),t("el-button",{class:[2==e.cause?"active-button":""],staticStyle:{"margin-left":"20px"},attrs:{size:"small"},on:{click:function(t){e.cause=2}}},[e._v("打包原因")]),t("el-button",{class:[3==e.cause?"active-button":""],staticStyle:{"margin-left":"20px"},attrs:{size:"small"},on:{click:function(t){e.cause=3}}},[e._v("物流原因")])],1)])]),t("div",{staticClass:"accounts-list"},[e._v(" 订单金额 "),t("div",{staticClass:"accounts-center"},[e._v(" ¥"+e._s(e.orderInfo.orderPrice?parseFloat(e.orderInfo.orderPrice):0)+" "),Number(e.orderInfo.tkPrice)>0?t("span",{staticStyle:{"margin-left":"15px","font-size":"18px",color:"green","font-weight":"bold"}},[e._v("已退¥"+e._s(e.orderInfo.tkPrice?parseFloat(e.orderInfo.tkPrice):0))]):e._e()])]),t("div",{staticClass:"accounts-list"},[e._v(" 可退金额 "),t("div",{staticClass:"accounts-center"},[e._v("¥"+e._s(e.couldRefundPrice))])]),t("div",{staticClass:"accounts-list"},[e._v(" 预计退款 "),t("div",{staticClass:"accounts-center"},[e._v("¥"+e._s(e.refundPrice))])]),t("div",{staticClass:"accounts-list"},[e._v(" 实际退款 "),t("div",{staticClass:"accounts-center"},[t("el-input",{staticStyle:{width:"120px"},attrs:{placeholder:"输入金额"},on:{focus:function(t){e.refundMoney=""}},model:{value:e.refundMoney,callback:function(t){e.refundMoney=t},expression:"refundMoney"}})],1)]),t("div",{staticClass:"accounts-list"},[e._v(" 备注内容 "),t("div",{staticClass:"accounts-center"},[t("el-input",{attrs:{type:"textarea",rows:2,placeholder:"请输入内容"},model:{value:e.remark,callback:function(t){e.remark=t},expression:"remark"}})],1)])]),t("div",{staticStyle:{padding:"20upx 0 20upx 0","font-size":"30upx","font-weight":"bold","margin-left":"70px"}},[2==e.orderInfo.onlinePay?t("span",{staticStyle:{color:"green"}},[e._v("此单线上付款,提交后,钱会原路自动退回给客户")]):[Number(e.orderInfo.debtPrice)>0?t("span",{staticStyle:{color:"#3385ff"}},[e._v(" 此单为欠款单,提交后,欠款金额会自动减少 ")]):t("span",{staticStyle:{color:"red"}},[e._v("此单线下付款,提交后钱不会原路退回,请线下转账给客户")])]],2),t("div",{staticStyle:{"margin-left":"80px","margin-top":"20px"}},[t("el-button",{staticStyle:{"margin-left":"120px"},on:{click:e.closeOpen}},[e._v("取消")]),t("el-popconfirm",{staticStyle:{"margin-left":"180px"},attrs:{title:"确认退款?"},on:{confirm:function(t){return e.confirmRefund()},onConfirm:function(t){return e.confirmRefund()}}},[t("el-button",{attrs:{slot:"reference",type:"primary"},slot:"reference"},[e._v("确认")])],1)],1),e.$util.isEmpty(e.unClear)?e._e():t("div",{staticStyle:{"font-size":"20px","z-index":"9999",color:"red","text-align":"center","font-weight":"bold","margin-bottom":"30px"}},[t("span",[e._v("有一个待结账单 ¥"+e._s(e.unClear.actPrice?parseFloat(e.unClear.actPrice):0))])])])])],1)},s=[],o=(r("b138"),r("8f26"),r("666b"),r("963e"),r("f803"),{name:"begin-refund",props:{currentRefundData:{type:Object,default:()=>{}}},data(){return{showDtail:!1,loading:!0,product:[],refundMoney:0,refundType:1,cause:0,remark:"",orderInfo:{},couldRefundPrice:0,unClear:{}}},computed:{refundPrice(){let e=0;if(this.product)for(const t of this.product)if(Number(t.refundCount)>0){let r=Number(t.refundCount)*Number(t.xhUnitPrice);r.toFixed(2),e=Number(e)+Number(r),e.toFixed(2)}return Number(this.orderInfo.refundSendCostAmount)>0&&(e=Number(this.orderInfo.refundSendCostAmount)+Number(e)),Number(this.orderInfo.refundPackCostAmount)>0&&(e=Number(this.orderInfo.refundPackCostAmount)+Number(e)),e=parseFloat(e.toFixed(2)),this.refundMoney=e,e}},methods:{closeTrigger(){this.$emit("searchFocus")},confirmRefund(){let e=!1,t=[],r=this;if(this.product.forEach(r=>{let n=r.refundCount?Number(r.refundCount):0,s=r.xhNum?Number(r.xhNum):0,o=r.refundNum?Number(r.refundNum):0,i=Number(s)-Number(o);if(Number(n)>Number(i))return this.$message.error(r.name+"超过可退数量"),e=!0,!1;Number(r.refundCount)>0&&t.push({productId:r.productId,num:r.refundCount,unitType:r.unitType,unitName:r.xhUnitName,unitType:r.xhUnitType,unitPrice:r.xhUnitPrice})}),e)return;if(this.$util.isEmpty(t)&&1==this.refundType)return void this.$message.error("请选择商品");if(Number(this.orderInfo.refundPackCostAmount)>0){let e=parseFloat((Number(this.orderInfo.packCost)-Number(this.orderInfo.refundPackCost)).toFixed(2));if(Number(this.orderInfo.refundPackCostAmount)>Number(e))return this.$message.error("打包费超出可退金额"),!1}if(Number(this.orderInfo.refundSendCostAmount)>0){let e=parseFloat((Number(this.orderInfo.sendCost)-Number(this.orderInfo.refundSendCost)).toFixed(2));if(Number(this.orderInfo.refundSendCostAmount)>Number(e))return this.$message.error("运费超出可退金额"),!1}let n={id:this.currentRefundData.id,product:JSON.stringify(t),price:this.refundMoney,remark:this.remark,refundType:this.refundType,getOriginalItem:1,cause:this.cause,refundSendCost:this.orderInfo.refundSendCostAmount,refundPackCost:this.orderInfo.refundPackCostAmount};this.$service.refund.refund(n).then(e=>{if(e.error&&"hasUnClearOrder"==e.error)return r.needCancelRemind(e.clearId),!1;r.$message.success("售后成功"),r.closeOpen()})},needCancelRemind(e){this.$message.error("有结账单取消了才能退款")},init(){this.product=[],this.refundMoney=0,this.refundType=1,this.cause=0,this.remark="",this.orderInfo={},this.couldRefundPrice=0,this.unClear={},this.showDtail=!0,this.$service.order.detail({id:this.currentRefundData.id,getOriginalItem:1}).then(e=>{this.orderInfo={...e,refundPackCostAmount:"",refundSendCostAmount:""},this.couldRefundPrice=Number(e.orderPrice)-Number(e.tkPrice),this.couldRefundPrice=this.couldRefundPrice.toFixed(2),this.couldRefundPrice=parseFloat(this.couldRefundPrice),this.product=e.product.map(e=>({...e,refundCount:null}));let t=e.customId?e.customId:0;Number(t)>0&&this.$service.clear.getUnClear({customId:t}).then(e=>{this.unClear=e.info})})},closeOpen(){this.showDtail=!1}}}),i=o,a=(r("0a8b"),r("77b5"),r("1805")),u=Object(a["a"])(i,n,s,!1,null,"4034ffb6",null);t["default"]=u.exports},db83:function(e,t,r){}}]);