| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3155ebec"],{"0771":function(e,t,r){},"078e":function(e,t,r){"use strict";r("0771")},"437e":function(e,t,r){},b3c3:function(e,t,r){"use strict";r("437e")},e697:function(e,t,r){"use strict";r.r(t);var i=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}}},[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,i){return t("div",{key:i,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.itemNum))+e._s(r.bigUnit))]),t("span",{staticClass:"product-price"},[e._v(e._s(""+parseFloat(r.bigPrice))+"元/"+e._s(r.bigUnit))])]),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.bigUnit))]),t("span",{staticStyle:{color:"green","margin-left":"20px"}},[e._v("可退"+e._s(Number(r.itemNum)-Number(r.refundNum))+e._s(r.bigUnit))])]),e.orderInfo.inBooking&&1==e.orderInfo.inBooking&&!e.$util.isEmpty(r.sendList)?t("div",{staticStyle:{border:"1px solid #6795da","font-size":"18px",margin:"8px 0 5px 0",padding:"5px 0 5px 0"}},e._l(r.sendList,(function(i,n){return t("div",{key:n,staticStyle:{padding:"5px 5px 5px 8px"}},[t("div",[e._v(e._s(i.customName)+"("+e._s(i.seatSn)+")"),t("span",{staticStyle:{"margin-left":"20px"}},[e._v("上架数 "+e._s(i.num)+e._s(r.bigUnit))])]),t("div",{staticStyle:{"border-bottom":"1px solid #77a977","padding-bottom":"6px","padding-top":"4px",display:"flex","align-items":"center","margin-top":"3px"}},[t("input",{directives:[{name:"model",rawName:"v-model",value:i.currentRefundNum,expression:"send.currentRefundNum"}],staticStyle:{border:"2px solid #ddd",width:"140px","font-size":"18px","text-align":"center","margin-right":"10px"},attrs:{type:"text",placeholder:"下架数","placeholder-style":"color:#CCCCCC"},domProps:{value:i.currentRefundNum},on:{input:function(t){t.target.composing||e.$set(i,"currentRefundNum",t.target.value)}}}),t("span",{staticStyle:{"margin-left":"10px"}},[e._v("可下架"+e._s(parseFloat((Number(i.num)-Number(i.outNum)).toFixed(2)))+e._s(r.bigUnit))])])])})),0):e._e()])})),0)]):e._e()]),t("div",{staticClass:"accounts-list"},[e._v(" 订单金额 "),t("div",{staticClass:"accounts-center"},[e._v(" ¥"+e._s(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:"输入金额"},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:{"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)])])],1)},n=[],s=(r("f16c"),r("45d2"),r("8160"),r("9052"),{name:"begin-refund",props:{currentRefundData:{type:Object,default:()=>{}}},data(){return{showDtail:!1,loading:!0,product:[],refundMoney:0,refundType:1,remark:"",orderInfo:{},couldRefundPrice:0}},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.bigPrice);r.toFixed(2),e=Number(e)+Number(r),e.toFixed(2)}return e=parseFloat(e.toFixed(2)),this.refundMoney=e,e}},methods:{confirmRefund(){let e=!1,t=[],r=null;if(this.product.forEach(i=>{let n=i.refundCount?Number(i.refundCount):0,s=i.itemNum?Number(i.itemNum):0,u=i.refundNum?Number(i.refundNum):0,o=Number(s)-Number(u);if(Number(n)>Number(o))return this.$message.error(i.name+"超过可退数量"),e=!0,!1;r=[],this.$util.isEmpty(i.sendList)||i.sendList.forEach(e=>{e.currentRefundNum&&parseFloat(e.currentRefundNum)>0&&r.push({id:e.id,refundNum:e.currentRefundNum})}),Number(i.refundCount)>0&&t.push({productId:i.productId,num:i.refundCount,unitType:0,unitName:i.bigUnit,unitPrice:i.bigPrice,sendRefund:r})}),e)return;if(this.$util.isEmpty(t)&&1==this.refundType)return void this.$message.error("请选择花材");let i={id:this.orderInfo.id,product:JSON.stringify(t),price:this.refundMoney,remark:this.remark,refundType:this.refundType};this.$service.cgRefund.createOrder(i).then(e=>{this.$message.success("操作成功"),this.closeOpen()})},init(){this.product=[],this.refundMoney=0,this.refundType=1,this.remark="",this.orderInfo={},this.couldRefundPrice=0,this.showDtail=!0,this.$service.purchaseOrder.detail({orderSn:this.currentRefundData.orderSn}).then(e=>{this.orderInfo=e,this.couldRefundPrice=Number(e.orderPrice)-Number(e.tkPrice),this.couldRefundPrice=this.couldRefundPrice.toFixed(2),this.couldRefundPrice=parseFloat(this.couldRefundPrice),this.product=e.itemInfo.map(e=>({...e,refundCount:null}))})},closeOpen(){this.showDtail=!1}}}),u=s,o=(r("b3c3"),r("078e"),r("1805")),a=Object(o["a"])(u,i,n,!1,null,"d55e5b2a",null);t["default"]=a.exports}}]);
|