d50d637dc0cf3fcd76fe47a145ae6b18503949ae.svn-base 73 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566
  1. <template>
  2. <div class="app-container">
  3. <el-tabs v-model="activeName" @tab-click="handleTabClick">
  4. <el-tab-pane label="效率统计" name="first">
  5. <div class="search">
  6. <el-date-picker v-model="tab.table.getdataListParm.parammaps.mydate" type="date" placeholder="选择日期" style="width: 150px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" />
  7. <span style="margin-left: 10px;">统计类型:</span>
  8. <el-radio v-model="tab.radio" label="1" @change="changeRadio">配方</el-radio>
  9. <el-radio v-model="tab.radio" label="2" @change="changeRadio">栏舍</el-radio>
  10. <el-radio v-model="tab.radio" label="3" @change="changeRadio">牲畜类别</el-radio>
  11. <el-input v-if="tab.isFormulaName" v-model="tab.table.getdataListParm.parammaps.source" class="filter-item" style="width: 245px;" placeholder="配方模板" />
  12. <el-input v-if="tab.isHouseName" v-model="tab.table.getdataListParm.parammaps.source" class="filter-item" style="width: 150px;" placeholder="栏舍" />
  13. <el-input v-if="tab.isHouseName" v-model="tab.table.getdataListParm.parammaps.source" class="filter-item" style="width: 150px;" placeholder="配方模板" />
  14. <el-input v-if="tab.isLivestockType" v-model="tab.table.getdataListParm.parammaps.source" class="filter-item" style="width: 150px;" placeholder="牲畜类别" />
  15. <el-button class="successBorder" @click="handleSearch">查询</el-button>
  16. <el-button class="export" @click="handleDownload">导出</el-button>
  17. </div>
  18. <div class="table">
  19. <el-table
  20. :key="tab.table.tableKey"
  21. v-loading="tab.table.listLoading"
  22. element-loading-text="给我一点时间"
  23. :data="tab.table.list"
  24. border
  25. fit
  26. highlight-current-row
  27. style="width: 100%;"
  28. :row-style="rowStyle"
  29. :cell-style="cellStyle"
  30. class="elTable table-fixed"
  31. >
  32. <el-table-column v-if="tab.isFormulaName" label="配方模板" min-width="110px" align="center" prop="A1" />
  33. <el-table-column v-if="tab.isHouseName" label="栏舍" min-width="110px" align="center" prop="A1" />
  34. <el-table-column v-if="tab.isHouseName" label="配方模板" min-width="110px" align="center" prop="A20" />
  35. <el-table-column v-if="tab.isLivestockType" label="牲畜类别" min-width="110px" align="center" prop="A1" />
  36. <el-table-column label="实际牛头数" min-width="110px" align="center" prop="A2" />
  37. <el-table-column label="应混料量(kg)" min-width="110px" align="center" prop="A3" />
  38. <el-table-column label="实际混料量(kg)" min-width="110px" align="center" prop="A4" />
  39. <el-table-column label="撒料量(kg)" min-width="110px" align="center" prop="A5" />
  40. <el-table-column label="混料时间(min)" min-width="110px" align="center" prop="A6" />
  41. <el-table-column label="搅拌时间(min)" min-width="110px" align="center" prop="A7" />
  42. <el-table-column label="转投剩料量(kg)" min-width="110px" align="center" prop="A8" />
  43. <el-table-column label="今日剩料量(kg)" min-width="110px" align="center" prop="A9" />
  44. <el-table-column label="剩料率(%)" min-width="110px" align="center" prop="A10" />
  45. <el-table-column label="TMR干物质(%)" min-width="110px" align="center" prop="A11" />
  46. <el-table-column label="配方干物质采食量(kg/头)" min-width="110px" align="center" prop="A12" />
  47. <el-table-column label="实际干物质采食量(kg/头)" min-width="110px" align="center" prop="A13" />
  48. <el-table-column label="采食率(%)" min-width="110px" align="center" prop="A14" />
  49. <el-table-column label="配方成本(元/头)" min-width="110px" align="center" prop="A15" />
  50. <el-table-column label="实际成本(元/头)" min-width="110px" align="center" prop="A16" />
  51. <el-table-column label="产奶量(kg/头)" min-width="110px" align="center" prop="A17" />
  52. <el-table-column label="饲料转化率" min-width="110px" align="center" prop="A18" />
  53. <el-table-column label="公斤奶饲料成本" min-width="110px" align="center" prop="A19" />
  54. </el-table>
  55. <!-- <pagination v-show="tab.table.total>=0" :total="tab.table.total" :page.sync="tab.table.getdataListParm.offset" :limit.sync="tab.table.getdataListParm.pagecount" @pagination="getTabList" /> -->
  56. </div>
  57. <div class="AnalysisChart">
  58. <el-row :gutter="10">
  59. <!-- 泌乳牛采食量 -->
  60. <el-col :span="12" style="position: relative;">
  61. <h4 style="text-align:center;">泌乳牛采食量</h4>
  62. <div>
  63. <el-date-picker v-model="tab.chart1.getdataListParm.parammaps.inputDatetime" style="width: 250px;" class="inputDatetime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
  64. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('chart1')">导出</el-button>
  65. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleTable('chart1')">切换表格</el-button>
  66. </div>
  67. <div id="chartLine1" style="width:100%;height:430px;" />
  68. <div v-if="tab.chart1.isTable" class="table" style="width: 100%;position: absolute;top:19px;right: 0;">
  69. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('chart1')">导出</el-button>
  70. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleChart('chart1')">切换图表</el-button>
  71. <el-table
  72. :key="tab.chart1.table.tableKey"
  73. v-loading="tab.chart1.table.listLoading"
  74. element-loading-text="给我一点时间"
  75. :data="tab.chart1.table.list"
  76. border
  77. fit
  78. highlight-current-row
  79. style="width: 100%;"
  80. height="430"
  81. :row-style="rowStyle"
  82. :cell-style="cellStyle"
  83. class="elTable table-fixed"
  84. >
  85. <el-table-column label="日期" min-width="110px" align="center" prop="barname" />
  86. <el-table-column label="泌乳牛采食量(kg)" min-width="110px" align="center" prop="barname" />
  87. <el-table-column label="泌乳牛产奶量(kg)" min-width="110px" align="center" prop="barname" />
  88. </el-table>
  89. </div>
  90. </el-col>
  91. <!-- 牛栏剩料率 -->
  92. <el-col :span="12" style="position: relative;">
  93. <h4 style="text-align:center;">牛栏剩料率</h4>
  94. <div>
  95. <el-select v-model="tab.chart2.getdataListParm.parammaps.enable" style="width: 150px;margin-right: 5px;" multiple collapse-tags placeholder="请选择统计参数">
  96. <el-option v-for="item in tab.chart2.statisticsList" :key="item.id" :label="item.name" :value="item.id" />
  97. </el-select>
  98. <el-date-picker v-model="tab.chart2.getdataListParm.parammaps.inputDatetime" style="width: 250px;" class="inputDatetime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
  99. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('chart2')">导出</el-button>
  100. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleTable('chart2')">切换表格</el-button>
  101. </div>
  102. <div id="chartLine2" style="width:100%;height:400px;" />
  103. <div v-if="tab.chart2.isTable" class="table" style="width: 100%;position: absolute;top:19px;right: 0;">
  104. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('chart2')">导出</el-button>
  105. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleChart('chart2')">切换图表</el-button>
  106. <el-table
  107. :key="tab.chart2.table.tableKey"
  108. v-loading="tab.chart2.table.listLoading"
  109. element-loading-text="给我一点时间"
  110. :data="tab.chart2.table.list"
  111. border
  112. fit
  113. highlight-current-row
  114. style="width: 100%;"
  115. height="430"
  116. :row-style="rowStyle"
  117. :cell-style="cellStyle"
  118. class="elTable table-fixed"
  119. >
  120. <el-table-column label="日期" min-width="110px" align="center" prop="barname" />
  121. <el-table-column label="栏舍名称" min-width="110px" align="center" prop="barname" />
  122. <el-table-column label="剩料量" min-width="110px" align="center" prop="barname" />
  123. <el-table-column label="撒料量" min-width="110px" align="center" prop="barname" />
  124. <el-table-column label="剩料率" min-width="110px" align="center" prop="barname" />
  125. </el-table>
  126. </div>
  127. </el-col>
  128. </el-row>
  129. <el-row :gutter="10">
  130. <!-- 搅拌时间统计 -->
  131. <el-col :span="12" style="position: relative;">
  132. <h4 style="text-align:center;">搅拌时间统计</h4>
  133. <div>
  134. <el-date-picker v-model="tab.chart3.getdataListParm.parammaps.inputDatetime" style="width: 250px;" class="inputDatetime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
  135. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('chart3')">导出</el-button>
  136. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleTable('chart3')">切换表格</el-button>
  137. </div>
  138. <div id="chartLine3" style="width:100%;height:400px;" />
  139. <div v-if="tab.chart3.isTable" class="table" style="width: 100%;position: absolute;top:19px;right: 0;">
  140. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('chart3')">导出</el-button>
  141. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleChart('chart3')">切换图表</el-button>
  142. <el-table
  143. :key="tab.chart3.table.tableKey"
  144. v-loading="tab.chart3.table.listLoading"
  145. element-loading-text="给我一点时间"
  146. :data="tab.chart3.table.list"
  147. border
  148. fit
  149. highlight-current-row
  150. style="width: 100%;"
  151. height="430"
  152. :row-style="rowStyle"
  153. :cell-style="cellStyle"
  154. class="elTable table-fixed"
  155. >
  156. <el-table-column label="日期" min-width="110px" align="center" prop="barname" />
  157. <el-table-column label="平均搅拌时间(分钟)" min-width="110px" align="center" prop="barname" />
  158. <el-table-column label="混料+搅拌时间(分钟)" min-width="110px" align="center" prop="barname" />
  159. </el-table>
  160. </div>
  161. </el-col>
  162. <!-- 转化率 -->
  163. <el-col :span="12" style="position: relative;">
  164. <h4 style="text-align:center;">转化率</h4>
  165. <div>
  166. <el-select v-model="tab.chart4.getdataListParm.parammaps.enable" style="width: 150px;margin-right: 5px;" multiple collapse-tags placeholder="请选择统计参数">
  167. <el-option v-for="item in tab.chart4.statisticsList" :key="item.id" :label="item.name" :value="item.id" />
  168. </el-select>
  169. <el-date-picker v-model="tab.chart4.getdataListParm.parammaps.inputDatetime" style="width: 250px;" class="inputDatetime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
  170. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('chart4')">导出</el-button>
  171. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleTable('chart4')">切换表格</el-button>
  172. </div>
  173. <div id="chartLine4" style="width:100%;height:400px;" />
  174. <div v-if="tab.chart4.isTable" class="table" style="width: 100%;position: absolute;top:19px;right: 0;">
  175. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('chart4')">导出</el-button>
  176. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleChart('chart4')">切换图表</el-button>
  177. <el-table
  178. :key="tab.chart4.table.tableKey"
  179. v-loading="tab.chart4.table.listLoading"
  180. element-loading-text="给我一点时间"
  181. :data="tab.chart4.table.list"
  182. border
  183. fit
  184. highlight-current-row
  185. style="width: 100%;"
  186. height="430"
  187. :row-style="rowStyle"
  188. :cell-style="cellStyle"
  189. class="elTable table-fixed"
  190. >
  191. <el-table-column label="日期" min-width="110px" align="center" prop="barname" />
  192. <el-table-column label="配方名称" min-width="110px" align="center" prop="barname" />
  193. <el-table-column label="饲料转化率" min-width="110px" align="center" prop="barname" />
  194. </el-table>
  195. </div>
  196. </el-col>
  197. </el-row>
  198. <el-row :gutter="10">
  199. <!-- 成本分析 -->
  200. <el-col :span="24" style="position: relative;">
  201. <h4 style="text-align:center;">成本分析</h4>
  202. <div>
  203. <el-select v-model="tab.chart5.getdataListParm.parammaps.enable" style="width: 150px;margin-right: 5px;" multiple collapse-tags placeholder="请选择统计参数">
  204. <el-option v-for="item in tab.chart5.statisticsList" :key="item.id" :label="item.name" :value="item.id" />
  205. </el-select>
  206. <el-date-picker v-model="tab.chart5.getdataListParm.parammaps.inputDatetime" style="width: 250px;" class="inputDatetime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
  207. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('chart5')">导出</el-button>
  208. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleTable('chart5')">切换表格</el-button>
  209. </div>
  210. <div id="chartLine5" style="width:100%;height:400px;" />
  211. <div v-if="tab.chart5.isTable" class="table" style="width: 100%;position: absolute;top:19px;right: 0;">
  212. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('chart5')">导出</el-button>
  213. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleChart('chart5')">切换图表</el-button>
  214. <el-table
  215. :key="tab.chart5.table.tableKey"
  216. v-loading="tab.chart5.table.listLoading"
  217. element-loading-text="给我一点时间"
  218. :data="tab.chart5.table.list"
  219. border
  220. fit
  221. highlight-current-row
  222. style="width: 100%;"
  223. height="430"
  224. :row-style="rowStyle"
  225. :cell-style="cellStyle"
  226. class="elTable table-fixed"
  227. >
  228. <el-table-column label="日期" min-width="110px" align="center" prop="barname" />
  229. <el-table-column label="牲畜类别" min-width="110px" align="center" prop="barname" />
  230. <el-table-column label="公斤奶饲料成本(元)" min-width="110px" align="center" prop="barname" />
  231. </el-table>
  232. </div>
  233. </el-col>
  234. </el-row>
  235. </div>
  236. </el-tab-pane>
  237. <el-tab-pane label="牛群评估" name="second">
  238. <div class="search">
  239. <el-date-picker v-model="tab2.table.getdataListParm.parammaps.date" :clearable="false" type="date" placeholder="选择日期" style="width: 150px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="changeTab2Date" />
  240. </div>
  241. <div class="table">
  242. <el-row :gutter="10">
  243. <!-- 宾州筛分析 -->
  244. <el-col :span="12">
  245. <h4 style="text-align:center;">宾州筛分析</h4>
  246. <el-table
  247. :key="tab2.table.tableKey"
  248. v-loading="tab2.table.listLoading"
  249. element-loading-text="给我一点时间"
  250. :data="tab2.table.list"
  251. border
  252. fit
  253. highlight-current-row
  254. style="width: 100%;"
  255. :row-style="rowStyle"
  256. :cell-style="cellStyle"
  257. class="elTable table-fixed"
  258. height="400px"
  259. >
  260. <el-table-column label="宾州筛" min-width="110px" align="center" prop="barname" />
  261. <el-table-column label="第一层重量" min-width="110px" align="center" prop="oneweight" />
  262. <el-table-column label="第一层百分比" min-width="110px" align="center" prop="onerate" />
  263. <el-table-column label="第二层重量" min-width="110px" align="center" prop="twoweight" />
  264. <el-table-column label="第二层百分比" min-width="110px" align="center" prop="tworate" />
  265. <el-table-column label="第三层重量" min-width="110px" align="center" prop="threeweight" />
  266. <el-table-column label="第三层百分比" min-width="110px" align="center" prop="threerate" />
  267. <el-table-column label="第四层重量" min-width="110px" align="center" prop="fourweight" />
  268. <el-table-column label="第四层百分比" min-width="110px" align="center" prop="fourrate" />
  269. <el-table-column label="参考标准" min-width="110px" align="center" prop="standard" />
  270. </el-table>
  271. </el-col>
  272. <!-- 粪便筛分析 -->
  273. <el-col :span="12">
  274. <h4 style="text-align:center;">粪便筛分析</h4>
  275. <el-table
  276. :key="tab2.table2.tableKey"
  277. v-loading="tab2.table2.listLoading"
  278. element-loading-text="给我一点时间"
  279. :data="tab2.table2.list"
  280. border
  281. fit
  282. highlight-current-row
  283. style="width: 100%;"
  284. :row-style="rowStyle"
  285. :cell-style="cellStyle"
  286. class="elTable table-fixed"
  287. height="400px"
  288. >
  289. <el-table-column label="粪便筛" min-width="150px" align="center" prop="barname" />
  290. <el-table-column label="第一层重量" min-width="110px" align="center" prop="oneweight" />
  291. <el-table-column label="第一层百分比" min-width="110px" align="center" prop="onerate" />
  292. <el-table-column label="第二层重量" min-width="110px" align="center" prop="twoweight" />
  293. <el-table-column label="第二层百分比" min-width="110px" align="center" prop="tworate" />
  294. <el-table-column label="第三层重量" min-width="110px" align="center" prop="threeweight" />
  295. <el-table-column label="第三层百分比" min-width="110px" align="center" prop="threerate" />
  296. <el-table-column label="参考标准" min-width="110px" align="center" prop="standard" />
  297. </el-table>
  298. </el-col>
  299. </el-row>
  300. <el-row :gutter="10">
  301. <!-- BCS评分 -->
  302. <el-col :span="12">
  303. <h4 style="text-align:center;">BCS评分</h4>
  304. <el-table
  305. :key="tab2.table3.tableKey"
  306. v-loading="tab2.table3.listLoading"
  307. element-loading-text="给我一点时间"
  308. :data="tab2.table3.list"
  309. border
  310. fit
  311. highlight-current-row
  312. style="width: 100%;"
  313. :row-style="rowStyle"
  314. :cell-style="cellStyle"
  315. class="elTable table-fixed"
  316. height="400px"
  317. >
  318. <el-table-column label="栏舍" min-width="110px" align="center" prop="barname" />
  319. <el-table-column label="抽查样本数" min-width="110px" align="center" prop="sumcowcount" />
  320. <el-table-column label="单产" min-width="110px" align="center" prop="product" />
  321. <el-table-column label="干物质采食量" min-width="110px" align="center" prop="dryweight" />
  322. <el-table-column label="泌乳天数" min-width="110px" align="center" prop="avgdim" />
  323. <el-table-column label="标准分数" min-width="110px" align="center" prop="standardscore" />
  324. <el-table-column label="2.75-分(数量、百分比)" min-width="110px" align="center" prop="score25" />
  325. <el-table-column label="2.75分(数量、百分比" min-width="110px" align="center" prop="score275" />
  326. <el-table-column label="3分(数量、百分比)" min-width="110px" align="center" prop="score3" />
  327. <el-table-column label="3.25分(数量、百分比)" min-width="110px" align="center" prop="score325" />
  328. <el-table-column label="3.5分(数量、百分比)" min-width="110px" align="center" prop="score35" />
  329. <el-table-column label="3.75分(数量、百分比)" min-width="110px" align="center" prop="score375" />
  330. <el-table-column label="4+分(数量、百分比)" min-width="110px" align="center" prop="score4" />
  331. </el-table>
  332. </el-col>
  333. <!-- 粪便评分 -->
  334. <el-col :span="12">
  335. <h4 style="text-align:center;">粪便评分</h4>
  336. <el-table
  337. :key="tab2.table4.tableKey"
  338. v-loading="tab2.table4.listLoading"
  339. element-loading-text="给我一点时间"
  340. :data="tab2.table4.list"
  341. border
  342. fit
  343. highlight-current-row
  344. style="width: 100%;"
  345. :row-style="rowStyle"
  346. :cell-style="cellStyle"
  347. class="elTable table-fixed"
  348. height="400px"
  349. >
  350. <el-table-column label="栏舍" min-width="110px" align="center" prop="barname" />
  351. <el-table-column label="抽查样本数" min-width="110px" align="center" prop="sumcowcount" />
  352. <el-table-column label="单产" min-width="110px" align="center" prop="product" />
  353. <el-table-column label="干物质采食量" min-width="110px" align="center" prop="dryweight" />
  354. <el-table-column label="泌乳天数" min-width="110px" align="center" prop="avgdim" />
  355. <el-table-column label="标准分数" min-width="110px" align="center" prop="standardscore" />
  356. <el-table-column label="1分(数量、百分比)" min-width="110px" align="center" prop="score1" />
  357. <el-table-column label="2分(数量、百分比)" min-width="110px" align="center" prop="score2" />
  358. <el-table-column label="3分(数量、百分比)" min-width="110px" align="center" prop="score3" />
  359. <el-table-column label="4分(数量、百分比)" min-width="110px" align="center" prop="score4" />
  360. <el-table-column label="5分(数量、百分比)" min-width="110px" align="center" prop="score5" />
  361. </el-table>
  362. </el-col>
  363. </el-row>
  364. </div>
  365. </el-tab-pane>
  366. </el-tabs>
  367. </div>
  368. </template>
  369. <script>
  370. import echarts from 'echarts'
  371. require('echarts/theme/macarons')
  372. import { GetDataByName } from '@/api/common'
  373. import Cookies from 'js-cookie'
  374. import { parseTime } from '@/utils/index.js'
  375. import Pagination from '@/components/Pagination'
  376. import { json2excel } from '@/utils/index.js'
  377. export default {
  378. name: 'ErrorAnalysis',
  379. components: { Pagination },
  380. data() {
  381. return {
  382. activeName: 'first',
  383. tab: {
  384. radio: '1',
  385. isFormulaName: true, // 配方名称
  386. isHouseName: false, // 栏舍名称
  387. isLivestockType: false, // 牲畜类别
  388. table: {
  389. getdataListParm: {
  390. name: 'getBarmilkList',
  391. page: 1,
  392. offset: 1,
  393. pagecount: 10,
  394. returntype: 'Map',
  395. parammaps: {
  396. pastureid: Cookies.get('pastureid'),
  397. startTime: '',
  398. stopTime: '',
  399. inputDatetime: ''
  400. }
  401. },
  402. tableKey: 1,
  403. list: [
  404. { 'id': 1, 'A1': '干奶牛', 'A2': '107', 'A3': '3210', 'A4': '3200', 'A5': '3200', 'A6': '1.5', 'A7': '3.3', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.45', 'A12': '13.50', 'A13': '13.46', 'A14': '99.70', 'A15': '30.9', 'A16': '30.8', 'A17': '', 'A18': '', 'A19': '' },
  405. { 'id': 2, 'A1': '临产牛', 'A2': '93', 'A3': '3003', 'A4': '3008', 'A5': '3008', 'A6': '2.6', 'A7': '4.2', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.46', 'A12': '14.85', 'A13': '14.88 ', 'A14': '100.20', 'A15': '41.01', 'A16': '41.08', 'A17': '', 'A18': '', 'A19': '' },
  406. { 'id': 3, 'A1': '新产牛', 'A2': '16', 'A3': '372', 'A4': '362', 'A5': '33620', 'A6': '1.25', 'A7': '3.2', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.48', 'A12': '11.16', 'A13': '10.86', 'A14': '97.31', 'A15': '31.85', 'A16': '31.0', 'A17': '15', 'A18': '65%', 'A19': '1.55' },
  407. { 'id': 4, 'A1': '新产牛', 'A2': '119', 'A3': '3840', 'A4': '3864', 'A5': '3864', 'A6': '2.12', 'A7': '3.4', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.48', 'A12': '15.49', 'A13': '10.21', 'A14': '100.65', 'A15': '44.21', 'A16': '44.48', 'A17': '20', 'A18': '72%', 'A19': '1.6' },
  408. { 'id': 5, 'A1': '青年牛', 'A2': '103', 'A3': '2280', 'A4': '2287', 'A5': '2287', 'A6': '3', 'A7': '4.2', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.46', 'A12': '10.18', 'A13': '9.67', 'A14': '100.29', 'A15': '19.26', 'A16': '19.32', 'A17': '', 'A18': '', 'A19': '' },
  409. { 'id': 6, 'A1': '高产牛', 'A2': '96', 'A3': '4409', 'A4': '1976', 'A5': '1976', 'A6': '1', 'A7': '2.3', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.47', 'A12': '21.59', 'A13': '9.41', 'A14': '44.79', 'A15': '57.41', 'A16': '25.73', 'A17': '27', 'A18': '85%', 'A19': '1.2' },
  410. { 'id': 7, 'A1': '小育成', 'A2': '155', 'A3': '3308', 'A4': '3316', 'A5': '3316', 'A6': '1.63', 'A7': '2.4', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.44', 'A12': '9.39', 'A13': '9.98', 'A14': '100.21', 'A15': '22.2', 'A16': '22.25', 'A17': '', 'A18': '', 'A19': '' },
  411. { 'id': 8, 'A1': '大公牛', 'A2': '113', 'A3': '2684', 'A4': '2684', 'A5': '2684', 'A6': '2.2', 'A7': '3.5', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.42', 'A12': '9.98', 'A13': '9.98', 'A14': '100.00', 'A15': '15.2', 'A16': '15.2', 'A17': '', 'A18': '', 'A19': '' },
  412. { 'id': 9, 'A1': '青年牛', 'A2': '154', 'A3': '3342', 'A4': '3326', 'A5': '3326', 'A6': '2.5', 'A7': '4.23', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.46', 'A12': '9.98', 'A13': '13.46', 'A14': '99.50', 'A15': '18.88', 'A16': '18.79', 'A17': '', 'A18': '', 'A19': '' },
  413. { 'id': 10, 'A1': '青年牛', 'A2': '150', 'A3': '3418', 'A4': '3417', 'A5': '3417', 'A6': '3.1', 'A7': '5', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.46', 'A12': '10.48', 'A13': '13.46', 'A14': '100.00', 'A15': '19.82', 'A16': '19.82', 'A17': '', 'A18': '', 'A19': '' }
  414. ],
  415. total: 0,
  416. listLoading: true,
  417. temp: {}
  418. },
  419. table2: {
  420. getdataListParm: {
  421. name: 'getBarmilkList',
  422. page: 1,
  423. offset: 1,
  424. pagecount: 10,
  425. returntype: 'Map',
  426. parammaps: {
  427. pastureid: Cookies.get('pastureid'),
  428. startTime: '',
  429. stopTime: '',
  430. inputDatetime: ''
  431. }
  432. },
  433. tableKey: 2,
  434. list: [],
  435. total: 0,
  436. listLoading: true,
  437. temp: {}
  438. },
  439. chart1: {
  440. chartLine: null,
  441. chartLine_data: {},
  442. getdataListParm: {
  443. name: 'getBarmilkList',
  444. page: 1,
  445. offset: 1,
  446. pagecount: 10,
  447. returntype: 'Map',
  448. parammaps: {
  449. pastureid: Cookies.get('pastureid'),
  450. enable: ''
  451. }
  452. },
  453. tableKey: 1,
  454. list: [],
  455. total: 0,
  456. listLoading: true,
  457. statisticsList: [{ id: '0', name: '配方01' }, { id: '1', name: '配方02' }, { id: '2', name: '配方03' }],
  458. isChart: true,
  459. isTable: false,
  460. table: {
  461. getdataListParm: {
  462. name: 'getBarmilkList',
  463. page: 1,
  464. offset: 1,
  465. pagecount: 10,
  466. returntype: 'Map',
  467. parammaps: {
  468. pastureid: Cookies.get('pastureid'),
  469. enable: ''
  470. }
  471. },
  472. tableKey: 1,
  473. list: [],
  474. total: 0,
  475. listLoading: true
  476. }
  477. },
  478. chart2: {
  479. chartLine: null,
  480. chartLine_data: {},
  481. getdataListParm: {
  482. name: 'getBarmilkList',
  483. page: 1,
  484. offset: 1,
  485. pagecount: 10,
  486. returntype: 'Map',
  487. parammaps: {
  488. pastureid: Cookies.get('pastureid'),
  489. enable: ''
  490. }
  491. },
  492. tableKey: 1,
  493. list: [],
  494. total: 0,
  495. listLoading: true,
  496. statisticsList: [{ id: '0', name: '配方01' }, { id: '1', name: '配方02' }, { id: '2', name: '配方03' }],
  497. isChart: true,
  498. isTable: false,
  499. table: {
  500. getdataListParm: {
  501. name: 'getBarmilkList',
  502. page: 1,
  503. offset: 1,
  504. pagecount: 10,
  505. returntype: 'Map',
  506. parammaps: {
  507. pastureid: Cookies.get('pastureid'),
  508. enable: ''
  509. }
  510. },
  511. tableKey: 1,
  512. list: [],
  513. total: 0,
  514. listLoading: true
  515. }
  516. },
  517. chart3: {
  518. chartLine: null,
  519. chartLine_data: {},
  520. getdataListParm: {
  521. name: 'getBarmilkList',
  522. page: 1,
  523. offset: 1,
  524. pagecount: 10,
  525. returntype: 'Map',
  526. parammaps: {
  527. pastureid: Cookies.get('pastureid'),
  528. enable: ''
  529. }
  530. },
  531. tableKey: 1,
  532. list: [],
  533. total: 0,
  534. listLoading: true,
  535. isChart: true,
  536. isTable: false,
  537. table: {
  538. getdataListParm: {
  539. name: 'getBarmilkList',
  540. page: 1,
  541. offset: 1,
  542. pagecount: 10,
  543. returntype: 'Map',
  544. parammaps: {
  545. pastureid: Cookies.get('pastureid'),
  546. enable: ''
  547. }
  548. },
  549. tableKey: 1,
  550. list: [],
  551. total: 0,
  552. listLoading: true
  553. }
  554. },
  555. chart4: {
  556. chartLine: null,
  557. chartLine_data: {},
  558. getdataListParm: {
  559. name: 'getBarmilkList',
  560. page: 1,
  561. offset: 1,
  562. pagecount: 10,
  563. returntype: 'Map',
  564. parammaps: {
  565. pastureid: Cookies.get('pastureid'),
  566. enable: ''
  567. }
  568. },
  569. tableKey: 1,
  570. list: [],
  571. total: 0,
  572. listLoading: true,
  573. statisticsList: [{ id: '0', name: '配方01' }, { id: '1', name: '配方02' }, { id: '2', name: '配方03' }],
  574. isChart: true,
  575. isTable: false,
  576. table: {
  577. getdataListParm: {
  578. name: 'getBarmilkList',
  579. page: 1,
  580. offset: 1,
  581. pagecount: 10,
  582. returntype: 'Map',
  583. parammaps: {
  584. pastureid: Cookies.get('pastureid'),
  585. enable: ''
  586. }
  587. },
  588. tableKey: 1,
  589. list: [],
  590. total: 0,
  591. listLoading: true
  592. }
  593. },
  594. chart5: {
  595. chartLine: null,
  596. chartLine_data: {},
  597. getdataListParm: {
  598. name: 'getBarmilkList',
  599. page: 1,
  600. offset: 1,
  601. pagecount: 10,
  602. returntype: 'Map',
  603. parammaps: {
  604. pastureid: Cookies.get('pastureid'),
  605. enable: ''
  606. }
  607. },
  608. tableKey: 1,
  609. list: [],
  610. total: 0,
  611. listLoading: true,
  612. statisticsList: [{ id: '0', name: '配方01' }, { id: '1', name: '配方02' }, { id: '2', name: '配方03' }],
  613. isChart: true,
  614. isTable: false,
  615. table: {
  616. getdataListParm: {
  617. name: 'getBarmilkList',
  618. page: 1,
  619. offset: 1,
  620. pagecount: 10,
  621. returntype: 'Map',
  622. parammaps: {
  623. pastureid: Cookies.get('pastureid'),
  624. enable: ''
  625. }
  626. },
  627. tableKey: 1,
  628. list: [],
  629. total: 0,
  630. listLoading: true
  631. }
  632. }
  633. },
  634. tab2: {
  635. table: {
  636. getdataListParm: {
  637. name: 'getAssessCowPenn',
  638. page: 1,
  639. offset: 1,
  640. pagecount: 10,
  641. returntype: 'Map',
  642. parammaps: {
  643. pastureid: Cookies.get('pastureid'),
  644. date: parseTime(new Date(), '{y}-{m}-{d}')
  645. }
  646. },
  647. tableKey: 1,
  648. list: [],
  649. total: 0,
  650. listLoading: true,
  651. temp: {}
  652. },
  653. table2: {
  654. getdataListParm: {
  655. name: 'getAssessCowDung',
  656. page: 1,
  657. offset: 1,
  658. pagecount: 10,
  659. returntype: 'Map',
  660. parammaps: {
  661. pastureid: Cookies.get('pastureid'),
  662. date: ''
  663. }
  664. },
  665. tableKey: 1,
  666. list: [],
  667. total: 0,
  668. listLoading: true,
  669. temp: {}
  670. },
  671. table3: {
  672. getdataListParm: {
  673. name: 'getAssessBodyscore',
  674. page: 1,
  675. offset: 1,
  676. pagecount: 10,
  677. returntype: 'Map',
  678. parammaps: {
  679. pastureid: Cookies.get('pastureid'),
  680. date: ''
  681. }
  682. },
  683. tableKey: 1,
  684. list: [],
  685. total: 0,
  686. listLoading: true,
  687. temp: {}
  688. },
  689. table4: {
  690. getdataListParm: {
  691. name: 'getAssessDungscore',
  692. page: 1,
  693. offset: 1,
  694. pagecount: 10,
  695. returntype: 'Map',
  696. parammaps: {
  697. pastureid: Cookies.get('pastureid'),
  698. date: ''
  699. }
  700. },
  701. tableKey: 1,
  702. list: [],
  703. total: 0,
  704. listLoading: true,
  705. temp: {}
  706. }
  707. },
  708. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  709. cellStyle: { padding: 0 + 'px' }
  710. }
  711. },
  712. created() {
  713. this.getTabList()
  714. this.getTabList2()
  715. this.getChart1()
  716. this.getChart2()
  717. this.getChart3()
  718. this.getChart4()
  719. this.getChart5()
  720. },
  721. mounted() {
  722. },
  723. methods: {
  724. handleDownload() {
  725. if (this.tab.radio == '1') {
  726. var excelDatas = [
  727. {
  728. tHeader: ['配方模板', '实际牛头数', '应混料量(kg)', '实际混料量(kg)', '撒料量(kg)', '混料时间(min)', '搅拌时间(min)', '转投剩料量(kg)', '今日剩料量(kg)', '剩料率(%)', 'TMR干物质(%)', '配方干物质采食量(kg/头)', '实际干物质采食量(kg/头)', '采食率(%) ', '配方成本(元/头 )', '实际成本(元/ 头)', '产奶量(kg /头)', '饲 料转化率', '公斤奶饲料成本'],
  729. filterVal: ['A1', 'A2', 'A3', 'A4', 'A5', 'A6', 'A7', 'A8', 'A9', 'A10', 'A11', 'A12', 'A13', 'A14', 'A15', 'A16', 'A17', 'A18', 'A19'],
  730. tableDatas: this.tab.table.list,
  731. sheetName: '配方'
  732. }
  733. ]
  734. json2excel(excelDatas, '效率统计-配方', true, 'xlsx')
  735. } else if (this.tab.radio == '2') {
  736. var excelDatas2 = [
  737. {
  738. tHeader: ['栏舍', '配方模板', '实际牛头数', '应混料量(kg)', '实际混料量(kg)', '撒料量(kg)', '混料时间(min)', '搅拌时间(min)', '转投剩料量(kg)', '今日剩料量(kg)', '剩料率(%)', 'TMR干物质(%)', '配方干物质采食量(kg/头)', ' 实际干物质采食量( kg/头)', '采食率 (%)', '配方成本( 元/头)', '实际成本 (元/头)', '产奶量(kg/头)', '饲料转化率', '公斤奶饲料成本'],
  739. filterVal: ['A1', 'A20', 'A2', 'A3', 'A4', 'A5', 'A6', 'A7', 'A8', 'A9', 'A10', 'A11', 'A12', 'A13', 'A14', 'A15', 'A16', 'A17', 'A18', 'A19'],
  740. tableDatas: this.tab.table.list,
  741. sheetName: '栏舍'
  742. }
  743. ]
  744. json2excel(excelDatas2, '效率统计-栏舍', true, 'xlsx')
  745. } else if (this.tab.radio == '3') {
  746. var excelDatas3 = [
  747. {
  748. tHeader: ['牲畜类别', '实际牛头数', '应混料量(kg)', '实际混料量(kg)', '撒料量(kg)', '混料时间(min)', '搅拌时间(min)', '转投剩料量(kg)', '今日剩料量(kg)', '剩料率(%)', 'TMR干物质(%)', '配方干 物质采食量(kg/ 头)', '实际干物质采 食量(kg/头)', ' 采食率(%)', '配方 成本(元/头)', '实际成本(元/头)', '产奶量(kg/头)', '饲料转化率', '公斤奶饲料成本'],
  749. filterVal: ['A1', 'A2', 'A3', 'A4', 'A5', 'A6', 'A7', 'A8', 'A9', 'A10', 'A11', 'A12', 'A13', 'A14', 'A15', 'A16', 'A17', 'A18', 'A19'],
  750. tableDatas: this.tab.table.list,
  751. sheetName: '牲畜类别'
  752. }
  753. ]
  754. json2excel(excelDatas3, '效率统计-牲畜类别', true, 'xlsx')
  755. }
  756. },
  757. handleTabClick() {
  758. if (this.activeName == 'first') {
  759. this.getTabList()
  760. this.getTabList2()
  761. this.getChart1()
  762. this.getChart2()
  763. this.getChart3()
  764. this.getChart4()
  765. this.getChart5()
  766. } else if (this.activeName == 'second') {
  767. this.getTab2List()
  768. this.getTab2List2()
  769. this.getTab2List3()
  770. this.getTab2List4()
  771. }
  772. },
  773. changeRadio() {
  774. console.log(this.tab.radio)
  775. if (this.tab.radio == '1') {
  776. console.log('配方名称')
  777. this.tab.isFormulaName = true
  778. this.tab.isHouseName = false
  779. this.tab.isLivestockType = false
  780. this.tab.table.getdataListParm.name = 'getBarmilkList'
  781. this.getTabList()
  782. this.tab.table2.getdataListParm.name = 'getBarmilkList'
  783. this.getTabList2()
  784. this.tab.table.list = [
  785. { 'id': 1, 'A1': '干奶牛', 'A2': '107', 'A3': '3210', 'A4': '3200', 'A5': '3200', 'A6': '1.5', 'A7': '3.3', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.45', 'A12': '13.50', 'A13': '13.46', 'A14': '99.70', 'A15': '30.9', 'A16': '30.8', 'A17': '', 'A18': '', 'A19': '' },
  786. { 'id': 2, 'A1': '临产牛', 'A2': '93', 'A3': '3003', 'A4': '3008', 'A5': '3008', 'A6': '2.6', 'A7': '4.2', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.46', 'A12': '14.85', 'A13': '14.88 ', 'A14': '100.20', 'A15': '41.01', 'A16': '41.08', 'A17': '', 'A18': '', 'A19': '' },
  787. { 'id': 3, 'A1': '新产牛', 'A2': '16', 'A3': '372', 'A4': '362', 'A5': '33620', 'A6': '1.25', 'A7': '3.2', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.48', 'A12': '11.16', 'A13': '10.86', 'A14': '97.31', 'A15': '31.85', 'A16': '31.0', 'A17': '15', 'A18': '65%', 'A19': '1.55' },
  788. { 'id': 4, 'A1': '新产牛', 'A2': '119', 'A3': '3840', 'A4': '3864', 'A5': '3864', 'A6': '2.12', 'A7': '3.4', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.48', 'A12': '15.49', 'A13': '10.21', 'A14': '100.65', 'A15': '44.21', 'A16': '44.48', 'A17': '20', 'A18': '72%', 'A19': '1.6' },
  789. { 'id': 5, 'A1': '青年牛', 'A2': '103', 'A3': '2280', 'A4': '2287', 'A5': '2287', 'A6': '3', 'A7': '4.2', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.46', 'A12': '10.18', 'A13': '9.67', 'A14': '100.29', 'A15': '19.26', 'A16': '19.32', 'A17': '', 'A18': '', 'A19': '' },
  790. { 'id': 6, 'A1': '高产牛', 'A2': '96', 'A3': '4409', 'A4': '1976', 'A5': '1976', 'A6': '1', 'A7': '2.3', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.47', 'A12': '21.59', 'A13': '9.41', 'A14': '44.79', 'A15': '57.41', 'A16': '25.73', 'A17': '27', 'A18': '85%', 'A19': '1.2' },
  791. { 'id': 7, 'A1': '小育成', 'A2': '155', 'A3': '3308', 'A4': '3316', 'A5': '3316', 'A6': '1.63', 'A7': '2.4', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.44', 'A12': '9.39', 'A13': '9.98', 'A14': '100.21', 'A15': '22.2', 'A16': '22.25', 'A17': '', 'A18': '', 'A19': '' },
  792. { 'id': 8, 'A1': '大公牛', 'A2': '113', 'A3': '2684', 'A4': '2684', 'A5': '2684', 'A6': '2.2', 'A7': '3.5', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.42', 'A12': '9.98', 'A13': '9.98', 'A14': '100.00', 'A15': '15.2', 'A16': '15.2', 'A17': '', 'A18': '', 'A19': '' },
  793. { 'id': 9, 'A1': '青年牛', 'A2': '154', 'A3': '3342', 'A4': '3326', 'A5': '3326', 'A6': '2.5', 'A7': '4.23', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.46', 'A12': '9.98', 'A13': '13.46', 'A14': '99.50', 'A15': '18.88', 'A16': '18.79', 'A17': '', 'A18': '', 'A19': '' },
  794. { 'id': 10, 'A1': '青年牛', 'A2': '150', 'A3': '3418', 'A4': '3417', 'A5': '3417', 'A6': '3.1', 'A7': '5', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.46', 'A12': '10.48', 'A13': '13.46', 'A14': '100.00', 'A15': '19.82', 'A16': '19.82', 'A17': '', 'A18': '', 'A19': '' }
  795. ]
  796. } else if (this.tab.radio == '2') {
  797. console.log('栏舍名称')
  798. this.tab.isFormulaName = false
  799. this.tab.isHouseName = true
  800. this.tab.isLivestockType = false
  801. this.tab.table.getdataListParm.name = 'getBarmilkList'
  802. this.getTabList()
  803. this.tab.table2.getdataListParm.name = 'getBarmilkList'
  804. this.getTabList2()
  805. this.tab.table.list = [
  806. { 'id': 1, 'A1': '2号南', 'A2': '107', 'A3': '3210', 'A4': '3200', 'A5': '3200', 'A6': '1.5', 'A7': '3.3', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.45', 'A12': '13.50', 'A13': '13.46', 'A14': '99.70', 'A15': '30.9', 'A16': '30.8', 'A17': '', 'A18': '', 'A19': '', 'A20': '干奶牛' },
  807. { 'id': 2, 'A1': '1号北', 'A2': '93', 'A3': '3003', 'A4': '3008', 'A5': '3008', 'A6': '2.6', 'A7': '4.2', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.46', 'A12': '14.85', 'A13': '14.88 ', 'A14': '100.20', 'A15': '41.01', 'A16': '41.08', 'A17': '', 'A18': '', 'A19': '', 'A20': '临产牛' },
  808. { 'id': 3, 'A1': '1号南', 'A2': '16', 'A3': '372', 'A4': '362', 'A5': '33620', 'A6': '1.25', 'A7': '3.2', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.48', 'A12': '11.16', 'A13': '10.86', 'A14': '97.31', 'A15': '31.85', 'A16': '31.0', 'A17': '15', 'A18': '65%', 'A19': '1.55', 'A20': '新产牛' },
  809. { 'id': 4, 'A1': '5号南', 'A2': '119', 'A3': '3840', 'A4': '3864', 'A5': '3864', 'A6': '2.12', 'A7': '3.4', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.48', 'A12': '15.49', 'A13': '10.21', 'A14': '100.65', 'A15': '44.21', 'A16': '44.48', 'A17': '20', 'A18': '72%', 'A19': '1.6', 'A20': '新产牛' },
  810. { 'id': 5, 'A1': '5号北西', 'A2': '103', 'A3': '2280', 'A4': '2287', 'A5': '2287', 'A6': '3', 'A7': '4.2', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.46', 'A12': '10.18', 'A13': '9.67', 'A14': '100.29', 'A15': '19.26', 'A16': '19.32', 'A17': '', 'A18': '', 'A19': '', 'A20': '青年牛' },
  811. { 'id': 6, 'A1': '4号北', 'A2': '96', 'A3': '4409', 'A4': '1976', 'A5': '1976', 'A6': '1', 'A7': '2.3', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.47', 'A12': '21.59', 'A13': '9.41', 'A14': '44.79', 'A15': '57.41', 'A16': '25.73', 'A17': '27', 'A18': '85%', 'A19': '1.2', 'A20': '高产牛' },
  812. { 'id': 7, 'A1': '4号南', 'A2': '155', 'A3': '3308', 'A4': '3316', 'A5': '3316', 'A6': '1.63', 'A7': '2.4', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.44', 'A12': '9.39', 'A13': '9.98', 'A14': '100.21', 'A15': '22.2', 'A16': '22.25', 'A17': '', 'A18': '', 'A19': '', 'A20': '小育成' },
  813. { 'id': 8, 'A1': '8号南', 'A2': '113', 'A3': '2684', 'A4': '2684', 'A5': '2684', 'A6': '2.2', 'A7': '3.5', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.42', 'A12': '9.98', 'A13': '9.98', 'A14': '100.00', 'A15': '15.2', 'A16': '15.2', 'A17': '', 'A18': '', 'A19': '', 'A20': '大公牛' },
  814. { 'id': 9, 'A1': '7号北', 'A2': '154', 'A3': '3342', 'A4': '3326', 'A5': '3326', 'A6': '2.5', 'A7': '4.23', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.46', 'A12': '9.98', 'A13': '13.46', 'A14': '99.50', 'A15': '18.88', 'A16': '18.79', 'A17': '', 'A18': '', 'A19': '', 'A20': '青年牛' },
  815. { 'id': 10, 'A1': '8号北', 'A2': '150', 'A3': '3418', 'A4': '3417', 'A5': '3417', 'A6': '3.1', 'A7': '5', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.46', 'A12': '10.48', 'A13': '13.46', 'A14': '100.00', 'A15': '19.82', 'A16': '19.82', 'A17': '', 'A18': '', 'A19': '', 'A20': '青年牛' }
  816. ]
  817. } else if (this.tab.radio == '3') {
  818. console.log(' 牲畜类别')
  819. this.tab.isFormulaName = false
  820. this.tab.isHouseName = false
  821. this.tab.isLivestockType = true
  822. this.tab.table.getdataListParm.name = 'getBarmilkList'
  823. this.getTabList()
  824. this.tab.table2.getdataListParm.name = 'getBarmilkList'
  825. this.getTabList2()
  826. this.tab.table.list = [
  827. { 'id': 1, 'A1': '干奶牛', 'A2': '107', 'A3': '3210', 'A4': '3200', 'A5': '3200', 'A6': '1.5', 'A7': '3.3', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.45', 'A12': '13.50', 'A13': '13.46', 'A14': '99.70', 'A15': '30.9', 'A16': '30.8', 'A17': '', 'A18': '', 'A19': '' },
  828. { 'id': 2, 'A1': '临产牛', 'A2': '93', 'A3': '3003', 'A4': '3008', 'A5': '3008', 'A6': '2.6', 'A7': '4.2', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.46', 'A12': '14.85', 'A13': '14.88 ', 'A14': '100.20', 'A15': '41.01', 'A16': '41.08', 'A17': '', 'A18': '', 'A19': '' },
  829. { 'id': 3, 'A1': '新产牛', 'A2': '16', 'A3': '372', 'A4': '362', 'A5': '33620', 'A6': '1.25', 'A7': '3.2', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.48', 'A12': '11.16', 'A13': '10.86', 'A14': '97.31', 'A15': '31.85', 'A16': '31.0', 'A17': '15', 'A18': '65%', 'A19': '1.55' },
  830. { 'id': 4, 'A1': '新产牛', 'A2': '119', 'A3': '3840', 'A4': '3864', 'A5': '3864', 'A6': '2.12', 'A7': '3.4', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.48', 'A12': '15.49', 'A13': '10.21', 'A14': '100.65', 'A15': '44.21', 'A16': '44.48', 'A17': '20', 'A18': '72%', 'A19': '1.6' },
  831. { 'id': 5, 'A1': '青年牛', 'A2': '103', 'A3': '2280', 'A4': '2287', 'A5': '2287', 'A6': '3', 'A7': '4.2', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.46', 'A12': '10.18', 'A13': '9.67', 'A14': '100.29', 'A15': '19.26', 'A16': '19.32', 'A17': '', 'A18': '', 'A19': '' },
  832. { 'id': 6, 'A1': '高产牛', 'A2': '96', 'A3': '4409', 'A4': '1976', 'A5': '1976', 'A6': '1', 'A7': '2.3', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.47', 'A12': '21.59', 'A13': '9.41', 'A14': '44.79', 'A15': '57.41', 'A16': '25.73', 'A17': '27', 'A18': '85%', 'A19': '1.2' },
  833. { 'id': 7, 'A1': '小育成', 'A2': '155', 'A3': '3308', 'A4': '3316', 'A5': '3316', 'A6': '1.63', 'A7': '2.4', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.44', 'A12': '9.39', 'A13': '9.98', 'A14': '100.21', 'A15': '22.2', 'A16': '22.25', 'A17': '', 'A18': '', 'A19': '' },
  834. { 'id': 8, 'A1': '大公牛', 'A2': '113', 'A3': '2684', 'A4': '2684', 'A5': '2684', 'A6': '2.2', 'A7': '3.5', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.42', 'A12': '9.98', 'A13': '9.98', 'A14': '100.00', 'A15': '15.2', 'A16': '15.2', 'A17': '', 'A18': '', 'A19': '' },
  835. { 'id': 9, 'A1': '青年牛', 'A2': '154', 'A3': '3342', 'A4': '3326', 'A5': '3326', 'A6': '2.5', 'A7': '4.23', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.46', 'A12': '9.98', 'A13': '13.46', 'A14': '99.50', 'A15': '18.88', 'A16': '18.79', 'A17': '', 'A18': '', 'A19': '' },
  836. { 'id': 10, 'A1': '青年牛', 'A2': '150', 'A3': '3418', 'A4': '3417', 'A5': '3417', 'A6': '3.1', 'A7': '5', 'A8': '0', 'A9': '0', 'A10': '0', 'A11': '0.46', 'A12': '10.48', 'A13': '13.46', 'A14': '100.00', 'A15': '19.82', 'A16': '19.82', 'A17': '', 'A18': '', 'A19': '' }
  837. ]
  838. }
  839. },
  840. // 汇总统计/混料
  841. getTabList() {
  842. this.tab.table.listLoading = true
  843. GetDataByName(this.tab.table.getdataListParm).then(response => {
  844. console.log('汇总统计/混料table数据', response.data.list)
  845. if (response.data.list !== null) {
  846. // this.tab.table.list = response.data.list
  847. // this.tab.table.total = response.data.total
  848. } else {
  849. this.tab.table.list = []
  850. }
  851. setTimeout(() => {
  852. this.tab.table.listLoading = false
  853. }, 100)
  854. })
  855. },
  856. // 汇总统计/撒料
  857. getTabList2() {
  858. this.tab.table2.listLoading = true
  859. GetDataByName(this.tab.table2.getdataListParm).then(response => {
  860. console.log('汇总统计/撒料table数据', response.data.list)
  861. if (response.data.list !== null) {
  862. this.tab.table2.list = response.data.list
  863. this.tab.table2.total = response.data.total
  864. } else {
  865. this.tab.table2.list = []
  866. }
  867. setTimeout(() => {
  868. this.tab.table2.listLoading = false
  869. }, 100)
  870. })
  871. },
  872. // 开始日期/结束日期
  873. changeDate() {
  874. if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
  875. this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  876. this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  877. } else {
  878. this.tab.table.getdataListParm.parammaps.inputDatetime = ''
  879. this.tab.table.getdataListParm.parammaps.startTime = ''
  880. this.tab.table.getdataListParm.parammaps.stopTime = ''
  881. }
  882. this.tab.table.getdataListParm.offset = 1
  883. this.getTabList()
  884. },
  885. // 查询
  886. handleSearch() {
  887. if (this.tab.radio == '1') {
  888. console.log('配方名称/查询')
  889. this.tab.isFormulaName = true
  890. this.tab.isHouseName = false
  891. this.tab.isLivestockType = false
  892. this.tab.table.getdataListParm.name = 'getBarmilkList'
  893. this.getTabList()
  894. this.tab.table2.getdataListParm.name = 'getBarmilkList'
  895. this.getTabList2()
  896. } else if (this.tab.radio == '2') {
  897. console.log('栏舍名称/查询')
  898. this.tab.isFormulaName = false
  899. this.tab.isHouseName = true
  900. this.tab.isLivestockType = false
  901. this.tab.table.getdataListParm.name = 'getBarmilkList'
  902. this.getTabList()
  903. this.tab.table2.getdataListParm.name = 'getBarmilkList'
  904. this.getTabList2()
  905. } else if (this.tab.radio == '3') {
  906. console.log(' 牲畜类别/查询')
  907. this.tab.isFormulaName = false
  908. this.tab.isHouseName = false
  909. this.tab.isLivestockType = true
  910. this.tab.table.getdataListParm.name = 'getBarmilkList'
  911. this.getTabList()
  912. this.tab.table2.getdataListParm.name = 'getBarmilkList'
  913. this.getTabList2()
  914. }
  915. },
  916. // 泌乳牛采食量
  917. getChart1() {
  918. this.tab.chart1.listLoading = true
  919. GetDataByName(this.tab.chart1.getdataListParm).then(response => {
  920. console.log('泌乳牛采食量图表数据', response.data.list)
  921. if (response.data.list !== null) {
  922. this.tab.chart1.chartLine_data = {
  923. data1: ['09/16', '09/17', '09/18', '09/19', '09/20', '09/21', '09/22', '09/23', '09/24', '09/25', '09/26', '09/27', '09/28', '09/29', '09/30'],
  924. data2: [25, 27.2, 26.5, 29, 26.4, 23.6, 27.7, 28, 31, 33.5, 30, 35, 29.8, 26, 29.5],
  925. data3: [22.5, 25, 26.5, 24.3, 27.1, 25.5, 29, 22.4, 29, 19.8, 23.5, 22.8, 27.6, 21.2, 26]
  926. }
  927. this.tab.chart1.total = response.data.total
  928. this.roadChartLine1(this.tab.chart1.chartLine_data)
  929. } else {
  930. this.tab.chart1.list = []
  931. }
  932. setTimeout(() => {
  933. this.tab.chart1.listLoading = false
  934. }, 100)
  935. })
  936. },
  937. getChart1Table() {
  938. this.tab.chart1.table.listLoading = true
  939. GetDataByName(this.tab.chart1.table.getdataListParm).then(response => {
  940. console.log('泌乳牛采食量table/导出数据', response.data.list)
  941. if (response.data.list !== null) {
  942. this.tab.chart1.table.list = response.data.list
  943. this.tab.chart1.table.total = response.data.total
  944. } else {
  945. this.tab.chart1.table.list = []
  946. }
  947. setTimeout(() => {
  948. this.tab.chart1.table.listLoading = false
  949. }, 100)
  950. })
  951. },
  952. roadChartLine1(chartLine_data) {
  953. if (this.tab.chart1.chartLine != null) {
  954. this.tab.chart1.chartLine.dispose()
  955. }
  956. this.tab.chart1.chartLine = echarts.init(document.getElementById('chartLine1'))
  957. var option = {
  958. tooltip: {
  959. trigger: 'axis'
  960. },
  961. legend: {
  962. data: ['泌乳牛采食量', '泌乳牛产奶量']
  963. },
  964. xAxis: [
  965. {
  966. type: 'category',
  967. data: chartLine_data.data1
  968. }
  969. ],
  970. yAxis: [
  971. {
  972. type: 'value',
  973. name: '泌乳牛采食量',
  974. axisLabel: {
  975. formatter: '{value} '
  976. }
  977. }, {
  978. type: 'value',
  979. name: '泌乳牛产奶量',
  980. axisLabel: {
  981. formatter: '{value} '
  982. }
  983. }
  984. ],
  985. series: [{
  986. name: '泌乳牛采食量',
  987. type: 'bar',
  988. itemStyle: { /* 设置柱状颜色*/
  989. normal: {
  990. color: '#61a5e8'
  991. }
  992. },
  993. data: chartLine_data.data2
  994. }, {
  995. name: '泌乳牛产奶量',
  996. type: 'line',
  997. itemStyle: { /* 设置折线颜色*/
  998. normal: {
  999. color: '#ff2d2d'
  1000. }
  1001. },
  1002. data: chartLine_data.data3
  1003. }]
  1004. }
  1005. this.tab.chart1.chartLine.setOption(option)
  1006. window.onresize = function() {
  1007. this.tab.chart1.chartLine.resize()
  1008. }
  1009. },
  1010. // 牛栏剩料率
  1011. getChart2() {
  1012. this.tab.chart2.listLoading = true
  1013. GetDataByName(this.tab.chart2.getdataListParm).then(response => {
  1014. console.log('牛栏剩料率图表数据', response.data.list)
  1015. if (response.data.list !== null) {
  1016. this.tab.chart2.chartLine_data = {
  1017. data1: ['17号', '5号南', '3南东', '3南西', '1号南'],
  1018. data2: ['09/16', '09/17', '09/18', '09/19', '09/20', '09/21', '09/22', '09/23', '09/24', '09/25', '09/26', '09/27', '09/28', '09/29', '09/30'],
  1019. data3: [
  1020. { data: [3.5, 2.7, 6.6, 1.8, 2.2, 4.1, 5.3, 2.7, 0.8, 0.65, 2.1, 2.55, 2.7, 3.45, 2.1] },
  1021. { data: [2.8, 2.54, 1.5, 2.3, 2.1, 1.5, 1.9, 3.3, 4.1, 2.3, 2.6, 2.1, 2.73, 1.2, 0.65] },
  1022. { data: [1.2, 1.3, 1.1, 3.4, 0.9, 2.3, 2.1, 1.8, 3.6, 4.16, 2.87, 3.2, 4.1, 2.7, 2.1] },
  1023. { data: [2.1, 3.54, 1.9, 2.7, 2.1, 2.5, 2.9, 2.3, 2.1, 4.3, 1.5, 1.1, 2.53, 3.2, 1.65] },
  1024. { data: [2.8, 5.4, 2.5, 3.3, 3.1, 1.7, 1.2, 3.6, 1.1, 1.3, 2.7, 2.3, 1.3, 1.8, 3.1] }
  1025. ]
  1026. }
  1027. this.tab.chart2.total = response.data.total
  1028. this.roadChartLine2(this.tab.chart2.chartLine_data)
  1029. } else {
  1030. this.tab.chart2.list = []
  1031. }
  1032. setTimeout(() => {
  1033. this.tab.chart2.listLoading = false
  1034. }, 100)
  1035. })
  1036. },
  1037. getChart2Table() {
  1038. this.tab.chart2.table.listLoading = true
  1039. GetDataByName(this.tab.chart2.table.getdataListParm).then(response => {
  1040. console.log('牛栏剩料率table/导出数据', response.data.list)
  1041. if (response.data.list !== null) {
  1042. this.tab.chart2.table.list = response.data.list
  1043. this.tab.chart2.table.total = response.data.total
  1044. } else {
  1045. this.tab.chart2.table.list = []
  1046. }
  1047. setTimeout(() => {
  1048. this.tab.chart2.table.listLoading = false
  1049. }, 100)
  1050. })
  1051. },
  1052. roadChartLine2(chartLine_data) {
  1053. if (this.tab.chart2.chartLine != null) {
  1054. this.tab.chart2.chartLine.dispose()
  1055. }
  1056. this.tab.chart2.chartLine = echarts.init(document.getElementById('chartLine2'))
  1057. var option = {
  1058. title: {
  1059. text: ''
  1060. },
  1061. tooltip: {
  1062. trigger: 'axis'
  1063. },
  1064. legend: {
  1065. data: chartLine_data.data1,
  1066. top: 10,
  1067. right: 10
  1068. },
  1069. grid: {
  1070. left: '3%',
  1071. right: '8%',
  1072. bottom: '3%',
  1073. containLabel: true
  1074. },
  1075. toolbox: {
  1076. show: true,
  1077. right: '2%',
  1078. feature: {}
  1079. },
  1080. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '时间' },
  1081. yAxis: {
  1082. type: 'value', name: '剩料率'
  1083. },
  1084. series: (function() {
  1085. var serie = []
  1086. for (var i = 0; i < chartLine_data.data3.length; i++) {
  1087. var item = {
  1088. name: chartLine_data.data1[i],
  1089. type: 'line',
  1090. data: chartLine_data.data3[i].data
  1091. }
  1092. serie.push(item)
  1093. }
  1094. return serie
  1095. }())
  1096. }
  1097. this.tab.chart2.chartLine.setOption(option)
  1098. window.onresize = function() {
  1099. this.tab.chart2.chartLine.resize()
  1100. }
  1101. },
  1102. // 搅拌时间统计
  1103. getChart3() {
  1104. this.tab.chart3.listLoading = true
  1105. GetDataByName(this.tab.chart3.getdataListParm).then(response => {
  1106. console.log('搅拌时间统计图表数据', response.data.list)
  1107. if (response.data.list !== null) {
  1108. this.tab.chart3.chartLine_data = {
  1109. data1: ['平均搅拌时间', '混料+搅拌时间'],
  1110. data2: ['09/16', '09/17', '09/18', '09/19', '09/20', '09/21', '09/22', '09/23', '09/24', '09/25', '09/26', '09/27', '09/28', '09/29', '09/30'],
  1111. data3: [12, 13, 10.5, 10.4, 12.9, 13.3, 11.1, 11.5, 10.8, 12.5, 11.8, 12.9, 12.3, 12.1, 11.9],
  1112. data4: [33.5, 33.2, 34.1, 35.4, 35.9, 36.4, 34.1, 34.2, 33.9, 35.5, 34.7, 35.9, 35.2, 34.8, 34.1]
  1113. }
  1114. this.tab.chart3.total = response.data.total
  1115. this.roadChartLine3(this.tab.chart3.chartLine_data)
  1116. } else {
  1117. this.tab.chart3.list = []
  1118. }
  1119. setTimeout(() => {
  1120. this.tab.chart3.listLoading = false
  1121. }, 100)
  1122. })
  1123. },
  1124. getChart3Table() {
  1125. this.tab.chart3.table.listLoading = true
  1126. GetDataByName(this.tab.chart3.table.getdataListParm).then(response => {
  1127. console.log('搅拌时间统计table/导出数据', response.data.list)
  1128. if (response.data.list !== null) {
  1129. this.tab.chart3.table.list = response.data.list
  1130. this.tab.chart3.table.total = response.data.total
  1131. } else {
  1132. this.tab.chart3.table.list = []
  1133. }
  1134. setTimeout(() => {
  1135. this.tab.chart3.table.listLoading = false
  1136. }, 100)
  1137. })
  1138. },
  1139. roadChartLine3(chartLine_data) {
  1140. if (this.tab.chart3.chartLine != null) {
  1141. this.tab.chart3.chartLine.dispose()
  1142. }
  1143. this.tab.chart3.chartLine = echarts.init(document.getElementById('chartLine3'))
  1144. var option = {
  1145. title: {
  1146. text: ''
  1147. },
  1148. tooltip: {
  1149. trigger: 'axis'
  1150. },
  1151. legend: {
  1152. data: chartLine_data.data1,
  1153. top: 10,
  1154. right: 10
  1155. },
  1156. grid: {
  1157. left: '3%',
  1158. right: '8%',
  1159. bottom: '3%',
  1160. containLabel: true
  1161. },
  1162. toolbox: {
  1163. show: true,
  1164. right: '2%',
  1165. feature: {}
  1166. },
  1167. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '时间' },
  1168. yAxis: {
  1169. type: 'value', name: '分钟',
  1170. axisLabel: {
  1171. formatter: '{value}min'
  1172. }
  1173. },
  1174. series: [
  1175. {
  1176. name: chartLine_data.data1[0],
  1177. type: 'line',
  1178. stack: '总量',
  1179. data: chartLine_data.data3
  1180. },
  1181. {
  1182. name: chartLine_data.data1[1],
  1183. type: 'line',
  1184. stack: '总量',
  1185. data: chartLine_data.data4
  1186. },
  1187. {
  1188. name: chartLine_data.data1[2],
  1189. type: 'line',
  1190. stack: '总量',
  1191. data: chartLine_data.data5
  1192. }
  1193. ]
  1194. }
  1195. this.tab.chart3.chartLine.setOption(option)
  1196. window.onresize = function() {
  1197. this.tab.chart3.chartLine.resize()
  1198. }
  1199. },
  1200. // 转化率
  1201. getChart4() {
  1202. this.tab.chart4.listLoading = true
  1203. GetDataByName(this.tab.chart4.getdataListParm).then(response => {
  1204. console.log('转化率图表数据', response.data.list)
  1205. if (response.data.list !== null) {
  1206. this.tab.chart4.chartLine_data = {
  1207. data1: ['新产牛', '高产牛', '干奶牛', '低产牛', '小公牛', '小育成', '青年牛'],
  1208. data2: ['09/16', '09/17', '09/18', '09/19', '09/20', '09/21', '09/22', '09/23', '09/24', '09/25', '09/26', '09/27', '09/28', '09/29', '09/30'],
  1209. data3: [
  1210. { data: [76.5, 80.6, 75, 81, 85.5, 86.6, 87, 91.5, 87, 74, 76, 69.5, 84, 68.8, 91] },
  1211. { data: [78, 84, 85, 81, 80, 82.6, 85.8, 90.5, 84, 79.5, 77.6, 79.5, 81, 78.8, 92] },
  1212. { data: [86.5, 86, 77, 87, 70.5, 76, 92, 81.5, 86, 77.8, 72, 79.5, 88, 71, 93] },
  1213. { data: [74.5, 80, 75, 71, 81, 84, 89.7, 95, 80.7, 79, 72, 65, 88, 67.1, 89] },
  1214. { data: [79, 78, 71, 86, 80, 88, 82.8, 93, 83, 78.7, 74.6, 79.5, 94, 88.8, 81] },
  1215. { data: [85, 88.6, 85, 81, 71.5, 89.6, 80.7, 94, 85.7, 70, 77.4, 79.1, 81, 65, 90.5] },
  1216. { data: [78, 85, 69, 87, 92, 82, 87, 95.5, 80.7, 71.4, 70.6, 79.5, 81.4, 78.8, 88] }
  1217. ]
  1218. }
  1219. this.tab.chart4.total = response.data.total
  1220. this.roadChartLine4(this.tab.chart4.chartLine_data)
  1221. } else {
  1222. this.tab.chart4.list = []
  1223. }
  1224. setTimeout(() => {
  1225. this.tab.chart4.listLoading = false
  1226. }, 100)
  1227. })
  1228. },
  1229. getChart4Table() {
  1230. this.tab.chart4.table.listLoading = true
  1231. GetDataByName(this.tab.chart4.table.getdataListParm).then(response => {
  1232. console.log('转化率table/导出数据', response.data.list)
  1233. if (response.data.list !== null) {
  1234. this.tab.chart4.table.list = response.data.list
  1235. this.tab.chart4.table.total = response.data.total
  1236. } else {
  1237. this.tab.chart4.table.list = []
  1238. }
  1239. setTimeout(() => {
  1240. this.tab.chart4.table.listLoading = false
  1241. }, 100)
  1242. })
  1243. },
  1244. roadChartLine4(chartLine_data) {
  1245. if (this.tab.chart4.chartLine != null) {
  1246. this.tab.chart4.chartLine.dispose()
  1247. }
  1248. this.tab.chart4.chartLine = echarts.init(document.getElementById('chartLine4'))
  1249. var option = {
  1250. title: {
  1251. text: ''
  1252. },
  1253. tooltip: {
  1254. trigger: 'axis'
  1255. },
  1256. legend: {
  1257. data: chartLine_data.data1,
  1258. top: 10,
  1259. right: 10
  1260. },
  1261. grid: {
  1262. left: '3%',
  1263. right: '8%',
  1264. bottom: '3%',
  1265. containLabel: true
  1266. },
  1267. toolbox: {
  1268. show: true,
  1269. right: '2%',
  1270. feature: {}
  1271. },
  1272. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '时间' },
  1273. yAxis: {
  1274. type: 'value', name: '百分比', axisLabel: { formatter: '{value} %' }
  1275. },
  1276. series: (function() {
  1277. var serie = []
  1278. for (var i = 0; i < chartLine_data.data3.length; i++) {
  1279. var item = {
  1280. name: chartLine_data.data1[i],
  1281. type: 'line',
  1282. data: chartLine_data.data3[i].data
  1283. }
  1284. serie.push(item)
  1285. }
  1286. return serie
  1287. }())
  1288. }
  1289. this.tab.chart4.chartLine.setOption(option)
  1290. window.onresize = function() {
  1291. this.tab.chart4.chartLine.resize()
  1292. }
  1293. },
  1294. // 成本分析
  1295. getChart5() {
  1296. this.tab.chart5.listLoading = true
  1297. GetDataByName(this.tab.chart5.getdataListParm).then(response => {
  1298. console.log('转化率图表数据', response.data.list)
  1299. if (response.data.list !== null) {
  1300. this.tab.chart5.chartLine_data = {
  1301. data1: ['新产牛', '高产牛', '低产牛'],
  1302. data2: ['09/16', '09/17', '09/18', '09/19', '09/20', '09/21', '09/22', '09/23', '09/24', '09/25', '09/26', '09/27', '09/28', '09/29', '09/30'],
  1303. data3: [
  1304. { data: [1.5, 1.2, 1.7, 1.2, 1.6, 1.7, 1.6, 1.5, 1.2, 1.7, 1.2, 1.6, 1.7, 1.5, 2.1] },
  1305. { data: [1.7, 0.8, 1.2, 1.8, 1.7, 1.2, 1.8, 1.1, 1.5, 1.9, 1.8, 1.3, 1.4, 1.5, 1.4] },
  1306. { data: [1.3, 2.2, 1.9, 1.4, 2.1, 1, 1.3, 1.7, 1, 2, 1, 2.2, 1.1, 1.5, 1.2, 1.9] }
  1307. ]
  1308. }
  1309. this.tab.chart5.total = response.data.total
  1310. this.roadChartLine5(this.tab.chart5.chartLine_data)
  1311. } else {
  1312. this.tab.chart5.list = []
  1313. }
  1314. setTimeout(() => {
  1315. this.tab.chart5.listLoading = false
  1316. }, 100)
  1317. })
  1318. },
  1319. getChart5Table() {
  1320. this.tab.chart5.table.listLoading = true
  1321. GetDataByName(this.tab.chart5.table.getdataListParm).then(response => {
  1322. console.log('转化率table/导出数据', response.data.list)
  1323. if (response.data.list !== null) {
  1324. this.tab.chart5.table.list = response.data.list
  1325. this.tab.chart5.table.total = response.data.total
  1326. } else {
  1327. this.tab.chart5.table.list = []
  1328. }
  1329. setTimeout(() => {
  1330. this.tab.chart5.table.listLoading = false
  1331. }, 100)
  1332. })
  1333. },
  1334. roadChartLine5(chartLine_data) {
  1335. if (this.tab.chart5.chartLine != null) {
  1336. this.tab.chart5.chartLine.dispose()
  1337. }
  1338. this.tab.chart5.chartLine = echarts.init(document.getElementById('chartLine5'))
  1339. var option = {
  1340. title: {
  1341. text: ''
  1342. },
  1343. tooltip: {
  1344. trigger: 'axis'
  1345. },
  1346. legend: {
  1347. data: chartLine_data.data1,
  1348. top: 10,
  1349. right: 10
  1350. },
  1351. grid: {
  1352. left: '3%',
  1353. right: '8%',
  1354. bottom: '3%',
  1355. containLabel: true
  1356. },
  1357. toolbox: {
  1358. show: true,
  1359. right: '2%',
  1360. feature: {}
  1361. },
  1362. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '时间' },
  1363. yAxis: {
  1364. type: 'value', name: '公斤奶饲料成本(元)'
  1365. },
  1366. series: (function() {
  1367. var serie = []
  1368. for (var i = 0; i < chartLine_data.data3.length; i++) {
  1369. var item = {
  1370. name: chartLine_data.data1[i],
  1371. type: 'line',
  1372. data: chartLine_data.data3[i].data
  1373. }
  1374. serie.push(item)
  1375. }
  1376. return serie
  1377. }())
  1378. }
  1379. this.tab.chart5.chartLine.setOption(option)
  1380. window.onresize = function() {
  1381. this.tab.chart5.chartLine.resize()
  1382. }
  1383. },
  1384. // 导出
  1385. handleExport(item) {
  1386. if (item == 'chart1') {
  1387. console.log('泌乳牛采食量导出')
  1388. this.getChart1Table()
  1389. } else if (item == 'chart2') {
  1390. console.log('牛栏剩料率导出')
  1391. this.getChart2Table()
  1392. } else if (item == 'chart3') {
  1393. console.log('搅拌时间统计导出')
  1394. this.getChart3Table()
  1395. } else if (item == 'chart4') {
  1396. console.log('转化率导出')
  1397. this.getChart4Table()
  1398. } else if (item == 'chart5') {
  1399. console.log('成本分析导出')
  1400. this.getChart5Table()
  1401. }
  1402. },
  1403. // 切换表格
  1404. handleTable(item) {
  1405. // 显示切换表格
  1406. if (item == 'chart1') {
  1407. console.log('泌乳牛采食量表格')
  1408. this.tab.chart1.isTable = true
  1409. this.tab.chart1.isChart = false
  1410. this.getChart1Table()
  1411. } else if (item == 'chart2') {
  1412. console.log('牛栏剩料率表格')
  1413. this.tab.chart2.isTable = true
  1414. this.tab.chart2.isChart = false
  1415. this.getChart2Table()
  1416. } else if (item == 'chart3') {
  1417. console.log('搅拌时间统计表格')
  1418. this.tab.chart3.isTable = true
  1419. this.tab.chart3.isChart = false
  1420. this.getChart3Table()
  1421. } else if (item == 'chart4') {
  1422. console.log('转化率表格')
  1423. this.tab.chart4.isTable = true
  1424. this.tab.chart4.isChart = false
  1425. this.getChart4Table()
  1426. } else if (item == 'chart5') {
  1427. console.log('成本分析表格')
  1428. this.tab.chart5.isTable = true
  1429. this.tab.chart5.isChart = false
  1430. this.getChart5Table()
  1431. }
  1432. },
  1433. // 切换图表
  1434. handleChart(item) {
  1435. // 显示切换图表
  1436. if (item == 'chart1') {
  1437. console.log('泌乳牛采食量图表')
  1438. this.tab.chart1.isTable = false
  1439. this.tab.chart1.isChart = true
  1440. } else if (item == 'chart2') {
  1441. console.log('牛栏剩料率图表')
  1442. this.tab.chart2.isTable = false
  1443. this.tab.chart2.isChart = true
  1444. } else if (item == 'chart3') {
  1445. console.log('搅拌时间统计图表')
  1446. this.tab.chart3.isTable = false
  1447. this.tab.chart3.isChart = true
  1448. } else if (item == 'chart4') {
  1449. console.log('转化率图表')
  1450. this.tab.chart4.isTable = false
  1451. this.tab.chart4.isChart = true
  1452. } else if (item == 'chart5') {
  1453. console.log('成本分析图表')
  1454. this.tab.chart5.isTable = false
  1455. this.tab.chart5.isChart = true
  1456. }
  1457. },
  1458. // 切换tab2日期
  1459. changeTab2Date() {
  1460. this.getTab2List()
  1461. this.getTab2List2()
  1462. this.getTab2List3()
  1463. this.getTab2List4()
  1464. },
  1465. // 宾州筛分析
  1466. getTab2List() {
  1467. this.tab2.table.listLoading = true
  1468. GetDataByName(this.tab2.table.getdataListParm).then(response => {
  1469. console.log('宾州筛分析table数据', response.data.list)
  1470. if (response.data.list !== null) {
  1471. this.tab2.table.list = response.data.list
  1472. this.tab2.table.total = response.data.total
  1473. } else {
  1474. this.tab2.table.list = []
  1475. }
  1476. setTimeout(() => {
  1477. this.tab2.table.listLoading = false
  1478. }, 100)
  1479. })
  1480. },
  1481. // 粪便筛分析
  1482. getTab2List2() {
  1483. this.tab2.table2.listLoading = true
  1484. this.tab2.table2.getdataListParm.parammaps.date = this.tab2.table.getdataListParm.parammaps.date
  1485. GetDataByName(this.tab2.table2.getdataListParm).then(response => {
  1486. console.log('粪便筛分析table数据', response.data.list)
  1487. if (response.data.list !== null) {
  1488. this.tab2.table2.list = response.data.list
  1489. this.tab2.table2.total = response.data.total
  1490. } else {
  1491. this.tab2.table2.list = []
  1492. }
  1493. setTimeout(() => {
  1494. this.tab2.table2.listLoading = false
  1495. }, 100)
  1496. })
  1497. },
  1498. // BCS评分
  1499. getTab2List3() {
  1500. this.tab2.table3.listLoading = true
  1501. this.tab2.table3.getdataListParm.parammaps.date = this.tab2.table.getdataListParm.parammaps.date
  1502. GetDataByName(this.tab2.table3.getdataListParm).then(response => {
  1503. console.log('BCS评分table数据', response.data.list)
  1504. if (response.data.list !== null) {
  1505. this.tab2.table3.list = response.data.list
  1506. this.tab2.table3.total = response.data.total
  1507. } else {
  1508. this.tab2.table3.list = []
  1509. }
  1510. setTimeout(() => {
  1511. this.tab2.table3.listLoading = false
  1512. }, 100)
  1513. })
  1514. },
  1515. // 粪便评分
  1516. getTab2List4() {
  1517. this.tab2.table4.listLoading = true
  1518. this.tab2.table4.getdataListParm.parammaps.date = this.tab2.table.getdataListParm.parammaps.date
  1519. GetDataByName(this.tab2.table4.getdataListParm).then(response => {
  1520. console.log('成本分析table数据', response.data.list)
  1521. if (response.data.list !== null) {
  1522. this.tab2.table4.list = response.data.list
  1523. this.tab2.table4.total = response.data.total
  1524. } else {
  1525. this.tab2.table4.list = []
  1526. }
  1527. setTimeout(() => {
  1528. this.tab2.table4.listLoading = false
  1529. }, 100)
  1530. })
  1531. }
  1532. }
  1533. }
  1534. </script>
  1535. <style lang="scss" scoped>
  1536. .search{margin-bottom:10px;}
  1537. </style>