1 line
11 KiB
JavaScript
1 line
11 KiB
JavaScript
"use strict";require("./sub-common/dde3895fab754ea605d2697ad6817a2a.js");require("./sub-common/f8a6dd331d5db0678cb85ef7c3928ab1.js");require("./sub-common/0c45a2ac643e2e02a31775755227815f.js");(wx.webpackJsonp=wx.webpackJsonp||[]).push([[5909],{2401:function(e,n,i){var _=i(2180),l=i(4165),o=i(5861),t=i(3433),s=i(9439),d=i(1515),r=i(2954),a=i.n(r),c=i(7294),u={common_safe_area_y:"index-module__common_safe_area_y___BbUYw","flex-col":"index-module__flex-col___i_q3A","flex-row":"index-module__flex-row___E4vAx","justify-between":"index-module__justify-between___BMSb0","justify-center":"index-module__justify-center___IWYCo","items-center":"index-module__items-center___nXXDn","flex-item":"index-module__flex-item___qnDE9","full-100":"index-module__full-100___Y7qOK","color-blue":"index-module__color-blue___Neq_9","color-yellow":"index-module__color-yellow___u2xTY","color-green":"index-module__color-green____idwQ","color-grey":"index-module__color-grey___h2Nx7","color-white":"index-module__color-white___htC36","s-w":"index-module__s-w___XCHkC","s-e":"index-module__s-e___Rdd1A",filter:"index-module__filter___DYkrE",mainTop:"index-module__mainTop____aDFN",mainUser:"index-module__mainUser___MG9ub",leftSafe:"index-module__leftSafe___I46Ku",itemCile:"index-module__itemCile___BmfHC",item_top_one:"index-module__item_top_one___pb3co",item_top_one_flex:"index-module__item_top_one_flex____tfUa",itemName:"index-module__itemName___NQQXD",itemPhone:"index-module__itemPhone___nopCF",item_tag_box:"index-module__item_tag_box___ZDtjL",item_tagItem:"index-module__item_tagItem___MLnae",item_tagAdd:"index-module__item_tagAdd___c6lBJ",item_add:"index-module__item_add___eJiSL",item_add_font:"index-module__item_add_font___OnHMD",pos:"index-module__pos___rW3Ev",formBox:"index-module__formBox___O9XuG",order_list:"index-module__order_list___g2LSL"},m=i(4184),x=i.n(m),h="index-module__flexBox___KuN45",f="index-module__itemBox___tlV5q",p="index-module__itemFont___wAqF4",v="index-module__activeItems___lL9Kh",j="index-module__borderBox___rDt_5",N=i(5893),w=function Tabs(e){var n=e.list,i=void 0===n?[]:n,_=e.handChose;return(0,N.jsx)(d.G7,{className:h,children:i.map((function(e,n){return(0,N.jsxs)(d.G7,{className:f,onClick:function onClick(){return null==_?void 0:_(e)},children:[(0,N.jsx)(d.G7,{className:x()(e.showBorder?v:p),children:null==e?void 0:e.name}),e.showBorder&&(0,N.jsx)(d.G7,{className:j})]},n)}))})},g=(0,c.memo)(w),C="index-module__mainItem___pcED6",k="index-module__mainItem_left___QSO_f",G="index-module__mainItem_right___k1qDp",y="index-module__mainItem_active_right___NSPvs",b="index-module__call___Cd1SG",Z="index-module__mainItem_active___DgnlV",B=function Form(e){var n=e.isPhone,i=void 0!==n&&n,_=e.isBorder,l=void 0===_||_;return(0,N.jsxs)(d.G7,{className:x()(l?C:Z),children:[(0,N.jsx)(d.G7,{className:k,children:e.title}),(0,N.jsx)(d.G7,{className:x()(i?y:G),children:e.des}),i&&(0,N.jsx)(d.G7,{className:b,onClick:function onClick(){return function handPhone(){a().makePhoneCall({phoneNumber:e.des})}()},children:"拨打"})]})},D=(0,c.memo)(B),S="index-module__scrollView___twuPa",I="index-module__thirdBox___FAwl1",L="index-module__thirdTopfont___uh4Tg",P="index-module__flexModebox___c1R0r",T="index-module__activemodeBox___H2HI5",M="index-module__modeBox___xmI6n",E="index-module__bottomBox___odRDM",R="index-module__resetBox___pTMyy",q="index-module__button___Po96G",A="index-module__activeButton___oOq3w",F=i(5989),O=i(1687),z=i(9742),H=function TagPopup(e,n){var i=(0,r.useRouter)(),_=(0,O.lb)().fetchData,u=(0,c.useState)([]),m=(0,s.Z)(u,2),h=m[0],f=m[1],p=function(){var e=(0,o.Z)((0,l.Z)().mark((function _callee(){var e;return(0,l.Z)().wrap((function _callee$(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,_();case 2:(e=n.sent).data&&f((0,t.Z)(e.data.list));case 4:case"end":return n.stop()}}),_callee)})));return function getList(){return e.apply(this,arguments)}}(),v=(0,O.hf)().fetchData,j=function(){var n=(0,o.Z)((0,l.Z)().mark((function _callee2(){var n,_,o;return(0,l.Z)().wrap((function _callee2$(l){for(;;)switch(l.prev=l.next){case 0:return _=[],h.filter((function(e){return e.checked})).forEach((function(e){_.push({label_id:e.id})})),a().showLoading({title:"请稍等...",mask:!0}),l.next=6,v({binding_label:_,purchaser_id:Number(i.params.purchaser_id)});case 6:"success"==(o=l.sent).msg?(a().showToast({icon:"success",title:"成功"}),a().hideLoading()):(a().showToast({icon:"error",title:o.msg}),a().hideLoading()),null==e||null===(n=e.diseShow)||void 0===n||n.call(e);case 9:case"end":return l.stop()}}),_callee2)})));return function handSure(){return n.apply(this,arguments)}}(),w=(0,c.useMemo)((function(){return!h.filter((function(e){return e.checked})).length}),[h]),g=(0,c.useMemo)((function(){return h.filter((function(e){return e.checked})).length}),[h]);return(0,c.useImperativeHandle)(n,(function(){return{modeList:h,setModeList:f}})),(0,c.useEffect)((function(){p()}),[]),(0,N.jsxs)(F.Z,{title:"选择标签",show:e.showPopup,onClose:function onClose(){e.handClose()},children:[(0,N.jsx)(d.pf,{scrollY:!0,className:S,children:(0,N.jsxs)(d.G7,{className:I,children:[(0,N.jsx)(d.G7,{className:L,children:"自定义标签分组"}),(0,N.jsx)(d.G7,{className:P,children:h.map((function(e,n){return(0,N.jsx)(d.G7,{onClick:function onClick(){!function handCheckMode(e){h.map((function(n){return n.id===e.id&&(n.checked=!n.checked),n})),f((0,t.Z)(h))}(e)},className:x()(M,e.checked&&T),children:e.name},n)}))})]})}),(0,N.jsxs)(d.G7,{className:E,children:[(0,N.jsx)(z.Z,{onClick:function handReset(){h.map((function(e){return e.checked=!1,e})),f((0,t.Z)(h))},customClassName:R,type:"primary",size:"normal",plain:!0,circle:!0,children:"重置"}),(0,N.jsxs)(z.Z,{onClick:j,disabled:w,customClassName:x()(!w&&A,q),type:"primary",size:"normal",plain:!0,circle:!0,children:["保存(",g,")"]})]})]})},Y=(0,c.memo)((0,c.forwardRef)(H)),U=i(1115),X=i(4812),J=i(4384),K=i(9579),Q=function CustomerDetails(){var e,n,i=(0,r.useRouter)(),_=(0,c.useState)(1),m=(0,s.Z)(_,2),x=m[0],h=m[1],f=(0,c.useState)(),p=(0,s.Z)(f,2),v=p[0],j=p[1],w=(0,O.xF)().fetchData,C=(0,c.useRef)(),k=(0,c.useState)([{id:1,name:"基础信息",showBorder:!0},{id:2,name:"收货地址",showBorder:!1}]),G=(0,s.Z)(k,2),y=G[0],b=G[1],Z=function handChose(e){y.forEach((function(n){n.id===e.id?n.showBorder=!0:n.showBorder=!1,b((0,t.Z)(y)),h(e.id)})),2==e.id&&a().nextTick((function(){var e;null===(e=C.current)||void 0===e||e.getData()}))},B=(0,c.useState)(!1),S=(0,s.Z)(B,2),I=S[0],L=S[1],P=(0,c.useRef)(),T=function(){var e=(0,o.Z)((0,l.Z)().mark((function _callee(){var e;return(0,l.Z)().wrap((function _callee$(n){for(;;)switch(n.prev=n.next){case 0:return a().showLoading({title:"请稍等...",mask:!0}),n.next=3,w({id:i.params.purchaser_id});case 3:e=n.sent,j(e.data),a().hideLoading(),L(!1);case 7:case"end":return n.stop()}}),_callee)})));return function getInfo(){return e.apply(this,arguments)}}();return(0,r.useDidShow)((function(){T()})),(0,N.jsxs)(d.G7,{className:u.mainBox,children:[(0,N.jsxs)(d.G7,{className:u.mainTop,children:[(0,N.jsxs)(d.G7,{className:u.mainUser,children:[(0,N.jsx)(d.G7,{className:u.leftSafe,children:(0,N.jsx)(d.G7,{className:u.itemCile,children:null==v||null===(e=v.name)||void 0===e?void 0:e[0]})}),(0,N.jsxs)(d.G7,{className:u.item_top_one,children:[(0,N.jsxs)(d.G7,{className:u.item_top_one_flex,children:[(0,N.jsx)(d.G7,{className:u.itemName,children:null==v?void 0:v.name}),(0,N.jsx)(d.G7,{className:u.itemPhone,children:null==v?void 0:v.phone})]}),(0,N.jsxs)(d.G7,{className:u.item_tag_box,children:[1!==(null==v?void 0:v.platform_source)&&(0,N.jsx)(K.Z,{type:"primary",size:"normal",circle:!0,customClassName:u.item_tagItem,plain:!0,children:(null==v?void 0:v.platform_source_name)||"暂无"}),(0,N.jsx)(K.Z,{type:"primary",size:"normal",circle:!0,customClassName:u.item_tagItem,plain:!0,children:(null==v?void 0:v.purchaser_type_name)||"暂无"}),(0,N.jsx)(K.Z,{type:"primary",size:"normal",circle:!0,customClassName:u.item_tagItem,plain:!0,children:(null==v?void 0:v.sale_user_name)||"暂无"}),null==v||null===(n=v.label_list)||void 0===n?void 0:n.map((function(e,n){return(0,N.jsx)(K.Z,{type:"primary",size:"normal",circle:!0,customClassName:u.item_tagItem,children:e.label_name},n)})),(0,N.jsxs)(d.G7,{className:u.item_tagAdd,onClick:function onClick(){return function handShow(){var e;null==P||null===(e=P.current)||void 0===e||e.modeList.map((function(e){var n;return null==v||null===(n=v.label_list)||void 0===n||n.forEach((function(n){e.id==n.label_id&&(e.checked=!0)})),e})),P.current.setModeList((0,t.Z)(P.current.modeList)),L(!0)}()},children:[(0,N.jsx)(d.G7,{className:u.item_add,children:"+"}),(0,N.jsx)(d.G7,{className:u.item_add_font,children:"标签"})]})]})]}),(0,N.jsx)(d.G7,{className:u.pos,onClick:function onClick(){return(0,U.jD)("/pages/customerEditor/index?id=".concat(i.params.purchaser_id,"&type=edit"))},children:"编辑 >"})]}),(0,N.jsx)(g,{list:y,handChose:function handChose(e){return null==Z?void 0:Z(e)}})]}),1===x&&(0,N.jsxs)(d.G7,{className:u.formBox,children:[(0,N.jsx)(D,{title:"客户全称",des:(null==v?void 0:v.name)||"暂无"}),(0,N.jsx)(D,{title:"客户简称",des:(null==v?void 0:v.short_name)||"暂无"}),(0,N.jsx)(D,{title:"客户类型",des:(null==v?void 0:v.purchaser_type_name)||"暂无"}),(0,N.jsx)(D,{title:"联系人",des:(null==v?void 0:v.director)||"暂无"}),(0,N.jsx)(D,{title:"联系电话",des:(null==v?void 0:v.phone)||"暂无",isPhone:!0}),(0,N.jsx)(D,{title:"省市区",des:(null==v?void 0:v.province_name)+(null==v?void 0:v.city_name)+(null==v?void 0:v.district_name)||"暂无"}),(0,N.jsx)(D,{title:"详细地址",des:(null==v?void 0:v.address_detail)||"暂无"}),(0,N.jsx)(D,{title:"业务人员",des:(null==v?void 0:v.sale_user_name)||"暂无"}),(0,N.jsx)(D,{title:"客户来源",des:(null==v?void 0:v.purchaser_source_name)||"暂无"}),(0,N.jsx)(D,{title:"备注信息",des:(null==v?void 0:v.remark)||"暂无"}),(0,N.jsx)(D,{title:"下单时间",des:(0,X.o0)(null==v?void 0:v.recent_order_time)||"暂无"}),(0,N.jsx)(D,{title:"创建时间",des:(0,X.o0)(null==v?void 0:v.create_time)||"暂无"}),(0,N.jsx)(D,{title:"创建人",des:(null==v?void 0:v.creator)||"暂无"}),(0,N.jsx)(D,{title:"更新人",des:(null==v?void 0:v.update_user_name)||"暂无"}),(0,N.jsx)(D,{title:"更新时间",des:(0,X.o0)(null==v?void 0:v.update_time)||"暂无",isBorder:!1})]}),2===x&&(0,N.jsx)(d.G7,{className:u.order_list,children:(0,N.jsx)(J.Z,{ref:C,refresherEnabled:!0,purchaser_id:i.params.purchaser_id})}),(0,N.jsx)(Y,{ref:P,showPopup:I,handClose:function handClose(){return L(!1)},diseShow:function diseShow(){return T()}})]})};Page((0,_.createPageConfig)(Q,"pages/customerDetails/index",{root:{cn:[]}},{navigationBarTitleText:"客户详情"}||{}))}},function(e){e.O(0,[7097,5992,6370,6004,2107,1216,8592],(function(){return n=2401,e(e.s=n);var n}));e.O()}]); |