"use strict";(wx.webpackJsonp=wx.webpackJsonp||[]).push([[635],{1213:function(e,l,t){var o=t(2180),n=t(3433),i=t(4165),a=t(5861),s=t(9439),r=t(1515),d=t(2954),c=t.n(d),_=t(7294),u=t(1413),m="index-module__order_popup___WbtSD",x="index-module__order_popup_title___jH7rJ",f="index-module__order_popup_input___rjEMT",p="index-module__descDataNum___el1xm",h="index-module__order_save_address___fVLrC",v=t(5893),j=function Remark(e){var l=e.onBlur,t=e.onSave,o=e.defaultValue,n=void 0===o?"":o,i=(0,_.useState)({number:0,value:"",count:200}),a=(0,s.Z)(i,2),d=a[0],c=a[1],j=function getDesc(e){var l=e;e.length>d.count&&(l=e.slice(0,d.count)),c((0,u.Z)((0,u.Z)({},d),{},{number:l.length,value:l}))};return(0,_.useEffect)((function(){j(n)}),[n]),(0,v.jsxs)(r.G7,{className:m,children:[(0,v.jsx)(r.G7,{className:x,children:"编辑备注"}),(0,v.jsxs)(r.G7,{className:f,children:[(0,v.jsx)(r.gx,{placeholder:"请添加备注",value:null==d?void 0:d.value,maxlength:d.count,cursorSpacing:100,onInput:function onInput(e){return j(e.detail.value)},onBlur:function onBlur(e){return null==l?void 0:l(e)}}),(0,v.jsxs)(r.G7,{className:p,children:[d.number,"/",d.count]})]}),(0,v.jsx)(r.G7,{className:h,onClick:function onClick(){return function setSave(){null==t||t(d.value)}()},children:"保存"})]})},y={common_safe_area_y:"index-module__common_safe_area_y___jhKJF","flex-col":"index-module__flex-col___qrM4t","flex-row":"index-module__flex-row___qUVur","justify-between":"index-module__justify-between___XeJlV","justify-center":"index-module__justify-center___yxLN5","items-center":"index-module__items-center___HXovp","flex-item":"index-module__flex-item___PUT7y","full-100":"index-module__full-100___aF_b_","color-blue":"index-module__color-blue___BGTj3","color-yellow":"index-module__color-yellow___FdzaZ","color-green":"index-module__color-green___ixW04","color-grey":"index-module__color-grey___kCwBj","color-white":"index-module__color-white___rL2IG","s-w":"index-module__s-w___xnnGs","s-e":"index-module__s-e___J6inT",filter:"index-module__filter___P5trU",deliveryDetail:"index-module__deliveryDetail___Ko2wi",content:"index-module__content___Y4UJx",detailTop:"index-module__detailTop____JI0B",topBar__orderType:"index-module__topBar__orderType___Tw6hw",cellTitle:"index-module__cellTitle___oZCVD",bottomBar:"index-module__bottomBar___yTwSs",detailInfo:"index-module__detailInfo___COuNx","detailInfoItem--title":"index-module__detailInfoItem--title___P2kv4","detailInfoItem--detail":"index-module__detailInfoItem--detail___oZm3J","detailInfoItem--detail--row":"index-module__detailInfoItem--detail--row___y9NuP","detailInfoItem--detail--name":"index-module__detailInfoItem--detail--name___Y2HF6","detailInfoItem--detail--count":"index-module__detailInfoItem--detail--count___e4cSA","detailInfoItem--detail--weight":"index-module__detailInfoItem--detail--weight___QnwU9",orderInfoTop:"index-module__orderInfoTop___mzLc6",desc:"index-module__desc___Ykgew",orderNo:"index-module__orderNo___KO4wC",status:"index-module__status___dW_rX","status--takingGoods":"index-module__status--takingGoods___r0dpY","status--finished":"index-module__status--finished___xDucq",divider:"index-module__divider___F2trC",total:"index-module__total___BIkzc",totalContent:"index-module__totalContent___TiqAo"},g=t(1263),I=t(4812),N=t(3710),Z=t(2128),k=t(8260),w=t(9742),G=t(2213),C=t(2038),T=t(1115),b=t(5989),S=t(4547),D=t(6028),B=function TakeDeliveryDetail(){var e=(0,d.useRouter)(),l=(0,g.Yq)().fetchData,t=(0,_.useState)({}),o=(0,s.Z)(t,2),u=o[0],m=o[1],x=function(){var t=(0,a.Z)((0,i.Z)().mark((function _callee(){var t,o;return(0,i.Z)().wrap((function _callee$(n){for(;;)switch(n.prev=n.next){case 0:return t=e.params.id,n.next=3,l({id:t});case 3:o=n.sent,console.log("res==>",o.data),m(o.data),c().setNavigationBarTitle({title:o.data.take_goods_order_type_name});case 7:case"end":return n.stop()}}),_callee)})));return function getData(){return t.apply(this,arguments)}}();(0,_.useEffect)((function(){x()}),[]);var f=(0,_.useMemo)((function(){var e,l={};return null==u||null===(e=u.dyelot_number_list)||void 0===e||e.forEach((function(e){var t="".concat(e.product_code,"# ").concat(e.product_name);l.hasOwnProperty(t)?l[t].push(e):l[t]=[e]})),l}),[u]),p=function formatUnit(e){return e===S.p.Bulk?"条":"米"},h=(0,g.Bp)().fetchData,B=(0,_.useMemo)((function(){var e=Object.entries(f).map((function(e,l){var t,o,n,i=(0,s.Z)(e,2),a=i[0],d=i[1],c=0;return c=(null===(t=d[0])||void 0===t?void 0:t.sale_mode)===S.p.Bulk?d.reduce((function(e,l){return e+l.sale_roll}),0):d.reduce((function(e,l){return e+(0,I.N6)(l.sale_length)}),0),(0,v.jsxs)(r.G7,{className:y.detailInfo,children:[(0,v.jsx)(Z.Z,{direction:"horizontal",customClassName:y.divider}),(0,v.jsxs)(r.G7,{className:y.detailInfoItem,children:[(0,v.jsxs)(r.G7,{className:y["detailInfoItem--title"],children:[(0,v.jsxs)(r.G7,{className:"",children:[(0,v.jsx)(r.xv,{style:{marginRight:"20rpx"},children:a}),(0,v.jsx)(G.Z,{saleMode:null===(o=d[0])||void 0===o?void 0:o.sale_mode})]}),(0,v.jsxs)(r.G7,{className:"",children:["共 ",c," ",p(null===(n=d[0])||void 0===n?void 0:n.sale_mode)]})]}),(0,v.jsx)(r.G7,{className:y["detailInfoItem--detail"],children:null==d?void 0:d.map((function(e,l){return(0,v.jsxs)(r.G7,{className:y["detailInfoItem--detail--row"],children:[(0,v.jsxs)(r.G7,{className:y["detailInfoItem--detail--name"],children:[e.product_color_code,"# ",e.product_color_name]}),(0,v.jsxs)(r.G7,{className:y["detailInfoItem--detail--count"],children:["x",0===(null==e?void 0:e.sale_mode)?"".concat(e.sale_roll," 条"):"".concat((0,I.N6)((null==e?void 0:e.sale_length)||0)," 米")]}),(0,v.jsxs)(r.G7,{className:y["detailInfoItem--detail--weight"],children:[(0,I.$y)(e.weight),"kg"]})]},l)}))})]})]},l)}));return(0,v.jsx)(v.Fragment,{children:e})}),[u]),F=(0,_.useState)([]),z=(0,s.Z)(F,2),J=z[0],L=z[1],R=function handleUploadChange(e){console.log("imageList===>",e),L((function(l){return[].concat((0,n.Z)(l),(0,n.Z)(e))}))},M=(0,g.rT)().fetchData,O=(0,_.useState)(!1),P=(0,s.Z)(O,2),U=P[0],q=P[1],V=function(){var l=(0,a.Z)((0,i.Z)().mark((function _callee2(l){return(0,i.Z)().wrap((function _callee2$(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,M({id:Number(e.params.id),remark:l});case 2:t.sent.success?(T.Z9.success("拒收成功"),x()):T.Z9.error("该操作失败");case 4:case"end":return t.stop()}}),_callee2)})));return function handleRefuseOrder(e){return l.apply(this,arguments)}}(),$=function(){var e=(0,a.Z)((0,i.Z)().mark((function _callee3(e){return(0,i.Z)().wrap((function _callee3$(l){for(;;)switch(l.prev=l.next){case 0:V(e);case 1:case"end":return l.stop()}}),_callee3)})));return function onRemarkSave(l){return e.apply(this,arguments)}}(),Y=(0,_.useCallback)((function(){q(!0)}),[]),E=(0,_.useCallback)((function(){c().showModal({confirmColor:"#337FFF",title:"确定要提货?",success:function success(l){return(0,a.Z)((0,i.Z)().mark((function _callee4(){return(0,i.Z)().wrap((function _callee4$(t){for(;;)switch(t.prev=t.next){case 0:if(!l.confirm){t.next=5;break}return t.next=3,h({take_goods_order_id:[Number(e.params.id)]});case 3:t.sent.success?(T.Z9.success("提货成功"),x()):T.Z9.error("请求失败");case 5:case"end":return t.stop()}}),_callee4)})))()}})}),[J]),H=(0,_.useMemo)((function(){return 0!==(null==u?void 0:u.take_goods_order_type)?(0,v.jsx)(r.G7,{className:y.bottomBar,children:(0,v.jsx)(w.Z,{type:"primary",round:!0,onClick:E,customStyles:{width:"100%"},children:"确认提货"})}):(0,v.jsxs)(r.G7,{className:y.bottomBar,style:{justifyContent:"space-between"},children:[(0,v.jsx)(w.Z,{type:"primary",plain:!0,round:!0,onClick:Y,customStyles:{width:"25%"},children:"拒收"}),(0,v.jsx)(w.Z,{type:"primary",round:!0,onClick:E,customStyles:{width:"25%"},children:"确认提货"})]})}),[Y,E]);return(0,v.jsxs)(r.G7,{className:y.deliveryDetail,children:[(0,v.jsxs)(r.G7,{className:y.content,children:[(0,v.jsxs)(k.Z,{circle:!0,customStyle:{padding:"24rpx"},children:[(0,v.jsxs)(r.G7,{className:y.detailTop,children:[(0,v.jsxs)(r.G7,{className:y.orderNo,children:["提货单号:",null==u?void 0:u.take_order_no]}),0===(null==u?void 0:u.take_goods_status)?(0,v.jsx)(r.G7,{className:y["status--takingGoods"],children:null==u?void 0:u.take_goods_status_name}):(0,v.jsx)(r.G7,{className:y["status--finished"],children:null==u?void 0:u.take_goods_status_name})]}),0===(null==u?void 0:u.take_goods_order_type)&&(0,v.jsxs)(r.xv,{className:y.topBar__orderType,children:["供应信息:",null==u?void 0:u.supplier_name]}),B,(0,v.jsxs)(r.G7,{className:y.total,children:[(0,v.jsx)(r.xv,{children:"汇总:"}),(0,v.jsxs)(r.xv,{className:y.totalContent,children:["共",(null==u?void 0:u.product_count)||0,"种面料,",(null==u?void 0:u.product_color_count)||0,"种颜色,共",0===(null==u?void 0:u.sale_mode)?"".concat(null==u?void 0:u.take_roll,"条"):"".concat((0,I.N6)(null==u?void 0:u.take_meters).toLocaleString(),"米"),",重量",(0,I.$y)(null==u?void 0:u.total_take_weight).toLocaleString(),"kg"]})]})]}),0!==(null==u?void 0:u.take_goods_order_type)&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(k.Z,{circle:!0,customStyle:{padding:"24rpx"},children:[(0,v.jsx)(r.G7,{className:y.orderInfoTop,children:"退货布匹附件"}),(0,v.jsx)(Z.Z,{direction:"horizontal",customClassName:y.divider}),(0,v.jsx)(C.Z,{onlyRead:0!==(null==u?void 0:u.status),onChange:R,defaultList:null==u?void 0:u.fabric_piece_accessory_url})]}),(0,v.jsxs)(k.Z,{circle:!0,customStyle:{padding:"24rpx"},children:[(0,v.jsx)(r.G7,{className:y.orderInfoTop,children:"退货物流附件"}),(0,v.jsx)(Z.Z,{direction:"horizontal",customClassName:y.divider}),(0,v.jsx)(C.Z,{onlyRead:0!==(null==u?void 0:u.status),onChange:R,defaultList:null==u?void 0:u.accessory_url})]})]}),(0,v.jsxs)(k.Z,{circle:!0,customStyle:{padding:"24rpx"},children:[(0,v.jsx)(r.G7,{className:y.orderInfoTop,children:"订单信息"}),(0,v.jsx)(Z.Z,{direction:"horizontal",customClassName:y.divider}),(0,v.jsxs)(r.G7,{className:"orderInfoDetail",children:[(0,v.jsx)(N.Z,{title:"提货人:",desc:(null==u?void 0:u.auditor_name)||"暂无提货人"}),(0,v.jsx)(N.Z,{title:"创建时间:",desc:(0,I.o0)(null==u?void 0:u.create_time)||"暂无创建时间"}),(0,v.jsx)(N.Z,{title:"提货时间:",desc:(0,I.o0)(null==u?void 0:u.audit_time)||"暂无提货时间"})]})]}),(0,v.jsxs)(k.Z,{circle:!0,customStyle:{padding:"24rpx",paddingBottom:"8rpx",paddingTop:"8rpx"},children:[(null==u?void 0:u.delivery_notice_order_no)&&(0,v.jsx)(N.Z,{title:"发货订单",customTitleClassName:y.cellTitle,customDescClassName:y.desc,desc:(0,v.jsxs)(r.G7,{style:{display:"flex",alignItems:"center"},children:[(0,v.jsx)(r.G7,{style:{color:"#3980f8",marginRight:"10rpx"},children:null==u?void 0:u.delivery_notice_order_no}),(0,v.jsx)(D.Z,{name:"icon-chakanquanbukehu",size:46,color:"#3980f8"})]}),onClick:function handleClick(){(0,T.jD)("/pages/deliveryDetail/index",{id:u.delivery_notice_order_id})}}),!(null!=u&&u.delivery_notice_order_no)&&0===(null==u?void 0:u.collect_status)&&(0,v.jsx)(N.Z,{customTitleClassName:y.cellTitle,title:"发货订单",desc:"未付款不可发货"}),!(null!=u&&u.delivery_notice_order_no)&&2===(null==u?void 0:u.collect_status)&&(0,v.jsx)(N.Z,{customTitleClassName:y.cellTitle,title:"发货订单",desc:"未提其他商品"})]}),0!==(null==u?void 0:u.take_goods_order_type)&&(0,v.jsxs)(k.Z,{circle:!0,customStyle:{padding:"24rpx"},children:[(0,v.jsx)(r.G7,{className:y.orderInfoTop,children:"备注信息"}),(0,v.jsx)(Z.Z,{direction:"horizontal",customClassName:y.divider}),(0,v.jsx)(r.G7,{className:"orderInfoDetail",children:null==u?void 0:u.remark})]})]}),0===(null==u?void 0:u.take_goods_status)&&H,(0,v.jsx)(b.Z,{show:U,showTitle:!1,onClose:function onClose(){return q(!1)},children:(0,v.jsx)(j,{onSave:$,defaultValue:null==u?void 0:u.remark})})]})};Page((0,o.createPageConfig)(B,"pages/takeDeliveryDetail/index",{root:{cn:[]}},{navigationBarTitleText:"提货详情"}||{}))}},function(e){e.O(0,[2107,1216,8592],(function(){return l=1213,e(e.s=l);var l}));e.O()}]);