index.vue 305 KB

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