"use strict";(wx.webpackJsonp=wx.webpackJsonp||[]).push([[5521],{6722:function(e,n,l){var a=l(2180),o=l(4165),t=l(1413),r=l(5861),_=l(9439),s=l(1515),i=l(7294),c=l(7484),d=l.n(c),u=l(4184),m=l.n(u),x={common_safe_area_y:"index-module__common_safe_area_y___UB6t3","flex-col":"index-module__flex-col___tUp6c","flex-row":"index-module__flex-row___PR3FX","justify-between":"index-module__justify-between___jHhnD","justify-center":"index-module__justify-center___RZUJB","items-center":"index-module__items-center___iDVZm","flex-item":"index-module__flex-item___rHRYt","full-100":"index-module__full-100___i_pGD","color-blue":"index-module__color-blue___Y9lKb","color-yellow":"index-module__color-yellow___nJJzx","color-green":"index-module__color-green___qzWrs","color-grey":"index-module__color-grey___KfA37","color-white":"index-module__color-white___wOv3y","s-w":"index-module__s-w___kapCb","s-e":"index-module__s-e___VXmk4",filter:"index-module__filter___U45O5",main:"index-module__main___ZKLFi",topBox:"index-module__topBox___uOzLz",search_input:"index-module__search_input___ThPLq",menuBox:"index-module__menuBox___KJxtZ",totalFont:"index-module__totalFont___KDs5c",statusDialog:"index-module__statusDialog___EKNtD",title:"index-module__title___zzeIc",statusLine:"index-module__statusLine___f32tE",explanation:"index-module__explanation___GjrJz",explanation_status:"index-module__explanation_status___VUDXH",explanation_block:"index-module__explanation_block___zig01",explanation_text:"index-module__explanation_text___BbBTX",explanation_success:"index-module__explanation_success___zo4K8",explanation_fail:"index-module__explanation_fail___nW4H1",explanation_pending:"index-module__explanation_pending___grLNS",explanation_waiting:"index-module__explanation_waiting___r44m2",explanation_cancel:"index-module__explanation_cancel___kNBfU",order_list:"index-module__order_list___KU4qm"},p={common_safe_area_y:"index-module__common_safe_area_y___FENrA","flex-col":"index-module__flex-col___duF7u","flex-row":"index-module__flex-row___c0ESy","justify-between":"index-module__justify-between___Mr_2j","justify-center":"index-module__justify-center___IIvgH","items-center":"index-module__items-center___gDZwZ","flex-item":"index-module__flex-item___JiAmH","full-100":"index-module__full-100___TpBbX","color-blue":"index-module__color-blue___LhBHH","color-yellow":"index-module__color-yellow___PqCKA","color-green":"index-module__color-green___snOB_","color-grey":"index-module__color-grey___fvRDo","color-white":"index-module__color-white___w2RCE","s-w":"index-module__s-w___CTa5T","s-e":"index-module__s-e___q8L8s",filter:"index-module__filter___jorFj",process:"index-module__process___O7DkP",block:"index-module__block___FlJbg",waiting:"index-module__waiting___zi2oF",pending:"index-module__pending___Cn0NA",fail:"index-module__fail___O3h64",success:"index-module__success___j7ekO",cancel:"index-module__cancel____GxYg",col:"index-module__col___Yq6MV",subBlock:"index-module__subBlock___D0lVz",text:"index-module__text___FGKXp",text1:"index-module__text1___icaM2"},f=l(5893),h=function(e){return e.PENDING="pending",e.WAITING="waiting",e.SUCCESS="success",e.FAIL="fail",e.CANCAL="cancal",e}({}),N=function StatusLine(e){var n=e.line;return(0,f.jsx)(s.G7,{className:p.process,children:n.map((function(e){return e.children&&e.children.length>0?(0,f.jsx)(s.G7,{className:m()(p.block,p.col),children:e.children.map((function(e,n){return(0,f.jsx)(s.G7,{className:m()(p.block,(null==e?void 0:e.colorClassName)&&p[e.colorClassName],p.subBlock),children:e.showText&&(0,f.jsx)(s.xv,{className:m()(p.text,p["text".concat(n+1)]),children:e.typeName})},e.id)}))},e.id):(0,f.jsx)(s.G7,{className:m()(p.block,(null==e?void 0:e.colorClassName)&&p[e.colorClassName]),children:e.showText&&(0,f.jsx)(s.xv,{className:p.text,children:e.typeName})},e.id)}))})},C="index-module__totalSummary___KxNEC",g="index-module__gray___nwAkh",v="index-module__name___IpBvL",y="index-module__number___c3nQe",w="index-module__address___uswys",j="index-module__tag___dXnt1",S="index-module__title___BF7p1",G="index-module__status___LIEvO",Z="index-module__pending___shh8k",k="index-module__fail___gzkgx",I="index-module__success___aUWld",D="index-module__cancel___ChBq3",b="index-module__cancelColor___irMmm",T=l(8260),A=l(2128),Y=l(9579),E=l(6028),O=l(1115),B=[{id:1,order_warning_process:1,colorClassName:h.WAITING,type:h.WAITING,typeName:"开始"},{id:2,order_warning_process:2,colorClassName:h.WAITING,type:h.WAITING,typeName:"接单"},{id:3,order_warning_process:3,colorClassName:h.WAITING,type:h.WAITING,typeName:"配布"},{id:4,children:[{id:5,order_warning_process:4,colorClassName:h.WAITING,type:h.WAITING,typeName:"提货"},{id:6,order_warning_process:5,colorClassName:h.WAITING,type:h.WAITING,typeName:"收款"}]},{id:7,order_warning_process:6,colorClassName:h.WAITING,type:h.WAITING,typeName:"出仓"},{id:8,order_warning_process:7,colorClassName:h.WAITING,type:h.WAITING,typeName:"收货"}],U={"已完成":I,"有异常":Z,"超时完成":k,"已取消":D},W=function OrderItem(e){var n,l,a=e.data,o=function dispenseStatus(e,n){return"已取消"===n.handle_status_name?h.CANCAL:e.is_handle&&!e.is_timeout?h.SUCCESS:e.is_handle&&e.is_timeout?h.FAIL:!e.is_handle&&e.is_timeout?h.PENDING:h.WAITING},t=(0,i.useMemo)((function(){return JSON.parse(JSON.stringify(B)).map((function(e){if(e.children&&e.children.length>0)return e.children=e.children.map((function(e){var n,l=null==a||null===(n=a.order_process)||void 0===n?void 0:n.findIndex((function(n){return n.order_warning_process===e.order_warning_process}));if(-1!==(l=null==l?-1:l)){var t=null==a?void 0:a.order_process[l];return{id:e.id,order_warning_process:t.order_warning_process,colorClassName:o(t,a),type:o(t,a),typeName:t.order_warning_process_name}}return e})),e;var n,l=null==a||null===(n=a.order_process)||void 0===n?void 0:n.findIndex((function(n){return n.order_warning_process===e.order_warning_process}));if(-1!==(l=null==l?-1:l)){var t=null==a?void 0:a.order_process[l];return{id:e.id,order_warning_process:t.order_warning_process,colorClassName:o(t,a),type:o(t,a),typeName:t.order_warning_process_name}}return e}))}),[a]),r=function colorGray(){return"已取消"===(null==a?void 0:a.handle_status_name)?b:null};return(0,f.jsxs)(T.Z,{circle:!0,customClassName:"已取消"===(null==a?void 0:a.handle_status_name)?g:"",flexDirection:"col",customStyle:{padding:"20rpx 32rpx"},onClick:function handleClickDetail(){(0,O.jD)("/pages/orderWarningAnalysis/orderWarningAnalysisDetail/index",{id:a.sale_order_id})},children:[(0,f.jsxs)(s.G7,{className:"flex-row justify-between ",children:[(0,f.jsxs)(s.G7,{className:"flex-row items-center",children:[(0,f.jsx)(Y.Z,{circle:!0,customClassName:m()(j,U[null==a?void 0:a.handle_status_name]),type:"primary",size:"normal",children:null==a?void 0:a.handle_status_name}),(0,f.jsxs)(s.G7,{className:m()(S,"flex-1",r()),children:["单号:",null==a?void 0:a.sale_order_no]})]}),(0,f.jsx)(s.G7,{className:m()(G,r()),children:"已取消"===(null==a?void 0:a.handle_status_name)?"取消":null==a||null===(n=a.order_process)||void 0===n||null===(l=n[(null==a?void 0:a.order_process.length)-1])||void 0===l?void 0:l.order_warning_process_name})]}),(0,f.jsx)(A.Z,{direction:"horizontal",customStyles:{margin:"20rpx 0 10rpx 0 "}}),(0,f.jsxs)(s.G7,{className:m()("flex-row","items-center","justify-between",C),children:[(0,f.jsxs)(s.G7,{className:"flex-row items-center",children:[(0,f.jsx)(s.G7,{className:v,children:null==a?void 0:a.sale_user_name}),(0,f.jsx)(s.G7,{className:y,children:null==a?void 0:a.roll_or_length}),(0,f.jsx)(s.G7,{className:w,children:null==a?void 0:a.address})]}),(0,f.jsx)(E.Z,{name:"icon-chakanquanbukehu",size:38,color:"#5f5f5f"})]}),(0,f.jsx)(N,{line:t})]})},M="index-module__grid___i4Yl2",P=l(1263),F=l(2146),R=l(8221),z=[{id:1,code:"0",name:"进行中"},{id:2,code:"1",name:"有异常"},{id:3,code:"2",name:"已完成"},{id:4,code:"2",name:"已取消"},{id:5,code:"2",name:"超时完成"}],L=function SelectProcessingStatus(e,n){var l="处理状态",a=e.onChange,t=e.onCloseOverlay,c=e.defaultValue,d=void 0===c?-1:c;console.log(e);var u=(0,P.F_)().fetchData,m=(0,i.useState)([]),x=(0,_.Z)(m,2),p=x[0],h=x[1],N=function(){var e=(0,r.Z)((0,o.Z)().mark((function _callee(){return(0,o.Z)().wrap((function _callee$(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u();case 2:e.sent,h([{id:-1,code:"",name:"全部"}].concat(z));case 4:case"end":return e.stop()}}),_callee)})));return function getData(){return e.apply(this,arguments)}}();(0,i.useEffect)((function(){N()}),[]);var C=(0,i.useState)(d),g=(0,_.Z)(C,2),v=g[0],y=g[1],w=(0,i.useRef)(null);(0,i.useImperativeHandle)(n,(function(){return{show:w.current.show,showPopup:w.current.showPopup,closePopup:w.current.closePopup}}),[w.current]);var j=(0,i.useMemo)((function(){var e,n;return-1===v?l:p.length?null===(e=p.filter((function(e){return e.id===v})))||void 0===e||null===(n=e[0])||void 0===n?void 0:n.name:l}),[p,v]);return(0,f.jsx)(F.Z,{title:j,value:v,activeColor:"#337fff",ref:w,onCloseOverlay:t,children:(0,f.jsx)(s.G7,{className:M,children:!!p.length&&p.map((function(e,n){return(0,f.jsx)(R.Z,{circle:!0,isActive:e.id===v,onClick:function onClick(){return function handleClick(e){y(e),null==a||a(e)}(e.id)},children:e.name},n)}))})})},J=(0,i.memo)((0,i.forwardRef)(L)),K=l(1767),H=l(9335),q=l(2916),V=l(7227),X=l(3818),$=l(4262),Q=l(9742),ee=l(5436),ne="index-module__grid___ZZmYj",le=l(4547),ae=l(545),oe=[{id:le.p.Bulk,code:"0",name:ae.F[le.p.Bulk].title},{id:le.p.Plate,code:"1",name:ae.F[le.p.Plate].title},{id:le.p.BulkCut,code:"2",name:ae.F[le.p.BulkCut].title}],te=function SelectOrderType(e,n){var l="订单类型",a=e.onChange,t=e.onCloseOverlay;console.log(e);(0,P.F_)().fetchData;var c=(0,i.useState)([]),d=(0,_.Z)(c,2),u=d[0],m=d[1],x=function(){var e=(0,r.Z)((0,o.Z)().mark((function _callee(){return(0,o.Z)().wrap((function _callee$(e){for(;;)switch(e.prev=e.next){case 0:m([{id:-1,code:"",name:"全部"}].concat(oe));case 1:case"end":return e.stop()}}),_callee)})));return function getData(){return e.apply(this,arguments)}}();(0,i.useEffect)((function(){x()}),[]);var p=(0,i.useState)(-1),h=(0,_.Z)(p,2),N=h[0],C=h[1],g=(0,i.useRef)(null);(0,i.useImperativeHandle)(n,(function(){return{show:g.current.show,showPopup:g.current.showPopup,closePopup:g.current.closePopup}}),[g.current]);var v=(0,i.useMemo)((function(){var e,n;return-1===N?l:u.length?null===(e=u.filter((function(e){return e.id===N})))||void 0===e||null===(n=e[0])||void 0===n?void 0:n.name:l}),[u,N]);return(0,f.jsx)(F.Z,{title:v,value:N,activeColor:"#337fff",ref:g,onCloseOverlay:t,children:(0,f.jsx)(s.G7,{className:ne,children:!!u.length&&u.map((function(e,n){return(0,f.jsx)(R.Z,{circle:!0,isActive:e.id===N,onClick:function onClick(){return function handleClick(e){C(e),null==a||a(e)}(e.id)},children:e.name},n)}))})})},re=(0,i.memo)((0,i.forwardRef)(te)),_e={1:{name:"今天",date_min:"".concat(d()(new Date).add(-1,"day").format("YYYY-MM-DD")," 19:00:00"),date_max:"".concat(d()(new Date).format("YYYY-MM-DD")," 19:00:00")},2:{name:"昨日",date_min:"".concat(d()(new Date).add(-2,"day").format("YYYY-MM-DD")," 19:00:00"),date_max:"".concat(d()(new Date).add(-1,"day").format("YYYY-MM-DD")," 19:00:00")}},se=[{id:1,colorClassName:h.SUCCESS,type:h.SUCCESS,typeName:"开始",showText:!0},{id:2,colorClassName:h.SUCCESS,type:h.SUCCESS,typeName:"接单",showText:!0},{id:3,colorClassName:h.SUCCESS,type:h.SUCCESS,typeName:"配布",showText:!0},{id:4,children:[{id:5,colorClassName:h.SUCCESS,type:h.SUCCESS,typeName:"提货",showText:!0},{id:6,colorClassName:h.SUCCESS,type:h.SUCCESS,typeName:"收款",showText:!0}]},{id:7,colorClassName:h.SUCCESS,type:h.SUCCESS,typeName:"出仓",showText:!0},{id:8,colorClassName:h.SUCCESS,type:h.SUCCESS,typeName:"收货",showText:!0}],ie=function OrderWarningAnalysis(){var e,n=(0,ee.Z)(),l=n.fetchData,a=n.state,c=(0,i.useState)(!1),u=(0,_.Z)(c,2),p=u[0],h=u[1],C=function(){var e=(0,r.Z)((0,o.Z)().mark((function _callee(){var e;return(0,o.Z)().wrap((function _callee$(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,l((0,V.mB)(y));case 2:e=n.sent,k((function(n){var l,a;return(0,t.Z)((0,t.Z)({},n),{},{list:null===(l=e.data)||void 0===l?void 0:l.list,total:null===(a=e.data)||void 0===a?void 0:a.total})})),h(!1);case 5:case"end":return n.stop()}}),_callee)})));return function getData(){return e.apply(this,arguments)}}(),g=(0,i.useState)({order_start_time:_e[1].date_min,order_end_time:_e[1].date_max,sale_mode:"",handle_status:2}),v=(0,_.Z)(g,2),y=v[0],w=v[1],j=(0,i.useCallback)((function(e){console.log("value",e);var n=(0,_.Z)(e,2),l=n[0],a=n[1];l=d()(l).subtract(1).format("YYYY-MM-DD 19:00:00"),a=d()(a).format("YYYY-MM-DD 19:00:00");var o=d()(a).diff(d()(l),"days");if(console.log("diff",o),o>1)return O.Z9.none("日期范围不能超过1天");w((function(e){return(0,t.Z)((0,t.Z)({},e),{},{order_start_time:l,order_end_time:a})}))}),[]),S=(0,i.useState)({list:[],total:0}),G=(0,_.Z)(S,2),Z=G[0],k=G[1],I=(0,i.useMemo)((function(){return(0,V.rA)({list:Z.list,total:Z.list.length,status:a.loading})}),[Z,a]),D=function(){var e=(0,r.Z)((0,o.Z)().mark((function _callee2(){return(0,o.Z)().wrap((function _callee2$(e){for(;;)switch(e.prev=e.next){case 0:h(!0),w((function(e){return(0,t.Z)({},e)}));case 2:case"end":return e.stop()}}),_callee2)})));return function getRefresherRefresh(){return e.apply(this,arguments)}}();(0,i.useEffect)((function(){C()}),[y]);var b=(0,i.useState)(!1),T=(0,_.Z)(b,2),A=T[0],Y=T[1],E=function handleShowTips(e){Y(e)},B=(0,i.useRef)(null),U=(0,i.useRef)(null),M=(0,i.useRef)(null);return(0,f.jsxs)(s.G7,{className:x.main,children:[(0,f.jsx)(s.G7,{className:x.topBox,children:(0,f.jsx)(s.G7,{className:x.menuBox,children:(0,f.jsxs)(K.Z,{children:[(0,f.jsx)(re,{ref:M,onChange:function onChangeOrderType(e){w((function(n){return(0,t.Z)((0,t.Z)({},n),{},{sale_mode:-1===e?"":e})}))},onCloseOverlay:function onCloseOverlay(){return!0}}),(0,f.jsx)(J,{defaultValue:y.handle_status,ref:U,onChange:function onChangeStatus(e){w((function(n){return(0,t.Z)((0,t.Z)({},n),{},{handle_status:-1===e?"":e})}))},onCloseOverlay:function onCloseOverlay(){return!0}}),(0,f.jsx)(q.Z,{ref:B,defaultValue:1,onChange:j,onCloseOverlay:function onCloseOverlay(){return!0},timeOptions:_e})]})})}),(0,f.jsxs)(s.G7,{className:x.totalFont,children:[(0,f.jsx)(s.G7,{onClick:E,children:(0,f.jsx)(X.Z,{direction:"right",iconName:"icon-tishi1",iconSize:30,color:"#aeaeae",svg:!0,text:"预警说明"})}),(0,f.jsxs)(s.xv,{children:["共 ",(null==Z?void 0:Z.total)||0," 单"]})]}),(0,f.jsx)(s.G7,{className:x.order_list,children:(0,f.jsx)(H.Z,{statusMore:I,refresherEnabled:!0,refresherTriggered:p,selfOnRefresherRefresh:D,children:null==Z||null===(e=Z.list)||void 0===e?void 0:e.map((function(e,n){return(0,f.jsx)(W,{data:e},n)}))})}),(0,f.jsx)($.Z,{show:A,onChange:E,children:(0,f.jsxs)(s.G7,{className:m()(x.statusDialog),children:[(0,f.jsx)(s.G7,{className:x.title,children:"进度条信息"}),(0,f.jsx)(s.G7,{className:x.statusLine,children:(0,f.jsx)(N,{line:se})}),(0,f.jsxs)(s.G7,{className:x.explanation,children:[(0,f.jsxs)(s.G7,{className:x.explanation_block,children:[(0,f.jsx)(s.G7,{className:m()(x.explanation_status,x.explanation_waiting)}),(0,f.jsx)(s.G7,{className:x.explanation_text,children:"待进行"})]}),(0,f.jsxs)(s.G7,{className:x.explanation_block,children:[(0,f.jsx)(s.G7,{className:m()(x.explanation_status,x.explanation_success)}),(0,f.jsx)(s.G7,{className:x.explanation_text,children:"正常进行"})]}),(0,f.jsxs)(s.G7,{className:x.explanation_block,children:[(0,f.jsx)(s.G7,{className:m()(x.explanation_status,x.explanation_fail)}),(0,f.jsx)(s.G7,{className:x.explanation_text,children:"超时完成"})]}),(0,f.jsxs)(s.G7,{className:x.explanation_block,children:[(0,f.jsx)(s.G7,{className:m()(x.explanation_status,x.explanation_pending)}),(0,f.jsx)(s.G7,{className:x.explanation_text,children:"进行中异常"})]}),(0,f.jsxs)(s.G7,{className:x.explanation_block,children:[(0,f.jsx)(s.G7,{className:m()(x.explanation_status,x.explanation_cancel)}),(0,f.jsx)(s.G7,{className:x.explanation_text,children:"已取消"})]})]}),(0,f.jsx)(Q.Z,{circle:!0,type:"primary",customClassName:x.btn,onClick:function handleConfirm(){Y(!1)},children:"确认"})]})})]})};Page((0,a.createPageConfig)(ie,"pages/orderWarningAnalysis/index",{root:{cn:[]}},{navigationBarTitleText:"订单预警分析",enablePullDownRefresh:!0,backgroundTextStyle:"dark"}||{}))}},function(e){e.O(0,[2107,1216,8592],(function(){return n=6722,e(e.s=n);var n}));e.O()}]);