e046a056481710716ffc4a03fc98d10cc2c2e0c5.svn-base 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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. import { parseTime } from '@/utils/index.js'
  101. export default {
  102. name: 'MaterialIssuancePlan',
  103. display: 'Two list header slot',
  104. order: 14,
  105. components: { draggable },
  106. data() {
  107. return {
  108. table: {
  109. getdataListParm: {
  110. name: 'getLppListdate',
  111. name1: 'getLppdListdate',
  112. page: 1,
  113. offset: 1,
  114. returntype: 'Map',
  115. parammaps: {
  116. pastureid: Cookies.get('pastureid'),
  117. date: parseTime(new Date(), '{y}-{m}-{d}')
  118. }
  119. },
  120. list: [],
  121. total: 0,
  122. tableKey: 0,
  123. listLoading: false,
  124. temp: {},
  125. changeList: [],
  126. startObj: {}
  127. },
  128. requestParams2: {
  129. name: 'getTMRListEnable', offset: 0, parammaps: { pastureid: Cookies.get('pastureid'), eqtype: '1' }
  130. },
  131. equipmentList: [], // 撒料设备
  132. height: document.body.clientHeight - 255 - 50, // table高度
  133. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  134. cellStyle: { padding: 0 + 'px' }
  135. }
  136. },
  137. created() {
  138. this.getList()
  139. this.getDownList()
  140. },
  141. methods: {
  142. changeDate() {
  143. this.getList()
  144. },
  145. getDownList() {
  146. GetDataByName(this.requestParams2).then(response => {
  147. this.equipmentList = response.data.list
  148. })
  149. },
  150. getList() {
  151. this.table.listLoading = true
  152. GetArrList(this.table.getdataListParm).then(response => {
  153. console.log('table数据', response.data.list)
  154. if (response.data.list !== null) {
  155. for (let i = 0; i < response.data.list.length; i++) {
  156. if (response.data.list[i].arrList == null) {
  157. this.$set(response.data.list[i], 'arrList', [])
  158. }
  159. }
  160. this.table.list = response.data.list
  161. this.table.changeList = []
  162. this.table.startObj = {}
  163. if (response.data.total) {
  164. this.table.total = response.data.total
  165. }
  166. } else {
  167. this.table.list = []
  168. }
  169. setTimeout(() => {
  170. this.table.listLoading = false
  171. }, 100)
  172. })
  173. }
  174. }
  175. }
  176. </script>
  177. <style lang="scss" scoped>
  178. .search{margin-bottom: 10px;}
  179. </style>