b802b35ebeb96ffb9c2bea95065bd42c262d1c2e.svn-base 303 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262
  1. <template>
  2. <div class="app-container">
  3. <div class="operation">
  4. <!-- 临时隐藏 -->
  5. <!-- <el-button v-if="isRoleEdit" class="successBorder" style="float: left;" @click="handleNutritional">营养评估</el-button> -->
  6. <!-- 临时隐藏 -->
  7. <div class="search">
  8. <el-select v-model="table.getdataListParm.parammaps.barid" clearable filterable placeholder="请选择栏舍" style="width: 180px;" class="filter-item">
  9. <el-option v-for="item in barList" :key="item.id" :label="item.bname" :value="item.id" />
  10. </el-select>
  11. <el-input v-model="table.getdataListParm.parammaps.tname" placeholder="请输入配方名称" style="width: 180px;" class="filter-item" />
  12. <el-button class="successBorder" @click="handleSearch">查询</el-button>
  13. </div>
  14. <el-button v-if="isRoleEdit" class="successBorder" style="float: left;" @click="handleDryMatterRegulation">干物质调节</el-button>
  15. <el-upload style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
  16. <el-button v-if="isRoleEdit" class="import" icon="el-icon-download" style="float: right;">导入</el-button>
  17. </el-upload>
  18. <el-dropdown style="float: right;margin-right: 10px;">
  19. <el-button class="export" icon="el-icon-upload2">导出</el-button>
  20. <el-dropdown-menu slot="dropdown">
  21. <el-dropdown-item @click.native="handleExport(1)">导出模板</el-dropdown-item>
  22. <el-dropdown-item @click.native="handleExport(2)">导出数据</el-dropdown-item>
  23. </el-dropdown-menu>
  24. </el-dropdown>
  25. <el-button class="export" style="float: right;margin-right: 10px;" @click="handleHistoryRecords">历史记录</el-button>
  26. </div>
  27. <div class="search" />
  28. <div class="table">
  29. <el-table
  30. :key="table.tableKey"
  31. ref="table"
  32. v-loading="table.listLoading"
  33. element-loading-text="给我一点时间"
  34. :data="table.list"
  35. border
  36. fit
  37. highlight-current-row
  38. style="width: 100%;"
  39. :row-style="rowStyle"
  40. :cell-style="cellStyle"
  41. class="elTable table-fixed"
  42. :max-height="myHeight"
  43. @header-click="headerClick"
  44. @cell-click="cellClick"
  45. @selection-change="handleSelect"
  46. @cell-dblclick="celldblclick"
  47. >
  48. <el-table-column type="selection" width="50" />
  49. <el-table-column :key="1" label="序号" align="center" type="index" width="50px" class-name="small-padding fixed-width" fixed="left" />
  50. <el-table-column label="栏舍名称" min-width="100px" align="center" class-name="small-padding fixed-width" fixed="left">
  51. <template slot-scope="scope">
  52. <span>{{ scope.row.barname }}</span>
  53. </template>
  54. </el-table-column>
  55. <el-table-column :key="2" label="软件牛头数" min-width="70px" align="center">
  56. <template slot-scope="scope">
  57. <span>{{ scope.row.softccount }}</span>
  58. </template>
  59. </el-table-column>
  60. <el-table-column :key="3" label="实际牛头数" min-width="90px" align="center">
  61. <template slot-scope="scope">
  62. <span v-if="scope.row.NoEdit">{{ scope.row.ccount }}</span>
  63. <el-input v-if="scope.row.Edit" v-model="scope.row.ccount" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurCcount(scope.row)" />
  64. </template>
  65. </el-table-column>
  66. <el-table-column :key="4" label="系数(%)" min-width="85px" align="center">
  67. <template slot-scope="scope">
  68. <span v-if="scope.row.NoEdit">{{ scope.row.ratio }}</span>
  69. <el-input v-if="scope.row.Edit" v-model="scope.row.ratio" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurRatio(scope.row)" />
  70. </template>
  71. </el-table-column>
  72. <el-table-column :key="5" label="系数头数" min-width="85px" align="center">
  73. <template slot-scope="scope">
  74. <span v-if="scope.row.NoEdit">{{ scope.row.ccountratio }}</span>
  75. <el-input v-if="scope.row.Edit" v-model="scope.row.ccountratio" type="number" style="width:95%;padding:10px 0;" @blur="blurCcountratio(scope.row)" />
  76. </template>
  77. </el-table-column>
  78. <el-table-column :key="6" label="配方模板" min-width="130px" align="center">
  79. <template slot-scope="scope">
  80. <span v-if="scope.row.NoEdit">{{ scope.row.ftname }}</span>
  81. <el-select v-if="scope.row.Edit" v-model="scope.row.ftid" filterable placeholder="配方模板" class="filter-item" style="width:99%;" @change="(value)=> {changeRecipeTemplate(value, scope.row)}">
  82. <el-option v-for="item in recipeTemplateList" :key="item.id" :label="item.tname" :value="item.id" />
  83. </el-select>
  84. </template>
  85. </el-table-column>
  86. <el-table-column v-if="table.isPtsfname" :key="7" label="补料配方" min-width="130px" align="center">
  87. <template slot-scope="scope">
  88. <span v-if="scope.row.NoEdit">{{ scope.row.ptsfname }}</span>
  89. <el-select v-if="scope.row.Edit" v-model="scope.row.ptsfid" clearable filterable placeholder="补料配方" class="filter-item" style="width:95%;padding:10px 0;" @change="(value)=> {changeFeedingFormula(value, scope.row)}">
  90. <el-option v-for="item in feedingFormulaList" :key="item.id" :label="item.tname" :value="item.id" />
  91. </el-select>
  92. </template>
  93. </el-table-column>
  94. <el-table-column v-if="table.isRW1" :key="8" label="第一班比例(%)" min-width="80px" align="center">
  95. <template slot-scope="scope">
  96. <span v-if="scope.row.NoEdit">{{ scope.row.r1 }}</span>
  97. <el-input v-if="scope.row.Edit" v-model="scope.row.r1" :disabled="scope.row.isOneWeight" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurR(scope.row)" />
  98. </template>
  99. </el-table-column>
  100. <el-table-column v-if="table.isRW1" :key="9" label="第一班重量" min-width="120px" align="center" :render-header="renderHeader">
  101. <template slot-scope="scope">
  102. <span v-if="scope.row.NoEdit">{{ scope.row.w1 }}</span>
  103. <el-input v-if="scope.row.Edit" v-model="scope.row.w1" :disabled="scope.row.isOneWeight" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurW(scope.row)" @focus="focusW(scope.row)" />
  104. </template>
  105. </el-table-column>
  106. <el-table-column v-if="table.isRW1 && table.isPtsfname" :key="10" label="第一班补料重量" min-width="120px" align="center">
  107. <template slot-scope="scope">
  108. <span v-if="scope.row.NoEdit">{{ scope.row.bw1 }}</span>
  109. <el-input v-if="scope.row.Edit" v-model="scope.row.bw1" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurBw(scope.row)" @focus="focusBw(scope.row)" />
  110. </template>
  111. </el-table-column>
  112. <el-table-column v-if="table.isRW2" :key="11" label="第二班比例(%)" min-width="80px" align="center">
  113. <template slot-scope="scope">
  114. <span v-if="scope.row.NoEdit">{{ scope.row.r2 }}</span>
  115. <el-input v-if="scope.row.Edit" v-model="scope.row.r2" step="0.01" type="number" :disabled="scope.row.isTwoWeight" style="width:95%;padding:10px 0;" @blur="blurR(scope.row)" />
  116. </template>
  117. </el-table-column>
  118. <el-table-column v-if="table.isRW2" :key="12" label="第二班重量" min-width="120px" align="center" :render-header="renderHeader">
  119. <template slot-scope="scope">
  120. <span v-if="scope.row.NoEdit">{{ scope.row.w2 }}</span>
  121. <el-input v-if="scope.row.Edit" v-model="scope.row.w2" :disabled="scope.row.isTwoWeight" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurW2(scope.row)" @focus="focusW2(scope.row)" />
  122. </template>
  123. </el-table-column>
  124. <el-table-column v-if="table.isRW2 && table.isPtsfname" :key="13" label="第二班补料重量" min-width="120px" align="center">
  125. <template slot-scope="scope">
  126. <span v-if="scope.row.NoEdit">{{ scope.row.bw2 }}</span>
  127. <el-input v-if="scope.row.Edit" v-model="scope.row.bw2" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurBw(scope.row)" @focus="focusBw(scope.row)" />
  128. </template>
  129. </el-table-column>
  130. <el-table-column v-if="table.isRW3" :key="14" label="第三班比例(%)" min-width="80px" align="center">
  131. <template slot-scope="scope">
  132. <span v-if="scope.row.NoEdit">{{ scope.row.r3 }}</span>
  133. <el-input v-if="scope.row.Edit" v-model="scope.row.r3" step="0.01" type="number" :disabled="scope.row.isThreeWeight" style="width:95%;padding:10px 0;" @blur="blurR(scope.row)" />
  134. </template>
  135. </el-table-column>
  136. <el-table-column v-if="table.isRW3" :key="15" label="第三班重量" min-width="120px" align="center" :render-header="renderHeader">
  137. <template slot-scope="scope">
  138. <span v-if="scope.row.NoEdit">{{ scope.row.w3 }}</span>
  139. <el-input v-if="scope.row.Edit" v-model="scope.row.w3" :disabled="scope.row.isThreeWeight" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurW3(scope.row)" @focus="focusW3(scope.row)" />
  140. </template>
  141. </el-table-column>
  142. <el-table-column v-if="table.isRW3 && table.isPtsfname" :key="16" label="第三班补料重量" min-width="120px" align="center">
  143. <template slot-scope="scope">
  144. <span v-if="scope.row.NoEdit">{{ scope.row.bw3 }}</span>
  145. <el-input v-if="scope.row.Edit" v-model="scope.row.bw3" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurBw(scope.row)" @focus="focusBw(scope.row)" />
  146. </template>
  147. </el-table-column>
  148. <el-table-column v-if="table.isRW4" :key="17" label="第四班比例(%)" min-width="80px" align="center">
  149. <template slot-scope="scope">
  150. <span v-if="scope.row.NoEdit">{{ scope.row.r4 }}</span>
  151. <el-input v-if="scope.row.Edit" v-model="scope.row.r4" step="0.01" type="number" :disabled="scope.row.isFourWeight" style="width:95%;padding:10px 0;" @blur="blurR(scope.row)" />
  152. </template>
  153. </el-table-column>
  154. <el-table-column v-if="table.isRW4" :key="18" label="第四班重量" min-width="120px" align="center" :render-header="renderHeader">
  155. <template slot-scope="scope">
  156. <span v-if="scope.row.NoEdit">{{ scope.row.w4 }}</span>
  157. <el-input v-if="scope.row.Edit" v-model="scope.row.w4" :disabled="scope.row.isFourWeight" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurW4(scope.row)" @focus="focusW4(scope.row)" />
  158. </template>
  159. </el-table-column>
  160. <el-table-column v-if="table.isRW4 && table.isPtsfname" :key="19" label="第四班补料重量" min-width="120px" align="center">
  161. <template slot-scope="scope">
  162. <span v-if="scope.row.NoEdit">{{ scope.row.bw4 }}</span>
  163. <el-input v-if="scope.row.Edit" v-model="scope.row.bw4" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurBw(scope.row)" @focus="focusBw(scope.row)" />
  164. </template>
  165. </el-table-column>
  166. <el-table-column :key="20" label="饲喂总比例(%)" min-width="80px" align="center">
  167. <template slot-scope="scope">
  168. <span>{{ scope.row.sumr }}</span>
  169. </template>
  170. </el-table-column>
  171. <el-table-column :key="21" label="饲喂投喂量" min-width="80px" align="center">
  172. <template slot-scope="scope">
  173. <span>{{ scope.row.todayweight }}</span>
  174. </template>
  175. </el-table-column>
  176. <el-table-column :key="22" label="饲喂配方重量" min-width="70px" align="center">
  177. <template slot-scope="scope">
  178. <span>{{ scope.row.ftweight }}</span>
  179. </template>
  180. </el-table-column>
  181. <el-table-column v-if="table.isPtsfname" :key="23" label="补料配方重量" min-width="100px" align="center">
  182. <template slot-scope="scope">
  183. <span>{{ scope.row.supplyweight }}</span>
  184. </template>
  185. </el-table-column>
  186. <!-- <el-table-column :key="22" label="投喂量" min-width="80px" align="center">
  187. <template slot-scope="scope">
  188. <span>{{ scope.row.feedweight }}</span>
  189. </template>
  190. </el-table-column> -->
  191. <el-table-column v-if="table.isPtsfname" :key="24" label="补料投喂量" min-width="70px" align="center">
  192. <template slot-scope="scope">
  193. <span>{{ scope.row.todaysupplement }}</span>
  194. </template>
  195. </el-table-column>
  196. <el-table-column :key="25" label="日投喂量" min-width="70px" align="center">
  197. <template slot-scope="scope">
  198. <span>{{ scope.row.todayfeed }}</span>
  199. </template>
  200. </el-table-column>
  201. <el-table-column :key="26" label="配方干物质" min-width="70px" align="center">
  202. <template slot-scope="scope">
  203. <span>{{ scope.row.dryweight }}</span>
  204. </template>
  205. </el-table-column>
  206. <el-table-column label="操作" align="center" width="80" class-name="small-padding fixed-width" fixed="right">
  207. <template slot-scope="{row}">
  208. <el-button v-if="row.isUpdate && isRoleEdit" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
  209. <el-button v-if="row.isUpdateSave && isRoleEdit" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData(row)" />
  210. <span v-if="row.isUpdateSave && isRoleEdit" class="centerSpan">|</span>
  211. <el-button v-if="row.isUpdateSave && isRoleEdit" class="minCancel" icon="el-icon-close" @click="updateCancel(row)" />
  212. </template>
  213. </el-table-column>
  214. </el-table>
  215. <!-- <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" /> -->
  216. </div>
  217. <!-- 历史记录 -->
  218. <el-dialog :fullscreen="dialogFull" :destroy-on-close="true" :visible.sync="history.dialogFormVisible" :close-on-click-modal="false" width="90%">
  219. <template slot="title">
  220. <div class="avue-crud__dialog__header">
  221. <span class="el-dialog__title">
  222. <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
  223. {{ textMap[history.dialogStatus] }}
  224. </span>
  225. <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
  226. <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
  227. <svg-icon v-else icon-class="fullscreen" />
  228. </div>
  229. </div>
  230. </template>
  231. <div class="app-history">
  232. <div class="search">
  233. <el-date-picker v-model="history.getdataListParm.parammaps.date" type="date" placeholder="请选择历史记录时间" :clearable="false" style="width: 180px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="changeDate" />
  234. <!-- <el-select v-model="history.getdataListParm.parammaps.barid" clearable filterable placeholder="请选择栏舍" style="width: 180px;" class="filter-item">
  235. <el-option v-for="item in barList" :key="item.id" :label="item.bname" :value="item.id" />
  236. </el-select>
  237. <el-input v-model="history.getdataListParm.parammaps.tname" placeholder="请输入配方名称" style="width: 180px;" class="filter-item" />
  238. <el-button class="successBorder" @click="handleHistorySearch">查询</el-button> -->
  239. <!-- <el-button class="successBorder" @click="handleApplication">应用</el-button> -->
  240. </div>
  241. <div class="table">
  242. <el-table
  243. :key="history.tableKey"
  244. v-loading="history.listLoading"
  245. element-loading-text="给我一点时间"
  246. :data="history.list"
  247. border
  248. fit
  249. highlight-current-row
  250. style="width: 100%;"
  251. :row-style="rowStyle"
  252. :cell-style="cellStyle"
  253. class="elTable table-fixed"
  254. :span-method="objectSpanMethod"
  255. >
  256. <el-table-column :key="1" label="序号" align="center" type="index" width="50px" class-name="small-padding fixed-width" fixed="left">
  257. <template slot-scope="scope">
  258. <span>{{ scope.$index + (history.pageNum-1) * history.pageSize + 1 }}</span>
  259. </template>
  260. </el-table-column>
  261. <el-table-column :key="2" label="栏舍名称" prop="barname" min-width="90px" align="center" class-name="small-padding fixed-width" fixed="left" />
  262. <el-table-column :key="3" label="班次" prop="times" min-width="90px" align="center" class-name="small-padding fixed-width" fixed="left" />
  263. <el-table-column :key="4" label="软件牛头数" prop="softccount" min-width="70px" align="center" />
  264. <el-table-column :key="5" label="实际牛头数" prop="ccount" min-width="70px" align="center" />
  265. <el-table-column :key="6" label="系数(%)" prop="ratio" min-width="70px" align="center" />
  266. <el-table-column :key="7" label="系数头数" prop="ccountratio" min-width="70px" align="center" />
  267. <el-table-column :key="8" label="配方模板" prop="ptname" min-width="70px" align="center" />
  268. <el-table-column v-if="table.isPtsfname" :key="9" label="补料配方" prop="ptsname" min-width="70px" align="center" />
  269. <el-table-column :key="10" label="班次比例" prop="tratio" min-width="70px" align="center" />
  270. <el-table-column :key="11" label="班次重量" prop="weight" min-width="70px" align="center" />
  271. <el-table-column :key="12" label="配方重量" prop="pweight" min-width="70px" align="center" />
  272. <el-table-column v-if="table.isPtsfname" :key="13" label="补料重量" prop="ptweight" min-width="70px" align="center" />
  273. <el-table-column :key="14" label="配方干物质量" prop="dryweight" min-width="70px" align="center" />
  274. <el-table-column :key="15" label="饲喂干物质量" prop="swdryw" min-width="70px" align="center" />
  275. <el-table-column :key="16" label="采样干物质量" prop="cydryw" min-width="70px" align="center" />
  276. <el-table-column :key="17" label="日投喂量" prop="sumweight" min-width="70px" align="center" />
  277. </el-table>
  278. <pagination2 v-show="history.total>0" :total="history.total" :page.sync="history.getdataListParm.offset" :limit.sync="history.getdataListParm.pagecount" @pagination="getHistoryList" />
  279. </div>
  280. </div>
  281. <div slot="footer" class="dialog-footer" style="bottom: 10px;">
  282. <el-button class="cancelClose cancelClose1" @click="history.dialogFormVisible = false; ">关闭</el-button>
  283. </div>
  284. </el-dialog>
  285. <!-- 营养评估 -->
  286. <el-dialog :fullscreen="dialogFull" :visible.sync="nutritional.dialogFormVisible" :close-on-click-modal="false" width="90%">
  287. <template slot="title">
  288. <div class="avue-crud__dialog__header">
  289. <span class="el-dialog__title">
  290. <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
  291. {{ textMap[nutritional.dialogStatus] }}
  292. </span>
  293. <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
  294. <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
  295. <svg-icon v-else icon-class="fullscreen" />
  296. </div>
  297. </div>
  298. </template>
  299. <div class="app-nutritional">
  300. <h4 style="position: absolute;top:-5px;left:140px;font:16px/30px '' ;color:#303133;">栏舍:{{ nutritional.tab1.temp.barname }}</h4>
  301. <el-tabs v-model="nutritional.activeName" @tab-click="handleNutritionalTab">
  302. <el-tab-pane label="营养评估" name="first">
  303. <el-form ref="temp" :rules="rules" :model="nutritional.tab1.temp" label-position="right" label-width="95px" style="width: 100%;margin-bottom:30px">
  304. <el-row>
  305. <el-col :span="4">
  306. <el-form-item label="类别" prop="cowclassid">
  307. <el-select v-model="nutritional.tab1.temp.cowclassid" :disabled="nutritional.tab1.disabledCowclass" filterable placeholder="" class="filter-item" style="width:100%;">
  308. <el-option v-for="item in livestockTypeList" :key="item.id" :label="item.mixname" :value="item.id" />
  309. </el-select>
  310. </el-form-item>
  311. </el-col>
  312. <el-col :span="4">
  313. <el-form-item label="月龄" prop="avgmonthage">
  314. <el-input ref="avgmonthage" v-model="nutritional.tab1.temp.avgmonthage" class="filter-item" placeholder="" style="width:100%;" />
  315. </el-form-item>
  316. </el-col>
  317. <el-col :span="4">
  318. <el-form-item label="体重(kg)" prop="bw">
  319. <el-input ref="bw" v-model="nutritional.tab1.temp.bw" class="filter-item" placeholder="" style="width:100%;" />
  320. </el-form-item>
  321. </el-col>
  322. <el-col :span="4">
  323. <el-form-item label="日增重(kg)" prop="dayw">
  324. <el-input ref="dayw" v-model="nutritional.tab1.temp.dayw" class="filter-item" placeholder="" style="width:100%;" />
  325. </el-form-item>
  326. </el-col>
  327. <el-col :span="4">
  328. <el-form-item label="胎次(次)" prop="fetal">
  329. <el-input ref="fetal" v-model="nutritional.tab1.temp.fetal" class="filter-item" placeholder="" style="width:100%;" />
  330. </el-form-item>
  331. </el-col>
  332. <el-col :span="4">
  333. <el-form-item label="泌乳天数(天)" prop="avgdim">
  334. <el-input ref="avgdim" v-model="nutritional.tab1.temp.avgdim" class="filter-item" placeholder="" style="width:100%;" />
  335. </el-form-item>
  336. </el-col>
  337. </el-row>
  338. <el-row>
  339. <el-col :span="4">
  340. <el-form-item label="怀孕天数(天)" prop="dayspre">
  341. <el-input ref="dayspre" v-model="nutritional.tab1.temp.dayspre" class="filter-item" placeholder="" style="width:100%;" />
  342. </el-form-item>
  343. </el-col>
  344. <el-col :span="4">
  345. <el-form-item label="产奶量(kg)" prop="product">
  346. <el-input ref="product" v-model="nutritional.tab1.temp.product" class="filter-item" placeholder="" style="width:100%;" />
  347. </el-form-item>
  348. </el-col>
  349. <el-col :span="4">
  350. <el-form-item label="乳脂率(%)" prop="fat">
  351. <el-input ref="fat" v-model="nutritional.tab1.temp.fat" class="filter-item" placeholder="" style="width:100%;" />
  352. </el-form-item>
  353. </el-col>
  354. <el-col :span="4">
  355. <el-form-item label="乳蛋白率(%)" prop="pro">
  356. <el-input ref="pro" v-model="nutritional.tab1.temp.pro" class="filter-item" placeholder="" style="width:100%;" />
  357. </el-form-item>
  358. </el-col>
  359. <el-col :span="4">
  360. <el-form-item label="乳糖率(%)" prop="lactose">
  361. <el-input ref="lactose" v-model="nutritional.tab1.temp.lactose" class="filter-item" placeholder="" style="width:100%;" />
  362. </el-form-item>
  363. </el-col>
  364. <el-col :span="4">
  365. <el-form-item label="温度(℃)" prop="tem">
  366. <el-input ref="tem" v-model="nutritional.tab1.temp.tem" class="filter-item" placeholder="" style="width:100%;" />
  367. </el-form-item>
  368. </el-col>
  369. </el-row>
  370. </el-form>
  371. <div style="height: 50px;">
  372. <el-date-picker v-model="nutritional.tab1.inputDatetime" :picker-options="pickerOptions" class="inputDatetime filter-item" :clearable="false" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;margin-right: 10px;" />
  373. <el-button class="el-icon-arrow-left elIconArrowLeft" @click="handleBefore" />
  374. <el-button class="el-icon-arrow-right elIconArrowRight" @click="handleNext" />
  375. <el-button class="successBorder" :disabled="isokDisable" @click="assessmentData()">评估</el-button>
  376. </div>
  377. <div class="table">
  378. <el-table
  379. :key="nutritional.tab1.tableKey"
  380. v-loading="nutritional.tab1.listLoading"
  381. element-loading-text="给我一点时间"
  382. :data="nutritional.tab1.list"
  383. border
  384. fit
  385. highlight-current-row
  386. style="width: 100%;margin-bottom:60px;"
  387. :row-style="rowStyle"
  388. :cell-style="cellStyle"
  389. class="elTable table-fixed"
  390. :row-class-name="tableRowClassName"
  391. >
  392. <el-table-column label="序号" align="center" type="index" width="50px" />
  393. <el-table-column label="指标" min-width="130px" align="center">
  394. <template slot-scope="scope">
  395. <span>{{ scope.row.standard }}</span>
  396. </template>
  397. </el-table-column>
  398. <el-table-column label="奶牛需要" min-width="130px" align="center">
  399. <template slot-scope="scope">
  400. <span>{{ scope.row.cowneed }}</span>
  401. </template>
  402. </el-table-column>
  403. <el-table-column label="配方量" min-width="130px" align="center">
  404. <template slot-scope="scope">
  405. <span>{{ scope.row.ftpro }}</span>
  406. </template>
  407. </el-table-column>
  408. <el-table-column label="TMR料" min-width="130px" align="center">
  409. <template slot-scope="scope">
  410. <span>{{ scope.row.hprov }}</span>
  411. </template>
  412. </el-table-column>
  413. <el-table-column label="采食量" min-width="130px" align="center">
  414. <template slot-scope="scope">
  415. <span>{{ scope.row.sprov }}</span>
  416. </template>
  417. </el-table-column>
  418. </el-table>
  419. </div>
  420. </el-tab-pane>
  421. <el-tab-pane label="牛群评估" name="second">
  422. <el-date-picker v-model="nutritional.tab2.inputDatetime" :picker-options="pickerOptions" :clearable="false" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;margin-right: 10px;" @change="changeTab2Date" />
  423. <el-button class="el-icon-arrow-left elIconArrowLeft" @click="handleBefore" />
  424. <el-button class="el-icon-arrow-right elIconArrowRight" @click="handleNext" />
  425. <el-row>
  426. <el-col :span="24">
  427. <h3 style="text-align: center;">宾州筛分析</h3>
  428. <div class="table">
  429. <el-table
  430. :key="nutritional.tab2.tableKey1"
  431. v-loading="nutritional.tab2.listLoading1"
  432. element-loading-text="给我一点时间"
  433. :data="nutritional.tab2.list1"
  434. border
  435. fit
  436. highlight-current-row
  437. style="width: 100%;margin-bottom:60px;"
  438. :row-style="rowStyle"
  439. :cell-style="cellStyle"
  440. class="elTable table-fixed"
  441. >
  442. <el-table-column label="日期" min-width="130px" align="center">
  443. <template slot-scope="scope">
  444. <span>{{ scope.row.operatetime }}</span>
  445. </template>
  446. </el-table-column>
  447. <el-table-column label="第一层重量(g)" min-width="130px" align="center">
  448. <template slot-scope="scope">
  449. <span>{{ scope.row.oneweight }}</span>
  450. </template>
  451. </el-table-column>
  452. <el-table-column label="第一层百分比" min-width="130px" align="center">
  453. <template slot-scope="scope">
  454. <span>{{ scope.row.onerate }}</span>
  455. </template>
  456. </el-table-column>
  457. <el-table-column label="第二层重量(g)" min-width="130px" align="center">
  458. <template slot-scope="scope">
  459. <span>{{ scope.row.twoweight }}</span>
  460. </template>
  461. </el-table-column>
  462. <el-table-column label="第二层百分比" min-width="130px" align="center">
  463. <template slot-scope="scope">
  464. <span>{{ scope.row.tworate }}</span>
  465. </template>
  466. </el-table-column>
  467. <el-table-column label="第三层重量(g)" min-width="130px" align="center">
  468. <template slot-scope="scope">
  469. <span>{{ scope.row.threeweight }}</span>
  470. </template>
  471. </el-table-column>
  472. <el-table-column label="第三层百分比" min-width="130px" align="center">
  473. <template slot-scope="scope">
  474. <span>{{ scope.row.threerate }}</span>
  475. </template>
  476. </el-table-column>
  477. <el-table-column label="第四层重量(g)" min-width="130px" align="center">
  478. <template slot-scope="scope">
  479. <span>{{ scope.row.fourweight }}</span>
  480. </template>
  481. </el-table-column>
  482. <el-table-column label="第四层百分比" min-width="130px" align="center">
  483. <template slot-scope="scope">
  484. <span>{{ scope.row.fourrate }}</span>
  485. </template>
  486. </el-table-column>
  487. <el-table-column label="参考标准" min-width="130px" align="center">
  488. <template slot-scope="scope">
  489. <span>{{ scope.row.standard }}</span>
  490. </template>
  491. </el-table-column>
  492. </el-table>
  493. </div>
  494. </el-col>
  495. </el-row>
  496. <el-row>
  497. <el-col :span="24">
  498. <h3 style="text-align: center;">粪便筛分析</h3>
  499. <div class="table">
  500. <el-table
  501. :key="nutritional.tab2.tableKey2"
  502. v-loading="nutritional.tab2.listLoading2"
  503. element-loading-text="给我一点时间"
  504. :data="nutritional.tab2.list2"
  505. border
  506. fit
  507. highlight-current-row
  508. style="width: 100%;margin-bottom:60px;"
  509. :row-style="rowStyle"
  510. :cell-style="cellStyle"
  511. class="elTable table-fixed"
  512. >
  513. <el-table-column label="日期" min-width="130px" align="center">
  514. <template slot-scope="scope">
  515. <span>{{ scope.row.operatetime }}</span>
  516. </template>
  517. </el-table-column>
  518. <el-table-column label="第一层重量(g)" min-width="130px" align="center">
  519. <template slot-scope="scope">
  520. <span>{{ scope.row.oneweight }}</span>
  521. </template>
  522. </el-table-column>
  523. <el-table-column label="第一层百分比" min-width="130px" align="center">
  524. <template slot-scope="scope">
  525. <span>{{ scope.row.onerate }}</span>
  526. </template>
  527. </el-table-column>
  528. <el-table-column label="第二层重量(g)" min-width="130px" align="center">
  529. <template slot-scope="scope">
  530. <span>{{ scope.row.twoweight }}</span>
  531. </template>
  532. </el-table-column>
  533. <el-table-column label="第二层百分比" min-width="130px" align="center">
  534. <template slot-scope="scope">
  535. <span>{{ scope.row.tworate }}</span>
  536. </template>
  537. </el-table-column>
  538. <el-table-column label="第三层重量(g)" min-width="130px" align="center">
  539. <template slot-scope="scope">
  540. <span>{{ scope.row.threeweight }}</span>
  541. </template>
  542. </el-table-column>
  543. <el-table-column label="第三层百分比" min-width="130px" align="center">
  544. <template slot-scope="scope">
  545. <span>{{ scope.row.threerate }}</span>
  546. </template>
  547. </el-table-column>
  548. <el-table-column label="参考标准" min-width="130px" align="center">
  549. <template slot-scope="scope">
  550. <span>{{ scope.row.standard }}</span>
  551. </template>
  552. </el-table-column>
  553. </el-table>
  554. </div>
  555. </el-col>
  556. </el-row>
  557. <el-row>
  558. <el-col :span="24">
  559. <h3 style="text-align: center;">BCS评分</h3>
  560. <div class="table">
  561. <el-table
  562. :key="nutritional.tab2.tableKey3"
  563. v-loading="nutritional.tab2.listLoading3"
  564. element-loading-text="给我一点时间"
  565. :data="nutritional.tab2.list3"
  566. border
  567. fit
  568. highlight-current-row
  569. style="width: 100%;margin-bottom:60px;"
  570. :row-style="rowStyle"
  571. :cell-style="cellStyle"
  572. class="elTable table-fixed"
  573. >
  574. <el-table-column label="日期" min-width="130px" align="center">
  575. <template slot-scope="scope">
  576. <span>{{ scope.row.operatetime }}</span>
  577. </template>
  578. </el-table-column>
  579. <el-table-column label="抽查样本数" min-width="130px" align="center">
  580. <template slot-scope="scope">
  581. <span>{{ scope.row.sumcowcount }}</span>
  582. </template>
  583. </el-table-column>
  584. <el-table-column label="单产(kg/头)" min-width="130px" align="center">
  585. <template slot-scope="scope">
  586. <span>{{ scope.row.product }}</span>
  587. </template>
  588. </el-table-column>
  589. <el-table-column label="干物质采食量(kg/头)" min-width="130px" align="center">
  590. <template slot-scope="scope">
  591. <span>{{ scope.row.cowneed }}</span>
  592. </template>
  593. </el-table-column>
  594. <el-table-column label="泌乳天数" min-width="130px" align="center">
  595. <template slot-scope="scope">
  596. <span>{{ scope.row.avgdim }}</span>
  597. </template>
  598. </el-table-column>
  599. <el-table-column label="标准分数" min-width="130px" align="center">
  600. <template slot-scope="scope">
  601. <span>{{ scope.row.standardscore }}</span>
  602. </template>
  603. </el-table-column>
  604. <el-table-column label="2.75-分(数量、百分比)" min-width="130px" align="center">
  605. <template slot-scope="scope">
  606. <span>{{ scope.row.score25 }}({{ scope.row.score25rate }}%)</span>
  607. </template>
  608. </el-table-column>
  609. <el-table-column label="2.75分(数量、百分比)" min-width="130px" align="center">
  610. <template slot-scope="scope">
  611. <span>{{ scope.row.score275 }}({{ scope.row.score275rate }}%)</span>
  612. </template>
  613. </el-table-column>
  614. <el-table-column label="3分(数量、百分比)" min-width="130px" align="center">
  615. <template slot-scope="scope">
  616. <span>{{ scope.row.score3 }}({{ scope.row.score3rate }}%)</span>
  617. </template>
  618. </el-table-column>
  619. <el-table-column label="3.25分(数量、百分比)" min-width="130px" align="center">
  620. <template slot-scope="scope">
  621. <span>{{ scope.row.score325 }}({{ scope.row.score325rate }}%)</span>
  622. </template>
  623. </el-table-column>
  624. <el-table-column label="3.5分(数量、百分比)" min-width="130px" align="center">
  625. <template slot-scope="scope">
  626. <span>{{ scope.row.score35 }}({{ scope.row.score35rate }}%)</span>
  627. </template>
  628. </el-table-column>
  629. <el-table-column label="3.75分(数量、百分比)" min-width="130px" align="center">
  630. <template slot-scope="scope">
  631. <span>{{ scope.row.score375 }}({{ scope.row.score375rate }}%)</span>
  632. </template>
  633. </el-table-column>
  634. <el-table-column label="4+分(数量、百分比)" min-width="130px" align="center">
  635. <template slot-scope="scope">
  636. <span>{{ scope.row.score4 }}({{ scope.row.score4rate }}%)</span>
  637. </template>
  638. </el-table-column>
  639. </el-table>
  640. </div>
  641. </el-col>
  642. </el-row>
  643. <el-row>
  644. <el-col :span="24">
  645. <h3 style="text-align: center;">粪便评分</h3>
  646. <div class="table">
  647. <el-table
  648. :key="nutritional.tab2.tableKey4"
  649. v-loading="nutritional.tab2.listLoading4"
  650. element-loading-text="给我一点时间"
  651. :data="nutritional.tab2.list4"
  652. border
  653. fit
  654. highlight-current-row
  655. style="width: 100%;margin-bottom:60px;"
  656. :row-style="rowStyle"
  657. :cell-style="cellStyle"
  658. class="elTable table-fixed"
  659. >
  660. <el-table-column label="日期" min-width="130px" align="center">
  661. <template slot-scope="scope">
  662. <span>{{ scope.row.operatetime }}</span>
  663. </template>
  664. </el-table-column>
  665. <el-table-column label="抽查样本数" min-width="130px" align="center">
  666. <template slot-scope="scope">
  667. <span>{{ scope.row.sumcowcount }}</span>
  668. </template>
  669. </el-table-column>
  670. <el-table-column label="单产(kg/头)" min-width="130px" align="center">
  671. <template slot-scope="scope">
  672. <span>{{ scope.row.product }}</span>
  673. </template>
  674. </el-table-column>
  675. <el-table-column label="干物质采食量(kg/头)" min-width="130px" align="center">
  676. <template slot-scope="scope">
  677. <span>{{ scope.row.cowneed }}</span>
  678. </template>
  679. </el-table-column>
  680. <el-table-column label="泌乳天数" min-width="130px" align="center">
  681. <template slot-scope="scope">
  682. <span>{{ scope.row.avgdim }}</span>
  683. </template>
  684. </el-table-column>
  685. <el-table-column label="标准分数" min-width="130px" align="center">
  686. <template slot-scope="scope">
  687. <span>{{ scope.row.cowneed }}</span>
  688. </template>
  689. </el-table-column>
  690. <el-table-column label="1分(数量、百分比)" min-width="130px" align="center">
  691. <template slot-scope="scope">
  692. <span>{{ scope.row.score1 }}({{ scope.row.score1rate }}%)</span>
  693. </template>
  694. </el-table-column>
  695. <el-table-column label="2分(数量、百分比)" min-width="130px" align="center">
  696. <template slot-scope="scope">
  697. <span>{{ scope.row.score2 }}({{ scope.row.score2rate }}%)</span>
  698. </template>
  699. </el-table-column>
  700. <el-table-column label="3分(数量、百分比)" min-width="130px" align="center">
  701. <template slot-scope="scope">
  702. <span>{{ scope.row.score3 }}({{ scope.row.score3rate }}%)</span>
  703. </template>
  704. </el-table-column>
  705. <el-table-column label="4分(数量、百分比)" min-width="130px" align="center">
  706. <template slot-scope="scope">
  707. <span>{{ scope.row.score4 }}({{ scope.row.score4rate }}%)</span>
  708. </template>
  709. </el-table-column>
  710. <el-table-column label="5分(数量、百分比)" min-width="130px" align="center">
  711. <template slot-scope="scope">
  712. <span>{{ scope.row.score5 }}({{ scope.row.score5rate }}%)</span>
  713. </template>
  714. </el-table-column>
  715. </el-table>
  716. </div>
  717. </el-col>
  718. </el-row>
  719. </el-tab-pane>
  720. </el-tabs>
  721. <div slot="footer" class="dialog-footer">
  722. <el-button class="cancelClose cancelClose1" @click="nutritional.dialogFormVisible = false; ">关闭</el-button>
  723. </div>
  724. </div>
  725. </el-dialog>
  726. <!-- 干物质调节 -->
  727. <DryMatterRegulation ref="mychild" :show.sync="isShowDialog" @getIsDisplay="getIsDisplay" />
  728. </div>
  729. </template>
  730. <script>
  731. import { GetDataByName, GETNurJudge, GetDataByNames, compareSort, ExecDataByConfig, failproccess, PostDataByName, formatNum, checkButtons } from '@/api/common'
  732. import Pagination from '@/components/Pagination'
  733. import Pagination2 from '@/components/Pagination2'
  734. import { parseTime, json2excel, handleTableSpan, handleObjectSpanMethod } from '@/utils/index.js'
  735. import { MessageBox } from 'element-ui'
  736. import Cookies from 'js-cookie'
  737. import axios from 'axios'
  738. import { getToken } from '@/utils/auth'
  739. import DryMatterRegulation from './dryMatterRegulation.vue'
  740. export default {
  741. inject: ['reload'],
  742. name: 'DhedFormula',
  743. components: { Pagination, Pagination2, DryMatterRegulation },
  744. data() {
  745. return {
  746. dialogFull: false,
  747. isRoleEdit: [],
  748. headerList: [],
  749. pickerMinDate: '',
  750. pickerOptions: {
  751. onPick: ({ maxDate, minDate }) => {
  752. this.pickerMinDate = minDate.getTime()
  753. if (maxDate) {
  754. this.pickerMinDate = ''
  755. }
  756. },
  757. // 限制不能选择今天之后的日期
  758. disabledDate: (time) => {
  759. if (this.pickerMinDate !== '') {
  760. const one = 31 * 24 * 3600 * 1000
  761. const minTime = this.pickerMinDate - one
  762. let maxTime = this.pickerMinDate + one
  763. if (maxTime > new Date()) {
  764. maxTime = new Date()
  765. }
  766. return time.getTime() < minTime - 8.64e7 || time.getTime() > maxTime - 8.64e7
  767. }
  768. return time.getTime() > Date.now() - 8.64e7
  769. }
  770. },
  771. requestParams: [
  772. { name: 'getFTSWList', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
  773. { name: 'getFTBLList', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
  774. { name: 'getCowclassListEnable', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
  775. { name: 'getBarListEnable', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }}
  776. ],
  777. recipeTemplateList: [], // 配方模板
  778. feedingFormulaList: [], // 补料配方
  779. livestockTypeList: [], // 类别
  780. barList: [],
  781. rules: {
  782. cowclassid: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }]
  783. },
  784. table: {
  785. getdataListParm: {
  786. name: 'getFPList',
  787. page: 1,
  788. offset: 1,
  789. // pagecount: parseInt(Cookies.get('pageCount')),
  790. pagecount: '',
  791. returntype: 'Map',
  792. parammaps: {
  793. pastureid: Cookies.get('pastureid'),
  794. enable: '',
  795. barid: '',
  796. tname: ''
  797. }
  798. },
  799. tableKey: 0,
  800. list: [],
  801. total: 0,
  802. listLoading: true,
  803. temp: {},
  804. rwList: [],
  805. isPtsfname: false, // 补料配方/补料重量
  806. getdataListParm2: {
  807. name: 'getSysoptEnable',
  808. page: 1,
  809. offset: 1,
  810. pagecount: 1,
  811. returntype: 'Map',
  812. parammaps: {
  813. pastureid: Cookies.get('pastureid'),
  814. inforname: 'isEnableSupplyFeed'
  815. }
  816. },
  817. isRW1: false, // 第一班
  818. isRW2: false, // 第二班
  819. isRW3: false, // 第三班
  820. isRW4: false, // 第四班
  821. getdataListParm3: {
  822. name: 'getSysoptEnable1',
  823. page: 1,
  824. offset: 1,
  825. pagecount: 1,
  826. returntype: 'Map',
  827. parammaps: {
  828. pastureid: Cookies.get('pastureid'),
  829. inforname: 'times'
  830. }
  831. },
  832. RWLength: '' // 班次长度
  833. },
  834. selectList: [],
  835. // 营养评估
  836. nutritional: {
  837. dialogFormVisible: false,
  838. dialogStatus: '',
  839. activeName: 'first ',
  840. tab1: {
  841. // inputDatetime: [new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 1), new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 1)],
  842. inputDatetime: [new Date(), new Date()],
  843. listLoading1: true,
  844. getdataListParm1: {
  845. name: 'getnurj',
  846. page: 1,
  847. offset: 1,
  848. pagecount: 10,
  849. returntype: 'Map',
  850. parammaps: {
  851. pastureid: '',
  852. barid: ''
  853. }
  854. },
  855. disabledCowclass: false,
  856. temp: {},
  857. tableKey: 0,
  858. list: [],
  859. total: 0,
  860. listLoading2: true,
  861. getdataListParm2: {
  862. name: 'GETNurJudge',
  863. page: 1,
  864. offset: 1,
  865. pagecount: 10,
  866. returntype: 'Map',
  867. parammaps: {
  868. pastureid: '',
  869. cowclassid: ''
  870. }
  871. }
  872. },
  873. tab2: {
  874. // inputDatetime: [new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 1), new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 1)],
  875. inputDatetime: [new Date(), new Date()],
  876. listLoading1: true,
  877. tableKey1: 0,
  878. list1: [],
  879. total1: 0,
  880. getdataListParm1: {
  881. name: 'getPennsieveList',
  882. page: 1,
  883. offset: 1,
  884. pagecount: 10,
  885. returntype: 'Map',
  886. parammaps: {
  887. pastureid: '',
  888. barid: '',
  889. startTime: '',
  890. stopTime: '',
  891. inputDatetime: ''
  892. }
  893. },
  894. listLoading2: true,
  895. tableKey2: 0,
  896. list2: [],
  897. total2: 0,
  898. getdataListParm2: {
  899. name: 'getDungsieveList',
  900. page: 1,
  901. offset: 1,
  902. pagecount: 10,
  903. returntype: 'Map',
  904. parammaps: {
  905. pastureid: '',
  906. barid: '',
  907. startTime: '',
  908. stopTime: '',
  909. inputDatetime: ''
  910. }
  911. },
  912. listLoading3: true,
  913. tableKey3: 0,
  914. list3: [],
  915. total3: 0,
  916. getdataListParm3: {
  917. name: 'getBodyscoreList',
  918. page: 1,
  919. offset: 1,
  920. pagecount: 10,
  921. returntype: 'Map',
  922. parammaps: {
  923. pastureid: '',
  924. barid: '',
  925. startTime: '',
  926. stopTime: '',
  927. inputDatetime: ''
  928. }
  929. },
  930. listLoading4: true,
  931. tableKey4: 0,
  932. list4: [],
  933. total4: 0,
  934. getdataListParm4: {
  935. name: 'getDungscoreList',
  936. page: 1,
  937. offset: 1,
  938. pagecount: 10,
  939. returntype: 'Map',
  940. parammaps: {
  941. pastureid: '',
  942. barid: '',
  943. startTime: '',
  944. stopTime: '',
  945. inputDatetime: ''
  946. }
  947. }
  948. }
  949. },
  950. history: {
  951. dialogFormVisible: false,
  952. dialogStatus: '',
  953. temp: {},
  954. rules: {},
  955. tableKey: 0,
  956. list: [],
  957. total: 0,
  958. listLoading: true,
  959. getdataListParm: {
  960. name: 'getPlanModifyFPlist',
  961. page: 1,
  962. offset: 1,
  963. pagecount: 12,
  964. returntype: 'Map',
  965. parammaps: {
  966. pastureid: Cookies.get('pastureid'),
  967. date: '',
  968. barid: '',
  969. tname: ''
  970. }
  971. },
  972. isPtsfname: false, // 补料配方/补料重量
  973. getdataListParm2: {
  974. name: 'getSysoptEnable',
  975. page: 1,
  976. offset: 1,
  977. pagecount: 1,
  978. returntype: 'Map',
  979. parammaps: {
  980. pastureid: Cookies.get('pastureid'),
  981. inforname: 'isEnableSupplyFeed'
  982. }
  983. },
  984. isRW1: false, // 第一班
  985. isRW2: false, // 第二班
  986. isRW3: false, // 第三班
  987. isRW4: false, // 第四班
  988. getdataListParm3: {
  989. name: 'getSysoptEnable1',
  990. page: 1,
  991. offset: 1,
  992. pagecount: 1,
  993. returntype: 'Map',
  994. parammaps: {
  995. pastureid: Cookies.get('pastureid'),
  996. inforname: 'times'
  997. }
  998. },
  999. getdataDateParm: {
  1000. name: 'getFPMaxDate',
  1001. page: 1,
  1002. offset: 1,
  1003. pagecount: 10,
  1004. returntype: 'Map',
  1005. parammaps: {
  1006. pastureid: Cookies.get('pastureid')
  1007. }
  1008. }
  1009. },
  1010. textMap: {
  1011. Nutritional: '营养评估',
  1012. history: '历史记录'
  1013. },
  1014. focusWRow: {}, // 一班重量得到焦点暂存
  1015. focusWRow2: {}, // 2班重量得到焦点暂存
  1016. focusWRow3: {}, // 3班重量得到焦点暂存
  1017. focusWRow4: {}, // 4班重量得到焦点暂存
  1018. requestParam: {},
  1019. download: {
  1020. getdataListParm: {
  1021. name: 'getFPList',
  1022. page: 1,
  1023. offset: 1,
  1024. pagecount: 0,
  1025. returntype: 'Map',
  1026. parammaps: {
  1027. pastureid: Cookies.get('pastureid'),
  1028. enable: ''
  1029. }
  1030. },
  1031. list: []
  1032. },
  1033. spanObj: {},
  1034. mergekeys: ['barname', 'sumweight'],
  1035. isShowDialog: false,
  1036. isokDisable: false,
  1037. rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
  1038. cellStyle: { padding: 0 + 'px' },
  1039. myHeight: document.documentElement.clientHeight - 85 - 140
  1040. }
  1041. },
  1042. computed: {
  1043. // 设置请求头
  1044. headers() {
  1045. return {
  1046. token: getToken()
  1047. }
  1048. },
  1049. uploadData() {
  1050. return {
  1051. name: 'checkbarname,checkftsw,checkftbl,updateBigFPUpload,updateBigFPfeedweightUpload,updateBigFPDetailUpload,updateBigFPDetailUploadV1,updateBigFPDetailUploadV2,updateBigFPDetailUploadV3',
  1052. importParams: '栏舍名称,实际牛头数,系数(%),配方模板,补料配方,第一班比例(%),第二班比例(%),第三班比例(%)',
  1053. sheetname: 'Sheet1',
  1054. // 登录牧场
  1055. pastureid: Cookies.get('pastureid'),
  1056. // 日期参数
  1057. dateParams: '',
  1058. // 必填参数
  1059. requiredParams: '栏舍名称,实际牛头数,系数(%),配方模板,',
  1060. // 为数值的参数
  1061. numParams: '实际牛头数,系数(%),第一班比例(%),第二班比例(%),第三班比例(%),,第四班比例(%)'
  1062. }
  1063. },
  1064. // 设置上传地址
  1065. uploadExcelUrl() {
  1066. return process.env.VUE_APP_BASE_API + 'authdata/ImportExcel'
  1067. }
  1068. },
  1069. created() {
  1070. this.getButtons()
  1071. this.getDownList()
  1072. },
  1073. methods: {
  1074. getButtons() {
  1075. const Edit = 'DhedFormula'
  1076. const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
  1077. this.isRoleEdit = isRoleEdit
  1078. },
  1079. getDownList() {
  1080. GetDataByNames(this.requestParams).then(response => {
  1081. this.recipeTemplateList = response.data.getFTSWList.list
  1082. this.feedingFormulaList = response.data.getFTBLList.list
  1083. this.livestockTypeList = response.data.getCowclassListEnable.list
  1084. this.barList = response.data.getBarListEnable.list
  1085. this.getIsDisplay()
  1086. })
  1087. },
  1088. getIsDisplay() {
  1089. GetDataByName(this.table.getdataListParm2).then(response => {
  1090. console.log(response.data.list[0].inforvalue)
  1091. if (response.data.list !== null) {
  1092. if (response.data.list[0].inforvalue == 0) {
  1093. this.table.isPtsfname = false
  1094. } else {
  1095. this.table.isPtsfname = true
  1096. }
  1097. }
  1098. })
  1099. GetDataByName(this.table.getdataListParm3).then(response => {
  1100. console.log(response.data.list[0].inforvalue)
  1101. if (response.data.list !== null) {
  1102. this.table.RWLength = response.data.list[0].inforvalue
  1103. if (response.data.list[0].inforvalue == 1) {
  1104. this.table.isRW1 = true
  1105. this.table.isRW2 = false
  1106. this.table.isRW3 = false
  1107. this.table.isRW4 = false
  1108. } else if (response.data.list[0].inforvalue == 2) {
  1109. this.table.isRW1 = true
  1110. this.table.isRW2 = true
  1111. this.table.isRW3 = false
  1112. this.table.isRW4 = false
  1113. } else if (response.data.list[0].inforvalue == 3) {
  1114. this.table.isRW1 = true
  1115. this.table.isRW2 = true
  1116. this.table.isRW3 = true
  1117. this.table.isRW4 = false
  1118. } else if (response.data.list[0].inforvalue == 4) {
  1119. this.table.isRW1 = true
  1120. this.table.isRW2 = true
  1121. this.table.isRW3 = true
  1122. this.table.isRW4 = true
  1123. }
  1124. } else {
  1125. this.table.isRW1 = false
  1126. this.table.isRW2 = false
  1127. this.table.isRW3 = false
  1128. this.table.isRW4 = false
  1129. }
  1130. })
  1131. this.getList()
  1132. },
  1133. getList() {
  1134. this.table.listLoading = true
  1135. GetDataByName(this.table.getdataListParm).then(response => {
  1136. console.log('table数据', response.data.list)
  1137. if (response.data.list !== null) {
  1138. for (let i = 0; i < response.data.list.length; i++) {
  1139. this.$set(response.data.list[i], 'Edit', false) // 编辑
  1140. this.$set(response.data.list[i], 'NoEdit', true) // 不可编辑/输入
  1141. this.$set(response.data.list[i], 'isUpdate', true) // 编辑操作
  1142. this.$set(response.data.list[i], 'isUpdateSave', false) // 编辑保存
  1143. if (response.data.list[i].ftid !== undefined && response.data.list[i].ftid !== '') {
  1144. if (this.recipeTemplateList.find(obj => obj.id == response.data.list[i].ftid) !== undefined) {
  1145. this.$set(response.data.list[i], 'dryweight', this.recipeTemplateList.find(obj => obj.id == response.data.list[i].ftid).dryweight) // 编辑保存
  1146. } else {
  1147. this.$set(response.data.list[i], 'dryweight', '')
  1148. }
  1149. }
  1150. if (response.data.list[i].ftid == undefined || response.data.list[i].ftname == '') {
  1151. this.$set(response.data.list[i], 'ftid', '')
  1152. this.$set(response.data.list[i], 'ftname', '')
  1153. }
  1154. if (response.data.list[i].ptsfid == undefined || response.data.list[i].ptsfname == '') {
  1155. this.$set(response.data.list[i], 'ptsfid', '')
  1156. this.$set(response.data.list[i], 'ptsfname', '')
  1157. }
  1158. if (response.data.list[i].ccount == undefined) {
  1159. this.$set(response.data.list[i], 'ccount', '')
  1160. }
  1161. if (response.data.list[i].softccount == undefined) {
  1162. this.$set(response.data.list[i], 'softccount', '')
  1163. }
  1164. if (response.data.list[i].ratio == undefined) {
  1165. this.$set(response.data.list[i], 'ratio', 100)
  1166. }
  1167. if (response.data.list[i].ccountratio == undefined) {
  1168. this.$set(response.data.list[i], 'ccountratio', '')
  1169. }
  1170. if (response.data.list[i].r1 == undefined) {
  1171. this.$set(response.data.list[i], 'r1', '')
  1172. }
  1173. if (response.data.list[i].r2 == undefined) {
  1174. this.$set(response.data.list[i], 'r2', '')
  1175. }
  1176. if (response.data.list[i].r3 == undefined) {
  1177. this.$set(response.data.list[i], 'r3', '')
  1178. }
  1179. if (response.data.list[i].r4 == undefined) {
  1180. this.$set(response.data.list[i], 'r4', '')
  1181. }
  1182. if (response.data.list[i].w1 == undefined) {
  1183. this.$set(response.data.list[i], 'w1', '')
  1184. }
  1185. if (response.data.list[i].w2 == undefined) {
  1186. this.$set(response.data.list[i], 'w2', '')
  1187. }
  1188. if (response.data.list[i].w3 == undefined) {
  1189. this.$set(response.data.list[i], 'w3', '')
  1190. }
  1191. if (response.data.list[i].w4 == undefined) {
  1192. this.$set(response.data.list[i], 'w4', '')
  1193. }
  1194. if (response.data.list[i].supplyweight == undefined) {
  1195. this.$set(response.data.list[i], 'supplyweight', '')
  1196. }
  1197. if (response.data.list[i].feedweight == undefined) {
  1198. this.$set(response.data.list[i], 'feedweight', '')
  1199. }
  1200. this.$set(response.data.list[i], 'dailyWeight', '')
  1201. if (response.data.list[i].Bfweight == undefined) {
  1202. this.$set(response.data.list[i], 'Bfweight', '')
  1203. }
  1204. if (response.data.list[i].Sfweight == undefined) {
  1205. this.$set(response.data.list[i], 'Sfweight', '')
  1206. }
  1207. if (response.data.list[i].isOneWeight == undefined) {
  1208. this.$set(response.data.list[i], 'isOneWeight', false)
  1209. }
  1210. if (response.data.list[i].isTwoWeight == undefined) {
  1211. this.$set(response.data.list[i], 'isTwoWeight', false)
  1212. }
  1213. if (response.data.list[i].isThreeWeight == undefined) {
  1214. this.$set(response.data.list[i], 'isThreeWeight', false)
  1215. }
  1216. if (response.data.list[i].isFourWeight == undefined) {
  1217. this.$set(response.data.list[i], 'isFourWeight', false)
  1218. }
  1219. if (response.data.list[i].timesopt !== undefined) {
  1220. var timesoptArr = response.data.list[i].timesopt.split(',')
  1221. for (let j = 0; j < timesoptArr.length; j++) {
  1222. response.data.list[i]['r' + timesoptArr[j].split(':')[0]] = timesoptArr[j].split(':')[1]
  1223. response.data.list[i]['w' + timesoptArr[j].split(':')[0]] = timesoptArr[j].split(':')[2]
  1224. }
  1225. }
  1226. if (response.data.list[i].bw1 == undefined) {
  1227. this.$set(response.data.list[i], 'bw1', '')
  1228. }
  1229. if (response.data.list[i].bw2 == undefined) {
  1230. this.$set(response.data.list[i], 'bw2', '')
  1231. }
  1232. if (response.data.list[i].bw3 == undefined) {
  1233. this.$set(response.data.list[i], 'bw3', '')
  1234. }
  1235. if (response.data.list[i].bw4 == undefined) {
  1236. this.$set(response.data.list[i], 'bw4', '')
  1237. }
  1238. if (response.data.list[i].supplement !== undefined) {
  1239. var supplementArr = response.data.list[i].supplement.split(',')
  1240. for (let j = 0; j < supplementArr.length; j++) {
  1241. response.data.list[i]['bw' + supplementArr[j].split(':')[0]] = supplementArr[j].split(':')[2]
  1242. }
  1243. }
  1244. }
  1245. // console.log(response.data.list, sumr)
  1246. for (let i = 0; i < response.data.list.length; i++) {
  1247. if (response.data.list[i].r1 == '') {
  1248. response.data.list[i].r1 = 0
  1249. response.data.list[i].w1 = 0
  1250. }
  1251. if (response.data.list[i].r2 == '') {
  1252. response.data.list[i].r2 = 0
  1253. response.data.list[i].w2 = 0
  1254. }
  1255. if (response.data.list[i].r3 == '') {
  1256. response.data.list[i].r3 = 0
  1257. response.data.list[i].w3 = 0
  1258. }
  1259. if (response.data.list[i].r4 == '') {
  1260. response.data.list[i].r4 = 0
  1261. response.data.list[i].w4 = 0
  1262. }
  1263. this.$set(response.data.list[i], 'sumr', parseFloat(response.data.list[i].r1) + parseFloat(response.data.list[i].r2) + parseFloat(response.data.list[i].r3) + parseFloat(response.data.list[i].r4))
  1264. response.data.list[i].sumr = formatNum(response.data.list[i].sumr, parseInt(Cookies.get('decimal')))
  1265. // this.$set(response.data.list[i],'feedweight',formatNum(parseFloat(response.data.list[i].feedweight) * parseFloat(response.data.list[i].sumr)/100,2))
  1266. this.$set(response.data.list[i], 'dailyWeight', parseFloat(response.data.list[i].w1) + parseFloat(response.data.list[i].w2) + parseFloat(response.data.list[i].w3) + parseFloat(response.data.list[i].w4))
  1267. response.data.list[i].dailyWeight = formatNum(response.data.list[i].dailyWeight, parseInt(Cookies.get('decimal')))
  1268. }
  1269. this.table.list = response.data.list
  1270. console.log(this.table.list, 'this.table.list')
  1271. this.table.pageNum = response.data.pageNum
  1272. this.table.pageSize = response.data.pageSize
  1273. this.table.total = response.data.total
  1274. } else {
  1275. this.table.list = []
  1276. }
  1277. setTimeout(() => {
  1278. this.table.listLoading = false
  1279. }, 100)
  1280. })
  1281. },
  1282. handleSearch() {
  1283. this.getList()
  1284. },
  1285. renderHeader(h, { column, $index }) { // h即为cerateElement的简写,具体可看vue官方文档
  1286. return h(
  1287. 'div',
  1288. [
  1289. h('span', column.label),
  1290. h('i', {
  1291. class: 'el-icon-unlock',
  1292. ref: 'el-icon-unlock',
  1293. style: 'margin-left:5px;'
  1294. })
  1295. ]
  1296. )
  1297. },
  1298. headerClick(column, event) {
  1299. console.log(column, event)
  1300. this.headerList.push(event)
  1301. if (column.label == '第一班重量') {
  1302. for (let i = 0; i < this.table.list.length; i++) {
  1303. if (this.table.list[i].Edit == true) {
  1304. if (event.target.outerHTML == '<i class="el-icon-unlock" style="margin-left: 5px;"></i>') {
  1305. event.target.className = 'el-icon-lock'
  1306. this.$set(this.table.list[i], 'isOneWeight', true) // 锁住不可编辑
  1307. } else if (event.target.outerHTML == '<i class="el-icon-lock" style="margin-left: 5px;"></i>') {
  1308. event.target.className = 'el-icon-unlock'
  1309. this.$set(this.table.list[i], 'isOneWeight', false) // 解锁可编辑
  1310. }
  1311. }
  1312. }
  1313. } else if (column.label == '第二班重量') {
  1314. for (let i = 0; i < this.table.list.length; i++) {
  1315. if (this.table.list[i].Edit == true) {
  1316. if (event.target.outerHTML == '<i class="el-icon-unlock" style="margin-left: 5px;"></i>') {
  1317. event.target.className = 'el-icon-lock'
  1318. this.$set(this.table.list[i], 'isTwoWeight', true) // 锁住不可编辑
  1319. } else if (event.target.outerHTML == '<i class="el-icon-lock" style="margin-left: 5px;"></i>') {
  1320. event.target.className = 'el-icon-unlock'
  1321. this.$set(this.table.list[i], 'isTwoWeight', false) // 解锁可编辑
  1322. }
  1323. }
  1324. }
  1325. } else if (column.label == '第三班重量') {
  1326. for (let i = 0; i < this.table.list.length; i++) {
  1327. if (this.table.list[i].Edit == true) {
  1328. if (event.target.outerHTML == '<i class="el-icon-unlock" style="margin-left: 5px;"></i>') {
  1329. event.target.className = 'el-icon-lock'
  1330. this.$set(this.table.list[i], 'isThreeWeight', true) // 锁住不可编辑
  1331. } else if (event.target.outerHTML == '<i class="el-icon-lock" style="margin-left: 5px;"></i>') {
  1332. event.target.className = 'el-icon-unlock'
  1333. this.$set(this.table.list[i], 'isThreeWeight', false) // 解锁可编辑
  1334. }
  1335. }
  1336. }
  1337. } else if (column.label == '第四班重量') {
  1338. for (let i = 0; i < this.table.list.length; i++) {
  1339. if (this.table.list[i].Edit == true) {
  1340. if (event.target.outerHTML == '<i class="el-icon-unlock" style="margin-left: 5px;"></i>') {
  1341. event.target.className = 'el-icon-lock'
  1342. this.$set(this.table.list[i], 'isFourWeight', true) // 锁住不可编辑
  1343. } else if (event.target.outerHTML == '<i class="el-icon-lock" style="margin-left: 5px;"></i>') {
  1344. event.target.className = 'el-icon-unlock'
  1345. this.$set(this.table.list[i], 'isFourWeight', false) // 解锁可编辑
  1346. }
  1347. }
  1348. }
  1349. }
  1350. },
  1351. // 配方模板
  1352. changeRecipeTemplate(item, row) {
  1353. row.myccname = this.recipeTemplateList.find(obj => obj.id == item).ccname
  1354. if (row.bigcowclass !== row.myccname) {
  1355. this.$message({ type: 'warning', message: '所选配方模板牲畜类别与栏舍对应牲畜类别不一致', duration: 2000 })
  1356. }
  1357. console.log(row.supplyweight, 'row.supplyweight')
  1358. row.ftname = this.recipeTemplateList.find(obj => obj.id == item).tname
  1359. row.Sfweight = this.recipeTemplateList.find(obj => obj.id == item).Sfweight// Sfweight
  1360. row.SfweightLock = this.recipeTemplateList.find(obj => obj.id == item).SfweightLock// SfweightLock
  1361. row.dryweight = this.recipeTemplateList.find(obj => obj.id == item).dryweight// SfweightLock
  1362. // 补料重量supplyweight
  1363. // 配方重量ftweight
  1364. // 系数头数ccountratio
  1365. // 投喂量feedweight
  1366. // 实际牛头数ccount
  1367. // 投喂量 = 配方重量 + 补料重量
  1368. // 配方重量 = Sfweight * 系数头数 + SfweightLock * 实际牛头数ccount
  1369. console.log(row.Sfweight, 'row.Sfweight')
  1370. console.log(row.ccountratio, '系数头数')
  1371. console.log(row.SfweightLock, 'SfweightLock')
  1372. console.log(row.ccount, '实际牛头数')
  1373. if (row.Sfweight !== '' && row.ccount !== '') {
  1374. this.$set(row, 'ftweight', formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), parseInt(Cookies.get('decimal'))))
  1375. } else {
  1376. row.ftweight = ''
  1377. }
  1378. // console.log(row.ftweight, 'row.ftweight')
  1379. // console.log(row.supplyweight, 'row.supplyweight')
  1380. // console.log(this.table.isPtsfname, 'isPtsfname')
  1381. if (this.table.isPtsfname == false) {
  1382. row.feedweight = formatNum(parseFloat(row.ftweight), parseInt(Cookies.get('decimal')))
  1383. } else {
  1384. if (row.supplyweight == 'NaN') {
  1385. row.supplyweight = 0
  1386. }
  1387. console.log(row.supplyweight)
  1388. if (row.supplyweight !== '' && row.ftweight !== '') {
  1389. row.feedweight = formatNum(parseFloat(row.supplyweight) + parseFloat(row.ftweight), parseInt(Cookies.get('decimal')))
  1390. } else if (row.supplyweight == '' && row.ftweight !== '') {
  1391. row.feedweight = formatNum(parseFloat(row.ftweight), parseInt(Cookies.get('decimal')))
  1392. } else if (row.supplyweight !== '' && row.ftweight !== '') {
  1393. row.feedweight = formatNum(parseFloat(row.supplyweight), parseInt(Cookies.get('decimal')))
  1394. }
  1395. if (row.ccountratio !== '' && row.ftweight !== '') {
  1396. row.ftweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), parseInt(Cookies.get('decimal')))
  1397. }
  1398. if (row.Sfweight !== '' && row.ccount !== '') {
  1399. this.$set(row, 'ftweight', formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), parseInt(Cookies.get('decimal'))))
  1400. } else {
  1401. row.ftweight = ''
  1402. }
  1403. }
  1404. console.log(row.supplyweight)
  1405. if (row.supplyweight == 'NaN') { row.supplyweight = 0 }
  1406. if (row.r1 !== '') { this.$set(row, 'w1', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r1) / 100), parseInt(Cookies.get('decimal')))) }
  1407. if (row.r2 !== '') { this.$set(row, 'w2', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r2) / 100), parseInt(Cookies.get('decimal')))) }
  1408. if (row.r3 !== '') { this.$set(row, 'w3', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r3) / 100), parseInt(Cookies.get('decimal')))) }
  1409. if (row.r4 !== '') { this.$set(row, 'w4', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r4) / 100), parseInt(Cookies.get('decimal')))) }
  1410. if (row.w1 == '') { row.w1 = 0 }
  1411. if (row.w2 == '') { row.w2 = 0 }
  1412. if (row.w3 == '') { row.w3 = 0 }
  1413. if (row.w4 == '') { row.w4 = 0 }
  1414. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  1415. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  1416. },
  1417. // 补料配方
  1418. changeFeedingFormula(item, row) {
  1419. console.log(item, '=========')
  1420. // 补料重量supplyweight
  1421. // 配方重量ftweight
  1422. // 系数头数ccountratio
  1423. // 投喂量feedweight
  1424. // 实际牛头数ccount
  1425. // 投喂量 = 配方重量 + 补料重量
  1426. row.myccname = this.feedingFormulaList.find(obj => obj.id == item).ccname
  1427. if (row.bigcowclass !== row.myccname) {
  1428. this.$message({ type: 'warning', message: '所选补料配方与栏舍对应牲畜类别不一致', duration: 2000 })
  1429. }
  1430. if (item !== '') {
  1431. console.log(456)
  1432. row.ptsfname = this.feedingFormulaList.find(obj => obj.id == item).tname
  1433. row.BLweight = this.feedingFormulaList.find(obj => obj.id == item).Sfweight
  1434. row.BLSfweightLock = this.feedingFormulaList.find(obj => obj.id == item).SfweightLock
  1435. } else {
  1436. row.ptsfname = ''
  1437. row.BLweight = 0
  1438. row.BLSfweightLock = 0
  1439. }
  1440. // 配方重量 = 系数头数 * Sfweight
  1441. // if (row.ccountratio !== '' && row.ftweight !== '') {
  1442. // row.ftweight = parseFloat(row.Sfweight) * parseFloat(row.ccountratio)
  1443. // }
  1444. // 补料重量 = 系数头数 * BLweight
  1445. // console.log(row.ccountratio)
  1446. // console.log(row.ccount)
  1447. // console.log(row.BLweight)
  1448. // console.log(row.BLSfweightLock)
  1449. if (row.ccountratio !== '' && row.ccount !== '' && row.ccount.BLweight !== '' && row.BLSfweightLock !== '') {
  1450. this.$set(row, 'supplyweight', formatNum(parseFloat(row.BLweight) * parseFloat(row.ccountratio) + parseFloat(row.BLSfweightLock) * parseFloat(row.ccount), parseInt(Cookies.get('decimal'))))
  1451. } else {
  1452. row.supplyweight = ''
  1453. }
  1454. if (this.table.isPtsfname == false) {
  1455. row.feedweight = parseFloat(row.ftweight)
  1456. } else {
  1457. if (row.supplyweight !== '' && row.ftweight !== '') {
  1458. row.feedweight = formatNum(parseFloat(row.supplyweight) + parseFloat(row.ftweight), parseInt(Cookies.get('decimal')))
  1459. } else if (row.supplyweight == '' && row.ftweight !== '') {
  1460. row.feedweight = formatNum(parseFloat(row.ftweight), parseInt(Cookies.get('decimal')))
  1461. } else if (row.supplyweight !== '' && row.ftweight == '') {
  1462. row.feedweight = formatNum(parseFloat(row.supplyweight), parseInt(Cookies.get('decimal')))
  1463. }
  1464. // if (row.ccountratio !== '' && row.ftweight !== '') {
  1465. // row.ftweight = parseFloat(row.Sfweight) * parseFloat(row.ccountratio)
  1466. // }
  1467. // if (row.ccountratio !== '' && row.BLweight !== '') {
  1468. // row.supplyweight = parseFloat(row.BLweight) * parseFloat(row.ccountratio)
  1469. // }
  1470. }
  1471. if (row.r1 !== '') { this.$set(row, 'w1', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r1) / 100), parseInt(Cookies.get('decimal')))) }
  1472. if (row.r2 !== '') { this.$set(row, 'w2', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r2) / 100), parseInt(Cookies.get('decimal')))) }
  1473. if (row.r3 !== '') { this.$set(row, 'w3', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r3) / 100), parseInt(Cookies.get('decimal')))) }
  1474. if (row.r4 !== '') { this.$set(row, 'w4', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r4) / 100), parseInt(Cookies.get('decimal')))) }
  1475. if (row.w1 == '') { row.w1 = 0 }
  1476. if (row.w2 == '') { row.w2 = 0 }
  1477. if (row.w3 == '') { row.w3 = 0 }
  1478. if (row.w4 == '') { row.w4 = 0 }
  1479. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  1480. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  1481. },
  1482. // 实际牛头数失去焦点计算
  1483. // ccount实际牛头数
  1484. // ratio系数
  1485. // ccountratio系数牛头数
  1486. blurCcount(row) { // 实际牛头数
  1487. console.log(row)
  1488. if (row.ftid !== '-1' && row.ftid !== '') {
  1489. console.log(this.recipeTemplateList.find(obj => obj.id == row.ftid).Sfweight)
  1490. row.Sfweight = this.recipeTemplateList.find(obj => obj.id == row.ftid).Sfweight
  1491. row.SfweightLock = this.recipeTemplateList.find(obj => obj.id == row.ftid).SfweightLock
  1492. }
  1493. if (row.ptsfid !== '-1' && row.ptsfid !== '' && this.table.isPtsfname == true) {
  1494. // row.ptsfid = parseInt(row.ptsfid)
  1495. row.BLweight = formatNum(parseFloat(this.feedingFormulaList.find(obj => obj.id == row.ptsfid).Sfweight), parseInt(Cookies.get('decimal')))
  1496. row.BLweightLock = formatNum(parseFloat(this.feedingFormulaList.find(obj => obj.id == row.ptsfid).SfweightLock), parseInt(Cookies.get('decimal')))
  1497. }
  1498. if (row.ptsfid == '') {
  1499. row.BLweight = 0
  1500. row.BLweightLock = 0
  1501. }
  1502. if (row.Sfweight !== '' && row.ccount !== '') {
  1503. // console.log(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount))
  1504. row.ftweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), parseInt(Cookies.get('decimal')))
  1505. }
  1506. // 系数牛头数 = 实际牛头数 * 系数/100
  1507. if (row.ccount !== '' && row.ratio !== '') {
  1508. row.ccountratio = formatNum(parseFloat(row.ccount) * parseFloat(row.ratio) / 100, parseInt(Cookies.get('decimal')))
  1509. } else if (row.ratio !== '' && row.ccountratio !== '') {
  1510. row.ccount = formatNum(parseFloat(row.ccountratio) * 100 / parseFloat(row.ratio) / 100, parseInt(Cookies.get('decimal')))
  1511. } else if (row.ccount !== '' || row.ratio !== '') {
  1512. row.ccountratio = ''
  1513. }
  1514. // 补料重量
  1515. console.log(row.ccountratio, row.BLweight)
  1516. if (row.BLweight == 'undefined') {
  1517. this.$set(row, 'BLweight', '')
  1518. }
  1519. console.log('BLweight', row.BLweight)
  1520. console.log('ccountratio', row.ccountratio)
  1521. console.log('BLweightLock', row.BLweightLock)
  1522. console.log('ccount', row.ccount)
  1523. if (row.ccountratio !== '' && row.BLweight !== '') {
  1524. row.supplyweight = formatNum(parseFloat(row.BLweight) * parseFloat(row.ccountratio) + parseFloat(row.BLweightLock) * parseFloat(row.ccount), parseInt(Cookies.get('decimal')))
  1525. } else if (row.ccountratio !== '' && row.BLweight == '') {
  1526. row.supplyweight = ''
  1527. row.feedweight = ''
  1528. } else if (row.ccountratio == '' && row.BLweight !== '') {
  1529. row.supplyweight = ''
  1530. row.feedweight = ''
  1531. }
  1532. // 配方重量
  1533. if (row.ccountratio !== '' && row.Sfweight !== '') {
  1534. row.ftweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), parseInt(Cookies.get('decimal')))
  1535. } else if (row.ccountratio !== '' && row.Sfweight == '') {
  1536. row.ftweight = ''
  1537. row.feedweight = ''
  1538. } else if (row.ccountratio == '' && row.Sfweight !== '') {
  1539. row.ftweight = ''
  1540. row.feedweight = ''
  1541. }
  1542. if (this.table.isPtsfname == false) {
  1543. row.feedweight = parseFloat(row.ftweight)
  1544. } else {
  1545. if (row.supplyweight !== '' && row.ftweight !== '') {
  1546. row.feedweight = formatNum(parseFloat(row.supplyweight) + parseFloat(row.ftweight), parseInt(Cookies.get('decimal')))
  1547. } else if (row.supplyweight !== '' && row.ftweight == '') {
  1548. row.feedweight = formatNum(parseFloat(row.supplyweight), parseInt(Cookies.get('decimal')))
  1549. } else if (row.supplyweight == '' && row.ftweight !== '') {
  1550. row.feedweight = formatNum(parseFloat(row.ftweight), parseInt(Cookies.get('decimal')))
  1551. }
  1552. // 配方重量 = 系数头数 * Sfweight
  1553. if (row.ccountratio !== '' && row.ftweight !== '') {
  1554. row.ftweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), parseInt(Cookies.get('decimal')))
  1555. }
  1556. // 补料重量 = 系数头数 * BLweight
  1557. if (row.ccountratio !== '' && row.BLweight !== '') {
  1558. row.supplyweight = formatNum(parseFloat(row.BLweight) * parseFloat(row.ccountratio) + parseFloat(row.BLweightLock) * parseFloat(row.ccount), parseInt(Cookies.get('decimal')))
  1559. }
  1560. }
  1561. console.log(row)
  1562. if (row.r1 !== '' && row.isOneWeight == false) { this.$set(row, 'w1', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r1) / 100), parseInt(Cookies.get('decimal')))) }
  1563. if (row.r2 !== '' && row.isTwoWeight == false) { this.$set(row, 'w2', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r2) / 100), parseInt(Cookies.get('decimal')))) }
  1564. if (row.r3 !== '' && row.isThreeWeight == false) { this.$set(row, 'w3', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r3) / 100), parseInt(Cookies.get('decimal')))) }
  1565. if (row.r4 !== '' && row.isFourWeight == false) { this.$set(row, 'w4', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r4) / 100), parseInt(Cookies.get('decimal')))) }
  1566. if (row.isOneWeight == true) {
  1567. this.$set(row, 'r1', formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal'))))
  1568. }
  1569. if (row.isTwoWeight == true) {
  1570. this.$set(row, 'r2', formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal'))))
  1571. }
  1572. if (row.isThreeWeight == true) {
  1573. this.$set(row, 'r3', formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal'))))
  1574. }
  1575. if (row.isFourWeight == true) {
  1576. this.$set(row, 'r4', formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal'))))
  1577. }
  1578. if (row.w1 == '') { row.w1 = 0 }
  1579. if (row.w2 == '') { row.w2 = 0 }
  1580. if (row.w3 == '') { row.w3 = 0 }
  1581. if (row.w4 == '') { row.w4 = 0 }
  1582. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  1583. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  1584. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  1585. },
  1586. blurRatio(row) {
  1587. console.log(row, '--------------')
  1588. if (row.ftid !== '-1' && row.ftid !== '') {
  1589. row.Sfweight = this.recipeTemplateList.find(obj => obj.id == row.ftid).Sfweight
  1590. row.SfweightLock = this.recipeTemplateList.find(obj => obj.id == row.ftid).SfweightLock
  1591. }
  1592. if (row.ptsfid !== '-1' && row.ptsfid !== '' && this.table.isPtsfname == true) {
  1593. // row.ptsfid = parseInt(row.ptsfid)
  1594. row.BLweight = formatNum(parseFloat(this.feedingFormulaList.find(obj => obj.id == row.ptsfid).Sfweight), parseInt(Cookies.get('decimal')))
  1595. row.BLweightLock = formatNum(parseFloat(this.feedingFormulaList.find(obj => obj.id == row.ptsfid).SfweightLock), parseInt(Cookies.get('decimal')))
  1596. }
  1597. if (row.ptsfid == '') {
  1598. row.BLweight = 0
  1599. row.BLweightLock = 0
  1600. }
  1601. // 系数
  1602. if (row.ccount !== '' && row.ratio !== '' && row.ccountratio !== '') {
  1603. row.ccountratio = formatNum(parseFloat(row.ccount) * parseFloat(row.ratio) / 100, parseInt(Cookies.get('decimal')))
  1604. } else if (row.ccount !== '' && row.ccountratio !== '') {
  1605. row.ratio = formatNum(parseFloat(row.ccountratio) * 100 / parseFloat(row.ccount), parseInt(Cookies.get('decimal')))
  1606. } else if (row.ccount !== '' || row.ccountratio !== '') {
  1607. row.ratio = ''
  1608. }
  1609. // 补料重量
  1610. if (row.ccountratio !== '' && row.BLweight !== '') {
  1611. row.supplyweight = formatNum(parseFloat(row.BLweight) * parseFloat(row.ccountratio) + parseFloat(row.BLweightLock) * parseFloat(row.ccount), parseInt(Cookies.get('decimal')))
  1612. } else if (row.ccountratio !== '' && row.BLweight == '' || row.ccountratio == '' && row.BLweight !== '') {
  1613. row.supplyweight = ''
  1614. row.feedweight = ''
  1615. }
  1616. // 配方重量
  1617. if (row.ccountratio !== '' && row.Sfweight !== '') {
  1618. row.ftweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), parseInt(Cookies.get('decimal')))
  1619. } else if (row.ccountratio !== '' && row.Sfweight == '' || row.ccountratio == '' && row.Sfweight !== '') {
  1620. row.ftweight = ''
  1621. row.feedweight = ''
  1622. }
  1623. // 投喂量
  1624. if (row.supplyweight !== '' && row.ftweight !== '') {
  1625. row.feedweight = formatNum(parseFloat(row.BLweight) * parseFloat(row.ccountratio) + parseFloat(row.BLweightLock) * parseFloat(row.ccount), parseInt(Cookies.get('decimal')))
  1626. } else if (row.supplyweight == '' && row.ftweight !== '') {
  1627. row.feedweight = formatNum(parseFloat(row.ftweight), parseInt(Cookies.get('decimal')))
  1628. } else if (row.supplyweight !== '' && row.ftweight == '') {
  1629. row.feedweight = formatNum(parseFloat(row.supplyweight), parseInt(Cookies.get('decimal')))
  1630. }
  1631. console.log(row.supplyweight, '补料重量')
  1632. console.log(row.ftweight, '配方重量')
  1633. if (this.table.isPtsfname == false) {
  1634. row.feedweight = formatNum(parseFloat(row.ftweight), parseInt(Cookies.get('decimal')))
  1635. } else {
  1636. // 投喂量
  1637. if (row.supplyweight !== '' && row.ftweight !== '') {
  1638. row.feedweight = formatNum(parseFloat(row.supplyweight) + parseFloat(row.ftweight), parseInt(Cookies.get('decimal')))
  1639. } else if (row.supplyweight == '' && row.ftweight !== '') {
  1640. row.feedweight = formatNum(parseFloat(row.ftweight), parseInt(Cookies.get('decimal')))
  1641. } else if (row.supplyweight !== '' && row.ftweight == '') {
  1642. row.feedweight = formatNum(parseFloat(row.supplyweight), parseInt(Cookies.get('decimal')))
  1643. }
  1644. // 补料重量
  1645. if (row.ccountratio !== '' && row.BLweight !== '') {
  1646. row.supplyweight = formatNum(parseFloat(row.BLweight) * parseFloat(row.ccountratio) + parseFloat(row.BLweightLock) * parseFloat(row.ccount), parseInt(Cookies.get('decimal')))
  1647. } else if (row.ccountratio !== '' && row.BLweight == '') {
  1648. row.supplyweight = ''
  1649. row.feedweight = ''
  1650. } else if (row.ccountratio == '' && row.BLweight !== '') {
  1651. row.supplyweight = ''
  1652. row.feedweight = ''
  1653. }
  1654. // 配方重量
  1655. if (row.ccountratio !== '' && row.Sfweight !== '') {
  1656. row.ftweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), parseInt(Cookies.get('decimal')))
  1657. } else if (row.ccountratio !== '' && row.Sfweight == '') {
  1658. row.ftweight = ''
  1659. row.feedweight = ''
  1660. } else if (row.ccountratio == '' && row.Sfweight !== '') {
  1661. row.ftweight = ''
  1662. row.feedweight = ''
  1663. }
  1664. }
  1665. if (row.r1 !== '' && row.isOneWeight == false) { this.$set(row, 'w1', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r1) / 100), parseInt(Cookies.get('decimal')))) }
  1666. if (row.r2 !== '' && row.isTwoWeight == false) { this.$set(row, 'w2', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r2) / 100), parseInt(Cookies.get('decimal')))) }
  1667. if (row.r3 !== '' && row.isThreeWeight == false) { this.$set(row, 'w3', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r3) / 100), parseInt(Cookies.get('decimal')))) }
  1668. if (row.r4 !== '' && row.isFourWeight == false) { this.$set(row, 'w4', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r4) / 100), parseInt(Cookies.get('decimal')))) }
  1669. if (row.isOneWeight == true) {
  1670. this.$set(row, 'r1', formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal'))))
  1671. }
  1672. if (row.isTwoWeight == true) {
  1673. this.$set(row, 'r2', formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal'))))
  1674. }
  1675. if (row.isThreeWeight == true) {
  1676. this.$set(row, 'r3', formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal'))))
  1677. }
  1678. if (row.isFourWeight == true) {
  1679. this.$set(row, 'r4', formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal'))))
  1680. }
  1681. if (row.w1 == '') { row.w1 = 0 }
  1682. if (row.w2 == '') { row.w2 = 0 }
  1683. if (row.w3 == '') { row.w3 = 0 }
  1684. if (row.w4 == '') { row.w4 = 0 }
  1685. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  1686. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  1687. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  1688. },
  1689. blurCcountratio(row) {
  1690. if (row.ftid !== '-1' && row.ftid !== '') {
  1691. row.Sfweight = this.recipeTemplateList.find(obj => obj.id == row.ftid).Sfweight
  1692. row.SfweightLock = this.recipeTemplateList.find(obj => obj.id == row.ftid).SfweightLock
  1693. }
  1694. if (row.ptsfid !== '-1' && row.ptsfid !== '' && this.table.isPtsfname == true) {
  1695. // row.ptsfid = parseInt(row.ptsfid)
  1696. row.BLweight = formatNum(parseFloat(this.feedingFormulaList.find(obj => obj.id == row.ptsfid).Sfweight), parseInt(Cookies.get('decimal')))
  1697. row.BLweightLock = formatNum(parseFloat(this.feedingFormulaList.find(obj => obj.id == row.ptsfid).SfweightLock), parseInt(Cookies.get('decimal')))
  1698. }
  1699. if (row.ptsfid == '') {
  1700. row.BLweight = 0
  1701. row.BLweightLock = 0
  1702. }
  1703. if (row.ptsfid == '') {
  1704. row.BLweight = 0
  1705. row.BLweightLock = 0
  1706. }
  1707. // ratio系数ccountratio系数头数ccount实际牛头数
  1708. // 系数头数
  1709. if (row.ccountratio !== '' && row.ccount !== '' && row.ratio !== '') {
  1710. if (row.ccountratio !== 0 && row.ccount !== 0) {
  1711. row.ratio = formatNum(parseFloat(row.ccountratio) * 100 / parseFloat(row.ccount), parseInt(Cookies.get('decimal')))
  1712. }
  1713. } else if (row.ccount !== '' && row.ratio !== '') {
  1714. row.ccountratio = formatNum(parseFloat(row.ccount) * parseFloat(row.ratio) / 100, parseInt(Cookies.get('decimal')))
  1715. } else if (row.ccountratio !== '' && row.ccount !== '') {
  1716. if (row.ccountratio !== 0 && row.ccount !== 0) {
  1717. row.ratio = formatNum(parseFloat(row.ccountratio) * 100 / parseFloat(row.ccount), parseInt(Cookies.get('decimal')))
  1718. }
  1719. } else if (row.ccountratio !== '' && row.ratio !== '') {
  1720. row.ccount = formatNum(parseFloat(row.ccountratio) * 100 / parseFloat(row.ratio) / 100, parseInt(Cookies.get('decimal')))
  1721. }
  1722. // 补料重量
  1723. if (row.ccountratio !== '' && row.BLweight !== '') {
  1724. row.supplyweight = formatNum(parseFloat(row.BLweight) * parseFloat(row.ccountratio) + parseFloat(row.BLweightLock) * parseFloat(row.ccount), parseInt(Cookies.get('decimal')))
  1725. } else if (row.ccountratio !== '' && row.BLweight == '') {
  1726. row.supplyweight = ''
  1727. row.feedweight = ''
  1728. } else if (row.ccountratio == '' && row.BLweight !== '') {
  1729. row.supplyweight = ''
  1730. row.feedweight = ''
  1731. }
  1732. // 配方重量
  1733. if (row.ccountratio !== '' && row.Sfweight !== '') {
  1734. row.ftweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), parseInt(Cookies.get('decimal')))
  1735. } else if (row.ccountratio !== '' && row.Sfweight == '') {
  1736. row.ftweight = ''
  1737. row.feedweight = ''
  1738. } else if (row.ccountratio == '' && row.Sfweight !== '') {
  1739. row.ftweight = ''
  1740. row.feedweight = ''
  1741. }
  1742. // 投喂量
  1743. if (row.supplyweight !== '' && row.ftweight !== '') {
  1744. row.feedweight = formatNum(parseFloat(row.supplyweight) + parseFloat(row.ftweight), parseInt(Cookies.get('decimal')))
  1745. } else if (row.supplyweight == '' && row.ftweight !== '') {
  1746. row.feedweight = formatNum(parseFloat(row.ftweight), parseInt(Cookies.get('decimal')))
  1747. } else if (row.supplyweight !== '' && row.ftweight == '') {
  1748. row.feedweight = formatNum(parseFloat(row.supplyweight), parseInt(Cookies.get('decimal')))
  1749. }
  1750. if (this.table.isPtsfname == false) {
  1751. console.log(row)
  1752. row.feedweight = formatNum(parseFloat(row.ftweight), parseInt(Cookies.get('decimal')))
  1753. } else {
  1754. // 投喂量
  1755. if (row.supplyweight !== '' && row.ftweight !== '') {
  1756. row.feedweight = formatNum(parseFloat(row.supplyweight) + parseFloat(row.ftweight), parseInt(Cookies.get('decimal')))
  1757. } else if (row.supplyweight == '' && row.ftweight !== '') {
  1758. row.feedweight = formatNum(parseFloat(row.ftweight), parseInt(Cookies.get('decimal')))
  1759. } else if (row.supplyweight !== '' && row.ftweight == '') {
  1760. row.feedweight = formatNum(parseFloat(row.supplyweight), parseInt(Cookies.get('decimal')))
  1761. }
  1762. // 补料重量
  1763. if (row.ccountratio !== '' && row.BLweight !== '') {
  1764. row.supplyweight = formatNum(parseFloat(row.BLweight) * parseFloat(row.ccountratio) + parseFloat(row.BLweightLock) * parseFloat(row.ccount), parseInt(Cookies.get('decimal')))
  1765. } else if (row.ccountratio !== '' && row.BLweight == '') {
  1766. row.supplyweight = ''
  1767. row.feedweight = ''
  1768. } else if (row.ccountratio == '' && row.BLweight !== '') {
  1769. row.supplyweight = ''
  1770. row.feedweight = ''
  1771. }
  1772. // 配方重量
  1773. if (row.ccountratio !== '' && row.Sfweight !== '') {
  1774. row.ftweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), parseInt(Cookies.get('decimal')))
  1775. } else if (row.ccountratio !== '' && row.Sfweight == '') {
  1776. row.ftweight = ''
  1777. row.feedweight = ''
  1778. } else if (row.ccountratio == '' && row.Sfweight !== '') {
  1779. row.ftweight = ''
  1780. row.feedweight = ''
  1781. }
  1782. }
  1783. if (row.r1 !== '' && row.isOneWeight == false) {
  1784. this.$set(row, 'w1', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r1) / 100), parseInt(Cookies.get('decimal'))))
  1785. }
  1786. if (row.r2 !== '' && row.isTwoWeight == false) {
  1787. this.$set(row, 'w2', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r2) / 100), parseInt(Cookies.get('decimal'))))
  1788. }
  1789. if (row.r3 !== '' && row.isThreeWeight == false) {
  1790. this.$set(row, 'w3', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r3) / 100), parseInt(Cookies.get('decimal'))))
  1791. }
  1792. if (row.r4 !== '' && row.isFourWeight == false) {
  1793. this.$set(row, 'w4', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r4) / 100), parseInt(Cookies.get('decimal'))))
  1794. }
  1795. if (row.isOneWeight == true) {
  1796. this.$set(row, 'r1', formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal'))))
  1797. }
  1798. if (row.isTwoWeight == true) {
  1799. this.$set(row, 'r2', formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal'))))
  1800. }
  1801. if (row.isThreeWeight == true) {
  1802. this.$set(row, 'r3', formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal'))))
  1803. }
  1804. if (row.isFourWeight == true) {
  1805. this.$set(row, 'r4', formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal'))))
  1806. }
  1807. if (row.w1 == '') { row.w1 = 0 }
  1808. if (row.w2 == '') { row.w2 = 0 }
  1809. if (row.w3 == '') { row.w3 = 0 }
  1810. if (row.w4 == '') { row.w4 = 0 }
  1811. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  1812. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  1813. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  1814. },
  1815. // 总比例
  1816. blurR(row) {
  1817. if (row.r1 == '') { row.r1 = 0 }
  1818. if (row.r2 == '') { row.r2 = 0 }
  1819. if (row.r3 == '') { row.r3 = 0 }
  1820. if (row.r4 == '') { row.r4 = 0 }
  1821. if (row.r1 !== '') {
  1822. row.w1 = formatNum(parseFloat(row.feedweight) * parseFloat(row.r1) / 100, parseInt(Cookies.get('decimal')))
  1823. }
  1824. if (row.r2 !== '') {
  1825. row.w2 = formatNum(parseFloat(row.feedweight) * parseFloat(row.r2) / 100, parseInt(Cookies.get('decimal')))
  1826. }
  1827. if (row.r3 !== '') {
  1828. row.w3 = formatNum(parseFloat(row.feedweight) * parseFloat(row.r3) / 100, parseInt(Cookies.get('decimal')))
  1829. }
  1830. if (row.r4 !== '') {
  1831. row.w4 = formatNum(parseFloat(row.feedweight) * parseFloat(row.r4) / 100, parseInt(Cookies.get('decimal')))
  1832. }
  1833. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  1834. if (row.w1 == '') { row.w1 = 0 }
  1835. if (row.w2 == '') { row.w2 = 0 }
  1836. if (row.w3 == '') { row.w3 = 0 }
  1837. if (row.w4 == '') { row.w4 = 0 }
  1838. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  1839. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  1840. },
  1841. // 一班重量得到焦点
  1842. focusW(row) {
  1843. console.log(row, '====')
  1844. this.focusWRow = Object.assign({}, row)
  1845. },
  1846. // 1班重量得到焦点
  1847. focusW2(row) {
  1848. this.focusWRow2 = Object.assign({}, row)
  1849. },
  1850. // 3班重量得到焦点
  1851. focusW3(row) {
  1852. this.focusWRow3 = Object.assign({}, row)
  1853. },
  1854. // 4班重量得到焦点
  1855. focusW4(row) {
  1856. this.focusWRow4 = Object.assign({}, row)
  1857. },
  1858. // 一班重量
  1859. blurW(row) {
  1860. if (row.w1 == '') {
  1861. row.w1 = 0
  1862. }
  1863. if (row.w2 == '') {
  1864. row.w2 = 0
  1865. }
  1866. if (row.w3 == '') {
  1867. row.w3 = 0
  1868. }
  1869. if (row.w4 == '') {
  1870. row.w4 = 0
  1871. }
  1872. if (row.r1 == '') {
  1873. row.r1 = 0
  1874. }
  1875. if (row.r2 == '') {
  1876. row.r2 = 0
  1877. }
  1878. if (row.r3 == '') {
  1879. row.r3 = 0
  1880. }
  1881. if (row.r4 == '') {
  1882. row.r4 = 0
  1883. }
  1884. // row.ftweight = parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4)
  1885. console.log(row, '=======投喂量feedweight')
  1886. // isOneWeight,isTwoWeight,isThreeWeight,isFourWeight
  1887. if (this.table.RWLength == 4) {
  1888. // isOneWeight,isTwoWeight,isThreeWeight,isFourWeight
  1889. // 2班3班4班都锁定
  1890. if (row.isTwoWeight == true && row.isThreeWeight == true && row.isFourWeight == true) {
  1891. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1892. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  1893. }
  1894. // 2班3班锁定4班未锁定
  1895. if (row.isTwoWeight == true && row.isThreeWeight == true && row.isFourWeight == false) {
  1896. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1897. row.w4 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2) - parseFloat(row.w3), parseInt(Cookies.get('decimal')))
  1898. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1899. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  1900. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  1901. }
  1902. // 2班4班锁定3班未锁定
  1903. if (row.isTwoWeight == true && row.isFourWeight == true && row.isThreeWeight == false) {
  1904. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1905. row.w3 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2) - parseFloat(row.w4), parseInt(Cookies.get('decimal')))
  1906. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1907. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  1908. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  1909. }
  1910. // 3班4班锁定2班未锁定
  1911. if (row.isTwoWeight == false && row.isThreeWeight == true && row.isFourWeight == true) {
  1912. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1913. row.w2 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w3) - parseFloat(row.w4), parseInt(Cookies.get('decimal')))
  1914. row.r2 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1915. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  1916. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  1917. }
  1918. // 2班锁定,3班4班未锁
  1919. if (row.isTwoWeight == true && row.isThreeWeight == false && row.isFourWeight == false) {
  1920. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1921. if (row.r3 == 0 && row.r4 == 0) {
  1922. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2)) / 2, parseInt(Cookies.get('decimal')))
  1923. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1924. row.w4 = row.w3
  1925. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1926. } else if (row.r3 == 0 && row.r4 !== 0) {
  1927. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2) - parseFloat(row.w4)), parseInt(Cookies.get('decimal')))
  1928. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1929. if (row.w1 == '') { row.w1 = 0 }
  1930. if (row.w2 == '') { row.w2 = 0 }
  1931. if (row.w3 == '') { row.w3 = 0 }
  1932. if (row.w4 == '') { row.w4 = 0 }
  1933. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  1934. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  1935. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  1936. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  1937. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  1938. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  1939. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow.dailyWeight)) {
  1940. row.w4 = formatNum((parseFloat(this.focusWRow.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2)) * parseFloat(row.r4) / (parseFloat(this.focusWRow.r3) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
  1941. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1942. }
  1943. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  1944. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  1945. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  1946. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  1947. } else if (row.r3 !== 0 && row.r4 == 0) {
  1948. row.w4 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2) - parseFloat(row.w3)), parseInt(Cookies.get('decimal')))
  1949. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1950. if (row.w1 == '') { row.w1 = 0 }
  1951. if (row.w2 == '') { row.w2 = 0 }
  1952. if (row.w3 == '') { row.w3 = 0 }
  1953. if (row.w4 == '') { row.w4 = 0 }
  1954. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  1955. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  1956. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  1957. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  1958. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  1959. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  1960. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow.dailyWeight)) {
  1961. row.w3 = formatNum((parseFloat(this.focusWRow.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2)) * parseFloat(row.r3) / (parseFloat(row.r3) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
  1962. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1963. }
  1964. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  1965. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  1966. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  1967. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  1968. } else {
  1969. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2)) * parseFloat(row.r3) / (parseFloat(row.r3) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
  1970. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1971. row.w4 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2)) * parseFloat(row.r4) / (parseFloat(this.focusWRow.r3) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
  1972. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1973. }
  1974. if (isNaN(row.w3)) {
  1975. row.w3 = 0
  1976. row.r3 = 0
  1977. }
  1978. if (isNaN(row.w4)) {
  1979. row.w4 = 0
  1980. row.r4 = 0
  1981. }
  1982. if (row.w3 <= 0) {
  1983. row.w3 = 0
  1984. row.r3 = 0
  1985. }
  1986. if (row.w4 <= 0) {
  1987. row.w4 = 0
  1988. row.r4 = 0
  1989. }
  1990. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  1991. }
  1992. // 3班锁定,2班4班未锁
  1993. if (row.isTwoWeight == false && row.isThreeWeight == true && row.isFourWeight == false) {
  1994. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1995. if (row.r2 == 0 && row.r4 == 0) {
  1996. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w3)) / 2, parseInt(Cookies.get('decimal')))
  1997. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1998. row.w4 = row.w2
  1999. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2000. } else if (row.r2 == 0 && row.r4 !== 0) {
  2001. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w3) - parseFloat(row.w4)), parseInt(Cookies.get('decimal')))
  2002. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2003. if (row.w1 == '') { row.w1 = 0 }
  2004. if (row.w2 == '') { row.w2 = 0 }
  2005. if (row.w3 == '') { row.w3 = 0 }
  2006. if (row.w4 == '') { row.w4 = 0 }
  2007. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2008. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2009. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2010. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2011. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2012. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2013. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow.dailyWeight)) {
  2014. row.w4 = formatNum((parseFloat(this.focusWRow.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w3)) * parseFloat(row.r4) / (parseFloat(this.focusWRow.r2) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
  2015. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2016. }
  2017. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2018. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2019. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2020. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2021. } else if (row.r2 !== 0 && row.r4 == 0) {
  2022. row.w4 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w3) - parseFloat(row.w2)), parseInt(Cookies.get('decimal')))
  2023. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2024. if (row.w1 == '') { row.w1 = 0 }
  2025. if (row.w2 == '') { row.w2 = 0 }
  2026. if (row.w3 == '') { row.w3 = 0 }
  2027. if (row.w4 == '') { row.w4 = 0 }
  2028. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2029. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2030. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2031. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2032. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2033. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2034. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow.dailyWeight)) {
  2035. row.w2 = formatNum((parseFloat(this.focusWRow.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w3)) * parseFloat(row.r2) / (parseFloat(row.r2) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
  2036. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2037. }
  2038. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2039. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2040. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2041. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2042. } else {
  2043. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w3)) * parseFloat(row.r2) / (parseFloat(row.r2) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
  2044. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2045. row.w4 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w3)) * parseFloat(row.r4) / (parseFloat(this.focusWRow.r2) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
  2046. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2047. }
  2048. if (isNaN(row.w2)) {
  2049. row.w2 = 0
  2050. row.r2 = 0
  2051. }
  2052. if (isNaN(row.w4)) {
  2053. row.w4 = 0
  2054. row.r4 = 0
  2055. }
  2056. if (row.w2 <= 0) {
  2057. row.w2 = 0
  2058. row.r2 = 0
  2059. }
  2060. if (row.w4 <= 0) {
  2061. row.w4 = 0
  2062. row.r4 = 0
  2063. }
  2064. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  2065. }
  2066. // 4班锁定,2班3班未锁
  2067. if (row.isTwoWeight == false && row.isThreeWeight == false && row.isFourWeight == true) {
  2068. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2069. if (row.r2 == 0 && row.r3 == 0) {
  2070. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w4)) / 2, parseInt(Cookies.get('decimal')))
  2071. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2072. row.w3 = row.w2
  2073. row.r3 = row.r2
  2074. } else if (row.r2 == 0 && row.r3 !== 0) {
  2075. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w4) - parseFloat(row.w3)), parseInt(Cookies.get('decimal')))
  2076. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2077. if (row.w1 == '') { row.w1 = 0 }
  2078. if (row.w2 == '') { row.w2 = 0 }
  2079. if (row.w3 == '') { row.w3 = 0 }
  2080. if (row.w4 == '') { row.w4 = 0 }
  2081. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2082. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2083. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2084. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2085. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2086. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2087. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow.dailyWeight)) {
  2088. row.w3 = formatNum((parseFloat(this.focusWRow.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w4)) * parseFloat(row.r3) / (parseFloat(this.focusWRow.r2) + parseFloat(row.r3)), parseInt(Cookies.get('decimal')))
  2089. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2090. }
  2091. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2092. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2093. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2094. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2095. } else if (row.r2 !== 0 && row.r3 == 0) {
  2096. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w4) - parseFloat(row.w2)), parseInt(Cookies.get('decimal')))
  2097. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2098. if (row.w1 == '') { row.w1 = 0 }
  2099. if (row.w2 == '') { row.w2 = 0 }
  2100. if (row.w3 == '') { row.w3 = 0 }
  2101. if (row.w4 == '') { row.w4 = 0 }
  2102. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2103. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2104. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2105. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2106. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2107. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2108. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow.dailyWeight)) {
  2109. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w4)) * parseFloat(row.r2) / (parseFloat(row.r2) + parseFloat(row.r3)), parseInt(Cookies.get('decimal')))
  2110. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2111. }
  2112. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2113. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2114. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2115. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2116. } else {
  2117. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w4)) * parseFloat(row.r2) / (parseFloat(row.r2) + parseFloat(row.r3)), parseInt(Cookies.get('decimal')))
  2118. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2119. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w4)) * parseFloat(row.r3) / (parseFloat(this.focusWRow.r2) + parseFloat(row.r3)), parseInt(Cookies.get('decimal')))
  2120. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2121. }
  2122. if (row.w2 <= 0) {
  2123. row.w2 = 0
  2124. row.r2 = 0
  2125. }
  2126. if (row.w3 <= 0) {
  2127. row.w3 = 0
  2128. row.r3 = 0
  2129. }
  2130. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  2131. }
  2132. // 2班3班4班未锁
  2133. if (row.isTwoWeight == false && row.isThreeWeight == false && row.isFourWeight == false) {
  2134. console.log('1231234')
  2135. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2136. if (parseFloat(row.r2) == 0 && parseFloat(row.r3) == 0 && parseFloat(row.r4) == 0) {
  2137. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1)) / 3, parseInt(Cookies.get('decimal')))
  2138. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2139. row.w3 = row.w2
  2140. row.w4 = row.w2
  2141. row.r3 = row.r2
  2142. row.r4 = row.r2
  2143. } else if (parseFloat(row.r2) == 0 && parseFloat(row.r3) == 0 && parseFloat(row.r4) !== 0) {
  2144. row.w3 = formatNum(((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w4))) / 2, parseInt(Cookies.get('decimal')))
  2145. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2146. row.w2 = row.w3
  2147. row.r2 = row.r3
  2148. if (row.w1 == '') { row.w1 = 0 }
  2149. if (row.w2 == '') { row.w2 = 0 }
  2150. if (row.w3 == '') { row.w3 = 0 }
  2151. if (row.w4 == '') { row.w4 = 0 }
  2152. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2153. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2154. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2155. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2156. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2157. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2158. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow.dailyWeight)) {
  2159. row.w4 = formatNum((parseFloat(this.focusWRow.dailyWeight) - parseFloat(row.w1)) * parseFloat(this.focusWRow.r4) / (parseFloat(this.focusWRow.r2) + parseFloat(this.focusWRow.r3) + parseFloat(this.focusWRow.r4)), parseInt(Cookies.get('decimal')))
  2160. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2161. }
  2162. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2163. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2164. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2165. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2166. } else if (parseFloat(row.r2) == 0 && parseFloat(row.r3) !== 0 && parseFloat(row.r4) == 0) {
  2167. row.w2 = formatNum(((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w3))) / 2, parseInt(Cookies.get('decimal')))
  2168. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2169. row.w4 = row.w2
  2170. row.r4 = row.r2
  2171. if (row.w1 == '') { row.w1 = 0 }
  2172. if (row.w2 == '') { row.w2 = 0 }
  2173. if (row.w3 == '') { row.w3 = 0 }
  2174. if (row.w4 == '') { row.w4 = 0 }
  2175. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2176. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2177. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2178. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2179. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2180. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2181. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow.dailyWeight)) {
  2182. row.w3 = formatNum((parseFloat(this.focusWRow.dailyWeight) - parseFloat(row.w1)) * parseFloat(this.focusWRow.r3) / (parseFloat(this.focusWRow.r2) + parseFloat(this.focusWRow.r3) + parseFloat(this.focusWRow.r4)), parseInt(Cookies.get('decimal')))
  2183. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2184. }
  2185. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2186. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2187. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2188. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2189. } else if (parseFloat(row.r2) !== 0 && parseFloat(row.r3) == 0 && parseFloat(row.r4) == 0) {
  2190. row.w3 = formatNum(((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2))) / 2, parseInt(Cookies.get('decimal')))
  2191. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2192. row.w4 = row.w3
  2193. row.r4 = row.r3
  2194. if (row.w1 == '') { row.w1 = 0 }
  2195. if (row.w2 == '') { row.w2 = 0 }
  2196. if (row.w3 == '') { row.w3 = 0 }
  2197. if (row.w4 == '') { row.w4 = 0 }
  2198. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2199. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2200. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2201. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2202. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2203. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2204. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow.dailyWeight)) {
  2205. row.w2 = formatNum((parseFloat(this.focusWRow.dailyWeight) - parseFloat(row.w1)) * parseFloat(row.r2) / (parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
  2206. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2207. }
  2208. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2209. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2210. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2211. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2212. } else if (row.r2 == 0 && row.r3 !== 0 && row.r4 !== 0) {
  2213. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w3) - parseFloat(row.w4)), parseInt(Cookies.get('decimal')))
  2214. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2215. if (row.w1 == '') { row.w1 = 0 }
  2216. if (row.w2 == '') { row.w2 = 0 }
  2217. if (row.w3 == '') { row.w3 = 0 }
  2218. if (row.w4 == '') { row.w4 = 0 }
  2219. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2220. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2221. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2222. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2223. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2224. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2225. console.log(row.dailyWeight)
  2226. console.log(this.focusWRow.dailyWeight)
  2227. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow.dailyWeight)) {
  2228. row.w3 = formatNum((parseFloat(this.focusWRow.dailyWeight) - parseFloat(row.w1)) * parseFloat(this.focusWRow.r3) / (parseFloat(this.focusWRow.r2) + parseFloat(this.focusWRow.r3) + parseFloat(this.focusWRow.r4)), parseInt(Cookies.get('decimal')))
  2229. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2230. row.w4 = formatNum((parseFloat(this.focusWRow.dailyWeight) - parseFloat(row.w1)) * parseFloat(this.focusWRow.r4) / (parseFloat(this.focusWRow.r2) + parseFloat(this.focusWRow.r3) + parseFloat(this.focusWRow.r4)), parseInt(Cookies.get('decimal')))
  2231. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2232. }
  2233. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2234. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2235. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2236. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2237. } else if (row.r2 !== 0 && row.r3 == 0 && row.r4 !== 0) {
  2238. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2) - parseFloat(row.w4)), parseInt(Cookies.get('decimal')))
  2239. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2240. if (row.w1 == '') { row.w1 = 0 }
  2241. if (row.w2 == '') { row.w2 = 0 }
  2242. if (row.w3 == '') { row.w3 = 0 }
  2243. if (row.w4 == '') { row.w4 = 0 }
  2244. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2245. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2246. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2247. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2248. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2249. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2250. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow.dailyWeight)) {
  2251. row.w2 = formatNum((parseFloat(this.focusWRow.dailyWeight) - parseFloat(row.w1)) * parseFloat(row.r2) / (parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
  2252. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2253. row.w4 = formatNum((parseFloat(this.focusWRow.dailyWeight) - parseFloat(row.w1)) * parseFloat(this.focusWRow.r4) / (parseFloat(this.focusWRow.r2) + parseFloat(this.focusWRow.r3) + parseFloat(this.focusWRow.r4)), parseInt(Cookies.get('decimal')))
  2254. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2255. }
  2256. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2257. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2258. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2259. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2260. } else if (row.r2 !== 0 && row.r3 !== 0 && row.r4 == 0) {
  2261. row.w4 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2) - parseFloat(row.w3)), parseInt(Cookies.get('decimal')))
  2262. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2263. if (row.w1 == '') { row.w1 = 0 }
  2264. if (row.w2 == '') { row.w2 = 0 }
  2265. if (row.w3 == '') { row.w3 = 0 }
  2266. if (row.w4 == '') { row.w4 = 0 }
  2267. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2268. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2269. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2270. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2271. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2272. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2273. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow.dailyWeight)) {
  2274. row.w2 = formatNum((parseFloat(this.focusWRow.dailyWeight) - parseFloat(row.w1)) * parseFloat(row.r2) / (parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
  2275. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2276. row.w3 = formatNum((parseFloat(this.focusWRow.dailyWeight) - parseFloat(row.w1)) * parseFloat(row.r3) / (parseFloat(this.focusWRow.r2) + parseFloat(this.focusWRow.r3) + parseFloat(this.focusWRow.r4)), parseInt(Cookies.get('decimal')))
  2277. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2278. }
  2279. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2280. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2281. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2282. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2283. } else {
  2284. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1)) * parseFloat(row.r2) / (parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
  2285. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2286. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1)) * parseFloat(row.r3) / (parseFloat(this.focusWRow.r2) + parseFloat(this.focusWRow.r3) + parseFloat(this.focusWRow.r4)), parseInt(Cookies.get('decimal')))
  2287. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2288. row.w4 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1)) * parseFloat(row.r4) / (parseFloat(this.focusWRow.r2) + parseFloat(this.focusWRow.r3) + parseFloat(this.focusWRow.r4)), parseInt(Cookies.get('decimal')))
  2289. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2290. }
  2291. if (isNaN(row.w2)) {
  2292. row.w2 = 0
  2293. row.r2 = 0
  2294. }
  2295. if (isNaN(row.w3)) {
  2296. row.w3 = 0
  2297. row.r3 = 0
  2298. }
  2299. if (isNaN(row.w4)) {
  2300. row.w4 = 0
  2301. row.r4 = 0
  2302. }
  2303. if (row.w2 <= 0) {
  2304. row.w2 = 0
  2305. row.r2 = 0
  2306. }
  2307. if (row.w3 <= 0) {
  2308. row.w3 = 0
  2309. row.r3 = 0
  2310. }
  2311. if (row.w4 <= 0) {
  2312. row.w4 = 0
  2313. row.r4 = 0
  2314. }
  2315. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  2316. }
  2317. } else if (this.table.RWLength == 3) {
  2318. // 三班
  2319. // 2班/3班锁定
  2320. if (row.isTwoWeight == true && row.isThreeWeight == true) {
  2321. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2322. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3), parseInt(Cookies.get('decimal'))))
  2323. }
  2324. // 2班不锁3班锁
  2325. if (row.isTwoWeight == false && row.isThreeWeight == true) {
  2326. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2327. row.w2 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w3), parseInt(Cookies.get('decimal')))
  2328. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2329. if (row.w2 <= 0) {
  2330. row.w2 = 0
  2331. row.r2 = 0
  2332. }
  2333. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3), parseInt(Cookies.get('decimal'))))
  2334. }
  2335. // 3班不锁2班锁
  2336. if (row.isTwoWeight == true && row.isThreeWeight == false) {
  2337. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2338. row.w3 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2), parseInt(Cookies.get('decimal')))
  2339. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2340. if (row.w3 <= 0) {
  2341. row.w3 = 0
  2342. row.r3 = 0
  2343. }
  2344. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3), parseInt(Cookies.get('decimal'))))
  2345. }
  2346. // 2班3班都不锁
  2347. if (row.isTwoWeight == false && row.isThreeWeight == false) {
  2348. console.log(row.w1, 'w1----------')
  2349. console.log(row.feedweight, 'feedweight----------')
  2350. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2351. if (row.r2 == 0 && row.r3 == 0) {
  2352. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1)) / 2, parseInt(Cookies.get('decimal')))
  2353. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2354. row.w3 = row.w2
  2355. row.r3 = row.r2
  2356. } else if (row.r2 == 0 && row.r3 !== 0) {
  2357. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w3)), parseInt(Cookies.get('decimal')))
  2358. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2359. if (row.w1 == '') { row.w1 = 0 }
  2360. if (row.w2 == '') { row.w2 = 0 }
  2361. if (row.w3 == '') { row.w3 = 0 }
  2362. if (row.w4 == '') { row.w4 = 0 }
  2363. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2364. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2365. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2366. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2367. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2368. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2369. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow.dailyWeight)) {
  2370. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1)) * parseFloat(this.focusWRow.r3) / (parseFloat(this.focusWRow.r2) + parseFloat(this.focusWRow.r3)), parseInt(Cookies.get('decimal')))
  2371. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2372. }
  2373. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2374. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2375. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2376. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2377. } else if (row.r2 !== 0 && row.r3 == 0) {
  2378. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2)), parseInt(Cookies.get('decimal')))
  2379. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2380. if (row.w1 == '') { row.w1 = 0 }
  2381. if (row.w2 == '') { row.w2 = 0 }
  2382. if (row.w3 == '') { row.w3 = 0 }
  2383. if (row.w4 == '') { row.w4 = 0 }
  2384. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2385. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2386. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2387. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2388. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2389. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2390. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow.dailyWeight)) {
  2391. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1)) * parseFloat(this.focusWRow.r2) / (parseFloat(this.focusWRow.r2) + parseFloat(this.focusWRow.r3)), parseInt(Cookies.get('decimal')))
  2392. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2393. }
  2394. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2395. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2396. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2397. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2398. } else {
  2399. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1)) * parseFloat(this.focusWRow.r2) / (parseFloat(this.focusWRow.r2) + parseFloat(this.focusWRow.r3)), parseInt(Cookies.get('decimal')))
  2400. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2401. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1)) * parseFloat(this.focusWRow.r3) / (parseFloat(this.focusWRow.r2) + parseFloat(this.focusWRow.r3)), parseInt(Cookies.get('decimal')))
  2402. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2403. console.log('我改了1')
  2404. }
  2405. if (isNaN(row.w2)) {
  2406. row.w2 = 0
  2407. row.r2 = 0
  2408. }
  2409. if (isNaN(row.w3)) {
  2410. row.w3 = 0
  2411. row.r3 = 0
  2412. }
  2413. if (row.w3 <= 0) {
  2414. row.w3 = 0
  2415. row.r3 = 0
  2416. }
  2417. if (row.w2 <= 0) {
  2418. row.w2 = 0
  2419. row.r2 = 0
  2420. }
  2421. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3), parseInt(Cookies.get('decimal'))))
  2422. }
  2423. } else if (this.table.RWLength == 2) {
  2424. // 两班isOneWeight,isTwoWeight
  2425. if (row.w1 == '') { row.w1 = 0 }
  2426. if (row.w2 == '') { row.w2 = 0 }
  2427. if (row.r1 == '') { row.r1 = 0 }
  2428. if (row.r2 == '') { row.r2 = 0 }
  2429. if (row.isTwoWeight == false) {
  2430. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2431. row.w2 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w1), parseInt(Cookies.get('decimal')))
  2432. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2433. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2434. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2), parseInt(Cookies.get('decimal'))))
  2435. } else {
  2436. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2437. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2), parseInt(Cookies.get('decimal'))))
  2438. }
  2439. } else {
  2440. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2441. this.$set(row, 'sumr', formatNum(parseFloat(row.r1), parseInt(Cookies.get('decimal'))))
  2442. }
  2443. if (row.w1 == '') { row.w1 = 0 }
  2444. if (row.w2 == '') { row.w2 = 0 }
  2445. if (row.w3 == '') { row.w3 = 0 }
  2446. if (row.w4 == '') { row.w4 = 0 }
  2447. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2448. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2449. },
  2450. blurW2(row) {
  2451. // 2班重量
  2452. if (row.w1 == '') {
  2453. row.w1 = 0
  2454. }
  2455. if (row.w2 == '') {
  2456. row.w2 = 0
  2457. }
  2458. if (row.w3 == '') {
  2459. row.w3 = 0
  2460. }
  2461. if (row.w4 == '') {
  2462. row.w4 = 0
  2463. }
  2464. if (row.r1 == '') {
  2465. row.r1 = 0
  2466. }
  2467. if (row.r2 == '') {
  2468. row.r2 = 0
  2469. }
  2470. if (row.r3 == '') {
  2471. row.r3 = 0
  2472. }
  2473. if (row.r4 == '') {
  2474. row.r4 = 0
  2475. }
  2476. // row.ftweight = parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4)
  2477. console.log(row, '=======投喂量feedweight')
  2478. // isOneWeight,isTwoWeight,isThreeWeight,isFourWeight
  2479. if (this.table.RWLength == 4) {
  2480. // 四班
  2481. // 1班3班4班都锁定
  2482. if (row.isOneWeight == true && row.isThreeWeight == true && row.isFourWeight == true) {
  2483. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2484. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  2485. }
  2486. // 1班3班锁定4班未锁定
  2487. if (row.isOneWeight == true && row.isThreeWeight == true && row.isFourWeight == false) {
  2488. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2489. row.w4 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2) - parseFloat(row.w3), parseInt(Cookies.get('decimal')))
  2490. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2491. if (row.w4 <= 0) {
  2492. row.w4 = 0
  2493. row.r4 = 0
  2494. }
  2495. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  2496. }
  2497. // 1班4班锁定3班未锁定
  2498. if (row.isOneWeight == true && row.isFourWeight == true && row.isThreeWeight == false) {
  2499. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2500. row.w3 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2) - parseFloat(row.w4), parseInt(Cookies.get('decimal')))
  2501. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2502. if (row.w3 <= 0) {
  2503. row.w3 = 0
  2504. row.r3 = 0
  2505. }
  2506. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  2507. }
  2508. // 3班4班锁定1班未锁定
  2509. if (row.isOneWeight == false && row.isThreeWeight == true && row.isFourWeight == true) {
  2510. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2511. row.w1 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w2) - parseFloat(row.w3) - parseFloat(row.w4), parseInt(Cookies.get('decimal')))
  2512. row.r1 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2513. if (row.w1 <= 0) {
  2514. row.w1 = 0
  2515. row.r1 = 0
  2516. }
  2517. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  2518. }
  2519. // 1班锁定,3班4班未锁
  2520. if (row.isOneWeight == true && row.isThreeWeight == false && row.isFourWeight == false) {
  2521. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2522. if (row.r3 == 0 && row.r4 == 0) {
  2523. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2)) / 2, parseInt(Cookies.get('decimal')))
  2524. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2525. row.w4 = row.w3
  2526. row.r4 = row.r3
  2527. } else if (row.r3 == 0 && row.r4 !== 0) {
  2528. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2) - parseFloat(row.w4)), parseInt(Cookies.get('decimal')))
  2529. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2530. if (row.w1 == '') { row.w1 = 0 }
  2531. if (row.w2 == '') { row.w2 = 0 }
  2532. if (row.w3 == '') { row.w3 = 0 }
  2533. if (row.w4 == '') { row.w4 = 0 }
  2534. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2535. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2536. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2537. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2538. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2539. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2540. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow2.dailyWeight)) {
  2541. row.w4 = formatNum((parseFloat(this.focusWRow2.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2)) * parseFloat(row.r4) / (parseFloat(this.focusWRow2.r3) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
  2542. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2543. }
  2544. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2545. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2546. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2547. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2548. } else if (row.r3 !== 0 && row.r4 == 0) {
  2549. row.w4 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2) - parseFloat(row.w3)), parseInt(Cookies.get('decimal')))
  2550. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2551. if (row.w1 == '') { row.w1 = 0 }
  2552. if (row.w2 == '') { row.w2 = 0 }
  2553. if (row.w3 == '') { row.w3 = 0 }
  2554. if (row.w4 == '') { row.w4 = 0 }
  2555. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2556. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2557. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2558. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2559. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2560. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2561. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow2.dailyWeight)) {
  2562. row.w3 = formatNum((parseFloat(this.focusWRow2.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2)) * parseFloat(row.r3) / (parseFloat(row.r3) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
  2563. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2564. }
  2565. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2566. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2567. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2568. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2569. } else {
  2570. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2)) * parseFloat(row.r3) / (parseFloat(row.r3) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
  2571. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2572. row.w4 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2)) * parseFloat(row.r4) / (parseFloat(this.focusWRow2.r3) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
  2573. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2574. }
  2575. if (isNaN(row.w3)) {
  2576. row.w3 = 0
  2577. row.r3 = 0
  2578. }
  2579. if (isNaN(row.w4)) {
  2580. row.w4 = 0
  2581. row.r4 = 0
  2582. }
  2583. if (row.w3 <= 0) {
  2584. row.w3 = 0
  2585. row.r3 = 0
  2586. }
  2587. if (row.w4 <= 0) {
  2588. row.w4 = 0
  2589. row.r4 = 0
  2590. }
  2591. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  2592. }
  2593. // 3班锁定,1班4班未锁
  2594. if (row.isOneWeight == false && row.isThreeWeight == true && row.isFourWeight == false) {
  2595. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2596. if (row.r1 == 0 && row.r4 == 0) {
  2597. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3) - parseFloat(row.w2)) / 2, parseInt(Cookies.get('decimal')))
  2598. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2599. row.w4 = row.w1
  2600. row.r4 = row.r1
  2601. } else if (row.r1 == 0 && row.r4 !== 0) {
  2602. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3) - parseFloat(row.w2) - parseFloat(row.w4)), parseInt(Cookies.get('decimal')))
  2603. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2604. if (row.w1 == '') { row.w1 = 0 }
  2605. if (row.w2 == '') { row.w2 = 0 }
  2606. if (row.w3 == '') { row.w3 = 0 }
  2607. if (row.w4 == '') { row.w4 = 0 }
  2608. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2609. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2610. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2611. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2612. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2613. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2614. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow2.dailyWeight)) {
  2615. row.w4 = formatNum((parseFloat(this.focusWRow2.dailyWeight) - parseFloat(row.w3) - parseFloat(row.w2)) * parseFloat(row.r4) / (parseFloat(this.focusWRow2.r1) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
  2616. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2617. }
  2618. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2619. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2620. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2621. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2622. } else if (row.r1 !== 0 && row.r4 == 0) {
  2623. row.w4 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3) - parseFloat(row.w2) - parseFloat(row.w1)), parseInt(Cookies.get('decimal')))
  2624. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2625. if (row.w1 == '') { row.w1 = 0 }
  2626. if (row.w2 == '') { row.w2 = 0 }
  2627. if (row.w3 == '') { row.w3 = 0 }
  2628. if (row.w4 == '') { row.w4 = 0 }
  2629. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2630. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2631. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2632. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2633. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2634. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2635. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow2.dailyWeight)) {
  2636. row.w1 = formatNum((parseFloat(this.focusWRow2.dailyWeight) - parseFloat(row.w3) - parseFloat(row.w2)) * parseFloat(row.r1) / (parseFloat(row.r1) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
  2637. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2638. }
  2639. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2640. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2641. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2642. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2643. } else {
  2644. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3) - parseFloat(row.w2)) * parseFloat(row.r1) / (parseFloat(row.r1) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
  2645. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2646. row.w4 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3) - parseFloat(row.w2)) * parseFloat(row.r4) / (parseFloat(this.focusWRow2.r1) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
  2647. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2648. }
  2649. if (isNaN(row.w1)) {
  2650. row.w1 = 0
  2651. row.r1 = 0
  2652. }
  2653. if (isNaN(row.w4)) {
  2654. row.w4 = 0
  2655. row.r4 = 0
  2656. }
  2657. if (row.w1 <= 0) {
  2658. row.w1 = 0
  2659. row.r1 = 0
  2660. }
  2661. if (row.w4 <= 0) {
  2662. row.w4 = 0
  2663. row.r4 = 0
  2664. }
  2665. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  2666. }
  2667. // 4班锁定,1班3班未锁
  2668. if (row.isOneWeight == false && row.isThreeWeight == false && row.isFourWeight == true) {
  2669. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2670. if (row.r1 == 0 && row.r3 == 0) {
  2671. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w2)) / 2, parseInt(Cookies.get('decimal')))
  2672. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2673. row.w3 = row.w1
  2674. row.r3 = row.r1
  2675. } else if (row.r1 == 0 && row.r3 !== 0) {
  2676. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w2) - parseFloat(row.w3)), parseInt(Cookies.get('decimal')))
  2677. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2678. if (row.w1 == '') { row.w1 = 0 }
  2679. if (row.w2 == '') { row.w2 = 0 }
  2680. if (row.w3 == '') { row.w3 = 0 }
  2681. if (row.w4 == '') { row.w4 = 0 }
  2682. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2683. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2684. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2685. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2686. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2687. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2688. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow2.dailyWeight)) {
  2689. row.w3 = formatNum((parseFloat(this.focusWRow2.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w2)) * parseFloat(row.r3) / (parseFloat(row.r3) + parseFloat(this.focusWRow2.r1)), parseInt(Cookies.get('decimal')))
  2690. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2691. }
  2692. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2693. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2694. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2695. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2696. } else if (row.r1 !== 0 && row.r3 == 0) {
  2697. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w2) - parseFloat(row.w1)), parseInt(Cookies.get('decimal')))
  2698. row.r3 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2699. if (row.w1 == '') { row.w1 = 0 }
  2700. if (row.w2 == '') { row.w2 = 0 }
  2701. if (row.w3 == '') { row.w3 = 0 }
  2702. if (row.w4 == '') { row.w4 = 0 }
  2703. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2704. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2705. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2706. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2707. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2708. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2709. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow2.dailyWeight)) {
  2710. row.w1 = formatNum((parseFloat(this.focusWRow2.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w2)) * parseFloat(row.r1) / (parseFloat(row.r1) + parseFloat(row.r3)), parseInt(Cookies.get('decimal')))
  2711. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2712. }
  2713. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2714. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2715. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2716. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2717. } else {
  2718. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w2)) * parseFloat(row.r1) / (parseFloat(row.r1) + parseFloat(row.r3)), parseInt(Cookies.get('decimal')))
  2719. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2720. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w2)) * parseFloat(row.r3) / (parseFloat(row.r3) + parseFloat(this.focusWRow2.r1)), parseInt(Cookies.get('decimal')))
  2721. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2722. }
  2723. if (isNaN(row.w1)) {
  2724. row.w1 = 0
  2725. row.r1 = 0
  2726. }
  2727. if (isNaN(row.w3)) {
  2728. row.w3 = 0
  2729. row.r3 = 0
  2730. }
  2731. if (row.w1 <= 0) {
  2732. row.w1 = 0
  2733. row.r1 = 0
  2734. }
  2735. if (row.w3 <= 0) {
  2736. row.w3 = 0
  2737. row.r3 = 0
  2738. }
  2739. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  2740. }
  2741. // 1班3班4班未锁
  2742. if (row.isOneWeight == false && row.isThreeWeight == false && row.isFourWeight == false) {
  2743. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2744. if (row.r1 == 0 && row.r3 == 0 && row.r4 == 0) {
  2745. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w2)) / 3, parseInt(Cookies.get('decimal')))
  2746. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2747. row.w3 = row.w1
  2748. row.r3 = row.r1
  2749. row.w4 = row.w1
  2750. row.r4 = row.r1
  2751. } else if (row.r1 == 0 && row.r3 == 0 && row.r4 !== 0) {
  2752. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w2) - parseFloat(row.w4)) / 2, parseInt(Cookies.get('decimal')))
  2753. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2754. row.w3 = row.w1
  2755. row.r3 = row.r1
  2756. if (row.w1 == '') { row.w1 = 0 }
  2757. if (row.w2 == '') { row.w2 = 0 }
  2758. if (row.w3 == '') { row.w3 = 0 }
  2759. if (row.w4 == '') { row.w4 = 0 }
  2760. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2761. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2762. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2763. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2764. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2765. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2766. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow2.dailyWeight)) {
  2767. row.w4 = formatNum((parseFloat(this.focusWRow2.dailyWeight) - parseFloat(row.w2)) * parseFloat(row.r4) / (parseFloat(this.focusWRow2.r1) + parseFloat(this.focusWRow2.r3) + parseFloat(this.focusWRow2.r4)), parseInt(Cookies.get('decimal')))
  2768. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2769. }
  2770. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2771. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2772. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2773. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2774. } else if (row.r1 == 0 && row.r3 !== 0 && row.r4 == 0) {
  2775. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w2) - parseFloat(row.w3)) / 2, parseInt(Cookies.get('decimal')))
  2776. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2777. row.w4 = row.w1
  2778. row.r4 = row.r1
  2779. if (row.w1 == '') { row.w1 = 0 }
  2780. if (row.w2 == '') { row.w2 = 0 }
  2781. if (row.w3 == '') { row.w3 = 0 }
  2782. if (row.w4 == '') { row.w4 = 0 }
  2783. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2784. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2785. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2786. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2787. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2788. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2789. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow2.dailyWeight)) {
  2790. row.w3 = formatNum((parseFloat(this.focusWRow2.dailyWeight) - parseFloat(row.w2)) * parseFloat(row.r3) / (parseFloat(this.focusWRow2.r1) + parseFloat(this.focusWRow2.r3) + parseFloat(this.focusWRow2.r4)), parseInt(Cookies.get('decimal')))
  2791. row.r3 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2792. }
  2793. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2794. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2795. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2796. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2797. } else if (row.r1 !== 0 && row.r3 == 0 && row.r4 == 0) {
  2798. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w2) - parseFloat(row.w1)) / 2, parseInt(Cookies.get('decimal')))
  2799. row.r3 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2800. row.w4 = row.w3
  2801. row.r4 = row.r3
  2802. if (row.w1 == '') { row.w1 = 0 }
  2803. if (row.w2 == '') { row.w2 = 0 }
  2804. if (row.w3 == '') { row.w3 = 0 }
  2805. if (row.w4 == '') { row.w4 = 0 }
  2806. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2807. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2808. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2809. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2810. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2811. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2812. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow2.dailyWeight)) {
  2813. console.log('huijia;')
  2814. row.w1 = formatNum((parseFloat(this.focusWRow2.dailyWeight) - parseFloat(row.w2)) * parseFloat(row.r1) / (parseFloat(row.r1) + parseFloat(row.r3) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
  2815. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2816. }
  2817. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2818. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2819. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2820. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2821. } else if ((row.r1 !== 0 && row.r3 !== 0 && row.r4 == 0)) {
  2822. row.w4 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w2) - parseFloat(row.w1) - parseFloat(row.w3)), parseInt(Cookies.get('decimal')))
  2823. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2824. if (row.w1 == '') { row.w1 = 0 }
  2825. if (row.w2 == '') { row.w2 = 0 }
  2826. if (row.w3 == '') { row.w3 = 0 }
  2827. if (row.w4 == '') { row.w4 = 0 }
  2828. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2829. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2830. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2831. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2832. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2833. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2834. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow2.dailyWeight)) {
  2835. row.w1 = formatNum((parseFloat(this.focusWRow2.dailyWeight) - parseFloat(row.w2)) * parseFloat(row.r1) / (parseFloat(row.r1) + parseFloat(row.r3) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
  2836. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2837. row.w3 = formatNum((parseFloat(this.focusWRow2.dailyWeight) - parseFloat(row.w2)) * parseFloat(row.r3) / (parseFloat(this.focusWRow2.r1) + parseFloat(this.focusWRow2.r3) + parseFloat(this.focusWRow2.r4)), parseInt(Cookies.get('decimal')))
  2838. row.r3 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2839. }
  2840. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2841. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2842. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2843. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2844. } else if ((row.r1 !== 0 && row.r3 == 0 && row.r4 !== 0)) {
  2845. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w2) - parseFloat(row.w1) - parseFloat(row.w4)), parseInt(Cookies.get('decimal')))
  2846. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2847. if (row.w1 == '') { row.w1 = 0 }
  2848. if (row.w2 == '') { row.w2 = 0 }
  2849. if (row.w3 == '') { row.w3 = 0 }
  2850. if (row.w4 == '') { row.w4 = 0 }
  2851. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2852. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2853. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2854. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2855. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2856. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2857. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow2.dailyWeight)) {
  2858. row.w1 = formatNum((parseFloat(this.focusWRow2.dailyWeight) - parseFloat(row.w2)) * parseFloat(row.r1) / (parseFloat(row.r1) + parseFloat(row.r3) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
  2859. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2860. row.w4 = formatNum((parseFloat(this.focusWRow2.dailyWeight) - parseFloat(row.w2)) * parseFloat(row.r4) / (parseFloat(this.focusWRow2.r1) + parseFloat(this.focusWRow2.r3) + parseFloat(this.focusWRow2.r4)), parseInt(Cookies.get('decimal')))
  2861. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2862. }
  2863. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2864. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2865. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2866. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2867. } else if ((row.r1 == 0 && row.r3 !== 0 && row.r4 !== 0)) {
  2868. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w2) - parseFloat(row.w3) - parseFloat(row.w4)), parseInt(Cookies.get('decimal')))
  2869. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2870. if (row.w1 == '') { row.w1 = 0 }
  2871. if (row.w2 == '') { row.w2 = 0 }
  2872. if (row.w3 == '') { row.w3 = 0 }
  2873. if (row.w4 == '') { row.w4 = 0 }
  2874. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2875. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2876. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2877. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2878. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2879. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2880. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow2.dailyWeight)) {
  2881. row.w3 = formatNum((parseFloat(this.focusWRow2.dailyWeight) - parseFloat(row.w2)) * parseFloat(row.r3) / (parseFloat(this.focusWRow2.r1) + parseFloat(this.focusWRow2.r3) + parseFloat(this.focusWRow2.r4)), parseInt(Cookies.get('decimal')))
  2882. row.r3 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2883. row.w4 = formatNum((parseFloat(this.focusWRow2.dailyWeight) - parseFloat(row.w2)) * parseFloat(row.r4) / (parseFloat(this.focusWRow2.r1) + parseFloat(this.focusWRow2.r3) + parseFloat(this.focusWRow2.r4)), parseInt(Cookies.get('decimal')))
  2884. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2885. }
  2886. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2887. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2888. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2889. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2890. } else {
  2891. console.log('wolaile')
  2892. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w2)) * parseFloat(row.r1) / (parseFloat(row.r1) + parseFloat(row.r3) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
  2893. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2894. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w2)) * parseFloat(row.r3) / (parseFloat(this.focusWRow2.r1) + parseFloat(this.focusWRow2.r3) + parseFloat(this.focusWRow2.r4)), parseInt(Cookies.get('decimal')))
  2895. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2896. row.w4 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w2)) * parseFloat(row.r4) / (parseFloat(this.focusWRow2.r1) + parseFloat(this.focusWRow2.r3) + parseFloat(this.focusWRow2.r4)), parseInt(Cookies.get('decimal')))
  2897. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2898. }
  2899. if (isNaN(row.w1)) {
  2900. row.w1 = 0
  2901. row.r1 = 0
  2902. }
  2903. if (isNaN(row.w3)) {
  2904. row.w3 = 0
  2905. row.r3 = 0
  2906. }
  2907. if (isNaN(row.w4)) {
  2908. row.w4 = 0
  2909. row.r4 = 0
  2910. }
  2911. if (row.w1 <= 0) {
  2912. row.w1 = 0
  2913. row.r1 = 0
  2914. }
  2915. if (row.w3 <= 0) {
  2916. row.w3 = 0
  2917. row.r3 = 0
  2918. }
  2919. if (row.w4 <= 0) {
  2920. row.w4 = 0
  2921. row.r4 = 0
  2922. }
  2923. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  2924. }
  2925. } else if (this.table.RWLength == 3) {
  2926. // 三班
  2927. // 1班/3班锁定
  2928. if (row.isOneWeight == true && row.isThreeWeight == true) {
  2929. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2930. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3), parseInt(Cookies.get('decimal'))))
  2931. }
  2932. // 1班不锁3班锁
  2933. if (row.isOneWeight == false && row.isThreeWeight == true) {
  2934. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2935. row.w1 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w2) - parseFloat(row.w3), parseInt(Cookies.get('decimal')))
  2936. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2937. if (row.w1 <= 0) {
  2938. row.w1 = 0
  2939. row.r1 = 0
  2940. }
  2941. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3), parseInt(Cookies.get('decimal'))))
  2942. }
  2943. // 3班不锁1班锁
  2944. if (row.isOneWeight == true && row.isThreeWeight == false) {
  2945. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2946. row.w3 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2), parseInt(Cookies.get('decimal')))
  2947. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2948. if (row.w3 <= 0) {
  2949. row.w3 = 0
  2950. row.r3 = 0
  2951. }
  2952. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3), parseInt(Cookies.get('decimal'))))
  2953. }
  2954. // 1班3班都不锁
  2955. if (row.isOneWeight == false && row.isThreeWeight == false) {
  2956. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2957. if (row.r1 == 0 && row.r3 == 0) {
  2958. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w2)) / 2, parseInt(Cookies.get('decimal')))
  2959. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2960. row.w3 = row.w1
  2961. row.r3 = row.r1
  2962. } else if (row.r1 == 0 && row.r3 !== 0) {
  2963. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w2) - parseFloat(row.w3)), parseInt(Cookies.get('decimal')))
  2964. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2965. if (row.w1 == '') { row.w1 = 0 }
  2966. if (row.w2 == '') { row.w2 = 0 }
  2967. if (row.w3 == '') { row.w3 = 0 }
  2968. if (row.w4 == '') { row.w4 = 0 }
  2969. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2970. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2971. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2972. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2973. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2974. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2975. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow2.dailyWeight)) {
  2976. row.w3 = formatNum((parseFloat(this.focusWRow2.dailyWeight) - parseFloat(row.w2)) * parseFloat(row.r3) / (parseFloat(this.focusWRow2.r1) + parseFloat(row.r3)), parseInt(Cookies.get('decimal')))
  2977. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2978. }
  2979. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2980. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2981. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2982. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2983. } else if (row.r1 !== 0 && row.r3 == 0) {
  2984. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w2) - parseFloat(row.w1)), parseInt(Cookies.get('decimal')))
  2985. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2986. if (row.w1 == '') { row.w1 = 0 }
  2987. if (row.w2 == '') { row.w2 = 0 }
  2988. if (row.w3 == '') { row.w3 = 0 }
  2989. if (row.w4 == '') { row.w4 = 0 }
  2990. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2991. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2992. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2993. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2994. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2995. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2996. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow2.dailyWeight)) {
  2997. row.w1 = formatNum((parseFloat(this.focusWRow2.dailyWeight) - parseFloat(row.w2)) * parseFloat(row.r1) / (parseFloat(row.r1) + parseFloat(row.r3)), parseInt(Cookies.get('decimal')))
  2998. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2999. }
  3000. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3001. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3002. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3003. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3004. } else {
  3005. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w2)) * parseFloat(row.r1) / (parseFloat(row.r1) + parseFloat(row.r3)), parseInt(Cookies.get('decimal')))
  3006. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3007. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w2)) * parseFloat(row.r3) / (parseFloat(this.focusWRow2.r1) + parseFloat(row.r3)), parseInt(Cookies.get('decimal')))
  3008. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3009. }
  3010. if (isNaN(row.w1)) {
  3011. row.w1 = 0
  3012. row.r1 = 0
  3013. }
  3014. if (isNaN(row.w3)) {
  3015. row.w3 = 0
  3016. row.r3 = 0
  3017. }
  3018. if (row.w3 <= 0) {
  3019. row.w3 = 0
  3020. row.r3 = 0
  3021. }
  3022. if (row.w1 <= 0) {
  3023. row.w1 = 0
  3024. row.r1 = 0
  3025. }
  3026. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3), parseInt(Cookies.get('decimal'))))
  3027. }
  3028. } else if (this.table.RWLength == 2) {
  3029. if (row.isOneWeight == false) {
  3030. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3031. row.w1 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w2), parseInt(Cookies.get('decimal')))
  3032. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3033. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3034. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2), parseInt(Cookies.get('decimal'))))
  3035. } else {
  3036. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3037. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2), parseInt(Cookies.get('decimal'))))
  3038. }
  3039. }
  3040. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3041. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3042. if (row.w1 == '') { row.w1 = 0 }
  3043. if (row.w2 == '') { row.w2 = 0 }
  3044. if (row.w3 == '') { row.w3 = 0 }
  3045. if (row.w4 == '') { row.w4 = 0 }
  3046. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3047. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3048. },
  3049. blurW3(row) {
  3050. // 3班重量
  3051. if (row.w1 == '') {
  3052. row.w1 = 0
  3053. }
  3054. if (row.w2 == '') {
  3055. row.w2 = 0
  3056. }
  3057. if (row.w3 == '') {
  3058. row.w3 = 0
  3059. }
  3060. if (row.w4 == '') {
  3061. row.w4 = 0
  3062. }
  3063. if (row.r1 == '') {
  3064. row.r1 = 0
  3065. }
  3066. if (row.r2 == '') {
  3067. row.r2 = 0
  3068. }
  3069. if (row.r3 == '') {
  3070. row.r3 = 0
  3071. }
  3072. if (row.r4 == '') {
  3073. row.r4 = 0
  3074. }
  3075. // row.ftweight = parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4)
  3076. console.log(row, '=======投喂量feedweight')
  3077. // isOneWeight,isTwoWeight,isThreeWeight,isFourWeight
  3078. if (this.table.RWLength == 4) {
  3079. // 四班
  3080. // 1班2班4班都锁定
  3081. if (row.isOneWeight == true && row.isTwoWeight == true && row.isFourWeight == true) {
  3082. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3083. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  3084. }
  3085. // 1班2班锁定4班未锁定
  3086. if (row.isOneWeight == true && row.isTwoWeight == true && row.isFourWeight == false) {
  3087. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3088. row.w4 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2) - parseFloat(row.w3), parseInt(Cookies.get('decimal')))
  3089. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3090. if (row.w4 <= 0) {
  3091. row.w4 = 0
  3092. row.r4 = 0
  3093. }
  3094. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  3095. }
  3096. // 2班4班锁定1班未锁定
  3097. if (row.isOneWeight == false && row.isTwoWeight == true && row.isFourWeight == true) {
  3098. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3099. row.w1 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w2) - parseFloat(row.w3) - parseFloat(row.w4), parseInt(Cookies.get('decimal')))
  3100. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3101. if (row.w1 <= 0) {
  3102. row.w1 = 0
  3103. row.r1 = 0
  3104. }
  3105. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  3106. }
  3107. // 1班4班锁定2班未锁定
  3108. if (row.isTwoWeight == false && row.isOneWeight == true && row.isFourWeight == true) {
  3109. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3110. row.w2 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w3) - parseFloat(row.w4), parseInt(Cookies.get('decimal')))
  3111. row.r2 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3112. if (row.w2 <= 0) {
  3113. row.w2 = 0
  3114. row.r2 = 0
  3115. }
  3116. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  3117. }
  3118. // 2班锁定,1班4班未锁
  3119. if (row.isTwoWeight == true && row.isOneWeight == false && row.isFourWeight == false) {
  3120. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3121. if (row.r1 == 0 && row.r4 == 0) {
  3122. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w2) - parseFloat(row.w3)) / 2, parseInt(Cookies.get('decimal')))
  3123. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3124. row.w4 = row.w1
  3125. row.r4 = row.r1
  3126. } else if (row.r1 == 0 && row.r4 !== 0) {
  3127. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w2) - parseFloat(row.w3) - parseFloat(row.w4)), parseInt(Cookies.get('decimal')))
  3128. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3129. if (row.w1 == '') { row.w1 = 0 }
  3130. if (row.w2 == '') { row.w2 = 0 }
  3131. if (row.w3 == '') { row.w3 = 0 }
  3132. if (row.w4 == '') { row.w4 = 0 }
  3133. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3134. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3135. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3136. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3137. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3138. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3139. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow3.dailyWeight)) {
  3140. row.w4 = formatNum((parseFloat(this.focusWRow3.dailyWeight) - parseFloat(row.w2) - parseFloat(row.w3)) * parseFloat(row.r4) / (parseFloat(this.focusWRow3.r1) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
  3141. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3142. }
  3143. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3144. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3145. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3146. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3147. } else if (row.r1 !== 0 && row.r4 == 0) {
  3148. row.w4 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w2) - parseFloat(row.w3) - parseFloat(row.w1)), parseInt(Cookies.get('decimal')))
  3149. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3150. if (row.w1 == '') { row.w1 = 0 }
  3151. if (row.w2 == '') { row.w2 = 0 }
  3152. if (row.w3 == '') { row.w3 = 0 }
  3153. if (row.w4 == '') { row.w4 = 0 }
  3154. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3155. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3156. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3157. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3158. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3159. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3160. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow3.dailyWeight)) {
  3161. row.w1 = formatNum((parseFloat(this.focusWRow3.dailyWeight) - parseFloat(row.w2) - parseFloat(row.w3)) * parseFloat(row.r1) / (parseFloat(row.r1) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
  3162. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3163. }
  3164. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3165. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3166. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3167. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3168. } else {
  3169. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w2) - parseFloat(row.w3)) * parseFloat(row.r1) / (parseFloat(row.r1) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
  3170. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3171. row.w4 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w2) - parseFloat(row.w3)) * parseFloat(row.r4) / (parseFloat(this.focusWRow3.r1) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
  3172. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3173. }
  3174. if (isNaN(row.w1)) {
  3175. row.w1 = 0
  3176. row.r1 = 0
  3177. }
  3178. if (isNaN(row.w4)) {
  3179. row.w4 = 0
  3180. row.r4 = 0
  3181. }
  3182. if (row.w1 <= 0) {
  3183. row.w1 = 0
  3184. row.r1 = 0
  3185. }
  3186. if (row.w4 <= 0) {
  3187. row.w4 = 0
  3188. row.r4 = 0
  3189. }
  3190. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  3191. }
  3192. // 1班锁定,2班4班未锁
  3193. if (row.isTwoWeight == false && row.isOneWeight == true && row.isFourWeight == false) {
  3194. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3195. if (row.r2 == 0 && row.r4 == 0) {
  3196. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w3)) / 2, parseInt(Cookies.get('decimal')))
  3197. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3198. row.w4 = row.w2
  3199. row.r4 = row.r2
  3200. } else if (row.r2 == 0 && row.r4 !== 0) {
  3201. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w3) - parseFloat(row.w4)), parseInt(Cookies.get('decimal')))
  3202. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3203. if (row.w1 == '') { row.w1 = 0 }
  3204. if (row.w2 == '') { row.w2 = 0 }
  3205. if (row.w3 == '') { row.w3 = 0 }
  3206. if (row.w4 == '') { row.w4 = 0 }
  3207. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3208. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3209. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3210. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3211. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3212. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3213. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow3.dailyWeight)) {
  3214. row.w4 = formatNum((parseFloat(this.focusWRow3.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w3)) * parseFloat(row.r4) / (parseFloat(this.focusWRow3.r2) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
  3215. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3216. }
  3217. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3218. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3219. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3220. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3221. } else if (row.r2 !== 0 && row.r4 == 0) {
  3222. row.w4 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w3) - parseFloat(row.w2)), parseInt(Cookies.get('decimal')))
  3223. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3224. if (row.w1 == '') { row.w1 = 0 }
  3225. if (row.w2 == '') { row.w2 = 0 }
  3226. if (row.w3 == '') { row.w3 = 0 }
  3227. if (row.w4 == '') { row.w4 = 0 }
  3228. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3229. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3230. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3231. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3232. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3233. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3234. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow3.dailyWeight)) {
  3235. row.w2 = formatNum((parseFloat(this.focusWRow3.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w3)) * parseFloat(row.r2) / (parseFloat(row.r2) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
  3236. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3237. }
  3238. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3239. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3240. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3241. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3242. } else {
  3243. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w3)) * parseFloat(row.r2) / (parseFloat(row.r2) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
  3244. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3245. row.w4 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w3)) * parseFloat(row.r4) / (parseFloat(this.focusWRow3.r2) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
  3246. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3247. }
  3248. if (isNaN(row.w2)) {
  3249. row.w2 = 0
  3250. row.r2 = 0
  3251. }
  3252. if (isNaN(row.w4)) {
  3253. row.w4 = 0
  3254. row.r4 = 0
  3255. }
  3256. if (row.w2 <= 0) {
  3257. row.w2 = 0
  3258. row.r2 = 0
  3259. }
  3260. if (row.w4 <= 0) {
  3261. row.w4 = 0
  3262. row.r4 = 0
  3263. }
  3264. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  3265. }
  3266. // 4班锁定,2班1班未锁
  3267. if (row.isTwoWeight == false && row.isOneWeight == false && row.isFourWeight == true) {
  3268. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3269. if (row.r1 == 0 && row.r2 == 0) {
  3270. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3) - parseFloat(row.w4)) / 2, parseInt(Cookies.get('decimal')))
  3271. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3272. row.w2 = row.w1
  3273. row.r2 = row.r1
  3274. } else if (row.r1 == 0 && row.r2 !== 0) {
  3275. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3) - parseFloat(row.w4) - parseFloat(row.w2)), parseInt(Cookies.get('decimal')))
  3276. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3277. if (row.w1 == '') { row.w1 = 0 }
  3278. if (row.w2 == '') { row.w2 = 0 }
  3279. if (row.w3 == '') { row.w3 = 0 }
  3280. if (row.w4 == '') { row.w4 = 0 }
  3281. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3282. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3283. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3284. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3285. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3286. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3287. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow3.dailyWeight)) {
  3288. row.w2 = formatNum((parseFloat(this.focusWRow3.dailyWeight) - parseFloat(row.w3) - parseFloat(row.w4)) * parseFloat(row.r2) / (parseFloat(this.focusWRow3.r1) + parseFloat(row.r2)), parseInt(Cookies.get('decimal')))
  3289. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3290. }
  3291. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3292. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3293. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3294. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3295. } else if (row.r1 !== 0 && row.r2 == 0) {
  3296. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3) - parseFloat(row.w4) - parseFloat(row.w1)), parseInt(Cookies.get('decimal')))
  3297. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3298. if (row.w1 == '') { row.w1 = 0 }
  3299. if (row.w2 == '') { row.w2 = 0 }
  3300. if (row.w3 == '') { row.w3 = 0 }
  3301. if (row.w4 == '') { row.w4 = 0 }
  3302. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3303. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3304. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3305. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3306. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3307. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3308. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow3.dailyWeight)) {
  3309. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3) - parseFloat(row.w4)) * parseFloat(row.r1) / (parseFloat(this.focusWRow3.r1) + parseFloat(row.r2)), parseInt(Cookies.get('decimal')))
  3310. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3311. }
  3312. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3313. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3314. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3315. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3316. } else {
  3317. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3) - parseFloat(row.w4)) * parseFloat(row.r1) / (parseFloat(this.focusWRow3.r1) + parseFloat(row.r2)), parseInt(Cookies.get('decimal')))
  3318. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3319. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3) - parseFloat(row.w4)) * parseFloat(row.r2) / (parseFloat(this.focusWRow3.r1) + parseFloat(row.r2)), parseInt(Cookies.get('decimal')))
  3320. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3321. }
  3322. if (isNaN(row.w1)) {
  3323. row.w1 = 0
  3324. row.r1 = 0
  3325. }
  3326. if (isNaN(row.w2)) {
  3327. row.w2 = 0
  3328. row.r2 = 0
  3329. }
  3330. if (row.w2 <= 0) {
  3331. row.w2 = 0
  3332. row.r2 = 0
  3333. }
  3334. if (row.w1 <= 0) {
  3335. row.w1 = 0
  3336. row.r1 = 0
  3337. }
  3338. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  3339. }
  3340. // 2班1班4班未锁
  3341. if (row.isTwoWeight == false && row.isOneWeight == false && row.isFourWeight == false) {
  3342. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3343. if (row.r1 == 0 && row.r2 == 0 && row.r4 == 0) {
  3344. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3)) / 3, parseInt(Cookies.get('decimal')))
  3345. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3346. row.w2 = row.w1
  3347. row.r2 = row.r1
  3348. row.w4 = row.w1
  3349. row.r4 = row.r1
  3350. } else if (row.r1 == 0 && row.r2 == 0 && row.r4 !== 0) {
  3351. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3) - parseFloat(row.w4)) / 2, parseInt(Cookies.get('decimal')))
  3352. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3353. row.w2 = row.w1
  3354. row.r2 = row.r1
  3355. if (row.w1 == '') { row.w1 = 0 }
  3356. if (row.w2 == '') { row.w2 = 0 }
  3357. if (row.w3 == '') { row.w3 = 0 }
  3358. if (row.w4 == '') { row.w4 = 0 }
  3359. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3360. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3361. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3362. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3363. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3364. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3365. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow3.dailyWeight)) {
  3366. row.w4 = formatNum((parseFloat(this.focusWRow3.dailyWeight - row.w3) * parseFloat(row.r4) / (parseFloat(this.focusWRow3.r1) + parseFloat(this.focusWRow3.r2) + parseFloat(this.focusWRow3.r4))), parseInt(Cookies.get('decimal')))
  3367. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3368. }
  3369. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3370. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3371. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3372. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3373. } else if (row.r1 == 0 && row.r2 !== 0 && row.r4 == 0) {
  3374. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3) - parseFloat(row.w2)) / 2, parseInt(Cookies.get('decimal')))
  3375. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3376. row.w4 = row.w1
  3377. row.r4 = row.r1
  3378. if (row.w1 == '') { row.w1 = 0 }
  3379. if (row.w2 == '') { row.w2 = 0 }
  3380. if (row.w3 == '') { row.w3 = 0 }
  3381. if (row.w4 == '') { row.w4 = 0 }
  3382. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3383. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3384. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3385. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3386. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3387. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3388. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow3.dailyWeight)) {
  3389. row.w2 = formatNum((parseFloat(this.focusWRow3.dailyWeight - row.w3) * parseFloat(row.r2) / (parseFloat(this.focusWRow3.r1) + parseFloat(this.focusWRow3.r2) + parseFloat(this.focusWRow3.r4))), parseInt(Cookies.get('decimal')))
  3390. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3391. }
  3392. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3393. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3394. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3395. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3396. } else if (row.r1 !== 0 && row.r2 == 0 && row.r4 == 0) {
  3397. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3) - parseFloat(row.w1)) / 2, parseInt(Cookies.get('decimal')))
  3398. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3399. row.w4 = row.w1
  3400. row.r4 = row.r1
  3401. if (row.w1 == '') { row.w1 = 0 }
  3402. if (row.w2 == '') { row.w2 = 0 }
  3403. if (row.w3 == '') { row.w3 = 0 }
  3404. if (row.w4 == '') { row.w4 = 0 }
  3405. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3406. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3407. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3408. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3409. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3410. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3411. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow3.dailyWeight)) {
  3412. row.w1 = formatNum((parseFloat(this.focusWRow3.dailyWeight) - parseFloat(row.w3)) * parseFloat(row.r1) / (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
  3413. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3414. }
  3415. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3416. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3417. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3418. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3419. } else if (row.r1 !== 0 && row.r2 !== 0 && row.r4 == 0) {
  3420. row.w4 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3) - parseFloat(row.w1) - parseFloat(row.w2)), parseInt(Cookies.get('decimal')))
  3421. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3422. if (row.w1 == '') { row.w1 = 0 }
  3423. if (row.w2 == '') { row.w2 = 0 }
  3424. if (row.w3 == '') { row.w3 = 0 }
  3425. if (row.w4 == '') { row.w4 = 0 }
  3426. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3427. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3428. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3429. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3430. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3431. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3432. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow3.dailyWeight)) {
  3433. row.w1 = formatNum((parseFloat(this.focusWRow3.dailyWeight) - parseFloat(row.w3)) * parseFloat(row.r1) / (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
  3434. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3435. row.w2 = formatNum((parseFloat(this.focusWRow3.dailyWeight - row.w3) * parseFloat(row.r2) / (parseFloat(this.focusWRow3.r1) + parseFloat(this.focusWRow3.r2) + parseFloat(this.focusWRow3.r4))), parseInt(Cookies.get('decimal')))
  3436. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3437. }
  3438. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3439. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3440. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3441. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3442. } else if (row.r1 !== 0 && row.r2 == 0 && row.r4 !== 0) {
  3443. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3) - parseFloat(row.w1) - parseFloat(row.w4)), parseInt(Cookies.get('decimal')))
  3444. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3445. if (row.w1 == '') { row.w1 = 0 }
  3446. if (row.w2 == '') { row.w2 = 0 }
  3447. if (row.w3 == '') { row.w3 = 0 }
  3448. if (row.w4 == '') { row.w4 = 0 }
  3449. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3450. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3451. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3452. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3453. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3454. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3455. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow3.dailyWeight)) {
  3456. row.w1 = formatNum((parseFloat(this.focusWRow3.dailyWeight) - parseFloat(row.w3)) * parseFloat(row.r1) / (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
  3457. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3458. row.w4 = formatNum((parseFloat(this.focusWRow3.dailyWeight - row.w3) * parseFloat(row.r4) / (parseFloat(this.focusWRow3.r1) + parseFloat(this.focusWRow3.r2) + parseFloat(this.focusWRow3.r4))), parseInt(Cookies.get('decimal')))
  3459. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3460. }
  3461. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3462. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3463. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3464. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3465. } else if (row.r1 == 0 && row.r2 !== 0 && row.r4 !== 0) {
  3466. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3) - parseFloat(row.w2) - parseFloat(row.w4)), parseInt(Cookies.get('decimal')))
  3467. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3468. if (row.w1 == '') { row.w1 = 0 }
  3469. if (row.w2 == '') { row.w2 = 0 }
  3470. if (row.w3 == '') { row.w3 = 0 }
  3471. if (row.w4 == '') { row.w4 = 0 }
  3472. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3473. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3474. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3475. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3476. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3477. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3478. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow3.dailyWeight)) {
  3479. row.w2 = formatNum((parseFloat(this.focusWRow3.dailyWeight - row.w3) * parseFloat(row.r2) / (parseFloat(this.focusWRow3.r1) + parseFloat(this.focusWRow3.r2) + parseFloat(this.focusWRow3.r4))), parseInt(Cookies.get('decimal')))
  3480. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3481. row.w4 = formatNum((parseFloat(this.focusWRow3.dailyWeight - row.w3) * parseFloat(row.r4) / (parseFloat(this.focusWRow3.r1) + parseFloat(this.focusWRow3.r2) + parseFloat(this.focusWRow3.r4))), parseInt(Cookies.get('decimal')))
  3482. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3483. }
  3484. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3485. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3486. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3487. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3488. } else {
  3489. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3)) * parseFloat(row.r1) / (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
  3490. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3491. row.w2 = formatNum((parseFloat(row.dailyWeight - row.w3) * parseFloat(row.r2) / (parseFloat(this.focusWRow3.r1) + parseFloat(this.focusWRow3.r2) + parseFloat(this.focusWRow3.r4))), parseInt(Cookies.get('decimal')))
  3492. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3493. row.w4 = formatNum((parseFloat(row.dailyWeight - row.w3) * parseFloat(row.r4) / (parseFloat(this.focusWRow3.r1) + parseFloat(this.focusWRow3.r2) + parseFloat(this.focusWRow3.r4))), parseInt(Cookies.get('decimal')))
  3494. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3495. }
  3496. if (isNaN(row.w1)) {
  3497. row.w1 = 0
  3498. row.r1 = 0
  3499. }
  3500. if (isNaN(row.w2)) {
  3501. row.w2 = 0
  3502. row.r2 = 0
  3503. }
  3504. if (isNaN(row.w4)) {
  3505. row.w4 = 0
  3506. row.r4 = 0
  3507. }
  3508. if (row.w1 <= 0) {
  3509. row.w1 = 0
  3510. row.r1 = 0
  3511. }
  3512. if (row.w2 <= 0) {
  3513. row.w2 = 0
  3514. row.r2 = 0
  3515. }
  3516. if (row.w4 <= 0) {
  3517. row.w4 = 0
  3518. row.r4 = 0
  3519. }
  3520. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  3521. }
  3522. } else if (this.table.RWLength == 3) {
  3523. // 三班
  3524. // 1班/2班锁定
  3525. if (row.isOneWeight == true && row.isTwoWeight == true) {
  3526. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3527. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3), parseInt(Cookies.get('decimal'))))
  3528. }
  3529. // 1班不锁2班锁
  3530. if (row.isOneWeight == false && row.isTwoWeight == true) {
  3531. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3532. row.w1 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w2) - parseFloat(row.w3), parseInt(Cookies.get('decimal')))
  3533. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3534. if (row.w1 <= 0) {
  3535. row.w1 = 0
  3536. row.r1 = 0
  3537. }
  3538. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3), parseInt(Cookies.get('decimal'))))
  3539. }
  3540. // 3班不锁2班锁
  3541. // 2班不锁1班锁
  3542. if (row.isOneWeight == true && row.isTwoWeight == false) {
  3543. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3544. row.w2 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w3), parseInt(Cookies.get('decimal')))
  3545. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3546. if (row.w2 <= 0) {
  3547. row.w2 = 0
  3548. row.r2 = 0
  3549. }
  3550. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3), parseInt(Cookies.get('decimal'))))
  3551. }
  3552. // 2班3班都不锁
  3553. // 1班2班都不锁
  3554. if (row.isOneWeight == false && row.isTwoWeight == false) {
  3555. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3556. if (row.r1 == 0 && row.r2 == 0) {
  3557. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3)) / 2, parseInt(Cookies.get('decimal')))
  3558. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3559. row.w2 = row.w1
  3560. row.r2 = row.r1
  3561. } else if (row.r1 == 0 && row.r2 !== 0) {
  3562. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3) - parseFloat(row.w2)), parseInt(Cookies.get('decimal')))
  3563. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3564. if (row.w1 == '') { row.w1 = 0 }
  3565. if (row.w2 == '') { row.w2 = 0 }
  3566. if (row.w3 == '') { row.w3 = 0 }
  3567. if (row.w4 == '') { row.w4 = 0 }
  3568. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3569. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3570. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3571. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3572. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3573. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3574. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow3.dailyWeight)) {
  3575. row.w2 = formatNum((parseFloat(this.focusWRow3.dailyWeight) - parseFloat(row.w3)) * parseFloat(row.r2) / (parseFloat(this.focusWRow3.r1) + parseFloat(row.r2)), parseInt(Cookies.get('decimal')))
  3576. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3577. }
  3578. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3579. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3580. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3581. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3582. } else if (row.r1 !== 0 && row.r2 == 0) {
  3583. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3) - parseFloat(row.w1)), parseInt(Cookies.get('decimal')))
  3584. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3585. if (row.w1 == '') { row.w1 = 0 }
  3586. if (row.w2 == '') { row.w2 = 0 }
  3587. if (row.w3 == '') { row.w3 = 0 }
  3588. if (row.w4 == '') { row.w4 = 0 }
  3589. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3590. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3591. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3592. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3593. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3594. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3595. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow3.dailyWeight)) {
  3596. row.w1 = formatNum((parseFloat(this.focusWRow3.dailyWeight) - parseFloat(row.w3)) * parseFloat(row.r1) / (parseFloat(row.r1) + parseFloat(row.r2)), parseInt(Cookies.get('decimal')))
  3597. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3598. }
  3599. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3600. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3601. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3602. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3603. } else {
  3604. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3)) * parseFloat(row.r1) / (parseFloat(row.r1) + parseFloat(row.r2)), parseInt(Cookies.get('decimal')))
  3605. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3606. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3)) * parseFloat(row.r2) / (parseFloat(this.focusWRow3.r1) + parseFloat(row.r2)), parseInt(Cookies.get('decimal')))
  3607. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3608. }
  3609. if (isNaN(row.w1)) {
  3610. row.w1 = 0
  3611. row.r1 = 0
  3612. }
  3613. if (isNaN(row.w2)) {
  3614. row.w2 = 0
  3615. row.r2 = 0
  3616. }
  3617. if (row.w1 <= 0) {
  3618. row.w1 = 0
  3619. row.r1 = 0
  3620. }
  3621. if (row.w2 <= 0) {
  3622. row.w2 = 0
  3623. row.r2 = 0
  3624. }
  3625. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3), parseInt(Cookies.get('decimal'))))
  3626. }
  3627. }
  3628. if (row.w1 == '') { row.w1 = 0 }
  3629. if (row.w2 == '') { row.w2 = 0 }
  3630. if (row.w3 == '') { row.w3 = 0 }
  3631. if (row.w4 == '') { row.w4 = 0 }
  3632. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3633. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3634. },
  3635. blurW4(row) {
  3636. if (row.w1 == '') {
  3637. row.w1 = 0
  3638. }
  3639. if (row.w2 == '') {
  3640. row.w2 = 0
  3641. }
  3642. if (row.w3 == '') {
  3643. row.w3 = 0
  3644. }
  3645. if (row.w4 == '') {
  3646. row.w4 = 0
  3647. }
  3648. if (row.r1 == '') {
  3649. row.r1 = 0
  3650. }
  3651. if (row.r2 == '') {
  3652. row.r2 = 0
  3653. }
  3654. if (row.r3 == '') {
  3655. row.r3 = 0
  3656. }
  3657. if (row.r4 == '') {
  3658. row.r4 = 0
  3659. }
  3660. // row.ftweight = parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4)
  3661. console.log(row, '=======投喂量feedweight')
  3662. // isOneWeight,isTwoWeight,isThreeWeight,isFourWeight
  3663. if (this.table.RWLength == 4) {
  3664. // 四班
  3665. // 1班2班3班都锁定
  3666. if (row.isOneWeight == true && row.isTwoWeight == true && row.isThreeWeight == true) {
  3667. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3668. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  3669. }
  3670. // 2班3班锁定1班未锁定
  3671. if (row.isOneWeight == false && row.isTwoWeight == true && row.isThreeWeight == true) {
  3672. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3673. row.w1 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w2) - parseFloat(row.w3), parseInt(Cookies.get('decimal')))
  3674. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3675. if (row.w1 <= 0) {
  3676. row.w1 = 0
  3677. row.r1 = 0
  3678. }
  3679. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  3680. }
  3681. // 2班1班锁定3班未锁定
  3682. if (row.isOneWeight == true && row.isTwoWeight == true && row.isThreeWeight == false) {
  3683. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3684. row.w3 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2) - parseFloat(row.w4), parseInt(Cookies.get('decimal')))
  3685. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3686. if (row.w3 <= 0) {
  3687. row.w3 = 0
  3688. row.r3 = 0
  3689. }
  3690. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  3691. }
  3692. // 3班1班锁定2班未锁定
  3693. if (row.isOneWeight == true && row.isTwoWeight == false && row.isThreeWeight == true) {
  3694. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3695. row.w2 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w3) - parseFloat(row.w4), parseInt(Cookies.get('decimal')))
  3696. row.r2 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3697. if (row.w2 <= 0) {
  3698. row.w2 = 0
  3699. row.r2 = 0
  3700. }
  3701. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  3702. }
  3703. // 2班锁定,3班1班未锁
  3704. if (row.isOneWeight == false && row.isTwoWeight == true && row.isThreeWeight == false) {
  3705. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3706. if (row.r1 == 0 && row.r3 == 0) {
  3707. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w2)) / 2, parseInt(Cookies.get('decimal')))
  3708. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3709. row.w3 = row.w1
  3710. row.r3 = row.r1
  3711. } else if (row.r1 == 0 && row.r3 !== 0) {
  3712. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w2) - parseFloat(row.w3)), parseInt(Cookies.get('decimal')))
  3713. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3714. if (row.w1 == '') { row.w1 = 0 }
  3715. if (row.w2 == '') { row.w2 = 0 }
  3716. if (row.w3 == '') { row.w3 = 0 }
  3717. if (row.w4 == '') { row.w4 = 0 }
  3718. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3719. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3720. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3721. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3722. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3723. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3724. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow4.dailyWeight)) {
  3725. row.w3 = formatNum((parseFloat(this.focusWRow4.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w2)) * parseFloat(row.r3) / (parseFloat(row.r3) + parseFloat(this.focusWRow4.r1)), parseInt(Cookies.get('decimal')))
  3726. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3727. }
  3728. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3729. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3730. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3731. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3732. } else if (row.r1 !== 0 && row.r3 == 0) {
  3733. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w2) - parseFloat(row.w1)), parseInt(Cookies.get('decimal')))
  3734. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3735. if (row.w1 == '') { row.w1 = 0 }
  3736. if (row.w2 == '') { row.w2 = 0 }
  3737. if (row.w3 == '') { row.w3 = 0 }
  3738. if (row.w4 == '') { row.w4 = 0 }
  3739. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3740. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3741. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3742. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3743. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3744. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3745. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow4.dailyWeight)) {
  3746. row.w1 = formatNum((parseFloat(this.focusWRow4.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w2)) * parseFloat(row.r1) / (parseFloat(row.r1) + parseFloat(row.r3)), parseInt(Cookies.get('decimal')))
  3747. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3748. }
  3749. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3750. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3751. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3752. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3753. } else {
  3754. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w2)) * parseFloat(row.r1) / (parseFloat(row.r1) + parseFloat(row.r3)), parseInt(Cookies.get('decimal')))
  3755. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3756. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w2)) * parseFloat(row.r3) / (parseFloat(row.r3) + parseFloat(this.focusWRow4.r1)), parseInt(Cookies.get('decimal')))
  3757. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3758. }
  3759. if (isNaN(row.w1)) {
  3760. row.w1 = 0
  3761. row.r1 = 0
  3762. }
  3763. if (isNaN(row.w3)) {
  3764. row.w3 = 0
  3765. row.r3 = 0
  3766. }
  3767. if (row.w3 <= 0) {
  3768. row.w3 = 0
  3769. row.r3 = 0
  3770. }
  3771. if (row.w1 <= 0) {
  3772. row.w1 = 0
  3773. row.r1 = 0
  3774. }
  3775. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  3776. }
  3777. // 3班锁定,2班1班未锁
  3778. if (row.isOneWeight == false && row.isTwoWeight == false && row.isThreeWeight == true) {
  3779. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3780. if (row.r1 == 0 && row.r2 == 0) {
  3781. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w3)) / 2, parseInt(Cookies.get('decimal')))
  3782. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3783. row.w2 = row.w1
  3784. row.r2 = row.r1
  3785. } else if (row.r1 == 0 && row.r2 !== 0) {
  3786. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w3) - parseFloat(row.w2)), parseInt(Cookies.get('decimal')))
  3787. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3788. if (row.w1 == '') { row.w1 = 0 }
  3789. if (row.w2 == '') { row.w2 = 0 }
  3790. if (row.w3 == '') { row.w3 = 0 }
  3791. if (row.w4 == '') { row.w4 = 0 }
  3792. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3793. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3794. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3795. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3796. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3797. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3798. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow4.dailyWeight)) {
  3799. row.w2 = formatNum((parseFloat(this.focusWRow4.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w3)) * parseFloat(row.r2) / (parseFloat(row.r2) + parseFloat(this.focusWRow4.r1)), parseInt(Cookies.get('decimal')))
  3800. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3801. }
  3802. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3803. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3804. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3805. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3806. } else if (row.r1 !== 0 && row.r2 == 0) {
  3807. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w3) - parseFloat(row.w1)), parseInt(Cookies.get('decimal')))
  3808. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3809. if (row.w1 == '') { row.w1 = 0 }
  3810. if (row.w2 == '') { row.w2 = 0 }
  3811. if (row.w3 == '') { row.w3 = 0 }
  3812. if (row.w4 == '') { row.w4 = 0 }
  3813. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3814. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3815. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3816. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3817. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3818. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3819. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow4.dailyWeight)) {
  3820. row.w1 = formatNum((parseFloat(this.focusWRow4.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w3)) * parseFloat(row.r1) / (parseFloat(row.r2) + parseFloat(row.r1)), parseInt(Cookies.get('decimal')))
  3821. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3822. }
  3823. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3824. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3825. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3826. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3827. } else {
  3828. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w3)) * parseFloat(row.r1) / (parseFloat(row.r2) + parseFloat(row.r1)), parseInt(Cookies.get('decimal')))
  3829. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3830. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w3)) * parseFloat(row.r2) / (parseFloat(row.r2) + parseFloat(this.focusWRow4.r1)), parseInt(Cookies.get('decimal')))
  3831. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3832. }
  3833. if (isNaN(row.w1)) {
  3834. row.w1 = 0
  3835. row.r1 = 0
  3836. }
  3837. if (isNaN(row.w2)) {
  3838. row.w2 = 0
  3839. row.r2 = 0
  3840. }
  3841. if (row.w2 <= 0) {
  3842. row.w2 = 0
  3843. row.r2 = 0
  3844. }
  3845. if (row.w1 <= 0) {
  3846. row.w1 = 0
  3847. row.r1 = 0
  3848. }
  3849. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  3850. }
  3851. // 1班锁定,2班3班未锁
  3852. if (row.isOneWeight == true && row.isTwoWeight == false && row.isThreeWeight == false) {
  3853. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3854. if (row.r2 == 0 && row.r3 == 0) {
  3855. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w4)) / 2, parseInt(Cookies.get('decimal')))
  3856. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3857. row.w3 = row.w2
  3858. row.r3 = row.r2
  3859. } else if (row.r2 == 0 && row.r3 !== 0) {
  3860. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w4) - parseFloat(row.w3)), parseInt(Cookies.get('decimal')))
  3861. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3862. if (row.w1 == '') { row.w1 = 0 }
  3863. if (row.w2 == '') { row.w2 = 0 }
  3864. if (row.w3 == '') { row.w3 = 0 }
  3865. if (row.w4 == '') { row.w4 = 0 }
  3866. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3867. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3868. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3869. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3870. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3871. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3872. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow4.dailyWeight)) {
  3873. row.w3 = formatNum((parseFloat(this.focusWRow4.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w4)) * parseFloat(row.r3) / (parseFloat(this.focusWRow4.r2) + parseFloat(row.r3)), parseInt(Cookies.get('decimal')))
  3874. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3875. }
  3876. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3877. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3878. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3879. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3880. } else if (row.r2 !== 0 && row.r3 == 0) {
  3881. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w4) - parseFloat(row.w2)), parseInt(Cookies.get('decimal')))
  3882. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3883. if (row.w1 == '') { row.w1 = 0 }
  3884. if (row.w2 == '') { row.w2 = 0 }
  3885. if (row.w3 == '') { row.w3 = 0 }
  3886. if (row.w4 == '') { row.w4 = 0 }
  3887. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3888. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3889. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3890. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3891. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3892. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3893. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow4.dailyWeight)) {
  3894. row.w2 = formatNum((parseFloat(this.focusWRow4.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w4)) * parseFloat(row.r2) / (parseFloat(row.r2) + parseFloat(row.r3)), parseInt(Cookies.get('decimal')))
  3895. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3896. }
  3897. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3898. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3899. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3900. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3901. } else {
  3902. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w4)) * parseFloat(row.r2) / (parseFloat(row.r2) + parseFloat(row.r3)), parseInt(Cookies.get('decimal')))
  3903. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3904. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w4)) * parseFloat(row.r3) / (parseFloat(this.focusWRow4.r2) + parseFloat(row.r3)), parseInt(Cookies.get('decimal')))
  3905. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3906. }
  3907. if (isNaN(row.w2)) {
  3908. row.w2 = 0
  3909. row.r2 = 0
  3910. }
  3911. if (isNaN(row.w3)) {
  3912. row.w3 = 0
  3913. row.r3 = 0
  3914. }
  3915. if (row.w2 <= 0) {
  3916. row.w2 = 0
  3917. row.r2 = 0
  3918. }
  3919. if (row.w3 <= 0) {
  3920. row.w3 = 0
  3921. row.r3 = 0
  3922. }
  3923. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  3924. }
  3925. // 2班3班1班未锁
  3926. if (row.isOneWeight == false && row.isTwoWeight == false && row.isThreeWeight == false) {
  3927. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3928. if (row.r1 == 0 && row.r2 == 0 && row.r3 == 0) {
  3929. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4)) / 3, parseInt(Cookies.get('decimal')))
  3930. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3931. row.w2 = row.w1
  3932. row.r2 = row.r1
  3933. row.w3 = row.w1
  3934. row.r3 = row.r1
  3935. } else if (row.r1 == 0 && row.r2 == 0 && row.r3 !== 0) {
  3936. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w3)) / 2, parseInt(Cookies.get('decimal')))
  3937. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3938. row.w2 = row.w1
  3939. row.r2 = row.r1
  3940. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3941. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3942. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3943. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3944. if (row.w1 == '') { row.w1 = 0 }
  3945. if (row.w2 == '') { row.w2 = 0 }
  3946. if (row.w3 == '') { row.w3 = 0 }
  3947. if (row.w4 == '') { row.w4 = 0 }
  3948. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3949. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3950. console.log(row.dailyWeight)
  3951. console.log(this.focusWRow4.dailyWeight)
  3952. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow4.dailyWeight)) {
  3953. row.w3 = formatNum((parseFloat(this.focusWRow4.dailyWeight) - parseFloat(row.w4)) * parseFloat(row.r3) / (parseFloat(this.focusWRow4.r1) + parseFloat(this.focusWRow4.r2) + parseFloat(this.focusWRow4.r3)), parseInt(Cookies.get('decimal')))
  3954. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3955. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3956. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3957. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3958. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3959. }
  3960. } else if (row.r1 == 0 && row.r2 !== 0 && row.r3 == 0) {
  3961. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w2)) / 2, parseInt(Cookies.get('decimal')))
  3962. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3963. row.w3 = row.w1
  3964. row.r3 = row.r1
  3965. if (row.w1 == '') { row.w1 = 0 }
  3966. if (row.w2 == '') { row.w2 = 0 }
  3967. if (row.w3 == '') { row.w3 = 0 }
  3968. if (row.w4 == '') { row.w4 = 0 }
  3969. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3970. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3971. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3972. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3973. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3974. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3975. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow4.dailyWeight)) {
  3976. row.w2 = formatNum((parseFloat(this.focusWRow4.dailyWeight) - parseFloat(row.w4)) * parseFloat(row.r2) / (parseFloat(this.focusWRow4.r1) + parseFloat(this.focusWRow4.r2) + parseFloat(this.focusWRow4.r3)), parseInt(Cookies.get('decimal')))
  3977. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3978. }
  3979. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3980. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3981. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3982. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3983. } else if (row.r1 !== 0 && row.r2 == 0 && row.r3 == 0) {
  3984. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w1)) / 2, parseInt(Cookies.get('decimal')))
  3985. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3986. row.w3 = row.w1
  3987. row.r3 = row.r1
  3988. if (row.w1 == '') { row.w1 = 0 }
  3989. if (row.w2 == '') { row.w2 = 0 }
  3990. if (row.w3 == '') { row.w3 = 0 }
  3991. if (row.w4 == '') { row.w4 = 0 }
  3992. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3993. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3994. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3995. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3996. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3997. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3998. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow4.dailyWeight)) {
  3999. row.w1 = formatNum((parseFloat(this.focusWRow4.dailyWeight) - parseFloat(row.w4)) * parseFloat(row.r1) / (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3)), parseInt(Cookies.get('decimal')))
  4000. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  4001. }
  4002. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  4003. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  4004. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  4005. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  4006. } else if (row.r1 !== 0 && row.r2 !== 0 && row.r3 == 0) {
  4007. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w1) - parseFloat(row.w2)), parseInt(Cookies.get('decimal')))
  4008. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  4009. if (row.w1 == '') { row.w1 = 0 }
  4010. if (row.w2 == '') { row.w2 = 0 }
  4011. if (row.w3 == '') { row.w3 = 0 }
  4012. if (row.w4 == '') { row.w4 = 0 }
  4013. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  4014. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  4015. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  4016. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  4017. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  4018. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  4019. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow4.dailyWeight)) {
  4020. row.w1 = formatNum((parseFloat(this.focusWRow4.dailyWeight) - parseFloat(row.w4)) * parseFloat(row.r1) / (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3)), parseInt(Cookies.get('decimal')))
  4021. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  4022. row.w2 = formatNum((parseFloat(this.focusWRow4.dailyWeight) - parseFloat(row.w4)) * parseFloat(row.r2) / (parseFloat(this.focusWRow4.r1) + parseFloat(this.focusWRow4.r2) + parseFloat(this.focusWRow4.r3)), parseInt(Cookies.get('decimal')))
  4023. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  4024. }
  4025. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  4026. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  4027. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  4028. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  4029. } else if (row.r1 !== 0 && row.r2 == 0 && row.r3 !== 0) {
  4030. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w1) - parseFloat(row.w3)), parseInt(Cookies.get('decimal')))
  4031. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  4032. if (row.w1 == '') { row.w1 = 0 }
  4033. if (row.w2 == '') { row.w2 = 0 }
  4034. if (row.w3 == '') { row.w3 = 0 }
  4035. if (row.w4 == '') { row.w4 = 0 }
  4036. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  4037. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  4038. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  4039. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  4040. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  4041. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  4042. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow4.dailyWeight)) {
  4043. row.w1 = formatNum((parseFloat(this.focusWRow4.dailyWeight) - parseFloat(row.w4)) * parseFloat(row.r1) / (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3)), parseInt(Cookies.get('decimal')))
  4044. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  4045. row.w3 = formatNum((parseFloat(this.focusWRow4.dailyWeight) - parseFloat(row.w4)) * parseFloat(row.r3) / (parseFloat(this.focusWRow4.r1) + parseFloat(this.focusWRow4.r2) + parseFloat(this.focusWRow4.r3)), parseInt(Cookies.get('decimal')))
  4046. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  4047. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  4048. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  4049. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  4050. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  4051. }
  4052. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  4053. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  4054. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  4055. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  4056. } else if (row.r1 == 0 && row.r2 !== 0 && row.r3 !== 0) {
  4057. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w2) - parseFloat(row.w3)), parseInt(Cookies.get('decimal')))
  4058. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  4059. if (row.w1 == '') { row.w1 = 0 }
  4060. if (row.w2 == '') { row.w2 = 0 }
  4061. if (row.w3 == '') { row.w3 = 0 }
  4062. if (row.w4 == '') { row.w4 = 0 }
  4063. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  4064. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  4065. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  4066. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  4067. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  4068. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  4069. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow4.dailyWeight)) {
  4070. row.w2 = formatNum((parseFloat(this.focusWRow4.dailyWeight) - parseFloat(row.w4)) * parseFloat(row.r2) / (parseFloat(this.focusWRow4.r1) + parseFloat(this.focusWRow4.r2) + parseFloat(this.focusWRow4.r3)), parseInt(Cookies.get('decimal')))
  4071. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  4072. row.w3 = formatNum((parseFloat(this.focusWRow4.dailyWeight) - parseFloat(row.w4)) * parseFloat(row.r3) / (parseFloat(this.focusWRow4.r1) + parseFloat(this.focusWRow4.r2) + parseFloat(this.focusWRow4.r3)), parseInt(Cookies.get('decimal')))
  4073. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  4074. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  4075. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  4076. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  4077. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  4078. }
  4079. } else {
  4080. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4)) * parseFloat(row.r1) / (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3)), parseInt(Cookies.get('decimal')))
  4081. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  4082. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4)) * parseFloat(row.r2) / (parseFloat(this.focusWRow4.r1) + parseFloat(this.focusWRow4.r2) + parseFloat(this.focusWRow4.r3)), parseInt(Cookies.get('decimal')))
  4083. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  4084. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4)) * parseFloat(row.r3) / (parseFloat(this.focusWRow4.r1) + parseFloat(this.focusWRow4.r2) + parseFloat(this.focusWRow4.r3)), parseInt(Cookies.get('decimal')))
  4085. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  4086. }
  4087. if (isNaN(row.w1)) {
  4088. row.w1 = 0
  4089. row.r1 = 0
  4090. }
  4091. if (isNaN(row.w2)) {
  4092. row.w2 = 0
  4093. row.r2 = 0
  4094. }
  4095. if (isNaN(row.w3)) {
  4096. row.w3 = 0
  4097. row.r3 = 0
  4098. }
  4099. if (row.w1 <= 0) {
  4100. row.w1 = 0
  4101. row.r1 = 0
  4102. }
  4103. if (row.w2 <= 0) {
  4104. row.w2 = 0
  4105. row.r2 = 0
  4106. }
  4107. if (row.w3 <= 0) {
  4108. row.w3 = 0
  4109. row.r3 = 0
  4110. }
  4111. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  4112. }
  4113. }
  4114. if (row.w1 == '') { row.w1 = 0 }
  4115. if (row.w2 == '') { row.w2 = 0 }
  4116. if (row.w3 == '') { row.w3 = 0 }
  4117. if (row.w4 == '') { row.w4 = 0 }
  4118. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  4119. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  4120. },
  4121. celldblclick(row, column, cell, event) {
  4122. console.log(row, '=====')
  4123. this.handleUpdate(row)
  4124. },
  4125. // 编辑
  4126. handleUpdate(row) {
  4127. console.log(row)
  4128. for (let i = 0; i < this.table.list.length; i++) {
  4129. if (this.table.list[i].Edit == true) {
  4130. this.$message({ type: 'error', message: '当前内容未保存,请点击取消或保存继续进行操作', duration: 2000 })
  4131. return false
  4132. }
  4133. }
  4134. // 编辑true,不可编辑false
  4135. row.Edit = true
  4136. row.NoEdit = false
  4137. // 编辑false,编辑保存true
  4138. row.isUpdate = false
  4139. row.isUpdateSave = true
  4140. row.ftid = String(row.ftid)
  4141. if (row.ptsfid == '-1') {
  4142. row.ptsfid = ''
  4143. }
  4144. row.ptsfid = String(row.ptsfid)
  4145. // dryweight
  4146. this.table.temp.ftid = row.ftid
  4147. this.table.temp.ftname = row.ftname
  4148. this.table.temp.ptsfid = row.ptsfid
  4149. this.table.temp.ptsfname = row.ptsfname
  4150. },
  4151. updateData(row) {
  4152. if (row.r1 == 'NaN') { this.$set(row, 'r1', 0) }
  4153. if (row.r2 == 'NaN') { this.$set(row, 'r2', 0) }
  4154. if (row.r3 == 'NaN') { this.$set(row, 'r3', 0) }
  4155. if (row.r4 == 'NaN') { this.$set(row, 'r4', 0) }
  4156. if (row.w1 == 'NaN') { this.$set(row, 'w1', 0) }
  4157. if (row.w2 == 'NaN') { this.$set(row, 'w2', 0) }
  4158. if (row.w3 == 'NaN') { this.$set(row, 'w3', 0) }
  4159. if (row.w4 == 'NaN') { this.$set(row, 'w4', 0) }
  4160. if (row.bw1 == 'NaN') { this.$set(row, 'bw1', 0) }
  4161. if (row.bw2 == 'NaN') { this.$set(row, 'bw2', 0) }
  4162. if (row.bw3 == 'NaN') { this.$set(row, 'bw3', 0) }
  4163. if (row.bw4 == 'NaN') { this.$set(row, 'bw4', 0) }
  4164. var arr = []
  4165. for (let i = 1; i <= this.table.RWLength; i++) {
  4166. var obj = {}
  4167. obj['times'] = i
  4168. obj['pastureid'] = row.pastureid
  4169. obj['barid'] = row.barid
  4170. obj['cowcount'] = row.ccount
  4171. obj['ccountradio'] = row.ccountradio
  4172. obj['ptid'] = row.ftid
  4173. if (row.ptsfid !== '') {
  4174. obj['ptsid'] = row.ptsfid
  4175. } else {
  4176. obj['ptsid'] = '-1'
  4177. }
  4178. obj['weight'] = row['w' + i]
  4179. obj['supplement'] = row['bw' + i]
  4180. obj['tratio'] = Math.round(row['r' + i])
  4181. obj['todaysupplement'] = row.todaysupplement
  4182. obj['todayweight'] = row.todayweight
  4183. arr.push(obj)
  4184. }
  4185. if (this.table.isPtsfname == 0) {
  4186. row.ptsfid = '-1'
  4187. row.ptsfname = ''
  4188. } else {
  4189. if (row.ptsfid == '') {
  4190. row.ptsfid = '-1'
  4191. row.ptsfname = ''
  4192. }
  4193. }
  4194. if (row.supplyweight == '') {
  4195. row.supplyweight = '0'
  4196. }
  4197. if (this.table.isPtsfname == false) {
  4198. row.supplyweight = '0'
  4199. }
  4200. console.log(row, '============')
  4201. this.$set(row, 'ratio', Math.floor(parseFloat(row.ratio) * 100) / 100)
  4202. this.$set(row, 'ccountratio', Math.floor(parseFloat(row.ccountratio) * 100) / 100)
  4203. row.ratio = String(row.ratio)
  4204. row.ccountratio = String(row.ccountratio)
  4205. row.sumr = Math.round(row.sumr)
  4206. this.table.rwList = arr
  4207. console.log('点击了编辑保存', row)
  4208. this.table.temp.pastureid = row.pastureid
  4209. this.table.temp.id = row.id
  4210. this.table.temp.barname = row.barname
  4211. this.table.temp.barid = row.barid
  4212. this.table.temp.ccount = row.ccount
  4213. this.table.temp.ratio = row.ratio
  4214. this.table.temp.ccountratio = row.ccountratio
  4215. this.table.temp.ftid = row.ftid
  4216. this.table.temp.ftname = row.ftname
  4217. this.table.temp.ptsfid = row.ptsfid
  4218. this.table.temp.ptsfname = row.ptsfname
  4219. this.table.temp.ftweight = row.ftweight
  4220. this.table.temp.supplyweight = row.supplyweight
  4221. this.table.temp.feedweight = row.feedweight
  4222. this.table.temp.owner = row.owner
  4223. this.table.temp.sumr = row.sumr
  4224. if (row.softccount == '') {
  4225. row.softccount = 0
  4226. }
  4227. if (row.r1 == '') {
  4228. row.r1 = 0
  4229. }
  4230. if (row.r2 == '') {
  4231. row.r2 = 0
  4232. }
  4233. if (row.r3 == '') {
  4234. row.r3 = 0
  4235. }
  4236. if (row.r4 == '') {
  4237. row.r4 = 0
  4238. }
  4239. if (row.w1 == '') {
  4240. row.w1 = 0
  4241. }
  4242. if (row.w2 == '' || row.w4 == NaN) {
  4243. row.w2 = 0
  4244. }
  4245. if (row.w3 == '' || row.w4 == NaN) {
  4246. row.w3 = 0
  4247. }
  4248. if (row.w4 == '' || row.w4 == NaN) {
  4249. row.w4 = 0
  4250. }
  4251. console.log(row, '===========')
  4252. this.table.temp.softccount = row.softccount
  4253. this.table.temp.r1 = Math.round(row.r1)
  4254. this.table.temp.r2 = Math.round(row.r2)
  4255. this.table.temp.r3 = Math.round(row.r3)
  4256. this.table.temp.r4 = Math.round(row.r4)
  4257. this.table.temp.w1 = row.w1
  4258. this.table.temp.w2 = row.w2
  4259. this.table.temp.w3 = row.w3
  4260. this.table.temp.w4 = row.w4
  4261. if (this.table.temp.ccount == '' && this.table.temp.ratio == '' && this.table.temp.ccountratio == '' && this.table.temp.ftid == '') {
  4262. this.$message({ type: 'error', message: '实际牛头数/系数/系数头数/配方模版不能为空', duration: 2000 })
  4263. return false
  4264. }
  4265. if (this.table.temp.ratio == '' && this.table.temp.ccountratio == '' && this.table.temp.ftid == '') {
  4266. this.$message({ type: 'error', message: '系数/系数头数/配方模版不能为空', duration: 2000 })
  4267. return false
  4268. }
  4269. if (this.table.temp.ccountratio == '' && this.table.temp.ftid == '') {
  4270. this.$message({ type: 'error', message: '系数头数/配方模版不能为空', duration: 2000 })
  4271. return false
  4272. }
  4273. console.log(this.table.temp.ccount, '实际牛头数不能为空')
  4274. if (this.table.temp.ccount === '') {
  4275. this.$message({ type: 'error', message: '实际牛头数不能为空', duration: 2000 })
  4276. return false
  4277. }
  4278. if (this.table.temp.ratio === '') {
  4279. this.$message({ type: 'error', message: '系数不能为空', duration: 2000 })
  4280. return false
  4281. }
  4282. if (this.table.temp.ccountratio === '') {
  4283. this.$message({ type: 'error', message: '系数头数不能为空', duration: 2000 })
  4284. return false
  4285. }
  4286. if (this.table.temp.ftid == '') {
  4287. this.$message({ type: 'error', message: '配方模版不能为空', duration: 2000 })
  4288. return false
  4289. }
  4290. const positiveInteger = /^[0-9]\d*$/
  4291. if (!positiveInteger.test(parseFloat(this.table.temp.ccount))) {
  4292. this.$message({
  4293. type: 'error',
  4294. message: '实际牛头数请输入正整数',
  4295. duration: 2000
  4296. })
  4297. return false
  4298. }
  4299. this.isokDisable = true
  4300. setTimeout(() => {
  4301. this.isokDisable = false
  4302. }, 1000)
  4303. // this.requestParam.parammaps = this.table.temp
  4304. this.requestParam.common = {
  4305. 'returnmap': '0'
  4306. }
  4307. this.requestParam.data = []
  4308. this.requestParam.data[0] = { 'name': 'updateBigFP', 'type': 'e', 'parammaps': {
  4309. pastureid: row.pastureid,
  4310. id: row.id,
  4311. barname: row.barname,
  4312. barid: row.barid,
  4313. softccount: row.softccount,
  4314. ccount: row.ccount,
  4315. ratio: row.ratio,
  4316. ccountratio: row.ccountratio,
  4317. ftid: row.ftid,
  4318. ftname: row.ftname,
  4319. ptsfid: row.ptsfid,
  4320. ptsfname: row.ptsfname,
  4321. ftweight: row.ftweight,
  4322. supplyweight: row.supplyweight,
  4323. feedweight: row.feedweight,
  4324. owner: row.owner,
  4325. sumr: row.sumr
  4326. }}
  4327. this.requestParam.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.table.rwList }}
  4328. this.requestParam.data[1].children = []
  4329. this.requestParam.data[1].children[0] = { 'name': 'updateBigFPDetail', 'type': 'e', 'parammaps': {
  4330. pastureid: '@insertSpotList.pastureid',
  4331. barname: row.barname,
  4332. barid: '@insertSpotList.barid',
  4333. times: '@insertSpotList.times',
  4334. tratio: '@insertSpotList.tratio',
  4335. weight: '@insertSpotList.weight',
  4336. cowcount: '@insertSpotList.cowcount',
  4337. ccountradio: row.ccountratio,
  4338. ptid: '@insertSpotList.ptid',
  4339. ptsid: '@insertSpotList.ptsid',
  4340. supplement: '@insertSpotList.supplement',
  4341. feedweight: row.feedweight,
  4342. supplyweight: row.supplyweight,
  4343. ratio: row.ratio
  4344. }}
  4345. this.requestParam.data[2] = { 'name': 'updateLPPbyFPChange', 'type': 'e', 'parammaps': {
  4346. pastureid: row.pastureid,
  4347. fpid: row.id
  4348. }}
  4349. ExecDataByConfig(this.requestParam).then(response => {
  4350. console.log('编辑保存发送参数', this.requestParam)
  4351. if (response.msg === 'fail') {
  4352. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  4353. } else {
  4354. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  4355. // this.reload()
  4356. this.getList()
  4357. for (let i = 0; i < this.headerList.length; i++) {
  4358. if (this.headerList[i].target.className == 'el-icon-lock') {
  4359. this.headerList[i].target.className = 'el-icon-unlock'
  4360. this.$set(this.headerList[i].target, 'className', 'el-icon-unlock')
  4361. }
  4362. }
  4363. }
  4364. })
  4365. },
  4366. updateCancel(row) {
  4367. console.log('点击了编辑取消')
  4368. // 编辑false,不可编辑true
  4369. row.Edit = false
  4370. row.NoEdit = true
  4371. // 编辑true,编辑保存false
  4372. row.isUpdate = true
  4373. row.isUpdateSave = false
  4374. // this.reload()
  4375. for (let i = 0; i < this.headerList.length; i++) {
  4376. if (this.headerList[i].target.className == 'el-icon-lock') {
  4377. this.headerList[i].target.className = 'el-icon-unlock'
  4378. this.$set(this.headerList[i].target, 'className', 'el-icon-unlock')
  4379. }
  4380. }
  4381. console.log(this.table.getdataListParm.offset)
  4382. this.table.getdataListParm.offset = this.table.getdataListParm.offset
  4383. this.getList()
  4384. // this.$router.push('/formulationPlan/dhedFormula')
  4385. },
  4386. cellClick(row, column, event) {
  4387. console.log(column)
  4388. },
  4389. handleSelect(val) {
  4390. console.log('勾选数据', val)
  4391. this.selectList = val
  4392. },
  4393. // 营养评估
  4394. handleNutritional() {
  4395. console.log('点击了营养评估')
  4396. this.dialogFull = false
  4397. if (this.selectList.length !== 1) {
  4398. this.$message({ type: 'error', message: '请选择一条栏舍信息进行营养评估', duration: 2000 })
  4399. return false
  4400. } else {
  4401. console.log(this.nutritional.temp)
  4402. this.nutritional.dialogStatus = 'Nutritional'
  4403. this.nutritional.activeName = 'first'
  4404. this.nutritional.dialogFormVisible = true
  4405. this.nutritional.tab1.getdataListParm1.parammaps.pastureid = this.selectList[0].pastureid
  4406. this.nutritional.tab1.getdataListParm1.parammaps.barid = this.selectList[0].barid
  4407. this.getNutritionalList()
  4408. this.nutritional.tab1.list = []
  4409. }
  4410. },
  4411. tableRowClassName({ row }) {
  4412. // console.log(row)
  4413. if (row.isColor == '0') {
  4414. return 'red-row'
  4415. } else {
  4416. return ''
  4417. }
  4418. },
  4419. handleNutritionalTab(item) {
  4420. if (item == 'first ') {
  4421. this.nutritional.tab1.getdataListParm1.parammaps.pastureid = this.selectList[0].pastureid
  4422. this.nutritional.tab1.getdataListParm1.parammaps.barid = this.selectList[0].barid
  4423. this.getNutritionalList()
  4424. this.nutritional.tab1.list = []
  4425. } else {
  4426. console.log('牛群评估')
  4427. this.nutritional.tab2.getdataListParm1.parammaps.pastureid = this.selectList[0].pastureid
  4428. this.nutritional.tab2.getdataListParm1.parammaps.barid = this.selectList[0].barid
  4429. this.nutritional.tab2.getdataListParm1.parammaps.startTime = parseTime(this.nutritional.tab2.inputDatetime[0], '{y}-{m}-{d}')
  4430. this.nutritional.tab2.getdataListParm1.parammaps.stopTime = parseTime(this.nutritional.tab2.inputDatetime[1], '{y}-{m}-{d}')
  4431. this.nutritional.tab2.getdataListParm2.parammaps.pastureid = this.nutritional.tab2.getdataListParm1.parammaps.pastureid
  4432. this.nutritional.tab2.getdataListParm2.parammaps.barid = this.nutritional.tab2.getdataListParm1.parammaps.barid
  4433. this.nutritional.tab2.getdataListParm2.parammaps.startTime = this.nutritional.tab2.getdataListParm1.parammaps.startTime
  4434. this.nutritional.tab2.getdataListParm2.parammaps.stopTime = this.nutritional.tab2.getdataListParm1.parammaps.stopTime
  4435. this.nutritional.tab2.getdataListParm3.parammaps.pastureid = this.nutritional.tab2.getdataListParm1.parammaps.pastureid
  4436. this.nutritional.tab2.getdataListParm3.parammaps.barid = this.nutritional.tab2.getdataListParm1.parammaps.barid
  4437. this.nutritional.tab2.getdataListParm3.parammaps.startTime = this.nutritional.tab2.getdataListParm1.parammaps.startTime
  4438. this.nutritional.tab2.getdataListParm3.parammaps.stopTime = this.nutritional.tab2.getdataListParm1.parammaps.stopTime
  4439. this.nutritional.tab2.getdataListParm4.parammaps.pastureid = this.nutritional.tab2.getdataListParm1.parammaps.pastureid
  4440. this.nutritional.tab2.getdataListParm4.parammaps.barid = this.nutritional.tab2.getdataListParm1.parammaps.barid
  4441. this.nutritional.tab2.getdataListParm4.parammaps.startTime = this.nutritional.tab2.getdataListParm1.parammaps.startTime
  4442. this.nutritional.tab2.getdataListParm4.parammaps.stopTime = this.nutritional.tab2.getdataListParm1.parammaps.stopTime
  4443. this.getTab2NutritionalList1()
  4444. this.getTab2NutritionalList2()
  4445. this.getTab2NutritionalList3()
  4446. this.getTab2NutritionalList4()
  4447. }
  4448. },
  4449. changeTab2Date() {
  4450. this.nutritional.tab2.getdataListParm1.parammaps.pastureid = this.selectList[0].pastureid
  4451. this.nutritional.tab2.getdataListParm1.parammaps.barid = this.selectList[0].barid
  4452. this.nutritional.tab2.getdataListParm1.parammaps.startTime = parseTime(this.nutritional.tab2.inputDatetime[0], '{y}-{m}-{d}')
  4453. this.nutritional.tab2.getdataListParm1.parammaps.stopTime = parseTime(this.nutritional.tab2.inputDatetime[1], '{y}-{m}-{d}')
  4454. this.nutritional.tab2.getdataListParm2.parammaps.pastureid = this.nutritional.tab2.getdataListParm1.parammaps.pastureid
  4455. this.nutritional.tab2.getdataListParm2.parammaps.barid = this.nutritional.tab2.getdataListParm1.parammaps.barid
  4456. this.nutritional.tab2.getdataListParm2.parammaps.startTime = this.nutritional.tab2.getdataListParm1.parammaps.startTime
  4457. this.nutritional.tab2.getdataListParm2.parammaps.stopTime = this.nutritional.tab2.getdataListParm1.parammaps.stopTime
  4458. this.nutritional.tab2.getdataListParm3.parammaps.pastureid = this.nutritional.tab2.getdataListParm1.parammaps.pastureid
  4459. this.nutritional.tab2.getdataListParm3.parammaps.barid = this.nutritional.tab2.getdataListParm1.parammaps.barid
  4460. this.nutritional.tab2.getdataListParm3.parammaps.startTime = this.nutritional.tab2.getdataListParm1.parammaps.startTime
  4461. this.nutritional.tab2.getdataListParm3.parammaps.stopTime = this.nutritional.tab2.getdataListParm1.parammaps.stopTime
  4462. this.nutritional.tab2.getdataListParm4.parammaps.pastureid = this.nutritional.tab2.getdataListParm1.parammaps.pastureid
  4463. this.nutritional.tab2.getdataListParm4.parammaps.barid = this.nutritional.tab2.getdataListParm1.parammaps.barid
  4464. this.nutritional.tab2.getdataListParm4.parammaps.startTime = this.nutritional.tab2.getdataListParm1.parammaps.startTime
  4465. this.nutritional.tab2.getdataListParm4.parammaps.stopTime = this.nutritional.tab2.getdataListParm1.parammaps.stopTime
  4466. this.getTab2NutritionalList1()
  4467. this.getTab2NutritionalList2()
  4468. this.getTab2NutritionalList3()
  4469. this.getTab2NutritionalList4()
  4470. },
  4471. handleBefore() {
  4472. if (this.nutritional.activeName == 'first') {
  4473. if (this.nutritional.tab1.inputDatetime !== '' && this.nutritional.tab1.inputDatetime !== null) {
  4474. var start = new Date(this.nutritional.tab1.inputDatetime[0].setDate(this.nutritional.tab1.inputDatetime[0].getDate() - 1))
  4475. var stop = new Date(this.nutritional.tab1.inputDatetime[1].setDate(this.nutritional.tab1.inputDatetime[1].getDate() - 1))
  4476. this.nutritional.tab1.inputDatetime.length = 0
  4477. this.nutritional.tab1.inputDatetime.push(start, stop)
  4478. this.$forceUpdate()
  4479. }
  4480. } else {
  4481. var start2 = new Date(this.nutritional.tab2.inputDatetime[0].setDate(this.nutritional.tab2.inputDatetime[0].getDate() - 1))
  4482. var stop2 = new Date(this.nutritional.tab2.inputDatetime[1].setDate(this.nutritional.tab2.inputDatetime[1].getDate() - 1))
  4483. this.nutritional.tab2.inputDatetime.length = 0
  4484. this.nutritional.tab2.inputDatetime.push(start2, stop2)
  4485. this.$forceUpdate()
  4486. this.nutritional.tab2.getdataListParm1.parammaps.pastureid = this.selectList[0].pastureid
  4487. this.nutritional.tab2.getdataListParm1.parammaps.barid = this.selectList[0].barid
  4488. this.nutritional.tab2.getdataListParm1.parammaps.startTime = parseTime(this.nutritional.tab2.inputDatetime[0], '{y}-{m}-{d}')
  4489. this.nutritional.tab2.getdataListParm1.parammaps.stopTime = parseTime(this.nutritional.tab2.inputDatetime[1], '{y}-{m}-{d}')
  4490. this.nutritional.tab2.getdataListParm2.parammaps.pastureid = this.nutritional.tab2.getdataListParm1.parammaps.pastureid
  4491. this.nutritional.tab2.getdataListParm2.parammaps.barid = this.nutritional.tab2.getdataListParm1.parammaps.barid
  4492. this.nutritional.tab2.getdataListParm2.parammaps.startTime = parseTime(this.nutritional.tab2.inputDatetime[0], '{y}-{m}-{d}')
  4493. this.nutritional.tab2.getdataListParm2.parammaps.stopTime = parseTime(this.nutritional.tab2.inputDatetime[1], '{y}-{m}-{d}')
  4494. this.nutritional.tab2.getdataListParm3.parammaps.pastureid = this.nutritional.tab2.getdataListParm1.parammaps.pastureid
  4495. this.nutritional.tab2.getdataListParm3.parammaps.barid = this.nutritional.tab2.getdataListParm1.parammaps.barid
  4496. this.nutritional.tab2.getdataListParm3.parammaps.startTime = parseTime(this.nutritional.tab2.inputDatetime[0], '{y}-{m}-{d}')
  4497. this.nutritional.tab2.getdataListParm3.parammaps.stopTime = parseTime(this.nutritional.tab2.inputDatetime[1], '{y}-{m}-{d}')
  4498. this.nutritional.tab2.getdataListParm4.parammaps.pastureid = this.nutritional.tab2.getdataListParm1.parammaps.pastureid
  4499. this.nutritional.tab2.getdataListParm4.parammaps.barid = this.nutritional.tab2.getdataListParm1.parammaps.barid
  4500. this.nutritional.tab2.getdataListParm4.parammaps.startTime = parseTime(this.nutritional.tab2.inputDatetime[0], '{y}-{m}-{d}')
  4501. this.nutritional.tab2.getdataListParm4.parammaps.stopTime = parseTime(this.nutritional.tab2.inputDatetime[1], '{y}-{m}-{d}')
  4502. this.getTab2NutritionalList1()
  4503. this.getTab2NutritionalList2()
  4504. this.getTab2NutritionalList3()
  4505. this.getTab2NutritionalList4()
  4506. }
  4507. },
  4508. handleNext() {
  4509. if (this.nutritional.activeName == 'first') {
  4510. if (this.nutritional.tab1.inputDatetime !== '' && this.nutritional.tab1.inputDatetime !== null) {
  4511. console.log(this.nutritional.tab1.inputDatetime)
  4512. var start3 = new Date(this.nutritional.tab1.inputDatetime[0].setDate(this.nutritional.tab1.inputDatetime[0].getDate() + 1))
  4513. var stop3 = new Date(this.nutritional.tab1.inputDatetime[1].setDate(this.nutritional.tab1.inputDatetime[1].getDate() + 1))
  4514. this.nutritional.tab1.inputDatetime.length = 0
  4515. this.nutritional.tab1.inputDatetime.push(start3, stop3)
  4516. this.$forceUpdate()
  4517. }
  4518. } else {
  4519. var start4 = new Date(this.nutritional.tab2.inputDatetime[0].setDate(this.nutritional.tab2.inputDatetime[0].getDate() + 1))
  4520. var stop4 = new Date(this.nutritional.tab2.inputDatetime[1].setDate(this.nutritional.tab2.inputDatetime[1].getDate() + 1))
  4521. this.nutritional.tab2.inputDatetime.length = 0
  4522. this.nutritional.tab2.inputDatetime.push(start4, stop4)
  4523. this.$forceUpdate()
  4524. this.nutritional.tab2.getdataListParm1.parammaps.pastureid = this.selectList[0].pastureid
  4525. this.nutritional.tab2.getdataListParm1.parammaps.barid = this.selectList[0].barid
  4526. this.nutritional.tab2.getdataListParm1.parammaps.startTime = parseTime(this.nutritional.tab2.inputDatetime[0], '{y}-{m}-{d}')
  4527. this.nutritional.tab2.getdataListParm1.parammaps.stopTime = parseTime(this.nutritional.tab2.inputDatetime[1], '{y}-{m}-{d}')
  4528. this.nutritional.tab2.getdataListParm2.parammaps.pastureid = this.nutritional.tab2.getdataListParm1.parammaps.pastureid
  4529. this.nutritional.tab2.getdataListParm2.parammaps.barid = this.nutritional.tab2.getdataListParm1.parammaps.barid
  4530. this.nutritional.tab2.getdataListParm2.parammaps.startTime = parseTime(this.nutritional.tab2.inputDatetime[0], '{y}-{m}-{d}')
  4531. this.nutritional.tab2.getdataListParm2.parammaps.stopTime = parseTime(this.nutritional.tab2.inputDatetime[1], '{y}-{m}-{d}')
  4532. this.nutritional.tab2.getdataListParm3.parammaps.pastureid = this.nutritional.tab2.getdataListParm1.parammaps.pastureid
  4533. this.nutritional.tab2.getdataListParm3.parammaps.barid = this.nutritional.tab2.getdataListParm1.parammaps.barid
  4534. this.nutritional.tab2.getdataListParm3.parammaps.startTime = parseTime(this.nutritional.tab2.inputDatetime[0], '{y}-{m}-{d}')
  4535. this.nutritional.tab2.getdataListParm3.parammaps.stopTime = parseTime(this.nutritional.tab2.inputDatetime[1], '{y}-{m}-{d}')
  4536. this.nutritional.tab2.getdataListParm4.parammaps.pastureid = this.nutritional.tab2.getdataListParm1.parammaps.pastureid
  4537. this.nutritional.tab2.getdataListParm4.parammaps.barid = this.nutritional.tab2.getdataListParm1.parammaps.barid
  4538. this.nutritional.tab2.getdataListParm4.parammaps.startTime = parseTime(this.nutritional.tab2.inputDatetime[0], '{y}-{m}-{d}')
  4539. this.nutritional.tab2.getdataListParm4.parammaps.stopTime = parseTime(this.nutritional.tab2.inputDatetime[1], '{y}-{m}-{d}')
  4540. this.getTab2NutritionalList1()
  4541. this.getTab2NutritionalList2()
  4542. this.getTab2NutritionalList3()
  4543. this.getTab2NutritionalList4()
  4544. }
  4545. },
  4546. getNutritionalList() {
  4547. this.nutritional.tab1.listLoading1 = true
  4548. GetDataByName(this.nutritional.tab1.getdataListParm1).then(response => {
  4549. console.log('评估上方数据', response.data.list)
  4550. if (response.data.list !== null) {
  4551. response.data.list[0].cowclassid = String(response.data.list[0].cowclassid)
  4552. this.nutritional.tab1.temp = response.data.list[0]
  4553. this.nutritional.tab1.disabledCowclass = true
  4554. this.nutritional.tab1.getdataListParm2.parammaps.name = 'judgenurFT'
  4555. this.nutritional.tab1.getdataListParm2.parammaps.name1 = 'judgenurBarHSL'
  4556. this.nutritional.tab1.getdataListParm2.parammaps.startTime = parseTime(this.nutritional.tab1.inputDatetime[0], '{y}-{m}-{d}')
  4557. this.nutritional.tab1.getdataListParm2.parammaps.stopTime = parseTime(this.nutritional.tab1.inputDatetime[1], '{y}-{m}-{d}')
  4558. this.nutritional.tab1.getdataListParm2.parammaps.bw = parseFloat(this.nutritional.tab1.temp.bw)
  4559. this.nutritional.tab1.getdataListParm2.parammaps.dayw = parseFloat(this.nutritional.tab1.temp.dayw)
  4560. this.nutritional.tab1.getdataListParm2.parammaps.fetal = parseFloat(this.nutritional.tab1.temp.fetal)
  4561. this.nutritional.tab1.getdataListParm2.parammaps.avgdim = parseFloat(this.nutritional.tab1.temp.avgdim)
  4562. this.nutritional.tab1.getdataListParm2.parammaps.dayspre = parseFloat(this.nutritional.tab1.temp.dayspre)
  4563. this.nutritional.tab1.getdataListParm2.parammaps.product = parseFloat(this.nutritional.tab1.temp.product)
  4564. this.nutritional.tab1.getdataListParm2.parammaps.fat = parseFloat(this.nutritional.tab1.temp.fat)
  4565. this.nutritional.tab1.getdataListParm2.parammaps.pro = parseFloat(this.nutritional.tab1.temp.pro)
  4566. this.nutritional.tab1.getdataListParm2.parammaps.lactose = parseFloat(this.nutritional.tab1.temp.lactose)
  4567. this.nutritional.tab1.getdataListParm2.parammaps.source = parseFloat(this.nutritional.tab1.temp.source)
  4568. this.nutritional.tab1.getdataListParm2.parammaps.tem = parseFloat(this.nutritional.tab1.temp.tem)
  4569. this.nutritional.tab1.getdataListParm2.parammaps.cowsum = parseFloat(this.nutritional.tab1.temp.cowsum)
  4570. this.nutritional.tab1.getdataListParm2.parammaps.cowclass = this.nutritional.tab1.temp.cowclass
  4571. this.nutritional.tab1.getdataListParm2.parammaps.cowclassid = this.nutritional.tab1.temp.cowclassid
  4572. this.nutritional.tab1.getdataListParm2.parammaps.bigcowclass = this.nutritional.tab1.temp.bigcowclass
  4573. this.nutritional.tab1.getdataListParm2.parammaps.pastureid = this.selectList[0].pastureid
  4574. this.nutritional.tab1.getdataListParm2.parammaps.barid = this.nutritional.tab1.temp.barid
  4575. this.nutritional.tab1.getdataListParm2.parammaps.date = this.nutritional.tab1.temp.date
  4576. this.getNutritionalList2()
  4577. } else {
  4578. this.nutritional.tab1.temp = []
  4579. this.nutritional.tab1.disabledCowclass = false
  4580. }
  4581. setTimeout(() => {
  4582. this.nutritional.tab1.listLoading = false
  4583. }, 100)
  4584. })
  4585. },
  4586. assessmentData() {
  4587. console.log('评估保存')
  4588. this.$refs['temp'].validate(valid => {
  4589. if (valid) {
  4590. if (this.nutritional.tab1.inputDatetime == '' || this.nutritional.tab1.inputDatetime == null) {
  4591. this.$message({ type: 'error', message: '开始日期结束日期不能为空', duration: 2000 })
  4592. return false
  4593. } else {
  4594. // 牛头数
  4595. const positiveInteger = /^[1-9]\d*$/
  4596. if (this.nutritional.tab1.temp.cowsum !== '') {
  4597. if (!positiveInteger.test(parseFloat(this.nutritional.tab1.temp.cowsum))) {
  4598. this.$message({ type: 'error', message: '牛头数请输入正整数', duration: 2000 })
  4599. return false
  4600. }
  4601. }
  4602. const twoDecimalPlaces = /^\d+(\.\d{1,2})?$/
  4603. // 温度环境
  4604. if (this.nutritional.tab1.temp.tem !== '') {
  4605. if (!twoDecimalPlaces.test(parseFloat(this.nutritional.tab1.temp.tem))) {
  4606. this.$message({ type: 'error', message: '温度环境请保留两位小数', duration: 2000 })
  4607. return false
  4608. }
  4609. }
  4610. // 平均月龄
  4611. if (this.nutritional.tab1.temp.avgmonthage !== '') {
  4612. if (!twoDecimalPlaces.test(parseFloat(this.nutritional.tab1.temp.avgmonthage))) {
  4613. this.$message({ type: 'error', message: '平均月龄请保留两位小数', duration: 2000 })
  4614. return false
  4615. }
  4616. }
  4617. // 体重
  4618. if (this.nutritional.tab1.temp.bw !== '') {
  4619. if (!twoDecimalPlaces.test(parseFloat(this.nutritional.tab1.temp.bw))) {
  4620. this.$message({ type: 'error', message: '体重请保留两位小数', duration: 2000 })
  4621. return false
  4622. }
  4623. }
  4624. // 日增重
  4625. if (this.nutritional.tab1.temp.dayw !== '') {
  4626. if (!twoDecimalPlaces.test(parseFloat(this.nutritional.tab1.temp.dayw))) {
  4627. this.$message({ type: 'error', message: '日增重请保留两位小数', duration: 2000 })
  4628. return false
  4629. }
  4630. }
  4631. const dayspre = /^(([1-9]|([1-9]\d)|(1\d\d)|(2([0-7]\d|7[0-9]))))$/
  4632. // 怀孕天数
  4633. if (this.nutritional.tab1.temp.dayspre !== '') {
  4634. if (!dayspre.test(parseFloat(this.nutritional.tab1.temp.dayspre))) {
  4635. this.$message({ type: 'error', message: '怀孕天数请输入大于0小于280整数', duration: 2000 })
  4636. return false
  4637. }
  4638. }
  4639. const fetal = /^(?:[1-9]|1[0-9])$/
  4640. // 胎次
  4641. if (this.nutritional.tab1.temp.fetal !== '') {
  4642. if (!fetal.test(parseFloat(this.nutritional.tab1.temp.fetal))) {
  4643. this.$message({ type: 'error', message: '胎次请输入大于0小于20整数', duration: 2000 })
  4644. return false
  4645. }
  4646. }
  4647. // 平均泌乳
  4648. if (this.nutritional.tab1.temp.avgdim !== '') {
  4649. if (!positiveInteger.test(parseFloat(this.nutritional.tab1.temp.avgdim))) {
  4650. this.$message({ type: 'error', message: '平均泌乳天数请输入正整数', duration: 2000 })
  4651. return false
  4652. }
  4653. }
  4654. // 产奶量
  4655. if (this.nutritional.tab1.temp.product !== '') {
  4656. if (!twoDecimalPlaces.test(parseFloat(this.nutritional.tab1.temp.product))) {
  4657. this.$message({ type: 'error', message: '产奶量请保留两位小数', duration: 2000 })
  4658. return false
  4659. }
  4660. }
  4661. // 乳脂率
  4662. if (this.nutritional.tab1.temp.fat !== '') {
  4663. if (!twoDecimalPlaces.test(parseFloat(this.nutritional.tab1.temp.fat))) {
  4664. this.$message({ type: 'error', message: '乳脂率请保留两位小数', duration: 2000 })
  4665. return false
  4666. }
  4667. }
  4668. // 乳蛋白率
  4669. if (this.nutritional.tab1.temp.pro !== '') {
  4670. if (!twoDecimalPlaces.test(parseFloat(this.nutritional.tab1.temp.pro))) {
  4671. this.$message({ type: 'error', message: '乳蛋白率请保留两位小数', duration: 2000 })
  4672. return false
  4673. }
  4674. }
  4675. // 乳糖率
  4676. if (this.nutritional.tab1.temp.lactose !== '') {
  4677. if (!twoDecimalPlaces.test(parseFloat(this.nutritional.tab1.temp.lactose))) {
  4678. this.$message({ type: 'error', message: '乳糖率请保留两位小数', duration: 2000 })
  4679. return false
  4680. }
  4681. }
  4682. this.nutritional.tab1.getdataListParm2.parammaps.name = 'judgenurFT'
  4683. this.nutritional.tab1.getdataListParm2.parammaps.name1 = 'judgenurBarHSL'
  4684. this.nutritional.tab1.getdataListParm2.parammaps.startTime = parseTime(this.nutritional.tab1.inputDatetime[0], '{y}-{m}-{d}')
  4685. this.nutritional.tab1.getdataListParm2.parammaps.stopTime = parseTime(this.nutritional.tab1.inputDatetime[1], '{y}-{m}-{d}')
  4686. this.nutritional.tab1.getdataListParm2.parammaps.bw = parseFloat(this.nutritional.tab1.temp.bw)
  4687. this.nutritional.tab1.getdataListParm2.parammaps.dayw = parseFloat(this.nutritional.tab1.temp.dayw)
  4688. this.nutritional.tab1.getdataListParm2.parammaps.fetal = parseFloat(this.nutritional.tab1.temp.fetal)
  4689. this.nutritional.tab1.getdataListParm2.parammaps.avgdim = parseFloat(this.nutritional.tab1.temp.avgdim)
  4690. this.nutritional.tab1.getdataListParm2.parammaps.dayspre = parseFloat(this.nutritional.tab1.temp.dayspre)
  4691. this.nutritional.tab1.getdataListParm2.parammaps.product = parseFloat(this.nutritional.tab1.temp.product)
  4692. this.nutritional.tab1.getdataListParm2.parammaps.fat = parseFloat(this.nutritional.tab1.temp.fat)
  4693. this.nutritional.tab1.getdataListParm2.parammaps.pro = parseFloat(this.nutritional.tab1.temp.pro)
  4694. this.nutritional.tab1.getdataListParm2.parammaps.lactose = parseFloat(this.nutritional.tab1.temp.lactose)
  4695. this.nutritional.tab1.getdataListParm2.parammaps.source = parseFloat(this.nutritional.tab1.temp.source)
  4696. this.nutritional.tab1.getdataListParm2.parammaps.tem = parseFloat(this.nutritional.tab1.temp.tem)
  4697. this.nutritional.tab1.getdataListParm2.parammaps.cowsum = parseFloat(this.nutritional.tab1.temp.cowsum)
  4698. this.nutritional.tab1.getdataListParm2.parammaps.cowclass = this.nutritional.tab1.temp.cowclass
  4699. this.nutritional.tab1.getdataListParm2.parammaps.cowclassid = this.nutritional.tab1.temp.cowclassid
  4700. this.nutritional.tab1.getdataListParm2.parammaps.bigcowclass = this.nutritional.tab1.temp.bigcowclass
  4701. this.nutritional.tab1.getdataListParm2.parammaps.pastureid = this.selectList[0].pastureid
  4702. this.nutritional.tab1.getdataListParm2.parammaps.barid = this.nutritional.tab1.temp.barid
  4703. this.nutritional.tab1.getdataListParm2.parammaps.date = this.nutritional.tab1.temp.date
  4704. this.getNutritionalList2()
  4705. }
  4706. }
  4707. })
  4708. },
  4709. getNutritionalList2() {
  4710. this.nutritional.tab1.listLoading2 = true
  4711. GETNurJudge(this.nutritional.tab1.getdataListParm2).then(response => {
  4712. if (response.msg !== 'fail') {
  4713. if (response.data.list !== null) {
  4714. // response.data = response.data.sort(compareSort('sort'))
  4715. for (let i = 0; i < response.data.length; i++) {
  4716. if (response.data[i].cowneed == null) {
  4717. response.data[i].cowneed = ''
  4718. }
  4719. var reg = RegExp(/>/)
  4720. var reg2 = RegExp(/</)
  4721. var reg3 = RegExp(/-/)
  4722. if (reg.test(response.data[i].cowneed) == true) {
  4723. const cowneed = response.data[i].cowneed.split('>')[1]
  4724. if ((parseFloat(response.data[i].ftpro) < parseFloat(cowneed)) || (parseFloat(response.data[i].hprov) < parseFloat(cowneed)) || parseFloat(response.data[i].sprov) < parseFloat(cowneed)) {
  4725. this.$set(response.data[i], 'isColor', '0')
  4726. } else {
  4727. this.$set(response.data[i], 'isColor', '')
  4728. }
  4729. } else if (reg2.test(response.data[i].cowneed) == true) {
  4730. const cowneed2 = response.data[i].cowneed.split('<')[1]
  4731. if ((parseFloat(response.data[i].ftpro) > parseFloat(cowneed2)) || (parseFloat(response.data[i].hprov) > parseFloat(cowneed2)) || parseFloat(response.data[i].sprov) > parseFloat(cowneed2)) {
  4732. this.$set(response.data[i], 'isColor', '0')
  4733. } else {
  4734. this.$set(response.data[i], 'isColor', '')
  4735. }
  4736. } else if (reg3.test(response.data[i].cowneed) == true) {
  4737. response.data[i].cowneed = String(response.data[i].cowneed)
  4738. if (response.data[i].cowneed.length == 1) {
  4739. const cowneed3 = response.data[i].cowneed.split('-')
  4740. console.log(cowneed3, 'cowneed3')
  4741. if (parseFloat(response.data[i].ftpro) > parseFloat(cowneed3[0]) && parseFloat(response.data[i].ftpro) < parseFloat(cowneed3[1])) {
  4742. this.$set(response.data[i], 'isColor', '')
  4743. } else if (parseFloat(response.data[i].hprov) > parseFloat(cowneed3[0]) && parseFloat(response.data[i].hprov) < parseFloat(cowneed3[1])) {
  4744. this.$set(response.data[i], 'isColor', '')
  4745. } else if (parseFloat(response.data[i].sprov) > parseFloat(cowneed3[0]) && parseFloat(response.data[i].sprov) < parseFloat(cowneed3[1])) {
  4746. this.$set(response.data[i], 'isColor', '')
  4747. } else if (cowneed3[0] == '' && cowneed3[0] == '') {
  4748. this.$set(response.data[i], 'isColor', '')
  4749. } else {
  4750. this.$set(response.data[i], 'isColor', '0')
  4751. }
  4752. } else {
  4753. if ((parseFloat(response.data[i].ftpro) < parseFloat(response.data[i].cowneed)) || (parseFloat(response.data[i].hprov) < parseFloat(response.data[i].cowneed)) || parseFloat(response.data[i].sprov) < parseFloat(response.data[i].cowneed)) {
  4754. this.$set(response.data[i], 'isColor', '0')
  4755. } else {
  4756. this.$set(response.data[i], 'isColor', '')
  4757. }
  4758. }
  4759. } else {
  4760. response.data[i].cowneed = String(response.data[i].cowneed)
  4761. if (response.data[i].cowneed[0] !== '-') {
  4762. if ((parseFloat(response.data[i].ftpro) < parseFloat(response.data[i].cowneed)) || (parseFloat(response.data[i].hprov) < parseFloat(response.data[i].cowneed)) || parseFloat(response.data[i].sprov) < parseFloat(response.data[i].cowneed)) {
  4763. this.$set(response.data[i], 'isColor', '0')
  4764. } else {
  4765. this.$set(response.data[i], 'isColor', '')
  4766. }
  4767. } else {
  4768. this.$set(response.data[i], 'isColor', '')
  4769. }
  4770. }
  4771. }
  4772. console.log(response.data)
  4773. console.log('评估下方数据', response.data)
  4774. this.nutritional.tab1.list = response.data
  4775. this.nutritional.tab1.total = response.data.total
  4776. } else {
  4777. this.nutritional.tab1.list = []
  4778. }
  4779. } else {
  4780. this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
  4781. }
  4782. setTimeout(() => {
  4783. this.nutritional.tab1.listLoading2 = false
  4784. }, 100)
  4785. })
  4786. },
  4787. // 牛群评估
  4788. getTab2NutritionalList1() {
  4789. this.nutritional.tab2.listLoading1 = true
  4790. GetDataByName(this.nutritional.tab2.getdataListParm1).then(response => {
  4791. console.log('宾州筛分析', response.data.list)
  4792. if (response.data.list !== null) {
  4793. this.nutritional.tab2.list1 = response.data.list
  4794. this.nutritional.tab2.pageNum1 = response.data.pageNum
  4795. this.nutritional.tab2.pageSize1 = response.data.pageSize
  4796. this.nutritional.tab2.total1 = response.data.total
  4797. } else {
  4798. this.nutritional.tab2.list1 = []
  4799. }
  4800. setTimeout(() => {
  4801. this.nutritional.tab2.listLoading1 = false
  4802. }, 100)
  4803. })
  4804. },
  4805. getTab2NutritionalList2() {
  4806. this.nutritional.tab2.listLoading2 = true
  4807. GetDataByName(this.nutritional.tab2.getdataListParm2).then(response => {
  4808. console.log('粪便筛分析', response.data.list)
  4809. if (response.data.list !== null) {
  4810. this.nutritional.tab2.list2 = response.data.list
  4811. this.nutritional.tab2.pageNum2 = response.data.pageNum
  4812. this.nutritional.tab2.pageSize2 = response.data.pageSize
  4813. this.nutritional.tab2.total2 = response.data.total
  4814. } else {
  4815. this.nutritional.tab2.list2 = []
  4816. }
  4817. setTimeout(() => {
  4818. this.nutritional.tab2.listLoading2 = false
  4819. }, 100)
  4820. })
  4821. },
  4822. getTab2NutritionalList3() {
  4823. this.nutritional.tab2.listLoading3 = true
  4824. GetDataByName(this.nutritional.tab2.getdataListParm3).then(response => {
  4825. console.log('BCS评分', response.data.list)
  4826. if (response.data.list !== null) {
  4827. for (let i = 0; i < response.data.list.length; i++) {
  4828. this.$set(response.data.list[i], 'score25rate', (parseFloat(response.data.list[i].score25) / parseFloat(response.data.list[i].cowsum) * 100).toFixed(parseInt(Cookies.get('decimal'))))
  4829. this.$set(response.data.list[i], 'score275rate', (parseFloat(response.data.list[i].score275) / parseFloat(response.data.list[i].cowsum) * 100).toFixed(parseInt(Cookies.get('decimal'))))
  4830. this.$set(response.data.list[i], 'score3rate', (parseFloat(response.data.list[i].score3) / parseFloat(response.data.list[i].cowsum) * 100).toFixed(parseInt(Cookies.get('decimal'))))
  4831. this.$set(response.data.list[i], 'score325rate', (parseFloat(response.data.list[i].score325) / parseFloat(response.data.list[i].cowsum) * 100).toFixed(parseInt(Cookies.get('decimal'))))
  4832. this.$set(response.data.list[i], 'score35rate', (parseFloat(response.data.list[i].score35) / parseFloat(response.data.list[i].cowsum) * 100).toFixed(parseInt(Cookies.get('decimal'))))
  4833. this.$set(response.data.list[i], 'score375rate', (parseFloat(response.data.list[i].score375) / parseFloat(response.data.list[i].cowsum) * 100).toFixed(parseInt(Cookies.get('decimal'))))
  4834. this.$set(response.data.list[i], 'score4rate', (100 - response.data.list[i].score25rate - response.data.list[i].score275rate - response.data.list[i].score3rate - response.data.list[i].score325rate - response.data.list[i].score35rate - response.data.list[i].score375rate).toFixed(parseInt(Cookies.get('decimal'))))
  4835. }
  4836. this.nutritional.tab2.list3 = response.data.list
  4837. this.nutritional.tab2.pageNum3 = response.data.pageNum
  4838. this.nutritional.tab2.pageSize3 = response.data.pageSize
  4839. this.nutritional.tab2.total3 = response.data.total
  4840. } else {
  4841. this.nutritional.tab2.list3 = []
  4842. }
  4843. setTimeout(() => {
  4844. this.nutritional.tab2.listLoading3 = false
  4845. }, 100)
  4846. })
  4847. },
  4848. getTab2NutritionalList4() {
  4849. this.nutritional.tab2.listLoading4 = true
  4850. GetDataByName(this.nutritional.tab2.getdataListParm4).then(response => {
  4851. console.log('粪便评分', response.data.list)
  4852. if (response.data.list !== null) {
  4853. for (let i = 0; i < response.data.list.length; i++) {
  4854. this.$set(response.data.list[i], 'score1rate', (parseFloat(response.data.list[i].score1) / parseFloat(response.data.list[i].cowsum) * 100).toFixed(parseInt(Cookies.get('decimal'))))
  4855. this.$set(response.data.list[i], 'score2rate', (parseFloat(response.data.list[i].score2) / parseFloat(response.data.list[i].cowsum) * 100).toFixed(parseInt(Cookies.get('decimal'))))
  4856. this.$set(response.data.list[i], 'score3rate', (parseFloat(response.data.list[i].score3) / parseFloat(response.data.list[i].cowsum) * 100).toFixed(parseInt(Cookies.get('decimal'))))
  4857. this.$set(response.data.list[i], 'score4rate', (parseFloat(response.data.list[i].score4) / parseFloat(response.data.list[i].cowsum) * 100).toFixed(parseInt(Cookies.get('decimal'))))
  4858. this.$set(response.data.list[i], 'score5rate', (100 - response.data.list[i].score1rate - response.data.list[i].score2rate - response.data.list[i].score3rate - response.data.list[i].score4rate).toFixed(parseInt(Cookies.get('decimal'))))
  4859. }
  4860. this.nutritional.tab2.list4 = response.data.list
  4861. this.nutritional.tab2.pageNum4 = response.data.pageNum
  4862. this.nutritional.tab2.pageSize4 = response.data.pageSize
  4863. this.nutritional.tab2.total4 = response.data.total
  4864. } else {
  4865. this.nutritional.tab2.list4 = []
  4866. }
  4867. setTimeout(() => {
  4868. this.nutritional.tab2.listLoading4 = false
  4869. }, 100)
  4870. })
  4871. },
  4872. // 历史记录
  4873. handleHistoryRecords() {
  4874. console.log('点击了历史记录')
  4875. this.dialogFull = false
  4876. this.history.dialogStatus = 'history'
  4877. this.history.dialogFormVisible = true
  4878. this.getDateList()
  4879. },
  4880. // 历史时间
  4881. getDateList() {
  4882. GetDataByName(this.history.getdataDateParm).then(response => {
  4883. console.log('table数据', response.data.list)
  4884. if (response.data.list !== null) {
  4885. this.history.getdataListParm.parammaps.date = response.data.list[0].maxdate
  4886. this.getHistoryIsDisplay()
  4887. } else {
  4888. this.history.getdataListParm.parammaps.date = ''
  4889. }
  4890. })
  4891. },
  4892. getHistoryIsDisplay() {
  4893. GetDataByName(this.table.getdataListParm2).then(response => {
  4894. console.log(response.data.list[0].inforvalue)
  4895. if (response.data.list !== null) {
  4896. if (response.data.list[0].inforvalue == 0) {
  4897. this.table.isPtsfname = false
  4898. } else {
  4899. this.table.isPtsfname = true
  4900. }
  4901. }
  4902. })
  4903. GetDataByName(this.table.getdataListParm3).then(response => {
  4904. if (response.data.list !== null) {
  4905. if (response.data.list[0].inforvalue == 1) {
  4906. this.history.isRW1 = true
  4907. this.history.isRW2 = false
  4908. this.history.isRW3 = false
  4909. this.history.isRW4 = false
  4910. } else if (response.data.list[0].inforvalue == 2) {
  4911. this.history.isRW1 = true
  4912. this.history.isRW2 = true
  4913. this.history.isRW3 = false
  4914. this.history.isRW4 = false
  4915. } else if (response.data.list[0].inforvalue == 3) {
  4916. this.history.isRW1 = true
  4917. this.history.isRW2 = true
  4918. this.history.isRW3 = true
  4919. this.history.isRW4 = false
  4920. } else if (response.data.list[0].inforvalue == 4) {
  4921. this.history.isRW1 = true
  4922. this.history.isRW2 = true
  4923. this.history.isRW3 = true
  4924. this.history.isRW4 = true
  4925. }
  4926. } else {
  4927. this.history.isRW1 = false
  4928. this.history.isRW2 = false
  4929. this.history.isRW3 = false
  4930. this.history.isRW4 = false
  4931. }
  4932. })
  4933. this.getHistoryList()
  4934. },
  4935. getHistoryList() {
  4936. this.history.listLoading = true
  4937. GetDataByName(this.history.getdataListParm).then(response => {
  4938. console.log('table数据', response.data.list)
  4939. if (response.data.list !== null) {
  4940. console.log('table数据', response.data.list)
  4941. for (let i = 0; i < response.data.list.length; i++) {
  4942. if (response.data.list[i].ptid == undefined || response.data.list[i].ptname == '') {
  4943. this.$set(response.data.list[i], 'ptid', '')
  4944. this.$set(response.data.list[i], 'ptname', '')
  4945. }
  4946. }
  4947. this.history.list = response.data.list
  4948. this.handleSpan()
  4949. this.history.pageNum = response.data.pageNum
  4950. this.history.pageSize = response.data.pageSize
  4951. this.history.total = response.data.total
  4952. } else {
  4953. this.history.list = []
  4954. }
  4955. setTimeout(() => {
  4956. this.history.listLoading = false
  4957. }, 100)
  4958. })
  4959. },
  4960. handleSpan() {
  4961. this.mergekeys.forEach(key => {
  4962. this.spanObj[key] = []
  4963. let position = 0
  4964. this.history.list.forEach((item, index) => {
  4965. if (index === 0) {
  4966. this.spanObj[key].push(1)
  4967. position = 0
  4968. } else {
  4969. if (key == 'sumweight') {
  4970. if (this.history.list[index][key] === this.history.list[index - 1][key] && this.history.list[index]['barname'] === this.history.list[index - 1]['barname']) {
  4971. this.spanObj[key][position] += 1
  4972. this.spanObj[key].push(0)
  4973. } else {
  4974. this.spanObj[key].push(1)
  4975. position = index
  4976. }
  4977. } else {
  4978. if (this.history.list[index][key] === this.history.list[index - 1][key]) {
  4979. this.spanObj[key][position] += 1
  4980. this.spanObj[key].push(0)
  4981. } else {
  4982. this.spanObj[key].push(1)
  4983. position = index
  4984. }
  4985. }
  4986. }
  4987. })
  4988. })
  4989. },
  4990. objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  4991. for (let i = 0; i < this.mergekeys.length; i++) {
  4992. if (column.property === this.mergekeys[i]) {
  4993. const _row = this.spanObj[this.mergekeys[i]][rowIndex]
  4994. const _col = _row > 0 ? 1 : 0
  4995. return {
  4996. rowspan: _row,
  4997. colspan: _col
  4998. }
  4999. }
  5000. }
  5001. },
  5002. changeDate() {
  5003. this.getHistoryList()
  5004. },
  5005. // 应用
  5006. handleApplication() {
  5007. console.log('点击了应用')
  5008. MessageBox.confirm('是否确认将' + this.history.getdataListParm.parammaps.date + '的数据应用到当前?', {
  5009. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  5010. }).then(() => {
  5011. this.requestParam.name = 'applyFPdate'
  5012. this.requestParam.parammaps = {}
  5013. this.requestParam.parammaps.pastureid = Cookies.get('pastureid')
  5014. this.requestParam.parammaps.date = this.history.getdataListParm.parammaps.date
  5015. PostDataByName(this.requestParam).then(response => {
  5016. if (response.msg === 'fail') {
  5017. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  5018. } else {
  5019. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  5020. this.getHistoryIsDisplay()
  5021. this.getList()
  5022. }
  5023. })
  5024. }).catch(() => {
  5025. this.$message({ type: 'info', message: '已取消应用' })
  5026. })
  5027. },
  5028. // 导出
  5029. handleExport(item) {
  5030. if (item == 1) {
  5031. console.log('点击了导出模板')
  5032. this.download.getdataListParm.parammaps = this.table.getdataListParm.parammaps
  5033. GetDataByName(this.download.getdataListParm).then(response => {
  5034. if (response.data.list !== null) {
  5035. this.download.list = response.data.list
  5036. } else {
  5037. this.download.list = []
  5038. }
  5039. var downloadList = [
  5040. { 'obj1': '1、文件类型为xlsx类型,对应表格文件名格式为:文件名称.xlsx;' },
  5041. { 'obj1': '2、底部工作表名称不可更改,默认为:Sheet1;' },
  5042. { 'obj1': '3、栏舍名称,实际牛头数,系数(%),系数头数,配方模板,补料配方字体为必填;' },
  5043. { 'obj1': '4、第一列栏舍名称默认为系统中栏舍,不可修改;' },
  5044. { 'obj1': '5、实际牛头数为正整数,系数为正数,至多保留俩位小数;' },
  5045. { 'obj1': '6、配方模板名称必须与系统中配方计划—配方模板中的饲喂配方匹配;若补料配方开启,需与配方模板中的补料配方匹配;' },
  5046. { 'obj1': '7、数据最多可导入200条,超过200条请分多个文件导入。' }
  5047. ]
  5048. var excelDatas = [
  5049. {
  5050. tHeader: ['栏舍名称', '实际牛头数', '系数(%)', '配方模板', '补料配方', '第一班比例(%)', '第二班比例(%)', '第三班比例(%)', '第四班比例(%)'],
  5051. filterVal: ['barname', '', '', '', '', '', '', '', ''],
  5052. tableDatas: this.download.list,
  5053. sheetName: 'Sheet1'
  5054. }, {
  5055. tHeader: ['填写规范:'],
  5056. filterVal: ['obj1'],
  5057. tableDatas: downloadList,
  5058. sheetName: 'Sheet2'
  5059. }
  5060. ]
  5061. json2excel(excelDatas, '栏舍配方导入模板', true, 'xlsx')
  5062. })
  5063. } else {
  5064. console.log('点击了导出数据')
  5065. this.download.getdataListParm.parammaps = this.table.getdataListParm.parammaps
  5066. GetDataByName(this.download.getdataListParm).then(response => {
  5067. if (response.data.list !== null) {
  5068. for (let i = 0; i < response.data.list.length; i++) {
  5069. if (response.data.list[i].ftid !== undefined && response.data.list[i].ftid !== '') {
  5070. if (this.recipeTemplateList.find(obj => obj.id == response.data.list[i].ftid) !== undefined) {
  5071. this.$set(response.data.list[i], 'dryweight', this.recipeTemplateList.find(obj => obj.id == response.data.list[i].ftid).dryweight) // 编辑保存
  5072. } else {
  5073. this.$set(response.data.list[i], 'dryweight', '')
  5074. }
  5075. }
  5076. if (response.data.list[i].timesopt !== undefined) {
  5077. var timesoptArr = response.data.list[i].timesopt.split(',')
  5078. for (let j = 0; j < timesoptArr.length; j++) {
  5079. response.data.list[i]['r' + timesoptArr[j].split(':')[0]] = timesoptArr[j].split(':')[1]
  5080. response.data.list[i]['w' + timesoptArr[j].split(':')[0]] = timesoptArr[j].split(':')[2]
  5081. }
  5082. }
  5083. if (response.data.list[i].r1 == '' || response.data.list[i].r1 == undefined) {
  5084. response.data.list[i].r1 = 0
  5085. response.data.list[i].w1 = 0
  5086. }
  5087. if (response.data.list[i].r2 == '' || response.data.list[i].r2 == undefined) {
  5088. response.data.list[i].r2 = 0
  5089. response.data.list[i].w2 = 0
  5090. }
  5091. if (response.data.list[i].r3 == '' || response.data.list[i].r3 == undefined) {
  5092. response.data.list[i].r3 = 0
  5093. response.data.list[i].w3 = 0
  5094. }
  5095. if (response.data.list[i].r4 == '' || response.data.list[i].r4 == undefined) {
  5096. response.data.list[i].r4 = 0
  5097. response.data.list[i].w4 = 0
  5098. }
  5099. this.$set(response.data.list[i], 'sumr', parseFloat(response.data.list[i].r1) + parseFloat(response.data.list[i].r2) + parseFloat(response.data.list[i].r3) + parseFloat(response.data.list[i].r4))
  5100. response.data.list[i].sumr = formatNum(response.data.list[i].sumr, parseInt(Cookies.get('decimal')))
  5101. this.$set(response.data.list[i], 'dailyWeight', parseFloat(response.data.list[i].w1) + parseFloat(response.data.list[i].w2) + parseFloat(response.data.list[i].w3) + parseFloat(response.data.list[i].w4))
  5102. response.data.list[i].dailyWeight = formatNum(response.data.list[i].dailyWeight, parseInt(Cookies.get('decimal')))
  5103. }
  5104. this.download.list = response.data.list
  5105. } else {
  5106. this.download.list = []
  5107. }
  5108. if (this.table.isRW1 == true && this.table.isRW2 == false && this.table.isRW3 == false && this.table.isRW4 == false) {
  5109. var excelDatas = [
  5110. {
  5111. tHeader: ['栏舍名称', '软件牛头数', '实际牛头数', '系数(%)', '系数头数', '配方模板', '补料配方', '第一班比例(%)', '第一班重量', '总比例', '日投喂量', '配方重量', '补料重量', '配方干物质'],
  5112. filterVal: ['barname', 'softccount', 'ccount', 'ratio', 'ccountratio', 'ftname', 'ptsfname', 'r1', 'w1', 'sumr', 'dailyWeight', 'ftweight', 'supplyweight', 'dryweight'],
  5113. tableDatas: this.download.list,
  5114. sheetName: 'Sheet1'
  5115. }
  5116. ]
  5117. } else if (this.table.isRW1 == true && this.table.isRW2 == true && this.table.isRW3 == false && this.table.isRW4 == false) {
  5118. var excelDatas = [
  5119. {
  5120. tHeader: ['栏舍名称', '软件牛头数', '实际牛头数', '系数(%)', '系数头数', '配方模板', '补料配方', '第一班比例(%)', '第一班重量', '第二班比例(%)', '第二班重量', '总比例', '日投喂量', '配方重量', '补料重量', '配方干物质'],
  5121. filterVal: ['barname', 'softccount', 'ccount', 'ratio', 'ccountratio', 'ftname', 'ptsfname', 'r1', 'w1', 'r2', 'w2', 'sumr', 'dailyWeight', 'ftweight', 'supplyweight', 'dryweight'],
  5122. tableDatas: this.download.list,
  5123. sheetName: 'Sheet1'
  5124. }
  5125. ]
  5126. } else if (this.table.isRW1 == true && this.table.isRW2 == true && this.table.isRW3 == true && this.table.isRW4 == false) {
  5127. var excelDatas = [
  5128. {
  5129. tHeader: ['栏舍名称', '软件牛头数', '实际牛头数', '系数(%)', '系数头数', '配方模板', '补料配方', '第一班比例(%)', '第一班重量', '第二班比例(%)', '第二班重量', '第三班比例(%)', '第三班重量', '总比例', '日投喂量', '配方重量', '补料重量', '配方干物质'],
  5130. filterVal: ['barname', 'softccount', 'ccount', 'ratio', 'ccountratio', 'ftname', 'ptsfname', 'r1', 'w1', 'r2', 'w2', 'r3', 'w3', 'sumr', 'dailyWeight', 'ftweight', 'supplyweight', 'dryweight'],
  5131. tableDatas: this.download.list,
  5132. sheetName: 'Sheet1'
  5133. }
  5134. ]
  5135. } else {
  5136. var excelDatas = [
  5137. {
  5138. tHeader: ['栏舍名称', '软件牛头数', '实际牛头数', '系数(%)', '系数头数', '配方模板', '补料配方', '第一班比例(%)', '第一班重量', '第二班比例(%)', '第二班重量', '第三班比例(%)', '第三班重量', '第四班比例(%)', '第四班重量', '总比例', '日投喂量', '配方重量', '补料重量', '配方干物质'],
  5139. filterVal: ['barname', 'softccount', 'ccount', 'ratio', 'ccountratio', 'ftname', 'ptsfname', 'r1', 'w1', 'r2', 'w2', 'r3', 'w3', 'r4', 'w4', 'sumr', 'dailyWeight', 'ftweight', 'supplyweight', 'dryweight'],
  5140. tableDatas: this.download.list,
  5141. sheetName: 'Sheet1'
  5142. }
  5143. ]
  5144. }
  5145. json2excel(excelDatas, '栏舍配方', true, 'xlsx')
  5146. })
  5147. }
  5148. },
  5149. beforeImport(file) {
  5150. const isLt2M = file.size / 1024 / 1024 < 2
  5151. if (!isLt2M) {
  5152. this.$message.error('上传文件大小不能超过 2MB!')
  5153. }
  5154. return isLt2M
  5155. },
  5156. handleImportSuccess(res, file) {
  5157. this.getList()
  5158. if (res.msg === 'ok') {
  5159. this.$message({ title: '成功', message: '导入成功:' + res.data.success + '条!', type: 'success', duration: 2000 })
  5160. if (res.data.err_count > 0) {
  5161. this.$notify({ title: '失败', message: '导入失败:' + res.data.err_count + '条!', type: 'danger', duration: 2000 })
  5162. import('@/vendor/Export2Excel').then(excel => {
  5163. const list1 = res.data.result
  5164. const tHeader = [
  5165. '栏舍名称', '实际牛头数', '系数(%)', '配方模板', '补料配方', '第一班比例(%)', '第二班比例(%)', '第三班比例(%)', '错误信息'
  5166. ]
  5167. const filterVal = [
  5168. '栏舍名称', '实际牛头数', '系数(%)', '配方模板', '补料配方', '第一班比例(%)', '第二班比例(%)', '第三班比例(%)', 'error_msg'
  5169. ]
  5170. const data1 = this.formatJson(filterVal, list1)
  5171. excel.export_json_to_excel({ header: tHeader, data: data1, filename: '栏舍配方导入报错信息', autoWidth: true, bookType: 'xlsx' })
  5172. })
  5173. }
  5174. } else {
  5175. this.$notify({ title: '失败', message: '上传失败', type: 'danger', duration: 2000 })
  5176. }
  5177. },
  5178. formatJson(filterVal, jsonData) {
  5179. return jsonData.map(v =>
  5180. filterVal.map(j => {
  5181. if (j === 'timestamp') {
  5182. return parseTime(v[j])
  5183. } else {
  5184. return v[j]
  5185. }
  5186. })
  5187. )
  5188. },
  5189. // 干物质调节
  5190. handleDryMatterRegulation() {
  5191. console.log('干物质调节')
  5192. this.isShowDialog = true
  5193. this.$refs.mychild.getBalconicFormula()
  5194. this.$refs.mychild.restTemp()
  5195. },
  5196. blurBw(row) {
  5197. console.log(row)
  5198. },
  5199. focusBw(row) {
  5200. console.log(row)
  5201. }
  5202. }
  5203. }
  5204. </script>
  5205. <style lang="scss" scoped>
  5206. .search {
  5207. clear: both;
  5208. }
  5209. .table {
  5210. margin-top: 10px;
  5211. }
  5212. </style>
  5213. <style lang="scss">
  5214. .red-row{
  5215. background: #fde2e2 !important;
  5216. }
  5217. </style>