bigOrder.vue 200 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135
  1. <template>
  2. <div class="two-child">
  3. <Modal title="创建大会员订单" v-model="bShow" class-name="order-model member-model" :mask-closable="false"
  4. @on-visible-change="visibleChange">
  5. <Form ref="member" :model="member" :label-width="121">
  6. <FormItem label="基本信息" class="formTitle">
  7. </FormItem>
  8. <div class="flex-endbox">
  9. <FormItem label="合同性质" required>
  10. <!-- 订单状态为“已完成”,不支持修改。 -->
  11. <RadioGroup v-model="member.contract_nature" @on-change="contractChange">
  12. <Radio label="1" style="margin-right:30px">新签合同</Radio>
  13. <Radio label="2">续签合同</Radio>
  14. </RadioGroup>
  15. </FormItem>
  16. <FormItem label="购买主体" required>
  17. <RadioGroup v-model="member.buySubject" @on-change="radiosChange">
  18. <Radio label="1" style="margin-right:30px">个人(如有子账号,共享额度)</Radio>
  19. <Radio label="2">企业</Radio>
  20. </RadioGroup>
  21. </FormItem>
  22. </div>
  23. <!-- <FormItem label="订单时间" required>
  24. <date-sigle ref="sigleRef2" :dateType="'datetime'" :placeholderd="'请选择订单时间'" @startDate="orderDate" :overTime="0"></date-sigle>
  25. </FormItem> -->
  26. <FormItem label="公司名称" :required="member.buySubject == '2'">
  27. <Input v-model.trim="member.companyName" type="text" :maxlength="40" placeholder="请输入公司名称"></Input>
  28. </FormItem>
  29. <div class="flex-endbox">
  30. <FormItem label="开通权益手机号" required :class="{ 'big-stas': colr }">
  31. <Input class="ipt-inpt" v-model="member.phone" type="text" @on-change="pheHandler"
  32. @on-keyup="keyHandler" :maxlength="11" placeholder="请输入手机号" :readonly="pReadon"></Input>
  33. <Checkbox v-model="noPhone" @on-change="noPchange">无手机号</Checkbox>
  34. <Spin fix class="order-spin" v-if="spinShow">
  35. <Icon type="ios-loading" size=18 class="demo-spin-icon-load"></Icon>
  36. </Spin>
  37. <p v-html="colr" style="color:#e13d13"></p>
  38. </FormItem>
  39. <FormItem label="产品类型">
  40. <Select v-model="member.products" placeholder="请选择产品类型(暂不支持数据导出)" @on-change="proChange"
  41. :disabled="proDis">
  42. <!-- <Option v-for="item in bigPro" :value="item.v" :key="item.v">{{ item.n }}</Option> -->
  43. <Option value="1">大会员</Option>
  44. <Option value="2" :disabled="subaccountDis">大会员子账号</Option>
  45. <Option value="3" :disabled="member.buySubject != '1' || bigStas == 0">大会员补充包</Option>
  46. </Select>
  47. </FormItem>
  48. </div>
  49. <FormItem label="关联订单" required v-show="member.products == '2' && contactOrderList.length > 0">
  50. <div class="contactOrderTable">
  51. <Table border ref="selection" :columns="contactOrderColumns" :data="contactOrderList"></Table>
  52. </div>
  53. </FormItem>
  54. <!-- 选择大会员才展示 -->
  55. <FormItem label="会员套餐" v-if="creAuth == '1'" required>
  56. <RadioGroup v-model="member.level" @on-change="radiosChangelevel">
  57. <Radio :label="JSON.stringify(comVal)" :disabled="vipDis">自定义</Radio>
  58. <Radio :label="JSON.stringify(item)" v-for="(item, index) in levelDown"
  59. :value="JSON.stringify(item)" :key="index" :disabled="vipDis || downDis">{{ item.s_name }}
  60. </Radio>
  61. </RadioGroup>
  62. </FormItem>
  63. <!-- <FormItem label="会员套餐" v-if="creAuth == '1'" required>
  64. <Select v-model="member.level" placeholder="请选择会员套餐" @on-change="leChange" @on-select="leSelect">
  65. <Option :value="JSON.stringify(comVal)">自定义</Option>
  66. <Option v-for="(item,index) in levelDown" :value="JSON.stringify(item)" :key="index" :disabled="downDis">{{ item.s_name }}</Option>
  67. </Select>
  68. </FormItem> -->
  69. <!-- 仅大会员商机版2.0 支持购买单省版-->
  70. <!-- <FormItem label="规格" v-if="combo_id.id==6">
  71. <Radio v-model="member.single" ref="single" style="marginRight:30px" @click.native.prevent="areaCountClick(1)" >单省版</Radio>
  72. </FormItem> -->
  73. <!-- <FormItem label="计费模式" required>
  74. <Select v-model="member.billingMode" placeholder="请选择计费模式" @on-change="moneyChange">
  75. <Option v-for="item in chargeStatus" :value="item.v" :key="item.v">{{ item.n }}</Option>
  76. </Select>
  77. </FormItem> -->
  78. <!-- 大会员、子账号 -->
  79. <div v-if="nums !== '' && creAuth">
  80. <!-- nums == '0' 自定义 -->
  81. <!-- <FormItem required v-if="creAuth == '1' && nums == '0'">
  82. <RadioGroup v-model="member.createType" class="form-radio1" @on-change="serChange">
  83. <Radio label="1" :disabled="radioDis1">新建服务</Radio>
  84. <Radio label="2" :disabled="radioDis2">补充服务</Radio>
  85. <Radio label="3" :disabled="radioDis3">延长服务</Radio>
  86. </RadioGroup>
  87. </FormItem>
  88. <FormItem class="table-order1 table-order2" v-if="creAuth == '1' && nums == '0'">
  89. <Table class="sel-table" border ref="selection" :columns="columns3" :data="serData"
  90. @on-select="curChange" @on-select-cancel="canChange" @on-selection-change="selChage"
  91. @on-select-all="allChange" @on-select-all-cancel="allCancel" :summary-method="handleSummary"
  92. show-summary></Table>
  93. </FormItem> -->
  94. <FormItem required v-if="creAuth == '1' && nums == '0'" label="服务列表">
  95. <div class="servebox" v-for="(item, index) in newServedata" :key="index">
  96. <div class="one-group" v-show="!item.hide">
  97. <Checkbox v-model="item.choose" :disabled="item.disabled"
  98. @on-change="chooseChange($event, 'one', index)"></Checkbox><span
  99. class="serve-one">{{ item.ColumnName }}:</span>
  100. </div>
  101. <div class="serve-content">
  102. <div class="serve-two" v-show="!two.hide" v-for="(two, two_index) in item.lists"
  103. :key="two_index">
  104. <span v-if="two.id == 1">{{ two.name }}<span
  105. v-if="member.buySubject == '2'">+企业管理</span></span>
  106. <div class="servechildrenbox" v-else>
  107. <Checkbox v-model="two.choose" :disabled="two.disabled"
  108. @on-change="chooseChange($event, 'two', index)"></Checkbox>
  109. <span style="margin-right: 10px;">{{ two.name }}</span>
  110. <Select v-model="two.id" :disabled="two.disabled || !two.choose"
  111. placeholder="请选择产品" style="width:120px;margin-right:10px;"
  112. v-if="two.list.length > 1" @on-change="chooseChange($event, 'select')">
  113. <Option v-for="(three, three_index) in two.list" :key="three_index"
  114. :value="three.id" v-show="!three.hide" :disabled="three.disabled">{{ three.s_count_year + three.dw
  115. }}</Option>
  116. </Select>
  117. </div>
  118. </div>
  119. </div>
  120. </div>
  121. <div v-if="buyserveName"><span style="color: #e13d13;">注:服务到期时间:{{ serveEndtime }},</span><span
  122. style="font-weight:bold">该客户已购买:</span>{{ buyserveName }}</div>
  123. </FormItem>
  124. <FormItem label="购买数量" required v-if="!(creAuth == '3' && this.member.buySubject == '1')">
  125. <Input v-model="member.buyCount" type="tel" maxlength="4" @on-keyup="buyHandler"
  126. @on-change="payChange" placeholder="请填写购买数量"
  127. :disabled="vipDis && this.member.products != 2"></Input>
  128. <span v-if="member.products == '1'">(注:主账号+子账号数量之和)</span>
  129. </FormItem>
  130. <!-- <div v-if="creAuth !== '3'">
  131. <FormItem label="付费子账号数量">
  132. <Input
  133. v-model="member.paySub"
  134. type="tel"
  135. placeholder="请填写付费子账号数量"
  136. maxlength="4"
  137. @on-keyup="payHandler"
  138. @on-change="payChange"
  139. @on-blur="payBlur"
  140. ></Input>
  141. </FormItem>
  142. <FormItem label="免费子账号数量">
  143. <Input v-model="member.freeSub" type="tel" maxlength="4" @on-keyup="freeHandler" placeholder="请填写免费子账号数量"></Input>
  144. </FormItem>
  145. </div> -->
  146. <!-- 补充包 -->
  147. <div v-if="creAuth !== '2'">
  148. <FormItem class="table-order1" v-show="creAuth == '3'">
  149. <Table class="prei-table" border ref="selection" :columns="columns1" :data="pacData">
  150. </Table>
  151. </FormItem>
  152. <FormItem class="table-order1" v-show="creAuth == '3'">
  153. <Table class="prei-table" border ref="selection" :columns="columns2" :data="datas2"></Table>
  154. </FormItem>
  155. <!-- <div class="flex-endbox"> -->
  156. <FormItem label="有效周期" required v-if="creAuth == '1' && (repair != '2')">
  157. <div class="you-xiao" style="display:flex">
  158. <Input v-model="member.payCycle" type="tel" :maxlength="max_length"
  159. @on-keyup="cycleHandler" @on-change="peChange" :placeholder="placed"
  160. style="width:376px"></Input>
  161. <Select v-model="member.cycleType" placeholder="请选择单位" @on-change="unitChange"
  162. style="width:110px;margin-left:10px">
  163. <Option v-for="item in unitOptions" :value="item.v" :key="item.v">{{ item.n }}
  164. </Option>
  165. </Select>
  166. <Checkbox style="margin-left: 10px;"
  167. v-if="returnMyReceivable === false && ((member.buySubject == '1' && member.createType == '1') || member.buySubject == '2')"
  168. v-model="member.paybackOpenServer">全额回款当日自动开通</Checkbox>
  169. </div>
  170. <!-- 个人 延长服务 -->
  171. <span style="color: #e13d13;"
  172. v-if="member.buySubject == '1' && member.createType == '3'">全额回款后将自动续费开通权益,如若回款时间晚于原服务到期时间,则开始日期为回款日期。</span>
  173. </FormItem>
  174. <FormItem label="开始日期" v-if="creAuth == '1' && repair == '1' && showOrderStatus">
  175. <date-sigle ref="sigleRef1" :dateType="'date'" :placeholderd="'请选择开始日期'"
  176. @startDate="startDate" :disabledDateCallback="disabledDateForVIPCallback"
  177. :dateDis="!showOrderStatus || this.pReadon" class="no-pass"
  178. :beginDis="noPass"></date-sigle>
  179. <Checkbox v-model="noPass" @on-change="noTchange"
  180. :disabled="!showOrderStatus || this.pReadon">暂不开通</Checkbox>
  181. <Checkbox
  182. v-if="returnMyReceivable === true && ((member.buySubject == '1' && member.createType == '1') || member.buySubject == '2')"
  183. v-model="member.paybackOpenServer" :disabled="!noPass">全额回款当日自动开通</Checkbox>
  184. </FormItem>
  185. <!-- </div> -->
  186. </div>
  187. <div class="flex-endbox">
  188. <FormItem label="合同金额" required class="d-felx">
  189. <Input v-model="member.payMoney" type="text" @on-keyup="keyupSale('1')" :maxlength="9"
  190. placeholder="请填写合同金额" :disabled="shiDis"></Input>
  191. <span class="money-unit">元</span>
  192. </FormItem>
  193. <!-- <div v-if="creAuth == '1'">
  194. <FormItem label="大会员订单金额" :label-width="194">
  195. <span class="sum-jin">{{tipFunc(member.bigMoney)}}</span>
  196. </FormItem>
  197. <FormItem label="大会员子账号订单金额" :label-width="194">
  198. <span class="sum-jin">{{tipFunc(member.subMoney)}}</span>
  199. </FormItem>
  200. <FormItem label="大会员补充包订单金额" :label-width="194">
  201. <span class="sum-jin">{{tipFunc(member.supplyMoney)}}</span>
  202. </FormItem>
  203. </div> -->
  204. <!-- 中标企业预测 -->
  205. <FormItem label="标准售价" :label-width="creAuth !== '1' ? 110 : 194" v-if="creAuth !== '1'">
  206. <span class="sum-jin">{{ tipFunc(member.orderMoney) }}元</span>
  207. <span>(折扣率:<span style="color: #36a3f7">{{ member.payMoney && member.orderMoney ?
  208. ((member.payMoney / member.orderMoney) * 100).toFixed(2)
  209. + '%' : '--' }}</span>)</span>
  210. </FormItem>
  211. <FormItem label="标准售价" :label-width="194" v-else>
  212. <span class="sum-jin">{{ tipFunc(member.orderMoney) }}元</span>
  213. <span>(折扣率:<span style="color: #36a3f7">{{ member.payMoney && member.orderMoney ?
  214. ((member.payMoney / member.orderMoney) * 100).toFixed(2)
  215. + '%' : '--' }}</span>)</span>
  216. </FormItem>
  217. <!-- <FormItem label="大会员应付金额" :label-width="121" required v-show="creAuth == '1'">
  218. <Input
  219. v-model="member.bigPayMoney"
  220. type="text"
  221. @on-keyup="keyupSale('2')"
  222. :maxlength="9"
  223. placeholder="请输入大会员应付金额"
  224. :disabled="bigDis"
  225. ></Input>
  226. </FormItem>
  227. <FormItem label="子账号应付金额" required v-show="creAuth == '1'">
  228. <Input
  229. v-model="member.subPayMoney"
  230. type="text"
  231. @on-keyup="keyupSale('3')"
  232. :maxlength="9"
  233. placeholder="请输入子账号应付金额"
  234. :disabled="subDis"
  235. ></Input>
  236. </FormItem>
  237. <FormItem label="补充包应付金额" required v-show="creAuth == '1'">
  238. <Input
  239. v-model="member.supplyPayMoney"
  240. type="text"
  241. @on-keyup="keyupSale('4')"
  242. :maxlength="9"
  243. placeholder="请输入补充包应付金额"
  244. :disabled="supplyDis"
  245. ></Input>
  246. </FormItem> -->
  247. </div>
  248. <div class="flex-endbox">
  249. <FormItem label="佣金金额" class="d-felx" required>
  250. <Input v-model="member.commission" type="text" @on-keyup="keyupSale('5')" :maxlength="9"
  251. placeholder="请输入佣金金额"></Input>
  252. <span class="money-unit">元</span>
  253. </FormItem>
  254. <FormItem label="手续费" class="d-felx" required>
  255. <Input v-model="member.proceduresMoney" type="text" @on-keyup="keyupSale('6')"
  256. :maxlength="9" placeholder="请输入手续费"></Input>
  257. <span class="money-unit">元</span>
  258. </FormItem>
  259. </div>
  260. <FormItem label="协议信息" class="formTitle">
  261. </FormItem>
  262. <div class="flex-endbox">
  263. <FormItem label="协议状态" required>
  264. <RadioGroup v-model="member.agreementStatus" @on-change="agreementStatusChange">
  265. <Radio :label="item.v" v-for="(item, index) in agreeStatus" :value="item.v"
  266. :key="index">{{
  267. item.n }}</Radio>
  268. </RadioGroup>
  269. </FormItem>
  270. <FormItem label="签约主体" required>
  271. <v-cascader ref="casRef2" :initVal="'h01'" placeholderType="签约主体" reqType="签约主体"
  272. @levelChange="paybackChange" v-if="bShow"></v-cascader>
  273. </FormItem>
  274. </div>
  275. <div class="flex-endbox">
  276. <FormItem label="协议签订时间" v-show="member.agreementStatus == '1'">
  277. <date-sigle ref="sigleRef" :dateType="'date'" :placeholderd="'请选择协议签订时间'"
  278. @startDate="agreeDate" :overTime="0"></date-sigle>
  279. </FormItem>
  280. <FormItem label="协议编号" v-show="member.agreementStatus == '1' && !showOnlineContractForm">
  281. <Input v-model="member.agreementNumber" type="text" placeholder="请输入协议编号"></Input>
  282. </FormItem>
  283. </div>
  284. <!-- v-show="!showOnlineContractForm || showXieYi" -->
  285. <div class="showmore">
  286. <div class="flex-endbox">
  287. <FormItem label="协议归档状态" v-show="member.agreementStatus == '1'">
  288. <RadioGroup v-model="member.contract_archive_status">
  289. <Radio label="0">未归档</Radio>
  290. <Radio label="1">已归档</Radio>
  291. </RadioGroup>
  292. </FormItem>
  293. <FormItem label="归档时间"
  294. v-show="member.agreementStatus == '1' && member.contract_archive_status == '1'">
  295. <date-sigle ref="sigleRef4" :dateType="'date'" :placeholderd="'请选择归档时间'"
  296. @startDate="guiDate" :overTime="0"></date-sigle>
  297. </FormItem>
  298. </div>
  299. <div class="flex-endbox">
  300. <FormItem label="归档份数"
  301. v-show="member.agreementStatus == '1' && member.contract_archive_status == '1'">
  302. <Input v-model="member.contract_archive_num" type="tel" maxlength="4"
  303. @on-keyup="payHandler" placeholder="请输入归档份数"></Input>
  304. </FormItem>
  305. <FormItem label="归档协议" class="chuan-pay" v-show="member.contract_archive_status == '1'">
  306. <b-upload ref="uploadRef" @fileData="contractFile" :placeholdered="'请上传归档协议'"
  307. :accepted="'.doc,.pdf,.docx,.rar,.zip,.jpg,.png,.jpeg'"
  308. :formated="['doc', 'pdf', 'docx', 'rar', 'zip', 'jpg', 'png', 'jpeg']"
  309. :multipled="false" @onRemove="onRemoveUpload"></b-upload>
  310. </FormItem>
  311. </div>
  312. </div>
  313. <OnlineContractForm ref="onlineContractFormRef" v-if="showOnlineContractForm"
  314. :showMore="showXieYi && showOnlineContractForm" :buySubject="member.buySubject"
  315. :orderEntName="member.companyName" :e_contract_type.sync="member.e_contract_type"
  316. :e_contract_userA_type.sync="member.e_contract_userA_type"
  317. :e_contract_userA_name.sync="member.e_contract_userA_name"
  318. :e_contract_userA_contacts_name.sync="member.e_contract_userA_contacts_name"
  319. :e_contract_userA_contacts_tel.sync="member.e_contract_userA_contacts_tel"
  320. :e_contract_userA_contacts_address.sync="member.e_contract_userA_contacts_address"
  321. :e_contract_userB_contacts_name.sync="member.e_contract_userB_contacts_name"
  322. :e_contract_remark.sync="member.e_contract_remark" />
  323. <div style="display: flex;justify-content: center;" v-show="!showXieYi && showOnlineContractForm">
  324. <div @click="showXieYi = !showXieYi" style="color: #36a3f7;cursor: pointer; font-size: 14px;">
  325. <span>更多信息</span>
  326. <i class="el-icon-arrow-down"></i>
  327. </div>
  328. </div>
  329. <FormItem label="回款计划" class="formTitle"></FormItem>
  330. <FormItem label="回款次数" required>
  331. <Input v-model.trim="member.paybackNum" type="text" @on-keyup="keyupformat('paybackNum')"
  332. style="width: 80px"></Input><span style="margin-left: 5px;">次</span>
  333. </FormItem>
  334. <!-- 回款列表 -->
  335. <FormItem label="" v-show="member.paybackNum > 1">
  336. <Table border :columns="paybackTable" :data="paybackTableData">
  337. <template slot-scope="{ row }" slot="code">
  338. <strong>{{ row.code }}</strong>
  339. </template>
  340. <template slot-scope="{ row, index }" slot="time">
  341. <strong v-if="row.code == '合计'">-</strong>
  342. <date-sigle :ref="'paybackTime' + index" :dateType="'date'"
  343. :dataV="paybackTableData[index].time" :placeholderd="'请选择'"
  344. @startDate="paybackTableChange(row, index, 'time', $event)" :overTime="0"
  345. v-else></date-sigle>
  346. </template>
  347. <template slot-scope="{ row, index }" slot="money">
  348. <strong v-if="row.code == '合计'">{{ member.payMoney || '-' }}</strong>
  349. <Input v-model="paybackTableData[index].money"
  350. @on-keyup="paybackTableChange(row, index, 'money')" type="number"
  351. @mousewheel.native.prevent @DOMMouseScroll.native.prevent placeholder="请输入"
  352. :disabled="index + 1 == member.paybackNum" v-else></Input>
  353. </template>
  354. </Table>
  355. </FormItem>
  356. <!-- 回款工作日 -->
  357. <FormItem label=" " class="d-felx" :label-width="55" required v-show="member.paybackNum == 1">
  358. <span v-if="member.agreementStatus == '1'">自协议签订之日起</span>
  359. <span v-else>自订单创建之日起</span>
  360. <Input v-model.trim="member.paybackWorkDayNum" type="text"
  361. @on-keyup="keyupformat('paybackWorkDayNum')"
  362. style="width: 80px;margin-left:10px;margin-right: 10px;"></Input>
  363. <span> 个工作日回款,预计回款时间:<span style="color: #36a3f7">{{ member.paybackExpectDate ||
  364. '--' }}</span></span>
  365. </FormItem>
  366. <FormItem label="业绩归属" class="formTitle">
  367. </FormItem>
  368. <div class="flex-endbox">
  369. <FormItem label="业绩归属部门" required>
  370. <!-- <Cascader v-model="member.saleCodeModel" :data="saleDep" trigger="hover" @on-visible-change="saleDepClick" @on-change="saleDepChange"></Cascader> -->
  371. <cascaderMulti class="truecascader" v-model="member.saleCodeModel" :data="saleDep" multiple
  372. @on-change="saleDepChange"></cascaderMulti>
  373. </FormItem>
  374. <FormItem label="业绩统计时间">
  375. <date-sigle ref="sigleRef3" :dateType="'date'" :dataV="member.sale_time"
  376. :placeholderd="'请选择业绩统计时间'" @startDate="saleDate" :overTime="0"></date-sigle>
  377. </FormItem>
  378. </div>
  379. <FormItem label="销售人员">
  380. <sale-select ref="saleRef" @salePerson="salePerson"
  381. :setDefaultPerson="this.$store.getters.getAdminUser.username"></sale-select>
  382. </FormItem>
  383. <FormItem class="table-order1" v-show="saleTableData.length > 2">
  384. <Table border :columns="saleTable" :data="saleTableData">
  385. <template slot-scope="{ row }" slot="name">
  386. <strong>{{ row.name }}</strong>
  387. </template>
  388. <template slot-scope="{ row, index }" slot="money">
  389. <Input v-model="saleTableData[index].money" @on-keyup="saleTableChange(index)"
  390. type="number"></Input>
  391. </template>
  392. </Table>
  393. </FormItem>
  394. <FormItem label="销售渠道" required>
  395. <v-cascader ref="casRef" type="1" quType="1" placeholderType="请选择销售渠道" reqType="销售渠道"
  396. @levelChange="salesChange"></v-cascader>
  397. </FormItem>
  398. <FormItem label="其他信息" class="formTitle">
  399. </FormItem>
  400. <div class="flex-endbox">
  401. <FormItem label="约定支付方式" required>
  402. <Select v-model="member.payType" placeholder="请选择约定支付方式">
  403. <Option v-for="item in payTypes" :value="item.v" :key="item.v">{{ item.n }}</Option>
  404. </Select>
  405. </FormItem>
  406. <FormItem label="下单渠道" required>
  407. <v-cascader ref="casRef1" :initVal="'d01'" placeholderType="请选择下单渠道" reqType="下单渠道"
  408. @levelChange="channelChange" v-if="bShow"></v-cascader>
  409. </FormItem>
  410. </div>
  411. <!-- 修改为默认展示 -->
  412. <div v-show="!showOrderOther">
  413. <FormItem label="订单备注">
  414. <Input v-model="member.remark" type="text" :maxlength="40" placeholder="请输入订单备注"></Input>
  415. </FormItem>
  416. <FormItem label="订单状态" :required="showOrderStatus" v-if="showOrderStatus">
  417. <Select v-model="member.order_status" placeholder="请选择订单状态">
  418. <Option value="0">未完成</Option>
  419. <Option value="1">已完成</Option>
  420. </Select>
  421. </FormItem>
  422. </div>
  423. <!-- <div style="display: flex;justify-content: center;" v-show="!showOrderOther">
  424. <div @click="showOrderOther = !showOrderOther" style="color: #36a3f7;cursor: pointer; font-size: 14px;">
  425. <span>更多信息</span>
  426. <i class="el-icon-arrow-down"></i>
  427. </div>
  428. </div> -->
  429. </div>
  430. </Form>
  431. <div slot="footer">
  432. <Button type="primary" size="large" @click="ordConfirm({ save: '1' })" :disabled="isDisable">提交</Button>
  433. <Button type="primary" class="button-grey" size="large" @click="ordConfirm({ save: '2' })"
  434. :disabled="isDisable" v-if="!showOrderStatus">暂存</Button>
  435. <Button size="large" @click="ordCancel()">取消</Button>
  436. </div>
  437. </Modal>
  438. </div>
  439. </template>
  440. <script>
  441. import { dateFormatter } from '@/assets/js/date'
  442. import dateSigle from '@/components/dateSigle'
  443. import vCascader from '@/components/cascader'
  444. import bUpload from '@/components/uploadFile.vue'
  445. import OnlineContractForm from '@/components/OnlineContractForm'
  446. import saleSelect from './salesSelect.vue'
  447. import { getDateSub } from '@/assets/js/date'
  448. import { debounce } from '@/helper.js'
  449. import serveNames from '@/assets/js/serveName.js'
  450. export default {
  451. name: 'CreateBigOrderModal',
  452. components: {
  453. OnlineContractForm,
  454. vCascader,
  455. dateSigle,
  456. bUpload,
  457. saleSelect
  458. },
  459. props: {
  460. showOrderStatus: {
  461. type: Boolean,
  462. default: false
  463. }
  464. },
  465. computed: {
  466. subaccountDis() {
  467. if (this.member.buySubject == '1' && (this.bigStas == 1 || this.bigStas == 2)) {
  468. return false
  469. } else if (this.member.buySubject == '2' && this.contactOrderList.length > 0) {
  470. return false
  471. } else {
  472. return true
  473. }
  474. },
  475. proDis: function () {
  476. if (this.member.phone == '') {
  477. return true
  478. } else {
  479. if (this.noPhone) {
  480. return false
  481. } else {
  482. if (!(/^1[03456789]\d{9}$/.test(this.member.phone))) {
  483. return true
  484. } else {
  485. return false
  486. }
  487. }
  488. }
  489. },
  490. vipDis() {
  491. if (this.member.contract_nature == '2' && this.member.buySubject == '1') { // 个人续签合同
  492. return true
  493. } else if (this.member.contract_nature == '1' && this.member.buySubject == '1' && (this.bigStas == 2 || this.bigStas == 1)) { // 有大会员权限
  494. // this.member.level = JSON.stringify(this.comVal)
  495. return true
  496. } else if (!this.member.buySubject || !this.member.phone) {
  497. return true
  498. } else {
  499. return false
  500. }
  501. },
  502. showOnlineContractForm() {
  503. const paybackCompanyCheck = this.member.paybackCompany == 'h01' // 签约主体为:北京剑鱼信息技术有限公司/h01
  504. const contractStatusCheck = this.member.agreementStatus == '1' // 协议状态为签协议
  505. // 展示条件:
  506. // 1. 产品类型是超级订阅(且付费类型为“购买”、“续费”)才展示。
  507. // 2. 产品类型是“大会员”且会员套餐为“商机版2.0”、“专家版2.0”(且服务类型为“新购服务”、“延长服务”)
  508. // memberLevelMap.id:6'商机版2.0'、7'专家版2.0'
  509. const memberLevel = this.member.level
  510. if (!memberLevel || memberLevel == 'undefined') return false
  511. const memberLevelMap = JSON.parse(memberLevel)
  512. // console.log(memberLevelMap)
  513. // createType '1'新建 '2'补充 '3'延期
  514. const createType = this.nums == 0 ? this.member.createType : '1'
  515. // 这里的单省版 是商机版2.0单省版
  516. const bigmemberCheck = (memberLevelMap.id == 6 || memberLevelMap.id == 7 || memberLevelMap.s_name.indexOf('单省版') > -1) && (createType == '1' || createType == '3')
  517. const productTypeCheck = bigmemberCheck
  518. return paybackCompanyCheck && contractStatusCheck && productTypeCheck
  519. },
  520. vipval() { //收集多个参数变动 合同性质 购买主体 是否会员 产品
  521. return this.member.contract_nature + this.member.buySubject + this.bigStas + this.member.products + this.member.phone
  522. },
  523. priceChange() {
  524. return this.member.level + this.member.payCycle + this.member.cycleType + this.member.buySubject + String(this.form_serve.ids) + this.member.buyCount + this.member.phone + this.member.beginTime + this.member.createType
  525. },
  526. returnMyReceivable: function () {
  527. let rout = this.$route
  528. if (rout.path && rout.path.includes('myorderList')) {// 我的订单
  529. return false
  530. } else {
  531. return true
  532. }
  533. },
  534. },
  535. watch: {
  536. vipval() { // 监听变化多参数变动
  537. },
  538. priceChange() {
  539. this.$nextTick(() => {
  540. try {
  541. this.orderPriceCount()
  542. } catch (e) {
  543. // console.log(e)
  544. }
  545. })
  546. }
  547. },
  548. created() {
  549. },
  550. mounted() {
  551. // this.getNewservedata()
  552. },
  553. methods: {
  554. contractChange() {
  555. this.createdTypeChange()
  556. },
  557. orderPriceCount() { // 获取价格
  558. let obj = {}
  559. if (this.member.products == '1') {
  560. obj = {
  561. productType: '大会员',
  562. createType: this.member.buySubject == '2' ? '1' : this.member.createType || '',
  563. level: JSON.parse(this.member.level).id || 5,
  564. payCycle: this.member.payCycle || '',
  565. cycleType: this.member.cycleType == '0' ? 2 : 3 || '',
  566. startTime: this.member.createType == 2 || this.member.createType == 3 ? '' : this.member.beginTime || '',
  567. products: this.member.products + '', // 产品类型
  568. comboId: JSON.parse(this.member.level).id || 5,
  569. buySubject: this.member.buySubject,
  570. buyCount: this.member.buyCount,
  571. phone: this.member.phone
  572. }
  573. if (this.member.level && JSON.parse(this.member.level).i_ispreinstall == 0) {
  574. this.getserveIdAndname()
  575. obj.serversId = String(this.form_serve.ids)
  576. obj.level = 5
  577. obj.comboId = 5
  578. }
  579. }
  580. if (this.member.products == '3') { // 补充包
  581. obj = {
  582. products: this.member.products + '', // 产品类型
  583. productType: '大会员',
  584. buyCount: this.member.buyCount,
  585. phone: this.member.phone,
  586. buySubject: this.member.buySubject,
  587. createType: 1
  588. }
  589. let serveData = []
  590. this.datas2.forEach(v => {
  591. serveData.push({
  592. id: v.id,
  593. name: v.name,
  594. price: v.price,
  595. count: v.count * v.s_pkcount
  596. })
  597. })
  598. obj.serversArr = serveData
  599. }
  600. if (this.member.products == '2') { //子账号
  601. obj = {
  602. productType: '大会员',
  603. products: this.member.products + '', // 产品类型
  604. buyCount: this.member.buyCount,
  605. phone: this.member.phone,
  606. buySubject: this.member.buySubject,
  607. createType: 1
  608. }
  609. if (this.member.buySubject == '2') {
  610. obj.orderCode = this.member.contactOrderCode
  611. }
  612. }
  613. if (this.member.products == '1' && obj.phone && obj.buyCount && obj.buySubject) {
  614. if (this.member.createType == '1' && (!obj.payCycle || !obj.cycleType)) {
  615. return
  616. }
  617. this.getpriceAjax(obj)
  618. } else if (this.member.products == '2' && obj.phone && obj.buyCount && obj.buySubject) {
  619. if (this.member.buySubject == '2' && !obj.orderCode) {
  620. this.$Notice.warning({ title: '请选择关联订单' })
  621. return
  622. }
  623. this.getpriceAjax(obj)
  624. } else if (this.member.products == '3' && obj.phone && obj.buySubject && obj.serversArr && obj.serversArr.length > 0) {
  625. this.getpriceAjax(obj)
  626. }
  627. },
  628. createdTypeChange() { // 套餐自动勾选逻辑
  629. this.buyserveName = ''
  630. this.serveEndtime = ''
  631. try {
  632. if (!this.member.phone || !this.member.buySubject || !this.member.contract_nature) {
  633. return
  634. }
  635. this.newServedata = JSON.parse(JSON.stringify(this.initnewServedata)) // 初始化服务列表数据
  636. if (this.member.contract_nature == '1' && this.member.buySubject == '1' && (this.bigStas == 2 || this.bigStas == 1)) { // 合同性质为“新签合同”,且开通权益手机号已有大会员权限,则会员套餐默认为“自定义版”,不支持修改。
  637. this.radiosChangelevel(JSON.stringify(this.comVal)) // 补充 勾选自定义
  638. this.member.level = JSON.stringify(this.comVal)
  639. if (this.nums == 0) {
  640. clearTimeout(timer)
  641. let timer = setTimeout(() => {
  642. if (this.member.phone) {
  643. this.currentServer(this.member.phone, (res) => {
  644. let ids = res.data.list
  645. this.currentServerid = res.data.list
  646. let time = dateFormatter(res.data.serviceEndTime, 'yyyy-MM-dd')
  647. this.echoServe(ids, 'hide', ids)
  648. this.Purchasedservices(time)
  649. this.getserveIdAndname()
  650. })
  651. }
  652. }, 200);
  653. }
  654. }
  655. if (this.member.contract_nature == '2' && this.member.buySubject == '1') { // 个人续签合同 延长
  656. if (this.i_member_status) {
  657. this.levelDown.forEach(ele => {
  658. if (this.areaCount > 0) {// 单省版
  659. if (ele && ele.s_name.indexOf('单省版') > -1) {
  660. this.radiosChangelevel(JSON.stringify(ele))
  661. this.member.level = JSON.stringify(ele)
  662. }
  663. } else {
  664. if (ele && ele.id == this.i_member_status) {
  665. this.radiosChangelevel(JSON.stringify(ele))
  666. this.member.level = JSON.stringify(ele)
  667. }
  668. }
  669. })
  670. if (this.i_member_status == 5) { // 自定义
  671. this.radiosChangelevel(JSON.stringify(this.comVal))
  672. this.member.level = JSON.stringify(this.comVal)
  673. clearTimeout(timer)
  674. let timer = setTimeout(() => {
  675. if (this.member.phone) {
  676. this.currentServer(this.member.phone, (res) => {
  677. let ids = res.data.list
  678. this.currentServerid = res.data.list
  679. this.echoServe(ids, 'allDis')
  680. this.getserveIdAndname()
  681. })
  682. }
  683. }, 200);
  684. }
  685. } else {
  686. this.member.level = ''
  687. }
  688. }
  689. this.modifycreateType()
  690. } catch (e) {
  691. // console.log(e)
  692. }
  693. },
  694. getpriceAjax(obj) {
  695. if (this.pricetimer) {
  696. clearTimeout(this.pricetimer)
  697. }
  698. this.pricetimer = setTimeout(() => {
  699. this.$request('/order/orderPriceCount').data(obj).success((res) => {
  700. // if(!res.data.price){
  701. // return
  702. // }
  703. this.member.orderMoney = res.data.price
  704. }).post()
  705. }, 200);
  706. },
  707. getNewservedata() {// 获取新服务列表
  708. this.$request('/order/getServerNew').data({ sType: 2 }).success((res) => { // 获取自定义套餐所有服务选项
  709. let data = res.data.lists
  710. // 处理为符合前端结构数据
  711. data.forEach(ele => {
  712. if (ele.Children.length > 0) {
  713. for (const key in serveNames) { // 服务名称替换
  714. ele.Children.forEach(item => {
  715. if (item.s_new_name == key) {
  716. item.s_new_name = serveNames[key]
  717. }
  718. })
  719. }
  720. ele.maps = groupByProperty(ele.Children, 's_new_name') // 相同名称分组
  721. }
  722. })
  723. // data.forEach(ele => {
  724. // for (const key in ele.maps) {
  725. // if(ele.maps[key].length>1){
  726. // if(key.indexOf('数据导出') == -1){
  727. // ele.maps[key].unshift({'s_new_name':ele.maps[key][0].s_new_name,id:'',s_count_year:10})
  728. // }
  729. // }
  730. // }
  731. // })
  732. data.forEach(ele => {
  733. ele.lists = []
  734. for (const key in ele.maps) {
  735. let obj = {}
  736. if (key.includes('市场分析定制报告') || key.includes('企业分析') || key.includes('业主分析')) {
  737. obj.name = key + ',报告下载:'
  738. } else {
  739. obj.name = key
  740. }
  741. obj.list = ele.maps[key]
  742. if (obj.list.length == 1) {
  743. obj.id = ele.maps[key][0].id
  744. }
  745. if (obj.list.length > 1) {
  746. obj.list.forEach(e => {
  747. if (e.s_new_name.indexOf('数据导出') > -1) {
  748. e.dw = '条/天'
  749. if (e.s_count_year == 200) {
  750. obj.id = e.id
  751. }
  752. } else if (e.s_new_name.includes('市场分析定制报告') || e.s_new_name.includes('企业分析') || e.s_new_name.includes('业主分析')) {
  753. if (!e.s_count_year || e.s_count_year == 500) { // 企业分析count500是基础产品与一份下载包重合因此隐藏,其他两种的基础产品count是null
  754. e.hide = true
  755. }
  756. // i_isserver 1 套餐下载包
  757. if(e.i_isserver == 1){ // 隐藏套餐下载包
  758. e.dw = '份/年' // 单位
  759. e.disabled = true
  760. e.hide = true
  761. }else{
  762. e.dw = '份' // 单位
  763. }
  764. if (e.s_count_year == 1 && e.i_isserver != 1) { // 默认1份 非套餐的选项
  765. obj.id = e.id // 勾选层级的ID赋值为规格为1的产品ID
  766. }
  767. } else {
  768. e.dw = '个'
  769. if (e.s_count_year == 100) {
  770. obj.id = e.id
  771. }
  772. }
  773. })
  774. }
  775. ele.lists.push(obj)
  776. }
  777. })
  778. // 初始勾选处理
  779. data.forEach(ele => {
  780. if (ele.ColumnName == '基础服务') { // 基础服务默认勾选且不可修改
  781. ele.choose = true
  782. ele.disabled = true
  783. } else {
  784. ele.choose = false
  785. ele.disabled = false
  786. }
  787. ele.lists.forEach(e => {
  788. if (e.id == 1) {
  789. e.choose = true
  790. e.disabled = true
  791. } else {
  792. e.choose = false
  793. e.disabled = false
  794. }
  795. })
  796. })
  797. data.forEach(ele => {
  798. ele.lists.forEach(e => {
  799. let newlist = e.list.sort((a, b) => a.s_count_year - b.s_count_year) // 按数量排序
  800. ele.list = newlist
  801. })
  802. })
  803. this.newServedata = data
  804. console.log(this.newServedata)
  805. this.initnewServedata = JSON.parse(JSON.stringify(this.newServedata))
  806. }).get()
  807. // 基础数据格式处理 下拉默认选中ID及单位处理
  808. function groupByProperty(arr, prop) {
  809. let groups = {};
  810. arr.forEach(item => {
  811. let group = groups[item[prop]];
  812. if (!group) {
  813. group = groups[item[prop]] = [];
  814. }
  815. group.push(item);
  816. });
  817. return groups;
  818. }
  819. },
  820. chooseChange(e, t, index) { // 多选框选择
  821. console.log(e, t)
  822. let data = this.newServedata
  823. if (t == 'one') {
  824. data[index].lists.forEach(e => {
  825. if (data[index].choose) {
  826. e.choose = true
  827. } else {
  828. e.choose = false
  829. }
  830. })
  831. } else if (t == 'two') {
  832. console.log(data[index])
  833. if (data[index].lists.every(item => item.choose === true)) {
  834. data[index].choose = true
  835. } else {
  836. data[index].choose = false
  837. }
  838. }
  839. this.getserveIdAndname()
  840. },
  841. getserveIdAndname(type) { // 获取服务id和name
  842. let key = 'choose' //已勾选服务
  843. if (type == 'getbuyserve') { // 已购服务(被隐藏的服务即为已购服务)
  844. key = 'hide'
  845. }
  846. let data = this.newServedata || []
  847. let ids = []
  848. let names = []
  849. data.forEach(ele => {
  850. ele.lists.forEach(e => {
  851. if (e[key]) {
  852. ids.push(e.id)
  853. if (e.id == 22 || e.id == 20 || e.id == 24) { // 项目进度监控 22=>100; 14=>500 企业情报监控20=>100 ;23=>500 业主监控 24=>100 ;25=>500
  854. names.push(e.name + '(100个)')
  855. } else if (e.id == 14 || e.id == 23 || e.id == 25) {
  856. names.push(e.name + '(500个)')
  857. } else if (e.id == 17) { //数据导出
  858. names.push(e.name + '(100条/天)')
  859. } else if (e.id == 18) {
  860. names.push(e.name + '(200条/天)')
  861. } else if (e.id == 1) {
  862. if (this.member.buySubject == '2') {
  863. names.push('基础服务' + '+企业管理')
  864. } else {
  865. names.push('基础服务')
  866. }
  867. } else if (e.name.includes('市场分析定制报告') || e.name.includes('企业分析') || e.name.includes('业主分析')) {
  868. e.list.forEach(item => {
  869. if(e.id == item.id){
  870. if (item.s_count_year) {
  871. if (item.s_new_name.includes('企业分析') && item.s_count_year == 500) {
  872. names.push(item.s_new_name)
  873. } else {
  874. names.push(item.s_new_name.replace(',报告下载:', '') + `(报告下载:${item.s_count_year}${item.dw})`)
  875. }
  876. } else {
  877. names.push(item.s_new_name)
  878. }
  879. }
  880. })
  881. } else {
  882. names.push(e.name)
  883. }
  884. }
  885. })
  886. })
  887. let names_str = names.join(',')
  888. // 基础服务: 服务id需要传1 3 企业情报监控包含:企业情报监控 20 23 企业情报监控传20的时候 企业中标动态传21 企业中标动态 21 13 企业情报监控传23的时候 企业中标动态传13
  889. if (ids.includes(1) && !ids.includes(3)) {
  890. ids.push(3)
  891. }
  892. if (ids.includes(20) && !ids.includes(21)) {
  893. ids.push(21)
  894. }
  895. if (ids.includes(23) && !ids.includes(13)) {
  896. ids.push(13)
  897. }
  898. if (names_str.includes('市场分析定制报告') && !ids.includes(26)) { // 选中下载包的ID时则存在没有基础产品的ID,这里补上 基础产品和下载包是绑定的,但是有两个ID
  899. ids.push(26)
  900. }
  901. if (names_str.includes('企业分析') && !ids.includes(4)) {
  902. ids.push(4)
  903. }
  904. if (names_str.includes('业主分析') && !ids.includes(5)) {
  905. ids.push(5)
  906. }
  907. // console.log(ids,names)
  908. if (type == 'getbuyserve') {
  909. return { ids, names }
  910. } else {
  911. this.form_serve = { ids, names }
  912. }
  913. },
  914. Purchasedservices(time) {
  915. let { names } = this.getserveIdAndname('getbuyserve') // 获取已购服务 已购服务会在服务勾选隐藏
  916. this.buyserveName = names.join('、')
  917. this.serveEndtime = time
  918. },
  919. echoServe(ids, type, hide_id) { // 回显服务 ids:勾选ID; type: dis禁用已勾选 allDis禁用全部 hide隐藏 hide_dis 隐藏指定禁用剩下的; hide_id: 需要隐藏的id
  920. let data = ids
  921. if (!data.includes(1)) { // 1 3 基础服务默认都有
  922. data.push(1)
  923. }
  924. if (!data.includes(3)) {
  925. data.push(3)
  926. }
  927. let hide = hide_id || []
  928. if (!hide.includes(1)) { // 1 3 基础服务默认都有
  929. hide.push(1)
  930. }
  931. if (!hide.includes(3)) { // 1 3 基础服务默认都有
  932. hide.push(3)
  933. }
  934. let servedata = this.newServedata
  935. servedata.forEach(ele => {
  936. ele.lists.forEach(e => {
  937. e.list.forEach(item => {
  938. if (data.includes(item.id)) {
  939. if(item.id != 4 && item.id != 5 && item.id != 26){ // 企业分析 业主分析 市场分析定制报告 这三个基础服务不选中ID (捆绑的有下载包 选中下载包的ID)
  940. e.id = item.id
  941. }
  942. e.choose = true
  943. if (type == 'dis') { // 禁用已勾选
  944. e.disabled = true
  945. item.disabled = true
  946. ele.disabled = true
  947. }
  948. }
  949. if (hide.includes(item.id)) {
  950. if (type == 'hide' || type == 'hide_dis') {
  951. e.hide = true
  952. item.hide = true
  953. ele.hide = true
  954. e.disabled = true
  955. item.disabled = true
  956. ele.disabled = true
  957. }
  958. }
  959. if (type == 'allDis' || type == 'hide_dis') { // 禁用全部选项
  960. e.disabled = true
  961. item.disabled = true
  962. ele.disabled = true
  963. }
  964. })
  965. })
  966. })
  967. servedata.forEach(ele => {
  968. if (ele.lists.every(item => item.choose === true)) {
  969. ele.choose = true
  970. } else {
  971. ele.choose = false
  972. }
  973. if ((type == 'hide' || type == 'hide_dis') && ele.lists.every(item => item.hide === true)) {
  974. ele.hide = true
  975. } else {
  976. ele.hide = false
  977. }
  978. })
  979. },
  980. modifycreateType() {
  981. this.member.createType = ''
  982. if (this.member.contract_nature == '2' && this.member.buySubject == '1') { // 当“合同性质”为“续签合同”时,购买主体为“个人”,默认为“延长服务”
  983. this.member.createType = '3'
  984. } else if (this.bigStas == 0) { // 没有大会员权限
  985. this.member.createType = '1'
  986. } else if (this.member.contract_nature == '1' && this.member.buySubject == '1' && (this.bigStas == 2 || this.bigStas == 1)) { //当开通权益手机号已有大会员权限,购买主体为“个人”,“合同性质”为“新签合同”,默认为“补充服务”
  987. this.member.createType = '2'
  988. } else if (this.member.buySubject == '2') { // 企业走新建服务新建
  989. this.member.createType = '1'
  990. }
  991. this.repair = this.member.createType
  992. },
  993. initialized(conf = {}) {// 初始化
  994. // 排除某些字段不重置
  995. if (!conf) {
  996. conf = {}
  997. }
  998. this.member.contactOrderCode = ''
  999. this.member.entId = ''
  1000. this.member.paybackWorkDayNum = ''
  1001. this.member.paybackExpectDate = ''
  1002. this.member.paybackOpenServer = false
  1003. const excludeList = conf.excludeList || []
  1004. this.member.bigMoney = 0
  1005. this.member.subMoney = 0
  1006. this.member.supplyMoney = 0
  1007. this.member.orderMoney = 0
  1008. this.member.payMoney = ''
  1009. this.member.sums = 0
  1010. this.member.paySub = ''
  1011. this.member.freeSub = ''
  1012. this.member.bigPayMoney = ''
  1013. this.member.subPayMoney = ''
  1014. this.member.supplyPayMoney = ''
  1015. this.member.payCycle = ''
  1016. this.member.contractUrl = ''
  1017. if (!excludeList.includes('companyName')) {
  1018. this.member.companyName = ''
  1019. }
  1020. this.member.remark = ''
  1021. if (this.member.products == '2') {
  1022. this.member.agreementStatus = '0'
  1023. } else {
  1024. this.member.agreementStatus = '1'
  1025. }
  1026. this.member.payType = ''
  1027. this.member.agreementNumber = ''
  1028. this.member.cycleType = '0'
  1029. this.member.commission = '0'
  1030. this.member.proceduresMoney = '0'
  1031. this.member.contract_archive_status = '0'
  1032. this.member.contract_archive_num = ''
  1033. this.member.single = false
  1034. this.member.areaCount = 0
  1035. this.sumSel = []
  1036. this.sPrice = 0
  1037. this.strItems = []
  1038. this.selData = []
  1039. this.isAll = false
  1040. this.member.beginTime = ''
  1041. this.bigDis = true
  1042. this.subDis = true
  1043. this.supplyDis = true
  1044. this.strItems1 = []
  1045. this.strItems2 = []
  1046. this.strItems3 = []
  1047. this.strItems4 = []
  1048. this.strItems5 = []
  1049. this.optionDis1 = false
  1050. this.optionDis2 = false
  1051. this.optionDis3 = false
  1052. this.optionDis4 = false
  1053. this.optionDis5 = false
  1054. this.optionDis6 = false
  1055. this.combo_id = ''
  1056. Object.keys(this.member).forEach(key => {
  1057. if (key.startsWith('e_contract_')) {
  1058. // 默认重置
  1059. if (key !== 'e_contract_userB_contacts_name') { // 乙方联系人不重置
  1060. this.member[key] = this.$options.data().member[key]
  1061. }
  1062. }
  1063. })
  1064. setTimeout(() => {
  1065. let sigs = this.$refs.sigleRef
  1066. let sigs1 = this.$refs.sigleRef3
  1067. let sigs2 = this.$refs.sigleRef4
  1068. let uploads = this.$refs.uploadRef
  1069. if (sigs) {
  1070. this.$refs.sigleRef.initd()
  1071. this.$refs.sigleRef.dataVals = dateFormatter(new Date(), 'yyyy-MM-dd')
  1072. this.member.agreementTime = dateFormatter(new Date(), 'yyyy-MM-dd')
  1073. }
  1074. if (sigs1) {
  1075. this.$refs.sigleRef3.dataVals = dateFormatter(new Date(), 'yyyy-MM-dd') + ' 00:00:00'
  1076. this.member.sale_time = dateFormatter(new Date(), 'yyyy-MM-dd') + ' 00:00:00'
  1077. }
  1078. if (sigs2) {
  1079. this.$refs.sigleRef4.initd()
  1080. }
  1081. if (uploads) {
  1082. this.$refs.uploadRef.uploadShow = false
  1083. this.$refs.uploadRef.payHtml = ''
  1084. }
  1085. }, 200)
  1086. },
  1087. keyupSale(val) { // 正则格式化金额
  1088. if (val === '1') { // 合同金额
  1089. this.member.payMoney = this.moneyReg(this.member.payMoney)
  1090. // 金额变动清空回款列表
  1091. if (this.member.paybackNum > 1) {
  1092. this.paybackTableDataClear()
  1093. }
  1094. } else if (val === '2') {
  1095. this.member.bigPayMoney = this.moneyReg(this.member.bigPayMoney)
  1096. } else if (val === '3') {
  1097. this.member.subPayMoney = this.moneyReg(this.member.subPayMoney)
  1098. } else if (val === '4') {
  1099. this.member.supplyPayMoney = this.moneyReg(this.member.supplyPayMoney)
  1100. } else if (val === '5') {
  1101. this.member.commission = this.moneyReg(this.member.commission)
  1102. } else if (val === '6') {
  1103. this.member.proceduresMoney = this.moneyReg(this.member.proceduresMoney)
  1104. }
  1105. this.updateSaleMoney()
  1106. },
  1107. paybackTableDataClear() { // 初始化回款列表
  1108. let num = this.member.paybackNum
  1109. let arr = []
  1110. for (let i = 0; i <= num; i++) {
  1111. if (i == num) {
  1112. arr.push({ code: '合计', time: '-', money: this.member.payMoney })
  1113. } else {
  1114. arr.push({ code: i + 1, time: '', money: '' })
  1115. }
  1116. }
  1117. this.paybackTableData = arr
  1118. this.$nextTick(() => {
  1119. this.paybackTableData.forEach((ele, index) => {
  1120. if (index < this.paybackTableData.length - 1) {
  1121. this.$refs['paybackTime' + index].initd()
  1122. }
  1123. })
  1124. })
  1125. },
  1126. keyupformat(val) { // 格式化输入框
  1127. if (val === 'paybackWorkDayNum') {
  1128. this.member.paybackWorkDayNum = this.filterNonPositiveIntegers(this.member.paybackWorkDayNum)
  1129. this.getcollectionDate()
  1130. } else if (val === 'paybackNum') { // 回款次数
  1131. this.member.paybackNum = this.paybackNumReg(this.member.paybackNum)
  1132. if (this.member.paybackNum > 1) {
  1133. this.paybackTableDataClear()
  1134. } else {
  1135. // 切换一次重置数值
  1136. this.member.paybackWorkDayNum = ''
  1137. this.member.paybackExpectDate = ''
  1138. }
  1139. }
  1140. },
  1141. paybackTableChange(row, index, type, e) { // 回款计划表格 change
  1142. if (type == 'money') {
  1143. // 回款金额未录入时
  1144. if (!this.member.payMoney) {
  1145. this.$Notice.warning({ title: '请先输入合同金额' })
  1146. this.paybackTableData[index].money = ''
  1147. return
  1148. }
  1149. let num = 0
  1150. if (this.paybackmoneyReg(this.paybackTableData[index].money)) {
  1151. let money_ = this.paybackmoneyReg(this.paybackTableData[index].money)
  1152. this.paybackTableData[index].money = Number(money_).fixed(2)
  1153. } else {
  1154. this.paybackTableData[index].money = ''
  1155. }
  1156. this.paybackTableData.forEach((ele, index) => {
  1157. if (index < this.paybackTableData.length - 2) {
  1158. num += Number(ele.money)
  1159. }
  1160. })
  1161. if (num && this.member.payMoney) {
  1162. if (Number(this.member.payMoney) - Number(num) > 0) {
  1163. this.paybackTableData[this.member.paybackNum - 1].money = (Number(this.member.payMoney) - Number(num)).fixed(2)
  1164. } else {
  1165. this.$Notice.warning({ title: '需小于合同金额' })
  1166. this.paybackTableData[index].money = ''
  1167. // this.paybackTableData[this.member.paybackNum -1].money = ''
  1168. }
  1169. this.paybackTableData.forEach((ele) => {
  1170. if (ele.code == '合计') {
  1171. ele.money = Number(this.member.payMoney)
  1172. }
  1173. })
  1174. } else {
  1175. this.paybackTableData[this.member.paybackNum - 1].money = ''
  1176. }
  1177. } else if (type == 'time') {
  1178. if (e) {
  1179. this.paybackTableData[index].time = e
  1180. }
  1181. }
  1182. console.log(this.paybackTableData)
  1183. },
  1184. paybackmoneyReg(val) {
  1185. if (val) {
  1186. let str = this.moneyReg(val + "")
  1187. if (str == 0 && str !== '') {
  1188. this.$Notice.warning({ title: '不可为0' })
  1189. str = ''
  1190. } else if (Number(str) >= Number(this.member.payMoney)) {
  1191. this.$Notice.warning({ title: '需小于合同金额' })
  1192. str = ''
  1193. }
  1194. return str
  1195. } else {
  1196. return ""
  1197. }
  1198. },
  1199. paybackNumReg(val) {
  1200. let str = val.toString().replace(/-\d+|[^\d\s,]+/g, '')
  1201. if (str !== "" && str < 1) {
  1202. this.$Notice.warning({ title: '最小值为1' })
  1203. str = 1
  1204. } else if (str > 5) {
  1205. this.$Notice.warning({ title: '最大值为5' })
  1206. str = 5
  1207. }
  1208. if (str && str > 0) {
  1209. return Number(str)
  1210. } else {
  1211. return ''
  1212. }
  1213. },
  1214. getcollectionDate: debounce(function () {
  1215. if (this.member.paybackNum != 1) {
  1216. return
  1217. }
  1218. let start = ''
  1219. this.member.paybackExpectDate = ''
  1220. if (this.member.paybackWorkDayNum === 0) {
  1221. if (this.member.agreementStatus == '1') {
  1222. this.member.paybackExpectDate = this.member.agreementTime
  1223. } else {
  1224. this.member.paybackExpectDate = dateFormatter(new Date(), 'yyyy-MM-dd')
  1225. }
  1226. return
  1227. }
  1228. if (this.member.agreementStatus == '1') { //签协议
  1229. start = this.member.agreementTime
  1230. } else {//不签协议
  1231. start = dateFormatter(new Date(), 'yyyy-MM-dd')
  1232. }
  1233. if (this.member.paybackWorkDayNum === '' || !start) {
  1234. return
  1235. }
  1236. let obj = {
  1237. startDay: start,
  1238. workDayNum: Number(this.member.paybackWorkDayNum),
  1239. }
  1240. this.$request('getWorkDay').contentType('application/json').data(obj).success((res) => {
  1241. if (res.data) {
  1242. this.member.paybackExpectDate = res.data
  1243. }
  1244. }).post('rewritePath')
  1245. }, 200),
  1246. filterNonPositiveIntegers(str) {
  1247. let strs = str + ""
  1248. let num = strs.replace(/-\d+|[^\d\s,]+/g, '')
  1249. if (num && num >= 0) {
  1250. return Number(num)
  1251. } else {
  1252. return ''
  1253. }
  1254. },
  1255. saleTableChange(index) {
  1256. let money = Number(this.saleTableData[index].money).fixed(2)
  1257. this.saleTableData[index].money = money
  1258. let moneys = 0
  1259. this.saleTableData.forEach(v => {
  1260. if (v.name !== '合计') {
  1261. moneys += v.money
  1262. }
  1263. })
  1264. this.saleTableData[this.saleTableData.length - 1].money = moneys
  1265. },
  1266. updateSaleMoney() {
  1267. let money = Number(this.member.payMoney) + Number(this.member.bigPayMoney) + Number(this.member.subPayMoney) + Number(this.member.supplyPayMoney) - Number(this.member.commission) - Number(this.member.proceduresMoney)
  1268. let moneys = Number(money / (this.saleTableData.length - 1)).fixed(2)
  1269. this.saleTableData.forEach(v => {
  1270. if (v.name === '合计') {
  1271. v.money = money
  1272. } else {
  1273. v.money = moneys
  1274. }
  1275. })
  1276. },
  1277. saleDepClick() {
  1278. let url = '/order/getSalesChannelItem'
  1279. this.$request(url).data({
  1280. name: this.reqType
  1281. }).success((res) => {
  1282. if (res.data.dep) {
  1283. this.saleDep = res.data.dep
  1284. }
  1285. if (res.data.displayMap) {
  1286. if (res.data.displayMap.distribution_channel) {
  1287. this.member.salesChannel = res.data.displayMap.distribution_channel
  1288. }
  1289. if (res.data.displayMap.saleDep) {
  1290. this.member.saleCodeModel = res.data.displayMap.saleDep
  1291. }
  1292. }
  1293. }).post()
  1294. },
  1295. saleDepChange: debounce(function (val) { // 业绩归属部门
  1296. if (val && val.length > 0) {
  1297. let valres = this.getMinLevelData(this.saleDep, val)
  1298. this.saleCode = valres.join(',')
  1299. if (val.indexOf('010100') > -1 || val.indexOf('010101') > -1 || val.indexOf('010102') > -1 || val.indexOf('010103') > -1 || val.indexOf('010104') > -1 || val.indexOf('050000') > -1) {
  1300. this.$refs.casRef.getDictItem(() => {
  1301. this.$refs.casRef.setDate('x020')
  1302. })
  1303. this.$refs.casRef.values = ['x02', 'x020'] //业绩归属部门为“销售一部/电销组”或“销售三部”,销售渠道默认为“线下直销/电销”
  1304. this.member.salesChannel = 'x020'
  1305. }
  1306. } else {
  1307. this.saleCode = ''
  1308. }
  1309. }, 200),
  1310. removeElementFromArray(arr, value) {
  1311. for (let i = 0; i < arr.length; i++) {
  1312. if (arr[i] === value) {
  1313. arr.splice(i, 1)
  1314. i--
  1315. }
  1316. }
  1317. return arr
  1318. },
  1319. getMinLevelData(arrayA, arrayB) {
  1320. const result = []
  1321. const findItem = (arr) => {
  1322. for (let i = 0; i < arr.length; i++) {
  1323. if (arrayB.includes(arr[i].value)) {
  1324. result.push(arr[i].value)
  1325. }
  1326. if (arr[i].children) {
  1327. let arra = arr[i].children
  1328. for (let a = 0; a < arra.length; a++) {
  1329. if (arrayB.includes(arra[a].value)) {
  1330. this.removeElementFromArray(result, arra[a].value.substring(0, 2) + '0000')
  1331. result.push(arra[a].value)
  1332. }
  1333. if (arra[a].children) {
  1334. let arrb = arra[a].children
  1335. for (let b = 0; b < arrb.length; b++) {
  1336. if (arrayB.includes(arrb[b].value)) {
  1337. if (arrayB.includes(arrb[b].value.substring(0, 4) + '00')) {
  1338. this.removeElementFromArray(result, arrb[b].value.substring(0, 4) + '00')
  1339. }
  1340. result.push(arrb[b].value)
  1341. }
  1342. }
  1343. }
  1344. }
  1345. }
  1346. }
  1347. }
  1348. findItem(arrayA)
  1349. return result.reverse()
  1350. },
  1351. onRemoveUpload() {
  1352. this.member.contractUrl = ''
  1353. },
  1354. moneyReg(val) {
  1355. return val.replace(/[^\d^\.]+/g, '').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.')
  1356. },
  1357. keyHandler() {
  1358. this.member.phone = this.member.phone.replace(/[^\d]/g, '')
  1359. if (this.member.level) {
  1360. this.member.level = ''
  1361. this.nums = ''
  1362. }
  1363. },
  1364. noPchange(val) {
  1365. if (val) {
  1366. this.pReadon = true
  1367. this.member.phone = 9 + String(Math.random()).substring(2, 12)
  1368. this.overTime = 0
  1369. this.pheHandler() // 手机号变动
  1370. this.myNoTchange()
  1371. } else {
  1372. this.pReadon = false
  1373. this.member.phone = ''
  1374. }
  1375. },
  1376. salesChange(val) {
  1377. //销售渠道兼容单个内容 或数组内容
  1378. if (val instanceof Array) {
  1379. this.member.salesChannel = String(val[1])
  1380. } else if (typeof val === 'string') {
  1381. this.member.salesChannel = val
  1382. } else {
  1383. this.member.salesChannel = String(val)
  1384. }
  1385. },
  1386. channelChange(val) {
  1387. this.member.orderChannel = String(val)
  1388. },
  1389. radiosChange(val) {
  1390. this.member.buySubject = String(val)
  1391. this.member.buyCount = ''
  1392. this.creAuth = this.member.products
  1393. if (val == 2) {
  1394. this.member.products = '1'
  1395. this.repair = '1'
  1396. }
  1397. this.datas2 = []
  1398. this.member.paySub = ''
  1399. this.member.freeSub = ''
  1400. this.member.orderMoney = 0
  1401. this.member.payMoney = ''
  1402. this.nums = ''
  1403. this.member.level = ''
  1404. this.member.contractUrl = ''
  1405. this.member.single = false
  1406. this.member.areaCount = 0
  1407. this.isAll = false
  1408. setTimeout(() => {
  1409. let uploads = this.$refs.uploadRef
  1410. if (uploads) {
  1411. this.$refs.uploadRef.uploadShow = false
  1412. this.$refs.uploadRef.payHtml = ''
  1413. }
  1414. // 产品类型类型初始为大会员 获取套餐信息
  1415. this.proChange(this.member.products)
  1416. }, 200)
  1417. this.reged()
  1418. },
  1419. paybackChange(val) {
  1420. this.member.paybackCompany = String(val)
  1421. },
  1422. reged(type) {
  1423. this.spinShow = true
  1424. if (type == 'pheHandler') { //手机号变动调用此方法 不重置公司名称
  1425. this.initialized({
  1426. excludeList: ['companyName']
  1427. })
  1428. } else {
  1429. this.initialized()
  1430. }
  1431. this.$request('/order/isOpenBig').data({// 验证手机号权限
  1432. buySubject: this.member.buySubject,
  1433. getContactOrder: 1,
  1434. phone: this.member.phone,
  1435. entName: (this.member.buySubject == '2') ? this.member.companyName : ''
  1436. }).success((res) => {
  1437. this.bigStas = res.data.Bigstatus
  1438. this.subStas = res.data.isSub
  1439. this.isYears = res.data.isYear // 0 开过大会员没超过一年,1 开过大会员超过一年, 2 没开过大会员
  1440. this.overTime = res.data.endTime
  1441. this.i_member_status = res.data.i_member_status || ''
  1442. this.areaCount = res.data.areaCount || 0
  1443. this.contactOrderList = res.data.contactOrder || [] // 关联订单列表
  1444. if (this.contactOrderList.length == 1) {
  1445. this.$set(this.contactOrderList[0], 'choose', true)
  1446. this.contactOrderchoose = this.contactOrderList[0]
  1447. this.member.contactOrderCode = this.contactOrderchoose.order_code
  1448. this.member.entId = this.contactOrderchoose.ent_id
  1449. }
  1450. // 补充 或延长 回显购买数量
  1451. if (this.member.products != 2 && (this.member.contract_nature == '1' && this.member.buySubject == '1' && (this.bigStas == 2 || this.bigStas == 1)) || (this.member.contract_nature == '2' && this.member.buySubject == '1')) {
  1452. this.member.buyCount = res.data.buyCount || ''
  1453. this.initbuyCount = res.data.buyCount || ''
  1454. }
  1455. this.stopTime = getDateSub('', res.data.endTime)
  1456. this.serData = []
  1457. this.pacData = []
  1458. this.datas2 = []
  1459. if (res.data.isYear == 0) {
  1460. this.yearStas = 10
  1461. } else if (res.data.isYear == 1) {
  1462. this.yearStas = 12
  1463. }
  1464. this.currentServer()
  1465. setTimeout(() => {
  1466. this.spinShow = false
  1467. if (this.member.buySubject != '2') {
  1468. if (res.data.comingIntoEffective) {
  1469. this.$Modal.warning({
  1470. title: '警告提示',
  1471. content: '该用户存在即将生效的大会员订单,无法创建新订单',
  1472. okText: '我知道了',
  1473. onOk: () => {
  1474. this.bShow = false
  1475. }
  1476. })
  1477. }
  1478. }
  1479. if (this.member.products == 1) {
  1480. if (this.member.buySubject != '2') {//主体为个体走原有逻辑
  1481. if (this.bigStas == 1) {
  1482. if (this.subStas == 1) {
  1483. this.colr = ''
  1484. this.downDis = false
  1485. if (this.nums == 0) {
  1486. this.getServed('')
  1487. this.sumSel = []
  1488. this.radioDis1 = false
  1489. this.radioDis2 = true
  1490. this.radioDis3 = true
  1491. // this.member.createType = '1'
  1492. this.repair = 1
  1493. this.monthTime = 60
  1494. }
  1495. } else {
  1496. this.downDis = true
  1497. if (this.nums == 0) {
  1498. this.getServed('')
  1499. this.sumSel = []
  1500. this.radioDis1 = true
  1501. this.radioDis2 = false
  1502. this.radioDis3 = false
  1503. // this.member.createType = '2'
  1504. if (this.member.contract_nature == '1' && this.member.buySubject == '1' && (this.bigStas == 2 || this.bigStas == 1)) {
  1505. this.repair = 2
  1506. }
  1507. this.monthTime = this.stopTime
  1508. }
  1509. }
  1510. } else {
  1511. this.colr = ''
  1512. if (this.nums == 0) {
  1513. this.creAuth = '1'
  1514. }
  1515. this.downDis = false
  1516. this.getServed('')
  1517. if (this.nums == 0) {
  1518. this.sumSel = []
  1519. this.radioDis1 = false
  1520. this.radioDis2 = true
  1521. this.radioDis3 = true
  1522. // this.member.createType = '1'
  1523. this.repair = 1
  1524. this.monthTime = 60
  1525. }
  1526. }
  1527. } else { //企业直接按新用户购买处理
  1528. this.colr = ''
  1529. if (this.nums == 0) {
  1530. this.creAuth = '1'
  1531. }
  1532. this.downDis = false
  1533. this.getServed('')
  1534. if (this.nums == 0) {
  1535. this.sumSel = []
  1536. this.radioDis1 = false
  1537. this.radioDis2 = true
  1538. this.radioDis3 = true
  1539. // this.member.createType = '1'
  1540. this.repair = 1
  1541. this.monthTime = 60
  1542. }
  1543. }
  1544. this.createdTypeChange()
  1545. } else if (this.member.products == 2) {
  1546. if (this.bigStas == 0 && this.contactOrderList.length == 0) {
  1547. if (this.subStas == 0) {
  1548. this.colr = '此手机号无大会员权限'
  1549. this.creAuth = ''
  1550. }
  1551. } else if (this.bigStas == 2) {
  1552. this.colr = '此手机号已有大会员权限,无需再次创建'
  1553. this.creAuth = ''
  1554. } else {
  1555. if (this.subStas == 1) {
  1556. this.colr = '此手机号已是大会员子账号'
  1557. this.creAuth = ''
  1558. } else {
  1559. this.colr = ''
  1560. if (this.nums == 0) {
  1561. this.creAuth = '2'
  1562. this.getServed('')
  1563. this.sumSel = []
  1564. }
  1565. }
  1566. }
  1567. } else if (this.member.products == 3) {
  1568. if (this.bigStas == 0) {
  1569. if (this.subStas == 0) {
  1570. this.colr = '此手机号无大会员权限'
  1571. this.creAuth = ''
  1572. }
  1573. } else if (this.bigStas == 2) {
  1574. this.colr = '此手机号已有大会员权限,无需再次创建'
  1575. this.creAuth = ''
  1576. } else {
  1577. if (this.subStas == 1) {
  1578. this.colr = '此手机号已是大会员子账号'
  1579. this.creAuth = ''
  1580. } else {
  1581. this.colr = ''
  1582. if (this.nums == 0) {
  1583. this.creAuth = '3'
  1584. }
  1585. this.getServed('')
  1586. this.sumSel = []
  1587. }
  1588. }
  1589. } else {
  1590. this.member.products = ''
  1591. }
  1592. // this.modifycreateType()
  1593. }, 500)
  1594. }).post()
  1595. },
  1596. disabledDateForVIPCallback(date) {
  1597. return date && date.valueOf() < Date.now() - 86400000;
  1598. },
  1599. pheHandler() {// 填写手机号并验证
  1600. this.member.phone = this.member.phone.replace(/[^\d]/g, '')
  1601. if (this.member.phone) {
  1602. if (this.pReadon) {
  1603. this.reged('pheHandler')
  1604. } else {
  1605. if ((/^1[3456789]\d{9}$/.test(this.member.phone))) {
  1606. this.reged('pheHandler')
  1607. }
  1608. }
  1609. }
  1610. },
  1611. proChange(val) {// 产品类型
  1612. // alert(val)
  1613. if (this.member.buySubject == '2' && val == '2' && !this.member.companyName) {
  1614. this.member.products = '1'
  1615. this.$Notice.warning({ title: '请输入公司名称' })
  1616. return
  1617. }
  1618. this.creAuth = this.member.products
  1619. this.datas2 = []
  1620. this.proNums = val
  1621. this.member.paySub = ''
  1622. this.member.freeSub = ''
  1623. this.member.orderMoney = 0
  1624. this.member.payMoney = ''
  1625. this.member.level = ''
  1626. this.member.contractUrl = ''
  1627. this.member.single = false
  1628. this.member.areaCount = 0
  1629. this.isAll = false
  1630. setTimeout(() => {
  1631. let uploads = this.$refs.uploadRef
  1632. if (uploads) {
  1633. this.$refs.uploadRef.uploadShow = false
  1634. this.$refs.uploadRef.payHtml = ''
  1635. }
  1636. }, 200)
  1637. if (val == 1) {
  1638. if (this.initbuyCount && this.vipDis) {
  1639. this.member.buyCount = this.initbuyCount
  1640. }
  1641. this.nums = ''
  1642. this.$request('/order/getCombo').data().success((res) => {// 获取大会员套餐
  1643. this.levelDown = []
  1644. // let newobj = {}
  1645. res.data.lists.forEach(v => {
  1646. if (v.id !== 4) {// 试用版
  1647. this.levelDown.push(v)
  1648. }
  1649. // if (v.id == 6) { // 商机版2.0
  1650. // newobj = JSON.parse(JSON.stringify(v))
  1651. // newobj.s_name = newobj.s_name + '(单省版)'
  1652. // this.levelDown.push(newobj)
  1653. // }
  1654. })
  1655. this.comVal = {
  1656. i_ispreinstall: 0,
  1657. i_price: '',
  1658. id: '',
  1659. l_createtime: "",
  1660. s_name: "自定义",
  1661. s_servers: ""
  1662. }
  1663. if (this.member.buySubject != '2') {//主体为个体走原有逻辑
  1664. if (this.bigStas == 1) {
  1665. if (this.subStas == 1) {
  1666. this.colr = ''
  1667. } else {
  1668. this.downDis = true
  1669. }
  1670. } else {
  1671. this.colr = ''
  1672. this.downDis = false
  1673. }
  1674. } else { //主体为企业直接走新购买逻辑
  1675. this.colr = ''
  1676. this.downDis = false
  1677. }
  1678. if (this.member.products == '1') {
  1679. this.createdTypeChange()
  1680. }
  1681. }).get()
  1682. }
  1683. if (val == 2 || val == 3) {
  1684. this.member.buyCount = '' // 切换套餐重置数量
  1685. this.nums = '2'
  1686. if (this.bigStas == 0 && this.contactOrderList.length == 0) {
  1687. if (this.subStas == 0) {
  1688. this.colr = '此手机号无大会员权限'
  1689. this.creAuth = ''
  1690. }
  1691. } else if (this.bigStas == 2) {
  1692. this.colr = '此手机号已有大会员权限,无需再次创建'
  1693. this.creAuth = ''
  1694. } else {
  1695. if (this.subStas == 1) {
  1696. this.colr = '此手机号已是大会员子账号'
  1697. this.creAuth = ''
  1698. } else {
  1699. this.colr = ''
  1700. }
  1701. }
  1702. // 选择子账号货补充包回显销售渠道
  1703. if (this.member.salesChannel) {
  1704. this.$nextTick(() => {
  1705. this.$refs.casRef.getDictItem(() => {
  1706. this.$refs.casRef.setDate(this.member.salesChannel)
  1707. })
  1708. })
  1709. }
  1710. }
  1711. if (val == 2) { // 选择子账号 默认为不签协议
  1712. this.member.agreementStatus = '0'
  1713. if (this.member.phone) {
  1714. if (this.pReadon) {
  1715. this.reged('pheHandler')
  1716. } else {
  1717. if ((/^1[3456789]\d{9}$/.test(this.member.phone))) {
  1718. this.reged('pheHandler')
  1719. }
  1720. }
  1721. }
  1722. }
  1723. if (val == 3) {
  1724. this.getServed('')
  1725. }
  1726. },
  1727. tipFunc(val) {
  1728. return val.toLocaleString('zh', { style: 'currency', currency: 'CNY' })
  1729. },
  1730. currentServer(phone_, callback) {// 获取用户当前已享有的服务
  1731. this.$request('/order/getCurrentServer').data({
  1732. phone: phone_ ? phone_ : this.member.phone
  1733. }).success((res) => {
  1734. this.currentId = res.data.list
  1735. try {
  1736. if (callback) {
  1737. callback(res)
  1738. }
  1739. } catch (e) {
  1740. // console.log(e)
  1741. }
  1742. }).post()
  1743. },
  1744. unitChange(data) {// 有效周期选择单位
  1745. if (data == 1) {
  1746. this.placed = '请输入有效周期(单位 天)'
  1747. this.max_length = 4
  1748. } else {
  1749. this.max_length = 2
  1750. this.placed = '请输入有效周期(单位(月),最多输入' + this.monthTime + '个月)'
  1751. }
  1752. },
  1753. leChange(val) {// 会员套餐
  1754. console.log(val)
  1755. if (!val) return
  1756. this.initialized({
  1757. excludeList: ['companyName']
  1758. })
  1759. val = JSON.parse(val)
  1760. this.datas2 = []
  1761. this.sArr = []
  1762. this.combo_id = val
  1763. this.nums = val.i_ispreinstall // 0
  1764. if (this.pReadon) {
  1765. this.myNoTchange()
  1766. }
  1767. if (val.i_ispreinstall == 0) {
  1768. if (this.member.buySubject != '2') {//主体为个体走原有逻辑
  1769. if (this.bigStas == 1) {
  1770. if (this.subStas == 1) {
  1771. this.radioDis1 = false
  1772. this.radioDis2 = true
  1773. this.radioDis3 = true
  1774. // this.member.createType = '1'
  1775. this.repair = '1'
  1776. this.monthTime = 60
  1777. if (!this.showOrderStatus && !this.pReadon) {
  1778. this.myNoTchange()
  1779. }
  1780. } else {
  1781. this.radioDis1 = true
  1782. this.radioDis2 = false
  1783. this.radioDis3 = false
  1784. // this.member.createType = '2'
  1785. this.repair = '2'
  1786. this.monthTime = this.stopTime
  1787. }
  1788. } else {
  1789. this.radioDis1 = false
  1790. this.radioDis2 = true
  1791. this.radioDis3 = true
  1792. // this.member.createType = '1'
  1793. this.repair = '1'
  1794. this.monthTime = 60
  1795. if (!this.showOrderStatus && !this.pReadon) {
  1796. this.myNoTchange()
  1797. }
  1798. }
  1799. } else {
  1800. this.radioDis1 = false
  1801. this.radioDis2 = true
  1802. this.radioDis3 = true
  1803. // this.member.createType = '1'
  1804. this.repair = '1'
  1805. this.monthTime = 60
  1806. if (!this.showOrderStatus && !this.pReadon) {
  1807. this.myNoTchange()
  1808. }
  1809. }
  1810. this.getServed('')
  1811. } else {
  1812. // this.member.createType = ''
  1813. if (!this.showOrderStatus && !this.pReadon) {
  1814. this.myNoTchange()
  1815. }
  1816. }
  1817. if (val.i_ispreinstall == 1 || val.i_ispreinstall == null) {
  1818. this.getServed(val)
  1819. // this.currentServer()
  1820. this.valComs = val // 固定套餐
  1821. this.monthTime = 60
  1822. }
  1823. // this.modifycreateType()
  1824. },
  1825. leSelect(e) {
  1826. console.log(e)
  1827. let val = JSON.parse(e.value)
  1828. if (val.i_ispreinstall == 1) {
  1829. this.datas1.splice(0, 1, {
  1830. name: val.s_name,
  1831. price: val.i_price,
  1832. count: ''
  1833. })
  1834. } else {
  1835. this.datas1[0] = {}
  1836. }
  1837. },
  1838. radiosChangelevel(val) { // 单选会员套餐控件 change
  1839. this.leSelect({ value: val })
  1840. this.leChange(val)
  1841. let obj = JSON.parse(val)
  1842. if (obj.s_name && obj.s_name.indexOf('单省版') > -1) { // 商机2.0单省版 规格和地区数字段赋值
  1843. this.member.single = true
  1844. this.member.areaCount = 1
  1845. } else {
  1846. this.member.single = false
  1847. this.member.areaCount = 0
  1848. }
  1849. if (this.firstOpen) {
  1850. this.firstOpen = false
  1851. if (this.member.salesChannel && this.nums !== '' && this.creAuth) {
  1852. this.$nextTick(() => {
  1853. this.$refs.casRef.getDictItem(() => {
  1854. this.$refs.casRef.setDate(this.member.salesChannel)
  1855. })
  1856. })
  1857. }
  1858. }
  1859. },
  1860. serChange(val) {// 选择服务
  1861. if (val == 1) {
  1862. this.monthTime = 60
  1863. } else if (val == 2) {
  1864. this.monthTime = this.stopTime
  1865. } else if (val == 3) {
  1866. this.monthTime = 60 - this.stopTime
  1867. }
  1868. this.datas2 = []
  1869. this.initialized()
  1870. this.repair = val
  1871. this.getServed('')
  1872. },
  1873. cycleTime() {
  1874. let curTime = new Date().getTime()
  1875. let cycTime = getDateSub(this.member.beginTime, this.overTime)
  1876. if (this.repair == 2) {
  1877. if (this.member.beginTime * 1000 > curTime) {
  1878. this.monthTime = cycTime
  1879. if (this.member.payCycle <= cycTime) {
  1880. this.member.payCycle = this.member.payCycle.replace(/[^\d]+/g, '')
  1881. } else {
  1882. this.member.payCycle = ''
  1883. }
  1884. } else {
  1885. this.monthTime = this.stopTime
  1886. }
  1887. }
  1888. },
  1889. peChange() {// 有效周期
  1890. let arr2 = []
  1891. if (this.nums == 0) {
  1892. this.sumSel.forEach(v => {
  1893. // if (v.id != 1) {
  1894. arr2.push(v.id)
  1895. // }
  1896. })
  1897. if (arr2.length != 0) {
  1898. this.moneyFunc(this.valComs)// 大会员订单价格
  1899. } else {
  1900. this.member.bigMoney = 0
  1901. }
  1902. if (this.repair == '3') {
  1903. this.moneyFunc(this.valComs)// 大会员订单价格
  1904. }
  1905. } else {
  1906. this.moneyFunc(this.valComs)// 大会员订单价格
  1907. }
  1908. this.packsPrice() // 补充包价格
  1909. },
  1910. cycleHandler() {// 有效周期
  1911. if (this.member.cycleType == '0') {//选择月保持原有逻辑
  1912. if (this.nums == 0) {
  1913. if (this.repair == 1) {
  1914. if (this.member.payCycle <= 60) {
  1915. this.member.payCycle = this.member.payCycle.replace(/[^\d]+/g, '')
  1916. } else {
  1917. this.member.payCycle = ''
  1918. }
  1919. } else if (this.repair == 2) {
  1920. if (this.member.payCycle <= this.stopTime) {
  1921. this.member.payCycle = this.member.payCycle.replace(/[^\d]+/g, '')
  1922. } else {
  1923. this.member.payCycle = ''
  1924. }
  1925. this.cycleTime()
  1926. } else if (this.repair == 3) {
  1927. if (this.member.payCycle <= 60 - this.stopTime) {
  1928. this.member.payCycle = this.member.payCycle.replace(/[^\d]+/g, '')
  1929. } else {
  1930. this.member.payCycle = ''
  1931. }
  1932. }
  1933. } else {
  1934. if (this.member.payCycle <= 60) {
  1935. this.member.payCycle = this.member.payCycle.replace(/[^\d]+/g, '')
  1936. } else {
  1937. this.member.payCycle = ''
  1938. }
  1939. }
  1940. } else {//选择天只过滤字母
  1941. this.member.payCycle = this.member.payCycle.replace(/[^\d]+/g, '')
  1942. }
  1943. if (!this.member.payCycle) {
  1944. this.member.bigMoney = 0
  1945. }
  1946. },
  1947. timeReg(val) {
  1948. return new Date(dateFormatter(val, 'yyyy-MM-dd') + ' 00:00:00').getTime() / 1000
  1949. },
  1950. moneyChange(num) {
  1951. if (num == 0) {
  1952. if (this.member.products != '1') {
  1953. this.shiDis = true
  1954. this.member.payMoney = ''
  1955. } else {
  1956. this.allDis = true
  1957. }
  1958. } else {
  1959. if (this.member.products != '1') {
  1960. this.shiDis = false
  1961. } else {
  1962. this.allDis = false
  1963. }
  1964. }
  1965. if (this.member.bigMoney == 0 || this.allDis) {
  1966. this.bigDis = true
  1967. this.member.bigPayMoney = ''
  1968. } else {
  1969. this.bigDis = false
  1970. }
  1971. if (this.member.paySub == '' || this.allDis) {
  1972. this.subDis = true
  1973. this.member.subPayMoney = ''
  1974. } else {
  1975. this.subDis = false
  1976. }
  1977. if (this.member.supplyMoney == 0 || this.allDis) {
  1978. this.supplyDis = true
  1979. this.member.supplyPayMoney = ''
  1980. } else {
  1981. this.supplyDis = false
  1982. }
  1983. },
  1984. startDate(val) {
  1985. if (this.pReadon) {
  1986. this.$nextTick(() => {
  1987. if (this.$refs.sigleRef1 !== undefined) {
  1988. this.$refs.sigleRef1.dataVals = '2099-01-01'
  1989. this.member.beginTime = this.timeReg('2099-01-01')
  1990. }
  1991. })
  1992. } else {
  1993. if (val) {
  1994. this.member.beginTime = this.timeReg(val)
  1995. } else {
  1996. this.member.beginTime = ''
  1997. }
  1998. this.cycleTime()
  1999. }
  2000. },
  2001. orderDate(val) {
  2002. this.member.createTime = val
  2003. },
  2004. agreeDate(val) {
  2005. this.member.agreementTime = val
  2006. this.keyupformat('paybackWorkDayNum')
  2007. },
  2008. agreementStatusChange() {
  2009. this.keyupformat('paybackWorkDayNum')
  2010. },
  2011. noTchange(val) {
  2012. if (val) {
  2013. this.noPass = true
  2014. this.$refs.sigleRef1.dataVals = '2099-01-01'
  2015. this.member.beginTime = this.timeReg('2099-01-01')
  2016. } else {
  2017. this.$refs.sigleRef1.dataVals = ''
  2018. this.member.beginTime = ''
  2019. this.member.paybackOpenServer = false // 不勾选暂不开通 回款自动开通默认不勾选
  2020. }
  2021. },
  2022. myNoTchange() {
  2023. this.$nextTick(() => {
  2024. this.noPass = true
  2025. if (this.$refs.sigleRef1 !== undefined) {
  2026. this.$refs.sigleRef1.dataVals = '2099-01-01'
  2027. this.member.beginTime = this.timeReg('2099-01-01')
  2028. }
  2029. })
  2030. },
  2031. payBlur() {
  2032. if (this.member.paySub) {
  2033. this.datas1.splice(1, 1, {
  2034. name: '子账号',
  2035. price: 2000,
  2036. count: this.member.paySub
  2037. })
  2038. }
  2039. },
  2040. payHandler() {// 子账号金额
  2041. this.member.paySub = this.member.paySub.replace(/[^\d]+/g, '')
  2042. },
  2043. payChange() {
  2044. if (this.member.buyCount) { // 子账号数量 为购买数量-1 主账号1个
  2045. this.member.paySub = this.member.buyCount - 1
  2046. }
  2047. if (this.creAuth == 2) { // 子账号
  2048. // this.member.orderMoney = parseInt(this.member.paySub==''?0:this.member.paySub) * 2000
  2049. }
  2050. // this.member.subMoney = parseInt(this.member.paySub==''?0:this.member.paySub) * 2000
  2051. if (!this.member.paySub || this.allDis) {
  2052. this.subDis = true
  2053. this.member.subPayMoney = ''
  2054. } else {
  2055. this.subDis = false
  2056. }
  2057. this.allSum() // 总计
  2058. },
  2059. freeHandler() {
  2060. this.member.freeSub = this.member.freeSub.replace(/[^\d]+/g, '')
  2061. },
  2062. buyHandler() {
  2063. this.member.buyCount = this.member.buyCount.replace(/[^\d]+/g, '')
  2064. },
  2065. contractFile(val) {
  2066. this.member.contractUrl = val
  2067. },
  2068. fixedNum(val) {
  2069. return val ? Number(parseFloat(val * 100).toFixed(0)) : 0
  2070. },
  2071. saleDate(val) {
  2072. this.member.sale_time = val + ' 00:00:00'
  2073. },
  2074. guiDate(val) {
  2075. this.member.contract_archive_time = val + ' 00:00:00'
  2076. },
  2077. salePerson(val) {
  2078. this.member.salesPerson = val
  2079. let saleNameArr = []
  2080. val.forEach(v => {
  2081. let vjson = JSON.parse(v)
  2082. saleNameArr.push({ name: vjson.username, money: 0 })
  2083. })
  2084. saleNameArr.push({ name: '合计' })
  2085. this.saleTableData = saleNameArr
  2086. this.updateSaleMoney()
  2087. },
  2088. urlReq(url, obj) {
  2089. this.isDisable = true
  2090. this.$request(url).data(
  2091. obj
  2092. ).success(() => {
  2093. this.bShow = false
  2094. if (obj.save === '1') {
  2095. this.$Message.success({ content: '提交成功' })
  2096. } else if (obj.save === '2') {
  2097. this.$Message.success({ content: '暂存成功' })
  2098. }
  2099. // this.$Message.success({content: '提交成功'})
  2100. this.$parent.reload()
  2101. setTimeout(() => {
  2102. this.isDisable = false
  2103. }, 1000)
  2104. }).error(() => {
  2105. this.isDisable = false
  2106. }).post()
  2107. },
  2108. ordConfirm(params) { //提交
  2109. console.log(params)
  2110. if (!this.member.salesChannel || this.member.salesChannel == undefined || this.member.salesChannel == 'undefined') {
  2111. this.$Notice.warning({ title: '请选择销售渠道' })
  2112. return
  2113. }
  2114. if (this.member.buySubject == '') {
  2115. this.$Notice.warning({ title: '请选择购买主体' })
  2116. return
  2117. }
  2118. if (!this.saleCode) {
  2119. this.$Notice.warning({ title: '请选择业绩归属部门' })
  2120. return
  2121. }
  2122. if (!this.member.payType) {
  2123. this.$Notice.warning({ title: '请选择约定支付方式' })
  2124. return
  2125. }
  2126. if (this.member.phone == '') {
  2127. this.$Notice.warning({ title: '请输入手机号' })
  2128. return
  2129. }
  2130. if (this.member.phone && !this.noPhone && !/^1[3456789]\d{9}$/.test(this.member.phone)) {
  2131. this.$Notice.warning({ title: '手机号格式不正确' })
  2132. return
  2133. }
  2134. if (this.member.products == '') {
  2135. this.$Notice.warning({ title: '请选择产品类型' })
  2136. return
  2137. }
  2138. if (!this.member.paybackCompany) {
  2139. this.$Notice.warning({ title: '请选择签约主体' })
  2140. return
  2141. }
  2142. // if(this.member.billingMode !== 0 && this.member.billingMode !== 1){
  2143. // this.$Notice.warning({title: '请选择计费模式'})
  2144. // return
  2145. // }
  2146. if (this.showOnlineContractForm) {
  2147. // 如购买主体或甲方类型为“企业”,则公司名称必填
  2148. const entMark = this.member.buySubject == '2' || this.member.e_contract_userA_type == 2
  2149. if (entMark && !this.member.companyName) {
  2150. this.$Notice.warning({ title: '公司名称必填' })
  2151. return
  2152. }
  2153. if (!this.member.e_contract_type) {
  2154. this.$Notice.warning({ title: '电子协议类型必填' })
  2155. return
  2156. }
  2157. // if (!this.member.e_contract_userA_type) {
  2158. // this.$Notice.warning({title: '协议甲方类型必填'})
  2159. // return
  2160. // }
  2161. // if (!this.member.e_contract_userA_name) {
  2162. // this.$Notice.warning({title: '协议甲方必填'})
  2163. // return
  2164. // }
  2165. // if (!this.member.e_contract_userA_contacts_name) {
  2166. // this.$Notice.warning({title: '协议甲方联系人必填'})
  2167. // return
  2168. // }
  2169. // if (!this.member.e_contract_userA_contacts_tel) {
  2170. // this.$Notice.warning({title: '协议甲方联系方式必填'})
  2171. // return
  2172. // }
  2173. // if (!this.member.e_contract_userA_contacts_address) {
  2174. // this.$Notice.warning({title: '协议甲方联系地址必填'})
  2175. // return
  2176. // }
  2177. if (!this.member.e_contract_userB_contacts_name) {
  2178. this.$Notice.warning({ title: '协议乙方联系人必填' })
  2179. return
  2180. }
  2181. }
  2182. if (this.member.buySubject == '2') {
  2183. if (this.member.buyCount == '') {
  2184. this.$Notice.warning({ title: '请输入购买数量' })
  2185. return
  2186. }
  2187. if (this.member.buyCount <= 0) {
  2188. this.$Notice.warning({ title: '请输入大于0的数量' })
  2189. return
  2190. }
  2191. }
  2192. if (this.member.paybackNum == '') {
  2193. this.$Notice.warning({ title: '请输入回款次数' })
  2194. return
  2195. }
  2196. console.log(this.paybackTableData)
  2197. if (this.member.paybackNum > 1 && !this.paybackTableData.every(item => item.time && item.money)) {
  2198. this.$Notice.warning({ title: '请填写完整回款计划' })
  2199. return
  2200. }
  2201. if (this.member.paybackNum == 1 && !this.member.paybackExpectDate) {
  2202. this.$Notice.warning({ title: '请输入回款计划工作日' })
  2203. return
  2204. }
  2205. if (this.saleTableData) {
  2206. let isOk = true
  2207. this.saleTableData.forEach(v => {
  2208. if (v.name === '合计') {
  2209. // let money = Number(this.member.payMoney)+Number(this.member.bigPayMoney)+Number(this.member.subPayMoney)+Number(this.member.supplyPayMoney)-Number(this.member.commission)-Number(this.member.proceduresMoney)
  2210. let money
  2211. if (this.member.payMoney) {
  2212. money = Number(this.member.payMoney) - Number(this.member.commission) - Number(this.member.proceduresMoney)
  2213. } else {
  2214. money = Number(this.member.bigPayMoney) + Number(this.member.subPayMoney) + Number(this.member.supplyPayMoney) - Number(this.member.commission) - Number(this.member.proceduresMoney)
  2215. }
  2216. if (Number(v.money) > money) {
  2217. this.$Notice.warning({ title: '业绩金额大于合同金额' })
  2218. isOk = false
  2219. }
  2220. }
  2221. })
  2222. if (!isOk) {
  2223. return
  2224. }
  2225. }
  2226. let serveData = []
  2227. this.datas2.forEach(v => {
  2228. serveData.push({
  2229. id: v.id,
  2230. name: v.name,
  2231. price: v.price,
  2232. count: v.count * v.s_pkcount
  2233. })
  2234. })
  2235. // 服务列表参数处理
  2236. let saleNameArr = []
  2237. let saleIdArr = []
  2238. this.member.salesPerson.forEach(v => {
  2239. let vjson = JSON.parse(v)
  2240. saleNameArr.push(vjson.username)
  2241. saleIdArr.push(vjson.id)
  2242. })
  2243. let saleName = saleNameArr.join(',')
  2244. let saleId = saleIdArr.join(',')
  2245. // 回款列表参数处理
  2246. this.member.paybackList = this.paybackTableData
  2247. // 提交集合部分
  2248. if (this.proNums == 1) {// 大会员
  2249. if (this.nums == 0) {
  2250. this.getserveIdAndname()
  2251. var serId = this.form_serve.ids
  2252. var serName = this.form_serve.names
  2253. }
  2254. // 服务ID获取旧逻辑
  2255. // if (this.nums == 0) {
  2256. // if (this.sumSel.length == 0) {
  2257. // if (this.sArr.length == 0) {
  2258. // // return
  2259. // } else {
  2260. // this.sArr.forEach(j => {
  2261. // serId.push(j.id)
  2262. // serName.push(j.s_name)
  2263. // })
  2264. // }
  2265. // } else {
  2266. // this.sumSel.forEach(k => {
  2267. // serId.push(k.id)
  2268. // serName.push(k.s_name)
  2269. // })
  2270. // }
  2271. // }
  2272. // 服务ID获取旧逻辑 结束
  2273. if (!this.member.payMoney) { // 合同金额为0 则计费模式置为免费
  2274. this.member.billingMode = 0
  2275. } else {
  2276. this.member.billingMode = 1
  2277. }
  2278. // 会员套餐参数处理
  2279. let newlevel = ''
  2280. if (this.member.single) {
  2281. newlevel = 6
  2282. } else {
  2283. newlevel = JSON.parse(this.member.level).id ? JSON.parse(this.member.level).id : 5// 5自定义
  2284. }
  2285. let obj = {
  2286. ...params,
  2287. contract_nature: this.member.contract_nature,
  2288. createTime: this.member.createTime,
  2289. phone: this.member.phone,
  2290. buySubject: this.member.buySubject,//主体
  2291. buyCount: this.member.buyCount,//购买数量
  2292. products: '',// 产品类型不需要传(传空)
  2293. billingMode: this.member.billingMode === '' ? 999 : this.member.billingMode,
  2294. level: newlevel,
  2295. // this.nums == 1 ? JSON.parse(this.member.level).id : 5,
  2296. payCycle: this.member.payCycle,
  2297. cycleType: this.member.cycleType,
  2298. startTime: this.member.createType == 2 || this.member.createType == 3 ? '' : this.member.beginTime,
  2299. paySub: this.member.paySub,
  2300. freeSub: this.member.freeSub,
  2301. bigMoney: this.fixedNum(this.member.bigMoney),
  2302. subMoney: this.fixedNum(this.member.subMoney),
  2303. supplyMoney: this.fixedNum(this.member.supplyMoney),
  2304. orderMoney: this.fixedNum(this.member.orderMoney),
  2305. contractUrl: this.member.contractUrl,
  2306. isAll: this.isAll ? 1 : this.member.contractUrl ? 3 : 2,
  2307. bigPayMoney: this.member.billingMode == 0 ? 0 : this.fixedNum(this.member.bigPayMoney),
  2308. subPayMoney: this.member.billingMode == 0 ? 0 : this.fixedNum(this.member.subPayMoney),
  2309. supplyPayMoney: this.member.billingMode == 0 ? 0 : this.fixedNum(this.member.supplyPayMoney),
  2310. payMoney: this.fixedNum(this.member.payMoney),
  2311. createType: this.member.createType,
  2312. // this.nums == 0 ? this.member.createType : '1',
  2313. comboId: this.member.single ? 6 : this.combo_id.id,
  2314. serversId: this.nums == 0 ? String(serId) : '',
  2315. serversName: this.nums == 0 ? String(serName) : '',
  2316. serversArr: serveData,
  2317. commission: this.fixedNum(this.member.commission),
  2318. proceduresMoney: this.fixedNum(this.member.proceduresMoney),
  2319. companyName: this.member.companyName,
  2320. agreementStatus: this.member.agreementStatus == '0' || this.member.agreementStatus == '1' ? this.member.agreementStatus : 999,
  2321. agreementTime: this.member.agreementStatus !== 0 ? this.timeReg(this.member.agreementTime) : '',
  2322. agreementNumber: this.member.agreementStatus !== '' ? this.member.agreementNumber : '',
  2323. salesChannel: this.member.salesChannel,
  2324. orderChannel: this.member.orderChannel ? this.member.orderChannel : 'd01',
  2325. paybackCompany: this.member.paybackCompany ? this.member.paybackCompany : 'h01',
  2326. remark: this.member.remark,
  2327. order_status: this.member.order_status,
  2328. sale_time: this.member.sale_time,
  2329. contract_archive_status: this.member.agreementStatus == '1' ? this.member.contract_archive_status : '',
  2330. contract_archive_time: this.member.agreementStatus == '1' ? this.member.contract_archive_time : '',
  2331. contract_archive_num: this.member.agreementStatus == '1' ? this.member.contract_archive_num : '',
  2332. areaCount: this.member.areaCount,
  2333. salesPerson: saleName,
  2334. salesPersonId: saleId,
  2335. saleDep: this.saleCode,
  2336. payType: this.member.payType,
  2337. saleMoney: JSON.stringify({ data: this.saleTableData }),
  2338. // 电子协议相关
  2339. e_contract_type: this.member.e_contract_type, // 电子协议类型
  2340. e_contract_userA_type: this.member.e_contract_userA_type, // 协议甲方类型
  2341. e_contract_userA_name: this.member.e_contract_userA_name, // 协议甲方
  2342. e_contract_userA_contacts_name: this.member.e_contract_userA_contacts_name, // 协议甲方联系人
  2343. e_contract_userA_contacts_tel: this.member.e_contract_userA_contacts_tel, // 协议甲方联系方式
  2344. e_contract_userA_contacts_address: this.member.e_contract_userA_contacts_address, // 协议甲方联系地址
  2345. e_contract_userB_contacts_name: this.member.e_contract_userB_contacts_name, // 协议乙方联系人
  2346. e_contract_remark: this.member.e_contract_remark, // 协议备注
  2347. paybackExpectDate: this.member.paybackNum == 1 ? this.member.paybackExpectDate : "", // 回款日期
  2348. paybackWorkDayNum: this.member.paybackNum == 1 ? this.member.paybackWorkDayNum : "", // 回款天数
  2349. paybackOpenServer: this.member.paybackOpenServer, // 回款开通服务
  2350. paybackNum: this.member.paybackNum, // 回款次数
  2351. paybackList: this.member.paybackNum > 1 ? JSON.stringify(this.member.paybackList) : '', // 回款列表
  2352. oldSerName: this.buyserveName || ''
  2353. }
  2354. if (this.showOrderStatus) {
  2355. this.urlReq('/order/createBigOrder', obj)
  2356. } else {
  2357. this.urlReq('/order/myCreateBigOrder', obj)
  2358. }
  2359. } else if (this.proNums == 2) {// 子账号
  2360. let obj = {
  2361. ...params,
  2362. entId: this.member.entId,
  2363. contactOrderCode: this.member.contactOrderCode || '',
  2364. contract_nature: this.member.contract_nature,
  2365. createTime: this.member.createTime,
  2366. phone: this.member.phone,
  2367. products: '',// 产品类型不需要传(传空)
  2368. buySubject: this.member.buySubject,//主体
  2369. buyCount: this.member.buyCount,//购买数量
  2370. billingMode: this.member.billingMode === '' ? 999 : this.member.billingMode,
  2371. paySub: this.member.paySub,
  2372. freeSub: this.member.freeSub,
  2373. orderMoney: this.fixedNum(this.member.orderMoney),
  2374. contractUrl: this.member.contractUrl,
  2375. isAll: this.isAll ? 1 : this.member.contractUrl ? 3 : 2,
  2376. payMoney: this.fixedNum(this.member.payMoney),
  2377. commission: this.fixedNum(this.member.commission),
  2378. proceduresMoney: this.fixedNum(this.member.proceduresMoney),
  2379. companyName: this.member.companyName,
  2380. agreementStatus: this.member.agreementStatus == '0' || this.member.agreementStatus == '1' ? this.member.agreementStatus : 999,
  2381. agreementTime: this.member.agreementStatus !== '' ? this.timeReg(this.member.agreementTime) : '',
  2382. agreementNumber: this.member.agreementStatus !== '' ? this.member.agreementNumber : '',
  2383. salesChannel: this.member.salesChannel,
  2384. orderChannel: this.member.orderChannel ? this.member.orderChannel : 'd01',
  2385. paybackCompany: this.member.paybackCompany ? this.member.paybackCompany : 'h01',
  2386. remark: this.member.remark,
  2387. order_status: this.member.order_status,
  2388. sale_time: this.member.sale_time,
  2389. contract_archive_status: this.member.agreementStatus == '1' ? this.member.contract_archive_status : '',
  2390. contract_archive_time: this.member.agreementStatus == '1' ? this.member.contract_archive_time : '',
  2391. contract_archive_num: this.member.agreementStatus == '1' ? this.member.contract_archive_num : '',
  2392. salesPerson: saleName,
  2393. salesPersonId: saleId,
  2394. saleDep: this.saleCode,
  2395. payType: this.member.payType,
  2396. saleMoney: JSON.stringify({ data: this.saleTableData }),
  2397. paybackExpectDate: this.member.paybackNum == 1 ? this.member.paybackExpectDate : "", // 回款日期
  2398. paybackWorkDayNum: this.member.paybackNum == 1 ? this.member.paybackWorkDayNum : "", // 回款天数
  2399. paybackOpenServer: this.member.paybackOpenServer, // 回款开通服务
  2400. paybackNum: this.member.paybackNum, // 回款次数
  2401. paybackList: this.member.paybackNum > 1 ? JSON.stringify(this.member.paybackList) : '', // 回款列表
  2402. }
  2403. if (!this.member.contactOrderCode) {
  2404. this.$Notice.warning({ title: '请选择关联订单' })
  2405. return
  2406. }
  2407. if (this.showOrderStatus) {
  2408. this.urlReq('/order/createSubOrder', obj)
  2409. } else {
  2410. this.urlReq('/order/myCreateSubOrder', obj)
  2411. }
  2412. } else if (this.proNums == 3) {// 补充包
  2413. let obj = {
  2414. ...params,
  2415. contract_nature: this.member.contract_nature,
  2416. createTime: this.member.createTime,
  2417. phone: this.member.phone,
  2418. products: '',// 产品类型不需要传(传空)
  2419. billingMode: this.member.billingMode === '' ? 999 : this.member.billingMode,
  2420. serversArr: serveData,
  2421. orderMoney: this.fixedNum(this.member.orderMoney),
  2422. buySubject: this.member.buySubject,//主体
  2423. buyCount: this.member.buyCount,//购买数量
  2424. contractUrl: this.member.contractUrl,
  2425. isAll: this.isAll ? 1 : this.member.contractUrl ? 3 : 2,
  2426. payMoney: this.fixedNum(this.member.payMoney),
  2427. commission: this.fixedNum(this.member.commission),
  2428. proceduresMoney: this.fixedNum(this.member.proceduresMoney),
  2429. companyName: this.member.companyName,
  2430. agreementStatus: this.member.agreementStatus == '0' || this.member.agreementStatus == '1' ? this.member.agreementStatus : 999,
  2431. agreementTime: this.member.agreementStatus !== '' ? this.timeReg(this.member.agreementTime) : '',
  2432. agreementNumber: this.member.agreementStatus !== '' ? this.member.agreementNumber : '',
  2433. salesChannel: this.member.salesChannel,
  2434. orderChannel: this.member.orderChannel ? this.member.orderChannel : 'd01',
  2435. paybackCompany: this.member.paybackCompany ? this.member.paybackCompany : 'h01',
  2436. remark: this.member.remark,
  2437. order_status: this.member.order_status,
  2438. sale_time: this.member.sale_time,
  2439. contract_archive_status: this.member.agreementStatus == '1' ? this.member.contract_archive_status : '',
  2440. contract_archive_time: this.member.agreementStatus == '1' ? this.member.contract_archive_time : '',
  2441. contract_archive_num: this.member.agreementStatus == '1' ? this.member.contract_archive_num : '',
  2442. salesPerson: saleName,
  2443. salesPersonId: saleId,
  2444. saleDep: this.saleCode,
  2445. payType: this.member.payType,
  2446. saleMoney: JSON.stringify({ data: this.saleTableData }),
  2447. paybackExpectDate: this.member.paybackNum == 1 ? this.member.paybackExpectDate : "", // 回款日期
  2448. paybackWorkDayNum: this.member.paybackNum == 1 ? this.member.paybackWorkDayNum : "", // 回款天数
  2449. paybackOpenServer: this.member.paybackOpenServer, // 回款开通服务
  2450. paybackNum: this.member.paybackNum, // 回款次数
  2451. paybackList: this.member.paybackNum > 1 ? JSON.stringify(this.member.paybackList) : '', // 回款列表
  2452. }
  2453. if (this.showOrderStatus) {
  2454. this.urlReq('/order/createSupplyOrder', obj)
  2455. } else {
  2456. this.urlReq('/order/myCreateSupplyOrder', obj)
  2457. }
  2458. }
  2459. },
  2460. ordCancel() {
  2461. // this.$refs.casRef.values = []
  2462. this.member.saleCodeModel = []
  2463. this.saleTableData = []
  2464. this.bShow = false
  2465. },
  2466. visibleChange(val) { // 调起弹窗
  2467. if (val == false) {
  2468. setTimeout(() => {
  2469. // 初始回款次数
  2470. this.member.paybackNum = 1
  2471. this.showXieYi = false
  2472. this.colr = ''
  2473. this.creAuth = ''
  2474. // 产品类型类型初始为大会员
  2475. this.member.products = '1'
  2476. this.member.contract_nature = '1'
  2477. this.member.phone = ''
  2478. //this.member.salesPerson = ''
  2479. this.member.billingMode = ''
  2480. this.member.level = ''
  2481. // this.member.createType = ''
  2482. this.member.order_status = '1'
  2483. this.member.buySubject = ''
  2484. this.member.buyCount = ''
  2485. this.nums = ''
  2486. this.serData = []
  2487. this.member.saleCodeModel = []
  2488. this.saleTableData = []
  2489. this.spinShow = false
  2490. this.noPhone = false
  2491. this.noPass = false
  2492. this.pReadon = false
  2493. this.member.salesChannel = ''
  2494. this.member.orderChannel = 'd01'
  2495. this.member.paybackCompany = 'h01'
  2496. //this.$refs.saleRef.salePerson = ''
  2497. // this.$refs.casRef.values = []
  2498. let sigs2 = this.$refs.sigleRef2
  2499. let sigs3 = this.$refs.casRef1
  2500. let sigs4 = this.$refs.casRef2
  2501. if (sigs2) {
  2502. this.$refs.sigleRef2.initd()
  2503. }
  2504. if (sigs3) {
  2505. this.$refs.casRef1.values = ['d01']
  2506. }
  2507. if (sigs4) {
  2508. this.$refs.casRef2.values = ['h01']
  2509. }
  2510. this.initialized()
  2511. }, 500)
  2512. } else {
  2513. this.firstOpen = true
  2514. this.creAuth = ''
  2515. this.isDisable = false
  2516. //业绩部门
  2517. this.saleDepClick()
  2518. setTimeout(() => {
  2519. if (this.$refs.saleRef) {
  2520. this.$refs.saleRef.setDefaultPerson = this.$store.getters.getAdminUser.username
  2521. this.$refs.saleRef.personData()
  2522. }
  2523. }, 1000)
  2524. // 产品类型类型初始为大会员 获取套餐信息
  2525. this.member.products = '1'
  2526. this.proChange(this.member.products)
  2527. this.getNewservedata()
  2528. }
  2529. },
  2530. areaCountClick(val) { // 处理单省版 radio 选中后取消
  2531. if (this.member.single) {
  2532. this.member.single = false
  2533. this.member.areaCount = 0
  2534. } else {
  2535. this.member.single = true
  2536. this.member.areaCount = val
  2537. }
  2538. },
  2539. packsPrice() {// 补充包总价
  2540. let strs1 = 0, strs2 = 0
  2541. this.datas2.forEach(v => {
  2542. if (v.id == 11 || v.id == 15) {
  2543. strs1 += v.price * v.count
  2544. } else if (v.id == 14 || v.id == 16) {
  2545. if (this.repair == 1) {
  2546. strs2 += v.price / 12 * v.count * parseInt(this.member.payCycle ? this.member.payCycle : 0)
  2547. } else if (this.repair == 2) {
  2548. let strNums = 0
  2549. if (v.id == 14) {
  2550. if (this.currentId.indexOf(v.id) > -1) {
  2551. strNums = v.price / 12 * v.count * this.stopTime
  2552. } else {
  2553. strNums = v.price / 12 * v.count * parseInt(this.member.payCycle ? this.member.payCycle : 0)
  2554. }
  2555. } else {
  2556. if (this.currentId.indexOf(12) > -1 && this.currentId.indexOf(13) > -1) {
  2557. strNums = v.price / 12 * v.count * this.stopTime
  2558. } else {
  2559. strNums = v.price / 12 * v.count * parseInt(this.member.payCycle ? this.member.payCycle : 0)
  2560. }
  2561. }
  2562. strs2 += strNums
  2563. } else if (this.repair == 3) {
  2564. strs2 += v.price / 12 * v.count * (this.stopTime + parseInt(this.member.payCycle ? this.member.payCycle : 0))
  2565. }
  2566. } else {
  2567. strs1 += v.price * v.count
  2568. }
  2569. })
  2570. this.member.supplyMoney = parseInt(strs1) + parseInt(strs2)
  2571. if (this.member.supplyMoney == 0 || this.allDis) {
  2572. this.supplyDis = true
  2573. this.member.supplyPayMoney = ''
  2574. } else {
  2575. this.supplyDis = false
  2576. }
  2577. // this.member.orderMoney = this.member.supplyPayMoney
  2578. },
  2579. ordFunc() {// 订单金额
  2580. let strs1 = 0, strs2 = 0
  2581. this.datas2.forEach(v => {
  2582. if (v.id == 11 || v.id == 15) {
  2583. strs1 += parseInt(v.price) * v.count
  2584. } else if (v.id == 14 || v.id == 16) {
  2585. strs2 += parseInt(v.price) / 12 * v.count * this.stopTime
  2586. }
  2587. })
  2588. // this.member.orderMoney = parseInt(strs1) + parseInt(strs2)
  2589. },
  2590. // 旧服务列表相关
  2591. getServed(val) {
  2592. this.serData = []
  2593. this.pacData = []
  2594. const resList = []
  2595. this.resArr1 = []
  2596. this.resArr2 = []
  2597. this.resArr3 = []
  2598. this.resArr4 = []
  2599. this.resArr5 = []
  2600. this.resArr6 = []
  2601. this.$request('/order/getServer').data().success((res) => {// 获取自定义套餐所有服务选项
  2602. this.servedData = res.data.lists
  2603. res.data.lists.forEach(v => {
  2604. if (v.i_isserver == 1) {
  2605. if (this.repair == '1') {
  2606. if (v.id == 17 || v.id == 18) {
  2607. this.resArr1.push(v)
  2608. } else if (v.id == 4 || v.id == 19) {
  2609. this.resArr2.push(v)
  2610. } else if (v.id == 20 || v.id == 23) {
  2611. this.resArr3.push(v)
  2612. } else if (v.id == 13 || v.id == 21) {
  2613. this.resArr4.push(v)
  2614. } else if (v.id == 14 || v.id == 22) {
  2615. this.resArr5.push(v)
  2616. } else if (v.id == 24 || v.id == 25) {
  2617. this.resArr6.push(v)
  2618. } else {
  2619. if (v.id !== 12) {
  2620. resList.push(v)
  2621. }
  2622. }
  2623. }
  2624. if (this.repair == '2') {
  2625. if (v.id == 17 || v.id == 18) {
  2626. if (this.currentId.indexOf(v.id) > -1) {
  2627. resList.splice(1, 0, v)
  2628. } else {
  2629. this.resArr1.push(v)
  2630. }
  2631. } else if (v.id == 4 || v.id == 19) {
  2632. if (this.currentId.indexOf(v.id) > -1) {
  2633. resList.splice(4, 0, v)
  2634. } else {
  2635. this.resArr2.push(v)
  2636. }
  2637. } else if (v.id == 20 || v.id == 23) {
  2638. if (this.currentId.indexOf(v.id) > -1) {
  2639. resList.splice(14, 0, v)
  2640. } else {
  2641. this.resArr3.push(v)
  2642. }
  2643. } else if (v.id == 13 || v.id == 21) {
  2644. if (this.currentId.indexOf(v.id) > -1) {
  2645. resList.splice(16, 0, v)
  2646. } else {
  2647. this.resArr4.push(v)
  2648. }
  2649. } else if (v.id == 14 || v.id == 22) {
  2650. if (this.currentId.indexOf(v.id) > -1) {
  2651. resList.splice(18, 0, v)
  2652. } else {
  2653. this.resArr5.push(v)
  2654. }
  2655. } else if (v.id == 24 || v.id == 25) {
  2656. if (this.currentId.indexOf(v.id) > -1) {
  2657. resList.splice(20, 0, v)
  2658. } else {
  2659. this.resArr6.push(v)
  2660. }
  2661. } else {
  2662. if (v.id !== 12) {
  2663. resList.push(v)
  2664. }
  2665. }
  2666. }
  2667. if (this.repair == '3') {
  2668. if (v.id !== 12) {
  2669. resList.push(v)
  2670. }
  2671. }
  2672. }
  2673. if (v.i_ispackage == 1) {
  2674. this.pacData.push(v)
  2675. }
  2676. })
  2677. let arr1 = {
  2678. i_ispackage: 0,
  2679. i_isserver: 1,
  2680. i_pkprice: null,
  2681. i_price_month: null,
  2682. i_price_year: null,
  2683. s_count_year: null,
  2684. id: 9119,
  2685. s_name: '',
  2686. s_pkcount: null,
  2687. _checked: false
  2688. }
  2689. let arr2 = {
  2690. i_ispackage: 0,
  2691. i_isserver: 1,
  2692. i_pkprice: null,
  2693. i_price_month: null,
  2694. i_price_year: null,
  2695. s_count_year: null,
  2696. id: 9120,
  2697. s_name: '',
  2698. s_pkcount: null,
  2699. _checked: false
  2700. }
  2701. let arr3 = {
  2702. i_ispackage: 0,
  2703. i_isserver: 1,
  2704. i_pkprice: null,
  2705. i_price_month: null,
  2706. i_price_year: null,
  2707. s_count_year: null,
  2708. id: 9121,
  2709. s_name: '',
  2710. s_pkcount: null,
  2711. _checked: false
  2712. }
  2713. let arr4 = {
  2714. i_ispackage: 0,
  2715. i_isserver: 1,
  2716. i_pkprice: null,
  2717. i_price_month: null,
  2718. i_price_year: null,
  2719. s_count_year: null,
  2720. id: 9122,
  2721. s_name: '',
  2722. s_pkcount: null,
  2723. _checked: false
  2724. }
  2725. let arr5 = {
  2726. i_ispackage: 0,
  2727. i_isserver: 1,
  2728. i_pkprice: null,
  2729. i_price_month: null,
  2730. i_price_year: null,
  2731. s_count_year: null,
  2732. id: 9123,
  2733. s_name: '',
  2734. s_pkcount: null,
  2735. _checked: false
  2736. }
  2737. let arr6 = {
  2738. i_ispackage: 0,
  2739. i_isserver: 1,
  2740. i_pkprice: null,
  2741. i_price_month: null,
  2742. i_price_year: null,
  2743. s_count_year: null,
  2744. id: 9124,
  2745. s_name: '',
  2746. s_pkcount: null,
  2747. _checked: false
  2748. }
  2749. if (this.repair == '1') {
  2750. resList.splice(1, 0, arr1)
  2751. resList.splice(3, 0, arr2)
  2752. resList.splice(13, 0, arr3)
  2753. resList.splice(14, 0, arr4)
  2754. resList.splice(15, 0, arr5)
  2755. resList.splice(17, 0, arr6)
  2756. } else if (this.repair == '2') {
  2757. if (!(this.currentId.indexOf(17) > -1) && !(this.currentId.indexOf(18) > -1)) {
  2758. resList.splice(1, 0, arr1)
  2759. }
  2760. if (!(this.currentId.indexOf(4) > -1) && !(this.currentId.indexOf(19) > -1)) {
  2761. resList.splice(3, 0, arr2)
  2762. }
  2763. if (!(this.currentId.indexOf(20) > -1) && !(this.currentId.indexOf(23) > -1)) {
  2764. resList.splice(13, 0, arr3)
  2765. }
  2766. if (!(this.currentId.indexOf(13) > -1) && !(this.currentId.indexOf(21) > -1)) {
  2767. resList.splice(14, 0, arr4)
  2768. }
  2769. if (!(this.currentId.indexOf(14) > -1) && !(this.currentId.indexOf(22) > -1)) {
  2770. resList.splice(15, 0, arr5)
  2771. }
  2772. if (!(this.currentId.indexOf(24) > -1) && !(this.currentId.indexOf(25) > -1)) {
  2773. resList.splice(18, 0, arr6)
  2774. }
  2775. }
  2776. this.serData = resList
  2777. if (val) {
  2778. this.checkedDis2(val)
  2779. } else {
  2780. this.checkedDis1()
  2781. }
  2782. }).get()
  2783. },
  2784. checkedDis1() {// 服务列表选中已享有服务
  2785. this.serData.forEach(k => {
  2786. if (this.repair == '1') {
  2787. if (k.id == 1) {
  2788. k._checked = true
  2789. k._disabled = true
  2790. this.sumSel.push(k)
  2791. }
  2792. } else if (this.repair == 2) {
  2793. if (this.currentId.indexOf(k.id) > -1) {
  2794. k._checked = true
  2795. k._disabled = true
  2796. }
  2797. } else if (this.repair == '3') {
  2798. if (this.currentId.indexOf(k.id) > -1) {
  2799. k._checked = true
  2800. k._disabled = true
  2801. } else {
  2802. k._disabled = true
  2803. }
  2804. }
  2805. })
  2806. this.pacData.forEach(j => {
  2807. if (this.currentId.indexOf(j.id) > -1) {
  2808. j._rowDis = false
  2809. } else {
  2810. if (j.id == 16) {
  2811. if (this.currentId.indexOf(12) > -1 && this.currentId.indexOf(13) > -1 || this.currentId.indexOf(23) > -1 && this.currentId.indexOf(13) > -1 || this.currentId.indexOf(20) > -1 && this.currentId.indexOf(21) > -1) {
  2812. j._rowDis = false
  2813. } else {
  2814. j._rowDis = true
  2815. }
  2816. } else {
  2817. if (this.currentId.indexOf(j.id) > -1) {
  2818. j._rowDis = false
  2819. } else {
  2820. j._rowDis = true
  2821. }
  2822. }
  2823. }
  2824. })
  2825. },
  2826. checkedDis2(val) {
  2827. this.pacData.forEach(v => {
  2828. if (v.id == 16) {
  2829. if (val.s_servers.indexOf(12) > -1 && val.s_servers.indexOf(13) > -1 || val.s_servers.indexOf(23) > -1 && val.s_servers.indexOf(13) > -1 || val.s_servers.indexOf(20) > -1 && val.s_servers.indexOf(21) > -1) {
  2830. v._rowDis = false
  2831. } else {
  2832. v._rowDis = true
  2833. }
  2834. } else {
  2835. if (val.s_servers.indexOf(v.id) > -1) {
  2836. v._rowDis = false
  2837. } else {
  2838. v._rowDis = true
  2839. }
  2840. }
  2841. })
  2842. },
  2843. // 合计
  2844. handleSummary({ columns, data }) {
  2845. const sums = {}
  2846. columns.forEach((column, index) => {
  2847. const key = column.key
  2848. if (index === 0) {
  2849. sums[key] = {
  2850. key,
  2851. value: '合计'
  2852. }
  2853. return
  2854. }
  2855. let values = []
  2856. if (this.repair == 3) {
  2857. this.sArr = []
  2858. data.forEach(v => {
  2859. if (v._checked) {
  2860. this.sArr.push(v)
  2861. }
  2862. })
  2863. values = this.sArr.map(item => Number(item[key]))
  2864. } else {
  2865. values = this.sumSel.map(item => Number(item[key]))
  2866. }
  2867. if (!values.every(value => isNaN(value))) {
  2868. const v = values.reduce((prev, curr) => {
  2869. const value = Number(curr);
  2870. if (!isNaN(value)) {
  2871. return prev + curr;
  2872. } else {
  2873. return prev;
  2874. }
  2875. }, 0)
  2876. sums[key] = {
  2877. key,
  2878. value: v
  2879. }
  2880. // this.sPrice = sums.i_price_year.value
  2881. if (this.nums == 0) {
  2882. let arr2 = []
  2883. this.sumSel.forEach(v => {
  2884. if (v.id != 1) {
  2885. arr2.push(v.id)
  2886. }
  2887. })
  2888. if (arr2.length != 0) {
  2889. this.moneyFunc()// 大会员订单价格
  2890. }
  2891. if (this.repair == '2') {
  2892. this.member.payCycle = getDateSub('', this.overTime)
  2893. this.moneyFunc(this.valComs)// 大会员订单价格
  2894. }
  2895. if (this.repair == '3') {
  2896. this.moneyFunc(this.valComs)// 大会员订单价格
  2897. }
  2898. } else {
  2899. if (this.member.payCycle) {
  2900. this.moneyFunc()// 大会员订单价格
  2901. }
  2902. }
  2903. } else {
  2904. if (key == 's_name') {
  2905. sums[key] = {
  2906. key,
  2907. value: '-'
  2908. }
  2909. } else {
  2910. sums[key] = {
  2911. key,
  2912. value: 0
  2913. }
  2914. }
  2915. }
  2916. })
  2917. return sums;
  2918. },
  2919. // 多选
  2920. selChage(selection) {
  2921. const arrs = [], arrs1 = [], strItems = []
  2922. this.selData = selection
  2923. selection.map(v => {
  2924. arrs1.push(v.id)
  2925. if (this.repair == '1') {
  2926. if (v.id !== 9119 && v.id !== 9120 && v.id !== 9121 && v.id !== 9122 && v.id !== 9123 && v.id !== 9124) {
  2927. arrs.push(v)
  2928. }
  2929. } else {
  2930. if (!v._disabled) {
  2931. arrs.push(v)
  2932. }
  2933. }
  2934. if (v.id == 9119) {
  2935. strItems.splice(1, 0, this.strItems1)
  2936. } else if (v.id == 9120) {
  2937. strItems.splice(1, 0, this.strItems2)
  2938. } else if (v.id == 9121) {
  2939. strItems.splice(1, 0, this.strItems3)
  2940. } else if (v.id == 9122) {
  2941. strItems.splice(1, 0, this.strItems4)
  2942. } else if (v.id == 9123) {
  2943. strItems.splice(1, 0, this.strItems5)
  2944. } else if (v.id == 9124) {
  2945. strItems.splice(1, 0, this.strItems6)
  2946. }
  2947. })
  2948. if (arrs1.indexOf(9119) > -1 || arrs1.indexOf(9120) > -1 || arrs1.indexOf(9121) > -1 || arrs1.indexOf(9122) > -1 || arrs1.indexOf(9123) > -1 || arrs1.indexOf(9124) > -1) {
  2949. this.sumSel = arrs.concat(strItems)
  2950. } else {
  2951. this.sumSel = arrs
  2952. }
  2953. if (this.sumSel.length == 0) {
  2954. this.member.bigMoney = 0
  2955. this.allSum()
  2956. }
  2957. this.moneyFunc(this.valComs)// 大会员订单价格
  2958. },
  2959. allChange() {// 选择全选
  2960. this.pacData.forEach((t, i) => {
  2961. document.getElementById('counts' + i).disabled = false
  2962. })
  2963. },
  2964. allCancel() {// 取消全选
  2965. this.pacData.forEach((t, i) => {
  2966. if (t.id == 16) {
  2967. if (this.currentId.indexOf(12) > -1 && this.currentId.indexOf(13) > -1) {
  2968. document.getElementById('counts' + i).disabled = false
  2969. } else {
  2970. document.getElementById('counts' + i).disabled = true
  2971. }
  2972. } else {
  2973. if (this.currentId.indexOf(t.id) > -1) {
  2974. document.getElementById('counts' + i).disabled = false
  2975. } else {
  2976. document.getElementById('counts' + i).disabled = true
  2977. }
  2978. }
  2979. document.getElementById('counts' + i).value = ''
  2980. this.datas2.forEach((k, index) => {
  2981. this.datas2[index].count = 0
  2982. this.datas2.splice(index, 1)
  2983. this.packsPrice()
  2984. })
  2985. })
  2986. },
  2987. curChange(selection, row) {// 选择单个
  2988. let arr1 = []
  2989. selection.forEach(l => {
  2990. arr1.push(l.id)
  2991. })
  2992. if (arr1.indexOf(11) > -1) {
  2993. document.getElementById('counts0').disabled = false
  2994. }
  2995. if (arr1.indexOf(15) > -1) {
  2996. document.getElementById('counts2').disabled = false
  2997. }
  2998. if (arr1.indexOf(9121) > -1 && this.strItems3.id == 20 && arr1.indexOf(9122) > -1 && this.strItems4.id == 21) {
  2999. document.getElementById('counts3').disabled = false
  3000. }
  3001. if (arr1.indexOf(9121) > -1 && this.strItems3.id == 23 && arr1.indexOf(9122) > -1 && this.strItems4.id == 13) {
  3002. document.getElementById('counts3').disabled = false
  3003. }
  3004. if (arr1.indexOf(9123) > -1 && this.strItems5.id == 22) {
  3005. document.getElementById('counts4').disabled = false
  3006. }
  3007. if (arr1.indexOf(9123) > -1 && this.strItems5.id == 14) {
  3008. document.getElementById('counts1').disabled = false
  3009. }
  3010. if (arr1.indexOf(9124) > -1 && this.strItems5.id == 24) {
  3011. document.getElementById('counts4').disabled = false
  3012. }
  3013. if (arr1.indexOf(9124) > -1 && this.strItems5.id == 25) {
  3014. document.getElementById('counts1').disabled = false
  3015. }
  3016. },
  3017. canChange(selection, row) {// 取消单个
  3018. let arr2 = []
  3019. this.pacData.forEach((t, i) => {
  3020. if (row.id == t.id) {
  3021. document.getElementById('counts' + i).disabled = true
  3022. document.getElementById('counts' + i).value = ''
  3023. this.datas2.forEach((k, index) => {
  3024. if (k.id == row.id) {
  3025. this.datas2[index].count = 0
  3026. this.datas2.splice(index, 1)
  3027. this.packsPrice()
  3028. }
  3029. })
  3030. }
  3031. })
  3032. if (selection.length == 0) {
  3033. this.datas2 = []
  3034. }
  3035. selection.forEach(l => {
  3036. arr2.push(l.id)
  3037. })
  3038. if (arr2.indexOf(12) > -1 && arr2.indexOf(13) > -1) {
  3039. document.getElementById('counts3').disabled = false
  3040. } else {
  3041. document.getElementById('counts3').disabled = true
  3042. document.getElementById('counts3').value = ''
  3043. }
  3044. this.allSum()
  3045. },
  3046. allSum() {// 总计
  3047. this.member.sums = this.member.bigMoney + this.member.subMoney + this.member.supplyMoney
  3048. },
  3049. moneyFunc(str) {// 大会员金额
  3050. let sumd1 = 0, sumd2 = 0, sumd3 = 0
  3051. const arrs3 = [], arrs5 = [], arrs6 = [], arrs7 = []
  3052. if (this.repair == '3') {
  3053. this.sumSel = []
  3054. this.serData.map(v => {
  3055. if (v._checked && v._disabled) {
  3056. this.sumSel.push(v)
  3057. }
  3058. })
  3059. }
  3060. if (this.nums == 0) {
  3061. this.sumSel.map(v => {
  3062. arrs5.push(v.id)
  3063. if (v.id == 17 || v.id == 18) {
  3064. arrs3.push(v)
  3065. } else {
  3066. arrs6.push(v)
  3067. }
  3068. })
  3069. } else {
  3070. const sered = str.s_servers.split(',')
  3071. this.servedData.forEach(c => {
  3072. sered.forEach(r => {
  3073. if (r == c.id) {
  3074. arrs7.push(c)
  3075. }
  3076. })
  3077. })
  3078. this.nums == 0 ? this.sumSel : arrs7.map(v => {
  3079. arrs5.push(v.id)
  3080. if (v.id == 17 || v.id == 18) {
  3081. arrs3.push(v)
  3082. } else {
  3083. arrs6.push(v)
  3084. }
  3085. })
  3086. }
  3087. if (this.member.payCycle >= 12) {
  3088. if (arrs5.indexOf(17) > -1 || arrs5.indexOf(18) > -1) {
  3089. const cycles1 = parseInt(this.member.payCycle / 12) // 取整
  3090. const cycles2 = this.member.payCycle % 12 // 取余
  3091. arrs3.forEach(p => {
  3092. if (this.member.payCycle == 12) {
  3093. sumd3 += parseInt(p.i_price_year * cycles1)
  3094. } else {
  3095. sumd1 += parseInt(p.i_price_year * cycles1 + p.i_price_month * cycles2)
  3096. }
  3097. })
  3098. }
  3099. arrs6.forEach(p => {
  3100. sumd2 += parseInt(p.i_price_year / 12 * this.member.payCycle)
  3101. })
  3102. } else {
  3103. if (arrs5.indexOf(17) > -1 || arrs5.indexOf(18) > -1) {
  3104. arrs3.forEach(p => {
  3105. sumd1 += parseInt(p.i_price_month * this.member.payCycle)
  3106. })
  3107. }
  3108. arrs6.forEach(p => {
  3109. sumd2 += parseInt(p.i_price_year / 10 * this.member.payCycle)
  3110. })
  3111. }
  3112. this.member.bigMoney = sumd1 + sumd2 + sumd3
  3113. if (this.member.bigMoney == 0 || this.allDis) {
  3114. this.bigDis = true
  3115. this.member.bigPayMoney = ''
  3116. } else {
  3117. this.bigDis = false
  3118. }
  3119. this.allSum() // 总计
  3120. },
  3121. //旧服务列表相关结束
  3122. },
  3123. data() {
  3124. return {
  3125. firstOpen: true,
  3126. buyserveName: '',
  3127. serveEndtime: '',
  3128. paybackTable: [
  3129. {
  3130. title: '序号',
  3131. slot: 'code'
  3132. },
  3133. {
  3134. title: '预计回款时间',
  3135. slot: 'time'
  3136. },
  3137. {
  3138. title: '预计回款金额(元)',
  3139. slot: 'money'
  3140. }
  3141. ],
  3142. paybackTableData: [],
  3143. contactOrderList: [],
  3144. contactOrderchoose: {},
  3145. contactOrderColumns: [
  3146. {
  3147. title: '请选择',
  3148. align: 'center',
  3149. key: 'choose',
  3150. render: (h, params) => {
  3151. return h('div', [
  3152. h('Radio', {
  3153. props: {
  3154. value: params.row.choose,
  3155. disabled: params.row.disabled
  3156. },
  3157. on: {
  3158. 'on-change': (e) => {
  3159. this.contactOrderList.forEach((items) => { //取消所有对象的勾选,choose设置为false
  3160. this.$set(items, 'choose', false)
  3161. });
  3162. this.contactOrderList[params.index].choose = e; //将勾选的对象的choose设置为true
  3163. this.contactOrderchoose = this.contactOrderList[params.index]
  3164. this.member.contactOrderCode = this.contactOrderchoose.order_code
  3165. this.member.entId = this.contactOrderchoose.ent_id
  3166. console.log(e, this.contactOrderchoose)
  3167. this.orderPriceCount()
  3168. }
  3169. }
  3170. })
  3171. ])
  3172. }
  3173. },
  3174. {
  3175. title: '订单编号',
  3176. key: 'order_code',
  3177. align: 'center',
  3178. render: (h, { row }) => {
  3179. return h('div', {
  3180. style: {
  3181. color: 'rgb(54, 163, 247)',
  3182. cursor: 'pointer'
  3183. },
  3184. on: {
  3185. click: () => {
  3186. const news = this.$router.resolve({
  3187. path: '/order/orderList/orderDetail',
  3188. query: { id: row.id, proType: '大会员' }
  3189. })
  3190. window.open(news.href, '_blank')
  3191. }
  3192. }
  3193. }, [
  3194. h('span', row.order_code)
  3195. ])
  3196. }
  3197. },
  3198. {
  3199. title: '创建时间',
  3200. key: 'create_time',
  3201. align: 'center',
  3202. render: (h, { row }) => {
  3203. return h('span', dateFormatter(row.create_time * 1000, 'yyyy-MM-dd'))
  3204. }
  3205. },
  3206. {
  3207. title: '产品类型',
  3208. key: 'product_type',
  3209. align: 'center'
  3210. },
  3211. {
  3212. title: '到期时间',
  3213. key: 'vip_endtime',
  3214. align: 'center',
  3215. render: (h, { row }) => {
  3216. return h('span', dateFormatter(row.vip_endtime * 1000, 'yyyy-MM-dd'))
  3217. }
  3218. },
  3219. ],
  3220. pricetimer: null,
  3221. initbuyCount: '',
  3222. showOrderOther: false,
  3223. showXieYi: false,
  3224. initnewServedata: [], // 初始化自定义服务信息
  3225. form_serve: {},
  3226. newServedata: [],
  3227. i_member_status: '',
  3228. saleCode: '',
  3229. saleDep: [],
  3230. saleTable: [
  3231. {
  3232. title: '销售人员',
  3233. slot: 'name'
  3234. },
  3235. {
  3236. title: '销售业绩(元)',
  3237. slot: 'money'
  3238. }
  3239. ],
  3240. saleTableData: [],
  3241. comingIntoEffective: false,
  3242. max_length: 2, //默认为月
  3243. serData: [],
  3244. servedData: [],
  3245. pacData: [],
  3246. resArr1: [],
  3247. resArr2: [],
  3248. resArr3: [],
  3249. resArr4: [],
  3250. resArr5: [],
  3251. resArr6: [],
  3252. optionDis1: false,
  3253. optionDis2: false,
  3254. optionDis3: false,
  3255. optionDis4: false,
  3256. optionDis5: false,
  3257. optionDis6: false,
  3258. repair: '1',
  3259. spinShow: false,
  3260. bShow: false,
  3261. downDis: false,
  3262. shiDis: false,
  3263. valComs: {},
  3264. strs1: 0,
  3265. strs2: 0,
  3266. pArr1: [],
  3267. pArr2: [],
  3268. combo_id: {},
  3269. allDis: false,
  3270. bigDis: true,
  3271. subDis: true,
  3272. supplyDis: true,
  3273. sArr: [],
  3274. noPhone: false,
  3275. noPass: false,
  3276. pReadon: false,
  3277. isDisable: false,
  3278. selData: [],
  3279. placed: '请输入有效周期',
  3280. // placed: '请输入有效周期(单位(月),最多输入60个月)',
  3281. member: {
  3282. paybackList: [],
  3283. paybackNum: 1,
  3284. entId: '',
  3285. paybackOpenServer: false,
  3286. contactOrderCode: '',
  3287. paybackExpectDate: '',
  3288. paybackWorkDayNum: '',
  3289. contract_nature: '1', // 合同性质
  3290. phone: '',
  3291. products: '',
  3292. billingMode: '',
  3293. salesPerson: '',
  3294. level: '',
  3295. createType: '1',
  3296. payCycle: '',
  3297. cycleType: '0',
  3298. buyCount: '',
  3299. beginTime: '',
  3300. paySub: '',
  3301. freeSub: '',
  3302. bigMoney: 0,
  3303. subMoney: 0,
  3304. supplyMoney: 0,
  3305. orderMoney: 0,
  3306. sums: 0,
  3307. agreementStatus: '1',
  3308. agreementTime: dateFormatter(new Date(), 'yyyy-MM-dd'),
  3309. agreementNumber: '',
  3310. contractUrl: '',
  3311. payMoney: '',
  3312. bigPayMoney: '',
  3313. subPayMoney: '',
  3314. supplyPayMoney: '',
  3315. commission: '0',
  3316. proceduresMoney: '0',
  3317. companyName: '',
  3318. salesChannel: '',
  3319. orderChannel: 'd01',
  3320. paybackCompany: 'h01',
  3321. remark: '',
  3322. sale_time: dateFormatter(new Date(), 'yyyy-MM-dd') + ' 00:00:00',
  3323. order_status: '1',
  3324. buySubject: '',
  3325. contract_archive_status: '0',
  3326. contract_archive_time: '',
  3327. contract_archive_num: '',
  3328. single: false, // 大会员商机版2.0-单省版 radio 选中状态
  3329. areaCount: '0', // 大会员省份版-省份数量
  3330. payType: '',
  3331. saleCodeModel: [],
  3332. // 电子协议相关
  3333. e_contract_type: 1, // 电子协议类型
  3334. e_contract_userA_type: 1, // 协议甲方类型
  3335. e_contract_userA_name: '', // 协议甲方
  3336. e_contract_userA_contacts_name: '', // 协议甲方联系人
  3337. e_contract_userA_contacts_tel: '', // 协议甲方联系方式
  3338. e_contract_userA_contacts_address: '', // 协议甲方联系地址
  3339. e_contract_userB_contacts_name: '', // 协议乙方联系人
  3340. e_contract_remark: '', // 协议备注
  3341. },
  3342. isAll: false,
  3343. radioDis1: false,
  3344. radioDis2: false,
  3345. radioDis3: false,
  3346. currentId: [],
  3347. sPrice: 0,
  3348. mPrice: 0,
  3349. valNums: 0,
  3350. rowArr: {},
  3351. agreeStatus: [
  3352. { v: '0', n: '不签协议' },
  3353. { v: '1', n: '签协议' }
  3354. ],
  3355. payTypes: [
  3356. { v: 'transferAccounts', n: '对公转账' },
  3357. { v: 'wx', n: '微信' },
  3358. { v: 'ali', n: '支付宝' }
  3359. ],
  3360. unitOptions: [
  3361. { v: '0', n: '月' },
  3362. { v: '1', n: '天' }
  3363. ],
  3364. columns1: [
  3365. {
  3366. title: '补充包名称',
  3367. key: 's_name',
  3368. width: 280,
  3369. align: 'center',
  3370. render: (h, { row }) => {
  3371. return h('span', row.s_name ? row.s_name : '-')
  3372. }
  3373. },
  3374. {
  3375. title: '价格',
  3376. key: 'i_pkprice',
  3377. width: 130,
  3378. align: 'center',
  3379. render: (h, { row }) => {
  3380. let arr1 = [11, 15]
  3381. return h('span', row.i_pkprice ? row.s_pkcount ? row.s_pkcount + (arr1.indexOf(row.id) > -1 ? '次/' : '个/') + row.i_pkprice : row.i_pkprice : '-')
  3382. }
  3383. },
  3384. {
  3385. title: '购买数量',
  3386. key: 's_pkcount',
  3387. align: 'center',
  3388. render: (h, { row, index }) => {
  3389. return h('Input', {
  3390. props: {
  3391. placeholder: '请输入购买数量',
  3392. // value: row.s_pkcount,
  3393. disabled: row._rowDis,
  3394. elementId: 'counts' + index
  3395. },
  3396. on: {
  3397. 'on-change': (event) => {
  3398. this.rowArr = row
  3399. event.currentTarget.value = event.currentTarget.value.replace(/[^\d]+/g, '')
  3400. this.valNums = event.currentTarget.value
  3401. if (event.currentTarget.value) {
  3402. if (this.datas2.length !== 0) {
  3403. var isOk = false;
  3404. this.datas2.forEach(v => {
  3405. if (row.id == v.id) {
  3406. isOk = true
  3407. v.count = this.valNums
  3408. }
  3409. })
  3410. if (!isOk) {
  3411. this.datas2.push({
  3412. id: row.id,
  3413. name: row.s_name,
  3414. price: row.i_pkprice,
  3415. s_pkcount: row.s_pkcount,
  3416. count: this.valNums
  3417. })
  3418. }
  3419. } else {
  3420. this.datas2.push({
  3421. id: row.id,
  3422. name: row.s_name,
  3423. price: row.i_pkprice,
  3424. s_pkcount: row.s_pkcount,
  3425. count: this.valNums
  3426. })
  3427. }
  3428. } else {
  3429. this.datas2.forEach((v, i) => {
  3430. if (row.id == v.id) {
  3431. this.datas2.splice(i, 1)
  3432. }
  3433. })
  3434. }
  3435. this.packsPrice()
  3436. this.ordFunc()
  3437. this.allSum() // 总计
  3438. this.orderPriceCount()// 接口计算价格
  3439. },
  3440. 'on-keyup': (event) => {
  3441. event.currentTarget.value = event.currentTarget.value.replace(/[^\d]+/g, '')
  3442. }
  3443. }
  3444. })
  3445. }
  3446. }
  3447. ],
  3448. datas1: [],
  3449. datas2: [],
  3450. selStr: '',
  3451. strItems1: [],
  3452. strItems2: [],
  3453. strItems3: [],
  3454. strItems4: [],
  3455. strItems5: [],
  3456. strItems6: [],
  3457. value1: '',
  3458. columns2: [
  3459. {
  3460. title: '金额明细',
  3461. key: 'name',
  3462. align: 'center',
  3463. render: (h, { row }) => {
  3464. return h('span', row.name ? row.name : '-')
  3465. }
  3466. },
  3467. {
  3468. title: '价格',
  3469. key: 'price',
  3470. width: 170,
  3471. align: 'center',
  3472. render: (h, { row }) => {
  3473. return h('span', row.price ? row.count ? row.price + '*' + row.count : row.price : '-')
  3474. }
  3475. }
  3476. ],
  3477. // 服务列表相关
  3478. columns3: [
  3479. {
  3480. type: 'selection',
  3481. width: 40,
  3482. align: 'center'
  3483. },
  3484. {
  3485. title: '服务名称',
  3486. key: 's_name',
  3487. width: 260,
  3488. align: 'center',
  3489. render: (h, { row }) => {
  3490. if (this.repair == '1' || this.repair == '2') {
  3491. if (row.id == 9119) {
  3492. return h('Select', {
  3493. props: {
  3494. placeholder: '请选择单日限量包',
  3495. value: this.selStr,
  3496. },
  3497. on: {
  3498. 'on-change': (val) => {
  3499. row.i_price_year = JSON.parse(val).i_price_year
  3500. row.i_price_month = JSON.parse(val).i_price_month
  3501. },
  3502. 'on-select': val => {
  3503. this.strItems1 = JSON.parse(val.value)
  3504. const arrs = [], arrs1 = [], strItems = []
  3505. this.serData.forEach(s => {
  3506. if (this.selData.length == 0) {
  3507. if (this.repair == '1') {
  3508. if (s.id == 1) {
  3509. this.selData.push(s)
  3510. }
  3511. } else {
  3512. if (!s._disabled) {
  3513. this.selData.push(s)
  3514. }
  3515. }
  3516. }
  3517. })
  3518. this.selData.map(v => {
  3519. arrs1.push(v.id)
  3520. if (this.repair == '1') {
  3521. if (v.id != 9119 && v.id !== 9120 && v.id !== 9121 && v.id !== 9122 && v.id !== 9123 && v.id !== 9124) {
  3522. arrs.push(v)
  3523. }
  3524. } else {
  3525. if (v.id != 9119 && !v._disabled) {
  3526. arrs.push(v)
  3527. }
  3528. }
  3529. if (v.id == 9119) {
  3530. strItems.splice(1, 0, this.strItems1)
  3531. } else if (v.id == 9120) {
  3532. strItems.splice(1, 0, this.strItems2)
  3533. } else if (v.id == 9121) {
  3534. strItems.splice(1, 0, this.strItems3)
  3535. } else if (v.id == 9122) {
  3536. strItems.splice(1, 0, this.strItems4)
  3537. } else if (v.id == 9123) {
  3538. strItems.splice(1, 0, this.strItems5)
  3539. } else if (v.id == 9124) {
  3540. strItems.splice(1, 0, this.strItems6)
  3541. }
  3542. })
  3543. if (arrs1.indexOf(9119) > -1 || arrs1.indexOf(9120) > -1 || arrs1.indexOf(9121) > -1 || arrs1.indexOf(9122) > -1 || arrs1.indexOf(9123) > -1 || arrs1.indexOf(9124) > -1) {
  3544. this.sumSel = arrs.concat(strItems)
  3545. } else {
  3546. this.sumSel = arrs
  3547. }
  3548. }
  3549. }
  3550. },
  3551. this.resArr1.map(item => {
  3552. return h('Option', {
  3553. props: {
  3554. value: JSON.stringify(item)
  3555. }
  3556. }, item.s_name)
  3557. })
  3558. )
  3559. } else if (row.id == 9120) {
  3560. return h('Select', {
  3561. props: {
  3562. placeholder: '请选择企业全景分析',
  3563. value: this.value1,
  3564. },
  3565. on: {
  3566. 'on-change': (val) => {
  3567. const ids = JSON.parse(val).id
  3568. if (ids == 4) {
  3569. this.optionDis3 = true
  3570. this.optionDis4 = false
  3571. this.optionDis5 = true
  3572. this.optionDis6 = false
  3573. } else if (ids == 19) {
  3574. this.optionDis3 = false
  3575. this.optionDis4 = true
  3576. this.optionDis5 = false
  3577. this.optionDis6 = true
  3578. }
  3579. row.i_price_year = JSON.parse(val).i_price_year
  3580. row.i_price_month = JSON.parse(val).i_price_month
  3581. },
  3582. 'on-select': val => {
  3583. this.strItems2 = JSON.parse(val.value)
  3584. const arrs = [], arrs1 = [], strItems = []
  3585. this.serData.forEach(s => {
  3586. if (this.selData.length == 0) {
  3587. if (this.repair == '1') {
  3588. if (s.id == 1) {
  3589. this.selData.push(s)
  3590. }
  3591. } else {
  3592. if (!s._disabled) {
  3593. this.selData.push(s)
  3594. }
  3595. }
  3596. }
  3597. })
  3598. this.selData.map(v => {
  3599. arrs1.push(v.id)
  3600. if (this.repair == '1') {
  3601. if (v.id != 9119 && v.id !== 9120 && v.id !== 9121 && v.id !== 9122 && v.id !== 9123 && v.id !== 9124) {
  3602. arrs.push(v)
  3603. }
  3604. } else {
  3605. if (v.id != 9119 && !v._disabled) {
  3606. arrs.push(v)
  3607. }
  3608. }
  3609. if (v.id == 9119) {
  3610. strItems.splice(1, 0, this.strItems1)
  3611. } else if (v.id == 9120) {
  3612. strItems.splice(1, 0, this.strItems2)
  3613. } else if (v.id == 9121) {
  3614. strItems.splice(1, 0, this.strItems3)
  3615. } else if (v.id == 9122) {
  3616. strItems.splice(1, 0, this.strItems4)
  3617. } else if (v.id == 9123) {
  3618. strItems.splice(1, 0, this.strItems5)
  3619. } else if (v.id == 9124) {
  3620. strItems.splice(1, 0, this.strItems6)
  3621. }
  3622. })
  3623. if (arrs1.indexOf(9119) > -1 || arrs1.indexOf(9120) > -1 || arrs1.indexOf(9121) > -1 || arrs1.indexOf(9122) > -1 || arrs1.indexOf(9123) > -1 || arrs1.indexOf(9124) > -1) {
  3624. this.sumSel = arrs.concat(strItems)
  3625. } else {
  3626. this.sumSel = arrs
  3627. }
  3628. }
  3629. }
  3630. },
  3631. [
  3632. h('Option', {
  3633. props: {
  3634. value: JSON.stringify(this.resArr2[1]),
  3635. disabled: this.optionDis1
  3636. }
  3637. }, this.resArr2[1].s_name),
  3638. h('Option', {
  3639. props: {
  3640. value: JSON.stringify(this.resArr2[0]),
  3641. disabled: this.optionDis2
  3642. }
  3643. }, this.resArr2[0].s_name)
  3644. ]
  3645. )
  3646. } else if (row.id == 9121) {
  3647. return h('Select', {
  3648. props: {
  3649. placeholder: '请选择企业情报监控',
  3650. value: '',
  3651. },
  3652. on: {
  3653. 'on-change': (val) => {
  3654. const ids = JSON.parse(val).id
  3655. if (ids == 20) {
  3656. this.optionDis1 = false
  3657. this.optionDis2 = true
  3658. this.optionDis5 = false
  3659. this.optionDis6 = true
  3660. } else if (ids == 23) {
  3661. this.optionDis1 = true
  3662. this.optionDis2 = false
  3663. this.optionDis5 = true
  3664. this.optionDis6 = false
  3665. }
  3666. row.i_price_year = JSON.parse(val).i_price_year
  3667. row.i_price_month = JSON.parse(val).i_price_month
  3668. },
  3669. 'on-select': val => {
  3670. this.strItems3 = JSON.parse(val.value)
  3671. const arrs = [], arrs1 = [], strItems = []
  3672. this.serData.forEach(s => {
  3673. if (this.selData.length == 0) {
  3674. if (this.repair == '1') {
  3675. if (s.id == 1) {
  3676. this.selData.push(s)
  3677. }
  3678. } else {
  3679. if (!s._disabled) {
  3680. this.selData.push(s)
  3681. }
  3682. }
  3683. }
  3684. })
  3685. this.selData.map(v => {
  3686. arrs1.push(v.id)
  3687. if (this.repair == '1') {
  3688. if (v.id != 9119 && v.id !== 9120 && v.id !== 9121 && v.id !== 9122 && v.id !== 9123 && v.id !== 9124) {
  3689. arrs.push(v)
  3690. }
  3691. } else {
  3692. if (v.id != 9119 && !v._disabled) {
  3693. arrs.push(v)
  3694. }
  3695. }
  3696. if (v.id == 9119) {
  3697. strItems.splice(1, 0, this.strItems1)
  3698. } else if (v.id == 9120) {
  3699. strItems.splice(1, 0, this.strItems2)
  3700. } else if (v.id == 9121) {
  3701. strItems.splice(1, 0, this.strItems3)
  3702. } else if (v.id == 9122) {
  3703. strItems.splice(1, 0, this.strItems4)
  3704. } else if (v.id == 9123) {
  3705. strItems.splice(1, 0, this.strItems5)
  3706. } else if (v.id == 9124) {
  3707. strItems.splice(1, 0, this.strItems5)
  3708. }
  3709. })
  3710. if (arrs1.indexOf(9119) > -1 || arrs1.indexOf(9120) > -1 || arrs1.indexOf(9121) > -1 || arrs1.indexOf(9122) > -1 || arrs1.indexOf(9123) > -1 || arrs1.indexOf(9124) > -1) {
  3711. this.sumSel = arrs.concat(strItems)
  3712. } else {
  3713. this.sumSel = arrs
  3714. }
  3715. }
  3716. }
  3717. },
  3718. [
  3719. h('Option', {
  3720. props: {
  3721. value: JSON.stringify(this.resArr3[0]),
  3722. disabled: this.optionDis3
  3723. }
  3724. }, this.resArr3[0].s_name),
  3725. h('Option', {
  3726. props: {
  3727. value: JSON.stringify(this.resArr3[1]),
  3728. disabled: this.optionDis4
  3729. }
  3730. }, this.resArr3[1].s_name)
  3731. ]
  3732. )
  3733. } else if (row.id == 9122) {
  3734. return h('Select', {
  3735. props: {
  3736. placeholder: '请选择企业中标动态',
  3737. value: '',
  3738. },
  3739. on: {
  3740. 'on-change': (val) => {
  3741. const ids = JSON.parse(val).id
  3742. if (ids == 21) {
  3743. this.optionDis1 = false
  3744. this.optionDis2 = true
  3745. this.optionDis3 = false
  3746. this.optionDis4 = true
  3747. } else if (ids == 13) {
  3748. this.optionDis1 = true
  3749. this.optionDis2 = false
  3750. this.optionDis3 = true
  3751. this.optionDis4 = false
  3752. }
  3753. row.i_price_year = JSON.parse(val).i_price_year
  3754. row.i_price_month = JSON.parse(val).i_price_month
  3755. },
  3756. 'on-select': val => {
  3757. this.strItems4 = JSON.parse(val.value)
  3758. const arrs = [], arrs1 = [], strItems = []
  3759. this.serData.forEach(s => {
  3760. if (this.selData.length == 0) {
  3761. if (this.repair == '1') {
  3762. if (s.id == 1) {
  3763. this.selData.push(s)
  3764. }
  3765. } else {
  3766. if (!s._disabled) {
  3767. this.selData.push(s)
  3768. }
  3769. }
  3770. }
  3771. })
  3772. this.selData.map(v => {
  3773. arrs1.push(v.id)
  3774. if (this.repair == '1') {
  3775. if (v.id != 9119 && v.id !== 9120 && v.id !== 9121 && v.id !== 9122 && v.id !== 9123 && v.id !== 9124) {
  3776. arrs.push(v)
  3777. }
  3778. } else {
  3779. if (v.id != 9119 && !v._disabled) {
  3780. arrs.push(v)
  3781. }
  3782. }
  3783. if (v.id == 9119) {
  3784. strItems.splice(1, 0, this.strItems1)
  3785. } else if (v.id == 9120) {
  3786. strItems.splice(1, 0, this.strItems2)
  3787. } else if (v.id == 9121) {
  3788. strItems.splice(1, 0, this.strItems3)
  3789. } else if (v.id == 9122) {
  3790. strItems.splice(1, 0, this.strItems4)
  3791. } else if (v.id == 9123) {
  3792. strItems.splice(1, 0, this.strItems5)
  3793. } else if (v.id == 9124) {
  3794. strItems.splice(1, 0, this.strItems6)
  3795. }
  3796. })
  3797. if (arrs1.indexOf(9119) > -1 || arrs1.indexOf(9120) > -1 || arrs1.indexOf(9121) > -1 || arrs1.indexOf(9122) > -1 || arrs1.indexOf(9123) > -1 || arrs1.indexOf(9124) > -1) {
  3798. this.sumSel = arrs.concat(strItems)
  3799. } else {
  3800. this.sumSel = arrs
  3801. }
  3802. }
  3803. }
  3804. },
  3805. [
  3806. h('Option', {
  3807. props: {
  3808. value: JSON.stringify(this.resArr4[1]),
  3809. disabled: this.optionDis5
  3810. }
  3811. }, this.resArr4[1].s_name),
  3812. h('Option', {
  3813. props: {
  3814. value: JSON.stringify(this.resArr4[0]),
  3815. disabled: this.optionDis6
  3816. }
  3817. }, this.resArr4[0].s_name)
  3818. ]
  3819. )
  3820. } else if (row.id == 9123) {
  3821. return h('Select', {
  3822. props: {
  3823. placeholder: '请选择项目进度监控',
  3824. value: '',
  3825. },
  3826. on: {
  3827. 'on-change': (val) => {
  3828. row.i_price_year = JSON.parse(val).i_price_year
  3829. row.i_price_month = JSON.parse(val).i_price_month
  3830. },
  3831. 'on-select': val => {
  3832. this.strItems5 = JSON.parse(val.value)
  3833. const arrs = [], arrs1 = [], strItems = []
  3834. this.serData.forEach(s => {
  3835. if (this.selData.length == 0) {
  3836. if (this.repair == '1') {
  3837. if (s.id == 1) {
  3838. this.selData.push(s)
  3839. }
  3840. } else {
  3841. if (!s._disabled) {
  3842. this.selData.push(s)
  3843. }
  3844. }
  3845. }
  3846. })
  3847. this.selData.map(v => {
  3848. arrs1.push(v.id)
  3849. if (this.repair == '1') {
  3850. if (v.id != 9119 && v.id !== 9120 && v.id !== 9121 && v.id !== 9122 && v.id !== 9123) {
  3851. arrs.push(v)
  3852. }
  3853. } else {
  3854. if (v.id != 9119 && !v._disabled) {
  3855. arrs.push(v)
  3856. }
  3857. }
  3858. if (v.id == 9119) {
  3859. strItems.splice(1, 0, this.strItems1)
  3860. } else if (v.id == 9120) {
  3861. strItems.splice(1, 0, this.strItems2)
  3862. } else if (v.id == 9121) {
  3863. strItems.splice(1, 0, this.strItems3)
  3864. } else if (v.id == 9122) {
  3865. strItems.splice(1, 0, this.strItems4)
  3866. } else if (v.id == 9123) {
  3867. strItems.splice(1, 0, this.strItems5)
  3868. }
  3869. })
  3870. if (arrs1.indexOf(9119) > -1 || arrs1.indexOf(9120) > -1 || arrs1.indexOf(9121) > -1 || arrs1.indexOf(9122) > -1 || arrs1.indexOf(9123) > -1) {
  3871. this.sumSel = arrs.concat(strItems)
  3872. } else {
  3873. this.sumSel = arrs
  3874. }
  3875. }
  3876. }
  3877. },
  3878. [
  3879. h('Option', {
  3880. props: {
  3881. value: JSON.stringify(this.resArr5[1])
  3882. }
  3883. }, this.resArr5[1].s_name),
  3884. h('Option', {
  3885. props: {
  3886. value: JSON.stringify(this.resArr5[0])
  3887. }
  3888. }, this.resArr5[0].s_name)
  3889. ]
  3890. )
  3891. } else if (row.id == 9124) {
  3892. return h('Select', {
  3893. props: {
  3894. placeholder: '请选择业主监控',
  3895. value: '',
  3896. },
  3897. on: {
  3898. 'on-change': (val) => {
  3899. row.i_price_year = JSON.parse(val).i_price_year
  3900. row.i_price_month = JSON.parse(val).i_price_month
  3901. },
  3902. 'on-select': val => {
  3903. this.strItems6 = JSON.parse(val.value)
  3904. const arrs = [], arrs1 = [], strItems = []
  3905. this.serData.forEach(s => {
  3906. if (this.selData.length == 0) {
  3907. if (this.repair == '1') {
  3908. if (s.id == 1) {
  3909. this.selData.push(s)
  3910. }
  3911. } else {
  3912. if (!s._disabled) {
  3913. this.selData.push(s)
  3914. }
  3915. }
  3916. }
  3917. })
  3918. this.selData.map(v => {
  3919. arrs1.push(v.id)
  3920. if (this.repair == '1') {
  3921. if (v.id != 9119 && v.id !== 9120 && v.id !== 9121 && v.id !== 9122 && v.id !== 9123 && v.id !== 9124) {
  3922. arrs.push(v)
  3923. }
  3924. } else {
  3925. if (v.id != 9119 && !v._disabled) {
  3926. arrs.push(v)
  3927. }
  3928. }
  3929. if (v.id == 9119) {
  3930. strItems.splice(1, 0, this.strItems1)
  3931. } else if (v.id == 9120) {
  3932. strItems.splice(1, 0, this.strItems2)
  3933. } else if (v.id == 9121) {
  3934. strItems.splice(1, 0, this.strItems3)
  3935. } else if (v.id == 9122) {
  3936. strItems.splice(1, 0, this.strItems4)
  3937. } else if (v.id == 9123) {
  3938. strItems.splice(1, 0, this.strItems5)
  3939. } else if (v.id == 9124) {
  3940. strItems.splice(1, 0, this.strItems6)
  3941. }
  3942. })
  3943. if (arrs1.indexOf(9119) > -1 || arrs1.indexOf(9120) > -1 || arrs1.indexOf(9121) > -1 || arrs1.indexOf(9122) > -1 || arrs1.indexOf(9123) > -1 || arrs1.indexOf(9124) > -1) {
  3944. this.sumSel = arrs.concat(strItems)
  3945. } else {
  3946. this.sumSel = arrs
  3947. }
  3948. }
  3949. }
  3950. },
  3951. [
  3952. h('Option', {
  3953. props: {
  3954. value: JSON.stringify(this.resArr6[1])
  3955. }
  3956. }, this.resArr6[1].s_name),
  3957. h('Option', {
  3958. props: {
  3959. value: JSON.stringify(this.resArr6[0])
  3960. }
  3961. }, this.resArr6[0].s_name)
  3962. ]
  3963. )
  3964. } else {
  3965. return h('span', row.s_name ? row.s_name : '-')
  3966. }
  3967. } else {
  3968. return h('span', row.s_name ? row.s_name : '-')
  3969. }
  3970. }
  3971. },
  3972. {
  3973. title: '年价格',
  3974. key: 'i_price_year',
  3975. align: 'center',
  3976. render: (h, { row }) => {
  3977. let arr1 = [11, 15]
  3978. if (row.i_price_year) {
  3979. if (row.s_count_year) {
  3980. if (row.id == 17 || row.id == 18) {
  3981. return h('span', row.i_price_year)
  3982. } else {
  3983. return h('span', row.s_count_year + (arr1.indexOf(row.id) > -1 ? '次/' : '个/') + row.i_price_year)
  3984. }
  3985. } else {
  3986. return h('span', row.i_price_year)
  3987. }
  3988. } else {
  3989. return h('span', '-')
  3990. }
  3991. }
  3992. },
  3993. {
  3994. title: '月价格',
  3995. key: 'i_price_month',
  3996. align: 'center',
  3997. render: (h, { row }) => {
  3998. let arr1 = [11, 15]
  3999. if (row.i_price_month) {
  4000. if (row.s_count_month) {
  4001. if (row.id == 17 || row.id == 18) {
  4002. return h('span', row.i_price_month)
  4003. } else {
  4004. return h('span', row.s_count_month + (arr1.indexOf(row.id) > -1 ? '次/' : '个/') + row.i_price_month)
  4005. }
  4006. } else {
  4007. return h('span', row.i_price_month)
  4008. }
  4009. } else {
  4010. return h('span', '-')
  4011. }
  4012. }
  4013. }
  4014. ],
  4015. // 结束
  4016. sumSel: [],
  4017. creAuth: '',
  4018. bigStas: Number,
  4019. subStas: Number,
  4020. yearStas: Number,
  4021. isYears: Number,
  4022. stopTime: Number,
  4023. monthTime: Number,
  4024. colr: '',
  4025. proNums: 0,
  4026. comVal: {},
  4027. bigPro: [
  4028. { v: '1', n: '大会员' },
  4029. { v: '2', n: '大会员子账号' },
  4030. { v: '3', n: '大会员补充包' }
  4031. ],
  4032. levelDown: [],
  4033. nums: '',
  4034. chargeStatus: [
  4035. { v: 0, n: '免费' },
  4036. { v: 1, n: '收费' }
  4037. ],
  4038. currentServerid:''
  4039. }
  4040. }
  4041. }
  4042. </script>
  4043. <style lang="scss" scoped>
  4044. .servechildrenbox {
  4045. display: flex;
  4046. // margin-top: 15px;
  4047. }
  4048. .serve-one {
  4049. font-weight: bold;
  4050. }
  4051. .servebox {
  4052. overflow: hidden;
  4053. display: block;
  4054. }
  4055. .serve-two {
  4056. display: flex;
  4057. margin: 5px 0;
  4058. }
  4059. .one-group {
  4060. float: left;
  4061. margin: 5px 0;
  4062. }
  4063. .serve-content {
  4064. display: flex;
  4065. flex-wrap: wrap;
  4066. float: left;
  4067. width: 650px;
  4068. }
  4069. .sel-table.ivu-table-wrapper {
  4070. overflow: unset;
  4071. }
  4072. .button-grey {
  4073. color: #000000db;
  4074. background-color: #c6c5c5;
  4075. border-color: grey;
  4076. }
  4077. .ivu-form-item {
  4078. margin-bottom: 10px;
  4079. }
  4080. </style>