index.vue 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891
  1. <template>
  2. <div class="app-container">
  3. <div class="operation">
  4. <el-date-picker v-model="table.getdataListParm.parammaps.inputDatetime" :clearable="false" class="inputDatetime filter-item" type="daterange" :range-separator="$t('common.to')" :start-placeholder="$t('common.startTime')"" :end-placeholder="$t('common.endTime')" style="width: 250px;margin-right: 10px;float: left;" @change="changeDate" />
  5. <el-button class="el-icon-arrow-left elIconArrowLeft" @click="handleBefore" />
  6. <el-button class="el-icon-arrow-right elIconArrowRight" @click="handleNext" />
  7. <el-select v-model="table.getdataListParm.parammaps.search" placeholder="查询" class="filter-item" style="width: 120px;margin-right: 10px;">
  8. <el-option v-for="item in searchList" :key="item.id" :label="item.name" :value="item.id" />
  9. </el-select>
  10. <el-select v-if="table.getdataListParm.parammaps.search == '0'" v-model="table.getdataListParm.parammaps.templetid" clearable filterable placeholder="请输入配方名称" style="width: 180px;" class="filter-item">
  11. <el-option v-for="(item,index) in fenceHouseList" :key="index" :label="item.tname" :value="item.id" />
  12. </el-select>
  13. <el-select v-else v-model="table.getdataListParm.parammaps.barid" clearable filterable placeholder="请选择栏舍" style="width: 180px;" class="filter-item">
  14. <el-option v-for="item in formulaList" :key="item.id" :label="item.bname" :value="item.id" />
  15. </el-select>
  16. <el-button class="successBorder" style="margin-left:10px;" @click="form_search">{{$t('common.query')}}</el-button>
  17. </div>
  18. <div class="search" />
  19. <div class="table">
  20. <el-table
  21. :key="table.tableKey"
  22. v-loading="table.listLoading"
  23. element-loading-text="给我一点时间"
  24. :data="table.list"
  25. border
  26. fit
  27. highlight-current-row
  28. style="width: 100%;"
  29. :row-style="rowStyle"
  30. :cell-style="tableCellStyle"
  31. class="elTable table-fixed"
  32. >
  33. <el-table-column sortable label="配方模板/指标" min-width="98px" align="center">
  34. <template slot-scope="{row}">
  35. <a @click="clickFormulaTemplateIndex(row)">{{ row.tname }}</a>
  36. </template>
  37. </el-table-column>
  38. <el-table-column sortable label="牛头数" prop="ccount" min-width="58px" align="center" />
  39. <el-table-column label="干物质(kg)" align="center">
  40. <el-table-column sortable prop="dry" label="配方量" min-width="58" align="center" />
  41. <el-table-column sortable label="TMR料" min-width="65" align="center">
  42. <template slot-scope="scope">
  43. <span>{{ (scope.row.Hrate * scope.row.dry) | keepTreeNum }}</span>
  44. </template>
  45. </el-table-column>
  46. <el-table-column sortable label="采食量" min-width="58" align="center">
  47. <template slot-scope="scope">
  48. <span>{{ (scope.row.Srate * scope.row.dry) | keepTreeNum }}</span>
  49. </template>
  50. </el-table-column>
  51. </el-table-column>
  52. <el-table-column label="产奶净能(MJ)" align="center">
  53. <el-table-column sortable prop="nm" label="配方量" min-width="58" align="center" />
  54. <el-table-column sortable label="TMR料" min-width="65" align="center">
  55. <template slot-scope="scope">
  56. <span>{{ (scope.row.Hrate * scope.row.nm) | keepTreeNum }}</span>
  57. </template>
  58. </el-table-column>
  59. <el-table-column sortable label="采食量" min-width="58" align="center">
  60. <template slot-scope="scope">
  61. <span>{{ (scope.row.Srate * scope.row.nm) | keepTreeNum }}</span>
  62. </template>
  63. </el-table-column>
  64. </el-table-column>
  65. <el-table-column label="奶牛能量单位(NND)" align="center">
  66. <el-table-column sortable prop="nuint" label="配方量" min-width="58" align="center" />
  67. <el-table-column sortable label="TMR料" min-width="65" align="center">
  68. <template slot-scope="scope">
  69. <span>{{ (scope.row.Hrate * scope.row.nuint) | keepTreeNum }}</span>
  70. </template>
  71. </el-table-column>
  72. <el-table-column sortable label="采食量" min-width="58" align="center">
  73. <template slot-scope="scope">
  74. <span>{{ (scope.row.Srate * scope.row.nuint) | keepTreeNum }}</span>
  75. </template>
  76. </el-table-column>
  77. </el-table-column>
  78. <el-table-column label="粗蛋白(g)" align="center">
  79. <el-table-column prop="cp" label="配方量" min-width="58" align="center" />
  80. <el-table-column label="TMR料" min-width="65" align="center">
  81. <template slot-scope="scope">
  82. <span>{{ (scope.row.Hrate * scope.row.cp) | keepTreeNum }}</span>
  83. </template>
  84. </el-table-column>
  85. <el-table-column sortable label="采食量" min-width="58" align="center">
  86. <template slot-scope="scope">
  87. <span>{{ (scope.row.Srate * scope.row.cp) | keepTreeNum }}</span>
  88. </template>
  89. </el-table-column>
  90. </el-table-column>
  91. <el-table-column label="磷(g)" align="center">
  92. <el-table-column sortable prop="p" label="配方量" min-width="58" align="center" />
  93. <el-table-column sortable label="TMR料" min-width="65" align="center">
  94. <template slot-scope="scope">
  95. <span>{{ (scope.row.Hrate * scope.row.p) | keepTreeNum }}</span>
  96. </template>
  97. </el-table-column>
  98. <el-table-column sortable label="采食量" min-width="58" align="center">
  99. <template slot-scope="scope">
  100. <span>{{ (scope.row.Srate * scope.row.p) | keepTreeNum }}</span>
  101. </template>
  102. </el-table-column>
  103. </el-table-column>
  104. <el-table-column label="产奶净能(MCal/DM)" align="center">
  105. <el-table-column sortable prop="nmd" label="配方量" min-width="58" align="center" />
  106. <el-table-column sortable label="TMR料" min-width="65" align="center">
  107. <template slot-scope="scope">
  108. <span>{{ (scope.row.Hrate * scope.row.nmd) | keepTreeNum }}</span>
  109. </template>
  110. </el-table-column>
  111. <el-table-column sortable label="采食量" min-width="58" align="center">
  112. <template slot-scope="scope">
  113. <span>{{ (scope.row.Srate * scope.row.nmd) | keepTreeNum }}</span>
  114. </template>
  115. </el-table-column>
  116. </el-table-column>
  117. <el-table-column label="粗蛋白(%DM)" align="center">
  118. <el-table-column sortable prop="cpd" label="配方量" min-width="58" align="center" />
  119. <el-table-column sortable label="TMR料" min-width="65" align="center">
  120. <template slot-scope="scope">
  121. <span>{{ (scope.row.Hrate * scope.row.cpd) | keepTreeNum }}</span>
  122. </template>
  123. </el-table-column>
  124. <el-table-column sortable label="采食量" min-width="58" align="center">
  125. <template slot-scope="scope">
  126. <span>{{ (scope.row.Srate * scope.row.cpd) | keepTreeNum }}</span>
  127. </template>
  128. </el-table-column>
  129. </el-table-column>
  130. <el-table-column label="脂肪(%DM)" align="center">
  131. <el-table-column sortable prop="fat" label="配方量" min-width="58" align="center" />
  132. <el-table-column sortable label="TMR料" min-width="65" align="center">
  133. <template slot-scope="scope">
  134. <span>{{ (scope.row.Hrate * scope.row.fat) | keepTreeNum }}</span>
  135. </template>
  136. </el-table-column>
  137. <el-table-column sortable label="采食量" min-width="58" align="center">
  138. <template slot-scope="scope">
  139. <span>{{ (scope.row.Srate * scope.row.fat) | keepTreeNum }}</span>
  140. </template>
  141. </el-table-column>
  142. </el-table-column>
  143. <el-table-column label="淀粉(%DM)" align="center">
  144. <el-table-column sortable prop="starch" label="配方量" min-width="58" align="center" />
  145. <el-table-column sortable label="TMR料" min-width="65" align="center">
  146. <template slot-scope="scope">
  147. <span>{{ (scope.row.Hrate * scope.row.starch) | keepTreeNum }}</span>
  148. </template>
  149. </el-table-column>
  150. <el-table-column sortable label="采食量" min-width="58" align="center">
  151. <template slot-scope="scope">
  152. <span>{{ (scope.row.Srate * scope.row.starch) | keepTreeNum }}</span>
  153. </template>
  154. </el-table-column>
  155. </el-table-column>
  156. <el-table-column label="NDF(%DM)" align="center">
  157. <el-table-column sortable prop="ndf" label="配方量" min-width="58" align="center" />
  158. <el-table-column sortable label="TMR料" min-width="65" align="center">
  159. <template slot-scope="scope">
  160. <span>{{ (scope.row.Hrate * scope.row.ndf) | keepTreeNum }}</span>
  161. </template>
  162. </el-table-column>
  163. <el-table-column sortable label="采食量" min-width="58" align="center">
  164. <template slot-scope="scope">
  165. <span>{{ (scope.row.Srate * scope.row.ndf) | keepTreeNum }}</span>
  166. </template>
  167. </el-table-column>
  168. </el-table-column>
  169. <el-table-column label="粗料中的NDF(%DM)" align="center">
  170. <el-table-column sortable prop="cndf" label="配方量" min-width="58" align="center" />
  171. <el-table-column sortable label="TMR料" min-width="65" align="center">
  172. <template slot-scope="scope">
  173. <span>{{ (scope.row.Hrate * scope.row.cndf) | keepTreeNum }}</span>
  174. </template>
  175. </el-table-column>
  176. <el-table-column sortable label="采食量" min-width="58" align="center">
  177. <template slot-scope="scope">
  178. <span>{{ (scope.row.Srate * scope.row.cndf) | keepTreeNum }}</span>
  179. </template>
  180. </el-table-column>
  181. </el-table-column>
  182. <el-table-column label="ADF(%DM)" align="center">
  183. <el-table-column sortable prop="adf" label="配方量" min-width="58" align="center" />
  184. <el-table-column sortable label="TMR料" min-width="65" align="center">
  185. <template slot-scope="scope">
  186. <span>{{ (scope.row.Hrate * scope.row.adf) | keepTreeNum }}</span>
  187. </template>
  188. </el-table-column>
  189. <el-table-column sortable label="采食量" min-width="58" align="center">
  190. <template slot-scope="scope">
  191. <span>{{ (scope.row.Srate * scope.row.adf) | keepTreeNum }}</span>
  192. </template>
  193. </el-table-column>
  194. </el-table-column>
  195. <el-table-column label="钙(%DM)" align="center">
  196. <el-table-column sortable prop="cad" label="配方量" min-width="58" align="center" />
  197. <el-table-column sortable label="TMR料" min-width="65" align="center">
  198. <template slot-scope="scope">
  199. <span>{{ (scope.row.Hrate * scope.row.cad) | keepTreeNum }}</span>
  200. </template>
  201. </el-table-column>
  202. <el-table-column sortable label="采食量" min-width="58" align="center">
  203. <template slot-scope="scope">
  204. <span>{{ (scope.row.Srate * scope.row.cad) | keepTreeNum }}</span>
  205. </template>
  206. </el-table-column>
  207. </el-table-column>
  208. <el-table-column label="磷(%DM)" align="center">
  209. <el-table-column sortable prop="pd" label="配方量" min-width="58" align="center" />
  210. <el-table-column sortable label="TMR料" min-width="65" align="center">
  211. <template slot-scope="scope">
  212. <span>{{ (scope.row.Hrate * scope.row.pd) | keepTreeNum }}</span>
  213. </template>
  214. </el-table-column>
  215. <el-table-column sortable label="采食量" min-width="58" align="center">
  216. <template slot-scope="scope">
  217. <span>{{ (scope.row.Srate * scope.row.pd) | keepTreeNum }}</span>
  218. </template>
  219. </el-table-column>
  220. </el-table-column>
  221. <el-table-column sortable label="精粗比(%)" align="center">
  222. <el-table-column sortable prop="jcrate" label="配方量" min-width="58" align="center" />
  223. <el-table-column sortable label="TMR料" min-width="65" align="center">
  224. <template slot-scope="scope">
  225. <span>{{ (scope.row.Hrate * scope.row.jcrate) | keepTreeNum }}</span>
  226. </template>
  227. </el-table-column>
  228. <el-table-column sortable label="采食量" min-width="58" align="center">
  229. <template slot-scope="scope">
  230. <span>{{ (scope.row.Srate * scope.row.jcrate) | keepTreeNum }}</span>
  231. </template>
  232. </el-table-column>
  233. </el-table-column>
  234. <el-table-column label="操作" align="center" width="70" class-name="small-padding fixed-width" fixed="right">
  235. <template slot-scope="{row}">
  236. <el-button class="miniSuccess" icon="el-icon-search" @click="form_see(row)" />
  237. </template>
  238. </el-table-column>
  239. </el-table>
  240. <pagination v-show="table.total>0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
  241. </div>
  242. <!-- 查看 -->
  243. <el-dialog :fullscreen="dialogFull" :destroy-on-close="true" class="dialogMinHeight" :visible.sync="see.dialogFormVisible" :close-on-click-modal="false" width="90%">
  244. <template slot="title">
  245. <div class="avue-crud__dialog__header">
  246. <span class="el-dialog__title">
  247. <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
  248. {{ textMap[see.dialogStatus] }}
  249. </span>
  250. <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
  251. <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
  252. <svg-icon v-else icon-class="fullscreen" />
  253. </div>
  254. </div>
  255. </template>
  256. <div class="app-see dialogMinHeight">
  257. <div class="tableSee">
  258. <el-table
  259. :key="see.table.tableKey"
  260. v-loading="see.table.listLoading"
  261. element-loading-text="给我一点时间"
  262. :data="see.table.list"
  263. border
  264. fit
  265. show-summary
  266. highlight-current-row
  267. style="width: 100%;"
  268. :row-style="rowStyle"
  269. :cell-style="tableCellStyle"
  270. class="elTable table-fixed"
  271. >
  272. <el-table-column label="栏舍/指标" min-width="100px" align="center">
  273. <template slot-scope="{row}">
  274. <a @click="clickFormulaHurdlesIndex(row)">{{ row.barname }}</a>
  275. </template>
  276. </el-table-column>
  277. <el-table-column label="牛头数" min-width="100px" align="center" prop="ccount" />
  278. <el-table-column label="干物质(kg)" min-width="130px" align="center">
  279. <el-table-column prop="dry-nur" label="奶牛需要" min-width="70" align="center" />
  280. <el-table-column prop="dry-FT" label="配方量" min-width="58" align="center" />
  281. <el-table-column prop="dry-H" label="TMR料" min-width="65" align="center" />
  282. <el-table-column prop="dry-S" label="采食量" min-width="58" align="center" />
  283. </el-table-column>
  284. <el-table-column label="产奶净能(M)" min-width="130px" align="center">
  285. <el-table-column prop="nm-nur" label="奶牛需要" min-width="70" align="center" />
  286. <el-table-column prop="nm-FT" label="配方量" min-width="58" align="center" />
  287. <el-table-column prop="nm-H" label="TMR料" min-width="65" align="center" />
  288. <el-table-column prop="nm-S" label="采食量" min-width="58" align="center" />
  289. </el-table-column>
  290. <el-table-column label="奶牛能量单位(NND)" min-width="130px" align="center">
  291. <el-table-column prop="nuint-nur" label="奶牛需要" min-width="70" align="center" />
  292. <el-table-column prop="nuint-FT" label="配方量" min-width="58" align="center" />
  293. <el-table-column prop="nuint-H" label="TMR料" min-width="65" align="center" />
  294. <el-table-column prop="nuint-S" label="采食量" min-width="58" align="center" />
  295. </el-table-column>
  296. <el-table-column label="粗蛋白(g)" min-width="130px" align="center">
  297. <el-table-column prop="cp-nur" label="奶牛需要" min-width="70" align="center" />
  298. <el-table-column prop="cp-FT" label="配方量" min-width="58" align="center" />
  299. <el-table-column prop="cp-H" label="TMR料" min-width="65" align="center" />
  300. <el-table-column prop="cp-S" label="采食量" min-width="58" align="center" />
  301. </el-table-column>
  302. <el-table-column label="磷(g)" min-width="130px" align="center">
  303. <el-table-column prop="p-nur" label="奶牛需要" min-width="70" align="center" />
  304. <el-table-column prop="p-FT" label="配方量" min-width="58" align="center" />
  305. <el-table-column prop="p-H" label="TMR料" min-width="65" align="center" />
  306. <el-table-column prop="p-S" label="采食量" min-width="58" align="center" />
  307. </el-table-column>
  308. <el-table-column label="产奶净能(MCal/DM)" min-width="130px" align="center">
  309. <el-table-column prop="nmd-nur" label="奶牛需要" min-width="70" align="center" />
  310. <el-table-column prop="nmd-FT" label="配方量" min-width="58" align="center" />
  311. <el-table-column prop="nmd-H" label="TMR料" min-width="65" align="center" />
  312. <el-table-column prop="nmd-S" label="采食量" min-width="58" align="center" />
  313. </el-table-column>
  314. <el-table-column label="粗蛋白(%DM)" min-width="130px" align="center">
  315. <el-table-column prop="cpd-nur" label="奶牛需要" min-width="70" align="center" />
  316. <el-table-column prop="cpd-FT" label="配方量" min-width="58" align="center" />
  317. <el-table-column prop="cpd-H" label="TMR料" min-width="65" align="center" />
  318. <el-table-column prop="cpd-S" label="采食量" min-width="58" align="center" />
  319. </el-table-column>
  320. <el-table-column label="脂肪(%DM)" min-width="130px" align="center">
  321. <el-table-column prop="fat-nur" label="奶牛需要" min-width="70" align="center" />
  322. <el-table-column prop="fat-FT" label="配方量" min-width="58" align="center" />
  323. <el-table-column prop="fat-H" label="TMR料" min-width="65" align="center" />
  324. <el-table-column prop="fat-S" label="采食量" min-width="58" align="center" />
  325. </el-table-column>
  326. <el-table-column label="淀粉(%DM)" min-width="130px" align="center">
  327. <el-table-column prop="starch-nur" label="奶牛需要" min-width="70" align="center" />
  328. <el-table-column prop="starch-FT" label="配方量" min-width="58" align="center" />
  329. <el-table-column prop="starch-H" label="TMR料" min-width="65" align="center" />
  330. <el-table-column prop="starch-S" label="采食量" min-width="58" align="center" />
  331. </el-table-column>
  332. <el-table-column label="NDF(%DM)" min-width="130px" align="center">
  333. <el-table-column prop="ndf-nur" label="奶牛需要" min-width="70" align="center" />
  334. <el-table-column prop="ndf-FT" label="配方量" min-width="58" align="center" />
  335. <el-table-column prop="ndf-H" label="TMR料" min-width="65" align="center" />
  336. <el-table-column prop="ndf-S" label="采食量" min-width="58" align="center" />
  337. </el-table-column>
  338. <el-table-column label="粗料中的NDF(%DM)" min-width="130px" align="center">
  339. <el-table-column prop="cndf-nur" label="奶牛需要" min-width="70" align="center" />
  340. <el-table-column prop="cndf-FT" label="配方量" min-width="58" align="center" />
  341. <el-table-column prop="cndf-H" label="TMR料" min-width="65" align="center" />
  342. <el-table-column prop="cndf-S" label="采食量" min-width="58" align="center" />
  343. </el-table-column>
  344. <el-table-column label="ADF(%DM)" min-width="130px" align="center">
  345. <el-table-column prop="adf-nur" label="奶牛需要" min-width="70" align="center" />
  346. <el-table-column prop="adf-FT" label="配方量" min-width="58" align="center" />
  347. <el-table-column prop="adf-H" label="TMR料" min-width="65" align="center" />
  348. <el-table-column prop="adf-S" label="采食量" min-width="58" align="center" />
  349. </el-table-column>
  350. <el-table-column label="钙(%DM)" min-width="130px" align="center">
  351. <el-table-column prop="cad-nur" label="奶牛需要" min-width="70" align="center" />
  352. <el-table-column prop="cad-FT" label="配方量" min-width="58" align="center" />
  353. <el-table-column prop="cad-H" label="TMR料" min-width="65" align="center" />
  354. <el-table-column prop="cad-S" label="采食量" min-width="58" align="center" />
  355. </el-table-column>
  356. <el-table-column label="磷(%DM)" min-width="130px" align="center">
  357. <el-table-column prop="pd-nur" label="奶牛需要" min-width="70" align="center" />
  358. <el-table-column prop="pd-FT" label="配方量" min-width="58" align="center" />
  359. <el-table-column prop="pd-H" label="TMR料" min-width="65" align="center" />
  360. <el-table-column prop="pd-S" label="采食量" min-width="58" align="center" />
  361. </el-table-column>
  362. <el-table-column label="(4.0)饲料转化效率(kg/DM)" min-width="130px" align="center">
  363. <el-table-column prop="trans4f-nur" label="奶牛需要" min-width="70" align="center" />
  364. <el-table-column prop="trans4f-FT" label="配方量" min-width="58" align="center" />
  365. <el-table-column prop="trans4f-H" label="TMR料" min-width="65" align="center" />
  366. <el-table-column prop="trans4f-S" label="采食量" min-width="58" align="center" />
  367. </el-table-column>
  368. <el-table-column label="(3.5)饲料转化效率(kg/DM)" min-width="130px" align="center">
  369. <el-table-column prop="trans35f-nur" label="奶牛需要" min-width="70" align="center" />
  370. <el-table-column prop="trans35f-FT" label="配方量" min-width="58" align="center" />
  371. <el-table-column prop="trans35f-H" label="TMR料" min-width="65" align="center" />
  372. <el-table-column prop="trans35f-S" label="采食量" min-width="58" align="center" />
  373. </el-table-column>
  374. <el-table-column label="精粗比(%)" min-width="130px" align="center">
  375. <el-table-column prop="jcrate-nur" label="奶牛需要" min-width="70" align="center" />
  376. <el-table-column prop="jcrate-FT" label="配方量" min-width="58" align="center" />
  377. <el-table-column prop="jcrate-H" label="TMR料" min-width="65" align="center" />
  378. <el-table-column prop="jcrate-S" label="采食量" min-width="58" align="center" />
  379. </el-table-column>
  380. <el-table-column label="日粮成本(元)" min-width="130px" align="center">
  381. <el-table-column prop="uprice-nur" label="奶牛需要" min-width="70" align="center" />
  382. <el-table-column prop="uprice-FT" label="配方量" min-width="58" align="center" />
  383. <el-table-column prop="uprice-H" label="TMR料" min-width="65" align="center" />
  384. <el-table-column prop="uprice-S" label="采食量" min-width="58" align="center" />
  385. </el-table-column>
  386. <el-table-column label="干物质成本(元/公斤)" min-width="130px" align="center">
  387. <el-table-column prop="upriced-nur" label="奶牛需要" min-width="70" align="center" />
  388. <el-table-column prop="upriced-FT" label="配方量" min-width="58" align="center" />
  389. <el-table-column prop="upriced-H" label="TMR料" min-width="65" align="center" />
  390. <el-table-column prop="upriced-S" label="采食量" min-width="58" align="center" />
  391. </el-table-column>
  392. <el-table-column label="日公斤奶成本(元)" min-width="130px" align="center">
  393. <el-table-column prop="kprice-nur" label="奶牛需要" min-width="70" align="center" />
  394. <el-table-column prop="kprice-FT" label="配方量" min-width="58" align="center" />
  395. <el-table-column prop="kprice-H" label="TMR料" min-width="65" align="center" />
  396. <el-table-column prop="kprice-S" label="采食量" min-width="58" align="center" />
  397. </el-table-column>
  398. </el-table>
  399. </div>
  400. </div>
  401. <div slot="footer" class="dialog-footer" style="bottom: 10px;">
  402. <el-button class="cancelClose" style="right: 20px" @click="see.dialogFormVisible = false;$route.params.tname = '' ">{{$t('common.closed')}}</el-button>
  403. </div>
  404. </el-dialog>
  405. <!-- 配方详情 -->
  406. <el-dialog :fullscreen="dialogFull" :destroy-on-close="true" :visible.sync="details.dialogFormVisible" :close-on-click-modal="false" width="90%">
  407. <template slot="title">
  408. <div class="avue-crud__dialog__header">
  409. <span class="el-dialog__title">
  410. <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
  411. {{ textMap[details.dialogStatus] }}
  412. </span>
  413. <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
  414. <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
  415. <svg-icon v-else icon-class="fullscreen" />
  416. </div>
  417. </div>
  418. </template>
  419. <div class="details dialogMinHeight">
  420. <el-form ref="temp" :rules="details.rules" :model="details.temp" label-position="right" label-width="120px" style="width: 100%;margin-bottom:30px">
  421. <el-row>
  422. <el-col :span="8">
  423. <el-form-item label="历史记录时间:" prop="maxDate">
  424. <el-date-picker v-model="details.temp.maxDate" :clearable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd" type="date" placeholder="请选择历史记录时间" @change="changeMaxDate" />
  425. </el-form-item>
  426. </el-col>
  427. </el-row>
  428. </el-form>
  429. <div class="table1">
  430. <div ref="templateDialog" class="templateDialog">
  431. <div class="recipeTemplateF">
  432. <p>配方模板表</p>
  433. </div>
  434. </div>
  435. <el-table
  436. :key="details.table1.tableKey"
  437. v-loading="details.table1.listLoading"
  438. element-loading-text="给我一点时间"
  439. :data="details.table1.list"
  440. border
  441. fit
  442. highlight-current-row
  443. style="width: 100%;"
  444. :row-style="rowStyle"
  445. :cell-style="cellStyle"
  446. class="elTable table-fixed"
  447. >
  448. <el-table-column label="序号" type="index" width="50" align="center" />
  449. <el-table-column label="配方名称" min-width="100px" align="center" prop="tname" />
  450. <el-table-column label="牲畜类别" min-width="100px" align="center" prop="ccname" />
  451. <el-table-column label="配方类型" min-width="100px" align="center" prop="fttype" />
  452. <el-table-column label="来源" min-width="100px" align="center" prop="source" />
  453. <el-table-column label="版本号" min-width="100px" align="center" prop="version" />
  454. <el-table-column label="版本时间" min-width="100px" align="center" prop="versiontime" />
  455. </el-table>
  456. </div>
  457. <div class="table2 detailDialog">
  458. <div class="recipeTemplateF">
  459. <p>配方详情表</p>
  460. </div>
  461. <el-table
  462. :key="details.table2.tableKey"
  463. v-loading="details.table2.listLoading"
  464. element-loading-text="给我一点时间"
  465. :data="details.table2.list"
  466. border
  467. fit
  468. show-summary
  469. highlight-current-row
  470. style="width: 100%;"
  471. :row-style="rowStyle"
  472. :cell-style="cellStyle"
  473. class="elTable table-fixed"
  474. >
  475. <el-table-column label="序号" type="index" width="50" align="center" />
  476. <el-table-column label="饲料组" min-width="100px" align="center" prop="feedgroup" />
  477. <el-table-column label="饲料名称" min-width="100px" align="center" prop="fname" />
  478. <el-table-column label="重量(KG)" min-width="100px" align="center" prop="fweight" />
  479. <el-table-column label="搅拌延时(min)" min-width="100px" align="center" prop="autosecond" />
  480. <el-table-column label="是否锁定牛头数比例" min-width="100" align="center">
  481. <template slot-scope="scope">
  482. <span v-if="scope.row.islockcount == '0'">否</span>
  483. <span v-if="scope.row.islockcount == '1'">是</span>
  484. </template>
  485. </el-table-column>
  486. <el-table-column label="顺序" min-width="100" align="center">
  487. <template slot-scope="scope">
  488. <span>{{ scope.row.sort }}</span>
  489. </template>
  490. </el-table-column>
  491. </el-table>
  492. </div>
  493. </div>
  494. <div slot="footer" class="dialog-footer" style="bottom: 10px;">
  495. <el-button class="cancelClose" style="right: 20px" @click="details.dialogFormVisible = false;">{{$t('common.closed')}}</el-button>
  496. </div>
  497. </el-dialog>
  498. </div>
  499. </template>
  500. <script>
  501. import { GetDataByName, postJson } from '@/api/common'
  502. import Cookies from 'js-cookie'
  503. import Pagination from '@/components/Pagination'
  504. import { parseTime } from '@/utils/index.js'
  505. export default {
  506. name: 'FormulationEvaluation',
  507. components: { Pagination },
  508. filters: {
  509. keepTreeNum(value) {
  510. value = Number(value)
  511. return value.toFixed(3)
  512. }
  513. },
  514. data() {
  515. return {
  516. dialogFull: false,
  517. searchList: [{ id: '0', name: '按配方查询' }, { id: '1', name: '按栏舍查询' }],
  518. formulaList: [],
  519. fenceHouseList: [],
  520. table: {
  521. getdataListParm: {
  522. name: 'judgenurFTReport',
  523. page: 1,
  524. offset: 1,
  525. pagecount: parseInt(Cookies.get('pageCount')),
  526. returntype: 'Map',
  527. parammaps: {
  528. pastureid: Cookies.get('pastureid'),
  529. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  530. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  531. inputDatetime: [new Date(), new Date()],
  532. search: '0',
  533. templetid:'',
  534. barid:''
  535. }
  536. },
  537. tableKey: 1,
  538. list: [],
  539. total: 0,
  540. listLoading: true,
  541. temp: {}
  542. },
  543. see: {
  544. dialogFormVisible: false,
  545. dialogStatus: '',
  546. temp: {},
  547. rules: {},
  548. table: {
  549. tableKey: 0,
  550. list: [],
  551. total: 0,
  552. listLoading: true,
  553. getdataListParm: {
  554. name: 'judgenurFTReport',
  555. page: 1,
  556. offset: 1,
  557. pagecount: 0,
  558. returntype: 'Map',
  559. parammaps: {
  560. name: 'judgenurBarBmReport',
  561. name1: 'judgenurBarHSL'
  562. }
  563. }
  564. }
  565. },
  566. details: {
  567. dialogFormVisible: false,
  568. dialogStatus: '',
  569. temp: {
  570. maxDate: ''
  571. },
  572. rules: {},
  573. table1: {
  574. tableKey: 0,
  575. list: [],
  576. total: 0,
  577. listLoading: true,
  578. getdataListParm: {
  579. name: 'getFTListDateHis',
  580. page: 1,
  581. offset: 1,
  582. pagecount: 10,
  583. returntype: 'Map',
  584. parammaps: {
  585. pastureid: '',
  586. id: ''
  587. }
  588. }
  589. },
  590. table2: {
  591. tableKey: 0,
  592. list: [],
  593. total: 0,
  594. listLoading: true,
  595. getdataListParm: {
  596. name: 'getFTdetailListDate',
  597. page: 1,
  598. offset: 1,
  599. pagecount: 10,
  600. returntype: 'Map',
  601. parammaps: {
  602. pastureid: '',
  603. ftid: '',
  604. date: '',
  605. version: ''
  606. }
  607. }
  608. },
  609. maxDate: {
  610. getdataListParm: {
  611. name: 'getFTMaxDate',
  612. page: 1,
  613. offset: 1,
  614. pagecount: 10,
  615. returntype: 'Map',
  616. parammaps: {
  617. pastureid: ''
  618. }
  619. }
  620. }
  621. },
  622. textMap: {
  623. see: '',
  624. details: '配方详情'
  625. },
  626. rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
  627. cellStyle: { padding: 0 + 'px' }
  628. }
  629. },
  630. created() {
  631. if (this.$route.params.tname !== '' && this.$route.params.tname !== undefined && this.$route.params.startTime !== undefined && this.$route.params.stopTime !== undefined) {
  632. console.log(this.table.getdataListParm.parammaps.inputDatetime, 'this.table.getdataListParm.parammaps.inputDatetime')
  633. this.table.getdataListParm.parammaps.startTime = this.$route.params.startTime
  634. this.table.getdataListParm.parammaps.stopTime = this.$route.params.stopTime
  635. this.textMap.see = '栏舍详情——' + this.$route.params.tname
  636. setTimeout(() => {
  637. this.dialogFull = false
  638. this.see.dialogStatus = 'see'
  639. this.see.dialogFormVisible = true
  640. }, 500)
  641. this.see.table.getdataListParm.parammaps.ftid = this.$route.params.ftid
  642. this.see.table.getdataListParm.parammaps.pastureid = this.$route.params.pastureid
  643. this.see.table.getdataListParm.parammaps.startTime = this.table.getdataListParm.parammaps.startTime
  644. this.see.table.getdataListParm.parammaps.stopTime = this.table.getdataListParm.parammaps.stopTime
  645. this.getListSee()
  646. }
  647. this.getList()
  648. this.getformulaList()
  649. this.getfenceHouseList()
  650. },
  651. methods: {
  652. getformulaList(){
  653. const url = 'authdata/GetDataByName'
  654. const data = {}
  655. data.name = 'getBarListEnable'
  656. data.parammaps = {}
  657. data.parammaps.pastureid = Cookies.get('pastureid')
  658. postJson(url, data).then(response => {
  659. if(response.data.list !== null){
  660. this.formulaList = response.data.list
  661. }else{
  662. this.formulaList = []
  663. }
  664. })
  665. },
  666. getfenceHouseList(){
  667. const url = 'authdata/GetDataByName'
  668. const data = {}
  669. data.name = 'getFeedTempletName'
  670. postJson(url, data).then(response => {
  671. if(response.data.list !== null){
  672. this.fenceHouseList = response.data.list
  673. }else{
  674. this.fenceHouseList = []
  675. }
  676. })
  677. },
  678. getList() {
  679. this.table.listLoading = true
  680. GetDataByName(this.table.getdataListParm).then(response => {
  681. console.log('table数据', response.data.list)
  682. if (response.data.list !== null) {
  683. this.table.list = response.data.list
  684. this.table.pageNum = response.data.pageNum
  685. this.table.pageSize = response.data.pageSize
  686. this.table.total = response.data.total
  687. } else {
  688. this.table.list = []
  689. this.table.pageNum = 0
  690. this.table.pageSize = 0
  691. this.table.total = 0
  692. }
  693. setTimeout(() => {
  694. this.table.listLoading = false
  695. }, 100)
  696. })
  697. },
  698. form_search() {
  699. if(this.table.getdataListParm.parammaps.search == '0'){
  700. this.table.getdataListParm.parammaps.barid = ''
  701. }else{
  702. this.table.getdataListParm.parammaps.templetid = ''
  703. console.log(this.table.getdataListParm.parammaps.barid)
  704. }
  705. this.getList()
  706. },
  707. changeDate() {
  708. if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
  709. this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  710. this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  711. this.getList()
  712. }
  713. },
  714. handleBefore() {
  715. if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
  716. var start = new Date(this.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
  717. var stop = new Date(this.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
  718. this.table.getdataListParm.parammaps.inputDatetime.length = 0
  719. this.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
  720. this.$forceUpdate()
  721. }
  722. this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  723. this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  724. this.getList()
  725. },
  726. handleNext() {
  727. if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
  728. var start2 = new Date(this.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1))
  729. var stop2 = new Date(this.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1))
  730. this.table.getdataListParm.parammaps.inputDatetime.length = 0
  731. this.table.getdataListParm.parammaps.inputDatetime.push(start2, stop2)
  732. this.$forceUpdate()
  733. }
  734. this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  735. this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  736. this.getList()
  737. },
  738. tableCellStyle({ row, column, rowIndex, columnIndex }) {
  739. if (columnIndex === 0) {
  740. return {
  741. textDecoration: 'underline'
  742. }
  743. }
  744. return {
  745. textDecoration: 'none'
  746. }
  747. },
  748. clickFormulaTemplateIndex(row) {
  749. console.log('点击了配方模板/指标')
  750. this.dialogFull = false
  751. this.details.dialogStatus = 'details'
  752. this.details.dialogFormVisible = true
  753. this.details.table1.getdataListParm.parammaps.pastureid = row.pastureid
  754. this.details.table1.getdataListParm.parammaps.id = row.ftid
  755. this.details.maxDate.getdataListParm.parammaps.pastureid = row.pastureid
  756. this.getMaxDate()
  757. },
  758. getMaxDate() {
  759. GetDataByName(this.details.maxDate.getdataListParm).then(response => {
  760. if (response.data.list !== null) {
  761. this.details.temp.maxDate = response.data.list[0].maxdate
  762. } else {
  763. this.details.temp.maxDate = ''
  764. }
  765. this.details.table1.getdataListParm.parammaps.date = this.details.temp.maxDate
  766. this.details.table2.getdataListParm.parammaps.date = this.details.temp.maxDate
  767. this.getListDetails1()
  768. })
  769. },
  770. changeMaxDate(item) {
  771. this.details.table1.getdataListParm.parammaps.date = this.details.temp.maxDate
  772. this.getListDetails1()
  773. },
  774. getListDetails1() {
  775. this.details.table1.listLoading = true
  776. GetDataByName(this.details.table1.getdataListParm).then(response => {
  777. console.log('table数据', response.data.list)
  778. if (response.data.list !== null) {
  779. this.details.table1.list = response.data.list
  780. this.details.table1.pageNum = response.data.pageNum
  781. this.details.table1.pageSize = response.data.pageSize
  782. this.details.table1.total = response.data.total
  783. this.details.table2.getdataListParm.parammaps.pastureid = this.details.table1.list[0].pastureid
  784. this.details.table2.getdataListParm.parammaps.ftid = this.details.table1.list[0].id
  785. this.details.table2.getdataListParm.parammaps.version = this.details.table1.list[0].version
  786. this.getListDetails2()
  787. } else {
  788. this.details.table1.list = []
  789. this.details.table2.list = []
  790. this.details.table1.pageNum = 0
  791. this.details.table1.pageSize = 0
  792. this.details.table1.total = 0
  793. }
  794. setTimeout(() => {
  795. this.details.table1.listLoading = false
  796. }, 100)
  797. })
  798. },
  799. getListDetails2() {
  800. this.details.table2.listLoading = true
  801. GetDataByName(this.details.table2.getdataListParm).then(response => {
  802. console.log('table数据', response.data.list)
  803. if (response.data.list !== null) {
  804. this.details.table2.list = response.data.list
  805. this.details.table2.pageNum = response.data.pageNum
  806. this.details.table2.pageSize = response.data.pageSize
  807. this.details.table2.total = response.data.total
  808. } else {
  809. this.details.table2.list = []
  810. this.details.table2.pageNum = 0
  811. this.details.table2.pageSize = 0
  812. this.details.table2.total = 0
  813. }
  814. setTimeout(() => {
  815. this.details.table2.listLoading = false
  816. }, 100)
  817. })
  818. },
  819. clickFormulaHurdlesIndex(row) {
  820. console.log('点击了栏舍/指标')
  821. this.$router.push('/formulationPlan/DhedFormula')
  822. },
  823. form_see(row) {
  824. console.log('查看', row)
  825. this.dialogFull = false
  826. this.textMap.see = '栏舍详情——' + row.tname
  827. this.see.dialogStatus = 'see'
  828. this.see.dialogFormVisible = true
  829. this.see.table.getdataListParm.parammaps.ftid = row.ftid
  830. this.see.table.getdataListParm.parammaps.pastureid = row.pastureid
  831. this.see.table.getdataListParm.parammaps.startTime = this.table.getdataListParm.parammaps.startTime
  832. this.see.table.getdataListParm.parammaps.stopTime = this.table.getdataListParm.parammaps.stopTime
  833. this.getListSee()
  834. },
  835. getListSee() {
  836. this.see.table.listLoading = true
  837. const url = 'authdata/GETNurJudgeRport'
  838. const data = this.see.table.getdataListParm
  839. postJson(url, data).then(response => {
  840. if (response.data !== null) {
  841. console.log('table数据', response.data)
  842. this.see.table.list = response.data
  843. this.see.table.pageNum = response.data.pageNum
  844. this.see.table.pageSize = response.data.pageSize
  845. this.see.table.total = response.data.total
  846. } else {
  847. this.see.table.list = []
  848. this.see.table.pageNum = 0
  849. this.see.table.pageSize = 0
  850. this.see.table.total = 0
  851. }
  852. setTimeout(() => {
  853. this.see.table.listLoading = false
  854. }, 100)
  855. })
  856. }
  857. }
  858. }
  859. </script>
  860. <style lang="scss" scoped>
  861. .search {clear: both; }
  862. .table { margin-top: 10px; }
  863. .table2{margin-top: 20px;}
  864. .templateDialog{
  865. background: #fff;
  866. position: relative;
  867. }
  868. .detailDialog{
  869. background: #fff;
  870. position: relative;
  871. }
  872. </style>
  873. <style>
  874. .tableSee .el-table { overflow-x: auto; }
  875. .tableSee .el-table__header-wrapper,
  876. .tableSee .el-table__body-wrapper,
  877. .tableSee .el-table__footer-wrapper { overflow: visible; }
  878. .tableSee .el-table::after { position: relative; }
  879. .tableSee .el-table--scrollable-x .el-table__body-wrapper { overflow: visible; }
  880. .app-main{background: #fff;}
  881. </style>