1 line
15 KiB
JavaScript
1 line
15 KiB
JavaScript
"use strict";(wx.webpackJsonp=wx.webpackJsonp||[]).push([[4772],{434:function(e,t,n){var o=n(2180),l=n(4165),_=n(5861),a=n(1413),r=n(9439),i=n(1515),s=n(2954),c=n.n(s),d=n(7294),u=n(4184),m=n.n(u),f={common_safe_area_y:"index-module__common_safe_area_y___xiMJo","flex-col":"index-module__flex-col___jkqqo","flex-row":"index-module__flex-row___y8c32","justify-between":"index-module__justify-between___tebQ9","justify-center":"index-module__justify-center___Aswer","items-center":"index-module__items-center___B2MPa","flex-item":"index-module__flex-item___qi4LC","full-100":"index-module__full-100___lxNtK","color-blue":"index-module__color-blue___yN4wg","color-yellow":"index-module__color-yellow___SudMW","color-green":"index-module__color-green___ZK4F9","color-grey":"index-module__color-grey___Evh93","color-white":"index-module__color-white___M_sPV","s-w":"index-module__s-w___gZZx9","s-e":"index-module__s-e___uM1tT",filter:"index-module__filter___jtW5K",delivery:"index-module__delivery___HXkTc",searchBox:"index-module__searchBox___xVF1b",listBox:"index-module__listBox___BVJbc","listBox--total":"index-module__listBox--total___q5pHo",scanHandler:"index-module__scanHandler___r8fJ2",icon__filter:"index-module__icon__filter___KY5Bo",active:"index-module__active___Lx13M"},x={common_safe_area_y:"index-module__common_safe_area_y___pPqVA","flex-col":"index-module__flex-col___bKyWk","flex-row":"index-module__flex-row___K9Bf7","justify-between":"index-module__justify-between___kZXu0","justify-center":"index-module__justify-center___oh2D4","items-center":"index-module__items-center___YyBqX","flex-item":"index-module__flex-item___vMrMU","full-100":"index-module__full-100___xUMgN","color-blue":"index-module__color-blue___SHa6_","color-yellow":"index-module__color-yellow___rJVpV","color-green":"index-module__color-green___Nwvwi","color-grey":"index-module__color-grey____BShU","color-white":"index-module__color-white___j49WJ","s-w":"index-module__s-w___DFdj_","s-e":"index-module__s-e___rW1bk",filter:"index-module__filter___oUWV6",layoutBlock:"index-module__layoutBlock___dIGLr",topBar:"index-module__topBar___YOzjS",topBar__orderNo:"index-module__topBar__orderNo___kKOVQ",orderNo:"index-module__orderNo___RRArE",topBar__orderType:"index-module__topBar__orderType___tR2ns",topBar__orderStatus:"index-module__topBar__orderStatus___CvTsW","topBar__orderStatus--toBeAudited":"index-module__topBar__orderStatus--toBeAudited___pBTnT","topBar__orderStatus--finish":"index-module__topBar__orderStatus--finish___vDWCd",content__row:"index-module__content__row___qeQgP",content__row__left:"index-module__content__row__left___KTRcP",content__row__right:"index-module__content__row__right___sECmt",bottomBar:"index-module__bottomBar___XZRP2",bottomBar__button:"index-module__bottomBar__button___f564i",bord:"index-module__bord___AMTo7",tag:"index-module__tag___JUTDo"},h=n(8260),v=n(2128),p=n(9742),y=n(4547),g=n(4812),w=n(1115),Z=n(2213),j=n(935),D=n(5893),B=function ItemList(e){var t=e.itemData,n=e.onSuccess,o=function handleDetail(e){null==e||e.stopPropagation(),(0,w.jD)("/pages/deliveryDetail/index",{id:t.id})},a=(0,j.lo)().fetchData,r=function(){var e=(0,_.Z)((0,l.Z)().mark((function _callee(e){return(0,l.Z)().wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:return e.stopPropagation(),o.next=3,a({sale_order_id:t.sale_order_id});case 3:o.sent.success?(c().showToast({title:"出仓成功",icon:"success"}),null==n||n()):c().showToast({title:"出仓失败",icon:"error"});case 5:case"end":return o.stop()}}),_callee)})));return function handleTakeOutOfStorage(t){return e.apply(this,arguments)}}();return(0,D.jsxs)(h.Z,{circle:!0,customClassName:x.layoutBlock,onClick:o,children:[(0,D.jsxs)(i.G7,{className:x.topBar,children:[(0,D.jsxs)(i.G7,{className:x.topBar__orderNo,children:[(0,D.jsxs)(i.G7,{className:x.orderNo,children:["单号:",null==t?void 0:t.order_no]}),1===(null==t?void 0:t.status)&&(0,D.jsx)(i.G7,{className:m()(x.topBar__orderStatus,x["topBar__orderStatus--finish"]),children:"已审核"}),0===(null==t?void 0:t.status)&&(0,D.jsx)(i.G7,{className:m()(x.topBar__orderStatus,x["topBar__orderStatus--toBeAudited"]),children:"待审核"})]}),(0,D.jsx)(i.xv,{className:x.topBar__orderType,children:null==t?void 0:t.type_name})]}),(0,D.jsx)(v.Z,{direction:"horizontal",customStyles:{margin:"20rpx 0 10rpx 0"}}),(0,D.jsxs)(i.G7,{className:x.content,children:[(0,D.jsxs)(i.G7,{className:m()(x.content__row,x.bord),children:[(0,D.jsx)(i.G7,{className:x.content__row__left,children:"货品信息:"}),(0,D.jsxs)(i.G7,{className:x.content__row__right,children:[(0,D.jsx)(Z.Z,{saleMode:t.sale_mode,size:"small",customClassName:x.tag}),t.delivery_product_nums,"种面料,",t.delivery_product_color_nums,"种颜色,共",(null==t?void 0:t.sale_mode)===y.p.Bulk?"".concat(null==t?void 0:t.delivery_roll,"条"):"".concat((0,g.N6)(null==t?void 0:t.delivery_length),"米")]})]}),(0,D.jsxs)(i.G7,{className:x.content__row,children:[(0,D.jsx)(i.G7,{className:x.content__row__left,children:"发货地址:"}),(0,D.jsx)(i.G7,{className:x.content__row__right,children:(null==t?void 0:t.delivery_address)||"空"})]}),(0,D.jsxs)(i.G7,{className:x.content__row,children:[(0,D.jsx)(i.G7,{className:x.content__row__left,children:"创建时间:"}),(0,D.jsx)(i.G7,{className:x.content__row__right,children:(0,g.o0)(null==t?void 0:t.create_time)||"空"})]})]}),(0,D.jsxs)(i.G7,{className:x.bottomBar,children:[!(null!=t&&t.is_outbound)&&(0,D.jsx)(p.Z,{customClassName:x.bottomBar__button,plain:!0,type:"info",customStyles:{color:"#636363",borderColor:"#c8c8c8"},round:!0,onClick:r,children:"确认出仓"}),1!==(null==t?void 0:t.status)&&(0,D.jsx)(p.Z,{customClassName:x.bottomBar__button,type:"primary",round:!0,onClick:o,children:"确认送达"})]})]})},N=n(2437),S=n(1263),C=function DeliveryStatusList(e){var t=e.onChangeStatus,n=(0,S.Yd)().fetchData,o=(0,d.useState)([]),a=(0,r.Z)(o,2),i=a[0],s=a[1],c=(0,d.useState)(0),u=(0,r.Z)(c,2),m=u[0],f=u[1],x=function(){var e=(0,_.Z)((0,l.Z)().mark((function _callee(){var e,t;return(0,l.Z)().wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,n();case 2:e=o.sent,console.log(e.data.list),t=e.data.list.filter((function(e){return 3===e.id||4===e.id})),s(t),f(t[0].id);case 7:case"end":return o.stop()}}),_callee)})));return function getDeliveryStatusList(){return e.apply(this,arguments)}}();(0,d.useEffect)((function(){x()}),[]);var h=(0,d.useCallback)((function(e){t&&t({id:e.id,name:e.name})}),[t]);return(0,D.jsx)(N.Z,{list:i,onSelect:h,defaultId:m})},Y=(0,d.memo)(C),b=n(7484),k=n.n(b),M="index-module__filterItem___eioJ5",G="index-module__filterItem--title___u7Qt5",T="index-module__filterItem--wrapper___Nt2Fi",K="index-module__filter--time___ESP3b",R="index-module__filter--type___wsy_C",A="index-module__filterTimeButton___PitZf",P="index-module__filterButton___Kuys8",z="index-module__filterButton--text___oyByO",V="index-module__filterButton--active___vDZQm",E="index-module__filterController___VsQ8E",F="index-module__btn___DV1vi",O="index-module__rest_btn___NXqQ9",q="index-module__verify_btn___WuSns",J=n(6028),L=function FilterButton(e){var t=e.onClick,n=e.children,o=e.isActive,l=void 0!==o&&o,_=e.customClassName;return(0,D.jsx)(i.G7,{className:m()(P,l&&V,_),onClick:function handleClick(){null==t||t()},children:(0,D.jsx)(i.G7,{className:m()(z),children:n})})},W=function DeliveryFilter(e){var t={0:{name:"不限",date_min:void 0,date_max:void 0},1:{name:"今天",date_min:"".concat(k()(new Date).add(0,"day").format("YYYY-MM-DD")," 00:00:00"),date_max:"".concat(k()(new Date).add(1,"day").format("YYYY-MM-DD")," 00:00:00")},2:{name:"昨日",date_min:"".concat(k()(new Date).add(-1,"day").format("YYYY-MM-DD")," 00:00:00"),date_max:"".concat(k()(new Date).add(0,"day").format("YYYY-MM-DD")," 00:00:00")},3:{name:"近7日",date_min:"".concat(k()(new Date).add(-7,"day").format("YYYY-MM-DD")," 00:00:00"),date_max:"".concat(k()(new Date).add(0,"day").format("YYYY-MM-DD")," 00:00:00")},4:{name:"近30日",date_min:"".concat(k()(new Date).add(-30,"day").format("YYYY-MM-DD")," 00:00:00"),date_max:"".concat(k()(new Date).add(0,"day").format("YYYY-MM-DD")," 00:00:00")},5:{name:"近90日",date_min:"".concat(k()(new Date).add(-90,"day").format("YYYY-MM-DD")," 00:00:00"),date_max:"".concat(k()(new Date).add(0,"day").format("YYYY-MM-DD")," 00:00:00")}},n=e.onSearchTime,o=e.onConfirm,s=(e.onCancal,e.onReset),c=(0,S.d3)(),u=c.fetchData,f=c.state,x=(0,d.useState)({type:void 0,timeKey:"0"}),h=(0,r.Z)(x,2),v=h[0],y=h[1],g=function handleSelectedType(e){console.log("type==>",e),y("string"==typeof e&&"default"===e?function(e){return(0,a.Z)((0,a.Z)({},e),{},{type:void 0})}:function(t){return(0,a.Z)((0,a.Z)({},t),{},{type:e})})},w=(0,d.useMemo)((function(){return f.data.list}),[f]),Z=function(){var e=(0,_.Z)((0,l.Z)().mark((function _callee(){return(0,l.Z)().wrap((function _callee$(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u();case 2:case"end":return e.stop()}}),_callee)})));return function getEnumData(){return e.apply(this,arguments)}}();(0,d.useEffect)((function(){null!=w&&w.length||(Z(),console.log("getEnumData"))}),[w]);var j=(0,d.useState)({date_min:void 0,date_max:void 0}),B=(0,r.Z)(j,2),N=B[0],C=B[1],Y=function handleSelectedTime(e){y((function(t){return(0,a.Z)((0,a.Z)({},t),{},{timeKey:e})})),"6"===e?null==n||n():C({date_min:t[e].date_min,date_max:t[e].date_max})};return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(i.G7,{className:M,children:[(0,D.jsx)(i.G7,{className:G,children:"发货类型"}),(0,D.jsxs)(i.G7,{className:m()(T,R),children:[(0,D.jsx)(L,{isActive:null==v.type,onClick:function onClick(){return g("default")},children:"不限"}),!(null==w||!w.length)&&(null==w?void 0:w.map((function(e,t){return(0,D.jsx)(L,{isActive:v.type===(null==e?void 0:e.id),onClick:function onClick(){return g(null==e?void 0:e.id)},children:e.name},t)})))]})]}),(0,D.jsxs)(i.G7,{className:M,children:[(0,D.jsx)(i.G7,{className:G,children:"查询日期"}),(0,D.jsxs)(i.G7,{className:m()(T,K),children:[Object.entries(t).map((function(e,t){var n=(0,r.Z)(e,2),o=n[0],l=n[1];return(0,D.jsx)(L,{isActive:v.timeKey===o,onClick:function onClick(){return Y(o)},children:l.name},t)})),(0,D.jsxs)(L,{isActive:"6"===v.timeKey,customClassName:A,onClick:function onClick(){return Y("6")},children:["自定义时间",(0,D.jsx)(J.Z,{name:"icon-chakanquanbukehu",size:40,color:"6"===v.timeKey?"#4581ff":"#909090"})]})]})]}),(0,D.jsxs)(i.G7,{className:E,children:[(0,D.jsx)(p.Z,{plain:!0,type:"primary",round:!0,customClassName:m()(F,O),onClick:function handleReset(){y({type:void 0,timeKey:"0"}),null==s||s()},children:"重置"}),(0,D.jsx)(p.Z,{type:"primary",round:!0,customClassName:m()(F,q),onClick:function handleConfirm(){var e={type:v.type,date_min:N.date_min,date_max:N.date_max};console.log("changedField==>",e),null==o||o(e,v.timeKey)},children:"确认"})]})]})},I=(0,d.memo)(W),Q=n(4489),H=n(9335),U=n(7227),X=n(3818),$=n(5989),ee=n(4558),te={delivery_notice_order_status:0,page:1,size:10},ne=function Delivery(){var e=(0,d.useState)(te),t=(0,r.Z)(e,2),n=t[0],o=t[1],s=(0,d.useState)({list:[],total:0}),u=(0,r.Z)(s,2),x=u[0],h=u[1],v=(0,d.useMemo)((function(){return console.log("search",n),null!=n.type||null!=n.date_max||null!=n.date_min}),[n]),p=(0,S.LO)(),y=p.fetchData,g=p.state,Z=(0,d.useMemo)((function(){return(0,U.rA)({list:x.list,total:x.total,status:g.loading})}),[x,g]),j=(0,d.useCallback)((0,U.Ds)((function(e){o((function(t){return(0,a.Z)((0,a.Z)({},t),{},{delivery_notice_order_no:e})})),console.log("searchValue==>",e)}),300),[]),N=(0,d.useRef)({size:n.size,page:n.page}),C=(0,d.useCallback)((function(){if(x.list.length<x.total){N.current.page++;var e=N.current.size*N.current.page;o((function(t){return(0,a.Z)((0,a.Z)({},t),{},{size:e})})),console.log(n,11111)}}),[x]),b=(0,d.useState)(!1),k=(0,r.Z)(b,2),M=k[0],G=k[1],T=function(){var e=(0,_.Z)((0,l.Z)().mark((function _callee(){return(0,l.Z)().wrap((function _callee$(e){for(;;)switch(e.prev=e.next){case 0:N.current.page=1,G(!0),o((function(e){return(0,a.Z)((0,a.Z)({},e),{},{size:10})}));case 3:case"end":return e.stop()}}),_callee)})));return function getRefresherRefresh(){return e.apply(this,arguments)}}(),K=function(){var e=(0,_.Z)((0,l.Z)().mark((function _callee2(){var e,t,o,_,r;return(0,l.Z)().wrap((function _callee2$(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,y((0,a.Z)({},(0,U.mB)(n)));case 2:e=l.sent,h((function(t){var n,o;return(0,a.Z)((0,a.Z)({},t),{},{list:null===(n=e.data)||void 0===n?void 0:n.list,total:null===(o=e.data)||void 0===o?void 0:o.total})})),me.current&&(1===(null===(t=e.data)||void 0===t||null===(o=t.list)||void 0===o?void 0:o.length)&&(0,w.jD)("/pages/deliveryDetail/index",{id:null===(_=e.data)||void 0===_?void 0:_.list[0].id,order_no:null===(r=e.data)||void 0===r?void 0:r.list[0].order_no}),me.current=!1),G((function(){return!1}));case 6:case"end":return l.stop()}}),_callee2)})));return function getData(){return e.apply(this,arguments)}}(),R=(0,d.useState)("待发货"),A=(0,r.Z)(R,2),P=A[0],z=A[1],V=function handleAuditSuccess(){K()},E=(0,d.useState)(!1),F=(0,r.Z)(E,2),O=F[0],q=F[1],L=function handlePopupClose(){q(!1)},W=(0,d.useState)(!1),ne=(0,r.Z)(W,2),oe=ne[0],le=ne[1],_e=(0,d.useState)((new Date).toLocaleDateString()),ae=(0,r.Z)(_e,2),re=ae[0],ie=ae[1],se=(0,d.useState)(""),ce=(0,r.Z)(se,2),de=ce[0],ue=ce[1],me=(0,d.useRef)(!1);return(0,d.useEffect)((function(){K()}),[n]),(0,D.jsxs)(i.G7,{className:f.delivery,children:[(0,D.jsx)(i.G7,{className:f.searchBox,children:(0,D.jsx)(Q.Z,{placeholder:"请输入或扫描条形码",showBtn:!1,changeOnSearch:j,customRightSlot:function scanIcon(){return(0,D.jsx)(i.G7,{onClick:function handleScan(){c().scanCode({success:function success(e){console.log(e,"22222"),me.current=!0,o((function(t){return{page:t.page,size:t.size,delivery_notice_order_no:e.result}}))},fail:function fail(e){console.log(e)}})},className:f.scanHandler,children:(0,D.jsx)(J.Z,{name:"icon-saomiao",size:40})})}(),defaultValue:n.delivery_notice_order_no,children:(0,D.jsx)(i.G7,{onClick:function onShowFilter(){q(!0)},className:m()(f.icon__filter,v?f.active:""),children:(0,D.jsx)(X.Z,{svg:!0,iconName:"icon-shaixuan",text:"筛选",color:v?"#337fff":"#333",customClass:f["icon--filter"]})})})}),(0,D.jsx)(Y,{onChangeStatus:function handleChangeStatus(e){var t=e.id,n=e.name,l=0;3===t?l=0:4===t&&(l="1,2"),z(n),console.log("handleChangeStatus"),o((function(e){return(0,a.Z)((0,a.Z)({},e),{},{delivery_notice_order_status:l})}))}}),(0,D.jsx)(i.G7,{className:f.listBox,children:(0,D.jsxs)(H.Z,{statusMore:Z,selfonScrollToLower:C,refresherEnabled:!0,refresherTriggered:M,selfOnRefresherRefresh:T,children:[(0,D.jsxs)(i.xv,{className:f["listBox--total"],children:[P,"共 ",x.total," 单"]}),x.list.map((function(e){return(0,D.jsx)(B,{itemData:e,onSuccess:V},e.id)}))]})}),(0,D.jsx)($.Z,{show:O,title:"筛选列表",onClose:L,children:(0,D.jsx)(I,{onSearchTime:function handleSearchTime(){le(!0)},onConfirm:function handleConfirm(e,t){console.log("changedFields==>changedFields",e),o("6"===t?function(t){return(0,a.Z)((0,a.Z)((0,a.Z)({},t),e),{},{date_min:re,date_max:de})}:function(t){return(0,a.Z)((0,a.Z)({},t),e)}),L()},onReset:function handleReset(){o(te)}})}),(0,D.jsx)(ee.Z,{start:re,end:de,showTime:oe,closePopup:function handClose(){le(!1)},onSelectDate:function onSelectDate(e){return function handTime(e){var t,o;console.log(null==e?void 0:e.value,"event?.value?.start"),ie(null==e||null===(t=e.value)||void 0===t?void 0:t.start),ue(null==e||null===(o=e.value)||void 0===o?void 0:o.end),le(!1),console.log(n,8888)}(e)}})]})};Page((0,o.createPageConfig)(ne,"pages/delivery/index",{root:{cn:[]}},{navigationBarTitleText:"发货列表"}||{}))}},function(e){e.O(0,[2107,1216,8592],(function(){return t=434,e(e.s=t);var t}));e.O()}]); |