index.tsx 165 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078
  1. import { ref, reactive, computed, toRefs, nextTick, inject } from "vue";
  2. import { Table } from "@/hooks/interface";
  3. import { ColumnProps } from "@/components/LjVxeTable/interface";
  4. import { ALLOW_EDIT_STATE, sys_arry_formulatype } from "@/config/index";
  5. import { CommonDynamicSelect } from "@/api/modules/common";
  6. import { GetComputeMattress, GetMattressImportDW2, GetMattressPackagMx, GetComputeSpring } from "@/api/modules/quote";
  7. import { useUserStore } from "@/stores/modules/user";
  8. import MtrldefSelect from "@/views/system/selector/mtrldef/select.vue";
  9. import BednetSelect from "@/views/system/selector/bednet/select.vue";
  10. import { handleRowAccordingToProp, text2Formula } from "@/utils";
  11. import { ElButton, ElMessage, ElPopconfirm, ElMessageBox, ElNotification, ElTag } from "element-plus";
  12. import { Minus, Plus, InfoFilled } from "@element-plus/icons-vue";
  13. import { DwnameEnum } from "@/enums/dwnameEnum";
  14. import { isArray } from "@/utils/is";
  15. import {
  16. calculateFormula,
  17. formulaPartsFormula,
  18. floatAdd,
  19. floatMul,
  20. formatFixedNumber,
  21. autoMergeCells,
  22. formatCutNumber,
  23. formatAmount3,
  24. floatDiv
  25. } from "@/utils/index";
  26. import { cloneDeep, defaultsDeep, throttle } from "lodash-es";
  27. import { TYPE, useToast, POSITION } from "vue-toastification";
  28. import ToastFormula from "@/components/ToastWidget/Formula/index.vue";
  29. import ToastHistoryPrice from "@/components/ToastWidget/HistoryPrice/index.vue";
  30. import { useRouter } from "vue-router";
  31. import { useGlobalStore } from "@/stores/modules/global";
  32. import { storeToRefs } from "pinia";
  33. // import { title } from "process";
  34. interface defaultState {
  35. /**
  36. * @description 单据当前状态
  37. */
  38. orderStatus: string;
  39. vxeTableRef: any;
  40. LjDetailRef: any;
  41. MtrldefDialogRef: any;
  42. MtrldefDialogProps: any;
  43. BednetDialogRef: any;
  44. BednetDialogProps: any;
  45. /**
  46. * @description 面料tab页拆分
  47. */
  48. fabricMxTabList: any[];
  49. otherMxTabList: any[];
  50. /**
  51. * @description 面料当前tab页
  52. */
  53. fabricMxTabs: any;
  54. // fabricMxRef: any;
  55. fabricMxTab8Ref: any;
  56. fabricMxTab9Ref: any;
  57. fabricMxTab10Ref: any;
  58. fabricMxTab11Ref: any;
  59. fabricMxTab12Ref: any;
  60. fabricMxTab13Ref: any;
  61. bednetMxRef: any;
  62. cushionsMxRef: any;
  63. accessoriesMxRef: any;
  64. packagMxRef: any;
  65. innerClothLayerMxRef: any;
  66. topCottonMxRef: any;
  67. subSpecsRef: any;
  68. fabricMxTab8: any[];
  69. fabricMxTab9: any[];
  70. fabricMxTab10: any[];
  71. fabricMxTab11: any[];
  72. fabricMxTab12: any[];
  73. fabricMxTab13: any[];
  74. /**
  75. * @description 面料明细数据-裥大侧 新增
  76. */
  77. fabricMx10NewMtrlGroup: any[];
  78. /**
  79. * @description 面料明细数据-裥小侧 新增
  80. */
  81. fabricMx11NewMtrlGroup: any[];
  82. /**
  83. * @description 床垫类型枚举
  84. */
  85. mattresstypeEnum: any;
  86. /**
  87. * @description 原始明细数据
  88. */
  89. oriMxData: any;
  90. initParams: any;
  91. /**
  92. * @description 垫层数据
  93. */
  94. cushionsMxData: any;
  95. fabricMxData: any;
  96. /**
  97. * @description 辅料数据
  98. */
  99. accessoriesMxData: any;
  100. /**
  101. * @description 床网数据
  102. */
  103. bednetMxData: any;
  104. /**
  105. * @description 包装数据
  106. */
  107. packagMxData: any;
  108. /**
  109. * @description 公式弹窗-是否展示详细公式
  110. */
  111. showFormula: boolean;
  112. QuoteListDrawerRef: any;
  113. formulaKindEnum: any;
  114. formulaKindDcEnum: any;
  115. packtypeOptions: any;
  116. woodpallettypeOptions: any;
  117. areaOptions: any;
  118. cabinetTypeOptions: any;
  119. diancengAreaEnum: any;
  120. topCottonAddList: any;
  121. AllFormulaRef: any;
  122. LjDrawerRef: any;
  123. bednetDrawerProps: bednetDrawerPropsdata;
  124. cmpFormulas: any;
  125. cmpFormulaReplace: any;
  126. cmpFormulasOri: any;
  127. cmpFormulasBednet: any;
  128. cmpDiffer: any;
  129. specialProcessesMxRef: any;
  130. additionalCostsMxRef: any;
  131. specialProcessesMxData: any;
  132. additionalCostsMxData: any;
  133. specialProcessesMxInitData: any;
  134. additionalCostsMxInitData: any;
  135. specialProcessesEnum: any;
  136. additionalCostsEnum: any;
  137. isShowOriginFormulaMattress: boolean;
  138. columnsMx_subSpecs_dis: any[];
  139. subSpecsData: any[];
  140. }
  141. interface bednetDrawerPropsdata {
  142. deptid?: number;
  143. bednetid?: number;
  144. state?: string;
  145. }
  146. export const useHooks = (t?: any) => {
  147. const state = reactive<defaultState>({
  148. orderStatus: "",
  149. vxeTableRef: null,
  150. LjDetailRef: null,
  151. // fabricMxRef: null,
  152. fabricMxTab8Ref: null,
  153. fabricMxTab9Ref: null,
  154. fabricMxTab10Ref: null,
  155. fabricMxTab11Ref: null,
  156. fabricMxTab12Ref: null,
  157. fabricMxTab13Ref: null,
  158. MtrldefDialogRef: null,
  159. MtrldefDialogProps: {},
  160. BednetDialogRef: null,
  161. BednetDialogProps: {},
  162. fabricMxTabs: "",
  163. fabricMxTabList: [
  164. {
  165. label: "裥面",
  166. name: "tabpage_8",
  167. visible: () => Number(state.mattresstypeEnum?.if_top_side) == 1,
  168. type: [0, 80, 40, 50, 60, 70, 9000],
  169. ref: "fabricMxTab8Ref"
  170. },
  171. {
  172. label: "裥底",
  173. name: "tabpage_9",
  174. visible: () => Number(state.mattresstypeEnum?.if_button_sdie) == 1,
  175. type: [1, 81, 41, 51, 61, 71, 9001],
  176. ref: "fabricMxTab9Ref"
  177. },
  178. {
  179. label: "裥大恻",
  180. name: "tabpage_10",
  181. visible: () => Number(state.mattresstypeEnum?.if_big_side) == 1,
  182. type: [2, 82, 42, 52, 62, 72, 9002],
  183. ref: "fabricMxTab10Ref"
  184. },
  185. {
  186. label: "裥小恻",
  187. name: "tabpage_11",
  188. visible: () => Number(state.mattresstypeEnum?.if_small_side) == 1,
  189. type: [3, 83, 43, 53, 63, 73, 9003],
  190. ref: "fabricMxTab11Ref"
  191. },
  192. {
  193. label: "裥V恻",
  194. name: "tabpage_12",
  195. visible: () => Number(state.mattresstypeEnum?.if_v_side) == 1,
  196. type: [4, 84, 44, 54, 64, 74, 9004],
  197. ref: "fabricMxTab12Ref"
  198. },
  199. {
  200. label: "拉手刺绣及其他工艺",
  201. name: "tabpage_13",
  202. visible: () => true,
  203. type: [
  204. 0, 80, 40, 50, 60, 70, 1, 81, 41, 51, 61, 71, 2, 82, 42, 52, 62, 72, 3, 83, 43, 53, 63, 73, 4, 84, 44, 54, 64, 74, 9000,
  205. 9001, 9002, 9003, 9004, 9005, 9006
  206. ], // not in
  207. ref: "fabricMxTab13Ref"
  208. },
  209. {
  210. label: "床网",
  211. name: "bednetMx",
  212. ref: "bednetMxRef"
  213. },
  214. {
  215. label: "垫层",
  216. name: "cushionsMx",
  217. ref: "cushionsMxRef"
  218. },
  219. {
  220. label: "辅料",
  221. name: "accessoriesMx",
  222. ref: "accessoriesMxRef"
  223. },
  224. {
  225. label: "包装",
  226. name: "packagMx",
  227. ref: "packagMxRef"
  228. },
  229. {
  230. label: "内布套",
  231. name: "innerClothLayerMx",
  232. ref: "innerClothLayerMxRef"
  233. },
  234. {
  235. label: "顶布裥棉",
  236. name: "topCottonMx",
  237. ref: "topCottonMxRef"
  238. },
  239. {
  240. label: "特殊工艺费用",
  241. name: "specialProcesses",
  242. ref: "specialProcessesMxRef"
  243. },
  244. {
  245. label: "材料额外费用",
  246. name: "additionalCosts",
  247. ref: "additionalCostsMxRef"
  248. }
  249. ],
  250. otherMxTabList: [
  251. {
  252. label: "内布套",
  253. name: "tabpage_14",
  254. type: [101, 102, 103, 104, 105, 106]
  255. },
  256. {
  257. label: "外布套",
  258. name: "tabpage_15",
  259. type: [111, 112, 113, 114, 115, 116]
  260. }
  261. ],
  262. fabricMxTab8: [],
  263. fabricMxTab9: [],
  264. fabricMxTab10: [],
  265. fabricMxTab11: [],
  266. fabricMxTab12: [],
  267. fabricMxTab13: [],
  268. fabricMx10NewMtrlGroup: [
  269. {
  270. label: "普通大侧",
  271. value: 1
  272. },
  273. {
  274. label: "上下拼侧1",
  275. value: 2
  276. },
  277. {
  278. label: "上下拼侧2",
  279. value: 3
  280. },
  281. {
  282. label: "上下拼侧3",
  283. value: 4
  284. },
  285. {
  286. label: "左右拼侧1",
  287. value: 5
  288. },
  289. {
  290. label: "左右拼侧2",
  291. value: 6
  292. },
  293. {
  294. label: "左右拼侧3",
  295. value: 7
  296. },
  297. {
  298. label: "左右拼侧4",
  299. value: 8
  300. }
  301. ],
  302. fabricMx11NewMtrlGroup: [
  303. {
  304. label: "小侧1",
  305. value: 1
  306. },
  307. {
  308. label: "小侧1-上下拼侧1",
  309. value: 2
  310. },
  311. {
  312. label: "小侧1-上下拼侧2",
  313. value: 3
  314. },
  315. {
  316. label: "小侧1-上下拼侧3",
  317. value: 4
  318. }
  319. ],
  320. mattresstypeEnum: {},
  321. oriMxData: {},
  322. initParams: { arg_mattressid: 0 },
  323. fabricMxData: [],
  324. bednetMxData: [],
  325. cushionsMxData: [],
  326. accessoriesMxData: [],
  327. packagMxData: [],
  328. showFormula: false,
  329. QuoteListDrawerRef: null,
  330. formulaKindEnum: null,
  331. formulaKindDcEnum: null,
  332. bednetMxRef: null,
  333. cushionsMxRef: null,
  334. accessoriesMxRef: null,
  335. packagMxRef: null,
  336. innerClothLayerMxRef: null,
  337. topCottonMxRef: null,
  338. subSpecsRef: null,
  339. packtypeOptions: [
  340. {
  341. label: "压包",
  342. value: 0
  343. },
  344. {
  345. label: "卷包",
  346. value: 1
  347. },
  348. {
  349. label: "国内",
  350. value: 2
  351. }
  352. ],
  353. woodpallettypeOptions: [
  354. {
  355. label: "普通木托",
  356. value: 0
  357. },
  358. {
  359. label: "夹板木托",
  360. value: 1
  361. },
  362. {
  363. label: "铁管木托",
  364. value: 2
  365. }
  366. ],
  367. areaOptions: [
  368. {
  369. label: "普通地区",
  370. value: "普通地区"
  371. },
  372. {
  373. label: "特定地区",
  374. value: "特定地区"
  375. }
  376. ],
  377. cabinetTypeOptions: [
  378. {
  379. label: "大柜",
  380. value: "大柜"
  381. },
  382. {
  383. label: "小柜",
  384. value: "小柜"
  385. }
  386. ],
  387. diancengAreaEnum: [],
  388. topCottonAddList: [],
  389. AllFormulaRef: null,
  390. LjDrawerRef: null,
  391. bednetDrawerProps: {},
  392. cmpFormulas: [],
  393. cmpFormulaReplace: [],
  394. cmpFormulasOri: [],
  395. cmpFormulasBednet: [],
  396. cmpDiffer: [],
  397. specialProcessesMxRef: null,
  398. additionalCostsMxRef: null,
  399. specialProcessesMxData: [],
  400. additionalCostsMxData: [],
  401. specialProcessesMxInitData: [],
  402. additionalCostsMxInitData: [],
  403. specialProcessesEnum: [],
  404. additionalCostsEnum: [],
  405. isShowOriginFormulaMattress: false,
  406. columnsMx_subSpecs_dis: [],
  407. subSpecsData: []
  408. });
  409. const router = useRouter();
  410. /**
  411. * @description 面料分类取值
  412. */
  413. const mtrltypeTabList = [
  414. {
  415. label: "选布料",
  416. formulakinds: [0, 1, 2, 3, 4, 101, 111],
  417. value: 3
  418. },
  419. {
  420. label: "喷胶绵",
  421. formulakinds: [40, 41, 42, 43, 44, 102, 112],
  422. value: 5
  423. },
  424. {
  425. label: "裥绵海绵",
  426. formulakinds: [50, 51, 52, 53, 54, 103, 113],
  427. value: 4
  428. },
  429. {
  430. label: "无纺布",
  431. formulakinds: [60, 61, 62, 63, 64, 104, 114],
  432. value: 30
  433. },
  434. {
  435. label: "裥花图案",
  436. formulakinds: [70, 71, 72, 73, 74, 105, 115],
  437. value: 26
  438. },
  439. {
  440. label: "布料-加工工艺",
  441. formulakinds: [80, 81, 82, 83, 84, 106, 116],
  442. value: 15
  443. },
  444. {
  445. label: "拉手",
  446. formulakinds: [5],
  447. value: 10
  448. },
  449. {
  450. label: "刺绣",
  451. formulakinds: [6],
  452. value: 11
  453. },
  454. {
  455. label: "大侧*压布",
  456. formulakinds: [7],
  457. value: 3
  458. },
  459. {
  460. label: "大侧*边带",
  461. formulakinds: [8, 9],
  462. value: 9
  463. },
  464. {
  465. label: "大侧*上下压线",
  466. formulakinds: [10],
  467. value: 12
  468. },
  469. {
  470. label: "垫层",
  471. formulakinds: [11, 32, 33],
  472. value: 6
  473. },
  474. {
  475. label: "顶布",
  476. formulakinds: [12],
  477. value: 3
  478. },
  479. {
  480. label: "毡类",
  481. formulakinds: [13],
  482. value: 7
  483. },
  484. {
  485. label: "打底无纺布",
  486. formulakinds: [14],
  487. value: 2
  488. },
  489. {
  490. label: "辅料",
  491. formulakinds: [15],
  492. value: 8
  493. },
  494. {
  495. label: "PE",
  496. formulakinds: [16],
  497. value: 16
  498. },
  499. {
  500. label: "外层PE",
  501. formulakinds: [17],
  502. value: 17
  503. },
  504. {
  505. label: "PVC",
  506. formulakinds: [18],
  507. value: 18
  508. },
  509. {
  510. label: "卷包包装",
  511. formulakinds: [19],
  512. value: 19
  513. },
  514. {
  515. label: "牛皮纸袋",
  516. formulakinds: [20],
  517. value: 20
  518. },
  519. {
  520. label: "蓝色PE护角",
  521. formulakinds: [21],
  522. value: 21
  523. },
  524. {
  525. label: "无纺布袋",
  526. formulakinds: [22],
  527. value: 22
  528. },
  529. {
  530. label: "牛皮袋护角",
  531. formulakinds: [23],
  532. value: 23
  533. },
  534. {
  535. label: "编织袋",
  536. formulakinds: [24],
  537. value: 24
  538. },
  539. {
  540. label: "外袋",
  541. formulakinds: [25],
  542. value: 13
  543. },
  544. {
  545. label: "内袋",
  546. formulakinds: [26],
  547. value: 14
  548. },
  549. {
  550. label: "无拉手脚轮",
  551. formulakinds: [27],
  552. value: -1
  553. },
  554. {
  555. label: "拉钮",
  556. formulakinds: [28],
  557. value: -1
  558. },
  559. {
  560. label: "网面布料",
  561. formulakinds: [29],
  562. value: -1
  563. },
  564. {
  565. label: "防火线",
  566. formulakinds: [30],
  567. value: 32
  568. },
  569. {
  570. label: "木托",
  571. formulakinds: [31],
  572. value: -1
  573. },
  574. {
  575. label: "床网",
  576. formulakinds: [99],
  577. value: -1
  578. },
  579. {
  580. label: "拉链",
  581. formulakinds: [202],
  582. value: 31
  583. },
  584. {
  585. label: "席垫",
  586. formulakinds: [203],
  587. value: 32
  588. },
  589. {
  590. label: "车花边",
  591. formulakinds: [205],
  592. value: 32
  593. },
  594. {
  595. label: "骨条",
  596. formulakinds: [206],
  597. value: 33
  598. }
  599. ];
  600. /**
  601. * @description 包装
  602. */
  603. const mtrltypeTabList_packag = [
  604. {
  605. label: "选布料",
  606. formulakinds: [0, 1, 2, 3, 4],
  607. value: 3
  608. },
  609. {
  610. label: "喷胶绵",
  611. formulakinds: [40, 41, 42, 43, 44],
  612. value: 5
  613. },
  614. {
  615. label: "裥绵海绵",
  616. formulakinds: [50, 51, 52, 53, 54],
  617. value: 4
  618. },
  619. {
  620. label: "无纺布",
  621. formulakinds: [60, 61, 62, 63, 64],
  622. value: 2
  623. },
  624. {
  625. label: "裥花图案",
  626. formulakinds: [70, 71, 72, 73, 74],
  627. value: 4
  628. },
  629. {
  630. label: "布料-加工工艺",
  631. formulakinds: [80, 81, 82, 83, 84],
  632. value: 15
  633. },
  634. {
  635. label: "拉手",
  636. formulakinds: [5],
  637. value: 10
  638. },
  639. {
  640. label: "刺绣",
  641. formulakinds: [6],
  642. value: 11
  643. },
  644. {
  645. label: "大侧*压布",
  646. formulakinds: [7],
  647. value: 2
  648. },
  649. {
  650. label: "大侧*边带",
  651. formulakinds: [8, 9],
  652. value: 9
  653. },
  654. {
  655. label: "大侧*上下压线",
  656. formulakinds: [10],
  657. value: 12
  658. },
  659. {
  660. label: "垫层",
  661. formulakinds: [11, 32, 33],
  662. value: 6
  663. },
  664. {
  665. label: "顶布",
  666. formulakinds: [12],
  667. value: 3
  668. },
  669. {
  670. label: "毡类",
  671. formulakinds: [13],
  672. value: 7
  673. },
  674. {
  675. label: "打底无纺布",
  676. formulakinds: [14],
  677. value: 2
  678. },
  679. {
  680. label: "辅料",
  681. formulakinds: [15],
  682. value: 8
  683. },
  684. {
  685. label: "PE",
  686. formulakinds: [16],
  687. value: 16
  688. },
  689. {
  690. label: "外层PE",
  691. formulakinds: [17],
  692. value: 17
  693. },
  694. {
  695. label: "PVC",
  696. formulakinds: [18],
  697. value: 18
  698. },
  699. {
  700. label: "卷包包装",
  701. formulakinds: [19],
  702. value: 19
  703. },
  704. {
  705. label: "牛皮纸袋",
  706. formulakinds: [20],
  707. value: 20
  708. },
  709. {
  710. label: "蓝色PE护角",
  711. formulakinds: [21],
  712. value: 21
  713. },
  714. {
  715. label: "无纺布袋",
  716. formulakinds: [22],
  717. value: 22
  718. },
  719. {
  720. label: "牛皮袋护角",
  721. formulakinds: [23],
  722. value: 23
  723. },
  724. {
  725. label: "编织袋",
  726. formulakinds: [24],
  727. value: 24
  728. },
  729. {
  730. label: "外袋",
  731. formulakinds: [25],
  732. value: 13
  733. },
  734. {
  735. label: "内袋",
  736. formulakinds: [26],
  737. value: 14
  738. },
  739. {
  740. label: "无拉手脚轮",
  741. formulakinds: [27],
  742. value: 19
  743. },
  744. {
  745. label: "拉钮",
  746. formulakinds: [28],
  747. value: -1
  748. },
  749. {
  750. label: "网面布料",
  751. formulakinds: [29],
  752. value: -1
  753. },
  754. {
  755. label: "防火线",
  756. formulakinds: [30],
  757. value: -1
  758. },
  759. {
  760. label: "木托",
  761. formulakinds: [31],
  762. value: 28
  763. },
  764. {
  765. label: "无纺布护角",
  766. formulakinds: [201],
  767. value: 27
  768. },
  769. {
  770. label: "床网",
  771. formulakinds: [99],
  772. value: -1
  773. }
  774. ];
  775. /**
  776. * @description 垫层
  777. */
  778. const mtrltypeTabList_cushions = [
  779. {
  780. label: "垫层",
  781. formulakinds: [11, 32, 33],
  782. value: 6
  783. },
  784. {
  785. label: "顶布",
  786. formulakinds: [12],
  787. value: 29
  788. },
  789. {
  790. label: "毡类",
  791. formulakinds: [13, 35],
  792. value: 7
  793. },
  794. {
  795. label: "打底无纺布",
  796. formulakinds: [14],
  797. value: 2
  798. },
  799. {
  800. label: "网面布料",
  801. formulakinds: [29],
  802. value: 3
  803. },
  804. {
  805. label: "顶布裥棉",
  806. formulakinds: [1201],
  807. value: 1201
  808. }
  809. ];
  810. /**
  811. * @description 辅料
  812. */
  813. const mtrltypeTabList_accessories = [
  814. {
  815. label: "辅料",
  816. formulakinds: [15],
  817. value: 8
  818. }
  819. ];
  820. /**
  821. * @description 内布套
  822. */
  823. const mtrltypeTabList_inner = [
  824. {
  825. label: "选布料",
  826. formulakinds: [0, 1, 2, 3, 4, 101, 111],
  827. value: 3
  828. },
  829. {
  830. label: "喷胶绵",
  831. formulakinds: [40, 41, 42, 43, 44, 102, 112],
  832. value: 5
  833. },
  834. {
  835. label: "裥绵海绵",
  836. formulakinds: [50, 51, 52, 53, 54, 103, 113],
  837. value: 4
  838. },
  839. {
  840. label: "无纺布",
  841. formulakinds: [60, 61, 62, 63, 64, 104, 114],
  842. value: 200
  843. },
  844. {
  845. label: "裥花图案",
  846. formulakinds: [70, 71, 72, 73, 74, 105, 115],
  847. value: 26
  848. },
  849. {
  850. label: "布料-加工工艺",
  851. formulakinds: [80, 81, 82, 83, 84, 106, 116],
  852. value: 15
  853. },
  854. {
  855. label: "拉手",
  856. formulakinds: [5],
  857. value: 10
  858. },
  859. {
  860. label: "刺绣",
  861. formulakinds: [6],
  862. value: 11
  863. },
  864. {
  865. label: "大侧*压布",
  866. formulakinds: [7],
  867. value: 2
  868. },
  869. {
  870. label: "大侧*边带",
  871. formulakinds: [8, 9],
  872. value: 9
  873. },
  874. {
  875. label: "大侧*上下压线",
  876. formulakinds: [10],
  877. value: 12
  878. },
  879. {
  880. label: "垫层",
  881. formulakinds: [11, 32, 33],
  882. value: 6
  883. },
  884. {
  885. label: "顶布",
  886. formulakinds: [12],
  887. value: 3
  888. },
  889. {
  890. label: "毡类",
  891. formulakinds: [13],
  892. value: 7
  893. },
  894. {
  895. label: "打底无纺布",
  896. formulakinds: [14],
  897. value: 2
  898. },
  899. {
  900. label: "辅料",
  901. formulakinds: [15],
  902. value: 8
  903. },
  904. {
  905. label: "PE",
  906. formulakinds: [16],
  907. value: 16
  908. },
  909. {
  910. label: "外层PE",
  911. formulakinds: [17],
  912. value: 17
  913. },
  914. {
  915. label: "PVC",
  916. formulakinds: [18],
  917. value: 18
  918. },
  919. {
  920. label: "卷包包装",
  921. formulakinds: [19],
  922. value: 19
  923. },
  924. {
  925. label: "牛皮纸袋",
  926. formulakinds: [20],
  927. value: 20
  928. },
  929. {
  930. label: "蓝色PE护角",
  931. formulakinds: [21],
  932. value: 21
  933. },
  934. {
  935. label: "无纺布袋",
  936. formulakinds: [22],
  937. value: 22
  938. },
  939. {
  940. label: "牛皮袋护角",
  941. formulakinds: [23],
  942. value: 23
  943. },
  944. {
  945. label: "编织袋",
  946. formulakinds: [24],
  947. value: 24
  948. },
  949. {
  950. label: "外袋",
  951. formulakinds: [25],
  952. value: 13
  953. },
  954. {
  955. label: "内袋",
  956. formulakinds: [26],
  957. value: 14
  958. },
  959. {
  960. label: "无拉手脚轮",
  961. formulakinds: [27],
  962. value: -1
  963. },
  964. {
  965. label: "拉钮",
  966. formulakinds: [28],
  967. value: -1
  968. },
  969. {
  970. label: "网面布料",
  971. formulakinds: [29],
  972. value: -1
  973. },
  974. {
  975. label: "防火线",
  976. formulakinds: [30],
  977. value: -1
  978. },
  979. {
  980. label: "木托",
  981. formulakinds: [31],
  982. value: -1
  983. },
  984. {
  985. label: "床网",
  986. formulakinds: [99],
  987. value: -1
  988. },
  989. {
  990. label: "拉链",
  991. formulakinds: [202],
  992. value: 31
  993. },
  994. {
  995. label: "边带",
  996. formulakinds: [203],
  997. value: 9
  998. }
  999. ];
  1000. const { userInfo } = useUserStore();
  1001. state.orderStatus = inject("orderStatus", "");
  1002. const getData_mx = (params: any) => {
  1003. console.log("getData params :>> ", params);
  1004. let newParams: any = {};
  1005. params.pageNum && (newParams.pageindex = params.pageNum);
  1006. params.pageSize && (newParams.pagesize = params.pageSize);
  1007. delete params.pageNum;
  1008. delete params.pageSize;
  1009. newParams.queryParams = params;
  1010. console.log("params :>> ", params);
  1011. newParams.dsname = "web_mattress_mx";
  1012. return CommonDynamicSelect(newParams, DwnameEnum.mattressQuoteMx);
  1013. // return [];
  1014. };
  1015. const dataCallback = (data: any) => {
  1016. console.log("dataCallback data :>> ", data);
  1017. if (data.datatable.length > 0) {
  1018. data.datatable = data.datatable.map((item: any) => {
  1019. item.dannum_rate = Number(item.dannum_rate);
  1020. // item.if_w_butao = Boolean(Number(item.if_w_butao));
  1021. return item;
  1022. });
  1023. }
  1024. return {
  1025. list: data.datatable,
  1026. tableinfo: data.tableinfo,
  1027. total: data.totalcnt,
  1028. pageNum: data.pageindex,
  1029. pageSize: data.pagesize
  1030. };
  1031. };
  1032. const dataCallbackMx = (data: any) => {
  1033. console.log("dataCallback data :>> ", data);
  1034. return {
  1035. list: data.datatable,
  1036. tableinfo: data.tableinfo,
  1037. total: data.totalcnt,
  1038. pageNum: data.pageindex,
  1039. pageSize: data.pagesize
  1040. };
  1041. };
  1042. const funcTaxrateChange = async (val: any, data) => {
  1043. data.taxrate = val;
  1044. };
  1045. /**
  1046. * @description 弹窗模块:床网选择
  1047. * @param data 当前数据
  1048. * @param status 当前订单状态
  1049. * @returns Promise
  1050. */
  1051. const fModelChoseBednet = (data: any, params: any, $table?: any) => {
  1052. return new Promise((resolve, reject) => {
  1053. // if (!ALLOW_EDIT_STATE.includes(status)) return;
  1054. let _params = {
  1055. ...params,
  1056. keyword: ""
  1057. };
  1058. state.BednetDialogProps = {
  1059. onSubmit: (res: any) => {
  1060. // submit
  1061. console.log("openCustDialog res", res);
  1062. nextTick(() => {
  1063. rModelSetBednet(data, res.value[0], $table);
  1064. resolve(1);
  1065. });
  1066. },
  1067. onCancel: (error: any) => {
  1068. // cancel 回调
  1069. console.log("openCustDialog error", error);
  1070. }
  1071. };
  1072. state.BednetDialogRef.show(_params);
  1073. });
  1074. };
  1075. /**
  1076. * @description 在床网tab,更新垫层的床网厚度信息
  1077. * @param data 床网明细信息
  1078. * @param item 床网信息
  1079. * @param action 动作,add,set,del,clear
  1080. */
  1081. const wf_rtr_cwdc = async (data: any, item: any, action: string) => {
  1082. const $table = state.cushionsMxRef.element;
  1083. let { visibleData } = $table.getTableData();
  1084. console.log("wf_rtr_cwdc data :>> ", data, visibleData, item, action);
  1085. // fullData.map(item => {
  1086. // if (Number(item.formulakind) == 999 && Number(item.thickness) == 0) {
  1087. // $table.setRow(item, {
  1088. // thickness: data.bednet_height,
  1089. // qty: 1
  1090. // });
  1091. // }
  1092. // });
  1093. const $tableBednet = state.bednetMxRef.element;
  1094. let currentBednetIndex = $tableBednet.getRowSeq(data);
  1095. if (action == "add") {
  1096. let cushionItem = visibleData.find(o => o.formulakind == 999);
  1097. let records = cloneDeep(cushionItem ?? {});
  1098. if (!records?.chastr) {
  1099. records.chastr = state.diancengAreaEnum[0].value;
  1100. records.formulakind = 999;
  1101. }
  1102. records.thickness = 0;
  1103. records.qty = 0;
  1104. records._X_ROW_KEY = "";
  1105. records.mattressmxid = 0;
  1106. if (item) {
  1107. records.thickness = item?.bednet_height;
  1108. records.qty = 1;
  1109. }
  1110. let bednetList = visibleData.filter(o => Number(o.formulakind) == 999);
  1111. let lastIndex = bednetList.length > 0 ? $table.getRowSeq(bednetList[bednetList.length - 1]) : -1;
  1112. console.log("wf_rtr_cwdc lastIndex :>> ", bednetList, lastIndex, records);
  1113. let _index = visibleData.length > lastIndex ? lastIndex : -1;
  1114. console.log("wf_rtr_cwdc $table :>> ", $table, visibleData.length, _index);
  1115. $table.insertNextAt(records, _index);
  1116. } else {
  1117. console.log("wf_rtr_cwdc currentBednetIndex :>> ", action, currentBednetIndex);
  1118. if (action == "set") {
  1119. let idx = 1;
  1120. let _match = false;
  1121. visibleData.map(o => {
  1122. if (Number(o.formulakind) == 999) {
  1123. if (idx == currentBednetIndex) {
  1124. _match = true;
  1125. }
  1126. idx++;
  1127. }
  1128. });
  1129. if (!_match) {
  1130. await wf_rtr_cwdc(data, null, "add");
  1131. }
  1132. }
  1133. let { visibleData: afterVisibleData } = $table.getTableData();
  1134. let index = 1;
  1135. console.log("after add set", afterVisibleData, item);
  1136. afterVisibleData.map(o => {
  1137. if (Number(o.formulakind) == 999) {
  1138. if (index == currentBednetIndex) {
  1139. if (action == "set") {
  1140. console.log("after add o :>> ", currentBednetIndex, o);
  1141. $table.setRow(o, {
  1142. thickness: item?.bednet_height,
  1143. qty: 1
  1144. });
  1145. } else if (action == "clear") {
  1146. $table.setRow(o, {
  1147. thickness: 0,
  1148. qty: 0
  1149. });
  1150. } else if (action == "del") {
  1151. $table.remove(o);
  1152. }
  1153. }
  1154. index++;
  1155. }
  1156. });
  1157. }
  1158. };
  1159. /**
  1160. * @description 更新床网tab的垫层床网信息
  1161. * @param data 垫层明细信息
  1162. */
  1163. const wf_rtr_bednet = (data: any) => {
  1164. console.log("wf_rtr_bednet data :>> ", data);
  1165. const $table = state.cushionsMxRef.element;
  1166. let { visibleData } = $table.getTableData();
  1167. let currentcushionsIndex = $table.getRowSeq(data);
  1168. console.log("currentcushionsIndex :>> ", currentcushionsIndex);
  1169. const $tableBednet = state.bednetMxRef.element;
  1170. let { visibleData: visibleData_bednet } = $tableBednet.getTableData();
  1171. let currentBednetIndex = 0;
  1172. let index = 0;
  1173. visibleData.map((o, idx) => {
  1174. if (Number(o.formulakind) == 999) {
  1175. if (idx + 1 == currentcushionsIndex) {
  1176. currentBednetIndex = index;
  1177. }
  1178. index++;
  1179. }
  1180. });
  1181. console.log("wf_rtr_bednet currentBednetIndex :>> ", currentBednetIndex);
  1182. if (visibleData_bednet.length == 1) {
  1183. visibleData_bednet[0].mtrlid = 0;
  1184. visibleData_bednet[0].mtrlname = "";
  1185. visibleData_bednet[0].price = 0;
  1186. $tableBednet.reloadData(visibleData_bednet);
  1187. } else {
  1188. funcDelMtrlMx({ row: visibleData_bednet[currentBednetIndex], data: visibleData_bednet }, "bednetMxRef");
  1189. }
  1190. // 床网与主副规格互联
  1191. nextTick(() => {
  1192. updateSubspecsTable();
  1193. });
  1194. };
  1195. /**
  1196. * @description 垫层tab,公式名选择,联动增删床网tab
  1197. * @param val
  1198. * @param lastVal
  1199. * @param scope
  1200. */
  1201. const cushionsFormulaKindChange = (val: any, lastVal: any, scope: any) => {
  1202. console.log("wf_rtr_cwdc cushionsFormulaKindChange val :>> ", val, lastVal, scope);
  1203. const $table = state.cushionsMxRef.element;
  1204. const $table_bednet = state.bednetMxRef.element;
  1205. const { visibleData } = $table.getTableData();
  1206. if (Number(val) === 999 && Number(lastVal) !== 999) {
  1207. // 新增
  1208. if ($table_bednet) {
  1209. const { visibleData: visibleData_bednet } = $table_bednet.getTableData();
  1210. let curIndex = visibleData_bednet.length - 1;
  1211. // 寻找垫层当前位置,对上一个床网行位置进行复制
  1212. let arr = visibleData.filter((t, i) => t.formulakind == 999 && i < scope.$rowIndex);
  1213. if (arr.length > 0) {
  1214. curIndex = arr.length - 1;
  1215. }
  1216. console.log("wf_rtr_cwdc curIndex :>> ", curIndex);
  1217. rModelClearMtrl(scope.row);
  1218. funcAddMtrlMx({ row: visibleData_bednet[curIndex] }, null, "bednetMxRef", arr.length == 0);
  1219. // 床网与主副规格互联
  1220. nextTick(() => {
  1221. updateSubspecsTable();
  1222. });
  1223. }
  1224. } else if (Number(val) !== 999 && Number(lastVal) === 999) {
  1225. // 删除
  1226. if ($table_bednet) {
  1227. const { visibleData: visibleData_bednet } = $table_bednet.getTableData();
  1228. let curIndex = visibleData_bednet.length - 1;
  1229. curIndex = visibleData
  1230. .filter(t => t.formulakind == 999 || t._X_ROW_KEY === scope.row._X_ROW_KEY)
  1231. .findIndex(t => t._X_ROW_KEY === scope.row._X_ROW_KEY);
  1232. console.log("wf_rtr_cwdc curIndex :>> ", curIndex);
  1233. if (visibleData_bednet.length == 1) {
  1234. ElMessage.warning("不能全部删除,至少保留一个床网");
  1235. scope.row.formulakind = 999;
  1236. return false;
  1237. }
  1238. rModelClearMtrl(scope.row);
  1239. funcDelBednet({ row: visibleData_bednet[curIndex], data: visibleData_bednet }, null, "bednetMxRef");
  1240. // 床网与主副规格互联
  1241. nextTick(() => {
  1242. updateSubspecsTable();
  1243. });
  1244. }
  1245. } else {
  1246. rModelClearMtrl(scope.row);
  1247. }
  1248. };
  1249. const rModelSetBednet = (data: any, item: any, $table?: any) => {
  1250. console.log("rModelSetBednet data :>> ", data, item);
  1251. if (item) {
  1252. let _mtrlname =
  1253. item.typename +
  1254. " " +
  1255. item.bednetcode +
  1256. " " +
  1257. item.mattress_width +
  1258. "*" +
  1259. item.mattress_length +
  1260. "*" +
  1261. item.mattress_height;
  1262. data.mtrlid = item.bednetid;
  1263. data.mtrlname = _mtrlname;
  1264. // data.price = item.nottax_factory_cost;
  1265. data.price = item.total_cost;
  1266. data.qty = 1;
  1267. wf_rtr_cwdc(data, item, "set");
  1268. if ($table) {
  1269. $table.clearEdit();
  1270. nextTick(() => {
  1271. $table.setActiveRow(data);
  1272. // 床网与主副规格互联
  1273. updateSubspecsTable();
  1274. });
  1275. }
  1276. }
  1277. };
  1278. const rModelClearBednet = (data: any, $table?: any) => {
  1279. console.log("rModelSetBednet data :>> ", data);
  1280. data.mtrlid = 0;
  1281. data.mtrlname = "";
  1282. data.price = 0;
  1283. wf_rtr_cwdc(data, null, "clear");
  1284. if ($table) {
  1285. $table.clearEdit();
  1286. nextTick(() => {
  1287. // 床网与主副规格互联
  1288. updateSubspecsTable();
  1289. });
  1290. }
  1291. };
  1292. /**
  1293. * @description 弹窗模块:物料选择
  1294. * @param data 当前数据
  1295. * @param status 当前订单状态
  1296. * @returns Promise
  1297. */
  1298. const fModelChoseMtrl = (data: any, params: any, cb: any, label?: string, $table?: any) => {
  1299. return new Promise((resolve, reject) => {
  1300. // if (!ALLOW_EDIT_STATE.includes(status)) return;
  1301. let _params = {
  1302. keyword: "",
  1303. arg_mtrltype: params.mtrltype,
  1304. arg_pricelistid: params.pricelistid
  1305. };
  1306. state.MtrldefDialogProps = {
  1307. onSubmit: (res: any) => {
  1308. // submit
  1309. console.log("openCustDialog res", res);
  1310. nextTick(() => {
  1311. cb(data, res.value[0], $table);
  1312. resolve(1);
  1313. });
  1314. },
  1315. onCancel: (error: any) => {
  1316. // cancel 回调
  1317. console.log("openCustDialog error", error);
  1318. }
  1319. };
  1320. state.MtrldefDialogRef.show(_params, label);
  1321. });
  1322. };
  1323. /**
  1324. * @description 数据赋值:物料信息
  1325. * @param data 当前数据
  1326. * @param item 当前选择的数据
  1327. */
  1328. const rModelSetMtrl = (data: any, item: any, $table?: any) => {
  1329. console.log("rModelSetMtrl data :>> ", data);
  1330. console.log("rModelSetMtrl item :>> ", item);
  1331. if (item) {
  1332. data.mattressid = state.LjDetailRef._mainData.mattressid;
  1333. data.mattressmxid = 0;
  1334. data.mtrlid = item.mtrlid;
  1335. data.price = item.pricelistprice;
  1336. data.gram_weight = item.gram_weight;
  1337. data.cloth_width = item.cloth_width;
  1338. data.if_inputqty = Number(item.if_inputqty);
  1339. data.if_areaprice = item.if_areaprice;
  1340. data.if_subspecs = item.if_subspecs;
  1341. data.mtrlname = item.mtrlname;
  1342. data.priceunit = item.priceunit;
  1343. data.shrinkage = item.price; // 收缩率
  1344. if (item.if_inputqty == 1 || Number(data.thickness) == 0) {
  1345. data.thickness = Number(item.thickness);
  1346. }
  1347. data.price_formula = item.price_formula;
  1348. let _qty = 1;
  1349. if (data.formulakind == 5) {
  1350. //默认4个拉手
  1351. _qty = 4;
  1352. } else if ([7, 8, 9, 202].includes(data.formulakind)) {
  1353. // 拉手刺绣及其他工艺,大侧压压布、拉链等自动带出数量=周长
  1354. let mattress_width = state.LjDetailRef._mainData.mattress_width ?? 0;
  1355. let mattress_length = state.LjDetailRef._mainData.mattress_length ?? 0;
  1356. _qty = (mattress_width / 100 + mattress_length / 100) * 2;
  1357. }
  1358. data.qty = _qty;
  1359. // cb && cb();
  1360. if ($table) {
  1361. $table.clearEdit();
  1362. nextTick(() => {
  1363. $table.setActiveRow(data);
  1364. console.log("rModelSetMtrl data.formulatype == 99 :>> ", data.formulatype == 1);
  1365. if (data.formulatype == 1) {
  1366. // 床网与主副规格互联
  1367. updateSubspecsTable();
  1368. }
  1369. autoLoadMtrlExtra(item, state.specialProcessesMxRef);
  1370. });
  1371. }
  1372. }
  1373. };
  1374. const rModelClearMtrl = (data: any, $table?: any) => {
  1375. console.log("rModelClearMtrl data :>> ", data);
  1376. data.mattressid = state.LjDetailRef._mainData.mattressid;
  1377. data.mattressmxid = 0;
  1378. data.mtrlid = 0;
  1379. data.price = 0;
  1380. data.gram_weight = 0;
  1381. data.cloth_width = 0;
  1382. data.if_inputqty = 0;
  1383. data.if_areaprice = 0;
  1384. data.if_subspecs = 0;
  1385. data.mtrlname = "";
  1386. data.priceunit = "";
  1387. data.shrinkage = 0;
  1388. data.thickness = 0;
  1389. data.price_formula = "";
  1390. data.qty = "";
  1391. if ($table) {
  1392. $table.clearEdit();
  1393. console.log("rModelClearMtrl data.formulatype == 99 :>> ", data.formulatype == 1);
  1394. nextTick(() => {
  1395. if (data.formulatype == 1) {
  1396. // 床网与主副规格互联
  1397. updateSubspecsTable();
  1398. }
  1399. });
  1400. }
  1401. };
  1402. /**
  1403. * @description 数据赋值:物料信息
  1404. * @param data 当前数据
  1405. * @param item 当前选择的数据
  1406. */
  1407. const rModelSetMtrlInner = (data: any, item: any, $table?: any) => {
  1408. console.log("rModelSetMtrl data :>> ", data);
  1409. console.log("rModelSetMtrl item :>> ", item);
  1410. if (item) {
  1411. data.mattressid = state.LjDetailRef._mainData.mattressid;
  1412. data.mattressmxid = 0;
  1413. data.mtrlid = item.mtrlid;
  1414. data.price = item.pricelistprice;
  1415. data.gram_weight = item.gram_weight;
  1416. data.cloth_width = item.cloth_width;
  1417. data.if_inputqty = Number(item.if_inputqty);
  1418. data.if_areaprice = item.if_areaprice;
  1419. data.mtrlname = item.mtrlname;
  1420. data.priceunit = item.priceunit;
  1421. data.shrinkage = item.price; // 收缩率
  1422. if (item.if_inputqty == 1 || Number(data.thickness) == 0) {
  1423. data.thickness = Number(item.thickness);
  1424. }
  1425. item?.price_formula != "" && (data.price_formula = item.price_formula);
  1426. let _qty = 1;
  1427. if (data.formulakind == 5) {
  1428. //默认4个拉手
  1429. _qty = 4;
  1430. } else if ([7, 8, 9, 30, 202, 203].includes(data.formulakind)) {
  1431. // 拉手刺绣及其他工艺,大侧压压布7、大侧压边带8、大侧压织带9、防火线30、拉链202、内布套围边边带203,自动带出数量=周长
  1432. let mattress_width = state.LjDetailRef._mainData.mattress_width ?? 0;
  1433. let mattress_length = state.LjDetailRef._mainData.mattress_length ?? 0;
  1434. _qty = (mattress_width / 100 + mattress_length / 100) * 2;
  1435. }
  1436. data.qty = _qty;
  1437. if ($table) {
  1438. $table.clearEdit();
  1439. nextTick(() => {
  1440. $table.setActiveRow(data);
  1441. });
  1442. }
  1443. }
  1444. };
  1445. /**
  1446. * @description 面料-裥大、小侧,增加物料
  1447. */
  1448. const funcAddMxSide = async (params: any, data: any, targetRef?: any) => {
  1449. // arg_array_formulakind
  1450. let newParams: any = {};
  1451. newParams.queryParams = params;
  1452. newParams.dsname = "web_mattress_formulalist";
  1453. let res = await CommonDynamicSelect(newParams);
  1454. console.log("funcAddBigSide res :>> ", res);
  1455. if (res.datatable) {
  1456. if (targetRef) {
  1457. const $table = targetRef.element;
  1458. if ($table) {
  1459. res.datatable.map(itm => {
  1460. let records: any = {
  1461. formulatype: itm.formulatype,
  1462. if_mtrl: Number(itm.if_mtrl),
  1463. formulaid: itm.formulaid,
  1464. sortcode: data.label,
  1465. chastr: data.label,
  1466. costamt: 0,
  1467. formulakind: Number(itm.formulakind),
  1468. formula: itm.formula,
  1469. useformula: itm.useformula,
  1470. gydscrp: itm.gydscrp
  1471. };
  1472. if (records.if_mtrl > 1) {
  1473. records.addmx = "+";
  1474. records.delmx = "-";
  1475. }
  1476. $table.insertAt(records, -1);
  1477. });
  1478. }
  1479. } else {
  1480. let arr = [];
  1481. res.datatable.map(itm => {
  1482. let records: any = {
  1483. formulatype: itm.formulatype,
  1484. if_mtrl: Number(itm.if_mtrl),
  1485. formulaid: itm.formulaid,
  1486. sortcode: data.label,
  1487. chastr: data.label,
  1488. costamt: 0,
  1489. formulakind: Number(itm.formulakind),
  1490. formula: itm.formula,
  1491. useformula: itm.useformula,
  1492. gydscrp: itm.gydscrp
  1493. };
  1494. if (records.if_mtrl > 1) {
  1495. records.addmx = "+";
  1496. records.delmx = "-";
  1497. }
  1498. arr.push(records);
  1499. });
  1500. return arr;
  1501. }
  1502. } else {
  1503. return [];
  1504. }
  1505. };
  1506. const wf_mtrl_find = async (params: any) => {
  1507. let _params: any = {
  1508. dsname: "web_mtrl_choose",
  1509. queryparams: params
  1510. };
  1511. let res = await CommonDynamicSelect(_params);
  1512. if (res?.datatable?.length) {
  1513. return res?.datatable;
  1514. } else {
  1515. return [];
  1516. }
  1517. };
  1518. // /**
  1519. // * @description 垫层配置 和 垫层可选项
  1520. // * @author w_mattress_add wf_add_dianceng_bytype
  1521. // */
  1522. // const wf_add_dianceng_bytype = (dianceng_sort: string) => {
  1523. // let newMxData = [];
  1524. // let _diancengSortStr = dianceng_sort.replace(/,/g, ",").replace(/~r~n/g, "").replace(/~r/g, "").replace(/~n/g, "");
  1525. // let arr = _diancengSortStr.split("/");
  1526. // let formulakindArr = [];
  1527. // arr.map(async (t, index) => {
  1528. // let result = f_pb_split(t);
  1529. // let _formulakind;
  1530. // switch (result.left) {
  1531. // case "垫层":
  1532. // _formulakind = 32;
  1533. // break;
  1534. // case "床网":
  1535. // _formulakind = 999;
  1536. // break;
  1537. // case "顶布":
  1538. // _formulakind = 12;
  1539. // break;
  1540. // case "毡类":
  1541. // _formulakind = 13;
  1542. // break;
  1543. // case "打底无纺布":
  1544. // _formulakind = 14;
  1545. // break;
  1546. // case "网面布料":
  1547. // _formulakind = 29;
  1548. // break;
  1549. // default:
  1550. // _formulakind = -1;
  1551. // break;
  1552. // }
  1553. // let _params = {
  1554. // dsname: "web_mattress_formulalist",
  1555. // queryparams: {
  1556. // arg_array_formulakind: [_formulakind],
  1557. // arg_array_formulatype: [0, 1, 2, 3],
  1558. // pageindex: 1,
  1559. // pagesize: 1
  1560. // }
  1561. // };
  1562. // let res = await CommonDynamicSelect(_params);
  1563. // if (res?.datatable?.length) {
  1564. // res?.datatable.map((item: any) => {
  1565. // let _data: any = {};
  1566. // _data.formulatype = item.formulatype;
  1567. // _data.if_mtrl = 2;
  1568. // _data.formulaid = item.formulaid;
  1569. // _data.sortcode = item.sortcode;
  1570. // _data.formulakind = item.formulakind;
  1571. // _data.formula = item.formula;
  1572. // _data.chastr = wf_set_area_text(result.right);
  1573. // _data.qty = 1;
  1574. // _data.xu = index;
  1575. // _data.useformula = item.useformula;
  1576. // _data.gydscrp = item.gydscrp;
  1577. // newMxData.push(_data);
  1578. // });
  1579. // }
  1580. // });
  1581. // };
  1582. // const wf_add_dianceng_area_bytype = (data: string) => {
  1583. // if (!data) return;
  1584. // let _dataStr = data.replace(/,/g, ",").replace(/~r~n/g, "").replace(/~r/g, "").replace(/~n/g, "");
  1585. // let result: any = _dataStr.split(",");
  1586. // result = result.map(t => {
  1587. // return { value: t, label: t };
  1588. // });
  1589. // return result;
  1590. // };
  1591. // function wf_set_area_text(arg_str) {
  1592. // let ls_rtn = "";
  1593. // if (arg_str.includes("大侧")) {
  1594. // ls_rtn = "大侧";
  1595. // } else if (arg_str.includes("小侧1")) {
  1596. // ls_rtn = "小侧1";
  1597. // } else if (arg_str.includes("小侧2")) {
  1598. // ls_rtn = "小侧2";
  1599. // } else if (arg_str.includes("小侧3")) {
  1600. // ls_rtn = "小侧3";
  1601. // } else if (arg_str.includes("V侧1")) {
  1602. // ls_rtn = "V侧1";
  1603. // } else if (arg_str.includes("V侧2")) {
  1604. // ls_rtn = "V侧2";
  1605. // } else if (arg_str.includes("V侧3")) {
  1606. // ls_rtn = "V侧3";
  1607. // } else {
  1608. // ls_rtn = "";
  1609. // }
  1610. // return ls_rtn;
  1611. // }
  1612. // /**
  1613. // * @description 包装默认物料设置
  1614. // */
  1615. // const wf_default_mtrlid = async () => {
  1616. // // 包装
  1617. // console.log("wf_default_mtrlid state.packagMxData :>> ", state.packagMxData);
  1618. // let _deptid = state.LjDetailRef._mainData.deptid;
  1619. // let deptEnum = state.LjDetailRef.enumMap.get("deptid");
  1620. // let _pricelistid = 0;
  1621. // console.log("deptEnum :>> ", deptEnum);
  1622. // if (deptEnum) {
  1623. // let depItem = deptEnum.find((item: any) => item.value == _deptid);
  1624. // console.log("depItem :>> ", depItem);
  1625. // if (depItem) {
  1626. // _pricelistid = Number(depItem.pricelistid);
  1627. // }
  1628. // }
  1629. // // 根据formulaid,获取全部设置的默认物料信息
  1630. // let defaultMtrlList = [];
  1631. // let _param_mf = {
  1632. // dsname: "web_mtrl_choose",
  1633. // queryparams: {
  1634. // arg_array_formulaid: [16, 17, 18, 19, 27],
  1635. // arg_pricelistid: _pricelistid,
  1636. // arg_array_mtrlid: [46804, 46809, 46811, 46817, 46872]
  1637. // }
  1638. // };
  1639. // let res_mf = await CommonDynamicSelect(_param_mf);
  1640. // if (res_mf?.datatable?.length) {
  1641. // defaultMtrlList = res_mf?.datatable;
  1642. // }
  1643. // // let _mtrlData = await wf_mtrl_find(_pricelistid, [46804, 46809, 46811, 46817, 46872]);
  1644. // console.log("wf_default_mtrlid ccccc state.packagMxData :>> ", state.packagMxData);
  1645. // state.packagMxData.map(itm => {
  1646. // console.log("packagMxData itm :>> ", itm);
  1647. // let _formulakind = Number(itm.formulakind);
  1648. // let _data = null;
  1649. // if (_formulakind == 16) {
  1650. // //默认 pe kind = 16 默认 10C PE袋 mtrlid 46804
  1651. // itm.mtrlid = 46804;
  1652. // } else if (_formulakind == 17) {
  1653. // //默认 外层pe kind = 17 默认 20C mtrlid 46809
  1654. // itm.mtrlid = 46809;
  1655. // } else if (_formulakind == 18) {
  1656. // //默认 pvc kind = 18 默认 15C mtrlid 46811
  1657. // itm.mtrlid = 46811;
  1658. // } else if (_formulakind == 19) {
  1659. // //默认 卷包外包装 kind = 19 默认 彩箱 32*32 46817
  1660. // itm.mtrlid = 46817;
  1661. // } else if (_formulakind == 27) {
  1662. // //默认 拉手脚轮 kind = 27 默认 46872
  1663. // itm.mtrlid = 46872;
  1664. // }
  1665. // _data = defaultMtrlList.find(t => t.mtrlid == itm.mtrlid);
  1666. // console.log("wf_default_mtrlid _data :>> ", _data);
  1667. // if (_data) {
  1668. // itm.mtrlname = _data.mtrlname;
  1669. // itm.price = _data.pricelistprice;
  1670. // itm.gram_weight = _data.gram_weight;
  1671. // itm.cloth_width = _data.cloth_width;
  1672. // itm.if_inputqty = _data.if_inputqty;
  1673. // itm.priceunit = _data.priceunit;
  1674. // itm.shrinkage = _data.shrinkage;
  1675. // itm.qty = 1;
  1676. // if (_data.formula != "") {
  1677. // itm.formula = _data.formula;
  1678. // }
  1679. // }
  1680. // return itm;
  1681. // });
  1682. // console.log("wf_default_mtrlid state.packagMxData :>> ", state.packagMxData);
  1683. // };
  1684. // const wf_default_mtrlid_notbz = async () => {
  1685. // console.log("state.oriMxData.list bf state.oriMxData.list :>> ", state.oriMxData.list);
  1686. // // 收集数据中各种公式的formulaid
  1687. // let _formulaids = [];
  1688. // state.oriMxData.list.forEach((itm: any) => {
  1689. // _formulaids.push(itm.formulaid);
  1690. // });
  1691. // // 数组去重
  1692. // _formulaids = Array.from(new Set(_formulaids));
  1693. // // 部门设置的报价表
  1694. // let _pricelistid = 0;
  1695. // let _deptid = state.LjDetailRef._mainData.deptid;
  1696. // let deptEnum = state.LjDetailRef.enumMap.get("deptid");
  1697. // console.log("deptEnum :>> ", deptEnum);
  1698. // if (deptEnum) {
  1699. // let depItem = deptEnum.find((item: any) => item.value == _deptid);
  1700. // console.log("depItem :>> ", depItem);
  1701. // if (depItem) {
  1702. // _pricelistid = Number(depItem.pricelistid);
  1703. // }
  1704. // }
  1705. // // 根据formulaid,获取全部设置的默认物料信息
  1706. // let defaultMtrlList = [];
  1707. // let _param_mf = {
  1708. // dsname: "web_mtrl_choose",
  1709. // queryparams: {
  1710. // arg_array_formulaid: _formulaids,
  1711. // arg_pricelistid: _pricelistid,
  1712. // arg_array_mtrlid: [46804, 46809, 46811, 46817, 46872]
  1713. // }
  1714. // };
  1715. // let res_mf = await CommonDynamicSelect(_param_mf);
  1716. // if (res_mf?.datatable?.length) {
  1717. // defaultMtrlList = res_mf?.datatable;
  1718. // }
  1719. // state.oriMxData.list.forEach((itm: any) => {
  1720. // let _formulakind = Number(itm.formulakind);
  1721. // let _data = defaultMtrlList.find(t => t.formulaid == itm.formulaid);
  1722. // console.log("wf_default_mtrlid_notbz 查询默认物料_data :>> ", _data);
  1723. // // 包装default
  1724. // if (itm.formulatype == "3") {
  1725. // let changeMtrl = 0;
  1726. // if (_formulakind == 16) {
  1727. // //默认 pe kind = 16 默认 10C PE袋 mtrlid 46804
  1728. // changeMtrl = 46804;
  1729. // } else if (_formulakind == 17) {
  1730. // //默认 外层pe kind = 17 默认 20C mtrlid 46809
  1731. // changeMtrl = 46809;
  1732. // } else if (_formulakind == 18) {
  1733. // //默认 pvc kind = 18 默认 15C mtrlid 46811
  1734. // changeMtrl = 46811;
  1735. // } else if (_formulakind == 19) {
  1736. // //默认 卷包外包装 kind = 19 默认 彩箱 32*32 46817
  1737. // changeMtrl = 46817;
  1738. // } else if (_formulakind == 27) {
  1739. // //默认 拉手脚轮 kind = 27 默认 46872
  1740. // changeMtrl = 46872;
  1741. // }
  1742. // if (changeMtrl && !_data) {
  1743. // _data = defaultMtrlList.find(t => t.mtrlid == changeMtrl);
  1744. // }
  1745. // }
  1746. // if (_data) {
  1747. // itm.mtrlid = _data.mtrlid;
  1748. // itm.mtrlname = _data.mtrlname;
  1749. // itm.price = _data.pricelistprice;
  1750. // itm.gram_weight = _data.gram_weight;
  1751. // itm.cloth_width = _data.cloth_width;
  1752. // itm.if_inputqty = _data.if_inputqty;
  1753. // itm.priceunit = _data.priceunit;
  1754. // itm.shrinkage = _data.shrinkage;
  1755. // itm.qty = 1;
  1756. // if (_data.formula != "") {
  1757. // itm.formula = _data.formula;
  1758. // }
  1759. // }
  1760. // });
  1761. // console.log("state.oriMxData.list affff state.oriMxData.list :>> ", state.oriMxData.list);
  1762. // };
  1763. /**
  1764. * @description 明细,新增
  1765. */
  1766. const funcAddMtrlMx = async (data: any, cb?: Function, refName?: string, firstRow?: any) => {
  1767. console.log("state.LjDetail. :>> ", state.LjDetailRef);
  1768. console.log("funcAddMtrlMx data :>> ", data);
  1769. let { row, $rowIndex, visibleData } = data;
  1770. let tgRefName = "";
  1771. if (refName) {
  1772. tgRefName = refName;
  1773. } else {
  1774. let { tabsActive } = state.LjDetailRef;
  1775. let _target = tabsActive == "fabricMx" ? state.fabricMxTabs : tabsActive;
  1776. let currentTab = state.fabricMxTabList.find(t => t.name == _target);
  1777. tgRefName = currentTab.ref;
  1778. }
  1779. const $table = state[tgRefName].element;
  1780. if ($table) {
  1781. let records = {};
  1782. if (["specialProcessesMxRef", "additionalCostsMxRef"].includes(tgRefName)) {
  1783. records = {
  1784. addmx: "+",
  1785. delmx: "-",
  1786. mattressid: state.LjDetailRef._mainData.mattressid,
  1787. mattressmxid: 0,
  1788. extraid: row?.extraid ?? 0,
  1789. extramxid: row?.extramxid ?? 0,
  1790. extraname: "",
  1791. price: "",
  1792. qty: 1,
  1793. dscrp: ""
  1794. };
  1795. } else {
  1796. records = {
  1797. addmx: "+",
  1798. delmx: "-",
  1799. mattressmxid: 0,
  1800. formulatype: row.formulatype,
  1801. if_mtrl: row.if_mtrl,
  1802. formulaid: row.formulaid,
  1803. sortcode: row.sortcode,
  1804. formulakind: row.formulakind,
  1805. formula: row.formula,
  1806. thickness: 0,
  1807. mtrlid: 0,
  1808. chastr: row.chastr,
  1809. xu: Number(row.xu) + 0.01
  1810. };
  1811. }
  1812. // null 从第一行插入, row: 从当前行下一行插入
  1813. let _rowIdx = firstRow == -1 ? -1 : firstRow ? null : row;
  1814. console.log("funcAddMtrlMx _rowIdx :>> ", firstRow, firstRow == -1, _rowIdx);
  1815. const { row: newRow } = await $table.insertNextAt(records, _rowIdx);
  1816. await $table.setEditCell(newRow, "mtrlname");
  1817. await $table.setCurrentRow(newRow);
  1818. cb && cb();
  1819. }
  1820. };
  1821. /**
  1822. * @description 明细,删除
  1823. */
  1824. const funcDelMtrlMx = (data: any, refName?: string) => {
  1825. let { row } = data;
  1826. let tgRefName = "";
  1827. if (refName) {
  1828. tgRefName = refName;
  1829. } else {
  1830. let { tabsActive } = state.LjDetailRef;
  1831. let _target = tabsActive == "fabricMx" ? state.fabricMxTabs : tabsActive;
  1832. let currentTab = state.fabricMxTabList.find(t => t.name == _target);
  1833. tgRefName = currentTab.ref;
  1834. }
  1835. const $table = state[tgRefName].element;
  1836. if ($table) {
  1837. $table.remove(row);
  1838. }
  1839. };
  1840. /**
  1841. * @description 明细,删除
  1842. */
  1843. const funcDelBednet = (scope: any, cb?: Function, refName?: string) => {
  1844. console.log("funcDelBednet: ", scope);
  1845. if (scope.data.length == 1) {
  1846. ElMessage.warning("不能全部删除,至少保留一个床网");
  1847. return false;
  1848. }
  1849. cb && cb();
  1850. funcDelMtrlMx(scope, refName);
  1851. // 床网与主副规格互联
  1852. nextTick(() => {
  1853. updateSubspecsTable();
  1854. });
  1855. };
  1856. /**
  1857. * @description 据字符串'myRef'来获取ref
  1858. * @param name
  1859. * @returns
  1860. */
  1861. const dynamicRef = name => {
  1862. return state[name]; // 获取ref的值
  1863. };
  1864. /**
  1865. * @description 获取当前需要显示的面料明细tabs
  1866. */
  1867. const getMattressType = () => {
  1868. const globalStore = useGlobalStore();
  1869. const { enumMap, _mainData } = state.LjDetailRef;
  1870. console.log("getMattressType enumMap :>> ", enumMap, _mainData, state.LjDetailRef);
  1871. let _enum = enumMap.get("mattresstypeid");
  1872. console.log("_enum :>> ", _enum);
  1873. if (_enum) {
  1874. state.mattresstypeEnum = _enum.find(t => t.value == _mainData.mattresstypeid);
  1875. console.log("mattresstypeEnum :>> ", state.mattresstypeEnum);
  1876. }
  1877. let _dwname = DwnameEnum.mattressQuote + "__fabric";
  1878. let _dftabs = "";
  1879. let _fabricShowList = undefined;
  1880. let itmshow = null;
  1881. if (globalStore?.detailtabs && Object.keys(globalStore?.detailtabs).includes(_dwname)) {
  1882. _dftabs = globalStore?.detailtabs[_dwname];
  1883. }
  1884. if (_dftabs) {
  1885. _fabricShowList = state.fabricMxTabList
  1886. .map(o => Object.keys(o).includes("visible") && o?.visible() && o)
  1887. .find(o => o?.name == _dftabs);
  1888. }
  1889. if (_fabricShowList) {
  1890. itmshow = _fabricShowList;
  1891. } else {
  1892. itmshow = state.fabricMxTabList.find(o => Object.keys(o).includes("visible") && o?.visible() && o);
  1893. }
  1894. state.fabricMxTabs = itmshow.name;
  1895. };
  1896. const funcChaifenTab = () => {
  1897. const { _mainData } = state.LjDetailRef;
  1898. // 面料
  1899. state.fabricMxData = state.oriMxData.list.filter(
  1900. t => t.formulatype == 0 || (Number(_mainData.if_bcp_type) == 1 && t.formulatype == 104)
  1901. );
  1902. console.log("funcChaifenTab fabricMxData :>> ", state.fabricMxData);
  1903. let _mx8 = state.fabricMxTabList.find(t => t.name == "tabpage_8");
  1904. state.fabricMxTab8 = state.fabricMxData.filter(t => _mx8.type.includes(Number(t.formulakind)));
  1905. state.fabricMxTab8.forEach((o, i) => {
  1906. o.xu = i + 1;
  1907. });
  1908. console.log("funcChaifenTab fabricMxTab8 :>> ", state.fabricMxTab8);
  1909. let _mx9 = state.fabricMxTabList.find(t => t.name == "tabpage_9");
  1910. state.fabricMxTab9 = state.fabricMxData.filter(t => _mx9.type.includes(Number(t.formulakind)));
  1911. state.fabricMxTab9.forEach((o, i) => {
  1912. o.xu = i + 1;
  1913. });
  1914. let _mx10 = state.fabricMxTabList.find(t => t.name == "tabpage_10");
  1915. state.fabricMxTab10 = state.fabricMxData.filter(t => _mx10.type.includes(Number(t.formulakind)));
  1916. state.fabricMxTab10.forEach((o, i) => {
  1917. o.xu = i + 1;
  1918. });
  1919. let _mx11 = state.fabricMxTabList.find(t => t.name == "tabpage_11");
  1920. state.fabricMxTab11 = state.fabricMxData.filter(t => _mx11.type.includes(Number(t.formulakind)));
  1921. state.fabricMxTab11.forEach((o, i) => {
  1922. o.xu = i + 1;
  1923. });
  1924. console.log("funcChaifenTab state.fabricMxTab11 :>> ", state.fabricMxTab11);
  1925. let _mx12 = state.fabricMxTabList.find(t => t.name == "tabpage_12");
  1926. state.fabricMxTab12 = state.fabricMxData.filter(t => _mx12.type.includes(Number(t.formulakind)));
  1927. state.fabricMxTab12.forEach((o, i) => {
  1928. o.xu = i + 1;
  1929. });
  1930. let _mx13 = state.fabricMxTabList.find(t => t.name == "tabpage_13");
  1931. state.fabricMxTab13 = state.fabricMxData.filter(t => !_mx13.type.includes(Number(t.formulakind)));
  1932. state.fabricMxTab13.forEach((o, i) => {
  1933. o.xu = i + 1;
  1934. });
  1935. // 垫层
  1936. state.cushionsMxData = state.oriMxData.list.filter(t => t.formulatype == 1);
  1937. state.cushionsMxData.forEach((o, i) => {
  1938. o.xu = i + 1;
  1939. });
  1940. // 辅料
  1941. state.accessoriesMxData = state.oriMxData.list.filter(t => t.formulatype == 2);
  1942. state.accessoriesMxData.forEach((o, i) => {
  1943. o.xu = i + 1;
  1944. });
  1945. // 包装
  1946. state.packagMxData = state.oriMxData.list.filter(t => t.formulatype == 3);
  1947. state.packagMxData.forEach((o, i) => {
  1948. o.xu = i + 1;
  1949. });
  1950. // 床网
  1951. state.bednetMxData = state.oriMxData.list.filter(t => t.formulatype == 99);
  1952. state.bednetMxData.forEach((o, i) => {
  1953. o.xu = i + 1;
  1954. });
  1955. };
  1956. /**
  1957. * 拆分表格数据到不同的分类
  1958. * @param {Object} _mainData - 主数据对象
  1959. * @param {Object} oriMxData - 原始明细数据对象
  1960. * @returns {Object} 包含所有分类数据的对象
  1961. */
  1962. const funcChaifenTabPro = (_mainData, oriMxData) => {
  1963. // 1. 处理面料数据
  1964. const processFabricData = () => {
  1965. const fabricMxData = oriMxData.filter(
  1966. t => t.formulatype == 0 || (Number(_mainData.if_bcp_type) == 1 && t.formulatype == 104)
  1967. );
  1968. console.log("funcChaifenTab fabricMxData :>> ", fabricMxData);
  1969. // 处理面料分页数据
  1970. const processFabricTab = (tabName, isExclude = false) => {
  1971. const tab = state.fabricMxTabList.find(t => t.name === tabName);
  1972. const key = `fabricMxTab${tabName.split("_")[1]}`;
  1973. const result = isExclude
  1974. ? fabricMxData.filter(t => !tab.type.includes(Number(t.formulakind)))
  1975. : fabricMxData.filter(t => tab.type.includes(Number(t.formulakind)));
  1976. // 添加序号
  1977. result.forEach((o, i) => {
  1978. o.xu = i + 1;
  1979. });
  1980. console.log(`funcChaifenTab ${key} :>> `, result);
  1981. return { [key]: result };
  1982. };
  1983. // 处理各个面料分页并合并结果
  1984. return {
  1985. ...processFabricTab("tabpage_8"),
  1986. ...processFabricTab("tabpage_9"),
  1987. ...processFabricTab("tabpage_10"),
  1988. ...processFabricTab("tabpage_11"),
  1989. ...processFabricTab("tabpage_12"),
  1990. ...processFabricTab("tabpage_13", true) // 最后一个tab是排除逻辑
  1991. };
  1992. };
  1993. // 2. 处理其他分类数据
  1994. const processOtherCategories = () => {
  1995. const categories = [
  1996. { key: "cushionsMxData", type: 1 }, // 垫层
  1997. { key: "accessoriesMxData", type: 2 }, // 辅料
  1998. { key: "packagMxData", type: 3 }, // 包装
  1999. { key: "bednetMxData", type: 99 } // 床网
  2000. ];
  2001. return categories.reduce((acc, { key, type }) => {
  2002. const result = oriMxData.filter(t => t.formulatype == type);
  2003. result.forEach((o, i) => {
  2004. o.xu = i + 1;
  2005. });
  2006. return { ...acc, [key]: result };
  2007. }, {});
  2008. };
  2009. // 处理内布套
  2010. const processNeiBuTaoData = () => {
  2011. // 处理面料分页数据
  2012. const otherMxTabList = [
  2013. {
  2014. label: "内布套",
  2015. name: "innerClothLayerMx",
  2016. ref: "innerClothLayerMxRef",
  2017. type: [101, 102]
  2018. },
  2019. {
  2020. label: "顶布裥棉",
  2021. name: "topCottonMx",
  2022. ref: "topCottonMxRef",
  2023. type: [103]
  2024. }
  2025. ];
  2026. const processNeiBuTaoTab = (tabName, isExclude = false) => {
  2027. const tab = otherMxTabList.find(t => t.name === tabName);
  2028. const key = `${tab.name}`;
  2029. const result = oriMxData.filter(t => tab.type.includes(Number(t.formulatype)));
  2030. // 添加序号
  2031. result.forEach((o, i) => {
  2032. o.xu = i + 1;
  2033. });
  2034. console.log(`funcChaifenTab ${key} :>> `, result);
  2035. return { [key]: result };
  2036. };
  2037. // 处理各个面料分页并合并结果
  2038. return {
  2039. ...processNeiBuTaoTab("innerClothLayerMx"),
  2040. ...processNeiBuTaoTab("topCottonMx")
  2041. };
  2042. };
  2043. // 合并所有结果并返回
  2044. return {
  2045. ...processFabricData(),
  2046. ...processOtherCategories(),
  2047. ...processNeiBuTaoData()
  2048. };
  2049. };
  2050. /**
  2051. * 获取报价单明细数据
  2052. * @returns {Array} 报价单明细数据数组
  2053. */
  2054. const getQuoteListMxData = data => {
  2055. return [
  2056. {
  2057. label: "面裥绵",
  2058. field: "tabpage_8",
  2059. replace: "面裥绵-",
  2060. data: data.fabricMxTab8 || []
  2061. },
  2062. {
  2063. label: "底裥绵",
  2064. field: "tabpage_9",
  2065. replace: "底裥绵-",
  2066. data: data.fabricMxTab9 || []
  2067. },
  2068. {
  2069. label: "裥大侧",
  2070. field: "tabpage_10",
  2071. replace: "大侧裥绵-",
  2072. data: data.fabricMxTab10 || []
  2073. },
  2074. {
  2075. label: "裥小侧",
  2076. field: "tabpage_11",
  2077. replace: "小侧裥绵-",
  2078. data: data.fabricMxTab11 || []
  2079. },
  2080. {
  2081. label: "裥V侧",
  2082. field: "tabpage_12",
  2083. replace: "V侧裥绵-",
  2084. data: data.fabricMxTab12 || []
  2085. },
  2086. {
  2087. label: "其他工艺",
  2088. field: "tabpage_13",
  2089. replace: "V侧裥绵-",
  2090. data: data.fabricMxTab13 || []
  2091. },
  2092. {
  2093. label: "垫层",
  2094. field: "cushions",
  2095. data: {
  2096. cushions: data.cushionsMxData || [],
  2097. bednet: data.bednetMxData || []
  2098. }
  2099. },
  2100. {
  2101. label: "辅料",
  2102. field: "accessories",
  2103. data: data.accessoriesMxData || []
  2104. },
  2105. {
  2106. label: "包装",
  2107. field: "packag",
  2108. data: data.packagMxData || []
  2109. },
  2110. {
  2111. label: "内布套",
  2112. field: "innerClothLayerMx",
  2113. data: data.innerClothLayerMx || []
  2114. },
  2115. {
  2116. label: "顶布裥棉",
  2117. field: "topCottonMx",
  2118. data: data.topCottonMx || []
  2119. }
  2120. ];
  2121. };
  2122. /**
  2123. * @description 切换包装方式select,获取默认物料
  2124. * @param val
  2125. */
  2126. const funcPacktypeChange = async (val: any) => {
  2127. console.log("wf_import_bz val :>> ", val);
  2128. let newMxData: any = [];
  2129. const { _mainData, enumMap } = state.LjDetailRef;
  2130. if (val == "0") {
  2131. _mainData.diameter = 0;
  2132. } else if (val == "1") {
  2133. _mainData.packqty = 0;
  2134. } else {
  2135. _mainData.diameter = 0;
  2136. _mainData.packqty = 0;
  2137. }
  2138. let _pricelistid = getPriceid();
  2139. let _params = {
  2140. mattresstypeid: _mainData.mattresstypeid,
  2141. ifbcptype: _mainData.if_bcp_type,
  2142. packtype: _mainData.packtype,
  2143. pricelistid: _pricelistid
  2144. };
  2145. let res = await GetMattressPackagMx(_params);
  2146. if (res) {
  2147. newMxData = res.mattressMx;
  2148. _mainData.biandai_qty = res?.biandai_qty;
  2149. state.diancengAreaEnum = res?.diancengarea;
  2150. }
  2151. state.packagMxData = newMxData;
  2152. };
  2153. /**
  2154. * @description 重新获取明细数据
  2155. * @author w_mattress_add wf_import_dw_2
  2156. */
  2157. const wf_import_dw_2 = async () => {
  2158. // let _biandaiqty = 0;
  2159. let newMxData: any = [];
  2160. /**
  2161. * @description 床垫类别参数
  2162. */
  2163. let mattressTypeData: any = {};
  2164. const { _mainData, enumMap } = state.LjDetailRef;
  2165. let _pricelistid = getPriceid();
  2166. let _params = {
  2167. mattressid: Number(_mainData.mattressid),
  2168. mattresstypeid: _mainData.mattresstypeid,
  2169. ifbcptype: _mainData.if_bcp_type,
  2170. packtype: _mainData.packtype,
  2171. pricelistid: _pricelistid
  2172. };
  2173. let res = await GetMattressImportDW2(_params);
  2174. if (res) {
  2175. newMxData = res.mattressMx;
  2176. _mainData.biandai_qty = res?.biandai_qty;
  2177. state.diancengAreaEnum = res?.diancengarea;
  2178. state.specialProcessesMxData = res?.extraEnum.filter(t => t.typeid == 1);
  2179. state.additionalCostsMxData = res?.extraEnum.filter(t => t.typeid == 2);
  2180. state.specialProcessesEnum = res?.extraTypeEnum.filter(t => t.typeid == 1);
  2181. state.additionalCostsEnum = res?.extraTypeEnum.filter(t => t.typeid == 2);
  2182. state.specialProcessesMxInitData = res?.extraProcessesMx;
  2183. state.additionalCostsMxInitData = res?.extraCostsMx;
  2184. }
  2185. state.oriMxData.list = newMxData;
  2186. getMattressType();
  2187. funcChaifenTab();
  2188. await initExtraData();
  2189. };
  2190. const initExtraData = async () => {
  2191. console.log("initExtraData state.specialProcessesMxInitData :>> ", state.specialProcessesMxInitData);
  2192. console.log("initExtraData state.additionalCostsMxInitData :>> ", state.additionalCostsMxInitData);
  2193. const $tableSpecial = state.specialProcessesMxRef.element;
  2194. const $tableAdditional = state.additionalCostsMxRef.element;
  2195. if ($tableSpecial) {
  2196. $tableSpecial.remove();
  2197. let _arr = [];
  2198. let _mattressId = state.LjDetailRef._mainData.mattressid;
  2199. state.specialProcessesMxInitData.map(o => {
  2200. let _itm = {
  2201. addmx: "+",
  2202. delmx: "-",
  2203. mattressid: _mattressId,
  2204. mattressmxid: 0,
  2205. extraid: o.extraid,
  2206. extraname: o.extraname,
  2207. price: o.price,
  2208. qty: o.qty,
  2209. dscrp: o.dscrp,
  2210. inputtype: o.inputtype,
  2211. typeid: o.typeid
  2212. };
  2213. _arr.push(_itm);
  2214. });
  2215. await $tableSpecial.insertAt(_arr, -1);
  2216. }
  2217. if ($tableAdditional) {
  2218. $tableAdditional.remove();
  2219. let _arr = [];
  2220. let _mattressId = state.LjDetailRef._mainData.mattressid;
  2221. state.additionalCostsMxInitData.map(o => {
  2222. let _itm = {
  2223. addmx: "+",
  2224. delmx: "-",
  2225. mattressid: _mattressId,
  2226. mattressmxid: 0,
  2227. extraid: o.extraid,
  2228. extraname: o.extraname,
  2229. price: o.price,
  2230. qty: o.qty,
  2231. dscrp: o.dscrp,
  2232. inputtype: o.inputtype,
  2233. typeid: o.typeid
  2234. };
  2235. _arr.push(_itm);
  2236. });
  2237. await $tableAdditional.insertAt(_arr, -1);
  2238. }
  2239. };
  2240. /**
  2241. * @description 变更床垫分类时,重载明细数据 dw_1 itemchange
  2242. * @author w_mattress_add dw_1 itemchange
  2243. */
  2244. const funcImportMattressMx = async () => {
  2245. console.log("funcImportMattressMx state.LjDetailRef._mainData :>> ", state.LjDetailRef, state.orderStatus);
  2246. const { _mainData, enumMap, baseformRef } = state.LjDetailRef;
  2247. // let mainData = state.orderStatus == "new" ? initParam : _mainData;
  2248. console.log("mainData :>> ", _mainData);
  2249. if (!Number(_mainData.deptid)) {
  2250. ElMessage.warning("请先选择部门");
  2251. console.log("baseformRef.element :>> ", baseformRef.element);
  2252. baseformRef.element.validateField("deptid");
  2253. _mainData.mattresstypeid = "";
  2254. return;
  2255. }
  2256. let _pricelistid = getPriceid();
  2257. if (!_pricelistid) {
  2258. ElMessage.warning("选择部门未设置价格表,请检查");
  2259. return;
  2260. }
  2261. // if (!_mainData.mattresstypeid) {
  2262. // ElMessage.warning("请先选择床垫类别");
  2263. // return;
  2264. // }
  2265. wf_import_dw_2();
  2266. };
  2267. /**
  2268. * @description 刷新报价清单
  2269. */
  2270. const wf_factory_profitrate = async () => {
  2271. const { _mainData, enumMap } = state.LjDetailRef;
  2272. console.log("wf_factory_profitrate enumMap :>> ", enumMap);
  2273. let _pricelistid = getPriceid();
  2274. let _params = {
  2275. dsname: "web_factory_profitratelist",
  2276. queryparams: {
  2277. arg_deptid: _mainData.deptid,
  2278. arg_bednettypeid_mattresstypeid: _mainData.mattresstypeid,
  2279. kind: 1
  2280. }
  2281. };
  2282. let res = await CommonDynamicSelect(_params);
  2283. if (res?.datatable?.length > 0) {
  2284. _mainData.profitrate = res?.datatable[0].profitrate;
  2285. }
  2286. };
  2287. /**
  2288. * @description 获取部门汇率 和 折扣率
  2289. */
  2290. const wf_get_moneyrate_discount = (val: any, data) => {
  2291. const { _mainData, enumMap } = state.LjDetailRef;
  2292. let deptEnum = enumMap.get("deptid");
  2293. console.log("deptEnum :>> ", deptEnum);
  2294. if (deptEnum) {
  2295. let depItem = deptEnum.find((item: any) => item.value == _mainData.deptid);
  2296. if (depItem) {
  2297. let _moneyrate = !depItem.moneyrate || Number(depItem.moneyrate) == 0 ? 1 : depItem.moneyrate;
  2298. if (val == 0 || !_mainData.if_moneyrate) {
  2299. data.moneyrate = 1;
  2300. } else {
  2301. data.moneyrate = _moneyrate;
  2302. }
  2303. data.discount = depItem.discount;
  2304. }
  2305. }
  2306. };
  2307. /**
  2308. * @description 计算价格
  2309. */
  2310. const wf_cmp_cb = async () => {
  2311. const { _mainData, enumMap, baseformRef } = state.LjDetailRef;
  2312. //wf_paixu 未有
  2313. await wf_factory_profitrate();
  2314. // 佣金
  2315. if (_mainData?.commission == 0 || !_mainData.commission) {
  2316. _mainData.commission = 1;
  2317. }
  2318. if (_mainData?.taxrate == 0 || !_mainData.taxrate) {
  2319. _mainData.taxrate = 1;
  2320. }
  2321. if (_mainData?.other_rate == 0 || !_mainData.other_rate) {
  2322. _mainData.other_rate = 1;
  2323. }
  2324. if (_mainData?.moneyrate == 0 || !_mainData.moneyrate) {
  2325. _mainData.moneyrate = 1;
  2326. }
  2327. if (_mainData?.commission < 1) {
  2328. throw new Error("佣金点数不能小于1");
  2329. }
  2330. if (_mainData?.taxrate < 1) {
  2331. throw new Error("税率不能小于1");
  2332. }
  2333. if (_mainData?.other_rate < 1) {
  2334. throw new Error("额外点数不能小于1");
  2335. }
  2336. if (_mainData?.dept_profitrate == 0) {
  2337. throw new Error("部门利润率不能为0!");
  2338. }
  2339. return true;
  2340. };
  2341. /**
  2342. * @description 展示计算公式
  2343. * @param timeout
  2344. */
  2345. const gotoSummy = async (timeout = 0) => {
  2346. const globalStore = useGlobalStore();
  2347. const { isShowOriginFormulaMattress } = storeToRefs(globalStore);
  2348. state.isShowOriginFormulaMattress = isShowOriginFormulaMattress.value;
  2349. // if (userInfo.usermode == 1) {
  2350. // ElMessage.error("'业务员模式不可以查看计算公式!'");
  2351. // return false;
  2352. // }
  2353. let mattress = state.LjDetailRef._mainData;
  2354. mattress.mattressid = Number(mattress.mattressid ?? 0);
  2355. mattress.xd_flag = Number(mattress.xd_flag ?? 0);
  2356. mattress.js1_flag = Number(mattress.js1_flag ?? 0);
  2357. mattress.flag = Number(mattress.flag ?? 0);
  2358. console.log("bbbbbbbbbbbbbbbbbbbb mattress :>> ", mattress);
  2359. // mattress.if_moneyrate = Number(mattress.if_moneyrate ?? 0);
  2360. // mattress.if_bcp_type = Number(mattress.if_bcp_type ?? 0);
  2361. // mattress.if_d_chai = Number(mattress.if_d_chai ?? 0);
  2362. // mattress.if_m_chai = Number(mattress.if_m_chai ?? 0);
  2363. // mattress.if_m_wbutao_way = Number(mattress.if_m_wbutao_way ?? 0);
  2364. // mattress.if_n_butao = Number(mattress.if_n_butao ?? 0);
  2365. // mattress.if_w_butao = Number(mattress.if_w_butao ?? 0);
  2366. // mattress.if_z_chai = Number(mattress.if_z_chai ?? 0);
  2367. // mattress.if_zhedie_type = Number(mattress.if_zhedie_type ?? 0);
  2368. let mattressMx = [];
  2369. state.fabricMxTabList.map(t => {
  2370. if (t.ref) {
  2371. console.log("t.ref?.value :>> ", t.ref, dynamicRef(t.ref));
  2372. if (dynamicRef(t.ref)) {
  2373. let { fullData } = dynamicRef(t.ref)?.element.getTableData();
  2374. console.log("fullData :>> ", fullData);
  2375. fullData = fullData.map((itm, idx) => {
  2376. itm.xu = idx + 1;
  2377. return itm;
  2378. });
  2379. mattressMx = mattressMx.concat(fullData);
  2380. }
  2381. }
  2382. });
  2383. let _params = {
  2384. mattress,
  2385. // mattressMx,
  2386. check_original: Number(state.isShowOriginFormulaMattress)
  2387. };
  2388. let res = await GetComputeMattress(_params);
  2389. console.log("GetComputeBednet res :>> ", res);
  2390. // let summaryData = [];
  2391. // let fieldParams = [];
  2392. let cpData = {};
  2393. if (!res.message) {
  2394. // summaryData = res.formulas;
  2395. // fieldParams = res.replace;
  2396. state.cmpFormulas = res.formulas;
  2397. state.cmpFormulaReplace = res.replace;
  2398. // state.
  2399. state.cmpFormulasOri = res.formulas_origin ?? [];
  2400. state.cmpFormulasBednet = res.formulas_bednet ?? [];
  2401. state.cmpDiffer = res.differ;
  2402. // 更新床网tab大小单单价显示
  2403. if (state.cmpDiffer.length > 0) {
  2404. let costArr = [];
  2405. state.cmpDiffer.forEach(o => {
  2406. let bednetMatch = o.replace.filter(itm => itm.label.indexOf("床网车间成本") > -1 && itm.label.indexOf("总") == -1);
  2407. if (!costArr.length) {
  2408. // 先加入空对象
  2409. bednetMatch.forEach(itm => {
  2410. costArr.push({
  2411. dannum2_cost: 0, // 标准
  2412. dannum1_cost: 0, // 散单
  2413. dannum3_cost: 0, // 大单
  2414. dannum4_cost: 0 // 小单
  2415. });
  2416. });
  2417. }
  2418. // 取文本出现的数字
  2419. let reg = /\d+/g;
  2420. if (bednetMatch.length) {
  2421. bednetMatch.forEach(itm => {
  2422. let matchIdx = itm.label.match(reg);
  2423. if (matchIdx && matchIdx.length) {
  2424. let idx = Number(matchIdx[0]);
  2425. costArr[idx - 1][`dannum${o.type}_cost`] = itm.value;
  2426. }
  2427. });
  2428. }
  2429. });
  2430. state.bednetMxData = state.bednetMxData.map((o, idx) => {
  2431. o.dannum2_cost = costArr[idx]?.dannum2_cost;
  2432. o.dannum1_cost = costArr[idx]?.dannum1_cost;
  2433. o.dannum3_cost = costArr[idx]?.dannum3_cost;
  2434. o.dannum4_cost = costArr[idx]?.dannum4_cost;
  2435. return o;
  2436. });
  2437. console.log("床网报价cost :>> ", costArr, state.bednetMxData);
  2438. }
  2439. } else {
  2440. setTimeout(() => {
  2441. if (res.message) {
  2442. ElNotification({
  2443. title: "计算失败",
  2444. message: res.message,
  2445. type: "warning"
  2446. });
  2447. }
  2448. }, 100);
  2449. return false;
  2450. }
  2451. // console.log("LjDetailRef.value.mainData :>> ", LjDetailRef.value._mainData, summaryData.value);
  2452. // const { _mainData, enumMap, baseformRef } = state.LjDetailRef;
  2453. // const toast = useToast();
  2454. // let result = await calculateFormula(summaryData.value, fieldParams.value, _mainData);
  2455. // if (result.length) {
  2456. // let _data = cloneDeep(_mainData);
  2457. // result.map((t, i) => {
  2458. // _data[t.field] = t.value;
  2459. // });
  2460. // result.map((t, i) => {
  2461. // _mainData[t.field] = t.value;
  2462. // });
  2463. // console.log("_data :>> ", _mainData, result);
  2464. // toast.clear();
  2465. // toast(
  2466. // {
  2467. // component: ToastFormula,
  2468. // props: {
  2469. // t: t,
  2470. // formulas: summaryData,
  2471. // // data: cpData,
  2472. // fields: fieldParams
  2473. // },
  2474. // listeners: {
  2475. // tomore: () => {
  2476. // console.log("tomore summaryData :>> ", summaryData);
  2477. // state.AllFormulaRef.open(summaryData, fieldParams);
  2478. // toast.clear();
  2479. // },
  2480. // refresh: () => {
  2481. // gotoSummy();
  2482. // }
  2483. // }
  2484. // },
  2485. // {
  2486. // position: POSITION.BOTTOM_RIGHT,
  2487. // icon: false,
  2488. // timeout: timeout,
  2489. // closeButton: false,
  2490. // toastClassName: "longjoe-toast"
  2491. // }
  2492. // );
  2493. // } else {
  2494. // ElMessage.error("计算公式有误");
  2495. // }
  2496. };
  2497. /**
  2498. * @description 展示历史价格
  2499. * @param timeout
  2500. * @param params
  2501. */
  2502. const gotoHisprice = async (timeout = 0, params: any) => {
  2503. const toast = useToast();
  2504. toast(
  2505. {
  2506. component: ToastHistoryPrice,
  2507. props: {
  2508. ...params,
  2509. t: t
  2510. },
  2511. listeners: {
  2512. todetail: (row: any) => {
  2513. console.log("gotoHisprice dd val :>> ", row, router);
  2514. if (Number(row.typeid) == 1) {
  2515. router.push(`/mattressQuote/detail?id=${row.bednetid_mattressid}`);
  2516. // state.bednetDrawerProps.deptid = state.LjDetailRef._mainData.deptid;
  2517. // state.bednetDrawerProps.bednetid = row.bednetid_mattressid;
  2518. // state.bednetDrawerProps.state = "";
  2519. // state.LjDrawerRef.show();
  2520. } else if (Number(row.typeid) == 2) {
  2521. router.push(`/bednetQuote/detail?id=${row.bednetid_mattressid}`);
  2522. }
  2523. }
  2524. }
  2525. },
  2526. {
  2527. position: POSITION.BOTTOM_RIGHT,
  2528. icon: false,
  2529. timeout: timeout,
  2530. closeButton: false,
  2531. toastClassName: "longjoe-toast"
  2532. }
  2533. );
  2534. };
  2535. const getFormulakindEnum = async () => {
  2536. let _params = {
  2537. dsname: "_Mapper_formulakind",
  2538. queryparams: {}
  2539. };
  2540. let res = await CommonDynamicSelect(_params);
  2541. let result = [];
  2542. if (res?.datatable?.length > 0) {
  2543. result = res?.datatable;
  2544. }
  2545. state.formulaKindEnum = result;
  2546. let _params2 = {
  2547. dsname: "_Mapper_formulakind_dc",
  2548. queryparams: {}
  2549. };
  2550. let res2 = await CommonDynamicSelect(_params2);
  2551. let result2 = [];
  2552. if (res2?.datatable?.length > 0) {
  2553. result2 = res2?.datatable;
  2554. state.formulaKindDcEnum = result2;
  2555. }
  2556. console.log("getFormulakindEnum state. state.formulaKindEnum :>> ", state.formulaKindEnum);
  2557. console.log("getFormulakindEnum state.formulaKindDcEnum :>> ", state.formulaKindDcEnum);
  2558. };
  2559. // 表格配置项
  2560. const columns: ColumnProps<any>[] = [
  2561. { type: "checkbox", width: 40, fixed: "left" },
  2562. { title: "#", type: "seq", fixed: "left", width: 80 },
  2563. {
  2564. field: "deptid",
  2565. title: "部门",
  2566. search: {
  2567. el: "select",
  2568. key: "arg_deptid",
  2569. props: {
  2570. filterable: true,
  2571. onChange: val => {
  2572. state.initParams.arg_deptid = val;
  2573. }
  2574. },
  2575. order: 2
  2576. },
  2577. basicinfo: {
  2578. el: "select",
  2579. editable: (scope: any) => {
  2580. return Boolean(Number(scope.searchParam.deptid) == 0);
  2581. },
  2582. rules: [{ required: true, message: "请先选择部门", trigger: "change" }],
  2583. props: {
  2584. filterable: true,
  2585. clearable: false
  2586. },
  2587. order: 1,
  2588. group: "单据信息"
  2589. }
  2590. },
  2591. {
  2592. field: "mattressrelcode",
  2593. title: "核价编码",
  2594. basicinfo: {
  2595. el: "input",
  2596. editable: ALLOW_EDIT_STATE
  2597. }
  2598. },
  2599. {
  2600. field: "mattresstypeid",
  2601. title: "床垫类别",
  2602. basicinfo: {
  2603. el: "select",
  2604. editable: ALLOW_EDIT_STATE,
  2605. rules: [{ required: true, message: "请先选择床垫类别", trigger: "change" }],
  2606. props: {
  2607. clearable: false,
  2608. filterable: true,
  2609. onChange: () => funcImportMattressMx()
  2610. }
  2611. }
  2612. },
  2613. {
  2614. field: "mattressname",
  2615. title: "核价名称",
  2616. align: "left",
  2617. table: "u_mattress",
  2618. search: {
  2619. el: "input",
  2620. key: "arg_search",
  2621. titleKey: "searchKw",
  2622. props: {
  2623. placeholder: "唯一码/编码/名称"
  2624. },
  2625. order: 1
  2626. },
  2627. basicinfo: {
  2628. el: "input",
  2629. editable: ALLOW_EDIT_STATE
  2630. },
  2631. treeNode: true,
  2632. render: scope => {
  2633. return !scope.row?.child_count && !scope.row?.parentid ? (
  2634. scope.row?.mattressname
  2635. ) : scope.row?.parentid ? (
  2636. <div class="flx-justify-between">
  2637. <span class="mle">{scope.row?.mattressname}</span>
  2638. <el-tag type="warning" effect="light" disable-transitions size="small" round class="ml-4">
  2639. </el-tag>
  2640. </div>
  2641. ) : (
  2642. <div class="flx-justify-between">
  2643. <span class="mle">{scope.row?.mattressname}</span>
  2644. <el-tag type="primary" effect="light" disable-transitions size="small" round class="ml-4">
  2645. </el-tag>
  2646. </div>
  2647. );
  2648. }
  2649. },
  2650. {
  2651. field: "flag",
  2652. title: "财务审核",
  2653. table: "u_mattress",
  2654. search: {
  2655. el: "select",
  2656. key: "status_flag",
  2657. titleKey: "status",
  2658. props: {
  2659. clearable: true,
  2660. placeholder: "全部",
  2661. onChange: () => {
  2662. state.vxeTableRef.refresh();
  2663. }
  2664. },
  2665. order: 3,
  2666. render: scope => {
  2667. // let _keys = Object.keys(scope);
  2668. // let _data = _keys.includes("row") ? scope.row : _keys.includes("searchParam") ? scope.searchParam : scope;
  2669. return (
  2670. <el-select v-model={scope.searchParam.status_flag} placeholder="全部" clearable>
  2671. <el-option label="待下单" value="1" />
  2672. <el-option label="已下单" value="2" />
  2673. <el-option label="待财务审核" value="3" />
  2674. <el-option label="已财务审核" value="4" />
  2675. </el-select>
  2676. );
  2677. }
  2678. }
  2679. },
  2680. {
  2681. field: "dept_profitrate_rangli",
  2682. title: "部门让利点数",
  2683. basicinfo: {
  2684. el: "input-number",
  2685. editable: ALLOW_EDIT_STATE,
  2686. order: 2,
  2687. group: "单据信息"
  2688. }
  2689. },
  2690. {
  2691. field: "fees_dscrp",
  2692. title: "额外费用说明",
  2693. basicinfo: {
  2694. el: "input",
  2695. props: { type: "textarea", rows: 2 },
  2696. editable: ALLOW_EDIT_STATE,
  2697. row: 2
  2698. }
  2699. },
  2700. {
  2701. field: "foreign_cost",
  2702. table: "u_mattress",
  2703. title: "外币价",
  2704. basicinfo: {
  2705. titleKey: "bi_foreign_cost"
  2706. }
  2707. },
  2708. {
  2709. field: "nottax_dept_cost",
  2710. table: "u_mattress",
  2711. title: "部门不含税价",
  2712. basicinfo: {
  2713. titleKey: "bi_nottax_dept_cost"
  2714. }
  2715. },
  2716. {
  2717. field: "if_bcp_type",
  2718. title: "半成品",
  2719. basicinfo: {
  2720. labelHidden: true,
  2721. render: (scope: any) => {
  2722. let _disabled = !ALLOW_EDIT_STATE.includes(scope.status);
  2723. return (
  2724. <>
  2725. <el-checkbox
  2726. v-model={scope.searchParam.if_bcp_type}
  2727. true-value={1}
  2728. false-value={0}
  2729. disabled={_disabled}
  2730. label="半成品"
  2731. class="mr-8"
  2732. />
  2733. <el-checkbox
  2734. v-model={scope.searchParam.if_zhedie_type}
  2735. true-value={1}
  2736. false-value={0}
  2737. disabled={_disabled}
  2738. label="折叠款"
  2739. />
  2740. </>
  2741. );
  2742. }
  2743. }
  2744. },
  2745. {
  2746. field: "if_m_chai",
  2747. title: "面拆",
  2748. basicinfo: {
  2749. span: 2,
  2750. labelHidden: true,
  2751. render: (scope: any) => {
  2752. let _disabled = !ALLOW_EDIT_STATE.includes(scope.status);
  2753. return (
  2754. <>
  2755. <el-checkbox
  2756. v-model={scope.searchParam.if_m_chai}
  2757. true-value={1}
  2758. false-value={0}
  2759. disabled={_disabled}
  2760. label="面拆"
  2761. class="mr-8"
  2762. onChange={val => autoLoadExtraData_chai(val, "if_m_chai")}
  2763. />
  2764. <el-checkbox
  2765. v-model={scope.searchParam.if_z_chai}
  2766. true-value={1}
  2767. false-value={0}
  2768. disabled={_disabled}
  2769. label="中拆"
  2770. class="mr-8"
  2771. onChange={val => autoLoadExtraData_chai(val, "if_z_chai")}
  2772. />
  2773. <el-checkbox
  2774. v-model={scope.searchParam.if_d_chai}
  2775. true-value={1}
  2776. false-value={0}
  2777. disabled={_disabled}
  2778. label="底拆"
  2779. onChange={val => autoLoadExtraData_chai(val, "if_d_chai")}
  2780. />
  2781. </>
  2782. );
  2783. }
  2784. }
  2785. },
  2786. {
  2787. field: "erp_mtrlcode",
  2788. title: "L1物料编码",
  2789. search: {
  2790. el: "input",
  2791. key: "arg_erp_mtrlcode",
  2792. props: {
  2793. placeholder: "L1物料编码"
  2794. },
  2795. order: 0
  2796. }
  2797. },
  2798. {
  2799. field: "mattress_width",
  2800. title: "床垫宽/CM",
  2801. basicinfo: {
  2802. el: "input-number",
  2803. editable: ALLOW_EDIT_STATE
  2804. }
  2805. },
  2806. {
  2807. field: "mattress_length",
  2808. title: "床垫长/CM",
  2809. basicinfo: {
  2810. el: "input-number",
  2811. editable: ALLOW_EDIT_STATE
  2812. }
  2813. },
  2814. {
  2815. field: "mattress_height",
  2816. title: "床垫高/CM",
  2817. basicinfo: {
  2818. el: "input-number",
  2819. props: {
  2820. onChange: (val: any) => {
  2821. const $table = state.subSpecsRef?.element;
  2822. if ($table) {
  2823. const { visibleData } = $table.getTableData();
  2824. visibleData.forEach((o: any) => {
  2825. o.mattress_height = val;
  2826. });
  2827. }
  2828. }
  2829. },
  2830. editable: ALLOW_EDIT_STATE
  2831. }
  2832. },
  2833. {
  2834. field: "if_w_butao",
  2835. title: "顶布裥棉",
  2836. basicinfo: {
  2837. // el: "checkbox",
  2838. // editable: ALLOW_EDIT_STATE
  2839. labelHidden: true,
  2840. render: (scope: any) => {
  2841. console.log("if_w_butao scope :>> ", scope);
  2842. let _disabled = !ALLOW_EDIT_STATE.includes(scope.status);
  2843. return (
  2844. <>
  2845. <el-checkbox
  2846. v-model={scope.searchParam.if_w_butao}
  2847. true-value={1}
  2848. false-value={0}
  2849. disabled={_disabled}
  2850. label="顶布裥棉"
  2851. class="mr-8"
  2852. />
  2853. </>
  2854. );
  2855. }
  2856. }
  2857. },
  2858. {
  2859. field: "biandai_qty",
  2860. title: "边带数",
  2861. basicinfo: {
  2862. el: "input-number",
  2863. editable: (scope: any) => {
  2864. let someone =
  2865. Number(scope.searchParam?.if_m_chai ?? 0) +
  2866. Number(scope.searchParam?.if_z_chai ?? 0) +
  2867. Number(scope.searchParam?.if_d_chai ?? 0);
  2868. if (ALLOW_EDIT_STATE.includes(scope.status) && someone > 0) {
  2869. return true;
  2870. }
  2871. return false;
  2872. }
  2873. }
  2874. },
  2875. {
  2876. field: "if_n_butao",
  2877. title: "内布套",
  2878. basicinfo: {
  2879. labelHidden: true,
  2880. render: (scope: any) => {
  2881. let _disabled = !ALLOW_EDIT_STATE.includes(scope.status);
  2882. return (
  2883. <>
  2884. <el-checkbox
  2885. v-model={scope.searchParam.if_n_butao}
  2886. true-value={1}
  2887. false-value={0}
  2888. disabled={_disabled}
  2889. label="内布套"
  2890. class="mr-8"
  2891. />
  2892. </>
  2893. );
  2894. },
  2895. editvisible: (scope: any) => {
  2896. let someone =
  2897. Number(scope.searchParam?.if_m_chai ?? 0) +
  2898. Number(scope.searchParam?.if_z_chai ?? 0) +
  2899. Number(scope.searchParam?.if_d_chai ?? 0);
  2900. if (someone > 0) {
  2901. return true;
  2902. }
  2903. return false;
  2904. }
  2905. }
  2906. },
  2907. // {
  2908. // field: "s_cover_qty",
  2909. // title: "内布套上覆",
  2910. // basicinfo: {
  2911. // el: "input-number",
  2912. // editable: (scope: any) => {
  2913. // if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.if_n_butao)) {
  2914. // return true;
  2915. // }
  2916. // return false;
  2917. // },
  2918. // editvisible: (scope: any) => {
  2919. // let someone =
  2920. // Number(scope.searchParam?.if_m_chai ?? 0) +
  2921. // Number(scope.searchParam?.if_z_chai ?? 0) +
  2922. // Number(scope.searchParam?.if_d_chai ?? 0);
  2923. // if (someone > 0 && Number(scope.searchParam.if_n_butao)) {
  2924. // return true;
  2925. // }
  2926. // return false;
  2927. // }
  2928. // }
  2929. // },
  2930. // {
  2931. // field: "z_cover_qty",
  2932. // title: "内布套侧覆",
  2933. // basicinfo: {
  2934. // el: "input-number",
  2935. // editable: (scope: any) => {
  2936. // if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.if_n_butao)) {
  2937. // return true;
  2938. // }
  2939. // return false;
  2940. // },
  2941. // editvisible: (scope: any) => {
  2942. // let someone =
  2943. // Number(scope.searchParam?.if_m_chai ?? 0) +
  2944. // Number(scope.searchParam?.if_z_chai ?? 0) +
  2945. // Number(scope.searchParam?.if_d_chai ?? 0);
  2946. // if (someone > 0 && Number(scope.searchParam.if_n_butao)) {
  2947. // return true;
  2948. // }
  2949. // return false;
  2950. // }
  2951. // }
  2952. // },
  2953. // {
  2954. // field: "x_cover_qty",
  2955. // title: "内布套下覆",
  2956. // basicinfo: {
  2957. // el: "input-number",
  2958. // editable: (scope: any) => {
  2959. // if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.if_n_butao)) {
  2960. // return true;
  2961. // }
  2962. // return false;
  2963. // },
  2964. // editvisible: (scope: any) => {
  2965. // let someone =
  2966. // Number(scope.searchParam?.if_m_chai ?? 0) +
  2967. // Number(scope.searchParam?.if_z_chai ?? 0) +
  2968. // Number(scope.searchParam?.if_d_chai ?? 0);
  2969. // if (someone > 0 && Number(scope.searchParam.if_n_butao)) {
  2970. // return true;
  2971. // }
  2972. // return false;
  2973. // }
  2974. // }
  2975. // },
  2976. {
  2977. field: "if_m_wbutao_way",
  2978. title: "面料外布套做法",
  2979. basicinfo: {
  2980. labelHidden: true,
  2981. render: (scope: any) => {
  2982. let _disabled = !ALLOW_EDIT_STATE.includes(scope.status);
  2983. return (
  2984. <>
  2985. <el-checkbox
  2986. v-model={scope.searchParam.if_m_wbutao_way}
  2987. true-value={1}
  2988. false-value={0}
  2989. disabled={_disabled}
  2990. label="面料外布套做法"
  2991. class="mr-8"
  2992. />
  2993. </>
  2994. );
  2995. },
  2996. editvisible: (scope: any) => {
  2997. let someone =
  2998. Number(scope.searchParam?.if_m_chai ?? 0) +
  2999. Number(scope.searchParam?.if_z_chai ?? 0) +
  3000. Number(scope.searchParam?.if_d_chai ?? 0);
  3001. if (someone > 0) {
  3002. return true;
  3003. }
  3004. return false;
  3005. }
  3006. }
  3007. },
  3008. {
  3009. field: "s_m_cover_qty",
  3010. title: "面层向大侧覆盖",
  3011. basicinfo: {
  3012. el: "input-number",
  3013. editable: (scope: any) => {
  3014. if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.if_m_wbutao_way)) {
  3015. return true;
  3016. }
  3017. return false;
  3018. },
  3019. editvisible: (scope: any) => {
  3020. let someone =
  3021. Number(scope.searchParam?.if_m_chai ?? 0) +
  3022. Number(scope.searchParam?.if_z_chai ?? 0) +
  3023. Number(scope.searchParam?.if_d_chai ?? 0);
  3024. if (someone > 0 && Number(scope.searchParam.if_m_wbutao_way)) {
  3025. return true;
  3026. }
  3027. return false;
  3028. }
  3029. }
  3030. },
  3031. {
  3032. field: "z_m_cover_qty",
  3033. title: "大侧向底层覆盖",
  3034. basicinfo: {
  3035. el: "input-number",
  3036. editable: (scope: any) => {
  3037. if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.if_m_wbutao_way)) {
  3038. return true;
  3039. }
  3040. return false;
  3041. },
  3042. editvisible: (scope: any) => {
  3043. let someone =
  3044. Number(scope.searchParam?.if_m_chai ?? 0) +
  3045. Number(scope.searchParam?.if_z_chai ?? 0) +
  3046. Number(scope.searchParam?.if_d_chai ?? 0);
  3047. if (someone > 0 && Number(scope.searchParam.if_m_wbutao_way)) {
  3048. return true;
  3049. }
  3050. return false;
  3051. }
  3052. }
  3053. },
  3054. {
  3055. field: "x_m_cover_qty",
  3056. title: "底层向大侧覆盖",
  3057. basicinfo: {
  3058. el: "input-number",
  3059. editable: (scope: any) => {
  3060. if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.if_m_wbutao_way)) {
  3061. return true;
  3062. }
  3063. return false;
  3064. },
  3065. editvisible: (scope: any) => {
  3066. let someone =
  3067. Number(scope.searchParam?.if_m_chai ?? 0) +
  3068. Number(scope.searchParam?.if_z_chai ?? 0) +
  3069. Number(scope.searchParam?.if_d_chai ?? 0);
  3070. if (someone > 0 && Number(scope.searchParam.if_m_wbutao_way)) {
  3071. return true;
  3072. }
  3073. return false;
  3074. }
  3075. }
  3076. },
  3077. {
  3078. field: "commission",
  3079. title: "佣金点数",
  3080. basicinfo: {
  3081. el: "input-number",
  3082. editable: ALLOW_EDIT_STATE
  3083. }
  3084. },
  3085. {
  3086. field: "other_rate",
  3087. title: "额外点数",
  3088. basicinfo: {
  3089. el: "input-number",
  3090. editable: ALLOW_EDIT_STATE
  3091. }
  3092. },
  3093. {
  3094. field: "extras_cost",
  3095. title: "额外费用",
  3096. basicinfo: {
  3097. el: "input-number",
  3098. editable: ALLOW_EDIT_STATE
  3099. }
  3100. },
  3101. {
  3102. field: "taxes",
  3103. title: "税金",
  3104. enum: [
  3105. {
  3106. label: "不含税",
  3107. value: 1
  3108. },
  3109. {
  3110. label: "含税",
  3111. value: 1.07
  3112. }
  3113. ],
  3114. basicinfo: {
  3115. el: "select",
  3116. editable: ALLOW_EDIT_STATE,
  3117. render: (scope: any) => {
  3118. let optionRender = [];
  3119. let _disabled = !ALLOW_EDIT_STATE.includes(scope.status);
  3120. console.log("taxrate scope.enum :>> ", scope.enum);
  3121. scope.enum.map(item => {
  3122. optionRender.push(<el-option label={item.label} value={item.value} />);
  3123. });
  3124. let slotprefix = {
  3125. prefix: () => {
  3126. return <>{scope.searchParam.taxrate}</>;
  3127. }
  3128. };
  3129. let _taxrate = Number(scope.searchParam.taxrate);
  3130. return (
  3131. <el-select
  3132. v-model={_taxrate}
  3133. v-slots={slotprefix}
  3134. class="select-text-right"
  3135. disabled={_disabled}
  3136. onChange={val => funcTaxrateChange(val, scope.searchParam)}
  3137. >
  3138. {optionRender}
  3139. </el-select>
  3140. );
  3141. }
  3142. }
  3143. },
  3144. {
  3145. field: "moneyrate",
  3146. title: "币种",
  3147. render: (scope: any) => {
  3148. return (
  3149. <>
  3150. <div class="flx-justify-between">
  3151. <span>
  3152. <>{scope.row.moneyrate > 1 ? `美元` : "人民币"}</>
  3153. </span>
  3154. {scope.row.moneyrate > 1 && (
  3155. <span>
  3156. <>{scope.row.moneyrate}</>
  3157. </span>
  3158. )}
  3159. </div>
  3160. </>
  3161. );
  3162. },
  3163. basicinfo: {
  3164. el: "select",
  3165. editable: ALLOW_EDIT_STATE,
  3166. render: (scope: any) => {
  3167. let optionRender = [];
  3168. let _disabled = !ALLOW_EDIT_STATE.includes(scope.status);
  3169. scope.enum.map(item => {
  3170. optionRender.push(<el-option label={item.label} value={item.value} />);
  3171. });
  3172. let slotprefix = {
  3173. prefix: () => {
  3174. return <>{scope.searchParam.moneyrate}</>;
  3175. }
  3176. };
  3177. return (
  3178. <el-select
  3179. v-model={scope.searchParam.if_moneyrate}
  3180. v-slots={slotprefix}
  3181. class="select-text-right"
  3182. disabled={_disabled}
  3183. onChange={val => wf_get_moneyrate_discount(val, scope.searchParam)}
  3184. >
  3185. {optionRender}
  3186. </el-select>
  3187. );
  3188. }
  3189. }
  3190. },
  3191. {
  3192. field: "packtype",
  3193. enum: state.packtypeOptions
  3194. },
  3195. {
  3196. field: "dannum_cost1",
  3197. render: (scope: any) => {
  3198. if (scope.row?.moneyrate > 1) {
  3199. return (
  3200. <div>
  3201. <span class="text-f-s" style="color: var(--lj-color-gray-7)">
  3202. $
  3203. </span>
  3204. {formatAmount3({ val: floatDiv(scope.row?.dannum_cost1 ?? 0, scope.row.moneyrate) })}
  3205. </div>
  3206. );
  3207. } else {
  3208. return formatAmount3({ val: scope.row?.dannum_cost1 ?? 0 });
  3209. }
  3210. }
  3211. },
  3212. {
  3213. field: "dannum_cost2",
  3214. render: (scope: any) => {
  3215. if (scope.row?.moneyrate > 1) {
  3216. return (
  3217. <div>
  3218. <span class="text-f-s" style="color: var(--lj-color-gray-7)">
  3219. $
  3220. </span>
  3221. {formatAmount3({ val: floatDiv(scope.row?.dannum_cost2 ?? 0, scope.row.moneyrate) })}
  3222. </div>
  3223. );
  3224. } else {
  3225. return formatAmount3({ val: scope.row?.dannum_cost2 ?? 0 });
  3226. }
  3227. }
  3228. },
  3229. {
  3230. field: "dannum_cost3",
  3231. render: (scope: any) => {
  3232. if (scope.row?.moneyrate > 1) {
  3233. return (
  3234. <div>
  3235. <span class="text-f-s" style="color: var(--lj-color-gray-7)">
  3236. $
  3237. </span>
  3238. {formatAmount3({ val: floatDiv(scope.row?.dannum_cost3 ?? 0, scope.row.moneyrate) })}
  3239. </div>
  3240. );
  3241. } else {
  3242. return formatAmount3({ val: scope.row?.dannum_cost3 ?? 0 });
  3243. }
  3244. }
  3245. },
  3246. {
  3247. field: "dannum_cost4",
  3248. render: (scope: any) => {
  3249. if (scope.row?.moneyrate > 1) {
  3250. return (
  3251. <div>
  3252. <span class="text-f-s" style="color: var(--lj-color-gray-7)">
  3253. $
  3254. </span>
  3255. {formatAmount3({ val: floatDiv(scope.row?.dannum_cost4 ?? 0, scope.row.moneyrate) })}
  3256. </div>
  3257. );
  3258. } else {
  3259. return formatAmount3({ val: scope.row?.dannum_cost4 ?? 0 });
  3260. }
  3261. }
  3262. },
  3263. {
  3264. field: "createby",
  3265. search: {
  3266. el: "input",
  3267. key: "arg_createby",
  3268. props: {
  3269. placeholder: "搜索登记人"
  3270. }
  3271. // order: 1
  3272. }
  3273. }
  3274. ];
  3275. const columnsMx: ColumnProps<any>[] = [
  3276. { title: "#", type: "seq", fixed: "left", width: 80 },
  3277. {
  3278. title: "计算成功?",
  3279. field: "if_success",
  3280. datatype: "checkbox",
  3281. limited: () => {
  3282. const { userInfo } = useUserStore();
  3283. return userInfo.usermode != 0;
  3284. },
  3285. render: (scope: any) => {
  3286. if (Number(scope.row.if_success)) {
  3287. return (
  3288. <>
  3289. <ElTag type="danger">异常</ElTag>
  3290. </>
  3291. );
  3292. } else {
  3293. return <></>;
  3294. }
  3295. }
  3296. },
  3297. {
  3298. title: "+",
  3299. field: "addmx",
  3300. width: 80,
  3301. render: (scope: any) => {
  3302. let _if_mtrl = Number(scope.row.if_mtrl);
  3303. if (_if_mtrl > 1) {
  3304. if (state.orderStatus) {
  3305. return <ElButton type="primary" plain circle icon={Plus} onClick={() => funcAddMtrlMx(scope)}></ElButton>;
  3306. } else {
  3307. return <>+</>;
  3308. }
  3309. } else {
  3310. return <></>;
  3311. }
  3312. }
  3313. },
  3314. {
  3315. title: "-",
  3316. field: "delmx",
  3317. width: 80,
  3318. render: (scope: any) => {
  3319. let _if_mtrl = Number(scope.row.if_mtrl);
  3320. if (_if_mtrl > 1) {
  3321. if (state.orderStatus) {
  3322. return (
  3323. <>
  3324. <ElPopconfirm
  3325. width="220"
  3326. icon={InfoFilled}
  3327. title={t("business.tips.mattress.delMx")}
  3328. confirm-button-text={t("common.delText")}
  3329. confirm-button-type="danger"
  3330. onConfirm={() => funcDelMtrlMx(scope)}
  3331. >
  3332. {{
  3333. reference: () => {
  3334. return <ElButton type="danger" plain circle icon={Minus} />;
  3335. }
  3336. }}
  3337. </ElPopconfirm>
  3338. </>
  3339. );
  3340. // return <ElButton type="danger" plain circle icon={Minus} onClick={() => funcDelMtrlMx(scope)}></ElButton>;
  3341. } else {
  3342. return <>-</>;
  3343. }
  3344. } else {
  3345. return <></>;
  3346. }
  3347. }
  3348. },
  3349. {
  3350. title: "位置",
  3351. field: "chastr"
  3352. },
  3353. {
  3354. title: "公式名",
  3355. field: "formulakind",
  3356. table: "u_mattress_formula",
  3357. align: "left",
  3358. isFilterEnum: true,
  3359. fieldNames: { value: "value", label: "label" },
  3360. // enum: async () => {
  3361. // let res = await CommonDynamicSelect({
  3362. // dsname: "_Mapper_formulakind",
  3363. // queryparams: {}
  3364. // });
  3365. // return { data: res.datatable };
  3366. // }
  3367. render: (scope: any) => {
  3368. const { column, row, status } = scope;
  3369. let itmName = state.formulaKindEnum.find(t => t.value == row.formulakind)?.label ?? "";
  3370. return <>{itmName}</>;
  3371. }
  3372. },
  3373. {
  3374. title: "按物料?",
  3375. field: "if_mtrl",
  3376. table: "u_mattress_formula",
  3377. enum: [
  3378. {
  3379. value: "0",
  3380. label: "无物料"
  3381. },
  3382. {
  3383. value: "1",
  3384. label: "单物料"
  3385. },
  3386. {
  3387. value: "2",
  3388. label: "多物料"
  3389. }
  3390. ]
  3391. },
  3392. {
  3393. title: "厚度cm",
  3394. field: "thickness",
  3395. datatype: "number",
  3396. editRender: {},
  3397. editColRender: (scope: any) => {
  3398. const { $table, column, row, status } = scope;
  3399. const _disabled = !(
  3400. (row.if_inputqty == 0 && [50, 51, 52, 53, 54, 104, 114, 11, 12, 13, 14, 32, 33].includes(row.formulakind)) ||
  3401. row.formulakind == 202 ||
  3402. row.formulakind == 7
  3403. );
  3404. return <el-input v-model={scope.row.thickness} disabled={_disabled}></el-input>;
  3405. }
  3406. },
  3407. {
  3408. title: "物料",
  3409. field: "mtrlname",
  3410. editRender: {},
  3411. editColRender: (scope: any) => {
  3412. const { $table, column, row, status } = scope;
  3413. let field = column.field;
  3414. let _label = column.title;
  3415. // if (column?.format) {
  3416. // _label = handleRowAccordingToProp(searchParam, field, column?.format);
  3417. // }
  3418. let _pricelistid = getPriceid();
  3419. let _mtrltypeItem: any = mtrltypeTabList.find(t => t.formulakinds.includes(Number(row.formulakind)));
  3420. !_mtrltypeItem && (_mtrltypeItem = { value: -1 });
  3421. let params = {
  3422. mtrltype: _mtrltypeItem.value,
  3423. pricelistid: _pricelistid
  3424. };
  3425. return (
  3426. <>
  3427. <MtrldefSelect
  3428. value={row.mtrlid}
  3429. {...params}
  3430. clearable
  3431. placeholder={_label}
  3432. onOpenModal={() => fModelChoseMtrl(row, params, rModelSetMtrl, _mtrltypeItem.label, $table)}
  3433. onSelect={val => rModelSetMtrl(row, val, $table)}
  3434. onClear={() => rModelClearMtrl(row, $table)}
  3435. >
  3436. {{
  3437. label: () => row.mtrlname
  3438. }}
  3439. </MtrldefSelect>
  3440. </>
  3441. );
  3442. }
  3443. },
  3444. {
  3445. title: "数量/长度",
  3446. field: "qty",
  3447. datatype: "number",
  3448. editRender: {},
  3449. editColRender: (scope: any) => {
  3450. const { $table, column, row, status } = scope;
  3451. // 面料(面、底、侧)的数量/长度,不能输入
  3452. let arr = [
  3453. {
  3454. // label: "裥面",
  3455. type: [0, 80, 40, 50, 60, 70, 9000]
  3456. },
  3457. {
  3458. // label: "裥底",
  3459. type: [1, 81, 41, 51, 61, 71, 9001]
  3460. },
  3461. {
  3462. // label: "裥大恻",
  3463. type: [2, 82, 42, 52, 62, 72, 9002]
  3464. }
  3465. // {
  3466. // // label: "裥小恻",
  3467. // type: [3, 83, 43, 53, 63, 73, 9003]
  3468. // // ref: "fabricMxTab11Ref"
  3469. // },
  3470. // {
  3471. // // label: "裥V恻",
  3472. // type: [4, 84, 44, 54, 64, 74, 9004]
  3473. // // ref: "fabricMxTab12Ref"
  3474. // }
  3475. ];
  3476. let _disabled = arr.some(t => t.type.includes(row.formulakind));
  3477. return <el-input v-model={scope.row.qty} type="number" disabled={row.mtrlid == 0 || _disabled}></el-input>;
  3478. }
  3479. },
  3480. {
  3481. title: "规格宽/CM",
  3482. field: "mattress_width",
  3483. visible: false
  3484. },
  3485. {
  3486. title: "规格长/CM",
  3487. field: "mattress_length",
  3488. visible: false
  3489. },
  3490. {
  3491. title: "物料单价",
  3492. field: "price",
  3493. datatype: "number",
  3494. limited: () => {
  3495. return userInfo.usermode != 0;
  3496. }
  3497. },
  3498. {
  3499. title: "单位",
  3500. field: "priceunit"
  3501. },
  3502. {
  3503. title: "收缩率",
  3504. field: "shrinkage",
  3505. datatype: "number",
  3506. limited: () => {
  3507. return userInfo.usermode != 0;
  3508. }
  3509. },
  3510. {
  3511. title: "克重",
  3512. field: "gram_weight",
  3513. datatype: "number",
  3514. limited: () => {
  3515. return userInfo.usermode != 0;
  3516. }
  3517. },
  3518. {
  3519. title: "幅宽",
  3520. field: "cloth_width",
  3521. datatype: "number",
  3522. limited: () => {
  3523. return userInfo.usermode != 0;
  3524. }
  3525. },
  3526. {
  3527. title: "固定厚度?",
  3528. field: "if_inputqty",
  3529. datatype: "checkbox",
  3530. limited: () => {
  3531. return userInfo.usermode != 0;
  3532. }
  3533. },
  3534. {
  3535. title: "按面积单价?",
  3536. field: "if_areaprice",
  3537. datatype: "checkbox",
  3538. limited: () => {
  3539. return userInfo.usermode != 0;
  3540. }
  3541. },
  3542. {
  3543. title: "成本金额",
  3544. field: "costamt",
  3545. datatype: "number",
  3546. limited: () => {
  3547. return userInfo.usermode != 0;
  3548. }
  3549. },
  3550. {
  3551. title: "标准\r\n成本金额",
  3552. field: "dannum2_rate",
  3553. datatype: "number",
  3554. limited: () => {
  3555. return userInfo.usermode != 0;
  3556. },
  3557. render: (scope: any) => {
  3558. if (scope.row.hasOwnProperty("dannum2_cost")) {
  3559. return formatCutNumber({ val: scope.row.dannum2_cost });
  3560. }
  3561. return formatCutNumber({ val: floatMul(scope.row.costamt, 1 + scope.row.dannum2_rate) });
  3562. }
  3563. },
  3564. {
  3565. title: "散单\r\n成本金额",
  3566. field: "dannum1_rate",
  3567. datatype: "number",
  3568. limited: () => {
  3569. return userInfo.usermode != 0;
  3570. },
  3571. render: (scope: any) => {
  3572. if (scope.row.hasOwnProperty("dannum1_cost")) {
  3573. return formatCutNumber({ val: scope.row.dannum1_cost });
  3574. }
  3575. return formatCutNumber({ val: floatMul(scope.row.costamt, 1 + scope.row.dannum1_rate) });
  3576. }
  3577. },
  3578. {
  3579. title: "大单\r\n成本金额",
  3580. field: "dannum3_rate",
  3581. datatype: "number",
  3582. limited: () => {
  3583. return userInfo.usermode != 0;
  3584. },
  3585. render: (scope: any) => {
  3586. if (scope.row.hasOwnProperty("dannum3_cost")) {
  3587. return formatCutNumber({ val: scope.row.dannum3_cost });
  3588. }
  3589. return formatCutNumber({ val: floatMul(scope.row.costamt, 1 + scope.row.dannum3_rate) });
  3590. }
  3591. },
  3592. {
  3593. title: "小单\r\n成本金额",
  3594. field: "dannum4_rate",
  3595. datatype: "number",
  3596. limited: () => {
  3597. return userInfo.usermode != 0;
  3598. },
  3599. render: (scope: any) => {
  3600. if (scope.row.hasOwnProperty("dannum4_cost")) {
  3601. return formatCutNumber({ val: scope.row.dannum4_cost });
  3602. }
  3603. return formatCutNumber({ val: floatMul(scope.row.costamt, 1 + scope.row.dannum4_rate) });
  3604. }
  3605. },
  3606. {
  3607. title: "金额文本公式",
  3608. field: "formula",
  3609. limited: () => {
  3610. return userInfo.usermode != 0;
  3611. }
  3612. },
  3613. {
  3614. title: "金额数字公式",
  3615. field: "replace_formula",
  3616. limited: () => {
  3617. return userInfo.usermode != 0;
  3618. }
  3619. },
  3620. {
  3621. title: "清单用量",
  3622. field: "useqty",
  3623. datatype: "number",
  3624. limited: () => {
  3625. return userInfo.usermode != 0;
  3626. }
  3627. },
  3628. {
  3629. title: "用量文本公式",
  3630. field: "useformula",
  3631. limited: () => {
  3632. return userInfo.usermode != 0;
  3633. }
  3634. },
  3635. {
  3636. title: "用量数字公式",
  3637. field: "replace_useformula",
  3638. limited: () => {
  3639. return userInfo.usermode != 0;
  3640. }
  3641. },
  3642. {
  3643. title: "工艺填写说明",
  3644. field: "gydscrp",
  3645. editRender: {
  3646. name: "input",
  3647. props: {
  3648. type: "textarea"
  3649. }
  3650. }
  3651. }
  3652. ];
  3653. // /**
  3654. // * @description 主表计算公式
  3655. // */
  3656. // const summaryData = ref<any>([
  3657. // {
  3658. // label: "总成本",
  3659. // field: "total_cost",
  3660. // formula:
  3661. // "if([折叠款] = 1, ([总材料成本]*[大小单]+[款式费用]+[边带费用]+[额外费用]+[制造费用]) * 2, [总材料成本]*[大小单]+[款式费用]+[边带费用]+[额外费用]+[制造费用])",
  3662. // power: () => {
  3663. // if (userInfo.empid != 0 && userInfo.usermode != 0) {
  3664. // return false;
  3665. // } else {
  3666. // return true;
  3667. // }
  3668. // }
  3669. // },
  3670. // {
  3671. // label: "不含税出厂价",
  3672. // field: "nottax_factory_cost",
  3673. // formula: "[总成本] * ([工厂利润率] + [利润率点数] + [布套点数] + [拆装点数] + [海绵点数]) * [管理费点]"
  3674. // },
  3675. // {
  3676. // label: "部门售价",
  3677. // field: "nottax_dept_cost",
  3678. // formula: "[dijia_cost] / (1 - ([佣金点数] - 1)) * [额外点数] + [fob]"
  3679. // },
  3680. // {
  3681. // label: "税金",
  3682. // field: "taxes",
  3683. // formula: "([部门售价] * ([税率] - 1)) + [佣金] * 0.05"
  3684. // },
  3685. // {
  3686. // label: "部门含税价",
  3687. // field: "dept_cost",
  3688. // formula: "([部门售价] + [佣金] * 0.06) * [税率] * if([fob] = 0, 1, [折扣率])"
  3689. // },
  3690. // {
  3691. // label: "外币价",
  3692. // field: "foreign_cost",
  3693. // formula: "if([汇率] <> 0, [部门含税价] / [汇率], 0)"
  3694. // },
  3695. // {
  3696. // label: "底价 ",
  3697. // field: "dijia_cost_cp",
  3698. // formula: "if(([dept_profitrate] + [dept_profitrate_rangli] / 100) <> 0, [dijia_cost] ,0 )"
  3699. // },
  3700. // {
  3701. // label: "佣金",
  3702. // field: "commission_cp",
  3703. // formula: "[dijia_cost] / (1 - ([佣金点数] - 1 )) - [dijia_cost]"
  3704. // },
  3705. // {
  3706. // label: "FOB",
  3707. // field: "fob",
  3708. // formula: "[fob]"
  3709. // }
  3710. // ]);
  3711. // /**
  3712. // * @description 主表公式字段照表
  3713. // */
  3714. // const fieldParams = ref<any>([
  3715. // {
  3716. // label: "总成本",
  3717. // field: "total_cost"
  3718. // },
  3719. // {
  3720. // label: "不含税出厂价",
  3721. // field: "nottax_factory_cost"
  3722. // },
  3723. // {
  3724. // label: "部门售价",
  3725. // field: "nottax_dept_cost"
  3726. // },
  3727. // {
  3728. // label: "税金",
  3729. // field: "taxes"
  3730. // },
  3731. // {
  3732. // label: "部门含税价",
  3733. // field: "dept_cost"
  3734. // },
  3735. // {
  3736. // label: "外币价",
  3737. // field: "foreign_cost"
  3738. // },
  3739. // {
  3740. // label: "总材料成本",
  3741. // field: "total_material_cost"
  3742. // },
  3743. // {
  3744. // label: "大小单",
  3745. // field: "dannum_rate"
  3746. // },
  3747. // {
  3748. // label: "款式费用",
  3749. // field: "hrcost"
  3750. // },
  3751. // {
  3752. // label: "边带费用",
  3753. // field: "biandaicost"
  3754. // },
  3755. // {
  3756. // label: "额外费用",
  3757. // field: "extras_cost"
  3758. // },
  3759. // {
  3760. // label: "制造费用",
  3761. // field: "zhizao_amt"
  3762. // },
  3763. // {
  3764. // label: "折叠款",
  3765. // field: "if_zhedie_type"
  3766. // },
  3767. // {
  3768. // label: "管理费点",
  3769. // field: "guanli_rate"
  3770. // },
  3771. // {
  3772. // label: "工厂利润率",
  3773. // field: "profitrate"
  3774. // },
  3775. // {
  3776. // label: "利润率点数",
  3777. // field: "profitrate_point"
  3778. // },
  3779. // {
  3780. // label: "布套点数",
  3781. // field: "butao_point"
  3782. // },
  3783. // {
  3784. // label: "拆装点数",
  3785. // field: "chaizhuang_point"
  3786. // },
  3787. // {
  3788. // label: "海绵点数",
  3789. // field: "haimian_point"
  3790. // },
  3791. // {
  3792. // label: "部门利润率",
  3793. // field: "dept_profitrate"
  3794. // },
  3795. // {
  3796. // label: "部门让利点",
  3797. // field: "dept_profitrate_rangli"
  3798. // },
  3799. // {
  3800. // label: "额外点数",
  3801. // field: "other_rate"
  3802. // },
  3803. // {
  3804. // label: "佣金点数",
  3805. // field: "commission"
  3806. // },
  3807. // {
  3808. // label: "税率",
  3809. // field: "taxrate"
  3810. // },
  3811. // {
  3812. // label: "折扣率",
  3813. // field: "discount"
  3814. // },
  3815. // {
  3816. // label: "汇率",
  3817. // field: "moneyrate"
  3818. // },
  3819. // {
  3820. // label: "底价",
  3821. // field: "dijia_cost"
  3822. // }
  3823. // ]);
  3824. // /**
  3825. // * @description 明细公式字段照表
  3826. // */
  3827. // const fieldMxParams = ref<any>([
  3828. // {
  3829. // label: "名称前2位",
  3830. // field: "ls_temp_left_2"
  3831. // },
  3832. // {
  3833. // label: "规格宽",
  3834. // field: "ls_mattress_width"
  3835. // },
  3836. // {
  3837. // label: "规格长",
  3838. // field: "ls_mattress_length"
  3839. // },
  3840. // {
  3841. // label: "规格高",
  3842. // field: "ls_mattress_height"
  3843. // },
  3844. // {
  3845. // label: "压包数量",
  3846. // field: "ls_packqty"
  3847. // },
  3848. // {
  3849. // label: "卷包直径",
  3850. // field: "ls_diameter"
  3851. // },
  3852. // {
  3853. // label: "顶布裥棉外布套做法",
  3854. // field: "ls_if_db_wbutao_way"
  3855. // },
  3856. // {
  3857. // label: "面料外布套做法",
  3858. // field: "ls_if_m_wbutao_way"
  3859. // },
  3860. // {
  3861. // label: "内布套上覆",
  3862. // field: "ls_s_cover_qty"
  3863. // },
  3864. // {
  3865. // label: "内布套侧覆",
  3866. // field: "ls_z_cover_qty"
  3867. // },
  3868. // {
  3869. // label: "内布套下覆",
  3870. // field: "ls_x_cover_qty"
  3871. // },
  3872. // {
  3873. // label: "面料上覆",
  3874. // field: "ls_s_m_cover_qty"
  3875. // },
  3876. // {
  3877. // label: "面料侧覆",
  3878. // field: "ls_z_m_cover_qty"
  3879. // },
  3880. // {
  3881. // label: "面料下覆",
  3882. // field: "ls_x_m_cover_qty"
  3883. // },
  3884. // {
  3885. // label: "面拆",
  3886. // field: "ls_if_m_chai"
  3887. // },
  3888. // {
  3889. // label: "中拆",
  3890. // field: "ls_if_z_chai"
  3891. // },
  3892. // {
  3893. // label: "底拆",
  3894. // field: "ls_if_d_chai"
  3895. // },
  3896. // {
  3897. // label: "物料单价",
  3898. // field: "ls_price"
  3899. // },
  3900. // {
  3901. // label: "物料克重",
  3902. // field: "ls_gram_weight"
  3903. // },
  3904. // {
  3905. // label: "幅宽",
  3906. // field: "ls_cloth_width"
  3907. // },
  3908. // {
  3909. // label: "数量",
  3910. // field: "ls_qty"
  3911. // },
  3912. // {
  3913. // label: "物料厚度",
  3914. // field: "ls_if_inputqty"
  3915. // },
  3916. // {
  3917. // label: "固定厚度",
  3918. // field: "ls_if_inputqty"
  3919. // },
  3920. // {
  3921. // label: "厚度",
  3922. // field: "ls_thickness"
  3923. // },
  3924. // {
  3925. // label: "按面积单价",
  3926. // field: "ls_if_areaprice"
  3927. // },
  3928. // {
  3929. // label: "物料名称",
  3930. // field: "ls_mtrlname"
  3931. // },
  3932. // {
  3933. // label: "木托方式",
  3934. // field: "ls_woodpallettype",
  3935. // enum: [
  3936. // { label: " '普通木托' ", value: "0" },
  3937. // { label: " '夹板木托' ", value: "1" },
  3938. // { label: " '铁管木托' ", value: "2" }
  3939. // ]
  3940. // }
  3941. // ]);
  3942. // /**
  3943. // * @description 明细表计算公式
  3944. // */
  3945. // const summaryMxData = ref<any>([
  3946. // {
  3947. // label: "计算成本金额",
  3948. // field: "costamt",
  3949. // formula: ""
  3950. // },
  3951. // {
  3952. // label: "计算清单用量",
  3953. // field: "useqty",
  3954. // formula: ""
  3955. // }
  3956. // ]);
  3957. const funcMergeColumn = (columns: any, target: any, extra?: any) => {
  3958. let col = columns.map(t => {
  3959. let itm = target.find(item => t.field === item.field);
  3960. if (itm) {
  3961. t = defaultsDeep(itm, t);
  3962. }
  3963. return t;
  3964. });
  3965. if (extra) {
  3966. col = col.concat(extra);
  3967. }
  3968. return col;
  3969. };
  3970. // const cushionsEdit = reactive<any>({
  3971. // name: "VxeSelect",
  3972. // options: state.formulaKindDcEnum,
  3973. // optionProps: {
  3974. // label: "label",
  3975. // value: "value"
  3976. // }
  3977. // });
  3978. const bednetCoumns: ColumnProps<any>[] = [
  3979. {
  3980. title: "位置",
  3981. field: "chastr",
  3982. visible: false
  3983. },
  3984. {
  3985. title: "床网",
  3986. field: "mtrlname",
  3987. editRender: {},
  3988. width: 250,
  3989. editColRender: (scope: any) => {
  3990. const { column, row, status, $table } = scope;
  3991. let _label = column.title;
  3992. let _deptid = state.LjDetailRef._mainData.deptid;
  3993. let params = {
  3994. deptid: _deptid,
  3995. mattress_width: state.LjDetailRef._mainData.mattress_width,
  3996. mattress_length: state.LjDetailRef._mainData.mattress_length
  3997. };
  3998. return (
  3999. <BednetSelect
  4000. value={row.mtrlid}
  4001. {...params}
  4002. clearable
  4003. placeholder={_label}
  4004. onOpenModal={() => fModelChoseBednet(row, params, $table)}
  4005. onSelect={(val: any) => rModelSetBednet(row, val, $table)}
  4006. onClear={() => rModelClearBednet(row, $table)}
  4007. >
  4008. {{
  4009. label: () => row.mtrlname
  4010. }}
  4011. </BednetSelect>
  4012. );
  4013. }
  4014. },
  4015. {
  4016. title: "+",
  4017. field: "addmx",
  4018. width: 80,
  4019. render: (scope: any) => {
  4020. let _if_mtrl = Number(scope.row.if_mtrl);
  4021. if (_if_mtrl > 1) {
  4022. if (state.orderStatus) {
  4023. return (
  4024. <ElPopconfirm
  4025. width="220"
  4026. icon={InfoFilled}
  4027. title={t("business.tips.mattress.addMx")}
  4028. confirm-button-text={t("common.addText")}
  4029. onConfirm={() => funcAddMtrlMx(scope, () => wf_rtr_cwdc(scope.row, null, "add"))}
  4030. >
  4031. {{
  4032. reference: () => {
  4033. return <ElButton type="primary" plain circle icon={Plus}></ElButton>;
  4034. }
  4035. }}
  4036. </ElPopconfirm>
  4037. );
  4038. } else {
  4039. return "+";
  4040. }
  4041. } else {
  4042. return "";
  4043. }
  4044. }
  4045. },
  4046. {
  4047. title: "-",
  4048. field: "delmx",
  4049. width: 80,
  4050. render: (scope: any) => {
  4051. let _if_mtrl = Number(scope.row.if_mtrl);
  4052. if (_if_mtrl > 1) {
  4053. if (state.orderStatus) {
  4054. return (
  4055. <ElPopconfirm
  4056. width="220"
  4057. icon={InfoFilled}
  4058. title={t("business.tips.mattress.delMx")}
  4059. confirm-button-text={t("common.delText")}
  4060. confirm-button-type="danger"
  4061. onConfirm={() => funcDelBednet(scope, () => wf_rtr_cwdc(scope.row, null, "del"))}
  4062. >
  4063. {{
  4064. reference: () => {
  4065. return <ElButton type="danger" plain circle icon={Minus} />;
  4066. }
  4067. }}
  4068. </ElPopconfirm>
  4069. );
  4070. } else {
  4071. return "-";
  4072. }
  4073. } else {
  4074. return "";
  4075. }
  4076. }
  4077. }
  4078. ];
  4079. const bednetExtraColumns: ColumnProps<any>[] = [
  4080. {
  4081. title: "弹簧排列个数-宽",
  4082. field: "spring_qty_width",
  4083. datatype: "integer"
  4084. // editRender: {
  4085. // name: "$input"
  4086. // // props: {
  4087. // // type: "number"
  4088. // // }
  4089. // }
  4090. },
  4091. {
  4092. title: "弹簧排列个数-长",
  4093. field: "spring_qty_length",
  4094. datatype: "integer"
  4095. // editRender: {
  4096. // name: "$input"
  4097. // // props: {
  4098. // // type: "number"
  4099. // // }
  4100. // }
  4101. }
  4102. ];
  4103. const cushionsColumns: ColumnProps<any>[] = [
  4104. {
  4105. title: "位置",
  4106. field: "chastr",
  4107. editRender: {},
  4108. editColRender: (scope: any) => {
  4109. return (
  4110. <el-select v-model={scope.row.chastr}>
  4111. {{
  4112. default: () => {
  4113. let rs = [];
  4114. if (state.diancengAreaEnum.length) {
  4115. state.diancengAreaEnum.map((t: any) => {
  4116. rs.push(<el-option label={t.label} value={t.value} />);
  4117. });
  4118. }
  4119. return rs;
  4120. }
  4121. }}
  4122. </el-select>
  4123. );
  4124. }
  4125. },
  4126. {
  4127. title: "公式名",
  4128. field: "formulakind",
  4129. table: "u_mattress_formula",
  4130. align: "left",
  4131. isFilterEnum: true,
  4132. fieldNames: { value: "value", label: "label" },
  4133. // editRender: {
  4134. // name: "VxeSelect",
  4135. // options: state.formulaKindDcEnum
  4136. // }
  4137. // editRender: cushionsEdit
  4138. // render: (scope: any) => {
  4139. // const { column, row, status } = scope;
  4140. // let itmName = state.formulaKindEnum.find(t => t.value == row.formulakind)?.label ?? "";
  4141. // return <>{itmName}</>;
  4142. // },
  4143. editRender: {},
  4144. editColRender: (scope: any) => {
  4145. let lastVal = scope.row.formulakind;
  4146. return (
  4147. <el-select v-model={scope.row.formulakind} onChange={val => cushionsFormulaKindChange(val, lastVal, scope)}>
  4148. {{
  4149. default: () => {
  4150. let rs = [];
  4151. if (state.formulaKindDcEnum.length) {
  4152. state.formulaKindDcEnum.map((t: any) => {
  4153. rs.push(<el-option label={t.label} value={t.value} />);
  4154. });
  4155. }
  4156. return rs;
  4157. }
  4158. }}
  4159. </el-select>
  4160. );
  4161. }
  4162. },
  4163. {
  4164. title: "+",
  4165. field: "addmx",
  4166. visible: false
  4167. },
  4168. {
  4169. title: "-",
  4170. field: "delmx",
  4171. visible: false
  4172. },
  4173. {
  4174. title: "按物料?",
  4175. field: "if_mtrl",
  4176. visible: false
  4177. },
  4178. {
  4179. title: "物料",
  4180. field: "mtrlname",
  4181. editRender: {},
  4182. editColRender: (scope: any) => {
  4183. const { column, row, status, $table } = scope;
  4184. let _label = column.title;
  4185. let _pricelistid = getPriceid();
  4186. let _mtrltypeItem: any = mtrltypeTabList_cushions.find(t => t.formulakinds.includes(Number(row.formulakind)));
  4187. if (!_mtrltypeItem) {
  4188. // ElMessage.error("不是垫层类型行,不能选物料");
  4189. // return <></>;
  4190. }
  4191. console.log("垫层 row.formulakind :>> ", row.formulakind, _mtrltypeItem);
  4192. let params = {
  4193. mtrltype: _mtrltypeItem?.value,
  4194. pricelistid: _pricelistid
  4195. };
  4196. return (
  4197. <>
  4198. <MtrldefSelect
  4199. value={row.mtrlid}
  4200. {...params}
  4201. disabled={!_mtrltypeItem}
  4202. clearable
  4203. placeholder={_label}
  4204. onOpenModal={() => fModelChoseMtrl(row, params, rModelSetMtrl, _mtrltypeItem?.label, $table)}
  4205. onSelect={(val: any) => rModelSetMtrl(row, val, $table)}
  4206. onClear={() => rModelClearMtrl(row, $table)}
  4207. >
  4208. {{
  4209. label: () => row.mtrlname
  4210. }}
  4211. </MtrldefSelect>
  4212. </>
  4213. );
  4214. }
  4215. },
  4216. {
  4217. title: "规格宽/CM",
  4218. field: "mattress_width",
  4219. datatype: "number",
  4220. editRender: {
  4221. name: "input"
  4222. },
  4223. visible: true
  4224. },
  4225. {
  4226. title: "规格长/CM",
  4227. field: "mattress_length",
  4228. datatype: "number",
  4229. editRender: {
  4230. name: "input"
  4231. },
  4232. visible: true
  4233. },
  4234. {
  4235. title: "厚度cm",
  4236. field: "thickness",
  4237. datatype: "number",
  4238. editRender: {},
  4239. editColRender: (scope: any) => {
  4240. const { $table, column, row, status } = scope;
  4241. const _disabled = !(
  4242. (row.if_inputqty == 0 && [50, 51, 52, 53, 54, 104, 114, 11, 14, 32, 33].includes(row.formulakind)) ||
  4243. row.formulakind == 7 ||
  4244. row.formulakind == 999
  4245. );
  4246. return <el-input v-model={scope.row.thickness} type="number" disabled={_disabled}></el-input>;
  4247. }
  4248. }
  4249. ];
  4250. const accessoriesColumns: ColumnProps<any>[] = [
  4251. {
  4252. title: "位置",
  4253. field: "chastr",
  4254. visible: false
  4255. },
  4256. {
  4257. title: "物料",
  4258. field: "mtrlname",
  4259. editRender: {},
  4260. editColRender: (scope: any) => {
  4261. const { column, row, status, $table } = scope;
  4262. let field = column.field;
  4263. let _label = column.title;
  4264. // if (column?.format) {
  4265. // _label = handleRowAccordingToProp(searchParam, field, column?.format);
  4266. // }
  4267. let _pricelistid = getPriceid();
  4268. let _mtrltypeItem: any = mtrltypeTabList_accessories.find(t => t.formulakinds.includes(Number(row.formulakind)));
  4269. if (!_mtrltypeItem) {
  4270. ElMessage.error("不是辅料类型行,不能选物料");
  4271. return "";
  4272. }
  4273. let params = {
  4274. mtrltype: _mtrltypeItem.value,
  4275. pricelistid: _pricelistid
  4276. };
  4277. return (
  4278. <>
  4279. <MtrldefSelect
  4280. value={row.mtrlid}
  4281. {...params}
  4282. clearable
  4283. placeholder={_label}
  4284. onOpenModal={() => fModelChoseMtrl(row, params, rModelSetMtrl, _mtrltypeItem.label, $table)}
  4285. onSelect={(val: any) => rModelSetMtrl(row, val, $table)}
  4286. onClear={() => rModelClearMtrl(row, $table)}
  4287. >
  4288. {{
  4289. label: () => row.mtrlname
  4290. }}
  4291. </MtrldefSelect>
  4292. </>
  4293. );
  4294. }
  4295. },
  4296. {
  4297. title: "厚度cm",
  4298. field: "thickness",
  4299. limited: true
  4300. }
  4301. ];
  4302. const packagColumns: ColumnProps<any>[] = [
  4303. {
  4304. title: "位置",
  4305. field: "chastr",
  4306. visible: false
  4307. },
  4308. {
  4309. title: "物料",
  4310. field: "mtrlname",
  4311. editRender: {},
  4312. editColRender: (scope: any) => {
  4313. const { column, row, status, $table } = scope;
  4314. let field = column.field;
  4315. let _label = column.title;
  4316. // if (column?.format) {
  4317. // _label = handleRowAccordingToProp(searchParam, field, column?.format);
  4318. // }
  4319. let _pricelistid = getPriceid();
  4320. let _mtrltypeItem: any = mtrltypeTabList_packag.find(t => t.formulakinds.includes(Number(row.formulakind)));
  4321. !_mtrltypeItem && (_mtrltypeItem = { value: -1 });
  4322. let params = {
  4323. mtrltype: _mtrltypeItem.value,
  4324. pricelistid: _pricelistid
  4325. };
  4326. return (
  4327. <>
  4328. <MtrldefSelect
  4329. value={row.mtrlid}
  4330. {...params}
  4331. clearable
  4332. placeholder={_label}
  4333. onOpenModal={() => fModelChoseMtrl(row, params, rModelSetMtrl, _mtrltypeItem.label, $table)}
  4334. onSelect={(val: any) => rModelSetMtrl(row, val, $table)}
  4335. onClear={() => rModelClearMtrl(row, $table)}
  4336. >
  4337. {{
  4338. label: () => row.mtrlname
  4339. }}
  4340. </MtrldefSelect>
  4341. </>
  4342. );
  4343. }
  4344. },
  4345. {
  4346. title: "厚度cm",
  4347. field: "thickness",
  4348. limited: true
  4349. }
  4350. ];
  4351. const columnsMxInnerClothLayer: ColumnProps<any>[] = [
  4352. {
  4353. title: "计算成功?",
  4354. field: "if_success",
  4355. datatype: "checkbox",
  4356. limited: () => {
  4357. const { userInfo } = useUserStore();
  4358. return userInfo.usermode != 0;
  4359. },
  4360. render: (scope: any) => {
  4361. if (Number(scope.row.if_success)) {
  4362. return (
  4363. <>
  4364. <ElTag type="danger">异常</ElTag>
  4365. </>
  4366. );
  4367. } else {
  4368. return <></>;
  4369. }
  4370. }
  4371. },
  4372. {
  4373. title: "位置",
  4374. field: "chastr"
  4375. // treeNode: true
  4376. },
  4377. {
  4378. title: "+",
  4379. field: "addmx",
  4380. width: 80,
  4381. render: (scope: any) => {
  4382. let _if_mtrl = Number(scope.row.if_mtrl);
  4383. if (_if_mtrl > 1) {
  4384. if (state.orderStatus) {
  4385. return (
  4386. <>
  4387. <ElPopconfirm
  4388. width="220"
  4389. icon={InfoFilled}
  4390. title={t("business.tips.mattress.addMx")}
  4391. confirm-button-text={t("common.addText")}
  4392. onConfirm={() => funcAddMtrlMx(scope)}
  4393. >
  4394. {{
  4395. reference: () => {
  4396. return <ElButton type="primary" plain circle icon={Plus}></ElButton>;
  4397. }
  4398. }}
  4399. </ElPopconfirm>
  4400. </>
  4401. );
  4402. // return <ElButton type="primary" plain circle icon={Plus} onClick={() => funcAddMtrlMx(scope)}></ElButton>;
  4403. } else {
  4404. return <>+</>;
  4405. }
  4406. } else {
  4407. return <></>;
  4408. }
  4409. }
  4410. },
  4411. {
  4412. title: "-",
  4413. field: "delmx",
  4414. width: 80,
  4415. render: (scope: any) => {
  4416. let _if_mtrl = Number(scope.row.if_mtrl);
  4417. if (_if_mtrl > 1) {
  4418. if (state.orderStatus) {
  4419. return (
  4420. <>
  4421. <ElPopconfirm
  4422. width="220"
  4423. icon={InfoFilled}
  4424. title={t("business.tips.mattress.delMx")}
  4425. confirm-button-text={t("common.delText")}
  4426. confirm-button-type="danger"
  4427. onConfirm={() => funcDelMtrlMx(scope)}
  4428. >
  4429. {{
  4430. reference: () => {
  4431. return <ElButton type="danger" plain circle icon={Minus} />;
  4432. }
  4433. }}
  4434. </ElPopconfirm>
  4435. </>
  4436. );
  4437. // return <ElButton type="danger" plain circle icon={Minus} onClick={() => funcDelMtrlMx(scope)}></ElButton>;
  4438. } else {
  4439. return <>-</>;
  4440. }
  4441. } else {
  4442. return <></>;
  4443. }
  4444. }
  4445. },
  4446. {
  4447. title: "厚度cm",
  4448. field: "thickness",
  4449. datatype: "number",
  4450. editRender: {},
  4451. editColRender: (scope: any) => {
  4452. const { $table, column, row, status } = scope;
  4453. const _disabled = !(
  4454. (row.if_inputqty == 0 && [50, 51, 52, 53, 54, 104, 114, 11, 14, 32, 33].includes(row.formulakind)) ||
  4455. row.formulakind == 202 ||
  4456. row.formulakind == 203
  4457. );
  4458. return <el-input v-model={scope.row.thickness} type="number" disabled={_disabled}></el-input>;
  4459. }
  4460. },
  4461. {
  4462. title: "物料",
  4463. field: "mtrlname",
  4464. editRender: {},
  4465. editColRender: (scope: any) => {
  4466. const { column, row, status, $table } = scope;
  4467. let _label = column.title;
  4468. let _pricelistid = getPriceid();
  4469. let _mtrltypeItem: any = mtrltypeTabList_inner.find(t => t.formulakinds.includes(Number(row.formulakind)));
  4470. !_mtrltypeItem && (_mtrltypeItem = { value: -1 });
  4471. let params = {
  4472. mtrltype: _mtrltypeItem.value,
  4473. pricelistid: _pricelistid
  4474. };
  4475. return (
  4476. <>
  4477. <MtrldefSelect
  4478. value={row.mtrlid}
  4479. {...params}
  4480. clearable
  4481. placeholder={_label}
  4482. onOpenModal={() => fModelChoseMtrl(row, params, rModelSetMtrlInner, _mtrltypeItem.label, $table)}
  4483. onSelect={(val: any) => rModelSetMtrlInner(row, val, $table)}
  4484. onClear={() => rModelClearMtrl(row, $table)}
  4485. >
  4486. {{
  4487. label: () => row.mtrlname
  4488. }}
  4489. </MtrldefSelect>
  4490. </>
  4491. );
  4492. }
  4493. },
  4494. {
  4495. title: "数量/长度",
  4496. field: "qty",
  4497. datatype: "number",
  4498. editRender: {},
  4499. editColRender: (scope: any) => {
  4500. const { $table, column, row, status } = scope;
  4501. return <el-input v-model={scope.row.qty} type="number" disabled={row.mtrlid == 0}></el-input>;
  4502. }
  4503. },
  4504. {
  4505. title: "规格宽/CM",
  4506. field: "mattress_width",
  4507. datatype: "number",
  4508. editRender: {
  4509. name: "input"
  4510. }
  4511. },
  4512. {
  4513. title: "规格长/CM",
  4514. field: "mattress_length",
  4515. datatype: "number",
  4516. editRender: {
  4517. name: "input"
  4518. }
  4519. },
  4520. {
  4521. title: "标准\r\n成本金额",
  4522. field: "dannum2_rate",
  4523. datatype: "number",
  4524. limited: () => {
  4525. return userInfo.usermode != 0;
  4526. },
  4527. render: (scope: any) => {
  4528. return formatCutNumber({ val: floatMul(scope.row.costamt, 1 + scope.row.dannum2_rate) });
  4529. }
  4530. },
  4531. {
  4532. title: "散单\r\n成本金额",
  4533. field: "dannum1_rate",
  4534. datatype: "number",
  4535. limited: () => {
  4536. return userInfo.usermode != 0;
  4537. },
  4538. render: (scope: any) => {
  4539. return formatCutNumber({ val: floatMul(scope.row.costamt, 1 + scope.row.dannum1_rate) });
  4540. }
  4541. },
  4542. {
  4543. title: "大单\r\n成本金额",
  4544. field: "dannum3_rate",
  4545. datatype: "number",
  4546. limited: () => {
  4547. return userInfo.usermode != 0;
  4548. },
  4549. render: (scope: any) => {
  4550. return formatCutNumber({ val: floatMul(scope.row.costamt, 1 + scope.row.dannum3_rate) });
  4551. }
  4552. },
  4553. {
  4554. title: "小单\r\n成本金额",
  4555. field: "dannum4_rate",
  4556. datatype: "number",
  4557. limited: () => {
  4558. return userInfo.usermode != 0;
  4559. },
  4560. render: (scope: any) => {
  4561. return formatCutNumber({ val: floatMul(scope.row.costamt, 1 + scope.row.dannum4_rate) });
  4562. }
  4563. }
  4564. ];
  4565. const columnsMx_processes: any = [
  4566. { type: "checkbox", width: 50, fixed: "left" },
  4567. {
  4568. title: "+",
  4569. field: "addmx",
  4570. width: 80,
  4571. render: (scope: any) => {
  4572. let oItem = state.specialProcessesMxData.find(o => o.extraid == scope.row.extraid);
  4573. if (!oItem) {
  4574. oItem = {
  4575. inputtype: 1
  4576. };
  4577. }
  4578. if (state.orderStatus) {
  4579. return (
  4580. <ElButton
  4581. type="primary"
  4582. plain
  4583. circle
  4584. icon={Plus}
  4585. disabled={oItem.inputtype == 2}
  4586. onClick={() => funcAddMtrlMx(scope)}
  4587. ></ElButton>
  4588. );
  4589. } else {
  4590. return <>+</>;
  4591. }
  4592. }
  4593. },
  4594. {
  4595. title: "-",
  4596. field: "delmx",
  4597. width: 80,
  4598. render: (scope: any) => {
  4599. let oItem = state.specialProcessesMxData.find(o => o.extraid == scope.row.extraid);
  4600. if (!oItem) {
  4601. oItem = {
  4602. inputtype: 1
  4603. };
  4604. }
  4605. if (state.orderStatus) {
  4606. return (
  4607. <>
  4608. <ElPopconfirm
  4609. width="220"
  4610. icon={InfoFilled}
  4611. title={t("business.tips.mattress.delMx")}
  4612. confirm-button-text={t("common.delText")}
  4613. confirm-button-type="danger"
  4614. onConfirm={() => funcDelMtrlMx(scope)}
  4615. >
  4616. {{
  4617. reference: () => {
  4618. return <ElButton type="danger" plain circle disabled={oItem.inputtype == 2} icon={Minus} />;
  4619. }
  4620. }}
  4621. </ElPopconfirm>
  4622. </>
  4623. );
  4624. // return <ElButton type="danger" plain circle icon={Minus} onClick={() => funcDelMtrlMx(scope)}></ElButton>;
  4625. } else {
  4626. return <>-</>;
  4627. }
  4628. }
  4629. },
  4630. {
  4631. title: "项目类型",
  4632. field: "extraid",
  4633. // editRender: {
  4634. // name: "select"
  4635. // }
  4636. editRender: {},
  4637. editColRender: (scope: any) => {
  4638. return (
  4639. <el-select
  4640. v-model={scope.row.extraid}
  4641. disabled={scope.row.inputtype == 2}
  4642. onChange={val => extratypeOnChange(val, scope)}
  4643. >
  4644. {{
  4645. default: () => {
  4646. let rs = [];
  4647. if (state.specialProcessesEnum.length) {
  4648. state.specialProcessesEnum.map((t: any) => {
  4649. rs.push(<el-option label={t.typename} value={t.extraid} disabled={t.inputtype == 2} />);
  4650. });
  4651. }
  4652. return rs;
  4653. }
  4654. }}
  4655. </el-select>
  4656. );
  4657. },
  4658. render: scope => {
  4659. let item = state.specialProcessesEnum.find(t => t.extraid == scope.row.extraid);
  4660. if (item) {
  4661. return item.typename;
  4662. } else {
  4663. return "";
  4664. }
  4665. }
  4666. },
  4667. {
  4668. title: "项目名称",
  4669. field: "extraname",
  4670. editRender: {},
  4671. editColRender: (scope: any) => {
  4672. let _disabled = scope.row.inputtype == 2;
  4673. if (scope.row.inputtype == 0) {
  4674. return (
  4675. <el-select
  4676. v-model={scope.row.extramxid}
  4677. disabled={_disabled}
  4678. onChange={val => additionalOnChange(val, scope, state.specialProcessesMxData)}
  4679. >
  4680. {{
  4681. default: () => {
  4682. let rs = [];
  4683. if (state.specialProcessesMxData.length) {
  4684. state.specialProcessesMxData
  4685. .filter(t => t.extraid == scope.row.extraid)
  4686. .map((t: any) => {
  4687. rs.push(<el-option label={t.extramxname} value={t.extramxid} />);
  4688. });
  4689. }
  4690. return rs;
  4691. }
  4692. }}
  4693. </el-select>
  4694. );
  4695. } else {
  4696. return (
  4697. <el-autocomplete
  4698. v-model={scope.row.extraname}
  4699. disabled={_disabled}
  4700. value-key="extramxname"
  4701. fetch-suggestions={(queryString: string, callback: any) =>
  4702. querySearch_processes(queryString, callback, scope, state.specialProcessesMxData)
  4703. }
  4704. onSelect={itm => additionalOnSelect(itm, scope)}
  4705. clearable
  4706. />
  4707. );
  4708. }
  4709. }
  4710. },
  4711. {
  4712. title: "金额",
  4713. field: "price",
  4714. datatype: "number",
  4715. editRender: {},
  4716. editColRender: (scope: any) => {
  4717. const { $table, column, row, status } = scope;
  4718. return <el-input v-model={scope.row.price} type="number" disabled={row.inputtype == 2}></el-input>;
  4719. }
  4720. },
  4721. {
  4722. title: "数量",
  4723. field: "qty",
  4724. datatype: "number",
  4725. editRender: {},
  4726. editColRender: (scope: any) => {
  4727. const { $table, column, row, status } = scope;
  4728. return <el-input v-model={scope.row.qty} type="number" disabled={row.inputtype == 2}></el-input>;
  4729. }
  4730. },
  4731. {
  4732. title: "备注",
  4733. field: "dscrp",
  4734. editRender: {
  4735. name: "$input"
  4736. }
  4737. }
  4738. ];
  4739. const columnsMx_additional: any = [
  4740. { type: "checkbox", width: 50, fixed: "left" },
  4741. {
  4742. title: "+",
  4743. field: "addmx",
  4744. width: 80,
  4745. render: (scope: any) => {
  4746. if (state.orderStatus) {
  4747. return <ElButton type="primary" plain circle icon={Plus} onClick={() => funcAddMtrlMx(scope)}></ElButton>;
  4748. } else {
  4749. return <>+</>;
  4750. }
  4751. }
  4752. },
  4753. {
  4754. title: "-",
  4755. field: "delmx",
  4756. width: 80,
  4757. render: (scope: any) => {
  4758. let oItem = state.additionalCostsMxData.find(o => o.extraid == scope.row.extraid);
  4759. if (!oItem) {
  4760. oItem = {
  4761. inputtype: 1
  4762. };
  4763. }
  4764. if (state.orderStatus) {
  4765. return (
  4766. <>
  4767. <ElPopconfirm
  4768. width="220"
  4769. icon={InfoFilled}
  4770. title={t("business.tips.mattress.delMx")}
  4771. confirm-button-text={t("common.delText")}
  4772. confirm-button-type="danger"
  4773. onConfirm={() => funcDelMtrlMx(scope)}
  4774. >
  4775. {{
  4776. reference: () => {
  4777. return <ElButton type="danger" plain circle disabled={oItem.inputtype == 2} icon={Minus} />;
  4778. }
  4779. }}
  4780. </ElPopconfirm>
  4781. </>
  4782. );
  4783. // return <ElButton type="danger" plain circle icon={Minus} onClick={() => funcDelMtrlMx(scope)}></ElButton>;
  4784. } else {
  4785. return <>-</>;
  4786. }
  4787. }
  4788. },
  4789. {
  4790. title: "项目类型",
  4791. field: "extraid",
  4792. editRender: {},
  4793. editColRender: (scope: any) => {
  4794. return (
  4795. <el-select
  4796. v-model={scope.row.extraid}
  4797. disabled={scope.row.inputtype == 2}
  4798. onChange={val => extratypeOnChange(val, scope)}
  4799. >
  4800. {{
  4801. default: () => {
  4802. let rs = [];
  4803. if (state.additionalCostsEnum.length) {
  4804. state.additionalCostsEnum.map((t: any) => {
  4805. rs.push(<el-option label={t.typename} value={t.extraid} disabled={t.inputtype == 2} />);
  4806. });
  4807. }
  4808. return rs;
  4809. }
  4810. }}
  4811. </el-select>
  4812. );
  4813. },
  4814. render: scope => {
  4815. let item = state.additionalCostsEnum.find(t => t.extraid == scope.row.extraid);
  4816. if (item) {
  4817. return item.typename;
  4818. } else {
  4819. return "";
  4820. }
  4821. }
  4822. },
  4823. {
  4824. title: "项目名称",
  4825. field: "extraname",
  4826. editRender: {},
  4827. editColRender: (scope: any) => {
  4828. console.log("editColRender 1111 scope :>> ", scope);
  4829. let _disabled = scope.row.inputtype == 2;
  4830. if (scope.row.inputtype == 0) {
  4831. return (
  4832. <el-select
  4833. v-model={scope.row.extramxid}
  4834. disabled={_disabled}
  4835. onChange={val => additionalOnChange(val, scope, state.additionalCostsMxData)}
  4836. >
  4837. {{
  4838. default: () => {
  4839. let rs = [];
  4840. if (state.additionalCostsMxData.length) {
  4841. state.additionalCostsMxData
  4842. .filter(t => t.extraid == scope.row.extraid)
  4843. .map((t: any) => {
  4844. rs.push(<el-option label={t.extramxname} value={t.extramxid} />);
  4845. });
  4846. }
  4847. return rs;
  4848. }
  4849. }}
  4850. </el-select>
  4851. );
  4852. } else {
  4853. return (
  4854. <el-autocomplete
  4855. v-model={scope.row.extraname}
  4856. disabled={_disabled}
  4857. value-key="extramxname"
  4858. fetch-suggestions={(queryString: string, callback: any) =>
  4859. querySearch_additional(queryString, callback, scope, state.additionalCostsMxData)
  4860. }
  4861. onSelect={itm => additionalOnSelect(itm, scope)}
  4862. clearable
  4863. />
  4864. );
  4865. }
  4866. }
  4867. },
  4868. {
  4869. title: "金额",
  4870. field: "price",
  4871. datatype: "number",
  4872. editRender: {},
  4873. editColRender: (scope: any) => {
  4874. const { $table, column, row, status } = scope;
  4875. return <el-input v-model={scope.row.price} type="number" disabled={row.inputtype == 2}></el-input>;
  4876. }
  4877. },
  4878. {
  4879. title: "数量",
  4880. field: "qty",
  4881. datatype: "number",
  4882. editRender: {},
  4883. editColRender: (scope: any) => {
  4884. const { $table, column, row, status } = scope;
  4885. return <el-input v-model={scope.row.qty} type="number" disabled={row.inputtype == 2}></el-input>;
  4886. }
  4887. },
  4888. {
  4889. title: "备注",
  4890. field: "dscrp",
  4891. editRender: {
  4892. name: "$input"
  4893. }
  4894. }
  4895. ];
  4896. const extratypeOnChange = (value: any, scope: any) => {
  4897. const { row } = scope;
  4898. if (state.specialProcessesEnum.length) {
  4899. let item = state.specialProcessesEnum.find(t => t.extraid == value);
  4900. if (item) {
  4901. row.extramxid = 0;
  4902. row.inputtype = 0;
  4903. row.extraname = "";
  4904. row.price = 0;
  4905. row.qty = 0;
  4906. row.dscrp = "";
  4907. }
  4908. }
  4909. };
  4910. const additionalOnChange = (value: any, scope: any, enumdata: any) => {
  4911. const { row } = scope;
  4912. if (enumdata.length) {
  4913. let item = enumdata.find(t => t.extraid == row.extraid && t.extramxid == value);
  4914. if (item) {
  4915. additionalOnSelect(item, scope);
  4916. }
  4917. }
  4918. };
  4919. const additionalOnSelect = (item: Record<string, any>, scope: any) => {
  4920. const { row } = scope;
  4921. // console.log("additionalOnSelect: >>", item);
  4922. // const $tableAdditional = state.additionalCostsMxRef.element;
  4923. // if ($tableAdditional) {
  4924. // const { visibleData } = $tableAdditional.getTableData();
  4925. // const row = visibleData[$rowIndex];
  4926. // console.log("additionalOnSelect: row >>", row);
  4927. // row.extramxname = item.extramxname;
  4928. row.extramxid = item.extramxid ?? 0;
  4929. row.inputtype = item.inputtype;
  4930. row.extraid = item.extraid;
  4931. row.extraname = item.extramxname;
  4932. // row.typeid = item.typeid;
  4933. row.price = item.price;
  4934. row.qty = item.qty;
  4935. row.dscrp = item.dscrp;
  4936. // $tableAdditional.reloadData(visibleData);
  4937. // }
  4938. };
  4939. const querySearch_processes = (queryString: string, cb: any, data, list) => {
  4940. const { row } = data;
  4941. const results = queryString
  4942. ? list.filter(o => {
  4943. return o.extramxname.indexOf(queryString) > -1 && o.extraid == row.extraid;
  4944. })
  4945. : list.filter(o => o.extraid == row.extraid);
  4946. cb(results);
  4947. };
  4948. const querySearch_additional = (queryString: string, cb: any, data, list) => {
  4949. const { row } = data;
  4950. const results = queryString
  4951. ? list.filter(o => {
  4952. return o.extramxname.indexOf(queryString) > -1 && o.extraid == row.extraid;
  4953. })
  4954. : list.filter(o => o.extraid == row.extraid);
  4955. cb(results);
  4956. };
  4957. const columnsMx_subSpecs: any = [
  4958. { type: "checkbox", width: 50, fixed: "left" },
  4959. {
  4960. title: "核价编码",
  4961. field: "mattressrelcode",
  4962. editRender: {
  4963. name: "$input"
  4964. }
  4965. },
  4966. {
  4967. title: "核价名称",
  4968. field: "mattressname",
  4969. editRender: {
  4970. name: "$input"
  4971. }
  4972. },
  4973. {
  4974. title: "床垫宽/CM",
  4975. field: "mattress_width",
  4976. datatype: "number",
  4977. // editRender: {
  4978. // name: "VxeInput",
  4979. // props: {
  4980. // type: "number",
  4981. // onBlur: (e: any) => {
  4982. // const {value} = e
  4983. // console.log("columnsMx_subSpecs: e >>", e);
  4984. // if (value) {
  4985. // setMxSpringQtyWidthAndLength();
  4986. // }
  4987. // }
  4988. // }
  4989. // }
  4990. editRender: {},
  4991. editColRender: (scope: any) => {
  4992. return (
  4993. <>
  4994. <el-input v-model={scope.row.mattress_width} onChange={() => disshow_subspecs(scope)} />
  4995. </>
  4996. );
  4997. }
  4998. },
  4999. {
  5000. title: "床垫长/CM",
  5001. field: "mattress_length",
  5002. datatype: "number",
  5003. // editRender: {
  5004. // name: "$input",
  5005. // props: {
  5006. // type: "number"
  5007. // }
  5008. // }
  5009. editRender: {},
  5010. editColRender: (scope: any) => {
  5011. return (
  5012. <>
  5013. <el-input v-model={scope.row.mattress_length} onChange={() => disshow_subspecs(scope)} />
  5014. </>
  5015. );
  5016. }
  5017. },
  5018. {
  5019. title: "床垫高/CM",
  5020. field: "mattress_height",
  5021. datatype: "number"
  5022. // editRender: {
  5023. // name: "$input",
  5024. // props: {
  5025. // type: "number"
  5026. // }
  5027. // }
  5028. // editRender: {},
  5029. // editColRender: (scope: any) => {
  5030. // return (
  5031. // <>
  5032. // <el-input v-model={scope.row.mattress_height} onChange={() => disshow_subspecs(scope.row)} />
  5033. // </>
  5034. // );
  5035. // }
  5036. }
  5037. // {
  5038. // title: "弹簧排列个数-宽",
  5039. // field: "spring_qty_width",
  5040. // datatype: "integer",
  5041. // editRender: {
  5042. // name: "$input"
  5043. // // props: {
  5044. // // type: "number"
  5045. // // }
  5046. // }
  5047. // },
  5048. // {
  5049. // title: "弹簧排列个数-长",
  5050. // field: "spring_qty_length",
  5051. // datatype: "integer",
  5052. // editRender: {
  5053. // name: "$input"
  5054. // // props: {
  5055. // // type: "number"
  5056. // // }
  5057. // }
  5058. // }
  5059. ];
  5060. const handleToImportMxInner = async () => {
  5061. let _params = {
  5062. dsname: "web_mattress_formulalist",
  5063. queryparams: {
  5064. arg_array_formulatype: [101],
  5065. arrg_usetype: 0
  5066. }
  5067. };
  5068. let res = await CommonDynamicSelect(_params);
  5069. let idxStr = "";
  5070. const $table = state.innerClothLayerMxRef.element;
  5071. if ($table) {
  5072. const { visibleData } = $table.getTableData();
  5073. if (visibleData.length) {
  5074. let lastMx = visibleData[visibleData.length - 1];
  5075. idxStr = Number(lastMx.chastr.match(/\d+$/)?.[0] ?? 0) + 1 + "";
  5076. } else {
  5077. idxStr = "";
  5078. }
  5079. }
  5080. if (res?.datatable?.length) {
  5081. const $table = state.innerClothLayerMxRef.element;
  5082. // $table.remove();
  5083. let _rows = res?.datatable.map((item: any, index: number) => {
  5084. let _data: any = {};
  5085. if (Number(item.if_mtrl) > 1) {
  5086. _data.addmx = "+";
  5087. _data.delmx = "-";
  5088. }
  5089. _data.formulatype = item.formulatype;
  5090. _data.if_mtrl = item.if_mtrl;
  5091. _data.formulaid = item.formulaid;
  5092. _data.sortcode = item.sortcode;
  5093. _data.formulakind = item.formulakind;
  5094. _data.formula = item.formula;
  5095. _data.chastr = "内布套" + idxStr;
  5096. _data.useformula = item.useformula;
  5097. _data.gydscrp = item.gydscrp;
  5098. _data.pid = index + 1;
  5099. return _data;
  5100. });
  5101. // let tree = {
  5102. // chastr: "内布套",
  5103. // children: _rows
  5104. // };
  5105. // $table.insertAt(tree, -1);
  5106. await $table.insertAt(_rows, -1);
  5107. ElMessage.success("导入成功");
  5108. autoLoadExtraData(state.innerClothLayerMxRef, state.specialProcessesMxRef, 4, "chastr");
  5109. }
  5110. resetMergeCellsInner();
  5111. };
  5112. const resetMergeCellsInner = () => {
  5113. setTimeout(() => {
  5114. const $table = state.innerClothLayerMxRef.element;
  5115. if ($table) {
  5116. let mergeCells = autoMergeCells($table, ["chastr"]);
  5117. console.log("resetMergeCellsInner autoMergeCells :>> ", mergeCells);
  5118. $table.setMergeCells(mergeCells);
  5119. }
  5120. }, 200);
  5121. };
  5122. const resetSpecialProcesses = (type: string) => {
  5123. console.log("resetSpecialProcesses type:>> ", type);
  5124. console.log("resetSpecialProcesses additionalCostsMxInitData:>> ", state.additionalCostsMxInitData);
  5125. console.log("resetSpecialProcesses specialProcessesMxInitData:>> ", state.specialProcessesMxInitData);
  5126. // setTimeout(() => {
  5127. // const $table = state.innerClothLayerMxRef.element;
  5128. // if ($table) {
  5129. // let mergeCells = autoMergeCells($table, ["chastr"]);
  5130. // console.log("resetMergeCellsInner autoMergeCells :>> ", mergeCells);
  5131. // $table.setMergeCells(mergeCells);
  5132. // }
  5133. // }, 200);
  5134. };
  5135. const hanleDelMxInner = async (type: number) => {
  5136. const $table = state.innerClothLayerMxRef.element;
  5137. if ($table) {
  5138. if (type == 1) {
  5139. // 全部
  5140. await $table.remove();
  5141. } else if (type == 0) {
  5142. // 删除选中
  5143. const curRow = $table.getCurrentRecord();
  5144. if (!curRow) {
  5145. ElMessage.warning("请先选择要删除的行");
  5146. return;
  5147. }
  5148. let _chastr = curRow?.chastr;
  5149. const { visibleData } = $table.getTableData();
  5150. let _vData = visibleData.filter((o: any) => o.chastr != _chastr);
  5151. await $table.reloadData(_vData);
  5152. ElMessage.success("成功删除" + _chastr);
  5153. }
  5154. autoLoadExtraData(state.innerClothLayerMxRef, state.specialProcessesMxRef, 4, "chastr");
  5155. resetMergeCellsInner();
  5156. }
  5157. };
  5158. const w_mattress_add_itemname_choose = (type: number) => {
  5159. let arr = [];
  5160. if (type == 1) {
  5161. } else if (type == 2) {
  5162. } else if (type == 3) {
  5163. arr.push({
  5164. label: "内布套",
  5165. value: "内布套"
  5166. });
  5167. arr.push({
  5168. label: "内布套拆装",
  5169. value: "内布套拆装"
  5170. });
  5171. } else if (type == 4) {
  5172. arr.push({
  5173. label: "顶布裥棉1",
  5174. value: "顶布裥棉1"
  5175. });
  5176. arr.push({
  5177. label: "顶布裥棉2",
  5178. value: "顶布裥棉2"
  5179. });
  5180. arr.push({
  5181. label: "顶布裥棉3",
  5182. value: "顶布裥棉3"
  5183. });
  5184. arr.push({
  5185. label: "顶布裥棉4",
  5186. value: "顶布裥棉4"
  5187. });
  5188. }
  5189. return arr;
  5190. };
  5191. const wf_add_w_butao = async (val: any) => {
  5192. console.log("val :>> ", val);
  5193. const $table = state.topCottonMxRef.element;
  5194. if ($table) {
  5195. const { fullData } = $table.getTableData();
  5196. let ifind = fullData.find(t => t.chastr == val.value);
  5197. if (ifind) {
  5198. ElMessage.warning(`该选项${val.value}已存在`);
  5199. return;
  5200. }
  5201. let newParams: any = {};
  5202. newParams.queryParams = {
  5203. arg_array_formulatype: [103],
  5204. arrg_usetype: 0
  5205. };
  5206. newParams.dsname = "web_mattress_formulalist";
  5207. let res = await CommonDynamicSelect(newParams);
  5208. console.log("funcAddBigSide res :>> ", res);
  5209. if (res.datatable) {
  5210. let _rows = res?.datatable.map((item: any) => {
  5211. let _data: any = {};
  5212. if (Number(item.if_mtrl) > 1) {
  5213. _data.addmx = "+";
  5214. _data.delmx = "-";
  5215. }
  5216. _data.formulatype = item.formulatype;
  5217. _data.if_mtrl = item.if_mtrl;
  5218. _data.formulaid = item.formulaid;
  5219. _data.sortcode = item.sortcode;
  5220. _data.formulakind = item.formulakind;
  5221. _data.formula = item.formula;
  5222. _data.chastr = val.value;
  5223. _data.useformula = item.useformula;
  5224. _data.gydscrp = item.gydscrp;
  5225. return _data;
  5226. });
  5227. $table.insertAt(_rows, -1);
  5228. }
  5229. }
  5230. resetMergeCellsTopCotton();
  5231. };
  5232. const resetMergeCellsTopCotton = () => {
  5233. setTimeout(() => {
  5234. const $table = state.topCottonMxRef.element;
  5235. if ($table) {
  5236. let mergeCells = autoMergeCells($table, ["chastr"]);
  5237. console.log("resetMergeCellsInner autoMergeCells :>> ", mergeCells);
  5238. $table.setMergeCells(mergeCells);
  5239. }
  5240. }, 1);
  5241. };
  5242. /**
  5243. * @description 删除顶布裥棉明细
  5244. */
  5245. const wf_del_w_butao = async () => {
  5246. const $table = state.topCottonMxRef.element;
  5247. // 删除选中
  5248. const curRow = $table.getCurrentRecord();
  5249. const { fullData } = $table.getTableData();
  5250. if (!curRow) {
  5251. ElMessage.warning("请先选择要删除的行");
  5252. return;
  5253. }
  5254. let ls_chastr = curRow.chastr;
  5255. ElMessageBox.confirm(`是否确定要删除【${ls_chastr}】的明细行?`, "询问", {
  5256. confirmButtonText: "是",
  5257. cancelButtonText: "否",
  5258. type: "warning"
  5259. }).then(() => {
  5260. let _rows = fullData.filter((item: any) => item.chastr == ls_chastr);
  5261. $table.remove(_rows);
  5262. ElMessage({
  5263. type: "success",
  5264. message: "删除成功"
  5265. });
  5266. });
  5267. };
  5268. /**
  5269. * @description 获取部门的价格表id
  5270. * @returns
  5271. */
  5272. const getPriceid = () => {
  5273. let _deptid = state.LjDetailRef?._mainData?.deptid ?? 0;
  5274. if (!_deptid) {
  5275. ElMessage.warning("请先选择部门");
  5276. state.LjDetailRef?.baseformRef.element.validateField("deptid");
  5277. return 0;
  5278. }
  5279. let deptEnum = state.LjDetailRef.enumMap.get("deptid");
  5280. let _pricelistid = 0;
  5281. if (deptEnum) {
  5282. let depItem = deptEnum.find((item: any) => item.value == _deptid);
  5283. if (depItem) {
  5284. _pricelistid = Number(depItem.pricelistid);
  5285. }
  5286. }
  5287. return _pricelistid;
  5288. };
  5289. // 节流
  5290. const disshow_subspecs = throttle((val: any) => {
  5291. setMxSpringQtyWidthAndLength(val);
  5292. }, 500);
  5293. /**
  5294. * @description 设置床网高度,自动计算宽度,长度
  5295. */
  5296. const setMxSpringQtyWidthAndLength = async scope => {
  5297. console.log("setMxSpringQtyWidthAndLength varow :>> ", scope);
  5298. const { row } = scope;
  5299. const $tableBednet = state.bednetMxRef.element;
  5300. if ($tableBednet) {
  5301. const { visibleData } = $tableBednet.getTableData();
  5302. // 需要填写关键数据
  5303. if (!Number(row.mattress_width) || !Number(row.mattress_length) || !Number(row.mattress_height)) {
  5304. return;
  5305. }
  5306. // 如果表格没有数据/没有选床网,则不执行
  5307. if (!visibleData.length || !visibleData[0].mtrlid) {
  5308. return;
  5309. }
  5310. let _pricelistid = getPriceid();
  5311. for (let i = 0; i < visibleData.length; i++) {
  5312. let _mainData = visibleData[i];
  5313. if (_mainData.mtrlid > 0) {
  5314. let bednet = cloneDeep(_mainData);
  5315. bednet.bednetid = _mainData.mtrlid;
  5316. // bednet.if_doublenet = Number(bednet.if_doublenet);
  5317. // bednet.if_doublespring = Number(bednet.if_doublespring);
  5318. // bednet.if_side_iron = Number(bednet.if_side_iron);
  5319. // bednet.if_rsorwa = Number(bednet.if_rsorwa);
  5320. // bednet.if_sponge_drilling = Number(bednet.if_sponge_drilling);
  5321. // bednet.iffork = Number(bednet.iffork);
  5322. // bednet.ifsaleout = Number(bednet.ifsaleout);
  5323. // bednet.if_jb = Number(bednet.if_jb);
  5324. // bednet.flag = Number(bednet.flag);
  5325. bednet.mattress_length = row.mattress_length;
  5326. bednet.mattress_width = row.mattress_width;
  5327. bednet.pricelistid = _pricelistid;
  5328. let _params: any = {
  5329. bednet: bednet
  5330. // bednetMx: state.vxeTableMxRef?.element.getTableData().fullData ?? [],
  5331. // spring: state.vxeTableMxSpringRef?.element.getTableData().fullData ?? []
  5332. };
  5333. console.log("setMxSpringQtyWidthAndLength _params :>> ", _params);
  5334. let res = await GetComputeSpring(_params);
  5335. console.log("setMxSpringQtyWidthAndLength res :>> ", res);
  5336. console.log("setMxSpringQtyWidthAndLength row :>> ", row);
  5337. if (!res?.message) {
  5338. scope.row["spring_qty_width_" + (i + 1)] = res.bednetMx[0].spring_qty_width;
  5339. scope.row["spring_qty_length_" + (i + 1)] = res.bednetMx[0].spring_qty_length;
  5340. }
  5341. console.log("setMxSpringQtyWidthAndLength scopes row :>> ", scope.row);
  5342. }
  5343. }
  5344. }
  5345. };
  5346. /**
  5347. * @description 计算拼侧数量
  5348. */
  5349. const computedExtraSizeNum = (enumarr: any, arr: any, key: string, arg_extraid: number) => {
  5350. console.log("computedExtraSizeNum specialProcessesEnum.value :>> ", enumarr);
  5351. let extraArr = enumarr.filter(item => item.typeid == 1 && item.extraid == arg_extraid && item.extramxname.includes(key));
  5352. let arrNum = arr.filter(item => item.includes(key)).length;
  5353. let result = [];
  5354. extraArr.forEach(o => {
  5355. // 判断名称中出现的数量
  5356. try {
  5357. const checker = new Function("value", `return ${text2Formula(o.extramxname)};`);
  5358. if (checker(arrNum)) {
  5359. result.push(o);
  5360. }
  5361. } catch (error) {
  5362. console.log("error :>> ", error);
  5363. ElMessage.error(`${t("sys.api.operationFailed")}特殊工艺名称: ${error}`);
  5364. }
  5365. });
  5366. return result;
  5367. };
  5368. /**
  5369. * @description 判断目前选择的拼接数据量,自动导入修改特殊工艺费用
  5370. * @params tableRef 表格实例
  5371. * @params targetRef 目标表格实例
  5372. * @params arg_extraid 数据库建立的特殊费用id,1:特殊费用,4:内布套
  5373. * @params matchAttr 匹配字段
  5374. */
  5375. const autoLoadExtraData = (tableRef?: any, targetRef?: any, arg_extraid = 1, matchAttr = "sortcode") => {
  5376. //计算拼侧数量
  5377. const $table = tableRef.element;
  5378. const { visibleData } = $table.getTableData();
  5379. const $tableTarget = targetRef.element;
  5380. const { visibleData: tgVisibleData } = $tableTarget.getTableData();
  5381. let arr = [];
  5382. // 收集拼侧,并去重
  5383. visibleData.map(t => arr.push(t[matchAttr]));
  5384. arr = Array.from(new Set(arr));
  5385. console.log("autoLoadExtraData 收集拼侧,并去重 arr :>> ", arr, visibleData);
  5386. //
  5387. let _remove = [];
  5388. tgVisibleData.map(t => {
  5389. if (t.extraid == arg_extraid) {
  5390. _remove.push(t);
  5391. }
  5392. });
  5393. $tableTarget.remove(_remove);
  5394. let result = [];
  5395. if (!arr.includes("普通大侧")) {
  5396. result = result.concat(computedExtraSizeNum(state.specialProcessesMxData, arr, "上下", arg_extraid));
  5397. result = result.concat(computedExtraSizeNum(state.specialProcessesMxData, arr, "左右", arg_extraid));
  5398. result = result.concat(computedExtraSizeNum(state.specialProcessesMxData, arr, "内布套", arg_extraid));
  5399. console.log("autoLoadExtraData result :>> ", result, state.specialProcessesMxData);
  5400. }
  5401. if (result.length) {
  5402. let _arr = [];
  5403. let _mattressId = state.LjDetailRef._mainData.mattressid;
  5404. result.map(o => {
  5405. let _itm = {
  5406. mattressid: _mattressId,
  5407. mattressmxid: 0,
  5408. extraid: o.extraid,
  5409. extramxid: o.extramxid,
  5410. // extratypename: "",
  5411. extraname: o.extramxname,
  5412. price: o.price,
  5413. qty: o.qty,
  5414. dscrp: o.dscrp,
  5415. inputtype: o.inputtype,
  5416. typeid: o.typeid
  5417. };
  5418. _arr.push(_itm);
  5419. });
  5420. $tableTarget.insertAt(_arr, -1);
  5421. }
  5422. };
  5423. /**
  5424. * @description 获取特殊工艺数据
  5425. * @params mtrlItem 物料
  5426. * @params targetRef 目标表格实例
  5427. * @params arg_extraid 数据库建立的特殊费用id,5: 物料的特殊工艺费用
  5428. */
  5429. const autoLoadMtrlExtra = (mtrlItem?: any, targetRef?: any, arg_extraid = 5) => {
  5430. //计算拼侧数量
  5431. if (mtrlItem?.extra_cost == 0) return;
  5432. // const $table = tableRef.element;
  5433. // const { visibleData } = $table.getTableData();
  5434. const $tableTarget = targetRef.element;
  5435. const { visibleData: tgVisibleData } = $tableTarget.getTableData();
  5436. let _remove = [];
  5437. tgVisibleData.map(t => {
  5438. if (t.extraid == arg_extraid && mtrlItem.mtrlid == t?.mtrlid) {
  5439. _remove.push(t);
  5440. }
  5441. });
  5442. $tableTarget.remove(_remove);
  5443. let result = [];
  5444. let extraArr = state.specialProcessesMxData.filter(item => item.typeid == 1 && item.extraid == arg_extraid);
  5445. if (extraArr.length) {
  5446. // 取额外费用数据模版,插入
  5447. result.push(extraArr[0]);
  5448. }
  5449. if (result.length) {
  5450. let _arr = [];
  5451. let _mattressId = state.LjDetailRef._mainData.mattressid;
  5452. result.map(o => {
  5453. let _itm = {
  5454. mattressid: _mattressId,
  5455. mattressmxid: 0,
  5456. extraid: o.extraid,
  5457. extramxid: o.extramxid,
  5458. extraname: mtrlItem.mtrlname,
  5459. price: mtrlItem.extra_cost,
  5460. qty: o.qty,
  5461. dscrp: o.dscrp,
  5462. inputtype: o.inputtype,
  5463. typeid: o.typeid,
  5464. mtrlid: mtrlItem.mtrlid
  5465. };
  5466. _arr.push(_itm);
  5467. });
  5468. $tableTarget.insertAt(_arr, -1);
  5469. }
  5470. };
  5471. /**
  5472. * @description 自动导入修改特殊工艺费用
  5473. */
  5474. const autoLoadExtraData_chai = (value?: any, fieldName?: any) => {
  5475. console.log("autoLoadExtraData_chai value :>> ", value);
  5476. let _type = "";
  5477. switch (fieldName) {
  5478. case "if_m_chai":
  5479. _type = "面拆";
  5480. break;
  5481. case "if_z_chai":
  5482. _type = "中拆";
  5483. break;
  5484. case "if_d_chai":
  5485. _type = "底拆";
  5486. break;
  5487. }
  5488. console.log("state. specialProcessesEnum:>> ", state.specialProcessesEnum, state.specialProcessesMxData);
  5489. let result = state.specialProcessesMxData.filter((item: any) => item.extramxname.indexOf(_type) > -1);
  5490. if (result.length) {
  5491. const $tableTarget = state.specialProcessesMxRef.element;
  5492. const { visibleData: tgVisibleData } = $tableTarget.getTableData();
  5493. if (tgVisibleData) {
  5494. let _remove = [];
  5495. tgVisibleData.map(t => {
  5496. let _itm = result.find(i => i.extraid === t.extraid && i.extramxid === t.extramxid);
  5497. if (_itm) {
  5498. _remove.push(t);
  5499. }
  5500. });
  5501. $tableTarget.remove(_remove);
  5502. }
  5503. if (value) {
  5504. // 新增
  5505. if (result.length) {
  5506. let _arr = [];
  5507. let _mattressId = state.LjDetailRef._mainData.mattressid;
  5508. result.map(o => {
  5509. let _itm = {
  5510. mattressid: _mattressId,
  5511. mattressmxid: 0,
  5512. extraid: o.extraid,
  5513. extramxid: o.extramxid,
  5514. extraname: o.extramxname,
  5515. price: o.price,
  5516. qty: o.qty,
  5517. dscrp: o.dscrp,
  5518. inputtype: o.inputtype,
  5519. typeid: o.typeid
  5520. };
  5521. _arr.push(_itm);
  5522. });
  5523. $tableTarget.insertAt(_arr, -1);
  5524. }
  5525. } else {
  5526. // 删除
  5527. }
  5528. }
  5529. };
  5530. const gotoErpapi = (_cur, type) => {
  5531. try {
  5532. if (type === 1) {
  5533. if (_cur.yw_flag == 1) {
  5534. throw new Error(_cur.mattresscode + ":已业务补充审核,无法修改");
  5535. }
  5536. } else if (type === 2) {
  5537. if (_cur.js1_flag == 1) {
  5538. throw new Error(_cur.mattresscode + ":已产品补充审核,无法修改");
  5539. }
  5540. } else if (type === 3) {
  5541. if (_cur.js2_flag == 1) {
  5542. throw new Error(_cur.mattresscode + ":已清单补充审核,无法修改");
  5543. }
  5544. }
  5545. } catch (error) {
  5546. ElMessage.error(error.message);
  5547. return false;
  5548. }
  5549. router.push({
  5550. path: `/erpapi/mattressInterface/edit/${_cur.mattressid}`,
  5551. query: {
  5552. code: _cur.mattresscode,
  5553. type: type
  5554. }
  5555. });
  5556. };
  5557. /**
  5558. * @description 更新主副规格表结构
  5559. */
  5560. const updateSubspecsTable = () => {
  5561. // state.columnsMx_subSpecs_dis = [];
  5562. // 检查床网
  5563. console.log("updateSubspecsTable state.columnsMx_subSpecs_dis :>> ", state.columnsMx_subSpecs_dis);
  5564. const $tableBendet = state.bednetMxRef.element;
  5565. const $tableSubspecs = state.subSpecsRef?.element;
  5566. let cols = [];
  5567. let visibleData = [];
  5568. if ($tableSubspecs) {
  5569. visibleData = $tableSubspecs.getTableData().visibleData;
  5570. }
  5571. if ($tableBendet) {
  5572. const { visibleData: bednetVisibleData } = $tableBendet.getTableData();
  5573. if (bednetVisibleData && bednetVisibleData.length) {
  5574. // let filedsName = state.columnsMx_subSpecs_dis
  5575. // .filter((item: any) => item.field && item.field.indexOf("spring_qty_width_") > -1)
  5576. // .map(item => item.field);
  5577. // let bednetFieldsName = bednetVisibleData
  5578. // .filter((item: any) => item.mtrlid)
  5579. // .map(item => "spring_qty_width_" + item.mtrlid);
  5580. console.log(
  5581. 'filedsName.join(",") != bednetFieldsName.join(",") :>> ',
  5582. // filedsName.join(","),
  5583. // bednetFieldsName.join(","),
  5584. bednetVisibleData
  5585. );
  5586. // if (filedsName.join(",") != bednetFieldsName.join(",")) {
  5587. bednetVisibleData.map((item: any, idx: any) => {
  5588. if (item.mtrlid) {
  5589. cols.push({
  5590. title: "弹簧排列个数-宽" + "-床网" + (idx + 1),
  5591. field: "spring_qty_width_" + (idx + 1),
  5592. datatype: "integer",
  5593. editRender: {
  5594. name: "$input"
  5595. }
  5596. });
  5597. cols.push({
  5598. title: "弹簧排列个数-宽" + "-床网" + (idx + 1),
  5599. field: "spring_qty_length_" + (idx + 1),
  5600. datatype: "integer",
  5601. editRender: {
  5602. name: "$input"
  5603. }
  5604. });
  5605. // 床网使用弹叉
  5606. cols.push({
  5607. title: "弹叉数量" + "-床网" + (idx + 1),
  5608. field: "bednet_fork_qty_" + (idx + 1),
  5609. datatype: "integer",
  5610. editRender: {
  5611. name: "$input"
  5612. }
  5613. });
  5614. }
  5615. });
  5616. // }
  5617. }
  5618. }
  5619. const $tableCushions = state.cushionsMxRef.element;
  5620. if ($tableCushions) {
  5621. const { visibleData: cushionsVisibleData } = $tableCushions.getTableData();
  5622. if (cushionsVisibleData && cushionsVisibleData.length) {
  5623. // let filedsName = state.columnsMx_subSpecs_dis
  5624. // .filter((item: any) => item.field && item.field.indexOf("cushions_subspecs_") > -1)
  5625. // .map(item => item.field);
  5626. // let cushionsFieldsName = cushionsVisibleData
  5627. // .filter((item: any) => item.mtrlid && item.if_subspecs)
  5628. // .map(item => "cushions_subspecs_" + item.mtrlid);
  5629. // console.log('filedsName.join(",") ', filedsName.join(","));
  5630. // console.log(' cushionsFieldsName.join(",") :>> ', cushionsFieldsName.join(","));
  5631. // if (filedsName.join(",") != cushionsFieldsName.join(",")) {
  5632. let idx = 0;
  5633. cushionsVisibleData.map((item: any, index: any) => {
  5634. if (item.mtrlid && item.if_subspecs) {
  5635. let _field = "cushions_subspecs_" + (idx + 1);
  5636. let _mtrlname = "cushions_subspecs_mtrlname_" + (idx + 1);
  5637. let _formulakind = "cushions_subspecs_formulakind_" + (idx + 1);
  5638. idx++;
  5639. visibleData = visibleData.map(itm => {
  5640. itm[_formulakind] = item.formulakind;
  5641. return itm;
  5642. });
  5643. cols.push({
  5644. title: "垫层物料-" + item.chastr + " " + (index + 1),
  5645. field: _mtrlname,
  5646. width: "200",
  5647. datatype: "integer",
  5648. editRender: {},
  5649. editColRender: (scope: any) => {
  5650. const { column, row, status, $table } = scope;
  5651. let _label = column.title;
  5652. let _pricelistid = getPriceid();
  5653. let _mtrltypeItem: any = mtrltypeTabList_cushions.find(t => t.formulakinds.includes(Number(row[_formulakind])));
  5654. if (!_mtrltypeItem) {
  5655. // ElMessage.error("不是垫层类型行,不能选物料");
  5656. // return <></>;
  5657. }
  5658. console.log("updateSubspecsTable _mtrltypeItem :>> ", _mtrltypeItem);
  5659. let params = {
  5660. mtrltype: _mtrltypeItem?.value,
  5661. pricelistid: _pricelistid
  5662. };
  5663. return (
  5664. <>
  5665. <MtrldefSelect
  5666. value={row[_field]}
  5667. {...params}
  5668. disabled={!_mtrltypeItem}
  5669. clearable
  5670. placeholder={_label}
  5671. onOpenModal={() =>
  5672. fModelChoseMtrl(
  5673. row,
  5674. params,
  5675. (data, val: any) => {
  5676. row[_field] = val.mtrlid;
  5677. row[_mtrlname] = val.mtrlname;
  5678. },
  5679. _mtrltypeItem?.label,
  5680. $table
  5681. )
  5682. }
  5683. onSelect={(val: any) => {
  5684. row[_field] = val.mtrlid;
  5685. row[_mtrlname] = val.mtrlname;
  5686. }}
  5687. onClear={() => {
  5688. row[_field] = 0;
  5689. row[_mtrlname] = "";
  5690. }}
  5691. >
  5692. {{
  5693. label: () => row[_mtrlname]
  5694. }}
  5695. </MtrldefSelect>
  5696. </>
  5697. );
  5698. }
  5699. });
  5700. }
  5701. });
  5702. // }
  5703. }
  5704. }
  5705. // if (cols.length > 0) {
  5706. state.columnsMx_subSpecs_dis = columnsMx_subSpecs.concat(cols);
  5707. console.log("updateSubspecsTable state.columnsMx_subSpecs_dis 321:>> ", state.columnsMx_subSpecs_dis);
  5708. nextTick(() => {
  5709. // state.subSpecsRef.element.loadColumn(state.columnsMx_subSpecs_dis);
  5710. state.subSpecsRef.loadColumns(state.columnsMx_subSpecs_dis);
  5711. console.log("visibleData :>> ", visibleData);
  5712. if ($tableSubspecs) {
  5713. state.subSpecsData = visibleData;
  5714. }
  5715. });
  5716. // }
  5717. };
  5718. return {
  5719. ...toRefs(state),
  5720. columns,
  5721. columnsMx,
  5722. columnsMxBednet: funcMergeColumn(columnsMx, bednetCoumns, bednetExtraColumns),
  5723. columnsMxCushions: funcMergeColumn(columnsMx, cushionsColumns),
  5724. columnsMxAccessories: funcMergeColumn(columnsMx, accessoriesColumns),
  5725. columnsMxPackag: funcMergeColumn(columnsMx, packagColumns),
  5726. columnsMxInnerClothLayer,
  5727. // summaryData,
  5728. // fieldParams,
  5729. columnsMx_subSpecs,
  5730. columnsMx_processes,
  5731. columnsMx_additional,
  5732. funcAddMxSide,
  5733. funcChaifenTab,
  5734. getData_mx,
  5735. dataCallback,
  5736. dataCallbackMx,
  5737. getMattressType,
  5738. gotoSummy,
  5739. gotoHisprice,
  5740. getFormulakindEnum,
  5741. funcPacktypeChange,
  5742. dynamicRef,
  5743. wf_cmp_cb,
  5744. handleToImportMxInner,
  5745. hanleDelMxInner,
  5746. wf_add_w_butao,
  5747. wf_del_w_butao,
  5748. w_mattress_add_itemname_choose,
  5749. wf_rtr_bednet,
  5750. funcAddMtrlMx,
  5751. resetMergeCellsInner,
  5752. resetSpecialProcesses,
  5753. resetMergeCellsTopCotton,
  5754. wf_rtr_cwdc,
  5755. gotoErpapi,
  5756. updateSubspecsTable,
  5757. funcChaifenTabPro,
  5758. getQuoteListMxData,
  5759. autoLoadExtraData,
  5760. autoLoadExtraData_chai
  5761. };
  5762. };