dc95974171f584bee1959713e07157f858ca4f1f.svn-base 119 KB

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