cac02099ae1b7e5bcac40555cabe137df06d9d2c.svn-base 297 KB

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