afa03fcd6c58e237ff91d4739c6e53d5297b8265.svn-base 7.2 KB

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