5d1d4fc40a2876a5138a51421e3c61076302ebc2.svn-base 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  1. <template>
  2. <div class="app-history" style="height: 550px;overflow: auto;">
  3. <div class="search">
  4. <el-date-picker v-model="table.getdataListParm.parammaps.date" type="date" placeholder="请选择历史记录时间" :clearable="false" style="width: 230px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="changeDate" />
  5. </div>
  6. <div ref="template" class="template">
  7. <!-- <p class="recipeTemplate" /> -->
  8. <div class="recipeTemplate">
  9. <p>日执行计划</p>
  10. </div>
  11. <div class="table">
  12. <el-table
  13. :key="table.tableKey"
  14. v-loading="table.listLoading"
  15. element-loading-text="给我一点时间"
  16. :data="table.list"
  17. border
  18. fit
  19. highlight-current-row
  20. style="width: 98%;"
  21. :row-style="rowStyle"
  22. :cell-style="cellStyle"
  23. class="elTable table-fixed"
  24. @row-click="tableRowClick"
  25. >
  26. <el-table-column label="序号" align="center" type="index" width="50px" />
  27. <el-table-column label="计划名称" min-width="130px" align="center">
  28. <template slot-scope="scope">
  29. <span>{{ scope.row.projname }}</span>
  30. </template>
  31. </el-table-column>
  32. <el-table-column label="计划类型" prop="weight" min-width="130px" align="center" :formatter="lpplantype" />
  33. <el-table-column label="TMR编号" min-width="130px" align="center">
  34. <template slot-scope="scope">
  35. <span>{{ scope.row.tmrtname }}</span>
  36. </template>
  37. </el-table-column>
  38. <el-table-column label="驾驶员" min-width="130px" align="center">
  39. <template slot-scope="scope">
  40. <span>{{ scope.row.driver }}</span>
  41. </template>
  42. </el-table-column>
  43. <el-table-column label="已执行" min-width="130px" align="center">
  44. <template slot-scope="scope">
  45. <span>{{ scope.row.havebutton }}</span>
  46. </template>
  47. </el-table-column>
  48. <el-table-column label="班次" min-width="180px" align="center">
  49. <template slot-scope="scope">
  50. <span>{{ scope.row.times }}</span>
  51. </template>
  52. </el-table-column>
  53. <el-table-column label="理论量" min-width="180px" align="center">
  54. <template slot-scope="scope">
  55. <span>{{ scope.row.lweight }}</span>
  56. </template>
  57. </el-table-column>
  58. <el-table-column label="时间" min-width="180px" align="center">
  59. <template slot-scope="scope">
  60. <span>{{ scope.row.plantime }}</span>
  61. </template>
  62. </el-table-column>
  63. <el-table-column label="发料位" min-width="180px" align="left">
  64. <template slot-scope="scope">
  65. <span>{{ scope.row.barnames }}</span>
  66. </template>
  67. </el-table-column>
  68. </el-table>
  69. </div>
  70. </div>
  71. <div class="content">
  72. <div class="table2">
  73. <p class="contentOperation" />
  74. <div class="contentOperation">
  75. <p>计划内容<br>操作详情</p>
  76. </div>
  77. <div class="content-table">
  78. <el-table
  79. :key="table2.tableKey"
  80. v-loading="table2.listLoading"
  81. element-loading-text="给我一点时间"
  82. :data="table2.list"
  83. fit
  84. highlight-current-row
  85. style="width: 100%;"
  86. height="450"
  87. :row-style="rowStyle"
  88. :cell-style="cellStyle"
  89. class="elTable table-fixed"
  90. >
  91. <el-table-column label="操作序号" min-width="130px" align="center">
  92. <template slot-scope="scope">
  93. <span>{{ scope.row.sort }}</span>
  94. </template>
  95. </el-table-column>
  96. <el-table-column label="饲料名称" prop="fname" min-width="130px" align="center">
  97. <template slot-scope="scope">
  98. <span>{{ scope.row.fname }}</span>
  99. </template>
  100. </el-table-column>
  101. <el-table-column label="设计重量(KG)" prop="weight" min-width="130px" align="center">
  102. <template slot-scope="scope">
  103. <span>{{ scope.row.weight }}</span>
  104. </template>
  105. </el-table-column>
  106. </el-table>
  107. </div>
  108. </div>
  109. <div class="table3">
  110. <p class="stallRetails" />
  111. <div class="contentOperation">
  112. <p>计划内容<br>栏舍详情</p>
  113. </div>
  114. <div class="content-table">
  115. <el-table
  116. :key="table3.tableKey"
  117. v-loading="table3.listLoading"
  118. element-loading-text="给我一点时间"
  119. :data="table3.list"
  120. height="450"
  121. fit
  122. highlight-current-row
  123. style="width: 100%;"
  124. :row-style="rowStyle"
  125. :cell-style="cellStyle"
  126. class="elTable table-fixed"
  127. >
  128. <el-table-column label=" 操作序号" min-width="130px" align="center">
  129. <template slot-scope="scope">
  130. <span>{{ scope.row.sort }}</span>
  131. </template>
  132. </el-table-column>
  133. <el-table-column label="栏舍编号" min-width="130px" align="center">
  134. <template slot-scope="scope">
  135. <span>{{ scope.row.fname }}</span>
  136. </template>
  137. </el-table-column>
  138. <el-table-column v-if="table3.getdataListParm.parammaps.lpplantype == 3" label="转投栏舍" min-width="130px" align="center">
  139. <template slot-scope="scope">
  140. <span>{{ scope.row.useinbar }}</span>
  141. </template>
  142. </el-table-column>
  143. <el-table-column v-else label="设计重量(KG)" min-width="130px" align="center">
  144. <template slot-scope="scope">
  145. <span>{{ scope.row.weight }}</span>
  146. </template>
  147. </el-table-column>
  148. </el-table>
  149. </div>
  150. </div>
  151. </div>
  152. </div>
  153. </template>
  154. <script>
  155. import { GetDataByName } from '@/api/common'
  156. import { parseTime } from '@/utils/index.js'
  157. import Cookies from 'js-cookie'
  158. export default {
  159. name: 'MaterialIssuancePlan',
  160. display: 'Two list header slot',
  161. data() {
  162. return {
  163. table: {
  164. getdataListParm: {
  165. name: 'getDownloadedplanList',
  166. page: 1,
  167. offset: 1,
  168. pagecount: '',
  169. returntype: 'Map',
  170. parammaps: {
  171. pastureid: Cookies.get('pastureid'),
  172. barid: '',
  173. mydate: parseTime(new Date(), '{y}-{m}-{d}'),
  174. times: '',
  175. lpplantype: ''
  176. }
  177. },
  178. tableKey: 0,
  179. list: [],
  180. total: 0,
  181. listLoading: false
  182. },
  183. // 计划内容操作详情
  184. table2: {
  185. getdataListParm: {
  186. name: 'getDownloadplandtl1ListV2',
  187. page: 1,
  188. offset: 1,
  189. returntype: 'Map',
  190. parammaps: {
  191. pastureid: Cookies.get('pastureid'),
  192. date: '',
  193. id: ''
  194. }
  195. },
  196. tableKey: 0,
  197. list: [],
  198. total: 0,
  199. listLoading: false
  200. },
  201. // 计划内容 舍栏详情
  202. table3: {
  203. getdataListParm: {
  204. name: 'getDownloadplandt2ListV2',
  205. page: 1,
  206. offset: 1,
  207. returntype: 'Map',
  208. parammaps: {
  209. pastureid: Cookies.get('pastureid'),
  210. date: '',
  211. id: ''
  212. }
  213. },
  214. tableKey: 0,
  215. list: [],
  216. total: 0,
  217. listLoading: false
  218. },
  219. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  220. cellStyle: { padding: 0 + 'px' }
  221. }
  222. },
  223. created() {
  224. this.getList()
  225. },
  226. methods: {
  227. getList() {
  228. this.table.listLoading = true
  229. GetDataByName(this.table.getdataListParm).then(response => {
  230. console.log('table数据', response.data.list)
  231. if (response.data.list !== null) {
  232. this.table.list = response.data.list
  233. this.table.pageNum = response.data.pageNum
  234. this.table.pageSize = response.data.pageSize
  235. this.table.total = response.data.total
  236. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  237. this.table3.getdataListParm.parammaps.id = response.data.list[0].id
  238. this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
  239. this.getList2()
  240. this.getList3()
  241. } else {
  242. this.table.list = []
  243. this.table2.getdataListParm.parammaps.id = ''
  244. this.table3.getdataListParm.parammaps.id = ''
  245. // this.getList2()
  246. // this.getList3()
  247. this.table2.list = []
  248. this.table3.list = []
  249. }
  250. setTimeout(() => {
  251. this.table.listLoading = false
  252. }, 100)
  253. })
  254. },
  255. lpplantype: function(cellValue) {
  256. if (cellValue.lpplantype == 2) {
  257. return '撒料'
  258. } else if (cellValue.lpplantype == 4) {
  259. return '预混'
  260. } else if (cellValue.lpplantype == 3) {
  261. return '剩料'
  262. }
  263. },
  264. changeDate(val) {
  265. console.log('选择了日期', val)
  266. this.getList()
  267. this.getList2()
  268. this.getList3()
  269. },
  270. // 日执行计划行点击
  271. tableRowClick(row, column, event) {
  272. console.log(row, column, event)
  273. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  274. this.table2.getdataListParm.parammaps.id = row.id
  275. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  276. this.table3.getdataListParm.parammaps.id = row.id
  277. this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
  278. this.getList2()
  279. this.getList3()
  280. },
  281. // 计划内容操作详情
  282. getList2() {
  283. this.table2.listLoading = true
  284. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  285. GetDataByName(this.table2.getdataListParm).then(response => {
  286. console.log('table数据', response.data.list)
  287. if (response.data.list !== null) {
  288. this.table2.list = response.data.list
  289. const arr = []
  290. var a = 0
  291. let b = this.table2.list[0].sort
  292. let c = 0
  293. for (let i = 0; i < this.table2.list.length; i++) {
  294. if (b !== parseInt(this.table2.list[i].sort)) {
  295. b = this.table2.list[i].sort
  296. arr.push({ 'sort': '小计', 'weight': a.toFixed(2) })
  297. a = 0
  298. }
  299. a = a + parseFloat(this.table2.list[i].weight)
  300. c = c + parseFloat(this.table2.list[i].weight)
  301. arr.push(this.table2.list[i])
  302. }
  303. arr.push({ 'sort': '小计', 'weight': a })
  304. arr.push({ 'sort': '总计', 'weight': c.toFixed(2) })
  305. this.table2.list = arr
  306. console.log(this.table2.list)
  307. this.table2.pageNum = response.data.pageNum
  308. this.table2.pageSize = response.data.pageSize
  309. this.table2.total = response.data.total
  310. } else {
  311. this.table2.list = []
  312. }
  313. setTimeout(() => {
  314. this.table2.listLoading = false
  315. }, 100)
  316. })
  317. },
  318. // 计划内容栏舍详情
  319. getList3() {
  320. this.table3.listLoading = true
  321. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  322. GetDataByName(this.table3.getdataListParm).then(response => {
  323. console.log('table数据', response.data.list)
  324. if (response.data.list !== null) {
  325. this.table3.list = response.data.list
  326. this.table3.pageNum = response.data.pageNum
  327. this.table3.pageSize = response.data.pageSize
  328. this.table3.total = response.data.total
  329. } else {
  330. this.table3.list = []
  331. }
  332. setTimeout(() => {
  333. this.table3.listLoading = false
  334. }, 100)
  335. })
  336. }
  337. }
  338. }
  339. </script>
  340. <style lang="scss" scoped>
  341. .search{margin-bottom: 10px;}
  342. .table{margin-top:10px;}
  343. .template{
  344. background: #fff;
  345. position: relative;
  346. // .recipeTemplate{
  347. // width: 72px;
  348. // height: 70px;
  349. // position: absolute;
  350. // background: url(../../../assets/images/bg3.jpg) no-repeat;
  351. // right: 0;
  352. // top: 0;
  353. // margin: 0;
  354. // }
  355. .recipeTemplate{
  356. position: absolute;
  357. width: 120px;
  358. height: 120px;
  359. right: -38px;
  360. top: -50px;
  361. margin: 0;
  362. background: url(../../../assets/images/sanjiao.png) no-repeat;
  363. // border: 50px solid transparent;
  364. // border-top-color: #019966;
  365. // transform:rotate(225deg);
  366. // -webkit-transform: rotate(225deg);/*Safari 4+,Google Chrome 1+ */
  367. // -moz-transform: rotate(225deg);/*Firefox 3.5+*/
  368. // filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);/*ie*/
  369. z-index: 5;
  370. p{
  371. position: absolute;
  372. z-index: 1;
  373. color: #fff;
  374. right: 40px;
  375. top: 15px;
  376. width: 70px;
  377. // transform:rotate(180deg);
  378. -webkit-transform: rotate(45deg);/*Safari 4+,Google Chrome 1+ */
  379. -moz-transform: rotate(45deg);/*Firefox 3.5+*/
  380. filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);/*ie*/
  381. font-size: 10px;
  382. }
  383. }
  384. }
  385. .table2{
  386. float: left;width: 49%;margin-right: 1%;background: red;
  387. background: #fff;
  388. position: relative;
  389. .content-table{margin-top: 70px;}
  390. }
  391. .table3{
  392. float: left;
  393. width: 49%;
  394. background: #fff;
  395. position: relative;
  396. .content-table{margin-top: 70px;}
  397. }
  398. </style>