b6443b70f5a5dadeb8f43098414f042a507a439b.svn-base 94 KB

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