index.vue 57 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203
  1. <template>
  2. <div class="dashboard-editor-container" ref="prev">
  3. <div v-if="isPercentage" class="percentage" style="width: 210px;height: 90px;background: #fff;position: fixed;bottom: 0;left: 0;z-index: 9999999999999;">
  4. <h4 style="padding-left: 10px;line-height: 0;">导出进度:</h4>
  5. <el-progress style="padding-left: 10px;" :text-inside="true" :stroke-width="26" :percentage="percentage" />
  6. </div>
  7. <div :style="{position: 'fixed',height:'55px',top: '90px',zIndex: '999',marginBottom: '50px',background:'#f0f2f5',width: myWidth}">
  8. <el-radio-group v-model="radio" @change="changeRadio">
  9. <el-radio :label="1">月</el-radio>
  10. <el-radio :label="2">日</el-radio>
  11. </el-radio-group>
  12. <el-date-picker v-if="radio == 1" v-model="yearDate" type="monthrange" range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份" style="width: 250px;" format="yyyy-MM" value-format="yyyy-MM" :clearable="false" @change="changeTime('1')" />
  13. <el-date-picker v-else v-model="yearDate" type="daterange" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" style="width: 250px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" :clearable="false" @change="changeTime('2')" />
  14. <el-select v-model="jump" style="width: 140pxmargin-top:5px;;" placeholder="快捷跳转方式" class="filter-item" @visible-change="changeJump($event,jump)">
  15. <el-option v-for="item in jumpList" :key="item.id" :label="item.name" :value="item.name" />
  16. </el-select>
  17. <el-select v-model="pastureId" style="width: 140px;margin-top:5px;" placeholder="全部牧场" class="filter-item" @change="changePasture">
  18. <el-option v-for="item in findAllPasture" :key="item.name" :label="item.name" :value="item.id" />
  19. </el-select>
  20. <el-button class="filter-item" style="" type="success" icon="el-icon-edit" @click="handleDownload">导出</el-button>
  21. </div>
  22. <div style="margin-top: 50px;">
  23. <div v-if="radio == 1">
  24. <h3 id="equipmentIndexCostTable">设备指标</h3>
  25. <el-table
  26. :key="equipmentIndexCostTable.tableKey"
  27. v-loading="equipmentIndexCostTable.listLoading"
  28. element-loading-text="给我一点时间"
  29. :data="equipmentIndexCostTable.list"
  30. border
  31. fit
  32. highlight-current-row
  33. style="width: 100%;"
  34. :row-style="rowStyle"
  35. :cell-style="tableCellStyle"
  36. class="elTable"
  37. height="350"
  38. @sort-change="tableSort1"
  39. >
  40. <el-table-column label="设备指标" align="center">
  41. <el-table-column label="序号" align="center" type="index" width="50px" />
  42. <el-table-column label="牧场" min-width="70px" align="center">
  43. <template slot-scope="{row}">
  44. <a @click="clickEquipmentIndex(row)">{{ row.pastureName }}</a>
  45. </template>
  46. </el-table-column>
  47. <el-table-column label="饲养头日" sortable min-width="80px" align="center" prop="monthBudget" />
  48. </el-table-column>
  49. <el-table-column label="总指标(万元)" align="center">
  50. <el-table-column label="预算" sortable min-width="80px" align="center" prop="monthBudget" />
  51. <!-- <el-table-column label="内控" sortable min-width="80px" align="center" prop="monthLimit" /> -->
  52. <!-- <el-table-column label="迄今内控" sortable min-width="80px" align="center" prop="qmonthBudget" /> -->
  53. <el-table-column label="迄今预算" sortable min-width="80px" align="center" prop="qmonthBudget" />
  54. <el-table-column label="迄今实际" sortable min-width="80px" align="center" prop="sumPrice" />
  55. <el-table-column label="实际节约" sortable min-width="80px" align="center" prop="asave" />
  56. <el-table-column label="实际达成率" :sortable="true" :sort-method="(a,b) => sortMethod(a ,b , 'realReason')" min-width="90px" align="center" prop="realReason" />
  57. </el-table-column>
  58. <el-table-column label="单头牛指标(元)" align="center">
  59. <!-- <el-table-column label="单头牛预算" sortable min-width="80px" align="center" prop="oneCowBudget" /> -->
  60. <!-- <el-table-column label="单头牛内控" sortable min-width="80px" align="center" prop="oneCowLimit" /> -->
  61. <!-- <el-table-column label="单头牛迄今内控" sortable min-width="80px" align="center" prop="oneCowQmonthBudget" /> -->
  62. <el-table-column label="单头牛迄今实际" sortable min-width="80px" align="center" prop="oneCowSumPrice" />
  63. <!-- <el-table-column label="单头牛实际节约" sortable min-width="80px" align="center" prop="oneCowAsave" /> -->
  64. </el-table-column>
  65. </el-table>
  66. </div>
  67. <div>
  68. <h3 id="repairCostTable">维修费</h3>
  69. <el-table
  70. :key="repairCostTable.tableKey"
  71. v-loading="repairCostTable.listLoading"
  72. element-loading-text="给我一点时间"
  73. :data="repairCostTable.list"
  74. border
  75. fit
  76. highlight-current-row
  77. style="width: 100%;"
  78. :row-style="rowStyle"
  79. :cell-style="tableCellStyle"
  80. class="elTable"
  81. height="350"
  82. @sort-change="tableSort2"
  83. >
  84. <el-table-column label="设备指标" align="center">
  85. <el-table-column label="序号" align="center" type="index" width="50px" />
  86. <el-table-column label="牧场" min-width="70px" align="center">
  87. <template slot-scope="{row}">
  88. <a @click="clickRepairCost(row)">{{ row.pastureName }}</a>
  89. </template>
  90. </el-table-column>
  91. </el-table-column>
  92. <el-table-column label="总指标(万元)" align="center">
  93. <el-table-column label="预算" sortable min-width="80px" align="center" prop="monthBudget" />
  94. <!-- <el-table-column label="内控" sortable min-width="80px" align="center" prop="monthLimit" /> -->
  95. <el-table-column label="迄今预算" sortable min-width="80px" align="center" prop="qmonthBudget" />
  96. <el-table-column label="迄今实际" sortable min-width="80px" align="center" prop="sumPrice" />
  97. <el-table-column label="实际节约" sortable min-width="80px" align="center" prop="asave" />
  98. <el-table-column label="实际达成率" :sortable="true" :sort-method="(a,b) => sortMethod(a ,b , 'realReason')" min-width="90px" align="center" prop="realReason" />
  99. </el-table-column>
  100. <el-table-column label="单头牛指标(元)" align="center">
  101. <!-- <el-table-column label="单头牛预算" sortable min-width="80px" align="center" prop="oneCowBudget" /> -->
  102. <!-- <el-table-column label="单头牛内控" sortable min-width="80px" align="center" prop="oneCowLimit" /> -->
  103. <!-- <el-table-column label="单头牛迄今内控" sortable min-width="80px" align="center" prop="oneCowQmonthBudget" /> -->
  104. <el-table-column label="单头牛迄今实际" sortable min-width="80px" align="center" prop="oneCowSumPrice" />
  105. <!-- <el-table-column label="单头牛实际节约" sortable min-width="80px" align="center" prop="oneCowAsave" /> -->
  106. </el-table-column>
  107. </el-table>
  108. </div>
  109. <div v-if="radio == 1">
  110. <h3 id="waterCostTable">水费</h3>
  111. <el-table
  112. :key="waterCostTable.tableKey"
  113. v-loading="waterCostTable.listLoading"
  114. element-loading-text="给我一点时间"
  115. :data="waterCostTable.list"
  116. border
  117. fit
  118. highlight-current-row
  119. style="width: 100%;"
  120. :row-style="rowStyle"
  121. :cell-style="tableCellStyle"
  122. class="elTable"
  123. height="350"
  124. @sort-change="tableSort3"
  125. >
  126. <el-table-column label="设备指标" align="center">
  127. <el-table-column label="序号" align="center" type="index" width="50px" />
  128. <el-table-column label="牧场" min-width="70px" align="center">
  129. <template slot-scope="{row}">
  130. <a @click="clickWaterCost(row)">{{ row.pastureName }}</a>
  131. </template>
  132. </el-table-column>
  133. </el-table-column>
  134. <el-table-column label="总指标(万元)" align="center">
  135. <el-table-column label="预算" sortable min-width="80px" align="center" prop="monthBudget" />
  136. <!-- <el-table-column label="内控" sortable min-width="80px" align="center" prop="monthLimit" /> -->
  137. <el-table-column label="迄今预算" sortable min-width="80px" align="center" prop="qmonthBudget" />
  138. <el-table-column label="迄今实际" sortable min-width="80px" align="center" prop="sumPrice" />
  139. <el-table-column label="实际节约" sortable min-width="80px" align="center" prop="asave" />
  140. <el-table-column label="实际达成率" :sortable="true" :sort-method="(a,b) => sortMethod(a ,b , 'realReason')" min-width="90px" align="center" prop="realReason" />
  141. </el-table-column>
  142. <el-table-column label="单头牛指标(元)" align="center">
  143. <!-- <el-table-column label="单头牛预算" sortable min-width="80px" align="center" prop="oneCowBudget" /> -->
  144. <!-- <el-table-column label="单头牛内控" sortable min-width="80px" align="center" prop="oneCowLimit" /> -->
  145. <!-- <el-table-column label="单头牛迄今内控" sortable min-width="80px" align="center" prop="oneCowQmonthBudget" /> -->
  146. <el-table-column label="单头牛迄今实际" sortable min-width="80px" align="center" prop="oneCowSumPrice" />
  147. <!-- <el-table-column label="单头牛实际节约" sortable min-width="80px" align="center" prop="oneCowAsave" /> -->
  148. </el-table-column>
  149. </el-table>
  150. </div>
  151. <div v-if="radio == 1">
  152. <h3 id="elecCostTable">电费</h3>
  153. <el-table
  154. :key="elecCostTable.tableKey"
  155. v-loading="elecCostTable.listLoading"
  156. element-loading-text="给我一点时间"
  157. :data="elecCostTable.list"
  158. border
  159. fit
  160. highlight-current-row
  161. style="width: 100%;"
  162. :row-style="rowStyle"
  163. :cell-style="tableCellStyle"
  164. class="elTable"
  165. height="350"
  166. @sort-change="tableSort4"
  167. >
  168. <el-table-column label="设备指标" align="center">
  169. <el-table-column label="序号" align="center" type="index" width="50px" />
  170. <el-table-column label="牧场" min-width="70px" align="center">
  171. <template slot-scope="{row}">
  172. <a @click="clickElecCost(row)">{{ row.pastureName }}</a>
  173. </template>
  174. </el-table-column>
  175. </el-table-column>
  176. <el-table-column label="总指标(万元)" align="center">
  177. <el-table-column label="预算" sortable min-width="80px" align="center" prop="monthBudget" />
  178. <!-- <el-table-column label="内控" sortable min-width="80px" align="center" prop="monthLimit" /> -->
  179. <el-table-column label="迄今预算" sortable min-width="80px" align="center" prop="qmonthBudget" />
  180. <el-table-column label="迄今实际" sortable min-width="80px" align="center" prop="sumPrice" />
  181. <el-table-column label="实际节约" sortable min-width="80px" align="center" prop="asave" />
  182. <el-table-column label="实际达成率" :sortable="true" :sort-method="(a,b) => sortMethod(a ,b , 'realReason')" min-width="90px" align="center" prop="realReason" />
  183. </el-table-column>
  184. <el-table-column label="单头牛指标(元)" align="center">
  185. <!-- <el-table-column label="单头牛预算" sortable min-width="80px" align="center" prop="oneCowBudget" /> -->
  186. <!-- <el-table-column label="单头牛内控" sortable min-width="80px" align="center" prop="oneCowLimit" /> -->
  187. <!-- <el-table-column label="单头牛迄今内控" sortable min-width="80px" align="center" prop="oneCowQmonthBudget" /> -->
  188. <el-table-column label="单头牛迄今实际" sortable min-width="80px" align="center" prop="oneCowSumPrice" />
  189. <!-- <el-table-column label="单头牛实际节约" sortable min-width="80px" align="center" prop="oneCowAsave" /> -->
  190. </el-table-column>
  191. </el-table>
  192. </div>
  193. <div v-if="radio == 1">
  194. <h3 id="gasCostTable">柴油费</h3>
  195. <el-table
  196. :key="gasCostTable.tableKey"
  197. v-loading="gasCostTable.listLoading"
  198. element-loading-text="给我一点时间"
  199. :data="gasCostTable.list"
  200. border
  201. fit
  202. highlight-current-row
  203. style="width: 100%;"
  204. :row-style="rowStyle"
  205. :cell-style="tableCellStyle"
  206. class="elTable"
  207. height="350"
  208. @sort-change="tableSort5"
  209. >
  210. <el-table-column label="设备指标" align="center">
  211. <el-table-column label="序号" align="center" type="index" width="50px" />
  212. <el-table-column label="牧场" min-width="70px" align="center">
  213. <template slot-scope="{row}">
  214. <a @click="clickGasCost(row)">{{ row.pastureName }}</a>
  215. </template>
  216. </el-table-column>
  217. </el-table-column>
  218. <el-table-column label="总指标(万元)" align="center">
  219. <el-table-column label="预算" sortable min-width="80px" align="center" prop="monthBudget" />
  220. <!-- <el-table-column label="内控" sortable min-width="80px" align="center" prop="monthLimit" /> -->
  221. <el-table-column label="迄今预算" sortable min-width="80px" align="center" prop="qmonthBudget" />
  222. <el-table-column label="迄今实际" sortable min-width="80px" align="center" prop="sumPrice" />
  223. <el-table-column label="实际节约" sortable min-width="80px" align="center" prop="asave" />
  224. <el-table-column label="实际达成率" :sortable="true" :sort-method="(a,b) => sortMethod(a ,b , 'realReason')" min-width="90px" align="center" prop="realReason" />
  225. </el-table-column>
  226. <el-table-column label="单头牛指标(元)" align="center">
  227. <!-- <el-table-column label="单头牛预算" sortable min-width="80px" align="center" prop="oneCowBudget" /> -->
  228. <!-- <el-table-column label="单头牛内控" sortable min-width="80px" align="center" prop="oneCowLimit" /> -->
  229. <!-- <el-table-column label="单头牛迄今内控" sortable min-width="80px" align="center" prop="oneCowQmonthBudget" /> -->
  230. <el-table-column label="单头牛迄今实际" sortable min-width="80px" align="center" prop="oneCowSumPrice" />
  231. <!-- <el-table-column label="单头牛实际节约" sortable min-width="80px" align="center" prop="oneCowAsave" /> -->
  232. </el-table-column>
  233. </el-table>
  234. </div>
  235. <div>
  236. <h3 id="bioConsumptionTable">燃动费</h3>
  237. <el-table
  238. :key="bioConsumptionTable.tableKey"
  239. v-loading="bioConsumptionTable.listLoading"
  240. element-loading-text="给我一点时间"
  241. :data="bioConsumptionTable.list"
  242. border
  243. fit
  244. highlight-current-row
  245. style="width: 100%;"
  246. :row-style="rowStyle"
  247. :cell-style="tableCellStyle"
  248. class="elTable"
  249. height="350"
  250. @sort-change="tableSort8"
  251. >
  252. <el-table-column label="设备指标" align="center">
  253. <el-table-column label="序号" align="center" type="index" width="50px" />
  254. <el-table-column label="牧场" min-width="70px" align="center">
  255. <template slot-scope="{row}">
  256. <a @click="clickBioConsumption(row)">{{ row.pastureName }}</a>
  257. </template>
  258. </el-table-column>
  259. </el-table-column>
  260. <el-table-column label="总指标" align="center">
  261. <el-table-column label="预算" sortable min-width="80px" align="center" prop="monthBudget" />
  262. <el-table-column label="迄今预算" sortable min-width="80px" align="center" prop="qmonthBudget" />
  263. <el-table-column label="迄今实际" sortable min-width="80px" align="center" prop="sumPrice" />
  264. <el-table-column label="实际节约" sortable min-width="80px" align="center" prop="asave" />
  265. <el-table-column label="实际达成率" :sortable="true" :sort-method="(a,b) => sortMethod(a ,b , 'realReason')" min-width="90px" align="center" prop="realReason" />
  266. </el-table-column>
  267. <el-table-column label="单头牛指标" align="center">
  268. <el-table-column label="单头牛迄今实际" sortable min-width="80px" align="center" prop="oneCowSumPrice" />
  269. </el-table-column>
  270. </el-table>
  271. </div>
  272. <div>
  273. <h3 id="allConsumptionTable">水电柴油用量</h3>
  274. <el-table
  275. :key="allConsumptionTable.tableKey"
  276. v-loading="allConsumptionTable.listLoading"
  277. element-loading-text="给我一点时间"
  278. :data="allConsumptionTable.list"
  279. border
  280. fit
  281. highlight-current-row
  282. style="width: 100%;"
  283. :row-style="rowStyle"
  284. :cell-style="tableCellStyle"
  285. class="elTable"
  286. height="350"
  287. @sort-change="tableSort10"
  288. >
  289. <el-table-column label="序号" align="center" type="index" width="50px" />
  290. <el-table-column label="牧场" min-width="70px" align="center">
  291. <template slot-scope="{row}">
  292. <a @click="clickAllConsumption(row)">{{ row.pastureName }}</a>
  293. </template>
  294. </el-table-column>
  295. <el-table-column label="水迄今实际(吨)" sortable min-width="80px" align="center" prop="waterSumPrice" />
  296. <el-table-column label="水单头牛迄今实际(吨)" sortable min-width="80px" align="center" prop="waterOneCowSumPrice" />
  297. <el-table-column label="电迄今实际(度)" sortable min-width="80px" align="center" prop="electricitySumPrice" />
  298. <el-table-column label="电单头牛迄今实际(度)" sortable min-width="80px" align="center" prop="electricityOneCowSumPrice" />
  299. <el-table-column label="柴油迄今实际(升)" sortable min-width="80px" align="center" prop="monthiolSumPrice" />
  300. <el-table-column label="柴油单头牛迄今实际(升)" sortable min-width="80px" align="center" prop="monthiolOneCowSumPrice" />
  301. </el-table>
  302. </div>
  303. <!-- <div>
  304. <h3 id="waterConsumptionTable">水量(吨)</h3>
  305. <el-table
  306. :key="waterConsumptionTable.tableKey"
  307. v-loading="waterConsumptionTable.listLoading"
  308. element-loading-text="给我一点时间"
  309. :data="waterConsumptionTable.list"
  310. border
  311. fit
  312. highlight-current-row
  313. style="width: 100%;"
  314. :row-style="rowStyle"
  315. :cell-style="tableCellStyle"
  316. class="elTable"
  317. height="350"
  318. @sort-change="tableSort6"
  319. >
  320. <el-table-column label="设备指标" align="center">
  321. <el-table-column label="序号" align="center" type="index" width="50px" />
  322. <el-table-column label="牧场" min-width="70px" align="center">
  323. <template slot-scope="{row}">
  324. <a @click="clickWaterConsumption(row)">{{ row.pastureName }}</a>
  325. </template>
  326. </el-table-column>
  327. </el-table-column>
  328. <el-table-column label="总指标" align="center">
  329. <el-table-column label="预算" sortable min-width="80px" align="center" prop="monthBudget" />
  330. <el-table-column label="迄今预算" sortable min-width="80px" align="center" prop="qmonthBudget" />
  331. <el-table-column label="迄今实际" sortable min-width="80px" align="center" prop="sumPrice" />
  332. <el-table-column label="实际节约" sortable min-width="80px" align="center" prop="asave" />
  333. <el-table-column label="实际达成率" :sortable="true" :sort-method="(a,b) => sortMethod(a ,b , 'realReason')" min-width="90px" align="center" prop="realReason" />
  334. </el-table-column>
  335. <el-table-column label="单头牛指标" align="center">
  336. <el-table-column label="单头牛迄今实际" sortable min-width="80px" align="center" prop="oneCowSumPrice" />
  337. </el-table-column>
  338. </el-table>
  339. </div> -->
  340. <!-- <div>
  341. <h3 id="elecConsumptionTable">电量(度)</h3>
  342. <el-table
  343. :key="elecConsumptionTable.tableKey"
  344. v-loading="elecConsumptionTable.listLoading"
  345. element-loading-text="给我一点时间"
  346. :data="elecConsumptionTable.list"
  347. border
  348. fit
  349. highlight-current-row
  350. style="width: 100%;"
  351. :row-style="rowStyle"
  352. :cell-style="tableCellStyle"
  353. class="elTable"
  354. height="350"
  355. @sort-change="tableSort7"
  356. >
  357. <el-table-column label="设备指标" align="center">
  358. <el-table-column label="序号" align="center" type="index" width="50px" />
  359. <el-table-column label="牧场" min-width="70px" align="center">
  360. <template slot-scope="{row}">
  361. <a @click="clickElecConsumption(row)">{{ row.pastureName }}</a>
  362. </template>
  363. </el-table-column>
  364. </el-table-column>
  365. <el-table-column label="总指标" align="center">
  366. <el-table-column label="预算" sortable min-width="80px" align="center" prop="monthBudget" />
  367. <el-table-column label="内控" sortable min-width="80px" align="center" prop="monthLimit" />
  368. <el-table-column label="迄今内控" sortable min-width="80px" align="center" prop="qmonthBudget" />
  369. <el-table-column label="迄今实际" sortable min-width="80px" align="center" prop="sumPrice" />
  370. <el-table-column label="实际节约" sortable min-width="80px" align="center" prop="asave" />
  371. <el-table-column label="实际达成率" :sortable="true" :sort-method="(a,b) => sortMethod(a ,b , 'realReason')" min-width="90px" align="center" prop="realReason" />
  372. </el-table-column>
  373. <el-table-column label="单头牛指标" align="center">
  374. <el-table-column label="单头牛预算" sortable min-width="80px" align="center" prop="oneCowBudget" />
  375. <el-table-column label="单头牛迄今实际" sortable min-width="80px" align="center" prop="oneCowSumPrice" />
  376. </el-table-column>
  377. </el-table>
  378. </div> -->
  379. <!-- <div>
  380. <h3 id="gasConsumptionTable">柴油用量(L)</h3>
  381. <el-table
  382. :key="gasConsumptionTable.tableKey"
  383. v-loading="gasConsumptionTable.listLoading"
  384. element-loading-text="给我一点时间"
  385. :data="gasConsumptionTable.list"
  386. border
  387. fit
  388. highlight-current-row
  389. style="width: 100%;"
  390. :row-style="rowStyle"
  391. :cell-style="tableCellStyle"
  392. class="elTable"
  393. height="350"
  394. @sort-change="tableSort8"
  395. >
  396. <el-table-column label="设备指标" align="center">
  397. <el-table-column label="序号" align="center" type="index" width="50px" />
  398. <el-table-column label="牧场" min-width="70px" align="center">
  399. <template slot-scope="{row}">
  400. <a @click="clickGasConsumption(row)">{{ row.pastureName }}</a>
  401. </template>
  402. </el-table-column>
  403. </el-table-column>
  404. <el-table-column label="总指标" align="center">
  405. <el-table-column label="预算" sortable min-width="80px" align="center" prop="monthBudget" />
  406. <el-table-column label="迄今预算" sortable min-width="80px" align="center" prop="qmonthBudget" />
  407. <el-table-column label="迄今实际" sortable min-width="80px" align="center" prop="sumPrice" />
  408. <el-table-column label="实际节约" sortable min-width="80px" align="center" prop="asave" />
  409. <el-table-column label="实际达成率" :sortable="true" :sort-method="(a,b) => sortMethod(a ,b , 'realReason')" min-width="90px" align="center" prop="realReason" />
  410. </el-table-column>
  411. <el-table-column label="单头牛指标" align="center">
  412. <el-table-column label="单头牛迄今实际" sortable min-width="80px" align="center" prop="oneCowSumPrice" />
  413. </el-table-column>
  414. </el-table>
  415. </div> -->
  416. </div>
  417. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialog.dialogFormVisible" :close-on-click-modal="false">
  418. <div class="table">
  419. <el-table
  420. :key="dialog.tableKey"
  421. v-loading="dialog.listLoading"
  422. element-loading-text="给我一点时间"
  423. :data="dialog.list"
  424. border
  425. fit
  426. highlight-current-row
  427. style="width: 100%;"
  428. :row-style="rowStyle"
  429. :cell-style="cellStyle"
  430. class="elTable"
  431. :max-height="350"
  432. @sort-change="tableSort9"
  433. >
  434. <el-table-column label="设备指标" align="center">
  435. <el-table-column label="序号" align="center" type="index" width="50px" />
  436. <el-table-column label="部门" min-width="70px" align="center" prop="deptname" />
  437. </el-table-column>
  438. <el-table-column label="总指标" align="center">
  439. <el-table-column label="预算" sortable min-width="80px" align="center" prop="monthBudget" />
  440. <!-- <el-table-column label="内控" sortable min-width="80px" align="center" prop="monthLimit" /> -->
  441. <el-table-column label="迄今预算" sortable min-width="80px" align="center" prop="qmonthBudget" />
  442. <el-table-column label="迄今实际" sortable min-width="80px" align="center" prop="sumPrice" />
  443. <el-table-column label="实际节约" sortable min-width="80px" align="center" prop="asave" />
  444. <el-table-column label="实际达成率" :sortable="true" :sort-method="(a,b) => sortMethod(a ,b , 'realReason')" min-width="90px" align="center" prop="realReason" />
  445. </el-table-column>
  446. <el-table-column label="单头牛指标" align="center">
  447. <!-- <el-table-column label="单头牛预算" sortable min-width="80px" align="center" prop="oneCowBudget" /> -->
  448. <!-- <el-table-column label="单头牛内控" sortable min-width="80px" align="center" prop="oneCowLimit" /> -->
  449. <!-- <el-table-column label="单头牛迄今内控" sortable min-width="80px" align="center" prop="oneCowQmonthBudget" /> -->
  450. <el-table-column label="单头牛迄今实际" sortable min-width="80px" align="center" prop="oneCowSumPrice" />
  451. <!-- <el-table-column label="单头牛实际节约" sortable min-width="80px" align="center" prop="oneCowAsave" /> -->
  452. </el-table-column>
  453. </el-table>
  454. <pagination v-show="dialog.total>=0" :total="dialog.total" :page.sync="dialog.getdataListParm.offset" :limit.sync="dialog.getdataListParm.pagecount" @pagination="get_table_dataDialog" />
  455. </div>
  456. </el-dialog>
  457. </div>
  458. </template>
  459. <script>
  460. // 引入
  461. require('script-loader!file-saver')
  462. import { GetDataByName,postJson,getMonthFinalDay } from '@/api/common'
  463. import waves from '@/directive/waves'
  464. import Pagination from '@/components/Pagination'
  465. import { parseTime, sortChange, json2excel } from '@/utils/index.js'
  466. import Cookies from 'js-cookie'
  467. import axios from 'axios'
  468. import { getToken } from '@/utils/auth'
  469. export default {
  470. name: 'EquipmentIndex',
  471. components: { Pagination },
  472. directives: { waves },
  473. filters: {
  474. keepTwoNum(value) {
  475. value = Number(value)
  476. return value.toFixed(2)
  477. }
  478. },
  479. data() {
  480. return {
  481. radio:1,
  482. jump: '',
  483. jumpList: [{ name: '设备指标', id: '0' }, { name: '维修费用', id: '4' }, { name: '水费', id: '1' }, { name: '电费', id: '2' }, { name: '柴油费', id: '3' }, { name: '水电柴油用量', id: '5' }],
  484. // pastureId: Cookies.get('pasturename'),
  485. pastureId: "现代牧业",
  486. findAllPasture: [],
  487. // getPastureParam: { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
  488. getPastureParam: { name: 'findAllPastureBySbzb', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': '18'}},
  489. // getDepartParam: { name: 'findAllDepart1', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }},
  490. getDepartParam: { name: 'findAllDepart1', offset: 0, pagecount: 0, parammaps: { 'pastureId': '18', 'eId': Cookies.get('employeid') }},
  491. departmentId: '',
  492. findAllDept: [],
  493. yearDate: [],
  494. // 设备指标
  495. equipmentIndexCostTable: {
  496. listLoading: true,
  497. list: [],
  498. tableKey: 0,
  499. getdataListParm: {
  500. name: 'getChooseEqMonthBudgetListSumAll', page: 1, offset: 1, returntype: 'Map',
  501. parammaps: { startTime: '', endTime: '', pastureId: '', departmentId: '' }
  502. }
  503. },
  504. // 维修费
  505. repairCostTable: {
  506. listLoading: true,
  507. list: null,
  508. tableKey: 0,
  509. getdataListParm: {
  510. name: 'getChooseMonthWX', page: 1, offset: 1, returntype: 'Map',
  511. parammaps: { startTime: '', endTime: '', pastureId: '', departmentId: '' }
  512. }
  513. },
  514. // 水费
  515. waterCostTable: {
  516. listLoading: true,
  517. list: null,
  518. tableKey: 0,
  519. getdataListParm: {
  520. name: 'getChooseWaterPrice', page: 1, offset: 1, returntype: 'Map',
  521. parammaps: { startTime: '', endTime: '', pastureId: '', departmentId: '' }
  522. }
  523. },
  524. // 电费
  525. elecCostTable: {
  526. listLoading: true,
  527. list: null,
  528. tableKey: 0,
  529. getdataListParm: {
  530. name: 'getChooseElectricityPrice', page: 1, offset: 1, returntype: 'Map',
  531. parammaps: { startTime: '', endTime: '', pastureId: '', departmentId: '' }
  532. }
  533. },
  534. // 燃动费
  535. gasCostTable: {
  536. listLoading: true,
  537. list: null,
  538. tableKey: 0,
  539. getdataListParm: {
  540. name: 'getChooseMonthiolPrice', page: 1, offset: 1, returntype: 'Map',
  541. parammaps: { startTime: '', endTime: '', pastureId: '', departmentId: '' }
  542. }
  543. },
  544. // 水电柴油用量
  545. allConsumptionTable: {
  546. listLoading: true, list: null, tableKey: 0,
  547. getdataListParm: {
  548. name: 'getChooseMonthWater', page: 1, offset: 1, returntype: 'Map',
  549. parammaps: { startTime: '', endTime: '', pastureId: '', departmentId: '' }
  550. }
  551. },
  552. // 水量
  553. waterConsumptionTable: {
  554. listLoading: true, list: null, tableKey: 0,
  555. getdataListParm: {
  556. name: 'getChooseMonthWater', page: 1, offset: 1, returntype: 'Map',
  557. parammaps: { startTime: '', endTime: '', pastureId: '', departmentId: '' }
  558. }
  559. },
  560. // 电量
  561. elecConsumptionTable: {
  562. listLoading: true, list: null, tableKey: 0,
  563. getdataListParm: {
  564. name: 'getChooseMonthElectricity', page: 1, offset: 1, returntype: 'Map',
  565. parammaps: { startTime: '', endTime: '', pastureId: '', departmentId: '' }
  566. }
  567. },
  568. // 柴油用量
  569. gasConsumptionTable: {
  570. listLoading: true, list: null, tableKey: 0,
  571. getdataListParm: {
  572. name: 'getChooseMonthOilT', page: 1, offset: 1, returntype: 'Map',
  573. parammaps: { startTime: '', endTime: '', pastureId: '', departmentId: '' }
  574. }
  575. },
  576. // 燃动
  577. bioConsumptionTable: {
  578. listLoading: true, list: null, tableKey: 0,
  579. getdataListParm: {
  580. name: 'getLgnitionChargePrice', page: 1, offset: 1, returntype: 'Map',
  581. parammaps: { startTime: '', endTime: '', pastureId: '', departmentId: '' }
  582. }
  583. },
  584. // 汽油
  585. gaoilConsumptionTable: {
  586. listLoading: true, list: null, tableKey: 0,
  587. getdataListParm: {
  588. name: 'getChooseGasolinePrice', page: 1, offset: 1, returntype: 'Map',
  589. parammaps: { startTime: '', endTime: '', pastureId: '', departmentId: '' }
  590. }
  591. },
  592. // 煤炭
  593. coalConsumptionTable: {
  594. listLoading: true, list: null, tableKey: 0,
  595. getdataListParm: {
  596. name: 'getChooseCoalPrice', page: 1, offset: 1, returntype: 'Map',
  597. parammaps: { startTime: '', endTime: '', pastureId: '', departmentId: '' }
  598. }
  599. },
  600. dialog: {
  601. dialogFormVisible: false,
  602. tableKey: 0, listLoading: true, list: null, total: 0,
  603. getdataListParm: {
  604. name: '', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
  605. parammaps: { startTime: '', endTime: '', pastureId: '' }
  606. }
  607. },
  608. dialogStatus: '',
  609. textMap: {},
  610. requestParam: { name: '', offset: 0, pagecount: 0, parammaps: {}},
  611. downloadAll: {},
  612. isPercentage: false,
  613. percentage: 1,
  614. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  615. cellStyle: { padding: 0 + 'px' },
  616. myWidth:'',
  617. monthDate:[]
  618. }
  619. },
  620. created() {
  621. if(this.radio == 1){
  622. this.yearDate = [parseTime(new Date(), '{y}-{m}'), parseTime(new Date(), '{y}-{m}')]
  623. this.changeTime('1')
  624. }else{
  625. this.yearDate = [parseTime(new Date(), '{y}-{m}-{d}'), parseTime(new Date(), '{y}-{m}-{d}')]
  626. }
  627. this.getWindowWidth()
  628. this.getPastureDownList()
  629. this.getlistEquipmentIndex()
  630. },
  631. methods: {
  632. getWindowWidth() {
  633. this.$nextTick(()=>{
  634. this.myWidth = this.$refs.prev.clientWidth -30 +'px'
  635. console.log(this.myWidth)
  636. })
  637. },
  638. sortMethod(a, b, c) {
  639. var str = 0
  640. var str2 = 0
  641. str2 = parseFloat(a[c].substring(0, a[c].length - 1))
  642. str = parseFloat(b[c].substring(0, b[c].length - 1))
  643. return str2 - str
  644. },
  645. tableSort1(column) {
  646. sortChange(column, this.equipmentIndexCostTable.list)
  647. },
  648. tableSort2(column) {
  649. sortChange(column, this.repairCostTable.list)
  650. },
  651. tableSort3(column) {
  652. sortChange(column, this.waterCostTable.list)
  653. },
  654. tableSort4(column) {
  655. sortChange(column, this.elecCostTable.list)
  656. },
  657. tableSort5(column) {
  658. sortChange(column, this.gasCostTable.list)
  659. },
  660. tableSort6(column) {
  661. sortChange(column, this.waterConsumptionTable.list)
  662. },
  663. tableSort7(column) {
  664. sortChange(column, this.elecConsumptionTable.list)
  665. },
  666. tableSort8(column) {
  667. sortChange(column, this.gasConsumptionTable.list)
  668. },
  669. tableSort9(column) {
  670. sortChange(column, this.dialog.list)
  671. },
  672. tableSort10(column) {
  673. sortChange(column, this.allConsumptionTable.list)
  674. },
  675. changeJump(callback, jump) {
  676. if (!callback) {
  677. if (jump !== '') {
  678. console.log(jump)
  679. if (jump == '维修费用') {
  680. window.scrollTo(0, document.getElementById('repairCostTable').offsetTop - 150)
  681. // console.log(myHeight1, '11111')
  682. } else if (jump == '水费') {
  683. window.scrollTo(0, document.getElementById('waterCostTable').offsetTop - 150)
  684. } else if (jump == '电费') {
  685. window.scrollTo(0, document.getElementById('elecCostTable').offsetTop - 150)
  686. // console.log(myHeight3, '3333')
  687. } else if (jump == '柴油费') {
  688. window.scrollTo(0, document.getElementById('gasCostTable').offsetTop - 150)
  689. } else if (jump == '水量') {
  690. window.scrollTo(0, document.getElementById('waterConsumptionTable').offsetTop - 150)
  691. } else if (jump == '电量') {
  692. window.scrollTo(0, document.getElementById('elecConsumptionTable').offsetTop - 150)
  693. } else if (jump == '柴油量') {
  694. window.scrollTo(0, document.getElementById('gasConsumptionTable').offsetTop - 150)
  695. } else if (jump == '水电柴油用量') {
  696. window.scrollTo(0, document.getElementById('allConsumptionTable').offsetTop - 150)
  697. }else {
  698. window.scrollTo(0, document.getElementById('equipmentIndexCostTable').offsetTop - 150)
  699. }
  700. }
  701. }
  702. },
  703. handleDownload() {
  704. this.$alert('正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
  705. this.isPercentage = true
  706. this.percentage = 1
  707. var timer = setInterval(() => {
  708. this.percentage += 5
  709. if (this.percentage > 95) {
  710. this.percentage = 99
  711. clearInterval(timer)
  712. }
  713. this.percentage = this.percentage
  714. }, 1000)
  715. this.requestParam.name = 'DownloadEquipment'
  716. this.requestParam.offset = 0
  717. this.requestParam.pagecount = 0
  718. this.requestParam.parammaps = {}
  719. this.requestParam.parammaps.startTime = this.yearDate[0]
  720. this.requestParam.parammaps.endTime = this.yearDate[1]
  721. if (this.pastureId == "现代牧业") {
  722. this.requestParam.parammaps.pastureId = ''
  723. } else {
  724. this.requestParam.parammaps.pastureId = this.pastureId
  725. }
  726. this.requestParam.parammaps.departmentId = this.departmentId
  727. this.requestParam.parammaps.deptId = this.requestParam.parammaps.departmentId
  728. console.log(this.requestParam)
  729. const requestParam = this.requestParam
  730. const url = process.env.VUE_APP_BASE_API + 'authdata/downloadmailreport'// 请求下载文件的地址
  731. axios({
  732. method: 'post', url: url, data: requestParam, headers: { token: getToken(), optname: 'insertcustomdoc' }, responseType: 'blob'
  733. }).then(res => {
  734. if (!res) return
  735. this.percentage = 99
  736. setTimeout(() => {
  737. this.isPercentage = false
  738. }, 2000)
  739. const blob = new Blob([res.data], {
  740. type: 'application/octet-stream'
  741. })
  742. const url = window.URL.createObjectURL(blob)
  743. const aLink = document.createElement('a')
  744. aLink.style.display = 'none'
  745. aLink.href = url
  746. const docname = '设备指标.xlsx'
  747. aLink.setAttribute('download', docname) // 下载的文件
  748. document.body.appendChild(aLink)
  749. aLink.click()
  750. document.body.removeChild(aLink)
  751. window.URL.revokeObjectURL(url)
  752. })
  753. },
  754. getPastureDownList() {
  755. GetDataByName(this.getPastureParam).then(response => {
  756. this.findAllPasture = response.data.list
  757. this.getDepartDownList()
  758. })
  759. },
  760. getDepartDownList() {
  761. GetDataByName(this.getDepartParam).then(response => {
  762. this.findAllDept = response.data.list
  763. })
  764. },
  765. changePasture(item) {
  766. this.getDepartParam.parammaps.pastureId = item
  767. this.getDepartDownList()
  768. this.departmentId = ''
  769. this.getlistEquipmentIndex()
  770. },
  771. changeRadio(item){
  772. this.yearDate = [parseTime(new Date(), '{y}-{m}-{d}'), parseTime(new Date(), '{y}-{m}-{d}')]
  773. if(item == 1){
  774. this.jumpList = [{ name: '设备指标', id: '0' }, { name: '维修费用', id: '4' }, { name: '水费', id: '1' }, { name: '电费', id: '2' }, { name: '柴油费', id: '3' }, { name: '水电柴油用量', id: '5' }]
  775. }else{
  776. this.jumpList = [{ name: '维修费用', id: '4' }, { name: '水电柴油用量', id: '5' }]
  777. }
  778. this.changeTime(item)
  779. },
  780. changeTime(item) {
  781. if(item == 1){
  782. let year = this.yearDate[1].split('-')[0]
  783. let month = this.yearDate[1].split('-')[1]
  784. let lastday = getMonthFinalDay(year,month)
  785. this.yearDate = [parseTime(this.yearDate[0], '{y}-{m}') + '-01',lastday]
  786. // if (parseTime(this.yearDate[0], '{y}-{m}') == parseTime(this.yearDate[1], '{y}-{m}') && parseTime(this.yearDate[0], '{y}-{m}') == parseTime(new Date(), '{y}-{m}')) {
  787. // this.yearDate = [parseTime(new Date(), '{y}-{m}-{d}'), parseTime(new Date(), '{y}-{m}-{d}')]
  788. // } else if (parseTime(this.yearDate[0], '{y}-{m}') !== parseTime(this.yearDate[1], '{y}-{m}') && parseTime(this.yearDate[0], '{y}-{m}') == parseTime(new Date(), '{y}-{m}')) {
  789. // this.yearDate = [parseTime(new Date(), '{y}-{m}-{d}'), parseTime(this.yearDate[1], '{y}-{m}') + '-00']
  790. // } else if (parseTime(this.yearDate[0], '{y}-{m}') !== parseTime(this.yearDate[1], '{y}-{m}') && parseTime(this.yearDate[1], '{y}-{m}') == parseTime(new Date(), '{y}-{m}')) {
  791. // this.yearDate = [parseTime(this.yearDate[0], '{y}-{m}') + '-00', parseTime(new Date(), '{y}-{m}-{d}')]
  792. // } else {
  793. // this.yearDate = [parseTime(this.yearDate[0], '{y}-{m}') + '-00', parseTime(this.yearDate[1], '{y}-{m}') + '-00']
  794. // }
  795. console.log(this.yearDate)
  796. }
  797. console.log(item,'===',this.yearDate)
  798. this.getlistEquipmentIndex()
  799. },
  800. // 设备指标
  801. getlistEquipmentIndex() {
  802. this.equipmentIndexCostTable.listLoading = true
  803. this.equipmentIndexCostTable.getdataListParm.parammaps.startTime = this.yearDate[0]
  804. this.equipmentIndexCostTable.getdataListParm.parammaps.endTime = this.yearDate[1]
  805. this.equipmentIndexCostTable.getdataListParm.parammaps.pastureId = this.pastureId
  806. this.equipmentIndexCostTable.getdataListParm.parammaps.departmentId = this.departmentId
  807. GetDataByName(this.equipmentIndexCostTable.getdataListParm).then(response => {
  808. if (response.data.list !== null) {
  809. for (let i = 0; i < response.data.list.length; i++) {
  810. response.data.list[i].index = i + 1
  811. }
  812. this.equipmentIndexCostTable.list = response.data.list
  813. } else {
  814. this.equipmentIndexCostTable.list = []
  815. }
  816. setTimeout(() => {
  817. this.equipmentIndexCostTable.listLoading = false
  818. this.get_table_dataRepair()
  819. }, 100)
  820. })
  821. },
  822. // 维修费
  823. get_table_dataRepair() {
  824. this.repairCostTable.listLoading = true
  825. this.repairCostTable.getdataListParm.parammaps.startTime = this.yearDate[0]
  826. this.repairCostTable.getdataListParm.parammaps.endTime = this.yearDate[1]
  827. this.repairCostTable.getdataListParm.parammaps.pastureId = this.pastureId
  828. this.repairCostTable.getdataListParm.parammaps.departmentId = this.departmentId
  829. GetDataByName(this.repairCostTable.getdataListParm).then(response => {
  830. if (response.data.list !== null) {
  831. this.repairCostTable.list = response.data.list
  832. } else {
  833. this.repairCostTable.list = []
  834. }
  835. setTimeout(() => {
  836. this.get_table_dataWater()
  837. this.repairCostTable.listLoading = false
  838. }, 100)
  839. })
  840. },
  841. // 水费
  842. get_table_dataWater() {
  843. this.waterCostTable.listLoading = true
  844. this.waterCostTable.getdataListParm.parammaps.startTime = this.yearDate[0]
  845. this.waterCostTable.getdataListParm.parammaps.endTime = this.yearDate[1]
  846. this.waterCostTable.getdataListParm.parammaps.pastureId = this.pastureId
  847. this.waterCostTable.getdataListParm.parammaps.departmentId = this.departmentId
  848. GetDataByName(this.waterCostTable.getdataListParm).then(response => {
  849. if (response.data.list !== null) {
  850. this.waterCostTable.list = response.data.list
  851. } else {
  852. this.waterCostTable.list = []
  853. }
  854. setTimeout(() => {
  855. this.waterCostTable.listLoading = false
  856. this.get_table_dataElec()
  857. }, 100)
  858. })
  859. },
  860. // 电费
  861. get_table_dataElec() {
  862. this.elecCostTable.listLoading = true
  863. this.elecCostTable.getdataListParm.parammaps.startTime = this.yearDate[0]
  864. this.elecCostTable.getdataListParm.parammaps.endTime = this.yearDate[1]
  865. this.elecCostTable.getdataListParm.parammaps.pastureId = this.pastureId
  866. this.elecCostTable.getdataListParm.parammaps.departmentId = this.departmentId
  867. GetDataByName(this.elecCostTable.getdataListParm).then(response => {
  868. if (response.data.list !== null) {
  869. this.elecCostTable.list = response.data.list
  870. } else {
  871. this.elecCostTable.list = []
  872. }
  873. setTimeout(() => {
  874. this.get_table_dataGas()
  875. this.elecCostTable.listLoading = false
  876. }, 100)
  877. })
  878. },
  879. // 燃动费 table
  880. get_table_dataGas() {
  881. this.gasCostTable.listLoading = true
  882. this.gasCostTable.getdataListParm.parammaps.startTime = this.yearDate[0]
  883. this.gasCostTable.getdataListParm.parammaps.endTime = this.yearDate[1]
  884. this.gasCostTable.getdataListParm.parammaps.pastureId = this.pastureId
  885. this.gasCostTable.getdataListParm.parammaps.departmentId = this.departmentId
  886. GetDataByName(this.gasCostTable.getdataListParm).then(response => {
  887. if (response.data.list !== null) {
  888. this.gasCostTable.list = response.data.list
  889. } else {
  890. this.gasCostTable.list = []
  891. }
  892. setTimeout(() => {
  893. this.gasCostTable.listLoading = false
  894. this.get_table_dataallConsumption()
  895. this.get_table_dataBioConsumptionTable()
  896. }, 100)
  897. })
  898. },
  899. get_table_dataallConsumption() {
  900. this.allConsumptionTable.listLoading = true
  901. this.allConsumptionTable.getdataListParm.parammaps.startTime = this.yearDate[0]
  902. this.allConsumptionTable.getdataListParm.parammaps.endTime = this.yearDate[1]
  903. this.allConsumptionTable.getdataListParm.parammaps.pastureId = this.pastureId
  904. this.allConsumptionTable.getdataListParm.parammaps.departmentId = this.departmentId
  905. let url = 'authdata/waterandelectricity'
  906. let data = this.allConsumptionTable.getdataListParm.parammaps
  907. postJson(url,data).then(response => {
  908. if (response.data.data !== null) {
  909. this.allConsumptionTable.list = response.data.data
  910. } else {
  911. this.allConsumptionTable.list = []
  912. }
  913. setTimeout(() => {
  914. this.allConsumptionTable.listLoading = false
  915. }, 100)
  916. })
  917. },
  918. // 水量 table
  919. get_table_dataWaterConsumption() {
  920. this.waterConsumptionTable.listLoading = true
  921. this.waterConsumptionTable.getdataListParm.parammaps.startTime = this.yearDate[0]
  922. this.waterConsumptionTable.getdataListParm.parammaps.endTime = this.yearDate[1]
  923. this.waterConsumptionTable.getdataListParm.parammaps.pastureId = this.pastureId
  924. this.waterConsumptionTable.getdataListParm.parammaps.departmentId = this.departmentId
  925. GetDataByName(this.waterConsumptionTable.getdataListParm).then(response => {
  926. if (response.data.list !== null) {
  927. this.waterConsumptionTable.list = response.data.list
  928. } else {
  929. this.waterConsumptionTable.list = []
  930. }
  931. setTimeout(() => {
  932. this.get_table_dataElecConsumption()
  933. this.waterConsumptionTable.listLoading = false
  934. }, 100)
  935. })
  936. },
  937. // 电量 table
  938. get_table_dataElecConsumption() {
  939. this.elecConsumptionTable.listLoading = true
  940. this.elecConsumptionTable.getdataListParm.parammaps.startTime = this.yearDate[0]
  941. this.elecConsumptionTable.getdataListParm.parammaps.endTime = this.yearDate[1]
  942. this.elecConsumptionTable.getdataListParm.parammaps.pastureId = this.pastureId
  943. this.elecConsumptionTable.getdataListParm.parammaps.departmentId = this.departmentId
  944. GetDataByName(this.elecConsumptionTable.getdataListParm).then(response => {
  945. if (response.data.list !== null) {
  946. this.elecConsumptionTable.list = response.data.list
  947. } else {
  948. this.elecConsumptionTable.list = []
  949. }
  950. setTimeout(() => {
  951. this.get_table_dataGasConsumption()
  952. this.elecConsumptionTable.listLoading = false
  953. }, 100)
  954. })
  955. },
  956. // 柴油用量 table
  957. get_table_dataGasConsumption() {
  958. this.gasConsumptionTable.listLoading = true
  959. this.gasConsumptionTable.getdataListParm.parammaps.startTime = this.yearDate[0]
  960. this.gasConsumptionTable.getdataListParm.parammaps.endTime = this.yearDate[1]
  961. this.gasConsumptionTable.getdataListParm.parammaps.pastureId = this.pastureId
  962. this.gasConsumptionTable.getdataListParm.parammaps.departmentId = this.departmentId
  963. GetDataByName(this.gasConsumptionTable.getdataListParm).then(response => {
  964. if (response.data.list !== null) {
  965. this.gasConsumptionTable.list = response.data.list
  966. } else {
  967. this.gasConsumptionTable.list = []
  968. }
  969. setTimeout(() => {
  970. this.get_table_dataBioConsumptionTable()
  971. this.gasConsumptionTable.listLoading = false
  972. }, 100)
  973. })
  974. },
  975. //生物质
  976. get_table_dataBioConsumptionTable() {
  977. this.bioConsumptionTable.listLoading = true
  978. this.bioConsumptionTable.getdataListParm.parammaps.startTime = this.yearDate[0]
  979. this.bioConsumptionTable.getdataListParm.parammaps.endTime = this.yearDate[1]
  980. this.bioConsumptionTable.getdataListParm.parammaps.pastureId = this.pastureId
  981. this.bioConsumptionTable.getdataListParm.parammaps.departmentId = this.departmentId
  982. GetDataByName(this.bioConsumptionTable.getdataListParm).then(response => {
  983. if (response.data.list !== null) {
  984. this.bioConsumptionTable.list = response.data.list
  985. } else {
  986. this.bioConsumptionTable.list = []
  987. }
  988. setTimeout(() => {
  989. this.bioConsumptionTable.listLoading = false
  990. }, 100)
  991. })
  992. },
  993. get_table_dataDialog() {
  994. this.dialog.listLoading = true
  995. GetDataByName(this.dialog.getdataListParm).then(response => {
  996. if (response.data.list == null) {
  997. this.dialog.list = response.data.list
  998. this.dialog.pageNum = 0
  999. this.dialog.pageSize = 0
  1000. this.dialog.total = 0
  1001. } else {
  1002. this.dialog.list = response.data.list
  1003. this.dialog.pageNum = response.data.pageNum
  1004. this.dialog.pageSize = response.data.pageSize
  1005. this.dialog.total = response.data.total
  1006. }
  1007. setTimeout(() => {
  1008. this.dialog.listLoading = false
  1009. }, 100)
  1010. })
  1011. },
  1012. // 设备指标-点击
  1013. clickEquipmentIndex(row) {
  1014. if (row.pastureName !== '现代牧业') {
  1015. console.log(this.yearDate, '0000233')
  1016. console.log(this.yearDate[0].substring(0, this.yearDate[0].lastIndexOf('-')), '0000233')
  1017. this.textMap.equipmentIndex = row.pastureName + this.yearDate[0].substring(0, this.yearDate[0].lastIndexOf('-')) + '-' + this.yearDate[1].substring(0, this.yearDate[1].lastIndexOf('-')) + '设备指标'
  1018. this.dialogStatus = 'equipmentIndex'
  1019. this.dialog.dialogFormVisible = true
  1020. this.dialog.getdataListParm.name = 'getChooseEqMonthBudgetListSumAllDepartment'
  1021. this.dialog.getdataListParm.parammaps.startTime = this.yearDate[0]
  1022. this.dialog.getdataListParm.parammaps.endTime = this.yearDate[1]
  1023. this.dialog.getdataListParm.parammaps.pastureId = row.pastureId
  1024. this.get_table_dataDialog()
  1025. }
  1026. },
  1027. // 维修费-点击
  1028. clickRepairCost(row) {
  1029. if (row.pastureName !== '现代牧业') {
  1030. this.textMap.repair = row.pastureName + this.yearDate[0].substring(0, this.yearDate[0].lastIndexOf('-')) + '-' + this.yearDate[1].substring(0, this.yearDate[1].lastIndexOf('-')) + '维修费'
  1031. this.dialogStatus = 'repair'
  1032. this.dialog.dialogFormVisible = true
  1033. this.dialog.getdataListParm.name = 'getChooseMonthWXDepartment'
  1034. this.dialog.getdataListParm.parammaps.startTime = this.yearDate[0]
  1035. this.dialog.getdataListParm.parammaps.endTime = this.yearDate[1]
  1036. this.dialog.getdataListParm.parammaps.pastureId = row.pastureId
  1037. this.get_table_dataDialog()
  1038. }
  1039. },
  1040. // 水费-点击
  1041. clickWaterCost(row) {
  1042. if (row.pastureName !== '现代牧业') {
  1043. this.textMap.water = row.pastureName + this.yearDate[0].substring(0, this.yearDate[0].lastIndexOf('-')) + '-' + this.yearDate[1].substring(0, this.yearDate[1].lastIndexOf('-')) + '水费'
  1044. this.dialogStatus = 'water'
  1045. this.dialog.dialogFormVisible = true
  1046. this.dialog.getdataListParm.name = 'getChooseWaterPriceDepartment'
  1047. this.dialog.getdataListParm.parammaps.startTime = this.yearDate[0]
  1048. this.dialog.getdataListParm.parammaps.endTime = this.yearDate[1]
  1049. this.dialog.getdataListParm.parammaps.pastureId = row.pastureId
  1050. this.get_table_dataDialog()
  1051. }
  1052. },
  1053. // 电费-点击
  1054. clickElecCost(row) {
  1055. if (row.pastureName !== '现代牧业') {
  1056. this.textMap.elec = row.pastureName + this.yearDate[0].substring(0, this.yearDate[0].lastIndexOf('-')) + '-' + this.yearDate[1].substring(0, this.yearDate[1].lastIndexOf('-')) + '电费'
  1057. this.dialogStatus = 'elec'
  1058. this.dialog.dialogFormVisible = true
  1059. this.dialog.getdataListParm.name = 'getChooseElectricityPriceDepartment'
  1060. this.dialog.getdataListParm.parammaps.startTime = this.yearDate[0]
  1061. this.dialog.getdataListParm.parammaps.endTime = this.yearDate[1]
  1062. this.dialog.getdataListParm.parammaps.pastureId = row.pastureId
  1063. this.get_table_dataDialog()
  1064. }
  1065. },
  1066. // 柴油费-点击
  1067. clickGasCost(row) {
  1068. if (row.pastureName !== '现代牧业') {
  1069. this.textMap.gas = row.pastureName + this.yearDate[0].substring(0, this.yearDate[0].lastIndexOf('-')) + '-' + this.yearDate[1].substring(0, this.yearDate[1].lastIndexOf('-')) + '柴油费'
  1070. this.dialogStatus = 'gas'
  1071. this.dialog.dialogFormVisible = true
  1072. this.dialog.getdataListParm.name = 'getChooseMonthiolPriceDepartment'
  1073. this.dialog.getdataListParm.parammaps.startTime = this.yearDate[0]
  1074. this.dialog.getdataListParm.parammaps.endTime = this.yearDate[1]
  1075. this.dialog.getdataListParm.parammaps.pastureId = row.pastureId
  1076. this.get_table_dataDialog()
  1077. }
  1078. },
  1079. clickAllConsumption(row) {
  1080. if (row.pastureName !== '现代牧业') {
  1081. this.textMap.allConsumption = row.pastureName + this.yearDate[0].substring(0, this.yearDate[0].lastIndexOf('-')) + '-' + this.yearDate[1].substring(0, this.yearDate[1].lastIndexOf('-')) + '水量'
  1082. this.dialogStatus = 'allConsumption'
  1083. this.dialog.dialogFormVisible = true
  1084. this.dialog.getdataListParm.name = 'getChooseMonthWaterDepartment'
  1085. this.dialog.getdataListParm.parammaps.startTime = this.yearDate[0]
  1086. this.dialog.getdataListParm.parammaps.endTime = this.yearDate[1]
  1087. this.dialog.getdataListParm.parammaps.pastureId = row.pastureId
  1088. this.get_table_dataDialog()
  1089. }
  1090. },
  1091. // 水量-点击
  1092. clickWaterConsumption(row) {
  1093. if (row.pastureName !== '现代牧业') {
  1094. this.textMap.waterConsumption = row.pastureName + this.yearDate[0].substring(0, this.yearDate[0].lastIndexOf('-')) + '-' + this.yearDate[1].substring(0, this.yearDate[1].lastIndexOf('-')) + '水量'
  1095. this.dialogStatus = 'waterConsumption'
  1096. this.dialog.dialogFormVisible = true
  1097. this.dialog.getdataListParm.name = 'getChooseMonthWaterDepartment'
  1098. this.dialog.getdataListParm.parammaps.startTime = this.yearDate[0]
  1099. this.dialog.getdataListParm.parammaps.endTime = this.yearDate[1]
  1100. this.dialog.getdataListParm.parammaps.pastureId = row.pastureId
  1101. this.get_table_dataDialog()
  1102. }
  1103. },
  1104. // 电量-点击
  1105. clickElecConsumption(row) {
  1106. if (row.pastureName !== '现代牧业') {
  1107. this.textMap.elecConsumption = row.pastureName + this.yearDate[0].substring(0, this.yearDate[0].lastIndexOf('-')) + '-' + this.yearDate[1].substring(0, this.yearDate[1].lastIndexOf('-')) + '电量'
  1108. this.dialogStatus = 'elecConsumption'
  1109. this.dialog.dialogFormVisible = true
  1110. this.dialog.getdataListParm.name = 'getChooseMonthElectricityDepartment'
  1111. this.dialog.getdataListParm.parammaps.startTime = this.yearDate[0]
  1112. this.dialog.getdataListParm.parammaps.endTime = this.yearDate[1]
  1113. this.dialog.getdataListParm.parammaps.pastureId = row.pastureId
  1114. this.get_table_dataDialog()
  1115. }
  1116. },
  1117. // 柴油用量-点击
  1118. clickGasConsumption(row) {
  1119. if (row.pastureName !== '现代牧业') {
  1120. this.textMap.gasConsumption = row.pastureName + this.yearDate[0].substring(0, this.yearDate[0].lastIndexOf('-')) + '-' + this.yearDate[1].substring(0, this.yearDate[1].lastIndexOf('-')) + '柴油用量'
  1121. this.dialogStatus = 'gasConsumption'
  1122. this.dialog.dialogFormVisible = true
  1123. this.dialog.getdataListParm.name = 'getChooseMonthOilTDepartment'
  1124. this.dialog.getdataListParm.parammaps.startTime = this.yearDate[0]
  1125. this.dialog.getdataListParm.parammaps.endTime = this.yearDate[1]
  1126. this.dialog.getdataListParm.parammaps.pastureId = row.pastureId
  1127. this.get_table_dataDialog()
  1128. }
  1129. },
  1130. clickBioConsumption(row) {
  1131. if (row.pastureName !== '现代牧业') {
  1132. this.textMap.bioConsumption = row.pastureName + this.yearDate[0].substring(0, this.yearDate[0].lastIndexOf('-')) + '-' + this.yearDate[1].substring(0, this.yearDate[1].lastIndexOf('-')) + '燃动费'
  1133. this.dialogStatus = 'bioConsumption'
  1134. this.dialog.dialogFormVisible = true
  1135. this.dialog.getdataListParm.name = 'getChooseMonthOilTDepartment'
  1136. this.dialog.getdataListParm.parammaps.startTime = this.yearDate[0]
  1137. this.dialog.getdataListParm.parammaps.endTime = this.yearDate[1]
  1138. this.dialog.getdataListParm.parammaps.pastureId = row.pastureId
  1139. this.get_table_dataDialog()
  1140. }
  1141. },
  1142. tableCellStyle({ row, column, rowIndex, columnIndex }) {
  1143. if (columnIndex === 1) {
  1144. if (row.pastureName == '现代牧业') {
  1145. return {
  1146. textDecoration: 'none'
  1147. }
  1148. } else {
  1149. return {
  1150. textDecoration: 'underline'
  1151. }
  1152. }
  1153. }
  1154. return {
  1155. textDecoration: 'none'
  1156. }
  1157. }
  1158. }
  1159. }
  1160. </script>
  1161. <style lang="scss" scoped>
  1162. .dashboard-editor-container {
  1163. padding: 20px;
  1164. background-color: rgb(240, 242, 245);
  1165. h3{
  1166. background:#fff;line-height:50px;margin-bottom: 0;padding-left:10px;
  1167. }
  1168. }
  1169. </style>
  1170. <style type="text/css">
  1171. .el-date-editor .el-range-separator{width: 10%;}
  1172. </style>