index.vue 307 KB

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