1 line
5.7 KiB
JavaScript
1 line
5.7 KiB
JavaScript
"use strict";(wx.webpackJsonp=wx.webpackJsonp||[]).push([[7058],{4917:function(e,o,t){var n=t(4165),l=t(5861),a=t(9439),i=t(1515),r=t(2954),c=t.n(r),u=t(7294),s=t(4689),d=t(5989),_=t(4856),m=t(1115),b=t(1251),h=t(4812),p=t(5893),v=function RefundCodelist(e){var o=(0,b.Ps)().fetchData,t=(0,u.useState)(""),r=(0,a.Z)(t,2),v=r[0],g=r[1],j=(0,u.useMemo)((function(){return 1==(null==e?void 0:e.obj.type)||3==(null==e?void 0:e.obj.type)?null==e?void 0:e.obj.quality_check_pass_number:null==e?void 0:e.obj.total_number}),[null==e?void 0:e.obj]),f=function(){var t=(0,l.Z)((0,n.Z)().mark((function _callee(){var t,l,a,i,r,u,s,d,_,m,b,p,v,f,w,y,S,P,Z,k,x,C,A;return(0,n.Z)().wrap((function _callee$(n){for(;;)switch(n.prev=n.next){case 0:return c().showLoading({title:"请稍等...",mask:!0}),x=[],[],(1==e.obj.type||3==(null==e?void 0:e.obj.type)?e.obj.quality_check_pass_product:e.obj.product_list).forEach((function(e){e.product_colors.forEach((function(o){x.push({product_code:e.code,product_name:e.name,product_color_code:o.code,product_color_name:o.name,num:o.roll.toString(),weight:(0,h.$y)(o.label_weight).toString(),deduction_weight:(0,h.$y)(o.deductions_weight).toString(),settle_weight:(0,h.$y)(o.settle_weight).toString(),deduction_amount:(o.deductions_amount/100).toString(),sale_price:(o.sale_price/100).toString(),total_price:(o.estimate_amount/100).toString(),length:(o.length/100).toString(),weight_error:(0,h.$y)(o.settle_weight_error).toString()})}))})),C={list:x,title:"售后确认单",order_type:e.obj.sale_mode_name,sale_user:e.obj.sale_user_name,order_created_time:(0,h.o0)(e.obj.create_time),order_no:e.obj.return_order_no,pay_account:e.obj.transfer_remittance_account,bank_account_name:e.obj.account_name,bank_name:e.obj.bank_of_deposit,client:e.obj.purchaser_name,order_total_length:(e.obj.total_number/100).toString(),order_total_price:(e.obj.refund_amount/100).toString(),order_total_num:j.toString(),order_total_settle_weight:(e.obj.order_total_settle_weight/1e3).toString(),order_total_deduction_weight:(e.obj.order_total_deduction_weight/1e3).toString(),order_total_deduction_amount:(e.obj.order_total_deduction_amount/100).toString(),order_total_weight_error:(e.obj.total_weight_error/1e3).toString(),show_sale_price:!(0!==(null==e||null===(t=e.obj)||void 0===t?void 0:t.sale_mode)||null==e||null===(l=e.obj)||void 0===l||!l.is_display_price)||!(1!==(null==e||null===(a=e.obj)||void 0===a?void 0:a.sale_mode)&&2!==(null==e||null===(i=e.obj)||void 0===i?void 0:i.sale_mode)),show_total_price:!(0!==(null==e||null===(r=e.obj)||void 0===r?void 0:r.sale_mode)||null==e||null===(u=e.obj)||void 0===u||!u.is_display_price)||!(1!==(null==e||null===(s=e.obj)||void 0===s?void 0:s.sale_mode)&&2!==(null==e||null===(d=e.obj)||void 0===d?void 0:d.sale_mode)),show_deduction_amount:!(0!==(null==e||null===(_=e.obj)||void 0===_?void 0:_.sale_mode)||null==e||null===(m=e.obj)||void 0===m||!m.is_display_price)||!(1!==(null==e||null===(b=e.obj)||void 0===b?void 0:b.sale_mode)&&2!==(null==e||null===(p=e.obj)||void 0===p?void 0:p.sale_mode)),show_order_total_price:!(0!==(null==e||null===(v=e.obj)||void 0===v?void 0:v.sale_mode)||null==e||null===(f=e.obj)||void 0===f||!f.is_display_price)||!(1!==(null==e||null===(w=e.obj)||void 0===w?void 0:w.sale_mode)&&2!==(null==e||null===(y=e.obj)||void 0===y?void 0:y.sale_mode)),show_order_total_deduction_amount:!(0!==(null==e||null===(S=e.obj)||void 0===S?void 0:S.sale_mode)||null==e||null===(P=e.obj)||void 0===P||!P.is_display_price)||!(1!==(null==e||null===(Z=e.obj)||void 0===Z?void 0:Z.sale_mode)&&2!==(null==e||null===(k=e.obj)||void 0===k?void 0:k.sale_mode))},n.next=8,o(C);case 8:(A=n.sent).data&&(g(A.data.base64),c().hideLoading());case 10:case"end":return n.stop()}}),_callee)})));return function getPic(){return t.apply(this,arguments)}}(),w=(0,u.useRef)({filePath:"",base64:""}),y=(0,_.Z)({scope:"scope.writePhotosAlbum",msg:"您没授权,无法保存图片"}).check;(0,u.useEffect)((function(){Object.keys(e.obj).length>0&&f()}),[e.obj]);var S=function saveImage(){var e=(new Date).valueOf(),o=/data:image\/(\w+);base64,(.*)/.exec(v)||[],t=(0,a.Z)(o,3),n=t[1],l=t[2],i="".concat(c().env.USER_DATA_PATH,"/img").concat(e,".").concat(n);w.current.filePath=i,w.current.base64=l,c().getFileSystemManager().writeFile({filePath:w.current.filePath,data:w.current.base64,encoding:"base64"}),m.Z9.loading("正在保存图片"),c().saveImageToPhotosAlbum({filePath:w.current.filePath,success:function success(){m.Z9.success("图片保存成功")},fail:function fail(e){console.log("err::",e)}})},P=function(){var e=(0,l.Z)((0,n.Z)().mark((function _callee2(){return(0,n.Z)().wrap((function _callee2$(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,y();case 2:e.sent&&S();case 4:case"end":return e.stop()}}),_callee2)})));return function saveImageCheck(){return e.apply(this,arguments)}}();return(0,p.jsx)(d.Z,{show:e.showPopup,title:"退款码单",onClose:function onClose(){var o;return null===(o=e.popupClose)||void 0===o?void 0:o.call(e)},children:(0,p.jsxs)(i.G7,{className:s.Z.popupBox,children:[(0,p.jsx)(i.pf,{enhanced:!0,scrollY:!0,className:s.Z.scroStyle,children:(0,p.jsx)(i.G7,{className:s.Z.pic,children:(0,p.jsx)(i.Ee,{lazyLoad:!0,mode:"widthFix",style:{width:"100%",height:"100%"},src:v,onClick:function onClick(){return function showImage(){var e=(new Date).valueOf(),o=/data:image\/(\w+);base64,(.*)/.exec(v)||[],t=(0,a.Z)(o,3),n=t[1],l=t[2],i="".concat(c().env.USER_DATA_PATH,"/img").concat(e,".").concat(n);w.current.filePath=i,w.current.base64=l,c().getFileSystemManager().writeFile({filePath:w.current.filePath,data:w.current.base64,encoding:"base64"}),c().previewImage({current:w.current.filePath,urls:[w.current.filePath]})}()}})})}),(0,p.jsx)(i.G7,{className:s.Z.sure,onClick:function onClick(){return P()},children:"保存图片"})]})})};o.Z=(0,u.memo)(v)}}]); |