1 line
9.5 KiB
JavaScript
1 line
9.5 KiB
JavaScript
"use strict";require("./sub-common/f97e90c355a4ac0e7c8adaf0d0cd2639.js");require("./sub-common/cec1d189f23439aac313e907e3419e4b.js");require("./sub-common/77c6c00ee9ac4bfa87e3885cb3a9f4ce.js");require("./sub-common/13c349ec6fe97c02f07716d358f66d11.js");require("./sub-common/b14021f24a99c16a41f3ddce1a2c0358.js");require("./sub-common/a2adaa4f70b80326c7400ed443cd7103.js");require("./sub-common/1da759392e78d572495498b53bc4e2a9.js");(wx.webpackJsonp=wx.webpackJsonp||[]).push([[1183],{2916:function(e,t,n){var l=n(2180),o=n(3433),a=n(4165),i=n(5861),r=n(9439),s=n(1515),d=n(2954),c=n.n(d),_=n(7294),u={common_safe_area_y:"index-module__common_safe_area_y___htZtu","flex-col":"index-module__flex-col___cXJA0","flex-row":"index-module__flex-row___u5tTg","justify-between":"index-module__justify-between___T_iHW","justify-center":"index-module__justify-center___mts4D","items-center":"index-module__items-center___VWJP5","flex-item":"index-module__flex-item___gBznn","full-100":"index-module__full-100___JLSam","color-blue":"index-module__color-blue___ig07T","color-yellow":"index-module__color-yellow___rKNiE","color-green":"index-module__color-green___jSjSZ","color-grey":"index-module__color-grey___sF5FU","color-white":"index-module__color-white___K6CSc","s-w":"index-module__s-w___pfEow","s-e":"index-module__s-e___RUgpU",filter:"index-module__filter___ygxOu",deliveryDetail:"index-module__deliveryDetail___LgWBB",content:"index-module__content___fEVXG",detailTop:"index-module__detailTop___JntJA",bottomBar:"index-module__bottomBar___YsZ49",detailInfo:"index-module__detailInfo___O6yWD","detailInfoItem--title":"index-module__detailInfoItem--title___OTBUW","detailInfoItem--detail":"index-module__detailInfoItem--detail___IRtTl","detailInfoItem--detail--row":"index-module__detailInfoItem--detail--row___LvOM6","detailInfoItem--detail--name":"index-module__detailInfoItem--detail--name___QICav","detailInfoItem--detail--count":"index-module__detailInfoItem--detail--count___NJNEP","detailInfoItem--detail--weight":"index-module__detailInfoItem--detail--weight___JnoWg",orderInfoTop:"index-module__orderInfoTop____gPsf",orderNo:"index-module__orderNo___F8j3w",status:"index-module__status___z8NIx","status--toBeAudit":"index-module__status--toBeAudit___eelMQ","status--audited":"index-module__status--audited___EzW0k",divider:"index-module__divider___qffav",total:"index-module__total___lfAzN",totalContent:"index-module__totalContent___ks6S_"},m=n(1263),x=n(4812),f=n(4356),p=n(2128),h=n(8260),v=n(9742),j=n(2213),g=n(3416),I=n(1115),w=n(935),y=n(4547),N=n(5893),Z=function DeliveryDetail(){(0,d.usePullDownRefresh)((function(){G()}));var e=(0,d.useRouter)(),t=(0,m.GH)().fetchData,n=(0,w.lo)().fetchData,l=(0,_.useState)({}),Z=(0,r.Z)(l,2),b=Z[0],k=Z[1],G=function(){var n=(0,i.Z)((0,a.Z)().mark((function _callee(){var n,l;return(0,a.Z)().wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:return n=e.params.id,o.next=3,t({id:n});case 3:l=o.sent,console.log("res==>",l.data),k(l.data),c().stopPullDownRefresh();case 7:case"end":return o.stop()}}),_callee)})));return function getData(){return n.apply(this,arguments)}}();(0,_.useLayoutEffect)((function(){G()}),[]);var C=(0,m.Xt)().fetchData,T=(0,m.pu)().fetchData,D=(0,_.useState)([]),S=(0,r.Z)(D,2),B=S[0],P=S[1],O=(0,_.useCallback)((0,i.Z)((0,a.Z)().mark((function _callee2(){return(0,a.Z)().wrap((function _callee2$(t){for(;;)switch(t.prev=t.next){case 0:if(B.length){t.next=2;break}return t.abrupt("return",Promise.reject(new Error("请先上传附件")));case 2:return console.log("readyToUploadList:::",B),t.next=5,C({id:Number(e.params.id),delivery_appendix:B});case 5:if(!t.sent.success){t.next=10;break}return t.abrupt("return",Promise.resolve());case 10:return t.abrupt("return",Promise.reject(new Error("上传失败")));case 11:case"end":return t.stop()}}),_callee2)}))),[B]),E=(0,_.useCallback)((function(){c().showModal({confirmColor:"#337FFF",title:"确定审核?",success:function success(t){return(0,i.Z)((0,a.Z)().mark((function _callee3(){var n;return(0,a.Z)().wrap((function _callee3$(l){for(;;)switch(l.prev=l.next){case 0:if(!t.confirm){l.next=18;break}return l.prev=1,l.next=4,O();case 4:l.next=12;break;case 6:return l.prev=6,l.t0=l.catch(1),l.t0.name="",console.log("e",l.t0.toString()),I.Z9.error(l.t0.toString()),l.abrupt("return");case 12:return l.next=14,T({id:Number(e.params.id)});case 14:(n=l.sent).success?(I.Z9.success("审核成功"),G()):I.Z9.none(n.msg),l.next=19;break;case 18:t.cancel&&console.log("用户点击取消");case 19:case"end":return l.stop()}}),_callee3,null,[[1,6]])})))()}})}),[B]),J=function(){var e=(0,i.Z)((0,a.Z)().mark((function _callee4(){return(0,a.Z)().wrap((function _callee4$(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n({sale_order_id:b.sale_order_id});case 2:e.sent.success?(c().showToast({title:"出仓成功",icon:"success"}),G()):c().showToast({title:"出仓失败",icon:"error"});case 4:case"end":return e.stop()}}),_callee4)})));return function handleTakeOutOfStorage(){return e.apply(this,arguments)}}(),L=(0,_.useMemo)((function(){var e,t={};return null==b||null===(e=b.weight_list)||void 0===e||e.forEach((function(e){var n="".concat(e.product_code," ").concat(e.product_name);t.hasOwnProperty(n)?t[n].push(e):t[n]=[e]})),t}),[b]),R=function formatUnit(e){return e===y.p.Bulk?"条":"米"};return(0,N.jsxs)(s.G7,{className:u.deliveryDetail,children:[(0,N.jsxs)(s.G7,{className:u.content,children:[(0,N.jsxs)(h.Z,{circle:!0,customStyle:{padding:"24rpx"},children:[(0,N.jsxs)(s.G7,{className:u.detailTop,children:[(0,N.jsxs)(s.G7,{className:u.orderNo,children:["发货单号:",null==b?void 0:b.order_no]}),0===(null==b?void 0:b.status)?(0,N.jsx)(s.G7,{className:u["status--toBeAudit"],children:"待发货"}):(0,N.jsx)(s.G7,{className:u["status--audited"],children:"已完成"})]}),Object.entries(L).map((function(e,t){var n,l,o,a=(0,r.Z)(e,2),i=a[0],d=a[1],c=0;return c=(null===(n=d[0])||void 0===n?void 0:n.sale_mode)===y.p.Bulk?d.reduce((function(e,t){return e+t.roll}),0):d.reduce((function(e,t){return e+(0,x.N6)(t.length)}),0),(0,N.jsxs)(s.G7,{className:u.detailInfo,children:[(0,N.jsx)(p.Z,{direction:"horizontal",customClassName:u.divider}),(0,N.jsxs)(s.G7,{className:u.detailInfoItem,children:[(0,N.jsxs)(s.G7,{className:u["detailInfoItem--title"],children:[(0,N.jsxs)(s.G7,{className:"",children:[(0,N.jsx)(s.xv,{style:{marginRight:"20rpx"},children:i}),(0,N.jsx)(j.Z,{saleMode:null===(l=d[0])||void 0===l?void 0:l.sale_mode})]}),(0,N.jsxs)(s.G7,{className:"",children:["共 ",c," ",R(null===(o=d[0])||void 0===o?void 0:o.sale_mode)]})]}),(0,N.jsx)(s.G7,{className:u["detailInfoItem--detail"],children:null==d?void 0:d.map((function(e,t){return(0,N.jsxs)(s.G7,{className:u["detailInfoItem--detail--row"],children:[(0,N.jsxs)(s.G7,{className:u["detailInfoItem--detail--name"],children:[e.product_color_code," ",e.product_color_name]}),(0,N.jsxs)(s.G7,{className:u["detailInfoItem--detail--count"],children:["x",0===(null==e?void 0:e.sale_mode)?"".concat(e.roll," 条"):"".concat((0,x.N6)((null==e?void 0:e.length)||0)," 米")]}),(0,N.jsxs)(s.G7,{className:u["detailInfoItem--detail--weight"],children:[(0,x.$y)(e.weight),"kg"]})]},t)}))})]})]},t)})),(0,N.jsxs)(s.G7,{className:u.total,children:[(0,N.jsx)(s.xv,{children:"汇总:"}),(0,N.jsxs)(s.xv,{className:u.totalContent,children:["共",(null==b?void 0:b.delivery_product_nums)||0,"种面料,",(null==b?void 0:b.delivery_product_color_nums)||0,"种颜色,共",0===(null==b?void 0:b.sale_mode)?"".concat(null==b?void 0:b.total_roll,"条"):"".concat((0,x.N6)(null==b?void 0:b.total_length).toLocaleString(),"米"),",重量",(0,x.$y)(null==b?void 0:b.total_settle_weight).toLocaleString(),"kg"]})]})]}),(0,N.jsxs)(h.Z,{circle:!0,customStyle:{padding:"24rpx"},children:[(0,N.jsx)(s.G7,{className:u.orderInfoTop,children:"订单信息"}),(0,N.jsx)(p.Z,{direction:"horizontal",customClassName:u.divider}),(0,N.jsxs)(s.G7,{className:"orderInfoDetail",children:[(0,N.jsx)(f.Z,{title:"订单备注:",desc:(null==b?void 0:b.sale_order_remark)||"暂无备注信息"}),(0,N.jsx)(f.Z,{title:"创建时间:",desc:(0,x.o0)(null==b?void 0:b.create_time)||"暂无创建时间"}),(0,N.jsx)(f.Z,{title:"发货方式:",desc:(null==b?void 0:b.shipment_mode_name)||"暂无发货方式"}),(0,N.jsx)(f.Z,{title:"发货地址:",desc:b.province_name?"".concat(b.province_name).concat(b.city_name).concat(b.district_name).concat(b.address_detail):"暂无发货地址"})]})]}),(0,N.jsxs)(h.Z,{circle:!0,customStyle:{padding:"24rpx"},children:[(0,N.jsx)(s.G7,{className:u.orderInfoTop,children:"附件"}),(0,N.jsx)(p.Z,{direction:"horizontal",customClassName:u.divider}),(0,N.jsx)(g.Z,{onlyRead:0!==(null==b?void 0:b.status),onChange:function handleUploadChange(e){console.log("imageList===>",e),P((0,o.Z)(e))},defaultList:null==b?void 0:b.delivery_appendix_url})]})]}),0===(null==b?void 0:b.status)&&function BottomBar(){return(0,N.jsxs)(s.G7,{className:u.bottomBar,style:null!=b&&b.is_outbound?{justifyContent:"center"}:{justifyContent:"space-between"},children:[!(null!=b&&b.is_outbound)&&(0,N.jsx)(v.Z,{customClassName:u.bottomBar__button,plain:!0,type:"info",customStyles:{width:"45%",color:"#636363",borderColor:"#c8c8c8"},round:!0,onClick:J,children:"确认出仓"}),(0,N.jsx)(v.Z,{type:"primary",round:!0,customStyles:{width:null!=b&&b.is_outbound?"90%":"45%"},onClick:E,children:"确认送达"})]})}()]})};Page((0,l.createPageConfig)(Z,"pages/deliveryDetail/index",{root:{cn:[]}},{enablePullDownRefresh:!0,navigationBarTitleText:"销售发货"}||{}))}},function(e){e.O(0,[6570,4199,9886,3338,3927,750,5508,9652,3039,2107,1216,8592],(function(){return t=2916,e(e.s=t);var t}));e.O()}]); |