historyRecord.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <template>
  2. <div class="app-history">
  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 class="table">
  7. <el-table
  8. id="table"
  9. :key="table.tableKey"
  10. ref="table"
  11. v-loading="table.listLoading"
  12. element-loading-text="给我一点时间"
  13. :data="table.list"
  14. border
  15. highlight-current-row
  16. style="width: 100%;"
  17. :height="height"
  18. :row-style="rowStyle"
  19. :cell-style="cellStyle"
  20. class="elTable table-fixed"
  21. row-key="id"
  22. >
  23. <el-table-column label="车次" width="85px" align="center">
  24. <template slot-scope="scope">
  25. <span>{{ scope.row.sort }}</span>
  26. </template>
  27. </el-table-column>
  28. <el-table-column label="TMR编号" width="110px" align="center">
  29. <template slot-scope="scope">
  30. <span>{{ scope.row.tmrname }}</span>
  31. </template>
  32. </el-table-column>
  33. <el-table-column label="描述" width="110px" align="center">
  34. <template slot-scope="scope">
  35. <span>{{ scope.row.display }}</span>
  36. </template>
  37. </el-table-column>
  38. <el-table-column label="生效" width="100px" align="center">
  39. <template slot-scope="scope">
  40. <el-switch v-model="scope.row.sel" disabled active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleTakeEffectChange(scope.$index, scope.row)" />
  41. </template>
  42. </el-table-column>
  43. <el-table-column label="班次" width="100px" align="center">
  44. <template slot-scope="scope">
  45. <span>{{ scope.row.timesstr }}</span>
  46. </template>
  47. </el-table-column>
  48. <el-table-column label="时间" width="150px" align="center">
  49. <template slot-scope="scope">
  50. <span>{{ scope.row.begintime }}</span>
  51. </template>
  52. </el-table-column>
  53. <el-table-column label="最大重量" width="80px" align="center">
  54. <template slot-scope="scope">
  55. <span>{{ scope.row.maxweight }}</span>
  56. </template>
  57. </el-table-column>
  58. <el-table-column label="合计重量" width="80px" align="center">
  59. <template slot-scope="scope">
  60. <span>{{ scope.row.sumweight }}</span>
  61. </template>
  62. </el-table-column>
  63. <el-table-column label="模板配方" width="120px" align="center">
  64. <template slot-scope="scope">
  65. <span>{{ scope.row.ftname }}</span>
  66. </template>
  67. </el-table-column>
  68. <el-table-column label="是否提前小料拆分" width="100px" align="center">
  69. <template slot-scope="scope">
  70. <el-switch v-model="scope.row.issplit" :disabled="scope.row.NoEdit" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" disabled />
  71. </template>
  72. </el-table-column>
  73. <el-table-column label="撒料" min-width="250px" align="left" header-align="center">
  74. <template slot-scope="scope">
  75. <div v-for="element in scope.row.arrList" :key="element.name" class="list">
  76. <el-tooltip placement="top" :open-delay="1000">
  77. <div slot="content">
  78. <div> 栏舍全称:{{ element.barname }} </div>
  79. <div> 饲料重量:{{ element.weight }} </div>
  80. <!-- <div> 撒料车:{{ element.tmrname }} </div> -->
  81. </div>
  82. <div :style="{'background':element.background}" class="tmrname">{{ element.barname }}</div>
  83. </el-tooltip>
  84. </div>
  85. </template>
  86. </el-table-column>
  87. </el-table>
  88. </div>
  89. </div>
  90. </template>
  91. <script>
  92. import { GetDataByName, postJson } from '@/api/common'
  93. import draggable from 'vuedraggable'
  94. import Cookies from 'js-cookie'
  95. import { parseTime } from '@/utils/index.js'
  96. export default {
  97. name: 'MaterialIssuancePlan',
  98. display: 'Two list header slot',
  99. order: 14,
  100. components: { draggable },
  101. data() {
  102. return {
  103. table: {
  104. getdataListParm: {
  105. name: 'getLppListdate',
  106. name1: 'getLppdListdate',
  107. page: 1,
  108. offset: 1,
  109. returntype: 'Map',
  110. parammaps: {
  111. pastureid: Cookies.get('pastureid'),
  112. date: parseTime(new Date(), '{y}-{m}-{d}')
  113. }
  114. },
  115. list: [],
  116. total: 0,
  117. tableKey: 0,
  118. listLoading: false,
  119. temp: {},
  120. changeList: [],
  121. startObj: {}
  122. },
  123. requestParams2: {
  124. name: 'getTMRListEnable', offset: 0, parammaps: { pastureid: Cookies.get('pastureid'), eqtype: '1' }
  125. },
  126. equipmentList: [], // 撒料设备
  127. height: document.body.clientHeight - 255 - 50, // table高度
  128. rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
  129. cellStyle: { padding: 0 + 'px' }
  130. }
  131. },
  132. created() {
  133. this.getList()
  134. this.getDownList()
  135. },
  136. methods: {
  137. changeDate() {
  138. this.getList()
  139. },
  140. getDownList() {
  141. GetDataByName(this.requestParams2).then(response => {
  142. this.equipmentList = response.data.list
  143. })
  144. },
  145. getList() {
  146. this.table.listLoading = true
  147. const url = 'authdata/GetArrList'
  148. const data = this.table.getdataListParm
  149. postJson(url, data).then(response => {
  150. console.log('table数据', response.data.list)
  151. if (response.data.list !== null) {
  152. for (let i = 0; i < response.data.list.length; i++) {
  153. if (response.data.list[i].arrList == null) {
  154. this.$set(response.data.list[i], 'arrList', [])
  155. }
  156. }
  157. this.table.list = response.data.list
  158. this.table.changeList = []
  159. this.table.startObj = {}
  160. if (response.data.total) {
  161. this.table.total = response.data.total
  162. }
  163. } else {
  164. this.table.list = []
  165. }
  166. setTimeout(() => {
  167. this.table.listLoading = false
  168. }, 100)
  169. })
  170. }
  171. }
  172. }
  173. </script>
  174. <style lang="scss" scoped>
  175. .search{margin-bottom: 10px;}
  176. .list{width: 60px;display: inline-block;margin: 5px 5px;text-align: center;
  177. .tmrname{
  178. width:100%;padding: 5px 5px;overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  179. }
  180. }
  181. </style>