index.vue 167 KB

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