index.tsx 165 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082
  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: "mattresscode"
  4962. },
  4963. {
  4964. title: "核价编码",
  4965. field: "mattressrelcode",
  4966. editRender: {
  4967. name: "$input"
  4968. }
  4969. },
  4970. {
  4971. title: "核价名称",
  4972. field: "mattressname",
  4973. editRender: {
  4974. name: "$input"
  4975. }
  4976. },
  4977. {
  4978. title: "床垫宽/CM",
  4979. field: "mattress_width",
  4980. datatype: "number",
  4981. // editRender: {
  4982. // name: "VxeInput",
  4983. // props: {
  4984. // type: "number",
  4985. // onBlur: (e: any) => {
  4986. // const {value} = e
  4987. // console.log("columnsMx_subSpecs: e >>", e);
  4988. // if (value) {
  4989. // setMxSpringQtyWidthAndLength();
  4990. // }
  4991. // }
  4992. // }
  4993. // }
  4994. editRender: {},
  4995. editColRender: (scope: any) => {
  4996. return (
  4997. <>
  4998. <el-input v-model={scope.row.mattress_width} onChange={() => disshow_subspecs(scope)} />
  4999. </>
  5000. );
  5001. }
  5002. },
  5003. {
  5004. title: "床垫长/CM",
  5005. field: "mattress_length",
  5006. datatype: "number",
  5007. // editRender: {
  5008. // name: "$input",
  5009. // props: {
  5010. // type: "number"
  5011. // }
  5012. // }
  5013. editRender: {},
  5014. editColRender: (scope: any) => {
  5015. return (
  5016. <>
  5017. <el-input v-model={scope.row.mattress_length} onChange={() => disshow_subspecs(scope)} />
  5018. </>
  5019. );
  5020. }
  5021. },
  5022. {
  5023. title: "床垫高/CM",
  5024. field: "mattress_height",
  5025. datatype: "number"
  5026. // editRender: {
  5027. // name: "$input",
  5028. // props: {
  5029. // type: "number"
  5030. // }
  5031. // }
  5032. // editRender: {},
  5033. // editColRender: (scope: any) => {
  5034. // return (
  5035. // <>
  5036. // <el-input v-model={scope.row.mattress_height} onChange={() => disshow_subspecs(scope.row)} />
  5037. // </>
  5038. // );
  5039. // }
  5040. }
  5041. // {
  5042. // title: "弹簧排列个数-宽",
  5043. // field: "spring_qty_width",
  5044. // datatype: "integer",
  5045. // editRender: {
  5046. // name: "$input"
  5047. // // props: {
  5048. // // type: "number"
  5049. // // }
  5050. // }
  5051. // },
  5052. // {
  5053. // title: "弹簧排列个数-长",
  5054. // field: "spring_qty_length",
  5055. // datatype: "integer",
  5056. // editRender: {
  5057. // name: "$input"
  5058. // // props: {
  5059. // // type: "number"
  5060. // // }
  5061. // }
  5062. // }
  5063. ];
  5064. const handleToImportMxInner = async () => {
  5065. let _params = {
  5066. dsname: "web_mattress_formulalist",
  5067. queryparams: {
  5068. arg_array_formulatype: [101],
  5069. arrg_usetype: 0
  5070. }
  5071. };
  5072. let res = await CommonDynamicSelect(_params);
  5073. let idxStr = "";
  5074. const $table = state.innerClothLayerMxRef.element;
  5075. if ($table) {
  5076. const { visibleData } = $table.getTableData();
  5077. if (visibleData.length) {
  5078. let lastMx = visibleData[visibleData.length - 1];
  5079. idxStr = Number(lastMx.chastr.match(/\d+$/)?.[0] ?? 0) + 1 + "";
  5080. } else {
  5081. idxStr = "";
  5082. }
  5083. }
  5084. if (res?.datatable?.length) {
  5085. const $table = state.innerClothLayerMxRef.element;
  5086. // $table.remove();
  5087. let _rows = res?.datatable.map((item: any, index: number) => {
  5088. let _data: any = {};
  5089. if (Number(item.if_mtrl) > 1) {
  5090. _data.addmx = "+";
  5091. _data.delmx = "-";
  5092. }
  5093. _data.formulatype = item.formulatype;
  5094. _data.if_mtrl = item.if_mtrl;
  5095. _data.formulaid = item.formulaid;
  5096. _data.sortcode = item.sortcode;
  5097. _data.formulakind = item.formulakind;
  5098. _data.formula = item.formula;
  5099. _data.chastr = "内布套" + idxStr;
  5100. _data.useformula = item.useformula;
  5101. _data.gydscrp = item.gydscrp;
  5102. _data.pid = index + 1;
  5103. return _data;
  5104. });
  5105. // let tree = {
  5106. // chastr: "内布套",
  5107. // children: _rows
  5108. // };
  5109. // $table.insertAt(tree, -1);
  5110. await $table.insertAt(_rows, -1);
  5111. ElMessage.success("导入成功");
  5112. autoLoadExtraData(state.innerClothLayerMxRef, state.specialProcessesMxRef, 4, "chastr");
  5113. }
  5114. resetMergeCellsInner();
  5115. };
  5116. const resetMergeCellsInner = () => {
  5117. setTimeout(() => {
  5118. const $table = state.innerClothLayerMxRef.element;
  5119. if ($table) {
  5120. let mergeCells = autoMergeCells($table, ["chastr"]);
  5121. console.log("resetMergeCellsInner autoMergeCells :>> ", mergeCells);
  5122. $table.setMergeCells(mergeCells);
  5123. }
  5124. }, 200);
  5125. };
  5126. const resetSpecialProcesses = (type: string) => {
  5127. console.log("resetSpecialProcesses type:>> ", type);
  5128. console.log("resetSpecialProcesses additionalCostsMxInitData:>> ", state.additionalCostsMxInitData);
  5129. console.log("resetSpecialProcesses specialProcessesMxInitData:>> ", state.specialProcessesMxInitData);
  5130. // setTimeout(() => {
  5131. // const $table = state.innerClothLayerMxRef.element;
  5132. // if ($table) {
  5133. // let mergeCells = autoMergeCells($table, ["chastr"]);
  5134. // console.log("resetMergeCellsInner autoMergeCells :>> ", mergeCells);
  5135. // $table.setMergeCells(mergeCells);
  5136. // }
  5137. // }, 200);
  5138. };
  5139. const hanleDelMxInner = async (type: number) => {
  5140. const $table = state.innerClothLayerMxRef.element;
  5141. if ($table) {
  5142. if (type == 1) {
  5143. // 全部
  5144. await $table.remove();
  5145. } else if (type == 0) {
  5146. // 删除选中
  5147. const curRow = $table.getCurrentRecord();
  5148. if (!curRow) {
  5149. ElMessage.warning("请先选择要删除的行");
  5150. return;
  5151. }
  5152. let _chastr = curRow?.chastr;
  5153. const { visibleData } = $table.getTableData();
  5154. let _vData = visibleData.filter((o: any) => o.chastr != _chastr);
  5155. await $table.reloadData(_vData);
  5156. ElMessage.success("成功删除" + _chastr);
  5157. }
  5158. autoLoadExtraData(state.innerClothLayerMxRef, state.specialProcessesMxRef, 4, "chastr");
  5159. resetMergeCellsInner();
  5160. }
  5161. };
  5162. const w_mattress_add_itemname_choose = (type: number) => {
  5163. let arr = [];
  5164. if (type == 1) {
  5165. } else if (type == 2) {
  5166. } else if (type == 3) {
  5167. arr.push({
  5168. label: "内布套",
  5169. value: "内布套"
  5170. });
  5171. arr.push({
  5172. label: "内布套拆装",
  5173. value: "内布套拆装"
  5174. });
  5175. } else if (type == 4) {
  5176. arr.push({
  5177. label: "顶布裥棉1",
  5178. value: "顶布裥棉1"
  5179. });
  5180. arr.push({
  5181. label: "顶布裥棉2",
  5182. value: "顶布裥棉2"
  5183. });
  5184. arr.push({
  5185. label: "顶布裥棉3",
  5186. value: "顶布裥棉3"
  5187. });
  5188. arr.push({
  5189. label: "顶布裥棉4",
  5190. value: "顶布裥棉4"
  5191. });
  5192. }
  5193. return arr;
  5194. };
  5195. const wf_add_w_butao = async (val: any) => {
  5196. console.log("val :>> ", val);
  5197. const $table = state.topCottonMxRef.element;
  5198. if ($table) {
  5199. const { fullData } = $table.getTableData();
  5200. let ifind = fullData.find(t => t.chastr == val.value);
  5201. if (ifind) {
  5202. ElMessage.warning(`该选项${val.value}已存在`);
  5203. return;
  5204. }
  5205. let newParams: any = {};
  5206. newParams.queryParams = {
  5207. arg_array_formulatype: [103],
  5208. arrg_usetype: 0
  5209. };
  5210. newParams.dsname = "web_mattress_formulalist";
  5211. let res = await CommonDynamicSelect(newParams);
  5212. console.log("funcAddBigSide res :>> ", res);
  5213. if (res.datatable) {
  5214. let _rows = res?.datatable.map((item: any) => {
  5215. let _data: any = {};
  5216. if (Number(item.if_mtrl) > 1) {
  5217. _data.addmx = "+";
  5218. _data.delmx = "-";
  5219. }
  5220. _data.formulatype = item.formulatype;
  5221. _data.if_mtrl = item.if_mtrl;
  5222. _data.formulaid = item.formulaid;
  5223. _data.sortcode = item.sortcode;
  5224. _data.formulakind = item.formulakind;
  5225. _data.formula = item.formula;
  5226. _data.chastr = val.value;
  5227. _data.useformula = item.useformula;
  5228. _data.gydscrp = item.gydscrp;
  5229. return _data;
  5230. });
  5231. $table.insertAt(_rows, -1);
  5232. }
  5233. }
  5234. resetMergeCellsTopCotton();
  5235. };
  5236. const resetMergeCellsTopCotton = () => {
  5237. setTimeout(() => {
  5238. const $table = state.topCottonMxRef.element;
  5239. if ($table) {
  5240. let mergeCells = autoMergeCells($table, ["chastr"]);
  5241. console.log("resetMergeCellsInner autoMergeCells :>> ", mergeCells);
  5242. $table.setMergeCells(mergeCells);
  5243. }
  5244. }, 1);
  5245. };
  5246. /**
  5247. * @description 删除顶布裥棉明细
  5248. */
  5249. const wf_del_w_butao = async () => {
  5250. const $table = state.topCottonMxRef.element;
  5251. // 删除选中
  5252. const curRow = $table.getCurrentRecord();
  5253. const { fullData } = $table.getTableData();
  5254. if (!curRow) {
  5255. ElMessage.warning("请先选择要删除的行");
  5256. return;
  5257. }
  5258. let ls_chastr = curRow.chastr;
  5259. ElMessageBox.confirm(`是否确定要删除【${ls_chastr}】的明细行?`, "询问", {
  5260. confirmButtonText: "是",
  5261. cancelButtonText: "否",
  5262. type: "warning"
  5263. }).then(() => {
  5264. let _rows = fullData.filter((item: any) => item.chastr == ls_chastr);
  5265. $table.remove(_rows);
  5266. ElMessage({
  5267. type: "success",
  5268. message: "删除成功"
  5269. });
  5270. });
  5271. };
  5272. /**
  5273. * @description 获取部门的价格表id
  5274. * @returns
  5275. */
  5276. const getPriceid = () => {
  5277. let _deptid = state.LjDetailRef?._mainData?.deptid ?? 0;
  5278. if (!_deptid) {
  5279. ElMessage.warning("请先选择部门");
  5280. state.LjDetailRef?.baseformRef.element.validateField("deptid");
  5281. return 0;
  5282. }
  5283. let deptEnum = state.LjDetailRef.enumMap.get("deptid");
  5284. let _pricelistid = 0;
  5285. if (deptEnum) {
  5286. let depItem = deptEnum.find((item: any) => item.value == _deptid);
  5287. if (depItem) {
  5288. _pricelistid = Number(depItem.pricelistid);
  5289. }
  5290. }
  5291. return _pricelistid;
  5292. };
  5293. // 节流
  5294. const disshow_subspecs = throttle((val: any) => {
  5295. setMxSpringQtyWidthAndLength(val);
  5296. }, 500);
  5297. /**
  5298. * @description 设置床网高度,自动计算宽度,长度
  5299. */
  5300. const setMxSpringQtyWidthAndLength = async scope => {
  5301. console.log("setMxSpringQtyWidthAndLength varow :>> ", scope);
  5302. const { row } = scope;
  5303. const $tableBednet = state.bednetMxRef.element;
  5304. if ($tableBednet) {
  5305. const { visibleData } = $tableBednet.getTableData();
  5306. // 需要填写关键数据
  5307. if (!Number(row.mattress_width) || !Number(row.mattress_length) || !Number(row.mattress_height)) {
  5308. return;
  5309. }
  5310. // 如果表格没有数据/没有选床网,则不执行
  5311. if (!visibleData.length || !visibleData[0].mtrlid) {
  5312. return;
  5313. }
  5314. let _pricelistid = getPriceid();
  5315. for (let i = 0; i < visibleData.length; i++) {
  5316. let _mainData = visibleData[i];
  5317. if (_mainData.mtrlid > 0) {
  5318. let bednet = cloneDeep(_mainData);
  5319. bednet.bednetid = _mainData.mtrlid;
  5320. // bednet.if_doublenet = Number(bednet.if_doublenet);
  5321. // bednet.if_doublespring = Number(bednet.if_doublespring);
  5322. // bednet.if_side_iron = Number(bednet.if_side_iron);
  5323. // bednet.if_rsorwa = Number(bednet.if_rsorwa);
  5324. // bednet.if_sponge_drilling = Number(bednet.if_sponge_drilling);
  5325. // bednet.iffork = Number(bednet.iffork);
  5326. // bednet.ifsaleout = Number(bednet.ifsaleout);
  5327. // bednet.if_jb = Number(bednet.if_jb);
  5328. // bednet.flag = Number(bednet.flag);
  5329. bednet.mattress_length = row.mattress_length;
  5330. bednet.mattress_width = row.mattress_width;
  5331. bednet.pricelistid = _pricelistid;
  5332. let _params: any = {
  5333. bednet: bednet
  5334. // bednetMx: state.vxeTableMxRef?.element.getTableData().fullData ?? [],
  5335. // spring: state.vxeTableMxSpringRef?.element.getTableData().fullData ?? []
  5336. };
  5337. console.log("setMxSpringQtyWidthAndLength _params :>> ", _params);
  5338. let res = await GetComputeSpring(_params);
  5339. console.log("setMxSpringQtyWidthAndLength res :>> ", res);
  5340. console.log("setMxSpringQtyWidthAndLength row :>> ", row);
  5341. if (!res?.message) {
  5342. scope.row["spring_qty_width_" + (i + 1)] = res.bednetMx[0].spring_qty_width;
  5343. scope.row["spring_qty_length_" + (i + 1)] = res.bednetMx[0].spring_qty_length;
  5344. }
  5345. console.log("setMxSpringQtyWidthAndLength scopes row :>> ", scope.row);
  5346. }
  5347. }
  5348. }
  5349. };
  5350. /**
  5351. * @description 计算拼侧数量
  5352. */
  5353. const computedExtraSizeNum = (enumarr: any, arr: any, key: string, arg_extraid: number) => {
  5354. console.log("computedExtraSizeNum specialProcessesEnum.value :>> ", enumarr);
  5355. let extraArr = enumarr.filter(item => item.typeid == 1 && item.extraid == arg_extraid && item.extramxname.includes(key));
  5356. let arrNum = arr.filter(item => item.includes(key)).length;
  5357. let result = [];
  5358. extraArr.forEach(o => {
  5359. // 判断名称中出现的数量
  5360. try {
  5361. const checker = new Function("value", `return ${text2Formula(o.extramxname)};`);
  5362. if (checker(arrNum)) {
  5363. result.push(o);
  5364. }
  5365. } catch (error) {
  5366. console.log("error :>> ", error);
  5367. ElMessage.error(`${t("sys.api.operationFailed")}特殊工艺名称: ${error}`);
  5368. }
  5369. });
  5370. return result;
  5371. };
  5372. /**
  5373. * @description 判断目前选择的拼接数据量,自动导入修改特殊工艺费用
  5374. * @params tableRef 表格实例
  5375. * @params targetRef 目标表格实例
  5376. * @params arg_extraid 数据库建立的特殊费用id,1:特殊费用,4:内布套
  5377. * @params matchAttr 匹配字段
  5378. */
  5379. const autoLoadExtraData = (tableRef?: any, targetRef?: any, arg_extraid = 1, matchAttr = "sortcode") => {
  5380. //计算拼侧数量
  5381. const $table = tableRef.element;
  5382. const { visibleData } = $table.getTableData();
  5383. const $tableTarget = targetRef.element;
  5384. const { visibleData: tgVisibleData } = $tableTarget.getTableData();
  5385. let arr = [];
  5386. // 收集拼侧,并去重
  5387. visibleData.map(t => arr.push(t[matchAttr]));
  5388. arr = Array.from(new Set(arr));
  5389. console.log("autoLoadExtraData 收集拼侧,并去重 arr :>> ", arr, visibleData);
  5390. //
  5391. let _remove = [];
  5392. tgVisibleData.map(t => {
  5393. if (t.extraid == arg_extraid) {
  5394. _remove.push(t);
  5395. }
  5396. });
  5397. $tableTarget.remove(_remove);
  5398. let result = [];
  5399. if (!arr.includes("普通大侧")) {
  5400. result = result.concat(computedExtraSizeNum(state.specialProcessesMxData, arr, "上下", arg_extraid));
  5401. result = result.concat(computedExtraSizeNum(state.specialProcessesMxData, arr, "左右", arg_extraid));
  5402. result = result.concat(computedExtraSizeNum(state.specialProcessesMxData, arr, "内布套", arg_extraid));
  5403. console.log("autoLoadExtraData result :>> ", result, state.specialProcessesMxData);
  5404. }
  5405. if (result.length) {
  5406. let _arr = [];
  5407. let _mattressId = state.LjDetailRef._mainData.mattressid;
  5408. result.map(o => {
  5409. let _itm = {
  5410. mattressid: _mattressId,
  5411. mattressmxid: 0,
  5412. extraid: o.extraid,
  5413. extramxid: o.extramxid,
  5414. // extratypename: "",
  5415. extraname: o.extramxname,
  5416. price: o.price,
  5417. qty: o.qty,
  5418. dscrp: o.dscrp,
  5419. inputtype: o.inputtype,
  5420. typeid: o.typeid
  5421. };
  5422. _arr.push(_itm);
  5423. });
  5424. $tableTarget.insertAt(_arr, -1);
  5425. }
  5426. };
  5427. /**
  5428. * @description 获取特殊工艺数据
  5429. * @params mtrlItem 物料
  5430. * @params targetRef 目标表格实例
  5431. * @params arg_extraid 数据库建立的特殊费用id,5: 物料的特殊工艺费用
  5432. */
  5433. const autoLoadMtrlExtra = (mtrlItem?: any, targetRef?: any, arg_extraid = 5) => {
  5434. //计算拼侧数量
  5435. if (mtrlItem?.extra_cost == 0) return;
  5436. // const $table = tableRef.element;
  5437. // const { visibleData } = $table.getTableData();
  5438. const $tableTarget = targetRef.element;
  5439. const { visibleData: tgVisibleData } = $tableTarget.getTableData();
  5440. let _remove = [];
  5441. tgVisibleData.map(t => {
  5442. if (t.extraid == arg_extraid && mtrlItem.mtrlid == t?.mtrlid) {
  5443. _remove.push(t);
  5444. }
  5445. });
  5446. $tableTarget.remove(_remove);
  5447. let result = [];
  5448. let extraArr = state.specialProcessesMxData.filter(item => item.typeid == 1 && item.extraid == arg_extraid);
  5449. if (extraArr.length) {
  5450. // 取额外费用数据模版,插入
  5451. result.push(extraArr[0]);
  5452. }
  5453. if (result.length) {
  5454. let _arr = [];
  5455. let _mattressId = state.LjDetailRef._mainData.mattressid;
  5456. result.map(o => {
  5457. let _itm = {
  5458. mattressid: _mattressId,
  5459. mattressmxid: 0,
  5460. extraid: o.extraid,
  5461. extramxid: o.extramxid,
  5462. extraname: mtrlItem.mtrlname,
  5463. price: mtrlItem.extra_cost,
  5464. qty: o.qty,
  5465. dscrp: o.dscrp,
  5466. inputtype: o.inputtype,
  5467. typeid: o.typeid,
  5468. mtrlid: mtrlItem.mtrlid
  5469. };
  5470. _arr.push(_itm);
  5471. });
  5472. $tableTarget.insertAt(_arr, -1);
  5473. }
  5474. };
  5475. /**
  5476. * @description 自动导入修改特殊工艺费用
  5477. */
  5478. const autoLoadExtraData_chai = (value?: any, fieldName?: any) => {
  5479. console.log("autoLoadExtraData_chai value :>> ", value);
  5480. let _type = "";
  5481. switch (fieldName) {
  5482. case "if_m_chai":
  5483. _type = "面拆";
  5484. break;
  5485. case "if_z_chai":
  5486. _type = "中拆";
  5487. break;
  5488. case "if_d_chai":
  5489. _type = "底拆";
  5490. break;
  5491. }
  5492. console.log("state. specialProcessesEnum:>> ", state.specialProcessesEnum, state.specialProcessesMxData);
  5493. let result = state.specialProcessesMxData.filter((item: any) => item.extramxname.indexOf(_type) > -1);
  5494. if (result.length) {
  5495. const $tableTarget = state.specialProcessesMxRef.element;
  5496. const { visibleData: tgVisibleData } = $tableTarget.getTableData();
  5497. if (tgVisibleData) {
  5498. let _remove = [];
  5499. tgVisibleData.map(t => {
  5500. let _itm = result.find(i => i.extraid === t.extraid && i.extramxid === t.extramxid);
  5501. if (_itm) {
  5502. _remove.push(t);
  5503. }
  5504. });
  5505. $tableTarget.remove(_remove);
  5506. }
  5507. if (value) {
  5508. // 新增
  5509. if (result.length) {
  5510. let _arr = [];
  5511. let _mattressId = state.LjDetailRef._mainData.mattressid;
  5512. result.map(o => {
  5513. let _itm = {
  5514. mattressid: _mattressId,
  5515. mattressmxid: 0,
  5516. extraid: o.extraid,
  5517. extramxid: o.extramxid,
  5518. extraname: o.extramxname,
  5519. price: o.price,
  5520. qty: o.qty,
  5521. dscrp: o.dscrp,
  5522. inputtype: o.inputtype,
  5523. typeid: o.typeid
  5524. };
  5525. _arr.push(_itm);
  5526. });
  5527. $tableTarget.insertAt(_arr, -1);
  5528. }
  5529. } else {
  5530. // 删除
  5531. }
  5532. }
  5533. };
  5534. const gotoErpapi = (_cur, type) => {
  5535. try {
  5536. if (type === 1) {
  5537. if (_cur.yw_flag == 1) {
  5538. throw new Error(_cur.mattresscode + ":已业务补充审核,无法修改");
  5539. }
  5540. } else if (type === 2) {
  5541. if (_cur.js1_flag == 1) {
  5542. throw new Error(_cur.mattresscode + ":已产品补充审核,无法修改");
  5543. }
  5544. } else if (type === 3) {
  5545. if (_cur.js2_flag == 1) {
  5546. throw new Error(_cur.mattresscode + ":已清单补充审核,无法修改");
  5547. }
  5548. }
  5549. } catch (error) {
  5550. ElMessage.error(error.message);
  5551. return false;
  5552. }
  5553. router.push({
  5554. path: `/erpapi/mattressInterface/edit/${_cur.mattressid}`,
  5555. query: {
  5556. code: _cur.mattresscode,
  5557. type: type
  5558. }
  5559. });
  5560. };
  5561. /**
  5562. * @description 更新主副规格表结构
  5563. */
  5564. const updateSubspecsTable = () => {
  5565. // state.columnsMx_subSpecs_dis = [];
  5566. // 检查床网
  5567. console.log("updateSubspecsTable state.columnsMx_subSpecs_dis :>> ", state.columnsMx_subSpecs_dis);
  5568. const $tableBendet = state.bednetMxRef.element;
  5569. const $tableSubspecs = state.subSpecsRef?.element;
  5570. let cols = [];
  5571. let visibleData = [];
  5572. if ($tableSubspecs) {
  5573. visibleData = $tableSubspecs.getTableData().visibleData;
  5574. }
  5575. if ($tableBendet) {
  5576. const { visibleData: bednetVisibleData } = $tableBendet.getTableData();
  5577. if (bednetVisibleData && bednetVisibleData.length) {
  5578. // let filedsName = state.columnsMx_subSpecs_dis
  5579. // .filter((item: any) => item.field && item.field.indexOf("spring_qty_width_") > -1)
  5580. // .map(item => item.field);
  5581. // let bednetFieldsName = bednetVisibleData
  5582. // .filter((item: any) => item.mtrlid)
  5583. // .map(item => "spring_qty_width_" + item.mtrlid);
  5584. console.log(
  5585. 'filedsName.join(",") != bednetFieldsName.join(",") :>> ',
  5586. // filedsName.join(","),
  5587. // bednetFieldsName.join(","),
  5588. bednetVisibleData
  5589. );
  5590. // if (filedsName.join(",") != bednetFieldsName.join(",")) {
  5591. bednetVisibleData.map((item: any, idx: any) => {
  5592. if (item.mtrlid) {
  5593. cols.push({
  5594. title: "弹簧排列个数-宽" + "-床网" + (idx + 1),
  5595. field: "spring_qty_width_" + (idx + 1),
  5596. datatype: "integer",
  5597. editRender: {
  5598. name: "$input"
  5599. }
  5600. });
  5601. cols.push({
  5602. title: "弹簧排列个数-宽" + "-床网" + (idx + 1),
  5603. field: "spring_qty_length_" + (idx + 1),
  5604. datatype: "integer",
  5605. editRender: {
  5606. name: "$input"
  5607. }
  5608. });
  5609. // 床网使用弹叉
  5610. cols.push({
  5611. title: "弹叉数量" + "-床网" + (idx + 1),
  5612. field: "bednet_fork_qty_" + (idx + 1),
  5613. datatype: "integer",
  5614. editRender: {
  5615. name: "$input"
  5616. }
  5617. });
  5618. }
  5619. });
  5620. // }
  5621. }
  5622. }
  5623. const $tableCushions = state.cushionsMxRef.element;
  5624. if ($tableCushions) {
  5625. const { visibleData: cushionsVisibleData } = $tableCushions.getTableData();
  5626. if (cushionsVisibleData && cushionsVisibleData.length) {
  5627. // let filedsName = state.columnsMx_subSpecs_dis
  5628. // .filter((item: any) => item.field && item.field.indexOf("cushions_subspecs_") > -1)
  5629. // .map(item => item.field);
  5630. // let cushionsFieldsName = cushionsVisibleData
  5631. // .filter((item: any) => item.mtrlid && item.if_subspecs)
  5632. // .map(item => "cushions_subspecs_" + item.mtrlid);
  5633. // console.log('filedsName.join(",") ', filedsName.join(","));
  5634. // console.log(' cushionsFieldsName.join(",") :>> ', cushionsFieldsName.join(","));
  5635. // if (filedsName.join(",") != cushionsFieldsName.join(",")) {
  5636. let idx = 0;
  5637. cushionsVisibleData.map((item: any, index: any) => {
  5638. if (item.mtrlid && item.if_subspecs) {
  5639. let _field = "cushions_subspecs_" + (idx + 1);
  5640. let _mtrlname = "cushions_subspecs_mtrlname_" + (idx + 1);
  5641. let _formulakind = "cushions_subspecs_formulakind_" + (idx + 1);
  5642. idx++;
  5643. visibleData = visibleData.map(itm => {
  5644. itm[_formulakind] = item.formulakind;
  5645. return itm;
  5646. });
  5647. cols.push({
  5648. title: "垫层物料-" + item.chastr + " " + (index + 1),
  5649. field: _mtrlname,
  5650. width: "200",
  5651. datatype: "integer",
  5652. editRender: {},
  5653. editColRender: (scope: any) => {
  5654. const { column, row, status, $table } = scope;
  5655. let _label = column.title;
  5656. let _pricelistid = getPriceid();
  5657. let _mtrltypeItem: any = mtrltypeTabList_cushions.find(t => t.formulakinds.includes(Number(row[_formulakind])));
  5658. if (!_mtrltypeItem) {
  5659. // ElMessage.error("不是垫层类型行,不能选物料");
  5660. // return <></>;
  5661. }
  5662. console.log("updateSubspecsTable _mtrltypeItem :>> ", _mtrltypeItem);
  5663. let params = {
  5664. mtrltype: _mtrltypeItem?.value,
  5665. pricelistid: _pricelistid
  5666. };
  5667. return (
  5668. <>
  5669. <MtrldefSelect
  5670. value={row[_field]}
  5671. {...params}
  5672. disabled={!_mtrltypeItem}
  5673. clearable
  5674. placeholder={_label}
  5675. onOpenModal={() =>
  5676. fModelChoseMtrl(
  5677. row,
  5678. params,
  5679. (data, val: any) => {
  5680. row[_field] = val.mtrlid;
  5681. row[_mtrlname] = val.mtrlname;
  5682. },
  5683. _mtrltypeItem?.label,
  5684. $table
  5685. )
  5686. }
  5687. onSelect={(val: any) => {
  5688. row[_field] = val.mtrlid;
  5689. row[_mtrlname] = val.mtrlname;
  5690. }}
  5691. onClear={() => {
  5692. row[_field] = 0;
  5693. row[_mtrlname] = "";
  5694. }}
  5695. >
  5696. {{
  5697. label: () => row[_mtrlname]
  5698. }}
  5699. </MtrldefSelect>
  5700. </>
  5701. );
  5702. }
  5703. });
  5704. }
  5705. });
  5706. // }
  5707. }
  5708. }
  5709. // if (cols.length > 0) {
  5710. state.columnsMx_subSpecs_dis = columnsMx_subSpecs.concat(cols);
  5711. console.log("updateSubspecsTable state.columnsMx_subSpecs_dis 321:>> ", state.columnsMx_subSpecs_dis);
  5712. nextTick(() => {
  5713. // state.subSpecsRef.element.loadColumn(state.columnsMx_subSpecs_dis);
  5714. state.subSpecsRef.loadColumns(state.columnsMx_subSpecs_dis);
  5715. console.log("visibleData :>> ", visibleData);
  5716. if ($tableSubspecs) {
  5717. state.subSpecsData = visibleData;
  5718. }
  5719. });
  5720. // }
  5721. };
  5722. return {
  5723. ...toRefs(state),
  5724. columns,
  5725. columnsMx,
  5726. columnsMxBednet: funcMergeColumn(columnsMx, bednetCoumns, bednetExtraColumns),
  5727. columnsMxCushions: funcMergeColumn(columnsMx, cushionsColumns),
  5728. columnsMxAccessories: funcMergeColumn(columnsMx, accessoriesColumns),
  5729. columnsMxPackag: funcMergeColumn(columnsMx, packagColumns),
  5730. columnsMxInnerClothLayer,
  5731. // summaryData,
  5732. // fieldParams,
  5733. columnsMx_subSpecs,
  5734. columnsMx_processes,
  5735. columnsMx_additional,
  5736. funcAddMxSide,
  5737. funcChaifenTab,
  5738. getData_mx,
  5739. dataCallback,
  5740. dataCallbackMx,
  5741. getMattressType,
  5742. gotoSummy,
  5743. gotoHisprice,
  5744. getFormulakindEnum,
  5745. funcPacktypeChange,
  5746. dynamicRef,
  5747. wf_cmp_cb,
  5748. handleToImportMxInner,
  5749. hanleDelMxInner,
  5750. wf_add_w_butao,
  5751. wf_del_w_butao,
  5752. w_mattress_add_itemname_choose,
  5753. wf_rtr_bednet,
  5754. funcAddMtrlMx,
  5755. resetMergeCellsInner,
  5756. resetSpecialProcesses,
  5757. resetMergeCellsTopCotton,
  5758. wf_rtr_cwdc,
  5759. gotoErpapi,
  5760. updateSubspecsTable,
  5761. funcChaifenTabPro,
  5762. getQuoteListMxData,
  5763. autoLoadExtraData,
  5764. autoLoadExtraData_chai
  5765. };
  5766. };