73849526a7f70a4ca4cc4bfc3388c6595e5a25cc.svn-base 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  1. <template>
  2. <div class="app-container">
  3. <div ref="list" class="list">
  4. <div class="list-t">
  5. <span>班次:</span>
  6. <el-radio-group v-model="menuRadio" size="small" @change="changeMenu">
  7. <el-radio-button label="全部">全部</el-radio-button>
  8. <el-radio-button label="早班">早班</el-radio-button>
  9. <el-radio-button label="中班">中班</el-radio-button>
  10. <el-radio-button label="晚班">晚班</el-radio-button>
  11. </el-radio-group>
  12. </div>
  13. <!-- 拖拽列表 -->
  14. <ul class="draggableList">
  15. <li v-for="element in MenuList" :key="element.name">
  16. <span class="draggableTitle">{{ element.title }}:</span>
  17. <draggable id="1" data-source="juju1" :list="element.MenuList" class="list-group1" draggable=".item" group="a" :move="move" @change="log" @start="start" @end="end">
  18. <div v-for="item in element.MenuList" :key="item.name" :style="{'background':item.background}" class="list-group-item1 item" style="width: 100px;float: left;margin:5px 5px;height: 28px;">
  19. <el-tooltip placement="top">
  20. <div slot="content">{{ item.name }}</div>
  21. <div class="draggableName">{{ item.name }}</div>
  22. </el-tooltip>
  23. <div class="draggableWeight">{{ item.weight }}</div>
  24. </div>
  25. </draggable>
  26. </li>
  27. </ul>
  28. </div>
  29. <div ref="listRight" class="list-r">
  30. <div v-if="isLeftButton" class="rightButton" @click="handleLeftButton">
  31. <i class="el-icon-arrow-left left" />
  32. <span>栏舍统计</span>
  33. </div>
  34. <div v-if="isRightButton" class="rightButton" @click="handleRightButton">
  35. <i class="el-icon-arrow-right right" />
  36. <div class="smallTable">
  37. <el-table slot="reference" :data="smallMenu.list" header-align="center" :cell-style="cellStyle2" :row-style="rowStyle2" :header-row-style="headerRowStyle2" :header-cell-style="headerCellStyle2" :height="150">
  38. <template v-for="(item,index) in smallMenu.titlelist">
  39. <el-table-column :key="index" show-overflow-tooltip :prop="item.column_name" :label="item.label" :width="item.width" />
  40. </template>
  41. </el-table>
  42. </div>
  43. </div>
  44. </div>
  45. <div class="operation">
  46. <el-button class="success" style="float:left;" @click="handleNewTrains">新增车次</el-button>
  47. <el-button class="danger" style="float:left;" @click="handleReduceTrains">减少车次</el-button>
  48. <el-button class="success" style="float:left;" @click="handleAutomaticGeneration">自动生成</el-button>
  49. <el-button class="success" style="float:left;" @click="handleCheck">校验</el-button>
  50. <el-button class="import" style="float:right;" @click="handleHistoryRecord">历史记录</el-button>
  51. </div>
  52. <div class="table">
  53. <el-table
  54. id="table"
  55. :key="table.tableKey"
  56. v-loading="table.listLoading"
  57. element-loading-text="给我一点时间"
  58. :data="table.list"
  59. border
  60. highlight-current-row
  61. style="width: 100%;"
  62. :height="height"
  63. :row-style="rowStyle"
  64. :cell-style="cellStyle"
  65. class="elTable table-fixed"
  66. :row-class-name="tableRowClassName"
  67. row-key="id"
  68. @cell-click="tabClick"
  69. @selection-change="handleSelect"
  70. >
  71. <el-table-column type="selection" width="50" />
  72. <el-table-column label="车次" width="85px" align="center">
  73. <template slot-scope="scope">
  74. <el-input v-if="scope.row.index === table.tabClickIndex && table.tabClickLabel === '车次'" ref="input1" v-model="scope.row.pastureName" type="number" placeholder="车次" class="filter-item" style="display: inline-block;width: 95%;" @blur="handleBlur" />
  75. <span v-else>{{ scope.row.pastureName }}</span>
  76. </template>
  77. </el-table-column>
  78. <el-table-column label="TMR编号" width="110px" align="center">
  79. <template slot-scope="scope">
  80. <el-select v-if="scope.row.index === table.tabClickIndex && table.tabClickLabel === 'TMR编号'" ref="input2" v-model="scope.row.status" placeholder="TMR编号" class="filter-item" style="width:95%;" @change="handleSelectChange()">
  81. <el-option v-for="item in TMRNumberList" :key="item.id" :label="item.name" :value="item.name" />
  82. </el-select>
  83. <span v-else>{{ scope.row.status }}</span>
  84. </template>
  85. </el-table-column>
  86. <el-table-column label="描述" width="110px" align="center">
  87. <template slot-scope="scope">
  88. <el-input v-if="scope.row.index === table.tabClickIndex && table.tabClickLabel === '描述'" ref="input3" v-model="scope.row.pastureName" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" placeholder="描述" maxlength="255" class="filter-item" style="display: inline-block;width: 95%;" @blur="handleBlur" />
  89. <span v-else>{{ scope.row.status }}</span>
  90. </template>
  91. </el-table-column>
  92. <el-table-column label="生效" width="100px" align="center">
  93. <template slot-scope="scope">
  94. <el-switch v-model="scope.row.enable" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleTakeEffectChange(scope.$index, scope.row)" />
  95. </template>
  96. </el-table-column>
  97. <el-table-column label="班次" width="100px" align="center">
  98. <template slot-scope="scope">
  99. <el-select v-if="scope.row.index === table.tabClickIndex && table.tabClickLabel === '班次'" ref="input4" v-model="scope.row.status" placeholder="班次" class="filter-item" style="width:95%;" @change="handleSelectChange()">
  100. <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.name" />
  101. </el-select>
  102. <span v-else>{{ scope.row.status }}</span>
  103. </template>
  104. </el-table-column>
  105. <el-table-column label="时间" width="150px" align="center">
  106. <template slot-scope="scope">
  107. <el-time-picker v-if="scope.row.index === table.tabClickIndex && table.tabClickLabel === '时间'" ref="input5" v-model="scope.row.pastureName" :picker-options="{ selectableRange: '00:00:00 - 23:59:59' }" placeholder="选择时间" style="display: inline-block;width: 95%;" @change="handleTimeChange" />
  108. <span v-else>{{ scope.row.status }}</span>
  109. </template>
  110. </el-table-column>
  111. <el-table-column label="最大重量" width="80px" align="center">
  112. <template slot-scope="scope">
  113. <span>{{ scope.row.status }}</span>
  114. </template>
  115. </el-table-column>
  116. <el-table-column label="合计重量" width="80px" align="center">
  117. <template slot-scope="scope">
  118. <span>{{ scope.row.status }}</span>
  119. </template>
  120. </el-table-column>
  121. <el-table-column label="模板配方" width="120px" align="center">
  122. <template slot-scope="scope">
  123. <el-select v-if="scope.row.index === table.tabClickIndex && table.tabClickLabel === '模板配方'" ref="input6" v-model="scope.row.status" placeholder="模板配方" class="filter-item" style="width:95%;" @change="handleSelectChange">
  124. <el-option v-for="item in templateFormulationList" :key="item.id" :label="item.name" :value="item.name" />
  125. </el-select>
  126. <span v-else>{{ scope.row.status }}</span>
  127. </template>
  128. </el-table-column>
  129. <el-table-column label="发料" width="950px" align="center">
  130. <template slot-scope="scope">
  131. <draggable id="2" data-source="juju" :list="scope.row.list" class="list-group2" draggable=".item" group="a" :move="move2" @change="log2" @start="start2" @end="end2">
  132. <div v-for="element in scope.row.list" :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;">
  133. <span :style="{'background':element.background}" style="display: block;height:20px;line-height: 20px;border-radius:5px;position: relative;color:#fff;">
  134. {{ element.name }}
  135. <i class="el-icon-close" style="position: absolute;right: 0;" @click="handleDelete(element.name)" />
  136. </span>
  137. <div style="margin-top: 7px;">
  138. <el-tooltip placement="top">
  139. <div slot="content">{{ element.brandName }}</div>
  140. <el-select v-model="element.brandName" placeholder="发料设备" class="filter-item2" style="display: inline-block;width: 55px;">
  141. <el-option v-for="item in equipmentList" :key="item.id" :label="item.name" :value="item.name" />
  142. </el-select>
  143. </el-tooltip>
  144. <el-tooltip placement="top">
  145. <div slot="content">{{ element.weight }}</div>
  146. <el-input v-model="element.weight" type="number" placeholder="重量" class="filter-item2" style="display: inline-block;width: 40px;" />
  147. </el-tooltip>
  148. </div>
  149. </div>
  150. </draggable>
  151. </template>
  152. </el-table-column>
  153. </el-table>
  154. </div>
  155. <!-- 自动生成 -->
  156. <el-dialog :title="textMap[automaticGeneration.dialogStatus]" :destroy-on-close="true" :visible.sync="automaticGeneration.dialogFormVisible" :close-on-click-modal="false" width="40%">
  157. <div class="app-automaticGeneration" style="margin: 0 auto;">
  158. <div style="width: 210px;margin:60px auto 100px;">
  159. 请选择自动生成方式<br>
  160. 1、清空计划生产新计划<br>
  161. 2、当前计划基础上继续生成计划<br>
  162. </div>
  163. <div slot="footer" class="dialog-footer">
  164. <el-button class="cancel" @click="automaticGeneration.dialogFormVisible = false; ">关闭</el-button>
  165. <el-button class="success" :disabled="isokDisable" @click="continueData()">继续生成</el-button>
  166. <el-button class="success" :disabled="isokDisable" @click="emptyPlanData()">清空计划</el-button>
  167. </div>
  168. </div>
  169. </el-dialog>
  170. </div>
  171. </template>
  172. <script>
  173. import { GetDataByName } from '@/api/common'
  174. import draggable from 'vuedraggable'
  175. import Sortable from 'sortablejs'
  176. // const id = 1
  177. export default {
  178. name: 'MaterialIssuancePlan',
  179. display: 'Two list header slot',
  180. order: 14,
  181. components: { draggable },
  182. data() {
  183. return {
  184. equipmentList: [{ id: 0, name: '发料设备01' }, { id: 1, name: '发料设备02' }], // 发料设备
  185. TMRNumberList: [{ id: 0, name: 'TMR编号01' }, { id: 1, name: 'TMR编号02' }], // TMR编号
  186. frequencyList: [{ id: 0, name: '早班' }, { id: 1, name: '中班' }, { id: 2, name: '晚班' }], // 班次
  187. templateFormulationList: [{ id: 0, name: '泌乳牛高产' }, { id: 1, name: '高产日粮' }, { id: 2, name: '青年牛' }], // templateFormulationList
  188. table: {
  189. getdataListParm: {
  190. name: 'getAssetList',
  191. page: 1,
  192. offset: 1,
  193. pagecount: 10,
  194. returntype: 'Map',
  195. parammaps: {
  196. enable: ''
  197. }
  198. },
  199. list: [],
  200. total: 0,
  201. tableKey: 0,
  202. listLoading: false,
  203. tabClickIndex: null, // 点击的单元格
  204. tabClickLabel: '' // 当前点击的列名
  205. },
  206. selectList: [], // 选中数据
  207. menuRadio: '全部', // 全部/早班/中班/晚班
  208. MenuList: [], // 配单列表
  209. allMenuList: [
  210. { 'title': '配方1', 'MenuList': [{ background: '#909', name: '全部1', id: 1, 'weight': 100 }, { background: '#909', name: '全部2', id: 2, 'weight': 99 }, { background: '#909', name: '全部3', id: 3, 'weight': 98 }, { background: '#909', name: '全部4', id: 4, 'weight': 90 }] },
  211. { 'title': '配方2', 'MenuList': [{ background: '#9f0', name: '全部11', id: 1, 'weight': 100 }, { background: '#9f0', name: '全部22', id: 2, 'weight': 99 }, { background: '#9f0', name: '全部33', id: 3, 'weight': 98 }, { background: '#9f0', name: '全部44', id: 4, 'weight': 90 }, { background: '#9f0', name: '全部55全部55全部55全部55', id: 5, 'weight': 55 }, { background: '#9f0', name: '全部66', id: 6, 'weight': 80 }] },
  212. { 'title': '配方3', 'MenuList': [{ background: '#909', name: '全部77', id: 7, 'weight': 100 }, { background: '#909', name: '全部88', id: 8, 'weight': 99 }, { background: '#909', name: '全部99', id: 9, 'weight': 98 }, { background: '#909', name: '全部10', id: 10, 'weight': 90 }, { background: '#909', name: '全部11', id: 11, 'weight': 55 }, { background: '#909', name: '全部12', id: 12, 'weight': 80 }, { background: '#909', name: '全部13', id: 13, 'weight': 70 }] },
  213. { 'title': '配方4', 'MenuList': [{ background: '#9f0', name: '全部14', id: 14, 'weight': 100 }, { background: '#9f0', name: '全部15', id: 15, 'weight': 99 }, { background: '#9f0', name: '全部16', id: 16, 'weight': 98 }, { background: '#9f0', name: '全部17', id: 17, 'weight': 90 }] },
  214. { 'title': '配方5', 'MenuList': [{ background: '#909', name: '全部18', id: 18, 'weight': 100 }, { background: '#909', name: '全部19', id: 19, 'weight': 99 }, { background: '#909', name: '全部20', id: 20, 'weight': 98 }, { background: '#909', name: '全部21', id: 21, 'weight': 90 }] }
  215. ],
  216. morningMenuList: [{ 'title': '配方1', 'MenuList': [{ name: '早班1', id: 1 }, { name: '早班2', id: 2 }, { name: '早班3', id: 3 }] }, { 'title': '配方2', 'MenuList': [{ name: '早班11', id: 1 }, { name: '早班22', id: 2 }, { name: '早班33', id: 3 }] }],
  217. middleMenuList: [{ 'title': '配方1', 'MenuList': [{ name: '中班1', id: 1 }, { name: '中班2', id: 2 }, { name: '中班3', id: 3 }] }, { 'title': '配方2', 'MenuList': [{ name: '中班11', id: 1 }, { name: '中班22', id: 2 }, { name: '中班33', id: 3 }] }],
  218. eveningMenuList: [{ 'title': '配方1', 'MenuList': [{ name: '晚班1', id: 1 }, { name: '晚班2', id: 2 }, { name: '晚班3', id: 3 }] }, { 'title': '配方2', 'MenuList': [{ name: '晚班11', id: 1 }, { name: '晚班22', id: 2 }, { name: '晚班33', id: 3 }] }],
  219. isLeftButton: true, // 向左
  220. isRightButton: false, // 向右
  221. rowStyle2: { maxHeight: 20 + 'px', height: 20 + 'px' },
  222. cellStyle2: { padding: 0 + 'px' },
  223. headerRowStyle2: { maxHeight: 20 + 'px', height: 20 + 'px' },
  224. headerCellStyle2: { padding: 0 + 'px' },
  225. smallMenu: { // 栏舍统计table
  226. getdataListParm: {
  227. name: 'getAssetList',
  228. page: 1,
  229. offset: 1,
  230. pagecount: 10,
  231. returntype: 'Map',
  232. parammaps: {
  233. enable: ''
  234. }
  235. },
  236. total: 0,
  237. tableKey: 0,
  238. listLoading: false,
  239. 'list': [],
  240. 'titlelist': []
  241. },
  242. // 自动生成
  243. automaticGeneration: {
  244. dialogFormVisible: false,
  245. dialogStatus: ''
  246. },
  247. textMap: {
  248. automaticGeneration: '提示'
  249. },
  250. height: document.body.clientHeight - 255 - 50, // table高度
  251. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  252. cellStyle: { padding: 0 + 'px' }
  253. }
  254. },
  255. created() {
  256. if (this.menuRadio === '全部') {
  257. this.MenuList = this.allMenuList
  258. }
  259. this.getList()
  260. this.getSmallMenuList()
  261. },
  262. methods: {
  263. getSmallMenuList() {
  264. this.smallMenu.listLoading = true
  265. GetDataByName(this.smallMenu.getdataListParm).then(response => {
  266. console.log('smallMenu数据', response.data.list)
  267. if (response.data.list !== null) {
  268. // this.smallMenu.list = response.data.list
  269. this.smallMenu.list = [
  270. { 'a1': '总数', 'a2': '11-1', 'a3': '12-1', 'a4': '13-1', 'a5': '14-1', 'a6': '15-1', 'a7': '16-1' },
  271. { 'a1': '早班未分配', 'a2': '11-2', 'a3': '12-2', 'a4': '13-2', 'a5': '14-2', 'a6': '15-2', 'a7': '16-2' },
  272. { 'a1': '中班未分配', 'a2': '11-3', 'a3': '12-3', 'a4': '13-3', 'a5': '14-3', 'a6': '15-3', 'a7': '16-3' },
  273. { 'a1': '晚班未分配', 'a2': '11-4', 'a3': '12-4', 'a4': '13-4', 'a5': '14-4', 'a6': '15-4', 'a7': '16-4' }
  274. ]
  275. this.smallMenu.titlelist = [
  276. { 'label': '配方/班次', 'column_name': 'a1' },
  277. { 'label': '总栏舍', 'column_name': 'a2' },
  278. { 'label': '配方1', 'column_name': 'a3' },
  279. { 'label': '配方2', 'column_name': 'a4' },
  280. { 'label': '配方3', 'column_name': 'a5' },
  281. { 'label': '配方4', 'column_name': 'a6' },
  282. { 'label': '配方5', 'column_name': 'a7' }
  283. ]
  284. is.table.total = response.data.total
  285. } else {
  286. this.smallMenu.list = []
  287. }
  288. setTimeout(() => {
  289. this.smallMenu.listLoading = false
  290. }, 100)
  291. })
  292. },
  293. getList() {
  294. this.table.listLoading = true
  295. GetDataByName(this.table.getdataListParm).then(response => {
  296. console.log('table数据', response.data.list)
  297. if (response.data.list !== null) {
  298. this.table.list = response.data.list
  299. this.table.list = [
  300. { 'id': 0, 'eqName': '潜污泵', 'pastureName': '双城牧场1', 'purpose': '0', 'specification': '"Q=150t/h', 'status': '正常', 'list': [{ 'name': 'John 1', 'myid': 1, 'background': '#d9d' }, { 'name': 'John 2', 'myid': 2, 'background': '#d9d' }, { 'name': 'John 3', 'myid': 3, 'background': '#d9d' }]
  301. }, {
  302. 'id': 1, 'eqCode': '24.QWB074', 'eqName': '潜污泵', 'pastureName': '双城牧场2', 'specification': '"Q=150t/h', 'status': '正常', 'list': [{ 'name': 'John 4', 'myid': 4, 'background': '#0f5' }, { name: 'John 5', 'myid': 5, 'background': '#0f5' }, { 'name': 'John 6', 'myid': 6, 'background': '#0f5' }]
  303. }, {
  304. 'id': 2, 'eqCode': '24.QWB074', 'eqName': '潜污泵', 'pastureName': '双城牧场3', 'specification': '"Q=150t/h', 'status': '正常', 'list': []
  305. }, {
  306. 'id': 3, 'eqCode': '24.QWB074', 'eqName': '潜污泵', 'pastureName': '双城牧场4', 'specification': '"Q=150t/h', 'status': '正常', 'list': []
  307. }, {
  308. 'id': 4, 'eqCode': '24.QWB074', 'eqName': '潜污泵', 'pastureName': '双城牧场5', 'specification': '"Q=150t/h', 'status': '正常', 'list': []
  309. }, {
  310. 'id': 5, 'eqCode': '24.QWB074', 'eqName': '潜污泵', 'pastureName': '双城牧场6', 'specification': '"Q=150t/h', 'status': '正常', 'list': []
  311. }
  312. ]
  313. this.rowDrop()
  314. if (response.data.total) {
  315. this.table.tal = response.data.total
  316. }
  317. } else {
  318. this.table.list = []
  319. }
  320. setTimeout(() => {
  321. this.table.listLoading = false
  322. }, 100)
  323. })
  324. },
  325. // 行拖拽
  326. rowDrop() {
  327. console.log(document.querySelector('#table .el-table__body-wrapper tbody'))
  328. const tbody = document.querySelector('#table .el-table__body-wrapper tbody')
  329. const that = this
  330. Sortable.create(tbody, {
  331. onEnd({ newIndex, oldIndex }) {
  332. const currRow = that.table.list.splice(oldIndex, 1)[0]
  333. that.table.list.splice(newIndex, 0, currRow)
  334. console.log('索引', newIndex)
  335. console.log('拖动数据', currRow)
  336. console.log('上', that.table.list[newIndex - 1])
  337. console.log('下', that.table.list[newIndex + 1])
  338. }
  339. })
  340. },
  341. handleSelect(val) {
  342. console.log('勾选数据', val)
  343. this.selectList = val
  344. },
  345. // 增加车次
  346. handleNewTrains() {
  347. this.table.list.unshift({})
  348. },
  349. // 减少车次
  350. handleReduceTrains() {
  351. if (this.selectList.length !== 1) {
  352. this.$message({ type: 'error', message: '请选择车次', duration: 2000 })
  353. return false
  354. } else {
  355. // 减少对应车次
  356. }
  357. },
  358. // 自动生成
  359. handleAutomaticGeneration() {
  360. this.automaticGeneration.dialogStatus = 'automaticGeneration'
  361. this.automaticGeneration.dialogFormVisible = true
  362. },
  363. continueData() {
  364. console.log('点击继续生成')
  365. },
  366. emptyPlanData() {
  367. console.log('点击清空计划')
  368. },
  369. // 检验
  370. handleCheck() {
  371. console.log('点击检验')
  372. },
  373. // 历史记录
  374. handleHistoryRecord() {
  375. console.log('点击历史记录')
  376. },
  377. // 配方
  378. log: function(evt) {
  379. window.console.log(evt)
  380. },
  381. start(evt) {},
  382. end(evt) {},
  383. move(evt, originalEvent) {
  384. if (originalEvent.target.className === 'list-group-item1 item') {
  385. return false
  386. } else {
  387. console.log(222)
  388. }
  389. },
  390. // 发料位
  391. log2: function(evt) {
  392. window.console.log(evt)
  393. },
  394. start2(evt) { },
  395. end2(evt) { },
  396. move2(evt, originalEvent) {
  397. console.log(evt, originalEvent)
  398. if (originalEvent.target.className === 'list-group-item1 item') {
  399. return false
  400. }
  401. },
  402. // 点击编辑
  403. tableRowClassName({ row, rowIndex }) {
  404. row.index = rowIndex // 把每一行的索引放进row
  405. },
  406. tabClick(row, column) {
  407. console.log()
  408. switch (column.label) {
  409. case '车次':
  410. this.table.tabClickIndex = row.index
  411. this.table.tabClickLabel = column.label
  412. this.$nextTick(() => {
  413. this.$refs.input1.focus()
  414. })
  415. break
  416. case 'TMR编号':
  417. this.table.tabClickIndex = row.index
  418. this.table.tabClickLabel = column.label
  419. this.$nextTick(() => {
  420. this.$refs.input2.focus()
  421. })
  422. break
  423. case '描述':
  424. this.table.tabClickIndex = row.index
  425. this.table.tabClickLabel = column.label
  426. this.$nextTick(() => {
  427. this.$refs.input3.focus()
  428. })
  429. break
  430. case '班次':
  431. this.table.tabClickIndex = row.index
  432. this.table.tabClickLabel = column.label
  433. this.$nextTick(() => {
  434. this.$refs.input4.focus()
  435. })
  436. break
  437. case '时间':
  438. this.table.tabClickIndex = row.index
  439. this.table.tabClickLabel = column.label
  440. this.$nextTick(() => {
  441. this.$refs.input5.focus()
  442. })
  443. break
  444. case '模板配方':
  445. this.table.tabClickIndex = row.index
  446. this.table.tabClickLabel = column.label
  447. this.$nextTick(() => {
  448. this.$refs.input6.focus()
  449. })
  450. break
  451. default: return
  452. }
  453. },
  454. // 失去焦点/选择保存
  455. handleBlur(index, row) {
  456. this.table.tabClickIndex = null
  457. this.table.tabClickLabel = ''
  458. console.log(index, row)
  459. },
  460. handleSelectChange(index, row) {
  461. this.table.tabClickIndex = null
  462. this.table.tabClickLabel = ''
  463. },
  464. handleTimeChange() {
  465. this.table.tabClickIndex = null
  466. this.table.tabClickLabel = ''
  467. },
  468. handleTakeEffectChange() {
  469. console.log('点击了生效')
  470. },
  471. // 删除
  472. handleDelete(val) {
  473. console.log(val, '点击了发料删除')
  474. },
  475. // 早中晚班
  476. changeMenu(val) {
  477. console.log(val)
  478. if (this.menuRadio === '全部') {
  479. this.MenuList = this.allMenuList
  480. } else if (this.menuRadio === '早班') {
  481. this.MenuList = this.morningMenuList
  482. } else if (this.menuRadio === '中班') {
  483. this.MenuList = this.middleMenuList
  484. } else if (this.menuRadio === '晚班') {
  485. this.MenuList = this.eveningMenuList
  486. }
  487. },
  488. handleLeftButton() { // 向左
  489. this.isLeftButton = false
  490. this.isRightButton = true
  491. this.$refs.listRight.style.zIndex = 4
  492. },
  493. handleRightButton() { // 向右
  494. this.isLeftButton = true
  495. this.isRightButton = false
  496. this.$refs.listRight.style.zIndex = 1
  497. }
  498. }
  499. }
  500. </script>
  501. <style lang="scss">
  502. .el-radio-button__orig-radio:checked+.el-radio-button__inner {
  503. color: #fff;
  504. background-color: #ccc;
  505. border-color: #ccc;
  506. -webkit-box-shadow: -1px 0 0 0 #ccc;
  507. box-shadow: -1px 0 0 0 #ccc;
  508. }
  509. </style>
  510. <style lang="scss" scoped>
  511. .list{
  512. position: fixed; height: 150px;z-index: 3;width: 60%;
  513. .list-t{position: fixed;z-index: 1;height:32px;}
  514. .draggableList{ width: 100%; height: 117px; list-style: none;margin-top:32px;padding-left:0;padding-right:0;overflow: auto;
  515. .draggableTitle{float: left;width: 100px;margin:5px 5px;text-align: center;color:#000;height: 28px;line-height: 36px;}
  516. li{
  517. margin: 3px 0;text-align: center;color:#fff;
  518. .draggableName{display:block;font-size: 12px;overflow: hidden; width: 100px;text-overflow:ellipsis; white-space: nowrap;}
  519. .draggableWeight{display:block;font-size: 10px;}
  520. }
  521. }
  522. }
  523. $width:24%;
  524. $width2:calc(24% - 50px);
  525. .list-r{
  526. position: fixed; height: 150px;z-index: 1;width: $width;right: 0;
  527. .rightButton{
  528. height: 150px;position: fixed;
  529. .left{font:40px/150px '';position: fixed;background: #fff;width: 50px;right: 0;}
  530. span{width: 20px;font:500 16px/16px '';display: inline-block;position: fixed;right: 0;margin-top: 42px;}
  531. .right{font:40px/150px '';background: #fff;width: 50px;right: $width;}
  532. .smallTable{position: fixed; top: 95px; width: $width2; margin-left: 50px;}
  533. }
  534. }
  535. .operation{margin-top: 150px;height: 50px;}
  536. .table{clear:both;}
  537. </style>
  538. <style lang="scss">
  539. // 下拉框
  540. .filter-item2 .el-input--suffix .el-input__inner{
  541. height: 30px !important;
  542. font-size: 8px;
  543. padding: 0 2px;
  544. }
  545. .filter-item2 .el-input--suffix .el-input__suffix .el-input__suffix-inner .el-input__icon{
  546. line-height: 30px !important;
  547. }
  548. // 输入框
  549. .filter-item2 .el-input__inner{
  550. height: 30px !important;
  551. font-size: 8px;
  552. padding: 0 2px;
  553. }
  554. </style>