1 line
30 KiB
JavaScript
1 line
30 KiB
JavaScript
"use strict";(wx.webpackJsonp=wx.webpackJsonp||[]).push([[563],{5767:function(e,n,o){var t=o(9975),l=o(2982),i=o(4165),a=o(1413),c=o(5861),s=o(885),r=o(1515),u=o(9792),d=o(1251),_="index-module__order_status_list___k66cU",m="index-module__order_status_item___rcQLA",x="index-module__selected___RLILI",h="index-module__order_list_scroll___mbA1_",f=o(6408),p=o.n(f),v=o(5513),g=(0,u.memo)((function(e){var n=e.list,o=void 0===n?[]:n,t=e.defaultId,l=void 0===t?null:t,i=e.onSelect,c=(0,u.useState)({selected:-1,tabId:""}),d=(0,s.Z)(c,2),f=d[0],g=d[1];(0,u.useEffect)((function(){if(l){var e=null==o?void 0:o.findIndex((function(e){return e.id==l}));if(-1!==e){var n=e>0?e-1:0;g((function(e){return(0,a.Z)((0,a.Z)({},e),{},{tabId:o[n].id.toString()})}))}}g((function(e){return(0,a.Z)((0,a.Z)({},e),{},{selected:l||-1})}))}),[l]);return(0,v.jsx)(r.G7,{className:_,children:(0,v.jsx)(r.pf,{scrollX:!0,scrollIntoView:"tabs_".concat(f.tabId),scrollWithAnimation:!0,children:(0,v.jsx)(r.G7,{className:h,children:o.map((function(e,n){return(0,v.jsx)(r.G7,{id:"tabs_".concat(e.id),onClick:function onClick(){return function clickEvent(e){var n=e.item,t=e.index,l=t>0?t-1:0;g((function(e){return(0,a.Z)((0,a.Z)({},e),{},{tabId:o[l].id.toString(),selected:n.id})})),null==i||i(n.id)}({item:e,index:n})},className:p()(m,f.selected==e.id&&x),children:e.name},e.id)}))})})})})),j=o(5032),b=o(7227),N={common_safe_area_y:"index-module__common_safe_area_y___P1Do_","full-100":"index-module__full-100___Dh8iF","color-blue":"index-module__color-blue___SV3iG","color-yellow":"index-module__color-yellow___cQjXZ","color-green":"index-module__color-green___ib23v","color-grey":"index-module__color-grey___KVUuL","color-white":"index-module__color-white___CcsbJ",flexBox:"index-module__flexBox___zJAJh",icon_shaixuan:"index-module__icon_shaixuan___ZLiRQ",activeshaixuan:"index-module__activeshaixuan___rHn4Q",shaixuan:"index-module__shaixuan___Hlvjt",activeshai:"index-module__activeshai___Nf47_",popupBox:"index-module__popupBox___NrHv7",topBox:"index-module__topBox___lVlZ6",leftTop:"index-module__leftTop___RoELY",lefttopTitle:"index-module__lefttopTitle___Rv_iD",lefttopSelectBox:"index-module__lefttopSelectBox___X26l6",lefttopSelectName:"index-module__lefttopSelectName___jWuQz",icon_more:"index-module__icon_more___ZuQ9q",activelefttopSelectBox:"index-module__activelefttopSelectBox___bu1fh",secondBox:"index-module__secondBox___BoNjH",secondTopfont:"index-module__secondTopfont___zdFhL",inputBox:"index-module__inputBox___ynOAj",orderInput:"index-module__orderInput___pjQvs",saomiao:"index-module__saomiao___xFk0W",thirdBox:"index-module__thirdBox___PWSQH",thirdTopfont:"index-module__thirdTopfont___Gs7HO",flexModebox:"index-module__flexModebox___rs5Sr",activemodeBox:"index-module__activemodeBox___mVovb",modeBox:"index-module__modeBox___kcNx0",bottomBox:"index-module__bottomBox___sebvs",resetBox:"index-module__resetBox___fGGEZ",button:"index-module__button___GU26e",activeButton:"index-module__activeButton___D0M1j",order_list:"index-module__order_list___RoU_W",bigBpx:"index-module__bigBpx___pO8tV",kongboxTwo:"index-module__kongboxTwo____wJnY"},k=o(5854),Z=o(4909),G=o(2535),w=o.n(G),y="index-module__itemBox___r2hfd",S="index-module__topItem___p12RW",B="index-module__orderNo___ee0pt",C="index-module__status___mfwsO",T="index-module__pussName___OFHb2",P="index-module__line___bwG9I",I="index-module__contBox___z18C3",z="index-module__leftCont___lAQ2l",L="index-module__leftContNums___NYM9g",F="index-module__rightCont___zh7yE",R="index-module__rightTop___CTR2z",D="index-module__productBox___ZRAps",O="index-module__productName___BYyH2",M="index-module__productMode___FoG3x",A="index-module__shipMode___m7eRw",E="index-module__colorsBox___AGf69",U="index-module__colorNameOne___DByBc",$="index-module__colorName___J5hr_",H="index-module__colorNameTwo___DxtPY",J="index-module__lineOne___AvPrw",V="index-module__bottomMsg___Ol2O_",Y="index-module__msgLeft____ZLLS",Q="index-module__msgRight___SR_rw",W="index-module__msgRightOne___IJhUL",q="index-module__bottomBox___rpUFB",K=o(6631),X=o(4812),ee=(0,u.memo)((function(e){var n,o,t,l,i,a,c,s,u,d,_,m,x,h,f,p,g,j,b,N,k,Z,G,ee,ne,oe,te,le,ie,ae,ce,se,re,ue,de,_e,me,xe,he,fe,pe,ve,ge,je,be,Ne,ke,Ze,Ge,we,ye,Se,Be,Ce,Te,Pe,Ie,ze,Le,Fe,Re,De,Oe,Me,Ae,Ee,Ue;return(0,v.jsxs)(r.G7,{className:y,onClick:function onClick(n){return function navTo(n){var o;w().navigateTo({url:"/pages/orderDetails/index?id="+(null==e||null===(o=e.obj)||void 0===o?void 0:o.id)})}()},children:[(0,v.jsxs)(r.G7,{className:S,children:[(0,v.jsxs)(r.G7,{className:B,children:["单号:",null==e||null===(n=e.obj)||void 0===n?void 0:n.order_no]}),(0,v.jsx)(r.G7,{className:C,children:null==e||null===(o=e.obj)||void 0===o?void 0:o.status_name})]}),(0,v.jsx)(r.G7,{className:T,children:null==e||null===(t=e.obj)||void 0===t?void 0:t.purchaser_name}),(0,v.jsx)(r.G7,{className:P}),(0,v.jsxs)(r.G7,{className:I,children:[(0,v.jsx)(r.G7,{className:z,style:{backgroundColor:"rgb(".concat(null==e||null===(l=e.obj)||void 0===l||null===(i=l.product_list[0])||void 0===i||null===(a=i.product_colors[0])||void 0===a||null===(c=a.rgb)||void 0===c?void 0:c.r," ").concat(null==e||null===(s=e.obj)||void 0===s||null===(u=s.product_list[0])||void 0===u||null===(d=u.product_colors[0])||void 0===d||null===(_=d.rgb)||void 0===_?void 0:_.g," ").concat(null==e||null===(m=e.obj)||void 0===m||null===(x=m.product_list[0])||void 0===x||null===(h=x.product_colors[0])||void 0===h||null===(f=h.rgb)||void 0===f?void 0:f.b,")")},children:(0,v.jsxs)(r.G7,{className:L,children:["颜色 (",null==e||null===(p=e.obj)||void 0===p?void 0:p.total_colors,")"]})}),(0,v.jsxs)(r.G7,{className:F,children:[(0,v.jsxs)(r.G7,{className:R,children:[(0,v.jsxs)(r.G7,{className:D,children:[(0,v.jsxs)(r.G7,{className:O,children:[null==e||null===(g=e.obj)||void 0===g||null===(j=g.product_list[0])||void 0===j?void 0:j.code," ",null==e||null===(b=e.obj)||void 0===b||null===(N=b.product_list[0])||void 0===N?void 0:N.name]}),(0,v.jsx)(r.G7,{className:M,children:0===(null==e||null===(k=e.obj)||void 0===k?void 0:k.sale_mode)?"大货":1===(null==e||null===(Z=e.obj)||void 0===Z?void 0:Z.sale_mode)?"剪版":"散剪"})]}),(0,v.jsx)(r.G7,{className:A,children:null==e||null===(G=e.obj)||void 0===G?void 0:G.shipment_mode_name})]}),(0,v.jsxs)(r.G7,{className:E,children:[(0,v.jsxs)(r.G7,{className:U,children:[null==e||null===(ee=e.obj)||void 0===ee||null===(ne=ee.product_list[0])||void 0===ne||null===(oe=ne.product_colors[0])||void 0===oe?void 0:oe.code," ",null==e||null===(te=e.obj)||void 0===te||null===(le=te.product_list[0])||void 0===le||null===(ie=le.product_colors[0])||void 0===ie?void 0:ie.name]}),(0,v.jsxs)(r.G7,{className:$,children:["x",0===(null==e||null===(ae=e.obj)||void 0===ae?void 0:ae.sale_mode)?null==e||null===(ce=e.obj)||void 0===ce||null===(se=ce.product_list[0])||void 0===se||null===(re=se.product_colors[0])||void 0===re?void 0:re.roll:(null==e||null===(ue=e.obj)||void 0===ue||null===(de=ue.product_list[0])||void 0===de||null===(_e=de.product_colors[0])||void 0===_e?void 0:_e.length)/100," ",0===(null==e||null===(me=e.obj)||void 0===me?void 0:me.sale_mode)?"条":"m"]}),(0,v.jsxs)(r.G7,{className:H,children:["¥ ",(null==e||null===(xe=e.obj)||void 0===xe||null===(he=xe.product_list[0])||void 0===he||null===(fe=he.product_colors[0])||void 0===fe?void 0:fe.sale_price)/100,"/kg"]})]}),(null==e||null===(pe=e.obj)||void 0===pe||null===(ve=pe.product_list[0])||void 0===ve||null===(ge=ve.product_colors)||void 0===ge?void 0:ge.length)>1&&(0,v.jsx)(v.Fragment,{children:(0,v.jsxs)(r.G7,{className:E,children:[(0,v.jsxs)(r.G7,{className:U,children:[null==e||null===(je=e.obj)||void 0===je||null===(be=je.product_list[0])||void 0===be||null===(Ne=be.product_colors[1])||void 0===Ne?void 0:Ne.code," ",null==e||null===(ke=e.obj)||void 0===ke||null===(Ze=ke.product_list[0])||void 0===Ze||null===(Ge=Ze.product_colors[1])||void 0===Ge?void 0:Ge.name]}),(0,v.jsxs)(r.G7,{className:$,children:["x",0===(null==e||null===(we=e.obj)||void 0===we?void 0:we.sale_mode)?null==e||null===(ye=e.obj)||void 0===ye||null===(Se=ye.product_list[0])||void 0===Se||null===(Be=Se.product_colors[1])||void 0===Be?void 0:Be.roll:(null==e||null===(Ce=e.obj)||void 0===Ce||null===(Te=Ce.product_list[0])||void 0===Te||null===(Pe=Te.product_colors[1])||void 0===Pe?void 0:Pe.length)/100," ",0===(null==e||null===(Ie=e.obj)||void 0===Ie?void 0:Ie.sale_mode)?"条":"m"]}),(0,v.jsxs)(r.G7,{className:H,children:["¥ ",(null==e||null===(ze=e.obj)||void 0===ze||null===(Le=ze.product_list[0])||void 0===Le||null===(Fe=Le.product_colors[1])||void 0===Fe?void 0:Fe.sale_price)/100,"/kg"]})]})})]})]}),(0,v.jsx)(r.G7,{className:J}),(0,v.jsxs)(r.G7,{className:V,children:[(0,v.jsx)(r.G7,{className:Y,children:"布料信息:"}),(0,v.jsxs)(r.G7,{className:Q,children:[null==e||null===(Re=e.obj)||void 0===Re?void 0:Re.total_fabrics," 种面料,",null==e||null===(De=e.obj)||void 0===De?void 0:De.total_colors," 种颜色,共"," ",0===(null==e||null===(Oe=e.obj)||void 0===Oe?void 0:Oe.sale_mode)?null==e||null===(Me=e.obj)||void 0===Me?void 0:Me.total_number:(null==e||null===(Ae=e.obj)||void 0===Ae?void 0:Ae.total_number)/100," ",0===(null==e||null===(Ee=e.obj)||void 0===Ee?void 0:Ee.sale_mode)?"条":"m"]})]}),(0,v.jsxs)(r.G7,{className:V,children:[(0,v.jsx)(r.G7,{className:Y,children:"预估金额:"}),(0,v.jsxs)(r.G7,{className:W,children:["¥",(0,X.yb)(null==e||null===(Ue=e.obj)||void 0===Ue?void 0:Ue.estimate_amount)]})]}),(0,v.jsx)(r.G7,{className:q,children:(0,v.jsx)(K.Z,{obj:null==e?void 0:e.obj,cancle:function cancle(n){var o;return null==e||null===(o=e.cancle)||void 0===o?void 0:o.call(e,n,null==e?void 0:e.obj)},nextBuy:function nextBuy(n){var o;return null==e||null===(o=e.nextBuy)||void 0===o?void 0:o.call(e,n,null==e?void 0:e.obj)},toPay:function toPay(n){var o;return null==e||null===(o=e.toPay)||void 0===o?void 0:o.call(e,n,null==e?void 0:e.obj)}})})]})})),ne="index-module__popupBox___kFbgH",oe="index-module__contBox___CAcdg",te="index-module__topMoney___j8UZV",le="index-module__itemMoney___bJKJg",ie="index-module__leftFont___Tksm8",ae="index-module__rightFont___eYtZ8",ce="index-module__line___YTc2_",se="index-module__itemBox___UJO13",re="index-module__leftItem___drH4s",ue="index-module__leftCrile___YCyu3",de="index-module__lujing___RZRmU",_e="index-module__rightLeft___zeTRC",me="index-module__title___P9e9y",xe="index-module__nums___FDuy6",he="index-module__checkYuan___TH2KO",fe="index-module__gou___eEUoA",pe="index-module__activeChecked___VgIhV",ve="index-module__chakanquanbukehu___XPisv",ge="index-module__sure___vTthp",je="index-module__pic___B9wKm",be=o(1115),Ne=(0,u.memo)((function(e){var n,o,t,l=e.showSide,a=void 0===l||l,d=e.showPopup,_=void 0!==d&&d,m=e.popupClose,x=e.obj,h=void 0===x?{wait_pay_amount:"",actual_amount:"",total_sale_price:""}:x,f=e.clickItem,g=e.handsurePay,j=e.list,b=void 0===j?[]:j,N=e.title,Z=void 0===N?"待支付款项":N,G=e.picUrl,y=void 0===G?"":G,S=(0,u.useRef)({filePath:"",base64:""}),B=(o=(n={scope:"scope.writePhotosAlbum",msg:"您没授权,无法保存图片"}).scope,t=n.msg,{check:(0,u.useCallback)((function(){return new Promise((function(e,n){w().getSetting({success:function success(l){l.authSetting[o]?e(!0):void 0===l.authSetting[o]?w().authorize({scope:o,success:function success(){e(!0)},fail:function fail(){be.Z9.none(t),n(!1)}}):w().openSetting({success:function success(l){l.authSetting[o]?e(!0):(be.Z9.none(t),n(!1))}})}})}))}),[o])}).check,C=function(){var e=(0,c.Z)((0,i.Z)().mark((function _callee(){return(0,i.Z)().wrap((function _callee$(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,B();case 2:e.sent&&T();case 4:case"end":return e.stop()}}),_callee)})));return function saveImageCheck(){return e.apply(this,arguments)}}(),T=function saveImage(){be.Z9.loading("正在保存图片"),w().saveImageToPhotosAlbum({filePath:S.current.filePath,success:function success(){be.Z9.success("图片保存成功")},fail:function fail(e){}})};return(0,v.jsx)(r.G7,{className:ne,children:(0,v.jsxs)(k.Z,{show:_,title:Z,onClose:function onClose(){return null==m?void 0:m()},children:[a&&(0,v.jsxs)(r.G7,{className:oe,children:[(0,v.jsxs)(r.G7,{className:te,children:["¥",(0,X.yb)(h.wait_pay_amount)]}),(0,v.jsxs)(r.G7,{className:le,children:[(0,v.jsx)(r.G7,{className:ie,children:"订单金额"}),(0,v.jsxs)(r.G7,{className:ae,children:["¥",(0,X.yb)(h.total_sale_price)]})]}),(0,v.jsxs)(r.G7,{className:le,children:[(0,v.jsx)(r.G7,{className:ie,children:"已付金额"}),(0,v.jsxs)(r.G7,{className:ae,children:["¥",(0,X.yb)(h.actual_amount)]})]}),(0,v.jsx)(r.G7,{className:ce}),b.map((function(e,n){return(0,v.jsxs)(r.G7,{className:se,onClick:function onClick(){return null==f?void 0:f(e)},children:[(0,v.jsxs)(r.G7,{className:re,children:[(0,v.jsx)(r.G7,{className:ue,children:(0,v.jsx)(r.G7,{className:p()("iconfont",e.iconfont,de)})}),(0,v.jsxs)(r.G7,{className:_e,children:[(0,v.jsx)(r.G7,{className:me,children:e.name}),e.fonts&&(0,v.jsxs)(r.G7,{className:xe,children:[e.fonts,""!==e.money?"¥":"",e.money]})]})]}),"扫码支付"!==e.name&&(0,v.jsx)(r.G7,{className:e.checked?pe:he,children:(0,v.jsx)(r.G7,{className:p()("iconfont","icon-lujing",fe)})}),"扫码支付"===e.name&&(0,v.jsx)(r.G7,{className:p()("iconfont","icon-chakanquanbukehu",ve)})]},n)}))]}),a&&(0,v.jsx)(r.G7,{className:ge,onClick:function onClick(){return null==g?void 0:g(null==e?void 0:e.obj)},children:"确认交易"}),!a&&(0,v.jsx)(r.pf,{enhanced:!0,scrollY:!0,style:{height:"700rpx",marginLeft:"24rpx"},children:(0,v.jsx)(r.G7,{className:je,children:(0,v.jsx)(r.Ee,{lazyLoad:!0,mode:"widthFix",style:{width:"100%",height:"100%"},src:y,onClick:function onClick(){return function showImage(){var e=(new Date).valueOf(),n=/data:image\/(\w+);base64,(.*)/.exec(y)||[],o=(0,s.Z)(n,3),t=o[1],l=o[2],i=w().env.USER_DATA_PATH+"/img"+e+"."+t;S.current.filePath=i,S.current.base64=l,w().getFileSystemManager().writeFile({filePath:S.current.filePath,data:S.current.base64,encoding:"base64"}),w().previewImage({current:S.current.filePath,urls:[S.current.filePath]})}()}})})}),!a&&(0,v.jsx)(r.G7,{className:ge,onClick:function onClick(){return C()},children:"保存图片"})]})})}));Page((0,t.createPageConfig)((function(){var e,n=(0,u.useState)({status:-1,page:1,size:10,name:""}),o=(0,s.Z)(n,2),t=o[0],_=o[1],m=(0,d.Vy)(),x=m.fetchData,h=m.state,f=(0,u.useState)({list:[],total:0}),y=(0,s.Z)(f,2),S=y[0],B=y[1],C=function(){var e=(0,c.Z)((0,i.Z)().mark((function _callee(){var e;return(0,i.Z)().wrap((function _callee$(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,x((0,a.Z)((0,a.Z)({},(0,b.mB)(t)),(0,b.mB)(ne)));case 2:e=n.sent,B((function(n){var o,t;return(0,a.Z)((0,a.Z)({},n),{},{list:null===(o=e.data)||void 0===o?void 0:o.list,total:null===(t=e.data)||void 0===t?void 0:t.total})})),W(!1),z((function(){return!1}));case 6:case"end":return n.stop()}}),_callee)})));return function getOrderList(){return e.apply(this,arguments)}}(),T=(0,u.useState)(!1),P=(0,s.Z)(T,2),I=P[0],z=P[1],L=function(){var e=(0,c.Z)((0,i.Z)().mark((function _callee2(){return(0,i.Z)().wrap((function _callee2$(e){for(;;)switch(e.prev=e.next){case 0:R.current.size=1,z(!0),_((function(e){return(0,a.Z)((0,a.Z)({},e),{},{size:10})}));case 3:case"end":return e.stop()}}),_callee2)})));return function getRefresherRefresh(){return e.apply(this,arguments)}}(),F=(0,u.useMemo)((function(){return(0,b.rA)({list:S.list,total:S.total,status:h.loading})}),[S,h]),R=(0,u.useRef)({size:t.size,page:t.page}),D=(0,u.useCallback)((function(){if(S.list.length<S.total){R.current.page++;var e=R.current.size*R.current.page;_((0,a.Z)((0,a.Z)({},t),{},{size:e}))}}),[S]),O=(0,d.rj)().fetchData,M=(0,u.useState)([{id:-1,name:"全部"}]),A=(0,s.Z)(M,2),E=A[0],U=A[1],$=function(){var e=(0,c.Z)((0,i.Z)().mark((function _callee3(){var e;return(0,i.Z)().wrap((function _callee3$(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,O();case 2:e=n.sent,U((function(n){return[].concat((0,l.Z)(n),(0,l.Z)(e.data.list))}));case 4:case"end":return n.stop()}}),_callee3)})));return function getOrderStatusList(){return e.apply(this,arguments)}}();(0,u.useEffect)((function(){null!=t.status&&C()}),[t]);var H=(0,u.useCallback)((function(e){R.current.page=1,_((function(n){return(0,a.Z)((0,a.Z)({},n),{},{status:e,size:10})})),B((function(){return{list:[],total:0}}))}),[]),J=(0,u.useCallback)((function(e){R.current.page=1,B((function(){return{list:[],total:0}})),_((function(n){return(0,a.Z)((0,a.Z)({},n),{},{name:e,size:10})}))}),[]),V=(0,u.useState)(!1),Y=(0,s.Z)(V,2),Q=Y[0],W=Y[1];(0,G.useDidShow)((function(){var e=w().getCurrentPages(),n=e[e.length-1];oe((function(e){var o,t,l,i,c,s,r,u;return(0,a.Z)((0,a.Z)({},e),{},{purchaser_id:null!==(o=n.data)&&void 0!==o&&o.clientId?null===(t=n.data)||void 0===t?void 0:t.clientId:"",clientName:null!==(l=n.data)&&void 0!==l&&l.clientName?null===(i=n.data)||void 0===i?void 0:i.clientName:"",sale_user_id:null!==(c=n.data)&&void 0!==c&&c.saleuserId?null===(s=n.data)||void 0===s?void 0:s.saleuserId:"",saleuserName:null!==(r=n.data)&&void 0!==r&&r.saleuserName?null===(u=n.data)||void 0===u?void 0:u.saleuserName:""})}))}));var q=(0,u.useState)({purchaser_id:"",clientName:"",sale_user_id:"",saleuserName:"",orderNo:"",sale_mode:void 0,shipment_mode:void 0}),K=(0,s.Z)(q,2),ne=K[0],oe=K[1],te=function navTo(e){1===e?w().navigateTo({url:"/pages/customerPage/index?clientId="+(null==ne?void 0:ne.purchaser_id)}):w().navigateTo({url:"/pages/saleuserPage/index?saleuserId="+(null==ne?void 0:ne.sale_user_id)})},le=(0,u.useState)([{id:-1,name:"不限"},{id:0,name:"大货"},{id:1,name:"剪版"},{id:2,name:"散剪"}]),ie=(0,s.Z)(le,2),ae=ie[0],ce=ie[1],se=(0,u.useState)([{id:-1,name:"不限"},{id:1,name:"自提"},{id:2,name:"物流"}]),re=(0,s.Z)(se,2),ue=re[0],de=re[1],_e=(0,u.useMemo)((function(){return""===ne.clientName&&""===ne.orderNo&&""===ne.saleuserName&&void 0===ne.sale_mode&&void 0===ne.shipment_mode}),[ne]),me=function(){var e=(0,c.Z)((0,i.Z)().mark((function _callee4(){return(0,i.Z)().wrap((function _callee4$(e){for(;;)switch(e.prev=e.next){case 0:C();case 1:case"end":return e.stop()}}),_callee4)})));return function handSure(){return e.apply(this,arguments)}}();(0,u.useEffect)((function(){$()}),[]);var xe=(0,d.Rv)().fetchData,he=function(){var e=(0,c.Z)((0,i.Z)().mark((function _callee6(e,n){return(0,i.Z)().wrap((function _callee6$(o){for(;;)switch(o.prev=o.next){case 0:e.stopPropagation(),w().showModal({content:"确定要取消吗?",confirmText:"确认",cancelText:"取消",success:function(){var e=(0,c.Z)((0,i.Z)().mark((function _callee5(e){var o;return(0,i.Z)().wrap((function _callee5$(t){for(;;)switch(t.prev=t.next){case 0:if(!e.confirm){t.next=6;break}return w().showLoading({title:"请稍等...",mask:!0}),t.next=4,xe({id:n.id});case 4:"success"===(o=t.sent).msg?(w().showToast({title:"取消成功"}),w().hideLoading(),C()):w().showToast({title:o.msg,icon:"error"});case 6:case"end":return t.stop()}}),_callee5)})));return function success(n){return e.apply(this,arguments)}}()});case 2:case"end":return o.stop()}}),_callee6)})));return function cancle(n,o){return e.apply(this,arguments)}}(),fe=(0,d.eS)().fetchData,pe=function(){var e=(0,c.Z)((0,i.Z)().mark((function _callee7(e,n){var o,t,l;return(0,i.Z)().wrap((function _callee7$(i){for(;;)switch(i.prev=i.next){case 0:return e.stopPropagation(),w().showLoading({title:"请稍等...",mask:!0}),o=[],n.product_list.forEach((function(e){e.product_colors.forEach((function(e){o.push({length:e.length,roll:e.roll,product_color_id:e.id})}))})),t={purchaser_id:n.purchaser_id,sale_mode:n.sale_mode,color_list:o},i.next=7,fe(t);case 7:"success"===(l=i.sent).msg?(w().showToast({title:"加入购物车成功!"}),w().hideLoading(),C()):w().showToast({title:l.msg,icon:"error"});case 9:case"end":return i.stop()}}),_callee7)})));return function nextBuy(n,o){return e.apply(this,arguments)}}(),ve=(0,d.Gg)().fetchData,ge=(0,d.fu)().fetchData,je=(0,u.useState)({}),be=(0,s.Z)(je,2),ke=be[0],Ze=be[1],Ge=(0,u.useState)([{id:2,iconfont:"icon-xianxiahuizong",name:"预存款",fonts:"可用额度 ",money:"",isCheck:!1},{id:5,iconfont:"icon-xianxiahuizong",name:"货到付款",fonts:"发货后3天内付款",isCheck:!1,money:""},{id:3,iconfont:"icon-xianxiahuizong",name:"x天账期",fonts:"可用额度 ",money:"",isCheck:!1},{iconfont:"icon-saomiao",name:"扫码支付"}]),we=(0,s.Z)(Ge,2),ye=we[0],Se=we[1],Be=function(){var e=(0,c.Z)((0,i.Z)().mark((function _callee8(e,n){var o,t,a,c,s;return(0,i.Z)().wrap((function _callee8$(i){for(;;)switch(i.prev=i.next){case 0:if(e.stopPropagation(),Ze(n),10===n.status){i.next=11;break}return i.next=5,ve({id:n.should_collect_order_id});case 5:o=i.sent,ye.map((function(e){return 3===e.id&&(e.name="".concat(o.data.account_period,"天账期"),e.fonts="可用额度".concat((0,X.yb)(o.data.account_period_credit_available_line).toLocaleString())),2===e.id&&(e.fonts="可用额度".concat((0,X.yb)(o.data.advance_deposit_balance).toLocaleString())),e})),Se((0,l.Z)(ye)),n.is_shipper_picks_up&&(t=ye.filter((function(e){return 6===e.id})),0===t.length&&(ye.unshift({id:6,iconfont:"icon-xianxiahuizong",name:"货主自提",fonts:"",money:"",isCheck:!1}),Se((0,l.Z)(ye)))),i.next=18;break;case 11:return i.next=13,ge({id:n.pre_collect_order_id});case 13:a=i.sent,(c=[]).push({id:2,iconfont:"icon-xianxiahuizong",name:"预存款",fonts:"可用额度".concat((0,X.yb)(a.data.advance_deposit_balance).toLocaleString()),money:"",isCheck:!1},{iconfont:"icon-saomiao",name:"扫码支付"}),n.is_shipper_picks_up&&(s=c.filter((function(e){return 6===e.id})),0===s.length&&c.unshift({id:6,iconfont:"icon-xianxiahuizong",name:"货主自提",fonts:"",money:"",isCheck:!1})),Se([].concat(c));case 18:Ie(!0),Qe(!0);case 20:case"end":return i.stop()}}),_callee8)})));return function toPay(n,o){return e.apply(this,arguments)}}(),Ce=(0,u.useState)(!0),Te=(0,s.Z)(Ce,2),Pe=Te[0],Ie=Te[1],ze=(0,u.useState)(""),Le=(0,s.Z)(ze,2),Fe=Le[0],Re=Le[1],De=(0,u.useState)(""),Oe=(0,s.Z)(De,2),Me=Oe[0],Ae=Oe[1],Ee=(0,d.fs)().fetchData,Ue=function(){var e=(0,c.Z)((0,i.Z)().mark((function _callee9(){var e,n,o;return(0,i.Z)().wrap((function _callee9$(t){for(;;)switch(t.prev=t.next){case 0:return e=[],ke.product_list.forEach((function(n){n.product_colors.forEach((function(o){e.push({product_code:n.code,product_name:n.name,product_color_code:o.product_color_code,product_color_name:o.product_color_name,num:o.roll.toString(),weight:(0,X.$y)(o.actual_weight).toString(),sale_price:(o.sale_price/100).toString(),total_price:0!==o.actual_amount?(o.actual_amount/100).toString():(o.estimate_amount/100).toString(),length:(o.length/100).toString(),weight_error:(0,X.$y)(o.weight_error).toString()})}))})),n={list:e,title:"面料销售电子确认单",show_qrcode:!0,show_barcode:!0,show_wait_pay_amount:!0,order_type:ke.sale_mode_name,shipment_mode:ke.shipment_mode_name,company:ke.title_purchaser_name,sale_user:ke.sale_user_name,order_created_time:(0,X.o0)(ke.create_time),order_no:ke.order_no,target_user_name:ke.target_user_name,target_address:ke.address_detail,target_description:ke.remark,pay_account:ke.transfer_remittance_account,bank_account_name:ke.account_name,bank_name:ke.bank_of_deposit,pay_type:ke.settle_mode_name,client:ke.purchaser_name,phone:ke.target_user_phone,order_total_length:(ke.total_number/100).toString(),order_total_price:(ke.bill_total_sale_price/100).toString(),total_weight_error_discount:(ke.total_weight_error_discount/100).toString(),order_total_num:ke.total_number.toString(),qrcode:"",order_total_weight:(ke.total_weight/1e3).toString(),estimate_amount:(ke.estimate_amount/100).toString(),total_sale_price:(ke.total_sale_price/100).toString(),show_total_sale_price:!0,show_total_weight_error_discount:!0,actual_amount:(ke.payment_amount/100).toString(),wait_pay_amount:(ke.wait_pay_amount/100).toString(),order_total_weight_error:(ke.total_weight_error/1e3).toString()},t.next=5,Ee(n);case 5:(o=t.sent).data&&(Ie(!1),Re("查看销售码单"),Ae(o.data.base64));case 7:case"end":return t.stop()}}),_callee9)})));return function handScanpay(){return e.apply(this,arguments)}}(),$e=(0,d.a3)().fetchData,He=(0,d.ot)().fetchData,Je=(0,u.useState)(!1),Ve=(0,s.Z)(Je,2),Ye=Ve[0],Qe=Ve[1];return(0,v.jsxs)(r.G7,{children:[(0,v.jsx)(r.G7,{style:{background:"#FFFFFF",paddingLeft:"20rpx",paddingBottom:"20rpx",position:"sticky",top:"0",zIndex:"99"},children:(0,v.jsx)(j.Z,{placeholder:"搜索商品/名称/颜色/订单号",showBtn:!1,changeOnSearch:J,debounceTime:300,children:(0,v.jsxs)(r.G7,{className:N.flexBox,onClick:function onClick(){return function showSelctPopup(){W(!0)}()},children:[(0,v.jsx)(r.G7,{className:p()("iconfont","icon-shaixuan",_e?N.activeshaixuan:N.icon_shaixuan)}),(0,v.jsx)(r.G7,{className:p()(_e?N.shaixuan:N.activeshai),children:"筛选"})]})})}),(0,v.jsx)(r.G7,{style:{background:"#FFFFFF"},children:(0,v.jsx)(g,{list:E,onSelect:H,defaultId:-1})}),(0,v.jsxs)(r.G7,{className:N.order_list,children:[(0,v.jsx)(Z.Z,{statusMore:F,selfonScrollToLower:D,refresherEnabled:!0,refresherTriggered:I,selfOnRefresherRefresh:L,children:null==S||null===(e=S.list)||void 0===e?void 0:e.map((function(e,n){return(0,v.jsx)(r.G7,{className:N.order_item_con,children:(0,v.jsx)(ee,{obj:e,cancle:function cancle(e,n){return he(e,n)},nextBuy:function nextBuy(e,n){return pe(e,n)},toPay:function toPay(e,n){return Be(e,n)}},n)},e.id)}))}),(0,v.jsx)(r.G7,{className:N.kongboxTwo})]}),(0,v.jsx)(k.Z,{title:"筛选订单",show:Q,onClose:function onClose(){return function closePopup(){W(!1)}()},children:(0,v.jsxs)(r.G7,{className:N.popupBox,children:[(0,v.jsxs)(r.G7,{className:N.topBox,children:[(0,v.jsxs)(r.G7,{className:N.leftTop,onClick:function onClick(){return te(1)},children:[(0,v.jsx)(r.G7,{className:N.lefttopTitle,children:"客户信息"}),(0,v.jsxs)(r.G7,{className:p()(""===ne.clientName?N.lefttopSelectBox:N.activelefttopSelectBox),children:[(0,v.jsx)(r.G7,{className:N.lefttopSelectName,children:""===ne.clientName?"请选择客户":ne.clientName}),(0,v.jsx)(r.G7,{className:p()("iconfont","icon-more",N.icon_more)})]})]}),(0,v.jsxs)(r.G7,{className:N.leftTop,onClick:function onClick(){return te(2)},children:[(0,v.jsx)(r.G7,{className:N.lefttopTitle,children:"业务员"}),(0,v.jsxs)(r.G7,{className:p()(""===ne.saleuserName?N.lefttopSelectBox:N.activelefttopSelectBox),children:[(0,v.jsx)(r.G7,{className:N.lefttopSelectName,children:""===ne.saleuserName?"请选择客户":ne.saleuserName}),(0,v.jsx)(r.G7,{className:p()("iconfont","icon-more",N.icon_more)})]})]})]}),(0,v.jsxs)(r.G7,{className:N.secondBox,children:[(0,v.jsx)(r.G7,{className:N.secondTopfont,children:"订单单号"}),(0,v.jsxs)(r.G7,{className:N.inputBox,children:[(0,v.jsx)(r.II,{onInput:function onInput(e){!function handInput(e){oe((function(n){return(0,a.Z)((0,a.Z)({},n),{},{orderNo:e.detail.value})}))}(e)},placeholderStyle:"color:#000000; font-size:26rpx",className:N.orderInput,value:ne.orderNo,placeholder:"请输入或扫描条形码"}),(0,v.jsx)(r.G7,{className:p()("iconfont","icon-saomiao",N.saomiao),onClick:function onClick(){!function handScan(){w().scanCode({success:function success(e){oe((function(n){return(0,a.Z)((0,a.Z)({},n),{},{orderNo:e.result})}))},fail:function fail(e){}})}()}})]})]}),(0,v.jsxs)(r.G7,{className:N.thirdBox,children:[(0,v.jsx)(r.G7,{className:N.thirdTopfont,children:"订单类型"}),(0,v.jsx)(r.G7,{className:N.flexModebox,children:ae.map((function(e,n){return(0,v.jsx)(r.G7,{onClick:function onClick(){!function handCheckMode(e){ae.map((function(n){return n.id===e.id?n.checked=!0:n.checked=!1,n})),ce((0,l.Z)(ae)),oe((function(n){return(0,a.Z)((0,a.Z)({},n),{},{sale_mode:e.id})}))}(e)},className:p()(e.checked?N.activemodeBox:N.modeBox),children:e.name},n)}))})]}),(0,v.jsxs)(r.G7,{className:N.thirdBox,children:[(0,v.jsx)(r.G7,{className:N.thirdTopfont,children:"发货方式"}),(0,v.jsx)(r.G7,{className:N.flexModebox,children:ue.map((function(e,n){return(0,v.jsx)(r.G7,{onClick:function onClick(){!function handCheckDelivery(e){ue.map((function(n){return n.id===e.id?n.checked=!0:n.checked=!1,n})),de((0,l.Z)(ue)),oe((function(n){return(0,a.Z)((0,a.Z)({},n),{},{shipment_mode:e.id})}))}(e)},className:p()(e.checked?N.activemodeBox:N.modeBox),children:e.name},n)}))})]}),(0,v.jsx)(r.G7,{children:_e}),(0,v.jsx)(r.G7,{style:{height:"160rpx"}}),(0,v.jsxs)(r.G7,{className:N.bottomBox,children:[(0,v.jsxs)(r.zx,{className:N.resetBox,onClick:function onClick(){!function handReset(){oe({purchaser_id:"",clientName:"",sale_user_id:"",saleuserName:"",orderNo:"",sale_mode:void 0,shipment_mode:void 0})}()},children:[" ","重置"]}),(0,v.jsxs)(r.zx,{className:p()(_e?N.button:N.activeButton),disabled:_e,onClick:function onClick(){null==me||me()},children:[" ","确认"]})]})]})}),(0,v.jsx)(Ne,{list:ye,obj:ke,showPopup:Ye,popupClose:function popupClose(){return Qe(!1)},clickItem:function clickItem(e){return function clickItem(e){"扫码支付"===e.name&&Ue(),ye.map((function(n){return e.id===n.id?n.checked=!0:n.checked=!1,n})),Se((0,l.Z)(ye))}(e)},handsurePay:function handsurePay(e){return function handsurePay(e){var n,o;if(!(n=ye.filter((function(e){return e.checked}))).length)return w().showToast({title:"请选择后再提交",icon:"error"}),!1;w().showModal({content:"确定交易吗?",confirmText:"确认",cancelText:"取消",success:(o=(0,c.Z)((0,i.Z)().mark((function _callee10(o){var t,l,a;return(0,i.Z)().wrap((function _callee10$(i){for(;;)switch(i.prev=i.next){case 0:if(!o.confirm){i.next=12;break}return w().showLoading({title:"请稍等...",mask:!0}),i.next=4,e.status;case 4:if(i.t0=i.sent,10===i.t0){i.next=9;break}i.t1=$e({id:Number(e.should_collect_order_id),payment_method:Number(null===(t=n[0])||void 0===t?void 0:t.id)}),i.next=10;break;case 9:i.t1=He({id:Number(e.pre_collect_order_id),payment_method:Number(null===(l=n[0])||void 0===l?void 0:l.id)});case 10:"success"===(null==(a=i.t1)?void 0:a.msg)?(w().showToast({title:"交易成功"}),w().hideLoading(),Qe(!1),C()):w().showToast({title:null==a?void 0:a.msg,icon:"error"});case 12:case"end":return i.stop()}}),_callee10)}))),function success(e){return o.apply(this,arguments)})})}(e)},showSide:Pe,title:Fe,picUrl:Me})]})}),"pages/order/index",{root:{cn:[]}},{navigationBarTitleText:"订单"}||{}))}},function(e){e.O(0,[107,216,592],(function(){return n=5767,e(e.s=n);var n}));e.O()}]); |