index.tsx 126 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784
  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 } 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 } 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 { calculateFormula, formulaPartsFormula, floatAdd, floatMul, formatFixedNumber, autoMergeCells } from "@/utils/index";
  16. import { cloneDeep, defaultsDeep } from "lodash-es";
  17. import { TYPE, useToast, POSITION } from "vue-toastification";
  18. import ToastFormula from "@/components/ToastWidget/Formula/index.vue";
  19. import ToastHistoryPrice from "@/components/ToastWidget/HistoryPrice/index.vue";
  20. import { useRouter } from "vue-router";
  21. import { useGlobalStore } from "@/stores/modules/global";
  22. interface defaultState {
  23. /**
  24. * @description 单据当前状态
  25. */
  26. orderStatus: string;
  27. LjDetailRef: any;
  28. MtrldefDialogRef: any;
  29. MtrldefDialogProps: any;
  30. BednetDialogRef: any;
  31. BednetDialogProps: any;
  32. /**
  33. * @description 面料tab页拆分
  34. */
  35. fabricMxTabList: any[];
  36. otherMxTabList: any[];
  37. /**
  38. * @description 面料当前tab页
  39. */
  40. fabricMxTabs: any;
  41. // fabricMxRef: any;
  42. fabricMxTab8Ref: any;
  43. fabricMxTab9Ref: any;
  44. fabricMxTab10Ref: any;
  45. fabricMxTab11Ref: any;
  46. fabricMxTab12Ref: any;
  47. fabricMxTab13Ref: any;
  48. bednetMxRef: any;
  49. cushionsMxRef: any;
  50. accessoriesMxRef: any;
  51. packagMxRef: any;
  52. innerClothLayerMxRef: any;
  53. topCottonMxRef: any;
  54. subSpecsRef: any;
  55. fabricMxTab8: any[];
  56. fabricMxTab9: any[];
  57. fabricMxTab10: any[];
  58. fabricMxTab11: any[];
  59. fabricMxTab12: any[];
  60. fabricMxTab13: any[];
  61. /**
  62. * @description 面料明细数据-裥大侧 新增
  63. */
  64. fabricMx10NewMtrlGroup: any[];
  65. /**
  66. * @description 面料明细数据-裥小侧 新增
  67. */
  68. fabricMx11NewMtrlGroup: any[];
  69. /**
  70. * @description 床垫类型枚举
  71. */
  72. mattresstypeEnum: any;
  73. /**
  74. * @description 原始明细数据
  75. */
  76. oriMxData: any;
  77. initParams: any;
  78. /**
  79. * @description 垫层数据
  80. */
  81. cushionsMxData: any;
  82. fabricMxData: any;
  83. /**
  84. * @description 辅料数据
  85. */
  86. accessoriesMxData: any;
  87. /**
  88. * @description 床网数据
  89. */
  90. bednetMxData: any;
  91. /**
  92. * @description 包装数据
  93. */
  94. packagMxData: any;
  95. /**
  96. * @description 公式弹窗-是否展示详细公式
  97. */
  98. showFormula: boolean;
  99. QuoteListDrawerRef: any;
  100. formulaKindEnum: any;
  101. formulaKindDcEnum: any;
  102. packtypeOptions: any;
  103. woodpallettypeOptions: any;
  104. areaOptions: any;
  105. cabinetTypeOptions: any;
  106. diancengAreaEnum: any;
  107. topCottonAddList: any;
  108. AllFormulaRef: any;
  109. LjDrawerRef: any;
  110. bednetDrawerProps: bednetDrawerPropsdata;
  111. cmpFormulas: any;
  112. cmpFormulaReplace: any;
  113. }
  114. interface bednetDrawerPropsdata {
  115. deptid?: number;
  116. bednetid?: number;
  117. state?: string;
  118. }
  119. export const useHooks = (t?: any) => {
  120. const state = reactive<defaultState>({
  121. orderStatus: "",
  122. LjDetailRef: null,
  123. // fabricMxRef: null,
  124. fabricMxTab8Ref: null,
  125. fabricMxTab9Ref: null,
  126. fabricMxTab10Ref: null,
  127. fabricMxTab11Ref: null,
  128. fabricMxTab12Ref: null,
  129. fabricMxTab13Ref: null,
  130. MtrldefDialogRef: null,
  131. MtrldefDialogProps: {},
  132. BednetDialogRef: null,
  133. BednetDialogProps: {},
  134. fabricMxTabs: "",
  135. fabricMxTabList: [
  136. {
  137. label: "裥面",
  138. name: "tabpage_8",
  139. visible: () => Number(state.mattresstypeEnum.if_top_side) == 1,
  140. type: [0, 80, 40, 50, 60, 70, 9000],
  141. ref: "fabricMxTab8Ref"
  142. },
  143. {
  144. label: "裥底",
  145. name: "tabpage_9",
  146. visible: () => Number(state.mattresstypeEnum.if_button_sdie) == 1,
  147. type: [1, 81, 41, 51, 61, 71, 9001],
  148. ref: "fabricMxTab9Ref"
  149. },
  150. {
  151. label: "裥大恻",
  152. name: "tabpage_10",
  153. visible: () => Number(state.mattresstypeEnum.if_big_side) == 1,
  154. type: [2, 82, 42, 52, 62, 72, 9002],
  155. ref: "fabricMxTab10Ref"
  156. },
  157. {
  158. label: "裥小恻",
  159. name: "tabpage_11",
  160. visible: () => Number(state.mattresstypeEnum.if_small_side) == 1,
  161. type: [3, 83, 43, 53, 63, 73, 9003],
  162. ref: "fabricMxTab11Ref"
  163. },
  164. {
  165. label: "裥V恻",
  166. name: "tabpage_12",
  167. visible: () => Number(state.mattresstypeEnum.if_v_side) == 1,
  168. type: [4, 84, 44, 54, 64, 74, 9004],
  169. ref: "fabricMxTab12Ref"
  170. },
  171. {
  172. label: "拉手刺绣及其他工艺",
  173. name: "tabpage_13",
  174. visible: () => true,
  175. type: [
  176. 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,
  177. 9001, 9002, 9003, 9004, 9005, 9006
  178. ], // not in
  179. ref: "fabricMxTab13Ref"
  180. },
  181. {
  182. label: "床网",
  183. name: "bednetMx",
  184. ref: "bednetMxRef"
  185. },
  186. {
  187. label: "垫层",
  188. name: "cushionsMx",
  189. ref: "cushionsMxRef"
  190. },
  191. {
  192. label: "辅料",
  193. name: "accessoriesMx",
  194. ref: "accessoriesMxRef"
  195. },
  196. {
  197. label: "包装",
  198. name: "packagMx",
  199. ref: "packagMxRef"
  200. },
  201. {
  202. label: "内布套",
  203. name: "innerClothLayerMx",
  204. ref: "innerClothLayerMxRef"
  205. },
  206. {
  207. label: "顶布裥棉",
  208. name: "topCottonMx",
  209. ref: "topCottonMxRef"
  210. }
  211. ],
  212. otherMxTabList: [
  213. {
  214. label: "内布套",
  215. name: "tabpage_14",
  216. type: [101, 102, 103, 104, 105, 106]
  217. },
  218. {
  219. label: "外布套",
  220. name: "tabpage_15",
  221. type: [111, 112, 113, 114, 115, 116]
  222. }
  223. ],
  224. fabricMxTab8: [],
  225. fabricMxTab9: [],
  226. fabricMxTab10: [],
  227. fabricMxTab11: [],
  228. fabricMxTab12: [],
  229. fabricMxTab13: [],
  230. fabricMx10NewMtrlGroup: [
  231. {
  232. label: "普通大侧",
  233. value: 1
  234. },
  235. {
  236. label: "上下拼侧1",
  237. value: 2
  238. },
  239. {
  240. label: "上下拼侧2",
  241. value: 3
  242. },
  243. {
  244. label: "上下拼侧3",
  245. value: 4
  246. },
  247. {
  248. label: "左右拼侧1",
  249. value: 5
  250. },
  251. {
  252. label: "左右拼侧2",
  253. value: 6
  254. },
  255. {
  256. label: "左右拼侧3",
  257. value: 7
  258. },
  259. {
  260. label: "左右拼侧4",
  261. value: 8
  262. }
  263. ],
  264. fabricMx11NewMtrlGroup: [
  265. {
  266. label: "小侧1",
  267. value: 1
  268. },
  269. {
  270. label: "小侧1-上下拼侧1",
  271. value: 2
  272. },
  273. {
  274. label: "小侧1-上下拼侧2",
  275. value: 3
  276. },
  277. {
  278. label: "小侧1-上下拼侧3",
  279. value: 4
  280. }
  281. ],
  282. mattresstypeEnum: {},
  283. oriMxData: {},
  284. initParams: { arg_mattressid: 0 },
  285. fabricMxData: [],
  286. bednetMxData: [],
  287. cushionsMxData: [],
  288. accessoriesMxData: [],
  289. packagMxData: [],
  290. showFormula: false,
  291. QuoteListDrawerRef: null,
  292. formulaKindEnum: null,
  293. formulaKindDcEnum: null,
  294. bednetMxRef: null,
  295. cushionsMxRef: null,
  296. accessoriesMxRef: null,
  297. packagMxRef: null,
  298. innerClothLayerMxRef: null,
  299. topCottonMxRef: null,
  300. subSpecsRef: null,
  301. packtypeOptions: [
  302. {
  303. label: "压包",
  304. value: "0"
  305. },
  306. {
  307. label: "卷包",
  308. value: "1"
  309. },
  310. {
  311. label: "国内",
  312. value: "2"
  313. }
  314. ],
  315. woodpallettypeOptions: [
  316. {
  317. label: "普通木托",
  318. value: "0"
  319. },
  320. {
  321. label: "夹板木托",
  322. value: "1"
  323. },
  324. {
  325. label: "铁管木托",
  326. value: "2"
  327. }
  328. ],
  329. areaOptions: [
  330. {
  331. label: "普通地区",
  332. value: "普通地区"
  333. },
  334. {
  335. label: "特定地区",
  336. value: "特定地区"
  337. }
  338. ],
  339. cabinetTypeOptions: [
  340. {
  341. label: "大柜",
  342. value: "大柜"
  343. },
  344. {
  345. label: "小柜",
  346. value: "小柜"
  347. }
  348. ],
  349. diancengAreaEnum: [],
  350. topCottonAddList: [],
  351. AllFormulaRef: null,
  352. LjDrawerRef: null,
  353. bednetDrawerProps: {},
  354. cmpFormulas: [],
  355. cmpFormulaReplace: []
  356. });
  357. const router = useRouter();
  358. /**
  359. * @description 面料分类取值
  360. */
  361. const mtrltypeTabList = [
  362. {
  363. label: "选布料",
  364. formulakinds: [0, 1, 2, 3, 4, 101, 111],
  365. value: 3
  366. },
  367. {
  368. label: "喷胶绵",
  369. formulakinds: [40, 41, 42, 43, 44, 102, 112],
  370. value: 5
  371. },
  372. {
  373. label: "裥绵海绵",
  374. formulakinds: [50, 51, 52, 53, 54, 103, 113],
  375. value: 4
  376. },
  377. {
  378. label: "无纺布",
  379. formulakinds: [60, 61, 62, 63, 64, 104, 114],
  380. value: 30
  381. },
  382. {
  383. label: "裥花图案",
  384. formulakinds: [70, 71, 72, 73, 74, 105, 115],
  385. value: 26
  386. },
  387. {
  388. label: "布料-加工工艺",
  389. formulakinds: [80, 81, 82, 83, 84, 106, 116],
  390. value: 15
  391. },
  392. {
  393. label: "拉手",
  394. formulakinds: [5],
  395. value: 10
  396. },
  397. {
  398. label: "刺绣",
  399. formulakinds: [6],
  400. value: 11
  401. },
  402. {
  403. label: "大侧*压布",
  404. formulakinds: [7],
  405. value: 3
  406. },
  407. {
  408. label: "大侧*边带",
  409. formulakinds: [8, 9],
  410. value: 9
  411. },
  412. {
  413. label: "大侧*上下压线",
  414. formulakinds: [10],
  415. value: 12
  416. },
  417. {
  418. label: "垫层",
  419. formulakinds: [11, 32, 33],
  420. value: 6
  421. },
  422. {
  423. label: "顶布",
  424. formulakinds: [12],
  425. value: 3
  426. },
  427. {
  428. label: "毡类",
  429. formulakinds: [13],
  430. value: 7
  431. },
  432. {
  433. label: "打底无纺布",
  434. formulakinds: [14],
  435. value: 2
  436. },
  437. {
  438. label: "辅料",
  439. formulakinds: [15],
  440. value: 8
  441. },
  442. {
  443. label: "PE",
  444. formulakinds: [16],
  445. value: 16
  446. },
  447. {
  448. label: "外层PE",
  449. formulakinds: [17],
  450. value: 17
  451. },
  452. {
  453. label: "PVC",
  454. formulakinds: [18],
  455. value: 18
  456. },
  457. {
  458. label: "卷包包装",
  459. formulakinds: [19],
  460. value: 19
  461. },
  462. {
  463. label: "牛皮纸袋",
  464. formulakinds: [20],
  465. value: 20
  466. },
  467. {
  468. label: "蓝色PE护角",
  469. formulakinds: [21],
  470. value: 21
  471. },
  472. {
  473. label: "无纺布袋",
  474. formulakinds: [22],
  475. value: 22
  476. },
  477. {
  478. label: "牛皮袋护角",
  479. formulakinds: [23],
  480. value: 23
  481. },
  482. {
  483. label: "编织袋",
  484. formulakinds: [24],
  485. value: 24
  486. },
  487. {
  488. label: "外袋",
  489. formulakinds: [25],
  490. value: 13
  491. },
  492. {
  493. label: "内袋",
  494. formulakinds: [26],
  495. value: 14
  496. },
  497. {
  498. label: "无拉手脚轮",
  499. formulakinds: [27],
  500. value: -1
  501. },
  502. {
  503. label: "拉钮",
  504. formulakinds: [28],
  505. value: -1
  506. },
  507. {
  508. label: "网面布料",
  509. formulakinds: [29],
  510. value: -1
  511. },
  512. {
  513. label: "防火线",
  514. formulakinds: [30],
  515. value: -1
  516. },
  517. {
  518. label: "木托",
  519. formulakinds: [31],
  520. value: -1
  521. },
  522. {
  523. label: "床网",
  524. formulakinds: [99],
  525. value: -1
  526. },
  527. {
  528. label: "拉链",
  529. formulakinds: [202],
  530. value: 31
  531. },
  532. {
  533. label: "席垫",
  534. formulakinds: [203],
  535. value: 32
  536. },
  537. {
  538. label: "车花边",
  539. formulakinds: [205],
  540. value: 32
  541. }
  542. ];
  543. /**
  544. * @description 包装
  545. */
  546. const mtrltypeTabList_packag = [
  547. {
  548. label: "选布料",
  549. formulakinds: [0, 1, 2, 3, 4],
  550. value: 3
  551. },
  552. {
  553. label: "喷胶绵",
  554. formulakinds: [40, 41, 42, 43, 44],
  555. value: 5
  556. },
  557. {
  558. label: "裥绵海绵",
  559. formulakinds: [50, 51, 52, 53, 54],
  560. value: 4
  561. },
  562. {
  563. label: "无纺布",
  564. formulakinds: [60, 61, 62, 63, 64],
  565. value: 2
  566. },
  567. {
  568. label: "裥花图案",
  569. formulakinds: [70, 71, 72, 73, 74],
  570. value: 4
  571. },
  572. {
  573. label: "布料-加工工艺",
  574. formulakinds: [80, 81, 82, 83, 84],
  575. value: 15
  576. },
  577. {
  578. label: "拉手",
  579. formulakinds: [5],
  580. value: 10
  581. },
  582. {
  583. label: "刺绣",
  584. formulakinds: [6],
  585. value: 11
  586. },
  587. {
  588. label: "大侧*压布",
  589. formulakinds: [7],
  590. value: 2
  591. },
  592. {
  593. label: "大侧*边带",
  594. formulakinds: [8, 9],
  595. value: 9
  596. },
  597. {
  598. label: "大侧*上下压线",
  599. formulakinds: [10],
  600. value: 12
  601. },
  602. {
  603. label: "垫层",
  604. formulakinds: [11, 32, 33],
  605. value: 6
  606. },
  607. {
  608. label: "顶布",
  609. formulakinds: [12],
  610. value: 3
  611. },
  612. {
  613. label: "毡类",
  614. formulakinds: [13],
  615. value: 7
  616. },
  617. {
  618. label: "打底无纺布",
  619. formulakinds: [14],
  620. value: 2
  621. },
  622. {
  623. label: "辅料",
  624. formulakinds: [15],
  625. value: 8
  626. },
  627. {
  628. label: "PE",
  629. formulakinds: [16],
  630. value: 16
  631. },
  632. {
  633. label: "外层PE",
  634. formulakinds: [17],
  635. value: 17
  636. },
  637. {
  638. label: "PVC",
  639. formulakinds: [18],
  640. value: 18
  641. },
  642. {
  643. label: "卷包包装",
  644. formulakinds: [19],
  645. value: 19
  646. },
  647. {
  648. label: "牛皮纸袋",
  649. formulakinds: [20],
  650. value: 20
  651. },
  652. {
  653. label: "蓝色PE护角",
  654. formulakinds: [21],
  655. value: 21
  656. },
  657. {
  658. label: "无纺布袋",
  659. formulakinds: [22],
  660. value: 22
  661. },
  662. {
  663. label: "牛皮袋护角",
  664. formulakinds: [23],
  665. value: 23
  666. },
  667. {
  668. label: "编织袋",
  669. formulakinds: [24],
  670. value: 24
  671. },
  672. {
  673. label: "外袋",
  674. formulakinds: [25],
  675. value: 13
  676. },
  677. {
  678. label: "内袋",
  679. formulakinds: [26],
  680. value: 14
  681. },
  682. {
  683. label: "无拉手脚轮",
  684. formulakinds: [27],
  685. value: -1
  686. },
  687. {
  688. label: "拉钮",
  689. formulakinds: [28],
  690. value: -1
  691. },
  692. {
  693. label: "网面布料",
  694. formulakinds: [29],
  695. value: -1
  696. },
  697. {
  698. label: "防火线",
  699. formulakinds: [30],
  700. value: -1
  701. },
  702. {
  703. label: "木托",
  704. formulakinds: [31],
  705. value: -1
  706. },
  707. {
  708. label: "床网",
  709. formulakinds: [99],
  710. value: -1
  711. }
  712. ];
  713. /**
  714. * @description 垫层
  715. */
  716. const mtrltypeTabList_cushions = [
  717. {
  718. label: "垫层",
  719. formulakinds: [11, 32, 33],
  720. value: 6
  721. },
  722. {
  723. label: "顶布",
  724. formulakinds: [12],
  725. value: 29
  726. },
  727. {
  728. label: "毡类",
  729. formulakinds: [13, 35],
  730. value: 7
  731. },
  732. {
  733. label: "打底无纺布",
  734. formulakinds: [14],
  735. value: 2
  736. },
  737. {
  738. label: "网面布料",
  739. formulakinds: [29],
  740. value: 3
  741. },
  742. {
  743. label: "顶布裥棉",
  744. formulakinds: [1201],
  745. value: 1201
  746. }
  747. ];
  748. /**
  749. * @description 辅料
  750. */
  751. const mtrltypeTabList_accessories = [
  752. {
  753. label: "辅料",
  754. formulakinds: [15],
  755. value: 8
  756. }
  757. ];
  758. /**
  759. * @description 内部套
  760. */
  761. const mtrltypeTabList_inner = [
  762. {
  763. label: "选布料",
  764. formulakinds: [0, 1, 2, 3, 4, 101, 111],
  765. value: 3
  766. },
  767. {
  768. label: "喷胶绵",
  769. formulakinds: [40, 41, 42, 43, 44, 102, 112],
  770. value: 5
  771. },
  772. {
  773. label: "裥绵海绵",
  774. formulakinds: [50, 51, 52, 53, 54, 103, 113],
  775. value: 4
  776. },
  777. {
  778. label: "无纺布",
  779. formulakinds: [60, 61, 62, 63, 64, 104, 114],
  780. value: 200
  781. },
  782. {
  783. label: "裥花图案",
  784. formulakinds: [70, 71, 72, 73, 74, 105, 115],
  785. value: 26
  786. },
  787. {
  788. label: "布料-加工工艺",
  789. formulakinds: [80, 81, 82, 83, 84, 106, 116],
  790. value: 15
  791. },
  792. {
  793. label: "拉手",
  794. formulakinds: [5],
  795. value: 10
  796. },
  797. {
  798. label: "刺绣",
  799. formulakinds: [6],
  800. value: 11
  801. },
  802. {
  803. label: "大侧*压布",
  804. formulakinds: [7],
  805. value: 2
  806. },
  807. {
  808. label: "大侧*边带",
  809. formulakinds: [8, 9],
  810. value: 9
  811. },
  812. {
  813. label: "大侧*上下压线",
  814. formulakinds: [10],
  815. value: 12
  816. },
  817. {
  818. label: "垫层",
  819. formulakinds: [11, 32, 33],
  820. value: 6
  821. },
  822. {
  823. label: "顶布",
  824. formulakinds: [12],
  825. value: 3
  826. },
  827. {
  828. label: "毡类",
  829. formulakinds: [13],
  830. value: 7
  831. },
  832. {
  833. label: "打底无纺布",
  834. formulakinds: [14],
  835. value: 2
  836. },
  837. {
  838. label: "辅料",
  839. formulakinds: [15],
  840. value: 8
  841. },
  842. {
  843. label: "PE",
  844. formulakinds: [16],
  845. value: 16
  846. },
  847. {
  848. label: "外层PE",
  849. formulakinds: [17],
  850. value: 17
  851. },
  852. {
  853. label: "PVC",
  854. formulakinds: [18],
  855. value: 18
  856. },
  857. {
  858. label: "卷包包装",
  859. formulakinds: [19],
  860. value: 19
  861. },
  862. {
  863. label: "牛皮纸袋",
  864. formulakinds: [20],
  865. value: 20
  866. },
  867. {
  868. label: "蓝色PE护角",
  869. formulakinds: [21],
  870. value: 21
  871. },
  872. {
  873. label: "无纺布袋",
  874. formulakinds: [22],
  875. value: 22
  876. },
  877. {
  878. label: "牛皮袋护角",
  879. formulakinds: [23],
  880. value: 23
  881. },
  882. {
  883. label: "编织袋",
  884. formulakinds: [24],
  885. value: 24
  886. },
  887. {
  888. label: "外袋",
  889. formulakinds: [25],
  890. value: 13
  891. },
  892. {
  893. label: "内袋",
  894. formulakinds: [26],
  895. value: 14
  896. },
  897. {
  898. label: "无拉手脚轮",
  899. formulakinds: [27],
  900. value: -1
  901. },
  902. {
  903. label: "拉钮",
  904. formulakinds: [28],
  905. value: -1
  906. },
  907. {
  908. label: "网面布料",
  909. formulakinds: [29],
  910. value: -1
  911. },
  912. {
  913. label: "防火线",
  914. formulakinds: [30],
  915. value: -1
  916. },
  917. {
  918. label: "木托",
  919. formulakinds: [31],
  920. value: -1
  921. },
  922. {
  923. label: "床网",
  924. formulakinds: [99],
  925. value: -1
  926. },
  927. {
  928. label: "拉链",
  929. formulakinds: [202],
  930. value: 31
  931. },
  932. {
  933. label: "边带",
  934. formulakinds: [203],
  935. value: -9
  936. }
  937. ];
  938. const { userInfo } = useUserStore();
  939. state.orderStatus = inject("orderStatus", "");
  940. const getData_mx = (params: any) => {
  941. console.log("getData params :>> ", params);
  942. let newParams: any = {};
  943. params.pageNum && (newParams.pageindex = params.pageNum);
  944. params.pageSize && (newParams.pagesize = params.pageSize);
  945. delete params.pageNum;
  946. delete params.pageSize;
  947. newParams.queryParams = params;
  948. console.log("params :>> ", params);
  949. newParams.dsname = "web_mattress_mx";
  950. return CommonDynamicSelect(newParams, DwnameEnum.mattressQuoteMx);
  951. // return [];
  952. };
  953. const dataCallback = (data: any) => {
  954. console.log("dataCallback data :>> ", data);
  955. if (data.datatable.length > 0) {
  956. data.datatable = data.datatable.map((item: any) => {
  957. item.dannum_rate = Number(item.dannum_rate);
  958. // item.if_w_butao = Boolean(Number(item.if_w_butao));
  959. return item;
  960. });
  961. }
  962. return {
  963. list: data.datatable,
  964. tableinfo: data.tableinfo,
  965. total: data.totalcnt,
  966. pageNum: data.pageindex,
  967. pageSize: data.pagesize
  968. };
  969. };
  970. const dataCallbackMx = (data: any) => {
  971. console.log("dataCallback data :>> ", data);
  972. return {
  973. list: data.datatable,
  974. tableinfo: data.tableinfo,
  975. total: data.totalcnt,
  976. pageNum: data.pageindex,
  977. pageSize: data.pagesize
  978. };
  979. };
  980. const funcMoneyrateChange = async (val: any, data) => {
  981. let newParams = {
  982. dsname: "_Mapper_deptid",
  983. queryparams: {
  984. deptid: data.deptid
  985. }
  986. };
  987. let res = await CommonDynamicSelect(newParams);
  988. let _discount = 1;
  989. let _moneyrate = 1;
  990. if (res.datatable?.length > 0) {
  991. _discount = res.datatable[0].discount;
  992. _moneyrate = res.datatable[0].moneyrate;
  993. }
  994. data.moneyrate = _moneyrate;
  995. data.discount = _discount;
  996. };
  997. const funcTaxrateChange = async (val: any, data) => {
  998. data.taxrate = val;
  999. };
  1000. /**
  1001. * @description 弹窗模块:床网选择
  1002. * @param data 当前数据
  1003. * @param status 当前订单状态
  1004. * @returns Promise
  1005. */
  1006. const fModelChoseBednet = (data: any, params: any, $table?: any) => {
  1007. return new Promise((resolve, reject) => {
  1008. // if (!ALLOW_EDIT_STATE.includes(status)) return;
  1009. let _params = {
  1010. ...params,
  1011. keyword: ""
  1012. };
  1013. state.BednetDialogProps = {
  1014. onSubmit: (res: any) => {
  1015. // submit
  1016. console.log("openCustDialog res", res);
  1017. nextTick(() => {
  1018. rModelSetBednet(data, res.value[0], $table);
  1019. resolve(1);
  1020. });
  1021. },
  1022. onCancel: (error: any) => {
  1023. // cancel 回调
  1024. console.log("openCustDialog error", error);
  1025. }
  1026. };
  1027. state.BednetDialogRef.show(_params);
  1028. });
  1029. };
  1030. /**
  1031. * @description 更新垫层的床网厚度信息
  1032. * @param data 床网订单信息
  1033. */
  1034. const wf_rtr_cwdc = (data: any, item: any, action: string) => {
  1035. console.log("wf_rtr_cwdc data :>> ", data);
  1036. const $table = state.cushionsMxRef.element;
  1037. let { fullData } = $table.getTableData();
  1038. // fullData.map(item => {
  1039. // if (Number(item.formulakind) == 999 && Number(item.thickness) == 0) {
  1040. // $table.setRow(item, {
  1041. // thickness: data.bednet_height,
  1042. // qty: 1
  1043. // });
  1044. // }
  1045. // });
  1046. const $tableBednet = state.bednetMxRef.element;
  1047. let currentBednetIndex = $tableBednet.getRowSeq(data);
  1048. if (action == "add") {
  1049. let records = cloneDeep(fullData.find(o => o.formulakind == 999));
  1050. records.thickness = 0;
  1051. records.qty = 0;
  1052. records._X_ROW_KEY = "";
  1053. let bednetList = fullData.filter(o => Number(o.formulakind) == 999);
  1054. let lastIndex = $table.getRowSeq(bednetList[bednetList.length - 1]);
  1055. console.log("wf_rtr_cwdc lastIndex :>> ", bednetList, lastIndex, records);
  1056. $table.insertAt(records, lastIndex);
  1057. } else {
  1058. console.log("wf_rtr_cwdc currentBednetIndex :>> ", action, currentBednetIndex);
  1059. let index = 1;
  1060. fullData.map(o => {
  1061. if (Number(o.formulakind) == 999) {
  1062. if (index == currentBednetIndex) {
  1063. if (action == "set") {
  1064. $table.setRow(o, {
  1065. thickness: item?.bednet_height,
  1066. qty: 1
  1067. });
  1068. } else if (action == "clear") {
  1069. $table.setRow(o, {
  1070. thickness: 0,
  1071. qty: 0
  1072. });
  1073. } else if (action == "del") {
  1074. // $table.setRow(o, {
  1075. // thickness: 0,
  1076. // qty: 0
  1077. // });
  1078. $table.remove(o);
  1079. }
  1080. }
  1081. index++;
  1082. }
  1083. });
  1084. }
  1085. };
  1086. /**
  1087. * @description 更新床网tab的垫层床网信息
  1088. * @param data 床网订单信息
  1089. */
  1090. const wf_rtr_bednet = (data: any, item: any, action: string) => {
  1091. console.log("wf_rtr_cwdc data :>> ", data);
  1092. const $table = state.cushionsMxRef.element;
  1093. let { fullData } = $table.getTableData();
  1094. // fullData.map(item => {
  1095. // if (Number(item.formulakind) == 999 && Number(item.thickness) == 0) {
  1096. // $table.setRow(item, {
  1097. // thickness: data.bednet_height,
  1098. // qty: 1
  1099. // });
  1100. // }
  1101. // });
  1102. // const $tableBednet = state.bednetMxRef.element;
  1103. // let { fullData: bednetFullData } = $tableBednet.getTableData();
  1104. // let currentBednetIndex = $tableBednet.getRowSeq(data);
  1105. // if (action == "add") {
  1106. // let records = cloneDeep(fullData.find(o => o.formulakind == 999));
  1107. // records.thickness = 0;
  1108. // records.qty = 0;
  1109. // records._X_ROW_KEY = "";
  1110. // let bednetList = fullData.filter(o => Number(o.formulakind) == 999);
  1111. // let lastIndex = bednetList[bednetList.length - 1];
  1112. // console.log("wf_rtr_cwdc lastIndex :>> ", bednetList, lastIndex, records);
  1113. // $tableBednet.insertAt(records, lastIndex);
  1114. // } else {
  1115. // console.log("wf_rtr_cwdc currentBednetIndex :>> ", action, currentBednetIndex);
  1116. // let index = 1;
  1117. // fullData.map(o => {
  1118. // if (Number(o.formulakind) == 999) {
  1119. // if (index == currentBednetIndex) {
  1120. // if (action == "set") {
  1121. // $table.setRow(o, {
  1122. // thickness: item?.bednet_height,
  1123. // qty: 1
  1124. // });
  1125. // } else if (action == "clear") {
  1126. // $table.setRow(o, {
  1127. // thickness: 0,
  1128. // qty: 0
  1129. // });
  1130. // } else if (action == "del") {
  1131. // // $table.setRow(o, {
  1132. // // thickness: 0,
  1133. // // qty: 0
  1134. // // });
  1135. // $table.remove(o);
  1136. // }
  1137. // }
  1138. // index++;
  1139. // }
  1140. // });
  1141. // }
  1142. };
  1143. /**
  1144. * @description 垫层tab,公式名选择,联动增删床网tab
  1145. * @param val
  1146. * @param lastVal
  1147. * @param scope
  1148. */
  1149. const cushionsFormulaKindChange = (val: any, lastVal: any, scope: any) => {
  1150. console.log("wf_rtr_cwdc cushionsFormulaKindChange val :>> ", val, lastVal, scope);
  1151. const $table = state.cushionsMxRef.element;
  1152. const $table_bednet = state.bednetMxRef.element;
  1153. const { visibleData } = $table.getTableData();
  1154. if (Number(val) === 999 && Number(lastVal) !== 999) {
  1155. // 新增
  1156. if ($table_bednet) {
  1157. const { visibleData: visibleData_bednet } = $table_bednet.getTableData();
  1158. let curIndex = visibleData_bednet.length - 1;
  1159. // 寻找垫层当前位置,对上一个床网行位置进行复制
  1160. let arr = visibleData.filter((t, i) => t.formulakind == 999 && i < scope.$rowIndex);
  1161. if (arr.length > 0) {
  1162. curIndex = arr.length - 1;
  1163. }
  1164. console.log("wf_rtr_cwdc curIndex :>> ", curIndex);
  1165. rModelClearMtrl(scope.row);
  1166. funcAddMtrlMx({ row: visibleData_bednet[curIndex] }, null, "bednetMxRef", arr.length == 0);
  1167. }
  1168. } else if (Number(val) !== 999 && Number(lastVal) === 999) {
  1169. // 删除
  1170. if ($table_bednet) {
  1171. const { visibleData: visibleData_bednet } = $table_bednet.getTableData();
  1172. let curIndex = visibleData_bednet.length - 1;
  1173. curIndex = visibleData
  1174. .filter(t => t.formulakind == 999 || t._X_ROW_KEY === scope.row._X_ROW_KEY)
  1175. .findIndex(t => t._X_ROW_KEY === scope.row._X_ROW_KEY);
  1176. console.log("wf_rtr_cwdc curIndex :>> ", curIndex);
  1177. if (visibleData_bednet.length == 1) {
  1178. ElMessage.warning("不能全部删除,至少保留一个床网");
  1179. scope.row.formulakind = 999;
  1180. return false;
  1181. }
  1182. rModelClearMtrl(scope.row);
  1183. funcDelBednet({ row: visibleData_bednet[curIndex], data: visibleData_bednet }, null, "bednetMxRef");
  1184. }
  1185. } else {
  1186. rModelClearMtrl(scope.row);
  1187. }
  1188. };
  1189. const rModelSetBednet = (data: any, item: any, $table?: any) => {
  1190. console.log("rModelSetBednet data :>> ", data, item);
  1191. if (item) {
  1192. let _mtrlname =
  1193. item.typename +
  1194. " " +
  1195. item.bednetcode +
  1196. " " +
  1197. item.mattress_width +
  1198. "*" +
  1199. item.mattress_length +
  1200. "*" +
  1201. item.mattress_height;
  1202. data.mtrlid = item.bednetid;
  1203. data.mtrlname = _mtrlname;
  1204. data.price = item.nottax_factory_cost;
  1205. data.qty = 1;
  1206. wf_rtr_cwdc(data, item, "set");
  1207. if ($table) {
  1208. $table.clearEdit();
  1209. nextTick(() => {
  1210. $table.setActiveRow(data);
  1211. });
  1212. }
  1213. }
  1214. };
  1215. const rModelClearBednet = (data: any, $table?: any) => {
  1216. console.log("rModelSetBednet data :>> ", data);
  1217. data.mtrlid = 0;
  1218. data.mtrlname = "";
  1219. data.price = 0;
  1220. wf_rtr_cwdc(data, null, "clear");
  1221. if ($table) {
  1222. $table.clearEdit();
  1223. }
  1224. };
  1225. /**
  1226. * @description 弹窗模块:物料选择
  1227. * @param data 当前数据
  1228. * @param status 当前订单状态
  1229. * @returns Promise
  1230. */
  1231. const fModelChoseMtrl = (data: any, params: any, cb: any, label?: string, $table?: any) => {
  1232. return new Promise((resolve, reject) => {
  1233. // if (!ALLOW_EDIT_STATE.includes(status)) return;
  1234. let _params = {
  1235. keyword: "",
  1236. arg_mtrltype: params.mtrltype,
  1237. arg_pricelistid: params.pricelistid
  1238. };
  1239. state.MtrldefDialogProps = {
  1240. onSubmit: (res: any) => {
  1241. // submit
  1242. console.log("openCustDialog res", res);
  1243. nextTick(() => {
  1244. cb(data, res.value[0], $table);
  1245. resolve(1);
  1246. });
  1247. },
  1248. onCancel: (error: any) => {
  1249. // cancel 回调
  1250. console.log("openCustDialog error", error);
  1251. }
  1252. };
  1253. state.MtrldefDialogRef.show(_params, label);
  1254. });
  1255. };
  1256. /**
  1257. * @description 数据赋值:物料信息
  1258. * @param data 当前数据
  1259. * @param item 当前选择的数据
  1260. */
  1261. const rModelSetMtrl = (data: any, item: any, $table?: any) => {
  1262. console.log("rModelSetMtrl data :>> ", data);
  1263. console.log("rModelSetMtrl item :>> ", item);
  1264. if (item) {
  1265. data.mattressid = state.LjDetailRef._mainData.mattressid;
  1266. data.mattressmxid = 0;
  1267. data.mtrlid = item.mtrlid;
  1268. data.price = item.pricelistprice;
  1269. data.gram_weight = item.gram_weight;
  1270. data.cloth_width = item.cloth_width;
  1271. data.if_inputqty = Number(item.if_inputqty);
  1272. data.if_areaprice = item.if_areaprice;
  1273. data.mtrlname = item.mtrlname;
  1274. data.priceunit = item.priceunit;
  1275. data.shrinkage = item.price; // 收缩率
  1276. data.thickness = Number(item.thickness);
  1277. data.price_formula = item.price_formula;
  1278. data.qty = 1;
  1279. // cb && cb();
  1280. if ($table) {
  1281. $table.clearEdit();
  1282. nextTick(() => {
  1283. $table.setActiveRow(data);
  1284. });
  1285. }
  1286. }
  1287. };
  1288. const rModelClearMtrl = (data: any, $table?: any) => {
  1289. console.log("rModelClearMtrl data :>> ", data);
  1290. data.mattressid = state.LjDetailRef._mainData.mattressid;
  1291. data.mattressmxid = 0;
  1292. data.mtrlid = 0;
  1293. data.price = 0;
  1294. data.gram_weight = 0;
  1295. data.cloth_width = 0;
  1296. data.if_inputqty = 0;
  1297. data.if_areaprice = 0;
  1298. data.mtrlname = "";
  1299. data.priceunit = "";
  1300. data.shrinkage = 0;
  1301. data.thickness = 0;
  1302. data.price_formula = "";
  1303. data.qty = "";
  1304. if ($table) {
  1305. $table.clearEdit();
  1306. }
  1307. };
  1308. /**
  1309. * @description 数据赋值:物料信息
  1310. * @param data 当前数据
  1311. * @param item 当前选择的数据
  1312. */
  1313. const rModelSetMtrlInner = (data: any, item: any, $table?: any) => {
  1314. console.log("rModelSetMtrl data :>> ", data);
  1315. console.log("rModelSetMtrl item :>> ", item);
  1316. if (item) {
  1317. data.mattressid = state.LjDetailRef._mainData.mattressid;
  1318. data.mattressmxid = 0;
  1319. data.mtrlid = item.mtrlid;
  1320. data.price = item.pricelistprice;
  1321. data.gram_weight = item.gram_weight;
  1322. data.cloth_width = item.cloth_width;
  1323. data.if_inputqty = Number(item.if_inputqty);
  1324. data.if_areaprice = item.if_areaprice;
  1325. data.mtrlname = item.mtrlname;
  1326. data.priceunit = item.priceunit;
  1327. data.shrinkage = item.price; // 收缩率
  1328. Number(item?.thickness) > 0 && (data.thickness = item.thickness);
  1329. item?.price_formula != "" && (data.price_formula = item.price_formula);
  1330. data.qty = 1;
  1331. if (Number(data.formulakind) == 5) {
  1332. data.qty = 4;
  1333. } else if ([7, 8, 9, 10, 202, 203].includes(Number(data.formulakind))) {
  1334. if (state.LjDetailRef._mainData) {
  1335. data.qty = (state.LjDetailRef._mainData.mattress_width * state.LjDetailRef._mainData.mattress_length * 2) / 100;
  1336. }
  1337. }
  1338. if ($table) {
  1339. $table.clearEdit();
  1340. nextTick(() => {
  1341. $table.setActiveRow(data);
  1342. });
  1343. }
  1344. }
  1345. };
  1346. /**
  1347. * @description 面料-裥大、小侧,增加物料
  1348. */
  1349. const funcAddMxSide = async (params: any, data: any, targetRef?: any) => {
  1350. // arg_array_formulakind
  1351. let newParams: any = {};
  1352. newParams.queryParams = params;
  1353. newParams.dsname = "web_mattress_formulalist";
  1354. let res = await CommonDynamicSelect(newParams);
  1355. console.log("funcAddBigSide res :>> ", res);
  1356. if (res.datatable) {
  1357. if (targetRef) {
  1358. const $table = targetRef.element;
  1359. if ($table) {
  1360. res.datatable.map(itm => {
  1361. let records: any = {
  1362. formulatype: itm.formulatype,
  1363. if_mtrl: Number(itm.if_mtrl),
  1364. formulaid: itm.formulaid,
  1365. sortcode: data.label,
  1366. chastr: data.label,
  1367. formulakind: Number(itm.formulakind),
  1368. formula: itm.formula,
  1369. useformula: itm.useformula,
  1370. gydscrp: itm.gydscrp
  1371. };
  1372. if (records.if_mtrl > 1) {
  1373. records.addmx = "+";
  1374. records.delmx = "-";
  1375. }
  1376. $table.insertAt(records, -1);
  1377. });
  1378. }
  1379. } else {
  1380. let arr = [];
  1381. res.datatable.map(itm => {
  1382. let records: any = {
  1383. formulatype: itm.formulatype,
  1384. if_mtrl: Number(itm.if_mtrl),
  1385. formulaid: itm.formulaid,
  1386. sortcode: data.label,
  1387. chastr: data.label,
  1388. formulakind: Number(itm.formulakind),
  1389. formula: itm.formula,
  1390. useformula: itm.useformula,
  1391. gydscrp: itm.gydscrp
  1392. };
  1393. if (records.if_mtrl > 1) {
  1394. records.addmx = "+";
  1395. records.delmx = "-";
  1396. }
  1397. arr.push(records);
  1398. });
  1399. return arr;
  1400. }
  1401. } else {
  1402. return [];
  1403. }
  1404. };
  1405. const wf_mtrl_find = async (params: any) => {
  1406. let _params: any = {
  1407. dsname: "web_mtrl_choose",
  1408. queryparams: params
  1409. };
  1410. let res = await CommonDynamicSelect(_params);
  1411. if (res?.datatable?.length) {
  1412. return res?.datatable;
  1413. } else {
  1414. return [];
  1415. }
  1416. };
  1417. /**
  1418. * @description 垫层配置 和 垫层可选项
  1419. * @author w_mattress_add wf_add_dianceng_bytype
  1420. */
  1421. const wf_add_dianceng_bytype = (dianceng_sort: string) => {
  1422. let newMxData = [];
  1423. let _diancengSortStr = dianceng_sort.replace(/,/g, ",").replace(/~r~n/g, "").replace(/~r/g, "").replace(/~n/g, "");
  1424. let arr = _diancengSortStr.split("/");
  1425. let formulakindArr = [];
  1426. arr.map(async (t, index) => {
  1427. let result = f_pb_split(t);
  1428. let _formulakind;
  1429. switch (result.left) {
  1430. case "垫层":
  1431. _formulakind = 32;
  1432. break;
  1433. case "床网":
  1434. _formulakind = 999;
  1435. break;
  1436. case "顶布":
  1437. _formulakind = 12;
  1438. break;
  1439. case "毡类":
  1440. _formulakind = 13;
  1441. break;
  1442. case "打底无纺布":
  1443. _formulakind = 14;
  1444. break;
  1445. case "网面布料":
  1446. _formulakind = 29;
  1447. break;
  1448. default:
  1449. _formulakind = -1;
  1450. break;
  1451. }
  1452. let _params = {
  1453. dsname: "web_mattress_formulalist",
  1454. queryparams: {
  1455. arg_array_formulakind: [_formulakind],
  1456. arg_array_formulatype: [0, 1, 2, 3],
  1457. pageindex: 1,
  1458. pagesize: 1
  1459. }
  1460. };
  1461. let res = await CommonDynamicSelect(_params);
  1462. if (res?.datatable?.length) {
  1463. res?.datatable.map((item: any) => {
  1464. let _data: any = {};
  1465. _data.formulatype = item.formulatype;
  1466. _data.if_mtrl = 2;
  1467. _data.formulaid = item.formulaid;
  1468. _data.sortcode = item.sortcode;
  1469. _data.formulakind = item.formulakind;
  1470. _data.formula = item.formula;
  1471. _data.chastr = wf_set_area_text(result.right);
  1472. _data.qty = 1;
  1473. _data.xu = index;
  1474. _data.useformula = item.useformula;
  1475. _data.gydscrp = item.gydscrp;
  1476. newMxData.push(_data);
  1477. });
  1478. }
  1479. });
  1480. };
  1481. const wf_add_dianceng_area_bytype = (data: string) => {
  1482. if (!data) return;
  1483. let _dataStr = data.replace(/,/g, ",").replace(/~r~n/g, "").replace(/~r/g, "").replace(/~n/g, "");
  1484. let result: any = _dataStr.split(",");
  1485. result = result.map(t => {
  1486. return { value: t, label: t };
  1487. });
  1488. return result;
  1489. };
  1490. function wf_set_area_text(arg_str) {
  1491. let ls_rtn = "";
  1492. if (arg_str.includes("大侧")) {
  1493. ls_rtn = "大侧";
  1494. } else if (arg_str.includes("小侧1")) {
  1495. ls_rtn = "小侧1";
  1496. } else if (arg_str.includes("小侧2")) {
  1497. ls_rtn = "小侧2";
  1498. } else if (arg_str.includes("小侧3")) {
  1499. ls_rtn = "小侧3";
  1500. } else if (arg_str.includes("V侧1")) {
  1501. ls_rtn = "V侧1";
  1502. } else if (arg_str.includes("V侧2")) {
  1503. ls_rtn = "V侧2";
  1504. } else if (arg_str.includes("V侧3")) {
  1505. ls_rtn = "V侧3";
  1506. } else {
  1507. ls_rtn = "";
  1508. }
  1509. return ls_rtn;
  1510. }
  1511. /**
  1512. * @description 包装默认物料设置
  1513. */
  1514. const wf_default_mtrlid = async () => {
  1515. // 包装
  1516. console.log("wf_default_mtrlid state.packagMxData :>> ", state.packagMxData);
  1517. let _deptid = state.LjDetailRef._mainData.deptid;
  1518. let deptEnum = state.LjDetailRef.enumMap.get("deptid");
  1519. let _pricelistid = 0;
  1520. console.log("deptEnum :>> ", deptEnum);
  1521. if (deptEnum) {
  1522. let depItem = deptEnum.find((item: any) => item.value == _deptid);
  1523. console.log("depItem :>> ", depItem);
  1524. if (depItem) {
  1525. _pricelistid = Number(depItem.pricelistid);
  1526. }
  1527. }
  1528. // 根据formulaid,获取全部设置的默认物料信息
  1529. let defaultMtrlList = [];
  1530. let _param_mf = {
  1531. dsname: "web_mtrl_choose",
  1532. queryparams: {
  1533. arg_array_formulaid: [16, 17, 18, 19, 27],
  1534. arg_pricelistid: _pricelistid,
  1535. arg_array_mtrlid: [46804, 46809, 46811, 46817, 46872]
  1536. }
  1537. };
  1538. let res_mf = await CommonDynamicSelect(_param_mf);
  1539. if (res_mf?.datatable?.length) {
  1540. defaultMtrlList = res_mf?.datatable;
  1541. }
  1542. // let _mtrlData = await wf_mtrl_find(_pricelistid, [46804, 46809, 46811, 46817, 46872]);
  1543. console.log("wf_default_mtrlid ccccc state.packagMxData :>> ", state.packagMxData);
  1544. state.packagMxData.map(itm => {
  1545. console.log("packagMxData itm :>> ", itm);
  1546. let _formulakind = Number(itm.formulakind);
  1547. let _data = null;
  1548. if (_formulakind == 16) {
  1549. //默认 pe kind = 16 默认 10C PE袋 mtrlid 46804
  1550. itm.mtrlid = 46804;
  1551. } else if (_formulakind == 17) {
  1552. //默认 外层pe kind = 17 默认 20C mtrlid 46809
  1553. itm.mtrlid = 46809;
  1554. } else if (_formulakind == 18) {
  1555. //默认 pvc kind = 18 默认 15C mtrlid 46811
  1556. itm.mtrlid = 46811;
  1557. } else if (_formulakind == 19) {
  1558. //默认 卷包外包装 kind = 19 默认 彩箱 32*32 46817
  1559. itm.mtrlid = 46817;
  1560. } else if (_formulakind == 27) {
  1561. //默认 拉手脚轮 kind = 27 默认 46872
  1562. itm.mtrlid = 46872;
  1563. }
  1564. _data = defaultMtrlList.find(t => t.mtrlid == itm.mtrlid);
  1565. console.log("wf_default_mtrlid _data :>> ", _data);
  1566. if (_data) {
  1567. itm.mtrlname = _data.mtrlname;
  1568. itm.price = _data.pricelistprice;
  1569. itm.gram_weight = _data.gram_weight;
  1570. itm.cloth_width = _data.cloth_width;
  1571. itm.if_inputqty = _data.if_inputqty;
  1572. itm.priceunit = _data.priceunit;
  1573. itm.shrinkage = _data.shrinkage;
  1574. itm.qty = 1;
  1575. if (_data.formula != "") {
  1576. itm.formula = _data.formula;
  1577. }
  1578. }
  1579. return itm;
  1580. });
  1581. console.log("wf_default_mtrlid state.packagMxData :>> ", state.packagMxData);
  1582. };
  1583. const wf_default_mtrlid_notbz = async () => {
  1584. console.log("state.oriMxData.list bf state.oriMxData.list :>> ", state.oriMxData.list);
  1585. // 收集数据中各种公式的formulaid
  1586. let _formulaids = [];
  1587. state.oriMxData.list.forEach((itm: any) => {
  1588. _formulaids.push(itm.formulaid);
  1589. });
  1590. // 数组去重
  1591. _formulaids = Array.from(new Set(_formulaids));
  1592. // 部门设置的报价表
  1593. let _pricelistid = 0;
  1594. let _deptid = state.LjDetailRef._mainData.deptid;
  1595. let deptEnum = state.LjDetailRef.enumMap.get("deptid");
  1596. console.log("deptEnum :>> ", deptEnum);
  1597. if (deptEnum) {
  1598. let depItem = deptEnum.find((item: any) => item.value == _deptid);
  1599. console.log("depItem :>> ", depItem);
  1600. if (depItem) {
  1601. _pricelistid = Number(depItem.pricelistid);
  1602. }
  1603. }
  1604. // 根据formulaid,获取全部设置的默认物料信息
  1605. let defaultMtrlList = [];
  1606. let _param_mf = {
  1607. dsname: "web_mtrl_choose",
  1608. queryparams: {
  1609. arg_array_formulaid: _formulaids,
  1610. arg_pricelistid: _pricelistid,
  1611. arg_array_mtrlid: [46804, 46809, 46811, 46817, 46872]
  1612. }
  1613. };
  1614. let res_mf = await CommonDynamicSelect(_param_mf);
  1615. if (res_mf?.datatable?.length) {
  1616. defaultMtrlList = res_mf?.datatable;
  1617. }
  1618. state.oriMxData.list.forEach((itm: any) => {
  1619. let _formulakind = Number(itm.formulakind);
  1620. let _data = defaultMtrlList.find(t => t.formulaid == itm.formulaid);
  1621. console.log("wf_default_mtrlid_notbz 查询默认物料_data :>> ", _data);
  1622. // 包装default
  1623. if (itm.formulatype == "3") {
  1624. let changeMtrl = 0;
  1625. if (_formulakind == 16) {
  1626. //默认 pe kind = 16 默认 10C PE袋 mtrlid 46804
  1627. changeMtrl = 46804;
  1628. } else if (_formulakind == 17) {
  1629. //默认 外层pe kind = 17 默认 20C mtrlid 46809
  1630. changeMtrl = 46809;
  1631. } else if (_formulakind == 18) {
  1632. //默认 pvc kind = 18 默认 15C mtrlid 46811
  1633. changeMtrl = 46811;
  1634. } else if (_formulakind == 19) {
  1635. //默认 卷包外包装 kind = 19 默认 彩箱 32*32 46817
  1636. changeMtrl = 46817;
  1637. } else if (_formulakind == 27) {
  1638. //默认 拉手脚轮 kind = 27 默认 46872
  1639. changeMtrl = 46872;
  1640. }
  1641. if (changeMtrl && !_data) {
  1642. _data = defaultMtrlList.find(t => t.mtrlid == changeMtrl);
  1643. }
  1644. }
  1645. if (_data) {
  1646. itm.mtrlid = _data.mtrlid;
  1647. itm.mtrlname = _data.mtrlname;
  1648. itm.price = _data.pricelistprice;
  1649. itm.gram_weight = _data.gram_weight;
  1650. itm.cloth_width = _data.cloth_width;
  1651. itm.if_inputqty = _data.if_inputqty;
  1652. itm.priceunit = _data.priceunit;
  1653. itm.shrinkage = _data.shrinkage;
  1654. itm.qty = 1;
  1655. if (_data.formula != "") {
  1656. itm.formula = _data.formula;
  1657. }
  1658. }
  1659. });
  1660. console.log("state.oriMxData.list affff state.oriMxData.list :>> ", state.oriMxData.list);
  1661. };
  1662. function f_pb_split(arg_source) {
  1663. // 检查输入字符串是否为空
  1664. if (arg_source === "") {
  1665. return;
  1666. }
  1667. // 查找逗号的位置
  1668. const commaPos = arg_source.indexOf(",");
  1669. let arg_left_str, arg_right_str;
  1670. if (commaPos > -1) {
  1671. // 如果存在逗号,分割字符串
  1672. arg_left_str = arg_source.substring(0, commaPos).trim();
  1673. arg_right_str = arg_source.substring(commaPos + 1).trim();
  1674. } else {
  1675. // 如果不存在逗号,整个字符串作为左部分,右部分为空字符串
  1676. arg_left_str = arg_source.trim();
  1677. arg_right_str = "";
  1678. }
  1679. // 返回结果
  1680. return { left: arg_left_str, right: arg_right_str };
  1681. }
  1682. /**
  1683. * @description 明细,新增
  1684. */
  1685. const funcAddMtrlMx = async (data: any, cb?: Function, refName?: string, firstRow?: boolean) => {
  1686. console.log("state.LjDetail. :>> ", state.LjDetailRef);
  1687. console.log("funcAddMtrlMx data :>> ", data);
  1688. let { row, $rowIndex, visibleData } = data;
  1689. let tgRefName = "";
  1690. if (refName) {
  1691. tgRefName = refName;
  1692. } else {
  1693. let { tabsActive } = state.LjDetailRef;
  1694. let _target = tabsActive == "fabricMx" ? state.fabricMxTabs : tabsActive;
  1695. let currentTab = state.fabricMxTabList.find(t => t.name == _target);
  1696. tgRefName = currentTab.ref;
  1697. }
  1698. const $table = state[tgRefName].element;
  1699. if ($table) {
  1700. const records = {
  1701. addmx: "+",
  1702. delmx: "-",
  1703. formulatype: row.formulatype,
  1704. if_mtrl: row.if_mtrl,
  1705. formulaid: row.formulaid,
  1706. sortcode: row.sortcode,
  1707. formulakind: row.formulakind,
  1708. formula: row.formula,
  1709. thickness: 0,
  1710. mtrlid: 0,
  1711. chastr: row.chastr,
  1712. xu: Number(row.xu) + 0.01
  1713. };
  1714. // null 从第一行插入, row: 从当前行下一行插入
  1715. let _rowIdx = firstRow ? null : row;
  1716. const { row: newRow } = await $table.insertNextAt(records, _rowIdx);
  1717. await $table.setEditCell(newRow, "mtrlname");
  1718. await $table.setCurrentRow(newRow);
  1719. cb && cb();
  1720. }
  1721. };
  1722. /**
  1723. * @description 明细,删除
  1724. */
  1725. const funcDelMtrlMx = (data: any, refName?: string) => {
  1726. let { row } = data;
  1727. let tgRefName = "";
  1728. if (refName) {
  1729. tgRefName = refName;
  1730. } else {
  1731. let { tabsActive } = state.LjDetailRef;
  1732. let _target = tabsActive == "fabricMx" ? state.fabricMxTabs : tabsActive;
  1733. let currentTab = state.fabricMxTabList.find(t => t.name == _target);
  1734. tgRefName = currentTab.ref;
  1735. }
  1736. const $table = state[tgRefName].element;
  1737. if ($table) {
  1738. $table.remove(row);
  1739. }
  1740. };
  1741. /**
  1742. * @description 明细,删除
  1743. */
  1744. const funcDelBednet = (scope: any, cb?: Function, refName?: string) => {
  1745. console.log("funcDelBednet: ", scope);
  1746. if (scope.data.length == 1) {
  1747. ElMessage.warning("不能全部删除,至少保留一个床网");
  1748. return false;
  1749. }
  1750. cb && cb();
  1751. funcDelMtrlMx(scope, refName);
  1752. };
  1753. /**
  1754. * @description 据字符串'myRef'来获取ref
  1755. * @param name
  1756. * @returns
  1757. */
  1758. const dynamicRef = name => {
  1759. return state[name]; // 获取ref的值
  1760. };
  1761. /**
  1762. * @description 获取当前需要显示的面料明细tabs
  1763. */
  1764. const getMattressType = () => {
  1765. const globalStore = useGlobalStore();
  1766. const { enumMap, _mainData } = state.LjDetailRef;
  1767. console.log("getMattressType enumMap :>> ", enumMap, _mainData, state.LjDetailRef);
  1768. let _enum = enumMap.get("mattresstypeid");
  1769. console.log("_enum :>> ", _enum);
  1770. if (_enum) {
  1771. state.mattresstypeEnum = _enum.find(t => t.value == _mainData.mattresstypeid);
  1772. console.log("mattresstypeEnum :>> ", state.mattresstypeEnum);
  1773. }
  1774. let _dwname = DwnameEnum.mattressQuote + "__fabric";
  1775. let _dftabs = "";
  1776. let _fabricShowList = undefined;
  1777. let itmshow = null;
  1778. if (globalStore?.detailtabs && Object.keys(globalStore?.detailtabs).includes(_dwname)) {
  1779. _dftabs = globalStore?.detailtabs[_dwname];
  1780. }
  1781. if (_dftabs) {
  1782. _fabricShowList = state.fabricMxTabList
  1783. .map(o => Object.keys(o).includes("visible") && o?.visible() && o)
  1784. .find(o => o?.name == _dftabs);
  1785. }
  1786. if (_fabricShowList) {
  1787. itmshow = _fabricShowList;
  1788. } else {
  1789. itmshow = state.fabricMxTabList.find(o => Object.keys(o).includes("visible") && o?.visible() && o);
  1790. }
  1791. state.fabricMxTabs = itmshow.name;
  1792. };
  1793. const funcChaifenTab = () => {
  1794. const { _mainData } = state.LjDetailRef;
  1795. // 面料
  1796. state.fabricMxData = state.oriMxData.list.filter(
  1797. t => t.formulatype == 0 || (Number(_mainData.if_bcp_type) == 1 && t.formulatype == 104)
  1798. );
  1799. console.log("funcChaifenTab fabricMxData :>> ", state.fabricMxData);
  1800. let _mx8 = state.fabricMxTabList.find(t => t.name == "tabpage_8");
  1801. state.fabricMxTab8 = state.fabricMxData.filter(t => _mx8.type.includes(Number(t.formulakind)));
  1802. state.fabricMxTab8.forEach((o, i) => {
  1803. o.xu = i + 1;
  1804. });
  1805. console.log("funcChaifenTab fabricMxTab8 :>> ", state.fabricMxTab8);
  1806. let _mx9 = state.fabricMxTabList.find(t => t.name == "tabpage_9");
  1807. state.fabricMxTab9 = state.fabricMxData.filter(t => _mx9.type.includes(Number(t.formulakind)));
  1808. state.fabricMxTab9.forEach((o, i) => {
  1809. o.xu = i + 1;
  1810. });
  1811. let _mx10 = state.fabricMxTabList.find(t => t.name == "tabpage_10");
  1812. state.fabricMxTab10 = state.fabricMxData.filter(t => _mx10.type.includes(Number(t.formulakind)));
  1813. state.fabricMxTab10.forEach((o, i) => {
  1814. o.xu = i + 1;
  1815. });
  1816. let _mx11 = state.fabricMxTabList.find(t => t.name == "tabpage_11");
  1817. state.fabricMxTab11 = state.fabricMxData.filter(t => _mx11.type.includes(Number(t.formulakind)));
  1818. state.fabricMxTab11.forEach((o, i) => {
  1819. o.xu = i + 1;
  1820. });
  1821. console.log("funcChaifenTab state.fabricMxTab11 :>> ", state.fabricMxTab11);
  1822. let _mx12 = state.fabricMxTabList.find(t => t.name == "tabpage_12");
  1823. state.fabricMxTab12 = state.fabricMxData.filter(t => _mx12.type.includes(Number(t.formulakind)));
  1824. state.fabricMxTab12.forEach((o, i) => {
  1825. o.xu = i + 1;
  1826. });
  1827. let _mx13 = state.fabricMxTabList.find(t => t.name == "tabpage_13");
  1828. state.fabricMxTab13 = state.fabricMxData.filter(t => !_mx13.type.includes(Number(t.formulakind)));
  1829. state.fabricMxTab13.forEach((o, i) => {
  1830. o.xu = i + 1;
  1831. });
  1832. // 垫层
  1833. state.cushionsMxData = state.oriMxData.list.filter(t => t.formulatype == 1);
  1834. state.cushionsMxData.forEach((o, i) => {
  1835. o.xu = i + 1;
  1836. });
  1837. // 辅料
  1838. state.accessoriesMxData = state.oriMxData.list.filter(t => t.formulatype == 2);
  1839. state.accessoriesMxData.forEach((o, i) => {
  1840. o.xu = i + 1;
  1841. });
  1842. // 包装
  1843. state.packagMxData = state.oriMxData.list.filter(t => t.formulatype == 3);
  1844. state.packagMxData.forEach((o, i) => {
  1845. o.xu = i + 1;
  1846. });
  1847. // 床网
  1848. state.bednetMxData = state.oriMxData.list.filter(t => t.formulatype == 99);
  1849. state.bednetMxData.forEach((o, i) => {
  1850. o.xu = i + 1;
  1851. });
  1852. };
  1853. /**
  1854. * @description 切换包装方式select,获取默认物料
  1855. * @param val
  1856. */
  1857. const funcPacktypeChange = async (val: any) => {
  1858. console.log("wf_import_bz val :>> ", val);
  1859. let newMxData: any = [];
  1860. const { _mainData, enumMap } = state.LjDetailRef;
  1861. if (val == "0") {
  1862. _mainData.diameter = 0;
  1863. } else if (val == "1") {
  1864. _mainData.packqty = 0;
  1865. } else {
  1866. _mainData.diameter = 0;
  1867. _mainData.packqty = 0;
  1868. }
  1869. let deptEnum = state.LjDetailRef.enumMap.get("deptid");
  1870. let _deptid = state.LjDetailRef._mainData.deptid;
  1871. let _pricelistid = 0;
  1872. console.log("deptEnum :>> ", deptEnum);
  1873. if (deptEnum) {
  1874. let depItem = deptEnum.find((item: any) => item.value == _deptid);
  1875. console.log("depItem :>> ", depItem);
  1876. if (depItem) {
  1877. _pricelistid = Number(depItem.pricelistid);
  1878. }
  1879. }
  1880. let _params = {
  1881. mattresstypeid: _mainData.mattresstypeid,
  1882. ifbcptype: _mainData.if_bcp_type,
  1883. packtype: _mainData.packtype,
  1884. pricelistid: _pricelistid
  1885. };
  1886. let res = await GetMattressPackagMx(_params);
  1887. if (res) {
  1888. newMxData = res.mattressMx;
  1889. _mainData.biandai_qty = res?.biandai_qty;
  1890. state.diancengAreaEnum = res?.diancengarea;
  1891. }
  1892. state.packagMxData = newMxData;
  1893. };
  1894. /**
  1895. * @description 重新获取明细数据
  1896. * @author w_mattress_add wf_import_dw_2
  1897. */
  1898. const wf_import_dw_2 = async () => {
  1899. // let _biandaiqty = 0;
  1900. let newMxData: any = [];
  1901. /**
  1902. * @description 床垫类别参数
  1903. */
  1904. let mattressTypeData: any = {};
  1905. const { _mainData, enumMap } = state.LjDetailRef;
  1906. let deptEnum = state.LjDetailRef.enumMap.get("deptid");
  1907. let _deptid = state.LjDetailRef._mainData.deptid;
  1908. let _pricelistid = 0;
  1909. console.log("deptEnum :>> ", deptEnum);
  1910. if (deptEnum) {
  1911. let depItem = deptEnum.find((item: any) => item.value == _deptid);
  1912. console.log("depItem :>> ", depItem);
  1913. if (depItem) {
  1914. _pricelistid = Number(depItem.pricelistid);
  1915. }
  1916. }
  1917. let _params = {
  1918. mattressid: Number(_mainData.mattressid),
  1919. mattresstypeid: _mainData.mattresstypeid,
  1920. ifbcptype: _mainData.if_bcp_type,
  1921. packtype: _mainData.packtype,
  1922. pricelistid: _pricelistid
  1923. };
  1924. let res = await GetMattressImportDW2(_params);
  1925. if (res) {
  1926. newMxData = res.mattressMx;
  1927. _mainData.biandai_qty = res?.biandai_qty;
  1928. state.diancengAreaEnum = res?.diancengarea;
  1929. }
  1930. state.oriMxData.list = newMxData;
  1931. getMattressType();
  1932. funcChaifenTab();
  1933. };
  1934. /**
  1935. * @description 变更床垫分类时,重载明细数据 dw_1 itemchange
  1936. * @author w_mattress_add dw_1 itemchange
  1937. */
  1938. const funcImportMattressMx = async () => {
  1939. console.log("funcImportMattressMx state.LjDetailRef._mainData :>> ", state.LjDetailRef, state.orderStatus);
  1940. const { _mainData, enumMap, baseformRef } = state.LjDetailRef;
  1941. // let mainData = state.orderStatus == "new" ? initParam : _mainData;
  1942. console.log("mainData :>> ", _mainData);
  1943. if (!Number(_mainData.deptid)) {
  1944. ElMessage.warning("请先选择部门");
  1945. console.log("baseformRef.element :>> ", baseformRef.element);
  1946. baseformRef.element.validateField("deptid");
  1947. _mainData.mattresstypeid = "";
  1948. return;
  1949. }
  1950. let deptEnum = enumMap.get("deptid");
  1951. let _pricelistid = 0;
  1952. if (deptEnum) {
  1953. let depItem = deptEnum.find((item: any) => item.value == _mainData.deptid);
  1954. console.log("depItem :>> ", depItem);
  1955. if (depItem) {
  1956. _pricelistid = Number(depItem.pricelistid);
  1957. }
  1958. }
  1959. if (!_pricelistid) {
  1960. ElMessage.warning("选择部门未设置价格表,请检查");
  1961. return;
  1962. }
  1963. if (!_mainData.mattresstypeid) {
  1964. ElMessage.warning("请先选择床垫类别");
  1965. return;
  1966. }
  1967. wf_import_dw_2();
  1968. };
  1969. /**
  1970. * @description 刷新报价清单
  1971. */
  1972. const wf_factory_profitrate = async () => {
  1973. const { _mainData, enumMap } = state.LjDetailRef;
  1974. console.log("wf_factory_profitrate enumMap :>> ", enumMap);
  1975. let deptEnum = enumMap.get("deptid");
  1976. console.log("deptEnum :>> ", deptEnum);
  1977. if (deptEnum) {
  1978. let depItem = deptEnum.find((item: any) => item.value == _mainData.deptid);
  1979. console.log("depItem :>> ", depItem);
  1980. if (depItem) {
  1981. _mainData.dept_profitrate = Number(depItem.profitrate);
  1982. }
  1983. }
  1984. let _params = {
  1985. dsname: "web_factory_profitratelist",
  1986. queryparams: {
  1987. arg_deptid: _mainData.deptid,
  1988. arg_bednettypeid_mattresstypeid: _mainData.mattresstypeid,
  1989. kind: 1
  1990. }
  1991. };
  1992. let res = await CommonDynamicSelect(_params);
  1993. if (res?.datatable?.length > 0) {
  1994. _mainData.profitrate = res?.datatable[0].profitrate;
  1995. }
  1996. };
  1997. /**
  1998. * @description 获取部门汇率 和 折扣率
  1999. */
  2000. const wf_get_moneyrate_discount = () => {
  2001. const { _mainData, enumMap } = state.LjDetailRef;
  2002. let deptEnum = enumMap.get("deptid");
  2003. console.log("deptEnum :>> ", deptEnum);
  2004. if (deptEnum) {
  2005. let depItem = deptEnum.find((item: any) => item.value == _mainData.deptid);
  2006. console.log("wf_get_moneyrate_discount depItem :>> ", depItem);
  2007. if (depItem) {
  2008. let _moneyrate = !depItem.moneyrate || Number(depItem.moneyrate) == 0 ? 1 : depItem.moneyrate;
  2009. console.log("_mainData.if_moneyrate == 0 :>> ", _mainData.if_moneyrate == "0");
  2010. if (_mainData.if_moneyrate == "0" || !_mainData.if_moneyrate) {
  2011. _mainData.moneyrate = 1;
  2012. } else {
  2013. _mainData.moneyrate = _moneyrate;
  2014. }
  2015. _mainData.discount = depItem.discount;
  2016. }
  2017. }
  2018. };
  2019. /**
  2020. * @description 清除运算结果
  2021. */
  2022. const wf_clear = () => {
  2023. const { _mainData } = state.LjDetailRef;
  2024. _mainData.total_fees_cost = 0;
  2025. _mainData.total_cost = 0;
  2026. _mainData.nottax_factory_cost = 0;
  2027. _mainData.nottax_dept_cost = 0;
  2028. _mainData.taxes = 0;
  2029. _mainData.dept_cost = 0;
  2030. _mainData.foreign_cost = 0;
  2031. _mainData.hrcost = 0;
  2032. _mainData.biandaicost = 0;
  2033. _mainData.fob = 0;
  2034. _mainData.profitrate_point = 0;
  2035. _mainData.butao_point = 0;
  2036. _mainData.chaizhuang_point = 0;
  2037. _mainData.haimian_point = 0;
  2038. state.fabricMxTabList.map(t => {
  2039. if (t.ref && state[t.ref]) {
  2040. console.log("t.ref?.value :>> ", t.ref, state[t.ref]);
  2041. // console.log("state[t.ref].tableData :>> ", state[t.ref].tableData);
  2042. // state[t.ref].tableData.map(item => {
  2043. // item.costamt = 0;
  2044. // item.replace_formula = "";
  2045. // item.if_success = 1;
  2046. // item.thickness = 1;
  2047. // });
  2048. let { fullData } = state[t.ref].element.getTableData();
  2049. state[t.ref].element.setRow(fullData, {
  2050. costamt: 0,
  2051. replace_formula: "",
  2052. if_success: 0
  2053. });
  2054. // console.log("fullData :>> ", fullData);
  2055. // fullData = fullData.map((itm, idx) => {
  2056. // itm.xu = idx + 1;
  2057. // return itm
  2058. // });
  2059. }
  2060. });
  2061. };
  2062. /**
  2063. * @description 更新物料最新 单价等信息
  2064. */
  2065. const wf_cmp_update_mtrl = async () => {
  2066. const { _mainData, enumMap } = state.LjDetailRef;
  2067. let computeList = [
  2068. "tabpage_8",
  2069. "tabpage_9",
  2070. "tabpage_10",
  2071. "tabpage_11",
  2072. "tabpage_12",
  2073. "tabpage_13",
  2074. "cushionsMx",
  2075. "accessoriesMx",
  2076. "packagMx"
  2077. ];
  2078. let arg_array_formulakind = [];
  2079. state.fabricMxTabList.map(t => {
  2080. if (!computeList.includes(t.name)) {
  2081. return;
  2082. }
  2083. if (t.ref && state[t.ref]) {
  2084. let { fullData } = state[t.ref].element.getTableData();
  2085. fullData.map(itm => {
  2086. arg_array_formulakind.push(itm.formulakind);
  2087. });
  2088. }
  2089. });
  2090. // 数组去重
  2091. arg_array_formulakind = Array.from(new Set(arg_array_formulakind));
  2092. let _param = {
  2093. dsname: "web_mattress_formulalist",
  2094. queryparams: {
  2095. arg_array_formulakind: arg_array_formulakind
  2096. }
  2097. };
  2098. let res = await CommonDynamicSelect(_param);
  2099. if (res?.datatable?.length) {
  2100. state.fabricMxTabList.map(t => {
  2101. if (!computeList.includes(t.name)) {
  2102. return;
  2103. }
  2104. if (t.ref && state[t.ref]) {
  2105. let { fullData } = state[t.ref].element.getTableData();
  2106. fullData.map(item => {
  2107. let tFormula = res?.datatable.find(itm => itm.formulakind == item.formulakind);
  2108. state[t.ref].element.setRow(item, {
  2109. formula: tFormula.formula ?? "err",
  2110. useformula: tFormula.useformula ?? "",
  2111. gydscrp: tFormula.gydscrp ?? ""
  2112. });
  2113. });
  2114. }
  2115. });
  2116. }
  2117. //______________________________________________________
  2118. state.fabricMxTabList.map(t => {
  2119. if (!computeList.includes(t.name)) {
  2120. return;
  2121. }
  2122. if (t.ref && state[t.ref]) {
  2123. let { fullData } = state[t.ref].element.getTableData();
  2124. fullData.map(async item => {
  2125. if (item?.mtrlid && Number(item.mtrlid) > 0) {
  2126. let res_mtrls = await wf_mtrl_find({ arg_mtrlid: item.mtrlid, arg_pricelistid: item.pricelistid });
  2127. if (res_mtrls.length > 0) {
  2128. let res_mtrl = res_mtrls[0];
  2129. let _data: any = {
  2130. mtrlname: res_mtrl.mtrlname,
  2131. price: res_mtrl.pricelistprice,
  2132. gram_weight: res_mtrl.gram_weight,
  2133. cloth_width: res_mtrl.cloth_width,
  2134. if_inputqty: res_mtrl.if_inputqty,
  2135. priceunit: res_mtrl.priceunit,
  2136. shrinkage: res_mtrl.shrinkage,
  2137. if_areaprice: res_mtrl.if_areaprice
  2138. };
  2139. if (Number(res_mtrl.if_inputqty) == 1) {
  2140. _data.thickness = res_mtrl.thickness;
  2141. }
  2142. if (!res_mtrl.formula) {
  2143. _data.formula = res_mtrl.formula;
  2144. }
  2145. if (!res_mtrl.qty_formula) {
  2146. _data.useformula = res_mtrl.qty_formula;
  2147. }
  2148. state[t.ref].element.setRow(item, _data);
  2149. }
  2150. }
  2151. });
  2152. }
  2153. });
  2154. };
  2155. /**
  2156. * @description 检查垫层 是否填写正确 并 更新 u_mattress_mx_mtrl_formulaid
  2157. */
  2158. const wf_check_dianceng_ifright = async () => {
  2159. let arg_array_formulakind = [];
  2160. let { fullData: dcData } = state.cushionsMxRef.element.getTableData();
  2161. dcData.map(itm => {
  2162. arg_array_formulakind.push(Number(itm.formulakind));
  2163. });
  2164. // 数组去重
  2165. arg_array_formulakind = Array.from(new Set(arg_array_formulakind));
  2166. let _param = {
  2167. dsname: "web_mattress_formulalist",
  2168. queryparams: {
  2169. arg_array_formulakind: arg_array_formulakind
  2170. }
  2171. };
  2172. let res = await CommonDynamicSelect(_param);
  2173. if (res?.datatable?.length) {
  2174. let { fullData } = state.cushionsMxRef.element.getTableData();
  2175. fullData.map(item => {
  2176. let tFormula = res?.datatable.find(itm => itm.formulakind == item.formulakind);
  2177. state.cushionsMxRef.element.setRow(item, {
  2178. formulaid: tFormula.formulaid
  2179. });
  2180. });
  2181. }
  2182. //检查是否 含有床网
  2183. let lb_flag = arg_array_formulakind.includes(999);
  2184. let lb_re_cmp = false; //批重算
  2185. if (!lb_flag && !lb_re_cmp) {
  2186. // ElMessageBox.confirm("垫层没有包含床网_,是否继续?", "询问", {
  2187. // confirmButtonText: '是',
  2188. // cancelButtonText: "否",
  2189. // type: "warning"
  2190. // })
  2191. // .then(() => {
  2192. // return
  2193. // })
  2194. // .catch((e: TypeError) => {
  2195. // console.log("e :>> ", e);
  2196. ElMessage({
  2197. type: "info",
  2198. message: "垫层没有包含床网_!"
  2199. });
  2200. // });
  2201. }
  2202. };
  2203. /**
  2204. * @description 重算床网价格
  2205. */
  2206. const wf_cmp_bednet = () => {
  2207. // bednetMxRef
  2208. return true;
  2209. };
  2210. /**
  2211. * @description 公式替换:替换大侧高度
  2212. */
  2213. const wf_replace_height_big_side = (arg_str: string, arg_chastr: string) => {
  2214. if (arg_str.indexOf("【大侧高度】") <= 0) return arg_str;
  2215. // let ls_str = arg_str;
  2216. const { _mainData, enumMap } = state.LjDetailRef;
  2217. let ls_seachstr = "大侧";
  2218. let lde_sum = 0;
  2219. state.cushionsMxRef.element.getTableData().fullData.map(itm => {
  2220. if (itm.chastr.indexOf(ls_seachstr) > 0 && Number(itm.qty) > 0 && Number(itm.thickness) > 0) {
  2221. lde_sum = floatAdd(lde_sum, floatMul(itm.qty, itm.thickness));
  2222. }
  2223. });
  2224. let ls_temp = formatFixedNumber({ val: lde_sum }, 4);
  2225. let ls_formula_big_side = "";
  2226. let mtEnum = enumMap.get("mattresstypeid");
  2227. let _mattresstypeid = _mainData?.mattresstypeid ?? 0;
  2228. console.log("deptEnum :>> ", mtEnum);
  2229. if (mtEnum) {
  2230. let mtItem = mtEnum.find((item: any) => Number(item.value) == _mattresstypeid);
  2231. console.log("wf_replace_height_big_side mtItem :>> ", mtItem);
  2232. ls_formula_big_side = mtItem?.formula_big_side ?? "";
  2233. }
  2234. if (ls_formula_big_side) {
  2235. arg_str = arg_str.replaceAll("【大侧高度】", ` ( ${ls_formula_big_side} ) `);
  2236. }
  2237. if (lde_sum) {
  2238. arg_str = arg_str.replaceAll("【垫层】", ls_temp);
  2239. arg_str = arg_str.replaceAll("【大侧高度】", ls_temp);
  2240. }
  2241. arg_str = arg_str.replaceAll("【位置】", `'${ls_seachstr}'`);
  2242. return arg_str;
  2243. };
  2244. /**
  2245. * @description 公式替换:小侧高度
  2246. */
  2247. const wf_replace_height_small_side = (arg_str: string, arg_chastr: string) => {
  2248. if (arg_str.indexOf("【小侧高度】") <= 0) return arg_str;
  2249. // let ls_str = arg_str;
  2250. const { _mainData, enumMap } = state.LjDetailRef;
  2251. let ls_seachstr = !arg_chastr || arg_chastr == "" ? "小侧1" : arg_chastr;
  2252. let lde_sum = 0;
  2253. state.cushionsMxRef.element.getTableData().fullData.map(itm => {
  2254. if (itm.chastr.indexOf(ls_seachstr) > 0 && Number(itm.qty) > 0 && Number(itm.thickness) > 0) {
  2255. lde_sum = floatAdd(lde_sum, floatMul(itm.qty, itm.thickness));
  2256. }
  2257. });
  2258. let ls_temp = formatFixedNumber({ val: lde_sum }, 4);
  2259. let ls_formula_big_side = "";
  2260. let mtEnum = enumMap.get("mattresstypeid");
  2261. let _mattresstypeid = _mainData?.mattresstypeid ?? 0;
  2262. console.log("deptEnum :>> ", mtEnum);
  2263. if (mtEnum) {
  2264. let mtItem = mtEnum.find((item: any) => Number(item.value) == _mattresstypeid);
  2265. console.log("wf_replace_height_big_side mtItem :>> ", mtItem);
  2266. ls_formula_big_side = mtItem?.formula_big_side ?? "";
  2267. }
  2268. if (ls_formula_big_side) {
  2269. arg_str = arg_str.replaceAll("【小侧高度】", ` ( ${ls_formula_big_side} ) `);
  2270. }
  2271. if (lde_sum) {
  2272. arg_str = arg_str.replaceAll("【垫层】", ls_temp);
  2273. }
  2274. arg_str = arg_str.replaceAll("【位置】", `'${ls_seachstr}'`);
  2275. arg_str = arg_str.replaceAll("【小侧高度】", ls_temp);
  2276. return arg_str;
  2277. };
  2278. /**
  2279. * @description 公式替换:V侧高度
  2280. */
  2281. const wf_replace_height_v_side = (arg_str: string, arg_chastr: string) => {
  2282. if (arg_str.indexOf("【V侧高度】") <= 0) return arg_str;
  2283. // let ls_str = arg_str;
  2284. const { _mainData, enumMap } = state.LjDetailRef;
  2285. let ls_seachstr = !arg_chastr || arg_chastr == "" ? "小侧1" : arg_chastr;
  2286. let lde_sum = 0;
  2287. state.cushionsMxRef.element.getTableData().fullData.map(itm => {
  2288. if (itm.chastr.indexOf(ls_seachstr) > 0 && Number(itm.qty) > 0 && Number(itm.thickness) > 0) {
  2289. lde_sum = floatAdd(lde_sum, floatMul(itm.qty, itm.thickness));
  2290. }
  2291. });
  2292. let ls_temp = formatFixedNumber({ val: lde_sum }, 4);
  2293. let ls_formula_big_side = "";
  2294. let mtEnum = enumMap.get("mattresstypeid");
  2295. let _mattresstypeid = _mainData?.mattresstypeid ?? 0;
  2296. console.log("deptEnum :>> ", mtEnum);
  2297. if (mtEnum) {
  2298. let mtItem = mtEnum.find((item: any) => Number(item.value) == _mattresstypeid);
  2299. console.log("wf_replace_height_big_side mtItem :>> ", mtItem);
  2300. ls_formula_big_side = mtItem?.formula_big_side ?? "";
  2301. }
  2302. if (ls_formula_big_side) {
  2303. arg_str = arg_str.replaceAll("【V侧高度】", ` ( ${ls_formula_big_side} ) `);
  2304. }
  2305. if (lde_sum) {
  2306. arg_str = arg_str.replaceAll("【垫层】", ls_temp);
  2307. }
  2308. arg_str = arg_str.replaceAll("【位置】", `'${ls_seachstr}'`);
  2309. ls_temp = formatFixedNumber({ val: 18 }, 4);
  2310. arg_str = arg_str.replaceAll("【V侧高度】", ls_temp);
  2311. return arg_str;
  2312. };
  2313. /**
  2314. * @description 替换布料幅宽star
  2315. * @returns string
  2316. */
  2317. const wf_replace_cloth_width = (item: any, fullData: any, formulakind: any) => {
  2318. let ls_bl_cloth_width = "";
  2319. // let { fullData: mlData } = state[t.ref].element.getTableData();
  2320. fullData.find(itm => {
  2321. if (!item?.chastr) {
  2322. if (Number(itm.formulakind) == formulakind) {
  2323. ls_bl_cloth_width = formatFixedNumber({ val: itm.cloth_width }, 4);
  2324. return true;
  2325. }
  2326. } else {
  2327. if (Number(itm.formulakind) == formulakind && itm.chastr == item?.chastr) {
  2328. ls_bl_cloth_width = formatFixedNumber({ val: itm.cloth_width }, 4);
  2329. return true;
  2330. }
  2331. }
  2332. });
  2333. // if (Number(ls_bl_cloth_width) > 0) {
  2334. // ls_Expression = ls_Expression.replaceAll('【布料幅宽】', ls_bl_cloth_width);
  2335. // ls_Use_Expression = ls_Use_Expression.replaceAll('【布料幅宽】', ls_bl_cloth_width);
  2336. // }
  2337. return ls_bl_cloth_width;
  2338. };
  2339. /**
  2340. * @description 计算价格
  2341. */
  2342. const wf_cmp_cb = async () => {
  2343. const { _mainData, enumMap, baseformRef } = state.LjDetailRef;
  2344. //wf_paixu 未有
  2345. await wf_factory_profitrate();
  2346. // 佣金
  2347. if (_mainData?.commission == 0 || !_mainData.commission) {
  2348. _mainData.commission = 1;
  2349. }
  2350. if (_mainData?.taxrate == 0 || !_mainData.taxrate) {
  2351. _mainData.taxrate = 1;
  2352. }
  2353. if (_mainData?.other_rate == 0 || !_mainData.other_rate) {
  2354. _mainData.other_rate = 1;
  2355. }
  2356. if (_mainData?.moneyrate == 0 || !_mainData.moneyrate) {
  2357. _mainData.moneyrate = 1;
  2358. }
  2359. if (_mainData?.commission < 1) {
  2360. throw new Error("佣金点数不能小于1");
  2361. }
  2362. if (_mainData?.taxrate < 1) {
  2363. throw new Error("税率不能小于1");
  2364. }
  2365. if (_mainData?.other_rate < 1) {
  2366. throw new Error("额外点数不能小于1");
  2367. }
  2368. if (_mainData?.dept_profitrate == 0) {
  2369. throw new Error("部门利润率不能为0!");
  2370. }
  2371. return true;
  2372. };
  2373. /**
  2374. * @description 展示计算公式
  2375. * @param timeout
  2376. */
  2377. const gotoSummy = async (timeout = 0) => {
  2378. // if (userInfo.usermode == 1) {
  2379. // ElMessage.error("'业务员模式不可以查看计算公式!'");
  2380. // return false;
  2381. // }
  2382. let mattress = state.LjDetailRef._mainData;
  2383. mattress.mattressid = Number(mattress.mattressid ?? 0);
  2384. mattress.xd_flag = Number(mattress.xd_flag ?? 0);
  2385. mattress.js1_flag = Number(mattress.js1_flag ?? 0);
  2386. mattress.flag = Number(mattress.flag ?? 0);
  2387. console.log("bbbbbbbbbbbbbbbbbbbb mattress :>> ", mattress);
  2388. // mattress.if_moneyrate = Number(mattress.if_moneyrate ?? 0);
  2389. // mattress.if_bcp_type = Number(mattress.if_bcp_type ?? 0);
  2390. // mattress.if_d_chai = Number(mattress.if_d_chai ?? 0);
  2391. // mattress.if_m_chai = Number(mattress.if_m_chai ?? 0);
  2392. // mattress.if_m_wbutao_way = Number(mattress.if_m_wbutao_way ?? 0);
  2393. // mattress.if_n_butao = Number(mattress.if_n_butao ?? 0);
  2394. // mattress.if_w_butao = Number(mattress.if_w_butao ?? 0);
  2395. // mattress.if_z_chai = Number(mattress.if_z_chai ?? 0);
  2396. // mattress.if_zhedie_type = Number(mattress.if_zhedie_type ?? 0);
  2397. let mattressMx = [];
  2398. state.fabricMxTabList.map(t => {
  2399. if (t.ref) {
  2400. console.log("t.ref?.value :>> ", t.ref, dynamicRef(t.ref));
  2401. if (dynamicRef(t.ref)) {
  2402. let { fullData } = dynamicRef(t.ref)?.element.getTableData();
  2403. console.log("fullData :>> ", fullData);
  2404. fullData = fullData.map((itm, idx) => {
  2405. itm.xu = idx + 1;
  2406. return itm;
  2407. });
  2408. mattressMx = mattressMx.concat(fullData);
  2409. }
  2410. }
  2411. });
  2412. let _params = {
  2413. mattress,
  2414. mattressMx
  2415. };
  2416. let res = await GetComputeMattress(_params);
  2417. console.log("GetComputeBednet res :>> ", res);
  2418. // let summaryData = [];
  2419. // let fieldParams = [];
  2420. let cpData = {};
  2421. if (!res.message) {
  2422. // summaryData = res.formulas;
  2423. // fieldParams = res.replace;
  2424. state.cmpFormulas = res.formulas;
  2425. state.cmpFormulaReplace = res.replace;
  2426. } else {
  2427. setTimeout(() => {
  2428. if (res.message) {
  2429. ElNotification({
  2430. title: "计算失败",
  2431. message: res.message,
  2432. type: "warning"
  2433. });
  2434. }
  2435. }, 100);
  2436. return false;
  2437. }
  2438. // console.log("LjDetailRef.value.mainData :>> ", LjDetailRef.value._mainData, summaryData.value);
  2439. // const { _mainData, enumMap, baseformRef } = state.LjDetailRef;
  2440. // const toast = useToast();
  2441. // let result = await calculateFormula(summaryData.value, fieldParams.value, _mainData);
  2442. // if (result.length) {
  2443. // let _data = cloneDeep(_mainData);
  2444. // result.map((t, i) => {
  2445. // _data[t.field] = t.value;
  2446. // });
  2447. // result.map((t, i) => {
  2448. // _mainData[t.field] = t.value;
  2449. // });
  2450. // console.log("_data :>> ", _mainData, result);
  2451. // toast.clear();
  2452. // toast(
  2453. // {
  2454. // component: ToastFormula,
  2455. // props: {
  2456. // t: t,
  2457. // formulas: summaryData,
  2458. // // data: cpData,
  2459. // fields: fieldParams
  2460. // },
  2461. // listeners: {
  2462. // tomore: () => {
  2463. // console.log("tomore summaryData :>> ", summaryData);
  2464. // state.AllFormulaRef.open(summaryData, fieldParams);
  2465. // toast.clear();
  2466. // },
  2467. // refresh: () => {
  2468. // gotoSummy();
  2469. // }
  2470. // }
  2471. // },
  2472. // {
  2473. // position: POSITION.BOTTOM_RIGHT,
  2474. // icon: false,
  2475. // timeout: timeout,
  2476. // closeButton: false,
  2477. // toastClassName: "longjoe-toast"
  2478. // }
  2479. // );
  2480. // } else {
  2481. // ElMessage.error("计算公式有误");
  2482. // }
  2483. };
  2484. /**
  2485. * @description 展示历史价格
  2486. * @param timeout
  2487. * @param params
  2488. */
  2489. const gotoHisprice = async (timeout = 0, params: any) => {
  2490. const toast = useToast();
  2491. toast(
  2492. {
  2493. component: ToastHistoryPrice,
  2494. props: {
  2495. ...params,
  2496. t: t
  2497. },
  2498. listeners: {
  2499. todetail: (row: any) => {
  2500. console.log("gotoHisprice dd val :>> ", row, router);
  2501. if (Number(row.typeid) == 1) {
  2502. router.push(`/mattressQuote/detail?id=${row.bednetid_mattressid}`);
  2503. // state.bednetDrawerProps.deptid = state.LjDetailRef._mainData.deptid;
  2504. // state.bednetDrawerProps.bednetid = row.bednetid_mattressid;
  2505. // state.bednetDrawerProps.state = "";
  2506. // state.LjDrawerRef.show();
  2507. } else if (Number(row.typeid) == 2) {
  2508. router.push(`/bednetQuote/detail?id=${row.bednetid_mattressid}`);
  2509. }
  2510. }
  2511. }
  2512. },
  2513. {
  2514. position: POSITION.BOTTOM_RIGHT,
  2515. icon: false,
  2516. timeout: timeout,
  2517. closeButton: false,
  2518. toastClassName: "longjoe-toast"
  2519. }
  2520. );
  2521. };
  2522. const getFormulakindEnum = async () => {
  2523. let _params = {
  2524. dsname: "_Mapper_formulakind",
  2525. queryparams: {}
  2526. };
  2527. let res = await CommonDynamicSelect(_params);
  2528. let result = [];
  2529. if (res?.datatable?.length > 0) {
  2530. result = res?.datatable;
  2531. }
  2532. state.formulaKindEnum = result;
  2533. let _params2 = {
  2534. dsname: "_Mapper_formulakind_dc",
  2535. queryparams: {}
  2536. };
  2537. let res2 = await CommonDynamicSelect(_params2);
  2538. let result2 = [];
  2539. if (res2?.datatable?.length > 0) {
  2540. result2 = res2?.datatable;
  2541. state.formulaKindDcEnum = result2;
  2542. }
  2543. console.log("getFormulakindEnum state. state.formulaKindEnum :>> ", state.formulaKindEnum);
  2544. console.log("getFormulakindEnum state.formulaKindDcEnum :>> ", state.formulaKindDcEnum);
  2545. };
  2546. // 表格配置项
  2547. const columns: ColumnProps<any>[] = [
  2548. { type: "checkbox", width: 50, fixed: "left" },
  2549. { title: "#", field: "pid", fixed: "left", width: 80 },
  2550. {
  2551. field: "deptid",
  2552. title: "部门",
  2553. search: {
  2554. el: "select",
  2555. key: "arg_deptid",
  2556. props: {
  2557. filterable: true
  2558. },
  2559. order: 1
  2560. },
  2561. basicinfo: {
  2562. el: "select",
  2563. editable: ALLOW_EDIT_STATE,
  2564. rules: [{ required: true, message: "请先选择部门", trigger: "change" }],
  2565. props: {
  2566. filterable: true,
  2567. clearable: false
  2568. },
  2569. order: 1,
  2570. group: "单据信息"
  2571. }
  2572. },
  2573. {
  2574. field: "mattressrelcode",
  2575. title: "床垫编码",
  2576. basicinfo: {
  2577. el: "input",
  2578. editable: ALLOW_EDIT_STATE
  2579. }
  2580. },
  2581. {
  2582. field: "mattresstypeid",
  2583. title: "床垫类别",
  2584. basicinfo: {
  2585. el: "select",
  2586. editable: ALLOW_EDIT_STATE,
  2587. rules: [{ required: true, message: "请先选择床垫类别", trigger: "change" }],
  2588. props: {
  2589. clearable: false,
  2590. filterable: true,
  2591. onChange: () => funcImportMattressMx()
  2592. }
  2593. }
  2594. },
  2595. {
  2596. field: "mattressname",
  2597. title: "床垫名称",
  2598. align: "left",
  2599. table: "u_mattress",
  2600. search: {
  2601. el: "input",
  2602. key: "arg_search",
  2603. titleKey: "searchKw",
  2604. props: {
  2605. placeholder: "唯一码/编码/名称"
  2606. },
  2607. order: 0
  2608. },
  2609. basicinfo: {
  2610. el: "input",
  2611. editable: ALLOW_EDIT_STATE
  2612. },
  2613. treeNode: true
  2614. },
  2615. {
  2616. field: "flag",
  2617. title: "财务审核",
  2618. table: "u_mattress",
  2619. search: {
  2620. el: "select",
  2621. key: "status_flag",
  2622. titleKey: "status",
  2623. props: {
  2624. clearable: true,
  2625. placeholder: "全部"
  2626. },
  2627. order: 2,
  2628. render: scope => {
  2629. // let _keys = Object.keys(scope);
  2630. // let _data = _keys.includes("row") ? scope.row : _keys.includes("searchParam") ? scope.searchParam : scope;
  2631. return (
  2632. <el-select v-model={scope.searchParam.status_flag} placeholder="全部" clearable>
  2633. <el-option label="待下单" value="1" />
  2634. <el-option label="已下单" value="2" />
  2635. <el-option label="待财务审核" value="3" />
  2636. <el-option label="已财务审核" value="4" />
  2637. </el-select>
  2638. );
  2639. }
  2640. }
  2641. },
  2642. {
  2643. field: "dept_profitrate_rangli",
  2644. title: "部门让利点数",
  2645. basicinfo: {
  2646. el: "input-number",
  2647. editable: ALLOW_EDIT_STATE,
  2648. order: 2,
  2649. group: "单据信息"
  2650. }
  2651. },
  2652. {
  2653. field: "fees_dscrp",
  2654. title: "额外费用说明",
  2655. basicinfo: {
  2656. el: "input",
  2657. props: { type: "textarea", rows: 2 },
  2658. editable: ALLOW_EDIT_STATE,
  2659. row: 2
  2660. }
  2661. },
  2662. {
  2663. field: "foreign_cost",
  2664. table: "u_mattress",
  2665. title: "外币价",
  2666. basicinfo: {
  2667. titleKey: "bi_foreign_cost"
  2668. }
  2669. },
  2670. {
  2671. field: "nottax_dept_cost",
  2672. table: "u_mattress",
  2673. title: "部门不含税价",
  2674. basicinfo: {
  2675. titleKey: "bi_nottax_dept_cost"
  2676. }
  2677. },
  2678. {
  2679. field: "if_bcp_type",
  2680. title: "半成品",
  2681. basicinfo: {
  2682. labelHidden: true,
  2683. render: (scope: any) => {
  2684. let _disabled = !ALLOW_EDIT_STATE.includes(scope.status);
  2685. return (
  2686. <>
  2687. <el-checkbox
  2688. v-model={scope.searchParam.if_bcp_type}
  2689. true-value="1"
  2690. false-value="0"
  2691. disabled={_disabled}
  2692. label="半成品"
  2693. class="mr-8"
  2694. />
  2695. <el-checkbox
  2696. v-model={scope.searchParam.if_zhedie_type}
  2697. true-value="1"
  2698. false-value="0"
  2699. disabled={_disabled}
  2700. label="折叠款"
  2701. />
  2702. </>
  2703. );
  2704. }
  2705. }
  2706. },
  2707. {
  2708. field: "if_m_chai",
  2709. title: "面拆",
  2710. basicinfo: {
  2711. span: 2,
  2712. labelHidden: true,
  2713. render: (scope: any) => {
  2714. let _disabled = !ALLOW_EDIT_STATE.includes(scope.status);
  2715. return (
  2716. <>
  2717. <el-checkbox
  2718. v-model={scope.searchParam.if_m_chai}
  2719. true-value="1"
  2720. false-value="0"
  2721. disabled={_disabled}
  2722. label="面拆"
  2723. class="mr-8"
  2724. />
  2725. <el-checkbox
  2726. v-model={scope.searchParam.if_z_chai}
  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_d_chai}
  2735. true-value="1"
  2736. false-value="0"
  2737. disabled={_disabled}
  2738. label="底拆"
  2739. />
  2740. </>
  2741. );
  2742. }
  2743. }
  2744. },
  2745. {
  2746. field: "mattress_width",
  2747. title: "床垫宽/CM",
  2748. basicinfo: {
  2749. el: "input-number",
  2750. editable: ALLOW_EDIT_STATE
  2751. }
  2752. },
  2753. {
  2754. field: "mattress_length",
  2755. title: "床垫长/CM",
  2756. basicinfo: {
  2757. el: "input-number",
  2758. editable: ALLOW_EDIT_STATE
  2759. }
  2760. },
  2761. {
  2762. field: "mattress_height",
  2763. title: "床垫高/CM",
  2764. basicinfo: {
  2765. el: "input-number",
  2766. editable: ALLOW_EDIT_STATE
  2767. }
  2768. },
  2769. {
  2770. field: "if_w_butao",
  2771. title: "顶布裥棉",
  2772. basicinfo: {
  2773. // el: "checkbox",
  2774. // editable: ALLOW_EDIT_STATE
  2775. labelHidden: true,
  2776. render: (scope: any) => {
  2777. console.log("if_w_butao scope :>> ", scope);
  2778. let _disabled = !ALLOW_EDIT_STATE.includes(scope.status);
  2779. return (
  2780. <>
  2781. <el-checkbox
  2782. v-model={scope.searchParam.if_w_butao}
  2783. true-value="1"
  2784. false-value="0"
  2785. disabled={_disabled}
  2786. label="顶布裥棉"
  2787. class="mr-8"
  2788. />
  2789. </>
  2790. );
  2791. }
  2792. }
  2793. },
  2794. {
  2795. field: "biandai_qty",
  2796. title: "边带数",
  2797. basicinfo: {
  2798. el: "input-number",
  2799. editable: (scope: any) => {
  2800. let someone =
  2801. Number(scope.searchParam?.if_m_chai ?? 0) +
  2802. Number(scope.searchParam?.if_z_chai ?? 0) +
  2803. Number(scope.searchParam?.if_d_chai ?? 0);
  2804. if (ALLOW_EDIT_STATE.includes(scope.status) && someone > 0) {
  2805. return true;
  2806. }
  2807. return false;
  2808. }
  2809. }
  2810. },
  2811. {
  2812. field: "if_n_butao",
  2813. title: "内布套",
  2814. basicinfo: {
  2815. labelHidden: true,
  2816. render: (scope: any) => {
  2817. let _disabled = !ALLOW_EDIT_STATE.includes(scope.status);
  2818. return (
  2819. <>
  2820. <el-checkbox
  2821. v-model={scope.searchParam.if_n_butao}
  2822. true-value="1"
  2823. false-value="0"
  2824. disabled={_disabled}
  2825. label="内布套"
  2826. class="mr-8"
  2827. />
  2828. </>
  2829. );
  2830. },
  2831. editvisible: (scope: any) => {
  2832. let someone =
  2833. Number(scope.searchParam?.if_m_chai ?? 0) +
  2834. Number(scope.searchParam?.if_z_chai ?? 0) +
  2835. Number(scope.searchParam?.if_d_chai ?? 0);
  2836. if (someone > 0) {
  2837. return true;
  2838. }
  2839. return false;
  2840. }
  2841. }
  2842. },
  2843. {
  2844. field: "s_cover_qty",
  2845. title: "内布套上覆",
  2846. basicinfo: {
  2847. el: "input-number",
  2848. editable: (scope: any) => {
  2849. if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.if_n_butao)) {
  2850. return true;
  2851. }
  2852. return false;
  2853. },
  2854. editvisible: (scope: any) => {
  2855. let someone =
  2856. Number(scope.searchParam?.if_m_chai ?? 0) +
  2857. Number(scope.searchParam?.if_z_chai ?? 0) +
  2858. Number(scope.searchParam?.if_d_chai ?? 0);
  2859. if (someone > 0 && Number(scope.searchParam.if_n_butao)) {
  2860. return true;
  2861. }
  2862. return false;
  2863. }
  2864. }
  2865. },
  2866. {
  2867. field: "z_cover_qty",
  2868. title: "内布套侧覆",
  2869. basicinfo: {
  2870. el: "input-number",
  2871. editable: (scope: any) => {
  2872. if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.if_n_butao)) {
  2873. return true;
  2874. }
  2875. return false;
  2876. },
  2877. editvisible: (scope: any) => {
  2878. let someone =
  2879. Number(scope.searchParam?.if_m_chai ?? 0) +
  2880. Number(scope.searchParam?.if_z_chai ?? 0) +
  2881. Number(scope.searchParam?.if_d_chai ?? 0);
  2882. if (someone > 0 && Number(scope.searchParam.if_n_butao)) {
  2883. return true;
  2884. }
  2885. return false;
  2886. }
  2887. }
  2888. },
  2889. {
  2890. field: "x_cover_qty",
  2891. title: "内布套下覆",
  2892. basicinfo: {
  2893. el: "input-number",
  2894. editable: (scope: any) => {
  2895. if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.if_n_butao)) {
  2896. return true;
  2897. }
  2898. return false;
  2899. },
  2900. editvisible: (scope: any) => {
  2901. let someone =
  2902. Number(scope.searchParam?.if_m_chai ?? 0) +
  2903. Number(scope.searchParam?.if_z_chai ?? 0) +
  2904. Number(scope.searchParam?.if_d_chai ?? 0);
  2905. if (someone > 0 && Number(scope.searchParam.if_n_butao)) {
  2906. return true;
  2907. }
  2908. return false;
  2909. }
  2910. }
  2911. },
  2912. {
  2913. field: "if_m_wbutao_way",
  2914. title: "面料外布套做法",
  2915. basicinfo: {
  2916. labelHidden: true,
  2917. render: (scope: any) => {
  2918. let _disabled = !ALLOW_EDIT_STATE.includes(scope.status);
  2919. return (
  2920. <>
  2921. <el-checkbox
  2922. v-model={scope.searchParam.if_m_wbutao_way}
  2923. true-value="1"
  2924. false-value="0"
  2925. disabled={_disabled}
  2926. label="面料外布套做法"
  2927. class="mr-8"
  2928. />
  2929. </>
  2930. );
  2931. },
  2932. editvisible: (scope: any) => {
  2933. let someone =
  2934. Number(scope.searchParam?.if_m_chai ?? 0) +
  2935. Number(scope.searchParam?.if_z_chai ?? 0) +
  2936. Number(scope.searchParam?.if_d_chai ?? 0);
  2937. if (someone > 0) {
  2938. return true;
  2939. }
  2940. return false;
  2941. }
  2942. }
  2943. },
  2944. {
  2945. field: "s_m_cover_qty",
  2946. title: "面层向大侧覆盖",
  2947. basicinfo: {
  2948. el: "input-number",
  2949. editable: (scope: any) => {
  2950. if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.if_m_wbutao_way)) {
  2951. return true;
  2952. }
  2953. return false;
  2954. },
  2955. editvisible: (scope: any) => {
  2956. let someone =
  2957. Number(scope.searchParam?.if_m_chai ?? 0) +
  2958. Number(scope.searchParam?.if_z_chai ?? 0) +
  2959. Number(scope.searchParam?.if_d_chai ?? 0);
  2960. if (someone > 0 && Number(scope.searchParam.if_m_wbutao_way)) {
  2961. return true;
  2962. }
  2963. return false;
  2964. }
  2965. }
  2966. },
  2967. {
  2968. field: "z_m_cover_qty",
  2969. title: "大侧向底层覆盖",
  2970. basicinfo: {
  2971. el: "input-number",
  2972. editable: (scope: any) => {
  2973. if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.if_m_wbutao_way)) {
  2974. return true;
  2975. }
  2976. return false;
  2977. },
  2978. editvisible: (scope: any) => {
  2979. let someone =
  2980. Number(scope.searchParam?.if_m_chai ?? 0) +
  2981. Number(scope.searchParam?.if_z_chai ?? 0) +
  2982. Number(scope.searchParam?.if_d_chai ?? 0);
  2983. if (someone > 0 && Number(scope.searchParam.if_m_wbutao_way)) {
  2984. return true;
  2985. }
  2986. return false;
  2987. }
  2988. }
  2989. },
  2990. {
  2991. field: "x_m_cover_qty",
  2992. title: "底层向大侧覆盖",
  2993. basicinfo: {
  2994. el: "input-number",
  2995. editable: (scope: any) => {
  2996. if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.if_m_wbutao_way)) {
  2997. return true;
  2998. }
  2999. return false;
  3000. },
  3001. editvisible: (scope: any) => {
  3002. let someone =
  3003. Number(scope.searchParam?.if_m_chai ?? 0) +
  3004. Number(scope.searchParam?.if_z_chai ?? 0) +
  3005. Number(scope.searchParam?.if_d_chai ?? 0);
  3006. if (someone > 0 && Number(scope.searchParam.if_m_wbutao_way)) {
  3007. return true;
  3008. }
  3009. return false;
  3010. }
  3011. }
  3012. },
  3013. {
  3014. field: "commission",
  3015. title: "佣金点数",
  3016. basicinfo: {
  3017. el: "input-number",
  3018. editable: ALLOW_EDIT_STATE
  3019. }
  3020. },
  3021. {
  3022. field: "other_rate",
  3023. title: "额外点数",
  3024. basicinfo: {
  3025. el: "input-number",
  3026. editable: ALLOW_EDIT_STATE
  3027. }
  3028. },
  3029. {
  3030. field: "extras_cost",
  3031. title: "额外费用",
  3032. basicinfo: {
  3033. el: "input-number",
  3034. editable: ALLOW_EDIT_STATE
  3035. }
  3036. },
  3037. {
  3038. field: "taxes",
  3039. title: "税金",
  3040. enum: [
  3041. {
  3042. label: "不含税",
  3043. value: 1
  3044. },
  3045. {
  3046. label: "含税",
  3047. value: 1.07
  3048. }
  3049. ],
  3050. basicinfo: {
  3051. el: "select",
  3052. editable: ALLOW_EDIT_STATE,
  3053. render: (scope: any) => {
  3054. let optionRender = [];
  3055. let _disabled = !ALLOW_EDIT_STATE.includes(scope.status);
  3056. console.log("taxrate scope.enum :>> ", scope.enum);
  3057. scope.enum.map(item => {
  3058. optionRender.push(<el-option label={item.label} value={item.value} />);
  3059. });
  3060. let slotprefix = {
  3061. prefix: () => {
  3062. return <>{scope.searchParam.taxrate}</>;
  3063. }
  3064. };
  3065. let _taxrate = Number(scope.searchParam.taxrate);
  3066. return (
  3067. <el-select
  3068. v-model={_taxrate}
  3069. v-slots={slotprefix}
  3070. class="select-text-right"
  3071. disabled={_disabled}
  3072. onChange={val => funcTaxrateChange(val, scope.searchParam)}
  3073. >
  3074. {optionRender}
  3075. </el-select>
  3076. );
  3077. }
  3078. }
  3079. },
  3080. {
  3081. field: "moneyrate",
  3082. title: "汇率",
  3083. basicinfo: {
  3084. el: "select",
  3085. editable: ALLOW_EDIT_STATE,
  3086. render: (scope: any) => {
  3087. let optionRender = [];
  3088. let _disabled = !ALLOW_EDIT_STATE.includes(scope.status);
  3089. scope.enum.map(item => {
  3090. optionRender.push(<el-option label={item.label} value={item.value} />);
  3091. });
  3092. let slotprefix = {
  3093. prefix: () => {
  3094. return <>{scope.searchParam.moneyrate}</>;
  3095. }
  3096. };
  3097. return (
  3098. <el-select
  3099. v-model={scope.searchParam.if_moneyrate}
  3100. v-slots={slotprefix}
  3101. class="select-text-right"
  3102. disabled={_disabled}
  3103. onChange={val => funcMoneyrateChange(val, scope.searchParam)}
  3104. >
  3105. {optionRender}
  3106. </el-select>
  3107. );
  3108. }
  3109. }
  3110. }
  3111. ];
  3112. const columnsMx: ColumnProps<any>[] = [
  3113. { title: "#", type: "seq", fixed: "left", width: 80 },
  3114. {
  3115. title: "计算成功?",
  3116. field: "if_success",
  3117. datatype: "checkbox",
  3118. limited: () => {
  3119. const { userInfo } = useUserStore();
  3120. return userInfo.usermode != 0;
  3121. },
  3122. render: (scope: any) => {
  3123. if (Number(scope.row.if_success)) {
  3124. return (
  3125. <>
  3126. <ElTag type="danger">异常</ElTag>
  3127. </>
  3128. );
  3129. } else {
  3130. return <></>;
  3131. }
  3132. }
  3133. },
  3134. {
  3135. title: "+",
  3136. field: "addmx",
  3137. width: 80,
  3138. render: (scope: any) => {
  3139. let _if_mtrl = Number(scope.row.if_mtrl);
  3140. if (_if_mtrl > 1) {
  3141. if (state.orderStatus) {
  3142. return (
  3143. <>
  3144. <ElPopconfirm
  3145. width="220"
  3146. icon={InfoFilled}
  3147. title={t("business.tips.mattress.addMx")}
  3148. confirm-button-text={t("common.addText")}
  3149. onConfirm={() => funcAddMtrlMx(scope)}
  3150. >
  3151. {{
  3152. reference: () => {
  3153. return <ElButton type="primary" plain circle icon={Plus}></ElButton>;
  3154. }
  3155. }}
  3156. </ElPopconfirm>
  3157. </>
  3158. );
  3159. // return <ElButton type="primary" plain circle icon={Plus} onClick={() => funcAddMtrlMx(scope)}></ElButton>;
  3160. } else {
  3161. return <>+</>;
  3162. }
  3163. } else {
  3164. return <></>;
  3165. }
  3166. }
  3167. },
  3168. {
  3169. title: "-",
  3170. field: "delmx",
  3171. width: 80,
  3172. render: (scope: any) => {
  3173. let _if_mtrl = Number(scope.row.if_mtrl);
  3174. if (_if_mtrl > 1) {
  3175. if (state.orderStatus) {
  3176. return (
  3177. <>
  3178. <ElPopconfirm
  3179. width="220"
  3180. icon={InfoFilled}
  3181. title={t("business.tips.mattress.delMx")}
  3182. confirm-button-text={t("common.delText")}
  3183. confirm-button-type="danger"
  3184. onConfirm={() => funcDelMtrlMx(scope)}
  3185. >
  3186. {{
  3187. reference: () => {
  3188. return <ElButton type="danger" plain circle icon={Minus} />;
  3189. }
  3190. }}
  3191. </ElPopconfirm>
  3192. </>
  3193. );
  3194. // return <ElButton type="danger" plain circle icon={Minus} onClick={() => funcDelMtrlMx(scope)}></ElButton>;
  3195. } else {
  3196. return <>-</>;
  3197. }
  3198. } else {
  3199. return <></>;
  3200. }
  3201. }
  3202. },
  3203. {
  3204. title: "位置",
  3205. field: "chastr"
  3206. },
  3207. {
  3208. title: "公式名",
  3209. field: "formulakind",
  3210. table: "u_mattress_formula",
  3211. align: "left",
  3212. isFilterEnum: true,
  3213. fieldNames: { value: "value", label: "label" },
  3214. // enum: async () => {
  3215. // let res = await CommonDynamicSelect({
  3216. // dsname: "_Mapper_formulakind",
  3217. // queryparams: {}
  3218. // });
  3219. // return { data: res.datatable };
  3220. // }
  3221. render: (scope: any) => {
  3222. const { column, row, status } = scope;
  3223. let itmName = state.formulaKindEnum.find(t => t.value == row.formulakind)?.label ?? "";
  3224. return <>{itmName}</>;
  3225. }
  3226. },
  3227. {
  3228. title: "按物料?",
  3229. field: "if_mtrl",
  3230. table: "u_mattress_formula",
  3231. enum: [
  3232. {
  3233. value: "0",
  3234. label: "无物料"
  3235. },
  3236. {
  3237. value: "1",
  3238. label: "单物料"
  3239. },
  3240. {
  3241. value: "2",
  3242. label: "多物料"
  3243. }
  3244. ]
  3245. },
  3246. {
  3247. title: "厚度cm",
  3248. field: "thickness",
  3249. datatype: "number",
  3250. editRender: {
  3251. name: "$input",
  3252. props: {
  3253. type: "number"
  3254. }
  3255. }
  3256. },
  3257. {
  3258. title: "物料",
  3259. field: "mtrlname",
  3260. editRender: {},
  3261. editColRender: (scope: any) => {
  3262. console.log("mtrlname hooks render scope :>> ", scope);
  3263. console.log("mtrlname hooks render LjDetailRef.value._mainData :>> ", state.LjDetailRef);
  3264. const { $table, column, row, status } = scope;
  3265. let field = column.field;
  3266. let _label = column.title;
  3267. // if (column?.format) {
  3268. // _label = handleRowAccordingToProp(searchParam, field, column?.format);
  3269. // }
  3270. let _deptid = state.LjDetailRef._mainData.deptid;
  3271. let deptEnum = state.LjDetailRef.enumMap.get("deptid");
  3272. let _pricelistid = 0;
  3273. console.log("deptEnum :>> ", deptEnum);
  3274. if (deptEnum) {
  3275. let depItem = deptEnum.find((item: any) => item.value == _deptid);
  3276. console.log("depItem :>> ", depItem);
  3277. if (depItem) {
  3278. _pricelistid = Number(depItem.pricelistid);
  3279. }
  3280. }
  3281. console.log("_pricelistid :>> ", _pricelistid, row.formulakind);
  3282. console.log("state.mtrltypeTabList :>> ", mtrltypeTabList);
  3283. let _mtrltypeItem: any = mtrltypeTabList.find(t => t.formulakinds.includes(Number(row.formulakind)));
  3284. !_mtrltypeItem && (_mtrltypeItem = { value: -1 });
  3285. let params = {
  3286. mtrltype: _mtrltypeItem.value,
  3287. pricelistid: _pricelistid
  3288. };
  3289. return (
  3290. <>
  3291. <MtrldefSelect
  3292. value={row.mtrlid}
  3293. {...params}
  3294. clearable
  3295. placeholder={_label}
  3296. onOpenModal={() => fModelChoseMtrl(row, params, rModelSetMtrl, _mtrltypeItem.label, $table)}
  3297. onSelect={val => rModelSetMtrl(row, val, $table)}
  3298. onClear={() => rModelClearMtrl(row, $table)}
  3299. >
  3300. {{
  3301. label: () => row.mtrlname
  3302. }}
  3303. </MtrldefSelect>
  3304. </>
  3305. );
  3306. }
  3307. },
  3308. {
  3309. title: "数量/长度",
  3310. field: "qty",
  3311. datatype: "number",
  3312. editRender: {
  3313. name: "input",
  3314. props: {
  3315. type: "number"
  3316. }
  3317. }
  3318. },
  3319. {
  3320. title: "物料单价",
  3321. field: "price",
  3322. datatype: "number",
  3323. limited: () => {
  3324. return userInfo.usermode != 0;
  3325. }
  3326. },
  3327. {
  3328. title: "单位",
  3329. field: "priceunit"
  3330. },
  3331. {
  3332. title: "收缩率",
  3333. field: "shrinkage",
  3334. datatype: "number",
  3335. limited: () => {
  3336. return userInfo.usermode != 0;
  3337. }
  3338. },
  3339. {
  3340. title: "克重",
  3341. field: "gram_weight",
  3342. datatype: "number",
  3343. limited: () => {
  3344. return userInfo.usermode != 0;
  3345. }
  3346. },
  3347. {
  3348. title: "幅宽",
  3349. field: "cloth_width",
  3350. datatype: "number",
  3351. limited: () => {
  3352. return userInfo.usermode != 0;
  3353. }
  3354. },
  3355. {
  3356. title: "固定厚度?",
  3357. field: "if_inputqty",
  3358. datatype: "checkbox",
  3359. limited: () => {
  3360. return userInfo.usermode != 0;
  3361. }
  3362. },
  3363. {
  3364. title: "按面积单价?",
  3365. field: "if_areaprice",
  3366. datatype: "checkbox",
  3367. limited: () => {
  3368. return userInfo.usermode != 0;
  3369. }
  3370. },
  3371. {
  3372. title: "成本金额",
  3373. field: "costamt",
  3374. datatype: "number",
  3375. limited: () => {
  3376. return userInfo.usermode != 0;
  3377. }
  3378. },
  3379. {
  3380. title: "金额文本公式",
  3381. field: "formula",
  3382. limited: () => {
  3383. return userInfo.usermode != 0;
  3384. }
  3385. },
  3386. {
  3387. title: "金额数字公式",
  3388. field: "replace_formula",
  3389. limited: () => {
  3390. return userInfo.usermode != 0;
  3391. }
  3392. },
  3393. {
  3394. title: "清单用量",
  3395. field: "useqty",
  3396. datatype: "number",
  3397. limited: () => {
  3398. return userInfo.usermode != 0;
  3399. }
  3400. },
  3401. {
  3402. title: "用量文本公式",
  3403. field: "useformula",
  3404. limited: () => {
  3405. return userInfo.usermode != 0;
  3406. }
  3407. },
  3408. {
  3409. title: "用量数字公式",
  3410. field: "replace_useformula",
  3411. limited: () => {
  3412. return userInfo.usermode != 0;
  3413. }
  3414. },
  3415. {
  3416. title: "工艺填写说明",
  3417. field: "gydscrp"
  3418. }
  3419. ];
  3420. /**
  3421. * @description 主表计算公式
  3422. */
  3423. const summaryData = ref<any>([
  3424. {
  3425. label: "总成本",
  3426. field: "total_cost",
  3427. formula:
  3428. "if([折叠款] = 1, ([总材料成本]*[大小单]+[款式费用]+[边带费用]+[额外费用]+[制造费用]) * 2, [总材料成本]*[大小单]+[款式费用]+[边带费用]+[额外费用]+[制造费用])",
  3429. power: () => {
  3430. if (userInfo.empid != 0 && userInfo.usermode != 0) {
  3431. return false;
  3432. } else {
  3433. return true;
  3434. }
  3435. }
  3436. },
  3437. {
  3438. label: "不含税出厂价",
  3439. field: "nottax_factory_cost",
  3440. formula: "[总成本] * ([工厂利润率] + [利润率点数] + [布套点数] + [拆装点数] + [海绵点数]) * [管理费点]"
  3441. },
  3442. {
  3443. label: "部门售价",
  3444. field: "nottax_dept_cost",
  3445. formula: "[dijia_cost] / (1 - ([佣金点数] - 1)) * [额外点数] + [fob]"
  3446. },
  3447. {
  3448. label: "税金",
  3449. field: "taxes",
  3450. formula: "([部门售价] * ([税率] - 1)) + [佣金] * 0.05"
  3451. },
  3452. {
  3453. label: "部门含税价",
  3454. field: "dept_cost",
  3455. formula: "([部门售价] + [佣金] * 0.06) * [税率] * if([fob] = 0, 1, [折扣率])"
  3456. },
  3457. {
  3458. label: "外币价",
  3459. field: "foreign_cost",
  3460. formula: "if([汇率] <> 0, [部门含税价] / [汇率], 0)"
  3461. },
  3462. {
  3463. label: "底价 ",
  3464. field: "dijia_cost_cp",
  3465. formula: "if(([dept_profitrate] + [dept_profitrate_rangli] / 100) <> 0, [dijia_cost] ,0 )"
  3466. },
  3467. {
  3468. label: "佣金",
  3469. field: "commission_cp",
  3470. formula: "[dijia_cost] / (1 - ([佣金点数] - 1 )) - [dijia_cost]"
  3471. },
  3472. {
  3473. label: "FOB",
  3474. field: "fob",
  3475. formula: "[fob]"
  3476. }
  3477. ]);
  3478. /**
  3479. * @description 主表公式字段照表
  3480. */
  3481. const fieldParams = ref<any>([
  3482. {
  3483. label: "总成本",
  3484. field: "total_cost"
  3485. },
  3486. {
  3487. label: "不含税出厂价",
  3488. field: "nottax_factory_cost"
  3489. },
  3490. {
  3491. label: "部门售价",
  3492. field: "nottax_dept_cost"
  3493. },
  3494. {
  3495. label: "税金",
  3496. field: "taxes"
  3497. },
  3498. {
  3499. label: "部门含税价",
  3500. field: "dept_cost"
  3501. },
  3502. {
  3503. label: "外币价",
  3504. field: "foreign_cost"
  3505. },
  3506. {
  3507. label: "总材料成本",
  3508. field: "total_material_cost"
  3509. },
  3510. {
  3511. label: "大小单",
  3512. field: "dannum_rate"
  3513. },
  3514. {
  3515. label: "款式费用",
  3516. field: "hrcost"
  3517. },
  3518. {
  3519. label: "边带费用",
  3520. field: "biandaicost"
  3521. },
  3522. {
  3523. label: "额外费用",
  3524. field: "extras_cost"
  3525. },
  3526. {
  3527. label: "制造费用",
  3528. field: "zhizao_amt"
  3529. },
  3530. {
  3531. label: "折叠款",
  3532. field: "if_zhedie_type"
  3533. },
  3534. {
  3535. label: "管理费点",
  3536. field: "guanli_rate"
  3537. },
  3538. {
  3539. label: "工厂利润率",
  3540. field: "profitrate"
  3541. },
  3542. {
  3543. label: "利润率点数",
  3544. field: "profitrate_point"
  3545. },
  3546. {
  3547. label: "布套点数",
  3548. field: "butao_point"
  3549. },
  3550. {
  3551. label: "拆装点数",
  3552. field: "chaizhuang_point"
  3553. },
  3554. {
  3555. label: "海绵点数",
  3556. field: "haimian_point"
  3557. },
  3558. {
  3559. label: "部门利润率",
  3560. field: "dept_profitrate"
  3561. },
  3562. {
  3563. label: "部门让利点",
  3564. field: "dept_profitrate_rangli"
  3565. },
  3566. {
  3567. label: "额外点数",
  3568. field: "other_rate"
  3569. },
  3570. {
  3571. label: "佣金点数",
  3572. field: "commission"
  3573. },
  3574. {
  3575. label: "税率",
  3576. field: "taxrate"
  3577. },
  3578. {
  3579. label: "折扣率",
  3580. field: "discount"
  3581. },
  3582. {
  3583. label: "汇率",
  3584. field: "moneyrate"
  3585. },
  3586. {
  3587. label: "底价",
  3588. field: "dijia_cost"
  3589. }
  3590. ]);
  3591. /**
  3592. * @description 明细公式字段照表
  3593. */
  3594. const fieldMxParams = ref<any>([
  3595. {
  3596. label: "名称前2位",
  3597. field: "ls_temp_left_2"
  3598. },
  3599. {
  3600. label: "规格宽",
  3601. field: "ls_mattress_width"
  3602. },
  3603. {
  3604. label: "规格长",
  3605. field: "ls_mattress_length"
  3606. },
  3607. {
  3608. label: "规格高",
  3609. field: "ls_mattress_height"
  3610. },
  3611. {
  3612. label: "压包数量",
  3613. field: "ls_packqty"
  3614. },
  3615. {
  3616. label: "卷包直径",
  3617. field: "ls_diameter"
  3618. },
  3619. {
  3620. label: "顶布裥棉外布套做法",
  3621. field: "ls_if_db_wbutao_way"
  3622. },
  3623. {
  3624. label: "面料外布套做法",
  3625. field: "ls_if_m_wbutao_way"
  3626. },
  3627. {
  3628. label: "内布套上覆",
  3629. field: "ls_s_cover_qty"
  3630. },
  3631. {
  3632. label: "内布套侧覆",
  3633. field: "ls_z_cover_qty"
  3634. },
  3635. {
  3636. label: "内布套下覆",
  3637. field: "ls_x_cover_qty"
  3638. },
  3639. {
  3640. label: "面料上覆",
  3641. field: "ls_s_m_cover_qty"
  3642. },
  3643. {
  3644. label: "面料侧覆",
  3645. field: "ls_z_m_cover_qty"
  3646. },
  3647. {
  3648. label: "面料下覆",
  3649. field: "ls_x_m_cover_qty"
  3650. },
  3651. {
  3652. label: "面拆",
  3653. field: "ls_if_m_chai"
  3654. },
  3655. {
  3656. label: "中拆",
  3657. field: "ls_if_z_chai"
  3658. },
  3659. {
  3660. label: "底拆",
  3661. field: "ls_if_d_chai"
  3662. },
  3663. {
  3664. label: "物料单价",
  3665. field: "ls_price"
  3666. },
  3667. {
  3668. label: "物料克重",
  3669. field: "ls_gram_weight"
  3670. },
  3671. {
  3672. label: "幅宽",
  3673. field: "ls_cloth_width"
  3674. },
  3675. {
  3676. label: "数量",
  3677. field: "ls_qty"
  3678. },
  3679. {
  3680. label: "物料厚度",
  3681. field: "ls_if_inputqty"
  3682. },
  3683. {
  3684. label: "固定厚度",
  3685. field: "ls_if_inputqty"
  3686. },
  3687. {
  3688. label: "厚度",
  3689. field: "ls_thickness"
  3690. },
  3691. {
  3692. label: "按面积单价",
  3693. field: "ls_if_areaprice"
  3694. },
  3695. {
  3696. label: "物料名称",
  3697. field: "ls_mtrlname"
  3698. },
  3699. {
  3700. label: "木托方式",
  3701. field: "ls_woodpallettype",
  3702. enum: [
  3703. { label: " '普通木托' ", value: "0" },
  3704. { label: " '夹板木托' ", value: "1" },
  3705. { label: " '铁管木托' ", value: "2" }
  3706. ]
  3707. }
  3708. ]);
  3709. /**
  3710. * @description 明细表计算公式
  3711. */
  3712. const summaryMxData = ref<any>([
  3713. {
  3714. label: "计算成本金额",
  3715. field: "costamt",
  3716. formula: ""
  3717. },
  3718. {
  3719. label: "计算清单用量",
  3720. field: "useqty",
  3721. formula: ""
  3722. }
  3723. ]);
  3724. const funcMergeColumn = (columns: any, target: any) => {
  3725. return columns.map(t => {
  3726. let itm = target.find(item => t.field === item.field);
  3727. if (itm) {
  3728. t = defaultsDeep(itm, t);
  3729. }
  3730. return t;
  3731. });
  3732. };
  3733. const cushionsEdit = reactive<any>({
  3734. name: "VxeSelect",
  3735. options: state.formulaKindDcEnum,
  3736. optionProps: {
  3737. label: "label",
  3738. value: "value"
  3739. }
  3740. });
  3741. const bednetCoumns: ColumnProps<any>[] = [
  3742. {
  3743. title: "位置",
  3744. field: "chastr",
  3745. visible: false
  3746. },
  3747. {
  3748. title: "床网",
  3749. field: "mtrlname",
  3750. editRender: {},
  3751. width: 250,
  3752. editColRender: (scope: any) => {
  3753. console.log("mtrlname hooks render scope :>> ", scope);
  3754. console.log("mtrlname hooks render LjDetailRef.value._mainData :>> ", state.LjDetailRef);
  3755. const { column, row, status, $table } = scope;
  3756. let _label = column.title;
  3757. let _deptid = state.LjDetailRef._mainData.deptid;
  3758. let params = {
  3759. deptid: _deptid,
  3760. mattress_width: state.LjDetailRef._mainData.mattress_width,
  3761. mattress_length: state.LjDetailRef._mainData.mattress_length
  3762. };
  3763. return (
  3764. <BednetSelect
  3765. value={row.mtrlid}
  3766. {...params}
  3767. clearable
  3768. placeholder={_label}
  3769. onOpenModal={() => fModelChoseBednet(row, params, $table)}
  3770. onSelect={(val: any) => rModelSetBednet(row, val, $table)}
  3771. onClear={() => rModelClearBednet(row, $table)}
  3772. >
  3773. {{
  3774. label: () => row.mtrlname
  3775. }}
  3776. </BednetSelect>
  3777. );
  3778. }
  3779. },
  3780. {
  3781. title: "+",
  3782. field: "addmx",
  3783. width: 80,
  3784. render: (scope: any) => {
  3785. let _if_mtrl = Number(scope.row.if_mtrl);
  3786. if (_if_mtrl > 1) {
  3787. if (state.orderStatus) {
  3788. return (
  3789. <ElPopconfirm
  3790. width="220"
  3791. icon={InfoFilled}
  3792. title={t("business.tips.mattress.addMx")}
  3793. confirm-button-text={t("common.addText")}
  3794. onConfirm={() => funcAddMtrlMx(scope, () => wf_rtr_cwdc(scope.row, null, "add"))}
  3795. >
  3796. {{
  3797. reference: () => {
  3798. return <ElButton type="primary" plain circle icon={Plus}></ElButton>;
  3799. }
  3800. }}
  3801. </ElPopconfirm>
  3802. );
  3803. } else {
  3804. return "+";
  3805. }
  3806. } else {
  3807. return "";
  3808. }
  3809. }
  3810. },
  3811. {
  3812. title: "-",
  3813. field: "delmx",
  3814. width: 80,
  3815. render: (scope: any) => {
  3816. let _if_mtrl = Number(scope.row.if_mtrl);
  3817. if (_if_mtrl > 1) {
  3818. if (state.orderStatus) {
  3819. return (
  3820. <ElPopconfirm
  3821. width="220"
  3822. icon={InfoFilled}
  3823. title={t("business.tips.mattress.delMx")}
  3824. confirm-button-text={t("common.delText")}
  3825. confirm-button-type="danger"
  3826. onConfirm={() => funcDelBednet(scope, () => wf_rtr_cwdc(scope.row, null, "del"))}
  3827. >
  3828. {{
  3829. reference: () => {
  3830. return <ElButton type="danger" plain circle icon={Minus} />;
  3831. }
  3832. }}
  3833. </ElPopconfirm>
  3834. );
  3835. } else {
  3836. return "-";
  3837. }
  3838. } else {
  3839. return "";
  3840. }
  3841. }
  3842. }
  3843. ];
  3844. const cushionsColumns: ColumnProps<any>[] = [
  3845. {
  3846. title: "位置",
  3847. field: "chastr",
  3848. editRender: {},
  3849. editColRender: (scope: any) => {
  3850. console.log("formulakind chastr scope :>> ", scope, state.diancengAreaEnum);
  3851. return (
  3852. <el-select v-model={scope.row.chastr}>
  3853. {{
  3854. default: () => {
  3855. let rs = [];
  3856. if (state.diancengAreaEnum.length) {
  3857. state.diancengAreaEnum.map((t: any) => {
  3858. rs.push(<el-option label={t.label} value={t.value} />);
  3859. });
  3860. }
  3861. return rs;
  3862. }
  3863. }}
  3864. </el-select>
  3865. );
  3866. }
  3867. },
  3868. {
  3869. title: "公式名",
  3870. field: "formulakind",
  3871. table: "u_mattress_formula",
  3872. align: "left",
  3873. isFilterEnum: true,
  3874. fieldNames: { value: "value", label: "label" },
  3875. // editRender: {
  3876. // name: "VxeSelect",
  3877. // options: state.formulaKindDcEnum
  3878. // }
  3879. // editRender: cushionsEdit
  3880. // render: (scope: any) => {
  3881. // const { column, row, status } = scope;
  3882. // let itmName = state.formulaKindEnum.find(t => t.value == row.formulakind)?.label ?? "";
  3883. // return <>{itmName}</>;
  3884. // },
  3885. editRender: {},
  3886. editColRender: (scope: any) => {
  3887. console.log("formulakind editColRender scope :>> ", scope);
  3888. let lastVal = scope.row.formulakind;
  3889. return (
  3890. <el-select v-model={scope.row.formulakind} onChange={val => cushionsFormulaKindChange(val, lastVal, scope)}>
  3891. {{
  3892. default: () => {
  3893. let rs = [];
  3894. if (state.formulaKindDcEnum.length) {
  3895. state.formulaKindDcEnum.map((t: any) => {
  3896. rs.push(<el-option label={t.label} value={t.value} />);
  3897. });
  3898. }
  3899. return rs;
  3900. }
  3901. }}
  3902. </el-select>
  3903. );
  3904. }
  3905. },
  3906. {
  3907. title: "+",
  3908. field: "addmx",
  3909. visible: false
  3910. },
  3911. {
  3912. title: "-",
  3913. field: "delmx",
  3914. visible: false
  3915. },
  3916. {
  3917. title: "按物料?",
  3918. field: "if_mtrl",
  3919. visible: false
  3920. },
  3921. {
  3922. title: "物料",
  3923. field: "mtrlname",
  3924. editRender: {},
  3925. editColRender: (scope: any) => {
  3926. console.log("mtrlname hooks render scope :>> ", scope);
  3927. console.log("mtrlname hooks render LjDetailRef.value._mainData :>> ", state.LjDetailRef);
  3928. const { column, row, status, $table } = scope;
  3929. let _label = column.title;
  3930. let _deptid = state.LjDetailRef._mainData.deptid;
  3931. let deptEnum = state.LjDetailRef.enumMap.get("deptid");
  3932. let _pricelistid = 0;
  3933. console.log("deptEnum :>> ", deptEnum);
  3934. if (deptEnum) {
  3935. let depItem = deptEnum.find((item: any) => item.value == _deptid);
  3936. console.log("depItem :>> ", depItem);
  3937. if (depItem) {
  3938. _pricelistid = Number(depItem.pricelistid);
  3939. }
  3940. }
  3941. console.log("_pricelistid :>> ", _pricelistid, row.formulakind);
  3942. let _mtrltypeItem: any = mtrltypeTabList_cushions.find(t => t.formulakinds.includes(Number(row.formulakind)));
  3943. console.log("state.mtrltypeTabList :>> ", mtrltypeTabList_cushions, _mtrltypeItem);
  3944. if (!_mtrltypeItem) {
  3945. // ElMessage.error("不是垫层类型行,不能选物料");
  3946. // return <></>;
  3947. }
  3948. let params = {
  3949. mtrltype: _mtrltypeItem?.value,
  3950. pricelistid: _pricelistid
  3951. };
  3952. return (
  3953. <>
  3954. <MtrldefSelect
  3955. value={row.mtrlid}
  3956. {...params}
  3957. disabled={!_mtrltypeItem}
  3958. clearable
  3959. placeholder={_label}
  3960. onOpenModal={() => fModelChoseMtrl(row, params, rModelSetMtrl, _mtrltypeItem?.label, $table)}
  3961. onSelect={(val: any) => rModelSetMtrl(row, val, $table)}
  3962. onClear={() => rModelClearMtrl(row, $table)}
  3963. >
  3964. {{
  3965. label: () => row.mtrlname
  3966. }}
  3967. </MtrldefSelect>
  3968. </>
  3969. );
  3970. }
  3971. }
  3972. ];
  3973. const accessoriesColumns: ColumnProps<any>[] = [
  3974. {
  3975. title: "位置",
  3976. field: "chastr",
  3977. visible: false
  3978. },
  3979. {
  3980. title: "物料",
  3981. field: "mtrlname",
  3982. editRender: {},
  3983. editColRender: (scope: any) => {
  3984. console.log("mtrlname hooks render scope :>> ", scope);
  3985. console.log("mtrlname hooks render LjDetailRef.value._mainData :>> ", state.LjDetailRef);
  3986. const { column, row, status, $table } = scope;
  3987. let field = column.field;
  3988. let _label = column.title;
  3989. // if (column?.format) {
  3990. // _label = handleRowAccordingToProp(searchParam, field, column?.format);
  3991. // }
  3992. let _deptid = state.LjDetailRef._mainData.deptid;
  3993. let deptEnum = state.LjDetailRef.enumMap.get("deptid");
  3994. let _pricelistid = 0;
  3995. console.log("deptEnum :>> ", deptEnum);
  3996. if (deptEnum) {
  3997. let depItem = deptEnum.find((item: any) => item.value == _deptid);
  3998. console.log("depItem :>> ", depItem);
  3999. if (depItem) {
  4000. _pricelistid = Number(depItem.pricelistid);
  4001. }
  4002. }
  4003. console.log("_pricelistid :>> ", _pricelistid, row.formulakind);
  4004. console.log("state.mtrltypeTabList :>> ", state.mtrltypeTabList);
  4005. let _mtrltypeItem: any = mtrltypeTabList_accessories.find(t => t.formulakinds.includes(Number(row.formulakind)));
  4006. if (!_mtrltypeItem) {
  4007. ElMessage.error("不是辅料类型行,不能选物料");
  4008. return "";
  4009. }
  4010. let params = {
  4011. mtrltype: _mtrltypeItem.value,
  4012. pricelistid: _pricelistid
  4013. };
  4014. return (
  4015. <>
  4016. <MtrldefSelect
  4017. value={row.mtrlid}
  4018. {...params}
  4019. clearable
  4020. placeholder={_label}
  4021. onOpenModal={() => fModelChoseMtrl(row, params, rModelSetMtrl, _mtrltypeItem.label, $table)}
  4022. onSelect={(val: any) => rModelSetMtrl(row, val, $table)}
  4023. onClear={() => rModelClearMtrl(row, $table)}
  4024. >
  4025. {{
  4026. label: () => row.mtrlname
  4027. }}
  4028. </MtrldefSelect>
  4029. </>
  4030. );
  4031. }
  4032. },
  4033. {
  4034. title: "厚度cm",
  4035. field: "thickness",
  4036. limited: true
  4037. }
  4038. ];
  4039. const packagColumns: ColumnProps<any>[] = [
  4040. {
  4041. title: "位置",
  4042. field: "chastr",
  4043. visible: false
  4044. },
  4045. {
  4046. title: "物料",
  4047. field: "mtrlname",
  4048. editRender: {},
  4049. editColRender: (scope: any) => {
  4050. console.log("mtrlname hooks render scope :>> ", scope);
  4051. console.log("mtrlname hooks render LjDetailRef.value._mainData :>> ", state.LjDetailRef);
  4052. const { column, row, status, $table } = scope;
  4053. let field = column.field;
  4054. let _label = column.title;
  4055. // if (column?.format) {
  4056. // _label = handleRowAccordingToProp(searchParam, field, column?.format);
  4057. // }
  4058. let _deptid = state.LjDetailRef._mainData.deptid;
  4059. let deptEnum = state.LjDetailRef.enumMap.get("deptid");
  4060. let _pricelistid = 0;
  4061. console.log("deptEnum :>> ", deptEnum);
  4062. if (deptEnum) {
  4063. let depItem = deptEnum.find((item: any) => item.value == _deptid);
  4064. console.log("depItem :>> ", depItem);
  4065. if (depItem) {
  4066. _pricelistid = Number(depItem.pricelistid);
  4067. }
  4068. }
  4069. console.log("_pricelistid :>> ", _pricelistid, row.formulakind);
  4070. console.log("state.mtrltypeTabList :>> ", state.mtrltypeTabList);
  4071. let _mtrltypeItem: any = mtrltypeTabList_packag.find(t => t.formulakinds.includes(Number(row.formulakind)));
  4072. !_mtrltypeItem && (_mtrltypeItem = { value: -1 });
  4073. let params = {
  4074. mtrltype: _mtrltypeItem.value,
  4075. pricelistid: _pricelistid
  4076. };
  4077. return (
  4078. <MtrldefSelect
  4079. value={row.mtrlid}
  4080. {...params}
  4081. clearable
  4082. placeholder={_label}
  4083. onOpenModal={() => fModelChoseMtrl(row, params, rModelSetMtrl, _mtrltypeItem.label, $table)}
  4084. onSelect={(val: any) => rModelSetMtrl(row, val, $table)}
  4085. onClear={() => rModelClearMtrl(row, $table)}
  4086. >
  4087. {{
  4088. label: () => row.mtrlname
  4089. }}
  4090. </MtrldefSelect>
  4091. );
  4092. }
  4093. },
  4094. {
  4095. title: "厚度cm",
  4096. field: "thickness",
  4097. limited: true
  4098. }
  4099. ];
  4100. const columnsMxInnerClothLayer: ColumnProps<any>[] = [
  4101. {
  4102. title: "计算成功?",
  4103. field: "if_success",
  4104. datatype: "checkbox",
  4105. limited: () => {
  4106. const { userInfo } = useUserStore();
  4107. return userInfo.usermode != 0;
  4108. },
  4109. render: (scope: any) => {
  4110. if (Number(scope.row.if_success)) {
  4111. return (
  4112. <>
  4113. <ElTag type="danger">异常</ElTag>
  4114. </>
  4115. );
  4116. } else {
  4117. return <></>;
  4118. }
  4119. }
  4120. },
  4121. {
  4122. title: "位置",
  4123. field: "chastr"
  4124. // treeNode: true
  4125. },
  4126. {
  4127. title: "+",
  4128. field: "addmx",
  4129. width: 80,
  4130. render: (scope: any) => {
  4131. let _if_mtrl = Number(scope.row.if_mtrl);
  4132. if (_if_mtrl > 1) {
  4133. if (state.orderStatus) {
  4134. return (
  4135. <>
  4136. <ElPopconfirm
  4137. width="220"
  4138. icon={InfoFilled}
  4139. title={t("business.tips.mattress.addMx")}
  4140. confirm-button-text={t("common.addText")}
  4141. onConfirm={() => funcAddMtrlMx(scope)}
  4142. >
  4143. {{
  4144. reference: () => {
  4145. return <ElButton type="primary" plain circle icon={Plus}></ElButton>;
  4146. }
  4147. }}
  4148. </ElPopconfirm>
  4149. </>
  4150. );
  4151. // return <ElButton type="primary" plain circle icon={Plus} onClick={() => funcAddMtrlMx(scope)}></ElButton>;
  4152. } else {
  4153. return <>+</>;
  4154. }
  4155. } else {
  4156. return <></>;
  4157. }
  4158. }
  4159. },
  4160. {
  4161. title: "-",
  4162. field: "delmx",
  4163. width: 80,
  4164. render: (scope: any) => {
  4165. let _if_mtrl = Number(scope.row.if_mtrl);
  4166. if (_if_mtrl > 1) {
  4167. if (state.orderStatus) {
  4168. return (
  4169. <>
  4170. <ElPopconfirm
  4171. width="220"
  4172. icon={InfoFilled}
  4173. title={t("business.tips.mattress.delMx")}
  4174. confirm-button-text={t("common.delText")}
  4175. confirm-button-type="danger"
  4176. onConfirm={() => funcDelMtrlMx(scope)}
  4177. >
  4178. {{
  4179. reference: () => {
  4180. return <ElButton type="danger" plain circle icon={Minus} />;
  4181. }
  4182. }}
  4183. </ElPopconfirm>
  4184. </>
  4185. );
  4186. // return <ElButton type="danger" plain circle icon={Minus} onClick={() => funcDelMtrlMx(scope)}></ElButton>;
  4187. } else {
  4188. return <>-</>;
  4189. }
  4190. } else {
  4191. return <></>;
  4192. }
  4193. }
  4194. },
  4195. {
  4196. title: "厚度cm",
  4197. field: "thickness",
  4198. datatype: "number",
  4199. editRender: {
  4200. name: "$input"
  4201. }
  4202. },
  4203. {
  4204. title: "物料",
  4205. field: "mtrlname",
  4206. editRender: {},
  4207. editColRender: (scope: any) => {
  4208. console.log("mtrlname hooks render scope :>> ", scope);
  4209. console.log("mtrlname hooks render LjDetailRef.value._mainData :>> ", state.LjDetailRef);
  4210. const { column, row, status, $table } = scope;
  4211. let _label = column.title;
  4212. let _deptid = state.LjDetailRef._mainData.deptid;
  4213. let deptEnum = state.LjDetailRef.enumMap.get("deptid");
  4214. let _pricelistid = 0;
  4215. console.log("deptEnum :>> ", deptEnum);
  4216. if (deptEnum) {
  4217. let depItem = deptEnum.find((item: any) => item.value == _deptid);
  4218. console.log("depItem :>> ", depItem);
  4219. if (depItem) {
  4220. _pricelistid = Number(depItem.pricelistid);
  4221. }
  4222. }
  4223. console.log("_pricelistid :>> ", _pricelistid, row.formulakind);
  4224. console.log("state.mtrltypeTabList :>> ", state.mtrltypeTabList);
  4225. let _mtrltypeItem: any = mtrltypeTabList_inner.find(t => t.formulakinds.includes(Number(row.formulakind)));
  4226. !_mtrltypeItem && (_mtrltypeItem = { value: -1 });
  4227. let params = {
  4228. mtrltype: _mtrltypeItem.value,
  4229. pricelistid: _pricelistid
  4230. };
  4231. return (
  4232. <>
  4233. <MtrldefSelect
  4234. value={row.mtrlid}
  4235. {...params}
  4236. clearable
  4237. placeholder={_label}
  4238. onOpenModal={() => fModelChoseMtrl(row, params, rModelSetMtrlInner, _mtrltypeItem.label, $table)}
  4239. onSelect={(val: any) => rModelSetMtrlInner(row, val, $table)}
  4240. onClear={() => rModelClearMtrl(row, $table)}
  4241. >
  4242. {{
  4243. label: () => row.mtrlname
  4244. }}
  4245. </MtrldefSelect>
  4246. </>
  4247. );
  4248. }
  4249. },
  4250. {
  4251. title: "数量/长度",
  4252. field: "qty",
  4253. datatype: "number",
  4254. editRender: {
  4255. name: "input"
  4256. }
  4257. }
  4258. ];
  4259. const columnsMx_subSpecs = [
  4260. { type: "checkbox", width: 50, fixed: "left" },
  4261. {
  4262. field: "mattress_width",
  4263. datatype: "number",
  4264. editRender: {
  4265. name: "$input",
  4266. props: {
  4267. type: "number"
  4268. }
  4269. }
  4270. },
  4271. {
  4272. field: "mattress_length",
  4273. datatype: "number",
  4274. editRender: {
  4275. name: "$input",
  4276. props: {
  4277. type: "number"
  4278. }
  4279. }
  4280. },
  4281. {
  4282. field: "mattress_height",
  4283. datatype: "number",
  4284. editRender: {
  4285. name: "$input",
  4286. props: {
  4287. type: "number"
  4288. }
  4289. }
  4290. }
  4291. ];
  4292. const handleToImportMxInner = async () => {
  4293. let _params = {
  4294. dsname: "web_mattress_formulalist",
  4295. queryparams: {
  4296. arg_array_formulatype: [101],
  4297. arrg_usetype: 0
  4298. }
  4299. };
  4300. let res = await CommonDynamicSelect(_params);
  4301. let idxStr = "";
  4302. const $table = state.innerClothLayerMxRef.element;
  4303. if ($table) {
  4304. const { visibleData } = $table.getTableData();
  4305. if (visibleData.length) {
  4306. let lastMx = visibleData[visibleData.length - 1];
  4307. idxStr = Number(lastMx.chastr.match(/\d+$/)?.[0] ?? 0) + 1 + "";
  4308. } else {
  4309. idxStr = "";
  4310. }
  4311. }
  4312. if (res?.datatable?.length) {
  4313. const $table = state.innerClothLayerMxRef.element;
  4314. // $table.remove();
  4315. let _rows = res?.datatable.map((item: any, index: number) => {
  4316. let _data: any = {};
  4317. if (Number(item.if_mtrl) > 1) {
  4318. _data.addmx = "+";
  4319. _data.delmx = "-";
  4320. }
  4321. _data.formulatype = item.formulatype;
  4322. _data.if_mtrl = item.if_mtrl;
  4323. _data.formulaid = item.formulaid;
  4324. _data.sortcode = item.sortcode;
  4325. _data.formulakind = item.formulakind;
  4326. _data.formula = item.formula;
  4327. _data.chastr = "内布套" + idxStr;
  4328. _data.useformula = item.useformula;
  4329. _data.gydscrp = item.gydscrp;
  4330. _data.pid = index + 1;
  4331. return _data;
  4332. });
  4333. // let tree = {
  4334. // chastr: "内布套",
  4335. // children: _rows
  4336. // };
  4337. // $table.insertAt(tree, -1);
  4338. await $table.insertAt(_rows, -1);
  4339. ElMessage.success("导入成功");
  4340. }
  4341. resetMergeCellsInner();
  4342. };
  4343. const resetMergeCellsInner = () => {
  4344. setTimeout(() => {
  4345. const $table = state.innerClothLayerMxRef.element;
  4346. if ($table) {
  4347. let mergeCells = autoMergeCells($table, ["chastr"]);
  4348. console.log("resetMergeCellsInner autoMergeCells :>> ", mergeCells);
  4349. $table.setMergeCells(mergeCells);
  4350. }
  4351. }, 200);
  4352. };
  4353. const hanleDelMxInner = (type: number) => {
  4354. const $table = state.innerClothLayerMxRef.element;
  4355. if ($table) {
  4356. if (type == 1) {
  4357. // 全部
  4358. $table.remove();
  4359. } else if (type == 0) {
  4360. // 删除选中
  4361. const curRow = $table.getCurrentRecord();
  4362. if (!curRow) {
  4363. ElMessage.warning("请先选择要删除的行");
  4364. return;
  4365. }
  4366. $table.remove(curRow);
  4367. }
  4368. }
  4369. };
  4370. const w_mattress_add_itemname_choose = (type: number) => {
  4371. let arr = [];
  4372. if (type == 1) {
  4373. } else if (type == 2) {
  4374. } else if (type == 3) {
  4375. arr.push({
  4376. label: "内布套",
  4377. value: "内布套"
  4378. });
  4379. arr.push({
  4380. label: "内布套拆装",
  4381. value: "内布套拆装"
  4382. });
  4383. } else if (type == 4) {
  4384. arr.push({
  4385. label: "顶布裥棉1",
  4386. value: "顶布裥棉1"
  4387. });
  4388. arr.push({
  4389. label: "顶布裥棉2",
  4390. value: "顶布裥棉2"
  4391. });
  4392. arr.push({
  4393. label: "顶布裥棉3",
  4394. value: "顶布裥棉3"
  4395. });
  4396. arr.push({
  4397. label: "顶布裥棉4",
  4398. value: "顶布裥棉4"
  4399. });
  4400. }
  4401. return arr;
  4402. };
  4403. const wf_add_w_butao = async (val: any) => {
  4404. console.log("val :>> ", val);
  4405. const $table = state.topCottonMxRef.element;
  4406. if ($table) {
  4407. const { fullData } = $table.getTableData();
  4408. let ifind = fullData.find(t => t.chastr == val.value);
  4409. if (ifind) {
  4410. ElMessage.warning(`该选项${val.value}已存在`);
  4411. return;
  4412. }
  4413. let newParams: any = {};
  4414. newParams.queryParams = {
  4415. arg_array_formulatype: [103],
  4416. arrg_usetype: 0
  4417. };
  4418. newParams.dsname = "web_mattress_formulalist";
  4419. let res = await CommonDynamicSelect(newParams);
  4420. console.log("funcAddBigSide res :>> ", res);
  4421. if (res.datatable) {
  4422. let _rows = res?.datatable.map((item: any) => {
  4423. let _data: any = {};
  4424. if (Number(item.if_mtrl) > 1) {
  4425. _data.addmx = "+";
  4426. _data.delmx = "-";
  4427. }
  4428. _data.formulatype = item.formulatype;
  4429. _data.if_mtrl = item.if_mtrl;
  4430. _data.formulaid = item.formulaid;
  4431. _data.sortcode = item.sortcode;
  4432. _data.formulakind = item.formulakind;
  4433. _data.formula = item.formula;
  4434. _data.chastr = val.value;
  4435. _data.useformula = item.useformula;
  4436. _data.gydscrp = item.gydscrp;
  4437. return _data;
  4438. });
  4439. $table.insertAt(_rows, -1);
  4440. }
  4441. }
  4442. resetMergeCellsTopCotton();
  4443. };
  4444. const resetMergeCellsTopCotton = () => {
  4445. setTimeout(() => {
  4446. const $table = state.topCottonMxRef.element;
  4447. if ($table) {
  4448. let mergeCells = autoMergeCells($table, ["chastr"]);
  4449. console.log("resetMergeCellsInner autoMergeCells :>> ", mergeCells);
  4450. $table.setMergeCells(mergeCells);
  4451. }
  4452. }, 1);
  4453. };
  4454. /**
  4455. * @description 删除顶布裥棉明细
  4456. */
  4457. const wf_del_w_butao = async () => {
  4458. const $table = state.topCottonMxRef.element;
  4459. // 删除选中
  4460. const curRow = $table.getCurrentRecord();
  4461. const { fullData } = $table.getTableData();
  4462. if (!curRow) {
  4463. ElMessage.warning("请先选择要删除的行");
  4464. return;
  4465. }
  4466. let ls_chastr = curRow.chastr;
  4467. ElMessageBox.confirm(`是否确定要删除【${ls_chastr}】的明细行?`, "询问", {
  4468. confirmButtonText: "是",
  4469. cancelButtonText: "否",
  4470. type: "warning"
  4471. }).then(() => {
  4472. let _rows = fullData.filter((item: any) => item.chastr == ls_chastr);
  4473. $table.remove(_rows);
  4474. ElMessage({
  4475. type: "success",
  4476. message: "删除成功"
  4477. });
  4478. });
  4479. };
  4480. return {
  4481. ...toRefs(state),
  4482. columns,
  4483. columnsMx,
  4484. columnsMxBednet: funcMergeColumn(columnsMx, bednetCoumns),
  4485. columnsMxCushions: funcMergeColumn(columnsMx, cushionsColumns),
  4486. columnsMxAccessories: funcMergeColumn(columnsMx, accessoriesColumns),
  4487. columnsMxPackag: funcMergeColumn(columnsMx, packagColumns),
  4488. columnsMxInnerClothLayer,
  4489. summaryData,
  4490. fieldParams,
  4491. columnsMx_subSpecs,
  4492. funcAddMxSide,
  4493. funcChaifenTab,
  4494. getData_mx,
  4495. dataCallback,
  4496. dataCallbackMx,
  4497. getMattressType,
  4498. gotoSummy,
  4499. gotoHisprice,
  4500. getFormulakindEnum,
  4501. funcPacktypeChange,
  4502. dynamicRef,
  4503. wf_cmp_cb,
  4504. handleToImportMxInner,
  4505. hanleDelMxInner,
  4506. wf_add_w_butao,
  4507. wf_del_w_butao,
  4508. w_mattress_add_itemname_choose,
  4509. wf_rtr_bednet,
  4510. funcAddMtrlMx,
  4511. resetMergeCellsInner,
  4512. resetMergeCellsTopCotton
  4513. };
  4514. };