index备份.vue 307 KB

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