c8317246cc0adebf66f862eb30c8e33504be6399.svn-base 92 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061
  1. <template>
  2. <div class="app-container1">
  3. <div class="search">
  4. <el-date-picker
  5. ref="inputDatetime"
  6. v-model="table.getdataListParm.parammaps.inputDatetime"
  7. :clearable="false"
  8. class="inputDatetime filter-item"
  9. type="daterange"
  10. range-separator="至"
  11. start-placeholder="开始日期"
  12. end-placeholder="结束日期"
  13. style="width: 250px;"
  14. :picker-options="pickerOptions"
  15. @change="changeDate"
  16. />
  17. <el-button class="el-icon-arrow-left elIconArrowLeft" :disabled="Beforedisabled" @click="handleBefore" />
  18. <el-button class="el-icon-arrow-right elIconArrowRight" :disabled="Nextdisabled" @click="handleNext" />
  19. <el-button class="export" @click="handleDownload">导出</el-button>
  20. <svg-icon icon-class="Up" class="down" style="width: 40px;height: 40px;float: right;" @click="handleQuickJumpChart" />
  21. </div>
  22. <div id="table" class="table">
  23. <h4>混料</h4>
  24. <el-table
  25. :key="table.tableKey"
  26. v-loading="table.listLoading"
  27. element-loading-text="给我一点时间"
  28. :data="table.list"
  29. border
  30. fit
  31. highlight-current-row
  32. style="width: 100%;"
  33. :row-style="rowStyle"
  34. :cell-style="tableCellStyle"
  35. class="elTable table-fixed"
  36. >
  37. <el-table-column label="牧场" min-width="110px" align="center">
  38. <template slot-scope="{row}">
  39. <a @click="clickPasture(row)">{{ row.pasturename }}</a>
  40. </template>
  41. </el-table-column>
  42. <el-table-column label="理论重量" min-width="110px" align="center" prop="理论重量" />
  43. <el-table-column label="实际重量" min-width="110px" align="center" prop="实际重量" />
  44. <el-table-column label="计划混料操作数" min-width="110px" align="center" prop="计划混料操作数" />
  45. <el-table-column label="已混料操作数" min-width="110px" align="center" prop="已混料操作数" />
  46. <el-table-column label="混料操作率" min-width="110px" align="center" prop="混料操作率" />
  47. <el-table-column label="混料误差值" min-width="110px" align="center" prop="混料误差值" />
  48. <el-table-column label="混料准确率" min-width="110px" align="center" prop="混料准确率" />
  49. <el-table-column label="混料自动跳转次数" min-width="110px" align="center" prop="混料自动跳转次数" />
  50. <el-table-column label="混料手动跳转次数" min-width="110px" align="center" prop="混料手动跳转次数" />
  51. <el-table-column label="取消次数" min-width="110px" align="center" prop="取消次数" />
  52. <el-table-column label="标准差" min-width="110px" align="center" prop="方差" />
  53. </el-table>
  54. <h4>撒料</h4>
  55. <el-table
  56. :key="table2.tableKey"
  57. v-loading="table2.listLoading"
  58. element-loading-text="给我一点时间"
  59. :data="table2.list"
  60. border
  61. fit
  62. highlight-current-row
  63. style="width: 100%;"
  64. :row-style="rowStyle"
  65. :cell-style="tableCellStyle"
  66. class="elTable table-fixed"
  67. >
  68. <el-table-column label="牧场" min-width="110px" align="center">
  69. <template slot-scope="{row}">
  70. <a @click="clickPasture(row)">{{ row.pasturename }}</a>
  71. </template>
  72. </el-table-column>
  73. <el-table-column label="理论重量" min-width="110px" align="center" prop="理论重量" />
  74. <el-table-column label="实际重量" min-width="110px" align="center" prop="实际重量" />
  75. <el-table-column label="计划撒料操作数" min-width="110px" align="center" prop="计划撒料操作数" />
  76. <el-table-column label="已撒料操作数" min-width="110px" align="center" prop="已撒料操作数" />
  77. <el-table-column label="撒料操作率" min-width="110px" align="center" prop="撒料操作率" />
  78. <el-table-column label="撒料误差值" min-width="110px" align="center" prop="撒料误差值" />
  79. <el-table-column label="撒料准确率" min-width="110px" align="center" prop="撒料准确率" />
  80. <el-table-column label="撒料自动跳转次数" min-width="110px" align="center" prop="撒料自动跳转次数" />
  81. <el-table-column label="撒料手动跳转次数" min-width="110px" align="center" prop="撒料手动跳转次数" />
  82. <el-table-column label="标准差" min-width="110px" align="center" prop="方差" />
  83. </el-table>
  84. </div>
  85. <div class="AnalysisChart">
  86. <el-row :gutter="10">
  87. <el-col :span="24" style="margin-bottom: 10px;margin-top: 10px;">
  88. <span>图表查询时间:</span>
  89. <el-date-picker v-model="chartDate" :clearable="false" style="margin-left: 10px;width: 250px;margin-right: 10px;" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions" />
  90. <el-button class="successBorder" @click="handleChartDate">确认</el-button>
  91. <svg-icon icon-class="Up" style="width: 40px;height: 40px;float: right;" @click="handleQuickJumpTop" />
  92. </el-col>
  93. </el-row>
  94. <el-row :gutter="10" class="dashboard-editor-container">
  95. <!-- 计划统计 -->
  96. <el-col :span="12">
  97. <div class="grid-content">
  98. <h4>计划统计</h4>
  99. <div v-if="chart1.isChart" class="button">
  100. <el-date-picker v-model="chart1.getdataListParm.parammaps.inputDatetime" :clearable="false" style="width: 250px;" class="inputDatetime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions" @change="changeChartDate('chart1')" />
  101. <div class="exportTable" @click="handleExport('chart1')">导出</div>
  102. <div class="exportTable" @click="handleTable('chart1')">切换表格</div>
  103. </div>
  104. <div v-if="chart1.isChart" id="chartLine1" style="width:100%;height:400px;background: #fff;" />
  105. <div v-if="chart1.isTable" class="table">
  106. <div class="button">
  107. <div class="exportTable" @click="handleExport('chart1')">导出</div>
  108. <div class="exportTable" @click="handleChart('chart1')">切换图表</div>
  109. </div>
  110. <el-table
  111. :key="chart1.table.tableKey"
  112. v-loading="chart1.table.listLoading"
  113. element-loading-text="给我一点时间"
  114. :data="chart1.table.list"
  115. border
  116. fit
  117. highlight-current-row
  118. style="width: 100%;"
  119. height="400"
  120. :row-style="rowStyle"
  121. :cell-style="cellStyle"
  122. class="elTable table-fixed"
  123. >
  124. <el-table-column label="日期" sortable min-width="85px" align="center" prop="日期" />
  125. <el-table-column label="计划执行重量(kg)" sortable min-width="85px" align="center" prop="实际量" />
  126. <el-table-column label="配方理论重量(kg)" sortable min-width="85px" align="center" prop="理论量" />
  127. <el-table-column label="计划准确率" sortable min-width="80px" align="center" prop="field1" />
  128. <el-table-column label="计划取消重量(kg)" sortable min-width="85px" align="center" prop="计划取消重量" />
  129. <el-table-column label="计划准确率(去除取消重量)" sortable min-width="110px" align="center" prop="field3" />
  130. <el-table-column label="计划正确数" sortable min-width="80px" align="center" prop="正确数" />
  131. <el-table-column label="计划数" sortable min-width="70px" align="center" prop="计划数" />
  132. <el-table-column label="计划正确率" sortable min-width="80px" align="center" prop="field2" />
  133. </el-table>
  134. </div>
  135. </div>
  136. </el-col>
  137. <!-- 牛群准确率 -->
  138. <el-col :span="12">
  139. <div class="grid-content">
  140. <h4>牛群准确率</h4>
  141. <div v-if="chart2.isChart" class="button">
  142. <el-date-picker v-model="chart2.getdataListParm.parammaps.inputDatetime" style="width: 250px;" class="inputDatetime filter-item" :clearable="false" type="daterange" range-separator="至" start-placeholder="开始日期" :picker-options="pickerOptions" end-placeholder="结束日期" @change="changeChartDate('chart2')" />
  143. <div class="exportTable" @click="handleExport('chart2')">导出</div>
  144. <div class="exportTable" @click="handleTable('chart2')">切换表格</div>
  145. </div>
  146. <div v-if="chart2.isChart" id="chartLine2" style="width:100%;height:400px;" />
  147. <div v-if="chart2.isTable" class="table">
  148. <div class="button">
  149. <div class="exportTable" @click="handleExport('chart2')">导出</div>
  150. <div class="exportTable" @click="handleChart('chart2')">切换图表</div>
  151. </div>
  152. <el-table
  153. :key="chart2.table.tableKey"
  154. v-loading="chart2.table.listLoading"
  155. element-loading-text="给我一点时间"
  156. :data="chart2.table.list"
  157. border
  158. fit
  159. highlight-current-row
  160. style="width: 100%;"
  161. height="400"
  162. :row-style="rowStyle"
  163. :cell-style="cellStyle"
  164. class="elTable table-fixed"
  165. >
  166. <el-table-column label="日期" sortable min-width="90px" align="center" prop="日期" />
  167. <el-table-column label="配方名称" sortable min-width="90px" align="center" prop="名称" />
  168. <el-table-column label="计划重量(kg)" sortable min-width="100px" align="center" prop="理论量" />
  169. <el-table-column label="实际重量(kg)" sortable min-width="100px" align="center" prop="实际量" />
  170. <el-table-column label="准确率" sortable min-width="90px" align="center" prop="准确率" />
  171. </el-table>
  172. </div>
  173. </div>
  174. </el-col>
  175. </el-row>
  176. <el-row :gutter="10" class="dashboard-editor-container">
  177. <!-- 混料次数统计 -->
  178. <el-col :span="12">
  179. <div class="grid-content">
  180. <h4>混料次数统计</h4>
  181. <div v-if="chart3.isChart" class="button">
  182. <el-date-picker v-model="chart3.getdataListParm.parammaps.inputDatetime" style="width: 250px;" :clearable="false" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" :picker-options="pickerOptions" end-placeholder="结束日期" @change="changeChartDate('chart3')" />
  183. <div class="exportTable" @click="handleExport('chart3')">导出</div>
  184. <div class="exportTable" @click="handleTable('chart3')">切换表格</div>
  185. </div>
  186. <div v-if="chart3.isChart" id="chartLine3" style="width:100%;height:400px;" />
  187. <div v-if="chart3.isTable" class="table">
  188. <div class="button">
  189. <div class="exportTable" @click="handleExport('chart3')">导出</div>
  190. <div class="exportTable" @click="handleChart('chart3')">切换图表</div>
  191. </div>
  192. <el-table
  193. :key="chart3.table.tableKey"
  194. v-loading="chart3.table.listLoading"
  195. element-loading-text="给我一点时间"
  196. :data="chart3.table.list"
  197. border
  198. fit
  199. highlight-current-row
  200. style="width: 100%;"
  201. height="400"
  202. :row-style="rowStyle"
  203. :cell-style="cellStyle"
  204. class="elTable table-fixed"
  205. >
  206. <el-table-column label="日期" sortable min-width="90px" align="center" prop="日期" />
  207. <el-table-column label="牲畜类别" sortable min-width="90px" align="center" prop="名称" />
  208. <el-table-column label="计划重量(kg)" sortable min-width="100px" align="center" prop="理论量" />
  209. <el-table-column label="实际重量(kg)" sortable min-width="100px" align="center" prop="实际量" />
  210. <el-table-column label="准确率" sortable min-width="90px" align="center" prop="准确率" />
  211. </el-table>
  212. </div>
  213. </div>
  214. </el-col>
  215. <!-- 混料准确率统计 -->
  216. <el-col :span="12">
  217. <div class="grid-content">
  218. <h4>混料准确率统计</h4>
  219. <div v-if="chart4.isChart" class="button">
  220. <el-date-picker v-model="chart4.getdataListParm.parammaps.inputDatetime" :clearable="false" style="width: 250px;" class="inputDatetime" type="daterange" range-separator="至" start-placeholder="开始日期" :picker-options="pickerOptions" end-placeholder="结束日期" @change="changeChartDate('chart4')" />
  221. <div class="exportTable" @click="handleExport('chart4')">导出</div>
  222. <div class="exportTable" @click="handleTable('chart4')">切换表格</div>
  223. </div>
  224. <div v-if="chart4.isChart" id="chartLine4" style="width:100%;height:400px;" />
  225. <div v-if="chart4.isTable" class="table">
  226. <div class="button">
  227. <div class="exportTable" @click="handleExport('chart4')">导出</div>
  228. <div class="exportTable" @click="handleChart('chart4')">切换图表</div>
  229. </div>
  230. <el-table
  231. :key="chart4.table.tableKey"
  232. v-loading="chart4.table.listLoading"
  233. element-loading-text="给我一点时间"
  234. :data="chart4.table.list"
  235. border
  236. fit
  237. highlight-current-row
  238. style="width: 100%;"
  239. height="400"
  240. :row-style="rowStyle"
  241. :cell-style="cellStyle"
  242. class="elTable table-fixed"
  243. >
  244. <el-table-column label="日期" sortable min-width="90px" align="center" prop="日期" />
  245. <el-table-column label="车次" sortable min-width="90px" align="center" prop="名称" />
  246. <el-table-column label="计划重量(kg)" sortable min-width="100px" align="center" prop="理论量" />
  247. <el-table-column label="实际重量(kg)" sortable min-width="100px" align="center" prop="实际量" />
  248. <el-table-column label="准确率" sortable min-width="90px" align="center" prop="准确率" />
  249. </el-table>
  250. </div>
  251. </div>
  252. </el-col>
  253. </el-row>
  254. <el-row :gutter="10" class="dashboard-editor-container">
  255. <!-- 栏舍平均撒料时间统计 -->
  256. <el-col :span="12">
  257. <div class="grid-content">
  258. <h4>栏舍平均撒料时间统计</h4>
  259. <div v-if="chart5.isChart" class="button">
  260. <el-date-picker v-model="chart5.getdataListParm.parammaps.inputDatetime" :clearable="false" style="width: 250px;" class="inputDatetime" type="daterange" range-separator="至" start-placeholder="开始日期" :picker-options="pickerOptions" end-placeholder="结束日期" @change="changeChartDate('chart5')" />
  261. <div class="exportTable" @click="handleExport('chart5')">导出</div>
  262. <div class="exportTable" @click="handleTable('chart5')">切换表格</div>
  263. </div>
  264. <div v-if="chart5.isChart" id="chartLine5" style="width:100%;height:400px;" />
  265. <div v-if="chart5.isTable" class="table">
  266. <div class="button">
  267. <div class="exportTable" @click="handleExport('chart5')">导出</div>
  268. <div class="exportTable" @click="handleChart('chart5')">切换图表</div>
  269. </div>
  270. <el-table
  271. :key="chart5.table.tableKey"
  272. v-loading="chart5.table.listLoading"
  273. element-loading-text="给我一点时间"
  274. :data="chart5.table.list"
  275. border
  276. fit
  277. highlight-current-row
  278. style="width: 100%;"
  279. height="400"
  280. :row-style="rowStyle"
  281. :cell-style="cellStyle"
  282. class="elTable table-fixed"
  283. >
  284. <el-table-column label="日期" sortable min-width="85px" align="center" prop="日期" />
  285. <el-table-column label="自动跳转次数" sortable min-width="80px" align="center" prop="field1" />
  286. <el-table-column label="手动跳转次数" sortable min-width="80px" align="center" prop="field2" />
  287. <el-table-column label="自动跳转理论重量" sortable min-width="85px" align="center" prop="理论自动" />
  288. <el-table-column label="自动跳转实际重量" sortable min-width="85px" align="center" prop="实际自动" />
  289. <el-table-column label="自动跳转准确率" sortable min-width="85px" align="center" prop="field3" />
  290. <el-table-column label="手动跳转理论重量" sortable min-width="85px" align="center" prop="理论手动" />
  291. <el-table-column label="手动跳转实际重量" sortable min-width="85px" align="center" prop="实际手动" />
  292. <el-table-column label="手动跳转准确率" sortable min-width="85px" align="center" prop="field4" />
  293. </el-table>
  294. </div>
  295. </div>
  296. </el-col>
  297. <el-col :span="12">
  298. <div class="grid-content">
  299. <h4>混料计划取消次数</h4>
  300. <div v-if="chart6.isChart" class="button">
  301. <el-date-picker v-model="chart6.getdataListParm.parammaps.inputDatetime" :clearable="false" style="width: 250px;" class="inputDatetime" type="daterange" range-separator="至" start-placeholder="开始日期" :picker-options="pickerOptions" end-placeholder="结束日期" @change="changeChartDate('chart6')" />
  302. <div class="exportTable" @click="handleExport('chart6')">导出</div>
  303. <div class="exportTable" @click="handleTable('chart6')">切换表格</div>
  304. </div>
  305. <div v-if="chart6.isChart" id="chartLine6" style="width:100%;height:400px;" />
  306. <div v-if="chart6.isTable" class="table">
  307. <div class="button">
  308. <div class="exportTable" @click="handleExport('chart6')">导出</div>
  309. <div class="exportTable" @click="handleChart('chart6')">切换图表</div>
  310. </div>
  311. <el-table
  312. :key="chart6.table.tableKey"
  313. v-loading="chart6.table.listLoading"
  314. element-loading-text="给我一点时间"
  315. :data="chart6.table.list"
  316. border
  317. fit
  318. highlight-current-row
  319. style="width: 100%;"
  320. height="400"
  321. :row-style="rowStyle"
  322. :cell-style="cellStyle"
  323. class="elTable table-fixed"
  324. >
  325. <el-table-column label="日期" sortable min-width="85px" align="center" prop="日期" />
  326. <el-table-column label="自动跳转次数" sortable min-width="80px" align="center" prop="field1" />
  327. <el-table-column label="手动跳转次数" sortable min-width="80px" align="center" prop="field2" />
  328. <el-table-column label="自动跳转理论重量" sortable min-width="85px" align="center" prop="理论自动" />
  329. <el-table-column label="自动跳转实际重量" sortable min-width="85px" align="center" prop="实际自动" />
  330. <el-table-column label="自动跳转准确率" sortable min-width="85px" align="center" prop="field3" />
  331. <el-table-column label="手动跳转理论重量" sortable min-width="85px" align="center" prop="理论手动" />
  332. <el-table-column label="手动跳转实际重量" sortable min-width="85px" align="center" prop="实际手动" />
  333. <el-table-column label="手动跳转准确率" sortable min-width="85px" align="center" prop="field4" />
  334. </el-table>
  335. </div>
  336. </div>
  337. </el-col>
  338. </el-row>
  339. </div>
  340. <el-dialog :title="textMap[pasture.dialogStatus]" :destroy-on-close="true" :visible.sync="pasture.dialogFormVisible" :close-on-click-modal="false" width="90%">
  341. <div class="app-pasture">
  342. <div class="search">
  343. <span style="margin-left: 10px;">统计类型:</span>
  344. <el-radio v-model="pasture.radio" label="1" @change="changeRadio">配方名称</el-radio>
  345. <el-radio v-model="pasture.radio" label="2" @change="changeRadio">栏舍名称</el-radio>
  346. <el-radio v-model="pasture.radio" label="3" @change="changeRadio">牲畜类别</el-radio>
  347. <el-radio v-model="pasture.radio" label="4" @change="changeRadio">车次</el-radio>
  348. <el-checkbox v-model="pasture.checked" style="margin-right: 10px;" @change="changeChecked">按日期统计</el-checkbox>
  349. <el-input v-if="pasture.isFormulaName" v-model="pasture.table.getdataListParm.parammaps.fname" class="filter-item" style="width: 245px;" placeholder="配方名称" />
  350. <el-input v-if="pasture.isHouseName" v-model="pasture.table.getdataListParm.parammaps.fname" class="filter-item" style="width: 245px;" placeholder="栏舍名称" />
  351. <el-input v-if="pasture.isLivestockType" v-model="pasture.table.getdataListParm.parammaps.fname" class="filter-item" style="width: 245px;" placeholder="牲畜名称" />
  352. <el-input v-if="pasture.isTrainNumber" v-model="pasture.table.getdataListParm.parammaps.sort" class="filter-item" style="width: 150px;" placeholder="车次" />
  353. <el-input v-if="pasture.isTrainNumber" v-model="pasture.table.getdataListParm.parammaps.times" class="filter-item" style="width: 150px;" placeholder="班次" />
  354. <el-input v-if="pasture.isTrainNumber" v-model="pasture.table.getdataListParm.parammaps.fname" class="filter-item" style="width: 150px;" placeholder="TMR名称" />
  355. <el-button class="successBorder" @click="handleSearch">查询</el-button>
  356. </div>
  357. <div class="table">
  358. <h4>混料</h4>
  359. <el-table
  360. :key="pasture.table.tableKey"
  361. v-loading="pasture.table.listLoading"
  362. element-loading-text="给我一点时间"
  363. :data="pasture.table.list"
  364. border
  365. fit
  366. highlight-current-row
  367. style="width: 100%;"
  368. :row-style="rowStyle"
  369. :cell-style="cellStyle"
  370. class="elTable table-fixed"
  371. >
  372. <el-table-column v-if="pasture.checked" label="日期" min-width="110px" align="center" prop="日期" />
  373. <el-table-column v-if="pasture.isFormulaName" label="配方名称" min-width="110px" align="center" prop="配方名称" />
  374. <el-table-column v-if="pasture.isHouseName" label="栏舍名称" min-width="110px" align="center" prop="栏舍名称" />
  375. <el-table-column v-if="pasture.isLivestockType" label="牲畜类别" min-width="110px" align="center" prop="牲畜类别" />
  376. <el-table-column v-if="pasture.isTrainNumber" label="车次" min-width="110px" align="center" prop="车次" />
  377. <el-table-column v-if="pasture.isTrainNumber" label="班次" min-width="110px" align="center" prop="班次" />
  378. <el-table-column v-if="pasture.isTrainNumber" label="TMR名称" min-width="110px" align="center" prop="TMR名称" />
  379. <el-table-column v-if="pasture.isTrainNumber" label="驾驶员" min-width="110px" align="center" prop="驾驶员" />
  380. <el-table-column label="理论重量" min-width="110px" align="center" prop="理论重量" />
  381. <el-table-column label="实际重量" min-width="110px" align="center" prop="实际重量" />
  382. <el-table-column label="计划混料操作数" min-width="110px" align="center" prop="计划混料操作数" />
  383. <el-table-column label="已混料操作数" min-width="110px" align="center" prop="已混料操作数" />
  384. <el-table-column label="混料操作率" min-width="110px" align="center" prop="混料操作率" />
  385. <el-table-column label="混料误差值" min-width="110px" align="center" prop="混料误差值" />
  386. <el-table-column label="混料准确率" min-width="110px" align="center" prop="混料准确率" />
  387. <el-table-column label="混料自动跳转次数" min-width="110px" align="center" prop="混料自动跳转次数" />
  388. <el-table-column label="混料手动跳转次数" min-width="110px" align="center" prop="混料手动跳转次数" />
  389. <el-table-column label="取消次数" min-width="110px" align="center" prop="取消次数" />
  390. <el-table-column label="方差" min-width="110px" align="center" prop="方差" />
  391. </el-table>
  392. <h4>撒料</h4>
  393. <el-table
  394. :key="pasture.table2.tableKey"
  395. v-loading="pasture.table2.listLoading"
  396. element-loading-text="给我一点时间"
  397. :data="pasture.table2.list"
  398. border
  399. fit
  400. highlight-current-row
  401. style="width: 100%;"
  402. :row-style="rowStyle"
  403. :cell-style="cellStyle"
  404. class="elTable table-fixed"
  405. >
  406. <el-table-column v-if="pasture.checked" label="日期" min-width="110px" align="center" prop="日期" />
  407. <el-table-column v-if="pasture.isFormulaName" label="配方名称" min-width="110px" align="center" prop="配方名称" />
  408. <el-table-column v-if="pasture.isHouseName" label="栏舍名称" min-width="110px" align="center" prop="栏舍名称" />
  409. <el-table-column v-if="pasture.isLivestockType" label="牲畜类别" min-width="110px" align="center" prop="牲畜类别" />
  410. <el-table-column v-if="pasture.isTrainNumber" label="车次" min-width="110px" align="center" prop="车次" />
  411. <el-table-column v-if="pasture.isTrainNumber" label="班次" min-width="110px" align="center" prop="班次" />
  412. <el-table-column v-if="pasture.isTrainNumber" label="TMR名称" min-width="110px" align="center" prop="TMR" />
  413. <el-table-column v-if="pasture.isTrainNumber" label="驾驶员" min-width="110px" align="center" prop="驾驶员" />
  414. <el-table-column label="理论重量" min-width="110px" align="center" prop="理论重量" />
  415. <el-table-column label="实际重量" min-width="110px" align="center" prop="实际重量" />
  416. <el-table-column label="计划撒料操作数" min-width="110px" align="center" prop="计划撒料操作数" />
  417. <el-table-column label="已撒料操作数" min-width="110px" align="center" prop="已撒料操作数" />
  418. <el-table-column label="撒料操作率" min-width="110px" align="center" prop="撒料操作率" />
  419. <el-table-column label="撒料误差值" min-width="110px" align="center" prop="撒料误差值" />
  420. <el-table-column label="撒料准确率" min-width="110px" align="center" prop="撒料准确率" />
  421. <el-table-column label="撒料自动跳转次数" min-width="110px" align="center" prop="撒料自动跳转次数" />
  422. <el-table-column label="撒料手动跳转次数" min-width="110px" align="center" prop="撒料手动跳转次数" />
  423. </el-table>
  424. </div>
  425. </div>
  426. <div slot="footer" class="dialog-footer" style="bottom: 10px;">
  427. <el-button class="cancelClose" @click="pasture.dialogFormVisible = false; ">关闭</el-button>
  428. </div>
  429. </el-dialog>
  430. </div>
  431. </template>
  432. <script>
  433. import echarts from 'echarts'
  434. require('echarts/theme/macarons')
  435. import { GetDataByName, GetReportform } from '@/api/common'
  436. import Cookies from 'js-cookie'
  437. import { parseTime } from '@/utils/index.js'
  438. import Pagination from '@/components/Pagination'
  439. import { json2excel } from '@/utils/index.js'
  440. import { MessageBox } from 'element-ui'
  441. export default {
  442. name: 'Tab1',
  443. components: { Pagination },
  444. data() {
  445. return {
  446. Beforedisabled: false,
  447. Nextdisabled: false,
  448. pickerMinDate: '',
  449. pickerOptions: {
  450. onPick: ({ maxDate, minDate }) => {
  451. this.pickerMinDate = minDate.getTime()
  452. if (maxDate) {
  453. this.pickerMinDate = ''
  454. }
  455. },
  456. // 限制不能选择今天之后的日期
  457. disabledDate: (time) => {
  458. if (this.pickerMinDate !== '') {
  459. const one = 31 * 24 * 3600 * 1000
  460. const minTime = this.pickerMinDate - one
  461. let maxTime = this.pickerMinDate + one
  462. if (maxTime > new Date()) {
  463. maxTime = new Date()
  464. }
  465. return time.getTime() < minTime || time.getTime() > maxTime
  466. }
  467. return time.getTime() > Date.now()
  468. }
  469. },
  470. table: {
  471. getdataListParm: {
  472. name: 'getAccuracyJTHALL',
  473. page: 1,
  474. offset: 1,
  475. pagecount: '',
  476. returntype: 'Map',
  477. parammaps: {
  478. pastureid: Cookies.get('pastureid'),
  479. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  480. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  481. inputDatetime: [new Date(), new Date()],
  482. fname: '',
  483. sort: '',
  484. times: ''
  485. }
  486. },
  487. tableKey: 1,
  488. list: [],
  489. total: 0,
  490. listLoading: true,
  491. temp: {}
  492. },
  493. table2: {
  494. getdataListParm: {
  495. name: 'getAccuracyJTSALL',
  496. page: 1,
  497. offset: 1,
  498. pagecount: '',
  499. returntype: 'Map',
  500. parammaps: {
  501. pastureid: Cookies.get('pastureid'),
  502. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  503. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  504. inputDatetime: [new Date(), new Date()],
  505. fname: '',
  506. sort: '',
  507. times: ''
  508. }
  509. },
  510. tableKey: 2,
  511. list: [],
  512. total: 0,
  513. listLoading: true,
  514. temp: {}
  515. },
  516. chartDate: [],
  517. // 计划统计
  518. chart1: {
  519. chartLine: null,
  520. chartLine_data: {},
  521. getdataListParm: {
  522. name: 'getJT1AccuracyAllJH',
  523. page: 1,
  524. offset: 1,
  525. pagecount: '',
  526. returntype: 'Map',
  527. parammaps: {
  528. pastureid: Cookies.get('pastureid'),
  529. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  530. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  531. inputDatetime: [new Date(), new Date()]
  532. }
  533. },
  534. tableKey: 1,
  535. list: [],
  536. total: 0,
  537. listLoading: true,
  538. statisticsList: [],
  539. chart1Data3: [],
  540. isChart: true,
  541. isTable: false,
  542. table: {
  543. tableKey: 1,
  544. list: [],
  545. total: 0,
  546. listLoading: false
  547. }
  548. },
  549. // 牛群准确率
  550. chart2: {
  551. chartLine: null,
  552. chartLine_data: {},
  553. getdataListParm: {
  554. name: 'getJT1AccuracyAllNQ',
  555. page: 1,
  556. offset: 1,
  557. pagecount: '',
  558. returntype: 'Map',
  559. parammaps: {
  560. pastureid: Cookies.get('pastureid'),
  561. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  562. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  563. inputDatetime: [new Date(), new Date()]
  564. }
  565. },
  566. tableKey: 1,
  567. list: [],
  568. total: 0,
  569. listLoading: true,
  570. isChart: true,
  571. isTable: false,
  572. table: {
  573. tableKey: 1,
  574. list: [],
  575. total: 0,
  576. listLoading: false
  577. }
  578. },
  579. // 混料次数统计
  580. chart3: {
  581. chartLine: null,
  582. chartLine_data: {},
  583. getdataListParm: {
  584. name: 'getJT1AccuracyAllHL',
  585. page: 1,
  586. offset: 1,
  587. pagecount: '',
  588. returntype: 'Map',
  589. parammaps: {
  590. pastureid: Cookies.get('pastureid'),
  591. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  592. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  593. inputDatetime: [new Date(), new Date()]
  594. }
  595. },
  596. tableKey: 1,
  597. list: [],
  598. total: 0,
  599. listLoading: true,
  600. statisticsList: [],
  601. chart1Data3: [],
  602. isChart: true,
  603. isTable: false,
  604. table: {
  605. tableKey: 1,
  606. list: [],
  607. total: 0,
  608. listLoading: false
  609. }
  610. },
  611. // 混料准确率统计
  612. chart4: {
  613. chartLine: null,
  614. chartLine_data: {},
  615. getdataListParm: {
  616. name: 'getJT1AccuracyAllHLRate',
  617. page: 1,
  618. offset: 1,
  619. pagecount: '',
  620. returntype: 'Map',
  621. parammaps: {
  622. pastureid: Cookies.get('pastureid'),
  623. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  624. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  625. inputDatetime: [new Date(), new Date()]
  626. }
  627. },
  628. tableKey: 1,
  629. list: [],
  630. total: 0,
  631. listLoading: true,
  632. statisticsList: [],
  633. chart4Data3: [],
  634. isChart: true,
  635. isTable: false,
  636. table: {
  637. tableKey: 1,
  638. list: [],
  639. total: 0,
  640. listLoading: false
  641. }
  642. },
  643. // 栏舍平均撒料时间统计
  644. chart5: {
  645. chartLine: null,
  646. chartLine_data: {},
  647. getdataListParm: {
  648. name: 'getAccuracyAllLSJT',
  649. page: 1,
  650. offset: 1,
  651. pagecount: '',
  652. returntype: 'Map',
  653. parammaps: {
  654. pastureid: Cookies.get('pastureid'),
  655. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  656. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  657. inputDatetime: [new Date(), new Date()]
  658. }
  659. },
  660. tableKey: 1,
  661. list: [],
  662. total: 0,
  663. listLoading: true,
  664. isChart: true,
  665. isTable: false,
  666. table: {
  667. tableKey: 1,
  668. list: [],
  669. total: 0,
  670. listLoading: false
  671. }
  672. },
  673. // 混料准确率统计
  674. chart6: {
  675. chartLine: null,
  676. chartLine_data: {},
  677. getdataListParm: {
  678. name: 'getJT1AccuracyAllQX',
  679. page: 1,
  680. offset: 1,
  681. pagecount: '',
  682. returntype: 'Map',
  683. parammaps: {
  684. pastureid: Cookies.get('pastureid'),
  685. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  686. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  687. inputDatetime: [new Date(), new Date()]
  688. }
  689. },
  690. tableKey: 1,
  691. list: [],
  692. total: 0,
  693. listLoading: true,
  694. statisticsList: [],
  695. chart4Data3: [],
  696. isChart: true,
  697. isTable: false,
  698. table: {
  699. tableKey: 1,
  700. list: [],
  701. total: 0,
  702. listLoading: false
  703. }
  704. },
  705. pasture: {
  706. dialogFormVisible: false,
  707. dialogStatus: '',
  708. radio: '1',
  709. isFormulaName: true, // 配方名称
  710. isHouseName: false, // 栏舍名称
  711. isLivestockType: false, // 牲畜类别
  712. isTrainNumber: false, // 车次
  713. checked: false, // 按日期统计
  714. table: {
  715. getdataListParm: {
  716. name: 'getAccuracyHFT',
  717. page: 1,
  718. offset: 1,
  719. pagecount: '',
  720. returntype: 'Map',
  721. parammaps: {
  722. pastureid: '',
  723. startTime: '',
  724. stopTime: '',
  725. fname: '',
  726. sort: '',
  727. times: ''
  728. }
  729. },
  730. tableKey: 1,
  731. list: [],
  732. total: 0,
  733. listLoading: true,
  734. temp: {}
  735. },
  736. table2: {
  737. getdataListParm: {
  738. name: 'getAccuracySFT',
  739. page: 1,
  740. offset: 1,
  741. pagecount: '',
  742. returntype: 'Map',
  743. parammaps: {
  744. pastureid: '',
  745. startTime: '',
  746. stopTime: '',
  747. fname: '',
  748. sort: '',
  749. times: ''
  750. }
  751. },
  752. tableKey: 2,
  753. list: [],
  754. total: 0,
  755. listLoading: true,
  756. temp: {}
  757. }
  758. },
  759. textMap: {
  760. pasture: '牧场'
  761. },
  762. rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
  763. cellStyle: { padding: 0 + 'px' }
  764. }
  765. },
  766. created() {
  767. this.getTimeFn()
  768. this.getList()
  769. this.getList2()
  770. this.getChart1()
  771. this.getChart2()
  772. this.getChart3()
  773. this.getChart4()
  774. this.getChart5()
  775. this.getChart6()
  776. },
  777. methods: {
  778. getTimeFn() {
  779. const that = this
  780. const start = new Date()
  781. const end = new Date()
  782. const start2 = new Date()
  783. const end2 = new Date()
  784. start2.setTime(start2.getTime() - 3600 * 1000 * 24 * 1)
  785. end2.setTime(end2.getTime() - 3600 * 1000 * 24 * 1)
  786. that.table.getdataListParm.parammaps.inputDatetime = [start2, end2]
  787. that.table.getdataListParm.parammaps.startTime = parseTime(start2, '{y}-{m}-{d}')
  788. that.table.getdataListParm.parammaps.stopTime = parseTime(end2, '{y}-{m}-{d}')
  789. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
  790. that.chartDate[0] = parseTime(start, '{y}-{m}-{d}')
  791. that.chartDate[1] = parseTime(end, '{y}-{m}-{d}')
  792. that.chart1.getdataListParm.parammaps.inputDatetime = [start, end]
  793. that.chart1.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  794. that.chart1.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  795. that.chart2.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  796. that.chart2.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  797. that.chart2.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  798. that.chart2.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  799. that.chart3.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  800. that.chart3.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  801. that.chart3.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  802. that.chart3.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  803. that.chart4.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  804. that.chart4.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  805. that.chart4.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  806. that.chart4.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  807. that.chart5.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  808. that.chart5.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  809. that.chart5.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  810. that.chart5.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  811. },
  812. getList() {
  813. this.table.listLoading = true
  814. GetDataByName(this.table.getdataListParm).then(response => {
  815. console.log('汇总统计/混料table数据', response.data.list)
  816. if (response.data.list !== null) {
  817. this.table.list = response.data.list
  818. } else {
  819. this.table.list = []
  820. }
  821. setTimeout(() => {
  822. this.table.listLoading = false
  823. }, 100)
  824. })
  825. },
  826. // 汇总统计/撒料
  827. getList2() {
  828. this.table2.listLoading = true
  829. GetDataByName(this.table2.getdataListParm).then(response => {
  830. console.log('汇总统计/撒料table数据', response.data.list)
  831. if (response.data.list !== null) {
  832. this.table2.list = response.data.list
  833. } else {
  834. this.table2.list = []
  835. }
  836. setTimeout(() => {
  837. this.table2.listLoading = false
  838. }, 100)
  839. })
  840. },
  841. changeDate() {
  842. console.log(this.$refs.inputDatetime.value)
  843. const startTime = this.$refs.inputDatetime.value[0]
  844. const stopTime = this.$refs.inputDatetime.value[1]
  845. this.table.getdataListParm.parammaps.startTime = parseTime(startTime, '{y}-{m}-{d}')
  846. this.table.getdataListParm.parammaps.stopTime = parseTime(stopTime, '{y}-{m}-{d}')
  847. this.table2.getdataListParm.parammaps.startTime = parseTime(startTime, '{y}-{m}-{d}')
  848. this.table2.getdataListParm.parammaps.stopTime = parseTime(stopTime, '{y}-{m}-{d}')
  849. this.getList()
  850. this.getList2()
  851. },
  852. handleBefore() {
  853. if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
  854. var start = new Date(this.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
  855. var stop = new Date(this.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
  856. if (stop > Date.now() - 8.64e7) {
  857. this.Nextdisabled = true
  858. this.Beforedisabled = false
  859. } else {
  860. this.Nextdisabled = false
  861. this.Beforedisabled = false
  862. }
  863. this.table.getdataListParm.parammaps.inputDatetime.length = 0
  864. this.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
  865. this.$forceUpdate()
  866. }
  867. this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  868. this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  869. this.getList()
  870. },
  871. handleNext() {
  872. if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
  873. var start2 = new Date(this.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1))
  874. var stop2 = new Date(this.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1))
  875. if (stop2 > Date.now() - 8.64e7) {
  876. this.Nextdisabled = true
  877. this.Beforedisabled = false
  878. } else {
  879. this.Nextdisabled = false
  880. this.Beforedisabled = false
  881. }
  882. this.table.getdataListParm.parammaps.inputDatetime.length = 0
  883. this.table.getdataListParm.parammaps.inputDatetime.push(start2, stop2)
  884. this.$forceUpdate()
  885. }
  886. this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  887. this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  888. this.getList()
  889. },
  890. tableCellStyle({ row, column, rowIndex, columnIndex }) {
  891. if (columnIndex === 0 && row.pastureid !== '-1') {
  892. return {
  893. textDecoration: 'underline'
  894. }
  895. }
  896. return {
  897. textDecoration: 'none'
  898. }
  899. },
  900. clickPasture(row) {
  901. console.log(row)
  902. if (row.pastureid !== '-1') {
  903. this.pasture.dialogStatus = 'pasture'
  904. this.pasture.dialogFormVisible = true
  905. this.pasture.table.getdataListParm.parammaps.pastureid = row.pastureid
  906. this.pasture.table2.getdataListParm.parammaps.pastureid = row.pastureid
  907. this.getTabList()
  908. this.getTabList2()
  909. }
  910. },
  911. // 切换统计类型
  912. changeRadio() {
  913. console.log(this.pasture.radio)
  914. this.pasture.table.getdataListParm.parammaps.sort = ''
  915. this.pasture.table.getdataListParm.parammaps.times = ''
  916. this.pasture.table.getdataListParm.parammaps.fname = ''
  917. if (this.pasture.radio == '1') {
  918. console.log('配方名称')
  919. this.pasture.isFormulaName = true
  920. this.pasture.isHouseName = false
  921. this.pasture.isLivestockType = false
  922. this.pasture.isTrainNumber = false
  923. this.pasture.table.getdataListParm.name = 'getAccuracyHFT'
  924. this.pasture.table.getdataListParm.parammaps.startTime = this.table.getdataListParm.parammaps.startTime
  925. this.pasture.table.getdataListParm.parammaps.stopTime = this.table.getdataListParm.parammaps.stopTime
  926. this.pasture.table.getdataListParm.offset = 1
  927. this.getTabList()
  928. this.pasture.table2.getdataListParm.name = 'getAccuracySFT'
  929. this.pasture.table2.getdataListParm.parammaps.startTime = this.table.getdataListParm.parammaps.startTime
  930. this.pasture.table2.getdataListParm.parammaps.stopTime = this.table.getdataListParm.parammaps.stopTime
  931. this.pasture.table2.getdataListParm.offset = 1
  932. this.getTabList2()
  933. } else if (this.pasture.radio == '2') {
  934. console.log('栏舍名称')
  935. this.pasture.isFormulaName = false
  936. this.pasture.isHouseName = true
  937. this.pasture.isLivestockType = false
  938. this.pasture.isTrainNumber = false
  939. this.pasture.table.getdataListParm.name = 'getAccuracyHNS'
  940. this.pasture.table.getdataListParm.parammaps.startTime = this.table.getdataListParm.parammaps.startTime
  941. this.pasture.table.getdataListParm.parammaps.stopTime = this.table.getdataListParm.parammaps.stopTime
  942. this.pasture.table.getdataListParm.offset = 1
  943. this.getTabList()
  944. this.pasture.table2.getdataListParm.name = 'getAccuracySNS'
  945. this.pasture.table2.getdataListParm.parammaps.startTime = this.table.getdataListParm.parammaps.startTime
  946. this.pasture.table2.getdataListParm.parammaps.stopTime = this.table.getdataListParm.parammaps.stopTime
  947. this.pasture.table2.getdataListParm.offset = 1
  948. this.getTabList2()
  949. } else if (this.pasture.radio == '3') {
  950. console.log(' 牲畜类别')
  951. this.pasture.isFormulaName = false
  952. this.pasture.isHouseName = false
  953. this.pasture.isLivestockType = true
  954. this.pasture.isTrainNumber = false
  955. this.pasture.table.getdataListParm.name = 'getAccuracyHSC'
  956. this.pasture.table.getdataListParm.parammaps.startTime = this.table.getdataListParm.parammaps.startTime
  957. this.pasture.table.getdataListParm.parammaps.stopTime = this.table.getdataListParm.parammaps.stopTime
  958. this.pasture.table.getdataListParm.offset = 1
  959. this.getTabList()
  960. this.pasture.table2.getdataListParm.name = 'getAccuracySSC'
  961. this.pasture.table2.getdataListParm.parammaps.startTime = this.table.getdataListParm.parammaps.startTime
  962. this.pasture.table2.getdataListParm.parammaps.stopTime = this.table.getdataListParm.parammaps.stopTime
  963. this.pasture.table2.getdataListParm.offset = 1
  964. this.getTabList2()
  965. } else if (this.pasture.radio == '4') {
  966. console.log('车次')
  967. this.pasture.isFormulaName = false
  968. this.pasture.isHouseName = false
  969. this.pasture.isLivestockType = false
  970. this.pasture.isTrainNumber = true
  971. this.pasture.table.getdataListParm.name = 'getAccuracyHCC'
  972. this.pasture.table.getdataListParm.parammaps.startTime = this.table.getdataListParm.parammaps.startTime
  973. this.pasture.table.getdataListParm.parammaps.stopTime = this.table.getdataListParm.parammaps.stopTime
  974. this.pasture.table.getdataListParm.offset = 1
  975. this.getTabList()
  976. this.pasture.table2.getdataListParm.name = 'getAccuracySCC'
  977. this.pasture.table2.getdataListParm.parammaps.startTime = this.table.getdataListParm.parammaps.startTime
  978. this.pasture.table2.getdataListParm.parammaps.stopTime = this.table.getdataListParm.parammaps.stopTime
  979. this.pasture.table2.getdataListParm.offset = 1
  980. this.getTabList2()
  981. }
  982. },
  983. changeChecked() {
  984. if (this.pasture.radio == '1') {
  985. console.log('配方名称')
  986. this.pasture.isFormulaName = true
  987. this.pasture.isHouseName = false
  988. this.pasture.isLivestockType = false
  989. this.pasture.isTrainNumber = false
  990. this.pasture.table.getdataListParm.name = 'getAccuracyHFT'
  991. this.pasture.table.getdataListParm.parammaps.startTime = this.table.getdataListParm.parammaps.startTime
  992. this.pasture.table.getdataListParm.parammaps.stopTime = this.table.getdataListParm.parammaps.stopTime
  993. this.pasture.table.getdataListParm.offset = 1
  994. this.getTabList()
  995. this.pasture.table2.getdataListParm.name = 'getAccuracySFT'
  996. this.pasture.table2.getdataListParm.parammaps.startTime = this.table.getdataListParm.parammaps.startTime
  997. this.pasture.table2.getdataListParm.parammaps.stopTime = this.table.getdataListParm.parammaps.stopTime
  998. this.pasture.table2.getdataListParm.offset = 1
  999. this.getTabList2()
  1000. } else if (this.pasture.radio == '2') {
  1001. console.log('栏舍名称')
  1002. this.pasture.isFormulaName = false
  1003. this.pasture.isHouseName = true
  1004. this.pasture.isLivestockType = false
  1005. this.pasture.isTrainNumber = false
  1006. this.pasture.table.getdataListParm.name = 'getAccuracyHNS'
  1007. this.pasture.table.getdataListParm.parammaps.startTime = this.table.getdataListParm.parammaps.startTime
  1008. this.pasture.table.getdataListParm.parammaps.stopTime = this.table.getdataListParm.parammaps.stopTime
  1009. this.pasture.table.getdataListParm.offset = 1
  1010. this.getTabList()
  1011. this.pasture.table2.getdataListParm.name = 'getAccuracySNS'
  1012. this.pasture.table2.getdataListParm.parammaps.startTime = this.table.getdataListParm.parammaps.startTime
  1013. this.pasture.table2.getdataListParm.parammaps.stopTime = this.table.getdataListParm.parammaps.stopTime
  1014. this.pasture.table2.getdataListParm.offset = 1
  1015. this.getTabList2()
  1016. } else if (this.pasture.radio == '3') {
  1017. console.log(' 牲畜类别')
  1018. this.pasture.isFormulaName = false
  1019. this.pasture.isHouseName = false
  1020. this.pasture.isLivestockType = true
  1021. this.pasture.isTrainNumber = false
  1022. this.pasture.table.getdataListParm.name = 'getAccuracyHSC'
  1023. this.pasture.table.getdataListParm.parammaps.startTime = this.table.getdataListParm.parammaps.startTime
  1024. this.pasture.table.getdataListParm.parammaps.stopTime = this.table.getdataListParm.parammaps.stopTime
  1025. this.pasture.table.getdataListParm.offset = 1
  1026. this.getTabList()
  1027. this.pasture.table2.getdataListParm.name = 'getAccuracySSC'
  1028. this.pasture.table2.getdataListParm.parammaps.startTime = this.table.getdataListParm.parammaps.startTime
  1029. this.pasture.table2.getdataListParm.parammaps.stopTime = this.table.getdataListParm.parammaps.stopTime
  1030. this.pasture.table2.getdataListParm.offset = 1
  1031. this.getTabList2()
  1032. } else if (this.pasture.radio == '4') {
  1033. console.log('车次')
  1034. this.pasture.isFormulaName = false
  1035. this.pasture.isHouseName = false
  1036. this.pasture.isLivestockType = false
  1037. this.pasture.isTrainNumber = true
  1038. this.pasture.table.getdataListParm.name = 'getAccuracyHCC'
  1039. this.pasture.table.getdataListParm.parammaps.startTime = this.table.getdataListParm.parammaps.startTime
  1040. this.pasture.table.getdataListParm.parammaps.stopTime = this.table.getdataListParm.parammaps.stopTime
  1041. this.pasture.table.getdataListParm.offset = 1
  1042. this.getTabList()
  1043. this.pasture.table2.getdataListParm.name = 'getAccuracySCC'
  1044. this.pasture.table2.getdataListParm.parammaps.startTime = this.table.getdataListParm.parammaps.startTime
  1045. this.pasture.table2.getdataListParm.parammaps.stopTime = this.table.getdataListParm.parammaps.stopTime
  1046. this.pasture.table2.getdataListParm.offset = 1
  1047. this.getTabList2()
  1048. }
  1049. },
  1050. handleSearch() {
  1051. if (this.pasture.radio == '1') {
  1052. console.log('配方名称/查询')
  1053. this.pasture.isFormulaName = true
  1054. this.pasture.isHouseName = false
  1055. this.pasture.isLivestockType = false
  1056. this.pasture.isTrainNumber = false
  1057. this.pasture.table.getdataListParm.name = 'getAccuracyHFT'
  1058. this.getTabList()
  1059. this.pasture.table2.getdataListParm.name = 'getAccuracySFT'
  1060. this.getTabList2()
  1061. } else if (this.pasture.radio == '2') {
  1062. console.log('栏舍名称/查询')
  1063. this.pasture.isFormulaName = false
  1064. this.pasture.isHouseName = true
  1065. this.pasture.isLivestockType = false
  1066. this.pasture.isTrainNumber = false
  1067. this.pasture.table.getdataListParm.name = 'getAccuracyHNS'
  1068. this.getTabList()
  1069. this.pasture.table2.getdataListParm.name = 'getAccuracySNS'
  1070. this.getTabList2()
  1071. } else if (this.pasture.radio == '3') {
  1072. console.log(' 牲畜类别/查询')
  1073. this.pasture.isFormulaName = false
  1074. this.pasture.isHouseName = false
  1075. this.pasture.isLivestockType = true
  1076. this.pasture.isTrainNumber = false
  1077. this.pasture.table.getdataListParm.name = 'getAccuracyHSC'
  1078. this.getTabList()
  1079. this.pasture.table2.getdataListParm.name = 'getAccuracySSC'
  1080. this.getTabList2()
  1081. } else if (this.pasture.radio == '4') {
  1082. console.log('车次/查询')
  1083. this.pasture.isFormulaName = false
  1084. this.pasture.isHouseName = false
  1085. this.pasture.isLivestockType = false
  1086. this.pasture.isTrainNumber = true
  1087. this.pasture.table.getdataListParm.name = 'getAccuracyHCC'
  1088. this.getTabList()
  1089. this.pasture.table2.getdataListParm.name = 'getAccuracySCC'
  1090. this.getTabList2()
  1091. }
  1092. },
  1093. // 汇总统计/混料
  1094. getTabList() {
  1095. this.pasture.table.listLoading = true
  1096. this.pasture.table.getdataListParm.parammaps.startTime = this.table.getdataListParm.parammaps.startTime
  1097. this.pasture.table.getdataListParm.parammaps.stopTime = this.table.getdataListParm.parammaps.stopTime
  1098. GetDataByName(this.pasture.table.getdataListParm).then(response => {
  1099. console.log('汇总统计/混料table数据', response.data.list)
  1100. if (response.data.list !== null) {
  1101. this.pasture.table.list = response.data.list
  1102. } else {
  1103. this.pasture.table.list = []
  1104. }
  1105. setTimeout(() => {
  1106. this.pasture.table.listLoading = false
  1107. }, 100)
  1108. })
  1109. },
  1110. // 汇总统计/撒料
  1111. getTabList2() {
  1112. this.pasture.table2.listLoading = true
  1113. this.pasture.table2.getdataListParm.parammaps.startTime = this.table.getdataListParm.parammaps.startTime
  1114. this.pasture.table2.getdataListParm.parammaps.stopTime = this.table.getdataListParm.parammaps.stopTime
  1115. GetDataByName(this.pasture.table2.getdataListParm).then(response => {
  1116. console.log('汇总统计/撒料table数据', response.data.list)
  1117. if (response.data.list !== null) {
  1118. this.pasture.table2.list = response.data.list
  1119. } else {
  1120. this.pasture.table2.list = []
  1121. }
  1122. setTimeout(() => {
  1123. this.pasture.table2.listLoading = false
  1124. }, 100)
  1125. })
  1126. },
  1127. // 快速跳转到图表
  1128. handleQuickJumpChart() {
  1129. var myHeight = document.getElementById('table').offsetHeight + 120
  1130. window.scrollTo(myHeight, myHeight)
  1131. },
  1132. // 快速回到顶部
  1133. handleQuickJumpTop() {
  1134. window.scrollTo(0, 0)
  1135. },
  1136. // 表总查询
  1137. handleChartDate() {
  1138. console.log('点击了确认时间')
  1139. MessageBox.confirm('是否调整以下所有图表查询时间?', {
  1140. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  1141. }).then(() => {
  1142. var that = this
  1143. var startTime = parseTime(this.chartDate[0], '{y}-{m}-{d}')
  1144. var stopTime = parseTime(this.chartDate[1], '{y}-{m}-{d}')
  1145. that.chart1.getdataListParm.parammaps.inputDatetime = this.chartDate
  1146. that.chart1.getdataListParm.parammaps.startTime = startTime
  1147. that.chart1.getdataListParm.parammaps.stopTime = stopTime
  1148. that.getChart1()
  1149. that.chart2.getdataListParm.parammaps.inputDatetime = this.chartDate
  1150. that.chart2.getdataListParm.parammaps.startTime = startTime
  1151. that.chart2.getdataListParm.parammaps.stopTime = stopTime
  1152. that.getChart2()
  1153. that.chart3.getdataListParm.parammaps.inputDatetime = this.chartDate
  1154. that.chart3.getdataListParm.parammaps.startTime = startTime
  1155. that.chart3.getdataListParm.parammaps.stopTime = stopTime
  1156. that.getChart3()
  1157. that.chart4.getdataListParm.parammaps.inputDatetime = this.chartDate
  1158. that.chart4.getdataListParm.parammaps.startTime = startTime
  1159. that.chart4.getdataListParm.parammaps.stopTime = stopTime
  1160. that.getChart4()
  1161. that.chart5.getdataListParm.parammaps.inputDatetime = this.chartDate
  1162. that.chart5.getdataListParm.parammaps.startTime = startTime
  1163. that.chart5.getdataListParm.parammaps.stopTime = stopTime
  1164. that.getChart5()
  1165. that.chart6.getdataListParm.parammaps.inputDatetime = this.chartDate
  1166. that.chart6.getdataListParm.parammaps.startTime = startTime
  1167. that.chart6.getdataListParm.parammaps.stopTime = stopTime
  1168. that.getChart6()
  1169. })
  1170. },
  1171. // 计划统计
  1172. getChart1() {
  1173. this.chart1.listLoading = true
  1174. GetReportform(this.chart1.getdataListParm).then(response => {
  1175. if (response.data.list !== null) {
  1176. this.chart1.table.list = response.data.data
  1177. this.chart1.chartLine_data = response.data.list
  1178. // this.chart1.chartLine_data = {
  1179. // 'data1': ['1牧', '2牧', '3牧', '4牧', '5牧', '6牧', '7牧', '8牧', '9牧', '10牧', '11牧', '12牧'], // x轴
  1180. // 'data2': [2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3], // 计划准确率
  1181. // 'data3': [2.6, 5.9, 9.0, 30, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3], // 计划正确率
  1182. // 'data4': [2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3]// 计划准确率(去除取消重量)
  1183. // }
  1184. this.chart1.total = response.data.total
  1185. console.log('计划统计图数据', this.chart1.chartLine_data)
  1186. console.log('计划统计表数据', this.chart1.table.list)
  1187. this.roadChartLine1(this.chart1.chartLine_data)
  1188. } else {
  1189. this.chart1.list = []
  1190. }
  1191. setTimeout(() => {
  1192. this.chart1.listLoading = false
  1193. }, 100)
  1194. })
  1195. },
  1196. roadChartLine1(chartLine_data) {
  1197. if (this.chart1.chartLine != null) {
  1198. this.chart1.chartLine.dispose()
  1199. }
  1200. this.chart1.chartLine = echarts.init(document.getElementById('chartLine1'))
  1201. var option = {
  1202. tooltip: {
  1203. trigger: 'axis',
  1204. axisPointer: {
  1205. type: 'cross',
  1206. crossStyle: {
  1207. color: '#999'
  1208. }
  1209. }
  1210. },
  1211. legend: {
  1212. data: ['计划准确率', '计划正确率', '计划准确率(去除取消重量)']
  1213. },
  1214. xAxis: [{ type: 'category', data: chartLine_data.data1, axisPointer: { type: 'shadow' }}],
  1215. yAxis: [{ type: 'value', name: '百分比', min: 0, max: 100, interval: 20, axisLabel: { formatter: '{value}' }}],
  1216. series: [{ name: '计划准确率', type: 'bar', itemStyle: { normal: { color: '#7ecf51' }},
  1217. data: chartLine_data.data2,
  1218. markLine: {
  1219. data: [{ type: 'average' }],
  1220. symbol: ['none', 'none'],
  1221. position: 'insideTopCenter',
  1222. itemStyle: {
  1223. normal: {
  1224. lineStyle: { type: 'dotted', width: 3 },
  1225. label: { show: true, position: 'middle', formatter: '' }
  1226. }
  1227. },
  1228. large: true,
  1229. effect: { show: false, loop: true, period: 0, scaleSize: 2, color: null, shadowColor: null, shadowBlur: null }
  1230. }
  1231. },
  1232. {
  1233. name: '计划正确率',
  1234. type: 'bar',
  1235. itemStyle: {
  1236. normal: {
  1237. color: '#ff6600'
  1238. }
  1239. },
  1240. data: chartLine_data.data3,
  1241. markLine: {
  1242. data: [{ type: 'average' }],
  1243. symbol: ['none', 'none'],
  1244. position: 'insideTopCenter',
  1245. itemStyle: {
  1246. normal: {
  1247. lineStyle: { type: 'dotted', width: 3 },
  1248. label: { show: true, position: 'middle', formatter: '' }
  1249. }
  1250. },
  1251. large: true,
  1252. effect: { show: false, loop: true, period: 0, scaleSize: 2, color: null, shadowColor: null, shadowBlur: null }
  1253. }
  1254. },
  1255. {
  1256. name: '计划准确率(去除取消重量)',
  1257. type: 'bar',
  1258. itemStyle: {
  1259. normal: {
  1260. color: '#61a5e8'
  1261. }
  1262. },
  1263. data: chartLine_data.data4,
  1264. markLine: {
  1265. data: [{ type: 'average' }],
  1266. symbol: ['none', 'none'],
  1267. position: 'insideTopCenter',
  1268. itemStyle: {
  1269. normal: {
  1270. lineStyle: { type: 'dotted', width: 3 },
  1271. label: { show: true, position: 'middle', formatter: '' }
  1272. }
  1273. },
  1274. large: true,
  1275. effect: { show: false, loop: true, period: 0, scaleSize: 2, color: null, shadowColor: null, shadowBlur: null }
  1276. }
  1277. }
  1278. ]
  1279. }
  1280. this.chart1.chartLine.setOption(option)
  1281. window.onresize = function() {
  1282. this.chart1.chartLine.resize()
  1283. }
  1284. },
  1285. // 牛群准确率
  1286. getChart2() {
  1287. this.chart2.listLoading = true
  1288. GetReportform(this.chart2.getdataListParm).then(response => {
  1289. console.log('牛群准确率图数据', this.chart2.chartLine_data)
  1290. if (response.data.list !== null) {
  1291. // for (let i = 0; i < response.data.data.length; i++) {
  1292. // response.data.data[i].准确率 = response.data.data[i].准确率 + '%'
  1293. // }
  1294. this.chart2.table.list = response.data.data
  1295. this.chart2.chartLine_data = response.data.list
  1296. this.chart2.total = response.data.total
  1297. this.chart2.chart3Data3 = response.data.list.data3
  1298. this.chart2.total = response.data.total
  1299. console.log('牛群准确率图数据', this.chart2.chartLine_data)
  1300. console.log('牛群准确率表数据', this.chart2.table.list)
  1301. // this.chart2.chartLine_data = {
  1302. // 'data1': ['1牧', '2牧', '3牧', '4牧', '5牧', '6牧', '7牧', '8牧', '9牧', '10牧', '11牧', '12牧'], // x轴
  1303. // 'data2': [2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3], // 泌乳牛
  1304. // 'data3': [2.6, 5.9, 9.0, 30, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3], // 后备牛
  1305. // 'data4': [2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3], // 干奶牛
  1306. // 'data5': [2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3]// 围产牛
  1307. // }
  1308. this.roadChartLine2(this.chart2.chartLine_data)
  1309. } else {
  1310. this.chart2.list = []
  1311. }
  1312. setTimeout(() => {
  1313. this.chart2.listLoading = false
  1314. }, 100)
  1315. })
  1316. },
  1317. roadChartLine2(chartLine_data) {
  1318. if (this.chart2.chartLine != null) {
  1319. this.chart2.chartLine.dispose()
  1320. }
  1321. this.chart2.chartLine = echarts.init(document.getElementById('chartLine2'))
  1322. var option = {
  1323. tooltip: {
  1324. trigger: 'axis',
  1325. axisPointer: {
  1326. type: 'cross',
  1327. crossStyle: {
  1328. color: '#999'
  1329. }
  1330. }
  1331. },
  1332. legend: {
  1333. data: ['泌乳牛', '后备牛', '干奶牛', '围产牛']
  1334. },
  1335. xAxis: [{ type: 'category', data: chartLine_data.data1, axisPointer: { type: 'shadow' }}],
  1336. yAxis: [{ type: 'value', name: '准确率', min: 0, max: 100, interval: 20, axisLabel: { formatter: '{value}%' }}],
  1337. series: [{ name: '泌乳牛', type: 'bar', itemStyle: { normal: { color: '#7ecf51' }},
  1338. data: chartLine_data.data2,
  1339. markLine: {
  1340. data: [{ type: 'average' }],
  1341. symbol: ['none', 'none'],
  1342. position: 'insideTopCenter',
  1343. itemStyle: {
  1344. normal: {
  1345. lineStyle: { type: 'dotted', width: 3 },
  1346. label: { show: true, position: 'middle', formatter: '' }
  1347. }
  1348. },
  1349. large: true,
  1350. effect: { show: false, loop: true, period: 0, scaleSize: 2, color: null, shadowColor: null, shadowBlur: null }
  1351. }
  1352. },
  1353. {
  1354. name: '后备牛',
  1355. type: 'bar',
  1356. itemStyle: {
  1357. normal: {
  1358. color: '#ff6600'
  1359. }
  1360. },
  1361. data: chartLine_data.data3,
  1362. markLine: {
  1363. data: [{ type: 'average' }],
  1364. symbol: ['none', 'none'],
  1365. position: 'insideTopCenter',
  1366. itemStyle: {
  1367. normal: {
  1368. lineStyle: { type: 'dotted', width: 3 },
  1369. label: { show: true, position: 'middle', formatter: '' }
  1370. }
  1371. },
  1372. large: true,
  1373. effect: { show: false, loop: true, period: 0, scaleSize: 2, color: null, shadowColor: null, shadowBlur: null }
  1374. }
  1375. },
  1376. {
  1377. name: '干奶牛',
  1378. type: 'bar',
  1379. itemStyle: {
  1380. normal: {
  1381. color: '#61a5e8'
  1382. }
  1383. },
  1384. data: chartLine_data.data4,
  1385. markLine: {
  1386. data: [{ type: 'average' }],
  1387. symbol: ['none', 'none'],
  1388. position: 'insideTopCenter',
  1389. itemStyle: {
  1390. normal: {
  1391. lineStyle: { type: 'dotted', width: 3 },
  1392. label: { show: true, position: 'middle', formatter: '' }
  1393. }
  1394. },
  1395. large: true,
  1396. effect: { show: false, loop: true, period: 0, scaleSize: 2, color: null, shadowColor: null, shadowBlur: null }
  1397. }
  1398. },
  1399. {
  1400. name: '围产牛',
  1401. type: 'bar',
  1402. itemStyle: {
  1403. normal: {
  1404. color: '#ffff00'
  1405. }
  1406. },
  1407. data: chartLine_data.data5,
  1408. markLine: {
  1409. data: [{ type: 'average' }],
  1410. symbol: ['none', 'none'],
  1411. position: 'insideTopCenter',
  1412. itemStyle: {
  1413. normal: {
  1414. lineStyle: { type: 'dotted', width: 3 },
  1415. label: { show: true, position: 'middle', formatter: '' }
  1416. }
  1417. },
  1418. large: true,
  1419. effect: { show: false, loop: true, period: 0, scaleSize: 2, color: null, shadowColor: null, shadowBlur: null }
  1420. }
  1421. }
  1422. ]
  1423. }
  1424. this.chart2.chartLine.setOption(option)
  1425. window.onresize = function() {
  1426. this.chart2.chartLine.resize()
  1427. }
  1428. },
  1429. // 混料次数统计
  1430. getChart3() {
  1431. this.chart3.listLoading = true
  1432. GetReportform(this.chart3.getdataListParm).then(response => {
  1433. if (response.data.list !== null) {
  1434. // for (let i = 0; i < response.data.data.length; i++) {
  1435. // response.data.data[i].准确率 = response.data.data[i].准确率 + '%'
  1436. // }
  1437. this.chart3.table.list = response.data.data
  1438. this.chart3.chartLine_data = response.data.list
  1439. // this.chart3.chartLine_data = {
  1440. // 'data1': ['1牧', '2牧', '3牧', '4牧', '5牧', '6牧', '7牧', '8牧', '9牧', '10牧', '11牧', '12牧'], // x轴
  1441. // 'data2': [2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3], // 自动跳转
  1442. // 'data3': [2.6, 5.9, 9.0, 30, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3] // 手动跳转
  1443. // }
  1444. this.chart3.total = response.data.total
  1445. this.chart3.total = response.data.total
  1446. console.log('混料次数统计图', this.chart3.chartLine_data)
  1447. console.log('混料次数统计表', this.chart3.table.list)
  1448. this.roadChartLine3(this.chart3.chartLine_data)
  1449. } else {
  1450. this.chart3.list = []
  1451. }
  1452. setTimeout(() => {
  1453. this.chart3.listLoading = false
  1454. }, 100)
  1455. })
  1456. },
  1457. roadChartLine3(chartLine_data) {
  1458. if (this.chart3.chartLine != null) {
  1459. this.chart3.chartLine.dispose()
  1460. }
  1461. this.chart3.chartLine = echarts.init(document.getElementById('chartLine3'))
  1462. var option = {
  1463. tooltip: {
  1464. trigger: 'axis',
  1465. axisPointer: {
  1466. type: 'cross',
  1467. crossStyle: {
  1468. color: '#999'
  1469. }
  1470. }
  1471. },
  1472. legend: {
  1473. data: ['自动跳转', '手动跳转', '取消次数']
  1474. },
  1475. xAxis: [{ type: 'category', data: chartLine_data.data1, axisPointer: { type: 'shadow' }}],
  1476. yAxis: [{ type: 'value', name: '次数', min: 0, max: 100, interval: 20, axisLabel: { formatter: '{value}' }}],
  1477. series: [{ name: '自动跳转', type: 'bar', itemStyle: { normal: { color: '#7ecf51' }},
  1478. data: chartLine_data.data2,
  1479. markLine: {
  1480. data: [{ type: 'average' }],
  1481. symbol: ['none', 'none'],
  1482. position: 'insideTopCenter',
  1483. itemStyle: {
  1484. normal: {
  1485. lineStyle: { type: 'dotted', width: 3 },
  1486. label: { show: true, position: 'middle', formatter: '' }
  1487. }
  1488. },
  1489. large: true,
  1490. effect: { show: false, loop: true, period: 0, scaleSize: 2, color: null, shadowColor: null, shadowBlur: null }
  1491. }
  1492. },
  1493. {
  1494. name: '手动跳转',
  1495. type: 'bar',
  1496. itemStyle: {
  1497. normal: {
  1498. color: '#ff6600'
  1499. }
  1500. },
  1501. data: chartLine_data.data3,
  1502. markLine: {
  1503. data: [{ type: 'average' }],
  1504. symbol: ['none', 'none'],
  1505. position: 'insideTopCenter',
  1506. itemStyle: {
  1507. normal: {
  1508. lineStyle: { type: 'dotted', width: 3 },
  1509. label: { show: true, position: 'middle', formatter: '' }
  1510. }
  1511. },
  1512. large: true,
  1513. effect: { show: false, loop: true, period: 0, scaleSize: 2, color: null, shadowColor: null, shadowBlur: null }
  1514. }
  1515. }]
  1516. }
  1517. this.chart3.chartLine.setOption(option)
  1518. window.onresize = function() {
  1519. this.chart3.chartLine.resize()
  1520. }
  1521. },
  1522. // 混料准确率统计
  1523. getChart4() {
  1524. this.chart4.listLoading = true
  1525. GetReportform(this.chart4.getdataListParm).then(response => {
  1526. if (response.data.list !== null) {
  1527. // for (let i = 0; i < response.data.data.length; i++) {
  1528. // response.data.data[i].准确率 = response.data.data[i].准确率 + '%'
  1529. // }
  1530. this.chart4.table.list = response.data.data
  1531. this.chart4.chartLine_data = response.data.list
  1532. // this.chart4.chartLine_data = {
  1533. // 'data1': ['1牧', '2牧', '3牧', '4牧', '5牧', '6牧', '7牧', '8牧', '9牧', '10牧', '11牧', '12牧'], // x轴
  1534. // 'data2': [2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3], // 自动跳转准确率
  1535. // 'data3': [2.6, 5.9, 9.0, 30, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3] // 手动跳转准确率
  1536. // }
  1537. this.chart4.total = response.data.total
  1538. this.chart4.total = response.data.total
  1539. console.log('混料准确率统计图', this.chart4.chartLine_data)
  1540. console.log('混料准确率统计表', this.chart4.table.list)
  1541. this.roadChartLine4(this.chart4.chartLine_data)
  1542. } else {
  1543. this.chart4.list = []
  1544. }
  1545. setTimeout(() => {
  1546. this.chart4.listLoading = false
  1547. }, 100)
  1548. })
  1549. },
  1550. roadChartLine4(chartLine_data) {
  1551. if (this.chart4.chartLine != null) {
  1552. this.chart4.chartLine.dispose()
  1553. }
  1554. this.chart4.chartLine = echarts.init(document.getElementById('chartLine4'))
  1555. var option = {
  1556. tooltip: {
  1557. trigger: 'axis',
  1558. axisPointer: {
  1559. type: 'cross',
  1560. crossStyle: {
  1561. color: '#999'
  1562. }
  1563. }
  1564. },
  1565. legend: {
  1566. data: ['自动跳转准确率', '手动跳转准确率']
  1567. },
  1568. xAxis: [{ type: 'category', data: chartLine_data.data1, axisPointer: { type: 'shadow' }}],
  1569. yAxis: [{ type: 'value', name: '混料准确率', min: 0, max: 100, interval: 20, axisLabel: { formatter: '{value}%' }}],
  1570. series: [{ name: '自动跳转准确率', type: 'bar', itemStyle: { normal: { color: '#7ecf51' }},
  1571. data: chartLine_data.data2,
  1572. markLine: {
  1573. data: [{ type: 'average' }],
  1574. symbol: ['none', 'none'],
  1575. position: 'insideTopCenter',
  1576. itemStyle: {
  1577. normal: {
  1578. lineStyle: { type: 'dotted', width: 3 },
  1579. label: { show: true, position: 'middle', formatter: '' }
  1580. }
  1581. },
  1582. large: true,
  1583. effect: { show: false, loop: true, period: 0, scaleSize: 2, color: null, shadowColor: null, shadowBlur: null }
  1584. }
  1585. },
  1586. {
  1587. name: '手动跳转准确率',
  1588. type: 'bar',
  1589. itemStyle: {
  1590. normal: {
  1591. color: '#ff6600'
  1592. }
  1593. },
  1594. data: chartLine_data.data3,
  1595. markLine: {
  1596. data: [{ type: 'average' }],
  1597. symbol: ['none', 'none'],
  1598. position: 'insideTopCenter',
  1599. itemStyle: {
  1600. normal: {
  1601. lineStyle: { type: 'dotted', width: 3 },
  1602. label: { show: true, position: 'middle', formatter: '' }
  1603. }
  1604. },
  1605. large: true,
  1606. effect: { show: false, loop: true, period: 0, scaleSize: 2, color: null, shadowColor: null, shadowBlur: null }
  1607. }
  1608. }]
  1609. }
  1610. this.chart4.chartLine.setOption(option)
  1611. window.onresize = function() {
  1612. this.chart4.chartLine.resize()
  1613. }
  1614. },
  1615. // 栏舍平均撒料时间统计
  1616. getChart5() {
  1617. this.chart5.listLoading = true
  1618. GetReportform(this.chart5.getdataListParm).then(response => {
  1619. if (response.data.list !== null) {
  1620. this.chart5.table.list = response.data.data
  1621. this.chart5.chartLine_data = response.data.list
  1622. // this.chart5.chartLine_data = {
  1623. // data1: ['1牧', '2牧', '3牧'], // 折线
  1624. // data2: ['12/01', '12/02', '12/03'], // X轴
  1625. // data3: [
  1626. // { data: [15.00, 12.08, 1.07, 1.02] },
  1627. // { data: [17.00, 8.05, 1.02, 1.08] },
  1628. // { data: [13.00, 22.05, 1.09, 1.04] }
  1629. // ]// 折线对应数据
  1630. // }
  1631. this.chart5.total = response.data.total
  1632. console.log('栏舍平均撒料时间统计图', this.chart5.chartLine_data)
  1633. console.log('栏舍平均撒料时间统计表', this.chart5.table.list)
  1634. this.roadChartLine5(this.chart5.chartLine_data)
  1635. } else {
  1636. this.chart5.list = []
  1637. }
  1638. setTimeout(() => {
  1639. this.chart5.listLoading = false
  1640. }, 100)
  1641. })
  1642. },
  1643. roadChartLine5(chartLine_data) {
  1644. if (this.chart5.chartLine != null) {
  1645. this.chart5.chartLine.dispose()
  1646. }
  1647. this.chart5.chartLine = echarts.init(document.getElementById('chartLine5'))
  1648. var option = {
  1649. title: {
  1650. text: ''
  1651. },
  1652. tooltip: {
  1653. trigger: 'axis',
  1654. formatter: function(params) {
  1655. // console.log(params)
  1656. var tip = params[0].name
  1657. for (let i = 0; i < params.length; i++) {
  1658. var b = []
  1659. // var str = params[i].value
  1660. for (let j = 0; j <= params[i].value.length; j++) {
  1661. if (params[i].value !== '') {
  1662. if (params[i].value.charAt(j) == '.') {
  1663. b[j] = params[i].value.replace('.', ':')
  1664. }
  1665. } else {
  1666. b[j] = ''
  1667. }
  1668. }
  1669. tip += '<br>' + params[i].seriesName + ': ' + b[b.length - 1]
  1670. }
  1671. return tip
  1672. }
  1673. },
  1674. legend: {
  1675. data: chartLine_data.data1,
  1676. right: 10
  1677. },
  1678. grid: {
  1679. top: '20%',
  1680. left: '5%',
  1681. right: '8%',
  1682. containLabel: true
  1683. },
  1684. toolbox: {
  1685. show: true,
  1686. right: '2%',
  1687. feature: {}
  1688. },
  1689. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },
  1690. yAxis: [{
  1691. type: '',
  1692. name: '时间',
  1693. mix: 0,
  1694. max: 24,
  1695. interval: 2,
  1696. axisLabel: {
  1697. formatter: function(value) {
  1698. var texts = []
  1699. if (value < 10) {
  1700. texts.push('0' + value + ':00')
  1701. } else {
  1702. texts.push(value + ':00')
  1703. }
  1704. return texts
  1705. }
  1706. }
  1707. }],
  1708. series: (function() {
  1709. var serie = []
  1710. for (var i = 0; i < chartLine_data.data3.length; i++) {
  1711. var item = {
  1712. name: chartLine_data.data1[i],
  1713. type: 'line',
  1714. data: chartLine_data.data3[i].data
  1715. }
  1716. serie.push(item)
  1717. }
  1718. return serie
  1719. }())
  1720. }
  1721. this.chart5.chartLine.setOption(option)
  1722. window.onresize = function() {
  1723. this.chart5.chartLine.resize()
  1724. }
  1725. },
  1726. // 混料计划取消次数
  1727. getChart6() {
  1728. this.chart6.listLoading = true
  1729. GetReportform(this.chart6.getdataListParm).then(response => {
  1730. if (response.data.list !== null) {
  1731. // for (let i = 0; i < response.data.data.length; i++) {
  1732. // response.data.data[i].准确率 = response.data.data[i].准确率 + '%'
  1733. // }
  1734. this.chart6.table.list = response.data.data
  1735. this.chart6.chartLine_data = response.data.list
  1736. // this.chart6.chartLine_data = {
  1737. // 'data1': ['1牧', '2牧', '3牧', '4牧', '5牧', '6牧', '7牧', '8牧', '9牧', '10牧', '11牧', '12牧'], // x轴
  1738. // 'data2': [2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3], // 自动跳转准确率
  1739. // 'data3': [2.6, 5.9, 9.0, 30, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3] // 手动跳转准确率
  1740. // }
  1741. this.chart6.total = response.data.total
  1742. this.chart6.total = response.data.total
  1743. console.log('混料计划取消次数图', this.chart6.chartLine_data)
  1744. console.log('混料计划取消次数表', this.chart6.table.list)
  1745. this.roadChartLine6(this.chart6.chartLine_data)
  1746. } else {
  1747. this.chart6.list = []
  1748. }
  1749. setTimeout(() => {
  1750. this.chart6.listLoading = false
  1751. }, 100)
  1752. })
  1753. },
  1754. roadChartLine6(chartLine_data) {
  1755. if (this.chart6.chartLine != null) {
  1756. this.chart6.chartLine.dispose()
  1757. }
  1758. this.chart6.chartLine = echarts.init(document.getElementById('chartLine6'))
  1759. var option = {
  1760. tooltip: {
  1761. trigger: 'axis',
  1762. axisPointer: {
  1763. type: 'cross',
  1764. crossStyle: {
  1765. color: '#999'
  1766. }
  1767. }
  1768. },
  1769. legend: {
  1770. data: ['混料计划取消次数']
  1771. },
  1772. xAxis: [{ type: 'category', data: chartLine_data.data1, axisPointer: { type: 'shadow' }}],
  1773. yAxis: [{ type: 'value', name: '次数', min: 0, max: 100, interval: 20, axisLabel: { formatter: '{value}%' }}],
  1774. series: [{ name: '混料计划取消次数', type: 'bar', itemStyle: { normal: { color: '#7ecf51' }},
  1775. data: chartLine_data.data2,
  1776. markLine: {
  1777. data: [{ type: 'average' }],
  1778. symbol: ['none', 'none'],
  1779. position: 'insideTopCenter',
  1780. itemStyle: {
  1781. normal: {
  1782. lineStyle: { type: 'dotted', width: 3 },
  1783. label: { show: true, position: 'middle', formatter: '' }
  1784. }
  1785. },
  1786. large: true,
  1787. effect: { show: false, loop: true, period: 0, scaleSize: 2, color: null, shadowColor: null, shadowBlur: null }
  1788. }
  1789. }]
  1790. }
  1791. this.chart6.chartLine.setOption(option)
  1792. window.onresize = function() {
  1793. this.chart6.chartLine.resize()
  1794. }
  1795. },
  1796. handleDownload() {
  1797. var excelDatas = [
  1798. {
  1799. tHeader: ['配方名称', '理论重量', '实际重量', '计划混料操作数', '已混料操作数', '混料操作率', '混料误差值', '混料准确率', '混料自动跳转次数', '混料手动跳转次数', '取消次数', '方差'],
  1800. filterVal: ['配方名称', '理论重量', '实际重量', '计划混料操作数', '已混料操作数', '混料操作率', '混料误差值', '混料准确率', '混料自动跳转次数', '混料手动跳转次数', '取消次数', '方差'],
  1801. tableDatas: this.table.list,
  1802. sheetName: '混料'
  1803. },
  1804. {
  1805. tHeader: ['配方名称', '理论重量', '实际重量', '计划撒料操作数', '已撒料操作数', '撒料操作率', '撒料误差值', '撒料准确率', '撒料自动跳转次数', '撒料手动跳转次数'],
  1806. filterVal: ['配方名称', '理论重量', '实际重量', '计划撒料操作数', '已撒料操作数', '撒料操作率', '撒料误差值', '撒料准确率', '撒料自动跳转次数', '撒料手动跳转次数'],
  1807. tableDatas: this.table2.list,
  1808. sheetName: '撒料'
  1809. }
  1810. ]
  1811. json2excel(excelDatas, '汇总统计-配方名称', true, 'xlsx')
  1812. },
  1813. // 时间
  1814. changeChartDate(item) {
  1815. console.log(item)
  1816. if (item == 'chart1') {
  1817. if (this.chart1.getdataListParm.parammaps.inputDatetime !== '' && this.chart1.getdataListParm.parammaps.inputDatetime !== null) {
  1818. this.chart1.getdataListParm.parammaps.startTime = parseTime(this.chart1.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1819. this.chart1.getdataListParm.parammaps.stopTime = parseTime(this.chart1.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1820. this.getChart1()
  1821. } else {
  1822. this.chart1.getdataListParm.parammaps.inputDatetime = ''
  1823. this.chart1.getdataListParm.parammaps.startTime = ''
  1824. this.chart1.getdataListParm.parammaps.stopTime = ''
  1825. this.getChart1()
  1826. }
  1827. } else if (item == 'chart2') {
  1828. if (this.chart2.getdataListParm.parammaps.inputDatetime !== '' && this.chart2.getdataListParm.parammaps.inputDatetime !== null) {
  1829. this.chart2.getdataListParm.parammaps.startTime = parseTime(this.chart2.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1830. this.chart2.getdataListParm.parammaps.stopTime = parseTime(this.chart2.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1831. this.getChart2()
  1832. } else {
  1833. this.chart2.getdataListParm.parammaps.inputDatetime = ''
  1834. this.chart2.getdataListParm.parammaps.startTime = ''
  1835. this.chart2.getdataListParm.parammaps.stopTime = ''
  1836. this.getChart2()
  1837. }
  1838. } else if (item == 'chart3') {
  1839. if (this.chart3.getdataListParm.parammaps.inputDatetime !== '' && this.chart3.getdataListParm.parammaps.inputDatetime !== null) {
  1840. this.chart3.getdataListParm.parammaps.startTime = parseTime(this.chart3.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1841. this.chart3.getdataListParm.parammaps.stopTime = parseTime(this.chart3.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1842. this.getChart3()
  1843. } else {
  1844. this.chart3.getdataListParm.parammaps.inputDatetime = ''
  1845. this.chart3.getdataListParm.parammaps.startTime = ''
  1846. this.chart3.getdataListParm.parammaps.stopTime = ''
  1847. this.getChart3()
  1848. }
  1849. } else if (item == 'chart4') {
  1850. if (this.chart4.getdataListParm.parammaps.inputDatetime !== '' && this.chart4.getdataListParm.parammaps.inputDatetime !== null) {
  1851. this.chart4.getdataListParm.parammaps.startTime = parseTime(this.chart4.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1852. this.chart4.getdataListParm.parammaps.stopTime = parseTime(this.chart4.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1853. this.getChart4()
  1854. } else {
  1855. this.chart4.getdataListParm.parammaps.inputDatetime = ''
  1856. this.chart4.getdataListParm.parammaps.startTime = ''
  1857. this.chart4.getdataListParm.parammaps.stopTime = ''
  1858. this.getChart4()
  1859. }
  1860. } else if (item == 'chart5') {
  1861. if (this.chart5.getdataListParm.parammaps.inputDatetime !== '' && this.chart5.getdataListParm.parammaps.inputDatetime !== null) {
  1862. this.chart5.getdataListParm.parammaps.startTime = parseTime(this.chart5.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1863. this.chart5.getdataListParm.parammaps.stopTime = parseTime(this.chart5.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1864. this.getChart5()
  1865. } else {
  1866. this.chart5.getdataListParm.parammaps.inputDatetime = ''
  1867. this.chart5.getdataListParm.parammaps.startTime = ''
  1868. this.chart5.getdataListParm.parammaps.stopTime = ''
  1869. this.getChart5()
  1870. }
  1871. } else if (item == 'chart6') {
  1872. if (this.chart6.getdataListParm.parammaps.inputDatetime !== '' && this.chart6.getdataListParm.parammaps.inputDatetime !== null) {
  1873. this.chart6.getdataListParm.parammaps.startTime = parseTime(this.chart6.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1874. this.chart6.getdataListParm.parammaps.stopTime = parseTime(this.chart6.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1875. this.getChart6()
  1876. } else {
  1877. this.chart6.getdataListParm.parammaps.inputDatetime = ''
  1878. this.chart6.getdataListParm.parammaps.startTime = ''
  1879. this.chart6.getdataListParm.parammaps.stopTime = ''
  1880. this.getChart6()
  1881. }
  1882. }
  1883. },
  1884. handleExport(item) {
  1885. if (item == 'chart1') {
  1886. console.log('配方准确率导出')
  1887. var excelDatasTabChart1 = [
  1888. {
  1889. tHeader: ['日期', '配方名称', '计划重量(kg)', '实际重量(kg)', '准确率'],
  1890. filterVal: ['日期', '名称', '理论量', '实际量', '准确率'],
  1891. tableDatas: this.chart1.table.list,
  1892. sheetName: '配方准确率'
  1893. }
  1894. ]
  1895. json2excel(excelDatasTabChart1, '配方准确率', true, 'xlsx')
  1896. } else if (item == 'chart2') {
  1897. console.log('计划统计导出')
  1898. var excelDatasTabChart2 = [
  1899. {
  1900. tHeader: ['日期', '计划执行重量(kg)', '配方理论重量(kg)', '计划准确率', '计划取消重量(kg)', '计划准确率(去除取消重量)', '计划正确数', '计划数', '计划正确率'],
  1901. filterVal: ['日期', '实际量', '理论量', 'field1', '计划取消重量', 'field3', '正确数', '计划数', 'field2'],
  1902. tableDatas: this.chart2.table.list,
  1903. sheetName: '计划统计'
  1904. }
  1905. ]
  1906. json2excel(excelDatasTabChart2, '计划统计', true, 'xlsx')
  1907. } else if (item == 'chart3') {
  1908. console.log('牛群准确率导出')
  1909. var excelDatasTabChart3 = [
  1910. {
  1911. tHeader: ['日期', '牲畜类别', '计划重量(kg)', '实际重量(kg)', '准确率'],
  1912. filterVal: ['日期', '名称', '理论量', '实际量', '准确率'],
  1913. tableDatas: this.chart3.table.list,
  1914. sheetName: '牛群准确率'
  1915. }
  1916. ]
  1917. json2excel(excelDatasTabChart3, '牛群准确率', true, 'xlsx')
  1918. } else if (item == 'chart4') {
  1919. console.log('车辆准确率(重量)导出')
  1920. var excelDatasTabChart4 = [
  1921. {
  1922. tHeader: ['日期', '车次', '计划重量(kg)', '实际重量(kg)', '准确率'],
  1923. filterVal: ['日期', '名称', '理论量', '实际量', '准确率'],
  1924. tableDatas: this.chart4.table.list,
  1925. sheetName: '车辆准确率(重量)'
  1926. }
  1927. ]
  1928. json2excel(excelDatasTabChart4, '车辆准确率(重量)', true, 'xlsx')
  1929. } else if (item == 'chart5') {
  1930. console.log('混料统计导出')
  1931. var excelDatasTabChart5 = [
  1932. {
  1933. tHeader: ['日期', '自动跳转次数', '手动跳转次数', '自动跳转理论重量', '自动跳转实际重量', '自动跳转准确率', '手动跳转理论重量', '手动跳转实际重量', '手动跳转准确率'],
  1934. filterVal: ['日期', 'field1', 'field2', '理论自动', '实际自动', 'field3', '理论手动', '实际手动', 'field4'],
  1935. tableDatas: this.chart5.table.list,
  1936. sheetName: '混料统计'
  1937. }
  1938. ]
  1939. json2excel(excelDatasTabChart5, '混料统计', true, 'xlsx')
  1940. } else if (item == 'chart6') {
  1941. console.log('混料计划取消次数导出')
  1942. var excelDatasTabChart5 = [
  1943. {
  1944. tHeader: ['日期', '自动跳转次数', '手动跳转次数', '自动跳转理论重量', '自动跳转实际重量', '自动跳转准确率', '手动跳转理论重量', '手动跳转实际重量', '手动跳转准确率'],
  1945. filterVal: ['日期', 'field1', 'field2', '理论自动', '实际自动', 'field3', '理论手动', '实际手动', 'field4'],
  1946. tableDatas: this.chart5.table.list,
  1947. sheetName: '混料计划取消次数'
  1948. }
  1949. ]
  1950. json2excel(excelDatasTabChart5, '混料计划取消次数', true, 'xlsx')
  1951. }
  1952. },
  1953. handleTable(item) {
  1954. // 显示切换表格
  1955. if (item == 'chart1') {
  1956. console.log('配方准确率表格')
  1957. this.chart1.isTable = true
  1958. this.chart1.isChart = false
  1959. } else if (item == 'chart2') {
  1960. console.log('计划统计表格')
  1961. this.chart2.isTable = true
  1962. this.chart2.isChart = false
  1963. } else if (item == 'chart3') {
  1964. console.log('牛群准确率表格')
  1965. this.chart3.isTable = true
  1966. this.chart3.isChart = false
  1967. } else if (item == 'chart4') {
  1968. console.log('车辆准确率(重量)表格')
  1969. this.chart4.isTable = true
  1970. this.chart4.isChart = false
  1971. } else if (item == 'chart5') {
  1972. console.log('混料统计表格')
  1973. this.chart5.isTable = true
  1974. this.chart5.isChart = false
  1975. } else if (item == 'chart6') {
  1976. console.log('混料计划取消次数表格')
  1977. this.chart6.isTable = true
  1978. this.chart6.isChart = false
  1979. } else if (item == 'chart7') {
  1980. console.log('栏舍撒料时间统计表格')
  1981. this.chart7.isTable = true
  1982. this.chart7.isChart = false
  1983. }
  1984. },
  1985. // 切换图表
  1986. handleChart(item) {
  1987. // 显示切换图表
  1988. if (item == 'chart1') {
  1989. console.log('配方准确率图表')
  1990. this.chart1.isTable = false
  1991. this.chart1.isChart = true
  1992. this.getChart1()
  1993. } else if (item == 'chart2') {
  1994. console.log('计划统计图表')
  1995. this.chart2.isTable = false
  1996. this.chart2.isChart = true
  1997. this.getChart2()
  1998. } else if (item == 'chart3') {
  1999. console.log('牛群准确率图表')
  2000. this.chart3.isTable = false
  2001. this.chart3.isChart = true
  2002. this.getChart3()
  2003. } else if (item == 'chart4') {
  2004. console.log('车辆准确率(重量)图表')
  2005. this.chart4.isTable = false
  2006. this.chart4.isChart = true
  2007. this.getChart4()
  2008. } else if (item == 'chart5') {
  2009. console.log('混料统计图表')
  2010. this.chart5.isTable = false
  2011. this.chart5.isChart = true
  2012. this.getChart5()
  2013. } else if (item == 'chart6') {
  2014. console.log('混料计划取消次数图表')
  2015. this.chart6.isTable = false
  2016. this.chart6.isChart = true
  2017. this.getChart6()
  2018. } else if (item == 'chart7') {
  2019. console.log('栏舍撒料时间统计图表')
  2020. this.chart7.isTable = false
  2021. this.chart7.isChart = true
  2022. this.getChart7()
  2023. }
  2024. }
  2025. }
  2026. }
  2027. </script>
  2028. <style lang="scss" scoped>
  2029. .button{
  2030. height: 50px;
  2031. .exportTable{float: right;margin-right: 5px;}
  2032. }
  2033. .app-container1{padding-left: 10px;background-color: #F4F4F4;}
  2034. .dashboard-editor-container {
  2035. background-color: #F4F4F4;
  2036. .grid-content{
  2037. background-color:#fff;padding: 0 10px;
  2038. h4{text-align: center;line-height: 50px;}
  2039. }
  2040. }
  2041. .table{margin-bottom: 50px;}
  2042. </style>