c346b8d6ac81a4061c8f10d4991624dc074cb2fd.svn-base 122 KB

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