1a77eebf91a99664226900b64eee5b91eaf70502.svn-base 297 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172
  1. <template>
  2. <div class="app-container">
  3. <div class="operation">
  4. <el-button v-if="isRoleEdit" class="successBorder" style="float: left;" @click="handleNutritional">营养评估</el-button>
  5. <el-button v-if="isRoleEdit" class="successBorder" style="float: left;" @click="handleDryMatterRegulation">干物质调节</el-button>
  6. <el-upload style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
  7. <el-button v-if="isRoleEdit" class="import" icon="el-icon-download" style="float: right;">导入</el-button>
  8. </el-upload>
  9. <el-dropdown style="float: right;margin-right: 10px;">
  10. <el-button class="export" icon="el-icon-upload2">导出</el-button>
  11. <el-dropdown-menu slot="dropdown">
  12. <el-dropdown-item @click.native="handleExport(1)">导出模板</el-dropdown-item>
  13. <el-dropdown-item @click.native="handleExport(2)">导出数据</el-dropdown-item>
  14. </el-dropdown-menu>
  15. </el-dropdown>
  16. <el-button class="export" style="float: right;margin-right: 10px;" @click="handleHistoryRecords">历史记录</el-button>
  17. </div>
  18. <div class="search" />
  19. <div class="table">
  20. <el-table
  21. :key="table.tableKey"
  22. ref="table"
  23. v-loading="table.listLoading"
  24. element-loading-text="给我一点时间"
  25. :data="table.list"
  26. border
  27. fit
  28. highlight-current-row
  29. style="width: 100%;"
  30. :row-style="rowStyle"
  31. :cell-style="cellStyle"
  32. class="elTable table-fixed"
  33. @header-click="headerClick"
  34. @cell-click="cellClick"
  35. @selection-change="handleSelect"
  36. >
  37. <el-table-column type="selection" width="50" />
  38. <el-table-column :key="1" label="序号" align="center" type="index" width="50px" class-name="small-padding fixed-width" fixed="left">
  39. <template slot-scope="scope">
  40. <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
  41. </template>
  42. </el-table-column>
  43. <el-table-column label="栏舍名称" min-width="100px" align="center" class-name="small-padding fixed-width" fixed="left">
  44. <template slot-scope="scope">
  45. <span>{{ scope.row.barname }}</span>
  46. </template>
  47. </el-table-column>
  48. <el-table-column label="软件牛头数" min-width="70px" align="center">
  49. <template slot-scope="scope">
  50. <span>{{ scope.row.softccount }}</span>
  51. </template>
  52. </el-table-column>
  53. <el-table-column label="实际牛头数" min-width="90px" align="center">
  54. <template slot-scope="scope">
  55. <span v-if="scope.row.NoEdit">{{ scope.row.ccount }}</span>
  56. <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)" />
  57. </template>
  58. </el-table-column>
  59. <el-table-column label="系数(%)" min-width="85px" align="center">
  60. <template slot-scope="scope">
  61. <span v-if="scope.row.NoEdit">{{ scope.row.ratio }}</span>
  62. <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)" />
  63. </template>
  64. </el-table-column>
  65. <el-table-column label="系数头数" min-width="85px" align="center">
  66. <template slot-scope="scope">
  67. <span v-if="scope.row.NoEdit">{{ scope.row.ccountratio }}</span>
  68. <el-input v-if="scope.row.Edit" v-model="scope.row.ccountratio" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurCcountratio(scope.row)" />
  69. </template>
  70. </el-table-column>
  71. <el-table-column label="配方模板" min-width="130px" align="center">
  72. <template slot-scope="scope">
  73. <span v-if="scope.row.NoEdit">{{ scope.row.ftname }}</span>
  74. <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)}">
  75. <el-option v-for="item in recipeTemplateList" :key="item.id" :label="item.tname" :value="item.id" />
  76. </el-select>
  77. </template>
  78. </el-table-column>
  79. <el-table-column v-if="table.isPtsfname" :key="8" label="补料配方" min-width="130px" align="center">
  80. <template slot-scope="scope">
  81. <span v-if="scope.row.NoEdit">{{ scope.row.ptsfname }}</span>
  82. <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)}">
  83. <el-option v-for="item in feedingFormulaList" :key="item.id" :label="item.tname" :value="item.id" />
  84. </el-select>
  85. </template>
  86. </el-table-column>
  87. <el-table-column v-if="table.isRW1" :key="9" label="第一班比例(%)" min-width="80px" align="center">
  88. <template slot-scope="scope">
  89. <span v-if="scope.row.NoEdit">{{ scope.row.r1 }}</span>
  90. <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)" />
  91. </template>
  92. </el-table-column>
  93. <el-table-column v-if="table.isRW1" :key="10" label="第一班重量" min-width="120px" align="center" :render-header="renderHeader">
  94. <template slot-scope="scope">
  95. <span v-if="scope.row.NoEdit">{{ scope.row.w1 }}</span>
  96. <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)" />
  97. </template>
  98. </el-table-column>
  99. <el-table-column v-if="table.isRW2" :key="11" label="第二班比例(%)" min-width="80px" align="center">
  100. <template slot-scope="scope">
  101. <span v-if="scope.row.NoEdit">{{ scope.row.r2 }}</span>
  102. <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)" />
  103. </template>
  104. </el-table-column>
  105. <el-table-column v-if="table.isRW2" :key="12" label="第二班重量" min-width="120px" align="center" :render-header="renderHeader">
  106. <template slot-scope="scope">
  107. <span v-if="scope.row.NoEdit">{{ scope.row.w2 }}</span>
  108. <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)" />
  109. </template>
  110. </el-table-column>
  111. <el-table-column v-if="table.isRW3" :key="13" label="第三班比例(%)" min-width="80px" align="center">
  112. <template slot-scope="scope">
  113. <span v-if="scope.row.NoEdit">{{ scope.row.r3 }}</span>
  114. <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)" />
  115. </template>
  116. </el-table-column>
  117. <el-table-column v-if="table.isRW3" :key="14" label="第三班重量" min-width="120px" align="center" :render-header="renderHeader">
  118. <template slot-scope="scope">
  119. <span v-if="scope.row.NoEdit">{{ scope.row.w3 }}</span>
  120. <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)" />
  121. </template>
  122. </el-table-column>
  123. <el-table-column v-if="table.isRW4" :key="15" label="第四班比例(%)" min-width="80px" align="center">
  124. <template slot-scope="scope">
  125. <span v-if="scope.row.NoEdit">{{ scope.row.r4 }}</span>
  126. <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)" />
  127. </template>
  128. </el-table-column>
  129. <el-table-column v-if="table.isRW4" :key="16" label="第四班重量" min-width="120px" align="center" :render-header="renderHeader">
  130. <template slot-scope="scope">
  131. <span v-if="scope.row.NoEdit">{{ scope.row.w4 }}</span>
  132. <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)" />
  133. </template>
  134. </el-table-column>
  135. <el-table-column :key="17" label="总比例(%)" min-width="80px" align="center">
  136. <template slot-scope="scope">
  137. <span>{{ scope.row.sumr }}</span>
  138. </template>
  139. </el-table-column>
  140. <!-- <el-table-column :key="22" label="投喂量" min-width="80px" align="center">
  141. <template slot-scope="scope">
  142. <span>{{ scope.row.feedweight }}</span>
  143. </template>
  144. </el-table-column> -->
  145. <el-table-column :key="18" label="日投喂量" min-width="70px" align="center">
  146. <template slot-scope="scope">
  147. <span>{{ scope.row.dailyWeight }}</span>
  148. </template>
  149. </el-table-column>
  150. <el-table-column :key="19" label="配方重量" min-width="70px" align="center">
  151. <template slot-scope="scope">
  152. <span>{{ scope.row.ftweight }}</span>
  153. </template>
  154. </el-table-column>
  155. <el-table-column v-if="table.isPtsfname" :key="20" label="补料重量" min-width="100px" align="center">
  156. <template slot-scope="scope">
  157. <span>{{ scope.row.supplyweight }}</span>
  158. </template>
  159. </el-table-column>
  160. <el-table-column :key="21" label="配方干物质" min-width="70px" align="center">
  161. <template slot-scope="scope">
  162. <span>{{ scope.row.dryweight }}</span>
  163. </template>
  164. </el-table-column>
  165. <el-table-column label="操作" align="center" width="80" class-name="small-padding fixed-width" fixed="right">
  166. <template slot-scope="{row}">
  167. <el-button v-if="row.isUpdate && isRoleEdit" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
  168. <el-button v-if="row.isUpdateSave && isRoleEdit" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData(row)" />
  169. <span v-if="row.isUpdateSave && isRoleEdit" class="centerSpan">|</span>
  170. <el-button v-if="row.isUpdateSave && isRoleEdit" class="minCancel" icon="el-icon-close" @click="updateCancel(row)" />
  171. </template>
  172. </el-table-column>
  173. </el-table>
  174. <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
  175. </div>
  176. <!-- 历史记录 -->
  177. <el-dialog :fullscreen="dialogFull" :destroy-on-close="true" :visible.sync="history.dialogFormVisible" :close-on-click-modal="false" width="90%">
  178. <template slot="title">
  179. <div class="avue-crud__dialog__header">
  180. <span class="el-dialog__title">
  181. <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
  182. {{ textMap[history.dialogStatus] }}
  183. </span>
  184. <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
  185. <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
  186. <svg-icon v-else icon-class="fullscreen" />
  187. </div>
  188. </div>
  189. </template>
  190. <div class="app-history">
  191. <div class="search">
  192. <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" />
  193. <!-- <el-button class="successBorder" @click="handleApplication">应用</el-button> -->
  194. </div>
  195. <div class="table">
  196. <el-table
  197. :key="history.tableKey"
  198. v-loading="history.listLoading"
  199. element-loading-text="给我一点时间"
  200. :data="history.list"
  201. border
  202. fit
  203. highlight-current-row
  204. style="width: 100%;"
  205. :row-style="rowStyle"
  206. :cell-style="cellStyle"
  207. class="elTable table-fixed"
  208. :span-method="objectSpanMethod"
  209. >
  210. <el-table-column :key="1" label="序号" align="center" type="index" width="50px" class-name="small-padding fixed-width" fixed="left">
  211. <template slot-scope="scope">
  212. <span>{{ scope.$index + (history.pageNum-1) * history.pageSize + 1 }}</span>
  213. </template>
  214. </el-table-column>
  215. <el-table-column :key="2" label="栏舍名称" prop="barname" min-width="90px" align="center" class-name="small-padding fixed-width" fixed="left" />
  216. <el-table-column :key="3" label="班次" prop="times" min-width="90px" align="center" class-name="small-padding fixed-width" fixed="left" />
  217. <el-table-column :key="4" label="软件牛头数" prop="softccount" min-width="70px" align="center" />
  218. <el-table-column :key="5" label="实际牛头数" prop="ccount" min-width="70px" align="center" />
  219. <el-table-column :key="6" label="系数(%)" prop="ratio" min-width="70px" align="center" />
  220. <el-table-column :key="7" label="系数头数" prop="ccountratio" min-width="70px" align="center" />
  221. <el-table-column :key="8" label="配方模板" prop="ptname" min-width="70px" align="center" />
  222. <el-table-column v-if="table.isPtsfname" :key="9" label="补料配方" prop="ptsname" min-width="70px" align="center" />
  223. <el-table-column :key="10" label="班次比例" prop="tratio" min-width="70px" align="center" />
  224. <el-table-column :key="11" label="班次重量" prop="weight" min-width="70px" align="center" />
  225. <el-table-column :key="12" label="配方重量" prop="pweight" min-width="70px" align="center" />
  226. <el-table-column v-if="table.isPtsfname" :key="13" label="补料重量" prop="ptweight" min-width="70px" align="center" />
  227. <el-table-column :key="14" label="配方干物质量" prop="dryweight" min-width="70px" align="center" />
  228. <el-table-column :key="15" label="饲喂干物质量" prop="swdryw" min-width="70px" align="center" />
  229. <el-table-column :key="16" label="采样干物质量" prop="cydryw" min-width="70px" align="center" />
  230. <el-table-column :key="17" label="日投喂量" prop="sumweight" min-width="70px" align="center" />
  231. </el-table>
  232. <pagination2 v-show="history.total>0" :total="history.total" :page.sync="history.getdataListParm.offset" :limit.sync="history.getdataListParm.pagecount" @pagination="getHistoryList" />
  233. </div>
  234. </div>
  235. <div slot="footer" class="dialog-footer" style="bottom: 10px;">
  236. <el-button class="cancelClose cancelClose1" @click="history.dialogFormVisible = false; ">关闭</el-button>
  237. </div>
  238. </el-dialog>
  239. <!-- 营养评估 -->
  240. <el-dialog :fullscreen="dialogFull" :visible.sync="nutritional.dialogFormVisible" :close-on-click-modal="false" width="90%">
  241. <template slot="title">
  242. <div class="avue-crud__dialog__header">
  243. <span class="el-dialog__title">
  244. <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
  245. {{ textMap[nutritional.dialogStatus] }}
  246. </span>
  247. <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
  248. <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
  249. <svg-icon v-else icon-class="fullscreen" />
  250. </div>
  251. </div>
  252. </template>
  253. <div class="app-nutritional">
  254. <h4 style="position: absolute;top:-5px;left:140px;font:16px/30px '' ;color:#303133;">栏舍:{{ nutritional.tab1.temp.barname }}</h4>
  255. <el-tabs v-model="nutritional.activeName" @tab-click="handleNutritionalTab">
  256. <el-tab-pane label="营养评估" name="first">
  257. <el-form ref="temp" :rules="rules" :model="nutritional.tab1.temp" label-position="right" label-width="95px" style="width: 100%;margin-bottom:30px">
  258. <el-row>
  259. <el-col :span="4">
  260. <el-form-item label="类别" prop="cowclassid">
  261. <el-select v-model="nutritional.tab1.temp.cowclassid" :disabled="nutritional.tab1.disabledCowclass" filterable placeholder="" class="filter-item" style="width:100%;">
  262. <el-option v-for="item in livestockTypeList" :key="item.id" :label="item.mixname" :value="item.id" />
  263. </el-select>
  264. </el-form-item>
  265. </el-col>
  266. <el-col :span="4">
  267. <el-form-item label="月龄" prop="avgmonthage">
  268. <el-input ref="avgmonthage" v-model="nutritional.tab1.temp.avgmonthage" class="filter-item" placeholder="" style="width:100%;" />
  269. </el-form-item>
  270. </el-col>
  271. <el-col :span="4">
  272. <el-form-item label="体重(kg)" prop="bw">
  273. <el-input ref="bw" v-model="nutritional.tab1.temp.bw" class="filter-item" placeholder="" style="width:100%;" />
  274. </el-form-item>
  275. </el-col>
  276. <el-col :span="4">
  277. <el-form-item label="日增重(kg)" prop="dayw">
  278. <el-input ref="dayw" v-model="nutritional.tab1.temp.dayw" class="filter-item" placeholder="" style="width:100%;" />
  279. </el-form-item>
  280. </el-col>
  281. <el-col :span="4">
  282. <el-form-item label="胎次(次)" prop="fetal">
  283. <el-input ref="fetal" v-model="nutritional.tab1.temp.fetal" class="filter-item" placeholder="" style="width:100%;" />
  284. </el-form-item>
  285. </el-col>
  286. <el-col :span="4">
  287. <el-form-item label="泌乳天数(天)" prop="avgdim">
  288. <el-input ref="avgdim" v-model="nutritional.tab1.temp.avgdim" class="filter-item" placeholder="" style="width:100%;" />
  289. </el-form-item>
  290. </el-col>
  291. </el-row>
  292. <el-row>
  293. <el-col :span="4">
  294. <el-form-item label="怀孕天数(天)" prop="dayspre">
  295. <el-input ref="dayspre" v-model="nutritional.tab1.temp.dayspre" class="filter-item" placeholder="" style="width:100%;" />
  296. </el-form-item>
  297. </el-col>
  298. <el-col :span="4">
  299. <el-form-item label="产奶量(kg)" prop="product">
  300. <el-input ref="product" v-model="nutritional.tab1.temp.product" class="filter-item" placeholder="" style="width:100%;" />
  301. </el-form-item>
  302. </el-col>
  303. <el-col :span="4">
  304. <el-form-item label="乳脂率(%)" prop="fat">
  305. <el-input ref="fat" v-model="nutritional.tab1.temp.fat" class="filter-item" placeholder="" style="width:100%;" />
  306. </el-form-item>
  307. </el-col>
  308. <el-col :span="4">
  309. <el-form-item label="乳蛋白率(%)" prop="pro">
  310. <el-input ref="pro" v-model="nutritional.tab1.temp.pro" class="filter-item" placeholder="" style="width:100%;" />
  311. </el-form-item>
  312. </el-col>
  313. <el-col :span="4">
  314. <el-form-item label="乳糖率(%)" prop="lactose">
  315. <el-input ref="lactose" v-model="nutritional.tab1.temp.lactose" class="filter-item" placeholder="" style="width:100%;" />
  316. </el-form-item>
  317. </el-col>
  318. <el-col :span="4">
  319. <el-form-item label="温度(℃)" prop="tem">
  320. <el-input ref="tem" v-model="nutritional.tab1.temp.tem" class="filter-item" placeholder="" style="width:100%;" />
  321. </el-form-item>
  322. </el-col>
  323. </el-row>
  324. </el-form>
  325. <div style="height: 50px;">
  326. <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;" />
  327. <el-button class="el-icon-arrow-left elIconArrowLeft" @click="handleBefore" />
  328. <el-button class="el-icon-arrow-right elIconArrowRight" @click="handleNext" />
  329. <el-button class="successBorder" :disabled="isokDisable" @click="assessmentData()">评估</el-button>
  330. </div>
  331. <div class="table">
  332. <el-table
  333. :key="nutritional.tab1.tableKey"
  334. v-loading="nutritional.tab1.listLoading"
  335. element-loading-text="给我一点时间"
  336. :data="nutritional.tab1.list"
  337. border
  338. fit
  339. highlight-current-row
  340. style="width: 100%;margin-bottom:60px;"
  341. :row-style="rowStyle"
  342. :cell-style="cellStyle"
  343. class="elTable table-fixed"
  344. :row-class-name="tableRowClassName"
  345. >
  346. <el-table-column label="序号" align="center" type="index" width="50px" />
  347. <el-table-column label="指标" min-width="130px" align="center">
  348. <template slot-scope="scope">
  349. <span>{{ scope.row.standard }}</span>
  350. </template>
  351. </el-table-column>
  352. <el-table-column label="奶牛需要" min-width="130px" align="center">
  353. <template slot-scope="scope">
  354. <span>{{ scope.row.cowneed }}</span>
  355. </template>
  356. </el-table-column>
  357. <el-table-column label="配方量" min-width="130px" align="center">
  358. <template slot-scope="scope">
  359. <span>{{ scope.row.ftpro }}</span>
  360. </template>
  361. </el-table-column>
  362. <el-table-column label="TMR料" min-width="130px" align="center">
  363. <template slot-scope="scope">
  364. <span>{{ scope.row.hprov }}</span>
  365. </template>
  366. </el-table-column>
  367. <el-table-column label="采食量" min-width="130px" align="center">
  368. <template slot-scope="scope">
  369. <span>{{ scope.row.sprov }}</span>
  370. </template>
  371. </el-table-column>
  372. </el-table>
  373. </div>
  374. </el-tab-pane>
  375. <el-tab-pane label="牛群评估" name="second">
  376. <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" />
  377. <el-button class="el-icon-arrow-left elIconArrowLeft" @click="handleBefore" />
  378. <el-button class="el-icon-arrow-right elIconArrowRight" @click="handleNext" />
  379. <el-row>
  380. <el-col :span="24">
  381. <h3 style="text-align: center;">宾州筛分析</h3>
  382. <div class="table">
  383. <el-table
  384. :key="nutritional.tab2.tableKey1"
  385. v-loading="nutritional.tab2.listLoading1"
  386. element-loading-text="给我一点时间"
  387. :data="nutritional.tab2.list1"
  388. border
  389. fit
  390. highlight-current-row
  391. style="width: 100%;margin-bottom:60px;"
  392. :row-style="rowStyle"
  393. :cell-style="cellStyle"
  394. class="elTable table-fixed"
  395. >
  396. <el-table-column label="日期" min-width="130px" align="center">
  397. <template slot-scope="scope">
  398. <span>{{ scope.row.operatetime }}</span>
  399. </template>
  400. </el-table-column>
  401. <el-table-column label="第一层重量(g)" min-width="130px" align="center">
  402. <template slot-scope="scope">
  403. <span>{{ scope.row.oneweight }}</span>
  404. </template>
  405. </el-table-column>
  406. <el-table-column label="第一层百分比" min-width="130px" align="center">
  407. <template slot-scope="scope">
  408. <span>{{ scope.row.onerate }}</span>
  409. </template>
  410. </el-table-column>
  411. <el-table-column label="第二层重量(g)" min-width="130px" align="center">
  412. <template slot-scope="scope">
  413. <span>{{ scope.row.twoweight }}</span>
  414. </template>
  415. </el-table-column>
  416. <el-table-column label="第二层百分比" min-width="130px" align="center">
  417. <template slot-scope="scope">
  418. <span>{{ scope.row.tworate }}</span>
  419. </template>
  420. </el-table-column>
  421. <el-table-column label="第三层重量(g)" min-width="130px" align="center">
  422. <template slot-scope="scope">
  423. <span>{{ scope.row.threeweight }}</span>
  424. </template>
  425. </el-table-column>
  426. <el-table-column label="第三层百分比" min-width="130px" align="center">
  427. <template slot-scope="scope">
  428. <span>{{ scope.row.threerate }}</span>
  429. </template>
  430. </el-table-column>
  431. <el-table-column label="第四层重量(g)" min-width="130px" align="center">
  432. <template slot-scope="scope">
  433. <span>{{ scope.row.fourweight }}</span>
  434. </template>
  435. </el-table-column>
  436. <el-table-column label="第四层百分比" min-width="130px" align="center">
  437. <template slot-scope="scope">
  438. <span>{{ scope.row.fourrate }}</span>
  439. </template>
  440. </el-table-column>
  441. <el-table-column label="参考标准" min-width="130px" align="center">
  442. <template slot-scope="scope">
  443. <span>{{ scope.row.standard }}</span>
  444. </template>
  445. </el-table-column>
  446. </el-table>
  447. </div>
  448. </el-col>
  449. </el-row>
  450. <el-row>
  451. <el-col :span="24">
  452. <h3 style="text-align: center;">粪便筛分析</h3>
  453. <div class="table">
  454. <el-table
  455. :key="nutritional.tab2.tableKey2"
  456. v-loading="nutritional.tab2.listLoading2"
  457. element-loading-text="给我一点时间"
  458. :data="nutritional.tab2.list2"
  459. border
  460. fit
  461. highlight-current-row
  462. style="width: 100%;margin-bottom:60px;"
  463. :row-style="rowStyle"
  464. :cell-style="cellStyle"
  465. class="elTable table-fixed"
  466. >
  467. <el-table-column label="日期" min-width="130px" align="center">
  468. <template slot-scope="scope">
  469. <span>{{ scope.row.operatetime }}</span>
  470. </template>
  471. </el-table-column>
  472. <el-table-column label="第一层重量(g)" min-width="130px" align="center">
  473. <template slot-scope="scope">
  474. <span>{{ scope.row.oneweight }}</span>
  475. </template>
  476. </el-table-column>
  477. <el-table-column label="第一层百分比" min-width="130px" align="center">
  478. <template slot-scope="scope">
  479. <span>{{ scope.row.onerate }}</span>
  480. </template>
  481. </el-table-column>
  482. <el-table-column label="第二层重量(g)" min-width="130px" align="center">
  483. <template slot-scope="scope">
  484. <span>{{ scope.row.twoweight }}</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.tworate }}</span>
  490. </template>
  491. </el-table-column>
  492. <el-table-column label="第三层重量(g)" min-width="130px" align="center">
  493. <template slot-scope="scope">
  494. <span>{{ scope.row.threeweight }}</span>
  495. </template>
  496. </el-table-column>
  497. <el-table-column label="第三层百分比" min-width="130px" align="center">
  498. <template slot-scope="scope">
  499. <span>{{ scope.row.threerate }}</span>
  500. </template>
  501. </el-table-column>
  502. <el-table-column label="参考标准" min-width="130px" align="center">
  503. <template slot-scope="scope">
  504. <span>{{ scope.row.standard }}</span>
  505. </template>
  506. </el-table-column>
  507. </el-table>
  508. </div>
  509. </el-col>
  510. </el-row>
  511. <el-row>
  512. <el-col :span="24">
  513. <h3 style="text-align: center;">BCS评分</h3>
  514. <div class="table">
  515. <el-table
  516. :key="nutritional.tab2.tableKey3"
  517. v-loading="nutritional.tab2.listLoading3"
  518. element-loading-text="给我一点时间"
  519. :data="nutritional.tab2.list3"
  520. border
  521. fit
  522. highlight-current-row
  523. style="width: 100%;margin-bottom:60px;"
  524. :row-style="rowStyle"
  525. :cell-style="cellStyle"
  526. class="elTable table-fixed"
  527. >
  528. <el-table-column label="日期" min-width="130px" align="center">
  529. <template slot-scope="scope">
  530. <span>{{ scope.row.operatetime }}</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.sumcowcount }}</span>
  536. </template>
  537. </el-table-column>
  538. <el-table-column label="单产(kg/头)" min-width="130px" align="center">
  539. <template slot-scope="scope">
  540. <span>{{ scope.row.product }}</span>
  541. </template>
  542. </el-table-column>
  543. <el-table-column label="干物质采食量(kg/头)" min-width="130px" align="center">
  544. <template slot-scope="scope">
  545. <span>{{ scope.row.cowneed }}</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.avgdim }}</span>
  551. </template>
  552. </el-table-column>
  553. <el-table-column label="标准分数" min-width="130px" align="center">
  554. <template slot-scope="scope">
  555. <span>{{ scope.row.standardscore }}</span>
  556. </template>
  557. </el-table-column>
  558. <el-table-column label="2.75-分(数量、百分比)" min-width="130px" align="center">
  559. <template slot-scope="scope">
  560. <span>{{ scope.row.score25 }}({{ scope.row.score25rate }}%)</span>
  561. </template>
  562. </el-table-column>
  563. <el-table-column label="2.75分(数量、百分比)" min-width="130px" align="center">
  564. <template slot-scope="scope">
  565. <span>{{ scope.row.score275 }}({{ scope.row.score275rate }}%)</span>
  566. </template>
  567. </el-table-column>
  568. <el-table-column label="3分(数量、百分比)" min-width="130px" align="center">
  569. <template slot-scope="scope">
  570. <span>{{ scope.row.score3 }}({{ scope.row.score3rate }}%)</span>
  571. </template>
  572. </el-table-column>
  573. <el-table-column label="3.25分(数量、百分比)" min-width="130px" align="center">
  574. <template slot-scope="scope">
  575. <span>{{ scope.row.score325 }}({{ scope.row.score325rate }}%)</span>
  576. </template>
  577. </el-table-column>
  578. <el-table-column label="3.5分(数量、百分比)" min-width="130px" align="center">
  579. <template slot-scope="scope">
  580. <span>{{ scope.row.score35 }}({{ scope.row.score35rate }}%)</span>
  581. </template>
  582. </el-table-column>
  583. <el-table-column label="3.75分(数量、百分比)" min-width="130px" align="center">
  584. <template slot-scope="scope">
  585. <span>{{ scope.row.score375 }}({{ scope.row.score375rate }}%)</span>
  586. </template>
  587. </el-table-column>
  588. <el-table-column label="4+分(数量、百分比)" min-width="130px" align="center">
  589. <template slot-scope="scope">
  590. <span>{{ scope.row.score4 }}({{ scope.row.score4rate }}%)</span>
  591. </template>
  592. </el-table-column>
  593. </el-table>
  594. </div>
  595. </el-col>
  596. </el-row>
  597. <el-row>
  598. <el-col :span="24">
  599. <h3 style="text-align: center;">粪便评分</h3>
  600. <div class="table">
  601. <el-table
  602. :key="nutritional.tab2.tableKey4"
  603. v-loading="nutritional.tab2.listLoading4"
  604. element-loading-text="给我一点时间"
  605. :data="nutritional.tab2.list4"
  606. border
  607. fit
  608. highlight-current-row
  609. style="width: 100%;margin-bottom:60px;"
  610. :row-style="rowStyle"
  611. :cell-style="cellStyle"
  612. class="elTable table-fixed"
  613. >
  614. <el-table-column label="日期" min-width="130px" align="center">
  615. <template slot-scope="scope">
  616. <span>{{ scope.row.operatetime }}</span>
  617. </template>
  618. </el-table-column>
  619. <el-table-column label="抽查样本数" min-width="130px" align="center">
  620. <template slot-scope="scope">
  621. <span>{{ scope.row.sumcowcount }}</span>
  622. </template>
  623. </el-table-column>
  624. <el-table-column label="单产(kg/头)" min-width="130px" align="center">
  625. <template slot-scope="scope">
  626. <span>{{ scope.row.product }}</span>
  627. </template>
  628. </el-table-column>
  629. <el-table-column label="干物质采食量(kg/头)" min-width="130px" align="center">
  630. <template slot-scope="scope">
  631. <span>{{ scope.row.cowneed }}</span>
  632. </template>
  633. </el-table-column>
  634. <el-table-column label="泌乳天数" min-width="130px" align="center">
  635. <template slot-scope="scope">
  636. <span>{{ scope.row.avgdim }}</span>
  637. </template>
  638. </el-table-column>
  639. <el-table-column label="标准分数" min-width="130px" align="center">
  640. <template slot-scope="scope">
  641. <span>{{ scope.row.cowneed }}</span>
  642. </template>
  643. </el-table-column>
  644. <el-table-column label="1分(数量、百分比)" min-width="130px" align="center">
  645. <template slot-scope="scope">
  646. <span>{{ scope.row.score1 }}({{ scope.row.score1rate }}%)</span>
  647. </template>
  648. </el-table-column>
  649. <el-table-column label="2分(数量、百分比)" min-width="130px" align="center">
  650. <template slot-scope="scope">
  651. <span>{{ scope.row.score2 }}({{ scope.row.score2rate }}%)</span>
  652. </template>
  653. </el-table-column>
  654. <el-table-column label="3分(数量、百分比)" min-width="130px" align="center">
  655. <template slot-scope="scope">
  656. <span>{{ scope.row.score3 }}({{ scope.row.score3rate }}%)</span>
  657. </template>
  658. </el-table-column>
  659. <el-table-column label="4分(数量、百分比)" min-width="130px" align="center">
  660. <template slot-scope="scope">
  661. <span>{{ scope.row.score4 }}({{ scope.row.score4rate }}%)</span>
  662. </template>
  663. </el-table-column>
  664. <el-table-column label="5分(数量、百分比)" min-width="130px" align="center">
  665. <template slot-scope="scope">
  666. <span>{{ scope.row.score5 }}({{ scope.row.score5rate }}%)</span>
  667. </template>
  668. </el-table-column>
  669. </el-table>
  670. </div>
  671. </el-col>
  672. </el-row>
  673. </el-tab-pane>
  674. </el-tabs>
  675. <div slot="footer" class="dialog-footer">
  676. <el-button class="cancelClose cancelClose1" @click="nutritional.dialogFormVisible = false; ">关闭</el-button>
  677. </div>
  678. </div>
  679. </el-dialog>
  680. <!-- 干物质调节 -->
  681. <DryMatterRegulation ref="mychild" :show.sync="isShowDialog" @getIsDisplay="getIsDisplay" />
  682. </div>
  683. </template>
  684. <script>
  685. import { GetDataByName, GETNurJudge, GetDataByNames, compareSort, ExecDataByConfig, failproccess, PostDataByName, formatNum, checkButtons } from '@/api/common'
  686. import Pagination from '@/components/Pagination'
  687. import Pagination2 from '@/components/Pagination2'
  688. import { parseTime, json2excel, handleTableSpan, handleObjectSpanMethod } from '@/utils/index.js'
  689. import { MessageBox } from 'element-ui'
  690. import Cookies from 'js-cookie'
  691. import axios from 'axios'
  692. import { getToken } from '@/utils/auth'
  693. import DryMatterRegulation from './dryMatterRegulation.vue'
  694. export default {
  695. inject: ['reload'],
  696. name: 'DhedFormula',
  697. components: { Pagination, Pagination2, DryMatterRegulation },
  698. data() {
  699. return {
  700. dialogFull: false,
  701. isRoleEdit: [],
  702. headerList: [],
  703. pickerMinDate: '',
  704. pickerOptions: {
  705. onPick: ({ maxDate, minDate }) => {
  706. this.pickerMinDate = minDate.getTime()
  707. if (maxDate) {
  708. this.pickerMinDate = ''
  709. }
  710. },
  711. // 限制不能选择今天之后的日期
  712. disabledDate: (time) => {
  713. if (this.pickerMinDate !== '') {
  714. const one = 31 * 24 * 3600 * 1000
  715. const minTime = this.pickerMinDate - one
  716. let maxTime = this.pickerMinDate + one
  717. if (maxTime > new Date()) {
  718. maxTime = new Date()
  719. }
  720. return time.getTime() < minTime - 8.64e7 || time.getTime() > maxTime - 8.64e7
  721. }
  722. return time.getTime() > Date.now() - 8.64e7
  723. }
  724. },
  725. requestParams: [
  726. { name: 'getFTSWList', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
  727. { name: 'getFTBLList', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
  728. { name: 'getCowclassListEnable', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }}
  729. ],
  730. recipeTemplateList: [], // 配方模板
  731. feedingFormulaList: [], // 补料配方
  732. livestockTypeList: [], // 类别
  733. rules: {
  734. cowclassid: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }]
  735. },
  736. table: {
  737. getdataListParm: {
  738. name: 'getFPList',
  739. page: 1,
  740. offset: 1,
  741. pagecount: parseInt(Cookies.get('pageCount')),
  742. returntype: 'Map',
  743. parammaps: {
  744. pastureid: Cookies.get('pastureid'),
  745. enable: ''
  746. }
  747. },
  748. tableKey: 0,
  749. list: [],
  750. total: 0,
  751. listLoading: true,
  752. temp: {},
  753. rwList: [],
  754. isPtsfname: false, // 补料配方/补料重量
  755. getdataListParm2: {
  756. name: 'getSysoptEnable',
  757. page: 1,
  758. offset: 1,
  759. pagecount: 1,
  760. returntype: 'Map',
  761. parammaps: {
  762. pastureid: Cookies.get('pastureid'),
  763. inforname: 'isEnableSupplyFeed'
  764. }
  765. },
  766. isRW1: false, // 第一班
  767. isRW2: false, // 第二班
  768. isRW3: false, // 第三班
  769. isRW4: false, // 第四班
  770. getdataListParm3: {
  771. name: 'getSysoptEnable1',
  772. page: 1,
  773. offset: 1,
  774. pagecount: 1,
  775. returntype: 'Map',
  776. parammaps: {
  777. pastureid: Cookies.get('pastureid'),
  778. inforname: 'times'
  779. }
  780. },
  781. RWLength: '' // 班次长度
  782. },
  783. selectList: [],
  784. // 营养评估
  785. nutritional: {
  786. dialogFormVisible: false,
  787. dialogStatus: '',
  788. activeName: 'first ',
  789. tab1: {
  790. // inputDatetime: [new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 1), new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 1)],
  791. inputDatetime: [new Date(), new Date()],
  792. listLoading1: true,
  793. getdataListParm1: {
  794. name: 'getnurj',
  795. page: 1,
  796. offset: 1,
  797. pagecount: 10,
  798. returntype: 'Map',
  799. parammaps: {
  800. pastureid: '',
  801. barid: ''
  802. }
  803. },
  804. disabledCowclass: false,
  805. temp: {},
  806. tableKey: 0,
  807. list: [],
  808. total: 0,
  809. listLoading2: true,
  810. getdataListParm2: {
  811. name: 'GETNurJudge',
  812. page: 1,
  813. offset: 1,
  814. pagecount: 10,
  815. returntype: 'Map',
  816. parammaps: {
  817. pastureid: '',
  818. cowclassid: ''
  819. }
  820. }
  821. },
  822. tab2: {
  823. // inputDatetime: [new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 1), new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 1)],
  824. inputDatetime: [new Date(), new Date()],
  825. listLoading1: true,
  826. tableKey1: 0,
  827. list1: [],
  828. total1: 0,
  829. getdataListParm1: {
  830. name: 'getPennsieveList',
  831. page: 1,
  832. offset: 1,
  833. pagecount: 10,
  834. returntype: 'Map',
  835. parammaps: {
  836. pastureid: '',
  837. barid: '',
  838. startTime: '',
  839. stopTime: '',
  840. inputDatetime: ''
  841. }
  842. },
  843. listLoading2: true,
  844. tableKey2: 0,
  845. list2: [],
  846. total2: 0,
  847. getdataListParm2: {
  848. name: 'getDungsieveList',
  849. page: 1,
  850. offset: 1,
  851. pagecount: 10,
  852. returntype: 'Map',
  853. parammaps: {
  854. pastureid: '',
  855. barid: '',
  856. startTime: '',
  857. stopTime: '',
  858. inputDatetime: ''
  859. }
  860. },
  861. listLoading3: true,
  862. tableKey3: 0,
  863. list3: [],
  864. total3: 0,
  865. getdataListParm3: {
  866. name: 'getBodyscoreList',
  867. page: 1,
  868. offset: 1,
  869. pagecount: 10,
  870. returntype: 'Map',
  871. parammaps: {
  872. pastureid: '',
  873. barid: '',
  874. startTime: '',
  875. stopTime: '',
  876. inputDatetime: ''
  877. }
  878. },
  879. listLoading4: true,
  880. tableKey4: 0,
  881. list4: [],
  882. total4: 0,
  883. getdataListParm4: {
  884. name: 'getDungscoreList',
  885. page: 1,
  886. offset: 1,
  887. pagecount: 10,
  888. returntype: 'Map',
  889. parammaps: {
  890. pastureid: '',
  891. barid: '',
  892. startTime: '',
  893. stopTime: '',
  894. inputDatetime: ''
  895. }
  896. }
  897. }
  898. },
  899. history: {
  900. dialogFormVisible: false,
  901. dialogStatus: '',
  902. temp: {},
  903. rules: {},
  904. tableKey: 0,
  905. list: [],
  906. total: 0,
  907. listLoading: true,
  908. getdataListParm: {
  909. name: 'getPlanModifyFPlist',
  910. page: 1,
  911. offset: 1,
  912. pagecount: 12,
  913. returntype: 'Map',
  914. parammaps: {
  915. pastureid: Cookies.get('pastureid'),
  916. date: ''
  917. }
  918. },
  919. isPtsfname: false, // 补料配方/补料重量
  920. getdataListParm2: {
  921. name: 'getSysoptEnable',
  922. page: 1,
  923. offset: 1,
  924. pagecount: 1,
  925. returntype: 'Map',
  926. parammaps: {
  927. pastureid: Cookies.get('pastureid'),
  928. inforname: 'isEnableSupplyFeed'
  929. }
  930. },
  931. isRW1: false, // 第一班
  932. isRW2: false, // 第二班
  933. isRW3: false, // 第三班
  934. isRW4: false, // 第四班
  935. getdataListParm3: {
  936. name: 'getSysoptEnable1',
  937. page: 1,
  938. offset: 1,
  939. pagecount: 1,
  940. returntype: 'Map',
  941. parammaps: {
  942. pastureid: Cookies.get('pastureid'),
  943. inforname: 'times'
  944. }
  945. },
  946. getdataDateParm: {
  947. name: 'getFPMaxDate',
  948. page: 1,
  949. offset: 1,
  950. pagecount: 10,
  951. returntype: 'Map',
  952. parammaps: {
  953. pastureid: Cookies.get('pastureid')
  954. }
  955. }
  956. },
  957. textMap: {
  958. Nutritional: '营养评估',
  959. history: '历史记录'
  960. },
  961. focusWRow: {}, // 一班重量得到焦点暂存
  962. focusWRow2: {}, // 2班重量得到焦点暂存
  963. focusWRow3: {}, // 3班重量得到焦点暂存
  964. focusWRow4: {}, // 4班重量得到焦点暂存
  965. requestParam: {},
  966. download: {
  967. getdataListParm: {
  968. name: 'getFPList',
  969. page: 1,
  970. offset: 1,
  971. pagecount: 0,
  972. returntype: 'Map',
  973. parammaps: {
  974. pastureid: Cookies.get('pastureid'),
  975. enable: ''
  976. }
  977. },
  978. list: []
  979. },
  980. spanObj: {},
  981. mergekeys: ['barname', 'sumweight'],
  982. isShowDialog: false,
  983. isokDisable: false,
  984. rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
  985. cellStyle: { padding: 0 + 'px' }
  986. }
  987. },
  988. computed: {
  989. // 设置请求头
  990. headers() {
  991. return {
  992. token: getToken()
  993. }
  994. },
  995. uploadData() {
  996. return {
  997. name: 'checkbarname,checkftsw,checkftbl,updateBigFPUpload,updateBigFPfeedweightUpload,updateBigFPDetailUpload,updateBigFPDetailUploadV1,updateBigFPDetailUploadV2,updateBigFPDetailUploadV3',
  998. importParams: '栏舍名称,实际牛头数,系数(%),配方模板,补料配方,第一班比例(%),第二班比例(%),第三班比例(%)',
  999. sheetname: 'Sheet1',
  1000. // 登录牧场
  1001. pastureid: Cookies.get('pastureid'),
  1002. // 日期参数
  1003. dateParams: '',
  1004. // 必填参数
  1005. requiredParams: '栏舍名称,实际牛头数,系数(%),配方模板,',
  1006. // 为数值的参数
  1007. numParams: '实际牛头数,系数(%),第一班比例(%),第二班比例(%),第三班比例(%),,第四班比例(%)'
  1008. }
  1009. },
  1010. // 设置上传地址
  1011. uploadExcelUrl() {
  1012. return process.env.VUE_APP_BASE_API + 'authdata/ImportExcel'
  1013. }
  1014. },
  1015. created() {
  1016. this.getButtons()
  1017. this.getDownList()
  1018. },
  1019. methods: {
  1020. getButtons() {
  1021. const Edit = 'DhedFormula'
  1022. const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
  1023. this.isRoleEdit = isRoleEdit
  1024. },
  1025. getDownList() {
  1026. GetDataByNames(this.requestParams).then(response => {
  1027. this.recipeTemplateList = response.data.getFTSWList.list
  1028. this.feedingFormulaList = response.data.getFTBLList.list
  1029. this.livestockTypeList = response.data.getCowclassListEnable.list
  1030. this.getIsDisplay()
  1031. })
  1032. },
  1033. getIsDisplay() {
  1034. GetDataByName(this.table.getdataListParm2).then(response => {
  1035. console.log(response.data.list[0].inforvalue)
  1036. if (response.data.list !== null) {
  1037. if (response.data.list[0].inforvalue == 0) {
  1038. this.table.isPtsfname = false
  1039. } else {
  1040. this.table.isPtsfname = true
  1041. }
  1042. }
  1043. })
  1044. GetDataByName(this.table.getdataListParm3).then(response => {
  1045. console.log(response.data.list[0].inforvalue)
  1046. if (response.data.list !== null) {
  1047. this.table.RWLength = response.data.list[0].inforvalue
  1048. if (response.data.list[0].inforvalue == 1) {
  1049. this.table.isRW1 = true
  1050. this.table.isRW2 = false
  1051. this.table.isRW3 = false
  1052. this.table.isRW4 = false
  1053. } else if (response.data.list[0].inforvalue == 2) {
  1054. this.table.isRW1 = true
  1055. this.table.isRW2 = true
  1056. this.table.isRW3 = false
  1057. this.table.isRW4 = false
  1058. } else if (response.data.list[0].inforvalue == 3) {
  1059. this.table.isRW1 = true
  1060. this.table.isRW2 = true
  1061. this.table.isRW3 = true
  1062. this.table.isRW4 = false
  1063. } else if (response.data.list[0].inforvalue == 4) {
  1064. this.table.isRW1 = true
  1065. this.table.isRW2 = true
  1066. this.table.isRW3 = true
  1067. this.table.isRW4 = true
  1068. }
  1069. } else {
  1070. this.table.isRW1 = false
  1071. this.table.isRW2 = false
  1072. this.table.isRW3 = false
  1073. this.table.isRW4 = false
  1074. }
  1075. })
  1076. this.getList()
  1077. },
  1078. getList() {
  1079. this.table.listLoading = true
  1080. GetDataByName(this.table.getdataListParm).then(response => {
  1081. console.log('table数据', response.data.list)
  1082. if (response.data.list !== null) {
  1083. for (let i = 0; i < response.data.list.length; i++) {
  1084. this.$set(response.data.list[i], 'Edit', false) // 编辑
  1085. this.$set(response.data.list[i], 'NoEdit', true) // 不可编辑/输入
  1086. this.$set(response.data.list[i], 'isUpdate', true) // 编辑操作
  1087. this.$set(response.data.list[i], 'isUpdateSave', false) // 编辑保存
  1088. if (response.data.list[i].ftid !== undefined && response.data.list[i].ftid !== '') {
  1089. if (this.recipeTemplateList.find(obj => obj.id == response.data.list[i].ftid) !== undefined) {
  1090. this.$set(response.data.list[i], 'dryweight', this.recipeTemplateList.find(obj => obj.id == response.data.list[i].ftid).dryweight) // 编辑保存
  1091. } else {
  1092. this.$set(response.data.list[i], 'dryweight', '')
  1093. }
  1094. }
  1095. if (response.data.list[i].ftid == undefined || response.data.list[i].ftname == '') {
  1096. this.$set(response.data.list[i], 'ftid', '')
  1097. this.$set(response.data.list[i], 'ftname', '')
  1098. }
  1099. if (response.data.list[i].ptsfid == undefined || response.data.list[i].ptsfname == '') {
  1100. this.$set(response.data.list[i], 'ptsfid', '')
  1101. this.$set(response.data.list[i], 'ptsfname', '')
  1102. }
  1103. if (response.data.list[i].ccount == undefined) {
  1104. this.$set(response.data.list[i], 'ccount', '')
  1105. }
  1106. if (response.data.list[i].softccount == undefined) {
  1107. this.$set(response.data.list[i], 'softccount', '')
  1108. }
  1109. if (response.data.list[i].ratio == undefined) {
  1110. this.$set(response.data.list[i], 'ratio', 100)
  1111. }
  1112. if (response.data.list[i].ccountratio == undefined) {
  1113. this.$set(response.data.list[i], 'ccountratio', '')
  1114. }
  1115. if (response.data.list[i].r1 == undefined) {
  1116. this.$set(response.data.list[i], 'r1', '')
  1117. }
  1118. if (response.data.list[i].r2 == undefined) {
  1119. this.$set(response.data.list[i], 'r2', '')
  1120. }
  1121. if (response.data.list[i].r3 == undefined) {
  1122. this.$set(response.data.list[i], 'r3', '')
  1123. }
  1124. if (response.data.list[i].r4 == undefined) {
  1125. this.$set(response.data.list[i], 'r4', '')
  1126. }
  1127. if (response.data.list[i].w1 == undefined) {
  1128. this.$set(response.data.list[i], 'w1', '')
  1129. }
  1130. if (response.data.list[i].w2 == undefined) {
  1131. this.$set(response.data.list[i], 'w2', '')
  1132. }
  1133. if (response.data.list[i].w3 == undefined) {
  1134. this.$set(response.data.list[i], 'w3', '')
  1135. }
  1136. if (response.data.list[i].w4 == undefined) {
  1137. this.$set(response.data.list[i], 'w4', '')
  1138. }
  1139. if (response.data.list[i].supplyweight == undefined) {
  1140. this.$set(response.data.list[i], 'supplyweight', '')
  1141. }
  1142. if (response.data.list[i].feedweight == undefined) {
  1143. this.$set(response.data.list[i], 'feedweight', '')
  1144. }
  1145. this.$set(response.data.list[i], 'dailyWeight', '')
  1146. if (response.data.list[i].Bfweight == undefined) {
  1147. this.$set(response.data.list[i], 'Bfweight', '')
  1148. }
  1149. if (response.data.list[i].Sfweight == undefined) {
  1150. this.$set(response.data.list[i], 'Sfweight', '')
  1151. }
  1152. if (response.data.list[i].isOneWeight == undefined) {
  1153. this.$set(response.data.list[i], 'isOneWeight', false)
  1154. }
  1155. if (response.data.list[i].isTwoWeight == undefined) {
  1156. this.$set(response.data.list[i], 'isTwoWeight', false)
  1157. }
  1158. if (response.data.list[i].isThreeWeight == undefined) {
  1159. this.$set(response.data.list[i], 'isThreeWeight', false)
  1160. }
  1161. if (response.data.list[i].isFourWeight == undefined) {
  1162. this.$set(response.data.list[i], 'isFourWeight', false)
  1163. }
  1164. if (response.data.list[i].timesopt !== undefined) {
  1165. var timesoptArr = response.data.list[i].timesopt.split(',')
  1166. for (let j = 0; j < timesoptArr.length; j++) {
  1167. response.data.list[i]['r' + timesoptArr[j].split(':')[0]] = timesoptArr[j].split(':')[1]
  1168. response.data.list[i]['w' + timesoptArr[j].split(':')[0]] = timesoptArr[j].split(':')[2]
  1169. }
  1170. }
  1171. }
  1172. // console.log(response.data.list, sumr)
  1173. for (let i = 0; i < response.data.list.length; i++) {
  1174. if (response.data.list[i].r1 == '') {
  1175. response.data.list[i].r1 = 0
  1176. response.data.list[i].w1 = 0
  1177. }
  1178. if (response.data.list[i].r2 == '') {
  1179. response.data.list[i].r2 = 0
  1180. response.data.list[i].w2 = 0
  1181. }
  1182. if (response.data.list[i].r3 == '') {
  1183. response.data.list[i].r3 = 0
  1184. response.data.list[i].w3 = 0
  1185. }
  1186. if (response.data.list[i].r4 == '') {
  1187. response.data.list[i].r4 = 0
  1188. response.data.list[i].w4 = 0
  1189. }
  1190. 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))
  1191. response.data.list[i].sumr = formatNum(response.data.list[i].sumr, parseInt(Cookies.get('decimal')))
  1192. // this.$set(response.data.list[i],'feedweight',formatNum(parseFloat(response.data.list[i].feedweight) * parseFloat(response.data.list[i].sumr)/100,2))
  1193. 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))
  1194. response.data.list[i].dailyWeight = formatNum(response.data.list[i].dailyWeight, parseInt(Cookies.get('decimal')))
  1195. }
  1196. this.table.list = response.data.list
  1197. console.log(this.table.list, 'this.table.list')
  1198. this.table.pageNum = response.data.pageNum
  1199. this.table.pageSize = response.data.pageSize
  1200. this.table.total = response.data.total
  1201. } else {
  1202. this.table.list = []
  1203. }
  1204. setTimeout(() => {
  1205. this.table.listLoading = false
  1206. }, 100)
  1207. })
  1208. },
  1209. renderHeader(h, { column, $index }) { // h即为cerateElement的简写,具体可看vue官方文档
  1210. return h(
  1211. 'div',
  1212. [
  1213. h('span', column.label),
  1214. h('i', {
  1215. class: 'el-icon-unlock',
  1216. ref: 'el-icon-unlock',
  1217. style: 'margin-left:5px;'
  1218. })
  1219. ]
  1220. )
  1221. },
  1222. headerClick(column, event) {
  1223. console.log(column, event)
  1224. this.headerList.push(event)
  1225. if (column.label == '第一班重量') {
  1226. for (let i = 0; i < this.table.list.length; i++) {
  1227. if (this.table.list[i].Edit == true) {
  1228. if (event.target.outerHTML == '<i class="el-icon-unlock" style="margin-left: 5px;"></i>') {
  1229. event.target.className = 'el-icon-lock'
  1230. this.$set(this.table.list[i], 'isOneWeight', true) // 锁住不可编辑
  1231. } else if (event.target.outerHTML == '<i class="el-icon-lock" style="margin-left: 5px;"></i>') {
  1232. event.target.className = 'el-icon-unlock'
  1233. this.$set(this.table.list[i], 'isOneWeight', false) // 解锁可编辑
  1234. }
  1235. }
  1236. }
  1237. } else if (column.label == '第二班重量') {
  1238. for (let i = 0; i < this.table.list.length; i++) {
  1239. if (this.table.list[i].Edit == true) {
  1240. if (event.target.outerHTML == '<i class="el-icon-unlock" style="margin-left: 5px;"></i>') {
  1241. event.target.className = 'el-icon-lock'
  1242. this.$set(this.table.list[i], 'isTwoWeight', true) // 锁住不可编辑
  1243. } else if (event.target.outerHTML == '<i class="el-icon-lock" style="margin-left: 5px;"></i>') {
  1244. event.target.className = 'el-icon-unlock'
  1245. this.$set(this.table.list[i], 'isTwoWeight', false) // 解锁可编辑
  1246. }
  1247. }
  1248. }
  1249. } else if (column.label == '第三班重量') {
  1250. for (let i = 0; i < this.table.list.length; i++) {
  1251. if (this.table.list[i].Edit == true) {
  1252. if (event.target.outerHTML == '<i class="el-icon-unlock" style="margin-left: 5px;"></i>') {
  1253. event.target.className = 'el-icon-lock'
  1254. this.$set(this.table.list[i], 'isThreeWeight', true) // 锁住不可编辑
  1255. } else if (event.target.outerHTML == '<i class="el-icon-lock" style="margin-left: 5px;"></i>') {
  1256. event.target.className = 'el-icon-unlock'
  1257. this.$set(this.table.list[i], 'isThreeWeight', false) // 解锁可编辑
  1258. }
  1259. }
  1260. }
  1261. } else if (column.label == '第四班重量') {
  1262. for (let i = 0; i < this.table.list.length; i++) {
  1263. if (this.table.list[i].Edit == true) {
  1264. if (event.target.outerHTML == '<i class="el-icon-unlock" style="margin-left: 5px;"></i>') {
  1265. event.target.className = 'el-icon-lock'
  1266. this.$set(this.table.list[i], 'isFourWeight', true) // 锁住不可编辑
  1267. } else if (event.target.outerHTML == '<i class="el-icon-lock" style="margin-left: 5px;"></i>') {
  1268. event.target.className = 'el-icon-unlock'
  1269. this.$set(this.table.list[i], 'isFourWeight', false) // 解锁可编辑
  1270. }
  1271. }
  1272. }
  1273. }
  1274. },
  1275. // 配方模板
  1276. changeRecipeTemplate(item, row) {
  1277. row.myccname = this.recipeTemplateList.find(obj => obj.id == item).ccname
  1278. if (row.bigcowclass !== row.myccname) {
  1279. this.$message({ type: 'warning', message: '所选配方模板与栏舍对应牲畜类别不一致', duration: 2000 })
  1280. }
  1281. console.log(row.supplyweight, 'row.supplyweight')
  1282. row.ftname = this.recipeTemplateList.find(obj => obj.id == item).tname
  1283. row.Sfweight = this.recipeTemplateList.find(obj => obj.id == item).Sfweight// Sfweight
  1284. row.SfweightLock = this.recipeTemplateList.find(obj => obj.id == item).SfweightLock// SfweightLock
  1285. row.dryweight = this.recipeTemplateList.find(obj => obj.id == item).dryweight// SfweightLock
  1286. // 补料重量supplyweight
  1287. // 配方重量ftweight
  1288. // 系数头数ccountratio
  1289. // 投喂量feedweight
  1290. // 实际牛头数ccount
  1291. // 投喂量 = 配方重量 + 补料重量
  1292. // 配方重量 = Sfweight * 系数头数 + SfweightLock * 实际牛头数ccount
  1293. console.log(row.Sfweight, 'row.Sfweight')
  1294. console.log(row.ccountratio, '系数头数')
  1295. console.log(row.SfweightLock, 'SfweightLock')
  1296. console.log(row.ccount, '实际牛头数')
  1297. if (row.Sfweight !== '' && row.ccount !== '') {
  1298. this.$set(row, 'ftweight', formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), parseInt(Cookies.get('decimal'))))
  1299. } else {
  1300. row.ftweight = ''
  1301. }
  1302. // console.log(row.ftweight, 'row.ftweight')
  1303. // console.log(row.supplyweight, 'row.supplyweight')
  1304. // console.log(this.table.isPtsfname, 'isPtsfname')
  1305. if (this.table.isPtsfname == false) {
  1306. row.feedweight = formatNum(parseFloat(row.ftweight), parseInt(Cookies.get('decimal')))
  1307. } else {
  1308. if (row.supplyweight == 'NaN') {
  1309. row.supplyweight = 0
  1310. }
  1311. console.log(row.supplyweight)
  1312. if (row.supplyweight !== '' && row.ftweight !== '') {
  1313. row.feedweight = formatNum(parseFloat(row.supplyweight) + parseFloat(row.ftweight), parseInt(Cookies.get('decimal')))
  1314. } else if (row.supplyweight == '' && row.ftweight !== '') {
  1315. row.feedweight = formatNum(parseFloat(row.ftweight), parseInt(Cookies.get('decimal')))
  1316. } else if (row.supplyweight !== '' && row.ftweight !== '') {
  1317. row.feedweight = formatNum(parseFloat(row.supplyweight), parseInt(Cookies.get('decimal')))
  1318. }
  1319. if (row.ccountratio !== '' && row.ftweight !== '') {
  1320. row.ftweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), parseInt(Cookies.get('decimal')))
  1321. }
  1322. if (row.Sfweight !== '' && row.ccount !== '') {
  1323. this.$set(row, 'ftweight', formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), parseInt(Cookies.get('decimal'))))
  1324. } else {
  1325. row.ftweight = ''
  1326. }
  1327. }
  1328. console.log(row.supplyweight)
  1329. if (row.supplyweight == 'NaN') { row.supplyweight = 0 }
  1330. if (row.r1 !== '') { this.$set(row, 'w1', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r1) / 100), parseInt(Cookies.get('decimal')))) }
  1331. if (row.r2 !== '') { this.$set(row, 'w2', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r2) / 100), parseInt(Cookies.get('decimal')))) }
  1332. if (row.r3 !== '') { this.$set(row, 'w3', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r3) / 100), parseInt(Cookies.get('decimal')))) }
  1333. if (row.r4 !== '') { this.$set(row, 'w4', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r4) / 100), parseInt(Cookies.get('decimal')))) }
  1334. if (row.w1 == '') { row.w1 = 0 }
  1335. if (row.w2 == '') { row.w2 = 0 }
  1336. if (row.w3 == '') { row.w3 = 0 }
  1337. if (row.w4 == '') { row.w4 = 0 }
  1338. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  1339. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  1340. },
  1341. // 补料配方
  1342. changeFeedingFormula(item, row) {
  1343. console.log(item, '=========')
  1344. // 补料重量supplyweight
  1345. // 配方重量ftweight
  1346. // 系数头数ccountratio
  1347. // 投喂量feedweight
  1348. // 实际牛头数ccount
  1349. // 投喂量 = 配方重量 + 补料重量
  1350. row.myccname = this.feedingFormulaList.find(obj => obj.id == item).ccname
  1351. if (row.bigcowclass !== row.myccname) {
  1352. this.$message({ type: 'warning', message: '所选补料配方与栏舍对应牲畜类别不一致', duration: 2000 })
  1353. }
  1354. if (item !== '') {
  1355. console.log(456)
  1356. row.ptsfname = this.feedingFormulaList.find(obj => obj.id == item).tname
  1357. row.BLweight = this.feedingFormulaList.find(obj => obj.id == item).Sfweight
  1358. row.BLSfweightLock = this.feedingFormulaList.find(obj => obj.id == item).SfweightLock
  1359. } else {
  1360. row.ptsfname = ''
  1361. row.BLweight = 0
  1362. row.BLSfweightLock = 0
  1363. }
  1364. // 配方重量 = 系数头数 * Sfweight
  1365. // if (row.ccountratio !== '' && row.ftweight !== '') {
  1366. // row.ftweight = parseFloat(row.Sfweight) * parseFloat(row.ccountratio)
  1367. // }
  1368. // 补料重量 = 系数头数 * BLweight
  1369. // console.log(row.ccountratio)
  1370. // console.log(row.ccount)
  1371. // console.log(row.BLweight)
  1372. // console.log(row.BLSfweightLock)
  1373. if (row.ccountratio !== '' && row.ccount !== '' && row.ccount.BLweight !== '' && row.BLSfweightLock !== '') {
  1374. this.$set(row, 'supplyweight', formatNum(parseFloat(row.BLweight) * parseFloat(row.ccountratio) + parseFloat(row.BLSfweightLock) * parseFloat(row.ccount), parseInt(Cookies.get('decimal'))))
  1375. } else {
  1376. row.supplyweight = ''
  1377. }
  1378. if (this.table.isPtsfname == false) {
  1379. row.feedweight = parseFloat(row.ftweight)
  1380. } else {
  1381. if (row.supplyweight !== '' && row.ftweight !== '') {
  1382. row.feedweight = formatNum(parseFloat(row.supplyweight) + parseFloat(row.ftweight), parseInt(Cookies.get('decimal')))
  1383. } else if (row.supplyweight == '' && row.ftweight !== '') {
  1384. row.feedweight = formatNum(parseFloat(row.ftweight), parseInt(Cookies.get('decimal')))
  1385. } else if (row.supplyweight !== '' && row.ftweight == '') {
  1386. row.feedweight = formatNum(parseFloat(row.supplyweight), parseInt(Cookies.get('decimal')))
  1387. }
  1388. // if (row.ccountratio !== '' && row.ftweight !== '') {
  1389. // row.ftweight = parseFloat(row.Sfweight) * parseFloat(row.ccountratio)
  1390. // }
  1391. // if (row.ccountratio !== '' && row.BLweight !== '') {
  1392. // row.supplyweight = parseFloat(row.BLweight) * parseFloat(row.ccountratio)
  1393. // }
  1394. }
  1395. if (row.r1 !== '') { this.$set(row, 'w1', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r1) / 100), parseInt(Cookies.get('decimal')))) }
  1396. if (row.r2 !== '') { this.$set(row, 'w2', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r2) / 100), parseInt(Cookies.get('decimal')))) }
  1397. if (row.r3 !== '') { this.$set(row, 'w3', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r3) / 100), parseInt(Cookies.get('decimal')))) }
  1398. if (row.r4 !== '') { this.$set(row, 'w4', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r4) / 100), parseInt(Cookies.get('decimal')))) }
  1399. if (row.w1 == '') { row.w1 = 0 }
  1400. if (row.w2 == '') { row.w2 = 0 }
  1401. if (row.w3 == '') { row.w3 = 0 }
  1402. if (row.w4 == '') { row.w4 = 0 }
  1403. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  1404. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  1405. },
  1406. // 实际牛头数失去焦点计算
  1407. // ccount实际牛头数
  1408. // ratio系数
  1409. // ccountratio系数牛头数
  1410. blurCcount(row) { // 实际牛头数
  1411. console.log(row)
  1412. if (row.ftid !== '-1' && row.ftid !== '') {
  1413. console.log(this.recipeTemplateList.find(obj => obj.id == row.ftid).Sfweight)
  1414. row.Sfweight = this.recipeTemplateList.find(obj => obj.id == row.ftid).Sfweight
  1415. row.SfweightLock = this.recipeTemplateList.find(obj => obj.id == row.ftid).SfweightLock
  1416. }
  1417. if (row.ptsfid !== '-1' && row.ptsfid !== '' && this.table.isPtsfname == true) {
  1418. // row.ptsfid = parseInt(row.ptsfid)
  1419. row.BLweight = formatNum(parseFloat(this.feedingFormulaList.find(obj => obj.id == row.ptsfid).Sfweight), parseInt(Cookies.get('decimal')))
  1420. row.BLweightLock = formatNum(parseFloat(this.feedingFormulaList.find(obj => obj.id == row.ptsfid).SfweightLock), parseInt(Cookies.get('decimal')))
  1421. }
  1422. if (row.ptsfid == '') {
  1423. row.BLweight = 0
  1424. row.BLweightLock = 0
  1425. }
  1426. if (row.Sfweight !== '' && row.ccount !== '') {
  1427. // console.log(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount))
  1428. row.ftweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), parseInt(Cookies.get('decimal')))
  1429. }
  1430. // 系数牛头数 = 实际牛头数 * 系数/100
  1431. if (row.ccount !== '' && row.ratio !== '') {
  1432. row.ccountratio = formatNum(parseFloat(row.ccount) * parseFloat(row.ratio) / 100, parseInt(Cookies.get('decimal')))
  1433. } else if (row.ratio !== '' && row.ccountratio !== '') {
  1434. row.ccount = formatNum(parseFloat(row.ccountratio) * 100 / parseFloat(row.ratio) / 100, parseInt(Cookies.get('decimal')))
  1435. } else if (row.ccount !== '' || row.ratio !== '') {
  1436. row.ccountratio = ''
  1437. }
  1438. // 补料重量
  1439. console.log(row.ccountratio, row.BLweight)
  1440. if (row.BLweight == 'undefined') {
  1441. this.$set(row, 'BLweight', '')
  1442. }
  1443. console.log('BLweight', row.BLweight)
  1444. console.log('ccountratio', row.ccountratio)
  1445. console.log('BLweightLock', row.BLweightLock)
  1446. console.log('ccount', row.ccount)
  1447. if (row.ccountratio !== '' && row.BLweight !== '') {
  1448. row.supplyweight = formatNum(parseFloat(row.BLweight) * parseFloat(row.ccountratio) + parseFloat(row.BLweightLock) * parseFloat(row.ccount), parseInt(Cookies.get('decimal')))
  1449. } else if (row.ccountratio !== '' && row.BLweight == '') {
  1450. row.supplyweight = ''
  1451. row.feedweight = ''
  1452. } else if (row.ccountratio == '' && row.BLweight !== '') {
  1453. row.supplyweight = ''
  1454. row.feedweight = ''
  1455. }
  1456. // 配方重量
  1457. if (row.ccountratio !== '' && row.Sfweight !== '') {
  1458. row.ftweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), parseInt(Cookies.get('decimal')))
  1459. } else if (row.ccountratio !== '' && row.Sfweight == '') {
  1460. row.ftweight = ''
  1461. row.feedweight = ''
  1462. } else if (row.ccountratio == '' && row.Sfweight !== '') {
  1463. row.ftweight = ''
  1464. row.feedweight = ''
  1465. }
  1466. if (this.table.isPtsfname == false) {
  1467. row.feedweight = parseFloat(row.ftweight)
  1468. } else {
  1469. if (row.supplyweight !== '' && row.ftweight !== '') {
  1470. row.feedweight = formatNum(parseFloat(row.supplyweight) + parseFloat(row.ftweight), parseInt(Cookies.get('decimal')))
  1471. } else if (row.supplyweight !== '' && row.ftweight == '') {
  1472. row.feedweight = formatNum(parseFloat(row.supplyweight), parseInt(Cookies.get('decimal')))
  1473. } else if (row.supplyweight == '' && row.ftweight !== '') {
  1474. row.feedweight = formatNum(parseFloat(row.ftweight), parseInt(Cookies.get('decimal')))
  1475. }
  1476. // 配方重量 = 系数头数 * Sfweight
  1477. if (row.ccountratio !== '' && row.ftweight !== '') {
  1478. row.ftweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), parseInt(Cookies.get('decimal')))
  1479. }
  1480. // 补料重量 = 系数头数 * BLweight
  1481. if (row.ccountratio !== '' && row.BLweight !== '') {
  1482. row.supplyweight = formatNum(parseFloat(row.BLweight) * parseFloat(row.ccountratio) + parseFloat(row.BLweightLock) * parseFloat(row.ccount), parseInt(Cookies.get('decimal')))
  1483. }
  1484. }
  1485. console.log(row)
  1486. if (row.r1 !== '' && row.isOneWeight == false) { this.$set(row, 'w1', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r1) / 100), parseInt(Cookies.get('decimal')))) }
  1487. if (row.r2 !== '' && row.isTwoWeight == false) { this.$set(row, 'w2', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r2) / 100), parseInt(Cookies.get('decimal')))) }
  1488. if (row.r3 !== '' && row.isThreeWeight == false) { this.$set(row, 'w3', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r3) / 100), parseInt(Cookies.get('decimal')))) }
  1489. if (row.r4 !== '' && row.isFourWeight == false) { this.$set(row, 'w4', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r4) / 100), parseInt(Cookies.get('decimal')))) }
  1490. if (row.isOneWeight == true) {
  1491. this.$set(row, 'r1', formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal'))))
  1492. }
  1493. if (row.isTwoWeight == true) {
  1494. this.$set(row, 'r2', formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal'))))
  1495. }
  1496. if (row.isThreeWeight == true) {
  1497. this.$set(row, 'r3', formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal'))))
  1498. }
  1499. if (row.isFourWeight == true) {
  1500. this.$set(row, 'r4', formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal'))))
  1501. }
  1502. if (row.w1 == '') { row.w1 = 0 }
  1503. if (row.w2 == '') { row.w2 = 0 }
  1504. if (row.w3 == '') { row.w3 = 0 }
  1505. if (row.w4 == '') { row.w4 = 0 }
  1506. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  1507. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  1508. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  1509. },
  1510. blurRatio(row) {
  1511. console.log(row, '--------------')
  1512. if (row.ftid !== '-1' && row.ftid !== '') {
  1513. row.Sfweight = this.recipeTemplateList.find(obj => obj.id == row.ftid).Sfweight
  1514. row.SfweightLock = this.recipeTemplateList.find(obj => obj.id == row.ftid).SfweightLock
  1515. }
  1516. if (row.ptsfid !== '-1' && row.ptsfid !== '' && this.table.isPtsfname == true) {
  1517. // row.ptsfid = parseInt(row.ptsfid)
  1518. row.BLweight = formatNum(parseFloat(this.feedingFormulaList.find(obj => obj.id == row.ptsfid).Sfweight), parseInt(Cookies.get('decimal')))
  1519. row.BLweightLock = formatNum(parseFloat(this.feedingFormulaList.find(obj => obj.id == row.ptsfid).SfweightLock), parseInt(Cookies.get('decimal')))
  1520. }
  1521. if (row.ptsfid == '') {
  1522. row.BLweight = 0
  1523. row.BLweightLock = 0
  1524. }
  1525. // 系数
  1526. if (row.ccount !== '' && row.ratio !== '' && row.ccountratio !== '') {
  1527. row.ccountratio = formatNum(parseFloat(row.ccount) * parseFloat(row.ratio) / 100, parseInt(Cookies.get('decimal')))
  1528. } else if (row.ccount !== '' && row.ccountratio !== '') {
  1529. row.ratio = formatNum(parseFloat(row.ccountratio) * 100 / parseFloat(row.ccount), parseInt(Cookies.get('decimal')))
  1530. } else if (row.ccount !== '' || row.ccountratio !== '') {
  1531. row.ratio = ''
  1532. }
  1533. // 补料重量
  1534. if (row.ccountratio !== '' && row.BLweight !== '') {
  1535. row.supplyweight = formatNum(parseFloat(row.BLweight) * parseFloat(row.ccountratio) + parseFloat(row.BLweightLock) * parseFloat(row.ccount), parseInt(Cookies.get('decimal')))
  1536. } else if (row.ccountratio !== '' && row.BLweight == '' || row.ccountratio == '' && row.BLweight !== '') {
  1537. row.supplyweight = ''
  1538. row.feedweight = ''
  1539. }
  1540. // 配方重量
  1541. if (row.ccountratio !== '' && row.Sfweight !== '') {
  1542. row.ftweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), parseInt(Cookies.get('decimal')))
  1543. } else if (row.ccountratio !== '' && row.Sfweight == '' || row.ccountratio == '' && row.Sfweight !== '') {
  1544. row.ftweight = ''
  1545. row.feedweight = ''
  1546. }
  1547. // 投喂量
  1548. if (row.supplyweight !== '' && row.ftweight !== '') {
  1549. row.feedweight = formatNum(parseFloat(row.BLweight) * parseFloat(row.ccountratio) + parseFloat(row.BLweightLock) * parseFloat(row.ccount), parseInt(Cookies.get('decimal')))
  1550. } else if (row.supplyweight == '' && row.ftweight !== '') {
  1551. row.feedweight = formatNum(parseFloat(row.ftweight), parseInt(Cookies.get('decimal')))
  1552. } else if (row.supplyweight !== '' && row.ftweight == '') {
  1553. row.feedweight = formatNum(parseFloat(row.supplyweight), parseInt(Cookies.get('decimal')))
  1554. }
  1555. console.log(row.supplyweight, '补料重量')
  1556. console.log(row.ftweight, '配方重量')
  1557. if (this.table.isPtsfname == false) {
  1558. row.feedweight = formatNum(parseFloat(row.ftweight), parseInt(Cookies.get('decimal')))
  1559. } else {
  1560. // 投喂量
  1561. if (row.supplyweight !== '' && row.ftweight !== '') {
  1562. row.feedweight = formatNum(parseFloat(row.supplyweight) + parseFloat(row.ftweight), parseInt(Cookies.get('decimal')))
  1563. } else if (row.supplyweight == '' && row.ftweight !== '') {
  1564. row.feedweight = formatNum(parseFloat(row.ftweight), parseInt(Cookies.get('decimal')))
  1565. } else if (row.supplyweight !== '' && row.ftweight == '') {
  1566. row.feedweight = formatNum(parseFloat(row.supplyweight), parseInt(Cookies.get('decimal')))
  1567. }
  1568. // 补料重量
  1569. if (row.ccountratio !== '' && row.BLweight !== '') {
  1570. row.supplyweight = formatNum(parseFloat(row.BLweight) * parseFloat(row.ccountratio) + parseFloat(row.BLweightLock) * parseFloat(row.ccount), parseInt(Cookies.get('decimal')))
  1571. } else if (row.ccountratio !== '' && row.BLweight == '') {
  1572. row.supplyweight = ''
  1573. row.feedweight = ''
  1574. } else if (row.ccountratio == '' && row.BLweight !== '') {
  1575. row.supplyweight = ''
  1576. row.feedweight = ''
  1577. }
  1578. // 配方重量
  1579. if (row.ccountratio !== '' && row.Sfweight !== '') {
  1580. row.ftweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), parseInt(Cookies.get('decimal')))
  1581. } else if (row.ccountratio !== '' && row.Sfweight == '') {
  1582. row.ftweight = ''
  1583. row.feedweight = ''
  1584. } else if (row.ccountratio == '' && row.Sfweight !== '') {
  1585. row.ftweight = ''
  1586. row.feedweight = ''
  1587. }
  1588. }
  1589. if (row.r1 !== '' && row.isOneWeight == false) { this.$set(row, 'w1', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r1) / 100), parseInt(Cookies.get('decimal')))) }
  1590. if (row.r2 !== '' && row.isTwoWeight == false) { this.$set(row, 'w2', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r2) / 100), parseInt(Cookies.get('decimal')))) }
  1591. if (row.r3 !== '' && row.isThreeWeight == false) { this.$set(row, 'w3', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r3) / 100), parseInt(Cookies.get('decimal')))) }
  1592. if (row.r4 !== '' && row.isFourWeight == false) { this.$set(row, 'w4', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r4) / 100), parseInt(Cookies.get('decimal')))) }
  1593. if (row.isOneWeight == true) {
  1594. this.$set(row, 'r1', formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal'))))
  1595. }
  1596. if (row.isTwoWeight == true) {
  1597. this.$set(row, 'r2', formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal'))))
  1598. }
  1599. if (row.isThreeWeight == true) {
  1600. this.$set(row, 'r3', formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal'))))
  1601. }
  1602. if (row.isFourWeight == true) {
  1603. this.$set(row, 'r4', formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal'))))
  1604. }
  1605. if (row.w1 == '') { row.w1 = 0 }
  1606. if (row.w2 == '') { row.w2 = 0 }
  1607. if (row.w3 == '') { row.w3 = 0 }
  1608. if (row.w4 == '') { row.w4 = 0 }
  1609. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  1610. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  1611. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  1612. },
  1613. blurCcountratio(row) {
  1614. if (row.ftid !== '-1' && row.ftid !== '') {
  1615. row.Sfweight = this.recipeTemplateList.find(obj => obj.id == row.ftid).Sfweight
  1616. row.SfweightLock = this.recipeTemplateList.find(obj => obj.id == row.ftid).SfweightLock
  1617. }
  1618. if (row.ptsfid !== '-1' && row.ptsfid !== '' && this.table.isPtsfname == true) {
  1619. // row.ptsfid = parseInt(row.ptsfid)
  1620. row.BLweight = formatNum(parseFloat(this.feedingFormulaList.find(obj => obj.id == row.ptsfid).Sfweight), parseInt(Cookies.get('decimal')))
  1621. row.BLweightLock = formatNum(parseFloat(this.feedingFormulaList.find(obj => obj.id == row.ptsfid).SfweightLock), parseInt(Cookies.get('decimal')))
  1622. }
  1623. if (row.ptsfid == '') {
  1624. row.BLweight = 0
  1625. row.BLweightLock = 0
  1626. }
  1627. if (row.ptsfid == '') {
  1628. row.BLweight = 0
  1629. row.BLweightLock = 0
  1630. }
  1631. // ratio系数ccountratio系数头数ccount实际牛头数
  1632. // 系数头数
  1633. if (row.ccountratio !== '' && row.ccount !== '' && row.ratio !== '') {
  1634. if (row.ccountratio !== 0 && row.ccount !== 0) {
  1635. row.ratio = formatNum(parseFloat(row.ccountratio) * 100 / parseFloat(row.ccount), parseInt(Cookies.get('decimal')))
  1636. }
  1637. } else if (row.ccount !== '' && row.ratio !== '') {
  1638. row.ccountratio = formatNum(parseFloat(row.ccount) * parseFloat(row.ratio) / 100, parseInt(Cookies.get('decimal')))
  1639. } else if (row.ccountratio !== '' && row.ccount !== '') {
  1640. if (row.ccountratio !== 0 && row.ccount !== 0) {
  1641. row.ratio = formatNum(parseFloat(row.ccountratio) * 100 / parseFloat(row.ccount), parseInt(Cookies.get('decimal')))
  1642. }
  1643. } else if (row.ccountratio !== '' && row.ratio !== '') {
  1644. row.ccount = formatNum(parseFloat(row.ccountratio) * 100 / parseFloat(row.ratio) / 100, parseInt(Cookies.get('decimal')))
  1645. }
  1646. // 补料重量
  1647. if (row.ccountratio !== '' && row.BLweight !== '') {
  1648. row.supplyweight = formatNum(parseFloat(row.BLweight) * parseFloat(row.ccountratio) + parseFloat(row.BLweightLock) * parseFloat(row.ccount), parseInt(Cookies.get('decimal')))
  1649. } else if (row.ccountratio !== '' && row.BLweight == '') {
  1650. row.supplyweight = ''
  1651. row.feedweight = ''
  1652. } else if (row.ccountratio == '' && row.BLweight !== '') {
  1653. row.supplyweight = ''
  1654. row.feedweight = ''
  1655. }
  1656. // 配方重量
  1657. if (row.ccountratio !== '' && row.Sfweight !== '') {
  1658. row.ftweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), parseInt(Cookies.get('decimal')))
  1659. } else if (row.ccountratio !== '' && row.Sfweight == '') {
  1660. row.ftweight = ''
  1661. row.feedweight = ''
  1662. } else if (row.ccountratio == '' && row.Sfweight !== '') {
  1663. row.ftweight = ''
  1664. row.feedweight = ''
  1665. }
  1666. // 投喂量
  1667. if (row.supplyweight !== '' && row.ftweight !== '') {
  1668. row.feedweight = formatNum(parseFloat(row.supplyweight) + parseFloat(row.ftweight), parseInt(Cookies.get('decimal')))
  1669. } else if (row.supplyweight == '' && row.ftweight !== '') {
  1670. row.feedweight = formatNum(parseFloat(row.ftweight), parseInt(Cookies.get('decimal')))
  1671. } else if (row.supplyweight !== '' && row.ftweight == '') {
  1672. row.feedweight = formatNum(parseFloat(row.supplyweight), parseInt(Cookies.get('decimal')))
  1673. }
  1674. if (this.table.isPtsfname == false) {
  1675. console.log(row)
  1676. row.feedweight = formatNum(parseFloat(row.ftweight), parseInt(Cookies.get('decimal')))
  1677. } else {
  1678. // 投喂量
  1679. if (row.supplyweight !== '' && row.ftweight !== '') {
  1680. row.feedweight = formatNum(parseFloat(row.supplyweight) + parseFloat(row.ftweight), parseInt(Cookies.get('decimal')))
  1681. } else if (row.supplyweight == '' && row.ftweight !== '') {
  1682. row.feedweight = formatNum(parseFloat(row.ftweight), parseInt(Cookies.get('decimal')))
  1683. } else if (row.supplyweight !== '' && row.ftweight == '') {
  1684. row.feedweight = formatNum(parseFloat(row.supplyweight), parseInt(Cookies.get('decimal')))
  1685. }
  1686. // 补料重量
  1687. if (row.ccountratio !== '' && row.BLweight !== '') {
  1688. row.supplyweight = formatNum(parseFloat(row.BLweight) * parseFloat(row.ccountratio) + parseFloat(row.BLweightLock) * parseFloat(row.ccount), parseInt(Cookies.get('decimal')))
  1689. } else if (row.ccountratio !== '' && row.BLweight == '') {
  1690. row.supplyweight = ''
  1691. row.feedweight = ''
  1692. } else if (row.ccountratio == '' && row.BLweight !== '') {
  1693. row.supplyweight = ''
  1694. row.feedweight = ''
  1695. }
  1696. // 配方重量
  1697. if (row.ccountratio !== '' && row.Sfweight !== '') {
  1698. row.ftweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), parseInt(Cookies.get('decimal')))
  1699. } else if (row.ccountratio !== '' && row.Sfweight == '') {
  1700. row.ftweight = ''
  1701. row.feedweight = ''
  1702. } else if (row.ccountratio == '' && row.Sfweight !== '') {
  1703. row.ftweight = ''
  1704. row.feedweight = ''
  1705. }
  1706. }
  1707. if (row.r1 !== '' && row.isOneWeight == false) {
  1708. this.$set(row, 'w1', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r1) / 100), parseInt(Cookies.get('decimal'))))
  1709. }
  1710. if (row.r2 !== '' && row.isTwoWeight == false) {
  1711. this.$set(row, 'w2', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r2) / 100), parseInt(Cookies.get('decimal'))))
  1712. }
  1713. if (row.r3 !== '' && row.isThreeWeight == false) {
  1714. this.$set(row, 'w3', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r3) / 100), parseInt(Cookies.get('decimal'))))
  1715. }
  1716. if (row.r4 !== '' && row.isFourWeight == false) {
  1717. this.$set(row, 'w4', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r4) / 100), parseInt(Cookies.get('decimal'))))
  1718. }
  1719. if (row.isOneWeight == true) {
  1720. this.$set(row, 'r1', formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal'))))
  1721. }
  1722. if (row.isTwoWeight == true) {
  1723. this.$set(row, 'r2', formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal'))))
  1724. }
  1725. if (row.isThreeWeight == true) {
  1726. this.$set(row, 'r3', formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal'))))
  1727. }
  1728. if (row.isFourWeight == true) {
  1729. this.$set(row, 'r4', formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal'))))
  1730. }
  1731. if (row.w1 == '') { row.w1 = 0 }
  1732. if (row.w2 == '') { row.w2 = 0 }
  1733. if (row.w3 == '') { row.w3 = 0 }
  1734. if (row.w4 == '') { row.w4 = 0 }
  1735. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  1736. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  1737. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  1738. },
  1739. // 总比例
  1740. blurR(row) {
  1741. if (row.r1 == '') { row.r1 = 0 }
  1742. if (row.r2 == '') { row.r2 = 0 }
  1743. if (row.r3 == '') { row.r3 = 0 }
  1744. if (row.r4 == '') { row.r4 = 0 }
  1745. if (row.r1 !== '') {
  1746. row.w1 = formatNum(parseFloat(row.feedweight) * parseFloat(row.r1) / 100, parseInt(Cookies.get('decimal')))
  1747. }
  1748. if (row.r2 !== '') {
  1749. row.w2 = formatNum(parseFloat(row.feedweight) * parseFloat(row.r2) / 100, parseInt(Cookies.get('decimal')))
  1750. }
  1751. if (row.r3 !== '') {
  1752. row.w3 = formatNum(parseFloat(row.feedweight) * parseFloat(row.r3) / 100, parseInt(Cookies.get('decimal')))
  1753. }
  1754. if (row.r4 !== '') {
  1755. row.w4 = formatNum(parseFloat(row.feedweight) * parseFloat(row.r4) / 100, parseInt(Cookies.get('decimal')))
  1756. }
  1757. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  1758. if (row.w1 == '') { row.w1 = 0 }
  1759. if (row.w2 == '') { row.w2 = 0 }
  1760. if (row.w3 == '') { row.w3 = 0 }
  1761. if (row.w4 == '') { row.w4 = 0 }
  1762. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  1763. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  1764. },
  1765. // 一班重量得到焦点
  1766. focusW(row) {
  1767. console.log(row, '====')
  1768. this.focusWRow = Object.assign({}, row)
  1769. },
  1770. // 1班重量得到焦点
  1771. focusW2(row) {
  1772. this.focusWRow2 = Object.assign({}, row)
  1773. },
  1774. // 3班重量得到焦点
  1775. focusW3(row) {
  1776. this.focusWRow3 = Object.assign({}, row)
  1777. },
  1778. // 4班重量得到焦点
  1779. focusW4(row) {
  1780. this.focusWRow4 = Object.assign({}, row)
  1781. },
  1782. // 一班重量
  1783. blurW(row) {
  1784. if (row.w1 == '') {
  1785. row.w1 = 0
  1786. }
  1787. if (row.w2 == '') {
  1788. row.w2 = 0
  1789. }
  1790. if (row.w3 == '') {
  1791. row.w3 = 0
  1792. }
  1793. if (row.w4 == '') {
  1794. row.w4 = 0
  1795. }
  1796. if (row.r1 == '') {
  1797. row.r1 = 0
  1798. }
  1799. if (row.r2 == '') {
  1800. row.r2 = 0
  1801. }
  1802. if (row.r3 == '') {
  1803. row.r3 = 0
  1804. }
  1805. if (row.r4 == '') {
  1806. row.r4 = 0
  1807. }
  1808. // row.ftweight = parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4)
  1809. console.log(row, '=======投喂量feedweight')
  1810. // isOneWeight,isTwoWeight,isThreeWeight,isFourWeight
  1811. if (this.table.RWLength == 4) {
  1812. // isOneWeight,isTwoWeight,isThreeWeight,isFourWeight
  1813. // 2班3班4班都锁定
  1814. if (row.isTwoWeight == true && row.isThreeWeight == true && row.isFourWeight == true) {
  1815. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1816. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  1817. }
  1818. // 2班3班锁定4班未锁定
  1819. if (row.isTwoWeight == true && row.isThreeWeight == true && row.isFourWeight == false) {
  1820. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1821. row.w4 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2) - parseFloat(row.w3), parseInt(Cookies.get('decimal')))
  1822. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1823. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  1824. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  1825. }
  1826. // 2班4班锁定3班未锁定
  1827. if (row.isTwoWeight == true && row.isFourWeight == true && row.isThreeWeight == false) {
  1828. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1829. row.w3 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2) - parseFloat(row.w4), parseInt(Cookies.get('decimal')))
  1830. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1831. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  1832. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  1833. }
  1834. // 3班4班锁定2班未锁定
  1835. if (row.isTwoWeight == false && row.isThreeWeight == true && row.isFourWeight == true) {
  1836. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1837. row.w2 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w3) - parseFloat(row.w4), parseInt(Cookies.get('decimal')))
  1838. row.r2 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1839. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  1840. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  1841. }
  1842. // 2班锁定,3班4班未锁
  1843. if (row.isTwoWeight == true && row.isThreeWeight == false && row.isFourWeight == false) {
  1844. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1845. if (row.r3 == 0 && row.r4 == 0) {
  1846. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2)) / 2, parseInt(Cookies.get('decimal')))
  1847. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1848. row.w4 = row.w3
  1849. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1850. } else if (row.r3 == 0 && row.r4 !== 0) {
  1851. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2) - parseFloat(row.w4)), parseInt(Cookies.get('decimal')))
  1852. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1853. if (row.w1 == '') { row.w1 = 0 }
  1854. if (row.w2 == '') { row.w2 = 0 }
  1855. if (row.w3 == '') { row.w3 = 0 }
  1856. if (row.w4 == '') { row.w4 = 0 }
  1857. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  1858. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  1859. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  1860. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  1861. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  1862. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  1863. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow.dailyWeight)) {
  1864. 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')))
  1865. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1866. }
  1867. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  1868. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  1869. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  1870. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  1871. } else if (row.r3 !== 0 && row.r4 == 0) {
  1872. row.w4 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2) - parseFloat(row.w3)), parseInt(Cookies.get('decimal')))
  1873. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1874. if (row.w1 == '') { row.w1 = 0 }
  1875. if (row.w2 == '') { row.w2 = 0 }
  1876. if (row.w3 == '') { row.w3 = 0 }
  1877. if (row.w4 == '') { row.w4 = 0 }
  1878. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  1879. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  1880. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  1881. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  1882. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  1883. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  1884. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow.dailyWeight)) {
  1885. 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')))
  1886. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1887. }
  1888. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  1889. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  1890. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  1891. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  1892. } else {
  1893. 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')))
  1894. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1895. 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')))
  1896. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1897. }
  1898. if (isNaN(row.w3)) {
  1899. row.w3 = 0
  1900. row.r3 = 0
  1901. }
  1902. if (isNaN(row.w4)) {
  1903. row.w4 = 0
  1904. row.r4 = 0
  1905. }
  1906. if (row.w3 <= 0) {
  1907. row.w3 = 0
  1908. row.r3 = 0
  1909. }
  1910. if (row.w4 <= 0) {
  1911. row.w4 = 0
  1912. row.r4 = 0
  1913. }
  1914. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  1915. }
  1916. // 3班锁定,2班4班未锁
  1917. if (row.isTwoWeight == false && row.isThreeWeight == true && row.isFourWeight == false) {
  1918. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1919. if (row.r2 == 0 && row.r4 == 0) {
  1920. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w3)) / 2, parseInt(Cookies.get('decimal')))
  1921. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1922. row.w4 = row.w2
  1923. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1924. } else if (row.r2 == 0 && row.r4 !== 0) {
  1925. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w3) - parseFloat(row.w4)), parseInt(Cookies.get('decimal')))
  1926. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1927. if (row.w1 == '') { row.w1 = 0 }
  1928. if (row.w2 == '') { row.w2 = 0 }
  1929. if (row.w3 == '') { row.w3 = 0 }
  1930. if (row.w4 == '') { row.w4 = 0 }
  1931. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  1932. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  1933. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  1934. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  1935. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  1936. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  1937. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow.dailyWeight)) {
  1938. 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')))
  1939. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1940. }
  1941. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  1942. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  1943. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  1944. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  1945. } else if (row.r2 !== 0 && row.r4 == 0) {
  1946. row.w4 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w3) - parseFloat(row.w2)), parseInt(Cookies.get('decimal')))
  1947. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1948. if (row.w1 == '') { row.w1 = 0 }
  1949. if (row.w2 == '') { row.w2 = 0 }
  1950. if (row.w3 == '') { row.w3 = 0 }
  1951. if (row.w4 == '') { row.w4 = 0 }
  1952. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  1953. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  1954. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  1955. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  1956. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  1957. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  1958. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow.dailyWeight)) {
  1959. 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')))
  1960. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1961. }
  1962. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  1963. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  1964. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  1965. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  1966. } else {
  1967. 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')))
  1968. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1969. 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')))
  1970. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1971. }
  1972. if (isNaN(row.w2)) {
  1973. row.w2 = 0
  1974. row.r2 = 0
  1975. }
  1976. if (isNaN(row.w4)) {
  1977. row.w4 = 0
  1978. row.r4 = 0
  1979. }
  1980. if (row.w2 <= 0) {
  1981. row.w2 = 0
  1982. row.r2 = 0
  1983. }
  1984. if (row.w4 <= 0) {
  1985. row.w4 = 0
  1986. row.r4 = 0
  1987. }
  1988. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  1989. }
  1990. // 4班锁定,2班3班未锁
  1991. if (row.isTwoWeight == false && row.isThreeWeight == false && row.isFourWeight == true) {
  1992. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1993. if (row.r2 == 0 && row.r3 == 0) {
  1994. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w4)) / 2, parseInt(Cookies.get('decimal')))
  1995. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  1996. row.w3 = row.w2
  1997. row.r3 = row.r2
  1998. } else if (row.r2 == 0 && row.r3 !== 0) {
  1999. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w4) - parseFloat(row.w3)), parseInt(Cookies.get('decimal')))
  2000. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2001. if (row.w1 == '') { row.w1 = 0 }
  2002. if (row.w2 == '') { row.w2 = 0 }
  2003. if (row.w3 == '') { row.w3 = 0 }
  2004. if (row.w4 == '') { row.w4 = 0 }
  2005. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2006. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2007. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2008. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2009. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2010. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2011. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow.dailyWeight)) {
  2012. 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')))
  2013. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2014. }
  2015. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2016. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2017. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2018. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2019. } else if (row.r2 !== 0 && row.r3 == 0) {
  2020. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w4) - parseFloat(row.w2)), parseInt(Cookies.get('decimal')))
  2021. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2022. if (row.w1 == '') { row.w1 = 0 }
  2023. if (row.w2 == '') { row.w2 = 0 }
  2024. if (row.w3 == '') { row.w3 = 0 }
  2025. if (row.w4 == '') { row.w4 = 0 }
  2026. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2027. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2028. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2029. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2030. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2031. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2032. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow.dailyWeight)) {
  2033. 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')))
  2034. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2035. }
  2036. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2037. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2038. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2039. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2040. } else {
  2041. 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')))
  2042. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2043. 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')))
  2044. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2045. }
  2046. if (row.w2 <= 0) {
  2047. row.w2 = 0
  2048. row.r2 = 0
  2049. }
  2050. if (row.w3 <= 0) {
  2051. row.w3 = 0
  2052. row.r3 = 0
  2053. }
  2054. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  2055. }
  2056. // 2班3班4班未锁
  2057. if (row.isTwoWeight == false && row.isThreeWeight == false && row.isFourWeight == false) {
  2058. console.log('1231234')
  2059. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2060. if (parseFloat(row.r2) == 0 && parseFloat(row.r3) == 0 && parseFloat(row.r4) == 0) {
  2061. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1)) / 3, parseInt(Cookies.get('decimal')))
  2062. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2063. row.w3 = row.w2
  2064. row.w4 = row.w2
  2065. row.r3 = row.r2
  2066. row.r4 = row.r2
  2067. } else if (parseFloat(row.r2) == 0 && parseFloat(row.r3) == 0 && parseFloat(row.r4) !== 0) {
  2068. row.w3 = formatNum(((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w4))) / 2, parseInt(Cookies.get('decimal')))
  2069. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2070. row.w2 = row.w3
  2071. row.r2 = row.r3
  2072. if (row.w1 == '') { row.w1 = 0 }
  2073. if (row.w2 == '') { row.w2 = 0 }
  2074. if (row.w3 == '') { row.w3 = 0 }
  2075. if (row.w4 == '') { row.w4 = 0 }
  2076. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2077. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2078. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2079. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2080. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2081. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2082. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow.dailyWeight)) {
  2083. 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')))
  2084. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2085. }
  2086. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2087. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2088. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2089. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2090. } else if (parseFloat(row.r2) == 0 && parseFloat(row.r3) !== 0 && parseFloat(row.r4) == 0) {
  2091. row.w2 = formatNum(((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w3))) / 2, parseInt(Cookies.get('decimal')))
  2092. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2093. row.w4 = row.w2
  2094. row.r4 = row.r2
  2095. if (row.w1 == '') { row.w1 = 0 }
  2096. if (row.w2 == '') { row.w2 = 0 }
  2097. if (row.w3 == '') { row.w3 = 0 }
  2098. if (row.w4 == '') { row.w4 = 0 }
  2099. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2100. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2101. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2102. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2103. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2104. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2105. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow.dailyWeight)) {
  2106. 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')))
  2107. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2108. }
  2109. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2110. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2111. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2112. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2113. } else if (parseFloat(row.r2) !== 0 && parseFloat(row.r3) == 0 && parseFloat(row.r4) == 0) {
  2114. row.w3 = formatNum(((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2))) / 2, parseInt(Cookies.get('decimal')))
  2115. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2116. row.w4 = row.w3
  2117. row.r4 = row.r3
  2118. if (row.w1 == '') { row.w1 = 0 }
  2119. if (row.w2 == '') { row.w2 = 0 }
  2120. if (row.w3 == '') { row.w3 = 0 }
  2121. if (row.w4 == '') { row.w4 = 0 }
  2122. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2123. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2124. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2125. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2126. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2127. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2128. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow.dailyWeight)) {
  2129. 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')))
  2130. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2131. }
  2132. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2133. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2134. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2135. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2136. } else if (row.r2 == 0 && row.r3 !== 0 && row.r4 !== 0) {
  2137. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w3) - parseFloat(row.w4)), parseInt(Cookies.get('decimal')))
  2138. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2139. if (row.w1 == '') { row.w1 = 0 }
  2140. if (row.w2 == '') { row.w2 = 0 }
  2141. if (row.w3 == '') { row.w3 = 0 }
  2142. if (row.w4 == '') { row.w4 = 0 }
  2143. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2144. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2145. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2146. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2147. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2148. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2149. console.log(row.dailyWeight)
  2150. console.log(this.focusWRow.dailyWeight)
  2151. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow.dailyWeight)) {
  2152. 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')))
  2153. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2154. 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')))
  2155. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2156. }
  2157. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2158. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2159. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2160. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2161. } else if (row.r2 !== 0 && row.r3 == 0 && row.r4 !== 0) {
  2162. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2) - parseFloat(row.w4)), parseInt(Cookies.get('decimal')))
  2163. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2164. if (row.w1 == '') { row.w1 = 0 }
  2165. if (row.w2 == '') { row.w2 = 0 }
  2166. if (row.w3 == '') { row.w3 = 0 }
  2167. if (row.w4 == '') { row.w4 = 0 }
  2168. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2169. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2170. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2171. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2172. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2173. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2174. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow.dailyWeight)) {
  2175. 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')))
  2176. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2177. 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')))
  2178. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2179. }
  2180. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2181. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2182. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2183. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2184. } else if (row.r2 !== 0 && row.r3 !== 0 && row.r4 == 0) {
  2185. row.w4 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2) - parseFloat(row.w3)), parseInt(Cookies.get('decimal')))
  2186. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2187. if (row.w1 == '') { row.w1 = 0 }
  2188. if (row.w2 == '') { row.w2 = 0 }
  2189. if (row.w3 == '') { row.w3 = 0 }
  2190. if (row.w4 == '') { row.w4 = 0 }
  2191. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2192. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2193. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2194. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2195. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2196. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2197. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow.dailyWeight)) {
  2198. 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')))
  2199. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2200. 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')))
  2201. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2202. }
  2203. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2204. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2205. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2206. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2207. } else {
  2208. 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')))
  2209. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2210. 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')))
  2211. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2212. 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')))
  2213. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2214. }
  2215. if (isNaN(row.w2)) {
  2216. row.w2 = 0
  2217. row.r2 = 0
  2218. }
  2219. if (isNaN(row.w3)) {
  2220. row.w3 = 0
  2221. row.r3 = 0
  2222. }
  2223. if (isNaN(row.w4)) {
  2224. row.w4 = 0
  2225. row.r4 = 0
  2226. }
  2227. if (row.w2 <= 0) {
  2228. row.w2 = 0
  2229. row.r2 = 0
  2230. }
  2231. if (row.w3 <= 0) {
  2232. row.w3 = 0
  2233. row.r3 = 0
  2234. }
  2235. if (row.w4 <= 0) {
  2236. row.w4 = 0
  2237. row.r4 = 0
  2238. }
  2239. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  2240. }
  2241. } else if (this.table.RWLength == 3) {
  2242. // 三班
  2243. // 2班/3班锁定
  2244. if (row.isTwoWeight == true && row.isThreeWeight == true) {
  2245. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2246. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3), parseInt(Cookies.get('decimal'))))
  2247. }
  2248. // 2班不锁3班锁
  2249. if (row.isTwoWeight == false && row.isThreeWeight == true) {
  2250. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2251. row.w2 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w3), parseInt(Cookies.get('decimal')))
  2252. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2253. if (row.w2 <= 0) {
  2254. row.w2 = 0
  2255. row.r2 = 0
  2256. }
  2257. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3), parseInt(Cookies.get('decimal'))))
  2258. }
  2259. // 3班不锁2班锁
  2260. if (row.isTwoWeight == true && row.isThreeWeight == false) {
  2261. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2262. row.w3 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2), parseInt(Cookies.get('decimal')))
  2263. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2264. if (row.w3 <= 0) {
  2265. row.w3 = 0
  2266. row.r3 = 0
  2267. }
  2268. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3), parseInt(Cookies.get('decimal'))))
  2269. }
  2270. // 2班3班都不锁
  2271. if (row.isTwoWeight == false && row.isThreeWeight == false) {
  2272. console.log(row.w1, 'w1----------')
  2273. console.log(row.feedweight, 'feedweight----------')
  2274. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2275. if (row.r2 == 0 && row.r3 == 0) {
  2276. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1)) / 2, parseInt(Cookies.get('decimal')))
  2277. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2278. row.w3 = row.w2
  2279. row.r3 = row.r2
  2280. } else if (row.r2 == 0 && row.r3 !== 0) {
  2281. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w3)), parseInt(Cookies.get('decimal')))
  2282. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2283. if (row.w1 == '') { row.w1 = 0 }
  2284. if (row.w2 == '') { row.w2 = 0 }
  2285. if (row.w3 == '') { row.w3 = 0 }
  2286. if (row.w4 == '') { row.w4 = 0 }
  2287. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2288. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2289. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2290. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2291. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2292. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2293. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow.dailyWeight)) {
  2294. 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')))
  2295. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2296. }
  2297. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2298. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2299. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2300. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2301. } else if (row.r2 !== 0 && row.r3 == 0) {
  2302. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2)), parseInt(Cookies.get('decimal')))
  2303. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2304. if (row.w1 == '') { row.w1 = 0 }
  2305. if (row.w2 == '') { row.w2 = 0 }
  2306. if (row.w3 == '') { row.w3 = 0 }
  2307. if (row.w4 == '') { row.w4 = 0 }
  2308. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2309. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2310. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2311. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2312. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2313. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2314. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow.dailyWeight)) {
  2315. 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')))
  2316. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2317. }
  2318. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2319. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2320. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2321. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2322. } else {
  2323. 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')))
  2324. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2325. 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')))
  2326. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2327. console.log('我改了1')
  2328. }
  2329. if (isNaN(row.w2)) {
  2330. row.w2 = 0
  2331. row.r2 = 0
  2332. }
  2333. if (isNaN(row.w3)) {
  2334. row.w3 = 0
  2335. row.r3 = 0
  2336. }
  2337. if (row.w3 <= 0) {
  2338. row.w3 = 0
  2339. row.r3 = 0
  2340. }
  2341. if (row.w2 <= 0) {
  2342. row.w2 = 0
  2343. row.r2 = 0
  2344. }
  2345. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3), parseInt(Cookies.get('decimal'))))
  2346. }
  2347. } else if (this.table.RWLength == 2) {
  2348. // 两班isOneWeight,isTwoWeight
  2349. if (row.w1 == '') { row.w1 = 0 }
  2350. if (row.w2 == '') { row.w2 = 0 }
  2351. if (row.r1 == '') { row.r1 = 0 }
  2352. if (row.r2 == '') { row.r2 = 0 }
  2353. if (row.isTwoWeight == false) {
  2354. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2355. row.w2 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w1), parseInt(Cookies.get('decimal')))
  2356. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2357. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2358. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2), parseInt(Cookies.get('decimal'))))
  2359. } else {
  2360. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2361. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2), parseInt(Cookies.get('decimal'))))
  2362. }
  2363. } else {
  2364. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2365. this.$set(row, 'sumr', formatNum(parseFloat(row.r1), parseInt(Cookies.get('decimal'))))
  2366. }
  2367. if (row.w1 == '') { row.w1 = 0 }
  2368. if (row.w2 == '') { row.w2 = 0 }
  2369. if (row.w3 == '') { row.w3 = 0 }
  2370. if (row.w4 == '') { row.w4 = 0 }
  2371. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2372. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2373. },
  2374. blurW2(row) {
  2375. // 2班重量
  2376. if (row.w1 == '') {
  2377. row.w1 = 0
  2378. }
  2379. if (row.w2 == '') {
  2380. row.w2 = 0
  2381. }
  2382. if (row.w3 == '') {
  2383. row.w3 = 0
  2384. }
  2385. if (row.w4 == '') {
  2386. row.w4 = 0
  2387. }
  2388. if (row.r1 == '') {
  2389. row.r1 = 0
  2390. }
  2391. if (row.r2 == '') {
  2392. row.r2 = 0
  2393. }
  2394. if (row.r3 == '') {
  2395. row.r3 = 0
  2396. }
  2397. if (row.r4 == '') {
  2398. row.r4 = 0
  2399. }
  2400. // row.ftweight = parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4)
  2401. console.log(row, '=======投喂量feedweight')
  2402. // isOneWeight,isTwoWeight,isThreeWeight,isFourWeight
  2403. if (this.table.RWLength == 4) {
  2404. // 四班
  2405. // 1班3班4班都锁定
  2406. if (row.isOneWeight == true && row.isThreeWeight == true && row.isFourWeight == true) {
  2407. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2408. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  2409. }
  2410. // 1班3班锁定4班未锁定
  2411. if (row.isOneWeight == true && row.isThreeWeight == true && row.isFourWeight == false) {
  2412. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2413. row.w4 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2) - parseFloat(row.w3), parseInt(Cookies.get('decimal')))
  2414. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2415. if (row.w4 <= 0) {
  2416. row.w4 = 0
  2417. row.r4 = 0
  2418. }
  2419. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  2420. }
  2421. // 1班4班锁定3班未锁定
  2422. if (row.isOneWeight == true && row.isFourWeight == true && row.isThreeWeight == false) {
  2423. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2424. row.w3 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2) - parseFloat(row.w4), parseInt(Cookies.get('decimal')))
  2425. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2426. if (row.w3 <= 0) {
  2427. row.w3 = 0
  2428. row.r3 = 0
  2429. }
  2430. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  2431. }
  2432. // 3班4班锁定1班未锁定
  2433. if (row.isOneWeight == false && row.isThreeWeight == true && row.isFourWeight == true) {
  2434. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2435. row.w1 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w2) - parseFloat(row.w3) - parseFloat(row.w4), parseInt(Cookies.get('decimal')))
  2436. row.r1 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2437. if (row.w1 <= 0) {
  2438. row.w1 = 0
  2439. row.r1 = 0
  2440. }
  2441. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  2442. }
  2443. // 1班锁定,3班4班未锁
  2444. if (row.isOneWeight == true && row.isThreeWeight == false && row.isFourWeight == false) {
  2445. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2446. if (row.r3 == 0 && row.r4 == 0) {
  2447. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2)) / 2, parseInt(Cookies.get('decimal')))
  2448. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2449. row.w4 = row.w3
  2450. row.r4 = row.r3
  2451. } else if (row.r3 == 0 && row.r4 !== 0) {
  2452. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2) - parseFloat(row.w4)), parseInt(Cookies.get('decimal')))
  2453. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2454. if (row.w1 == '') { row.w1 = 0 }
  2455. if (row.w2 == '') { row.w2 = 0 }
  2456. if (row.w3 == '') { row.w3 = 0 }
  2457. if (row.w4 == '') { row.w4 = 0 }
  2458. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2459. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2460. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2461. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2462. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2463. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2464. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow2.dailyWeight)) {
  2465. 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')))
  2466. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2467. }
  2468. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2469. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2470. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2471. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2472. } else if (row.r3 !== 0 && row.r4 == 0) {
  2473. row.w4 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2) - parseFloat(row.w3)), parseInt(Cookies.get('decimal')))
  2474. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2475. if (row.w1 == '') { row.w1 = 0 }
  2476. if (row.w2 == '') { row.w2 = 0 }
  2477. if (row.w3 == '') { row.w3 = 0 }
  2478. if (row.w4 == '') { row.w4 = 0 }
  2479. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2480. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2481. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2482. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2483. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2484. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2485. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow2.dailyWeight)) {
  2486. 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')))
  2487. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2488. }
  2489. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2490. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2491. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2492. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2493. } else {
  2494. 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')))
  2495. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2496. 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')))
  2497. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2498. }
  2499. if (isNaN(row.w3)) {
  2500. row.w3 = 0
  2501. row.r3 = 0
  2502. }
  2503. if (isNaN(row.w4)) {
  2504. row.w4 = 0
  2505. row.r4 = 0
  2506. }
  2507. if (row.w3 <= 0) {
  2508. row.w3 = 0
  2509. row.r3 = 0
  2510. }
  2511. if (row.w4 <= 0) {
  2512. row.w4 = 0
  2513. row.r4 = 0
  2514. }
  2515. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  2516. }
  2517. // 3班锁定,1班4班未锁
  2518. if (row.isOneWeight == false && row.isThreeWeight == true && row.isFourWeight == false) {
  2519. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2520. if (row.r1 == 0 && row.r4 == 0) {
  2521. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3) - parseFloat(row.w2)) / 2, parseInt(Cookies.get('decimal')))
  2522. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2523. row.w4 = row.w1
  2524. row.r4 = row.r1
  2525. } else if (row.r1 == 0 && row.r4 !== 0) {
  2526. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3) - parseFloat(row.w2) - parseFloat(row.w4)), parseInt(Cookies.get('decimal')))
  2527. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2528. if (row.w1 == '') { row.w1 = 0 }
  2529. if (row.w2 == '') { row.w2 = 0 }
  2530. if (row.w3 == '') { row.w3 = 0 }
  2531. if (row.w4 == '') { row.w4 = 0 }
  2532. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2533. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2534. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2535. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2536. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2537. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2538. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow2.dailyWeight)) {
  2539. 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')))
  2540. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2541. }
  2542. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2543. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2544. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2545. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2546. } else if (row.r1 !== 0 && row.r4 == 0) {
  2547. row.w4 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3) - parseFloat(row.w2) - parseFloat(row.w1)), parseInt(Cookies.get('decimal')))
  2548. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2549. if (row.w1 == '') { row.w1 = 0 }
  2550. if (row.w2 == '') { row.w2 = 0 }
  2551. if (row.w3 == '') { row.w3 = 0 }
  2552. if (row.w4 == '') { row.w4 = 0 }
  2553. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2554. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2555. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2556. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2557. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2558. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2559. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow2.dailyWeight)) {
  2560. 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')))
  2561. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2562. }
  2563. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2564. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2565. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2566. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2567. } else {
  2568. 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')))
  2569. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2570. 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')))
  2571. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2572. }
  2573. if (isNaN(row.w1)) {
  2574. row.w1 = 0
  2575. row.r1 = 0
  2576. }
  2577. if (isNaN(row.w4)) {
  2578. row.w4 = 0
  2579. row.r4 = 0
  2580. }
  2581. if (row.w1 <= 0) {
  2582. row.w1 = 0
  2583. row.r1 = 0
  2584. }
  2585. if (row.w4 <= 0) {
  2586. row.w4 = 0
  2587. row.r4 = 0
  2588. }
  2589. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  2590. }
  2591. // 4班锁定,1班3班未锁
  2592. if (row.isOneWeight == false && row.isThreeWeight == false && row.isFourWeight == true) {
  2593. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2594. if (row.r1 == 0 && row.r3 == 0) {
  2595. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w2)) / 2, parseInt(Cookies.get('decimal')))
  2596. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2597. row.w3 = row.w1
  2598. row.r3 = row.r1
  2599. } else if (row.r1 == 0 && row.r3 !== 0) {
  2600. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w2) - parseFloat(row.w3)), parseInt(Cookies.get('decimal')))
  2601. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2602. if (row.w1 == '') { row.w1 = 0 }
  2603. if (row.w2 == '') { row.w2 = 0 }
  2604. if (row.w3 == '') { row.w3 = 0 }
  2605. if (row.w4 == '') { row.w4 = 0 }
  2606. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2607. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2608. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2609. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2610. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2611. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2612. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow2.dailyWeight)) {
  2613. 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')))
  2614. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2615. }
  2616. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2617. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2618. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2619. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2620. } else if (row.r1 !== 0 && row.r3 == 0) {
  2621. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w2) - parseFloat(row.w1)), parseInt(Cookies.get('decimal')))
  2622. row.r3 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2623. if (row.w1 == '') { row.w1 = 0 }
  2624. if (row.w2 == '') { row.w2 = 0 }
  2625. if (row.w3 == '') { row.w3 = 0 }
  2626. if (row.w4 == '') { row.w4 = 0 }
  2627. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2628. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2629. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2630. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2631. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2632. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2633. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow2.dailyWeight)) {
  2634. 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')))
  2635. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2636. }
  2637. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2638. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2639. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2640. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2641. } else {
  2642. 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')))
  2643. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2644. 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')))
  2645. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2646. }
  2647. if (isNaN(row.w1)) {
  2648. row.w1 = 0
  2649. row.r1 = 0
  2650. }
  2651. if (isNaN(row.w3)) {
  2652. row.w3 = 0
  2653. row.r3 = 0
  2654. }
  2655. if (row.w1 <= 0) {
  2656. row.w1 = 0
  2657. row.r1 = 0
  2658. }
  2659. if (row.w3 <= 0) {
  2660. row.w3 = 0
  2661. row.r3 = 0
  2662. }
  2663. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  2664. }
  2665. // 1班3班4班未锁
  2666. if (row.isOneWeight == false && row.isThreeWeight == false && row.isFourWeight == false) {
  2667. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2668. if (row.r1 == 0 && row.r3 == 0 && row.r4 == 0) {
  2669. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w2)) / 3, parseInt(Cookies.get('decimal')))
  2670. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2671. row.w3 = row.w1
  2672. row.r3 = row.r1
  2673. row.w4 = row.w1
  2674. row.r4 = row.r1
  2675. } else if (row.r1 == 0 && row.r3 == 0 && row.r4 !== 0) {
  2676. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w2) - parseFloat(row.w4)) / 2, parseInt(Cookies.get('decimal')))
  2677. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2678. row.w3 = row.w1
  2679. row.r3 = row.r1
  2680. if (row.w1 == '') { row.w1 = 0 }
  2681. if (row.w2 == '') { row.w2 = 0 }
  2682. if (row.w3 == '') { row.w3 = 0 }
  2683. if (row.w4 == '') { row.w4 = 0 }
  2684. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2685. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2686. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2687. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2688. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2689. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2690. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow2.dailyWeight)) {
  2691. 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')))
  2692. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2693. }
  2694. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2695. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2696. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2697. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2698. } else if (row.r1 == 0 && row.r3 !== 0 && row.r4 == 0) {
  2699. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w2) - parseFloat(row.w3)) / 2, parseInt(Cookies.get('decimal')))
  2700. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2701. row.w4 = row.w1
  2702. row.r4 = row.r1
  2703. if (row.w1 == '') { row.w1 = 0 }
  2704. if (row.w2 == '') { row.w2 = 0 }
  2705. if (row.w3 == '') { row.w3 = 0 }
  2706. if (row.w4 == '') { row.w4 = 0 }
  2707. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2708. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2709. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2710. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2711. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2712. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2713. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow2.dailyWeight)) {
  2714. 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')))
  2715. row.r3 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2716. }
  2717. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2718. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2719. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2720. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2721. } else if (row.r1 !== 0 && row.r3 == 0 && row.r4 == 0) {
  2722. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w2) - parseFloat(row.w1)) / 2, parseInt(Cookies.get('decimal')))
  2723. row.r3 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2724. row.w4 = row.w3
  2725. row.r4 = row.r3
  2726. if (row.w1 == '') { row.w1 = 0 }
  2727. if (row.w2 == '') { row.w2 = 0 }
  2728. if (row.w3 == '') { row.w3 = 0 }
  2729. if (row.w4 == '') { row.w4 = 0 }
  2730. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2731. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2732. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2733. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2734. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2735. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2736. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow2.dailyWeight)) {
  2737. console.log('huijia;')
  2738. 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')))
  2739. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2740. }
  2741. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2742. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2743. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2744. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2745. } else if ((row.r1 !== 0 && row.r3 !== 0 && row.r4 == 0)) {
  2746. row.w4 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w2) - parseFloat(row.w1) - parseFloat(row.w3)), parseInt(Cookies.get('decimal')))
  2747. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2748. if (row.w1 == '') { row.w1 = 0 }
  2749. if (row.w2 == '') { row.w2 = 0 }
  2750. if (row.w3 == '') { row.w3 = 0 }
  2751. if (row.w4 == '') { row.w4 = 0 }
  2752. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2753. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2754. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2755. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2756. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2757. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2758. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow2.dailyWeight)) {
  2759. 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')))
  2760. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2761. 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')))
  2762. row.r3 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2763. }
  2764. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2765. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2766. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2767. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2768. } else if ((row.r1 !== 0 && row.r3 == 0 && row.r4 !== 0)) {
  2769. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w2) - parseFloat(row.w1) - parseFloat(row.w4)), parseInt(Cookies.get('decimal')))
  2770. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2771. if (row.w1 == '') { row.w1 = 0 }
  2772. if (row.w2 == '') { row.w2 = 0 }
  2773. if (row.w3 == '') { row.w3 = 0 }
  2774. if (row.w4 == '') { row.w4 = 0 }
  2775. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2776. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2777. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2778. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2779. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2780. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2781. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow2.dailyWeight)) {
  2782. 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')))
  2783. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2784. 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')))
  2785. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2786. }
  2787. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2788. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2789. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2790. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2791. } else if ((row.r1 == 0 && row.r3 !== 0 && row.r4 !== 0)) {
  2792. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w2) - parseFloat(row.w3) - parseFloat(row.w4)), parseInt(Cookies.get('decimal')))
  2793. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2794. if (row.w1 == '') { row.w1 = 0 }
  2795. if (row.w2 == '') { row.w2 = 0 }
  2796. if (row.w3 == '') { row.w3 = 0 }
  2797. if (row.w4 == '') { row.w4 = 0 }
  2798. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2799. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2800. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2801. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2802. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2803. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2804. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow2.dailyWeight)) {
  2805. 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')))
  2806. row.r3 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2807. 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')))
  2808. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2809. }
  2810. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2811. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2812. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2813. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2814. } else {
  2815. console.log('wolaile')
  2816. 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')))
  2817. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2818. 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')))
  2819. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2820. 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')))
  2821. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2822. }
  2823. if (isNaN(row.w1)) {
  2824. row.w1 = 0
  2825. row.r1 = 0
  2826. }
  2827. if (isNaN(row.w3)) {
  2828. row.w3 = 0
  2829. row.r3 = 0
  2830. }
  2831. if (isNaN(row.w4)) {
  2832. row.w4 = 0
  2833. row.r4 = 0
  2834. }
  2835. if (row.w1 <= 0) {
  2836. row.w1 = 0
  2837. row.r1 = 0
  2838. }
  2839. if (row.w3 <= 0) {
  2840. row.w3 = 0
  2841. row.r3 = 0
  2842. }
  2843. if (row.w4 <= 0) {
  2844. row.w4 = 0
  2845. row.r4 = 0
  2846. }
  2847. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  2848. }
  2849. } else if (this.table.RWLength == 3) {
  2850. // 三班
  2851. // 1班/3班锁定
  2852. if (row.isOneWeight == true && row.isThreeWeight == true) {
  2853. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2854. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3), parseInt(Cookies.get('decimal'))))
  2855. }
  2856. // 1班不锁3班锁
  2857. if (row.isOneWeight == false && row.isThreeWeight == true) {
  2858. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2859. row.w1 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w2) - parseFloat(row.w3), parseInt(Cookies.get('decimal')))
  2860. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2861. if (row.w1 <= 0) {
  2862. row.w1 = 0
  2863. row.r1 = 0
  2864. }
  2865. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3), parseInt(Cookies.get('decimal'))))
  2866. }
  2867. // 3班不锁1班锁
  2868. if (row.isOneWeight == true && row.isThreeWeight == false) {
  2869. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2870. row.w3 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2), parseInt(Cookies.get('decimal')))
  2871. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2872. if (row.w3 <= 0) {
  2873. row.w3 = 0
  2874. row.r3 = 0
  2875. }
  2876. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3), parseInt(Cookies.get('decimal'))))
  2877. }
  2878. // 1班3班都不锁
  2879. if (row.isOneWeight == false && row.isThreeWeight == false) {
  2880. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2881. if (row.r1 == 0 && row.r3 == 0) {
  2882. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w2)) / 2, parseInt(Cookies.get('decimal')))
  2883. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2884. row.w3 = row.w1
  2885. row.r3 = row.r1
  2886. } else if (row.r1 == 0 && row.r3 !== 0) {
  2887. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w2) - parseFloat(row.w3)), parseInt(Cookies.get('decimal')))
  2888. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2889. if (row.w1 == '') { row.w1 = 0 }
  2890. if (row.w2 == '') { row.w2 = 0 }
  2891. if (row.w3 == '') { row.w3 = 0 }
  2892. if (row.w4 == '') { row.w4 = 0 }
  2893. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2894. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2895. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2896. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2897. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2898. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2899. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow2.dailyWeight)) {
  2900. row.w3 = formatNum((parseFloat(this.focusWRow2.dailyWeight) - parseFloat(row.w2)) * parseFloat(row.r3) / (parseFloat(this.focusWRow2.r1) + parseFloat(row.r3)), parseInt(Cookies.get('decimal')))
  2901. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2902. }
  2903. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2904. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2905. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2906. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2907. } else if (row.r1 !== 0 && row.r3 == 0) {
  2908. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w2) - parseFloat(row.w1)), parseInt(Cookies.get('decimal')))
  2909. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2910. if (row.w1 == '') { row.w1 = 0 }
  2911. if (row.w2 == '') { row.w2 = 0 }
  2912. if (row.w3 == '') { row.w3 = 0 }
  2913. if (row.w4 == '') { row.w4 = 0 }
  2914. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2915. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2916. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2917. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2918. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2919. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2920. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow2.dailyWeight)) {
  2921. row.w1 = formatNum((parseFloat(this.focusWRow2.dailyWeight) - parseFloat(row.w2)) * parseFloat(row.r1) / (parseFloat(row.r1) + parseFloat(row.r3)), parseInt(Cookies.get('decimal')))
  2922. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2923. }
  2924. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2925. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2926. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  2927. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  2928. } else {
  2929. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w2)) * parseFloat(row.r1) / (parseFloat(row.r1) + parseFloat(row.r3)), parseInt(Cookies.get('decimal')))
  2930. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2931. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w2)) * parseFloat(row.r3) / (parseFloat(this.focusWRow2.r1) + parseFloat(row.r3)), parseInt(Cookies.get('decimal')))
  2932. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2933. }
  2934. if (isNaN(row.w1)) {
  2935. row.w1 = 0
  2936. row.r1 = 0
  2937. }
  2938. if (isNaN(row.w3)) {
  2939. row.w3 = 0
  2940. row.r3 = 0
  2941. }
  2942. if (row.w3 <= 0) {
  2943. row.w3 = 0
  2944. row.r3 = 0
  2945. }
  2946. if (row.w1 <= 0) {
  2947. row.w1 = 0
  2948. row.r1 = 0
  2949. }
  2950. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3), parseInt(Cookies.get('decimal'))))
  2951. }
  2952. } else if (this.table.RWLength == 2) {
  2953. if (row.isOneWeight == false) {
  2954. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2955. row.w1 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w2), parseInt(Cookies.get('decimal')))
  2956. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2957. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2958. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2), parseInt(Cookies.get('decimal'))))
  2959. } else {
  2960. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  2961. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2), parseInt(Cookies.get('decimal'))))
  2962. }
  2963. }
  2964. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  2965. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2966. if (row.w1 == '') { row.w1 = 0 }
  2967. if (row.w2 == '') { row.w2 = 0 }
  2968. if (row.w3 == '') { row.w3 = 0 }
  2969. if (row.w4 == '') { row.w4 = 0 }
  2970. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  2971. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  2972. },
  2973. blurW3(row) {
  2974. // 3班重量
  2975. if (row.w1 == '') {
  2976. row.w1 = 0
  2977. }
  2978. if (row.w2 == '') {
  2979. row.w2 = 0
  2980. }
  2981. if (row.w3 == '') {
  2982. row.w3 = 0
  2983. }
  2984. if (row.w4 == '') {
  2985. row.w4 = 0
  2986. }
  2987. if (row.r1 == '') {
  2988. row.r1 = 0
  2989. }
  2990. if (row.r2 == '') {
  2991. row.r2 = 0
  2992. }
  2993. if (row.r3 == '') {
  2994. row.r3 = 0
  2995. }
  2996. if (row.r4 == '') {
  2997. row.r4 = 0
  2998. }
  2999. // row.ftweight = parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4)
  3000. console.log(row, '=======投喂量feedweight')
  3001. // isOneWeight,isTwoWeight,isThreeWeight,isFourWeight
  3002. if (this.table.RWLength == 4) {
  3003. // 四班
  3004. // 1班2班4班都锁定
  3005. if (row.isOneWeight == true && row.isTwoWeight == true && row.isFourWeight == true) {
  3006. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3007. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  3008. }
  3009. // 1班2班锁定4班未锁定
  3010. if (row.isOneWeight == true && row.isTwoWeight == true && row.isFourWeight == false) {
  3011. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3012. row.w4 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2) - parseFloat(row.w3), parseInt(Cookies.get('decimal')))
  3013. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3014. if (row.w4 <= 0) {
  3015. row.w4 = 0
  3016. row.r4 = 0
  3017. }
  3018. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  3019. }
  3020. // 2班4班锁定1班未锁定
  3021. if (row.isOneWeight == false && row.isTwoWeight == true && row.isFourWeight == true) {
  3022. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3023. row.w1 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w2) - parseFloat(row.w3) - parseFloat(row.w4), parseInt(Cookies.get('decimal')))
  3024. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3025. if (row.w1 <= 0) {
  3026. row.w1 = 0
  3027. row.r1 = 0
  3028. }
  3029. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  3030. }
  3031. // 1班4班锁定2班未锁定
  3032. if (row.isTwoWeight == false && row.isOneWeight == true && row.isFourWeight == true) {
  3033. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3034. row.w2 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w3) - parseFloat(row.w4), parseInt(Cookies.get('decimal')))
  3035. row.r2 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3036. if (row.w2 <= 0) {
  3037. row.w2 = 0
  3038. row.r2 = 0
  3039. }
  3040. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  3041. }
  3042. // 2班锁定,1班4班未锁
  3043. if (row.isTwoWeight == true && row.isOneWeight == false && row.isFourWeight == false) {
  3044. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3045. if (row.r1 == 0 && row.r4 == 0) {
  3046. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w2) - parseFloat(row.w3)) / 2, parseInt(Cookies.get('decimal')))
  3047. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3048. row.w4 = row.w1
  3049. row.r4 = row.r1
  3050. } else if (row.r1 == 0 && row.r4 !== 0) {
  3051. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w2) - parseFloat(row.w3) - parseFloat(row.w4)), parseInt(Cookies.get('decimal')))
  3052. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3053. if (row.w1 == '') { row.w1 = 0 }
  3054. if (row.w2 == '') { row.w2 = 0 }
  3055. if (row.w3 == '') { row.w3 = 0 }
  3056. if (row.w4 == '') { row.w4 = 0 }
  3057. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3058. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3059. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3060. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3061. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3062. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3063. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow3.dailyWeight)) {
  3064. 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')))
  3065. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3066. }
  3067. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3068. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3069. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3070. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3071. } else if (row.r1 !== 0 && row.r4 == 0) {
  3072. row.w4 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w2) - parseFloat(row.w3) - parseFloat(row.w1)), parseInt(Cookies.get('decimal')))
  3073. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3074. if (row.w1 == '') { row.w1 = 0 }
  3075. if (row.w2 == '') { row.w2 = 0 }
  3076. if (row.w3 == '') { row.w3 = 0 }
  3077. if (row.w4 == '') { row.w4 = 0 }
  3078. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3079. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3080. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3081. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3082. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3083. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3084. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow3.dailyWeight)) {
  3085. 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')))
  3086. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3087. }
  3088. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3089. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3090. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3091. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3092. } else {
  3093. 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')))
  3094. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3095. 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')))
  3096. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3097. }
  3098. if (isNaN(row.w1)) {
  3099. row.w1 = 0
  3100. row.r1 = 0
  3101. }
  3102. if (isNaN(row.w4)) {
  3103. row.w4 = 0
  3104. row.r4 = 0
  3105. }
  3106. if (row.w1 <= 0) {
  3107. row.w1 = 0
  3108. row.r1 = 0
  3109. }
  3110. if (row.w4 <= 0) {
  3111. row.w4 = 0
  3112. row.r4 = 0
  3113. }
  3114. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  3115. }
  3116. // 1班锁定,2班4班未锁
  3117. if (row.isTwoWeight == false && row.isOneWeight == true && row.isFourWeight == false) {
  3118. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3119. if (row.r2 == 0 && row.r4 == 0) {
  3120. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w3)) / 2, parseInt(Cookies.get('decimal')))
  3121. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3122. row.w4 = row.w2
  3123. row.r4 = row.r2
  3124. } else if (row.r2 == 0 && row.r4 !== 0) {
  3125. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w3) - parseFloat(row.w4)), parseInt(Cookies.get('decimal')))
  3126. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3127. if (row.w1 == '') { row.w1 = 0 }
  3128. if (row.w2 == '') { row.w2 = 0 }
  3129. if (row.w3 == '') { row.w3 = 0 }
  3130. if (row.w4 == '') { row.w4 = 0 }
  3131. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3132. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3133. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3134. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3135. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3136. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3137. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow3.dailyWeight)) {
  3138. 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')))
  3139. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3140. }
  3141. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3142. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3143. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3144. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3145. } else if (row.r2 !== 0 && row.r4 == 0) {
  3146. row.w4 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w3) - parseFloat(row.w2)), parseInt(Cookies.get('decimal')))
  3147. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3148. if (row.w1 == '') { row.w1 = 0 }
  3149. if (row.w2 == '') { row.w2 = 0 }
  3150. if (row.w3 == '') { row.w3 = 0 }
  3151. if (row.w4 == '') { row.w4 = 0 }
  3152. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3153. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3154. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3155. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3156. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3157. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3158. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow3.dailyWeight)) {
  3159. 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')))
  3160. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3161. }
  3162. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3163. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3164. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3165. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3166. } else {
  3167. 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')))
  3168. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3169. 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')))
  3170. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3171. }
  3172. if (isNaN(row.w2)) {
  3173. row.w2 = 0
  3174. row.r2 = 0
  3175. }
  3176. if (isNaN(row.w4)) {
  3177. row.w4 = 0
  3178. row.r4 = 0
  3179. }
  3180. if (row.w2 <= 0) {
  3181. row.w2 = 0
  3182. row.r2 = 0
  3183. }
  3184. if (row.w4 <= 0) {
  3185. row.w4 = 0
  3186. row.r4 = 0
  3187. }
  3188. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  3189. }
  3190. // 4班锁定,2班1班未锁
  3191. if (row.isTwoWeight == false && row.isOneWeight == false && row.isFourWeight == true) {
  3192. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3193. if (row.r1 == 0 && row.r2 == 0) {
  3194. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3) - parseFloat(row.w4)) / 2, parseInt(Cookies.get('decimal')))
  3195. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3196. row.w2 = row.w1
  3197. row.r2 = row.r1
  3198. } else if (row.r1 == 0 && row.r2 !== 0) {
  3199. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3) - parseFloat(row.w4) - parseFloat(row.w2)), parseInt(Cookies.get('decimal')))
  3200. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3201. if (row.w1 == '') { row.w1 = 0 }
  3202. if (row.w2 == '') { row.w2 = 0 }
  3203. if (row.w3 == '') { row.w3 = 0 }
  3204. if (row.w4 == '') { row.w4 = 0 }
  3205. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3206. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3207. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3208. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3209. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3210. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3211. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow3.dailyWeight)) {
  3212. 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')))
  3213. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3214. }
  3215. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3216. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3217. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3218. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3219. } else if (row.r1 !== 0 && row.r2 == 0) {
  3220. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3) - parseFloat(row.w4) - parseFloat(row.w1)), parseInt(Cookies.get('decimal')))
  3221. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3222. if (row.w1 == '') { row.w1 = 0 }
  3223. if (row.w2 == '') { row.w2 = 0 }
  3224. if (row.w3 == '') { row.w3 = 0 }
  3225. if (row.w4 == '') { row.w4 = 0 }
  3226. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3227. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3228. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3229. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3230. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3231. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3232. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow3.dailyWeight)) {
  3233. 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')))
  3234. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3235. }
  3236. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3237. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3238. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3239. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3240. } else {
  3241. 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')))
  3242. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3243. 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')))
  3244. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3245. }
  3246. if (isNaN(row.w1)) {
  3247. row.w1 = 0
  3248. row.r1 = 0
  3249. }
  3250. if (isNaN(row.w2)) {
  3251. row.w2 = 0
  3252. row.r2 = 0
  3253. }
  3254. if (row.w2 <= 0) {
  3255. row.w2 = 0
  3256. row.r2 = 0
  3257. }
  3258. if (row.w1 <= 0) {
  3259. row.w1 = 0
  3260. row.r1 = 0
  3261. }
  3262. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  3263. }
  3264. // 2班1班4班未锁
  3265. if (row.isTwoWeight == false && row.isOneWeight == false && row.isFourWeight == false) {
  3266. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3267. if (row.r1 == 0 && row.r2 == 0 && row.r4 == 0) {
  3268. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3)) / 3, parseInt(Cookies.get('decimal')))
  3269. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3270. row.w2 = row.w1
  3271. row.r2 = row.r1
  3272. row.w4 = row.w1
  3273. row.r4 = row.r1
  3274. } else if (row.r1 == 0 && row.r2 == 0 && row.r4 !== 0) {
  3275. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3) - parseFloat(row.w4)) / 2, parseInt(Cookies.get('decimal')))
  3276. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3277. row.w2 = row.w1
  3278. row.r2 = row.r1
  3279. if (row.w1 == '') { row.w1 = 0 }
  3280. if (row.w2 == '') { row.w2 = 0 }
  3281. if (row.w3 == '') { row.w3 = 0 }
  3282. if (row.w4 == '') { row.w4 = 0 }
  3283. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3284. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3285. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3286. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3287. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3288. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3289. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow3.dailyWeight)) {
  3290. 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')))
  3291. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3292. }
  3293. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3294. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3295. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3296. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3297. } else if (row.r1 == 0 && row.r2 !== 0 && row.r4 == 0) {
  3298. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3) - parseFloat(row.w2)) / 2, parseInt(Cookies.get('decimal')))
  3299. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3300. row.w4 = row.w1
  3301. row.r4 = row.r1
  3302. if (row.w1 == '') { row.w1 = 0 }
  3303. if (row.w2 == '') { row.w2 = 0 }
  3304. if (row.w3 == '') { row.w3 = 0 }
  3305. if (row.w4 == '') { row.w4 = 0 }
  3306. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3307. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3308. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3309. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3310. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3311. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3312. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow3.dailyWeight)) {
  3313. 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')))
  3314. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3315. }
  3316. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3317. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3318. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3319. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3320. } else if (row.r1 !== 0 && row.r2 == 0 && row.r4 == 0) {
  3321. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3) - parseFloat(row.w1)) / 2, parseInt(Cookies.get('decimal')))
  3322. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3323. row.w4 = row.w1
  3324. row.r4 = row.r1
  3325. if (row.w1 == '') { row.w1 = 0 }
  3326. if (row.w2 == '') { row.w2 = 0 }
  3327. if (row.w3 == '') { row.w3 = 0 }
  3328. if (row.w4 == '') { row.w4 = 0 }
  3329. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3330. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3331. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3332. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3333. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3334. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3335. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow3.dailyWeight)) {
  3336. 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')))
  3337. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3338. }
  3339. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3340. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3341. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3342. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3343. } else if (row.r1 !== 0 && row.r2 !== 0 && row.r4 == 0) {
  3344. row.w4 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3) - parseFloat(row.w1) - parseFloat(row.w2)), parseInt(Cookies.get('decimal')))
  3345. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3346. if (row.w1 == '') { row.w1 = 0 }
  3347. if (row.w2 == '') { row.w2 = 0 }
  3348. if (row.w3 == '') { row.w3 = 0 }
  3349. if (row.w4 == '') { row.w4 = 0 }
  3350. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3351. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3352. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3353. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3354. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3355. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3356. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow3.dailyWeight)) {
  3357. 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')))
  3358. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3359. 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')))
  3360. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3361. }
  3362. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3363. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3364. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3365. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3366. } else if (row.r1 !== 0 && row.r2 == 0 && row.r4 !== 0) {
  3367. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3) - parseFloat(row.w1) - parseFloat(row.w4)), parseInt(Cookies.get('decimal')))
  3368. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3369. if (row.w1 == '') { row.w1 = 0 }
  3370. if (row.w2 == '') { row.w2 = 0 }
  3371. if (row.w3 == '') { row.w3 = 0 }
  3372. if (row.w4 == '') { row.w4 = 0 }
  3373. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3374. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3375. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3376. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3377. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3378. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3379. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow3.dailyWeight)) {
  3380. 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')))
  3381. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3382. 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')))
  3383. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3384. }
  3385. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3386. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3387. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3388. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3389. } else if (row.r1 == 0 && row.r2 !== 0 && row.r4 !== 0) {
  3390. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3) - parseFloat(row.w2) - parseFloat(row.w4)), parseInt(Cookies.get('decimal')))
  3391. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3392. if (row.w1 == '') { row.w1 = 0 }
  3393. if (row.w2 == '') { row.w2 = 0 }
  3394. if (row.w3 == '') { row.w3 = 0 }
  3395. if (row.w4 == '') { row.w4 = 0 }
  3396. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3397. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3398. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3399. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3400. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3401. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3402. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow3.dailyWeight)) {
  3403. 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')))
  3404. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3405. 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')))
  3406. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3407. }
  3408. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3409. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3410. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3411. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3412. } else {
  3413. 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')))
  3414. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3415. 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')))
  3416. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3417. 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')))
  3418. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3419. }
  3420. if (isNaN(row.w1)) {
  3421. row.w1 = 0
  3422. row.r1 = 0
  3423. }
  3424. if (isNaN(row.w2)) {
  3425. row.w2 = 0
  3426. row.r2 = 0
  3427. }
  3428. if (isNaN(row.w4)) {
  3429. row.w4 = 0
  3430. row.r4 = 0
  3431. }
  3432. if (row.w1 <= 0) {
  3433. row.w1 = 0
  3434. row.r1 = 0
  3435. }
  3436. if (row.w2 <= 0) {
  3437. row.w2 = 0
  3438. row.r2 = 0
  3439. }
  3440. if (row.w4 <= 0) {
  3441. row.w4 = 0
  3442. row.r4 = 0
  3443. }
  3444. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  3445. }
  3446. } else if (this.table.RWLength == 3) {
  3447. // 三班
  3448. // 1班/2班锁定
  3449. if (row.isOneWeight == true && row.isTwoWeight == true) {
  3450. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3451. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3), parseInt(Cookies.get('decimal'))))
  3452. }
  3453. // 1班不锁2班锁
  3454. if (row.isOneWeight == false && row.isTwoWeight == true) {
  3455. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3456. row.w1 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w2) - parseFloat(row.w3), parseInt(Cookies.get('decimal')))
  3457. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3458. if (row.w1 <= 0) {
  3459. row.w1 = 0
  3460. row.r1 = 0
  3461. }
  3462. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3), parseInt(Cookies.get('decimal'))))
  3463. }
  3464. // 3班不锁2班锁
  3465. // 2班不锁1班锁
  3466. if (row.isOneWeight == true && row.isTwoWeight == false) {
  3467. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3468. row.w2 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w3), parseInt(Cookies.get('decimal')))
  3469. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3470. if (row.w2 <= 0) {
  3471. row.w2 = 0
  3472. row.r2 = 0
  3473. }
  3474. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3), parseInt(Cookies.get('decimal'))))
  3475. }
  3476. // 2班3班都不锁
  3477. // 1班2班都不锁
  3478. if (row.isOneWeight == false && row.isTwoWeight == false) {
  3479. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3480. if (row.r1 == 0 && row.r2 == 0) {
  3481. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3)) / 2, parseInt(Cookies.get('decimal')))
  3482. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3483. row.w2 = row.w1
  3484. row.r2 = row.r1
  3485. } else if (row.r1 == 0 && row.r2 !== 0) {
  3486. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3) - parseFloat(row.w2)), parseInt(Cookies.get('decimal')))
  3487. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3488. if (row.w1 == '') { row.w1 = 0 }
  3489. if (row.w2 == '') { row.w2 = 0 }
  3490. if (row.w3 == '') { row.w3 = 0 }
  3491. if (row.w4 == '') { row.w4 = 0 }
  3492. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3493. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3494. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3495. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3496. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3497. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3498. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow3.dailyWeight)) {
  3499. row.w2 = formatNum((parseFloat(this.focusWRow3.dailyWeight) - parseFloat(row.w3)) * parseFloat(row.r2) / (parseFloat(this.focusWRow3.r1) + parseFloat(row.r2)), parseInt(Cookies.get('decimal')))
  3500. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3501. }
  3502. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3503. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3504. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3505. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3506. } else if (row.r1 !== 0 && row.r2 == 0) {
  3507. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3) - parseFloat(row.w1)), parseInt(Cookies.get('decimal')))
  3508. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3509. if (row.w1 == '') { row.w1 = 0 }
  3510. if (row.w2 == '') { row.w2 = 0 }
  3511. if (row.w3 == '') { row.w3 = 0 }
  3512. if (row.w4 == '') { row.w4 = 0 }
  3513. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3514. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3515. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3516. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3517. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3518. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3519. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow3.dailyWeight)) {
  3520. row.w1 = formatNum((parseFloat(this.focusWRow3.dailyWeight) - parseFloat(row.w3)) * parseFloat(row.r1) / (parseFloat(row.r1) + parseFloat(row.r2)), parseInt(Cookies.get('decimal')))
  3521. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3522. }
  3523. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3524. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3525. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3526. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3527. } else {
  3528. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3)) * parseFloat(row.r1) / (parseFloat(row.r1) + parseFloat(row.r2)), parseInt(Cookies.get('decimal')))
  3529. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3530. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w3)) * parseFloat(row.r2) / (parseFloat(this.focusWRow3.r1) + parseFloat(row.r2)), parseInt(Cookies.get('decimal')))
  3531. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3532. }
  3533. if (isNaN(row.w1)) {
  3534. row.w1 = 0
  3535. row.r1 = 0
  3536. }
  3537. if (isNaN(row.w2)) {
  3538. row.w2 = 0
  3539. row.r2 = 0
  3540. }
  3541. if (row.w1 <= 0) {
  3542. row.w1 = 0
  3543. row.r1 = 0
  3544. }
  3545. if (row.w2 <= 0) {
  3546. row.w2 = 0
  3547. row.r2 = 0
  3548. }
  3549. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3), parseInt(Cookies.get('decimal'))))
  3550. }
  3551. }
  3552. if (row.w1 == '') { row.w1 = 0 }
  3553. if (row.w2 == '') { row.w2 = 0 }
  3554. if (row.w3 == '') { row.w3 = 0 }
  3555. if (row.w4 == '') { row.w4 = 0 }
  3556. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3557. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3558. },
  3559. blurW4(row) {
  3560. if (row.w1 == '') {
  3561. row.w1 = 0
  3562. }
  3563. if (row.w2 == '') {
  3564. row.w2 = 0
  3565. }
  3566. if (row.w3 == '') {
  3567. row.w3 = 0
  3568. }
  3569. if (row.w4 == '') {
  3570. row.w4 = 0
  3571. }
  3572. if (row.r1 == '') {
  3573. row.r1 = 0
  3574. }
  3575. if (row.r2 == '') {
  3576. row.r2 = 0
  3577. }
  3578. if (row.r3 == '') {
  3579. row.r3 = 0
  3580. }
  3581. if (row.r4 == '') {
  3582. row.r4 = 0
  3583. }
  3584. // row.ftweight = parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4)
  3585. console.log(row, '=======投喂量feedweight')
  3586. // isOneWeight,isTwoWeight,isThreeWeight,isFourWeight
  3587. if (this.table.RWLength == 4) {
  3588. // 四班
  3589. // 1班2班3班都锁定
  3590. if (row.isOneWeight == true && row.isTwoWeight == true && row.isThreeWeight == true) {
  3591. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3592. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  3593. }
  3594. // 2班3班锁定1班未锁定
  3595. if (row.isOneWeight == false && row.isTwoWeight == true && row.isThreeWeight == true) {
  3596. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3597. row.w1 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w2) - parseFloat(row.w3), parseInt(Cookies.get('decimal')))
  3598. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3599. if (row.w1 <= 0) {
  3600. row.w1 = 0
  3601. row.r1 = 0
  3602. }
  3603. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  3604. }
  3605. // 2班1班锁定3班未锁定
  3606. if (row.isOneWeight == true && row.isTwoWeight == true && row.isThreeWeight == false) {
  3607. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3608. row.w3 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w2) - parseFloat(row.w4), parseInt(Cookies.get('decimal')))
  3609. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3610. if (row.w3 <= 0) {
  3611. row.w3 = 0
  3612. row.r3 = 0
  3613. }
  3614. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  3615. }
  3616. // 3班1班锁定2班未锁定
  3617. if (row.isOneWeight == true && row.isTwoWeight == false && row.isThreeWeight == true) {
  3618. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3619. row.w2 = formatNum(parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w3) - parseFloat(row.w4), parseInt(Cookies.get('decimal')))
  3620. row.r2 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  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) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  3626. }
  3627. // 2班锁定,3班1班未锁
  3628. if (row.isOneWeight == false && row.isTwoWeight == true && row.isThreeWeight == false) {
  3629. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3630. if (row.r1 == 0 && row.r3 == 0) {
  3631. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w2)) / 2, parseInt(Cookies.get('decimal')))
  3632. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3633. row.w3 = row.w1
  3634. row.r3 = row.r1
  3635. } else if (row.r1 == 0 && row.r3 !== 0) {
  3636. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w2) - parseFloat(row.w3)), parseInt(Cookies.get('decimal')))
  3637. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3638. if (row.w1 == '') { row.w1 = 0 }
  3639. if (row.w2 == '') { row.w2 = 0 }
  3640. if (row.w3 == '') { row.w3 = 0 }
  3641. if (row.w4 == '') { row.w4 = 0 }
  3642. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3643. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3644. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3645. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3646. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3647. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3648. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow4.dailyWeight)) {
  3649. 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')))
  3650. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3651. }
  3652. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3653. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3654. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3655. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3656. } else if (row.r1 !== 0 && row.r3 == 0) {
  3657. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w2) - parseFloat(row.w1)), parseInt(Cookies.get('decimal')))
  3658. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3659. if (row.w1 == '') { row.w1 = 0 }
  3660. if (row.w2 == '') { row.w2 = 0 }
  3661. if (row.w3 == '') { row.w3 = 0 }
  3662. if (row.w4 == '') { row.w4 = 0 }
  3663. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3664. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3665. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3666. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3667. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3668. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3669. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow4.dailyWeight)) {
  3670. 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')))
  3671. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3672. }
  3673. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3674. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3675. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3676. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3677. } else {
  3678. 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')))
  3679. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3680. 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')))
  3681. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3682. }
  3683. if (isNaN(row.w1)) {
  3684. row.w1 = 0
  3685. row.r1 = 0
  3686. }
  3687. if (isNaN(row.w3)) {
  3688. row.w3 = 0
  3689. row.r3 = 0
  3690. }
  3691. if (row.w3 <= 0) {
  3692. row.w3 = 0
  3693. row.r3 = 0
  3694. }
  3695. if (row.w1 <= 0) {
  3696. row.w1 = 0
  3697. row.r1 = 0
  3698. }
  3699. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  3700. }
  3701. // 3班锁定,2班1班未锁
  3702. if (row.isOneWeight == false && row.isTwoWeight == false && row.isThreeWeight == true) {
  3703. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3704. if (row.r1 == 0 && row.r2 == 0) {
  3705. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w3)) / 2, parseInt(Cookies.get('decimal')))
  3706. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3707. row.w2 = row.w1
  3708. row.r2 = row.r1
  3709. } else if (row.r1 == 0 && row.r2 !== 0) {
  3710. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w3) - parseFloat(row.w2)), parseInt(Cookies.get('decimal')))
  3711. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3712. if (row.w1 == '') { row.w1 = 0 }
  3713. if (row.w2 == '') { row.w2 = 0 }
  3714. if (row.w3 == '') { row.w3 = 0 }
  3715. if (row.w4 == '') { row.w4 = 0 }
  3716. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3717. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3718. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3719. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3720. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3721. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3722. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow4.dailyWeight)) {
  3723. 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')))
  3724. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3725. }
  3726. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3727. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3728. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3729. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3730. } else if (row.r1 !== 0 && row.r2 == 0) {
  3731. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w3) - parseFloat(row.w1)), parseInt(Cookies.get('decimal')))
  3732. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3733. if (row.w1 == '') { row.w1 = 0 }
  3734. if (row.w2 == '') { row.w2 = 0 }
  3735. if (row.w3 == '') { row.w3 = 0 }
  3736. if (row.w4 == '') { row.w4 = 0 }
  3737. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3738. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3739. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3740. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3741. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3742. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3743. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow4.dailyWeight)) {
  3744. 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')))
  3745. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3746. }
  3747. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3748. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3749. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3750. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3751. } else {
  3752. 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')))
  3753. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3754. 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')))
  3755. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3756. }
  3757. if (isNaN(row.w1)) {
  3758. row.w1 = 0
  3759. row.r1 = 0
  3760. }
  3761. if (isNaN(row.w2)) {
  3762. row.w2 = 0
  3763. row.r2 = 0
  3764. }
  3765. if (row.w2 <= 0) {
  3766. row.w2 = 0
  3767. row.r2 = 0
  3768. }
  3769. if (row.w1 <= 0) {
  3770. row.w1 = 0
  3771. row.r1 = 0
  3772. }
  3773. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  3774. }
  3775. // 1班锁定,2班3班未锁
  3776. if (row.isOneWeight == true && row.isTwoWeight == false && row.isThreeWeight == false) {
  3777. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3778. if (row.r2 == 0 && row.r3 == 0) {
  3779. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w4)) / 2, parseInt(Cookies.get('decimal')))
  3780. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3781. row.w3 = row.w2
  3782. row.r3 = row.r2
  3783. } else if (row.r2 == 0 && row.r3 !== 0) {
  3784. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w4) - parseFloat(row.w3)), parseInt(Cookies.get('decimal')))
  3785. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3786. if (row.w1 == '') { row.w1 = 0 }
  3787. if (row.w2 == '') { row.w2 = 0 }
  3788. if (row.w3 == '') { row.w3 = 0 }
  3789. if (row.w4 == '') { row.w4 = 0 }
  3790. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3791. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3792. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3793. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3794. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3795. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3796. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow4.dailyWeight)) {
  3797. 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')))
  3798. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3799. }
  3800. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3801. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3802. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3803. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3804. } else if (row.r2 !== 0 && row.r3 == 0) {
  3805. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w1) - parseFloat(row.w4) - parseFloat(row.w2)), parseInt(Cookies.get('decimal')))
  3806. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3807. if (row.w1 == '') { row.w1 = 0 }
  3808. if (row.w2 == '') { row.w2 = 0 }
  3809. if (row.w3 == '') { row.w3 = 0 }
  3810. if (row.w4 == '') { row.w4 = 0 }
  3811. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3812. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3813. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3814. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3815. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3816. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3817. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow4.dailyWeight)) {
  3818. 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')))
  3819. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3820. }
  3821. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3822. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3823. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3824. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3825. } else {
  3826. 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')))
  3827. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3828. 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')))
  3829. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3830. }
  3831. if (isNaN(row.w2)) {
  3832. row.w2 = 0
  3833. row.r2 = 0
  3834. }
  3835. if (isNaN(row.w3)) {
  3836. row.w3 = 0
  3837. row.r3 = 0
  3838. }
  3839. if (row.w2 <= 0) {
  3840. row.w2 = 0
  3841. row.r2 = 0
  3842. }
  3843. if (row.w3 <= 0) {
  3844. row.w3 = 0
  3845. row.r3 = 0
  3846. }
  3847. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  3848. }
  3849. // 2班3班1班未锁
  3850. if (row.isOneWeight == false && row.isTwoWeight == false && row.isThreeWeight == false) {
  3851. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3852. if (row.r1 == 0 && row.r2 == 0 && row.r3 == 0) {
  3853. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4)) / 3, parseInt(Cookies.get('decimal')))
  3854. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3855. row.w2 = row.w1
  3856. row.r2 = row.r1
  3857. row.w3 = row.w1
  3858. row.r3 = row.r1
  3859. } else if (row.r1 == 0 && row.r2 == 0 && row.r3 !== 0) {
  3860. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w3)) / 2, parseInt(Cookies.get('decimal')))
  3861. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3862. row.w2 = row.w1
  3863. row.r2 = row.r1
  3864. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3865. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3866. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3867. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3868. if (row.w1 == '') { row.w1 = 0 }
  3869. if (row.w2 == '') { row.w2 = 0 }
  3870. if (row.w3 == '') { row.w3 = 0 }
  3871. if (row.w4 == '') { row.w4 = 0 }
  3872. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3873. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3874. console.log(row.dailyWeight)
  3875. console.log(this.focusWRow4.dailyWeight)
  3876. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow4.dailyWeight)) {
  3877. 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')))
  3878. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3879. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3880. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3881. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3882. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3883. }
  3884. } else if (row.r1 == 0 && row.r2 !== 0 && row.r3 == 0) {
  3885. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w2)) / 2, parseInt(Cookies.get('decimal')))
  3886. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3887. row.w3 = row.w1
  3888. row.r3 = row.r1
  3889. if (row.w1 == '') { row.w1 = 0 }
  3890. if (row.w2 == '') { row.w2 = 0 }
  3891. if (row.w3 == '') { row.w3 = 0 }
  3892. if (row.w4 == '') { row.w4 = 0 }
  3893. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3894. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3895. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3896. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3897. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3898. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3899. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow4.dailyWeight)) {
  3900. 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')))
  3901. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3902. }
  3903. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3904. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3905. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3906. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3907. } else if (row.r1 !== 0 && row.r2 == 0 && row.r3 == 0) {
  3908. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w1)) / 2, parseInt(Cookies.get('decimal')))
  3909. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3910. row.w3 = row.w1
  3911. row.r3 = row.r1
  3912. if (row.w1 == '') { row.w1 = 0 }
  3913. if (row.w2 == '') { row.w2 = 0 }
  3914. if (row.w3 == '') { row.w3 = 0 }
  3915. if (row.w4 == '') { row.w4 = 0 }
  3916. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3917. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3918. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3919. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3920. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3921. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3922. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow4.dailyWeight)) {
  3923. 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')))
  3924. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3925. }
  3926. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3927. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3928. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3929. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3930. } else if (row.r1 !== 0 && row.r2 !== 0 && row.r3 == 0) {
  3931. row.w3 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w1) - parseFloat(row.w2)), parseInt(Cookies.get('decimal')))
  3932. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3933. if (row.w1 == '') { row.w1 = 0 }
  3934. if (row.w2 == '') { row.w2 = 0 }
  3935. if (row.w3 == '') { row.w3 = 0 }
  3936. if (row.w4 == '') { row.w4 = 0 }
  3937. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3938. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3939. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3940. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3941. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3942. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3943. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow4.dailyWeight)) {
  3944. 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')))
  3945. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3946. 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')))
  3947. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3948. }
  3949. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3950. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3951. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3952. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3953. } else if (row.r1 !== 0 && row.r2 == 0 && row.r3 !== 0) {
  3954. row.w2 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w1) - parseFloat(row.w3)), parseInt(Cookies.get('decimal')))
  3955. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3956. if (row.w1 == '') { row.w1 = 0 }
  3957. if (row.w2 == '') { row.w2 = 0 }
  3958. if (row.w3 == '') { row.w3 = 0 }
  3959. if (row.w4 == '') { row.w4 = 0 }
  3960. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3961. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3962. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3963. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3964. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3965. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3966. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow4.dailyWeight)) {
  3967. 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')))
  3968. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3969. 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')))
  3970. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3971. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3972. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3973. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3974. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3975. }
  3976. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3977. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3978. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3979. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3980. } else if (row.r1 == 0 && row.r2 !== 0 && row.r3 !== 0) {
  3981. row.w1 = formatNum((parseFloat(row.dailyWeight) - parseFloat(row.w4) - parseFloat(row.w2) - parseFloat(row.w3)), parseInt(Cookies.get('decimal')))
  3982. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3983. if (row.w1 == '') { row.w1 = 0 }
  3984. if (row.w2 == '') { row.w2 = 0 }
  3985. if (row.w3 == '') { row.w3 = 0 }
  3986. if (row.w4 == '') { row.w4 = 0 }
  3987. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3988. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  3989. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  3990. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  3991. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  3992. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  3993. if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow4.dailyWeight)) {
  3994. 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')))
  3995. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3996. 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')))
  3997. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  3998. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  3999. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  4000. if (row.w3 <= 0) { row.w3 = 0; row.r3 = 0 }
  4001. if (row.w4 <= 0) { row.w4 = 0; row.r4 = 0 }
  4002. }
  4003. } else {
  4004. 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')))
  4005. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  4006. 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')))
  4007. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  4008. 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')))
  4009. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
  4010. }
  4011. if (isNaN(row.w1)) {
  4012. row.w1 = 0
  4013. row.r1 = 0
  4014. }
  4015. if (isNaN(row.w2)) {
  4016. row.w2 = 0
  4017. row.r2 = 0
  4018. }
  4019. if (isNaN(row.w3)) {
  4020. row.w3 = 0
  4021. row.r3 = 0
  4022. }
  4023. if (row.w1 <= 0) {
  4024. row.w1 = 0
  4025. row.r1 = 0
  4026. }
  4027. if (row.w2 <= 0) {
  4028. row.w2 = 0
  4029. row.r2 = 0
  4030. }
  4031. if (row.w3 <= 0) {
  4032. row.w3 = 0
  4033. row.r3 = 0
  4034. }
  4035. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
  4036. }
  4037. }
  4038. if (row.w1 == '') { row.w1 = 0 }
  4039. if (row.w2 == '') { row.w2 = 0 }
  4040. if (row.w3 == '') { row.w3 = 0 }
  4041. if (row.w4 == '') { row.w4 = 0 }
  4042. this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
  4043. row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
  4044. },
  4045. // 编辑
  4046. handleUpdate(row) {
  4047. console.log(row)
  4048. for (let i = 0; i < this.table.list.length; i++) {
  4049. if (this.table.list[i].Edit == true) {
  4050. this.$message({ type: 'error', message: '当前内容未保存,请点击取消或保存继续进行操作', duration: 2000 })
  4051. return false
  4052. }
  4053. }
  4054. // 编辑true,不可编辑false
  4055. row.Edit = true
  4056. row.NoEdit = false
  4057. // 编辑false,编辑保存true
  4058. row.isUpdate = false
  4059. row.isUpdateSave = true
  4060. row.ftid = String(row.ftid)
  4061. if (row.ptsfid == '-1') {
  4062. row.ptsfid = ''
  4063. }
  4064. row.ptsfid = String(row.ptsfid)
  4065. // dryweight
  4066. this.table.temp.ftid = row.ftid
  4067. this.table.temp.ftname = row.ftname
  4068. this.table.temp.ptsfid = row.ptsfid
  4069. this.table.temp.ptsfname = row.ptsfname
  4070. },
  4071. updateData(row) {
  4072. console.log(row)
  4073. if (row.r1 == 'NaN') { this.$set(row, 'r1', 0) }
  4074. if (row.r2 == 'NaN') { this.$set(row, 'r2', 0) }
  4075. if (row.r3 == 'NaN') { this.$set(row, 'r3', 0) }
  4076. if (row.r4 == 'NaN') { this.$set(row, 'r4', 0) }
  4077. if (row.w1 == 'NaN') { this.$set(row, 'w1', 0) }
  4078. if (row.w2 == 'NaN') { this.$set(row, 'w2', 0) }
  4079. if (row.w3 == 'NaN') { this.$set(row, 'w3', 0) }
  4080. if (row.w4 == 'NaN') { this.$set(row, 'w4', 0) }
  4081. console.log(row)
  4082. var arr = []
  4083. for (let i = 1; i <= this.table.RWLength; i++) {
  4084. var obj = {}
  4085. obj['times'] = i
  4086. obj['pastureid'] = row.pastureid
  4087. obj['barid'] = row.barid
  4088. obj['cowcount'] = row.ccount
  4089. obj['ccountradio'] = row.ccountradio
  4090. obj['ptid'] = row.ftid
  4091. if (row.ptsfid !== '') {
  4092. obj['ptsid'] = row.ptsfid
  4093. } else {
  4094. obj['ptsid'] = '-1'
  4095. }
  4096. obj['weight'] = row['w' + i]
  4097. obj['tratio'] = Math.round(row['r' + i])
  4098. arr.push(obj)
  4099. }
  4100. if (this.table.isPtsfname == 0) {
  4101. row.ptsfid = '-1'
  4102. row.ptsfname = ''
  4103. } else {
  4104. if (row.ptsfid == '') {
  4105. row.ptsfid = '-1'
  4106. row.ptsfname = ''
  4107. }
  4108. }
  4109. if (row.supplyweight == '') {
  4110. row.supplyweight = '0'
  4111. }
  4112. if (this.table.isPtsfname == false) {
  4113. row.supplyweight = '0'
  4114. }
  4115. console.log(row, '============')
  4116. this.$set(row, 'ratio', Math.floor(parseFloat(row.ratio) * 100) / 100)
  4117. this.$set(row, 'ccountratio', Math.floor(parseFloat(row.ccountratio) * 100) / 100)
  4118. row.ratio = String(row.ratio)
  4119. row.ccountratio = String(row.ccountratio)
  4120. row.sumr = Math.round(row.sumr)
  4121. this.table.rwList = arr
  4122. console.log('点击了编辑保存', row)
  4123. this.table.temp.pastureid = row.pastureid
  4124. this.table.temp.id = row.id
  4125. this.table.temp.barname = row.barname
  4126. this.table.temp.barid = row.barid
  4127. this.table.temp.ccount = row.ccount
  4128. this.table.temp.ratio = row.ratio
  4129. this.table.temp.ccountratio = row.ccountratio
  4130. this.table.temp.ftid = row.ftid
  4131. this.table.temp.ftname = row.ftname
  4132. this.table.temp.ptsfid = row.ptsfid
  4133. this.table.temp.ptsfname = row.ptsfname
  4134. this.table.temp.ftweight = row.ftweight
  4135. this.table.temp.supplyweight = row.supplyweight
  4136. this.table.temp.feedweight = row.feedweight
  4137. this.table.temp.owner = row.owner
  4138. this.table.temp.sumr = row.sumr
  4139. if (row.softccount == '') {
  4140. row.softccount = 0
  4141. }
  4142. if (row.r1 == '') {
  4143. row.r1 = 0
  4144. }
  4145. if (row.r2 == '') {
  4146. row.r2 = 0
  4147. }
  4148. if (row.r3 == '') {
  4149. row.r3 = 0
  4150. }
  4151. if (row.r4 == '') {
  4152. row.r4 = 0
  4153. }
  4154. if (row.w1 == '') {
  4155. row.w1 = 0
  4156. }
  4157. if (row.w2 == '' || row.w4 == NaN) {
  4158. row.w2 = 0
  4159. }
  4160. if (row.w3 == '' || row.w4 == NaN) {
  4161. row.w3 = 0
  4162. }
  4163. if (row.w4 == '' || row.w4 == NaN) {
  4164. row.w4 = 0
  4165. }
  4166. console.log(row, '===========')
  4167. this.table.temp.softccount = row.softccount
  4168. this.table.temp.r1 = Math.round(row.r1)
  4169. this.table.temp.r2 = Math.round(row.r2)
  4170. this.table.temp.r3 = Math.round(row.r3)
  4171. this.table.temp.r4 = Math.round(row.r4)
  4172. this.table.temp.w1 = row.w1
  4173. this.table.temp.w2 = row.w2
  4174. this.table.temp.w3 = row.w3
  4175. this.table.temp.w4 = row.w4
  4176. if (this.table.temp.ccount == '' && this.table.temp.ratio == '' && this.table.temp.ccountratio == '' && this.table.temp.ftid == '') {
  4177. this.$message({ type: 'error', message: '实际牛头数/系数/系数头数/配方模版不能为空', duration: 2000 })
  4178. return false
  4179. }
  4180. if (this.table.temp.ratio == '' && this.table.temp.ccountratio == '' && this.table.temp.ftid == '') {
  4181. this.$message({ type: 'error', message: '系数/系数头数/配方模版不能为空', duration: 2000 })
  4182. return false
  4183. }
  4184. if (this.table.temp.ccountratio == '' && this.table.temp.ftid == '') {
  4185. this.$message({ type: 'error', message: '系数头数/配方模版不能为空', duration: 2000 })
  4186. return false
  4187. }
  4188. console.log(this.table.temp.ccount, '实际牛头数不能为空')
  4189. if (this.table.temp.ccount === '') {
  4190. this.$message({ type: 'error', message: '实际牛头数不能为空', duration: 2000 })
  4191. return false
  4192. }
  4193. if (this.table.temp.ratio === '') {
  4194. this.$message({ type: 'error', message: '系数不能为空', duration: 2000 })
  4195. return false
  4196. }
  4197. if (this.table.temp.ccountratio === '') {
  4198. this.$message({ type: 'error', message: '系数头数不能为空', duration: 2000 })
  4199. return false
  4200. }
  4201. if (this.table.temp.ftid == '') {
  4202. this.$message({ type: 'error', message: '配方模版不能为空', duration: 2000 })
  4203. return false
  4204. }
  4205. const positiveInteger = /^[0-9]\d*$/
  4206. if (!positiveInteger.test(parseFloat(this.table.temp.ccount))) {
  4207. this.$message({
  4208. type: 'error',
  4209. message: '实际牛头数请输入正整数',
  4210. duration: 2000
  4211. })
  4212. return false
  4213. }
  4214. this.isokDisable = true
  4215. setTimeout(() => {
  4216. this.isokDisable = false
  4217. }, 1000)
  4218. // this.requestParam.parammaps = this.table.temp
  4219. this.requestParam.common = {
  4220. 'returnmap': '0'
  4221. }
  4222. this.requestParam.data = []
  4223. this.requestParam.data[0] = { 'name': 'updateBigFP', 'type': 'e', 'parammaps': {
  4224. pastureid: row.pastureid,
  4225. id: row.id,
  4226. barname: row.barname,
  4227. barid: row.barid,
  4228. softccount: row.softccount,
  4229. ccount: row.ccount,
  4230. ratio: row.ratio,
  4231. ccountratio: row.ccountratio,
  4232. ftid: row.ftid,
  4233. ftname: row.ftname,
  4234. ptsfid: row.ptsfid,
  4235. ptsfname: row.ptsfname,
  4236. ftweight: row.ftweight,
  4237. supplyweight: row.supplyweight,
  4238. feedweight: row.feedweight,
  4239. owner: row.owner,
  4240. sumr: row.sumr
  4241. }}
  4242. this.requestParam.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.table.rwList }}
  4243. this.requestParam.data[1].children = []
  4244. this.requestParam.data[1].children[0] = { 'name': 'updateBigFPDetail', 'type': 'e', 'parammaps': {
  4245. pastureid: '@insertSpotList.pastureid',
  4246. barname: row.barname,
  4247. barid: '@insertSpotList.barid',
  4248. times: '@insertSpotList.times',
  4249. tratio: '@insertSpotList.tratio',
  4250. weight: '@insertSpotList.weight',
  4251. cowcount: '@insertSpotList.cowcount',
  4252. ccountradio: row.ccountratio,
  4253. ptid: '@insertSpotList.ptid',
  4254. ptsid: '@insertSpotList.ptsid',
  4255. feedweight: row.feedweight,
  4256. supplyweight: row.supplyweight,
  4257. ratio: row.ratio
  4258. }}
  4259. this.requestParam.data[2] = { 'name': 'updateLPPbyFPChange', 'type': 'e', 'parammaps': {
  4260. pastureid: row.pastureid,
  4261. fpid: row.id
  4262. }}
  4263. ExecDataByConfig(this.requestParam).then(response => {
  4264. console.log('编辑保存发送参数', this.requestParam)
  4265. if (response.msg === 'fail') {
  4266. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  4267. } else {
  4268. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  4269. // this.reload()
  4270. this.getList()
  4271. for (let i = 0; i < this.headerList.length; i++) {
  4272. if (this.headerList[i].target.className == 'el-icon-lock') {
  4273. this.headerList[i].target.className = 'el-icon-unlock'
  4274. this.$set(this.headerList[i].target, 'className', 'el-icon-unlock')
  4275. }
  4276. }
  4277. }
  4278. })
  4279. },
  4280. updateCancel(row) {
  4281. console.log('点击了编辑取消')
  4282. // 编辑false,不可编辑true
  4283. row.Edit = false
  4284. row.NoEdit = true
  4285. // 编辑true,编辑保存false
  4286. row.isUpdate = true
  4287. row.isUpdateSave = false
  4288. // this.reload()
  4289. for (let i = 0; i < this.headerList.length; i++) {
  4290. if (this.headerList[i].target.className == 'el-icon-lock') {
  4291. this.headerList[i].target.className = 'el-icon-unlock'
  4292. this.$set(this.headerList[i].target, 'className', 'el-icon-unlock')
  4293. }
  4294. }
  4295. console.log(this.table.getdataListParm.offset)
  4296. this.table.getdataListParm.offset = this.table.getdataListParm.offset
  4297. this.getList()
  4298. // this.$router.push('/formulationPlan/dhedFormula')
  4299. },
  4300. cellClick(row, column, event) {
  4301. console.log(column)
  4302. },
  4303. handleSelect(val) {
  4304. console.log('勾选数据', val)
  4305. this.selectList = val
  4306. },
  4307. // 营养评估
  4308. handleNutritional() {
  4309. console.log('点击了营养评估')
  4310. this.dialogFull = false
  4311. if (this.selectList.length !== 1) {
  4312. this.$message({ type: 'error', message: '请选择一条栏舍信息进行营养评估', duration: 2000 })
  4313. return false
  4314. } else {
  4315. console.log(this.nutritional.temp)
  4316. this.nutritional.dialogStatus = 'Nutritional'
  4317. this.nutritional.activeName = 'first'
  4318. this.nutritional.dialogFormVisible = true
  4319. this.nutritional.tab1.getdataListParm1.parammaps.pastureid = this.selectList[0].pastureid
  4320. this.nutritional.tab1.getdataListParm1.parammaps.barid = this.selectList[0].barid
  4321. this.getNutritionalList()
  4322. this.nutritional.tab1.list = []
  4323. }
  4324. },
  4325. tableRowClassName({ row }) {
  4326. // console.log(row)
  4327. if (row.isColor == '0') {
  4328. return 'red-row'
  4329. } else {
  4330. return ''
  4331. }
  4332. },
  4333. handleNutritionalTab(item) {
  4334. if (item == 'first ') {
  4335. this.nutritional.tab1.getdataListParm1.parammaps.pastureid = this.selectList[0].pastureid
  4336. this.nutritional.tab1.getdataListParm1.parammaps.barid = this.selectList[0].barid
  4337. this.getNutritionalList()
  4338. this.nutritional.tab1.list = []
  4339. } else {
  4340. console.log('牛群评估')
  4341. this.nutritional.tab2.getdataListParm1.parammaps.pastureid = this.selectList[0].pastureid
  4342. this.nutritional.tab2.getdataListParm1.parammaps.barid = this.selectList[0].barid
  4343. this.nutritional.tab2.getdataListParm1.parammaps.startTime = parseTime(this.nutritional.tab2.inputDatetime[0], '{y}-{m}-{d}')
  4344. this.nutritional.tab2.getdataListParm1.parammaps.stopTime = parseTime(this.nutritional.tab2.inputDatetime[1], '{y}-{m}-{d}')
  4345. this.nutritional.tab2.getdataListParm2.parammaps.pastureid = this.nutritional.tab2.getdataListParm1.parammaps.pastureid
  4346. this.nutritional.tab2.getdataListParm2.parammaps.barid = this.nutritional.tab2.getdataListParm1.parammaps.barid
  4347. this.nutritional.tab2.getdataListParm2.parammaps.startTime = this.nutritional.tab2.getdataListParm1.parammaps.startTime
  4348. this.nutritional.tab2.getdataListParm2.parammaps.stopTime = this.nutritional.tab2.getdataListParm1.parammaps.stopTime
  4349. this.nutritional.tab2.getdataListParm3.parammaps.pastureid = this.nutritional.tab2.getdataListParm1.parammaps.pastureid
  4350. this.nutritional.tab2.getdataListParm3.parammaps.barid = this.nutritional.tab2.getdataListParm1.parammaps.barid
  4351. this.nutritional.tab2.getdataListParm3.parammaps.startTime = this.nutritional.tab2.getdataListParm1.parammaps.startTime
  4352. this.nutritional.tab2.getdataListParm3.parammaps.stopTime = this.nutritional.tab2.getdataListParm1.parammaps.stopTime
  4353. this.nutritional.tab2.getdataListParm4.parammaps.pastureid = this.nutritional.tab2.getdataListParm1.parammaps.pastureid
  4354. this.nutritional.tab2.getdataListParm4.parammaps.barid = this.nutritional.tab2.getdataListParm1.parammaps.barid
  4355. this.nutritional.tab2.getdataListParm4.parammaps.startTime = this.nutritional.tab2.getdataListParm1.parammaps.startTime
  4356. this.nutritional.tab2.getdataListParm4.parammaps.stopTime = this.nutritional.tab2.getdataListParm1.parammaps.stopTime
  4357. this.getTab2NutritionalList1()
  4358. this.getTab2NutritionalList2()
  4359. this.getTab2NutritionalList3()
  4360. this.getTab2NutritionalList4()
  4361. }
  4362. },
  4363. changeTab2Date() {
  4364. this.nutritional.tab2.getdataListParm1.parammaps.pastureid = this.selectList[0].pastureid
  4365. this.nutritional.tab2.getdataListParm1.parammaps.barid = this.selectList[0].barid
  4366. this.nutritional.tab2.getdataListParm1.parammaps.startTime = parseTime(this.nutritional.tab2.inputDatetime[0], '{y}-{m}-{d}')
  4367. this.nutritional.tab2.getdataListParm1.parammaps.stopTime = parseTime(this.nutritional.tab2.inputDatetime[1], '{y}-{m}-{d}')
  4368. this.nutritional.tab2.getdataListParm2.parammaps.pastureid = this.nutritional.tab2.getdataListParm1.parammaps.pastureid
  4369. this.nutritional.tab2.getdataListParm2.parammaps.barid = this.nutritional.tab2.getdataListParm1.parammaps.barid
  4370. this.nutritional.tab2.getdataListParm2.parammaps.startTime = this.nutritional.tab2.getdataListParm1.parammaps.startTime
  4371. this.nutritional.tab2.getdataListParm2.parammaps.stopTime = this.nutritional.tab2.getdataListParm1.parammaps.stopTime
  4372. this.nutritional.tab2.getdataListParm3.parammaps.pastureid = this.nutritional.tab2.getdataListParm1.parammaps.pastureid
  4373. this.nutritional.tab2.getdataListParm3.parammaps.barid = this.nutritional.tab2.getdataListParm1.parammaps.barid
  4374. this.nutritional.tab2.getdataListParm3.parammaps.startTime = this.nutritional.tab2.getdataListParm1.parammaps.startTime
  4375. this.nutritional.tab2.getdataListParm3.parammaps.stopTime = this.nutritional.tab2.getdataListParm1.parammaps.stopTime
  4376. this.nutritional.tab2.getdataListParm4.parammaps.pastureid = this.nutritional.tab2.getdataListParm1.parammaps.pastureid
  4377. this.nutritional.tab2.getdataListParm4.parammaps.barid = this.nutritional.tab2.getdataListParm1.parammaps.barid
  4378. this.nutritional.tab2.getdataListParm4.parammaps.startTime = this.nutritional.tab2.getdataListParm1.parammaps.startTime
  4379. this.nutritional.tab2.getdataListParm4.parammaps.stopTime = this.nutritional.tab2.getdataListParm1.parammaps.stopTime
  4380. this.getTab2NutritionalList1()
  4381. this.getTab2NutritionalList2()
  4382. this.getTab2NutritionalList3()
  4383. this.getTab2NutritionalList4()
  4384. },
  4385. handleBefore() {
  4386. if (this.nutritional.activeName == 'first') {
  4387. if (this.nutritional.tab1.inputDatetime !== '' && this.nutritional.tab1.inputDatetime !== null) {
  4388. var start = new Date(this.nutritional.tab1.inputDatetime[0].setDate(this.nutritional.tab1.inputDatetime[0].getDate() - 1))
  4389. var stop = new Date(this.nutritional.tab1.inputDatetime[1].setDate(this.nutritional.tab1.inputDatetime[1].getDate() - 1))
  4390. this.nutritional.tab1.inputDatetime.length = 0
  4391. this.nutritional.tab1.inputDatetime.push(start, stop)
  4392. this.$forceUpdate()
  4393. }
  4394. } else {
  4395. var start2 = new Date(this.nutritional.tab2.inputDatetime[0].setDate(this.nutritional.tab2.inputDatetime[0].getDate() - 1))
  4396. var stop2 = new Date(this.nutritional.tab2.inputDatetime[1].setDate(this.nutritional.tab2.inputDatetime[1].getDate() - 1))
  4397. this.nutritional.tab2.inputDatetime.length = 0
  4398. this.nutritional.tab2.inputDatetime.push(start2, stop2)
  4399. this.$forceUpdate()
  4400. this.nutritional.tab2.getdataListParm1.parammaps.pastureid = this.selectList[0].pastureid
  4401. this.nutritional.tab2.getdataListParm1.parammaps.barid = this.selectList[0].barid
  4402. this.nutritional.tab2.getdataListParm1.parammaps.startTime = parseTime(this.nutritional.tab2.inputDatetime[0], '{y}-{m}-{d}')
  4403. this.nutritional.tab2.getdataListParm1.parammaps.stopTime = parseTime(this.nutritional.tab2.inputDatetime[1], '{y}-{m}-{d}')
  4404. this.nutritional.tab2.getdataListParm2.parammaps.pastureid = this.nutritional.tab2.getdataListParm1.parammaps.pastureid
  4405. this.nutritional.tab2.getdataListParm2.parammaps.barid = this.nutritional.tab2.getdataListParm1.parammaps.barid
  4406. this.nutritional.tab2.getdataListParm2.parammaps.startTime = parseTime(this.nutritional.tab2.inputDatetime[0], '{y}-{m}-{d}')
  4407. this.nutritional.tab2.getdataListParm2.parammaps.stopTime = parseTime(this.nutritional.tab2.inputDatetime[1], '{y}-{m}-{d}')
  4408. this.nutritional.tab2.getdataListParm3.parammaps.pastureid = this.nutritional.tab2.getdataListParm1.parammaps.pastureid
  4409. this.nutritional.tab2.getdataListParm3.parammaps.barid = this.nutritional.tab2.getdataListParm1.parammaps.barid
  4410. this.nutritional.tab2.getdataListParm3.parammaps.startTime = parseTime(this.nutritional.tab2.inputDatetime[0], '{y}-{m}-{d}')
  4411. this.nutritional.tab2.getdataListParm3.parammaps.stopTime = parseTime(this.nutritional.tab2.inputDatetime[1], '{y}-{m}-{d}')
  4412. this.nutritional.tab2.getdataListParm4.parammaps.pastureid = this.nutritional.tab2.getdataListParm1.parammaps.pastureid
  4413. this.nutritional.tab2.getdataListParm4.parammaps.barid = this.nutritional.tab2.getdataListParm1.parammaps.barid
  4414. this.nutritional.tab2.getdataListParm4.parammaps.startTime = parseTime(this.nutritional.tab2.inputDatetime[0], '{y}-{m}-{d}')
  4415. this.nutritional.tab2.getdataListParm4.parammaps.stopTime = parseTime(this.nutritional.tab2.inputDatetime[1], '{y}-{m}-{d}')
  4416. this.getTab2NutritionalList1()
  4417. this.getTab2NutritionalList2()
  4418. this.getTab2NutritionalList3()
  4419. this.getTab2NutritionalList4()
  4420. }
  4421. },
  4422. handleNext() {
  4423. if (this.nutritional.activeName == 'first') {
  4424. if (this.nutritional.tab1.inputDatetime !== '' && this.nutritional.tab1.inputDatetime !== null) {
  4425. console.log(this.nutritional.tab1.inputDatetime)
  4426. var start3 = new Date(this.nutritional.tab1.inputDatetime[0].setDate(this.nutritional.tab1.inputDatetime[0].getDate() + 1))
  4427. var stop3 = new Date(this.nutritional.tab1.inputDatetime[1].setDate(this.nutritional.tab1.inputDatetime[1].getDate() + 1))
  4428. this.nutritional.tab1.inputDatetime.length = 0
  4429. this.nutritional.tab1.inputDatetime.push(start3, stop3)
  4430. this.$forceUpdate()
  4431. }
  4432. } else {
  4433. var start4 = new Date(this.nutritional.tab2.inputDatetime[0].setDate(this.nutritional.tab2.inputDatetime[0].getDate() + 1))
  4434. var stop4 = new Date(this.nutritional.tab2.inputDatetime[1].setDate(this.nutritional.tab2.inputDatetime[1].getDate() + 1))
  4435. this.nutritional.tab2.inputDatetime.length = 0
  4436. this.nutritional.tab2.inputDatetime.push(start4, stop4)
  4437. this.$forceUpdate()
  4438. this.nutritional.tab2.getdataListParm1.parammaps.pastureid = this.selectList[0].pastureid
  4439. this.nutritional.tab2.getdataListParm1.parammaps.barid = this.selectList[0].barid
  4440. this.nutritional.tab2.getdataListParm1.parammaps.startTime = parseTime(this.nutritional.tab2.inputDatetime[0], '{y}-{m}-{d}')
  4441. this.nutritional.tab2.getdataListParm1.parammaps.stopTime = parseTime(this.nutritional.tab2.inputDatetime[1], '{y}-{m}-{d}')
  4442. this.nutritional.tab2.getdataListParm2.parammaps.pastureid = this.nutritional.tab2.getdataListParm1.parammaps.pastureid
  4443. this.nutritional.tab2.getdataListParm2.parammaps.barid = this.nutritional.tab2.getdataListParm1.parammaps.barid
  4444. this.nutritional.tab2.getdataListParm2.parammaps.startTime = parseTime(this.nutritional.tab2.inputDatetime[0], '{y}-{m}-{d}')
  4445. this.nutritional.tab2.getdataListParm2.parammaps.stopTime = parseTime(this.nutritional.tab2.inputDatetime[1], '{y}-{m}-{d}')
  4446. this.nutritional.tab2.getdataListParm3.parammaps.pastureid = this.nutritional.tab2.getdataListParm1.parammaps.pastureid
  4447. this.nutritional.tab2.getdataListParm3.parammaps.barid = this.nutritional.tab2.getdataListParm1.parammaps.barid
  4448. this.nutritional.tab2.getdataListParm3.parammaps.startTime = parseTime(this.nutritional.tab2.inputDatetime[0], '{y}-{m}-{d}')
  4449. this.nutritional.tab2.getdataListParm3.parammaps.stopTime = parseTime(this.nutritional.tab2.inputDatetime[1], '{y}-{m}-{d}')
  4450. this.nutritional.tab2.getdataListParm4.parammaps.pastureid = this.nutritional.tab2.getdataListParm1.parammaps.pastureid
  4451. this.nutritional.tab2.getdataListParm4.parammaps.barid = this.nutritional.tab2.getdataListParm1.parammaps.barid
  4452. this.nutritional.tab2.getdataListParm4.parammaps.startTime = parseTime(this.nutritional.tab2.inputDatetime[0], '{y}-{m}-{d}')
  4453. this.nutritional.tab2.getdataListParm4.parammaps.stopTime = parseTime(this.nutritional.tab2.inputDatetime[1], '{y}-{m}-{d}')
  4454. this.getTab2NutritionalList1()
  4455. this.getTab2NutritionalList2()
  4456. this.getTab2NutritionalList3()
  4457. this.getTab2NutritionalList4()
  4458. }
  4459. },
  4460. getNutritionalList() {
  4461. this.nutritional.tab1.listLoading1 = true
  4462. GetDataByName(this.nutritional.tab1.getdataListParm1).then(response => {
  4463. console.log('评估上方数据', response.data.list)
  4464. if (response.data.list !== null) {
  4465. response.data.list[0].cowclassid = String(response.data.list[0].cowclassid)
  4466. this.nutritional.tab1.temp = response.data.list[0]
  4467. this.nutritional.tab1.disabledCowclass = true
  4468. this.nutritional.tab1.getdataListParm2.parammaps.name = 'judgenurFT'
  4469. this.nutritional.tab1.getdataListParm2.parammaps.name1 = 'judgenurBarHSL'
  4470. this.nutritional.tab1.getdataListParm2.parammaps.startTime = parseTime(this.nutritional.tab1.inputDatetime[0], '{y}-{m}-{d}')
  4471. this.nutritional.tab1.getdataListParm2.parammaps.stopTime = parseTime(this.nutritional.tab1.inputDatetime[1], '{y}-{m}-{d}')
  4472. this.nutritional.tab1.getdataListParm2.parammaps.bw = parseFloat(this.nutritional.tab1.temp.bw)
  4473. this.nutritional.tab1.getdataListParm2.parammaps.dayw = parseFloat(this.nutritional.tab1.temp.dayw)
  4474. this.nutritional.tab1.getdataListParm2.parammaps.fetal = parseFloat(this.nutritional.tab1.temp.fetal)
  4475. this.nutritional.tab1.getdataListParm2.parammaps.avgdim = parseFloat(this.nutritional.tab1.temp.avgdim)
  4476. this.nutritional.tab1.getdataListParm2.parammaps.dayspre = parseFloat(this.nutritional.tab1.temp.dayspre)
  4477. this.nutritional.tab1.getdataListParm2.parammaps.product = parseFloat(this.nutritional.tab1.temp.product)
  4478. this.nutritional.tab1.getdataListParm2.parammaps.fat = parseFloat(this.nutritional.tab1.temp.fat)
  4479. this.nutritional.tab1.getdataListParm2.parammaps.pro = parseFloat(this.nutritional.tab1.temp.pro)
  4480. this.nutritional.tab1.getdataListParm2.parammaps.lactose = parseFloat(this.nutritional.tab1.temp.lactose)
  4481. this.nutritional.tab1.getdataListParm2.parammaps.source = parseFloat(this.nutritional.tab1.temp.source)
  4482. this.nutritional.tab1.getdataListParm2.parammaps.tem = parseFloat(this.nutritional.tab1.temp.tem)
  4483. this.nutritional.tab1.getdataListParm2.parammaps.cowsum = parseFloat(this.nutritional.tab1.temp.cowsum)
  4484. this.nutritional.tab1.getdataListParm2.parammaps.cowclass = this.nutritional.tab1.temp.cowclass
  4485. this.nutritional.tab1.getdataListParm2.parammaps.cowclassid = this.nutritional.tab1.temp.cowclassid
  4486. this.nutritional.tab1.getdataListParm2.parammaps.bigcowclass = this.nutritional.tab1.temp.bigcowclass
  4487. this.nutritional.tab1.getdataListParm2.parammaps.pastureid = this.selectList[0].pastureid
  4488. this.nutritional.tab1.getdataListParm2.parammaps.barid = this.nutritional.tab1.temp.barid
  4489. this.nutritional.tab1.getdataListParm2.parammaps.date = this.nutritional.tab1.temp.date
  4490. this.getNutritionalList2()
  4491. } else {
  4492. this.nutritional.tab1.temp = []
  4493. this.nutritional.tab1.disabledCowclass = false
  4494. }
  4495. setTimeout(() => {
  4496. this.nutritional.tab1.listLoading = false
  4497. }, 100)
  4498. })
  4499. },
  4500. assessmentData() {
  4501. console.log('评估保存')
  4502. this.$refs['temp'].validate(valid => {
  4503. if (valid) {
  4504. if (this.nutritional.tab1.inputDatetime == '' || this.nutritional.tab1.inputDatetime == null) {
  4505. this.$message({ type: 'error', message: '开始日期结束日期不能为空', duration: 2000 })
  4506. return false
  4507. } else {
  4508. // 牛头数
  4509. const positiveInteger = /^[1-9]\d*$/
  4510. if (this.nutritional.tab1.temp.cowsum !== '') {
  4511. if (!positiveInteger.test(parseFloat(this.nutritional.tab1.temp.cowsum))) {
  4512. this.$message({ type: 'error', message: '牛头数请输入正整数', duration: 2000 })
  4513. return false
  4514. }
  4515. }
  4516. const twoDecimalPlaces = /^\d+(\.\d{1,2})?$/
  4517. // 温度环境
  4518. if (this.nutritional.tab1.temp.tem !== '') {
  4519. if (!twoDecimalPlaces.test(parseFloat(this.nutritional.tab1.temp.tem))) {
  4520. this.$message({ type: 'error', message: '温度环境请保留两位小数', duration: 2000 })
  4521. return false
  4522. }
  4523. }
  4524. // 平均月龄
  4525. if (this.nutritional.tab1.temp.avgmonthage !== '') {
  4526. if (!twoDecimalPlaces.test(parseFloat(this.nutritional.tab1.temp.avgmonthage))) {
  4527. this.$message({ type: 'error', message: '平均月龄请保留两位小数', duration: 2000 })
  4528. return false
  4529. }
  4530. }
  4531. // 体重
  4532. if (this.nutritional.tab1.temp.bw !== '') {
  4533. if (!twoDecimalPlaces.test(parseFloat(this.nutritional.tab1.temp.bw))) {
  4534. this.$message({ type: 'error', message: '体重请保留两位小数', duration: 2000 })
  4535. return false
  4536. }
  4537. }
  4538. // 日增重
  4539. if (this.nutritional.tab1.temp.dayw !== '') {
  4540. if (!twoDecimalPlaces.test(parseFloat(this.nutritional.tab1.temp.dayw))) {
  4541. this.$message({ type: 'error', message: '日增重请保留两位小数', duration: 2000 })
  4542. return false
  4543. }
  4544. }
  4545. const dayspre = /^(([1-9]|([1-9]\d)|(1\d\d)|(2([0-7]\d|7[0-9]))))$/
  4546. // 怀孕天数
  4547. if (this.nutritional.tab1.temp.dayspre !== '') {
  4548. if (!dayspre.test(parseFloat(this.nutritional.tab1.temp.dayspre))) {
  4549. this.$message({ type: 'error', message: '怀孕天数请输入大于0小于280整数', duration: 2000 })
  4550. return false
  4551. }
  4552. }
  4553. const fetal = /^(?:[1-9]|1[0-9])$/
  4554. // 胎次
  4555. if (this.nutritional.tab1.temp.fetal !== '') {
  4556. if (!fetal.test(parseFloat(this.nutritional.tab1.temp.fetal))) {
  4557. this.$message({ type: 'error', message: '胎次请输入大于0小于20整数', duration: 2000 })
  4558. return false
  4559. }
  4560. }
  4561. // 平均泌乳
  4562. if (this.nutritional.tab1.temp.avgdim !== '') {
  4563. if (!positiveInteger.test(parseFloat(this.nutritional.tab1.temp.avgdim))) {
  4564. this.$message({ type: 'error', message: '平均泌乳天数请输入正整数', duration: 2000 })
  4565. return false
  4566. }
  4567. }
  4568. // 产奶量
  4569. if (this.nutritional.tab1.temp.product !== '') {
  4570. if (!twoDecimalPlaces.test(parseFloat(this.nutritional.tab1.temp.product))) {
  4571. this.$message({ type: 'error', message: '产奶量请保留两位小数', duration: 2000 })
  4572. return false
  4573. }
  4574. }
  4575. // 乳脂率
  4576. if (this.nutritional.tab1.temp.fat !== '') {
  4577. if (!twoDecimalPlaces.test(parseFloat(this.nutritional.tab1.temp.fat))) {
  4578. this.$message({ type: 'error', message: '乳脂率请保留两位小数', duration: 2000 })
  4579. return false
  4580. }
  4581. }
  4582. // 乳蛋白率
  4583. if (this.nutritional.tab1.temp.pro !== '') {
  4584. if (!twoDecimalPlaces.test(parseFloat(this.nutritional.tab1.temp.pro))) {
  4585. this.$message({ type: 'error', message: '乳蛋白率请保留两位小数', duration: 2000 })
  4586. return false
  4587. }
  4588. }
  4589. // 乳糖率
  4590. if (this.nutritional.tab1.temp.lactose !== '') {
  4591. if (!twoDecimalPlaces.test(parseFloat(this.nutritional.tab1.temp.lactose))) {
  4592. this.$message({ type: 'error', message: '乳糖率请保留两位小数', duration: 2000 })
  4593. return false
  4594. }
  4595. }
  4596. this.nutritional.tab1.getdataListParm2.parammaps.name = 'judgenurFT'
  4597. this.nutritional.tab1.getdataListParm2.parammaps.name1 = 'judgenurBarHSL'
  4598. this.nutritional.tab1.getdataListParm2.parammaps.startTime = parseTime(this.nutritional.tab1.inputDatetime[0], '{y}-{m}-{d}')
  4599. this.nutritional.tab1.getdataListParm2.parammaps.stopTime = parseTime(this.nutritional.tab1.inputDatetime[1], '{y}-{m}-{d}')
  4600. this.nutritional.tab1.getdataListParm2.parammaps.bw = parseFloat(this.nutritional.tab1.temp.bw)
  4601. this.nutritional.tab1.getdataListParm2.parammaps.dayw = parseFloat(this.nutritional.tab1.temp.dayw)
  4602. this.nutritional.tab1.getdataListParm2.parammaps.fetal = parseFloat(this.nutritional.tab1.temp.fetal)
  4603. this.nutritional.tab1.getdataListParm2.parammaps.avgdim = parseFloat(this.nutritional.tab1.temp.avgdim)
  4604. this.nutritional.tab1.getdataListParm2.parammaps.dayspre = parseFloat(this.nutritional.tab1.temp.dayspre)
  4605. this.nutritional.tab1.getdataListParm2.parammaps.product = parseFloat(this.nutritional.tab1.temp.product)
  4606. this.nutritional.tab1.getdataListParm2.parammaps.fat = parseFloat(this.nutritional.tab1.temp.fat)
  4607. this.nutritional.tab1.getdataListParm2.parammaps.pro = parseFloat(this.nutritional.tab1.temp.pro)
  4608. this.nutritional.tab1.getdataListParm2.parammaps.lactose = parseFloat(this.nutritional.tab1.temp.lactose)
  4609. this.nutritional.tab1.getdataListParm2.parammaps.source = parseFloat(this.nutritional.tab1.temp.source)
  4610. this.nutritional.tab1.getdataListParm2.parammaps.tem = parseFloat(this.nutritional.tab1.temp.tem)
  4611. this.nutritional.tab1.getdataListParm2.parammaps.cowsum = parseFloat(this.nutritional.tab1.temp.cowsum)
  4612. this.nutritional.tab1.getdataListParm2.parammaps.cowclass = this.nutritional.tab1.temp.cowclass
  4613. this.nutritional.tab1.getdataListParm2.parammaps.cowclassid = this.nutritional.tab1.temp.cowclassid
  4614. this.nutritional.tab1.getdataListParm2.parammaps.bigcowclass = this.nutritional.tab1.temp.bigcowclass
  4615. this.nutritional.tab1.getdataListParm2.parammaps.pastureid = this.selectList[0].pastureid
  4616. this.nutritional.tab1.getdataListParm2.parammaps.barid = this.nutritional.tab1.temp.barid
  4617. this.nutritional.tab1.getdataListParm2.parammaps.date = this.nutritional.tab1.temp.date
  4618. this.getNutritionalList2()
  4619. }
  4620. }
  4621. })
  4622. },
  4623. getNutritionalList2() {
  4624. this.nutritional.tab1.listLoading2 = true
  4625. GETNurJudge(this.nutritional.tab1.getdataListParm2).then(response => {
  4626. if (response.msg !== 'fail') {
  4627. if (response.data.list !== null) {
  4628. // response.data = response.data.sort(compareSort('sort'))
  4629. for (let i = 0; i < response.data.length; i++) {
  4630. if (response.data[i].cowneed == null) {
  4631. response.data[i].cowneed = ''
  4632. }
  4633. var reg = RegExp(/>/)
  4634. var reg2 = RegExp(/</)
  4635. var reg3 = RegExp(/-/)
  4636. if (reg.test(response.data[i].cowneed) == true) {
  4637. const cowneed = response.data[i].cowneed.split('>')[1]
  4638. if ((parseFloat(response.data[i].ftpro) < parseFloat(cowneed)) || (parseFloat(response.data[i].hprov) < parseFloat(cowneed)) || parseFloat(response.data[i].sprov) < parseFloat(cowneed)) {
  4639. this.$set(response.data[i], 'isColor', '0')
  4640. } else {
  4641. this.$set(response.data[i], 'isColor', '')
  4642. }
  4643. } else if (reg2.test(response.data[i].cowneed) == true) {
  4644. const cowneed2 = response.data[i].cowneed.split('<')[1]
  4645. if ((parseFloat(response.data[i].ftpro) > parseFloat(cowneed2)) || (parseFloat(response.data[i].hprov) > parseFloat(cowneed2)) || parseFloat(response.data[i].sprov) > parseFloat(cowneed2)) {
  4646. this.$set(response.data[i], 'isColor', '0')
  4647. } else {
  4648. this.$set(response.data[i], 'isColor', '')
  4649. }
  4650. } else if (reg3.test(response.data[i].cowneed) == true) {
  4651. response.data[i].cowneed = String(response.data[i].cowneed)
  4652. if (response.data[i].cowneed.length == 1) {
  4653. const cowneed3 = response.data[i].cowneed.split('-')
  4654. console.log(cowneed3, 'cowneed3')
  4655. if (parseFloat(response.data[i].ftpro) > parseFloat(cowneed3[0]) && parseFloat(response.data[i].ftpro) < parseFloat(cowneed3[1])) {
  4656. this.$set(response.data[i], 'isColor', '')
  4657. } else if (parseFloat(response.data[i].hprov) > parseFloat(cowneed3[0]) && parseFloat(response.data[i].hprov) < parseFloat(cowneed3[1])) {
  4658. this.$set(response.data[i], 'isColor', '')
  4659. } else if (parseFloat(response.data[i].sprov) > parseFloat(cowneed3[0]) && parseFloat(response.data[i].sprov) < parseFloat(cowneed3[1])) {
  4660. this.$set(response.data[i], 'isColor', '')
  4661. } else if (cowneed3[0] == '' && cowneed3[0] == '') {
  4662. this.$set(response.data[i], 'isColor', '')
  4663. } else {
  4664. this.$set(response.data[i], 'isColor', '0')
  4665. }
  4666. } else {
  4667. 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)) {
  4668. this.$set(response.data[i], 'isColor', '0')
  4669. } else {
  4670. this.$set(response.data[i], 'isColor', '')
  4671. }
  4672. }
  4673. } else {
  4674. response.data[i].cowneed = String(response.data[i].cowneed)
  4675. if (response.data[i].cowneed[0] !== '-') {
  4676. 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)) {
  4677. this.$set(response.data[i], 'isColor', '0')
  4678. } else {
  4679. this.$set(response.data[i], 'isColor', '')
  4680. }
  4681. } else {
  4682. this.$set(response.data[i], 'isColor', '')
  4683. }
  4684. }
  4685. }
  4686. console.log(response.data)
  4687. console.log('评估下方数据', response.data)
  4688. this.nutritional.tab1.list = response.data
  4689. this.nutritional.tab1.total = response.data.total
  4690. } else {
  4691. this.nutritional.tab1.list = []
  4692. }
  4693. } else {
  4694. this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
  4695. }
  4696. setTimeout(() => {
  4697. this.nutritional.tab1.listLoading2 = false
  4698. }, 100)
  4699. })
  4700. },
  4701. // 牛群评估
  4702. getTab2NutritionalList1() {
  4703. this.nutritional.tab2.listLoading1 = true
  4704. GetDataByName(this.nutritional.tab2.getdataListParm1).then(response => {
  4705. console.log('宾州筛分析', response.data.list)
  4706. if (response.data.list !== null) {
  4707. this.nutritional.tab2.list1 = response.data.list
  4708. this.nutritional.tab2.pageNum1 = response.data.pageNum
  4709. this.nutritional.tab2.pageSize1 = response.data.pageSize
  4710. this.nutritional.tab2.total1 = response.data.total
  4711. } else {
  4712. this.nutritional.tab2.list1 = []
  4713. }
  4714. setTimeout(() => {
  4715. this.nutritional.tab2.listLoading1 = false
  4716. }, 100)
  4717. })
  4718. },
  4719. getTab2NutritionalList2() {
  4720. this.nutritional.tab2.listLoading2 = true
  4721. GetDataByName(this.nutritional.tab2.getdataListParm2).then(response => {
  4722. console.log('粪便筛分析', response.data.list)
  4723. if (response.data.list !== null) {
  4724. this.nutritional.tab2.list2 = response.data.list
  4725. this.nutritional.tab2.pageNum2 = response.data.pageNum
  4726. this.nutritional.tab2.pageSize2 = response.data.pageSize
  4727. this.nutritional.tab2.total2 = response.data.total
  4728. } else {
  4729. this.nutritional.tab2.list2 = []
  4730. }
  4731. setTimeout(() => {
  4732. this.nutritional.tab2.listLoading2 = false
  4733. }, 100)
  4734. })
  4735. },
  4736. getTab2NutritionalList3() {
  4737. this.nutritional.tab2.listLoading3 = true
  4738. GetDataByName(this.nutritional.tab2.getdataListParm3).then(response => {
  4739. console.log('BCS评分', response.data.list)
  4740. if (response.data.list !== null) {
  4741. for (let i = 0; i < response.data.list.length; i++) {
  4742. this.$set(response.data.list[i], 'score25rate', (parseFloat(response.data.list[i].score25) / parseFloat(response.data.list[i].cowsum) * 100).toFixed(2))
  4743. this.$set(response.data.list[i], 'score275rate', (parseFloat(response.data.list[i].score275) / parseFloat(response.data.list[i].cowsum) * 100).toFixed(2))
  4744. this.$set(response.data.list[i], 'score3rate', (parseFloat(response.data.list[i].score3) / parseFloat(response.data.list[i].cowsum) * 100).toFixed(2))
  4745. this.$set(response.data.list[i], 'score325rate', (parseFloat(response.data.list[i].score325) / parseFloat(response.data.list[i].cowsum) * 100).toFixed(2))
  4746. this.$set(response.data.list[i], 'score35rate', (parseFloat(response.data.list[i].score35) / parseFloat(response.data.list[i].cowsum) * 100).toFixed(2))
  4747. this.$set(response.data.list[i], 'score375rate', (parseFloat(response.data.list[i].score375) / parseFloat(response.data.list[i].cowsum) * 100).toFixed(2))
  4748. 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(2))
  4749. }
  4750. this.nutritional.tab2.list3 = response.data.list
  4751. this.nutritional.tab2.pageNum3 = response.data.pageNum
  4752. this.nutritional.tab2.pageSize3 = response.data.pageSize
  4753. this.nutritional.tab2.total3 = response.data.total
  4754. } else {
  4755. this.nutritional.tab2.list3 = []
  4756. }
  4757. setTimeout(() => {
  4758. this.nutritional.tab2.listLoading3 = false
  4759. }, 100)
  4760. })
  4761. },
  4762. getTab2NutritionalList4() {
  4763. this.nutritional.tab2.listLoading4 = true
  4764. GetDataByName(this.nutritional.tab2.getdataListParm4).then(response => {
  4765. console.log('粪便评分', response.data.list)
  4766. if (response.data.list !== null) {
  4767. for (let i = 0; i < response.data.list.length; i++) {
  4768. this.$set(response.data.list[i], 'score1rate', (parseFloat(response.data.list[i].score1) / parseFloat(response.data.list[i].cowsum) * 100).toFixed(2))
  4769. this.$set(response.data.list[i], 'score2rate', (parseFloat(response.data.list[i].score2) / parseFloat(response.data.list[i].cowsum) * 100).toFixed(2))
  4770. this.$set(response.data.list[i], 'score3rate', (parseFloat(response.data.list[i].score3) / parseFloat(response.data.list[i].cowsum) * 100).toFixed(2))
  4771. this.$set(response.data.list[i], 'score4rate', (parseFloat(response.data.list[i].score4) / parseFloat(response.data.list[i].cowsum) * 100).toFixed(2))
  4772. 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(2))
  4773. }
  4774. this.nutritional.tab2.list4 = response.data.list
  4775. this.nutritional.tab2.pageNum4 = response.data.pageNum
  4776. this.nutritional.tab2.pageSize4 = response.data.pageSize
  4777. this.nutritional.tab2.total4 = response.data.total
  4778. } else {
  4779. this.nutritional.tab2.list4 = []
  4780. }
  4781. setTimeout(() => {
  4782. this.nutritional.tab2.listLoading4 = false
  4783. }, 100)
  4784. })
  4785. },
  4786. // 历史记录
  4787. handleHistoryRecords() {
  4788. console.log('点击了历史记录')
  4789. this.dialogFull = false
  4790. this.history.dialogStatus = 'history'
  4791. this.history.dialogFormVisible = true
  4792. this.getDateList()
  4793. },
  4794. // 历史时间
  4795. getDateList() {
  4796. GetDataByName(this.history.getdataDateParm).then(response => {
  4797. console.log('table数据', response.data.list)
  4798. if (response.data.list !== null) {
  4799. this.history.getdataListParm.parammaps.date = response.data.list[0].maxdate
  4800. this.getHistoryIsDisplay()
  4801. } else {
  4802. this.history.getdataListParm.parammaps.date = ''
  4803. }
  4804. })
  4805. },
  4806. getHistoryIsDisplay() {
  4807. GetDataByName(this.table.getdataListParm2).then(response => {
  4808. console.log(response.data.list[0].inforvalue)
  4809. if (response.data.list !== null) {
  4810. if (response.data.list[0].inforvalue == 0) {
  4811. this.table.isPtsfname = false
  4812. } else {
  4813. this.table.isPtsfname = true
  4814. }
  4815. }
  4816. })
  4817. GetDataByName(this.table.getdataListParm3).then(response => {
  4818. if (response.data.list !== null) {
  4819. if (response.data.list[0].inforvalue == 1) {
  4820. this.history.isRW1 = true
  4821. this.history.isRW2 = false
  4822. this.history.isRW3 = false
  4823. this.history.isRW4 = false
  4824. } else if (response.data.list[0].inforvalue == 2) {
  4825. this.history.isRW1 = true
  4826. this.history.isRW2 = true
  4827. this.history.isRW3 = false
  4828. this.history.isRW4 = false
  4829. } else if (response.data.list[0].inforvalue == 3) {
  4830. this.history.isRW1 = true
  4831. this.history.isRW2 = true
  4832. this.history.isRW3 = true
  4833. this.history.isRW4 = false
  4834. } else if (response.data.list[0].inforvalue == 4) {
  4835. this.history.isRW1 = true
  4836. this.history.isRW2 = true
  4837. this.history.isRW3 = true
  4838. this.history.isRW4 = true
  4839. }
  4840. } else {
  4841. this.history.isRW1 = false
  4842. this.history.isRW2 = false
  4843. this.history.isRW3 = false
  4844. this.history.isRW4 = false
  4845. }
  4846. })
  4847. this.getHistoryList()
  4848. },
  4849. getHistoryList() {
  4850. this.history.listLoading = true
  4851. GetDataByName(this.history.getdataListParm).then(response => {
  4852. console.log('table数据', response.data.list)
  4853. if (response.data.list !== null) {
  4854. console.log('table数据', response.data.list)
  4855. for (let i = 0; i < response.data.list.length; i++) {
  4856. if (response.data.list[i].ptid == undefined || response.data.list[i].ptname == '') {
  4857. this.$set(response.data.list[i], 'ptid', '')
  4858. this.$set(response.data.list[i], 'ptname', '')
  4859. }
  4860. }
  4861. this.history.list = response.data.list
  4862. this.handleSpan()
  4863. this.history.pageNum = response.data.pageNum
  4864. this.history.pageSize = response.data.pageSize
  4865. this.history.total = response.data.total
  4866. } else {
  4867. this.history.list = []
  4868. }
  4869. setTimeout(() => {
  4870. this.history.listLoading = false
  4871. }, 100)
  4872. })
  4873. },
  4874. handleSpan() {
  4875. this.mergekeys.forEach(key => {
  4876. this.spanObj[key] = []
  4877. let position = 0
  4878. this.history.list.forEach((item, index) => {
  4879. if (index === 0) {
  4880. this.spanObj[key].push(1)
  4881. position = 0
  4882. } else {
  4883. if (key == 'sumweight') {
  4884. if (this.history.list[index][key] === this.history.list[index - 1][key] && this.history.list[index]['barname'] === this.history.list[index - 1]['barname']) {
  4885. this.spanObj[key][position] += 1
  4886. this.spanObj[key].push(0)
  4887. } else {
  4888. this.spanObj[key].push(1)
  4889. position = index
  4890. }
  4891. } else {
  4892. if (this.history.list[index][key] === this.history.list[index - 1][key]) {
  4893. this.spanObj[key][position] += 1
  4894. this.spanObj[key].push(0)
  4895. } else {
  4896. this.spanObj[key].push(1)
  4897. position = index
  4898. }
  4899. }
  4900. }
  4901. })
  4902. })
  4903. },
  4904. objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  4905. for (let i = 0; i < this.mergekeys.length; i++) {
  4906. if (column.property === this.mergekeys[i]) {
  4907. const _row = this.spanObj[this.mergekeys[i]][rowIndex]
  4908. const _col = _row > 0 ? 1 : 0
  4909. return {
  4910. rowspan: _row,
  4911. colspan: _col
  4912. }
  4913. }
  4914. }
  4915. },
  4916. changeDate() {
  4917. this.getHistoryList()
  4918. },
  4919. // 应用
  4920. handleApplication() {
  4921. console.log('点击了应用')
  4922. MessageBox.confirm('是否确认将' + this.history.getdataListParm.parammaps.date + '的数据应用到当前?', {
  4923. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  4924. }).then(() => {
  4925. this.requestParam.name = 'applyFPdate'
  4926. this.requestParam.parammaps = {}
  4927. this.requestParam.parammaps.pastureid = Cookies.get('pastureid')
  4928. this.requestParam.parammaps.date = this.history.getdataListParm.parammaps.date
  4929. PostDataByName(this.requestParam).then(response => {
  4930. if (response.msg === 'fail') {
  4931. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  4932. } else {
  4933. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  4934. this.getHistoryIsDisplay()
  4935. this.getList()
  4936. }
  4937. })
  4938. }).catch(() => {
  4939. this.$message({ type: 'info', message: '已取消应用' })
  4940. })
  4941. },
  4942. // 导出
  4943. handleExport(item) {
  4944. if (item == 1) {
  4945. console.log('点击了导出模板')
  4946. this.download.getdataListParm.parammaps = this.table.getdataListParm.parammaps
  4947. GetDataByName(this.download.getdataListParm).then(response => {
  4948. if (response.data.list !== null) {
  4949. this.download.list = response.data.list
  4950. } else {
  4951. this.download.list = []
  4952. }
  4953. var downloadList = [
  4954. { 'obj1': '1、文件类型为xlsx类型,对应表格文件名格式为:文件名称.xlsx;' },
  4955. { 'obj1': '2、底部工作表名称不可更改,默认为:Sheet1;' },
  4956. { 'obj1': '3、栏舍名称,实际牛头数,系数(%),系数头数,配方模板,补料配方字体为必填;' },
  4957. { 'obj1': '4、第一列栏舍名称默认为系统中栏舍,不可修改;' },
  4958. { 'obj1': '5、实际牛头数为正整数,系数为正数,至多保留俩位小数;' },
  4959. { 'obj1': '6、配方模板名称必须与系统中配方计划—配方模板中的饲喂配方匹配;若补料配方开启,需与配方模板中的补料配方匹配;' },
  4960. { 'obj1': '7、数据最多可导入200条,超过200条请分多个文件导入。' }
  4961. ]
  4962. var excelDatas = [
  4963. {
  4964. tHeader: ['栏舍名称', '实际牛头数', '系数(%)', '配方模板', '补料配方', '第一班比例(%)', '第二班比例(%)', '第三班比例(%)', '第四班比例(%)'],
  4965. filterVal: ['barname', '', '', '', '', '', '', '', ''],
  4966. tableDatas: this.download.list,
  4967. sheetName: 'Sheet1'
  4968. }, {
  4969. tHeader: ['填写规范:'],
  4970. filterVal: ['obj1'],
  4971. tableDatas: downloadList,
  4972. sheetName: 'Sheet2'
  4973. }
  4974. ]
  4975. json2excel(excelDatas, '栏舍配方导入模板', true, 'xlsx')
  4976. })
  4977. } else {
  4978. console.log('点击了导出数据')
  4979. this.download.getdataListParm.parammaps = this.table.getdataListParm.parammaps
  4980. GetDataByName(this.download.getdataListParm).then(response => {
  4981. if (response.data.list !== null) {
  4982. for (let i = 0; i < response.data.list.length; i++) {
  4983. if (response.data.list[i].ftid !== undefined && response.data.list[i].ftid !== '') {
  4984. if (this.recipeTemplateList.find(obj => obj.id == response.data.list[i].ftid) !== undefined) {
  4985. this.$set(response.data.list[i], 'dryweight', this.recipeTemplateList.find(obj => obj.id == response.data.list[i].ftid).dryweight) // 编辑保存
  4986. } else {
  4987. this.$set(response.data.list[i], 'dryweight', '')
  4988. }
  4989. }
  4990. if (response.data.list[i].timesopt !== undefined) {
  4991. var timesoptArr = response.data.list[i].timesopt.split(',')
  4992. for (let j = 0; j < timesoptArr.length; j++) {
  4993. response.data.list[i]['r' + timesoptArr[j].split(':')[0]] = timesoptArr[j].split(':')[1]
  4994. response.data.list[i]['w' + timesoptArr[j].split(':')[0]] = timesoptArr[j].split(':')[2]
  4995. }
  4996. }
  4997. if (response.data.list[i].r1 == '' || response.data.list[i].r1 == undefined) {
  4998. response.data.list[i].r1 = 0
  4999. response.data.list[i].w1 = 0
  5000. }
  5001. if (response.data.list[i].r2 == '' || response.data.list[i].r2 == undefined) {
  5002. response.data.list[i].r2 = 0
  5003. response.data.list[i].w2 = 0
  5004. }
  5005. if (response.data.list[i].r3 == '' || response.data.list[i].r3 == undefined) {
  5006. response.data.list[i].r3 = 0
  5007. response.data.list[i].w3 = 0
  5008. }
  5009. if (response.data.list[i].r4 == '' || response.data.list[i].r4 == undefined) {
  5010. response.data.list[i].r4 = 0
  5011. response.data.list[i].w4 = 0
  5012. }
  5013. 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))
  5014. response.data.list[i].sumr = formatNum(response.data.list[i].sumr, parseInt(Cookies.get('decimal')))
  5015. 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))
  5016. response.data.list[i].dailyWeight = formatNum(response.data.list[i].dailyWeight, parseInt(Cookies.get('decimal')))
  5017. }
  5018. this.download.list = response.data.list
  5019. } else {
  5020. this.download.list = []
  5021. }
  5022. if (this.table.isRW1 == true && this.table.isRW2 == false && this.table.isRW3 == false && this.table.isRW4 == false) {
  5023. var excelDatas = [
  5024. {
  5025. tHeader: ['栏舍名称', '软件牛头数', '实际牛头数', '系数(%)', '系数头数', '配方模板', '补料配方', '第一班比例(%)', '第一班重量', '总比例', '日投喂量', '配方重量', '补料重量', '配方干物质'],
  5026. filterVal: ['barname', 'softccount', 'ccount', 'ratio', 'ccountratio', 'ftname', 'ptsfname', 'r1', 'w1', 'sumr', 'dailyWeight', 'ftweight', 'supplyweight', 'dryweight'],
  5027. tableDatas: this.download.list,
  5028. sheetName: 'Sheet1'
  5029. }
  5030. ]
  5031. } else if (this.table.isRW1 == true && this.table.isRW2 == true && this.table.isRW3 == false && this.table.isRW4 == false) {
  5032. var excelDatas = [
  5033. {
  5034. tHeader: ['栏舍名称', '软件牛头数', '实际牛头数', '系数(%)', '系数头数', '配方模板', '补料配方', '第一班比例(%)', '第一班重量', '第二班比例(%)', '第二班重量', '总比例', '日投喂量', '配方重量', '补料重量', '配方干物质'],
  5035. filterVal: ['barname', 'softccount', 'ccount', 'ratio', 'ccountratio', 'ftname', 'ptsfname', 'r1', 'w1', 'r2', 'w2', 'sumr', 'dailyWeight', 'ftweight', 'supplyweight', 'dryweight'],
  5036. tableDatas: this.download.list,
  5037. sheetName: 'Sheet1'
  5038. }
  5039. ]
  5040. } else if (this.table.isRW1 == true && this.table.isRW2 == true && this.table.isRW3 == true && this.table.isRW4 == false) {
  5041. var excelDatas = [
  5042. {
  5043. tHeader: ['栏舍名称', '软件牛头数', '实际牛头数', '系数(%)', '系数头数', '配方模板', '补料配方', '第一班比例(%)', '第一班重量', '第二班比例(%)', '第二班重量', '第三班比例(%)', '第三班重量', '总比例', '日投喂量', '配方重量', '补料重量', '配方干物质'],
  5044. filterVal: ['barname', 'softccount', 'ccount', 'ratio', 'ccountratio', 'ftname', 'ptsfname', 'r1', 'w1', 'r2', 'w2', 'r3', 'w3', 'sumr', 'dailyWeight', 'ftweight', 'supplyweight', 'dryweight'],
  5045. tableDatas: this.download.list,
  5046. sheetName: 'Sheet1'
  5047. }
  5048. ]
  5049. } else {
  5050. var excelDatas = [
  5051. {
  5052. tHeader: ['栏舍名称', '软件牛头数', '实际牛头数', '系数(%)', '系数头数', '配方模板', '补料配方', '第一班比例(%)', '第一班重量', '第二班比例(%)', '第二班重量', '第三班比例(%)', '第三班重量', '第四班比例(%)', '第四班重量', '总比例', '日投喂量', '配方重量', '补料重量', '配方干物质'],
  5053. filterVal: ['barname', 'softccount', 'ccount', 'ratio', 'ccountratio', 'ftname', 'ptsfname', 'r1', 'w1', 'r2', 'w2', 'r3', 'w3', 'r4', 'w4', 'sumr', 'dailyWeight', 'ftweight', 'supplyweight', 'dryweight'],
  5054. tableDatas: this.download.list,
  5055. sheetName: 'Sheet1'
  5056. }
  5057. ]
  5058. }
  5059. json2excel(excelDatas, '栏舍配方', true, 'xlsx')
  5060. })
  5061. }
  5062. },
  5063. beforeImport(file) {
  5064. const isLt2M = file.size / 1024 / 1024 < 2
  5065. if (!isLt2M) {
  5066. this.$message.error('上传文件大小不能超过 2MB!')
  5067. }
  5068. return isLt2M
  5069. },
  5070. handleImportSuccess(res, file) {
  5071. this.getList()
  5072. if (res.msg === 'ok') {
  5073. this.$message({ title: '成功', message: '导入成功:' + res.data.success + '条!', type: 'success', duration: 2000 })
  5074. if (res.data.err_count > 0) {
  5075. this.$notify({ title: '失败', message: '导入失败:' + res.data.err_count + '条!', type: 'danger', duration: 2000 })
  5076. import('@/vendor/Export2Excel').then(excel => {
  5077. const list1 = res.data.result
  5078. const tHeader = [
  5079. '栏舍名称', '实际牛头数', '系数(%)', '配方模板', '补料配方', '第一班比例(%)', '第二班比例(%)', '第三班比例(%)', '错误信息'
  5080. ]
  5081. const filterVal = [
  5082. '栏舍名称', '实际牛头数', '系数(%)', '配方模板', '补料配方', '第一班比例(%)', '第二班比例(%)', '第三班比例(%)', 'error_msg'
  5083. ]
  5084. const data1 = this.formatJson(filterVal, list1)
  5085. excel.export_json_to_excel({ header: tHeader, data: data1, filename: '栏舍配方导入报错信息', autoWidth: true, bookType: 'xlsx' })
  5086. })
  5087. }
  5088. } else {
  5089. this.$notify({ title: '失败', message: '上传失败', type: 'danger', duration: 2000 })
  5090. }
  5091. },
  5092. formatJson(filterVal, jsonData) {
  5093. return jsonData.map(v =>
  5094. filterVal.map(j => {
  5095. if (j === 'timestamp') {
  5096. return parseTime(v[j])
  5097. } else {
  5098. return v[j]
  5099. }
  5100. })
  5101. )
  5102. },
  5103. // 干物质调节
  5104. handleDryMatterRegulation() {
  5105. console.log('干物质调节')
  5106. this.isShowDialog = true
  5107. this.$refs.mychild.getBalconicFormula()
  5108. this.$refs.mychild.restTemp()
  5109. }
  5110. }
  5111. }
  5112. </script>
  5113. <style lang="scss" scoped>
  5114. .search {
  5115. clear: both;
  5116. }
  5117. .table {
  5118. margin-top: 10px;
  5119. }
  5120. </style>
  5121. <style lang="scss">
  5122. .red-row{
  5123. background: #fde2e2 !important;
  5124. }
  5125. </style>