e574fdf552cd947db791bfdc046a191c999431dd.svn-base 63 KB

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