edit.vue 198 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558
  1. <template>
  2. <div>
  3. <Toptitle
  4. :title="type == 1 ? '新增订单' : type == 2 ? '编辑订单' : '订单详情'"
  5. >
  6. <Button @click="back" type="primary" ghost style="margin-right: 10px"
  7. >返回</Button
  8. >
  9. <Button
  10. @click="showForms = true"
  11. type="primary"
  12. v-show="type != 3"
  13. style="margin-right: 10px"
  14. >表单设置</Button
  15. >
  16. <Button
  17. type="primary"
  18. v-show="type != 3"
  19. @click="handleSubmit('infoOrder')"
  20. >保存</Button
  21. >
  22. </Toptitle>
  23. <div class="page-edit">
  24. <!-- 表单项 -->
  25. <Form
  26. ref="infoOrder"
  27. inline
  28. :label-width="100"
  29. :model="info"
  30. style="padding: 10px 0"
  31. :rules="infoRules"
  32. >
  33. <FormItem
  34. v-if="formSetTableData.filter((v) => v.key == 'order_no')[0].is_show"
  35. :label="formSetTableData.filter((v) => v.key == 'order_no')[0].title"
  36. >
  37. <Input
  38. disabled
  39. v-if="type != 3"
  40. v-model="info.order_no"
  41. class="auto-width"
  42. placeholder="自动生成"
  43. />
  44. <span v-else>{{ info.order_no }}</span>
  45. </FormItem>
  46. <FormItem
  47. v-if="
  48. formSetTableData.filter((v) => v.key == 'residential_name')[0]
  49. .is_show
  50. "
  51. :label="
  52. formSetTableData.filter((v) => v.key == 'residential_name')[0].title
  53. "
  54. prop="residential_name"
  55. >
  56. <Input
  57. v-model="info.residential_name"
  58. v-if="type != 3"
  59. class="auto-width"
  60. placeholder="请输入项目名称"
  61. />
  62. <span v-else>{{ info.residential_name }}</span>
  63. </FormItem>
  64. <FormItem
  65. v-if="
  66. formSetTableData.filter((v) => v.key == 'warning_state')[0].is_show
  67. "
  68. :label="
  69. formSetTableData.filter((v) => v.key == 'warning_state')[0].title
  70. "
  71. prop="warning_state"
  72. >
  73. <Select
  74. clearable
  75. class="auto-width"
  76. v-if="type != 3"
  77. v-model="info.warning_state"
  78. >
  79. <Option
  80. :label="_item.title"
  81. v-for="_item in warningList"
  82. :key="_item.id"
  83. :value="_item.id"
  84. ></Option>
  85. </Select>
  86. <span v-else>{{
  87. warningList.length > 0 && info.warning_state
  88. ? warningList.filter((item) => item.id == info.warning_state)[0]
  89. .title
  90. : ""
  91. }}</span>
  92. </FormItem>
  93. <FormItem
  94. v-if="
  95. formSetTableData.filter((v) => v.key == 'front_money')[0].is_show
  96. "
  97. :label="
  98. formSetTableData.filter((v) => v.key == 'front_money')[0].title
  99. "
  100. >
  101. <Input
  102. v-model="info.front_money"
  103. class="auto-width"
  104. v-if="type != 3"
  105. placeholder="请输入项目定金"
  106. />
  107. <span v-else>{{ info.front_money }}</span>
  108. </FormItem>
  109. <FormItem
  110. v-if="
  111. formSetTableData.filter((v) => v.key == 'start_time')[0].is_show
  112. "
  113. :label="
  114. formSetTableData.filter((v) => v.key == 'start_time')[0].title
  115. "
  116. >
  117. <DatePicker
  118. :options="options"
  119. v-if="type != 3"
  120. v-model="info.start_time"
  121. type="date"
  122. placeholder="开始日期"
  123. class="auto-width"
  124. ></DatePicker>
  125. <span v-else>{{ info.start_time }}</span>
  126. </FormItem>
  127. <FormItem
  128. v-if="
  129. formSetTableData.filter((v) => v.key == 'client_name')[0].is_show
  130. "
  131. :label="
  132. formSetTableData.filter((v) => v.key == 'client_name')[0].title
  133. "
  134. prop="custom_id"
  135. >
  136. <Select
  137. clearable
  138. filterable
  139. v-if="type != 3"
  140. class="auto-width"
  141. @on-change="handleClientChange"
  142. v-model="info.custom_id"
  143. >
  144. <Option
  145. v-for="item in clientList"
  146. :label="item.title"
  147. :key="item.id"
  148. :value="item.id"
  149. ></Option>
  150. </Select>
  151. <span v-else>{{
  152. clientList.length > 0 && info.custom_id
  153. ? clientList.filter((item) => item.id == info.custom_id)[0].title
  154. : ""
  155. }}</span>
  156. </FormItem>
  157. <FormItem
  158. v-if="
  159. formSetTableData.filter((v) => v.key == 'custom_detail_name')[0]
  160. .is_show
  161. "
  162. :label="
  163. formSetTableData.filter((v) => v.key == 'custom_detail_name')[0]
  164. .title
  165. "
  166. >
  167. <Select
  168. placeholder="请选择负责人"
  169. v-if="type != 3"
  170. clearable
  171. filterable
  172. v-model="info.custom_detail_name"
  173. @on-change="handleClientChargeChange"
  174. class="auto-width"
  175. >
  176. <!-- @on-change="handleClientDetailChange" -->
  177. <Option
  178. v-for="item of clientDetailList_respon"
  179. :key="item.service_name"
  180. :label="item.service_name"
  181. :value="item.service_name"
  182. ></Option>
  183. </Select>
  184. <span v-else>{{ info.custom_detail_name }}</span>
  185. </FormItem>
  186. <FormItem
  187. v-if="
  188. formSetTableData.filter((v) => v.key == 'custom_detail_mobile')[0]
  189. .is_show
  190. "
  191. :label="
  192. formSetTableData.filter((v) => v.key == 'custom_detail_mobile')[0]
  193. .title
  194. "
  195. >
  196. <Select
  197. clearable
  198. filterable
  199. v-if="type != 3"
  200. class="auto-width"
  201. v-model="info.custom_detail_mobile"
  202. >
  203. <Option
  204. v-for="item in clientDetailList_mobile"
  205. :label="item.mobile"
  206. :key="item.id"
  207. :value="item.mobile"
  208. ></Option>
  209. </Select>
  210. <span v-else>{{ info.custom_detail_mobile }}</span>
  211. </FormItem>
  212. <FormItem
  213. v-if="
  214. formSetTableData.filter((v) => v.key == 'custom_detail_id')[0]
  215. .is_show
  216. "
  217. :label="
  218. formSetTableData.filter((v) => v.key == 'custom_detail_id')[0].title
  219. "
  220. >
  221. <Select
  222. clearable
  223. filterable
  224. v-if="type != 3"
  225. class="auto-width"
  226. @on-change="handleClientDetailChange"
  227. v-model="info.custom_detail_id"
  228. >
  229. <Option
  230. v-for="item in clientDetailList_address"
  231. :label="item.address"
  232. :key="item.id"
  233. :value="item.id"
  234. ></Option>
  235. </Select>
  236. <span v-else>{{ info.custom_detail_id }}</span>
  237. </FormItem>
  238. <FormItem
  239. v-if="
  240. formSetTableData.filter((v) => v.key == 'service_id')[0].is_show
  241. "
  242. :label="
  243. formSetTableData.filter((v) => v.key == 'service_id')[0].title
  244. "
  245. >
  246. <Select
  247. disabled
  248. v-if="type != 3"
  249. placeholder="自动带出"
  250. v-model="info.service_id"
  251. class="auto-width"
  252. >
  253. <Option
  254. v-for="item of users"
  255. :key="item.id"
  256. :label="item.nickname"
  257. :value="item.id"
  258. ></Option>
  259. </Select>
  260. <span v-else>{{
  261. users.length > 0 && info.service_id
  262. ? users.filter((item) => item.id == info.service_id)[0].nickname
  263. : ""
  264. }}</span>
  265. </FormItem>
  266. <FormItem
  267. v-if="formSetTableData.filter((v) => v.key == 'end_time')[0].is_show"
  268. :label="formSetTableData.filter((v) => v.key == 'end_time')[0].title"
  269. >
  270. <DatePicker
  271. :options="options"
  272. v-if="type != 3"
  273. v-model="info.end_time"
  274. type="date"
  275. placeholder="交付日期"
  276. class="auto-width"
  277. ></DatePicker>
  278. <span v-else>{{ info.end_time }}</span>
  279. </FormItem>
  280. <FormItem
  281. v-if="
  282. formSetTableData.filter((v) => v.key == 'predict_price')[0].is_show
  283. "
  284. :label="
  285. formSetTableData.filter((v) => v.key == 'predict_price')[0].title
  286. "
  287. >
  288. <Input
  289. v-model="info.predict_price"
  290. v-if="type != 3"
  291. readonly
  292. class="auto-width"
  293. placeholder="自动生成"
  294. />
  295. <span v-else>{{ info.predict_price }}</span>
  296. </FormItem>
  297. <FormItem
  298. v-if="formSetTableData.filter((v) => v.key == 'fax_price')[0].is_show"
  299. :label="formSetTableData.filter((v) => v.key == 'fax_price')[0].title"
  300. >
  301. <Input
  302. v-model="info.fax_price"
  303. v-if="type != 3"
  304. readonly
  305. class="auto-width"
  306. placeholder="自动生成"
  307. />
  308. <span v-else>{{ info.fax_price }}</span>
  309. </FormItem>
  310. <FormItem
  311. v-if="
  312. formSetTableData.filter((v) => v.key == 'order_price')[0].is_show
  313. "
  314. :label="
  315. formSetTableData.filter((v) => v.key == 'order_price')[0].title
  316. "
  317. >
  318. <Input
  319. v-model="info.order_price"
  320. v-if="type != 3"
  321. @on-change="handleOrderPriceChange($event, info)"
  322. class="auto-width"
  323. placeholder="自动生成"
  324. />
  325. <span v-else>{{ info.order_price }}</span>
  326. </FormItem>
  327. <FormItem
  328. prop="box_id"
  329. v-if="formSetTableData.filter((v) => v.key == 'box_id')[0].is_show"
  330. :label="formSetTableData.filter((v) => v.key == 'box_id')[0].title"
  331. >
  332. <Select
  333. clearable
  334. filterable
  335. v-if="type != 3"
  336. v-model="info.box_id"
  337. class="auto-width"
  338. >
  339. <Option
  340. v-for="item of sub_material_list"
  341. :key="item.id"
  342. :label="item.title"
  343. :value="item.id"
  344. ></Option>
  345. </Select>
  346. <span v-else>{{
  347. sub_material_list.length > 0 && info.box_id
  348. ? sub_material_list.filter((item) => item.id == info.box_id)[0]
  349. .title
  350. : ""
  351. }}</span>
  352. </FormItem>
  353. <FormItem
  354. v-if="formSetTableData.filter((v) => v.key == 'remark')[0].is_show"
  355. :label="formSetTableData.filter((v) => v.key == 'remark')[0].title"
  356. >
  357. <Input
  358. v-model="info.remark"
  359. type="textarea"
  360. v-if="type != 3"
  361. class="auto-width"
  362. placeholder="请输入订单备注"
  363. />
  364. <span v-else>{{ info.remark }}</span>
  365. </FormItem>
  366. <FormItem label="上传附件:">
  367. <div class="product-img">
  368. <div class="product-add">
  369. <div class="items" v-for="(item, index) of info.img" :key="index">
  370. <img
  371. @click="looks(item)"
  372. :src="$store.state.ip + item"
  373. alt=""
  374. />
  375. <Icon
  376. v-if="type != 3"
  377. size="20"
  378. @click="delItems(index, info.img)"
  379. class="delete-img"
  380. type="ios-close-circle"
  381. />
  382. </div>
  383. <div class="add-items" v-if="type != 3">
  384. <div class="item">
  385. <Icon size="50" type="ios-add" />
  386. </div>
  387. <span>支持jpg/png格式</span>
  388. <input
  389. @change="changeIpt($event, info.img)"
  390. type="file"
  391. class="ipt"
  392. />
  393. </div>
  394. </div>
  395. </div>
  396. <!-- <Button type="primary"
  397. style="margin-right:10px;"
  398. ghost>上传附件</Button> -->
  399. <!-- <Upload style="display: inline"
  400. name="your_file"
  401. :show-upload-list="false"
  402. :headers="headers"
  403. multiple
  404. :data="uploadData"
  405. :on-error="uploadError"
  406. :on-progress="onProgress"
  407. :on-success="uploadSuccess"
  408. :action="$store.state.ip + '/api/deep_img_import'">
  409. <Button type="primary"
  410. style="margin-right: 10px">上传附件</Button>
  411. </Upload> -->
  412. </FormItem>
  413. <div label="线条:" style="margin-left:20px;width:95%">
  414. <div style="font-size:20px">
  415. <span>线条:</span>
  416. <span v-if="wood_title_count.length < 1">无</span>
  417. <span
  418. v-else
  419. v-for="(item, index) in wood_title_count"
  420. :key="item.title + index"
  421. >{{ item.title }}:
  422. <span v-for="(_item, _index) in item.measure_str" :key="_item.id"
  423. >{{ _item.measure }}={{ _item.num }}{{ item.unit }}
  424. <span v-show="_index < item.measure_str.length - 1">;</span>
  425. </span>
  426. <span v-show="index < wood_title_count.length - 1">;</span>
  427. </span>
  428. </div>
  429. </div>
  430. <div label="合计:" style="margin-left:20px;width:95%">
  431. <div style="font-size:20px">
  432. <span>合计:</span>
  433. <span v-if="parts_title_count.length < 1">无</span>
  434. <span
  435. v-else
  436. v-for="(item, index) in parts_title_count"
  437. :key="item.title + index"
  438. v-show="item.title.indexOf('线条') == -1"
  439. >{{ item.title }}:{{ item.num }}{{ item.unit }}
  440. <span v-show="index < parts_title_count.length - 1">;</span>
  441. </span>
  442. </div>
  443. </div>
  444. </Form>
  445. <!-- 户型选择 -->
  446. <div class="content">
  447. <vxe-toolbar>
  448. <template #buttons>
  449. <div class="content_header">
  450. <h2>产品信息</h2>
  451. <div>
  452. <Button
  453. type="primary"
  454. style="margin-right: 10px"
  455. v-show="!tree_btn_show"
  456. @click="
  457. $refs.xTree.setAllTreeExpand(true);
  458. tree_btn_show = !tree_btn_show;
  459. "
  460. >全部展开</Button
  461. >
  462. <Button
  463. type="primary"
  464. style="margin-right: 10px"
  465. v-show="tree_btn_show"
  466. @click="
  467. $refs.xTree.clearTreeExpand();
  468. tree_btn_show = !tree_btn_show;
  469. "
  470. >全部收缩</Button
  471. >
  472. <Button
  473. type="primary"
  474. style="margin-right: 10px"
  475. v-show="type == 3"
  476. @click="handleShowMaterial"
  477. >{{ is_material_show ? "收起" : "查看" }}原材料</Button
  478. >
  479. <Button
  480. type="primary"
  481. style="margin-right: 10px"
  482. v-show="type != 3"
  483. @click="handleSet({}, null, 1)"
  484. >新增产品</Button
  485. >
  486. </div>
  487. </div>
  488. </template>
  489. </vxe-toolbar>
  490. <vxe-table
  491. resizable
  492. border
  493. ref="xTree"
  494. :tree-config="{ children: 'part' }"
  495. :data="tableData"
  496. >
  497. <vxe-table-column
  498. field="title"
  499. title="产品名称"
  500. align="center"
  501. min-width="120"
  502. tree-node
  503. ></vxe-table-column>
  504. <vxe-table-column
  505. field="position"
  506. title="位置"
  507. align="center"
  508. min-width="80"
  509. ></vxe-table-column>
  510. <vxe-table-column
  511. field="unit"
  512. title="计量单位"
  513. align="center"
  514. min-width="80"
  515. ></vxe-table-column>
  516. <vxe-table-column
  517. field="process_str"
  518. title="工艺属性"
  519. align="center"
  520. min-width="200"
  521. ></vxe-table-column>
  522. <vxe-table-column
  523. field="measurement_no_letter"
  524. title="尺寸"
  525. align="center"
  526. min-width="180"
  527. ></vxe-table-column>
  528. <vxe-table-column
  529. field="total_num"
  530. title="数量"
  531. align="center"
  532. min-width="80"
  533. ></vxe-table-column>
  534. <vxe-table-column
  535. field="num"
  536. title="核算数量"
  537. align="center"
  538. min-width="80"
  539. >
  540. <template #default="{ row }">
  541. {{ row.is_metal ? "" : row.num }}
  542. </template>
  543. </vxe-table-column>
  544. <vxe-table-column
  545. field="unit_price"
  546. title="单价"
  547. align="center"
  548. min-width="80"
  549. ></vxe-table-column>
  550. <vxe-table-column
  551. field="ext_price"
  552. title="附加金额"
  553. align="center"
  554. min-width="80"
  555. ></vxe-table-column>
  556. <vxe-table-column
  557. field="over_price"
  558. title="超标金额"
  559. align="center"
  560. min-width="80"
  561. ></vxe-table-column>
  562. <vxe-table-column
  563. field="price"
  564. title="金额"
  565. align="center"
  566. min-width="80"
  567. >
  568. <template #default="{ row }">
  569. {{ row.is_metal ? "" : row.price }}
  570. </template>
  571. </vxe-table-column>
  572. <vxe-table-column
  573. field="url_number"
  574. title="图号"
  575. align="center"
  576. min-width="80"
  577. ></vxe-table-column>
  578. <vxe-table-column
  579. field="remark"
  580. title="备注"
  581. align="center"
  582. min-width="80"
  583. ></vxe-table-column>
  584. <vxe-table-column
  585. field="extra"
  586. title="附加项"
  587. align="center"
  588. min-width="80"
  589. ></vxe-table-column>
  590. <vxe-table-column
  591. field="date"
  592. title="其他项"
  593. align="center"
  594. min-width="80"
  595. ></vxe-table-column>
  596. <vxe-table-column
  597. field=""
  598. title="操作"
  599. align="center"
  600. min-width="180"
  601. >
  602. <template #default="{ row, rowIndex }">
  603. <a
  604. @click="handleSet(row, rowIndex, 5)"
  605. v-show="type == 3 && rowIndex >= 0"
  606. style="margin: 0 5px"
  607. >详情</a
  608. >
  609. <a
  610. @click="handleSet(row, rowIndex, 4)"
  611. v-if="type != 3"
  612. v-show="rowIndex >= 0"
  613. style="margin: 0 5px"
  614. >复制</a
  615. >
  616. <a
  617. @click="handleSet(row, rowIndex, 2)"
  618. v-if="type != 3"
  619. v-show="rowIndex >= 0"
  620. style="margin: 0 5px"
  621. >编辑</a
  622. >
  623. <a
  624. @click="handleSet(row, rowIndex, 3)"
  625. v-if="type != 3"
  626. v-show="rowIndex >= 0"
  627. style="margin: 0 5px"
  628. >删除</a
  629. >
  630. </template>
  631. </vxe-table-column>
  632. </vxe-table>
  633. <!-- 原材料 -->
  634. <!-- v-show="type==3" -->
  635. <div class="original-part" v-show="type == 3 && is_material_show">
  636. <Table
  637. border
  638. show-summary
  639. :summary-method="handleSummary"
  640. :span-method="handleSpan"
  641. :columns="originalTableColumns"
  642. :data="originalData"
  643. ></Table>
  644. </div>
  645. </div>
  646. </div>
  647. <!-- 选择产品弹层--新增框 -->
  648. <Modal
  649. :width="1400"
  650. class-name="vertical-center-modal"
  651. title="新增产品"
  652. :mask-closable="false"
  653. v-model="showAddProduct"
  654. @on-visible-change="modalVisibleChange"
  655. >
  656. <div style="max-height: 800px; overflow: hidden; overflow-y: auto">
  657. <Tabs v-model="currentTabIndex" ref="tabsRef">
  658. <Button
  659. @click="handleProductCopy"
  660. size="small"
  661. type="primary"
  662. style="margin-right: 5px"
  663. slot="extra"
  664. >复制产品</Button
  665. >
  666. <Button
  667. @click="handleTabsAdd"
  668. size="small"
  669. type="warning"
  670. style="margin-right: 5px"
  671. slot="extra"
  672. >添加</Button
  673. >
  674. <Button
  675. @click="handleProductDele"
  676. size="small"
  677. type="primary"
  678. slot="extra"
  679. >删除</Button
  680. >
  681. <TabPane
  682. :label="
  683. (item.position ? item.position : '位置') + '-' + item.type_name
  684. "
  685. v-for="(item, index) in modalArray"
  686. :key="item.id"
  687. :name="item.index + ''"
  688. >
  689. <div class="modal_product_info">
  690. <div class="modal_product_info_title">产品信息</div>
  691. <div class="modal_product_info_content modal_product">
  692. <Form :model="item" :label-width="100">
  693. <FormItem label="选择产品:">
  694. <Tooltip style="width: 120px" transfer>
  695. <span slot="content">
  696. <span
  697. v-for="_item in productList"
  698. :key="_item.id"
  699. v-show="_item.id == item.product_id"
  700. >{{ _item.title }}</span
  701. >
  702. </span>
  703. <Select
  704. filterable
  705. clearable
  706. filter-by-label
  707. transfer
  708. label-in-value
  709. size="small"
  710. v-model="item.product_id"
  711. @on-change="changeAddProduct($event, index)"
  712. style="width: 120px"
  713. >
  714. <Option
  715. v-for="item of productList"
  716. :tag="item.img_url"
  717. :key="item.id"
  718. :label="item.title"
  719. :value="item.id"
  720. ></Option>
  721. </Select>
  722. </Tooltip>
  723. </FormItem>
  724. <FormItem label="位置:">
  725. <Tooltip style="width: 120px" transfer>
  726. <span slot="content">
  727. {{ item.position }}
  728. </span>
  729. <Input
  730. size="small"
  731. v-model="item.position"
  732. style="width: 120px"
  733. placeholder="请输入位置"
  734. />
  735. </Tooltip>
  736. </FormItem>
  737. <FormItem label="计量单位:">
  738. <Input
  739. size="small"
  740. disabled
  741. style="width: 120px"
  742. v-model="item.unit"
  743. placeholder="自动带出"
  744. />
  745. </FormItem>
  746. <!-- 工艺属性 -->
  747. <FormItem
  748. v-for="(ele, idx) in item.process"
  749. :key="ele.key + '' + item.id"
  750. :label="ele.title + ':'"
  751. >
  752. <Tooltip style="width: 120px" transfer>
  753. <span slot="content">
  754. <span
  755. v-for="_item in ele.processList"
  756. :key="_item.id"
  757. v-show="_item.id == ele.value"
  758. >{{ _item.title }}</span
  759. >
  760. </span>
  761. <Select
  762. style="width: 120px"
  763. filterable
  764. clearable
  765. filter-by-label
  766. transfer
  767. label-in-value
  768. @on-open-change="
  769. (e) => handleGetProductMeasure(e, idx, item, ele)
  770. "
  771. @on-change="
  772. (e) => handleProductProcessChange(e, idx, item, ele)
  773. "
  774. v-model="ele.value"
  775. size="small"
  776. >
  777. <Option
  778. v-for="option of ele.processList"
  779. :key="option.id"
  780. :disabled="option.isDisabled"
  781. :label="option.title"
  782. :value="option.id"
  783. ></Option>
  784. </Select>
  785. </Tooltip>
  786. </FormItem>
  787. <!-- 测量字段 -->
  788. <FormItem
  789. v-for="ele in item.measure"
  790. :key="ele.id"
  791. :label="ele.title + ':'"
  792. >
  793. <Input
  794. size="small"
  795. type="text"
  796. clearable
  797. :placeholder="ele.e_title"
  798. v-model="ele.value"
  799. @on-change="
  800. (e) => handleProductMeasureChange(e, item, ele)
  801. "
  802. @on-blur="(e) => handleProductMeasureBlur(e, item, ele)"
  803. style="width: 120px"
  804. />
  805. </FormItem>
  806. <FormItem label="数量:">
  807. <Input
  808. size="small"
  809. @on-change="(e) => handleProductNumChange(e, item)"
  810. v-model="item.total_num"
  811. style="width: 120px"
  812. placeholder="请输入产品数量"
  813. />
  814. </FormItem>
  815. <FormItem label="核算数量:">
  816. <Input
  817. size="small"
  818. v-model="item.num"
  819. disabled
  820. style="width: 120px"
  821. placeholder="自动带出"
  822. />
  823. </FormItem>
  824. <FormItem label="单价:">
  825. <Input
  826. size="small"
  827. v-model="item.unit_price"
  828. @on-change="(e) => handleProductUnit_priceChange(e, item)"
  829. style="width: 120px"
  830. placeholder="自动带出"
  831. />
  832. </FormItem>
  833. <FormItem label="附加金额:">
  834. <Input
  835. size="small"
  836. v-model="item.ext_price"
  837. @on-change="(e) => handleProductExt_priceChange(e, item)"
  838. style="width: 120px"
  839. placeholder="自动带出"
  840. />
  841. </FormItem>
  842. <FormItem label="超标金额:">
  843. <Input
  844. size="small"
  845. @on-change="(e) => handleProductOver_priceChange(e, item)"
  846. v-model="item.over_price"
  847. style="width: 120px"
  848. placeholder="自动带出"
  849. />
  850. </FormItem>
  851. <FormItem label="金额:">
  852. <Input
  853. size="small"
  854. v-model="item.price"
  855. style="width: 120px"
  856. placeholder="自动带出"
  857. />
  858. </FormItem>
  859. <FormItem label="图号:">
  860. <Input
  861. size="small"
  862. v-model="item.url_number"
  863. style="width: 120px"
  864. placeholder="自动带出"
  865. />
  866. </FormItem>
  867. <FormItem
  868. v-for="(_customize, customize_key) in item.customize"
  869. :label="_customize.style + ':'"
  870. :key="customize_key + 99"
  871. >
  872. <Input
  873. v-show="_customize.type == 1"
  874. size="small"
  875. type="text"
  876. v-model="_customize.value"
  877. style="width: 120px"
  878. placeholder="请输入"
  879. />
  880. <Select
  881. v-show="_customize.type == 2"
  882. style="width: 120px"
  883. filterable
  884. clearable
  885. v-model="_customize.value"
  886. size="small"
  887. >
  888. <Option
  889. v-for="option of _customize.explain"
  890. :key="option.value"
  891. :label="option.value"
  892. :value="option.value"
  893. ></Option>
  894. </Select>
  895. </FormItem>
  896. <FormItem
  897. v-for="(outh, outh_key) in item.outh"
  898. :label="outh.title"
  899. :key="outh_key + 21"
  900. >
  901. <img
  902. v-if="outh.key == 'img' || outh.key == 'url'"
  903. @click="showPreview(item, outh.key)"
  904. style="
  905. max-width: 30px;
  906. max-height: 30px;
  907. top: 5px;
  908. position: relative;
  909. cursor: pointer;
  910. "
  911. :src="$store.state.ip + outh.value"
  912. />
  913. <Input
  914. v-if="
  915. outh.key != 'img' &&
  916. outh.key != 'url' &&
  917. outh.key != 'lock'
  918. "
  919. disabled
  920. placeholder="自动生成"
  921. style="width: 120px"
  922. size="small"
  923. v-model="outh.value"
  924. />
  925. <Select
  926. label-in-value
  927. @on-change="changeLock($event, item, index)"
  928. size="small"
  929. clearable
  930. style="width: 120px"
  931. v-if="outh.key == 'lock'"
  932. v-model="item[outh.key]"
  933. >
  934. <Option
  935. v-for="luck of lock_list"
  936. :key="luck.id"
  937. :tag="luck.price"
  938. :value="luck.id"
  939. :label="luck.title"
  940. ></Option>
  941. <Option :value="0" label="无"></Option>
  942. </Select>
  943. </FormItem>
  944. <FormItem label="备注:">
  945. <Select
  946. size="small"
  947. clearable
  948. filterable
  949. allow-create
  950. @on-create="handleRemarkCreate"
  951. style="width: 120px"
  952. v-model="item.remark"
  953. >
  954. <Option
  955. v-for="_remark of support_remark"
  956. :key="_remark"
  957. :value="_remark"
  958. :label="_remark"
  959. ></Option>
  960. </Select>
  961. <!-- <Input
  962. size="small"
  963. type="textarea"
  964. v-model="item.remark"
  965. style="width: 120px"
  966. placeholder="请输入备注"
  967. /> -->
  968. </FormItem>
  969. <FormItem label="产品图:">
  970. <!-- v-show="modalData.url && modalData.url.length > 0" -->
  971. <div class="product-img">
  972. <div class="product-add">
  973. <div
  974. class="items"
  975. v-for="(item, index) of item.url"
  976. :key="index"
  977. >
  978. <img
  979. @click="looks(item)"
  980. :src="$store.state.ip + item"
  981. alt=""
  982. />
  983. </div>
  984. </div>
  985. </div>
  986. </FormItem>
  987. </Form>
  988. </div>
  989. </div>
  990. <div class="modal_product_info">
  991. <div class="modal_product_info_title">部件信息</div>
  992. <div class="modal_product_info_content modal_parts">
  993. <Form
  994. :model="element"
  995. v-for="(element, idx) in item.part"
  996. :key="element.id + '111' + idx"
  997. :label-width="50"
  998. >
  999. <FormItem
  1000. :label-width="element.isBP ? 1 : 50"
  1001. v-show="!element.is_metal"
  1002. >
  1003. <Radio
  1004. v-show="element.isBP"
  1005. @click.native.prevent="handleRadioClick(element)"
  1006. v-model="element.isChoosed"
  1007. ></Radio>
  1008. <!-- <span v-show="element.isBP">{{ element.part_title }} </span> -->
  1009. </FormItem>
  1010. <FormItem label="部件:" v-show="!element.is_metal">
  1011. <Select
  1012. filterable
  1013. clearable
  1014. transfer
  1015. label-in-value
  1016. size="small"
  1017. @on-change="
  1018. handlePartChange(
  1019. $event,
  1020. element,
  1021. item.measure,
  1022. item.total_num
  1023. )
  1024. "
  1025. v-model="element.change_id"
  1026. style="width: 180px"
  1027. >
  1028. <Option
  1029. v-for="item of element.change"
  1030. :key="item.id"
  1031. :label="item.part_title"
  1032. :value="item.id"
  1033. ></Option>
  1034. </Select>
  1035. </FormItem>
  1036. <FormItem
  1037. label="高:"
  1038. v-show="
  1039. !element.is_metal &&
  1040. element.hide_measure &&
  1041. !element.hide_measure.filter((v) => v == 'H').length > 0
  1042. "
  1043. >
  1044. <Input
  1045. size="small"
  1046. clearable
  1047. v-model="element.long"
  1048. style="width: 50px"
  1049. placeholder="请输入厚"
  1050. />
  1051. </FormItem>
  1052. <FormItem
  1053. label="宽:"
  1054. v-show="
  1055. !element.is_metal &&
  1056. element.hide_measure &&
  1057. !element.hide_measure.filter((v) => v == 'W').length > 0
  1058. "
  1059. >
  1060. <Input
  1061. size="small"
  1062. clearable
  1063. v-model="element.wide"
  1064. style="width: 50px"
  1065. placeholder="请输入宽"
  1066. />
  1067. </FormItem>
  1068. <FormItem
  1069. label="厚:"
  1070. v-show="
  1071. !element.is_metal &&
  1072. element.hide_measure &&
  1073. !element.hide_measure.filter((v) => v == 'T').length > 0
  1074. "
  1075. >
  1076. <Input
  1077. size="small"
  1078. clearable
  1079. v-model="element.high"
  1080. style="width: 50px"
  1081. placeholder="请输入高"
  1082. />
  1083. </FormItem>
  1084. <FormItem
  1085. v-for="(process_detail, idx) in element.process"
  1086. :key="process_detail.name + '222' + element.part_id"
  1087. :label="process_detail.name + ':'"
  1088. v-show="
  1089. !element.is_metal &&
  1090. element.hide_process &&
  1091. !element.hide_process.filter(
  1092. (v) => v == process_detail.process_id
  1093. ).length > 0
  1094. "
  1095. >
  1096. <Tooltip style="width: 120px" transfer>
  1097. <span slot="content">
  1098. <span
  1099. v-for="_item in process_detail.cld"
  1100. :key="_item.id"
  1101. v-show="_item.id == process_detail.procedure_property"
  1102. >{{ _item.title }}</span
  1103. >
  1104. </span>
  1105. <Select
  1106. style="width: 120px"
  1107. filterable
  1108. clearable
  1109. transfer
  1110. label-in-value
  1111. @on-change="
  1112. (e) => handlePartProcessChange(e, idx, element)
  1113. "
  1114. v-model="process_detail.procedure_property"
  1115. size="small"
  1116. >
  1117. <Option
  1118. v-for="option of process_detail.cld"
  1119. :key="option.id"
  1120. :label="option.title"
  1121. :value="option.id"
  1122. ></Option>
  1123. </Select>
  1124. </Tooltip>
  1125. </FormItem>
  1126. <FormItem v-show="!element.is_metal">
  1127. <Button
  1128. @click="handlePartsApart(element, idx, item.part)"
  1129. type="primary"
  1130. v-if="element.isBP"
  1131. style="margin-right: 5px"
  1132. size="small"
  1133. >拆分</Button
  1134. >
  1135. <Button
  1136. @click="handlePartsDele(element, idx, item.part)"
  1137. type="primary"
  1138. v-else
  1139. style="margin-right: 5px"
  1140. size="small"
  1141. >删除</Button
  1142. >
  1143. <Button
  1144. @click="handlePartDetailEdit(element, idx)"
  1145. type="primary"
  1146. style="margin-right: 5px"
  1147. size="small"
  1148. >{{
  1149. element.isShowPartDetail ? "收起" : "修改原材料"
  1150. }}</Button
  1151. >
  1152. </FormItem>
  1153. <div
  1154. :class="[
  1155. 'part_detail_form',
  1156. element.isShowPartDetail ? '' : 'hide_part_detail',
  1157. ]"
  1158. :data-index="idx"
  1159. >
  1160. <FormItem>
  1161. <div v-for="ele in element.part_detail" :key="ele.id">
  1162. <Form :model="ele">
  1163. <FormItem>
  1164. <div style="width: 200px">
  1165. <!-- <Tooltip
  1166. :content="
  1167. ele.title || ele.part_detail_title || '请选择'
  1168. "
  1169. > -->
  1170. {{ ele.title || ele.part_detail_title }}
  1171. <!-- </Tooltip> -->
  1172. </div>
  1173. </FormItem>
  1174. <!-- <FormItem label="厚" :label-width="40">
  1175. <Input
  1176. size="small"
  1177. v-model="ele.long"
  1178. style="width: 80px"
  1179. placeholder="请输入厚"
  1180. />
  1181. </FormItem> -->
  1182. <!-- <FormItem label="宽" :label-width="40">
  1183. <Input
  1184. size="small"
  1185. v-model="ele.wide"
  1186. style="width: 80px"
  1187. placeholder="请输入宽"
  1188. />
  1189. </FormItem> -->
  1190. <!-- <FormItem label="高" :label-width="40">
  1191. <Input
  1192. size="small"
  1193. v-model="ele.high"
  1194. style="width: 80px"
  1195. placeholder="请输入高"
  1196. />
  1197. </FormItem> -->
  1198. <!-- <FormItem label="数量" :label-width="40">
  1199. <Input
  1200. size="small"
  1201. v-model="ele.num"
  1202. @on-change="(e) => handleSubpartNumChange(e, ele)"
  1203. style="width: 80px"
  1204. placeholder="请输入数量"
  1205. />
  1206. </FormItem> -->
  1207. <!-- 原材料 -->
  1208. <Form>
  1209. <FormItem>
  1210. <div style="width: 200px">
  1211. <!-- <Tooltip
  1212. :content="
  1213. ele.material_detail_title || '请选择'
  1214. "
  1215. > -->
  1216. {{ ele.material_detail_title || "请选择" }}
  1217. <!-- </Tooltip> -->
  1218. </div>
  1219. </FormItem>
  1220. <FormItem label="高" :label-width="40">
  1221. <Select
  1222. style="width: 80px"
  1223. filterable
  1224. clearable
  1225. transfer
  1226. v-model="ele.material_detail_id"
  1227. @on-change="(e) => handleMaterialChange(e, ele)"
  1228. placeholder="请选择高"
  1229. size="small"
  1230. >
  1231. <Option
  1232. v-for="option of ele.material_detail_list"
  1233. :key="option.material_detail_id"
  1234. :label="option.long"
  1235. :value="option.material_detail_id"
  1236. ></Option>
  1237. </Select>
  1238. </FormItem>
  1239. <FormItem label="宽" :label-width="40">
  1240. <Select
  1241. style="width: 80px"
  1242. filterable
  1243. clearable
  1244. transfer
  1245. v-model="ele.material_detail_id"
  1246. placeholder="请选择宽"
  1247. size="small"
  1248. >
  1249. <Option
  1250. v-for="option of ele.material_detail_list"
  1251. :key="option.material_detail_id"
  1252. :label="option.wide"
  1253. :value="option.material_detail_id"
  1254. ></Option>
  1255. </Select>
  1256. </FormItem>
  1257. <FormItem label="厚" :label-width="40">
  1258. <Select
  1259. style="width: 80px"
  1260. filterable
  1261. clearable
  1262. transfer
  1263. v-model="ele.material_detail_id"
  1264. placeholder="请选择厚"
  1265. size="small"
  1266. >
  1267. <Option
  1268. v-for="option of ele.material_detail_list"
  1269. :key="option.material_detail_id"
  1270. :label="option.high"
  1271. :value="option.material_detail_id"
  1272. ></Option>
  1273. </Select>
  1274. </FormItem>
  1275. <FormItem label="数量" :label-width="40">
  1276. <Input
  1277. size="small"
  1278. v-model="ele.material_detail_num"
  1279. style="width: 80px"
  1280. placeholder="请输入数量"
  1281. />
  1282. </FormItem>
  1283. </Form>
  1284. </Form>
  1285. </div>
  1286. </FormItem>
  1287. </div>
  1288. </Form>
  1289. </div>
  1290. </div>
  1291. <div class="modal_product_info">
  1292. <div class="modal_product_info_title">
  1293. 附加信息
  1294. <Button
  1295. @click="handleExtraAdd(item.metalArray, 1)"
  1296. type="primary"
  1297. style="margin-right: 5px"
  1298. size="small"
  1299. >新增五金</Button
  1300. >
  1301. <Button
  1302. @click="handleExtraAdd(item.extArray, 2)"
  1303. type="primary"
  1304. size="small"
  1305. >新增附加项目</Button
  1306. >
  1307. </div>
  1308. <div class="modal_product_info_content modal_extra">
  1309. <Form
  1310. :model="element"
  1311. v-for="(element, idx) in item.metalArray"
  1312. :key="element.id"
  1313. :label-width="80"
  1314. >
  1315. <FormItem label="五金:">
  1316. <Select
  1317. filterable
  1318. clearable
  1319. transfer
  1320. label-in-value
  1321. size="small"
  1322. @on-change="
  1323. (e) =>
  1324. handleMetalChange(e, element, idx, item.metalArray)
  1325. "
  1326. v-model="element.material_id"
  1327. style="width: 100px"
  1328. >
  1329. <Option
  1330. v-for="item of metalList"
  1331. :key="item.id"
  1332. :label="item.title"
  1333. :value="item.id"
  1334. ></Option>
  1335. </Select>
  1336. </FormItem>
  1337. <FormItem label="数量:">
  1338. <Input
  1339. size="small"
  1340. v-model="element.num"
  1341. @on-change="handleTotalPriceCalc(element, item)"
  1342. style="width: 100px"
  1343. placeholder="请输入数量"
  1344. />
  1345. </FormItem>
  1346. <FormItem label="单价:">
  1347. <Input
  1348. size="small"
  1349. v-model="element.price"
  1350. @on-change="handleTotalPriceCalc(element, item)"
  1351. style="width: 100px"
  1352. placeholder="请输入单价"
  1353. />
  1354. </FormItem>
  1355. <FormItem label="金额:">
  1356. <Input
  1357. size="small"
  1358. @on-change="handleTotalPriceChange(element, item)"
  1359. v-model="element.total_price"
  1360. style="width: 100px"
  1361. placeholder="请输入金额"
  1362. />
  1363. </FormItem>
  1364. <FormItem label="备注:">
  1365. <Input
  1366. size="small"
  1367. v-model="element.remark"
  1368. style="width: 100px"
  1369. placeholder="请输入备注"
  1370. />
  1371. </FormItem>
  1372. <FormItem>
  1373. <a
  1374. style="color: red"
  1375. @click="
  1376. handleExtraDele(item.metalArray, element, idx, item)
  1377. "
  1378. >删除</a
  1379. >
  1380. </FormItem>
  1381. </Form>
  1382. <Form
  1383. :model="element"
  1384. v-for="(element, idx) in item.extArray"
  1385. :key="element.id"
  1386. :label-width="80"
  1387. >
  1388. <FormItem label="附加项目:">
  1389. <Select
  1390. filterable
  1391. clearable
  1392. transfer
  1393. label-in-value
  1394. size="small"
  1395. v-model="element.id"
  1396. @on-change="(e) => handleExtChange(element, e, item)"
  1397. style="width: 100px"
  1398. >
  1399. <Option
  1400. v-for="item of extList"
  1401. :key="item.id"
  1402. :label="item.title"
  1403. :value="item.id"
  1404. ></Option>
  1405. </Select>
  1406. </FormItem>
  1407. <FormItem label="数量:">
  1408. <Input
  1409. size="small"
  1410. v-model="element.num"
  1411. @on-change="handleTotalPriceCalc(element, item)"
  1412. style="width: 100px"
  1413. placeholder="请输入数量"
  1414. />
  1415. </FormItem>
  1416. <FormItem label="单价:">
  1417. <Input
  1418. size="small"
  1419. v-model="element.price"
  1420. @on-change="handleTotalPriceCalc(element, item)"
  1421. style="width: 100px"
  1422. placeholder="请输入单价"
  1423. />
  1424. </FormItem>
  1425. <FormItem label="金额:">
  1426. <Input
  1427. size="small"
  1428. @on-change="handleTotalPriceChange(element, item)"
  1429. v-model="element.total_price"
  1430. style="width: 100px"
  1431. placeholder="请输入金额"
  1432. />
  1433. </FormItem>
  1434. <FormItem label="备注:">
  1435. <Input
  1436. size="small"
  1437. v-model="element.remark"
  1438. style="width: 100px"
  1439. placeholder="请输入备注"
  1440. />
  1441. </FormItem>
  1442. <FormItem>
  1443. <a
  1444. style="color: red"
  1445. @click="
  1446. handleExtraDele(item.extArray, element, idx, item)
  1447. "
  1448. >删除</a
  1449. >
  1450. </FormItem>
  1451. </Form>
  1452. </div>
  1453. </div>
  1454. </TabPane>
  1455. </Tabs>
  1456. </div>
  1457. <div slot="footer">
  1458. <Button @click="cancelModal">取消</Button>
  1459. <Button @click="handleAddProductSubmit" type="primary">确定</Button>
  1460. </div>
  1461. </Modal>
  1462. <!-- 选择产品弹层--编辑框 -->
  1463. <Modal
  1464. :width="1400"
  1465. class-name="vertical-center-modal"
  1466. :title="title_state == 2 ? '编辑产品' : '查看产品'"
  1467. :mask-closable="false"
  1468. v-model="showEditProduct"
  1469. @on-visible-change="modalVisibleChange"
  1470. >
  1471. <div style="max-height: 800px; overflow: hidden; overflow-y: auto">
  1472. <Tabs value="name">
  1473. <TabPane
  1474. :label="
  1475. (modalData.position ? modalData.position : '位置') +
  1476. '-' +
  1477. modalData.type_name
  1478. "
  1479. name="name"
  1480. >
  1481. <div class="modal_product_info">
  1482. <div class="modal_product_info_title">产品信息</div>
  1483. <div class="modal_product_info_content modal_product">
  1484. <Form :model="modalData" :label-width="100">
  1485. <FormItem label="选择产品:">
  1486. <Tooltip style="width: 120px" transfer>
  1487. <span slot="content">
  1488. <span
  1489. v-for="_item in productList"
  1490. :key="_item.id"
  1491. v-show="_item.id == modalData.product_id"
  1492. >{{ _item.title }}</span
  1493. >
  1494. </span>
  1495. <Select
  1496. filterable
  1497. clearable
  1498. transfer
  1499. filter-by-label
  1500. label-in-value
  1501. :disabled="isCheck"
  1502. size="small"
  1503. v-model="modalData.product_id"
  1504. @on-change="changeEditProduct($event)"
  1505. style="width: 120px"
  1506. >
  1507. <Option
  1508. v-for="item of productList"
  1509. :tag="item.img_url"
  1510. :key="item.id"
  1511. :label="item.title"
  1512. :value="item.id"
  1513. ></Option>
  1514. </Select>
  1515. </Tooltip>
  1516. </FormItem>
  1517. <FormItem label="位置:">
  1518. <Tooltip style="width: 120px" transfer>
  1519. <span slot="content">
  1520. {{ modalData.position }}
  1521. </span>
  1522. <Input
  1523. size="small"
  1524. v-model="modalData.position"
  1525. :disabled="isCheck"
  1526. @on-change="
  1527. (e) => handleProductPositionChange(modalData, e)
  1528. "
  1529. style="width: 120px"
  1530. placeholder="请输入位置"
  1531. />
  1532. </Tooltip>
  1533. </FormItem>
  1534. <FormItem label="计量单位:">
  1535. <Input
  1536. size="small"
  1537. disabled
  1538. style="width: 120px"
  1539. v-model="modalData.unit"
  1540. placeholder="自动带出"
  1541. />
  1542. </FormItem>
  1543. <!-- 工艺属性 -->
  1544. <FormItem
  1545. v-for="(ele, idx) in modalData.process"
  1546. :key="idx + '333' + modalData.id"
  1547. :label="ele.title + ':'"
  1548. >
  1549. <Tooltip style="width: 120px" transfer>
  1550. <span slot="content">
  1551. <span
  1552. v-for="_item in ele.processList"
  1553. :key="_item.id"
  1554. v-show="_item.id == ele.value"
  1555. >{{ _item.title }}</span
  1556. >
  1557. </span>
  1558. <Select
  1559. style="width: 120px"
  1560. filterable
  1561. clearable
  1562. transfer
  1563. label-in-value
  1564. :disabled="isCheck"
  1565. @on-open-change="
  1566. (e) => handleGetProductMeasure(e, idx, modalData, ele)
  1567. "
  1568. @on-change="
  1569. (e) =>
  1570. handleProductProcessChange(e, idx, modalData, ele)
  1571. "
  1572. v-model="ele.value"
  1573. size="small"
  1574. >
  1575. <Option
  1576. v-for="option of ele.processList"
  1577. :key="option.id"
  1578. :disabled="option.isDisabled"
  1579. :label="option.title"
  1580. :value="option.id"
  1581. ></Option>
  1582. </Select>
  1583. </Tooltip>
  1584. </FormItem>
  1585. <!-- 测量字段 -->
  1586. <FormItem
  1587. v-for="ele in modalData.measure"
  1588. :key="ele.id"
  1589. :label="ele.title + ':'"
  1590. >
  1591. <Input
  1592. size="small"
  1593. type="text"
  1594. clearable
  1595. :disabled="isCheck"
  1596. :placeholder="ele.e_title"
  1597. v-model="ele.value"
  1598. @on-change="
  1599. (e) => handleProductMeasureChange(e, modalData, ele)
  1600. "
  1601. @on-blur="
  1602. (e) => handleProductMeasureBlur(e, modalData, ele)
  1603. "
  1604. style="width: 120px"
  1605. />
  1606. </FormItem>
  1607. <FormItem label="数量:">
  1608. <Input
  1609. size="small"
  1610. @on-change="(e) => handleProductNumChange(e, modalData)"
  1611. v-model="modalData.total_num"
  1612. :disabled="isCheck"
  1613. style="width: 120px"
  1614. placeholder="请输入产品数量"
  1615. />
  1616. </FormItem>
  1617. <FormItem label="核算数量:">
  1618. <Input
  1619. size="small"
  1620. v-model="modalData.num"
  1621. disabled
  1622. style="width: 120px"
  1623. placeholder="自动带出"
  1624. />
  1625. </FormItem>
  1626. <FormItem label="单价:">
  1627. <Input
  1628. size="small"
  1629. :disabled="isCheck"
  1630. v-model="modalData.unit_price"
  1631. @on-change="
  1632. (e) => handleProductUnit_priceChange(e, modalData)
  1633. "
  1634. style="width: 120px"
  1635. placeholder="自动带出"
  1636. />
  1637. </FormItem>
  1638. <FormItem label="附加金额:">
  1639. <Input
  1640. size="small"
  1641. :disabled="isCheck"
  1642. v-model="modalData.ext_price"
  1643. @on-change="
  1644. (e) => handleProductExt_priceChange(e, modalData)
  1645. "
  1646. style="width: 120px"
  1647. placeholder="自动带出"
  1648. />
  1649. </FormItem>
  1650. <FormItem label="超标金额:">
  1651. <Input
  1652. :disabled="isCheck"
  1653. size="small"
  1654. @on-change="
  1655. (e) => handleProductOver_priceChange(e, modalData)
  1656. "
  1657. v-model="modalData.over_price"
  1658. style="width: 120px"
  1659. placeholder="自动带出"
  1660. />
  1661. </FormItem>
  1662. <FormItem label="金额:">
  1663. <Input
  1664. :disabled="isCheck"
  1665. size="small"
  1666. v-model="modalData.price"
  1667. style="width: 120px"
  1668. placeholder="自动带出"
  1669. />
  1670. </FormItem>
  1671. <FormItem label="图号:">
  1672. <Input
  1673. size="small"
  1674. :disabled="isCheck"
  1675. v-model="modalData.url_number"
  1676. style="width: 120px"
  1677. placeholder="自动带出"
  1678. />
  1679. </FormItem>
  1680. <FormItem
  1681. v-for="(_customize, customize_key) in modalData.customize"
  1682. :label="_customize.style + ':'"
  1683. :key="customize_key + 99"
  1684. >
  1685. <Input
  1686. v-show="_customize.type == 1"
  1687. :disabled="isCheck"
  1688. size="small"
  1689. type="text"
  1690. v-model="_customize.value"
  1691. style="width: 120px"
  1692. placeholder="请输入"
  1693. />
  1694. <Select
  1695. v-show="_customize.type == 2"
  1696. style="width: 120px"
  1697. :disabled="isCheck"
  1698. filterable
  1699. clearable
  1700. v-model="_customize.value"
  1701. size="small"
  1702. >
  1703. <Option
  1704. v-for="option of _customize.explain"
  1705. :key="option.value"
  1706. :label="option.value"
  1707. :value="option.value"
  1708. ></Option>
  1709. </Select>
  1710. </FormItem>
  1711. <FormItem
  1712. v-for="(outh, outh_key) in modalData.outh"
  1713. :label="outh.title"
  1714. :key="outh_key + 21"
  1715. >
  1716. <img
  1717. v-if="outh.key == 'img' || outh.key == 'url'"
  1718. @click="showPreview(modalData, outh.key)"
  1719. style="
  1720. max-width: 30px;
  1721. max-height: 30px;
  1722. top: 5px;
  1723. position: relative;
  1724. cursor: pointer;
  1725. "
  1726. :src="$store.state.ip + outh.value"
  1727. />
  1728. <Input
  1729. v-if="
  1730. outh.key != 'img' &&
  1731. outh.key != 'url' &&
  1732. outh.key != 'lock'
  1733. "
  1734. disabled
  1735. placeholder="自动生成"
  1736. style="width: 120px"
  1737. size="small"
  1738. v-model="outh.value"
  1739. />
  1740. <Select
  1741. label-in-value
  1742. @on-change="changeLock($event, modalData, index)"
  1743. size="small"
  1744. clearable
  1745. style="width: 120px"
  1746. v-if="outh.key == 'lock'"
  1747. v-model="modalData[outh.key]"
  1748. >
  1749. <Option
  1750. v-for="luck of lock_list"
  1751. :key="luck.id"
  1752. :tag="luck.price"
  1753. :value="luck.id"
  1754. :label="luck.title"
  1755. ></Option>
  1756. <Option :value="0" label="无"></Option>
  1757. </Select>
  1758. </FormItem>
  1759. <FormItem label="备注:">
  1760. <Select
  1761. size="small"
  1762. clearable
  1763. filterable
  1764. :disabled="isCheck"
  1765. style="width: 120px"
  1766. allow-create
  1767. @on-create="handleRemarkCreate"
  1768. v-model="modalData.remark"
  1769. >
  1770. <Option
  1771. v-for="_remark of support_remark"
  1772. :key="_remark"
  1773. :value="_remark"
  1774. :label="_remark"
  1775. ></Option>
  1776. </Select>
  1777. <!-- <Input
  1778. size="small"
  1779. type="textarea"
  1780. :disabled="isCheck"
  1781. v-model="modalData.remark"
  1782. style="width: 120px"
  1783. placeholder="请输入备注"
  1784. /> -->
  1785. </FormItem>
  1786. <FormItem label="产品图:">
  1787. <!-- v-show="modalData.url && modalData.url.length > 0" -->
  1788. <div class="product-img">
  1789. <div class="product-add">
  1790. <div
  1791. class="items"
  1792. v-for="(item, index) of modalData.url"
  1793. :key="index"
  1794. >
  1795. <img
  1796. @click="looks(item)"
  1797. :src="$store.state.ip + item"
  1798. alt=""
  1799. />
  1800. </div>
  1801. </div>
  1802. </div>
  1803. </FormItem>
  1804. </Form>
  1805. </div>
  1806. </div>
  1807. <div class="modal_product_info">
  1808. <div class="modal_product_info_title">部件信息</div>
  1809. <div class="modal_product_info_content modal_parts">
  1810. <Form
  1811. :model="element"
  1812. v-for="(element, idx) in modalData.part"
  1813. :key="element.id + '444' + idx"
  1814. :label-width="50"
  1815. >
  1816. <FormItem
  1817. :label-width="element.isBP ? 1 : 50"
  1818. v-show="!element.is_metal"
  1819. >
  1820. <Radio
  1821. v-show="element.isBP"
  1822. :disabled="isCheck"
  1823. @click.native.prevent="handleRadioClick(element)"
  1824. v-model="element.isChoosed"
  1825. ></Radio>
  1826. <!-- <span v-show="element.isBP">{{ element.part_title }} </span> -->
  1827. </FormItem>
  1828. <FormItem
  1829. label="部件:"
  1830. v-show="element.is_metal ? false : true"
  1831. >
  1832. <Select
  1833. filterable
  1834. clearable
  1835. transfer
  1836. :disabled="isCheck"
  1837. label-in-value
  1838. size="small"
  1839. @on-change="
  1840. handlePartChange(
  1841. $event,
  1842. element,
  1843. modalData.measure,
  1844. modalData.total_num
  1845. )
  1846. "
  1847. v-model="element.change_id"
  1848. style="width: 180px"
  1849. >
  1850. <Option
  1851. v-for="item of element.change"
  1852. :key="item.id"
  1853. :label="item.part_title"
  1854. :value="item.id"
  1855. ></Option>
  1856. </Select>
  1857. </FormItem>
  1858. <FormItem
  1859. label="高:"
  1860. v-show="
  1861. !element.is_metal &&
  1862. element.hide_measure &&
  1863. !element.hide_measure.filter((v) => v == 'H').length > 0
  1864. "
  1865. >
  1866. <Input
  1867. size="small"
  1868. clearable
  1869. :disabled="isCheck"
  1870. v-model="element.long"
  1871. style="width: 50px"
  1872. placeholder="请输入厚"
  1873. />
  1874. </FormItem>
  1875. <FormItem
  1876. label="宽:"
  1877. v-show="
  1878. !element.is_metal &&
  1879. element.hide_measure &&
  1880. !element.hide_measure.filter((v) => v == 'W').length > 0
  1881. "
  1882. >
  1883. <Input
  1884. size="small"
  1885. clearable
  1886. :disabled="isCheck"
  1887. v-model="element.wide"
  1888. style="width: 50px"
  1889. placeholder="请输入宽"
  1890. />
  1891. </FormItem>
  1892. <FormItem
  1893. label="厚:"
  1894. v-show="
  1895. !element.is_metal &&
  1896. element.hide_measure &&
  1897. !element.hide_measure.filter((v) => v == 'T').length > 0
  1898. "
  1899. >
  1900. <Input
  1901. size="small"
  1902. clearable
  1903. :disabled="isCheck"
  1904. v-model="element.high"
  1905. style="width: 50px"
  1906. placeholder="请输入高"
  1907. />
  1908. </FormItem>
  1909. <FormItem
  1910. v-for="(process_detail, idx) in element.process"
  1911. :key="idx + '555' + element.part_id"
  1912. :label="process_detail.name + ':'"
  1913. v-show="
  1914. !element.is_metal &&
  1915. element.hide_process &&
  1916. !element.hide_process.filter(
  1917. (v) => process_all_list[v] == process_detail.name
  1918. ).length > 0
  1919. "
  1920. >
  1921. <Tooltip style="width: 120px" transfer>
  1922. <span slot="content">
  1923. <span
  1924. v-for="_item in process_detail.cld"
  1925. :key="_item.id"
  1926. v-show="_item.id == process_detail.procedure_property"
  1927. >{{ _item.title }}</span
  1928. >
  1929. </span>
  1930. <Select
  1931. style="width: 120px"
  1932. filterable
  1933. clearable
  1934. transfer
  1935. label-in-value
  1936. :disabled="isCheck"
  1937. @on-change="
  1938. (e) => handlePartProcessChange(e, idx, element)
  1939. "
  1940. v-model="process_detail.procedure_property"
  1941. size="small"
  1942. >
  1943. <Option
  1944. v-for="option of process_detail.cld"
  1945. :key="option.id"
  1946. :label="option.title"
  1947. :value="option.id"
  1948. ></Option>
  1949. </Select>
  1950. </Tooltip>
  1951. </FormItem>
  1952. <FormItem v-show="!element.is_metal">
  1953. <Button
  1954. @click="handlePartsApart(element, idx, modalData.part)"
  1955. type="primary"
  1956. v-show="!isCheck"
  1957. v-if="element.isBP"
  1958. style="margin-right: 5px"
  1959. size="small"
  1960. >拆分</Button
  1961. >
  1962. <Button
  1963. @click="handlePartsDele(element, idx, modalData.part)"
  1964. type="primary"
  1965. v-else
  1966. v-show="!isCheck"
  1967. style="margin-right: 5px"
  1968. size="small"
  1969. >删除</Button
  1970. >
  1971. <Button
  1972. @click="handlePartDetailEdit(element, idx)"
  1973. type="primary"
  1974. style="margin-right: 5px"
  1975. size="small"
  1976. >{{
  1977. element.isShowPartDetail
  1978. ? "收起"
  1979. : isCheck
  1980. ? "查看"
  1981. : "修改原材料"
  1982. }}</Button
  1983. >
  1984. </FormItem>
  1985. <div
  1986. :class="[
  1987. 'part_detail_form',
  1988. element.isShowPartDetail ? '' : 'hide_part_detail',
  1989. ]"
  1990. :data-index="idx"
  1991. >
  1992. <FormItem>
  1993. <div v-for="ele in element.part_detail" :key="ele.id">
  1994. <Form :model="ele">
  1995. <FormItem>
  1996. <div style="width: 200px">
  1997. <!-- <Tooltip
  1998. :content="
  1999. ele.title || ele.part_detail_title || '请选择'
  2000. "
  2001. > -->
  2002. {{ ele.title || ele.part_detail_title }}
  2003. <!-- </Tooltip> -->
  2004. </div>
  2005. </FormItem>
  2006. <!-- <FormItem label="厚" :label-width="40">
  2007. <Input
  2008. size="small"
  2009. v-model="ele.long"
  2010. style="width: 80px"
  2011. placeholder="请输入厚"
  2012. />
  2013. </FormItem> -->
  2014. <!-- <FormItem label="宽" :label-width="40">
  2015. <Input
  2016. size="small"
  2017. v-model="ele.wide"
  2018. style="width: 80px"
  2019. placeholder="请输入宽"
  2020. />
  2021. </FormItem> -->
  2022. <!-- <FormItem label="高" :label-width="40">
  2023. <Input
  2024. size="small"
  2025. v-model="ele.high"
  2026. style="width: 80px"
  2027. placeholder="请输入高"
  2028. />
  2029. </FormItem> -->
  2030. <!-- <FormItem label="数量" :label-width="40">
  2031. <Input
  2032. size="small"
  2033. v-model="ele.num"
  2034. @on-change="(e) => handleSubpartNumChange(e, ele)"
  2035. style="width: 80px"
  2036. placeholder="请输入数量"
  2037. />
  2038. </FormItem> -->
  2039. <!-- 原材料 -->
  2040. <Form>
  2041. <FormItem>
  2042. <div style="width: 200px">
  2043. <!-- <Tooltip
  2044. :content="
  2045. ele.material_detail_title || '请选择'
  2046. "
  2047. > -->
  2048. {{ ele.material_detail_title || "请选择" }}
  2049. <!-- </Tooltip> -->
  2050. </div>
  2051. </FormItem>
  2052. <FormItem label="高" :label-width="40">
  2053. <Select
  2054. style="width: 80px"
  2055. filterable
  2056. clearable
  2057. transfer
  2058. :disabled="isCheck"
  2059. v-model="ele.material_detail_id"
  2060. @on-change="(e) => handleMaterialChange(e, ele)"
  2061. placeholder="请选择高"
  2062. size="small"
  2063. >
  2064. <Option
  2065. v-for="option of ele.material_detail_list"
  2066. :key="option.material_detail_id"
  2067. :label="option.long"
  2068. :value="option.material_detail_id"
  2069. ></Option>
  2070. </Select>
  2071. </FormItem>
  2072. <FormItem label="宽" :label-width="40">
  2073. <Select
  2074. style="width: 80px"
  2075. filterable
  2076. clearable
  2077. transfer
  2078. :disabled="isCheck"
  2079. v-model="ele.material_detail_id"
  2080. placeholder="请选择宽"
  2081. size="small"
  2082. >
  2083. <Option
  2084. v-for="option of ele.material_detail_list"
  2085. :key="option.material_detail_id"
  2086. :label="option.wide"
  2087. :value="option.material_detail_id"
  2088. ></Option>
  2089. </Select>
  2090. </FormItem>
  2091. <FormItem label="厚" :label-width="40">
  2092. <Select
  2093. style="width: 80px"
  2094. filterable
  2095. clearable
  2096. transfer
  2097. :disabled="isCheck"
  2098. v-model="ele.material_detail_id"
  2099. placeholder="请选择厚"
  2100. size="small"
  2101. >
  2102. <Option
  2103. v-for="option of ele.material_detail_list"
  2104. :key="option.material_detail_id"
  2105. :label="option.high"
  2106. :value="option.material_detail_id"
  2107. ></Option>
  2108. </Select>
  2109. </FormItem>
  2110. <FormItem label="数量" :label-width="40">
  2111. <Input
  2112. size="small"
  2113. :disabled="isCheck"
  2114. v-model="ele.material_detail_num"
  2115. style="width: 80px"
  2116. placeholder="请输入数量"
  2117. />
  2118. </FormItem>
  2119. </Form>
  2120. </Form>
  2121. </div>
  2122. </FormItem>
  2123. </div>
  2124. </Form>
  2125. </div>
  2126. </div>
  2127. <div class="modal_product_info">
  2128. <div class="modal_product_info_title">
  2129. 附加信息
  2130. <Button
  2131. @click="handleExtraAdd(modalData.metalArray, 1)"
  2132. type="primary"
  2133. style="margin-right: 5px"
  2134. v-show="!isCheck"
  2135. size="small"
  2136. >新增五金</Button
  2137. >
  2138. <Button
  2139. @click="handleExtraAdd(modalData.extArray, 2)"
  2140. type="primary"
  2141. v-show="!isCheck"
  2142. size="small"
  2143. >新增附加项目</Button
  2144. >
  2145. </div>
  2146. <div class="modal_product_info_content modal_extra">
  2147. <Form
  2148. :model="element"
  2149. v-for="(element, idx) in modalData.metalArray"
  2150. :key="element.id"
  2151. :label-width="80"
  2152. >
  2153. <FormItem label="五金:">
  2154. <Select
  2155. filterable
  2156. clearable
  2157. transfer
  2158. label-in-value
  2159. size="small"
  2160. :disabled="isCheck"
  2161. @on-change="
  2162. (e) =>
  2163. handleMetalChange(
  2164. e,
  2165. element,
  2166. idx,
  2167. modalData.metalArray
  2168. )
  2169. "
  2170. v-model="element.material_id"
  2171. style="width: 100px"
  2172. >
  2173. <Option
  2174. v-for="item of metalList"
  2175. :key="item.id"
  2176. :label="item.title"
  2177. :value="item.id"
  2178. ></Option>
  2179. </Select>
  2180. </FormItem>
  2181. <FormItem label="数量:">
  2182. <Input
  2183. size="small"
  2184. :disabled="isCheck"
  2185. v-model="element.num"
  2186. @on-change="handleTotalPriceCalc(element, modalData)"
  2187. style="width: 100px"
  2188. placeholder="请输入数量"
  2189. />
  2190. </FormItem>
  2191. <FormItem label="单价:">
  2192. <Input
  2193. size="small"
  2194. :disabled="isCheck"
  2195. v-model="element.price"
  2196. @on-change="handleTotalPriceCalc(element, modalData)"
  2197. style="width: 100px"
  2198. placeholder="请输入单价"
  2199. />
  2200. </FormItem>
  2201. <FormItem label="金额:">
  2202. <Input
  2203. size="small"
  2204. :disabled="isCheck"
  2205. v-model="element.total_price"
  2206. @on-change="handleTotalPriceChange(element, modalData)"
  2207. style="width: 100px"
  2208. placeholder="请输入金额"
  2209. />
  2210. </FormItem>
  2211. <FormItem label="备注:">
  2212. <Input
  2213. size="small"
  2214. :disabled="isCheck"
  2215. v-model="element.remark"
  2216. style="width: 100px"
  2217. placeholder="请输入备注"
  2218. />
  2219. </FormItem>
  2220. <FormItem>
  2221. <a
  2222. style="color: red"
  2223. v-show="!isCheck"
  2224. @click="
  2225. handleExtraDele(
  2226. modalData.metalArray,
  2227. element,
  2228. idx,
  2229. modalData
  2230. )
  2231. "
  2232. >删除</a
  2233. >
  2234. </FormItem>
  2235. </Form>
  2236. <Form
  2237. :model="element"
  2238. v-for="(element, idx) in modalData.extArray"
  2239. :key="element.id"
  2240. :label-width="80"
  2241. >
  2242. <FormItem label="附加项目:">
  2243. <Select
  2244. filterable
  2245. clearable
  2246. transfer
  2247. label-in-value
  2248. :disabled="isCheck"
  2249. size="small"
  2250. v-model="element.id"
  2251. @on-change="(e) => handleExtChange(element, e, modalData)"
  2252. style="width: 100px"
  2253. >
  2254. <Option
  2255. v-for="item of extList"
  2256. :key="item.id"
  2257. :label="item.title"
  2258. :value="item.id"
  2259. ></Option>
  2260. </Select>
  2261. </FormItem>
  2262. <FormItem label="数量:">
  2263. <Input
  2264. size="small"
  2265. :disabled="isCheck"
  2266. v-model="element.num"
  2267. @on-change="handleTotalPriceCalc(element, modalData)"
  2268. style="width: 100px"
  2269. placeholder="请输入数量"
  2270. />
  2271. </FormItem>
  2272. <FormItem label="单价:">
  2273. <Input
  2274. size="small"
  2275. :disabled="isCheck"
  2276. v-model="element.price"
  2277. @on-change="handleTotalPriceCalc(element, modalData)"
  2278. style="width: 100px"
  2279. placeholder="请输入单价"
  2280. />
  2281. </FormItem>
  2282. <FormItem label="金额:">
  2283. <Input
  2284. size="small"
  2285. :disabled="isCheck"
  2286. v-model="element.total_price"
  2287. @on-change="handleTotalPriceChange(element, modalData)"
  2288. style="width: 100px"
  2289. placeholder="请输入金额"
  2290. />
  2291. </FormItem>
  2292. <FormItem label="备注:">
  2293. <Input
  2294. size="small"
  2295. :disabled="isCheck"
  2296. v-model="element.remark"
  2297. style="width: 100px"
  2298. placeholder="请输入备注"
  2299. />
  2300. </FormItem>
  2301. <FormItem>
  2302. <a
  2303. v-show="!isCheck"
  2304. style="color: red"
  2305. @click="
  2306. handleExtraDele(
  2307. modalData.extArray,
  2308. element,
  2309. idx,
  2310. modalData
  2311. )
  2312. "
  2313. >删除</a
  2314. >
  2315. </FormItem>
  2316. </Form>
  2317. </div>
  2318. </div>
  2319. </TabPane>
  2320. </Tabs>
  2321. </div>
  2322. <div slot="footer">
  2323. <Button @click="cancelModal">取消</Button>
  2324. <Button
  2325. @click="handleEditProductSubmit"
  2326. v-show="!isCheck"
  2327. type="primary"
  2328. >确定</Button
  2329. >
  2330. </div>
  2331. </Modal>
  2332. <Modal
  2333. v-model="showForms"
  2334. @on-ok="postForms(1)"
  2335. class-name="vertical-center-modal"
  2336. style="max-height: 700px; overflow: hidden; overflow-y: auto"
  2337. title="表单设置"
  2338. >
  2339. <Table
  2340. :max-height="600"
  2341. border
  2342. :columns="formSetTableColumns"
  2343. :data="post_formSetTableData"
  2344. >
  2345. </Table>
  2346. </Modal>
  2347. </div>
  2348. </template>
  2349. <script>
  2350. export default {
  2351. beforeRouteLeave(to, from, next) {
  2352. if (this.type == 1 || this.type == 2) {
  2353. if (to.path != "/cms/ordermannage/businessorderlist/list") {
  2354. this.$Modal.confirm({
  2355. title: "提示",
  2356. content: "切换页面会导致数据丢失,是否确认切换?",
  2357. onOk: () => {
  2358. next(() => {});
  2359. },
  2360. onCancel: () => {},
  2361. });
  2362. } else {
  2363. if (this.isAllowLeave) {
  2364. next(() => {});
  2365. } else {
  2366. this.$Modal.confirm({
  2367. title: "提示",
  2368. content: "切换页面会导致数据丢失,是否确认切换?",
  2369. onOk: () => {
  2370. next(() => {});
  2371. },
  2372. onCancel: () => {},
  2373. });
  2374. }
  2375. }
  2376. } else {
  2377. next(() => {});
  2378. }
  2379. },
  2380. data() {
  2381. const validateMobile = function(rule, value, fn) {
  2382. if (!/^1[3456789]\d{9}$/.test(value)) {
  2383. fn(new Error(" "));
  2384. return false;
  2385. }
  2386. fn();
  2387. };
  2388. return {
  2389. formObjs: {
  2390. order_no: 1,
  2391. residential_name: 1,
  2392. client_name: 1,
  2393. warning_state: 1,
  2394. service_id: 1,
  2395. pay_state: 1,
  2396. address: 1,
  2397. mobile: 1,
  2398. start_time: 1,
  2399. end_time: 1,
  2400. predict_price: 1,
  2401. predict_working: 1,
  2402. predict_time: 1,
  2403. remark: 1,
  2404. },
  2405. formObjs_reset: {
  2406. order_no: 1,
  2407. residential_name: 1,
  2408. warning_state: 1,
  2409. front_money: 1,
  2410. start_time: 1,
  2411. client_name: 1,
  2412. custom_detail_name: 1,
  2413. custom_detail_mobile: 1,
  2414. custom_detail_id: 1,
  2415. service_id: 1,
  2416. end_time: 1,
  2417. predict_price: 1,
  2418. order_price: 1,
  2419. box_id: 1,
  2420. remark: 1,
  2421. pay_state: 1,
  2422. },
  2423. tree_btn_show: false,
  2424. showForms: false,
  2425. forms_list: [],
  2426. type: 1,
  2427. order_no: this.$route.query.order_no,
  2428. modalArray: [
  2429. { type_name: "产品1", num: 1, id: 0, metalArray: [], extArray: [] },
  2430. ],
  2431. modalData: {},
  2432. productList: [],
  2433. metalList: [],
  2434. extList: [],
  2435. coumstList: [],
  2436. tableWidth: null,
  2437. users: [],
  2438. lock_list: [],
  2439. headers: { Authorization: localStorage.getItem("token") },
  2440. uploadData: {
  2441. order_no: this.$route.query.order_no,
  2442. title: "",
  2443. },
  2444. title_state: 0,
  2445. clientList: [],
  2446. clientDetailList: [],
  2447. clientDetailList_mobile: [],
  2448. clientDetailList_respon: [],
  2449. clientDetailList_address: [],
  2450. tableData: [],
  2451. showAddProduct: false,
  2452. showEditProduct: false,
  2453. infoRules: {
  2454. residential_name: [{ required: true, message: " ", trigger: "blur" }],
  2455. warning_state: [{ required: true, message: " " }],
  2456. pay_state: [{ required: true, message: "" }],
  2457. predict_price: [{ required: true, message: " " }],
  2458. fax_price: [{ required: true, message: " " }],
  2459. order_price: [{ required: true, message: " " }],
  2460. custom_id: [{ required: true, message: " " }],
  2461. start_time: [{ required: true, message: " " }],
  2462. end_time: [{ required: true, message: " " }],
  2463. box_id: [{ required: true, message: " " }],
  2464. remark: [{ required: true, message: " " }],
  2465. },
  2466. info: {
  2467. residential_name: "", //项目名称
  2468. order_no: "", //订单号
  2469. client_name: "", //客户名称
  2470. address: "", //
  2471. mobile: "", //手机号
  2472. start_time: new Date().toLocaleDateString().replace(/\//g, "-"), //开始时间
  2473. end_time: "", //结束时间
  2474. pay_state: "", //是否支付
  2475. warning_state: 1, //是否紧急
  2476. predict_time: "", //预估交付日期
  2477. service_id: null, //业务员
  2478. predict_price: null, //预估工价,
  2479. predict_working: null, //预估工期
  2480. remark: "",
  2481. img: [],
  2482. front_money: 0,
  2483. },
  2484. process_match_list: [],
  2485. process_all_list: [],
  2486. img: [],
  2487. sub_material_list: [],
  2488. showCurrencyOnly: false,
  2489. options: {
  2490. disabledDate(date) {
  2491. return date && date.valueOf() < Date.now() - 86400000;
  2492. },
  2493. },
  2494. editForm: {},
  2495. is_material_show: false,
  2496. currencyIndex: null,
  2497. currentTabIndex: "0",
  2498. parts_title_count: [],
  2499. wood_title_count: [],
  2500. isCheck: false,
  2501. warningList: [],
  2502. process_Select_match_list: [], //选中的list
  2503. originalTableColumns: [
  2504. { title: "原材料名称", align: "center", key: "title" },
  2505. { title: "原材料库存", align: "center", key: "stock" },
  2506. { title: "所需原材料数量", align: "center", key: "num" },
  2507. // { title: '原材料单价', align: 'center', key: 'price' },
  2508. {
  2509. title: "规格型号",
  2510. align: "center",
  2511. key: "specifications",
  2512. render: (h, params) => {
  2513. const { row } = params;
  2514. let text = "";
  2515. row.long ? (text += "L" + row.long + "*") : "";
  2516. row.wide ? (text += "W" + row.wide + "*") : "";
  2517. row.high ? (text += "H" + row.high + "*") : "";
  2518. text = text.substring(0, text.length - 1);
  2519. return h("span", {}, text);
  2520. },
  2521. },
  2522. { title: "原材料单位", align: "center", key: "unit" },
  2523. {
  2524. title: "原材料预估费用",
  2525. align: "center",
  2526. key: "total_price",
  2527. },
  2528. ],
  2529. originalData: [],
  2530. isAllowLeave: false,
  2531. pre_process_obj: {},
  2532. route_id_at_copy: "",
  2533. formSetTableColumns: [
  2534. {
  2535. title: "是否展示",
  2536. align: "center",
  2537. key: "is_show",
  2538. minWidth: 60,
  2539. render: (h, params) => {
  2540. const { index } = params;
  2541. const currentRow = JSON.parse(
  2542. JSON.stringify(this.post_formSetTableData[index])
  2543. );
  2544. return h("Checkbox", {
  2545. props: {
  2546. value: currentRow.is_show,
  2547. disabled:
  2548. currentRow.key == "order_no" ||
  2549. currentRow.key == "residential_name" ||
  2550. currentRow.key == "warning_state" ||
  2551. currentRow.key == "start_time" ||
  2552. currentRow.key == "end_time" ||
  2553. currentRow.key == "client_name" ||
  2554. currentRow.key == "predict_price" ||
  2555. currentRow.key == "box_id" ||
  2556. currentRow.key == "predict_price" ||
  2557. currentRow.key == "order_price" ||
  2558. currentRow.key == "fax_price" ||
  2559. currentRow.key == "remark",
  2560. },
  2561. on: {
  2562. "on-change": (e) => {
  2563. currentRow.is_show = e;
  2564. this.post_formSetTableData.splice(index, 1, currentRow);
  2565. },
  2566. },
  2567. });
  2568. },
  2569. },
  2570. {
  2571. title: "字段名",
  2572. align: "center",
  2573. key: "value",
  2574. minWidth: 100,
  2575. },
  2576. {
  2577. title: "展示名称",
  2578. align: "center",
  2579. key: "title",
  2580. minWidth: 100,
  2581. render: (h, params) => {
  2582. const { index } = params;
  2583. const currentRow = JSON.parse(
  2584. JSON.stringify(this.post_formSetTableData[index])
  2585. );
  2586. return h("Input", {
  2587. props: {
  2588. value: currentRow.title,
  2589. type: "text",
  2590. },
  2591. on: {
  2592. "on-change": (e) => {
  2593. currentRow.title = e.target.value;
  2594. this.post_formSetTableData.splice(index, 1, currentRow);
  2595. },
  2596. },
  2597. });
  2598. },
  2599. },
  2600. ],
  2601. formSetTableData: [
  2602. {
  2603. is_show: true,
  2604. key: "order_no",
  2605. value: "订单编号",
  2606. title: "订单编号",
  2607. },
  2608. {
  2609. is_show: true,
  2610. key: "residential_name",
  2611. value: "项目名称",
  2612. title: "项目名称",
  2613. },
  2614. {
  2615. is_show: true,
  2616. key: "warning_state",
  2617. value: "紧急程度",
  2618. title: "紧急程度",
  2619. },
  2620. {
  2621. is_show: true,
  2622. key: "front_money",
  2623. value: "项目定金",
  2624. title: "项目定金",
  2625. },
  2626. {
  2627. is_show: true,
  2628. key: "start_time",
  2629. value: "开始日期",
  2630. title: "开始日期",
  2631. },
  2632. {
  2633. is_show: true,
  2634. key: "client_name",
  2635. value: "客户名称",
  2636. title: "客户名称",
  2637. },
  2638. {
  2639. is_show: true,
  2640. key: "custom_detail_name",
  2641. value: "负责人",
  2642. title: "负责人",
  2643. },
  2644. {
  2645. is_show: true,
  2646. key: "custom_detail_mobile",
  2647. value: "手机号",
  2648. title: "手机号",
  2649. },
  2650. {
  2651. is_show: true,
  2652. key: "custom_detail_id",
  2653. value: "详细地址",
  2654. title: "详细地址",
  2655. },
  2656. {
  2657. is_show: true,
  2658. key: "service_id",
  2659. value: "专营业务员",
  2660. title: "专营业务员",
  2661. },
  2662. {
  2663. is_show: true,
  2664. key: "end_time",
  2665. value: "交付日期",
  2666. title: "交付日期",
  2667. },
  2668. {
  2669. is_show: true,
  2670. key: "predict_price",
  2671. value: "产品总价",
  2672. title: "产品总价",
  2673. },
  2674. {
  2675. is_show: true,
  2676. key: "order_price",
  2677. value: "订单金额",
  2678. title: "订单金额",
  2679. },
  2680. {
  2681. is_show: true,
  2682. key: "fax_price",
  2683. value: "折扣金额",
  2684. title: "折扣金额",
  2685. },
  2686. { is_show: true, key: "box_id", value: "包装", title: "包装" },
  2687. { is_show: true, key: "remark", value: "订单备注", title: "订单备注" },
  2688. ],
  2689. post_formSetTableData: [],
  2690. charge_list: [],
  2691. cus_list: [],
  2692. pre_bp_id: "",
  2693. support_remark: [],
  2694. };
  2695. },
  2696. computed: {
  2697. predict_price_clac() {
  2698. let sum = 0;
  2699. return sum;
  2700. },
  2701. },
  2702. watch: {},
  2703. created() {
  2704. // 获取负责人列表
  2705. this.axios.get("/api/support_service_name").then((res) => {
  2706. this.clientDetailList_respon = [];
  2707. res.data.map((item) => {
  2708. this.clientDetailList_respon.push({ service_name: item });
  2709. });
  2710. this.charge_list = JSON.parse(
  2711. JSON.stringify(this.clientDetailList_respon)
  2712. );
  2713. });
  2714. // 获取设置表单
  2715. this.get_forms();
  2716. // 获取紧急程度
  2717. this.axios.get("/api/warning_list").then((res) => {
  2718. (this.warningList = res.data.data),
  2719. (this.info.warning_state = this.warningList[0].id);
  2720. });
  2721. // 获取客户列表
  2722. this.axios.get("/api/custom_list").then((res) => {
  2723. this.cus_list = JSON.parse(JSON.stringify(res.data.data));
  2724. this.clientList = res.data.data;
  2725. });
  2726. // 获取五金列表
  2727. this.axios
  2728. .get("/api/material", { params: { sub_type_id: 5 } })
  2729. .then((res) => {
  2730. if (res.code == 200) {
  2731. this.metalList = res.data.data;
  2732. }
  2733. });
  2734. // 获取辅料列表
  2735. this.axios
  2736. .get("/api/material", { params: { sub_type_id: 4 } })
  2737. .then((res) => {
  2738. if (res.code == 200) {
  2739. this.sub_material_list = res.data.data;
  2740. }
  2741. });
  2742. // 获取附加列表
  2743. this.axios.get("/api/project_ext_list").then((res) => {
  2744. if (res.code == 200) {
  2745. this.extList = res.data.data;
  2746. }
  2747. });
  2748. let date1 = new Date();
  2749. let date2 = new Date();
  2750. date2.setDate(date1.getDate() + 30);
  2751. this.info.end_time = date2;
  2752. this.tableWidth = window.innerWidth - 300;
  2753. this.getUsers();
  2754. this.type = this.$route.query.type;
  2755. // this.axios("/api/order_get_forms").then((res) => {
  2756. // if (res.code == 200) {
  2757. // this.forms_list = res.data;
  2758. // this.postForms(0);
  2759. // }
  2760. // });
  2761. this.getCoumstList();
  2762. this.getLockList();
  2763. },
  2764. mounted() {
  2765. if (this.order_no) {
  2766. if (this.order_no) {
  2767. this.info = {};
  2768. }
  2769. this.initData(this.order_no);
  2770. }
  2771. this.getProducts();
  2772. addEventListener("resize", (e) => {
  2773. this.tableWidth = e.target.innerWidth - 300;
  2774. this.$forceUpdate();
  2775. });
  2776. },
  2777. methods: {
  2778. get_forms() {
  2779. this.axios
  2780. .post("/api/update/get_table", { id: "businessorderlist_detail" })
  2781. .then((res) => {
  2782. if (Array.isArray(res.data)) {
  2783. this.post_formSetTableData = JSON.parse(
  2784. JSON.stringify(this.formSetTableData)
  2785. );
  2786. } else {
  2787. if (res.data.table.formSet && res.data.table.formSet.length > 0) {
  2788. this.formSetTableData = JSON.parse(
  2789. JSON.stringify(res.data.table.formSet)
  2790. );
  2791. this.post_formSetTableData = JSON.parse(
  2792. JSON.stringify(res.data.table.formSet)
  2793. );
  2794. } else {
  2795. this.post_formSetTableData = JSON.parse(
  2796. JSON.stringify(this.formSetTableData)
  2797. );
  2798. }
  2799. }
  2800. });
  2801. },
  2802. back() {
  2803. // this.$router.go(-1);
  2804. this.$router.push({
  2805. path: "/cms/ordermannage/businessorderlist/list",
  2806. });
  2807. },
  2808. postForms(n) {
  2809. this.post_formSetTableData.forEach((element, index) => {
  2810. element.sort = index;
  2811. });
  2812. this.axios({
  2813. method: "post",
  2814. url: "/api/update/table",
  2815. data: {
  2816. id: "businessorderlist_detail",
  2817. result: {
  2818. formSet: this.post_formSetTableData,
  2819. },
  2820. },
  2821. }).then((res) => {
  2822. if (res.code == 200) {
  2823. this.$Message.success(res.msg);
  2824. // this.initData(this.order_no);
  2825. this.get_forms();
  2826. }
  2827. });
  2828. // let result = [];
  2829. // this.forms_list.map((rows) => {
  2830. // for (let i in this.formObjs_reset) {
  2831. // // if (i == rows) {
  2832. // result.push(i);
  2833. // // }
  2834. // }
  2835. // });
  2836. // const news_forms = {};
  2837. // this.post_formSetTableData = JSON.parse(JSON.stringify(this.formSetTableData))
  2838. // result.forEach((element) => {
  2839. // news_forms[element] = 1;
  2840. // });
  2841. // this.formObjs = news_forms;
  2842. // if (n) {
  2843. // this.axios
  2844. // .post("/api/order_set_form", {
  2845. // result: this.post_formSetTableData,
  2846. // all: Object.keys(this.formObjs_reset),
  2847. // })
  2848. // .then((res) => {
  2849. // if (res.code == 200) {
  2850. // this.$Message.success(res.msg);
  2851. // }
  2852. // });
  2853. // }
  2854. },
  2855. postData() {
  2856. let sendData = JSON.parse(JSON.stringify(this.info));
  2857. // sendData.custom_detail_id = sendData.custom_id
  2858. let sendList = JSON.parse(JSON.stringify(this.tableData));
  2859. sendList.map((item) => {
  2860. delete item.part;
  2861. });
  2862. this.tableData.map((item, index) => {
  2863. item.part.map((it, idx) => {
  2864. if (!it.is_metal) {
  2865. if (!sendList[index].part) {
  2866. sendList[index].part = [];
  2867. }
  2868. sendList[index].part.push(it);
  2869. }
  2870. });
  2871. });
  2872. // sendList= this.tableData.filter(item)
  2873. sendList.map((element) => {
  2874. element.part.map((elem) => {
  2875. if (!elem.is_metal) {
  2876. // elem.part_detail = elem.sub_part;
  2877. if (!elem.part_detail) {
  2878. elem.part_detail = elem.sub_part;
  2879. }
  2880. elem.part_detail.map((el) => {
  2881. el.material_num = el.material_detail_num;
  2882. });
  2883. }
  2884. });
  2885. });
  2886. try {
  2887. sendData.start_time = new Date(sendData.start_time)
  2888. .toLocaleDateString()
  2889. .replace(/\//g, "-");
  2890. sendData.end_time = new Date(sendData.end_time)
  2891. .toLocaleDateString()
  2892. .replace(/\//g, "-");
  2893. } catch (e) {
  2894. console.log(e);
  2895. }
  2896. let params = { ...sendData, product: sendList, renovation_type: 2 };
  2897. this.axios.post("/api/order_save_new", params).then((res) => {
  2898. if (res.code == 200) {
  2899. this.$Message.success(res.msg);
  2900. this.isAllowLeave = true;
  2901. this.back();
  2902. }
  2903. });
  2904. },
  2905. handleProductCopy() {
  2906. let idx = this.$refs.tabsRef.activeKey;
  2907. let obj = JSON.parse(JSON.stringify(this.modalArray[idx]));
  2908. obj.index = JSON.parse(JSON.stringify(this.modalArray.length));
  2909. this.pre_bp_id = this.modalArray[idx].bp_id;
  2910. this.modalArray.push(obj);
  2911. },
  2912. handleProductDele() {
  2913. let idx = this.$refs.tabsRef.activeKey;
  2914. this.modalArray.splice(idx, 1);
  2915. },
  2916. handleTabsAdd() {
  2917. let index = JSON.parse(JSON.stringify(this.modalArray.length));
  2918. this.modalArray.push({
  2919. type_name: "产品" + (this.modalArray.length + 1),
  2920. position: "",
  2921. index,
  2922. extArray: [{ type: 2 }],
  2923. metalArray: [{ type: 1 }],
  2924. });
  2925. },
  2926. handleShowMaterial() {
  2927. this.is_material_show = !this.is_material_show;
  2928. },
  2929. initData(order_no) {
  2930. this.axios("/api/order_detail_new", { params: { order_no } }).then(
  2931. (res) => {
  2932. //获取合计
  2933. // this.wood_title_count = res.data.materials;
  2934. // let total_line = 0;
  2935. // let total_line_unit;
  2936. // this.wood_title_count.forEach((element) => {
  2937. // element.measure_str = element.measure;
  2938. // for (const key in element.measure_str) {
  2939. // const elem = element.measure_str[key];
  2940. // total_line += elem.num;
  2941. // }
  2942. // total_line_unit = element.unit;
  2943. // });
  2944. // this.parts_title_count = res.data.parts;
  2945. // this.parts_title_count.push({
  2946. // title: "线 条",
  2947. // num: total_line,
  2948. // unit: total_line_unit,
  2949. // });
  2950. //获取产品
  2951. this.info = res.data;
  2952. this.info.img = this.info.imgs;
  2953. this.tableData = res.data.product_list;
  2954. this.tableData.forEach((element) => {
  2955. // 数据第一次通过接口获取
  2956. element.get_first_data = true;
  2957. //保存用数据
  2958. element.other = element.customize;
  2959. element.process_str = element.process;
  2960. // 部件尺寸不展示字母
  2961. element.measurement_no_letter = JSON.parse(
  2962. JSON.stringify(element.measurement)
  2963. );
  2964. element.measure.map((v) => {
  2965. element.measurement_no_letter = element.measurement_no_letter.replace(
  2966. new RegExp(v.e_title, "g"),
  2967. ""
  2968. );
  2969. });
  2970. element.part.forEach((elem) => {
  2971. if (!elem.is_metal) {
  2972. // 表格数据展示字段
  2973. elem.process_str = elem.process;
  2974. elem.measurement = elem.measure;
  2975. let measure_arr = elem.measure.split("*");
  2976. elem.long = measure_arr[0];
  2977. elem.wide = measure_arr[1];
  2978. elem.high = measure_arr[2];
  2979. }
  2980. });
  2981. // 拆分测量字段
  2982. // let product_measure = element.measurement.split('*')
  2983. element.measure.forEach((elem) => {
  2984. element[elem.e_title] = elem.value;
  2985. });
  2986. // 拼五金展示用
  2987. if (element.ext_list && element.ext_list.length > 0) {
  2988. element.ext_list.map((elem) => {
  2989. if (elem.type == 1) {
  2990. elem.total_num = elem.num;
  2991. elem.unit_price = elem.price;
  2992. elem.ext_price = elem.num * elem.price;
  2993. elem.is_metal = true;
  2994. element.part.push(elem);
  2995. } else {
  2996. if (!element.extra) {
  2997. element.extra = "";
  2998. }
  2999. element.extra += `${elem.title}/`;
  3000. }
  3001. });
  3002. if (element.extra) {
  3003. element.extra = element.extra.substring(
  3004. 0,
  3005. element.extra.length - 1
  3006. );
  3007. }
  3008. }
  3009. });
  3010. this.forms_list = res.tableSet || [];
  3011. // 查看详情时获取原材料信息
  3012. this.originalData = res.data.material_list;
  3013. this.originalData.forEach((element) => {
  3014. element.total_price = (element.num * element.price).toFixed(2);
  3015. });
  3016. this.handleCalcCount();
  3017. //获取客户信息
  3018. this.axios
  3019. .get("/api/custom_detail", { params: { id: res.data.custom_id } })
  3020. .then((re) => {
  3021. this.clientDetailList = re.data.list;
  3022. const _temp = this.clientDetailList.filter(
  3023. (item) => item.id == res.data.custom_detail_id
  3024. );
  3025. this.info.custom_detail_name = _temp[0].service_name;
  3026. this.info.custom_detail_mobile = _temp[0].mobile;
  3027. // 去重负责人
  3028. this.clientDetailList_respon = this.unique(re.data.list);
  3029. // 取负责人名字
  3030. // 取出手机号码是该负责人的
  3031. this.clientDetailList_mobile = this.unique(re.data.list);
  3032. this.clientDetailList_mobile = this.clientDetailList.filter(
  3033. (item) => item.service_name == this.info.custom_detail_name
  3034. );
  3035. // 去重手机号码
  3036. this.clientDetailList_mobile = this.unique(
  3037. this.clientDetailList_mobile
  3038. );
  3039. // 取出地址是该负责人的
  3040. this.clientDetailList_address = this.clientDetailList.filter(
  3041. (item) => item.service_name == this.info.custom_detail_name
  3042. );
  3043. this.fax = re.data.detail.fax;
  3044. // 修改价格
  3045. let sum = 0;
  3046. this.tableData.forEach((element) => {
  3047. sum += element.price * 1;
  3048. });
  3049. this.info.service_id = re.data.detail.service_id;
  3050. this.info.predict_price = sum.toFixed(2);
  3051. this.info.order_price = (
  3052. (this.info.predict_price * this.fax) /
  3053. 100
  3054. ).toFixed(2);
  3055. this.info.fax_price = (
  3056. this.info.predict_price - this.info.order_price
  3057. ).toFixed(2);
  3058. this.$forceUpdate();
  3059. });
  3060. }
  3061. );
  3062. },
  3063. addHours(row) {
  3064. row.push({
  3065. unit: null,
  3066. layer: null,
  3067. number: null,
  3068. product: [{ product_id: "" }],
  3069. });
  3070. },
  3071. getProducts() {
  3072. this.axios("/api/product").then(
  3073. (res) => (this.productList = res.data.data)
  3074. );
  3075. },
  3076. cancelModal() {
  3077. // this.modalArray = [{}]
  3078. this.showAddProduct = false;
  3079. this.showEditProduct = false;
  3080. },
  3081. handleSubmit(name) {
  3082. this.$refs[name].validate((valid) => {
  3083. if (valid) {
  3084. this.postData();
  3085. }
  3086. });
  3087. },
  3088. handleAddProductSubmit() {
  3089. this.$Modal.confirm({
  3090. content: "请确认线条名称是否正确!",
  3091. onOk: () => {
  3092. let flag = false;
  3093. this.modalArray.map((v) => {
  3094. v.part.map((w) => {
  3095. if (w.change_id == "") {
  3096. flag = true;
  3097. }
  3098. });
  3099. });
  3100. if (flag) {
  3101. return this.$Message.warning("部件信息请填写完整!");
  3102. }
  3103. this.modalArray.forEach((element) => {
  3104. // 工艺属性
  3105. if (!element.procedure_properties_str) {
  3106. element.procedure_properties_str = [];
  3107. }
  3108. if (!element.procedure_properties) {
  3109. element.procedure_properties = [];
  3110. }
  3111. element.process.forEach((elem, index) => {
  3112. const _temp = elem.processList.filter(
  3113. (item) => item.id == elem.value
  3114. );
  3115. element.procedure_properties_str[index] =
  3116. _temp.length > 0 ? _temp[0].title : "";
  3117. element.procedure_properties[index] =
  3118. _temp.length > 0 ? _temp[0].id : "";
  3119. });
  3120. element.process_str = element.procedure_properties_str.join("/");
  3121. // 尺寸
  3122. if (!element.measurement) {
  3123. element.measurement = "";
  3124. }
  3125. if (!element.measurement_no_letter) {
  3126. element.measurement_no_letter = "";
  3127. }
  3128. let tempStr = "";
  3129. let tempStr_no_letter = "";
  3130. element.measure.forEach((elem) => {
  3131. tempStr += elem.measureCalc + elem.value + "*";
  3132. tempStr_no_letter += +elem.value + "*";
  3133. });
  3134. element.measurement = tempStr.substring(0, tempStr.length - 1);
  3135. element.measurement_no_letter = tempStr_no_letter.substring(
  3136. 0,
  3137. tempStr_no_letter.length - 1
  3138. );
  3139. // 五金、 附加项目
  3140. element.ext = [...element.metalArray, ...element.extArray];
  3141. //其他项
  3142. element.other = element.customize;
  3143. // 部件字段
  3144. element.part.forEach((elem) => {
  3145. if (!elem.is_metal) {
  3146. elem.title ? "" : (elem.title = elem.part_title);
  3147. // if (elem.procedure_properties_str && elem.procedure_properties_str != 0) {
  3148. // elem.process_str = elem.procedure_properties_str.join('/')
  3149. // } else {
  3150. elem.procedure_properties_str = [];
  3151. elem.process.forEach((item, index) => {
  3152. const _temp = item.cld.filter(
  3153. (_cld) => _cld.id == item.procedure_property
  3154. );
  3155. elem.procedure_properties_str[index] =
  3156. _temp.length > 0 ? _temp[0].title : "";
  3157. });
  3158. elem.process_str = elem.procedure_properties_str.join("/");
  3159. // }
  3160. }
  3161. });
  3162. element.ext &&
  3163. element.ext.length > 0 &&
  3164. (element.ext.map((elem) => {
  3165. if (elem.type == 1) {
  3166. elem.total_num = elem.num;
  3167. elem.unit_price = elem.price;
  3168. elem.ext_price = elem.num * elem.price;
  3169. elem.is_metal = true;
  3170. element.part.push(elem);
  3171. if (!element.extra) {
  3172. element.extra = "";
  3173. }
  3174. } else {
  3175. if (!element.extra) {
  3176. element.extra = "";
  3177. }
  3178. element.extra += `${elem.title}/`;
  3179. }
  3180. }),
  3181. (element.extra = element.extra.substring(
  3182. 0,
  3183. element.extra.length - 1
  3184. )));
  3185. // element.part.push({
  3186. // title: "五金",
  3187. // total_num: "",
  3188. // unit_price: "",
  3189. // });
  3190. });
  3191. this.modalArray.forEach((element) => {
  3192. element.part.forEach((elem) => {
  3193. if (!elem.is_metal) {
  3194. elem.measurement = `${elem.long}*${elem.wide}*${elem.high}`;
  3195. elem.title = elem.part_title;
  3196. elem.procedure_properties = [];
  3197. elem.process.map((item) => {
  3198. elem.procedure_properties.push(item.procedure_property);
  3199. });
  3200. }
  3201. });
  3202. });
  3203. this.tableData = [...this.tableData, ...this.modalArray];
  3204. this.currencyIndex = null;
  3205. this.route_id_at_copy = "";
  3206. // 合计 、 线条 统计价格
  3207. this.handleCalcCount();
  3208. this.showAddProduct = false;
  3209. this.$forceUpdate();
  3210. },
  3211. onCancel: () => {},
  3212. });
  3213. },
  3214. handleEditProductSubmit() {
  3215. this.$Modal.confirm({
  3216. content: "请确认线条名称是否正确!",
  3217. onOk: () => {
  3218. const checkArr = this.modalData.part.filter((v) => {
  3219. return !v.change_id && !v.is_metal;
  3220. });
  3221. if (checkArr.length > 0) {
  3222. return this.$Message.warning("部件信息请填写完整!");
  3223. }
  3224. // 工艺属性
  3225. if (!this.modalData.procedure_properties_str) {
  3226. this.modalData.procedure_properties_str = [];
  3227. }
  3228. this.modalData.process.forEach((elem, index) => {
  3229. const _temp = elem.processList.filter(
  3230. (item) => item.id == elem.value
  3231. );
  3232. this.modalData.procedure_properties_str[index] =
  3233. _temp.length > 0 ? _temp[0].title : "";
  3234. });
  3235. this.modalData.process_str = this.modalData.procedure_properties_str.join(
  3236. "/"
  3237. );
  3238. // 尺寸
  3239. if (!this.modalData.measurement) {
  3240. this.modalData.measurement = "";
  3241. }
  3242. if (!this.modalData.measurement_no_letter) {
  3243. this.modalData.measurement_no_letter = "";
  3244. }
  3245. let tempStr = "";
  3246. let tempStr_no_letter = "";
  3247. this.modalData.measure.forEach((elem) => {
  3248. tempStr += elem.measureCalc + elem.value + "*";
  3249. tempStr_no_letter += elem.value + "*";
  3250. });
  3251. this.modalData.measurement = tempStr.substring(0, tempStr.length - 1);
  3252. this.modalData.measurement_no_letter = tempStr_no_letter.substring(
  3253. 0,
  3254. tempStr_no_letter.length - 1
  3255. );
  3256. // 五金、 附加项目
  3257. this.modalData.ext = [
  3258. ...this.modalData.metalArray,
  3259. ...this.modalData.extArray,
  3260. ];
  3261. //其他项
  3262. this.modalData.other = this.modalData.customize;
  3263. // 部件字段
  3264. this.modalData.part.forEach((elem, idx) => {
  3265. if (!elem.is_metal) {
  3266. elem.title ? "" : (elem.title = elem.part_title);
  3267. // if (elem.procedure_properties_str && elem.procedure_properties_str != 0) {
  3268. // elem.process_str = elem.procedure_properties_str.join('/')
  3269. // } else {
  3270. elem.procedure_properties_str = [];
  3271. if (elem.process) {
  3272. elem.process.forEach((item, index) => {
  3273. const _temp = item.cld.filter(
  3274. (_cld) => _cld.id == item.procedure_property
  3275. );
  3276. elem.procedure_properties_str[index] =
  3277. _temp.length > 0 ? _temp[0].title : "";
  3278. });
  3279. elem.process_str = elem.procedure_properties_str.join("/");
  3280. elem.procedure_properties = [];
  3281. elem.process.map((item) => {
  3282. elem.procedure_properties.push(item.procedure_property);
  3283. });
  3284. console.log(
  3285. "elem.procedure_properties :>> ",
  3286. elem.procedure_properties
  3287. );
  3288. }
  3289. // }
  3290. } else {
  3291. this.modalData.part.splice(idx, 1);
  3292. }
  3293. });
  3294. this.modalData.metalArray.map((item) => {
  3295. const obj = {
  3296. total_num: item.num,
  3297. title: item.title,
  3298. unit_price: item.price,
  3299. ext_price: item.num * item.price,
  3300. is_metal: true,
  3301. };
  3302. this.modalData.part.push(obj);
  3303. });
  3304. this.modalData.extra = "";
  3305. this.modalData.extArray.map((item) => {
  3306. const temp = this.extList.filter((it) => it.id == item.ext_id);
  3307. temp && temp.length > 0 && (item.title = temp[0].title);
  3308. });
  3309. this.modalData.extra = this.modalData.extArray.reduce((pre, cur) => {
  3310. return pre + `${cur.title}/`;
  3311. }, "");
  3312. this.modalData.extra = this.modalData.extra.substring(
  3313. 0,
  3314. this.modalData.extra.length - 1
  3315. );
  3316. const _temp = this.productList.filter(
  3317. (item) => item.id == this.modalData.product_id
  3318. );
  3319. this.modalData.title = _temp[0].title;
  3320. this.tableData.splice(this.currencyIndex, 1, this.modalData);
  3321. this.route_id_at_copy = "";
  3322. // 合计 、 线条 统计价格
  3323. this.handleCalcCount();
  3324. this.showEditProduct = false;
  3325. this.$forceUpdate();
  3326. },
  3327. onCancel: () => {},
  3328. });
  3329. },
  3330. // 合计 、 线条 统计价格
  3331. handleCalcCount() {
  3332. let sum = 0;
  3333. this.parts_title_count = [];
  3334. this.wood_title_count = [];
  3335. let total_line_unit = "";
  3336. this.tableData.forEach((element) => {
  3337. sum += element.price * 1;
  3338. element.part.forEach((elem) => {
  3339. if (!elem.is_metal) {
  3340. // 统计部件
  3341. const temp = this.parts_title_count.filter(
  3342. (item) => item.title == elem.title
  3343. );
  3344. if (temp && temp.length > 0) {
  3345. this.parts_title_count.map((v) => {
  3346. v.title == elem.title && v.num++;
  3347. });
  3348. } else {
  3349. this.parts_title_count.push({
  3350. title: elem.title,
  3351. num: elem.num || 1,
  3352. unit: elem.unit,
  3353. });
  3354. }
  3355. // 如果没有点开产品详情的话找不到 part_detail
  3356. if (!elem.part_detail) {
  3357. elem.part_detail = elem.sub_part;
  3358. }
  3359. // 部件中要统计所有线条数量
  3360. elem.part_detail &&
  3361. elem.part_detail.length > 0 &&
  3362. elem.part_detail.forEach((el) => {
  3363. if (el.material_detail_title.indexOf("线条") != -1) {
  3364. const temp = this.wood_title_count.filter(
  3365. (item) => item.title == el.material_detail_title
  3366. );
  3367. if (temp && temp.length > 0) {
  3368. // 匹配规格是否已存在
  3369. const _temp = temp[0].measure_str.filter(
  3370. (item) => item.id == el.material_detail_id
  3371. );
  3372. if (_temp && _temp.length > 0) {
  3373. this.wood_title_count.map((v) => {
  3374. v.title == el.material_detail_title &&
  3375. v.measure_str.map((item) => {
  3376. if (item.id == el.material_detail_id) {
  3377. item.num =
  3378. item.num * 1 + el.material_detail_num * 1;
  3379. }
  3380. });
  3381. });
  3382. } else {
  3383. // 不存在一样规格
  3384. if (
  3385. el.material_detail_list &&
  3386. el.material_detail_list.length > 0
  3387. ) {
  3388. const __temp = el.material_detail_list.filter(
  3389. (item) =>
  3390. item.material_detail_id == el.material_detail_id
  3391. );
  3392. this.wood_title_count.map((v) => {
  3393. v.title == el.material_detail_title &&
  3394. ((v.unit = __temp[0].unit),
  3395. v.measure_str.push({
  3396. num: el.material_detail_num,
  3397. id: __temp[0].material_detail_id,
  3398. measure: `${__temp[0].long || 0}*${__temp[0]
  3399. .wide || 0}*${__temp[0].high || 0}`,
  3400. }));
  3401. });
  3402. } else {
  3403. this.wood_title_count.map((v) => {
  3404. v.title == el.material_detail_title &&
  3405. ((v.unit = el.unit),
  3406. v.measure_str.push({
  3407. num: el.material_detail_num,
  3408. id: el.material_detail_id,
  3409. measure: `${el.long || 0}*${el.wide ||
  3410. 0}*${el.high || 0}`,
  3411. }));
  3412. });
  3413. }
  3414. }
  3415. } else {
  3416. // 不存在就新增
  3417. if (
  3418. el.material_detail_list &&
  3419. el.material_detail_list.length > 0
  3420. ) {
  3421. const _temp = el.material_detail_list.filter(
  3422. (item) =>
  3423. item.material_detail_id == el.material_detail_id
  3424. );
  3425. if (_temp && _temp.length > 0) {
  3426. if (!total_line_unit) {
  3427. total_line_unit = _temp[0].unit;
  3428. }
  3429. this.wood_title_count.push({
  3430. title: el.material_detail_title,
  3431. unit: total_line_unit,
  3432. measure_str: [
  3433. {
  3434. num: el.material_detail_num,
  3435. id: _temp[0].material_detail_id,
  3436. measure: `${_temp[0].long || 0}*${_temp[0].wide ||
  3437. 0}*${_temp[0].high || 0}`,
  3438. unit: _temp[0].unit,
  3439. },
  3440. ],
  3441. });
  3442. }
  3443. } else {
  3444. if (!total_line_unit) {
  3445. total_line_unit = el.unit;
  3446. }
  3447. this.wood_title_count.push({
  3448. title: el.material_detail_title,
  3449. unit: total_line_unit,
  3450. measure_str: [
  3451. {
  3452. num: el.material_detail_num,
  3453. id: el.material_detail_id,
  3454. measure: `${el.long || 0}*${el.wide ||
  3455. 0}*${el.high || 0}`,
  3456. unit: el.unit,
  3457. },
  3458. ],
  3459. });
  3460. }
  3461. }
  3462. }
  3463. });
  3464. }
  3465. });
  3466. });
  3467. // 数线条
  3468. let total_line = 0;
  3469. this.wood_title_count.map((v) => {
  3470. v.measure_str.map((w) => {
  3471. total_line += w.num;
  3472. });
  3473. });
  3474. // 线条合计放进统计
  3475. this.parts_title_count.push({
  3476. title: "线 条",
  3477. num: total_line,
  3478. unit: total_line_unit,
  3479. });
  3480. // 计算价格
  3481. this.info.predict_price = sum.toFixed(2);
  3482. this.info.order_price = (
  3483. (this.info.predict_price * this.fax) /
  3484. 100
  3485. ).toFixed(2);
  3486. this.info.fax_price = (
  3487. this.info.predict_price - this.info.order_price
  3488. ).toFixed(2);
  3489. },
  3490. getUsers() {
  3491. this.axios("/api/employee_list").then((res) => (this.users = res.data));
  3492. },
  3493. handleExtraAdd(array, type) {
  3494. array.push({
  3495. num: 0,
  3496. price: 0,
  3497. total_price: 0,
  3498. type,
  3499. remark: "",
  3500. title: "",
  3501. is_metal: true,
  3502. });
  3503. this.$forceUpdate();
  3504. },
  3505. handleExtraDele(array, row, index, modalData) {
  3506. array.splice(index, 1);
  3507. this.handleTotalPriceCalc(row, modalData);
  3508. this.$forceUpdate();
  3509. },
  3510. getCoumstList() {
  3511. this.axios("/api/bpp_list").then((res) => {
  3512. res.data.map((v) => {
  3513. if (v.select) {
  3514. v.cld.map((z) => {
  3515. v.select.map((k) => {
  3516. z.show = k == z.id ? true : false;
  3517. });
  3518. });
  3519. } else {
  3520. v.cld.map((v) => (v.show = false));
  3521. }
  3522. });
  3523. this.coumstList = res.data;
  3524. });
  3525. },
  3526. handleRemarkCreate(val) {
  3527. this.support_remark.push(val);
  3528. },
  3529. getLockList() {
  3530. this.axios("/api/lock_list").then((res) => (this.lock_list = res.data));
  3531. },
  3532. modalVisibleChange(e) {
  3533. if (!e) {
  3534. this.cancelModal();
  3535. }
  3536. },
  3537. unique(array) {
  3538. let arr = JSON.parse(JSON.stringify(array));
  3539. for (var i = 0; i < arr.length; i++) {
  3540. for (var j = i + 1; j < arr.length; j++) {
  3541. if (arr[i].service_name == arr[j].service_name) {
  3542. //第一个等同于第二个,splice方法删除第二个
  3543. arr.splice(j, 1);
  3544. j--;
  3545. }
  3546. }
  3547. }
  3548. return arr;
  3549. },
  3550. handleClientChange(id) {
  3551. if (id) {
  3552. this.axios({
  3553. method: "get",
  3554. url: "/api/custom_detail",
  3555. params: { id },
  3556. }).then((res) => {
  3557. this.info.custom_id = id;
  3558. this.clientDetailList = res.data.list;
  3559. // 去重负责人
  3560. this.clientDetailList_respon = this.unique(res.data.list);
  3561. // 赋值默认负责人
  3562. this.info.custom_detail_name = this.clientDetailList_respon[0].service_name;
  3563. // 取出手机号码是该负责人的
  3564. this.clientDetailList_mobile = this.clientDetailList.filter(
  3565. (item) => item.service_name == this.info.custom_detail_name
  3566. );
  3567. // 赋值默认手机号码
  3568. this.info.custom_detail_mobile = this.clientDetailList_mobile[0].mobile;
  3569. // 去重手机号码
  3570. this.clientDetailList_mobile = this.unique(
  3571. this.clientDetailList_mobile
  3572. );
  3573. // 取出地址是该负责人的
  3574. this.clientDetailList_address = this.clientDetailList.filter(
  3575. (item) => item.service_name == this.info.custom_detail_name
  3576. );
  3577. // 赋值默认地址
  3578. this.info.custom_detail_id = this.clientDetailList_respon[0].id || 0;
  3579. this.info.service_id = res.data.detail.service_id;
  3580. this.fax = res.data.detail.fax;
  3581. this.$forceUpdate();
  3582. });
  3583. } else {
  3584. this.clientDetailList_respon = JSON.parse(
  3585. JSON.stringify(this.charge_list)
  3586. );
  3587. this.clientList = JSON.parse(JSON.stringify(this.cus_list));
  3588. }
  3589. },
  3590. handleSpan({ row, column, rowIndex, columnIndex }) {
  3591. if (row.end) {
  3592. return [1, 6];
  3593. }
  3594. },
  3595. handleSummary({ columns, data }) {
  3596. const sums = {};
  3597. columns.forEach((column, index) => {
  3598. const key = column.key;
  3599. if (index === 0) {
  3600. sums[key] = {
  3601. key,
  3602. value: "合计",
  3603. };
  3604. return;
  3605. }
  3606. const values = data.map((item) => Number(item[key]));
  3607. if (!values.every((value) => isNaN(value))) {
  3608. const v = values.reduce((prev, curr) => {
  3609. const value = Number(curr);
  3610. if (!isNaN(value)) {
  3611. return prev + curr;
  3612. } else {
  3613. return prev;
  3614. }
  3615. }, 0);
  3616. sums[key] = {
  3617. key,
  3618. value: v,
  3619. };
  3620. } else {
  3621. sums[key] = {
  3622. key,
  3623. value: "",
  3624. };
  3625. }
  3626. });
  3627. return sums;
  3628. },
  3629. handleMetalChange(e, row, n, arr) {
  3630. arr[n].ext_id = e.value;
  3631. arr[n].title = e.label;
  3632. },
  3633. handleClientChargeChange(value) {
  3634. if (value) {
  3635. // if (this.info.custom_id) {
  3636. // this.info.custom_detail_name = value;
  3637. // // 取出手机号码是该负责人的
  3638. // this.clientDetailList_mobile = this.clientDetailList.filter(
  3639. // (item) => item.service_name == this.info.custom_detail_name
  3640. // );
  3641. // // 赋值默认手机号码
  3642. // this.info.custom_detail_mobile = this.clientDetailList_mobile[0].mobile;
  3643. // // 去重手机号码
  3644. // this.clientDetailList_mobile = this.unique(
  3645. // this.clientDetailList_mobile
  3646. // );
  3647. // // 取出地址是该负责人的
  3648. // this.clientDetailList_address = this.clientDetailList.filter(
  3649. // (item) => item.service_name == this.info.custom_detail_name
  3650. // );
  3651. // // 赋值默认地址
  3652. // this.info.custom_detail_id = this.clientDetailList_address[0].id || 0;
  3653. // } else {
  3654. this.axios
  3655. .get("/api/support_custom_for_service", {
  3656. params: { name: this.info.custom_detail_name },
  3657. })
  3658. .then((res) => {
  3659. this.clientList = res.data.data;
  3660. this.info.custom_id = res.data.data[0].id;
  3661. this.axios({
  3662. method: "get",
  3663. url: "/api/custom_detail",
  3664. params: { id: res.data.data[0].id },
  3665. }).then((re) => {
  3666. this.clientDetailList = re.data.list;
  3667. // 取出手机号码是该负责人的
  3668. this.clientDetailList_mobile = this.clientDetailList.filter(
  3669. (item) => item.service_name == value
  3670. );
  3671. // 赋值默认手机号码
  3672. this.info.custom_detail_mobile = this.clientDetailList_mobile[0].mobile;
  3673. // 去重手机号码
  3674. this.clientDetailList_mobile = this.unique(
  3675. this.clientDetailList_mobile
  3676. );
  3677. // 取出地址是该负责人的
  3678. this.clientDetailList_address = this.clientDetailList.filter(
  3679. (item) => item.service_name == value
  3680. );
  3681. // 赋值默认地址
  3682. this.info.custom_detail_id =
  3683. this.clientDetailList_address[0].id || 0;
  3684. this.info.service_id = re.data.detail.service_id;
  3685. this.fax = re.data.detail.fax;
  3686. });
  3687. });
  3688. // }
  3689. } else {
  3690. this.info.custom_detail_mobile = "";
  3691. this.info.custom_detail_id = "";
  3692. this.info.service_id = "";
  3693. this.clientDetailList_respon = JSON.parse(
  3694. JSON.stringify(this.charge_list)
  3695. );
  3696. this.clientList = JSON.parse(JSON.stringify(this.cus_list));
  3697. }
  3698. },
  3699. handleClientDetailChange(value) {
  3700. if (value) {
  3701. // this.clientDetailList_mobile = this.clientDetailList.filter(
  3702. // (item) => item.service_name == this.info.custom_detail_name
  3703. // );
  3704. this.info.custom_detail_id = value;
  3705. // this.info.address = row[0].address;
  3706. // this.info.address = row[0].address;
  3707. // this.info.mobile = row[0].mobile;
  3708. this.$forceUpdate();
  3709. }
  3710. },
  3711. getEditData(modalData, curData) {
  3712. // console.log("modalData :>> ", modalData);
  3713. // console.log("curData :>> ", curData);
  3714. modalData.ext_price = curData.ext_price * 1 || 0;
  3715. modalData.model = curData.model;
  3716. modalData.num = curData.num || 1;
  3717. modalData.num_temp_save = JSON.parse(JSON.stringify(modalData.num));
  3718. modalData.over_price = curData.over_price * 1 || 0;
  3719. modalData.position = curData.position;
  3720. modalData.price = curData.price;
  3721. modalData.product_id = curData.product_id;
  3722. modalData.remark = curData.remark;
  3723. modalData.route_id = curData.route_id;
  3724. modalData.total_num = curData.total_num;
  3725. modalData.unit = curData.unit;
  3726. modalData.unit_price = curData.unit_price * 1 || 0;
  3727. modalData.url_number = curData.url_number;
  3728. modalData.metalArray = [];
  3729. modalData.extArray = [];
  3730. // 金额=(产品单价)*核算数量+超标金额+附加金额
  3731. modalData.price =
  3732. (modalData.unit_price * 1 || 0) * (modalData.num * 1 || 1) +
  3733. (modalData.over_price * 1 || 0) +
  3734. (modalData.ext_price * 1 || 0);
  3735. modalData.price = modalData.price.toFixed(2);
  3736. // 获取产品 type_name
  3737. const temprow = this.productList.filter(
  3738. (item) => item.id == curData.product_id
  3739. );
  3740. modalData.type_name = temprow[0].title;
  3741. // 获取工艺属性
  3742. // 如果route_id是0,工艺属性值取procedure_properties
  3743. if (modalData.route_id == 0) {
  3744. modalData.process.map((v, k) => {
  3745. v.value = modalData.procedure_properties[k] * 1;
  3746. });
  3747. } else {
  3748. this.process_match_list.forEach((element) => {
  3749. if (element.id == curData.route_id) {
  3750. modalData.process_ids = element.detail;
  3751. }
  3752. });
  3753. modalData.process.forEach((element) => {
  3754. //赋值测量字段
  3755. for (const key in modalData.process_ids) {
  3756. const ele = modalData.process_ids[key];
  3757. if (element.key == key) {
  3758. element.value = ele * 1;
  3759. }
  3760. }
  3761. });
  3762. }
  3763. // 产品测量字段
  3764. let product_measure = curData.measurement.split("*");
  3765. for (let index = 0; index < product_measure.length; index++) {
  3766. const item = product_measure[index];
  3767. const product_measure_detail = [
  3768. item.substring(0, 1),
  3769. item.substring(1),
  3770. ];
  3771. modalData.measure.forEach((element) => {
  3772. if (element.measureCalc == product_measure_detail[0]) {
  3773. element.value = product_measure_detail[1];
  3774. }
  3775. });
  3776. }
  3777. // 拆分五金、附加信息
  3778. if (!curData.ext) {
  3779. curData.ext = curData.ext_list;
  3780. }
  3781. curData.ext.forEach((element) => {
  3782. element.type == 1 && modalData.metalArray.push(element);
  3783. element.type == 2 && modalData.extArray.push(element);
  3784. });
  3785. modalData.metalArray.forEach((element) => {
  3786. element.material_id = element.ext_id;
  3787. element.total_price = (element.price * element.num).toFixed(2);
  3788. });
  3789. modalData.extArray.forEach((element) => {
  3790. element.id = element.ext_id;
  3791. element.total_price = (element.price * element.num).toFixed(2);
  3792. });
  3793. // 同步 curData 、 modalData
  3794. // for (
  3795. // let _modal_idx = 0;
  3796. // _modal_idx < modalData.part.length;
  3797. // _modal_idx++
  3798. // ) {
  3799. // const _modal = modalData.part[_modal_idx];
  3800. // //匹配次数
  3801. // let match_idx = -1;
  3802. // // 相同次数
  3803. // let same_idx = 0;
  3804. // for (let _cur_idx = 0; _cur_idx < curData.part.length; _cur_idx++) {
  3805. // const _cur = curData.part[_cur_idx];
  3806. // if (
  3807. // _modal.part_id == _cur.part_id ||
  3808. // _modal.change_id == _cur.change_id
  3809. // ) {
  3810. // match_idx++;
  3811. // }
  3812. // if (match_idx == 1) {
  3813. // _modal.splice(
  3814. // _modal_idx,
  3815. // same_idx,
  3816. // JSON.parse(JSON.stringify(_cur))
  3817. // );
  3818. // match_idx--;
  3819. // same_idx++;
  3820. // _modal_idx++;
  3821. // }
  3822. // }
  3823. // if (match_idx == -1) {
  3824. // //modal存在但是cur不存在数据
  3825. // curData.part.splice(
  3826. // _modal_idx,
  3827. // 0,
  3828. // JSON.parse(JSON.stringify(_modal))
  3829. // );
  3830. // modalData.isChoosed = false;
  3831. // } else if (match_idx == 0) {
  3832. // // modal 与 cur数量一致
  3833. // }
  3834. // }
  3835. // 处理部件
  3836. curData.part.forEach((element, index) => {
  3837. if (!element.is_metal) {
  3838. modalData.part[index].change_id = element.change_id;
  3839. modalData.part[index].part_title = element.part_title;
  3840. modalData.part[index].org_part_id = JSON.parse(
  3841. JSON.stringify(modalData.part[index].part_id)
  3842. );
  3843. // 部件测量字段
  3844. if (element.measure && element.measure.length > 0) {
  3845. const part_measure_detail = element.measure.split("*");
  3846. modalData.part[index].long = part_measure_detail[0];
  3847. modalData.part[index].wide = part_measure_detail[1];
  3848. modalData.part[index].high = part_measure_detail[2];
  3849. }
  3850. // 替换项相关 如果选了替换项
  3851. if (element.part_id != modalData.part[index].part_id) {
  3852. const change_obj = modalData.part[index].change.filter(
  3853. (item) => item.part_id == element.part_id
  3854. );
  3855. if (change_obj && change_obj.length > 0) {
  3856. change_obj[0].sub_part.forEach((elem, idx) => {
  3857. modalData.part[index].part_detail[idx].material_detail_title =
  3858. elem.material_detail_list[0].title;
  3859. modalData.part[index].part_detail[idx].material_detail_id =
  3860. elem.material_detail_id;
  3861. modalData.part[index].part_detail[idx].material_detail_list =
  3862. elem.material_detail_list;
  3863. });
  3864. }
  3865. }
  3866. element.sub_part.forEach((elem, idx) => {
  3867. // 零部件字段 、 原材料字段
  3868. modalData.part[index].part_detail[idx].long = elem.long;
  3869. modalData.part[index].part_detail[idx].wide = elem.wide;
  3870. modalData.part[index].part_detail[idx].high = elem.high;
  3871. modalData.part[index].part_detail[idx].material_detail_id =
  3872. elem.material_detail_id;
  3873. modalData.part[index].part_detail[idx].material_detail_num =
  3874. elem.material_detail_num;
  3875. modalData.part[index].part_detail[idx].material_id =
  3876. elem.material_id;
  3877. modalData.part[index].part_detail[idx].num = elem.num;
  3878. });
  3879. modalData.part[index].part_id = element.part_id;
  3880. // 工艺属性
  3881. modalData.part[index].procedure_properties = JSON.parse(
  3882. JSON.stringify(element.process)
  3883. );
  3884. for (let idx = 0; idx < element.process.length; idx++) {
  3885. const item = element.process[idx];
  3886. modalData.part[index].process.forEach((elem) => {
  3887. elem.cld.forEach((el) => {
  3888. if (el.id == item) {
  3889. elem.procedure_property = item * 1;
  3890. }
  3891. });
  3892. });
  3893. // modalData.part[index].process[idx].procedure_property = item * 1;
  3894. }
  3895. }
  3896. });
  3897. },
  3898. handleSet(row, index, type) {
  3899. let obj;
  3900. // 1 新增 2 编辑 3 删除 4复制 5详情
  3901. switch (type) {
  3902. case 1:
  3903. this.title_state = 1;
  3904. if (this.info.custom_id) {
  3905. this.modalArray = [
  3906. {
  3907. type_name: "产品1",
  3908. num: 1,
  3909. position: "位置",
  3910. index: "0",
  3911. metalArray: [],
  3912. extArray: [],
  3913. },
  3914. ];
  3915. this.currentTabIndex = "0";
  3916. this.showAddProduct = true;
  3917. } else {
  3918. this.$Message.warning("请先选择客户");
  3919. }
  3920. break;
  3921. case 2:
  3922. this.title_state = 2;
  3923. this.isCheck = false;
  3924. if (this.type == 1) {
  3925. this.showEditProduct = true;
  3926. this.modalData = JSON.parse(JSON.stringify(row));
  3927. this.currencyIndex = index;
  3928. } else if (this.type == 2) {
  3929. if (row.get_first_data) {
  3930. this.axios
  3931. .get("/api/order_product_detail_new", {
  3932. params: { order_product_id: row.order_product_id },
  3933. })
  3934. .then((res) => {
  3935. if (res.code == 200) {
  3936. this.currencyIndex = index;
  3937. this.modalData = JSON.parse(JSON.stringify(row));
  3938. this.editForm = res.data;
  3939. this.changeProductOnEdit(res.data, 0);
  3940. }
  3941. });
  3942. } else {
  3943. this.modalData = JSON.parse(JSON.stringify(row));
  3944. this.currencyIndex = index;
  3945. this.showEditProduct = true;
  3946. }
  3947. }
  3948. break;
  3949. case 3:
  3950. this.tableData.splice(index, 1);
  3951. this.handleCalcCount();
  3952. break;
  3953. case 4:
  3954. obj = JSON.parse(JSON.stringify(row));
  3955. this.route_id_at_copy = row.route_id;
  3956. obj.index = obj.index + 1;
  3957. this.handleSetCopyId(obj, "_XID");
  3958. this.tableData.splice(index, 0, obj);
  3959. this.handleCalcCount();
  3960. break;
  3961. case 5:
  3962. this.title_state = 3;
  3963. this.isCheck = true;
  3964. if (row.get_first_data) {
  3965. this.axios
  3966. .get("/api/order_product_detail_new", {
  3967. params: { order_product_id: row.order_product_id },
  3968. })
  3969. .then((res) => {
  3970. if (res.code == 200) {
  3971. this.currencyIndex = index;
  3972. this.modalData = JSON.parse(JSON.stringify(row));
  3973. this.editForm = res.data;
  3974. this.changeProductOnEdit(res.data, 0);
  3975. }
  3976. });
  3977. } else {
  3978. this.modalData = JSON.parse(JSON.stringify(row));
  3979. this.currencyIndex = index;
  3980. this.showEditProduct = true;
  3981. }
  3982. break;
  3983. }
  3984. },
  3985. handleSetCopyId(obj, key) {
  3986. // 浅拷贝,不需要返回
  3987. const temp = obj[key].split("_");
  3988. temp[1]++;
  3989. obj[key] = temp.join("_");
  3990. },
  3991. async handleBeforeUpload(row) {
  3992. // row.name
  3993. this.uploadData.title = row.name.substring(0, row.name.indexOf("."));
  3994. return true;
  3995. },
  3996. uploadError(err) {
  3997. this.$Message.error(err.msg || "上传失败");
  3998. },
  3999. onProgress(e) {
  4000. console.log(e);
  4001. },
  4002. //导入成功
  4003. uploadSuccess(res) {
  4004. if (res.code == 200) {
  4005. this.$Message.success(res.msg || "上传成功");
  4006. // const temp = res.data;
  4007. // let list = [...this.postInfo.children, ...temp];
  4008. } else {
  4009. this.$Message.warning(res.msg || "上传失败");
  4010. }
  4011. },
  4012. handleExtChange(row, { value, label }, item) {
  4013. row.ext_id = value;
  4014. row.title = label;
  4015. const element = this.extList.filter((item) => item.id == value);
  4016. row.num = element[0].num;
  4017. row.price = element[0].price;
  4018. row.total_price = (row.num * row.price).toFixed(2);
  4019. this.handleTotalPriceCalc(row, item);
  4020. },
  4021. handleSameProcessDisabled(array, currencyChooseValue, currencyChooseIndex) {
  4022. let matchIds = array.selected_ids;
  4023. let target = array.same_process;
  4024. let source = array.same_process_compare;
  4025. let chooseable = [];
  4026. source.forEach((element, index) => {
  4027. element.forEach((elem, idx) => {
  4028. if (elem.id == currencyChooseValue) {
  4029. chooseable = [...chooseable, ...element];
  4030. }
  4031. });
  4032. });
  4033. target.forEach((element) => {
  4034. element.option.forEach((elem) => {
  4035. elem.isAllowSelect = true;
  4036. chooseable.forEach((el) => {
  4037. if (el.id == elem.id) {
  4038. elem.isAllowSelect = false;
  4039. }
  4040. });
  4041. });
  4042. });
  4043. this.$forceUpdate();
  4044. },
  4045. changeLock(value, row, idx) {
  4046. if (row.old_lock_price) {
  4047. row.price = parseInt(row.price) - row.old_lock_price;
  4048. }
  4049. row.old_lock_price = parseInt(value.tag || "0");
  4050. row.price = parseInt(row.price) + parseInt(value.tag || "0");
  4051. this.modalArray[idx] = row;
  4052. this.$forceUpdate();
  4053. },
  4054. handleTotalPriceChange(row, item) {
  4055. row.price = (row.total_price / (row.num == 0 ? 1 : row.num)).toFixed(2);
  4056. let sum = 0;
  4057. item.extArray.map((v) => {
  4058. return (sum += v.total_price * 1);
  4059. });
  4060. item.metalArray.map((v) => {
  4061. return (sum += v.total_price * 1);
  4062. });
  4063. item.ext_price = sum;
  4064. item.price =
  4065. (item.unit_price * 1 || 0) * (item.num * 1 || 1) +
  4066. (item.over_price * 1 || 0) +
  4067. (item.ext_price * 1 || 0);
  4068. item.price = item.price.toFixed(2);
  4069. this.$forceUpdate();
  4070. },
  4071. handleTotalPriceCalc(row, item) {
  4072. row.total_price = ((row.price || 0) * (row.num || 0)).toFixed(2);
  4073. let sum1 = 0;
  4074. item.metalArray &&
  4075. item.metalArray.length > 0 &&
  4076. item.metalArray.forEach((element) => {
  4077. sum1 += element.total_price * 1 || 0;
  4078. });
  4079. let sum2 = 0;
  4080. item.extArray &&
  4081. item.extArray.length > 0 &&
  4082. item.extArray.forEach((element) => {
  4083. sum2 += element.total_price * 1 || 0;
  4084. });
  4085. item.ext_price = sum1 * 1 + sum2 * 1;
  4086. item.price =
  4087. (item.unit_price * 1 || 0) * (item.num * 1 || 1) +
  4088. (item.over_price * 1 || 0) +
  4089. (item.ext_price * 1 || 0);
  4090. item.price = item.price.toFixed(2);
  4091. this.$forceUpdate();
  4092. },
  4093. handlePartDetailEdit(element, index) {
  4094. element.isShowPartDetail = !element.isShowPartDetail;
  4095. this.$forceUpdate();
  4096. },
  4097. handlePartsApart(element, index, array) {
  4098. let obj = JSON.parse(JSON.stringify(element));
  4099. obj.isBP = false;
  4100. array.splice(index + 1, 0, obj);
  4101. this.$forceUpdate();
  4102. },
  4103. handlePartsDele(element, index, array) {
  4104. array.splice(index, 1);
  4105. this.handleCalcCount();
  4106. this.$forceUpdate();
  4107. },
  4108. handleProductPositionChange(item, e) {
  4109. item.position = e.target.value;
  4110. this.$forceUpdate();
  4111. },
  4112. changeAddProduct(row, n) {
  4113. // route_id_at_copy
  4114. if (row) {
  4115. let id = row ? row.value : this.productList[0].id;
  4116. this.modalArray[n].type_name = row.label;
  4117. this.modalArray[n].title = row.label;
  4118. this.axios("/api/order_get_product_detail_new", {
  4119. params: { product_id: id, custom_id: this.info.custom_id },
  4120. }).then((res) => {
  4121. if (res.code == 200) {
  4122. this.process_match_list = res.data.process.list;
  4123. this.process_all_list = res.data.process.title;
  4124. // 赋值默认工艺路线
  4125. if (this.modalArray.length == 1) {
  4126. let _temp_obj = {};
  4127. if (res.data.process.list.length > 1) {
  4128. for (const key in res.data.process.list[0].detail) {
  4129. res.data.process.list.reduce((pre, cur) => {
  4130. if (_temp_obj[key] == "") {
  4131. return pre;
  4132. } else {
  4133. if (pre.detail[key] == cur.detail[key]) {
  4134. _temp_obj[key] = pre.detail[key];
  4135. return pre;
  4136. } else {
  4137. _temp_obj[key] = "";
  4138. return pre;
  4139. }
  4140. }
  4141. });
  4142. }
  4143. } else {
  4144. _temp_obj = res.data.process.list[0].detail;
  4145. }
  4146. this.pre_process_obj = JSON.parse(JSON.stringify(_temp_obj));
  4147. }
  4148. let modalData = this.modalArray[n];
  4149. this.support_remark = res.data.support_remark;
  4150. // modalData.route_id = res.data.process.list[0].id;
  4151. modalData.url = res.data.url;
  4152. modalData.total_num = res.data.total_num || 1;
  4153. modalData.ext_price = res.data.ext_price || 0;
  4154. modalData.unit_price = res.data.price || 0;
  4155. modalData.num = res.data.num || 1;
  4156. modalData.num_temp_save = JSON.parse(JSON.stringify(modalData.num));
  4157. modalData.over_price = res.data.over_price || 0;
  4158. modalData.position = res.data.position || "";
  4159. modalData.unit = res.data.unit || "";
  4160. modalData.remark = res.data.remark || "";
  4161. modalData.url_number = res.data.url_number || "";
  4162. modalData.overdraft = res.data.overdraft;
  4163. modalData.num_formula = res.data.num_formula;
  4164. modalData.bp_id = res.data.bp_id;
  4165. // 金额=(产品单价)*核算数量 +附加金额 + 超标金额
  4166. modalData.price =
  4167. (modalData.unit_price * 1 || 0) * (modalData.num * 1 || 1) +
  4168. (modalData.over_price * 1 || 0) +
  4169. (modalData.ext_price * 1 || 0);
  4170. modalData.price = modalData.price.toFixed(2);
  4171. // modalData.model = res.data.model || ''
  4172. // modalData.same_process_compare = JSON.parse(JSON.stringify(res.data.intermediate.same_process || []))
  4173. modalData.selected_ids = [];
  4174. modalData.part = res.data.part;
  4175. modalData.part.forEach((element, index) => {
  4176. // 选择不是附加项目的,
  4177. if (!element.is_metal) {
  4178. // 选择不是线条、或者基础档案中要默认为空的部件
  4179. element.isBP = true;
  4180. element.isChoosed = true;
  4181. if (element.is_null == 1) {
  4182. element.change_id = "";
  4183. } else {
  4184. element.part_detail = element.sub_part;
  4185. //展示非拆分部件
  4186. // 默认替换部件
  4187. element.change_id = element.change[0].id;
  4188. //存计算公式
  4189. element.long ? "" : (element.long = 0);
  4190. element.wide ? "" : (element.wide = 0);
  4191. element.high ? "" : (element.high = 0);
  4192. element.longCalc = JSON.parse(JSON.stringify(element.long));
  4193. element.wideCalc = JSON.parse(JSON.stringify(element.wide));
  4194. element.highCalc = JSON.parse(JSON.stringify(element.high));
  4195. element.part_detail.forEach((elem) => {
  4196. elem.org_num = JSON.parse(JSON.stringify(elem.num));
  4197. elem.material_detail_id = 0;
  4198. elem.material_detail_title =
  4199. elem.material_detail_list[0].title;
  4200. elem.material_detail_id =
  4201. elem.material_detail_list[0].material_detail_id;
  4202. elem.material_detail_num = elem.num || 0;
  4203. elem.material_detail_org_num = JSON.parse(
  4204. JSON.stringify(elem.num || 0)
  4205. );
  4206. elem.long ? "" : (elem.long = 0);
  4207. elem.wide ? "" : (elem.wide = 0);
  4208. elem.high ? "" : (elem.high = 0);
  4209. elem.longCalc = JSON.parse(JSON.stringify(elem.long || ""));
  4210. elem.wideCalc = JSON.parse(JSON.stringify(elem.wide || ""));
  4211. elem.highCalc = JSON.parse(JSON.stringify(elem.high || ""));
  4212. elem.material_detail_list.forEach((el) => {
  4213. el.long = el.long || "0";
  4214. el.wide = el.wide || "0";
  4215. el.high = el.high || "0";
  4216. });
  4217. });
  4218. }
  4219. }
  4220. });
  4221. //测量字段
  4222. modalData.measure = res.data.measure;
  4223. modalData.measure.forEach((element) => {
  4224. element.value = "";
  4225. element.measureCalc = JSON.parse(JSON.stringify(element.e_title));
  4226. });
  4227. //工艺属性
  4228. modalData.process = [];
  4229. this.axios({
  4230. method: "get",
  4231. url: "/api/bpp_list",
  4232. }).then((re) => {
  4233. re.data.forEach((element) => {
  4234. for (const key in res.data.process.title) {
  4235. const ele = res.data.process.title[key];
  4236. if (element.name == ele) {
  4237. if (this.route_id_at_copy) {
  4238. const compare_copy = res.data.process.list.filter(
  4239. (item) => item.id == this.route_id_at_copy
  4240. );
  4241. if (compare_copy && compare_copy.length > 0) {
  4242. if (!modalData.procedure_properties) {
  4243. modalData.procedure_properties = [];
  4244. }
  4245. modalData.procedure_properties[
  4246. modalData.process.lenngth
  4247. ] = compare_copy[0].detail[key] * 1;
  4248. modalData.process.push({
  4249. key: key,
  4250. title: ele,
  4251. value: compare_copy[0].detail[key] * 1,
  4252. processList: element.cld,
  4253. });
  4254. } else {
  4255. modalData.process.push({
  4256. key: key,
  4257. title: ele,
  4258. value: "",
  4259. processList: element.cld,
  4260. });
  4261. }
  4262. } else {
  4263. const compare = res.data.process.list.filter(
  4264. (item) => item.detail[key] == this.pre_process_obj[key]
  4265. );
  4266. if (compare.length > 0) {
  4267. modalData.procedure_properties = [];
  4268. modalData.procedure_properties.push(
  4269. this.pre_process_obj[key] * 1
  4270. );
  4271. modalData.process.push({
  4272. key: key,
  4273. title: ele,
  4274. value: this.pre_process_obj[key] * 1,
  4275. processList: element.cld,
  4276. });
  4277. } else {
  4278. modalData.procedure_properties = [];
  4279. modalData.procedure_properties.push("");
  4280. modalData.process.push({
  4281. key: key,
  4282. title: ele,
  4283. value: "",
  4284. processList: element.cld,
  4285. });
  4286. }
  4287. }
  4288. }
  4289. }
  4290. });
  4291. modalData.part.forEach((element) => {
  4292. if (!element.is_metal) {
  4293. //赋值默认工艺属性
  4294. element.process = JSON.parse(JSON.stringify(re.data));
  4295. element.process.forEach((elem, index) => {
  4296. for (const key in res.data.process.title) {
  4297. const ele = res.data.process.title[key];
  4298. if (elem.name == ele) {
  4299. elem.procedure_property = this.pre_process_obj[key] * 1;
  4300. elem.process_id = key;
  4301. if (!element.procedure_properties) {
  4302. element.procedure_properties = [];
  4303. }
  4304. element.procedure_properties[index] =
  4305. this.pre_process_obj[key] * 1;
  4306. }
  4307. }
  4308. });
  4309. }
  4310. });
  4311. // 更换产品,分类不同,清空附加信息
  4312. this.handleClearExtInfo(
  4313. modalData,
  4314. this.pre_bp_id,
  4315. res.data.bp_id
  4316. );
  4317. // 是否有上一个的工艺属性ID
  4318. // 因为现在出现2个入口 方法弃用
  4319. // 在列表复制时需要被复制对象的工艺,在新增复制时同理
  4320. // this.chooseLastRouteId(modalData, res);
  4321. this.$forceUpdate();
  4322. });
  4323. }
  4324. });
  4325. }
  4326. },
  4327. handleOrderPriceChange(e, info) {
  4328. this.info.order_price = e.target.value;
  4329. this.info.fax_price = (this.info.predict_price - e.target.value).toFixed(
  4330. 2
  4331. );
  4332. this.$forceUpdate()
  4333. },
  4334. handleClearExtInfo(modalData, pre_id, cur_id) {
  4335. if (cur_id != pre_id) {
  4336. modalData.extArray = [];
  4337. modalData.metalArray = [];
  4338. } else {
  4339. let sum = 0;
  4340. modalData.extArray.map((v) => {
  4341. return (sum += v.total_price * 1);
  4342. });
  4343. modalData.metalArray.map((v) => {
  4344. return (sum += v.total_price * 1);
  4345. });
  4346. modalData.ext_price = sum;
  4347. modalData.price =
  4348. (modalData.unit_price * 1 || 0) * (modalData.num * 1 || 1) +
  4349. (modalData.over_price * 1 || 0) +
  4350. (modalData.ext_price * 1 || 0);
  4351. modalData.price = modalData.price.toFixed(2);
  4352. }
  4353. this.pre_bp_id = cur_id;
  4354. },
  4355. changeEditProduct(row) {
  4356. if (row) {
  4357. let id = row ? row.value : this.productList[0].id;
  4358. this.modalData.type_name = row.label;
  4359. this.modalData.title = row.label;
  4360. this.axios("/api/order_get_product_detail_new", {
  4361. params: { product_id: id, custom_id: this.info.custom_id },
  4362. }).then((res) => {
  4363. if (res.code == 200) {
  4364. this.process_match_list = res.data.process.list;
  4365. this.process_all_list = res.data.process.title;
  4366. this.support_remark = res.data.support_remark;
  4367. // 赋值默认工艺路线
  4368. let _temp_obj = {};
  4369. if (res.data.process.list.length > 1) {
  4370. for (const key in res.data.process.list[0].detail) {
  4371. res.data.process.list.reduce((pre, cur) => {
  4372. if (_temp_obj[key] == "") {
  4373. return pre;
  4374. } else {
  4375. if (pre.detail[key] == cur.detail[key]) {
  4376. _temp_obj[key] = pre.detail[key];
  4377. return pre;
  4378. } else {
  4379. _temp_obj[key] = "";
  4380. return pre;
  4381. }
  4382. }
  4383. });
  4384. }
  4385. } else {
  4386. _temp_obj = res.data.process.list[0].detail;
  4387. }
  4388. this.pre_process_obj = JSON.parse(JSON.stringify(_temp_obj));
  4389. this.modalData.url = res.data.url;
  4390. // this.modalData.route_id = res.data.process.list[0].id;
  4391. this.modalData.total_num = res.data.total_num || 1;
  4392. this.modalData.ext_price = res.data.ext_price || 0;
  4393. this.modalData.unit_price = res.data.price || 0;
  4394. this.modalData.num = res.data.num || 1;
  4395. this.modalData.num = JSON.parse(JSON.stringify(res.data.num));
  4396. this.modalData.over_price = res.data.over_price || 0;
  4397. this.modalData.position = res.data.position || "";
  4398. this.modalData.unit = res.data.unit || "";
  4399. this.modalData.remark = res.data.remark || "";
  4400. this.modalData.url_number = res.data.url_number || "";
  4401. this.modalData.overdraft = res.data.overdraft;
  4402. this.modalData.num_formula = res.data.num_formula;
  4403. this.modalData.bp_id = res.data.bp_id;
  4404. // 金额=(产品单价)*核算数量 +附加金额 + 超标金额
  4405. this.modalData.price =
  4406. (this.modalData.unit_price * 1 || 0) *
  4407. (this.modalData.num * 1 || 1) +
  4408. (this.modalData.over_price * 1 || 0) +
  4409. (this.modalData.ext_price * 1 || 0);
  4410. this.modalData.price = this.modalData.price.toFixed(2);
  4411. // this.modalData.model = res.data.model || ''
  4412. // this.modalData.same_process_compare = JSON.parse(JSON.stringify(res.data.intermediate.same_process || []))
  4413. this.modalData.selected_ids = [];
  4414. this.modalData.part = res.data.part;
  4415. // 数据第一次通过接口获取
  4416. this.modalData.get_first_data = false;
  4417. this.modalData.part.forEach((element, index) => {
  4418. // 选择不是附加项目的,
  4419. if (!element.is_metal) {
  4420. // 选择不是线条、或者基础档案中要默认为空的部件
  4421. element.isBP = true;
  4422. element.isChoosed = true;
  4423. if (element.is_null == 1) {
  4424. element.change_id = "";
  4425. } else {
  4426. element.part_detail = element.sub_part;
  4427. //展示非拆分部件
  4428. // 默认替换部件
  4429. element.change_id = element.change[0].id;
  4430. //存计算公式
  4431. element.long ? "" : (element.long = 0);
  4432. element.wide ? "" : (element.wide = 0);
  4433. element.high ? "" : (element.high = 0);
  4434. element.longCalc = JSON.parse(JSON.stringify(element.long));
  4435. element.wideCalc = JSON.parse(JSON.stringify(element.wide));
  4436. element.highCalc = JSON.parse(JSON.stringify(element.high));
  4437. element.part_detail.forEach((elem) => {
  4438. elem.material_detail_id = 0;
  4439. elem.material_detail_title =
  4440. elem.material_detail_list[0].title;
  4441. elem.material_detail_id =
  4442. elem.material_detail_list[0].material_detail_id;
  4443. elem.org_num = JSON.parse(JSON.stringify(elem.num));
  4444. elem.material_detail_org_num = JSON.parse(
  4445. JSON.stringify(elem.num || 0)
  4446. );
  4447. elem.material_detail_num = elem.num || 0;
  4448. elem.long ? "" : (elem.long = 0);
  4449. elem.wide ? "" : (elem.wide = 0);
  4450. elem.high ? "" : (elem.high = 0);
  4451. elem.longCalc = JSON.parse(JSON.stringify(elem.long || ""));
  4452. elem.wideCalc = JSON.parse(JSON.stringify(elem.wide || ""));
  4453. elem.highCalc = JSON.parse(JSON.stringify(elem.high || ""));
  4454. elem.material_detail_list.forEach((el) => {
  4455. el.long = el.long || "0";
  4456. el.wide = el.wide || "0";
  4457. el.high = el.high || "0";
  4458. });
  4459. });
  4460. }
  4461. }
  4462. });
  4463. //测量字段
  4464. this.modalData.measure = res.data.measure;
  4465. this.modalData.measure.forEach((element) => {
  4466. element.value = "";
  4467. element.measureCalc = JSON.parse(JSON.stringify(element.e_title));
  4468. });
  4469. //工艺属性
  4470. this.modalData.process = [];
  4471. this.axios({
  4472. method: "get",
  4473. url: "/api/bpp_list",
  4474. }).then((re) => {
  4475. re.data.forEach((element) => {
  4476. for (const key in res.data.process.title) {
  4477. const ele = res.data.process.title[key];
  4478. if (element.name == ele) {
  4479. const compare = res.data.process.list.filter(
  4480. (item) => item.detail[key] == this.pre_process_obj[key]
  4481. );
  4482. this.modalData.procedure_properties = [];
  4483. if (compare.length > 0) {
  4484. this.modalData.procedure_properties.push(
  4485. this.pre_process_obj[key] * 1
  4486. );
  4487. this.modalData.process.push({
  4488. key: key,
  4489. title: ele,
  4490. value: this.pre_process_obj[key] * 1,
  4491. processList: element.cld,
  4492. });
  4493. } else {
  4494. this.modalData.procedure_properties.push("");
  4495. this.modalData.process.push({
  4496. key: key,
  4497. title: ele,
  4498. value: "",
  4499. processList: element.cld,
  4500. });
  4501. }
  4502. }
  4503. }
  4504. });
  4505. this.modalData.part.forEach((element) => {
  4506. if (!element.is_metal) {
  4507. //赋值默认工艺属性
  4508. element.process = JSON.parse(JSON.stringify(re.data));
  4509. element.process.forEach((elem, index) => {
  4510. for (const key in res.data.process.title) {
  4511. const ele = res.data.process.title[key];
  4512. if (elem.name == ele) {
  4513. elem.procedure_property = this.pre_process_obj[key] * 1;
  4514. elem.process_id = key;
  4515. if (!element.procedure_properties) {
  4516. element.procedure_properties = [];
  4517. }
  4518. element.procedure_properties[index] =
  4519. this.pre_process_obj[key] * 1;
  4520. }
  4521. }
  4522. });
  4523. }
  4524. });
  4525. this.handleClearExtInfo(
  4526. this.modalData,
  4527. this.pre_bp_id,
  4528. res.data.bp_id
  4529. );
  4530. // 是否有上一个的工艺属性ID
  4531. this.chooseLastRouteId(this.modalData, res);
  4532. this.$forceUpdate();
  4533. });
  4534. }
  4535. });
  4536. }
  4537. },
  4538. chooseLastRouteId(modalData, res) {
  4539. // 匹配
  4540. modalData.process.forEach((element) => {
  4541. for (const key in this.pre_process_obj) {
  4542. const item = this.pre_process_obj[key];
  4543. const compare = res.data.process.list.filter(
  4544. (_process) => _process.detail[key] == this.pre_process_obj[key]
  4545. );
  4546. if (element.key == key) {
  4547. if (compare.length > 0) {
  4548. element.value = item * 1;
  4549. } else {
  4550. element.value = "";
  4551. }
  4552. }
  4553. }
  4554. });
  4555. this.$forceUpdate();
  4556. },
  4557. changeProductOnEdit(row, n) {
  4558. if (row) {
  4559. this.modalData.type_name = row.label;
  4560. this.modalData.title = row.label;
  4561. this.axios("/api/order_get_product_detail_new", {
  4562. params: {
  4563. product_id: row.product_id,
  4564. custom_id: this.info.custom_id,
  4565. },
  4566. }).then((res) => {
  4567. if (res.code == 200) {
  4568. this.support_remark = res.data.support_remark;
  4569. this.process_match_list = res.data.process.list;
  4570. this.process_all_list = res.data.process.title;
  4571. //获取产品
  4572. this.modalData.total_num = res.data.total_num || 1;
  4573. this.modalData.ext_price = res.data.ext_price || 0;
  4574. this.modalData.unit_price = res.data.price || 0;
  4575. this.modalData.num = res.data.num || 1;
  4576. this.modalData.num_temp_save = JSON.parse(
  4577. JSON.stringify(res.data.num || 1)
  4578. );
  4579. this.modalData.over_price = res.data.over_price || 0;
  4580. this.modalData.position = res.data.position | "";
  4581. this.modalData.unit = res.data.unit || "";
  4582. this.modalData.remark = res.data.remark || "";
  4583. this.modalData.url = res.data.url || [];
  4584. this.modalData.url_number = res.data.url_number || "";
  4585. this.modalData.overdraft = res.data.overdraft;
  4586. this.modalData.bp_id = res.data.bp_id;
  4587. // this.modalData.same_process_compare = JSON.parse(JSON.stringify(res.data.intermediate.same_process || []))
  4588. this.modalData.selected_ids = [];
  4589. this.modalData.customize = row.customize;
  4590. this.modalData.get_first_data = false;
  4591. this.modalData.part = res.data.part;
  4592. this.modalData.part.forEach((element) => {
  4593. if (!element.is_metal) {
  4594. element.isBP = true;
  4595. element.isChoosed = true;
  4596. element.part_detail = element.sub_part;
  4597. // 数据第一次通过接口获取
  4598. //展示非拆分部件
  4599. //存计算公式
  4600. element.longCalc = JSON.parse(
  4601. JSON.stringify(element.long || "")
  4602. );
  4603. element.wideCalc = JSON.parse(
  4604. JSON.stringify(element.wide || "")
  4605. );
  4606. element.highCalc = JSON.parse(
  4607. JSON.stringify(element.high || "")
  4608. );
  4609. element.part_detail.forEach((elem) => {
  4610. elem.org_num = JSON.parse(JSON.stringify(elem.num));
  4611. elem.material_detail_id = 0;
  4612. elem.material_detail_title =
  4613. elem.material_detail_list[0].title;
  4614. elem.material_detail_num = elem.num || 0;
  4615. elem.material_detail_org_num = JSON.parse(
  4616. JSON.stringify(elem.num || 0)
  4617. );
  4618. elem.longCalc = JSON.parse(JSON.stringify(elem.long || ""));
  4619. elem.wideCalc = JSON.parse(JSON.stringify(elem.wide || ""));
  4620. elem.highCalc = JSON.parse(JSON.stringify(elem.high || ""));
  4621. elem.material_detail_list.forEach((el) => {
  4622. el.long = el.long || "0";
  4623. el.wide = el.wide || "0";
  4624. el.high = el.high || "0";
  4625. });
  4626. });
  4627. }
  4628. });
  4629. //测量字段
  4630. this.modalData.measure = res.data.measure;
  4631. this.modalData.measure.forEach((element) => {
  4632. element.measureCalc = JSON.parse(JSON.stringify(element.e_title));
  4633. });
  4634. //工艺属性
  4635. this.modalData.process = [];
  4636. this.axios({
  4637. method: "get",
  4638. url: "/api/bpp_list",
  4639. }).then((re) => {
  4640. this.modalData.part.forEach((element) => {
  4641. if (!element.is_metal) {
  4642. element.process = JSON.parse(JSON.stringify(re.data));
  4643. element.process.forEach((elem) => {
  4644. elem.procedure_property = "";
  4645. });
  4646. }
  4647. });
  4648. re.data.forEach((element) => {
  4649. for (const key in res.data.process.title) {
  4650. const ele = res.data.process.title[key];
  4651. if (element.name == ele) {
  4652. element.cld.forEach((elem) => {
  4653. elem.isDisabled = false;
  4654. });
  4655. this.modalData.process.push({
  4656. key: key,
  4657. title: ele,
  4658. value: "",
  4659. processList: element.cld,
  4660. });
  4661. }
  4662. }
  4663. });
  4664. (this.type == 2 || this.type == 3) &&
  4665. this.getEditData(this.modalData, this.editForm);
  4666. this.showEditProduct = true;
  4667. this.$forceUpdate();
  4668. });
  4669. }
  4670. });
  4671. }
  4672. },
  4673. handlePartChange($event, row, measure, product_num) {
  4674. if ($event) {
  4675. let cur = row.change.filter((item) => item.id == row.change_id);
  4676. row.part_title = cur[0].part_title;
  4677. row.org_part_id = JSON.parse(JSON.stringify(row.part_id));
  4678. row.part_id = cur[0].part_id;
  4679. row.high = cur[0].high || 0;
  4680. row.highCalc = JSON.parse(JSON.stringify(row.high));
  4681. row.long = cur[0].long || 0;
  4682. row.longCalc = JSON.parse(JSON.stringify(row.long));
  4683. row.wide = cur[0].wide || 0;
  4684. row.wideCalc = JSON.parse(JSON.stringify(row.wide));
  4685. row.part_detail = cur[0].sub_part;
  4686. row.part_detail.forEach((elem) => {
  4687. elem.longCalc = JSON.parse(JSON.stringify(elem.long || ""));
  4688. elem.wideCalc = JSON.parse(JSON.stringify(elem.wide || ""));
  4689. elem.highCalc = JSON.parse(JSON.stringify(elem.high || ""));
  4690. elem.org_num = JSON.parse(JSON.stringify(elem.num));
  4691. elem.material_detail_org_num = JSON.parse(
  4692. JSON.stringify(elem.num || 0)
  4693. );
  4694. elem.num =
  4695. ((elem.material_detail_org_num || elem.num) * product_num) | 0;
  4696. elem.material_detail_num = elem.material_detail_org_num * product_num;
  4697. });
  4698. measure.forEach((element) => {
  4699. if ((row.long + "").indexOf(element.measureCalc) != -1) {
  4700. if (typeof (element.value * 1) == "number") {
  4701. row.long = row.long.replace(
  4702. new RegExp(element.measureCalc, "g"),
  4703. element.value | ""
  4704. );
  4705. row.long = eval(row.long);
  4706. row.long += "";
  4707. } else {
  4708. row.long = "";
  4709. }
  4710. }
  4711. if ((row.wide + "").indexOf(element.measureCalc) != -1) {
  4712. if (typeof (element.value * 1) == "number") {
  4713. row.wide = row.wide.replace(
  4714. new RegExp(element.measureCalc, "g"),
  4715. element.value | ""
  4716. );
  4717. row.wide = eval(row.wide);
  4718. row.wide += "";
  4719. } else {
  4720. row.wide = "";
  4721. }
  4722. }
  4723. if ((row.high + "").indexOf(element.measureCalc) != -1) {
  4724. if (typeof (element.value * 1) == "number") {
  4725. row.high = row.high.replace(
  4726. new RegExp(element.measureCalc, "g"),
  4727. element.value | ""
  4728. );
  4729. row.high = eval(row.high);
  4730. row.high += "";
  4731. } else {
  4732. row.high = "";
  4733. }
  4734. }
  4735. row.part_detail.forEach((item) => {
  4736. item.num =
  4737. row.material_detail_org_num || item.material_detail_org_num;
  4738. if ((item.long || "").indexOf(element.measureCalc) != -1) {
  4739. if (typeof (element.value * 1) == "number") {
  4740. item.long = item.long.replace(
  4741. new RegExp(element.measureCalc, "g"),
  4742. element.value
  4743. );
  4744. try {
  4745. item.long = eval(item.long);
  4746. item.long += "";
  4747. } catch (error) {
  4748. item.long = "";
  4749. }
  4750. }
  4751. }
  4752. if ((item.wide || "").indexOf(element.measureCalc) != -1) {
  4753. if (typeof (element.value * 1) == "number") {
  4754. item.wide = item.wide.replace(
  4755. new RegExp(element.measureCalc, "g"),
  4756. element.value
  4757. );
  4758. try {
  4759. item.wide = eval(item.wide);
  4760. item.wide += "";
  4761. } catch (error) {
  4762. item.wide = "";
  4763. }
  4764. }
  4765. }
  4766. if ((item.high || "").indexOf(element.measureCalc) != -1) {
  4767. if (typeof (element.value * 1) == "number") {
  4768. item.high = item.high.replace(
  4769. new RegExp(element.measureCalc, "g"),
  4770. element.value
  4771. );
  4772. try {
  4773. item.high = eval(item.high);
  4774. item.high += "";
  4775. } catch (error) {
  4776. item.high = "";
  4777. }
  4778. }
  4779. }
  4780. item.material_detail_list.forEach((it) => {
  4781. it.long = it.long || "0";
  4782. it.wide = it.wide || "0";
  4783. it.high = it.high || "0";
  4784. });
  4785. item.long = item.long || "0";
  4786. item.wide = item.wide || "0";
  4787. item.high = item.high || "0";
  4788. item.material_detail_title = item.material_detail_list[0].title;
  4789. item.material_detail_id =
  4790. item.material_detail_list[0].material_detail_id;
  4791. item.material_detail_org_num = item.num || 0;
  4792. });
  4793. });
  4794. } else {
  4795. row.change_id = "";
  4796. }
  4797. this.$forceUpdate();
  4798. },
  4799. handleProductNumChange(e, product) {
  4800. product.part.map((element) => {
  4801. element.part_detail.map((elem) => {
  4802. elem.material_detail_num =
  4803. e.target.value * elem.material_detail_org_num;
  4804. });
  4805. });
  4806. product.total_num = e.target.value;
  4807. product.num = (product.total_num * product.num_temp_save).toFixed(2);
  4808. product.price =
  4809. (product.unit_price * 1 || 0) * (product.num * 1 || 1) +
  4810. (product.over_price * 1 || 0) +
  4811. (product.ext_price * 1 || 0);
  4812. product.price = product.price.toFixed(2);
  4813. this.$forceUpdate();
  4814. },
  4815. handleProductUnit_priceChange(e, product) {
  4816. product.unit_price = e.target.value * 1;
  4817. product.price =
  4818. (product.unit_price * 1 || 0) * (product.num * 1 || 1) +
  4819. (product.over_price * 1 || 0) +
  4820. (product.ext_price * 1 || 0);
  4821. product.price = product.price.toFixed(2);
  4822. this.$forceUpdate();
  4823. },
  4824. handleProductExt_priceChange(e, product) {
  4825. product.ext_price = e.target.value * 1;
  4826. product.price =
  4827. (product.unit_price * 1 || 0) * (product.num * 1 || 1) +
  4828. (product.over_price * 1 || 0) +
  4829. (product.ext_price * 1 || 0);
  4830. product.price = product.price.toFixed(2);
  4831. this.$forceUpdate();
  4832. },
  4833. handleProductOver_priceChange(e, product) {
  4834. product.over_price = e.target.value;
  4835. product.price =
  4836. (product.unit_price * 1 || 0) * (product.num * 1 || 1) +
  4837. (product.over_price * 1 || 0) +
  4838. (product.ext_price * 1 || 0);
  4839. product.price = product.price.toFixed(2);
  4840. this.$forceUpdate();
  4841. },
  4842. handleGetProductMeasure(val, index, product, ele) {
  4843. if (val) {
  4844. let change = [];
  4845. if (product.part.filter((v) => !v.change_id).length > 0) {
  4846. ele.processList = [];
  4847. this.$forceUpdate();
  4848. return this.$Message.warning("请先选择部件!");
  4849. }
  4850. product.part.map((item) => {
  4851. change.push({
  4852. old_id: item.org_part_id || item.part_id,
  4853. new_id: item.change.filter((v) => v.id == item.change_id)[0]
  4854. .part_id,
  4855. });
  4856. });
  4857. let list = product.process.map((item) => {
  4858. return { type_id: item.key, value: item.value || "" };
  4859. });
  4860. ele.processList = [];
  4861. this.axios({
  4862. method: "post",
  4863. url: "/api/order_get_product_process",
  4864. data: {
  4865. product_id: product.product_id,
  4866. type_id: ele.key,
  4867. list,
  4868. change,
  4869. },
  4870. }).then((res) => {
  4871. if (res.code == 200) {
  4872. ele.processList = res.data;
  4873. } else {
  4874. ele.processList = [];
  4875. }
  4876. this.$forceUpdate();
  4877. });
  4878. }
  4879. },
  4880. // 查找最接近
  4881. handleFindNearest(array, value) {
  4882. const temp = JSON.parse(JSON.stringify(array));
  4883. temp.sort((a, b) => {
  4884. return Math.abs(a.long - value) - Math.abs(b.long - value);
  4885. });
  4886. return temp[0].material_detail_id;
  4887. },
  4888. handleCalcPartDetailLong(part_detail, product) {
  4889. for (const key in product.measure) {
  4890. const element = product.measure[key];
  4891. if (element.value) {
  4892. part_detail._longCalc = part_detail.longCalc.replace(
  4893. new RegExp(element.e_title, "g"),
  4894. element.value || ""
  4895. );
  4896. }
  4897. }
  4898. try {
  4899. eval(part_detail._longCalc);
  4900. } catch (error) {
  4901. for (const key in product.measure) {
  4902. const element = product.measure[key];
  4903. part_detail._longCalc = part_detail._longCalc.replace(
  4904. new RegExp(element.e_title, "g"),
  4905. element.value || ""
  4906. );
  4907. }
  4908. }
  4909. return part_detail._longCalc;
  4910. },
  4911. handleProductMeasureBlur(e, product, measure_detail) {
  4912. try {
  4913. measure_detail.value = eval(e.target.value);
  4914. } catch (error) {
  4915. console.log("error :>> ", error);
  4916. }
  4917. product.part.map((part) => {
  4918. part.part_detail &&
  4919. part.part_detail.length > 0 &&
  4920. part.part_detail.map((part_detail) => {
  4921. part_detail._longCalc = this.handleCalcPartDetailLong(
  4922. part_detail,
  4923. product
  4924. );
  4925. if (part_detail.material_detail_list.length > 1) {
  4926. try {
  4927. part_detail.longCalcFinal = eval(part_detail._longCalc);
  4928. part_detail.material_detail_id = this.handleFindNearest(
  4929. part_detail.material_detail_list,
  4930. part_detail.longCalcFinal
  4931. );
  4932. } catch (error) {
  4933. console.log("error :>> ", error);
  4934. }
  4935. }
  4936. });
  4937. });
  4938. this.$forceUpdate();
  4939. },
  4940. handleProductMeasureChange(e, product, measure_detail) {
  4941. if (e.target.value) {
  4942. let cur_measure = measure_detail.measureCalc;
  4943. let cur_value = measure_detail.value;
  4944. product.over_price = 0;
  4945. //当前测量字段 L W H 修改部件测量字段
  4946. product.part.forEach((element) => {
  4947. if (!element.is_metal) {
  4948. if (!element.is_null == 1) {
  4949. //处理公式
  4950. if (element.highCalc.indexOf(cur_measure) != -1) {
  4951. element.high = element.highCalc.replace(
  4952. new RegExp(cur_measure, "g"),
  4953. cur_value || ""
  4954. );
  4955. }
  4956. if (element.longCalc.indexOf(cur_measure) != -1) {
  4957. element.long = element.longCalc.replace(
  4958. new RegExp(cur_measure, "g"),
  4959. cur_value || ""
  4960. );
  4961. }
  4962. if (element.wideCalc.indexOf(cur_measure) != -1) {
  4963. element.wide = element.wideCalc.replace(
  4964. new RegExp(cur_measure, "g"),
  4965. cur_value || ""
  4966. );
  4967. }
  4968. //判断测量字段公式中是否还含有字母
  4969. let flag_high = false;
  4970. let flag_long = false;
  4971. let flag_wide = false;
  4972. for (let index = 0; index < product.measure.length; index++) {
  4973. const item = product.measure[index];
  4974. if (element.high.indexOf(item.measureCalc) != -1) {
  4975. flag_high = true;
  4976. }
  4977. if (element.long.indexOf(item.measureCalc) != -1) {
  4978. flag_long = true;
  4979. }
  4980. if (element.wide.indexOf(item.measureCalc) != -1) {
  4981. flag_wide = true;
  4982. }
  4983. }
  4984. if (flag_high) {
  4985. element.high = JSON.parse(JSON.stringify(element.high));
  4986. } else {
  4987. element.high = eval(element.high);
  4988. element.high += "";
  4989. }
  4990. if (flag_long) {
  4991. element.long = JSON.parse(JSON.stringify(element.long));
  4992. } else {
  4993. element.long = eval(element.long);
  4994. element.long += "";
  4995. }
  4996. if (flag_wide) {
  4997. element.wide = JSON.parse(JSON.stringify(element.wide));
  4998. } else {
  4999. element.wide = eval(element.wide);
  5000. element.wide += "";
  5001. }
  5002. element.part_detail.forEach((elem) => {
  5003. if (!elem.high) {
  5004. } else if (elem.highCalc.indexOf(cur_measure) != -1) {
  5005. elem.high = elem.highCalc.replace(
  5006. new RegExp(cur_measure, "g"),
  5007. cur_value || ""
  5008. );
  5009. }
  5010. if (!elem.long) {
  5011. } else if (elem.longCalc.indexOf(cur_measure) != -1) {
  5012. elem.long = elem.longCalc.replace(
  5013. new RegExp(cur_measure, "g"),
  5014. cur_value || ""
  5015. );
  5016. }
  5017. if (!elem.wide) {
  5018. } else if (elem.wideCalc.indexOf(cur_measure) != -1) {
  5019. elem.wide = elem.wideCalc.replace(
  5020. new RegExp(cur_measure, "g"),
  5021. cur_value || ""
  5022. );
  5023. }
  5024. //判断测量字段公式中是否还含有字母
  5025. let _flag_high = false;
  5026. let _flag_long = false;
  5027. let _flag_wide = false;
  5028. // Number类型无法使用indexOf
  5029. elem.high += "";
  5030. elem.long += "";
  5031. elem.wide += "";
  5032. for (let index = 0; index < product.measure.length; index++) {
  5033. const item = product.measure[index];
  5034. if (!elem.high) {
  5035. } else if (elem.high.indexOf(item.measureCalc) != -1) {
  5036. _flag_high = true;
  5037. }
  5038. if (!elem.long) {
  5039. } else if (elem.long.indexOf(item.measureCalc) != -1) {
  5040. _flag_long = true;
  5041. }
  5042. if (!elem.wide) {
  5043. } else if (elem.wide.indexOf(item.measureCalc) != -1) {
  5044. _flag_wide = true;
  5045. }
  5046. }
  5047. if (_flag_high) {
  5048. elem.high = JSON.parse(JSON.stringify(elem.high));
  5049. } else {
  5050. elem.high = eval(elem.high);
  5051. elem.high += "";
  5052. elem.high == "null" && (elem.high = 0);
  5053. }
  5054. if (_flag_long) {
  5055. elem.long = JSON.parse(JSON.stringify(elem.long));
  5056. } else {
  5057. elem.long = eval(elem.long);
  5058. elem.long += "";
  5059. elem.long == "null" && (elem.long = 0);
  5060. }
  5061. if (_flag_wide) {
  5062. elem.wide = JSON.parse(JSON.stringify(elem.wide));
  5063. } else {
  5064. elem.wide = eval(elem.wide);
  5065. elem.wide += "";
  5066. elem.wide == "null" && (elem.wide = 0);
  5067. }
  5068. });
  5069. }
  5070. }
  5071. });
  5072. product.part.map((item) => {
  5073. const cur_part = product.overdraft.filter(
  5074. (v) => v.part_id == item.part_id
  5075. );
  5076. cur_part.length > 0 &&
  5077. cur_part.map((element) => {
  5078. // 1 高 2 宽 3 厚
  5079. if (
  5080. element.type == 1 &&
  5081. item.long > element.min &&
  5082. item.long < element.max
  5083. ) {
  5084. item.formula_temp = JSON.parse(JSON.stringify(element.formula));
  5085. item.formula_temp = item.formula_temp.replace(/H/g, item.long);
  5086. item.formula_temp = item.formula_temp.replace(/W/g, item.wide);
  5087. item.formula_temp = item.formula_temp.replace(/T/g, item.high);
  5088. item.formula_value = eval(item.formula_temp);
  5089. product.over_price += item.formula_value * 1 || 0;
  5090. }
  5091. if (
  5092. element.type == 2 &&
  5093. item.wide > element.min &&
  5094. item.wide < element.max
  5095. ) {
  5096. item.formula_temp = JSON.parse(JSON.stringify(element.formula));
  5097. item.formula_temp = item.formula_temp.replace(/H/g, item.long);
  5098. item.formula_temp = item.formula_temp.replace(/W/g, item.wide);
  5099. item.formula_temp = item.formula_temp.replace(/T/g, item.high);
  5100. item.formula_value = eval(item.formula_temp);
  5101. product.over_price += item.formula_value * 1 || 0;
  5102. }
  5103. if (
  5104. element.type == 3 &&
  5105. item.high > element.min &&
  5106. item.high < element.max
  5107. ) {
  5108. item.formula_temp = JSON.parse(JSON.stringify(element.formula));
  5109. item.formula_temp = item.formula_temp.replace(/H/g, item.long);
  5110. item.formula_temp = item.formula_temp.replace(/W/g, item.wide);
  5111. item.formula_temp = item.formula_temp.replace(/T/g, item.high);
  5112. item.formula_value = eval(item.formula_temp);
  5113. product.over_price += item.formula_value * 1 || 0;
  5114. }
  5115. });
  5116. });
  5117. //修改核算数量
  5118. // 如果没有核算数量公式,核算数量取产品数量
  5119. if (product.num_formula == "") {
  5120. product.total_num = product.num;
  5121. } else {
  5122. product.num_formula_temp = JSON.parse(
  5123. JSON.stringify(product.num_formula)
  5124. );
  5125. product.measure.forEach((element) => {
  5126. if (product.num_formula.indexOf(element.e_title) != -1) {
  5127. product.num_formula_temp = product.num_formula_temp.replace(
  5128. new RegExp(element.e_title, "g"),
  5129. element.value || 0
  5130. );
  5131. }
  5132. });
  5133. product.num = eval(product.num_formula_temp);
  5134. product.num = product.num.toFixed(2);
  5135. product.over_price = product.over_price.toFixed(2);
  5136. product.num_temp_save = JSON.parse(JSON.stringify(product.num));
  5137. product.price =
  5138. (product.unit_price * 1 || 0) * (product.num * 1 || 1) +
  5139. (product.over_price * 1 || 0) +
  5140. (product.ext_price * 1 || 0);
  5141. product.price = product.price.toFixed(2);
  5142. }
  5143. this.$forceUpdate();
  5144. }
  5145. },
  5146. handleSubpartNumChange(e, row) {
  5147. row.material_detail_num = e.target.value;
  5148. this.$forceUpdate();
  5149. },
  5150. //修改材质/颜色/工艺的 disabled
  5151. handleProductProcessChange(e, n, modelData, ele) {
  5152. if (e) {
  5153. this.pre_process_obj[n + 1] = e.value;
  5154. if (!modelData.procedure_properties_str) {
  5155. modelData.procedure_properties_str = [];
  5156. }
  5157. modelData.procedure_properties_str[ele.key - 1] = e.label;
  5158. if (!modelData.procedure_properties) {
  5159. modelData.procedure_properties = [];
  5160. }
  5161. modelData.procedure_properties[ele.key - 1] = e.value;
  5162. let isStart = true;
  5163. let match_list = []; //当前选中的list
  5164. this.process_match_list.map((item) => {
  5165. if (item.detail[ele.key] == e.value) {
  5166. match_list.push(item.detail);
  5167. }
  5168. });
  5169. this.process_Select_match_list = match_list;
  5170. modelData.process.forEach((element) => {
  5171. if (element.value == "") {
  5172. isStart = false;
  5173. }
  5174. });
  5175. //匹配工艺路线
  5176. if (isStart) {
  5177. let _target = [];
  5178. let _sorce = JSON.parse(JSON.stringify(this.process_match_list));
  5179. modelData.process.forEach((element) => {
  5180. _target.push(element.value);
  5181. });
  5182. _sorce.forEach((element) => {
  5183. let _str = [];
  5184. for (const key in element.detail) {
  5185. const item = element.detail[key];
  5186. _str.push(item);
  5187. }
  5188. element.new_detail = _str.join(",");
  5189. });
  5190. let target = _target.join(",");
  5191. _sorce.forEach((element) => {
  5192. if (element.new_detail == target) {
  5193. modelData.route_id = element.id;
  5194. }
  5195. });
  5196. }
  5197. // 产品 - 部件 工艺属性联动
  5198. modelData.part.forEach((element) => {
  5199. // 此处有错误,产品选择完工艺路线之后部件的展示跟着改了但是procedure_properties没有
  5200. if (!element.is_metal) {
  5201. element.process.forEach((elem) => {
  5202. if (elem.name == ele.title) {
  5203. elem.procedure_property = e.value;
  5204. if (!element.procedure_properties) {
  5205. element.procedure_properties = [];
  5206. }
  5207. if (!element.procedure_properties_str) {
  5208. element.procedure_properties_str = [];
  5209. }
  5210. element.procedure_properties[n] = e.value;
  5211. element.procedure_properties_str[n] = e.label;
  5212. }
  5213. });
  5214. }
  5215. });
  5216. } else {
  5217. modelData.route_id = "";
  5218. if (typeof modelData.procedure_properties == "string") {
  5219. modelData.procedure_properties = modelData.procedure_properties.split(
  5220. ","
  5221. );
  5222. }
  5223. // modelData.procedure_properties = [];
  5224. modelData.procedure_properties[ele.key - 1] = "";
  5225. }
  5226. this.$forceUpdate();
  5227. },
  5228. handleMaterialChange(val, row) {
  5229. if (val) {
  5230. let tempRow = row.material_detail_list.filter(
  5231. (item) => item.material_detail_id == val
  5232. );
  5233. row.material_detail_title = tempRow[0].title;
  5234. // row.material_detail_id = tempRow.length > 0 ? tempRow[0].id : 0
  5235. this.$forceUpdate();
  5236. }
  5237. },
  5238. handleRadioClick(row) {
  5239. row.isChoosed = !row.isChoosed;
  5240. this.$forceUpdate();
  5241. },
  5242. handlePartProcessChange(val, n, row) {
  5243. if (!row.procedure_properties) {
  5244. row.procedure_properties = [];
  5245. }
  5246. if (!row.procedure_properties_str) {
  5247. row.procedure_properties_str = [];
  5248. }
  5249. if (val) {
  5250. row.procedure_properties[n] = val.value;
  5251. row.procedure_properties_str[n] = val.label;
  5252. } else {
  5253. row.procedure_properties[n] = "";
  5254. row.procedure_properties_str[n] = "";
  5255. }
  5256. this.$forceUpdate();
  5257. },
  5258. looks(img) {
  5259. const array = [{ img_url: img }];
  5260. this.$previewImg({
  5261. list: array,
  5262. baseUrl: this.$store.state.ip,
  5263. baseImgField: "img_url",
  5264. baseTitleField: "",
  5265. });
  5266. },
  5267. delItems(n, arr) {
  5268. arr.splice(n, 1);
  5269. this.$forceUpdate();
  5270. },
  5271. changeIpt(e, row) {
  5272. if (this.info.img.length >= 3) {
  5273. return this.$Message.warning("图片最多上传3张");
  5274. }
  5275. let file = e.target.files[0];
  5276. this.postImg(file, row);
  5277. e.target.value = null;
  5278. },
  5279. postImg(file, row) {
  5280. let formData = new FormData();
  5281. formData.append("file", file);
  5282. this.axios.post("/api/upload_pic", formData).then((res) => {
  5283. row.push(res.data.url);
  5284. this.$forceUpdate();
  5285. });
  5286. },
  5287. },
  5288. };
  5289. </script>
  5290. <style lang="scss" scoped>
  5291. .product-img {
  5292. padding-top: 10px;
  5293. }
  5294. .product-add {
  5295. padding: 10px 0;
  5296. display: flex;
  5297. flex-wrap: wrap;
  5298. .ipt {
  5299. position: absolute;
  5300. width: 100%;
  5301. height: 100%;
  5302. opacity: 0;
  5303. cursor: pointer;
  5304. outline: none;
  5305. top: 0;
  5306. left: 0;
  5307. }
  5308. .add-items {
  5309. width: 120px;
  5310. height: 120px;
  5311. border: 1px dotted #e7e7e7;
  5312. border-radius: 5px;
  5313. display: flex;
  5314. justify-content: center;
  5315. align-items: center;
  5316. overflow: hidden;
  5317. position: relative;
  5318. flex-direction: column;
  5319. background: #f4f5f7;
  5320. .item {
  5321. width: 46px;
  5322. height: 46px;
  5323. background: #3764ff;
  5324. opacity: 0.6;
  5325. display: flex;
  5326. justify-content: center;
  5327. align-items: center;
  5328. border-radius: 50%;
  5329. color: #fff;
  5330. }
  5331. }
  5332. .items {
  5333. width: 120px;
  5334. height: 120px;
  5335. margin-bottom: 10px;
  5336. display: flex;
  5337. justify-content: center;
  5338. align-items: center;
  5339. background: #e7e7e7;
  5340. margin-right: 10px;
  5341. border-radius: 5px;
  5342. position: relative;
  5343. img {
  5344. max-width: 108px;
  5345. max-height: 108px;
  5346. }
  5347. }
  5348. }
  5349. .delete-img {
  5350. position: absolute;
  5351. right: 0px;
  5352. top: 0px;
  5353. color: red;
  5354. }
  5355. /deep/.ivu-tooltip-rel {
  5356. width: 200px;
  5357. overflow: hidden;
  5358. text-overflow: ellipsis;
  5359. white-space: nowrap;
  5360. }
  5361. .page-edit {
  5362. overflow: hidden;
  5363. overflow-y: auto;
  5364. position: relative;
  5365. top: 20px;
  5366. height: 85%;
  5367. padding-bottom: 20px;
  5368. /deep/ .ivu-form-item {
  5369. min-width: 300px;
  5370. }
  5371. }
  5372. .auto-width {
  5373. width: 200px;
  5374. }
  5375. .items {
  5376. // box-shadow: 0 2px 7px rgba(0, 0, 0, 0.15);
  5377. border-color: transparent;
  5378. position: relative;
  5379. border-radius: 5px;
  5380. .items-header {
  5381. padding: 10px 20px;
  5382. display: flex;
  5383. justify-content: space-between;
  5384. align-items: center;
  5385. border-bottom: 1px solid #f4f4f4;
  5386. .header-left {
  5387. span {
  5388. margin-left: 10px;
  5389. }
  5390. }
  5391. }
  5392. .form-item {
  5393. padding: 20px;
  5394. }
  5395. }
  5396. .modal-scroll {
  5397. height: 600px;
  5398. overflow: scroll;
  5399. }
  5400. .modal-items {
  5401. border-radius: 5px;
  5402. border: 1px solid #dedede;
  5403. padding: 0px 10px;
  5404. margin-bottom: 40px;
  5405. }
  5406. .modal-footer-button {
  5407. display: flex;
  5408. justify-content: flex-end;
  5409. padding: 10px 0;
  5410. }
  5411. .items-table {
  5412. width: 100%;
  5413. overflow-x: scroll;
  5414. }
  5415. /deep/ .ivu-table-wrapper {
  5416. overflow: visible;
  5417. color: red;
  5418. } //穿透iview
  5419. .original-part {
  5420. padding-top: 20px;
  5421. }
  5422. .column-li {
  5423. display: flex;
  5424. justify-content: space-between;
  5425. align-items: center;
  5426. padding: 2px 5px;
  5427. }
  5428. .hierarchy {
  5429. display: flex;
  5430. justify-content: flex-start;
  5431. align-items: flex-start;
  5432. flex-wrap: wrap;
  5433. .radio-g {
  5434. padding: 10px 0;
  5435. width: 700px;
  5436. display: flex;
  5437. justify-content: flex-start;
  5438. // align-items: flex-start;
  5439. flex-wrap: wrap;
  5440. .radio-us {
  5441. background: #f4f5f7;
  5442. padding: 5px 20px;
  5443. margin-right: 18px;
  5444. margin-bottom: 10px;
  5445. color: #999999;
  5446. border-radius: 15px;
  5447. border: 1px solid #dedede;
  5448. cursor: pointer;
  5449. }
  5450. .radio-us-foc {
  5451. color: #3764ff;
  5452. background: #fff;
  5453. border: 1px solid #3764ff;
  5454. }
  5455. }
  5456. }
  5457. .nav-product {
  5458. width: 100%;
  5459. height: 50px;
  5460. display: flex;
  5461. align-items: center;
  5462. }
  5463. /deep/.ivu-poptip-inner {
  5464. max-width: 90%;
  5465. // display: flex;
  5466. // justify-content: center;
  5467. }
  5468. /deep/.ivu-poptip-body {
  5469. max-height: 600px;
  5470. overflow: hidden;
  5471. overflow-y: auto;
  5472. }
  5473. .content {
  5474. .content_header {
  5475. display: flex;
  5476. justify-content: space-between;
  5477. padding: 0 10px;
  5478. }
  5479. }
  5480. .modal_product_info {
  5481. background-color: #f5f5f5;
  5482. border-radius: 10px;
  5483. padding: 10px;
  5484. margin-bottom: 10px;
  5485. .modal_product_info_title {
  5486. font-size: 20px;
  5487. font-weight: 700;
  5488. margin-bottom: 10px;
  5489. }
  5490. .modal_product_info_content {
  5491. .part_detail_form {
  5492. /deep/.ivu-form {
  5493. display: flex;
  5494. justify-content: flex-start;
  5495. flex-wrap: wrap;
  5496. }
  5497. /deep/ .ivu-form-item {
  5498. display: inline-block;
  5499. min-width: 150px;
  5500. }
  5501. }
  5502. }
  5503. .modal_product {
  5504. /deep/.ivu-form {
  5505. display: flex;
  5506. justify-content: flex-start;
  5507. flex-wrap: wrap;
  5508. }
  5509. /deep/ .ivu-form-item {
  5510. display: inline-block;
  5511. min-width: 200px;
  5512. }
  5513. }
  5514. .modal_parts {
  5515. /deep/.ivu-form {
  5516. display: flex;
  5517. justify-content: flex-start;
  5518. flex-wrap: wrap;
  5519. }
  5520. /deep/ .ivu-form-item {
  5521. display: inline-block;
  5522. min-width: 30px;
  5523. }
  5524. }
  5525. .modal_extra {
  5526. /deep/.ivu-form {
  5527. display: flex;
  5528. justify-content: flex-start;
  5529. flex-wrap: wrap;
  5530. }
  5531. /deep/ .ivu-form-item {
  5532. display: inline-block;
  5533. min-width: 100px;
  5534. }
  5535. }
  5536. }
  5537. /deep/.ivu-modal-body {
  5538. max-height: 800px;
  5539. }
  5540. .hide_part_detail {
  5541. display: none;
  5542. }
  5543. /deep/.ivu-form-item-content {
  5544. span {
  5545. vertical-align: middle;
  5546. }
  5547. }
  5548. </style>