edit.vue 188 KB

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