db73a3e694dd936a66e183fedda70de3981c174b.svn-base 155 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135
  1. <template>
  2. <div class="app-container">
  3. <div class="operation">
  4. <el-button class="success" style="float: left;" @click="handleNutritional">营养评估</el-button>
  5. <el-button class="import" style="float: right;">导入</el-button>
  6. <el-dropdown style="float: right;margin-right: 10px;">
  7. <el-button class="export">导出</el-button>
  8. <el-dropdown-menu slot="dropdown">
  9. <el-dropdown-item @click.native="handleExport(1)">导出模板</el-dropdown-item>
  10. <el-dropdown-item @click.native="handleExport(2)">导出数据</el-dropdown-item>
  11. </el-dropdown-menu>
  12. </el-dropdown>
  13. <el-button class="export" style="float: right;margin-right: 10px;" @click="handleHistoryRecords">历史记录</el-button>
  14. </div>
  15. <div class="search" />
  16. <div class="table">
  17. <el-table
  18. :key="table.tableKey"
  19. v-loading="table.listLoading"
  20. element-loading-text="给我一点时间"
  21. :data="table.list"
  22. border
  23. fit
  24. highlight-current-row
  25. style="width: 100%;"
  26. :row-style="rowStyle"
  27. :cell-style="cellStyle"
  28. class="elTable table-fixed"
  29. @header-click="headerClick"
  30. @cell-click="cellClick"
  31. @selection-change="handleSelect"
  32. >
  33. <el-table-column type="selection" width="50" />
  34. <el-table-column :key="1" label="序号" align="center" type="index" width="50px">
  35. <template slot-scope="scope">
  36. <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
  37. </template>
  38. </el-table-column>
  39. <el-table-column label="栏舍名称" min-width="100px" align="center">
  40. <template slot-scope="scope">
  41. <span>{{ scope.row.barname }}</span>
  42. </template>
  43. </el-table-column>
  44. <el-table-column label="软件牛头数" min-width="100px" align="center">
  45. <template slot-scope="scope">
  46. <span>{{ scope.row.softccount }}</span>
  47. </template>
  48. </el-table-column>
  49. <el-table-column label="实际牛头数" min-width="130px" align="center">
  50. <template slot-scope="scope">
  51. <span v-if="scope.row.NoEdit">{{ scope.row.ccount }}</span>
  52. <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)" />
  53. </template>
  54. </el-table-column>
  55. <el-table-column label="系数(%)" min-width="130px" align="center">
  56. <template slot-scope="scope">
  57. <span v-if="scope.row.NoEdit">{{ scope.row.ratio }}</span>
  58. <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)" />
  59. </template>
  60. </el-table-column>
  61. <el-table-column label="系数头数" min-width="130px" align="center">
  62. <template slot-scope="scope">
  63. <span v-if="scope.row.NoEdit">{{ scope.row.ccountratio }}</span>
  64. <el-input v-if="scope.row.Edit" v-model="scope.row.ccountratio" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurCcountratio(scope.row)" />
  65. </template>
  66. </el-table-column>
  67. <el-table-column label="配方模板" min-width="130px" align="center">
  68. <template slot-scope="scope">
  69. <span v-if="scope.row.NoEdit">{{ scope.row.ftname }}</span>
  70. <el-select v-if="scope.row.Edit" v-model="scope.row.ftid" filterable placeholder="配方模板" class="filter-item" style="width:95%;padding:10px 0;"@change="(value)=> {changeRecipeTemplate(value, scope.row)}">
  71. <el-option v-for="item in recipeTemplateList" :key="item.id" :label="item.tname" :value="item.id" />
  72. </el-select>
  73. </template>
  74. </el-table-column>
  75. <el-table-column v-if="table.isPtsfname" :key="8" label="补料配方" min-width="130px" align="center">
  76. <template slot-scope="scope">
  77. <span v-if="scope.row.NoEdit">{{ scope.row.ptsfname }}</span>
  78. <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)}">
  79. <el-option v-for="item in feedingFormulaList" :key="item.id" :label="item.tname" :value="item.id" />
  80. </el-select>
  81. </template>
  82. </el-table-column>
  83. <el-table-column v-if="table.isRW1" :key="9" label="第一班比例(%)" min-width="130px" align="center">
  84. <template slot-scope="scope">
  85. <span v-if="scope.row.NoEdit">{{ scope.row.r1 }}</span>
  86. <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)" />
  87. </template>
  88. </el-table-column>
  89. <el-table-column v-if="table.isRW1" :key="10" label="第一班重量" min-width="130px" align="center" :render-header="renderHeader">
  90. <template slot-scope="scope">
  91. <span v-if="scope.row.NoEdit">{{ scope.row.w1 }}</span>
  92. <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)" />
  93. </template>
  94. </el-table-column>
  95. <el-table-column v-if="table.isRW2" :key="11" label="第二班比例(%)" min-width="130px" align="center">
  96. <template slot-scope="scope">
  97. <span v-if="scope.row.NoEdit">{{ scope.row.r2 }}</span>
  98. <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)" />
  99. </template>
  100. </el-table-column>
  101. <el-table-column v-if="table.isRW2" :key="12" label="第二班重量" min-width="130px" align="center" :render-header="renderHeader">
  102. <template slot-scope="scope">
  103. <span v-if="scope.row.NoEdit">{{ scope.row.w2 }}</span>
  104. <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)" />
  105. </template>
  106. </el-table-column>
  107. <el-table-column v-if="table.isRW3" :key="13" label="第三班比例(%)" min-width="130px" align="center">
  108. <template slot-scope="scope">
  109. <span v-if="scope.row.NoEdit">{{ scope.row.r3 }}</span>
  110. <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)" />
  111. </template>
  112. </el-table-column>
  113. <el-table-column v-if="table.isRW3" :key="14" label="第三班重量" min-width="130px" align="center" :render-header="renderHeader">
  114. <template slot-scope="scope">
  115. <span v-if="scope.row.NoEdit">{{ scope.row.w3 }}</span>
  116. <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)" />
  117. </template>
  118. </el-table-column>
  119. <el-table-column v-if="table.isRW4" :key="15" label="第四班比例(%)" min-width="130px" align="center">
  120. <template slot-scope="scope">
  121. <span v-if="scope.row.NoEdit">{{ scope.row.r4 }}</span>
  122. <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)" />
  123. </template>
  124. </el-table-column>
  125. <el-table-column v-if="table.isRW4" :key="16" label="第四班重量" min-width="130px" align="center" :render-header="renderHeader">
  126. <template slot-scope="scope">
  127. <span v-if="scope.row.NoEdit">{{ scope.row.w4 }}</span>
  128. <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)" />
  129. </template>
  130. </el-table-column>
  131. <el-table-column :key="17" label="总比例(%)" min-width="130px" align="center">
  132. <template slot-scope="scope">
  133. <span>{{ scope.row.sumr }}</span>
  134. </template>
  135. </el-table-column>
  136. <el-table-column :key="18" label="投喂量" min-width="130px" align="center">
  137. <template slot-scope="scope">
  138. <span>{{ scope.row.feedweight }}</span>
  139. </template>
  140. </el-table-column>
  141. <el-table-column :key="19" label="配方重量" min-width="130px" align="center">
  142. <template slot-scope="scope">
  143. <span>{{ scope.row.ftweight }}</span>
  144. </template>
  145. </el-table-column>
  146. <el-table-column v-if="table.isPtsfname" :key="20" label="补料重量" min-width="130px" align="center">
  147. <template slot-scope="scope">
  148. <span>{{ scope.row.supplyweight }}</span>
  149. </template>
  150. </el-table-column>
  151. <el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width" fixed="right">
  152. <template slot-scope="{row}">
  153. <!-- 编辑 -->
  154. <el-button v-if="row.isUpdate" class="miniSuccess" @click="handleUpdate(row)">编辑</el-button>
  155. <!-- 编辑保存 -->
  156. <el-button v-if="row.isUpdateSave" class="miniSuccess" :disabled="isokDisable" @click="updateData(row)">保存</el-button>
  157. <el-button v-if="row.isUpdateSave" class="minCancel" @click="updateCancel(row)">取消</el-button>
  158. </template>
  159. </el-table-column>
  160. </el-table>
  161. <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
  162. </div>
  163. <!-- 历史记录 -->
  164. <el-dialog :title="textMap[history.dialogStatus]" :destroy-on-close="true" :visible.sync="history.dialogFormVisible" :close-on-click-modal="false" width="90%">
  165. <div class="app-history">
  166. <div class="search">
  167. <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" />
  168. <el-button class="successBorder" @click="handleApplication">应用</el-button>
  169. </div>
  170. <div class="table">
  171. <el-table
  172. :key="history.tableKey"
  173. v-loading="history.listLoading"
  174. element-loading-text="给我一点时间"
  175. :data="history.list"
  176. border
  177. fit
  178. highlight-current-row
  179. style="width: 100%;"
  180. :row-style="rowStyle"
  181. :cell-style="cellStyle"
  182. class="elTable table-fixed"
  183. >
  184. <el-table-column type="selection" width="50" />
  185. <el-table-column label="序号" align="center" type="index" width="50px">
  186. <template slot-scope="scope">
  187. <span>{{ scope.$index + (history.pageNum-1) * history.pageSize + 1 }}</span>
  188. </template>
  189. </el-table-column>
  190. <el-table-column label="栏舍名称" min-width="100px" align="center">
  191. <template slot-scope="scope">
  192. <span>{{ scope.row.barname }}</span>
  193. </template>
  194. </el-table-column>
  195. <el-table-column label="软件牛头数" min-width="100px" align="center">
  196. <template slot-scope="scope">
  197. <span>{{ scope.row.softccount }}</span>
  198. </template>
  199. </el-table-column>
  200. <el-table-column label="实际牛头数" min-width="130px" align="center">
  201. <template slot-scope="scope">
  202. <span v-if="scope.row.NoEdit">{{ scope.row.ccount }}</span>
  203. <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)" />
  204. </template>
  205. </el-table-column>
  206. <el-table-column label="系数(%)" min-width="130px" align="center">
  207. <template slot-scope="scope">
  208. <span v-if="scope.row.NoEdit">{{ scope.row.ratio }}</span>
  209. <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)" />
  210. </template>
  211. </el-table-column>
  212. <el-table-column label="系数头数" min-width="130px" align="center">
  213. <template slot-scope="scope">
  214. <span v-if="scope.row.NoEdit">{{ scope.row.ccountratio }}</span>
  215. <el-input v-if="scope.row.Edit" v-model="scope.row.ccountratio" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurCcountratio(scope.row)" />
  216. </template>
  217. </el-table-column>
  218. <el-table-column label="配方模板" min-width="130px" align="center">
  219. <template slot-scope="scope">
  220. <span v-if="scope.row.NoEdit">{{ scope.row.ftname }}</span>
  221. <el-select v-if="scope.row.Edit" v-model="scope.row.ftid" filterable placeholder="配方模板" class="filter-item" style="width:95%;padding:10px 0;" @change="(value)=> {changeRecipeTemplate(value, scope.row)}">
  222. <el-option v-for="item in recipeTemplateList" :key="item.id" :label="item.tname" :value="item.id" />
  223. </el-select>
  224. </template>
  225. </el-table-column>
  226. <el-table-column v-if="history.isPtsfname" label="补料配方" min-width="130px" align="center">
  227. <template slot-scope="scope">
  228. <span v-if="scope.row.NoEdit">{{ scope.row.ptsfname }}</span>
  229. <el-select v-if="scope.row.Edit" v-model="scope.row.ptsfid" filterable placeholder="补料配方" class="filter-item" style="width:95%;padding:10px 0;" @change="(value)=> {changeFeedingFormula(value, scope.row)}">
  230. <el-option v-for="item in feedingFormulaList" :key="item.id" :label="item.tname" :value="item.id" />
  231. </el-select>
  232. </template>
  233. </el-table-column>
  234. <el-table-column v-if="history.isRW1" label="第一班比例(%)" min-width="130px" align="center">
  235. <template slot-scope="scope">
  236. <span v-if="scope.row.NoEdit">{{ scope.row.r1 }}</span>
  237. <el-input v-if="scope.row.Edit" v-model="scope.row.r1" step="0.01" type="number" :disabled="scope.row.isOneWeight" style="width:95%;padding:10px 0;" @blur="blurR(scope.row)" />
  238. </template>
  239. </el-table-column>
  240. <el-table-column v-if="history.isRW1" label="第一班重量" min-width="130px" align="center">
  241. <template slot-scope="scope">
  242. <span v-if="scope.row.NoEdit">{{ scope.row.w1 }}</span>
  243. <el-input v-if="scope.row.Edit" v-model="scope.row.w1" :disabled="scope.row.isTwoWeight" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurW(scope.row)" />
  244. </template>
  245. </el-table-column>
  246. <el-table-column v-if="table.isRW2" label="第二班比例(%)" min-width="130px" align="center">
  247. <template slot-scope="scope">
  248. <span v-if="scope.row.NoEdit">{{ scope.row.r2 }}</span>
  249. <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)" />
  250. </template>
  251. </el-table-column>
  252. <el-table-column v-if="history.isRW2" label="第二班重量" min-width="130px" align="center">
  253. <template slot-scope="scope">
  254. <span v-if="scope.row.NoEdit">{{ scope.row.w2 }}</span>
  255. <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)" />
  256. </template>
  257. </el-table-column>
  258. <el-table-column v-if="history.isRW3" label="第三班比例(%)" min-width="130px" align="center">
  259. <template slot-scope="scope">
  260. <span v-if="scope.row.NoEdit">{{ scope.row.r3 }}</span>
  261. <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)" />
  262. </template>
  263. </el-table-column>
  264. <el-table-column v-if="history.isRW3" label="第三班重量" min-width="130px" align="center">
  265. <template slot-scope="scope">
  266. <span v-if="scope.row.NoEdit">{{ scope.row.w3 }}</span>
  267. <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)" />
  268. </template>
  269. </el-table-column>
  270. <el-table-column v-if="table.isRW4" label="第四班比例(%)" min-width="130px" align="center">
  271. <template slot-scope="scope">
  272. <span v-if="scope.row.NoEdit">{{ scope.row.r4 }}</span>
  273. <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)" />
  274. </template>
  275. </el-table-column>
  276. <el-table-column v-if="history.isRW4" label="第四班重量" min-width="130px" align="center">
  277. <template slot-scope="scope">
  278. <span v-if="scope.row.NoEdit">{{ scope.row.w4 }}</span>
  279. <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)" />
  280. </template>
  281. </el-table-column>
  282. <el-table-column label="总比例(%)" min-width="130px" align="center">
  283. <template slot-scope="scope">
  284. <span>{{ scope.row.sumr }}</span>
  285. </template>
  286. </el-table-column>
  287. <el-table-column label="投喂量" min-width="130px" align="center">
  288. <template slot-scope="scope">
  289. <span>{{ scope.row.feedweight }}</span>
  290. </template>
  291. </el-table-column>
  292. <el-table-column label="配方重量" min-width="130px" align="center">
  293. <template slot-scope="scope">
  294. <span>{{ scope.row.ftweight }}</span>
  295. </template>
  296. </el-table-column>
  297. <el-table-column v-if="history.isPtsfname" label="补料重量" min-width="130px" align="center">
  298. <template slot-scope="scope">
  299. <span>{{ scope.row.supplyweight }}</span>
  300. </template>
  301. </el-table-column>
  302. </el-table>
  303. <pagination v-show="history.total>0" :total="history.total" :page.sync="history.getdataListParm.offset" :limit.sync="history.getdataListParm.pagecount" @pagination="getHistoryList" />
  304. </div>
  305. <div slot="footer" class="dialog-footer">
  306. <el-button class="cancelClose" @click="history.dialogFormVisible = false; ">关闭</el-button>
  307. </div>
  308. </div>
  309. </el-dialog>
  310. <!-- 营养评估 -->
  311. <el-dialog :title="textMap[nutritional.dialogStatus]" :visible.sync="nutritional.dialogFormVisible" :close-on-click-modal="false" width="90%">
  312. <div class="app-nutritional">
  313. <h4 style="position: absolute;top:-5px;left:140px;font:18px/24px '' ;color:#303133;">栏舍:{{ nutritional.tab1.temp.barname }}</h4>
  314. <el-tabs v-model="nutritional.activeName" @tab-click="handleNutritionalTab">
  315. <el-tab-pane label="营养评估" name="first">
  316. <el-form ref="temp" :rules="rules" :model="nutritional.tab1.temp" label-position="right" label-width="95px" style="width: 100%;margin-bottom:30px">
  317. <el-row>
  318. <el-col :span="4">
  319. <el-form-item label="类别" prop="cowclassid">
  320. <el-select v-model="nutritional.tab1.temp.cowclassid" :disabled="nutritional.tab1.disabledCowclass" filterable placeholder="" class="filter-item" style="width:100%;">
  321. <el-option v-for="item in livestockTypeList" :key="item.id" :label="item.mixname" :value="item.id" />
  322. </el-select>
  323. </el-form-item>
  324. </el-col>
  325. <el-col :span="4">
  326. <el-form-item label="月龄" prop="avgmonthage">
  327. <el-input ref="avgmonthage" v-model="nutritional.tab1.temp.avgmonthage" class="filter-item" placeholder="" style="width:100%;" />
  328. </el-form-item>
  329. </el-col>
  330. <el-col :span="4">
  331. <el-form-item label="体重(kg)" prop="bw">
  332. <el-input ref="bw" v-model="nutritional.tab1.temp.bw" class="filter-item" placeholder="" style="width:100%;" />
  333. </el-form-item>
  334. </el-col>
  335. <el-col :span="4">
  336. <el-form-item label="日增重(kg)" prop="dayw">
  337. <el-input ref="dayw" v-model="nutritional.tab1.temp.dayw" class="filter-item" placeholder="" style="width:100%;" />
  338. </el-form-item>
  339. </el-col>
  340. <el-col :span="4">
  341. <el-form-item label="胎次(次)" prop="fetal">
  342. <el-input ref="fetal" v-model="nutritional.tab1.temp.fetal" class="filter-item" placeholder="" style="width:100%;" />
  343. </el-form-item>
  344. </el-col>
  345. <el-col :span="4">
  346. <el-form-item label="泌乳天数(天)" prop="avgdim">
  347. <el-input ref="avgdim" v-model="nutritional.tab1.temp.avgdim" class="filter-item" placeholder="" style="width:100%;" />
  348. </el-form-item>
  349. </el-col>
  350. </el-row>
  351. <el-row>
  352. <el-col :span="4">
  353. <el-form-item label="怀孕天数(天)" prop="dayspre">
  354. <el-input ref="dayspre" v-model="nutritional.tab1.temp.dayspre" class="filter-item" placeholder="" style="width:100%;" />
  355. </el-form-item>
  356. </el-col>
  357. <el-col :span="4">
  358. <el-form-item label="产奶量(kg)" prop="product">
  359. <el-input ref="product" v-model="nutritional.tab1.temp.product" class="filter-item" placeholder="" style="width:100%;" />
  360. </el-form-item>
  361. </el-col>
  362. <el-col :span="4">
  363. <el-form-item label="乳脂率(%)" prop="fat">
  364. <el-input ref="fat" v-model="nutritional.tab1.temp.fat" class="filter-item" placeholder="" style="width:100%;" />
  365. </el-form-item>
  366. </el-col>
  367. <el-col :span="4">
  368. <el-form-item label="乳蛋白率(%)" prop="pro">
  369. <el-input ref="pro" v-model="nutritional.tab1.temp.pro" class="filter-item" placeholder="" style="width:100%;" />
  370. </el-form-item>
  371. </el-col>
  372. <el-col :span="4">
  373. <el-form-item label="乳糖率(%)" prop="lactose">
  374. <el-input ref="lactose" v-model="nutritional.tab1.temp.lactose" class="filter-item" placeholder="" style="width:100%;" />
  375. </el-form-item>
  376. </el-col>
  377. <el-col :span="4">
  378. <el-form-item label="温度(℃)" prop="tem">
  379. <el-input ref="tem" v-model="nutritional.tab1.temp.tem" class="filter-item" placeholder="" style="width:100%;" />
  380. </el-form-item>
  381. </el-col>
  382. </el-row>
  383. </el-form>
  384. <div style="height: 50px;">
  385. <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;" />
  386. <el-button class="el-icon-arrow-left elIconArrowLeft" @click="handleBefore" />
  387. <el-button class="el-icon-arrow-right elIconArrowRight" @click="handleNext" />
  388. <el-button class="success" :disabled="isokDisable" @click="assessmentData()">评估</el-button>
  389. </div>
  390. <div class="table">
  391. <el-table
  392. :key="nutritional.tab1.tableKey"
  393. v-loading="nutritional.tab1.listLoading"
  394. element-loading-text="给我一点时间"
  395. :data="nutritional.tab1.list"
  396. border
  397. fit
  398. highlight-current-row
  399. style="width: 100%;margin-bottom:60px;"
  400. :row-style="rowStyle"
  401. :cell-style="cellStyle"
  402. class="elTable table-fixed"
  403. >
  404. <el-table-column label="序号" align="center" type="index" width="50px" />
  405. <el-table-column label="指标" min-width="130px" align="center">
  406. <template slot-scope="scope">
  407. <span>{{ scope.row.standard }}</span>
  408. </template>
  409. </el-table-column>
  410. <el-table-column label="奶牛需要" min-width="130px" align="center">
  411. <template slot-scope="scope">
  412. <span>{{ scope.row.cowneed }}</span>
  413. </template>
  414. </el-table-column>
  415. <el-table-column label="配方量" min-width="130px" align="center">
  416. <template slot-scope="scope">
  417. <span>{{ scope.row.ftpro }}</span>
  418. </template>
  419. </el-table-column>
  420. <el-table-column label="TMR料" min-width="130px" align="center">
  421. <template slot-scope="scope">
  422. <span>{{ scope.row.hprov }}</span>
  423. </template>
  424. </el-table-column>
  425. <el-table-column label="采食量" min-width="130px" align="center">
  426. <template slot-scope="scope">
  427. <span>{{ scope.row.sprov }}</span>
  428. </template>
  429. </el-table-column>
  430. </el-table>
  431. </div>
  432. </el-tab-pane>
  433. <el-tab-pane label="牛群评估" name="second">
  434. <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" />
  435. <el-button class="el-icon-arrow-left elIconArrowLeft" @click="handleBefore" />
  436. <el-button class="el-icon-arrow-right elIconArrowRight" @click="handleNext" />
  437. <el-row>
  438. <el-col :span="24">
  439. <h3 style="text-align: center;">宾州筛分析</h3>
  440. <div class="table">
  441. <el-table
  442. :key="nutritional.tab2.tableKey1"
  443. v-loading="nutritional.tab2.listLoading1"
  444. element-loading-text="给我一点时间"
  445. :data="nutritional.tab2.list1"
  446. border
  447. fit
  448. highlight-current-row
  449. style="width: 100%;margin-bottom:60px;"
  450. :row-style="rowStyle"
  451. :cell-style="cellStyle"
  452. class="elTable table-fixed"
  453. >
  454. <el-table-column label="日期" min-width="130px" align="center">
  455. <template slot-scope="scope">
  456. <span>{{ scope.row.operatetime }}</span>
  457. </template>
  458. </el-table-column>
  459. <el-table-column label="第一层重量(g)" min-width="130px" align="center">
  460. <template slot-scope="scope">
  461. <span>{{ scope.row.oneweight }}</span>
  462. </template>
  463. </el-table-column>
  464. <el-table-column label="第一层百分比" min-width="130px" align="center">
  465. <template slot-scope="scope">
  466. <span>{{ scope.row.onerate }}</span>
  467. </template>
  468. </el-table-column>
  469. <el-table-column label="第二层重量(g)" min-width="130px" align="center">
  470. <template slot-scope="scope">
  471. <span>{{ scope.row.twoweight }}</span>
  472. </template>
  473. </el-table-column>
  474. <el-table-column label="第二层百分比" min-width="130px" align="center">
  475. <template slot-scope="scope">
  476. <span>{{ scope.row.tworate }}</span>
  477. </template>
  478. </el-table-column>
  479. <el-table-column label="第三层重量(g)" min-width="130px" align="center">
  480. <template slot-scope="scope">
  481. <span>{{ scope.row.threeweight }}</span>
  482. </template>
  483. </el-table-column>
  484. <el-table-column label="第三层百分比" min-width="130px" align="center">
  485. <template slot-scope="scope">
  486. <span>{{ scope.row.threerate }}</span>
  487. </template>
  488. </el-table-column>
  489. <el-table-column label="第四层重量(g)" min-width="130px" align="center">
  490. <template slot-scope="scope">
  491. <span>{{ scope.row.fourweight }}</span>
  492. </template>
  493. </el-table-column>
  494. <el-table-column label="第四层百分比" min-width="130px" align="center">
  495. <template slot-scope="scope">
  496. <span>{{ scope.row.fourrate }}</span>
  497. </template>
  498. </el-table-column>
  499. <el-table-column label="参考标准" min-width="130px" align="center">
  500. <template slot-scope="scope">
  501. <span>{{ scope.row.standard }}</span>
  502. </template>
  503. </el-table-column>
  504. </el-table>
  505. </div>
  506. </el-col>
  507. </el-row>
  508. <el-row>
  509. <el-col :span="24">
  510. <h3 style="text-align: center;">粪便筛分析</h3>
  511. <div class="table">
  512. <el-table
  513. :key="nutritional.tab2.tableKey2"
  514. v-loading="nutritional.tab2.listLoading2"
  515. element-loading-text="给我一点时间"
  516. :data="nutritional.tab2.list2"
  517. border
  518. fit
  519. highlight-current-row
  520. style="width: 100%;margin-bottom:60px;"
  521. :row-style="rowStyle"
  522. :cell-style="cellStyle"
  523. class="elTable table-fixed"
  524. >
  525. <el-table-column label="日期" min-width="130px" align="center">
  526. <template slot-scope="scope">
  527. <span>{{ scope.row.operatetime }}</span>
  528. </template>
  529. </el-table-column>
  530. <el-table-column label="第一层重量(g)" min-width="130px" align="center">
  531. <template slot-scope="scope">
  532. <span>{{ scope.row.oneweight }}</span>
  533. </template>
  534. </el-table-column>
  535. <el-table-column label="第一层百分比" min-width="130px" align="center">
  536. <template slot-scope="scope">
  537. <span>{{ scope.row.onerate }}</span>
  538. </template>
  539. </el-table-column>
  540. <el-table-column label="第二层重量(g)" min-width="130px" align="center">
  541. <template slot-scope="scope">
  542. <span>{{ scope.row.twoweight }}</span>
  543. </template>
  544. </el-table-column>
  545. <el-table-column label="第二层百分比" min-width="130px" align="center">
  546. <template slot-scope="scope">
  547. <span>{{ scope.row.tworate }}</span>
  548. </template>
  549. </el-table-column>
  550. <el-table-column label="第三层重量(g)" min-width="130px" align="center">
  551. <template slot-scope="scope">
  552. <span>{{ scope.row.threeweight }}</span>
  553. </template>
  554. </el-table-column>
  555. <el-table-column label="第三层百分比" min-width="130px" align="center">
  556. <template slot-scope="scope">
  557. <span>{{ scope.row.threerate }}</span>
  558. </template>
  559. </el-table-column>
  560. <el-table-column label="参考标准" min-width="130px" align="center">
  561. <template slot-scope="scope">
  562. <span>{{ scope.row.standard }}</span>
  563. </template>
  564. </el-table-column>
  565. </el-table>
  566. </div>
  567. </el-col>
  568. </el-row>
  569. <el-row>
  570. <el-col :span="24">
  571. <h3 style="text-align: center;">BCS评分</h3>
  572. <div class="table">
  573. <el-table
  574. :key="nutritional.tab2.tableKey3"
  575. v-loading="nutritional.tab2.listLoading3"
  576. element-loading-text="给我一点时间"
  577. :data="nutritional.tab2.list3"
  578. border
  579. fit
  580. highlight-current-row
  581. style="width: 100%;margin-bottom:60px;"
  582. :row-style="rowStyle"
  583. :cell-style="cellStyle"
  584. class="elTable table-fixed"
  585. >
  586. <el-table-column label="日期" min-width="130px" align="center">
  587. <template slot-scope="scope">
  588. <span>{{ scope.row.operatetime }}</span>
  589. </template>
  590. </el-table-column>
  591. <el-table-column label="抽查样本数" min-width="130px" align="center">
  592. <template slot-scope="scope">
  593. <span>{{ scope.row.sumcowcount }}</span>
  594. </template>
  595. </el-table-column>
  596. <el-table-column label="单产(kg/头)" min-width="130px" align="center">
  597. <template slot-scope="scope">
  598. <span>{{ scope.row.product }}</span>
  599. </template>
  600. </el-table-column>
  601. <el-table-column label="物质采食量(kg/头)" min-width="130px" align="center">
  602. <template slot-scope="scope">
  603. <span>{{ scope.row.cowneed }}</span>
  604. </template>
  605. </el-table-column>
  606. <el-table-column label="泌乳天数" min-width="130px" align="center">
  607. <template slot-scope="scope">
  608. <span>{{ scope.row.avgdim }}</span>
  609. </template>
  610. </el-table-column>
  611. <el-table-column label="标准分数" min-width="130px" align="center">
  612. <template slot-scope="scope">
  613. <span>{{ scope.row.standardscore }}</span>
  614. </template>
  615. </el-table-column>
  616. <el-table-column label="2.5-分(数量、百分比)" min-width="130px" align="center">
  617. <template slot-scope="scope">
  618. <span>{{ scope.row.score25 }}</span>
  619. </template>
  620. </el-table-column>
  621. <el-table-column label="2.75分(数量、百分比)" min-width="130px" align="center">
  622. <template slot-scope="scope">
  623. <span>{{ scope.row.score275 }}</span>
  624. </template>
  625. </el-table-column>
  626. <el-table-column label="3分(数量、百分比)" min-width="130px" align="center">
  627. <template slot-scope="scope">
  628. <span>{{ scope.row.score3 }}</span>
  629. </template>
  630. </el-table-column>
  631. <el-table-column label="3.25分(数量、百分比)" min-width="130px" align="center">
  632. <template slot-scope="scope">
  633. <span>{{ scope.row.score325 }}</span>
  634. </template>
  635. </el-table-column>
  636. <el-table-column label="3.5分(数量、百分比)" min-width="130px" align="center">
  637. <template slot-scope="scope">
  638. <span>{{ scope.row.feedprov }}</span>
  639. </template>
  640. </el-table-column>
  641. <el-table-column label="3.75分(数量、百分比)" min-width="130px" align="center">
  642. <template slot-scope="scope">
  643. <span>{{ scope.row.score375 }}</span>
  644. </template>
  645. </el-table-column>
  646. <el-table-column label="4+分(数量、百分比)" min-width="130px" align="center">
  647. <template slot-scope="scope">
  648. <span>{{ scope.row.score4 }}</span>
  649. </template>
  650. </el-table-column>
  651. </el-table>
  652. </div>
  653. </el-col>
  654. </el-row>
  655. <el-row>
  656. <el-col :span="24">
  657. <h3 style="text-align: center;">粪便评分</h3>
  658. <div class="table">
  659. <el-table
  660. :key="nutritional.tab2.tableKey4"
  661. v-loading="nutritional.tab2.listLoading4"
  662. element-loading-text="给我一点时间"
  663. :data="nutritional.tab2.list4"
  664. border
  665. fit
  666. highlight-current-row
  667. style="width: 100%;margin-bottom:60px;"
  668. :row-style="rowStyle"
  669. :cell-style="cellStyle"
  670. class="elTable table-fixed"
  671. >
  672. <el-table-column label="日期" min-width="130px" align="center">
  673. <template slot-scope="scope">
  674. <span>{{ scope.row.operatetime }}</span>
  675. </template>
  676. </el-table-column>
  677. <el-table-column label="抽查样本数" min-width="130px" align="center">
  678. <template slot-scope="scope">
  679. <span>{{ scope.row.sumcowcount }}</span>
  680. </template>
  681. </el-table-column>
  682. <el-table-column label="单产(kg/头)" min-width="130px" align="center">
  683. <template slot-scope="scope">
  684. <span>{{ scope.row.product }}</span>
  685. </template>
  686. </el-table-column>
  687. <el-table-column label="干物质采食量(kg/头)" min-width="130px" align="center">
  688. <template slot-scope="scope">
  689. <span>{{ scope.row.cowneed }}</span>
  690. </template>
  691. </el-table-column>
  692. <el-table-column label="泌乳天数" min-width="130px" align="center">
  693. <template slot-scope="scope">
  694. <span>{{ scope.row.avgdim }}</span>
  695. </template>
  696. </el-table-column>
  697. <el-table-column label="标准分数" min-width="130px" align="center">
  698. <template slot-scope="scope">
  699. <span>{{ scope.row.cowneed }}</span>
  700. </template>
  701. </el-table-column>
  702. <el-table-column label="1分(数量、百分比)" min-width="130px" align="center">
  703. <template slot-scope="scope">
  704. <span>{{ scope.row.score1 }}</span>
  705. </template>
  706. </el-table-column>
  707. <el-table-column label="2分(数量、百分比)" min-width="130px" align="center">
  708. <template slot-scope="scope">
  709. <span>{{ scope.row.score2 }}</span>
  710. </template>
  711. </el-table-column>
  712. <el-table-column label="3分(数量、百分比)" min-width="130px" align="center">
  713. <template slot-scope="scope">
  714. <span>{{ scope.row.score3 }}</span>
  715. </template>
  716. </el-table-column>
  717. <el-table-column label="4分(数量、百分比)" min-width="130px" align="center">
  718. <template slot-scope="scope">
  719. <span>{{ scope.row.score4 }}</span>
  720. </template>
  721. </el-table-column>
  722. <el-table-column label="5分(数量、百分比)" min-width="130px" align="center">
  723. <template slot-scope="scope">
  724. <span>{{ scope.row.score5 }}</span>
  725. </template>
  726. </el-table-column>
  727. </el-table>
  728. </div>
  729. </el-col>
  730. </el-row>
  731. </el-tab-pane>
  732. </el-tabs>
  733. <div slot="footer" class="dialog-footer" style="bottom: 0;">
  734. <el-button class="cancelClose" @click="nutritional.dialogFormVisible = false; ">关闭</el-button>
  735. </div>
  736. </div>
  737. </el-dialog>
  738. </div>
  739. </template>
  740. <script>
  741. import { GetDataByName, GETNurJudge, GetDataByNames, compareSort, ExecDataByConfig, failproccess, PostDataByName, formatNum } from '@/api/common'
  742. import Pagination from '@/components/Pagination'
  743. import { parseTime } from '@/utils/index.js'
  744. import { MessageBox } from 'element-ui'
  745. import Cookies from 'js-cookie'
  746. export default {
  747. inject: ['reload'],
  748. name: 'DhedFormula',
  749. components: { Pagination },
  750. data() {
  751. return {
  752. pickerMinDate: '',
  753. pickerOptions: {
  754. onPick: ({ maxDate, minDate }) => {
  755. this.pickerMinDate = minDate.getTime()
  756. if (maxDate) {
  757. this.pickerMinDate = ''
  758. }
  759. },
  760. // 限制不能选择今天之后的日期
  761. disabledDate: (time) => {
  762. if (this.pickerMinDate !== '') {
  763. const one = 31 * 24 * 3600 * 1000
  764. const minTime = this.pickerMinDate - one
  765. let maxTime = this.pickerMinDate + one
  766. if (maxTime > new Date()) {
  767. maxTime = new Date()
  768. }
  769. return time.getTime() < minTime - 8.64e7 || time.getTime() > maxTime - 8.64e7
  770. }
  771. return time.getTime() > Date.now() - 8.64e7
  772. }
  773. },
  774. requestParams: [
  775. { name: 'getFTSWList', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
  776. { name: 'getFTBLList', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
  777. { name: 'getCowclassListEnable', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }}
  778. ],
  779. recipeTemplateList: [], // 配方模板
  780. feedingFormulaList: [], // 补料配方
  781. livestockTypeList: [], // 类别
  782. rules: {
  783. cowclassid: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }]
  784. },
  785. table: {
  786. getdataListParm: {
  787. name: 'getFPList',
  788. page: 1,
  789. offset: 1,
  790. pagecount: 10,
  791. returntype: 'Map',
  792. parammaps: {
  793. pastureid: Cookies.get('pastureid'),
  794. enable: ''
  795. }
  796. },
  797. tableKey: 0,
  798. list: [],
  799. total: 0,
  800. listLoading: true,
  801. temp: {},
  802. rwList: [],
  803. isPtsfname: false, // 补料配方/补料重量
  804. getdataListParm2: {
  805. name: 'getSysoptEnable',
  806. page: 1,
  807. offset: 1,
  808. pagecount: 1,
  809. returntype: 'Map',
  810. parammaps: {
  811. pastureid: Cookies.get('pastureid'),
  812. inforname: 'isEnableSupplyFeed'
  813. }
  814. },
  815. isRW1: false, // 第一班
  816. isRW2: false, // 第二班
  817. isRW3: false, // 第三班
  818. isRW4: false, // 第四班
  819. getdataListParm3: {
  820. name: 'getSysoptEnable1',
  821. page: 1,
  822. offset: 1,
  823. pagecount: 1,
  824. returntype: 'Map',
  825. parammaps: {
  826. pastureid: Cookies.get('pastureid'),
  827. inforname: 'times'
  828. }
  829. },
  830. RWLength: '' // 班次长度
  831. },
  832. selectList: [],
  833. // 营养评估
  834. nutritional: {
  835. dialogFormVisible: false,
  836. dialogStatus: '',
  837. activeName: 'first ',
  838. tab1: {
  839. inputDatetime: [new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 1), new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 1)],
  840. listLoading1: true,
  841. getdataListParm1: {
  842. name: 'getnurj',
  843. page: 1,
  844. offset: 1,
  845. pagecount: 10,
  846. returntype: 'Map',
  847. parammaps: {
  848. pastureid: '',
  849. barid: ''
  850. }
  851. },
  852. disabledCowclass: false,
  853. temp: {},
  854. tableKey: 0,
  855. list: [],
  856. total: 0,
  857. listLoading2: true,
  858. getdataListParm2: {
  859. name: 'GETNurJudge',
  860. page: 1,
  861. offset: 1,
  862. pagecount: 10,
  863. returntype: 'Map',
  864. parammaps: {
  865. pastureid: '',
  866. cowclassid: ''
  867. }
  868. }
  869. },
  870. tab2: {
  871. inputDatetime: [new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 1), new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 1)],
  872. listLoading1: true,
  873. tableKey1: 0,
  874. list1: [],
  875. total1: 0,
  876. getdataListParm1: {
  877. name: 'getPennsieveList',
  878. page: 1,
  879. offset: 1,
  880. pagecount: 10,
  881. returntype: 'Map',
  882. parammaps: {
  883. pastureid: '',
  884. barid: '',
  885. startTime: '',
  886. stopTime: '',
  887. inputDatetime: ''
  888. }
  889. },
  890. listLoading2: true,
  891. tableKey2: 0,
  892. list2: [],
  893. total2: 0,
  894. getdataListParm2: {
  895. name: 'getDungsieveList',
  896. page: 1,
  897. offset: 1,
  898. pagecount: 10,
  899. returntype: 'Map',
  900. parammaps: {
  901. pastureid: '',
  902. barid: '',
  903. startTime: '',
  904. stopTime: '',
  905. inputDatetime: ''
  906. }
  907. },
  908. listLoading3: true,
  909. tableKey3: 0,
  910. list3: [],
  911. total3: 0,
  912. getdataListParm3: {
  913. name: 'getBodyscoreList',
  914. page: 1,
  915. offset: 1,
  916. pagecount: 10,
  917. returntype: 'Map',
  918. parammaps: {
  919. pastureid: '',
  920. barid: '',
  921. startTime: '',
  922. stopTime: '',
  923. inputDatetime: ''
  924. }
  925. },
  926. listLoading4: true,
  927. tableKey4: 0,
  928. list4: [],
  929. total4: 0,
  930. getdataListParm4: {
  931. name: 'getDungscoreList',
  932. page: 1,
  933. offset: 1,
  934. pagecount: 10,
  935. returntype: 'Map',
  936. parammaps: {
  937. pastureid: '',
  938. barid: '',
  939. startTime: '',
  940. stopTime: '',
  941. inputDatetime: ''
  942. }
  943. }
  944. }
  945. },
  946. history: {
  947. dialogFormVisible: false,
  948. dialogStatus: '',
  949. temp: {},
  950. rules: {},
  951. tableKey: 0,
  952. list: [],
  953. total: 0,
  954. listLoading: true,
  955. getdataListParm: {
  956. name: 'getFPListDate',
  957. page: 1,
  958. offset: 1,
  959. pagecount: 10,
  960. returntype: 'Map',
  961. parammaps: {
  962. pastureid: Cookies.get('pastureid'),
  963. date: ''
  964. }
  965. },
  966. isPtsfname: false, // 补料配方/补料重量
  967. getdataListParm2: {
  968. name: 'getSysoptEnable',
  969. page: 1,
  970. offset: 1,
  971. pagecount: 1,
  972. returntype: 'Map',
  973. parammaps: {
  974. pastureid: Cookies.get('pastureid'),
  975. inforname: 'isEnableSupplyFeed'
  976. }
  977. },
  978. isRW1: false, // 第一班
  979. isRW2: false, // 第二班
  980. isRW3: false, // 第三班
  981. isRW4: false, // 第四班
  982. getdataListParm3: {
  983. name: 'getSysoptEnable1',
  984. page: 1,
  985. offset: 1,
  986. pagecount: 1,
  987. returntype: 'Map',
  988. parammaps: {
  989. pastureid: Cookies.get('pastureid'),
  990. inforname: 'times'
  991. }
  992. },
  993. getdataDateParm: {
  994. name: 'getFPMaxDate',
  995. page: 1,
  996. offset: 1,
  997. pagecount: 10,
  998. returntype: 'Map',
  999. parammaps: {
  1000. pastureid: Cookies.get('pastureid')
  1001. }
  1002. }
  1003. },
  1004. textMap: {
  1005. Nutritional: '营养评估',
  1006. history: '历史记录'
  1007. },
  1008. focusWRow: {}, // 一班重量得到焦点暂存
  1009. focusWRow2: {}, // 2班重量得到焦点暂存
  1010. focusWRow3: {}, // 3班重量得到焦点暂存
  1011. focusWRow4: {}, // 4班重量得到焦点暂存
  1012. requestParam: {},
  1013. isokDisable: false,
  1014. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  1015. cellStyle: { padding: 0 + 'px' }
  1016. }
  1017. },
  1018. created() {
  1019. this.getIsDisplay()
  1020. this.getDownList()
  1021. },
  1022. methods: {
  1023. getDownList() {
  1024. GetDataByNames(this.requestParams).then(response => {
  1025. this.recipeTemplateList = response.data.getFTSWList.list
  1026. this.feedingFormulaList = response.data.getFTBLList.list
  1027. this.livestockTypeList = response.data.getCowclassListEnable.list
  1028. })
  1029. },
  1030. getIsDisplay() {
  1031. GetDataByName(this.table.getdataListParm2).then(response => {
  1032. console.log(response.data.list[0].inforvalue)
  1033. if (response.data.list !== null) {
  1034. if (response.data.list[0].inforvalue == 0) {
  1035. this.table.isPtsfname = false
  1036. } else {
  1037. this.table.isPtsfname = true
  1038. }
  1039. }
  1040. })
  1041. GetDataByName(this.table.getdataListParm3).then(response => {
  1042. console.log(response.data.list[0].inforvalue)
  1043. if (response.data.list !== null) {
  1044. this.table.RWLength = response.data.list[0].inforvalue
  1045. if (response.data.list[0].inforvalue == 1) {
  1046. this.table.isRW1 = true
  1047. this.table.isRW2 = false
  1048. this.table.isRW3 = false
  1049. this.table.isRW4 = false
  1050. } else if (response.data.list[0].inforvalue == 2) {
  1051. this.table.isRW1 = true
  1052. this.table.isRW2 = true
  1053. this.table.isRW3 = false
  1054. this.table.isRW4 = false
  1055. } else if (response.data.list[0].inforvalue == 3) {
  1056. this.table.isRW1 = true
  1057. this.table.isRW2 = true
  1058. this.table.isRW3 = true
  1059. this.table.isRW4 = false
  1060. } else if (response.data.list[0].inforvalue == 4) {
  1061. this.table.isRW1 = true
  1062. this.table.isRW2 = true
  1063. this.table.isRW3 = true
  1064. this.table.isRW4 = true
  1065. }
  1066. } else {
  1067. this.table.isRW1 = false
  1068. this.table.isRW2 = false
  1069. this.table.isRW3 = false
  1070. this.table.isRW4 = false
  1071. }
  1072. })
  1073. this.getList()
  1074. },
  1075. getList() {
  1076. this.table.listLoading = true
  1077. GetDataByName(this.table.getdataListParm).then(response => {
  1078. console.log('table数据', response.data.list)
  1079. if (response.data.list !== null) {
  1080. for (let i = 0; i < response.data.list.length; i++) {
  1081. this.$set(response.data.list[i], 'Edit', false) // 编辑
  1082. this.$set(response.data.list[i], 'NoEdit', true) // 不可编辑/输入
  1083. this.$set(response.data.list[i], 'isUpdate', true) // 编辑操作
  1084. this.$set(response.data.list[i], 'isUpdateSave', false) // 编辑保存
  1085. if (response.data.list[i].ftid == undefined || response.data.list[i].ftname == '') {
  1086. this.$set(response.data.list[i], 'ftid', '')
  1087. this.$set(response.data.list[i], 'ftname', '')
  1088. }
  1089. if (response.data.list[i].ptsfid == undefined || response.data.list[i].ptsfname == '') {
  1090. this.$set(response.data.list[i], 'ptsfid', '')
  1091. this.$set(response.data.list[i], 'ptsfname', '')
  1092. }
  1093. if (response.data.list[i].ccount == undefined) {
  1094. this.$set(response.data.list[i], 'ccount', '')
  1095. }
  1096. if (response.data.list[i].softccount == undefined) {
  1097. this.$set(response.data.list[i], 'softccount', '')
  1098. }
  1099. if (response.data.list[i].ratio == undefined) {
  1100. this.$set(response.data.list[i], 'ratio', 100)
  1101. }
  1102. if (response.data.list[i].ccountratio == undefined) {
  1103. this.$set(response.data.list[i], 'ccountratio', '')
  1104. }
  1105. if (response.data.list[i].r1 == undefined) {
  1106. this.$set(response.data.list[i], 'r1', '')
  1107. }
  1108. if (response.data.list[i].r2 == undefined) {
  1109. this.$set(response.data.list[i], 'r2', '')
  1110. }
  1111. if (response.data.list[i].r3 == undefined) {
  1112. this.$set(response.data.list[i], 'r3', '')
  1113. }
  1114. if (response.data.list[i].r4 == undefined) {
  1115. this.$set(response.data.list[i], 'r4', '')
  1116. }
  1117. if (response.data.list[i].w1 == undefined) {
  1118. this.$set(response.data.list[i], 'w1', '')
  1119. }
  1120. if (response.data.list[i].w2 == undefined) {
  1121. this.$set(response.data.list[i], 'w2', '')
  1122. }
  1123. if (response.data.list[i].w3 == undefined) {
  1124. this.$set(response.data.list[i], 'w3', '')
  1125. }
  1126. if (response.data.list[i].w4 == undefined) {
  1127. this.$set(response.data.list[i], 'w4', '')
  1128. }
  1129. if (response.data.list[i].supplyweight == undefined) {
  1130. this.$set(response.data.list[i], 'supplyweight', '')
  1131. }
  1132. if (response.data.list[i].feedweight == undefined) {
  1133. this.$set(response.data.list[i], 'feedweight', '')
  1134. }
  1135. if (response.data.list[i].Bfweight == undefined) {
  1136. this.$set(response.data.list[i], 'Bfweight', '')
  1137. }
  1138. if (response.data.list[i].Sfweight == undefined) {
  1139. this.$set(response.data.list[i], 'Sfweight', '')
  1140. }
  1141. if (response.data.list[i].isOneWeight == undefined) {
  1142. this.$set(response.data.list[i], 'isOneWeight', false)
  1143. }
  1144. if (response.data.list[i].isTwoWeight == undefined) {
  1145. this.$set(response.data.list[i], 'isTwoWeight', false)
  1146. }
  1147. if (response.data.list[i].isThreeWeight == undefined) {
  1148. this.$set(response.data.list[i], 'isThreeWeight', false)
  1149. }
  1150. if (response.data.list[i].isFourWeight == undefined) {
  1151. this.$set(response.data.list[i], 'isFourWeight', false)
  1152. }
  1153. if (response.data.list[i].timesopt !== undefined) {
  1154. var timesoptArr = response.data.list[i].timesopt.split(',')
  1155. for (let j = 0; j < timesoptArr.length; j++) {
  1156. response.data.list[i]['r' + timesoptArr[j].split(':')[0]] = timesoptArr[j].split(':')[1]
  1157. response.data.list[i]['w' + timesoptArr[j].split(':')[0]] = timesoptArr[j].split(':')[2]
  1158. }
  1159. }
  1160. }
  1161. // console.log(response.data.list, sumr)
  1162. for (let i = 0; i < response.data.list.length; i++) {
  1163. if (response.data.list[i].r1 == '') {
  1164. response.data.list[i].r1 = 0
  1165. }
  1166. if (response.data.list[i].r2 == '') {
  1167. response.data.list[i].r2 = 0
  1168. }
  1169. if (response.data.list[i].r3 == '') {
  1170. response.data.list[i].r3 = 0
  1171. }
  1172. if (response.data.list[i].r4 == '') {
  1173. response.data.list[i].r4 = 0
  1174. }
  1175. 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))
  1176. response.data.list[i].sumr = formatNum(response.data.list[i].sumr, 2)
  1177. }
  1178. this.table.list = response.data.list
  1179. console.log(this.table.list, 'this.table.list')
  1180. this.table.pageNum = response.data.pageNum
  1181. this.table.pageSize = response.data.pageSize
  1182. this.table.total = response.data.total
  1183. } else {
  1184. this.table.list = []
  1185. }
  1186. setTimeout(() => {
  1187. this.table.listLoading = false
  1188. }, 100)
  1189. })
  1190. },
  1191. renderHeader(h, { column, $index }) { // h即为cerateElement的简写,具体可看vue官方文档
  1192. // console.log(column)
  1193. return h(
  1194. 'div',
  1195. [
  1196. h('span', column.label),
  1197. h('i', {
  1198. class: 'el-icon-unlock',
  1199. ref: 'el-icon-unlock',
  1200. style: 'margin-left:5px;'
  1201. })
  1202. ]
  1203. )
  1204. },
  1205. headerClick(column, event) {
  1206. console.log(column, event)
  1207. if (column.label == '第一班重量') {
  1208. for (let i = 0; i < this.table.list.length; i++) {
  1209. if (this.table.list[i].Edit == true) {
  1210. if (event.target.outerHTML == '<i class="el-icon-unlock" style="margin-left: 5px;"></i>') {
  1211. event.target.className = 'el-icon-lock'
  1212. this.$set(this.table.list[i], 'isOneWeight', true) // 锁住不可编辑
  1213. } else if (event.target.outerHTML == '<i class="el-icon-lock" style="margin-left: 5px;"></i>') {
  1214. event.target.className = 'el-icon-unlock'
  1215. this.$set(this.table.list[i], 'isOneWeight', false) // 解锁可编辑
  1216. }
  1217. }
  1218. }
  1219. } else if (column.label == '第二班重量') {
  1220. for (let i = 0; i < this.table.list.length; i++) {
  1221. if (this.table.list[i].Edit == true) {
  1222. if (event.target.outerHTML == '<i class="el-icon-unlock" style="margin-left: 5px;"></i>') {
  1223. event.target.className = 'el-icon-lock'
  1224. this.$set(this.table.list[i], 'isTwoWeight', true) // 锁住不可编辑
  1225. } else if (event.target.outerHTML == '<i class="el-icon-lock" style="margin-left: 5px;"></i>') {
  1226. event.target.className = 'el-icon-unlock'
  1227. this.$set(this.table.list[i], 'isTwoWeight', false) // 解锁可编辑
  1228. }
  1229. }
  1230. }
  1231. } else if (column.label == '第三班重量') {
  1232. for (let i = 0; i < this.table.list.length; i++) {
  1233. if (this.table.list[i].Edit == true) {
  1234. if (event.target.outerHTML == '<i class="el-icon-unlock" style="margin-left: 5px;"></i>') {
  1235. event.target.className = 'el-icon-lock'
  1236. this.$set(this.table.list[i], 'isThreeWeight', true) // 锁住不可编辑
  1237. } else if (event.target.outerHTML == '<i class="el-icon-lock" style="margin-left: 5px;"></i>') {
  1238. event.target.className = 'el-icon-unlock'
  1239. this.$set(this.table.list[i], 'isThreeWeight', false) // 解锁可编辑
  1240. }
  1241. }
  1242. }
  1243. } else if (column.label == '第四班重量') {
  1244. for (let i = 0; i < this.table.list.length; i++) {
  1245. if (this.table.list[i].Edit == true) {
  1246. if (event.target.outerHTML == '<i class="el-icon-unlock" style="margin-left: 5px;"></i>') {
  1247. event.target.className = 'el-icon-lock'
  1248. this.$set(this.table.list[i], 'isFourWeight', true) // 锁住不可编辑
  1249. } else if (event.target.outerHTML == '<i class="el-icon-lock" style="margin-left: 5px;"></i>') {
  1250. event.target.className = 'el-icon-unlock'
  1251. this.$set(this.table.list[i], 'isFourWeight', false) // 解锁可编辑
  1252. }
  1253. }
  1254. }
  1255. }
  1256. },
  1257. // 配方模板
  1258. changeRecipeTemplate(item, row) {
  1259. console.log(row.supplyweight, 'row.supplyweight')
  1260. row.ftname = this.recipeTemplateList.find(obj => obj.id == item).tname
  1261. row.Sfweight = this.recipeTemplateList.find(obj => obj.id == item).Sfweight// Sfweight
  1262. row.SfweightLock = this.recipeTemplateList.find(obj => obj.id == item).SfweightLock// SfweightLock
  1263. // 补料重量supplyweight
  1264. // 配方重量ftweight
  1265. // 系数头数ccountratio
  1266. // 投喂量feedweight
  1267. // 实际牛头数ccount
  1268. // 投喂量 = 配方重量 + 补料重量
  1269. // 配方重量 = Sfweight * 系数头数 + SfweightLock * 实际牛头数ccount
  1270. console.log(row.Sfweight, 'row.Sfweight')
  1271. console.log(row.ccountratio, '系数头数')
  1272. console.log(row.SfweightLock, 'SfweightLock')
  1273. console.log(row.ccount, '实际牛头数')
  1274. if (row.Sfweight !== '' && row.ccount !== '') {
  1275. this.$set(row, 'ftweight', formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), 2))
  1276. } else {
  1277. row.ftweight = ''
  1278. }
  1279. // console.log(row.ftweight, 'row.ftweight')
  1280. // console.log(row.supplyweight, 'row.supplyweight')
  1281. // console.log(this.table.isPtsfname, 'isPtsfname')
  1282. if (this.table.isPtsfname == false) {
  1283. row.feedweight = formatNum(parseFloat(row.ftweight), 2)
  1284. } else {
  1285. if (row.supplyweight == 'NaN') {
  1286. row.supplyweight = 0
  1287. }
  1288. console.log(row.supplyweight)
  1289. if (row.supplyweight !== '' && row.ftweight !== '') {
  1290. row.feedweight = formatNum(parseFloat(row.supplyweight) + parseFloat(row.ftweight), 2)
  1291. } else if (row.supplyweight == '' && row.ftweight !== '') {
  1292. row.feedweight = formatNum(parseFloat(row.ftweight), 2)
  1293. } else if (row.supplyweight !== '' && row.ftweight !== '') {
  1294. row.feedweight = formatNum(parseFloat(row.supplyweight), 2)
  1295. }
  1296. if (row.ccountratio !== '' && row.ftweight !== '') {
  1297. row.ftweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), 2)
  1298. }
  1299. if (row.Sfweight !== '' && row.ccount !== '') {
  1300. this.$set(row, 'ftweight', formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), 2))
  1301. } else {
  1302. row.ftweight = ''
  1303. }
  1304. }
  1305. console.log(row.supplyweight)
  1306. if (row.supplyweight == 'NaN') { row.supplyweight = 0 }
  1307. if (row.r1 !== '') { this.$set(row, 'w1', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r1) / 100), 2)) }
  1308. if (row.r2 !== '') { this.$set(row, 'w2', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r2) / 100), 2)) }
  1309. if (row.r3 !== '') { this.$set(row, 'w3', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r3) / 100), 2)) }
  1310. if (row.r4 !== '') { this.$set(row, 'w4', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r4) / 100), 2)) }
  1311. },
  1312. // 补料配方
  1313. changeFeedingFormula(item, row) {
  1314. console.log(item, '=========')
  1315. // 补料重量supplyweight
  1316. // 配方重量ftweight
  1317. // 系数头数ccountratio
  1318. // 投喂量feedweight
  1319. // 实际牛头数ccount
  1320. // 投喂量 = 配方重量 + 补料重量
  1321. if (item !== '') {
  1322. console.log(456)
  1323. row.ptsfname = this.feedingFormulaList.find(obj => obj.id == item).tname
  1324. row.BLweight = this.feedingFormulaList.find(obj => obj.id == item).Sfweight
  1325. row.BLSfweightLock = this.feedingFormulaList.find(obj => obj.id == item).SfweightLock
  1326. } else {
  1327. row.ptsfname = ''
  1328. row.BLweight = 0
  1329. row.BLSfweightLock = 0
  1330. }
  1331. // 配方重量 = 系数头数 * Sfweight
  1332. // if (row.ccountratio !== '' && row.ftweight !== '') {
  1333. // row.ftweight = parseFloat(row.Sfweight) * parseFloat(row.ccountratio)
  1334. // }
  1335. // 补料重量 = 系数头数 * BLweight
  1336. // console.log(row.ccountratio)
  1337. // console.log(row.ccount)
  1338. // console.log(row.BLweight)
  1339. // console.log(row.BLSfweightLock)
  1340. if (row.ccountratio !== '' && row.ccount !== '' && row.ccount.BLweight !== '' && row.BLSfweightLock !== '') {
  1341. this.$set(row, 'supplyweight', formatNum(parseFloat(row.BLweight) * parseFloat(row.ccountratio) + parseFloat(row.BLSfweightLock) * parseFloat(row.ccount), 2))
  1342. } else {
  1343. row.supplyweight = ''
  1344. }
  1345. if (this.table.isPtsfname == false) {
  1346. row.feedweight = parseFloat(row.ftweight)
  1347. } else {
  1348. if (row.supplyweight !== '' && row.ftweight !== '') {
  1349. row.feedweight = formatNum(parseFloat(row.supplyweight) + parseFloat(row.ftweight), 2)
  1350. } else if (row.supplyweight == '' && row.ftweight !== '') {
  1351. row.feedweight = formatNum(parseFloat(row.ftweight), 2)
  1352. } else if (row.supplyweight !== '' && row.ftweight == '') {
  1353. row.feedweight = formatNum(parseFloat(row.supplyweight), 2)
  1354. }
  1355. // if (row.ccountratio !== '' && row.ftweight !== '') {
  1356. // row.ftweight = parseFloat(row.Sfweight) * parseFloat(row.ccountratio)
  1357. // }
  1358. // if (row.ccountratio !== '' && row.BLweight !== '') {
  1359. // row.supplyweight = parseFloat(row.BLweight) * parseFloat(row.ccountratio)
  1360. // }
  1361. }
  1362. if (row.r1 !== '') { this.$set(row, 'w1', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r1) / 100), 2)) }
  1363. if (row.r2 !== '') { this.$set(row, 'w2', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r2) / 100), 2)) }
  1364. if (row.r3 !== '') { this.$set(row, 'w3', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r3) / 100), 2)) }
  1365. if (row.r4 !== '') { this.$set(row, 'w4', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r4) / 100), 2)) }
  1366. },
  1367. // 实际牛头数失去焦点计算
  1368. // ccount实际牛头数
  1369. // ratio系数
  1370. // ccountratio系数牛头数
  1371. blurCcount(row) { // 实际牛头数
  1372. console.log(row)
  1373. if (row.ftid !== '-1' && row.ftid !== '') {
  1374. console.log(this.recipeTemplateList.find(obj => obj.id == row.ftid).Sfweight)
  1375. row.Sfweight = this.recipeTemplateList.find(obj => obj.id == row.ftid).Sfweight
  1376. row.SfweightLock = this.recipeTemplateList.find(obj => obj.id == row.ftid).SfweightLock
  1377. }
  1378. if (row.ptsfid !== '-1' && row.ptsfid !== '' && this.table.isPtsfname == true) {
  1379. // row.ptsfid = parseInt(row.ptsfid)
  1380. row.BLweight = formatNum(parseFloat(this.feedingFormulaList.find(obj => obj.id == row.ptsfid).Sfweight), 2)
  1381. row.BLweightLock = formatNum(parseFloat(this.feedingFormulaList.find(obj => obj.id == row.ptsfid).SfweightLock), 2)
  1382. }
  1383. if (row.ptsfid == '') {
  1384. row.BLweight = 0
  1385. row.BLweightLock = 0
  1386. }
  1387. if (row.Sfweight !== '' && row.ccount !== '') {
  1388. // console.log(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount))
  1389. row.ftweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), 2)
  1390. }
  1391. // 系数牛头数 = 实际牛头数 * 系数/100
  1392. if (row.ccount !== '' && row.ratio !== '') {
  1393. row.ccountratio = formatNum(parseFloat(row.ccount) * parseFloat(row.ratio) / 100, 2)
  1394. } else if (row.ratio !== '' && row.ccountratio !== '') {
  1395. row.ccount = formatNum(parseFloat(row.ccountratio) * 100 / parseFloat(row.ratio) / 100, 2)
  1396. } else if (row.ccount !== '' || row.ratio !== '') {
  1397. row.ccountratio = ''
  1398. }
  1399. // 补料重量
  1400. console.log(row.ccountratio, row.BLweight)
  1401. if (row.BLweight == 'undefined') {
  1402. this.$set(row, 'BLweight', '')
  1403. }
  1404. console.log('BLweight', row.BLweight)
  1405. console.log('ccountratio', row.ccountratio)
  1406. console.log('BLweightLock', row.BLweightLock)
  1407. console.log('ccount', row.ccount)
  1408. if (row.ccountratio !== '' && row.BLweight !== '') {
  1409. row.supplyweight = formatNum(parseFloat(row.BLweight) * parseFloat(row.ccountratio) + parseFloat(row.BLweightLock) * parseFloat(row.ccount), 2)
  1410. } else if (row.ccountratio !== '' && row.BLweight == '') {
  1411. row.supplyweight = ''
  1412. row.feedweight = ''
  1413. } else if (row.ccountratio == '' && row.BLweight !== '') {
  1414. row.supplyweight = ''
  1415. row.feedweight = ''
  1416. }
  1417. // 配方重量
  1418. if (row.ccountratio !== '' && row.Sfweight !== '') {
  1419. row.ftweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), 2)
  1420. } else if (row.ccountratio !== '' && row.Sfweight == '') {
  1421. row.ftweight = ''
  1422. row.feedweight = ''
  1423. } else if (row.ccountratio == '' && row.Sfweight !== '') {
  1424. row.ftweight = ''
  1425. row.feedweight = ''
  1426. }
  1427. if (this.table.isPtsfname == false) {
  1428. row.feedweight = parseFloat(row.ftweight)
  1429. } else {
  1430. if (row.supplyweight !== '' && row.ftweight !== '') {
  1431. row.feedweight = formatNum(parseFloat(row.supplyweight) + parseFloat(row.ftweight), 2)
  1432. } else if (row.supplyweight !== '' && row.ftweight == '') {
  1433. row.feedweight = formatNum(parseFloat(row.supplyweight), 2)
  1434. } else if (row.supplyweight == '' && row.ftweight !== '') {
  1435. row.feedweight = formatNum(parseFloat(row.ftweight), 2)
  1436. }
  1437. // 配方重量 = 系数头数 * Sfweight
  1438. if (row.ccountratio !== '' && row.ftweight !== '') {
  1439. row.ftweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), 2)
  1440. }
  1441. // 补料重量 = 系数头数 * BLweight
  1442. if (row.ccountratio !== '' && row.BLweight !== '') {
  1443. row.supplyweight = formatNum(parseFloat(row.BLweight) * parseFloat(row.ccountratio) + parseFloat(row.BLweightLock) * parseFloat(row.ccount), 2)
  1444. }
  1445. }
  1446. if (row.r1 !== '') { this.$set(row, 'w1', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r1) / 100), 2)) }
  1447. if (row.r2 !== '') { this.$set(row, 'w2', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r2) / 100), 2)) }
  1448. if (row.r3 !== '') { this.$set(row, 'w3', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r3) / 100), 2)) }
  1449. if (row.r4 !== '') { this.$set(row, 'w4', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r4) / 100), 2)) }
  1450. },
  1451. blurRatio(row) {
  1452. console.log(row, '--------------')
  1453. if (row.ftid !== '-1' && row.ftid !== '') {
  1454. row.Sfweight = this.recipeTemplateList.find(obj => obj.id == row.ftid).Sfweight
  1455. row.SfweightLock = this.recipeTemplateList.find(obj => obj.id == row.ftid).SfweightLock
  1456. }
  1457. if (row.ptsfid !== '-1' && row.ptsfid !== '' && this.table.isPtsfname == true) {
  1458. // row.ptsfid = parseInt(row.ptsfid)
  1459. row.BLweight = formatNum(parseFloat(this.feedingFormulaList.find(obj => obj.id == row.ptsfid).Sfweight), 2)
  1460. row.BLweightLock = formatNum(parseFloat(this.feedingFormulaList.find(obj => obj.id == row.ptsfid).SfweightLock), 2)
  1461. }
  1462. if (row.ptsfid == '') {
  1463. row.BLweight = 0
  1464. row.BLweightLock = 0
  1465. }
  1466. // 系数
  1467. if (row.ccount !== '' && row.ratio !== '' && row.ccountratio !== '') {
  1468. row.ccountratio = formatNum(parseFloat(row.ccount) * parseFloat(row.ratio) / 100, 2)
  1469. } else if (row.ccount !== '' && row.ccountratio !== '') {
  1470. row.ratio = formatNum(parseFloat(row.ccountratio) * 100 / parseFloat(row.ccount), 2)
  1471. } else if (row.ccount !== '' || row.ccountratio !== '') {
  1472. row.ratio = ''
  1473. }
  1474. // 补料重量
  1475. if (row.ccountratio !== '' && row.BLweight !== '') {
  1476. row.supplyweight = formatNum(parseFloat(row.BLweight) * parseFloat(row.ccountratio) + parseFloat(row.BLweightLock) * parseFloat(row.ccount), 2)
  1477. } else if (row.ccountratio !== '' && row.BLweight == '' || row.ccountratio == '' && row.BLweight !== '') {
  1478. row.supplyweight = ''
  1479. row.feedweight = ''
  1480. }
  1481. // 配方重量
  1482. if (row.ccountratio !== '' && row.Sfweight !== '') {
  1483. row.ftweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), 2)
  1484. } else if (row.ccountratio !== '' && row.Sfweight == '' || row.ccountratio == '' && row.Sfweight !== '') {
  1485. row.ftweight = ''
  1486. row.feedweight = ''
  1487. }
  1488. // 投喂量
  1489. if (row.supplyweight !== '' && row.ftweight !== '') {
  1490. row.feedweight = formatNum(parseFloat(row.BLweight) * parseFloat(row.ccountratio) + parseFloat(row.BLweightLock) * parseFloat(row.ccount), 2)
  1491. } else if (row.supplyweight == '' && row.ftweight !== '') {
  1492. row.feedweight = formatNum(parseFloat(row.ftweight), 2)
  1493. } else if (row.supplyweight !== '' && row.ftweight == '') {
  1494. row.feedweight = formatNum(parseFloat(row.supplyweight), 2)
  1495. }
  1496. console.log(row.supplyweight, '补料重量')
  1497. console.log(row.ftweight, '配方重量')
  1498. if (this.table.isPtsfname == false) {
  1499. row.feedweight = formatNum(parseFloat(row.ftweight), 2)
  1500. } else {
  1501. // 投喂量
  1502. if (row.supplyweight !== '' && row.ftweight !== '') {
  1503. row.feedweight = formatNum(parseFloat(row.supplyweight) + parseFloat(row.ftweight), 2)
  1504. } else if (row.supplyweight == '' && row.ftweight !== '') {
  1505. row.feedweight = formatNum(parseFloat(row.ftweight), 2)
  1506. } else if (row.supplyweight !== '' && row.ftweight == '') {
  1507. row.feedweight = formatNum(parseFloat(row.supplyweight), 2)
  1508. }
  1509. // 补料重量
  1510. if (row.ccountratio !== '' && row.BLweight !== '') {
  1511. row.supplyweight = formatNum(parseFloat(row.BLweight) * parseFloat(row.ccountratio) + parseFloat(row.BLweightLock) * parseFloat(row.ccount), 2)
  1512. } else if (row.ccountratio !== '' && row.BLweight == '') {
  1513. row.supplyweight = ''
  1514. row.feedweight = ''
  1515. } else if (row.ccountratio == '' && row.BLweight !== '') {
  1516. row.supplyweight = ''
  1517. row.feedweight = ''
  1518. }
  1519. // 配方重量
  1520. if (row.ccountratio !== '' && row.Sfweight !== '') {
  1521. row.ftweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), 2)
  1522. } else if (row.ccountratio !== '' && row.Sfweight == '') {
  1523. row.ftweight = ''
  1524. row.feedweight = ''
  1525. } else if (row.ccountratio == '' && row.Sfweight !== '') {
  1526. row.ftweight = ''
  1527. row.feedweight = ''
  1528. }
  1529. }
  1530. if (row.r1 !== '') { this.$set(row, 'w1', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r1) / 100), 2)) }
  1531. if (row.r2 !== '') { this.$set(row, 'w2', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r2) / 100), 2)) }
  1532. if (row.r3 !== '') { this.$set(row, 'w3', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r3) / 100), 2)) }
  1533. if (row.r4 !== '') { this.$set(row, 'w4', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r4) / 100), 2)) }
  1534. },
  1535. blurCcountratio(row) {
  1536. if (row.ftid !== '-1' && row.ftid !== '') {
  1537. row.Sfweight = this.recipeTemplateList.find(obj => obj.id == row.ftid).Sfweight
  1538. row.SfweightLock = this.recipeTemplateList.find(obj => obj.id == row.ftid).SfweightLock
  1539. }
  1540. if (row.ptsfid !== '-1' && row.ptsfid !== '' && this.table.isPtsfname == true) {
  1541. // row.ptsfid = parseInt(row.ptsfid)
  1542. row.BLweight = formatNum(parseFloat(this.feedingFormulaList.find(obj => obj.id == row.ptsfid).Sfweight), 2)
  1543. row.BLweightLock = formatNum(parseFloat(this.feedingFormulaList.find(obj => obj.id == row.ptsfid).SfweightLock), 2)
  1544. }
  1545. if (row.ptsfid == '') {
  1546. row.BLweight = 0
  1547. row.BLweightLock = 0
  1548. }
  1549. if (row.ptsfid == '') {
  1550. row.BLweight = 0
  1551. row.BLweightLock = 0
  1552. }
  1553. // 系数头数
  1554. if (row.ccountratio !== '' && row.ccount !== '' && row.ratio !== '') {
  1555. row.ratio = formatNum(parseFloat(row.ccountratio) * 100 / parseFloat(row.ccount), 2)
  1556. } else if (row.ccount !== '' && row.ratio !== '') {
  1557. row.ccountratio = formatNum(parseFloat(row.ccount) * parseFloat(row.ratio) / 100, 2)
  1558. } else if (row.ccountratio !== '' && row.ccount !== '') {
  1559. row.ratio = formatNum(parseFloat(row.ccountratio) * 100 / parseFloat(row.ccount), 2)
  1560. } else if (row.ccountratio !== '' && row.ratio !== '') {
  1561. row.ccount = formatNum(parseFloat(row.ccountratio) * 100 / parseFloat(row.ratio) / 100, 2)
  1562. }
  1563. // 补料重量
  1564. if (row.ccountratio !== '' && row.BLweight !== '') {
  1565. row.supplyweight = formatNum(parseFloat(row.BLweight) * parseFloat(row.ccountratio) + parseFloat(row.BLweightLock) * parseFloat(row.ccount), 2)
  1566. } else if (row.ccountratio !== '' && row.BLweight == '') {
  1567. row.supplyweight = ''
  1568. row.feedweight = ''
  1569. } else if (row.ccountratio == '' && row.BLweight !== '') {
  1570. row.supplyweight = ''
  1571. row.feedweight = ''
  1572. }
  1573. // 配方重量
  1574. if (row.ccountratio !== '' && row.Sfweight !== '') {
  1575. row.ftweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), 2)
  1576. } else if (row.ccountratio !== '' && row.Sfweight == '') {
  1577. row.ftweight = ''
  1578. row.feedweight = ''
  1579. } else if (row.ccountratio == '' && row.Sfweight !== '') {
  1580. row.ftweight = ''
  1581. row.feedweight = ''
  1582. }
  1583. // 投喂量
  1584. if (row.supplyweight !== '' && row.ftweight !== '') {
  1585. row.feedweight = formatNum(parseFloat(row.supplyweight) + parseFloat(row.ftweight), 2)
  1586. } else if (row.supplyweight == '' && row.ftweight !== '') {
  1587. row.feedweight = formatNum(parseFloat(row.ftweight), 2)
  1588. } else if (row.supplyweight !== '' && row.ftweight == '') {
  1589. row.feedweight = formatNum(parseFloat(row.supplyweight), 2)
  1590. }
  1591. if (this.table.isPtsfname == false) {
  1592. console.log(row)
  1593. row.feedweight = formatNum(parseFloat(row.ftweight), 2)
  1594. } else {
  1595. // 投喂量
  1596. if (row.supplyweight !== '' && row.ftweight !== '') {
  1597. row.feedweight = formatNum(parseFloat(row.supplyweight) + parseFloat(row.ftweight), 2)
  1598. } else if (row.supplyweight == '' && row.ftweight !== '') {
  1599. row.feedweight = formatNum(parseFloat(row.ftweight), 2)
  1600. } else if (row.supplyweight !== '' && row.ftweight == '') {
  1601. row.feedweight = formatNum(parseFloat(row.supplyweight), 2)
  1602. }
  1603. // 补料重量
  1604. if (row.ccountratio !== '' && row.BLweight !== '') {
  1605. row.supplyweight = formatNum(parseFloat(row.BLweight) * parseFloat(row.ccountratio) + parseFloat(row.BLweightLock) * parseFloat(row.ccount), 2)
  1606. } else if (row.ccountratio !== '' && row.BLweight == '') {
  1607. row.supplyweight = ''
  1608. row.feedweight = ''
  1609. } else if (row.ccountratio == '' && row.BLweight !== '') {
  1610. row.supplyweight = ''
  1611. row.feedweight = ''
  1612. }
  1613. // 配方重量
  1614. if (row.ccountratio !== '' && row.Sfweight !== '') {
  1615. row.ftweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), 2)
  1616. } else if (row.ccountratio !== '' && row.Sfweight == '') {
  1617. row.ftweight = ''
  1618. row.feedweight = ''
  1619. } else if (row.ccountratio == '' && row.Sfweight !== '') {
  1620. row.ftweight = ''
  1621. row.feedweight = ''
  1622. }
  1623. }
  1624. if (row.r1 !== '') { this.$set(row, 'w1', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r1) / 100), 2)) }
  1625. if (row.r2 !== '') { this.$set(row, 'w2', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r2) / 100), 2)) }
  1626. if (row.r3 !== '') { this.$set(row, 'w3', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r3) / 100), 2)) }
  1627. if (row.r4 !== '') { this.$set(row, 'w4', formatNum(parseFloat(row.feedweight) * (parseFloat(row.r4) / 100), 2)) }
  1628. },
  1629. // 总比例
  1630. blurR(row) {
  1631. if (row.r1 == '') { row.r1 = 0 }
  1632. if (row.r2 == '') { row.r2 = 0 }
  1633. if (row.r3 == '') { row.r3 = 0 }
  1634. if (row.r4 == '') { row.r4 = 0 }
  1635. if (row.r1 !== '') {
  1636. row.w1 = formatNum(parseFloat(row.feedweight) * parseFloat(row.r1) / 100, 2)
  1637. }
  1638. if (row.r2 !== '') {
  1639. row.w2 = formatNum(parseFloat(row.feedweight) * parseFloat(row.r2) / 100, 2)
  1640. }
  1641. if (row.r3 !== '') {
  1642. row.w3 = formatNum(parseFloat(row.feedweight) * parseFloat(row.r3) / 100, 2)
  1643. }
  1644. if (row.r4 !== '') {
  1645. row.w4 = formatNum(parseFloat(row.feedweight) * parseFloat(row.r4) / 100, 2)
  1646. }
  1647. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), 2))
  1648. },
  1649. // 一班重量得到焦点
  1650. focusW(row) {
  1651. console.log(row)
  1652. this.focusWRow = Object.assign({}, row)
  1653. },
  1654. // 1班重量得到焦点
  1655. focusW2(row) {
  1656. this.focusWRow2 = Object.assign({}, row)
  1657. },
  1658. // 3班重量得到焦点
  1659. focusW3(row) {
  1660. this.focusWRow3 = Object.assign({}, row)
  1661. },
  1662. // 4班重量得到焦点
  1663. focusW4(row) {
  1664. this.focusWRow4 = Object.assign({}, row)
  1665. },
  1666. // 一班重量
  1667. blurW(row) {
  1668. if (row.w1 == '') {
  1669. row.w1 = 0
  1670. }
  1671. if (row.w2 == '') {
  1672. row.w2 = 0
  1673. }
  1674. if (row.w3 == '') {
  1675. row.w3 = 0
  1676. }
  1677. if (row.w4 == '') {
  1678. row.w4 = 0
  1679. }
  1680. if (row.r1 == '') {
  1681. row.r1 = 0
  1682. }
  1683. if (row.r2 == '') {
  1684. row.r2 = 0
  1685. }
  1686. if (row.r3 == '') {
  1687. row.r3 = 0
  1688. }
  1689. if (row.r4 == '') {
  1690. row.r4 = 0
  1691. }
  1692. // row.ftweight = parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4)
  1693. console.log(row, '=======投喂量feedweight')
  1694. // isOneWeight,isTwoWeight,isThreeWeight,isFourWeight
  1695. if (this.table.RWLength == 4) {
  1696. // 2班3班4班都锁定
  1697. if (row.isTwoWeight == true && row.isThreeWeight == true && row.isFourWeight == true) {
  1698. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, 2)
  1699. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), 2))
  1700. }
  1701. // 2班3班锁定4班未锁定
  1702. if (row.isTwoWeight == true && row.isThreeWeight == true && row.isFourWeight == false) {
  1703. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, 2)
  1704. row.w4 = formatNum(parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w2) - parseFloat(row.w3), 2)
  1705. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, 2)
  1706. if (row.w4 <= 0) {
  1707. row.w4 = 0
  1708. row.r4 = 0
  1709. }
  1710. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), 2))
  1711. }
  1712. // 2班4班锁定3班未锁定
  1713. if (row.isTwoWeight == true && row.isFourWeight == true && row.isThreeWeight == false) {
  1714. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, 2)
  1715. row.w3 = formatNum(parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w2) - parseFloat(row.w4), 2)
  1716. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, 2)
  1717. if (row.w3 <= 0) {
  1718. row.w3 = 0
  1719. row.r3 = 0
  1720. }
  1721. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), 2))
  1722. }
  1723. // 3班4班锁定2班未锁定
  1724. if (row.isTwoWeight == false && row.isThreeWeight == true && row.isFourWeight == true) {
  1725. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, 2)
  1726. row.w2 = formatNum(parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w3) - parseFloat(row.w4), 2)
  1727. row.r2 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, 2)
  1728. if (row.w2 <= 0) {
  1729. row.w2 = 0
  1730. row.r2 = 0
  1731. }
  1732. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), 2))
  1733. }
  1734. // 2班锁定,3班4班未锁
  1735. if (row.isTwoWeight == true && row.isThreeWeight == false && row.isFourWeight == false) {
  1736. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, 2)
  1737. row.w3 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w2)) * parseFloat(row.r3) / (parseFloat(this.focusWRow.r3) + parseFloat(this.focusWRow.r4)), 2)
  1738. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100)
  1739. row.w4 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w2)) * parseFloat(row.r4) / (parseFloat(this.focusWRow.r3) + parseFloat(row.r4)), 2)
  1740. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100)
  1741. if (row.w3 <= 0) {
  1742. row.w3 = 0
  1743. row.r3 = 0
  1744. }
  1745. if (row.w4 <= 0) {
  1746. row.w4 = 0
  1747. row.r4 = 0
  1748. }
  1749. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), 2))
  1750. }
  1751. // 3班锁定,2班4班未锁
  1752. if (row.isTwoWeight == false && row.isThreeWeight == true && row.isFourWeight == false) {
  1753. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, 2)
  1754. row.w2 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w3)) * parseFloat(row.r2) / (parseFloat(this.focusWRow.r2) + parseFloat(this.focusWRow.r4)), 2)
  1755. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, 2)
  1756. row.w4 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w3)) * parseFloat(row.r4) / (parseFloat(this.focusWRow.r2) + parseFloat(row.r4)), 2)
  1757. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, 2)
  1758. if (row.w2 <= 0) {
  1759. row.w2 = 0
  1760. row.r2 = 0
  1761. }
  1762. if (row.w4 <= 0) {
  1763. row.w4 = 0
  1764. row.r4 = 0
  1765. }
  1766. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), 2))
  1767. }
  1768. // 4班锁定,2班3班未锁
  1769. if (row.isTwoWeight == false && row.isThreeWeight == false && row.isFourWeight == true) {
  1770. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, 2)
  1771. row.w2 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w4)) * parseFloat(row.r2) / (parseFloat(this.focusWRow.r2) + parseFloat(this.focusWRow.r3)), 2)
  1772. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, 2)
  1773. row.w3 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w4)) * parseFloat(row.r3) / (parseFloat(this.focusWRow.r2) + parseFloat(row.r3)), 2)
  1774. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, 2)
  1775. if (row.w2 <= 0) {
  1776. row.w2 = 0
  1777. row.r2 = 0
  1778. }
  1779. if (row.w3 <= 0) {
  1780. row.w3 = 0
  1781. row.r3 = 0
  1782. }
  1783. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), 2))
  1784. }
  1785. // 2班3班4班未锁
  1786. if (row.isTwoWeight == false && row.isThreeWeight == false && row.isFourWeight == false) {
  1787. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, 2)
  1788. row.w2 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w1)) * parseFloat(row.r2) / (parseFloat(this.focusWRow.r2) + parseFloat(this.focusWRow.r3) + parseFloat(this.focusWRow.r4)), 2)
  1789. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, 2)
  1790. row.w3 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w1)) * parseFloat(row.r3) / (parseFloat(this.focusWRow.r2) + parseFloat(this.focusWRow.r3) + parseFloat(this.focusWRow.r4)), 2)
  1791. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, 2)
  1792. row.w4 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w1)) * parseFloat(row.r4) / (parseFloat(this.focusWRow.r2) + parseFloat(this.focusWRow.r3) + parseFloat(this.focusWRow.r4)), 2)
  1793. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, 2)
  1794. if (row.w2 <= 0) {
  1795. row.w2 = 0
  1796. row.r2 = 0
  1797. }
  1798. if (row.w3 <= 0) {
  1799. row.w3 = 0
  1800. row.r3 = 0
  1801. }
  1802. if (row.w4 <= 0) {
  1803. row.w4 = 0
  1804. row.r4 = 0
  1805. }
  1806. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), 2))
  1807. }
  1808. } else if (this.table.RWLength == 3) {
  1809. // 三班
  1810. // 2班/3班锁定
  1811. if (row.isTwoWeight == true && row.isThreeWeight == true) {
  1812. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, 2)
  1813. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3), 2))
  1814. }
  1815. // 2班不锁3班锁
  1816. if (row.isTwoWeight == false && row.isThreeWeight == true) {
  1817. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, 2)
  1818. row.w2 = formatNum(parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w3), 2)
  1819. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, 2)
  1820. if (row.w2 <= 0) {
  1821. row.w2 = 0
  1822. row.r2 = 0
  1823. }
  1824. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3), 2))
  1825. }
  1826. // 3班不锁2班锁
  1827. if (row.isTwoWeight == true && row.isThreeWeight == false) {
  1828. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, 2)
  1829. row.w3 = formatNum(parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w2), 2)
  1830. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, 2)
  1831. if (row.w3 <= 0) {
  1832. row.w3 = 0
  1833. row.r3 = 0
  1834. }
  1835. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3), 2))
  1836. }
  1837. // 2班3班都不锁
  1838. if (row.isTwoWeight == false && row.isThreeWeight == false) {
  1839. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, 2)
  1840. row.w2 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w1)) * parseFloat(row.r2) / (parseFloat(row.r2) + parseFloat(row.r3)), 2)
  1841. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, 2)
  1842. row.w3 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w1)) * parseFloat(row.r3) / (parseFloat(this.focusWRow.r2) + parseFloat(row.r3)), 2)
  1843. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, 2)
  1844. if (row.w3 <= 0) {
  1845. row.w3 = 0
  1846. row.r3 = 0
  1847. }
  1848. if (row.w2 <= 0) {
  1849. row.w2 = 0
  1850. row.r2 = 0
  1851. }
  1852. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3), 2))
  1853. }
  1854. } else if (this.table.RWLength == 2) {
  1855. // 两班isOneWeight,isTwoWeight
  1856. if (row.w1 == '') { row.w1 = 0 }
  1857. if (row.w2 == '') { row.w2 = 0 }
  1858. if (row.r1 == '') { row.r1 = 0 }
  1859. if (row.r2 == '') { row.r2 = 0 }
  1860. if (row.isTwoWeight == false) {
  1861. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, 2)
  1862. row.w2 = formatNum(parseFloat(row.feedweight) - parseFloat(row.w1), 2)
  1863. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, 2)
  1864. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  1865. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2), 2))
  1866. } else {
  1867. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, 2)
  1868. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2), 2))
  1869. }
  1870. }
  1871. },
  1872. blurW2(row) {
  1873. // 2班重量
  1874. if (row.w1 == '') {
  1875. row.w1 = 0
  1876. }
  1877. if (row.w2 == '') {
  1878. row.w2 = 0
  1879. }
  1880. if (row.w3 == '') {
  1881. row.w3 = 0
  1882. }
  1883. if (row.w4 == '') {
  1884. row.w4 = 0
  1885. }
  1886. if (row.r1 == '') {
  1887. row.r1 = 0
  1888. }
  1889. if (row.r2 == '') {
  1890. row.r2 = 0
  1891. }
  1892. if (row.r3 == '') {
  1893. row.r3 = 0
  1894. }
  1895. if (row.r4 == '') {
  1896. row.r4 = 0
  1897. }
  1898. // row.ftweight = parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4)
  1899. console.log(row, '=======投喂量feedweight')
  1900. // isOneWeight,isTwoWeight,isThreeWeight,isFourWeight
  1901. if (this.table.RWLength == 4) {
  1902. // 四班
  1903. // 1班3班4班都锁定
  1904. if (row.isOneWeight == true && row.isThreeWeight == true && row.isFourWeight == true) {
  1905. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, 2)
  1906. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), 2))
  1907. }
  1908. // 1班3班锁定4班未锁定
  1909. if (row.isOneWeight == true && row.isThreeWeight == true && row.isFourWeight == false) {
  1910. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, 2)
  1911. row.w4 = formatNum(parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w2) - parseFloat(row.w3), 2)
  1912. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, 2)
  1913. if (row.w4 <= 0) {
  1914. row.w4 = 0
  1915. row.r4 = 0
  1916. }
  1917. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), 2))
  1918. }
  1919. // 1班4班锁定3班未锁定
  1920. if (row.isOneWeight == true && row.isFourWeight == true && row.isThreeWeight == false) {
  1921. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, 2)
  1922. row.w3 = formatNum(parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w2) - parseFloat(row.w4), 2)
  1923. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, 2)
  1924. if (row.w3 <= 0) {
  1925. row.w3 = 0
  1926. row.r3 = 0
  1927. }
  1928. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), 2))
  1929. }
  1930. // 3班4班锁定1班未锁定
  1931. if (row.isOneWeight == false && row.isThreeWeight == true && row.isFourWeight == true) {
  1932. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, 2)
  1933. row.w1 = formatNum(parseFloat(row.feedweight) - parseFloat(row.w2) - parseFloat(row.w3) - parseFloat(row.w4), 2)
  1934. row.r1 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, 2)
  1935. if (row.w1 <= 0) {
  1936. row.w1 = 0
  1937. row.r1 = 0
  1938. }
  1939. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), 2))
  1940. }
  1941. // 1班锁定,3班4班未锁
  1942. if (row.isOneWeight == true && row.isThreeWeight == false && row.isFourWeight == false) {
  1943. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, 2)
  1944. row.w3 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w2)) * parseFloat(row.r3) / (parseFloat(this.focusWRow.r3) + parseFloat(this.focusWRow.r4)), 2)
  1945. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, 2)
  1946. row.w4 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w2)) * parseFloat(row.r4) / (parseFloat(this.focusWRow.r3) + parseFloat(row.r4)), 2)
  1947. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, 2)
  1948. if (row.w3 <= 0) {
  1949. row.w3 = 0
  1950. row.r3 = 0
  1951. }
  1952. if (row.w4 <= 0) {
  1953. row.w4 = 0
  1954. row.r4 = 0
  1955. }
  1956. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), 2))
  1957. }
  1958. // 3班锁定,1班4班未锁
  1959. if (row.isOneWeight == false && row.isThreeWeight == true && row.isFourWeight == false) {
  1960. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, 2)
  1961. row.w1 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w2) - parseFloat(row.w3)) * parseFloat(row.r1) / (parseFloat(this.focusWRow.r1) + parseFloat(this.focusWRow.r2)), 2)
  1962. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, 2)
  1963. row.w4 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w2) - parseFloat(row.w3)) * parseFloat(row.r4) / (parseFloat(this.focusWRow.r1) + parseFloat(row.r2)), 2)
  1964. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, 2)
  1965. if (row.w1 <= 0) {
  1966. row.w1 = 0
  1967. row.r1 = 0
  1968. }
  1969. if (row.w4 <= 0) {
  1970. row.w4 = 0
  1971. row.r4 = 0
  1972. }
  1973. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), 2))
  1974. }
  1975. // 4班锁定,1班3班未锁
  1976. if (row.isOneWeight == false && row.isThreeWeight == false && row.isFourWeight == true) {
  1977. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, 2)
  1978. row.w1 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w2) - parseFloat(row.w4)) * parseFloat(row.r1) / (parseFloat(this.focusWRow.r1) + parseFloat(this.focusWRow.r3)), 2)
  1979. row.r1 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, 2)
  1980. row.w3 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w2) - parseFloat(row.w4)) * parseFloat(row.r3) / (parseFloat(this.focusWRow.r1) + parseFloat(row.r3)), 2)
  1981. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, 2)
  1982. if (row.w1 <= 0) {
  1983. row.w1 = 0
  1984. row.r1 = 0
  1985. }
  1986. if (row.w3 <= 0) {
  1987. row.w3 = 0
  1988. row.r3 = 0
  1989. }
  1990. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), 2))
  1991. }
  1992. // 1班3班4班未锁
  1993. if (row.isOneWeight == false && row.isThreeWeight == false && row.isFourWeight == false) {
  1994. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, 2)
  1995. row.w1 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w2)) * parseFloat(row.r1) / (parseFloat(this.focusWRow.r2) + parseFloat(this.focusWRow.r3) + parseFloat(this.focusWRow.r1)), 2)
  1996. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, 2)
  1997. row.w3 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w2)) * parseFloat(row.r3) / (parseFloat(this.focusWRow.r2) + parseFloat(this.focusWRow.r3) + parseFloat(this.focusWRow.r1)), 2)
  1998. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, 2)
  1999. row.w4 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w2)) * parseFloat(row.r4) / (parseFloat(this.focusWRow.r2) + parseFloat(this.focusWRow.r3) + parseFloat(this.focusWRow.r1)), 2)
  2000. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, 2)
  2001. if (row.w1 <= 0) {
  2002. row.w1 = 0
  2003. row.r1 = 0
  2004. }
  2005. if (row.w3 <= 0) {
  2006. row.w3 = 0
  2007. row.r3 = 0
  2008. }
  2009. if (row.w4 <= 0) {
  2010. row.w4 = 0
  2011. row.r4 = 0
  2012. }
  2013. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), 2))
  2014. }
  2015. } else if (this.table.RWLength == 3) {
  2016. // 三班
  2017. // 1班/3班锁定
  2018. if (row.isOneWeight == true && row.isThreeWeight == true) {
  2019. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, 2)
  2020. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3), 2))
  2021. }
  2022. // 1班不锁3班锁
  2023. if (row.isOneWeight == false && row.isThreeWeight == true) {
  2024. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, 2)
  2025. row.w1 = formatNum(parseFloat(row.feedweight) - parseFloat(row.w2) - parseFloat(row.w3), 2)
  2026. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, 2)
  2027. if (row.w1 <= 0) {
  2028. row.w1 = 0
  2029. row.r1 = 0
  2030. }
  2031. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3), 2))
  2032. }
  2033. // 3班不锁1班锁
  2034. if (row.isOneWeight == true && row.isThreeWeight == false) {
  2035. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, 2)
  2036. row.w3 = formatNum(parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w2), 2)
  2037. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, 2)
  2038. if (row.w3 <= 0) {
  2039. row.w3 = 0
  2040. row.r3 = 0
  2041. }
  2042. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3), 2))
  2043. }
  2044. // 1班3班都不锁
  2045. if (row.isOneWeight == false && row.isThreeWeight == false) {
  2046. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, 2)
  2047. row.w1 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w2)) * parseFloat(row.r1) / (parseFloat(row.r1) + parseFloat(row.r3)), 2)
  2048. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, 2)
  2049. row.w3 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w2)) * parseFloat(row.r3) / (parseFloat(this.focusWRow2.r1) + parseFloat(row.r3)), 2)
  2050. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, 2)
  2051. if (row.w3 <= 0) {
  2052. row.w3 = 0
  2053. row.r3 = 0
  2054. }
  2055. if (row.w1 <= 0) {
  2056. row.w1 = 0
  2057. row.r1 = 0
  2058. }
  2059. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3), 2))
  2060. }
  2061. } else if (this.table.RWLength == 2) {
  2062. // 两班
  2063. if (row.isTwoWeight == false) {
  2064. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, 2)
  2065. row.w1 = formatNum(parseFloat(row.feedweight) - parseFloat(row.w2), 2)
  2066. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, 2)
  2067. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  2068. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2), 2))
  2069. } else {
  2070. row.r2 = parseFloat(row.w2) / parseFloat(row.feedweight) * 100
  2071. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2), 2))
  2072. }
  2073. }
  2074. },
  2075. blurW3(row) {
  2076. // 3班重量
  2077. if (row.w1 == '') {
  2078. row.w1 = 0
  2079. }
  2080. if (row.w2 == '') {
  2081. row.w2 = 0
  2082. }
  2083. if (row.w3 == '') {
  2084. row.w3 = 0
  2085. }
  2086. if (row.w4 == '') {
  2087. row.w4 = 0
  2088. }
  2089. if (row.r1 == '') {
  2090. row.r1 = 0
  2091. }
  2092. if (row.r2 == '') {
  2093. row.r2 = 0
  2094. }
  2095. if (row.r3 == '') {
  2096. row.r3 = 0
  2097. }
  2098. if (row.r4 == '') {
  2099. row.r4 = 0
  2100. }
  2101. // row.ftweight = parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4)
  2102. console.log(row, '=======投喂量feedweight')
  2103. // isOneWeight,isTwoWeight,isThreeWeight,isFourWeight
  2104. if (this.table.RWLength == 4) {
  2105. // 四班
  2106. // 1班2班4班都锁定
  2107. if (row.isOneWeight == true && row.isTwoWeight == true && row.isFourWeight == true) {
  2108. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, 2)
  2109. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), 2))
  2110. }
  2111. // 1班2班锁定4班未锁定
  2112. if (row.isOneWeight == true && row.isTwoWeight == true && row.isFourWeight == false) {
  2113. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, 2)
  2114. row.w4 = formatNum(parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w2) - parseFloat(row.w3), 2)
  2115. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, 2)
  2116. if (row.w4 <= 0) {
  2117. row.w4 = 0
  2118. row.r4 = 0
  2119. }
  2120. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), 2))
  2121. }
  2122. // 2班4班锁定1班未锁定
  2123. if (row.isOneWeight == false && row.isTwoWeight == true && row.isFourWeight == true) {
  2124. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, 2)
  2125. row.w1 = formatNum(parseFloat(row.feedweight) - parseFloat(row.w2) - parseFloat(row.w3) - parseFloat(row.w4), 2)
  2126. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, 2)
  2127. if (row.w1 <= 0) {
  2128. row.w1 = 0
  2129. row.r1 = 0
  2130. }
  2131. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), 2))
  2132. }
  2133. // 1班4班锁定2班未锁定
  2134. if (row.isTwoWeight == false && row.isOneWeight == true && row.isFourWeight == true) {
  2135. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, 2)
  2136. row.w2 = formatNum(parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w3) - parseFloat(row.w4), 2)
  2137. row.r2 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, 2)
  2138. if (row.w2 <= 0) {
  2139. row.w2 = 0
  2140. row.r2 = 0
  2141. }
  2142. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), 2))
  2143. }
  2144. // 2班锁定,1班4班未锁
  2145. if (row.isTwoWeight == true && row.isOneWeight == false && row.isFourWeight == false) {
  2146. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, 2)
  2147. row.w1 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w2) - parseFloat(row.w3)) * parseFloat(row.r1) / (parseFloat(this.focusWRow.r1) + parseFloat(this.focusWRow.r4)), 2)
  2148. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, 2)
  2149. row.w4 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w2) - parseFloat(row.w3)) * parseFloat(row.r4) / (parseFloat(this.focusWRow.r1) + parseFloat(row.r4)), 2)
  2150. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, 2)
  2151. if (row.w1 <= 0) {
  2152. row.w1 = 0
  2153. row.r1 = 0
  2154. }
  2155. if (row.w4 <= 0) {
  2156. row.w4 = 0
  2157. row.r4 = 0
  2158. }
  2159. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), 2))
  2160. }
  2161. // 1班锁定,2班4班未锁
  2162. if (row.isTwoWeight == false && row.isOneWeight == true && row.isFourWeight == false) {
  2163. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, 2)
  2164. row.w2 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w3)) * parseFloat(row.r2) / (parseFloat(this.focusWRow.r2) + parseFloat(this.focusWRow.r4)), 2)
  2165. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, 2)
  2166. row.w4 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w3)) * parseFloat(row.r4) / (parseFloat(this.focusWRow.r2) + parseFloat(row.r4)), 2)
  2167. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, 2)
  2168. if (row.w2 <= 0) {
  2169. row.w2 = 0
  2170. row.r2 = 0
  2171. }
  2172. if (row.w4 <= 0) {
  2173. row.w4 = 0
  2174. row.r4 = 0
  2175. }
  2176. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), 2))
  2177. }
  2178. // 4班锁定,2班1班未锁
  2179. if (row.isTwoWeight == false && row.isOneWeight == false && row.isFourWeight == true) {
  2180. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, 2)
  2181. row.w2 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w3) - parseFloat(row.w4)) * parseFloat(row.r1) / (parseFloat(this.focusWRow.r1) + parseFloat(this.focusWRow.r2)), 2)
  2182. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, 2)
  2183. row.w1 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w3) - parseFloat(row.w4)) * parseFloat(row.r2) / (parseFloat(this.focusWRow.r1) + parseFloat(row.r2)), 2)
  2184. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, 2)
  2185. if (row.w2 <= 0) {
  2186. row.w2 = 0
  2187. row.r2 = 0
  2188. }
  2189. if (row.w1 <= 0) {
  2190. row.w1 = 0
  2191. row.r1 = 0
  2192. }
  2193. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), 2))
  2194. }
  2195. // 2班1班4班未锁
  2196. if (row.isTwoWeight == false && row.isOneWeight == false && row.isFourWeight == false) {
  2197. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, 2)
  2198. row.w1 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w3)) * parseFloat(row.r1) / (parseFloat(this.focusWRow.r1) + parseFloat(this.focusWRow.r2) + parseFloat(this.focusWRow.r4)), 2)
  2199. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, 2)
  2200. row.w2 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w3)) * parseFloat(row.r2) / (parseFloat(this.focusWRow.r1) + parseFloat(this.focusWRow.r2) + parseFloat(this.focusWRow.r4)), 2)
  2201. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, 2)
  2202. row.w4 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w3)) * parseFloat(row.r4) / (parseFloat(this.focusWRow.r1) + parseFloat(this.focusWRow.r2) + parseFloat(this.focusWRow.r4)), 2)
  2203. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, 2)
  2204. if (row.w1 <= 0) {
  2205. row.w1 = 0
  2206. row.r1 = 0
  2207. }
  2208. if (row.w2 <= 0) {
  2209. row.w2 = 0
  2210. row.r2 = 0
  2211. }
  2212. if (row.w4 <= 0) {
  2213. row.w4 = 0
  2214. row.r4 = 0
  2215. }
  2216. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), 2))
  2217. }
  2218. } else if (this.table.RWLength == 3) {
  2219. // 三班
  2220. // 1班/2班锁定
  2221. if (row.isOneWeight == true && row.isTwoWeight == true) {
  2222. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, 2)
  2223. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3), 2))
  2224. }
  2225. // 1班不锁2班锁
  2226. if (row.isOneWeight == false && row.isTwoWeight == true) {
  2227. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, 2)
  2228. row.w1 = formatNum(parseFloat(row.feedweight) - parseFloat(row.w2) - parseFloat(row.w3), 2)
  2229. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, 2)
  2230. if (row.w1 <= 0) {
  2231. row.w1 = 0
  2232. row.r1 = 0
  2233. }
  2234. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3), 2))
  2235. }
  2236. // 3班不锁2班锁
  2237. // 2班不锁1班锁
  2238. if (row.isOneWeight == true && row.isTwoWeight == false) {
  2239. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, 2)
  2240. row.w2 = formatNum(parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w3), 2)
  2241. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, 2)
  2242. if (row.w2 <= 0) {
  2243. row.w2 = 0
  2244. row.r2 = 0
  2245. }
  2246. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3), 2))
  2247. }
  2248. // 2班3班都不锁
  2249. // 1班2班都不锁
  2250. if (row.isOneWeight == false && row.isTwoWeight == false) {
  2251. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, 2)
  2252. row.w1 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w3)) * parseFloat(row.r1) / (parseFloat(row.r1) + parseFloat(row.r2)), 2)
  2253. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, 2)
  2254. row.w2 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w3)) * parseFloat(row.r2) / (parseFloat(this.focusWRow3.r1) + parseFloat(row.r2)), 2)
  2255. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, 2)
  2256. if (row.w1 <= 0) {
  2257. row.w1 = 0
  2258. row.r1 = 0
  2259. }
  2260. if (row.w2 <= 0) {
  2261. row.w2 = 0
  2262. row.r2 = 0
  2263. }
  2264. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3), 2))
  2265. }
  2266. }
  2267. },
  2268. blurW4(row) {
  2269. if (row.w1 == '') {
  2270. row.w1 = 0
  2271. }
  2272. if (row.w2 == '') {
  2273. row.w2 = 0
  2274. }
  2275. if (row.w3 == '') {
  2276. row.w3 = 0
  2277. }
  2278. if (row.w4 == '') {
  2279. row.w4 = 0
  2280. }
  2281. if (row.r1 == '') {
  2282. row.r1 = 0
  2283. }
  2284. if (row.r2 == '') {
  2285. row.r2 = 0
  2286. }
  2287. if (row.r3 == '') {
  2288. row.r3 = 0
  2289. }
  2290. if (row.r4 == '') {
  2291. row.r4 = 0
  2292. }
  2293. // row.ftweight = parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4)
  2294. console.log(row, '=======投喂量feedweight')
  2295. // isOneWeight,isTwoWeight,isThreeWeight,isFourWeight
  2296. if (this.table.RWLength == 4) {
  2297. // 四班
  2298. // 1班2班3班都锁定
  2299. if (row.isOneWeight == true && row.isTwoWeight == true && row.isThreeWeight == true) {
  2300. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, 2)
  2301. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), 2))
  2302. }
  2303. // 2班3班锁定1班未锁定
  2304. if (row.isOneWeight == false && row.isTwoWeight == true && row.isThreeWeight == true) {
  2305. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, 2)
  2306. row.w1 = formatNum(parseFloat(row.feedweight) - parseFloat(row.w4) - parseFloat(row.w2) - parseFloat(row.w3), 2)
  2307. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, 2)
  2308. if (row.w1 <= 0) {
  2309. row.w1 = 0
  2310. row.r1 = 0
  2311. }
  2312. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), 2))
  2313. }
  2314. // 2班1班锁定3班未锁定
  2315. if (row.isOneWeight == true && row.isTwoWeight == true && row.isThreeWeight == false) {
  2316. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, 2)
  2317. row.w3 = formatNum(parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w2) - parseFloat(row.w4), 2)
  2318. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, 2)
  2319. if (row.w3 <= 0) {
  2320. row.w3 = 0
  2321. row.r3 = 0
  2322. }
  2323. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), 2))
  2324. }
  2325. // 3班1班锁定2班未锁定
  2326. if (row.isOneWeight == true && row.isTwoWeight == false && row.isThreeWeight == true) {
  2327. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, 2)
  2328. row.w2 = formatNum(parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w3) - parseFloat(row.w4), 2)
  2329. row.r2 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, 2)
  2330. if (row.w2 <= 0) {
  2331. row.w2 = 0
  2332. row.r2 = 0
  2333. }
  2334. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), 2))
  2335. }
  2336. // 2班锁定,3班1班未锁
  2337. if (row.isOneWeight == false && row.isTwoWeight == true && row.isThreeWeight == false) {
  2338. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, 2)
  2339. row.w3 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w4) - parseFloat(row.w2)) * parseFloat(row.r3) / (parseFloat(this.focusWRow.r3) + parseFloat(this.focusWRow.r1)), 2)
  2340. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, 2)
  2341. row.w1 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w4) - parseFloat(row.w2)) * parseFloat(row.r1) / (parseFloat(this.focusWRow.r3) + parseFloat(row.r1)), 2)
  2342. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, 2)
  2343. if (row.w3 <= 0) {
  2344. row.w3 = 0
  2345. row.r3 = 0
  2346. }
  2347. if (row.w1 <= 0) {
  2348. row.w1 = 0
  2349. row.r1 = 0
  2350. }
  2351. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), 2))
  2352. }
  2353. // 3班锁定,2班1班未锁
  2354. if (row.isOneWeight == false && row.isTwoWeight == false && row.isThreeWeight == true) {
  2355. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, 2)
  2356. row.w2 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w4) - parseFloat(row.w3)) * parseFloat(row.r2) / (parseFloat(this.focusWRow.r2) + parseFloat(this.focusWRow.r1)), 2)
  2357. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, 2)
  2358. row.w1 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w4) - parseFloat(row.w3)) * parseFloat(row.r1) / (parseFloat(this.focusWRow.r2) + parseFloat(row.r1)), 2)
  2359. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, 2)
  2360. if (row.w2 <= 0) {
  2361. row.w2 = 0
  2362. row.r2 = 0
  2363. }
  2364. if (row.w1 <= 0) {
  2365. row.w1 = 0
  2366. row.r1 = 0
  2367. }
  2368. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), 2))
  2369. }
  2370. // 1班锁定,2班3班未锁
  2371. if (row.isOneWeight == true && row.isTwoWeight == false && row.isThreeWeight == false) {
  2372. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, 2)
  2373. row.w2 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w4)) * parseFloat(row.r2) / (parseFloat(this.focusWRow.r2) + parseFloat(this.focusWRow.r3)), 2)
  2374. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, 2)
  2375. row.w3 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w4)) * parseFloat(row.r3) / (parseFloat(this.focusWRow.r2) + parseFloat(row.r3)), 2)
  2376. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, 2)
  2377. if (row.w2 <= 0) {
  2378. row.w2 = 0
  2379. row.r2 = 0
  2380. }
  2381. if (row.w3 <= 0) {
  2382. row.w3 = 0
  2383. row.r3 = 0
  2384. }
  2385. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), 2))
  2386. }
  2387. // 2班3班1班未锁
  2388. if (row.isOneWeight == false && row.isTwoWeight == false && row.isThreeWeight == false) {
  2389. row.r4 = formatNum(parseFloat(row.w4) / parseFloat(row.feedweight) * 100, 2)
  2390. row.w1 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w4)) * parseFloat(row.r1) / (parseFloat(this.focusWRow.r2) + parseFloat(this.focusWRow.r3) + parseFloat(this.focusWRow.r1)), 2)
  2391. row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, 2)
  2392. row.w2 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w4)) * parseFloat(row.r2) / (parseFloat(this.focusWRow.r2) + parseFloat(this.focusWRow.r3) + parseFloat(this.focusWRow.r1)), 2)
  2393. row.r2 = formatNum(parseFloat(row.w2) / parseFloat(row.feedweight) * 100, 2)
  2394. row.w3 = formatNum((parseFloat(row.feedweight) - parseFloat(row.w4)) * parseFloat(row.r3) / (parseFloat(this.focusWRow.r2) + parseFloat(this.focusWRow.r3) + parseFloat(this.focusWRow.r1)), 2)
  2395. row.r3 = formatNum(parseFloat(row.w3) / parseFloat(row.feedweight) * 100, 2)
  2396. if (row.w1 <= 0) {
  2397. row.w1 = 0
  2398. row.r1 = 0
  2399. }
  2400. if (row.w2 <= 0) {
  2401. row.w2 = 0
  2402. row.r2 = 0
  2403. }
  2404. if (row.w3 <= 0) {
  2405. row.w3 = 0
  2406. row.r3 = 0
  2407. }
  2408. this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), 2))
  2409. }
  2410. }
  2411. },
  2412. // 编辑
  2413. handleUpdate(row) {
  2414. console.log(row)
  2415. for (let i = 0; i < this.table.list.length; i++) {
  2416. if (this.table.list[i].Edit == true) {
  2417. this.$message({
  2418. type: 'error',
  2419. message: '当前内容未保存,请点击取消或保存继续进行操作',
  2420. duration: 2000
  2421. })
  2422. return false
  2423. }
  2424. }
  2425. // 编辑true,不可编辑false
  2426. row.Edit = true
  2427. row.NoEdit = false
  2428. // 编辑false,编辑保存true
  2429. row.isUpdate = false
  2430. row.isUpdateSave = true
  2431. row.ftid = String(row.ftid)
  2432. if (row.ptsfid == '-1') {
  2433. row.ptsfid = ''
  2434. }
  2435. row.ptsfid = String(row.ptsfid)
  2436. this.table.temp.ftid = row.ftid
  2437. this.table.temp.ftname = row.ftname
  2438. this.table.temp.ptsfid = row.ptsfid
  2439. this.table.temp.ptsfname = row.ptsfname
  2440. },
  2441. updateData(row) {
  2442. console.log(row)
  2443. if (row.r1 == 'NaN') { this.$set(row, 'r1', 0) }
  2444. if (row.r2 == 'NaN') { this.$set(row, 'r2', 0) }
  2445. if (row.r3 == 'NaN') { this.$set(row, 'r3', 0) }
  2446. if (row.r4 == 'NaN') { this.$set(row, 'r4', 0) }
  2447. if (row.w1 == 'NaN') { this.$set(row, 'w1', 0) }
  2448. if (row.w2 == 'NaN') { this.$set(row, 'w2', 0) }
  2449. if (row.w3 == 'NaN') { this.$set(row, 'w3', 0) }
  2450. if (row.w4 == 'NaN') { this.$set(row, 'w4', 0) }
  2451. console.log(row)
  2452. var arr = []
  2453. for (let i = 1; i <= this.table.RWLength; i++) {
  2454. var obj = {}
  2455. obj['times'] = i
  2456. obj['pastureid'] = row.pastureid
  2457. obj['barid'] = row.barid
  2458. obj['cowcount'] = row.ccount
  2459. obj['ccountradio'] = row.ccountradio
  2460. obj['ptid'] = row.ftid
  2461. if (row.ptsfid !== '') {
  2462. obj['ptsid'] = row.ptsfid
  2463. } else {
  2464. obj['ptsid'] = '-1'
  2465. }
  2466. obj['weight'] = row['w' + i]
  2467. obj['tratio'] = Math.round(row['r' + i])
  2468. arr.push(obj)
  2469. }
  2470. if (this.table.isPtsfname == 0) {
  2471. row.ptsfid = '-1'
  2472. row.ptsfname = ''
  2473. } else {
  2474. if (row.ptsfid == '') {
  2475. row.ptsfid = '-1'
  2476. row.ptsfname = ''
  2477. }
  2478. }
  2479. if (row.supplyweight == '') {
  2480. row.supplyweight = '0'
  2481. }
  2482. if (this.table.isPtsfname == false) {
  2483. row.supplyweight = '0'
  2484. }
  2485. console.log(row, '============')
  2486. this.$set(row, 'ratio', Math.floor(parseFloat(row.ratio) * 100) / 100)
  2487. this.$set(row, 'ccountratio', Math.floor(parseFloat(row.ccountratio) * 100) / 100)
  2488. row.ratio = String(row.ratio)
  2489. row.ccountratio = String(row.ccountratio)
  2490. row.sumr = Math.round(row.sumr)
  2491. this.table.rwList = arr
  2492. console.log('点击了编辑保存', row)
  2493. this.table.temp.pastureid = row.pastureid
  2494. this.table.temp.id = row.id
  2495. this.table.temp.barname = row.barname
  2496. this.table.temp.barid = row.barid
  2497. this.table.temp.ccount = row.ccount
  2498. this.table.temp.ratio = row.ratio
  2499. this.table.temp.ccountratio = row.ccountratio
  2500. this.table.temp.ftid = row.ftid
  2501. this.table.temp.ftname = row.ftname
  2502. this.table.temp.ptsfid = row.ptsfid
  2503. this.table.temp.ptsfname = row.ptsfname
  2504. this.table.temp.ftweight = row.ftweight
  2505. this.table.temp.supplyweight = row.supplyweight
  2506. this.table.temp.feedweight = row.feedweight
  2507. this.table.temp.owner = row.owner
  2508. this.table.temp.sumr = row.sumr
  2509. if (row.softccount == '') {
  2510. row.softccount = 0
  2511. }
  2512. if (row.r1 == '') {
  2513. row.r1 = 0
  2514. }
  2515. if (row.r2 == '') {
  2516. row.r2 = 0
  2517. }
  2518. if (row.r3 == '') {
  2519. row.r3 = 0
  2520. }
  2521. if (row.r4 == '') {
  2522. row.r4 = 0
  2523. }
  2524. if (row.w1 == '') {
  2525. row.w1 = 0
  2526. }
  2527. if (row.w2 == '' || row.w4 == NaN) {
  2528. row.w2 = 0
  2529. }
  2530. if (row.w3 == '' || row.w4 == NaN) {
  2531. row.w3 = 0
  2532. }
  2533. if (row.w4 == '' || row.w4 == NaN) {
  2534. row.w4 = 0
  2535. }
  2536. console.log(row, '===========')
  2537. this.table.temp.softccount = row.softccount
  2538. this.table.temp.r1 = Math.round(row.r1)
  2539. this.table.temp.r2 = Math.round(row.r2)
  2540. this.table.temp.r3 = Math.round(row.r3)
  2541. this.table.temp.r4 = Math.round(row.r4)
  2542. this.table.temp.w1 = row.w1
  2543. this.table.temp.w2 = row.w2
  2544. this.table.temp.w3 = row.w3
  2545. this.table.temp.w4 = row.w4
  2546. if (this.table.temp.ccount == '' && this.table.temp.ratio == '' && this.table.temp.ccountratio == '' && this.table.temp.ftid == '') {
  2547. this.$message({ type: 'error', message: '实际牛头数/系数/系数头数/配方模版不能为空', duration: 2000 })
  2548. return false
  2549. }
  2550. if (this.table.temp.ratio == '' && this.table.temp.ccountratio == '' && this.table.temp.ftid == '') {
  2551. this.$message({ type: 'error', message: '系数/系数头数/配方模版不能为空', duration: 2000 })
  2552. return false
  2553. }
  2554. if (this.table.temp.ccountratio == '' && this.table.temp.ftid == '') {
  2555. this.$message({ type: 'error', message: '系数头数/配方模版不能为空', duration: 2000 })
  2556. return false
  2557. }
  2558. console.log(this.table.temp.ccount, '实际牛头数不能为空')
  2559. if (this.table.temp.ccount == '') {
  2560. this.$message({ type: 'error', message: '实际牛头数不能为空', duration: 2000 })
  2561. return false
  2562. }
  2563. if (this.table.temp.ratio == '') {
  2564. this.$message({ type: 'error', message: '系数不能为空', duration: 2000 })
  2565. return false
  2566. }
  2567. if (this.table.temp.ccountratio == '') {
  2568. this.$message({ type: 'error', message: '系数头数不能为空', duration: 2000 })
  2569. return false
  2570. }
  2571. if (this.table.temp.ftid == '') {
  2572. this.$message({ type: 'error', message: '配方模版不能为空', duration: 2000 })
  2573. return false
  2574. }
  2575. const positiveInteger = /^[0-9]\d*$/
  2576. if (!positiveInteger.test(parseFloat(this.table.temp.ccount))) {
  2577. this.$message({
  2578. type: 'error',
  2579. message: '实际牛头数请输入正整数',
  2580. duration: 2000
  2581. })
  2582. return false
  2583. }
  2584. this.isokDisable = true
  2585. setTimeout(() => {
  2586. this.isokDisable = false
  2587. }, 1000)
  2588. // this.requestParam.parammaps = this.table.temp
  2589. this.requestParam.common = {
  2590. 'returnmap': '0'
  2591. }
  2592. this.requestParam.data = []
  2593. this.requestParam.data[0] = { 'name': 'updateBigFP', 'type': 'e', 'parammaps': {
  2594. pastureid: row.pastureid,
  2595. id: row.id,
  2596. barname: row.barname,
  2597. barid: row.barid,
  2598. softccount: row.softccount,
  2599. ccount: row.ccount,
  2600. ratio: row.ratio,
  2601. ccountratio: row.ccountratio,
  2602. ftid: row.ftid,
  2603. ftname: row.ftname,
  2604. ptsfid: row.ptsfid,
  2605. ptsfname: row.ptsfname,
  2606. ftweight: row.ftweight,
  2607. supplyweight: row.supplyweight,
  2608. feedweight: row.feedweight,
  2609. owner: row.owner,
  2610. sumr: row.sumr
  2611. }}
  2612. this.requestParam.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.table.rwList }}
  2613. this.requestParam.data[1].children = []
  2614. this.requestParam.data[1].children[0] = { 'name': 'updateBigFPDetail', 'type': 'e', 'parammaps': {
  2615. pastureid: '@insertSpotList.pastureid',
  2616. barname: row.barname,
  2617. barid: '@insertSpotList.barid',
  2618. times: '@insertSpotList.times',
  2619. tratio: '@insertSpotList.tratio',
  2620. weight: '@insertSpotList.weight',
  2621. cowcount: '@insertSpotList.cowcount',
  2622. ccountradio: row.ccountratio,
  2623. ptid: '@insertSpotList.ptid',
  2624. ptsid: '@insertSpotList.ptsid',
  2625. feedweight: row.feedweight,
  2626. supplyweight: row.supplyweight,
  2627. ratio: row.ratio
  2628. }}
  2629. this.requestParam.data[2] = { 'name': 'updateLPPbyFPChange', 'type': 'e', 'parammaps': {
  2630. pastureid: row.pastureid,
  2631. fpid: row.id
  2632. }}
  2633. ExecDataByConfig(this.requestParam).then(response => {
  2634. console.log('编辑保存发送参数', this.requestParam)
  2635. if (response.msg === 'fail') {
  2636. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  2637. } else {
  2638. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  2639. this.getList()
  2640. }
  2641. })
  2642. },
  2643. updateCancel(row) {
  2644. console.log('点击了编辑取消')
  2645. // 编辑false,不可编辑true
  2646. row.Edit = false
  2647. row.NoEdit = true
  2648. // 编辑true,编辑保存false
  2649. row.isUpdate = true
  2650. row.isUpdateSave = false
  2651. this.getList()
  2652. this.reload()
  2653. // this.$router.push('/formulationPlan/dhedFormula')
  2654. },
  2655. cellClick(row, column, event) {
  2656. console.log(column)
  2657. },
  2658. handleSelect(val) {
  2659. console.log('勾选数据', val)
  2660. this.selectList = val
  2661. },
  2662. // 营养评估
  2663. handleNutritional() {
  2664. console.log('点击了营养评估')
  2665. if (this.selectList.length !== 1) {
  2666. this.$message({ type: 'error', message: '请选择一条栏舍信息进行营养评估', duration: 2000 })
  2667. return false
  2668. } else {
  2669. console.log(this.nutritional.temp)
  2670. this.nutritional.dialogStatus = 'Nutritional'
  2671. this.nutritional.activeName = 'first'
  2672. this.nutritional.dialogFormVisible = true
  2673. this.nutritional.tab1.getdataListParm1.parammaps.pastureid = this.selectList[0].pastureid
  2674. this.nutritional.tab1.getdataListParm1.parammaps.barid = this.selectList[0].barid
  2675. this.getNutritionalList()
  2676. this.nutritional.tab1.list = []
  2677. }
  2678. },
  2679. handleNutritionalTab(item) {
  2680. if (item == 'first ') {
  2681. this.nutritional.tab1.getdataListParm1.parammaps.pastureid = this.selectList[0].pastureid
  2682. this.nutritional.tab1.getdataListParm1.parammaps.barid = this.selectList[0].barid
  2683. this.getNutritionalList()
  2684. this.nutritional.tab1.list = []
  2685. } else {
  2686. console.log('牛群评估')
  2687. this.nutritional.tab2.getdataListParm1.parammaps.pastureid = this.selectList[0].pastureid
  2688. this.nutritional.tab2.getdataListParm1.parammaps.barid = this.selectList[0].barid
  2689. this.nutritional.tab2.getdataListParm1.parammaps.startTime = parseTime(this.nutritional.tab2.inputDatetime[0], '{y}-{m}-{d}')
  2690. this.nutritional.tab2.getdataListParm1.parammaps.stopTime = parseTime(this.nutritional.tab2.inputDatetime[1], '{y}-{m}-{d}')
  2691. this.nutritional.tab2.getdataListParm2.parammaps.pastureid = this.nutritional.tab2.getdataListParm1.parammaps.pastureid
  2692. this.nutritional.tab2.getdataListParm2.parammaps.barid = this.nutritional.tab2.getdataListParm1.parammaps.barid
  2693. this.nutritional.tab2.getdataListParm2.parammaps.startTime = this.nutritional.tab2.getdataListParm1.parammaps.startTime
  2694. this.nutritional.tab2.getdataListParm2.parammaps.stopTime = this.nutritional.tab2.getdataListParm1.parammaps.stopTime
  2695. this.nutritional.tab2.getdataListParm3.parammaps.pastureid = this.nutritional.tab2.getdataListParm1.parammaps.pastureid
  2696. this.nutritional.tab2.getdataListParm3.parammaps.barid = this.nutritional.tab2.getdataListParm1.parammaps.barid
  2697. this.nutritional.tab2.getdataListParm3.parammaps.startTime = this.nutritional.tab2.getdataListParm1.parammaps.startTime
  2698. this.nutritional.tab2.getdataListParm3.parammaps.stopTime = this.nutritional.tab2.getdataListParm1.parammaps.stopTime
  2699. this.nutritional.tab2.getdataListParm4.parammaps.pastureid = this.nutritional.tab2.getdataListParm1.parammaps.pastureid
  2700. this.nutritional.tab2.getdataListParm4.parammaps.barid = this.nutritional.tab2.getdataListParm1.parammaps.barid
  2701. this.nutritional.tab2.getdataListParm4.parammaps.startTime = this.nutritional.tab2.getdataListParm1.parammaps.startTime
  2702. this.nutritional.tab2.getdataListParm4.parammaps.stopTime = this.nutritional.tab2.getdataListParm1.parammaps.stopTime
  2703. this.getTab2NutritionalList1()
  2704. this.getTab2NutritionalList2()
  2705. this.getTab2NutritionalList3()
  2706. this.getTab2NutritionalList4()
  2707. }
  2708. },
  2709. changeTab2Date() {
  2710. this.nutritional.tab2.getdataListParm1.parammaps.pastureid = this.selectList[0].pastureid
  2711. this.nutritional.tab2.getdataListParm1.parammaps.barid = this.selectList[0].barid
  2712. this.nutritional.tab2.getdataListParm1.parammaps.startTime = parseTime(this.nutritional.tab2.inputDatetime[0], '{y}-{m}-{d}')
  2713. this.nutritional.tab2.getdataListParm1.parammaps.stopTime = parseTime(this.nutritional.tab2.inputDatetime[1], '{y}-{m}-{d}')
  2714. this.nutritional.tab2.getdataListParm2.parammaps.pastureid = this.nutritional.tab2.getdataListParm1.parammaps.pastureid
  2715. this.nutritional.tab2.getdataListParm2.parammaps.barid = this.nutritional.tab2.getdataListParm1.parammaps.barid
  2716. this.nutritional.tab2.getdataListParm2.parammaps.startTime = this.nutritional.tab2.getdataListParm1.parammaps.startTime
  2717. this.nutritional.tab2.getdataListParm2.parammaps.stopTime = this.nutritional.tab2.getdataListParm1.parammaps.stopTime
  2718. this.nutritional.tab2.getdataListParm3.parammaps.pastureid = this.nutritional.tab2.getdataListParm1.parammaps.pastureid
  2719. this.nutritional.tab2.getdataListParm3.parammaps.barid = this.nutritional.tab2.getdataListParm1.parammaps.barid
  2720. this.nutritional.tab2.getdataListParm3.parammaps.startTime = this.nutritional.tab2.getdataListParm1.parammaps.startTime
  2721. this.nutritional.tab2.getdataListParm3.parammaps.stopTime = this.nutritional.tab2.getdataListParm1.parammaps.stopTime
  2722. this.nutritional.tab2.getdataListParm4.parammaps.pastureid = this.nutritional.tab2.getdataListParm1.parammaps.pastureid
  2723. this.nutritional.tab2.getdataListParm4.parammaps.barid = this.nutritional.tab2.getdataListParm1.parammaps.barid
  2724. this.nutritional.tab2.getdataListParm4.parammaps.startTime = this.nutritional.tab2.getdataListParm1.parammaps.startTime
  2725. this.nutritional.tab2.getdataListParm4.parammaps.stopTime = this.nutritional.tab2.getdataListParm1.parammaps.stopTime
  2726. this.getTab2NutritionalList1()
  2727. this.getTab2NutritionalList2()
  2728. this.getTab2NutritionalList3()
  2729. this.getTab2NutritionalList4()
  2730. },
  2731. handleBefore() {
  2732. if (this.nutritional.activeName == 'first') {
  2733. if (this.nutritional.tab1.inputDatetime !== '' && this.nutritional.tab1.inputDatetime !== null) {
  2734. var start = new Date(this.nutritional.tab1.inputDatetime[0].setDate(this.nutritional.tab1.inputDatetime[0].getDate() - 1))
  2735. var stop = new Date(this.nutritional.tab1.inputDatetime[1].setDate(this.nutritional.tab1.inputDatetime[1].getDate() - 1))
  2736. this.nutritional.tab1.inputDatetime.length = 0
  2737. this.nutritional.tab1.inputDatetime.push(start, stop)
  2738. this.$forceUpdate()
  2739. }
  2740. } else {
  2741. var start2 = new Date(this.nutritional.tab2.inputDatetime[0].setDate(this.nutritional.tab2.inputDatetime[0].getDate() - 1))
  2742. var stop2 = new Date(this.nutritional.tab2.inputDatetime[1].setDate(this.nutritional.tab2.inputDatetime[1].getDate() - 1))
  2743. this.nutritional.tab2.inputDatetime.length = 0
  2744. this.nutritional.tab2.inputDatetime.push(start2, stop2)
  2745. this.$forceUpdate()
  2746. }
  2747. },
  2748. handleNext() {
  2749. if (this.nutritional.activeName == 'first') {
  2750. if (this.nutritional.tab1.inputDatetime !== '' && this.nutritional.tab1.inputDatetime !== null) {
  2751. console.log(this.nutritional.tab1.inputDatetime)
  2752. var start3 = new Date(this.nutritional.tab1.inputDatetime[0].setDate(this.nutritional.tab1.inputDatetime[0].getDate() + 1))
  2753. var stop3 = new Date(this.nutritional.tab1.inputDatetime[1].setDate(this.nutritional.tab1.inputDatetime[1].getDate() + 1))
  2754. this.nutritional.tab1.inputDatetime.length = 0
  2755. this.nutritional.tab1.inputDatetime.push(start3, stop3)
  2756. this.$forceUpdate()
  2757. }
  2758. } else {
  2759. if (this.nutritional.tab2.inputDatetime !== '' && this.nutritional.tab2.inputDatetime !== null) {
  2760. var start4 = new Date(this.nutritional.tab2.inputDatetime[0].setDate(this.nutritional.tab2.inputDatetime[0].getDate() + 1))
  2761. var stop4 = new Date(this.nutritional.tab2.inputDatetime[1].setDate(this.nutritional.tab2.inputDatetime[1].getDate() + 1))
  2762. this.nutritional.tab2.inputDatetime.length = 0
  2763. this.nutritional.tab2.inputDatetime.push(start4, stop4)
  2764. this.$forceUpdate()
  2765. }
  2766. }
  2767. },
  2768. getNutritionalList() {
  2769. this.nutritional.tab1.listLoading1 = true
  2770. GetDataByName(this.nutritional.tab1.getdataListParm1).then(response => {
  2771. console.log('评估上方数据', response.data.list)
  2772. if (response.data.list !== null) {
  2773. response.data.list[0].cowclassid = String(response.data.list[0].cowclassid)
  2774. this.nutritional.tab1.temp = response.data.list[0]
  2775. this.nutritional.tab1.disabledCowclass = true
  2776. } else {
  2777. this.nutritional.tab1.temp = []
  2778. this.nutritional.tab1.disabledCowclass = false
  2779. }
  2780. setTimeout(() => {
  2781. this.nutritional.tab1.listLoading = false
  2782. }, 100)
  2783. })
  2784. },
  2785. assessmentData() {
  2786. console.log('评估保存')
  2787. this.$refs['temp'].validate(valid => {
  2788. if (valid) {
  2789. if (this.nutritional.tab1.inputDatetime == '' || this.nutritional.tab1.inputDatetime == null) {
  2790. this.$message({ type: 'error', message: '开始日期结束日期不能为空', duration: 2000 })
  2791. return false
  2792. } else {
  2793. this.nutritional.tab1.getdataListParm2.parammaps.name = 'judgenurFT'
  2794. this.nutritional.tab1.getdataListParm2.parammaps.name1 = 'judgenurBarHSL'
  2795. this.nutritional.tab1.getdataListParm2.parammaps.startTime = parseTime(this.nutritional.tab1.inputDatetime[0], '{y}-{m}-{d}')
  2796. this.nutritional.tab1.getdataListParm2.parammaps.stopTime = parseTime(this.nutritional.tab1.inputDatetime[1], '{y}-{m}-{d}')
  2797. this.nutritional.tab1.getdataListParm2.parammaps.bw = parseFloat(this.nutritional.tab1.temp.bw)
  2798. this.nutritional.tab1.getdataListParm2.parammaps.dayw = parseFloat(this.nutritional.tab1.temp.dayw)
  2799. this.nutritional.tab1.getdataListParm2.parammaps.fetal = parseFloat(this.nutritional.tab1.temp.fetal)
  2800. this.nutritional.tab1.getdataListParm2.parammaps.avgdim = parseFloat(this.nutritional.tab1.temp.avgdim)
  2801. this.nutritional.tab1.getdataListParm2.parammaps.dayspre = parseFloat(this.nutritional.tab1.temp.dayspre)
  2802. this.nutritional.tab1.getdataListParm2.parammaps.product = parseFloat(this.nutritional.tab1.temp.product)
  2803. this.nutritional.tab1.getdataListParm2.parammaps.fat = parseFloat(this.nutritional.tab1.temp.fat)
  2804. this.nutritional.tab1.getdataListParm2.parammaps.pro = parseFloat(this.nutritional.tab1.temp.pro)
  2805. this.nutritional.tab1.getdataListParm2.parammaps.lactose = parseFloat(this.nutritional.tab1.temp.lactose)
  2806. this.nutritional.tab1.getdataListParm2.parammaps.source = parseFloat(this.nutritional.tab1.temp.source)
  2807. this.nutritional.tab1.getdataListParm2.parammaps.tem = parseFloat(this.nutritional.tab1.temp.tem)
  2808. this.nutritional.tab1.getdataListParm2.parammaps.cowsum = parseFloat(this.nutritional.tab1.temp.cowsum)
  2809. this.nutritional.tab1.getdataListParm2.parammaps.cowclass = this.nutritional.tab1.temp.cowclass
  2810. this.nutritional.tab1.getdataListParm2.parammaps.cowclassid = this.nutritional.tab1.temp.cowclassid
  2811. this.nutritional.tab1.getdataListParm2.parammaps.bigcowclass = this.nutritional.tab1.temp.bigcowclass
  2812. this.nutritional.tab1.getdataListParm2.parammaps.pastureid = this.selectList[0].pastureid
  2813. this.nutritional.tab1.getdataListParm2.parammaps.barid = this.nutritional.tab1.temp.barid
  2814. this.nutritional.tab1.getdataListParm2.parammaps.date = this.nutritional.tab1.temp.date
  2815. this.getNutritionalList2()
  2816. }
  2817. }
  2818. })
  2819. },
  2820. getNutritionalList2() {
  2821. this.nutritional.tab1.listLoading2 = true
  2822. GETNurJudge(this.nutritional.tab1.getdataListParm2).then(response => {
  2823. console.log('评估下方数据', response.data)
  2824. if (response.data.list !== null) {
  2825. // response.data = response.data.sort(compareSort('sort'))
  2826. console.log(response.data)
  2827. this.nutritional.tab1.list = response.data
  2828. this.nutritional.tab1.total = response.data.total
  2829. } else {
  2830. this.nutritional.tab1.list = []
  2831. }
  2832. setTimeout(() => {
  2833. this.nutritional.tab1.listLoading2 = false
  2834. }, 100)
  2835. })
  2836. },
  2837. // 牛群评估
  2838. getTab2NutritionalList1() {
  2839. this.nutritional.tab2.listLoading1 = true
  2840. GetDataByName(this.nutritional.tab2.getdataListParm1).then(response => {
  2841. console.log('宾州筛分析', response.data.list)
  2842. if (response.data.list !== null) {
  2843. this.nutritional.tab2.list1 = response.data.list
  2844. this.nutritional.tab2.pageNum1 = response.data.pageNum
  2845. this.nutritional.tab2.pageSize1 = response.data.pageSize
  2846. this.nutritional.tab2.total1 = response.data.total
  2847. } else {
  2848. this.nutritional.tab2.list1 = []
  2849. }
  2850. setTimeout(() => {
  2851. this.nutritional.tab2.listLoading1 = false
  2852. }, 100)
  2853. })
  2854. },
  2855. getTab2NutritionalList2() {
  2856. this.nutritional.tab2.listLoading2 = true
  2857. GetDataByName(this.nutritional.tab2.getdataListParm2).then(response => {
  2858. console.log('粪便筛分析', response.data.list)
  2859. if (response.data.list !== null) {
  2860. this.nutritional.tab2.list2 = response.data.list
  2861. this.nutritional.tab2.pageNum2 = response.data.pageNum
  2862. this.nutritional.tab2.pageSize2 = response.data.pageSize
  2863. this.nutritional.tab2.total2 = response.data.total
  2864. } else {
  2865. this.nutritional.tab2.list2 = []
  2866. }
  2867. setTimeout(() => {
  2868. this.nutritional.tab2.listLoading2 = false
  2869. }, 100)
  2870. })
  2871. },
  2872. getTab2NutritionalList3() {
  2873. this.nutritional.tab2.listLoading3 = true
  2874. GetDataByName(this.nutritional.tab2.getdataListParm3).then(response => {
  2875. console.log('BCS评分', response.data.list)
  2876. if (response.data.list !== null) {
  2877. this.nutritional.tab2.list3 = response.data.list
  2878. this.nutritional.tab2.pageNum3 = response.data.pageNum
  2879. this.nutritional.tab2.pageSize3 = response.data.pageSize
  2880. this.nutritional.tab2.total3 = response.data.total
  2881. } else {
  2882. this.nutritional.tab2.list3 = []
  2883. }
  2884. setTimeout(() => {
  2885. this.nutritional.tab2.listLoading3 = false
  2886. }, 100)
  2887. })
  2888. },
  2889. getTab2NutritionalList4() {
  2890. this.nutritional.tab2.listLoading4 = true
  2891. GetDataByName(this.nutritional.tab2.getdataListParm4).then(response => {
  2892. console.log('粪便评分', response.data.list)
  2893. if (response.data.list !== null) {
  2894. this.nutritional.tab2.list4 = response.data.list
  2895. this.nutritional.tab2.pageNum4 = response.data.pageNum
  2896. this.nutritional.tab2.pageSize4 = response.data.pageSize
  2897. this.nutritional.tab2.total4 = response.data.total
  2898. } else {
  2899. this.nutritional.tab2.list4 = []
  2900. }
  2901. setTimeout(() => {
  2902. this.nutritional.tab2.listLoading4 = false
  2903. }, 100)
  2904. })
  2905. },
  2906. // 历史记录
  2907. handleHistoryRecords() {
  2908. console.log('点击了历史记录')
  2909. this.history.dialogStatus = 'history'
  2910. this.history.dialogFormVisible = true
  2911. this.getDateList()
  2912. },
  2913. // 历史时间
  2914. getDateList() {
  2915. GetDataByName(this.history.getdataDateParm).then(response => {
  2916. console.log('table数据', response.data.list)
  2917. if (response.data.list !== null) {
  2918. this.history.getdataListParm.parammaps.date = response.data.list[0].maxdate
  2919. this.getHistoryIsDisplay()
  2920. } else {
  2921. this.history.getdataListParm.parammaps.date = ''
  2922. }
  2923. })
  2924. },
  2925. getHistoryIsDisplay() {
  2926. GetDataByName(this.table.getdataListParm2).then(response => {
  2927. console.log(response.data.list[0].inforvalue)
  2928. if (response.data.list !== null) {
  2929. if (response.data.list[0].inforvalue == 0) {
  2930. this.table.isPtsfname = false
  2931. } else {
  2932. this.table.isPtsfname = true
  2933. }
  2934. }
  2935. })
  2936. GetDataByName(this.table.getdataListParm3).then(response => {
  2937. if (response.data.list !== null) {
  2938. if (response.data.list[0].inforvalue == 1) {
  2939. this.history.isRW1 = true
  2940. this.history.isRW2 = false
  2941. this.history.isRW3 = false
  2942. this.history.isRW4 = false
  2943. } else if (response.data.list[0].inforvalue == 2) {
  2944. this.history.isRW1 = true
  2945. this.history.isRW2 = true
  2946. this.history.isRW3 = false
  2947. this.history.isRW4 = false
  2948. } else if (response.data.list[0].inforvalue == 3) {
  2949. this.history.isRW1 = true
  2950. this.history.isRW2 = true
  2951. this.history.isRW3 = true
  2952. this.history.isRW4 = false
  2953. } else if (response.data.list[0].inforvalue == 4) {
  2954. this.history.isRW1 = true
  2955. this.history.isRW2 = true
  2956. this.history.isRW3 = true
  2957. this.history.isRW4 = true
  2958. }
  2959. } else {
  2960. this.history.isRW1 = false
  2961. this.history.isRW2 = false
  2962. this.history.isRW3 = false
  2963. this.history.isRW4 = false
  2964. }
  2965. })
  2966. this.getHistoryList()
  2967. },
  2968. getHistoryList() {
  2969. this.history.listLoading = true
  2970. GetDataByName(this.history.getdataListParm).then(response => {
  2971. console.log('table数据', response.data.list)
  2972. if (response.data.list !== null) {
  2973. console.log('table数据', response.data.list)
  2974. for (let i = 0; i < response.data.list.length; i++) {
  2975. this.$set(response.data.list[i], 'Edit', false) // 编辑
  2976. this.$set(response.data.list[i], 'NoEdit', true) // 不可编辑/输入
  2977. this.$set(response.data.list[i], 'isUpdate', true) // 编辑操作
  2978. this.$set(response.data.list[i], 'isUpdateSave', false) // 编辑保存
  2979. if (response.data.list[i].ftid == undefined || response.data.list[i].ftname == '') {
  2980. this.$set(response.data.list[i], 'ftid', '')
  2981. this.$set(response.data.list[i], 'ftname', '')
  2982. }
  2983. if (response.data.list[i].ptsfid == undefined || response.data.list[i].ptsfname == '') {
  2984. this.$set(response.data.list[i], 'ptsfid', '')
  2985. this.$set(response.data.list[i], 'ptsfname', '')
  2986. }
  2987. if (response.data.list[i].ccount == undefined) {
  2988. this.$set(response.data.list[i], 'ccount', '')
  2989. }
  2990. if (response.data.list[i].ratio == undefined) {
  2991. this.$set(response.data.list[i], 'ratio', '100')
  2992. }
  2993. if (response.data.list[i].ccountratio == undefined) {
  2994. this.$set(response.data.list[i], 'ccountratio', '')
  2995. }
  2996. if (response.data.list[i].r1 == undefined) {
  2997. this.$set(response.data.list[i], 'r1', '')
  2998. }
  2999. if (response.data.list[i].r2 == undefined) {
  3000. this.$set(response.data.list[i], 'r2', '')
  3001. }
  3002. if (response.data.list[i].r3 == undefined) {
  3003. this.$set(response.data.list[i], 'r3', '')
  3004. }
  3005. if (response.data.list[i].r4 == undefined) {
  3006. this.$set(response.data.list[i], 'r4', '')
  3007. }
  3008. if (response.data.list[i].w1 == undefined) {
  3009. this.$set(response.data.list[i], 'w1', '')
  3010. }
  3011. if (response.data.list[i].w2 == undefined) {
  3012. this.$set(response.data.list[i], 'w2', '')
  3013. }
  3014. if (response.data.list[i].w3 == undefined) {
  3015. this.$set(response.data.list[i], 'w3', '')
  3016. }
  3017. if (response.data.list[i].w4 == undefined) {
  3018. this.$set(response.data.list[i], 'w4', '')
  3019. }
  3020. if (response.data.list[i].feedweight == undefined) {
  3021. this.$set(response.data.list[i], 'feedweight', '')
  3022. }
  3023. if (response.data.list[i].Bfweight == undefined) {
  3024. this.$set(response.data.list[i], 'Bfweight', '')
  3025. }
  3026. if (response.data.list[i].Sfweight == undefined) {
  3027. this.$set(response.data.list[i], 'Sfweight', '')
  3028. }
  3029. if (response.data.list[i].timesopt !== undefined) {
  3030. var timesoptArr = response.data.list[i].timesopt.split(',')
  3031. for (let j = 0; j < timesoptArr.length; j++) {
  3032. response.data.list[i]['r' + timesoptArr[j].split(':')[0]] = timesoptArr[j].split(':')[1]
  3033. response.data.list[i]['w' + timesoptArr[j].split(':')[0]] = timesoptArr[j].split(':')[2]
  3034. }
  3035. }
  3036. }
  3037. this.history.list = response.data.list
  3038. for (let i = 0; i < response.data.list.length; i++) {
  3039. if (response.data.list[i].r1 == '') { response.data.list[i].r1 = 0 }
  3040. if (response.data.list[i].r2 == '') { response.data.list[i].r2 = 0 }
  3041. if (response.data.list[i].r3 == '') { response.data.list[i].r3 = 0 }
  3042. if (response.data.list[i].r4 == '') { response.data.list[i].r4 = 0 }
  3043. this.$set(response.data.list[i], 'sumr', Math.round(parseFloat(response.data.list[i].r1) + parseFloat(response.data.list[i].r2) + parseFloat(response.data.list[i].r3) + parseFloat(response.data.list[i].r4)))
  3044. }
  3045. this.history.pageNum = response.data.pageNum
  3046. this.history.pageSize = response.data.pageSize
  3047. this.history.total = response.data.total
  3048. } else {
  3049. this.history.list = []
  3050. }
  3051. setTimeout(() => {
  3052. this.history.listLoading = false
  3053. }, 100)
  3054. })
  3055. },
  3056. changeDate() {
  3057. this.getHistoryList()
  3058. },
  3059. // 应用
  3060. handleApplication() {
  3061. console.log('点击了应用')
  3062. MessageBox.confirm('是否确认将' + this.history.getdataListParm.parammaps.date + '的数据应用到当前?', {
  3063. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  3064. }).then(() => {
  3065. this.requestParam.name = 'applyFPdate'
  3066. this.requestParam.parammaps = {}
  3067. this.requestParam.parammaps.pastureid = Cookies.get('pastureid')
  3068. this.requestParam.parammaps.date = this.history.getdataListParm.parammaps.date
  3069. PostDataByName(this.requestParam).then(response => {
  3070. if (response.msg === 'fail') {
  3071. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  3072. } else {
  3073. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  3074. this.getHistoryIsDisplay()
  3075. this.getList()
  3076. }
  3077. })
  3078. }).catch(() => {
  3079. this.$message({ type: 'info', message: '已取消应用' })
  3080. })
  3081. },
  3082. // 导出
  3083. handleExport(item) {
  3084. if (item == 1) {
  3085. console.log('点击了导出模板')
  3086. } else {
  3087. console.log('点击了导出数据')
  3088. }
  3089. },
  3090. // 导入
  3091. handleImport() {
  3092. console.log('点击了导入')
  3093. }
  3094. }
  3095. }
  3096. </script>
  3097. <style lang="scss" scoped>
  3098. .search {
  3099. clear: both;
  3100. }
  3101. .table {
  3102. margin-top: 10px;
  3103. }
  3104. </style>