336a200f148b5bfcac3442f22b4a2f1c281e9f88.svn-base 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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" :move="move2" @change="changeLog2(scope.row)" @start="start2" @end="end2(scope.row)">
  76. <div v-for="element in scope.row.arrList" :key="element.name" class="list-group-item2 item">
  77. <div class="arr-l">
  78. <div class="arr-l-t">
  79. <div class="arr-l-t-t" />
  80. <el-select v-model="element.tmrid" placeholder="撒料设备" class="arr-l-t-b el-icon-arrow-down" @change="(value)=> {changeEquipment(value, scope.row,element.fttype,element.id)}">
  81. <el-option v-for="item in equipmentList" :key="item.id" :label="item.tmrmix" :value="item.id" />
  82. </el-select>
  83. </div>
  84. <div class="arr-l-b">
  85. <el-tooltip placement="top" class="list-group-item1 item" style="height: 18px;line-height: 18px;">
  86. <div slot="content">{{ element.tmrname }}</div>
  87. <div class="tmrname">{{ element.tmrname }}</div>
  88. </el-tooltip>
  89. </div>
  90. </div>
  91. <div class="arr-r">
  92. <div class="arr-r-l">
  93. <el-tooltip placement="top">
  94. <div slot="content">{{ element.barname }}</div>
  95. <div class="barname">{{ element.barname }}</div>
  96. </el-tooltip>
  97. </div>
  98. <div class="arr-r-c">-</div>
  99. <div class="arr-r-r">
  100. <el-tooltip v-show="!element.isWeight" placement="top">
  101. <div slot="content">{{ element.weight }}</div>
  102. <div class="weight" @dblclick="dbclickWeight(element)">{{ element.weight }}</div>
  103. </el-tooltip>
  104. <el-tooltip v-show="element.isWeight" placement="top">
  105. <div slot="content">{{ element.weight }}</div>
  106. <input ref="weight" v-model="element.weight" v-focus="element.focusState" type="number" placeholder="重量" step="0.01" class="filter-item2" style="display: inline-block;height:16px;padding:4px 0px; font-size:12px;width: 95%;border: 1px solid #e6e6e6;" @blur="(value)=> {blurWeight(scope.row,element.fttype,element.id)}">
  107. </el-tooltip>
  108. </div>
  109. </div>
  110. <div class="arr-t" :style="{'background':element.background}">
  111. <i class="el-icon-close" style="position: absolute;right: 0;" @click="handleFLDelete(element,scope.row)" />
  112. </div>
  113. </div>
  114. </draggable>
  115. </template>
  116. </el-table-column>
  117. </el-table>
  118. </div>
  119. </div>
  120. </template>
  121. <script>
  122. import { GetDataByName, GetArrList } from '@/api/common'
  123. import draggable from 'vuedraggable'
  124. import Cookies from 'js-cookie'
  125. import { parseTime } from '@/utils/index.js'
  126. export default {
  127. name: 'MaterialIssuancePlan',
  128. display: 'Two list header slot',
  129. order: 14,
  130. components: { draggable },
  131. data() {
  132. return {
  133. table: {
  134. getdataListParm: {
  135. name: 'getLppListdate',
  136. name1: 'getLppdListdate',
  137. page: 1,
  138. offset: 1,
  139. returntype: 'Map',
  140. parammaps: {
  141. pastureid: Cookies.get('pastureid'),
  142. date: parseTime(new Date(), '{y}-{m}-{d}')
  143. }
  144. },
  145. list: [],
  146. total: 0,
  147. tableKey: 0,
  148. listLoading: false,
  149. temp: {},
  150. changeList: [],
  151. startObj: {}
  152. },
  153. requestParams2: {
  154. name: 'getTMRListEnable', offset: 0, parammaps: { pastureid: Cookies.get('pastureid'), eqtype: '1' }
  155. },
  156. equipmentList: [], // 撒料设备
  157. height: document.body.clientHeight - 255 - 50, // table高度
  158. rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
  159. cellStyle: { padding: 0 + 'px' }
  160. }
  161. },
  162. created() {
  163. this.getList()
  164. this.getDownList()
  165. },
  166. methods: {
  167. changeDate() {
  168. this.getList()
  169. },
  170. getDownList() {
  171. GetDataByName(this.requestParams2).then(response => {
  172. this.equipmentList = response.data.list
  173. })
  174. },
  175. getList() {
  176. this.table.listLoading = true
  177. GetArrList(this.table.getdataListParm).then(response => {
  178. console.log('table数据', response.data.list)
  179. if (response.data.list !== null) {
  180. for (let i = 0; i < response.data.list.length; i++) {
  181. if (response.data.list[i].arrList == null) {
  182. this.$set(response.data.list[i], 'arrList', [])
  183. }
  184. }
  185. this.table.list = response.data.list
  186. this.table.changeList = []
  187. this.table.startObj = {}
  188. if (response.data.total) {
  189. this.table.total = response.data.total
  190. }
  191. } else {
  192. this.table.list = []
  193. }
  194. setTimeout(() => {
  195. this.table.listLoading = false
  196. }, 100)
  197. })
  198. }
  199. }
  200. }
  201. </script>
  202. <style lang="scss" scoped>
  203. .search{margin-bottom: 10px;}
  204. </style>