6560485eedd5f08549c3d716d85923c11abd92ea.svn-base 120 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812
  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. },
  1237. // 实际牛头数失去焦点计算
  1238. // ccount实际牛头数
  1239. // ratio系数
  1240. // ccountratio系数牛头数
  1241. blurCcount(row) { // 实际牛头数
  1242. console.log(row)
  1243. if (row.ftid !== '-1' && row.ftid !== '') {
  1244. console.log(123)
  1245. console.log(this.recipeTemplateList.find(obj => obj.id == row.ftid).Sfweight)
  1246. row.Sfweight = this.recipeTemplateList.find(obj => obj.id == row.ftid).Sfweight
  1247. }
  1248. if (row.ptsfid !== '-1' && row.ptsfid !== '') {
  1249. console.log(1234)
  1250. console.log(this.feedingFormulaList.find(obj => obj.id == row.ptsfid).Sfweight)
  1251. row.BLweight = this.feedingFormulaList.find(obj => obj.id == row.ptsfid).Sfweight
  1252. }
  1253. if (row.Sfweight !== '' && row.ccount !== '') {
  1254. console.log(1235)
  1255. console.log(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount))
  1256. row.ftweight = parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount)
  1257. }
  1258. // 系数牛头数 = 实际牛头数 * 系数/100
  1259. if (row.ccount !== '' && row.ratio !== '') {
  1260. row.ccountratio = parseFloat(row.ccount) * parseFloat(row.ratio) / 100
  1261. } else if (row.ratio !== '' && row.ccountratio !== '') {
  1262. row.ccount = parseFloat(row.ccountratio) * 100 / parseFloat(row.ratio) / 100
  1263. } else if (row.ccount !== '' || row.ratio !== '') {
  1264. row.ccountratio = ''
  1265. }
  1266. // 补料重量
  1267. console.log(row.ccountratio, row.BLweight)
  1268. if (row.BLweight == 'undefined') {
  1269. this.$set(row, 'BLweight', '')
  1270. console.log(111)
  1271. }
  1272. if (row.ccountratio !== '' && row.BLweight !== '') {
  1273. row.supplyweight = parseFloat(row.Sfweight) * parseFloat(row.ccountratio)
  1274. } else if (row.ccountratio !== '' && row.BLweight == '') {
  1275. row.supplyweight = ''
  1276. row.feedweight = ''
  1277. } else if (row.ccountratio == '' && row.BLweight !== '') {
  1278. row.supplyweight = ''
  1279. row.feedweight = ''
  1280. }
  1281. // 配方重量
  1282. if (row.ccountratio !== '' && row.Sfweight !== '') {
  1283. row.ftweight = parseFloat(row.Sfweight) * parseFloat(row.ccountratio)
  1284. } else if (row.ccountratio !== '' && row.Sfweight == '') {
  1285. row.ftweight = ''
  1286. row.feedweight = ''
  1287. } else if (row.ccountratio == '' && row.Sfweight !== '') {
  1288. row.ftweight = ''
  1289. row.feedweight = ''
  1290. }
  1291. if (this.table.isPtsfname == false) {
  1292. row.feedweight = parseFloat(row.ftweight)
  1293. } else {
  1294. if (row.supplyweight !== '' && row.ftweight !== '') {
  1295. row.feedweight = parseFloat(row.supplyweight) + parseFloat(row.ftweight)
  1296. } else if (row.supplyweight !== '' && row.ftweight == '') {
  1297. row.feedweight = parseFloat(row.supplyweight)
  1298. } else if (row.supplyweight == '' && row.ftweight !== '') {
  1299. row.feedweight = parseFloat(row.ftweight)
  1300. }
  1301. // 配方重量 = 系数头数 * Sfweight
  1302. if (row.ccountratio !== '' && row.ftweight !== '') {
  1303. row.ftweight = parseFloat(row.Sfweight) * parseFloat(row.ccountratio)
  1304. }
  1305. // 补料重量 = 系数头数 * BLweight
  1306. if (row.ccountratio !== '' && row.BLweight !== '') {
  1307. row.supplyweight = parseFloat(row.BLweight) * parseFloat(row.ccountratio)
  1308. }
  1309. }
  1310. },
  1311. blurRatio(row) {
  1312. console.log(row)
  1313. if (row.ftid !== '-1' && row.ftid !== '') {
  1314. row.Sfweight = this.recipeTemplateList.find(obj => obj.id == row.ftid).Sfweight
  1315. }
  1316. if (row.ptsfid !== '-1' && row.ptsfid !== '') {
  1317. row.BLweight = this.feedingFormulaList.find(obj => obj.id == row.ptsfid).Sfweight
  1318. }
  1319. // 系数
  1320. if (row.ccount !== '' && row.ratio !== '' && row.ccountratio !== '') {
  1321. row.ccountratio = parseFloat(row.ccount) * parseFloat(row.ratio) / 100
  1322. } else if (row.ccount !== '' && row.ccountratio !== '') {
  1323. row.ratio = parseFloat(row.ccountratio) * 100 / parseFloat(row.ccount)
  1324. } else if (row.ccount !== '' || row.ccountratio !== '') {
  1325. row.ratio = ''
  1326. }
  1327. // 补料重量
  1328. if (row.ccountratio !== '' && row.BLweight !== '') {
  1329. row.supplyweight = parseFloat(row.Sfweight) * parseFloat(row.ccountratio)
  1330. } else if (row.ccountratio !== '' && row.BLweight == '') {
  1331. row.supplyweight = ''
  1332. row.feedweight = ''
  1333. } else if (row.ccountratio == '' && row.BLweight !== '') {
  1334. row.supplyweight = ''
  1335. row.feedweight = ''
  1336. }
  1337. // 配方重量
  1338. if (row.ccountratio !== '' && row.Sfweight !== '') {
  1339. row.ftweight = parseFloat(row.Sfweight) * parseFloat(row.ccountratio)
  1340. } else if (row.ccountratio !== '' && row.Sfweight == '') {
  1341. row.ftweight = ''
  1342. row.feedweight = ''
  1343. } else if (row.ccountratio == '' && row.Sfweight !== '') {
  1344. row.ftweight = ''
  1345. row.feedweight = ''
  1346. }
  1347. // 投喂量
  1348. if (row.supplyweight !== '' && row.ftweight !== '') {
  1349. row.feedweight = parseFloat(row.supplyweight) + parseFloat(row.ftweight)
  1350. } else if (row.supplyweight == '' && row.ftweight !== '') {
  1351. row.feedweight = parseFloat(row.ftweight)
  1352. } else if (row.supplyweight !== '' && row.ftweight == '') {
  1353. row.feedweight = parseFloat(row.supplyweight)
  1354. }
  1355. if (this.table.isPtsfname == false) {
  1356. row.feedweight = parseFloat(row.ftweight)
  1357. } else {
  1358. // 投喂量
  1359. if (row.supplyweight !== '' && row.ftweight !== '') {
  1360. row.feedweight = parseFloat(row.supplyweight) + parseFloat(row.ftweight)
  1361. } else if (row.supplyweight == '' && row.ftweight !== '') {
  1362. row.feedweight = parseFloat(row.ftweight)
  1363. } else if (row.supplyweight !== '' && row.ftweight == '') {
  1364. row.feedweight = parseFloat(row.supplyweight)
  1365. }
  1366. // 补料重量
  1367. if (row.ccountratio !== '' && row.BLweight !== '') {
  1368. row.supplyweight = parseFloat(row.Sfweight) * parseFloat(row.ccountratio)
  1369. } else if (row.ccountratio !== '' && row.BLweight == '') {
  1370. row.supplyweight = ''
  1371. row.feedweight = ''
  1372. } else if (row.ccountratio == '' && row.BLweight !== '') {
  1373. row.supplyweight = ''
  1374. row.feedweight = ''
  1375. }
  1376. // 配方重量
  1377. if (row.ccountratio !== '' && row.Sfweight !== '') {
  1378. row.ftweight = parseFloat(row.Sfweight) * parseFloat(row.ccountratio)
  1379. } else if (row.ccountratio !== '' && row.Sfweight == '') {
  1380. row.ftweight = ''
  1381. row.feedweight = ''
  1382. } else if (row.ccountratio == '' && row.Sfweight !== '') {
  1383. row.ftweight = ''
  1384. row.feedweight = ''
  1385. }
  1386. }
  1387. },
  1388. blurCcountratio(row) {
  1389. if (row.ftid !== '-1' && row.ftid !== '') {
  1390. row.Sfweight = this.recipeTemplateList.find(obj => obj.id == row.ftid).Sfweight
  1391. }
  1392. if (row.ptsfid !== '-1' && row.ptsfid !== '') {
  1393. row.BLweight = this.feedingFormulaList.find(obj => obj.id == row.ptsfid).Sfweight
  1394. }
  1395. // 系数头数
  1396. if (row.ccountratio !== '' && row.ccount !== '' && row.ratio !== '') {
  1397. row.ratio = parseFloat(row.ccountratio) * 100 / parseFloat(row.ccount)
  1398. } else if (row.ccount !== '' && row.ratio !== '') {
  1399. row.ccountratio = parseFloat(row.ccount) * parseFloat(row.ratio) / 100
  1400. } else if (row.ccountratio !== '' && row.ccount !== '') {
  1401. row.ratio = parseFloat(row.ccountratio) * 100 / parseFloat(row.ccount)
  1402. } else if (row.ccountratio !== '' && row.ratio !== '') {
  1403. row.ccount = parseFloat(row.ccountratio) * 100 / parseFloat(row.ratio) / 100
  1404. }
  1405. // 补料重量
  1406. if (row.ccountratio !== '' && row.BLweight !== '') {
  1407. row.supplyweight = parseFloat(row.Sfweight) * parseFloat(row.ccountratio)
  1408. } else if (row.ccountratio !== '' && row.BLweight == '') {
  1409. row.supplyweight = ''
  1410. row.feedweight = ''
  1411. } else if (row.ccountratio == '' && row.BLweight !== '') {
  1412. row.supplyweight = ''
  1413. row.feedweight = ''
  1414. }
  1415. // 配方重量
  1416. if (row.ccountratio !== '' && row.Sfweight !== '') {
  1417. row.ftweight = parseFloat(row.Sfweight) * parseFloat(row.ccountratio)
  1418. } else if (row.ccountratio !== '' && row.Sfweight == '') {
  1419. row.ftweight = ''
  1420. row.feedweight = ''
  1421. } else if (row.ccountratio == '' && row.Sfweight !== '') {
  1422. row.ftweight = ''
  1423. row.feedweight = ''
  1424. }
  1425. // 投喂量
  1426. if (row.supplyweight !== '' && row.ftweight !== '') {
  1427. row.feedweight = parseFloat(row.supplyweight) + parseFloat(row.ftweight)
  1428. } else if (row.supplyweight == '' && row.ftweight !== '') {
  1429. row.feedweight = parseFloat(row.ftweight)
  1430. } else if (row.supplyweight !== '' && row.ftweight == '') {
  1431. row.feedweight = parseFloat(row.supplyweight)
  1432. }
  1433. if (this.table.isPtsfname == false) {
  1434. console.log(row)
  1435. row.feedweight = parseFloat(row.ftweight)
  1436. } else {
  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. // 补料重量
  1446. if (row.ccountratio !== '' && row.BLweight !== '') {
  1447. row.supplyweight = parseFloat(row.Sfweight) * parseFloat(row.ccountratio)
  1448. } else if (row.ccountratio !== '' && row.BLweight == '') {
  1449. row.supplyweight = ''
  1450. row.feedweight = ''
  1451. } else if (row.ccountratio == '' && row.BLweight !== '') {
  1452. row.supplyweight = ''
  1453. row.feedweight = ''
  1454. }
  1455. // 配方重量
  1456. if (row.ccountratio !== '' && row.Sfweight !== '') {
  1457. row.ftweight = parseFloat(row.Sfweight) * parseFloat(row.ccountratio)
  1458. } else if (row.ccountratio !== '' && row.Sfweight == '') {
  1459. row.ftweight = ''
  1460. row.feedweight = ''
  1461. } else if (row.ccountratio == '' && row.Sfweight !== '') {
  1462. row.ftweight = ''
  1463. row.feedweight = ''
  1464. }
  1465. }
  1466. },
  1467. // 总比例
  1468. blurR(row) {
  1469. if (row.r1 == '') { row.r1 = 0 }
  1470. if (row.r2 == '') { row.r2 = 0 }
  1471. if (row.r3 == '') { row.r3 = 0 }
  1472. if (row.r4 == '') { row.r4 = 0 }
  1473. if (row.r1 !== '') {
  1474. row.w1 = parseFloat(row.feedweight) * parseFloat(row.r1) / 100
  1475. row.w1 = row.w1.toFixed(2)
  1476. }
  1477. if (row.r2 !== '') {
  1478. row.w2 = parseFloat(row.feedweight) * parseFloat(row.r2) / 100
  1479. row.w2 = row.w2.toFixed(2)
  1480. }
  1481. if (row.r3 !== '') {
  1482. row.w3 = parseFloat(row.feedweight) * parseFloat(row.r3) / 100
  1483. row.w3 = row.w3.toFixed(2)
  1484. }
  1485. if (row.r4 !== '') {
  1486. row.w4 = parseFloat(row.feedweight) * parseFloat(row.r4) / 100
  1487. row.w4 = row.w4.toFixed(2)
  1488. }
  1489. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4)).toFixed(2))
  1490. },
  1491. // 一班重量得到焦点
  1492. focusW(row) {
  1493. console.log(row)
  1494. this.focusWRow = Object.assign({}, row)
  1495. },
  1496. // 1班重量得到焦点
  1497. focusW2(row) {
  1498. console.log(row)
  1499. this.focusWRow2 = Object.assign({}, row)
  1500. },
  1501. // 3班重量得到焦点
  1502. focusW3(row) {
  1503. console.log(row)
  1504. this.focusWRow3 = Object.assign({}, row)
  1505. },
  1506. // 4班重量得到焦点
  1507. focusW4(row) {
  1508. console.log(row)
  1509. this.focusWRow4 = Object.assign({}, row)
  1510. },
  1511. // 一班重量
  1512. blurW(row) {
  1513. if (row.w1 == '') {
  1514. row.w1 = 0
  1515. }
  1516. if (row.w2 == '') {
  1517. row.w2 = 0
  1518. }
  1519. if (row.w3 == '') {
  1520. row.w3 = 0
  1521. }
  1522. if (row.w4 == '') {
  1523. row.w4 = 0
  1524. }
  1525. if (row.r1 == '') {
  1526. row.r1 = 0
  1527. }
  1528. if (row.r2 == '') {
  1529. row.r2 = 0
  1530. }
  1531. if (row.r3 == '') {
  1532. row.r3 = 0
  1533. }
  1534. if (row.r4 == '') {
  1535. row.r4 = 0
  1536. }
  1537. // row.ftweight = parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4)
  1538. console.log(row, '=======投喂量feedweight')
  1539. // isOneWeight,isTwoWeight,isThreeWeight,isFourWeight
  1540. if (this.table.RWLength == 4) {
  1541. // 2班3班4班都锁定
  1542. if (row.isTwoWeight == true && row.isThreeWeight == true && row.isFourWeight == true) {
  1543. row.r1 = (parseFloat(row.w1) / parseFloat(row.feedweight) * 100).toFixed(2)
  1544. this.$set(row, 'sumr', parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4))
  1545. }
  1546. // 2班3班锁定4班未锁定
  1547. if (row.isTwoWeight == true && row.isThreeWeight == true && row.isFourWeight == false) {
  1548. row.r1 = (parseFloat(row.w1) / parseFloat(row.feedweight) * 100).toFixed(2)
  1549. row.w4 = (parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w2) - parseFloat(row.w3)).toFixed(2)
  1550. row.r4 = (parseFloat(row.w4) / parseFloat(row.feedweight) * 100).toFixed(2)
  1551. if (row.w4 <= 0) {
  1552. row.w4 = 0
  1553. row.r4 = 0
  1554. }
  1555. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4)).toFixed(2))
  1556. }
  1557. // 2班4班锁定3班未锁定
  1558. if (row.isTwoWeight == true && row.isFourWeight == true && row.isThreeWeight == false) {
  1559. row.r1 = (parseFloat(row.w1) / parseFloat(row.feedweight) * 100).toFixed(2)
  1560. row.w3 = (parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w2) - parseFloat(row.w4)).toFixed(2)
  1561. row.r3 = (parseFloat(row.w3) / parseFloat(row.feedweight) * 100).toFixed(2)
  1562. if (row.w3 <= 0) {
  1563. row.w3 = 0
  1564. row.r3 = 0
  1565. }
  1566. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4)).toFixed(2))
  1567. }
  1568. // 3班4班锁定2班未锁定
  1569. if (row.isTwoWeight == false && row.isThreeWeight == true && row.isFourWeight == true) {
  1570. row.r1 = (parseFloat(row.w1) / parseFloat(row.feedweight) * 100).toFixed(2)
  1571. row.w2 = (parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w3) - parseFloat(row.w4)).toFixed(2)
  1572. row.r2 = (parseFloat(row.w3) / parseFloat(row.feedweight) * 100).toFixed(2)
  1573. if (row.w2 <= 0) {
  1574. row.w2 = 0
  1575. row.r2 = 0
  1576. }
  1577. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4)).toFixed(2))
  1578. }
  1579. // 2班锁定,3班4班未锁
  1580. if (row.isTwoWeight == true && row.isThreeWeight == false && row.isFourWeight == false) {
  1581. row.r1 = (parseFloat(row.w1) / parseFloat(row.feedweight) * 100).toFixed(2)
  1582. row.w3 = ((parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w2)) * parseFloat(row.r3) / (parseFloat(this.focusWRow.r3) + parseFloat(this.focusWRow.r4))).toFixed(2)
  1583. row.r3 = (parseFloat(row.w3) / parseFloat(row.feedweight) * 100).toFixed(2)
  1584. row.w4 = ((parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w2)) * parseFloat(row.r4) / (parseFloat(this.focusWRow.r3) + parseFloat(row.r4))).toFixed(2)
  1585. row.r4 = (parseFloat(row.w4) / parseFloat(row.feedweight) * 100).toFixed(2)
  1586. if (row.w3 <= 0) {
  1587. row.w3 = 0
  1588. row.r3 = 0
  1589. }
  1590. if (row.w4 <= 0) {
  1591. row.w4 = 0
  1592. row.r4 = 0
  1593. }
  1594. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4)).toFixed(2))
  1595. }
  1596. // 3班锁定,2班4班未锁
  1597. if (row.isTwoWeight == false && row.isThreeWeight == true && row.isFourWeight == false) {
  1598. row.r1 = (parseFloat(row.w1) / parseFloat(row.feedweight) * 100).toFixed(2)
  1599. row.w2 = ((parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w3)) * parseFloat(row.r2) / (parseFloat(this.focusWRow.r2) + parseFloat(this.focusWRow.r4))).toFixed(2)
  1600. row.r2 = (parseFloat(row.w2) / parseFloat(row.feedweight) * 100).toFixed(2)
  1601. row.w4 = ((parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w3)) * parseFloat(row.r4) / (parseFloat(this.focusWRow.r2) + parseFloat(row.r4))).toFixed(2)
  1602. row.r4 = (parseFloat(row.w4) / parseFloat(row.feedweight) * 100).toFixed(2)
  1603. if (row.w2 <= 0) {
  1604. row.w2 = 0
  1605. row.r2 = 0
  1606. }
  1607. if (row.w4 <= 0) {
  1608. row.w4 = 0
  1609. row.r4 = 0
  1610. }
  1611. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4)).toFixed(2))
  1612. }
  1613. // 4班锁定,2班3班未锁
  1614. if (row.isTwoWeight == false && row.isThreeWeight == false && row.isFourWeight == true) {
  1615. row.r1 = (parseFloat(row.w1) / parseFloat(row.feedweight) * 100).toFixed(2)
  1616. row.w2 = ((parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w4)) * parseFloat(row.r2) / (parseFloat(this.focusWRow.r2) + parseFloat(this.focusWRow.r3))).toFixed(2)
  1617. row.r2 = (parseFloat(row.w2) / parseFloat(row.feedweight) * 100).toFixed(2)
  1618. row.w3 = ((parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w4)) * parseFloat(row.r3) / (parseFloat(this.focusWRow.r2) + parseFloat(row.r3))).toFixed(2)
  1619. row.r3 = (parseFloat(row.w3) / parseFloat(row.feedweight) * 100).toFixed(2)
  1620. if (row.w2 <= 0) {
  1621. row.w2 = 0
  1622. row.r2 = 0
  1623. }
  1624. if (row.w3 <= 0) {
  1625. row.w3 = 0
  1626. row.r3 = 0
  1627. }
  1628. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4)).toFixed(2))
  1629. }
  1630. // 2班3班4班未锁
  1631. if (row.isTwoWeight == false && row.isThreeWeight == false && row.isFourWeight == false) {
  1632. row.r1 = (parseFloat(row.w1) / parseFloat(row.feedweight) * 100).toFixed(2)
  1633. 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)
  1634. row.r2 = (parseFloat(row.w2) / parseFloat(row.feedweight) * 100).toFixed(2)
  1635. 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)
  1636. row.r3 = (parseFloat(row.w3) / parseFloat(row.feedweight) * 100).toFixed(2)
  1637. 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)
  1638. row.r4 = (parseFloat(row.w4) / parseFloat(row.feedweight) * 100).toFixed(2)
  1639. if (row.w2 <= 0) {
  1640. row.w2 = 0
  1641. row.r2 = 0
  1642. }
  1643. if (row.w3 <= 0) {
  1644. row.w3 = 0
  1645. row.r3 = 0
  1646. }
  1647. if (row.w4 <= 0) {
  1648. row.w4 = 0
  1649. row.r4 = 0
  1650. }
  1651. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4)).toFixed(2))
  1652. }
  1653. } else if (this.table.RWLength == 3) {
  1654. // 三班
  1655. // 2班/3班锁定
  1656. if (row.isTwoWeight == true && row.isThreeWeight == true) {
  1657. row.r1 = (parseFloat(row.w1) / parseFloat(row.feedweight) * 100).toFixed(2)
  1658. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3)).toFixed(2))
  1659. }
  1660. // 2班不锁3班锁
  1661. if (row.isTwoWeight == false && row.isThreeWeight == true) {
  1662. row.r1 = (parseFloat(row.w1) / parseFloat(row.feedweight) * 100).toFixed(2)
  1663. row.w2 = (parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w3)).toFixed(2)
  1664. row.r2 = (parseFloat(row.w2) / parseFloat(row.feedweight) * 100).toFixed(2)
  1665. if (row.w2 <= 0) {
  1666. row.w2 = 0
  1667. row.r2 = 0
  1668. }
  1669. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3)).toFixed(2))
  1670. }
  1671. // 3班不锁2班锁
  1672. if (row.isTwoWeight == true && row.isThreeWeight == false) {
  1673. row.r1 = (parseFloat(row.w1) / parseFloat(row.feedweight) * 100).toFixed(2)
  1674. row.w3 = (parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w2)).toFixed(2)
  1675. row.r3 = (parseFloat(row.w3) / parseFloat(row.feedweight) * 100).toFixed(2)
  1676. if (row.w3 <= 0) {
  1677. row.w3 = 0
  1678. row.r3 = 0
  1679. }
  1680. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3)).toFixed(2))
  1681. }
  1682. // 2班3班都不锁
  1683. if (row.isTwoWeight == false && row.isThreeWeight == false) {
  1684. row.r1 = (parseFloat(row.w1) / parseFloat(row.feedweight) * 100).toFixed(2)
  1685. row.w2 = ((parseFloat(row.feedweight) - parseFloat(row.w1)) * parseFloat(row.r2) / (parseFloat(row.r2) + parseFloat(row.r3))).toFixed(2)
  1686. row.r2 = (parseFloat(row.w2) / parseFloat(row.feedweight) * 100).toFixed(2)
  1687. row.w3 = ((parseFloat(row.feedweight) - parseFloat(row.w1)) * parseFloat(row.r3) / (parseFloat(this.focusWRow.r2) + parseFloat(row.r3))).toFixed(2)
  1688. row.r3 = (parseFloat(row.w3) / parseFloat(row.feedweight) * 100).toFixed(2)
  1689. if (row.w3 <= 0) {
  1690. row.w3 = 0
  1691. row.r3 = 0
  1692. }
  1693. if (row.w2 <= 0) {
  1694. row.w2 = 0
  1695. row.r2 = 0
  1696. }
  1697. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3)).toFixed(2))
  1698. }
  1699. } else if (this.table.RWLength == 2) {
  1700. // 两班isOneWeight,isTwoWeight
  1701. if (row.w1 == '') { row.w1 = 0 }
  1702. if (row.w2 == '') { row.w2 = 0 }
  1703. if (row.r1 == '') { row.r1 = 0 }
  1704. if (row.r2 == '') { row.r2 = 0 }
  1705. if (row.isTwoWeight == false) {
  1706. row.r1 = (parseFloat(row.w1) / parseFloat(row.feedweight) * 100).toFixed(2)
  1707. row.w2 = (parseFloat(row.feedweight) - parseFloat(row.w1)).toFixed(2)
  1708. row.r2 = (parseFloat(row.w2) / parseFloat(row.feedweight) * 100).toFixed(2)
  1709. if (row.w2 <= 0) { row.w2 = 0; row.r2 = 0 }
  1710. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2)).toFixed(2))
  1711. } else {
  1712. row.r1 = parseFloat(row.w1) / parseFloat(row.feedweight) * 100
  1713. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2)).toFixed(2))
  1714. }
  1715. }
  1716. },
  1717. blurW2(row) {
  1718. // 2班重量
  1719. if (row.w1 == '') {
  1720. row.w1 = 0
  1721. }
  1722. if (row.w2 == '') {
  1723. row.w2 = 0
  1724. }
  1725. if (row.w3 == '') {
  1726. row.w3 = 0
  1727. }
  1728. if (row.w4 == '') {
  1729. row.w4 = 0
  1730. }
  1731. if (row.r1 == '') {
  1732. row.r1 = 0
  1733. }
  1734. if (row.r2 == '') {
  1735. row.r2 = 0
  1736. }
  1737. if (row.r3 == '') {
  1738. row.r3 = 0
  1739. }
  1740. if (row.r4 == '') {
  1741. row.r4 = 0
  1742. }
  1743. // row.ftweight = parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4)
  1744. console.log(row, '=======投喂量feedweight')
  1745. // isOneWeight,isTwoWeight,isThreeWeight,isFourWeight
  1746. if (this.table.RWLength == 4) {
  1747. // 四班
  1748. // 1班3班4班都锁定
  1749. if (row.isOneWeight == true && row.isThreeWeight == true && row.isFourWeight == true) {
  1750. row.r2 = (parseFloat(row.w2) / parseFloat(row.feedweight) * 100).toFixed(2)
  1751. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4)).toFixed(2))
  1752. }
  1753. // 1班3班锁定4班未锁定
  1754. if (row.isOneWeight == true && row.isThreeWeight == true && row.isFourWeight == false) {
  1755. row.r2 = (parseFloat(row.w2) / parseFloat(row.feedweight) * 100).toFixed(2)
  1756. row.w4 = (parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w2) - parseFloat(row.w3)).toFixed(2)
  1757. row.r4 = (parseFloat(row.w4) / parseFloat(row.feedweight) * 100).toFixed(2)
  1758. if (row.w4 <= 0) {
  1759. row.w4 = 0
  1760. row.r4 = 0
  1761. }
  1762. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4)).toFixed(2))
  1763. }
  1764. // 1班4班锁定3班未锁定
  1765. if (row.isOneWeight == true && row.isFourWeight == true && row.isThreeWeight == false) {
  1766. row.r2 = (parseFloat(row.w2) / parseFloat(row.feedweight) * 100).toFixed(2)
  1767. row.w3 = (parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w2) - parseFloat(row.w4)).toFixed(2)
  1768. row.r3 = (parseFloat(row.w3) / parseFloat(row.feedweight) * 100).toFixed(2)
  1769. if (row.w3 <= 0) {
  1770. row.w3 = 0
  1771. row.r3 = 0
  1772. }
  1773. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4)).toFixed(2))
  1774. }
  1775. // 3班4班锁定1班未锁定
  1776. if (row.isOneWeight == false && row.isThreeWeight == true && row.isFourWeight == true) {
  1777. row.r2 = (parseFloat(row.w2) / parseFloat(row.feedweight) * 100).toFixed(2)
  1778. row.w1 = (parseFloat(row.feedweight) - parseFloat(row.w2) - parseFloat(row.w3) - parseFloat(row.w4)).toFixed(2)
  1779. row.r1 = (parseFloat(row.w3) / parseFloat(row.feedweight) * 100).toFixed(2)
  1780. if (row.w1 <= 0) {
  1781. row.w1 = 0
  1782. row.r1 = 0
  1783. }
  1784. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4)).toFixed(2))
  1785. }
  1786. // 1班锁定,3班4班未锁
  1787. if (row.isOneWeight == true && row.isThreeWeight == false && row.isFourWeight == false) {
  1788. row.r2 = (parseFloat(row.w2) / parseFloat(row.feedweight) * 100).toFixed(2)
  1789. row.w3 = ((parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w2)) * parseFloat(row.r3) / (parseFloat(this.focusWRow.r3) + parseFloat(this.focusWRow.r4))).toFixed(2)
  1790. row.r3 = (parseFloat(row.w3) / parseFloat(row.feedweight) * 100).toFixed(2)
  1791. row.w4 = ((parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w2)) * parseFloat(row.r4) / (parseFloat(this.focusWRow.r3) + parseFloat(row.r4))).toFixed(2)
  1792. row.r4 = (parseFloat(row.w4) / parseFloat(row.feedweight) * 100).toFixed(2)
  1793. if (row.w3 <= 0) {
  1794. row.w3 = 0
  1795. row.r3 = 0
  1796. }
  1797. if (row.w4 <= 0) {
  1798. row.w4 = 0
  1799. row.r4 = 0
  1800. }
  1801. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4)).toFixed(2))
  1802. }
  1803. // 3班锁定,1班4班未锁
  1804. if (row.isOneWeight == false && row.isThreeWeight == true && row.isFourWeight == false) {
  1805. row.r2 = (parseFloat(row.w2) / parseFloat(row.feedweight) * 100).toFixed(2)
  1806. row.w1 = ((parseFloat(row.feedweight) - parseFloat(row.w2) - parseFloat(row.w3)) * parseFloat(row.r1) / (parseFloat(this.focusWRow.r1) + parseFloat(this.focusWRow.r2))).toFixed(2)
  1807. row.r1 = (parseFloat(row.w1) / parseFloat(row.feedweight) * 100).toFixed(2)
  1808. row.w4 = ((parseFloat(row.feedweight) - parseFloat(row.w2) - parseFloat(row.w3)) * parseFloat(row.r4) / (parseFloat(this.focusWRow.r1) + parseFloat(row.r2))).toFixed(2)
  1809. row.r4 = (parseFloat(row.w4) / parseFloat(row.feedweight) * 100).toFixed(2)
  1810. if (row.w1 <= 0) {
  1811. row.w1 = 0
  1812. row.r1 = 0
  1813. }
  1814. if (row.w4 <= 0) {
  1815. row.w4 = 0
  1816. row.r4 = 0
  1817. }
  1818. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4)).toFixed(2))
  1819. }
  1820. // 4班锁定,1班3班未锁
  1821. if (row.isOneWeight == false && row.isThreeWeight == false && row.isFourWeight == true) {
  1822. row.r2 = (parseFloat(row.w2) / parseFloat(row.feedweight) * 100).toFixed(2)
  1823. row.w1 = ((parseFloat(row.feedweight) - parseFloat(row.w2) - parseFloat(row.w4)) * parseFloat(row.r1) / (parseFloat(this.focusWRow.r1) + parseFloat(this.focusWRow.r3))).toFixed(2)
  1824. row.r1 = (parseFloat(row.w2) / parseFloat(row.feedweight) * 100).toFixed(2)
  1825. row.w3 = ((parseFloat(row.feedweight) - parseFloat(row.w2) - parseFloat(row.w4)) * parseFloat(row.r3) / (parseFloat(this.focusWRow.r1) + parseFloat(row.r3))).toFixed(2)
  1826. row.r3 = (parseFloat(row.w3) / parseFloat(row.feedweight) * 100).toFixed(2)
  1827. if (row.w1 <= 0) {
  1828. row.w1 = 0
  1829. row.r1 = 0
  1830. }
  1831. if (row.w3 <= 0) {
  1832. row.w3 = 0
  1833. row.r3 = 0
  1834. }
  1835. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4)).toFixed(2))
  1836. }
  1837. // 1班3班4班未锁
  1838. if (row.isOneWeight == false && row.isThreeWeight == false && row.isFourWeight == false) {
  1839. row.r2 = (parseFloat(row.w2) / parseFloat(row.feedweight) * 100).toFixed(2)
  1840. 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)
  1841. row.r1 = (parseFloat(row.w1) / parseFloat(row.feedweight) * 100).toFixed(2)
  1842. 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)
  1843. row.r3 = (parseFloat(row.w3) / parseFloat(row.feedweight) * 100).toFixed(2)
  1844. 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)
  1845. row.r4 = (parseFloat(row.w4) / parseFloat(row.feedweight) * 100).toFixed(2)
  1846. if (row.w1 <= 0) {
  1847. row.w1 = 0
  1848. row.r1 = 0
  1849. }
  1850. if (row.w3 <= 0) {
  1851. row.w3 = 0
  1852. row.r3 = 0
  1853. }
  1854. if (row.w4 <= 0) {
  1855. row.w4 = 0
  1856. row.r4 = 0
  1857. }
  1858. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4)).toFixed(2))
  1859. }
  1860. } else if (this.table.RWLength == 3) {
  1861. // 三班
  1862. // 1班/3班锁定
  1863. if (row.isOneWeight == true && row.isThreeWeight == true) {
  1864. row.r2 = (parseFloat(row.w2) / parseFloat(row.feedweight) * 100).toFixed(2)
  1865. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3)).toFixed(2))
  1866. }
  1867. // 1班不锁3班锁
  1868. if (row.isOneWeight == false && row.isThreeWeight == true) {
  1869. row.r2 = (parseFloat(row.w2) / parseFloat(row.feedweight) * 100).toFixed(2)
  1870. row.w1 = (parseFloat(row.feedweight) - parseFloat(row.w2) - parseFloat(row.w3)).toFixed(2)
  1871. row.r1 = (parseFloat(row.w1) / parseFloat(row.feedweight) * 100).toFixed(2)
  1872. if (row.w1 <= 0) {
  1873. row.w1 = 0
  1874. row.r1 = 0
  1875. }
  1876. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3)).toFixed(2))
  1877. }
  1878. // 3班不锁1班锁
  1879. if (row.isOneWeight == true && row.isThreeWeight == false) {
  1880. row.r2 = (parseFloat(row.w2) / parseFloat(row.feedweight) * 100).toFixed(2)
  1881. row.w3 = (parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w2)).toFixed(2)
  1882. row.r3 = (parseFloat(row.w3) / parseFloat(row.feedweight) * 100).toFixed(2)
  1883. if (row.w3 <= 0) {
  1884. row.w3 = 0
  1885. row.r3 = 0
  1886. }
  1887. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3)).toFixed(2))
  1888. }
  1889. // 1班3班都不锁
  1890. if (row.isOneWeight == false && row.isThreeWeight == false) {
  1891. row.r2 = (parseFloat(row.w2) / parseFloat(row.feedweight) * 100).toFixed(2)
  1892. row.w1 = ((parseFloat(row.feedweight) - parseFloat(row.w2)) * parseFloat(row.r1) / (parseFloat(row.r1) + parseFloat(row.r3))).toFixed(2)
  1893. row.r1 = (parseFloat(row.w1) / parseFloat(row.feedweight) * 100).toFixed(2)
  1894. row.w3 = ((parseFloat(row.feedweight) - parseFloat(row.w2)) * parseFloat(row.r3) / (parseFloat(this.focusWRow2.r1) + parseFloat(row.r3))).toFixed(2)
  1895. row.r3 = (parseFloat(row.w3) / parseFloat(row.feedweight) * 100).toFixed(2)
  1896. if (row.w3 <= 0) {
  1897. row.w3 = 0
  1898. row.r3 = 0
  1899. }
  1900. if (row.w1 <= 0) {
  1901. row.w1 = 0
  1902. row.r1 = 0
  1903. }
  1904. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3)).toFixed(2))
  1905. }
  1906. } else if (this.table.RWLength == 2) {
  1907. // 两班
  1908. if (row.isTwoWeight == false) {
  1909. row.r2 = (parseFloat(row.w2) / parseFloat(row.feedweight) * 100).toFixed(2)
  1910. row.w1 = (parseFloat(row.feedweight) - parseFloat(row.w2))
  1911. row.r1 = (parseFloat(row.w1) / parseFloat(row.feedweight) * 100).toFixed(2)
  1912. if (row.w1 <= 0) { row.w1 = 0; row.r1 = 0 }
  1913. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2)).toFixed(2))
  1914. } else {
  1915. row.r2 = parseFloat(row.w2) / parseFloat(row.feedweight) * 100
  1916. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2)).toFixed(2))
  1917. }
  1918. }
  1919. },
  1920. blurW3(row) {
  1921. // 3班重量
  1922. if (row.w1 == '') {
  1923. row.w1 = 0
  1924. }
  1925. if (row.w2 == '') {
  1926. row.w2 = 0
  1927. }
  1928. if (row.w3 == '') {
  1929. row.w3 = 0
  1930. }
  1931. if (row.w4 == '') {
  1932. row.w4 = 0
  1933. }
  1934. if (row.r1 == '') {
  1935. row.r1 = 0
  1936. }
  1937. if (row.r2 == '') {
  1938. row.r2 = 0
  1939. }
  1940. if (row.r3 == '') {
  1941. row.r3 = 0
  1942. }
  1943. if (row.r4 == '') {
  1944. row.r4 = 0
  1945. }
  1946. // row.ftweight = parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4)
  1947. console.log(row, '=======投喂量feedweight')
  1948. // isOneWeight,isTwoWeight,isThreeWeight,isFourWeight
  1949. if (this.table.RWLength == 4) {
  1950. // 四班
  1951. // 1班2班4班都锁定
  1952. if (row.isOneWeight == true && row.isTwoWeight == true && row.isFourWeight == true) {
  1953. row.r3 = (parseFloat(row.w3) / parseFloat(row.feedweight) * 100).toFixed(2)
  1954. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4)).toFixed(2))
  1955. }
  1956. // 1班2班锁定4班未锁定
  1957. if (row.isOneWeight == true && row.isTwoWeight == true && row.isFourWeight == false) {
  1958. row.r3 = (parseFloat(row.w3) / parseFloat(row.feedweight) * 100).toFixed(2)
  1959. row.w4 = (parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w2) - parseFloat(row.w3)).toFixed(2)
  1960. row.r4 = (parseFloat(row.w4) / parseFloat(row.feedweight) * 100).toFixed(2)
  1961. if (row.w4 <= 0) {
  1962. row.w4 = 0
  1963. row.r4 = 0
  1964. }
  1965. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4)).toFixed(2))
  1966. }
  1967. // 2班4班锁定1班未锁定
  1968. if (row.isOneWeight == false && row.isTwoWeight == true && row.isFourWeight == true) {
  1969. row.r3 = (parseFloat(row.w3) / parseFloat(row.feedweight) * 100).toFixed(2)
  1970. row.w1 = (parseFloat(row.feedweight) - parseFloat(row.w2) - parseFloat(row.w3) - parseFloat(row.w4)).toFixed(2)
  1971. row.r1 = (parseFloat(row.w1) / parseFloat(row.feedweight) * 100).toFixed(2)
  1972. if (row.w1 <= 0) {
  1973. row.w1 = 0
  1974. row.r1 = 0
  1975. }
  1976. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4)).toFixed(2))
  1977. }
  1978. // 1班4班锁定2班未锁定
  1979. if (row.isTwoWeight == false && row.isOneWeight == true && row.isFourWeight == true) {
  1980. row.r3 = (parseFloat(row.w3) / parseFloat(row.feedweight) * 100)
  1981. row.w2 = (parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w3) - parseFloat(row.w4)).toFixed(2)
  1982. row.r2 = (parseFloat(row.w3) / parseFloat(row.feedweight) * 100).toFixed(2)
  1983. if (row.w2 <= 0) {
  1984. row.w2 = 0
  1985. row.r2 = 0
  1986. }
  1987. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4)).toFixed(2))
  1988. }
  1989. // 2班锁定,1班4班未锁
  1990. if (row.isTwoWeight == true && row.isOneWeight == false && row.isFourWeight == false) {
  1991. row.r3 = (parseFloat(row.w3) / parseFloat(row.feedweight) * 100).toFixed(2)
  1992. row.w1 = ((parseFloat(row.feedweight) - parseFloat(row.w2) - parseFloat(row.w3)) * parseFloat(row.r1) / (parseFloat(this.focusWRow.r1) + parseFloat(this.focusWRow.r4))).toFixed(2)
  1993. row.r1 = (parseFloat(row.w1) / parseFloat(row.feedweight) * 100).toFixed(2)
  1994. row.w4 = ((parseFloat(row.feedweight) - parseFloat(row.w2) - parseFloat(row.w3)) * parseFloat(row.r4) / (parseFloat(this.focusWRow.r1) + parseFloat(row.r4))).toFixed(2)
  1995. row.r4 = (parseFloat(row.w4) / parseFloat(row.feedweight) * 100).toFixed(2)
  1996. if (row.w1 <= 0) {
  1997. row.w1 = 0
  1998. row.r1 = 0
  1999. }
  2000. if (row.w4 <= 0) {
  2001. row.w4 = 0
  2002. row.r4 = 0
  2003. }
  2004. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4)).toFixed(2))
  2005. }
  2006. // 1班锁定,2班4班未锁
  2007. if (row.isTwoWeight == false && row.isOneWeight == true && row.isFourWeight == false) {
  2008. row.r1 = (parseFloat(row.w1) / parseFloat(row.feedweight) * 100).toFixed(2)
  2009. row.w2 = ((parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w3)) * parseFloat(row.r2) / (parseFloat(this.focusWRow.r2) + parseFloat(this.focusWRow.r4))).toFixed(2)
  2010. row.r2 = (parseFloat(row.w2) / parseFloat(row.feedweight) * 100).toFixed(2)
  2011. row.w4 = ((parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w3)) * parseFloat(row.r4) / (parseFloat(this.focusWRow.r2) + parseFloat(row.r4))).toFixed(2)
  2012. row.r4 = (parseFloat(row.w4) / parseFloat(row.feedweight) * 100).toFixed(2)
  2013. if (row.w2 <= 0) {
  2014. row.w2 = 0
  2015. row.r2 = 0
  2016. }
  2017. if (row.w4 <= 0) {
  2018. row.w4 = 0
  2019. row.r4 = 0
  2020. }
  2021. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4)).toFixed(2))
  2022. }
  2023. // 4班锁定,2班1班未锁
  2024. if (row.isTwoWeight == false && row.isOneWeight == false && row.isFourWeight == true) {
  2025. row.r3 = (parseFloat(row.w3) / parseFloat(row.feedweight) * 100)
  2026. row.w2 = ((parseFloat(row.feedweight) - parseFloat(row.w3) - parseFloat(row.w4)) * parseFloat(row.r1) / (parseFloat(this.focusWRow.r1) + parseFloat(this.focusWRow.r2))).toFixed(2)
  2027. row.r2 = (parseFloat(row.w2) / parseFloat(row.feedweight) * 100).toFixed(2)
  2028. row.w1 = ((parseFloat(row.feedweight) - parseFloat(row.w3) - parseFloat(row.w4)) * parseFloat(row.r2) / (parseFloat(this.focusWRow.r1) + parseFloat(row.r2))).toFixed(2)
  2029. row.r1 = (parseFloat(row.w1) / parseFloat(row.feedweight) * 100).toFixed(2)
  2030. if (row.w2 <= 0) {
  2031. row.w2 = 0
  2032. row.r2 = 0
  2033. }
  2034. if (row.w1 <= 0) {
  2035. row.w1 = 0
  2036. row.r1 = 0
  2037. }
  2038. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4)).toFixed(2))
  2039. }
  2040. // 2班1班4班未锁
  2041. if (row.isTwoWeight == false && row.isOneWeight == false && row.isFourWeight == false) {
  2042. row.r3 = (parseFloat(row.w3) / parseFloat(row.feedweight) * 100).toFixed(2)
  2043. 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)
  2044. row.r1 = (parseFloat(row.w1) / parseFloat(row.feedweight) * 100).toFixed(2)
  2045. 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)
  2046. row.r2 = (parseFloat(row.w2) / parseFloat(row.feedweight) * 100).toFixed(2)
  2047. 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)
  2048. row.r4 = (parseFloat(row.w4) / parseFloat(row.feedweight) * 100).toFixed(2)
  2049. if (row.w1 <= 0) {
  2050. row.w1 = 0
  2051. row.r1 = 0
  2052. }
  2053. if (row.w2 <= 0) {
  2054. row.w2 = 0
  2055. row.r2 = 0
  2056. }
  2057. if (row.w4 <= 0) {
  2058. row.w4 = 0
  2059. row.r4 = 0
  2060. }
  2061. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4)).toFixed(2))
  2062. }
  2063. } else if (this.table.RWLength == 3) {
  2064. // 三班
  2065. // 1班/2班锁定
  2066. if (row.isOneWeight == true && row.isTwoWeight == true) {
  2067. row.r3 = (parseFloat(row.w3) / parseFloat(row.feedweight) * 100).toFixed(2)
  2068. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3)).toFixed(2))
  2069. }
  2070. // 1班不锁2班锁
  2071. if (row.isOneWeight == false && row.isTwoWeight == true) {
  2072. row.r3 = (parseFloat(row.w3) / parseFloat(row.feedweight) * 100).toFixed(2)
  2073. row.w1 = (parseFloat(row.feedweight) - parseFloat(row.w2) - parseFloat(row.w3)).toFixed(2)
  2074. row.r1 = (parseFloat(row.w1) / parseFloat(row.feedweight) * 100).toFixed(2)
  2075. if (row.w1 <= 0) {
  2076. row.w1 = 0
  2077. row.r1 = 0
  2078. }
  2079. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3)).toFixed(2))
  2080. }
  2081. // 3班不锁2班锁
  2082. // 2班不锁1班锁
  2083. if (row.isOneWeight == true && row.isTwoWeight == false) {
  2084. row.r3 = (parseFloat(row.w3) / parseFloat(row.feedweight) * 100).toFixed(2)
  2085. row.w2 = (parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w3)).toFixed(2)
  2086. row.r2 = (parseFloat(row.w2) / parseFloat(row.feedweight) * 100).toFixed(2)
  2087. if (row.w2 <= 0) {
  2088. row.w2 = 0
  2089. row.r2 = 0
  2090. }
  2091. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3)).toFixed(2))
  2092. }
  2093. // 2班3班都不锁
  2094. // 1班2班都不锁
  2095. if (row.isOneWeight == false && row.isTwoWeight == false) {
  2096. row.r3 = (parseFloat(row.w3) / parseFloat(row.feedweight) * 100).toFixed(2)
  2097. row.w1 = ((parseFloat(row.feedweight) - parseFloat(row.w3)) * parseFloat(row.r1) / (parseFloat(row.r1) + parseFloat(row.r2))).toFixed(2)
  2098. row.r1 = (parseFloat(row.w1) / parseFloat(row.feedweight) * 100).toFixed(2)
  2099. row.w2 = ((parseFloat(row.feedweight) - parseFloat(row.w3)) * parseFloat(row.r2) / (parseFloat(this.focusWRow3.r1) + parseFloat(row.r2))).toFixed(2)
  2100. row.r2 = (parseFloat(row.w2) / parseFloat(row.feedweight) * 100).toFixed(2)
  2101. if (row.w1 <= 0) {
  2102. row.w1 = 0
  2103. row.r1 = 0
  2104. }
  2105. if (row.w2 <= 0) {
  2106. row.w2 = 0
  2107. row.r2 = 0
  2108. }
  2109. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3)).toFixed(2))
  2110. }
  2111. }
  2112. },
  2113. blurW4(row) {
  2114. if (row.w1 == '') {
  2115. row.w1 = 0
  2116. }
  2117. if (row.w2 == '') {
  2118. row.w2 = 0
  2119. }
  2120. if (row.w3 == '') {
  2121. row.w3 = 0
  2122. }
  2123. if (row.w4 == '') {
  2124. row.w4 = 0
  2125. }
  2126. if (row.r1 == '') {
  2127. row.r1 = 0
  2128. }
  2129. if (row.r2 == '') {
  2130. row.r2 = 0
  2131. }
  2132. if (row.r3 == '') {
  2133. row.r3 = 0
  2134. }
  2135. if (row.r4 == '') {
  2136. row.r4 = 0
  2137. }
  2138. // row.ftweight = parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4)
  2139. console.log(row, '=======投喂量feedweight')
  2140. // isOneWeight,isTwoWeight,isThreeWeight,isFourWeight
  2141. if (this.table.RWLength == 4) {
  2142. // 四班
  2143. // 1班2班3班都锁定
  2144. if (row.isOneWeight == true && row.isTwoWeight == true && row.isThreeWeight == true) {
  2145. row.r4 = (parseFloat(row.w4) / parseFloat(row.feedweight) * 100).toFixed(2)
  2146. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4)).toFixed(2))
  2147. }
  2148. // 2班3班锁定1班未锁定
  2149. if (row.isOneWeight == false && row.isTwoWeight == true && row.isThreeWeight == true) {
  2150. row.r4 = (parseFloat(row.w4) / parseFloat(row.feedweight) * 100).toFixed(2)
  2151. row.w1 = (parseFloat(row.feedweight) - parseFloat(row.w4) - parseFloat(row.w2) - parseFloat(row.w3)).toFixed(2)
  2152. row.r1 = (parseFloat(row.w1) / parseFloat(row.feedweight) * 100).toFixed(2)
  2153. if (row.w1 <= 0) {
  2154. row.w1 = 0
  2155. row.r1 = 0
  2156. }
  2157. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4)).toFixed(2))
  2158. }
  2159. // 2班1班锁定3班未锁定
  2160. if (row.isOneWeight == true && row.isTwoWeight == true && row.isThreeWeight == false) {
  2161. row.r4 = (parseFloat(row.w4) / parseFloat(row.feedweight) * 100).toFixed(2)
  2162. row.w3 = (parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w2) - parseFloat(row.w4)).toFixed(2)
  2163. row.r3 = (parseFloat(row.w3) / parseFloat(row.feedweight) * 100).toFixed(2)
  2164. if (row.w3 <= 0) {
  2165. row.w3 = 0
  2166. row.r3 = 0
  2167. }
  2168. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4)).toFixed(2))
  2169. }
  2170. // 3班1班锁定2班未锁定
  2171. if (row.isOneWeight == true && row.isTwoWeight == false && row.isThreeWeight == true) {
  2172. row.r4 = (parseFloat(row.w4) / parseFloat(row.feedweight) * 100).toFixed(2)
  2173. row.w2 = (parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w3) - parseFloat(row.w4)).toFixed(2)
  2174. row.r2 = (parseFloat(row.w3) / parseFloat(row.feedweight) * 100).toFixed(2)
  2175. if (row.w2 <= 0) {
  2176. row.w2 = 0
  2177. row.r2 = 0
  2178. }
  2179. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4)).toFixed(2))
  2180. }
  2181. // 2班锁定,3班1班未锁
  2182. if (row.isOneWeight == false && row.isTwoWeight == true && row.isThreeWeight == false) {
  2183. row.r4 = (parseFloat(row.w4) / parseFloat(row.feedweight) * 100).toFixed(2)
  2184. row.w3 = ((parseFloat(row.feedweight) - parseFloat(row.w4) - parseFloat(row.w2)) * parseFloat(row.r3) / (parseFloat(this.focusWRow.r3) + parseFloat(this.focusWRow.r1))).toFixed(2)
  2185. row.r3 = (parseFloat(row.w3) / parseFloat(row.feedweight) * 100).toFixed(2)
  2186. row.w1 = ((parseFloat(row.feedweight) - parseFloat(row.w4) - parseFloat(row.w2)) * parseFloat(row.r1) / (parseFloat(this.focusWRow.r3) + parseFloat(row.r1))).toFixed(2)
  2187. row.r1 = (parseFloat(row.w1) / parseFloat(row.feedweight) * 100).toFixed(2)
  2188. if (row.w3 <= 0) {
  2189. row.w3 = 0
  2190. row.r3 = 0
  2191. }
  2192. if (row.w1 <= 0) {
  2193. row.w1 = 0
  2194. row.r1 = 0
  2195. }
  2196. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4)).toFixed(2))
  2197. }
  2198. // 3班锁定,2班1班未锁
  2199. if (row.isOneWeight == false && row.isTwoWeight == false && row.isThreeWeight == true) {
  2200. row.r1 = (parseFloat(row.w1) / parseFloat(row.feedweight) * 100).toFixed(2)
  2201. row.w2 = ((parseFloat(row.feedweight) - parseFloat(row.w4) - parseFloat(row.w3)) * parseFloat(row.r2) / (parseFloat(this.focusWRow.r2) + parseFloat(this.focusWRow.r1))).toFixed(2)
  2202. row.r2 = (parseFloat(row.w2) / parseFloat(row.feedweight) * 100).toFixed(2)
  2203. row.w1 = ((parseFloat(row.feedweight) - parseFloat(row.w4) - parseFloat(row.w3)) * parseFloat(row.r1) / (parseFloat(this.focusWRow.r2) + parseFloat(row.r1))).toFixed(2)
  2204. row.r1 = (parseFloat(row.w1) / parseFloat(row.feedweight) * 100).toFixed(2)
  2205. if (row.w2 <= 0) {
  2206. row.w2 = 0
  2207. row.r2 = 0
  2208. }
  2209. if (row.w1 <= 0) {
  2210. row.w1 = 0
  2211. row.r1 = 0
  2212. }
  2213. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4)).toFixed(2))
  2214. }
  2215. // 1班锁定,2班3班未锁
  2216. if (row.isOneWeight == true && row.isTwoWeight == false && row.isThreeWeight == false) {
  2217. row.r4 = (parseFloat(row.w4) / parseFloat(row.feedweight) * 100).toFixed(2)
  2218. row.w2 = ((parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w4)) * parseFloat(row.r2) / (parseFloat(this.focusWRow.r2) + parseFloat(this.focusWRow.r3))).toFixed(2)
  2219. row.r2 = (parseFloat(row.w2) / parseFloat(row.feedweight) * 100).toFixed(2)
  2220. row.w3 = ((parseFloat(row.feedweight) - parseFloat(row.w1) - parseFloat(row.w4)) * parseFloat(row.r3) / (parseFloat(this.focusWRow.r2) + parseFloat(row.r3))).toFixed(2)
  2221. row.r3 = (parseFloat(row.w3) / parseFloat(row.feedweight) * 100).toFixed(2)
  2222. if (row.w2 <= 0) {
  2223. row.w2 = 0
  2224. row.r2 = 0
  2225. }
  2226. if (row.w3 <= 0) {
  2227. row.w3 = 0
  2228. row.r3 = 0
  2229. }
  2230. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4)).toFixed(2))
  2231. }
  2232. // 2班3班1班未锁
  2233. if (row.isOneWeight == false && row.isTwoWeight == false && row.isThreeWeight == false) {
  2234. row.r4 = (parseFloat(row.w4) / parseFloat(row.feedweight) * 100).toFixed(2)
  2235. 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)
  2236. row.r1 = (parseFloat(row.w1) / parseFloat(row.feedweight) * 100).toFixed(2)
  2237. 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)
  2238. row.r2 = (parseFloat(row.w2) / parseFloat(row.feedweight) * 100).toFixed(2)
  2239. 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)
  2240. row.r3 = (parseFloat(row.w3) / parseFloat(row.feedweight) * 100).toFixed(2)
  2241. if (row.w1 <= 0) {
  2242. row.w1 = 0
  2243. row.r1 = 0
  2244. }
  2245. if (row.w2 <= 0) {
  2246. row.w2 = 0
  2247. row.r2 = 0
  2248. }
  2249. if (row.w3 <= 0) {
  2250. row.w3 = 0
  2251. row.r3 = 0
  2252. }
  2253. this.$set(row, 'sumr', (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4)).toFixed(2))
  2254. }
  2255. }
  2256. },
  2257. // 编辑
  2258. handleUpdate(row) {
  2259. console.log(row.supplyweight)
  2260. for (let i = 0; i < this.table.list.length; i++) {
  2261. if (this.table.list[i].Edit == true) {
  2262. this.$message({
  2263. type: 'error',
  2264. message: '当前内容未保存,请点击取消或保存继续进行操作',
  2265. duration: 2000
  2266. })
  2267. return false
  2268. }
  2269. }
  2270. // 编辑true,不可编辑false
  2271. row.Edit = true
  2272. row.NoEdit = false
  2273. // 编辑false,编辑保存true
  2274. row.isUpdate = false
  2275. row.isUpdateSave = true
  2276. row.ftid = String(row.ftid)
  2277. row.ptsfid = String(row.ptsfid)
  2278. this.table.temp.ftid = row.ftid
  2279. this.table.temp.ftname = row.ftname
  2280. this.table.temp.ptsfid = row.ptsfid
  2281. this.table.temp.ptsfname = row.ptsfname
  2282. },
  2283. updateData(row) {
  2284. console.log(row)
  2285. if (row.r1 == 'NaN') { this.$set(row, 'r1', 0) }
  2286. if (row.r2 == 'NaN') { this.$set(row, 'r2', 0) }
  2287. if (row.r3 == 'NaN') { this.$set(row, 'r3', 0) }
  2288. if (row.r4 == 'NaN') { this.$set(row, 'r4', 0) }
  2289. if (row.w1 == 'NaN') { this.$set(row, 'w1', 0) }
  2290. if (row.w2 == 'NaN') { this.$set(row, 'w2', 0) }
  2291. if (row.w3 == 'NaN') { this.$set(row, 'w3', 0) }
  2292. if (row.w4 == 'NaN') { this.$set(row, 'w4', 0) }
  2293. console.log(row)
  2294. var arr = []
  2295. for (let i = 1; i <= this.table.RWLength; i++) {
  2296. var obj = {}
  2297. obj['times'] = i
  2298. obj['pastureid'] = row.pastureid
  2299. obj['barid'] = row.barid
  2300. obj['cowcount'] = row.ccount
  2301. obj['ccountradio'] = row.ccountradio
  2302. obj['ptid'] = row.ftid
  2303. if (row.ptsfid !== '') {
  2304. obj['ptsid'] = row.ptsfid
  2305. } else {
  2306. obj['ptsid'] = '-1'
  2307. }
  2308. obj['weight'] = row['w' + i]
  2309. obj['tratio'] = row['r' + i]
  2310. arr.push(obj)
  2311. }
  2312. if (row.ptsfid == '') {
  2313. row.ptsfid = '-1'
  2314. }
  2315. if (row.supplyweight == '') {
  2316. row.supplyweight = '0'
  2317. }
  2318. if (this.table.isPtsfname == false) {
  2319. row.supplyweight = '0'
  2320. }
  2321. this.table.rwList = arr
  2322. console.log('点击了编辑保存', row)
  2323. this.table.temp.pastureid = row.pastureid
  2324. this.table.temp.id = row.id
  2325. this.table.temp.barname = row.barname
  2326. this.table.temp.barid = row.barid
  2327. this.table.temp.ccount = row.ccount
  2328. this.table.temp.ratio = row.ratio
  2329. this.table.temp.ccountratio = row.ccountratio
  2330. this.table.temp.ftid = row.ftid
  2331. this.table.temp.ftname = row.ftname
  2332. this.table.temp.ptsfid = row.ptsfid
  2333. this.table.temp.ptsfname = row.ptsfname
  2334. this.table.temp.ftweight = row.ftweight
  2335. this.table.temp.supplyweight = row.supplyweight
  2336. this.table.temp.feedweight = row.feedweight
  2337. this.table.temp.owner = row.owner
  2338. this.table.temp.sumr = row.sumr
  2339. if (row.softccount == '') {
  2340. row.softccount = 0
  2341. }
  2342. if (row.r1 == '') {
  2343. row.r1 = 0
  2344. }
  2345. if (row.r2 == '') {
  2346. row.r2 = 0
  2347. }
  2348. if (row.r3 == '') {
  2349. row.r3 = 0
  2350. }
  2351. if (row.r4 == '') {
  2352. row.r4 = 0
  2353. }
  2354. if (row.w1 == '') {
  2355. row.w1 = 0
  2356. }
  2357. if (row.w2 == '' || row.w4 == NaN) {
  2358. row.w2 = 0
  2359. }
  2360. if (row.w3 == '' || row.w4 == NaN) {
  2361. row.w3 = 0
  2362. }
  2363. if (row.w4 == '' || row.w4 == NaN) {
  2364. row.w4 = 0
  2365. }
  2366. console.log(row, '===========')
  2367. this.table.temp.softccount = row.softccount
  2368. this.table.temp.r1 = row.r1
  2369. this.table.temp.r2 = row.r2
  2370. this.table.temp.r3 = row.r3
  2371. this.table.temp.r4 = row.r4
  2372. this.table.temp.w1 = row.w1
  2373. this.table.temp.w2 = row.w2
  2374. this.table.temp.w3 = row.w3
  2375. this.table.temp.w4 = row.w4
  2376. if (this.table.temp.ccount == '' && this.table.temp.ratio == '' && this.table.temp.ccountratio == '' && this.table.temp.ftid == '') {
  2377. this.$message({
  2378. type: 'error',
  2379. message: '实际牛头数/系数/系数头数/配方模版不能为空',
  2380. duration: 2000
  2381. })
  2382. return false
  2383. }
  2384. if (this.table.temp.ratio == '' && this.table.temp.ccountratio == '' && this.table.temp.ftid == '') {
  2385. this.$message({
  2386. type: 'error',
  2387. message: '系数/系数头数/配方模版不能为空',
  2388. duration: 2000
  2389. })
  2390. return false
  2391. }
  2392. if (this.table.temp.ccountratio == '' && this.table.temp.ftid == '') {
  2393. this.$message({
  2394. type: 'error',
  2395. message: '系数头数/配方模版不能为空',
  2396. duration: 2000
  2397. })
  2398. return false
  2399. }
  2400. if (this.table.temp.ccount == '') {
  2401. this.$message({
  2402. type: 'error',
  2403. message: '实际牛头数不能为空',
  2404. duration: 2000
  2405. })
  2406. return false
  2407. }
  2408. if (this.table.temp.ratio == '') {
  2409. this.$message({
  2410. type: 'error',
  2411. message: '系数不能为空',
  2412. duration: 2000
  2413. })
  2414. return false
  2415. }
  2416. if (this.table.temp.ccountratio == '') {
  2417. this.$message({
  2418. type: 'error',
  2419. message: '系数头数不能为空',
  2420. duration: 2000
  2421. })
  2422. return false
  2423. }
  2424. if (this.table.temp.ftid == '') {
  2425. this.$message({
  2426. type: 'error',
  2427. message: '配方模版不能为空',
  2428. duration: 2000
  2429. })
  2430. return false
  2431. }
  2432. const positiveInteger = /^[1-9]\d*$/
  2433. if (!positiveInteger.test(parseFloat(this.table.temp.ccount))) {
  2434. this.$message({
  2435. type: 'error',
  2436. message: '实际牛头数请输入正整数',
  2437. duration: 2000
  2438. })
  2439. return false
  2440. }
  2441. if (!positiveInteger.test(parseFloat(this.table.temp.ratio))) {
  2442. this.$message({
  2443. type: 'error',
  2444. message: '系数请输入正整数',
  2445. duration: 2000
  2446. })
  2447. return false
  2448. }
  2449. if (!positiveInteger.test(parseFloat(this.table.temp.ratio))) {
  2450. this.$message({
  2451. type: 'error',
  2452. message: '系数头数请输入正整数',
  2453. duration: 2000
  2454. })
  2455. return false
  2456. }
  2457. this.isokDisable = true
  2458. setTimeout(() => {
  2459. this.isokDisable = false
  2460. }, 1000)
  2461. // this.requestParam.parammaps = this.table.temp
  2462. this.requestParam.common = {
  2463. 'returnmap': '0'
  2464. }
  2465. this.requestParam.data = []
  2466. this.requestParam.data[0] = { 'name': 'updateBigFP', 'type': 'e', 'parammaps': {
  2467. pastureid: row.pastureid,
  2468. id: row.id,
  2469. barname: row.barname,
  2470. barid: row.barid,
  2471. softccount: row.softccount,
  2472. ccount: row.ccount,
  2473. ratio: row.ratio,
  2474. ccountratio: row.ccountratio,
  2475. ftid: row.ftid,
  2476. ftname: row.ftname,
  2477. ptsfid: row.ptsfid,
  2478. ptsfname: row.ptsfname,
  2479. ftweight: row.ftweight,
  2480. supplyweight: row.supplyweight,
  2481. feedweight: row.feedweight,
  2482. owner: row.owner,
  2483. sumr: row.sumr
  2484. }}
  2485. this.requestParam.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.table.rwList }}
  2486. this.requestParam.data[1].children = []
  2487. this.requestParam.data[1].children[0] = { 'name': 'updateBigFPDetail', 'type': 'e', 'parammaps': {
  2488. pastureid: '@insertSpotList.pastureid',
  2489. barname: row.barname,
  2490. barid: '@insertSpotList.barid',
  2491. times: '@insertSpotList.times',
  2492. tratio: '@insertSpotList.tratio',
  2493. weight: '@insertSpotList.weight',
  2494. cowcount: '@insertSpotList.cowcount',
  2495. ccountradio: row.ccountratio,
  2496. ptid: '@insertSpotList.ptid',
  2497. ptsid: '@insertSpotList.ptsid',
  2498. feedweight: row.feedweight,
  2499. supplyweight: row.supplyweight,
  2500. ratio: row.ratio
  2501. }}
  2502. this.requestParam.data[2] = { 'name': 'updateLPPbyFPChange', 'type': 'e', 'parammaps': {
  2503. pastureid: row.pastureid,
  2504. fpid: row.id
  2505. }}
  2506. ExecDataByConfig(this.requestParam).then(response => {
  2507. console.log('编辑保存发送参数', this.requestParam)
  2508. if (response.msg === 'fail') {
  2509. this.$notify({
  2510. title: '保存失败',
  2511. message: response.data,
  2512. type: 'warning',
  2513. duration: 2000
  2514. })
  2515. } else {
  2516. this.$notify({
  2517. title: '成功',
  2518. message: '保存成功',
  2519. type: 'success',
  2520. duration: 2000
  2521. })
  2522. this.getList()
  2523. }
  2524. })
  2525. },
  2526. updateCancel(row) {
  2527. console.log('点击了编辑取消')
  2528. // 编辑false,不可编辑true
  2529. row.Edit = false
  2530. row.NoEdit = true
  2531. // 编辑true,编辑保存false
  2532. row.isUpdate = true
  2533. row.isUpdateSave = false
  2534. this.getList()
  2535. },
  2536. handleSelect(val) {
  2537. console.log('勾选数据', val)
  2538. this.selectList = val
  2539. },
  2540. // 营养评估
  2541. handleNutritional() {
  2542. console.log('点击了营养评估')
  2543. if (this.selectList.length !== 1) {
  2544. this.$message({
  2545. type: 'error',
  2546. message: '请选择一条栏舍信息进行营养评估',
  2547. duration: 2000
  2548. })
  2549. return false
  2550. } else {
  2551. this.temp = this.selectList
  2552. this.nutritional.dialogStatus = 'Nutritional'
  2553. this.nutritional.dialogFormVisible = true
  2554. this.getList2()
  2555. }
  2556. },
  2557. assessmentData() {
  2558. console.log('评估保存')
  2559. this.getList2()
  2560. },
  2561. getList2() {
  2562. this.nutritional.listLoading = true
  2563. GetDataByName(this.nutritional.getdataListParm).then(response => {
  2564. console.log('table数据', response.data.list)
  2565. if (response.data.list !== null) {
  2566. this.nutritional.list = response.data.list
  2567. this.nutritional.pageNum = response.data.pageNum
  2568. this.nutritional.pageSize = response.data.pageSize
  2569. this.nutritional.total = response.data.total
  2570. } else {
  2571. this.nutritional.list = []
  2572. }
  2573. setTimeout(() => {
  2574. this.nutritional.listLoading = false
  2575. }, 100)
  2576. })
  2577. },
  2578. // 历史记录
  2579. handleHistoryRecords() {
  2580. console.log('点击了历史记录')
  2581. this.history.dialogStatus = 'history'
  2582. this.history.dialogFormVisible = true
  2583. this.getDateList()
  2584. },
  2585. // 历史时间
  2586. getDateList() {
  2587. GetDataByName(this.history.getdataDateParm).then(response => {
  2588. console.log('table数据', response.data.list)
  2589. if (response.data.list !== null) {
  2590. this.history.getdataListParm.parammaps.date = response.data.list[0].maxdate
  2591. this.getHistoryIsDisplay()
  2592. } else {
  2593. this.history.getdataListParm.parammaps.date = ''
  2594. }
  2595. })
  2596. },
  2597. getHistoryIsDisplay() {
  2598. GetDataByName(this.table.getdataListParm2).then(response => {
  2599. console.log(response.data.list[0].inforvalue)
  2600. if (response.data.list !== null) {
  2601. if (response.data.list[0].inforvalue == 0) {
  2602. this.table.isPtsfname = false
  2603. } else {
  2604. this.table.isPtsfname = true
  2605. }
  2606. }
  2607. })
  2608. GetDataByName(this.table.getdataListParm3).then(response => {
  2609. if (response.data.list !== null) {
  2610. if (response.data.list[0].inforvalue == 1) {
  2611. this.history.isRW1 = true
  2612. this.history.isRW2 = false
  2613. this.history.isRW3 = false
  2614. this.history.isRW4 = false
  2615. } else if (response.data.list[0].inforvalue == 2) {
  2616. this.history.isRW1 = true
  2617. this.history.isRW2 = true
  2618. this.history.isRW3 = false
  2619. this.history.isRW4 = false
  2620. } else if (response.data.list[0].inforvalue == 3) {
  2621. this.history.isRW1 = true
  2622. this.history.isRW2 = true
  2623. this.history.isRW3 = true
  2624. this.history.isRW4 = false
  2625. } else if (response.data.list[0].inforvalue == 4) {
  2626. this.history.isRW1 = true
  2627. this.history.isRW2 = true
  2628. this.history.isRW3 = true
  2629. this.history.isRW4 = true
  2630. }
  2631. } else {
  2632. this.history.isRW1 = false
  2633. this.history.isRW2 = false
  2634. this.history.isRW3 = false
  2635. this.history.isRW4 = false
  2636. }
  2637. })
  2638. this.getHistoryList()
  2639. },
  2640. getHistoryList() {
  2641. this.history.listLoading = true
  2642. GetDataByName(this.history.getdataListParm).then(response => {
  2643. console.log('table数据', response.data.list)
  2644. if (response.data.list !== null) {
  2645. for (let i = 0; i < response.data.list.length; i++) {
  2646. this.$set(response.data.list[i], 'Edit', false) // 编辑
  2647. this.$set(response.data.list[i], 'NoEdit', true) // 不可编辑/输入
  2648. this.$set(response.data.list[i], 'isUpdate', true) // 编辑操作
  2649. this.$set(response.data.list[i], 'isUpdateSave', false) // 编辑保存
  2650. if (response.data.list[i].ftid == undefined || response.data.list[i].ftname == '') {
  2651. this.$set(response.data.list[i], 'ftid', '')
  2652. this.$set(response.data.list[i], 'ftname', '')
  2653. }
  2654. if (response.data.list[i].ptsfid == undefined || response.data.list[i].ptsfname == '') {
  2655. this.$set(response.data.list[i], 'ptsfid', '')
  2656. this.$set(response.data.list[i], 'ptsfname', '')
  2657. }
  2658. if (response.data.list[i].ccount == undefined) {
  2659. this.$set(response.data.list[i], 'ccount', '')
  2660. }
  2661. if (response.data.list[i].ratio == undefined) {
  2662. this.$set(response.data.list[i], 'ratio', '100')
  2663. }
  2664. if (response.data.list[i].ccountratio == undefined) {
  2665. this.$set(response.data.list[i], 'ccountratio', '')
  2666. }
  2667. if (response.data.list[i].r1 == undefined) {
  2668. this.$set(response.data.list[i], 'r1', '')
  2669. }
  2670. if (response.data.list[i].r2 == undefined) {
  2671. this.$set(response.data.list[i], 'r2', '')
  2672. }
  2673. if (response.data.list[i].r3 == undefined) {
  2674. this.$set(response.data.list[i], 'r3', '')
  2675. }
  2676. if (response.data.list[i].r4 == undefined) {
  2677. this.$set(response.data.list[i], 'r4', '')
  2678. }
  2679. if (response.data.list[i].w1 == undefined) {
  2680. this.$set(response.data.list[i], 'w1', '')
  2681. }
  2682. if (response.data.list[i].w2 == undefined) {
  2683. this.$set(response.data.list[i], 'w2', '')
  2684. }
  2685. if (response.data.list[i].w3 == undefined) {
  2686. this.$set(response.data.list[i], 'w3', '')
  2687. }
  2688. if (response.data.list[i].w4 == undefined) {
  2689. this.$set(response.data.list[i], 'w4', '')
  2690. }
  2691. if (response.data.list[i].feedweight == undefined) {
  2692. this.$set(response.data.list[i], 'feedweight', '')
  2693. }
  2694. if (response.data.list[i].Bfweight == undefined) {
  2695. this.$set(response.data.list[i], 'Bfweight', '')
  2696. }
  2697. if (response.data.list[i].Sfweight == undefined) {
  2698. this.$set(response.data.list[i], 'Sfweight', '')
  2699. }
  2700. if (response.data.list[i].timesopt !== undefined) {
  2701. var timesoptArr = response.data.list[i].timesopt.split(',')
  2702. for (let j = 0; j < timesoptArr.length; j++) {
  2703. response.data.list[i]['r' + timesoptArr[j].split(':')[0]] = timesoptArr[j].split(':')[1]
  2704. response.data.list[i]['w' + timesoptArr[j].split(':')[0]] = timesoptArr[j].split(':')[2]
  2705. }
  2706. }
  2707. }
  2708. this.history.list = response.data.list
  2709. this.history.pageNum = response.data.pageNum
  2710. this.history.pageSize = response.data.pageSize
  2711. this.history.total = response.data.total
  2712. } else {
  2713. this.history.list = []
  2714. }
  2715. setTimeout(() => {
  2716. this.history.listLoading = false
  2717. }, 100)
  2718. })
  2719. },
  2720. changeDate() {
  2721. this.getHistoryList()
  2722. },
  2723. // 应用
  2724. handleApplication() {
  2725. console.log('点击了应用')
  2726. MessageBox.confirm('是否确认将' + this.history.getdataListParm.parammaps.date + '的数据应用到当前?', {
  2727. confirmButtonText: '确认',
  2728. cancelButtonText: '取消',
  2729. type: 'warning'
  2730. }).then(() => {
  2731. this.requestParam.name = 'applyFPdate'
  2732. this.requestParam.parammaps = {}
  2733. this.requestParam.parammaps.pastureid = Cookies.get('pastureid')
  2734. this.requestParam.parammaps.date = this.history.getdataListParm.parammaps.date
  2735. PostDataByName(this.requestParam).then(response => {
  2736. if (response.msg === 'fail') {
  2737. this.$notify({
  2738. title: '保存失败',
  2739. message: response.data,
  2740. type: 'warning',
  2741. duration: 2000
  2742. })
  2743. } else {
  2744. this.$notify({
  2745. title: '成功',
  2746. message: '保存成功',
  2747. type: 'success',
  2748. duration: 2000
  2749. })
  2750. this.getHistoryIsDisplay()
  2751. this.getList()
  2752. }
  2753. })
  2754. }).catch(() => {
  2755. this.$message({
  2756. type: 'info',
  2757. message: '已取消应用'
  2758. })
  2759. })
  2760. },
  2761. // 导出模板
  2762. handleExportTemp() {
  2763. console.log('点击了导出模板')
  2764. },
  2765. // 导出
  2766. handleExport() {
  2767. console.log('点击了导出数据')
  2768. },
  2769. // 导入
  2770. handleImport() {
  2771. console.log('点击了导入')
  2772. }
  2773. }
  2774. }
  2775. </script>
  2776. <style lang="scss" scoped>
  2777. .search {
  2778. clear: both;
  2779. }
  2780. .table {
  2781. margin-top: 10px;
  2782. }
  2783. </style>