647f05c9c05185836e3fe712d0e172cbf1b34dda.svn-base 103 KB

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