497113f986278f796885b9a556368b4c5a0ae79f.svn-base 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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="950px" align="center">
  69. <template slot-scope="scope">
  70. <draggable id="2" data-source="juju" :list="scope.row.arrList" class="list-group2" draggable=".item" group="a">
  71. <div v-for="element in scope.row.arrList" :key="element.name" :style="{'background':element.background}" class="list-group-item2 item" style="width: 100px;float: left;border-radius:5px;margin: 5px 5px;padding: 0;height: 60px;">
  72. <span :style="{'background':element.background}" style="display: block;height:20px;line-height: 20px;border-radius:5px;position: relative;color:#fff;">
  73. {{ element.barname }}
  74. <!-- <i class="el-icon-close" style="position: absolute;right: 0;" /> -->
  75. </span>
  76. <div style="margin-top: 7px;">
  77. <el-tooltip placement="top">
  78. <div slot="content">{{ element.tmrname }}</div>
  79. <el-select v-model="element.tmrid" disabled placeholder="撒料设备" class="filter-item2" style="display: inline-block;width: 55px;">
  80. <el-option v-for="item in equipmentList" :key="item.id" :label="item.tmrmix" :value="item.id" />
  81. </el-select>
  82. </el-tooltip>
  83. <el-tooltip placement="top">
  84. <div slot="content">{{ element.weight }}</div>
  85. <el-input v-model="element.weight" disabled type="number" placeholder="重量" step="0.01" class="filter-item2" style="display: inline-block;width: 40px;" @blur="(value)=> {blurWeight(scope.row,element.fttype,element.id)}" />
  86. </el-tooltip>
  87. </div>
  88. </div>
  89. </draggable>
  90. </template>
  91. </el-table-column>
  92. </el-table>
  93. </div>
  94. </div>
  95. </template>
  96. <script>
  97. import { GetDataByName, GetArrList } from '@/api/common'
  98. import draggable from 'vuedraggable'
  99. import Cookies from 'js-cookie'
  100. export default {
  101. name: 'MaterialIssuancePlan',
  102. display: 'Two list header slot',
  103. order: 14,
  104. components: { draggable },
  105. data() {
  106. return {
  107. table: {
  108. getdataListParm: {
  109. name: 'getLppList',
  110. name1: 'getLppdList',
  111. page: 1,
  112. offset: 1,
  113. returntype: 'Map',
  114. parammaps: {
  115. pastureid: Cookies.get('pastureid')
  116. }
  117. },
  118. list: [],
  119. total: 0,
  120. tableKey: 0,
  121. listLoading: false,
  122. temp: {},
  123. changeList: [],
  124. startObj: {}
  125. },
  126. requestParams2: {
  127. name: 'getTMRListEnable', offset: 0, parammaps: { pastureid: Cookies.get('pastureid'), eqtype: '1' }
  128. },
  129. equipmentList: [], // 撒料设备
  130. height: document.body.clientHeight - 255 - 50, // table高度
  131. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  132. cellStyle: { padding: 0 + 'px' }
  133. }
  134. },
  135. created() {
  136. this.getList()
  137. this.getDownList()
  138. },
  139. methods: {
  140. changeDate() {
  141. this.getList()
  142. },
  143. getDownList() {
  144. GetDataByName(this.requestParams2).then(response => {
  145. this.equipmentList = response.data.list
  146. })
  147. },
  148. getList() {
  149. this.table.listLoading = true
  150. GetArrList(this.table.getdataListParm).then(response => {
  151. console.log('table数据', response.data.list)
  152. if (response.data.list !== null) {
  153. for (let i = 0; i < response.data.list.length; i++) {
  154. if (response.data.list[i].arrList == null) {
  155. this.$set(response.data.list[i], 'arrList', [])
  156. }
  157. }
  158. this.table.list = response.data.list
  159. this.table.changeList = []
  160. this.table.startObj = {}
  161. if (response.data.total) {
  162. this.table.total = response.data.total
  163. }
  164. } else {
  165. this.table.list = []
  166. }
  167. setTimeout(() => {
  168. this.table.listLoading = false
  169. }, 100)
  170. })
  171. }
  172. }
  173. }
  174. </script>
  175. <style lang="scss" scoped>
  176. .search{margin-bottom: 10px;}
  177. </style>