7c69cd36aeb5aaa6012cda4649b94f9c1991ab75.svn-base 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217
  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 v-if="maxTime.isTime1" label="一班">一班</el-radio-button>
  8. <el-radio-button v-if="maxTime.isTime2" label="二班">二班</el-radio-button>
  9. <el-radio-button v-if="maxTime.isTime3" label="三班">三班</el-radio-button>
  10. <el-radio-button v-if="maxTime.isTime4" label="四班">四班</el-radio-button>
  11. </el-radio-group>
  12. </div>
  13. <!-- 拖拽列表 -->
  14. <ul class="draggableList">
  15. <li v-for="element in MenuList" :key="element.arrid">
  16. <span v-if="element.isShowTitle" class="draggableTitle">{{ element.ftname }}:</span>
  17. <draggable id="1" data-source="juju1" :list="element.arrList" class="list-group1" draggable=".item" group="a" :move="move" @change="changeLog" @start="start" @end="end">
  18. <div v-for="item in element.arrList" :key="item.id" :style="{'background':item.background}" class="list-group-item1 item" style="width: 80px;float: left;margin:5px 5px;height: 35px;border-radius: 7px;">
  19. <el-tooltip placement="top" class="list-group-item1 item">
  20. <div slot="content">{{ item.barname }}</div>
  21. <div class="draggableName">{{ item.barname }}</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
  38. :list-loading="smallMenu.listLoading"
  39. element-loading-text="给我一点时间"
  40. :data="smallMenu.list"
  41. :row-style="rowStyle2"
  42. :cell-style="cellStyle2"
  43. :header-row-style="headerRowStyle2"
  44. :header-cell-style="headerCellStyle2"
  45. :height="150"
  46. show-summary
  47. sum-text="总栏舍"
  48. >
  49. <el-table-column label="配方/班次" min-width="80px" align="center" prop="tname" />
  50. <el-table-column label="总数" min-width="50px" align="center" prop="usedsum" />
  51. <el-table-column v-if="maxTime.isTime1" label="第一班未分配" min-width="105px" align="center" prop="onetime" />
  52. <el-table-column v-if="maxTime.isTime2" label="第二班未分配" min-width="105px" align="center" prop="twotime" />
  53. <el-table-column v-if="maxTime.isTime3" label="第三班未分配" min-width="105px" align="center" prop="threetime" />
  54. <el-table-column v-if="maxTime.isTime4" label="第四班未分配" min-width="105px" align="center" prop="fourtime" />
  55. </el-table>
  56. </div>
  57. </div>
  58. </div>
  59. <div class="operation" style="width: 100%; border-top: 2px solid #d8dce5; box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.12), 0 0 6px 0 rgba(0, 0, 0, 0.04)">
  60. <el-button class="success" style="float:left;" @click="handleCreate">新增车次</el-button>
  61. <el-button class="danger" style="float:left;" @click="handleReduceTrains">减少车次</el-button>
  62. <el-button class="success" style="float:left;" @click="handleAutomaticGeneration">自动生成</el-button>
  63. <el-button class="success" style="float:left;" @click="handleCheck">校验</el-button>
  64. <el-button class="import" style="float:right;" @click="handleHistoryRecord">历史记录</el-button>
  65. </div>
  66. <div class="table">
  67. <el-table
  68. id="table"
  69. :key="table.tableKey"
  70. ref="table"
  71. v-loading="table.listLoading"
  72. element-loading-text="给我一点时间"
  73. :data="table.list"
  74. border
  75. highlight-current-row
  76. style="width: 100%;"
  77. :height="height"
  78. :row-style="rowStyle"
  79. :cell-style="cellStyle"
  80. class="elTable table-fixed"
  81. row-key="id"
  82. @selection-change="handleSelect"
  83. >
  84. <el-table-column type="selection" width="50" />
  85. <el-table-column label="车次" width="85px" align="center">
  86. <template slot-scope="scope">
  87. <span v-if="scope.row.NoEdit">{{ scope.row.sort }}</span>
  88. <el-input v-if="scope.row.Edit" v-model="scope.row.sort" type="number" placeholder="车次" class="filter-item" style="display: inline-block;width: 95%;" />
  89. </template>
  90. </el-table-column>
  91. <el-table-column label="TMR编号" width="110px" align="center">
  92. <template slot-scope="scope">
  93. <span v-if="scope.row.NoEdit">{{ scope.row.tmrname }}</span>
  94. <el-select v-if="scope.row.Edit" v-model="scope.row.tmrid" placeholder="TMR编号" class="filter-item" style="width:95%;" @change="(value)=> {changeTMRNumber(value, scope.row)}">
  95. <el-option v-for="item in TMRNumberList" :key="item.id" :label="item.eqcode" :value="item.id" />
  96. </el-select>
  97. </template>
  98. </el-table-column>
  99. <el-table-column label="描述" width="110px" align="center">
  100. <template slot-scope="scope">
  101. <span v-if="scope.row.NoEdit">{{ scope.row.display }}</span>
  102. <el-input v-if="scope.row.Edit" v-model="scope.row.display" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" placeholder="描述" maxlength="255" class="filter-item" style="display: inline-block;width: 95%;" />
  103. </template>
  104. </el-table-column>
  105. <el-table-column label="生效" width="100px" align="center">
  106. <template slot-scope="scope">
  107. <el-switch v-model="scope.row.sel" :disabled="scope.row.NoEdit" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleTakeEffectChange(scope.$index, scope.row)" />
  108. </template>
  109. </el-table-column>
  110. <el-table-column label="班次" width="100px" align="center">
  111. <template slot-scope="scope">
  112. <span v-if="scope.row.NoEdit">{{ scope.row.timesstr }}</span>
  113. <el-select v-if="scope.row.Edit" v-model="scope.row.times" :disabled="scope.row.Disabled" placeholder="班次" class="filter-item" style="width:95%;">
  114. <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
  115. </el-select>
  116. </template>
  117. </el-table-column>
  118. <el-table-column label="时间" width="150px" align="center">
  119. <template slot-scope="scope">
  120. <span v-if="scope.row.NoEdit">{{ scope.row.begintime }}</span>
  121. <el-time-picker v-if="scope.row.Edit" v-model="scope.row.begintime" type="datetime" placeholder="选择时间" format="HH:mm" value-format="HH:mm" style="display: inline-block;width: 95%;" />
  122. </template>
  123. </el-table-column>
  124. <el-table-column label="最大重量" width="80px" align="center">
  125. <template slot-scope="scope">
  126. <span>{{ scope.row.maxweight }}</span>
  127. </template>
  128. </el-table-column>
  129. <el-table-column label="合计重量" width="80px" align="center">
  130. <template slot-scope="scope">
  131. <span>{{ scope.row.sumweight }}</span>
  132. </template>
  133. </el-table-column>
  134. <el-table-column label="模板配方" width="120px" align="center">
  135. <template slot-scope="scope">
  136. <span v-if="scope.row.NoEdit">{{ scope.row.ftname }}</span>
  137. <el-select v-if="scope.row.Edit" v-model="scope.row.ftid" :disabled="scope.row.Disabled" placeholder="模板配方" class="filter-item" style="width:95%;" @change="(value)=> {changeTemplateFormulation(value, scope.row)}">
  138. <el-option v-for="item in templateFormulationList" :key="item.id" :label="item.tname" :value="item.id" />
  139. </el-select>
  140. </template>
  141. </el-table-column>
  142. <el-table-column label="发料" width="950px" align="center">
  143. <template slot-scope="scope">
  144. <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)">
  145. <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;">
  146. <span :style="{'background':element.background}" style="display: block;height:20px;line-height: 20px;border-radius:5px;position: relative;color:#fff;">
  147. {{ element.barname }}
  148. <i class="el-icon-close" style="position: absolute;right: 0;" @click="handleFLDelete(element,scope.row)" />
  149. </span>
  150. <div style="margin-top: 7px;">
  151. <el-tooltip placement="top">
  152. <div slot="content">{{ element.tmrname }}</div>
  153. <el-select v-model="element.tmrid" placeholder="发料设备" class="filter-item2" style="display: inline-block;width: 55px;" @change="(value)=> {changeEquipment(value, scope.row,element.fttype,element.id)}">
  154. <el-option v-for="item in equipmentList" :key="item.id" :label="item.tname" :value="item.id" />
  155. </el-select>
  156. </el-tooltip>
  157. <el-tooltip placement="top">
  158. <div slot="content">{{ element.weight }}</div>
  159. <el-input v-model="element.weight" type="number" placeholder="重量" class="filter-item2" style="display: inline-block;width: 40px;" @blur="(value)=> {blurWeight(scope.row,element.fttype,element.id)}" />
  160. </el-tooltip>
  161. </div>
  162. </div>
  163. </draggable>
  164. </template>
  165. </el-table-column>
  166. <el-table-column align="center" width="250" class-name="small-padding fixed-width" fixed="right">
  167. <template slot-scope="{row}">
  168. <!-- 新增 -->
  169. <el-button v-if="row.isCreate" :disabled="isokDisable" class="miniSuccess" @click="createData(row)">保存</el-button>
  170. <el-button v-if="row.isCreate" class="minCancel" @click="createCancel(row)">取消</el-button>
  171. <!-- 编辑 -->
  172. <el-button v-if="row.isUpdate" class="miniSuccess" @click="handleUpdate(row)">编辑</el-button>
  173. <el-button v-if="row.isUpdate" class="miniDanger" @click="handleRowDelete(row)">删除</el-button>
  174. <!-- 编辑保存 -->
  175. <el-button v-if="row.isUpdateSave" :disabled="isokDisable" class="miniSuccess" @click="updateData(row)">保存</el-button>
  176. <el-button v-if="row.isUpdateSave" class="minCancel" @click="updateCancel(row)">取消</el-button>
  177. </template>
  178. </el-table-column>
  179. </el-table>
  180. </div>
  181. <!-- 自动生成 -->
  182. <el-dialog :title="textMap[automaticGeneration.dialogStatus]" :destroy-on-close="true" :visible.sync="automaticGeneration.dialogFormVisible" :close-on-click-modal="false" width="40%">
  183. <div class="app-automaticGeneration" style="margin: 0 auto;">
  184. <div style="width: 210px;margin:60px auto 100px;">
  185. 请选择自动生成方式<br>
  186. 1、清空计划生产新计划<br>
  187. 2、当前计划基础上继续生成计划<br>
  188. </div>
  189. <div slot="footer" class="dialog-footer">
  190. <el-button class="cancel" @click="automaticGeneration.dialogFormVisible = false; ">关闭</el-button>
  191. <el-button class="success" :disabled="isokDisable" @click="continueData()">继续生成</el-button>
  192. <el-button class="success" :disabled="isokDisable" @click="emptyPlanData()">清空计划</el-button>
  193. </div>
  194. </div>
  195. </el-dialog>
  196. </div>
  197. </template>
  198. <script>
  199. import { GetDataByName, GetArrList, PostDataByName, failproccess, ExecDataByConfig } from '@/api/common'
  200. import draggable from 'vuedraggable'
  201. import Sortable from 'sortablejs'
  202. import Cookies from 'js-cookie'
  203. import { MessageBox } from 'element-ui'
  204. // const id = 1
  205. export default {
  206. name: 'MaterialIssuancePlan',
  207. display: 'Two list header slot',
  208. order: 14,
  209. components: { draggable },
  210. data() {
  211. return {
  212. requestParams: {
  213. name: 'getTMRListEnable', offset: 0, parammaps: { pastureid: Cookies.get('pastureid'), eqtype: '1' }
  214. },
  215. requestParams2: {
  216. name: 'getTMRListEnable', offset: 0, parammaps: { pastureid: Cookies.get('pastureid'), eqtype: '2' }
  217. },
  218. requestParams3: {
  219. name: 'getFTSWList', offset: 0, parammaps: { pastureid: Cookies.get('pastureid') }
  220. },
  221. equipmentList: [], // 发料设备
  222. TMRNumberList: [], // TMR编号
  223. frequencyList: [], // 班次
  224. templateFormulationList: [], // 模板配方
  225. // 班次
  226. maxTime: {
  227. getMaxTimesParm: {
  228. name: 'getSysoptEnable',
  229. page: 1,
  230. offset: 1,
  231. pagecount: 1,
  232. returntype: 'Map',
  233. parammaps: {
  234. pastureid: Cookies.get('pastureid'),
  235. inforname: 'times'
  236. }
  237. },
  238. // 班次
  239. isTime1: false,
  240. isTime2: false,
  241. isTime3: false,
  242. isTime4: false
  243. },
  244. table: {
  245. getdataListParm: {
  246. name: 'getLppList',
  247. name1: 'getLppdList',
  248. page: 1,
  249. offset: 1,
  250. returntype: 'Map',
  251. parammaps: {
  252. pastureid: Cookies.get('pastureid')
  253. }
  254. },
  255. list: [],
  256. total: 0,
  257. tableKey: 0,
  258. listLoading: false,
  259. tabClickIndex: null, // 点击的单元格
  260. tabClickLabel: '', // 当前点击的列名
  261. temp: {},
  262. move1: '',
  263. changeList: [],
  264. startObj: {},
  265. isGoing: false
  266. },
  267. selectList: [], // 选中数据
  268. // 班次
  269. menuRadio: '一班',
  270. MenuList: [], // 配单列表
  271. getdataListParmTimes: {
  272. name: 'geFTListByFP',
  273. name1: 'geFTListByFPDetail',
  274. page: 1,
  275. offset: 1,
  276. returntype: 'Map',
  277. parammaps: {
  278. pastureid: Cookies.get('pastureid'),
  279. times: '1'
  280. }
  281. },
  282. listLoadingTimes: false,
  283. // 栏舍统计
  284. isLeftButton: true, // 向左
  285. isRightButton: false, // 向右
  286. rowStyle2: { maxHeight: 20 + 'px', height: 20 + 'px' },
  287. cellStyle2: { padding: 0 + 'px' },
  288. headerRowStyle2: { maxHeight: 20 + 'px', height: 20 + 'px' },
  289. headerCellStyle2: { padding: 0 + 'px' },
  290. smallMenu: {
  291. getdataListParm: {
  292. name: 'getLppUseSUMList',
  293. page: 1,
  294. offset: 1,
  295. pagecount: 10,
  296. returntype: 'Map',
  297. parammaps: {
  298. pastureid: Cookies.get('pastureid')
  299. }
  300. },
  301. total: 0,
  302. tableKey: 0,
  303. listLoading: false,
  304. list: []
  305. },
  306. // 自动生成
  307. automaticGeneration: {
  308. dialogFormVisible: false,
  309. dialogStatus: ''
  310. },
  311. textMap: {
  312. automaticGeneration: '提示'
  313. },
  314. isokDisable: false,
  315. requestParam: {},
  316. height: document.body.clientHeight - 255 - 50, // table高度
  317. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  318. cellStyle: { padding: 0 + 'px' }
  319. }
  320. },
  321. created() {
  322. this.getIsDisplay()
  323. this.getDownList()
  324. },
  325. methods: {
  326. // 下拉列表
  327. getDownList() {
  328. GetDataByName(this.requestParams).then(response => {
  329. this.TMRNumberList = response.data.list
  330. })
  331. GetDataByName(this.requestParams2).then(response => {
  332. this.equipmentList = response.data.list
  333. })
  334. GetDataByName(this.requestParams3).then(response => {
  335. this.templateFormulationList = response.data.list
  336. })
  337. },
  338. // 显示班次
  339. getIsDisplay() {
  340. GetDataByName(this.maxTime.getMaxTimesParm).then(response => {
  341. console.log(response.data.list[0].inforvalue)
  342. if (response.data.list[0].inforvalue == 1) {
  343. this.frequencyList = [{ id: '1', name: '第一班' }]
  344. } else if (response.data.list[0].inforvalue == 2) {
  345. this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }]
  346. } else if (response.data.list[0].inforvalue == 3) {
  347. this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }]
  348. } else if (response.data.list[0].inforvalue == 4) {
  349. this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }, { id: '4', name: '第四班' }]
  350. }
  351. if (response.data.list !== null) {
  352. if (response.data.list[0].inforvalue == 1) {
  353. this.maxTime.isTime1 = true
  354. this.maxTime.isTime2 = false
  355. this.maxTime.isTime3 = false
  356. this.maxTime.isTime4 = false
  357. } else if (response.data.list[0].inforvalue == 2) {
  358. this.maxTime.isTime1 = true
  359. this.maxTime.isTime2 = true
  360. this.maxTime.isTime3 = false
  361. this.maxTime.isTime4 = false
  362. } else if (response.data.list[0].inforvalue == 3) {
  363. this.maxTime.isTime1 = true
  364. this.maxTime.isTime2 = true
  365. this.maxTime.isTime3 = true
  366. this.maxTime.isTime4 = false
  367. } else if (response.data.list[0].inforvalue == 4) {
  368. this.maxTime.isTime1 = true
  369. this.maxTime.isTime2 = true
  370. this.maxTime.isTime3 = true
  371. this.maxTime.isTime4 = true
  372. }
  373. } else {
  374. this.maxTime.isTime1 = false
  375. this.maxTime.isTime2 = false
  376. this.maxTime.isTime3 = false
  377. this.maxTime.isTime4 = false
  378. }
  379. })
  380. this.getList()
  381. this.getSmallMenuList() // 栏舍统计
  382. this.getTimesList() // 班次
  383. },
  384. // 头部班次
  385. getTimesList() {
  386. this.listLoadingTimes = true
  387. GetArrList(this.getdataListParmTimes).then(response => {
  388. for (let i = 0; i < response.data.list.length; i++) {
  389. this.$set(response.data.list[i], 'isShowTitle', true)
  390. if (response.data.list[i].arrList == null) {
  391. this.$set(response.data.list[i], 'isShowTitle', false)
  392. }
  393. }
  394. this.MenuList = response.data.list
  395. })
  396. },
  397. // 切换班次
  398. changeMenu(val) {
  399. console.log(val)
  400. if (this.menuRadio === '一班') {
  401. this.getdataListParmTimes.parammaps.times = '1'
  402. this.getTimesList()
  403. } else if (this.menuRadio === '二班') {
  404. this.getdataListParmTimes.parammaps.times = '2'
  405. this.getTimesList()
  406. this.MenuList = this.twoMenuList
  407. } else if (this.menuRadio === '三班') {
  408. this.getdataListParmTimes.parammaps.times = '3'
  409. this.getTimesList()
  410. } else if (this.menuRadio === '四班') {
  411. this.getdataListParmTimes.parammaps.times = '4'
  412. this.getTimesList()
  413. }
  414. },
  415. // 右侧栏舍统计
  416. getSmallMenuList() {
  417. this.smallMenu.listLoading = true
  418. GetDataByName(this.smallMenu.getdataListParm).then(response => {
  419. console.log('smallMenu数据', response.data.list)
  420. if (response.data.list !== null) {
  421. for (let i = 0; i < response.data.list.length; i++) {
  422. if (response.data.list[i].onetime == undefined) { this.$set(response.data.list[i], 'onetime', 0) } else { response.data.list[i].onetime = parseFloat(response.data.list[i].onetime) }
  423. if (response.data.list[i].twotime == undefined) { this.$set(response.data.list[i], 'twotime', 0) } else { response.data.list[i].twotime = parseFloat(response.data.list[i].twotime) }
  424. if (response.data.list[i].threetime == undefined) { this.$set(response.data.list[i], 'threetime', 0) } else { response.data.list[i].threetime = parseFloat(response.data.list[i].threetime) }
  425. if (response.data.list[i].fourtime == undefined) { this.$set(response.data.list[i], 'fourtime', 0) } else { response.data.list[i].fourtime = parseFloat(response.data.list[i].fourtime) }
  426. this.$set(response.data.list[i], 'usedsum', response.data.list[i].onetime + response.data.list[i].twotime + response.data.list[i].threetime + response.data.list[i].fourtime)
  427. this.$set(response.data.list[i], 'all', '')
  428. }
  429. this.smallMenu.list = response.data.list
  430. this.smallMenu.total = response.data.total
  431. } else {
  432. this.smallMenu.list = []
  433. }
  434. setTimeout(() => {
  435. this.smallMenu.listLoading = false
  436. }, 100)
  437. })
  438. },
  439. // table
  440. getList() {
  441. this.table.listLoading = true
  442. GetArrList(this.table.getdataListParm).then(response => {
  443. console.log('table数据', response.data.list)
  444. if (response.data.list !== null) {
  445. for (let i = 0; i < response.data.list.length; i++) {
  446. this.$set(response.data.list[i], 'Edit', false) // 编辑
  447. this.$set(response.data.list[i], 'NoEdit', true) // 不可编辑/输入
  448. this.$set(response.data.list[i], 'isCreate', false) // 新增操作
  449. this.$set(response.data.list[i], 'isUpdate', true) // 编辑操作
  450. this.$set(response.data.list[i], 'isUpdateSave', false) // 编辑保存
  451. this.$set(response.data.list[i], 'Disabled', true) // 班次/模板配方不可输入
  452. if (response.data.list[i].arrList == null) {
  453. this.$set(response.data.list[i], 'Disabled', false)
  454. this.$set(response.data.list[i], 'arrList', [])
  455. }
  456. }
  457. this.table.list = response.data.list
  458. this.rowDrop()
  459. this.table.changeList = []
  460. this.table.startObj = {}
  461. if (response.data.total) {
  462. this.table.total = response.data.total
  463. }
  464. } else {
  465. this.table.list = []
  466. }
  467. setTimeout(() => {
  468. this.table.listLoading = false
  469. }, 100)
  470. })
  471. },
  472. // 行拖拽
  473. rowDrop() {
  474. console.log(document.querySelector('#table .el-table__body-wrapper tbody'))
  475. const tbody = document.querySelector('#table .el-table__body-wrapper tbody')
  476. const that = this
  477. Sortable.create(tbody, {
  478. onEnd({ newIndex, oldIndex }) {
  479. const currRow = that.table.list.splice(oldIndex, 1)[0]
  480. that.table.list.splice(newIndex, 0, currRow)
  481. console.log('索引', newIndex)
  482. console.log('拖动数据', currRow)
  483. console.log('上', that.table.list[newIndex - 1])
  484. console.log('下', that.table.list[newIndex + 1])
  485. }
  486. })
  487. },
  488. // TMR编号
  489. changeTMRNumber(item, row) {
  490. row.tmrname = this.TMRNumberList.find(obj => obj.id === item).eqcode
  491. row.maxweight = this.TMRNumberList.find(obj => obj.id === item).maxstirfeed
  492. },
  493. // 配方模板
  494. changeTemplateFormulation(item, row) {
  495. row.ftname = this.templateFormulationList.find(obj => obj.id === item).tname
  496. },
  497. // 增加车次
  498. handleCreate() {
  499. for (let i = 0; i < this.table.list.length; i++) {
  500. if (this.table.list[i].Edit === true) {
  501. console.log(123)
  502. this.$message({ type: 'error', message: '当前内容未保存,请点击取消或保存继续进行操作', duration: 2000 })
  503. return false
  504. }
  505. }
  506. this.table.list.unshift({ 'myId': (new Date()).valueOf(), 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, 'tmrname': '', 'tmrid': '', 'sort': parseInt(this.table.list[this.table.list.length - 1].sort) + 1, 'sel': 1, 'times': '', 'display': '', 'begintime': '', 'ftname': '', 'ftid': '', 'sumweight': '', 'sumcowcount': '', 'maxweight': '', 'arrList': [] })
  507. // this.$refs.box.scrollTop = 0
  508. this.$refs.table.bodyWrapper.scrollTop = 0
  509. },
  510. createData(row) {
  511. console.log('点击了新增保存', row)
  512. this.table.temp.pastureid = Cookies.get('pastureid')
  513. this.table.temp.tmrname = row.tmrname
  514. this.table.temp.tmrid = row.tmrid
  515. this.table.temp.sort = row.sort
  516. this.table.temp.sel = row.sel
  517. this.table.temp.times = row.times
  518. this.table.temp.display = row.display
  519. this.table.temp.begintime = row.begintime
  520. this.table.temp.ftname = row.ftname
  521. this.table.temp.ftid = row.ftid
  522. this.table.temp.sumweight = 0
  523. this.table.temp.maxweight = row.maxweight
  524. if (this.table.temp.sort == '' && this.table.temp.tmrid == '' && this.table.temp.times == '' && this.table.temp.ftid == '') {
  525. this.$message({ type: 'error', message: '车次/TMR编号/班次/模板配方不能为空', duration: 2000 })
  526. return false
  527. } else if (this.table.temp.tmrid == '' && this.table.temp.times == '' && this.table.temp.ftid == '') {
  528. this.$message({ type: 'error', message: 'TMR编号/班次/模板配方不能为空', duration: 2000 })
  529. return false
  530. } else if (this.table.temp.times == '' && this.table.temp.ftid == '') {
  531. this.$message({ type: 'error', message: '班次/模板配方不能为空', duration: 2000 })
  532. return false
  533. } else if (this.table.temp.ftid == '') {
  534. this.$message({ type: 'error', message: '模板配方不能为空', duration: 2000 })
  535. return false
  536. } else if (this.table.temp.times == '') {
  537. this.$message({ type: 'error', message: '班次不能为空', duration: 2000 })
  538. return false
  539. }
  540. for (let i = 0; i < this.table.list.length; i++) {
  541. if (row.sort == this.table.list[i].sort) {
  542. if (row.myId !== this.table.list[i].myId) {
  543. this.$message({ type: 'error', message: '车次不客重复', duration: 2000 })
  544. return false
  545. }
  546. }
  547. }
  548. var isInteger = /^\d+$/
  549. if (this.table.temp.sort !== '') {
  550. if (!isInteger.test(parseFloat(this.table.temp.sort))) {
  551. this.$message({ type: 'error', message: '车次请输入整数', duration: 2000 })
  552. return false
  553. }
  554. }
  555. this.isokDisable = true
  556. setTimeout(() => {
  557. this.isokDisable = false
  558. }, 1000)
  559. this.requestParam = {}
  560. this.requestParam.name = 'insertLpp'
  561. this.requestParam.parammaps = this.table.temp
  562. PostDataByName(this.requestParam).then(response => {
  563. console.log('新增保存发送参数', this.requestParam)
  564. if (response.msg !== 'fail') {
  565. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  566. this.getList()
  567. } else {
  568. failproccess(response, this.$notify)
  569. }
  570. })
  571. },
  572. createCancel(row) {
  573. console.log('点击了新增取消')
  574. for (let i = 0; i < this.table.list.length; i++) {
  575. if (row.myId === this.table.list[i].myId) {
  576. var listIndex = this.table.list.indexOf(this.table.list[i])
  577. }
  578. if (listIndex > -1) {
  579. this.table.list.splice(listIndex, 1)
  580. return
  581. }
  582. }
  583. },
  584. // 编辑
  585. handleUpdate(row) {
  586. console.log(row, '点击了行编辑')
  587. for (let i = 0; i < this.table.list.length; i++) {
  588. if (this.table.list[i].Edit == true) {
  589. this.$message({ type: 'error', message: '当前内容未保存,请点击取消或保存继续进行操作', duration: 2000 })
  590. return false
  591. }
  592. }
  593. // 编辑true,不可编辑false
  594. row.Edit = true
  595. row.NoEdit = false
  596. // 新增false,编辑false,编辑保存true
  597. row.isCreate = false
  598. row.isUpdate = false
  599. row.isUpdateSave = true
  600. row.times = String(row.times)
  601. if (row.sort == undefined) { row.sort = '' }
  602. if (row.tmrid == undefined || row.tmrname == undefined) {
  603. row.tmrid = ''
  604. row.tmrname = ''
  605. }
  606. if (row.display == undefined) { row.display = '' }
  607. if (row.times == undefined) { row.times = '' }
  608. if (row.begintime == undefined) { row.begintime = '' }
  609. if (row.ftid == undefined || row.ftname == undefined) {
  610. row.ftid = ''
  611. row.ftname = ''
  612. }
  613. },
  614. updateData(row) {
  615. console.log('点击了编辑保存', row)
  616. this.table.temp.pastureid = row.pastureid
  617. this.table.temp.id = row.id
  618. this.table.temp.tmrname = row.tmrname
  619. this.table.temp.tmrid = row.tmrid
  620. this.table.temp.sort = row.sort
  621. this.table.temp.sel = row.sel
  622. this.table.temp.times = row.times
  623. this.table.temp.display = row.display
  624. this.table.temp.begintime = row.begintime
  625. this.table.temp.ftname = row.ftname
  626. this.table.temp.ftid = row.ftid
  627. this.table.temp.sumweight = row.sumweight
  628. this.table.temp.sumcowcount = row.sumcowcount
  629. this.table.temp.maxweight = row.maxweight
  630. if (this.table.temp.sort == '' && this.table.temp.tmrid == '' && this.table.temp.times == '' && this.table.temp.ftid == '') {
  631. this.$message({ type: 'error', message: '车次/TMR编号/班次/模板配方不能为空', duration: 2000 })
  632. return false
  633. } else if (this.table.temp.tmrid == '' && this.table.temp.times == '' && this.table.temp.ftid == '') {
  634. this.$message({ type: 'error', message: 'TMR编号/班次/模板配方不能为空', duration: 2000 })
  635. return false
  636. } else if (this.table.temp.times == '' && this.table.temp.ftid == '') {
  637. this.$message({ type: 'error', message: '班次/模板配方不能为空', duration: 2000 })
  638. return false
  639. } else if (this.table.temp.ftid == '') {
  640. this.$message({ type: 'error', message: '模板配方不能为空', duration: 2000 })
  641. return false
  642. }
  643. for (let i = 0; i < this.table.list.length; i++) {
  644. if (row.sort == this.table.list[i].sort) {
  645. if (row.id !== this.table.list[i].id) {
  646. this.$message({ type: 'error', message: '车次不客重复', duration: 2000 })
  647. return false
  648. }
  649. }
  650. }
  651. var isInteger = /^\d+$/
  652. if (this.table.temp.sort !== '') {
  653. if (!isInteger.test(parseFloat(this.table.temp.sort))) {
  654. this.$message({ type: 'error', message: '车次请输入整数', duration: 2000 })
  655. return false
  656. }
  657. }
  658. this.isokDisable = true
  659. setTimeout(() => {
  660. this.isokDisable = false
  661. }, 1000)
  662. this.requestParam = {}
  663. this.requestParam.name = 'updateLpp'
  664. this.requestParam.parammaps = this.table.temp
  665. PostDataByName(this.requestParam).then(response => {
  666. console.log('编辑保存发送参数', this.requestParam)
  667. if (response.msg !== 'fail') {
  668. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  669. this.getList()
  670. } else {
  671. failproccess(response, this.$notify)
  672. }
  673. })
  674. },
  675. updateCancel(row) {
  676. console.log('点击了编辑取消')
  677. // 编辑false,不可编辑true
  678. row.Edit = false
  679. row.NoEdit = true
  680. // 新增false,编辑true,编辑保存false
  681. row.isCreate = false
  682. row.isUpdate = true
  683. row.isUpdateSave = false
  684. },
  685. // 自动生成
  686. handleAutomaticGeneration() {
  687. this.automaticGeneration.dialogStatus = 'automaticGeneration'
  688. this.automaticGeneration.dialogFormVisible = true
  689. },
  690. continueData() {
  691. console.log('点击继续生成')
  692. },
  693. emptyPlanData() {
  694. console.log('点击清空计划')
  695. },
  696. // 检验
  697. handleCheck() {
  698. console.log('点击检验')
  699. },
  700. // 历史记录
  701. handleHistoryRecord() {
  702. console.log('点击历史记录')
  703. },
  704. // 配方
  705. changeLog: function(evt) {
  706. console.log('change1', evt)
  707. },
  708. start(evt) {
  709. console.log('start1', evt)
  710. this.$set(this.table.startObj, 'from', evt.from.className)
  711. this.$set(this.table.startObj, 'to', evt.from.className)
  712. },
  713. end(evt) {
  714. console.log('end1', evt)
  715. },
  716. move(evt, originalEvent) {
  717. if (originalEvent.target.className === 'list-group-item1 item' || originalEvent.target.className === 'draggableWeight') {
  718. return false
  719. }
  720. console.log(evt)
  721. this.table.move1 = evt.draggedContext.element
  722. },
  723. start2(evt) {
  724. console.log('start2', evt)
  725. this.$set(this.table.startObj, 'from', evt.from.className)
  726. this.$set(this.table.startObj, 'to', evt.from.className)
  727. },
  728. move2(evt, originalEvent) {
  729. // console.log(evt, originalEvent)
  730. if (originalEvent.target.className === 'list-group-item1 item' || originalEvent.target.className === 'draggableWeight') {
  731. return false
  732. }
  733. this.table.move1 = evt.draggedContext.element
  734. },
  735. end2(evt) {
  736. // console.log(evt)
  737. console.log('end2', evt)
  738. },
  739. // 发料位
  740. changeLog2(evt) {
  741. // console.log(this.table.startObj)
  742. console.log(evt, 'evt-----')
  743. this.table.changeList.push(evt)
  744. evt = this.table.changeList[0]
  745. if (evt.arrList.length == 1) {
  746. evt.arrList[0].sort = 0
  747. } else if (evt.arrList.length > 1) {
  748. for (let i = 0; i < evt.arrList.length; i++) {
  749. if (evt.arrList[i].id == this.table.move1.id && evt.arrList[i].fttype == this.table.move1.fttype) {
  750. if (evt.arrList[i - 1] == undefined) {
  751. evt.arrList[i].sort = 0
  752. evt.sort = 0
  753. } else {
  754. evt.arrList[i].sort = parseFloat(evt.arrList[i - 1].sort) + 1
  755. evt.sort = parseFloat(evt.arrList[i - 1].sort) + 1
  756. }
  757. }
  758. }
  759. }
  760. console.log(evt.arrList)
  761. if (this.table.startObj.from == 'list-group1' && this.table.startObj.to == 'list-group1') {
  762. this.requestParam = {}
  763. this.requestParam.common = { 'returnmap': '0' }
  764. this.requestParam.data = []
  765. this.requestParam.data[0] = { 'name': 'checkLLPDetailInsert', 'type': 'v', 'parammaps': {
  766. pastureid: this.table.move1.pastureid,
  767. barid: this.table.move1.barid,
  768. lppid: evt.id,
  769. times: evt.times,
  770. ftid: this.table.move1.ftid,
  771. ptsid: this.table.move1.ptsid,
  772. ptid: this.table.move1.ptid,
  773. fttype: this.table.move1.fttype,
  774. timesTem: this.table.move1.times
  775. }}
  776. this.requestParam.data[1] = { 'name': 'updateLpplandtlSorts', 'type': 'e', 'parammaps': {
  777. pastureid: evt.pastureid,
  778. sort: evt.sort,
  779. lppid: evt.id
  780. }}
  781. this.requestParam.data[2] = { 'name': 'insertLppd', 'type': 'e', 'parammaps': {
  782. pastureid: evt.pastureid,
  783. lppid: evt.id,
  784. barid: this.table.move1.barid,
  785. barname: this.table.move1.barname,
  786. fpdid: this.table.move1.id,
  787. fttype: this.table.move1.fttype,
  788. lweight: this.table.move1.weight,
  789. sort: evt.sort,
  790. tmrid: evt.tmrid,
  791. tmrname: evt.tmrname,
  792. background: this.table.move1.background,
  793. ccountradio: this.table.move1.ccountradio,
  794. cowcount: this.table.move1.cowcount
  795. }}
  796. this.requestParam.data[3] = { 'name': 'updateFpdetailUse', 'type': 'e', 'parammaps': {
  797. pastureid: this.table.move1.pastureid,
  798. id: this.table.move1.id,
  799. fttype: this.table.move1.fttype,
  800. lweight: this.table.move1.weight
  801. }}
  802. console.log('发料位上-下新增', this.requestParam)
  803. ExecDataByConfig(this.requestParam).then(response => {
  804. console.log('发料位新增保存发送参数', this.requestParam)
  805. if (response.msg === 'fail') {
  806. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  807. this.getTimesList()
  808. this.getSmallMenuList()
  809. this.getList()
  810. } else {
  811. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  812. this.getList()
  813. this.getSmallMenuList()
  814. }
  815. })
  816. } else if (this.table.startObj.from == 'list-group2' && this.table.startObj.to == 'list-group2') {
  817. if (this.table.changeList.length == 1) {
  818. this.requestParam = {}
  819. this.requestParam.common = { 'returnmap': '0' }
  820. this.requestParam.data = []
  821. this.requestParam.data[0] = { 'name': 'checkLLPDetailInsert', 'type': 'v', 'parammaps': {
  822. pastureid: this.table.move1.pastureid,
  823. barid: this.table.move1.barid,
  824. lppid: evt.id,
  825. times: evt.times,
  826. ftid: this.table.move1.ftid,
  827. ptsid: this.table.move1.ptsid,
  828. ptid: this.table.move1.ptid,
  829. fttype: this.table.move1.fttype,
  830. timesTem: evt.times
  831. }}
  832. this.requestParam.data[1] = { 'name': 'updateLpplandtlSorts', 'type': 'e', 'parammaps': {
  833. pastureid: evt.pastureid,
  834. sort: evt.sort,
  835. lppid: evt.id
  836. }}
  837. this.requestParam.data[2] = { 'name': 'deleteLppd', 'type': 'e', 'parammaps': {
  838. pastureid: evt.pastureid,
  839. id: this.table.move1.id
  840. }}
  841. this.requestParam.data[3] = { 'name': 'insertLppd', 'type': 'e', 'parammaps': {
  842. pastureid: evt.pastureid,
  843. lppid: evt.id,
  844. barid: this.table.move1.barid,
  845. barname: this.table.move1.barname,
  846. fpdid: this.table.move1.fpdid,
  847. fttype: this.table.move1.fttype,
  848. lweight: this.table.move1.weight,
  849. sort: evt.sort,
  850. tmrid: evt.tmrid,
  851. tmrname: evt.tmrname,
  852. background: this.table.move1.background,
  853. ccountradio: this.table.move1.ccountradio,
  854. cowcount: this.table.move1.cowcount
  855. }}
  856. console.log('发料位下-下新增', this.requestParam)
  857. ExecDataByConfig(this.requestParam).then(response => {
  858. console.log('发料位新增保存发送参数', this.requestParam)
  859. if (response.msg === 'fail') {
  860. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  861. this.getTimesList()
  862. this.getSmallMenuList()
  863. this.getList()
  864. } else {
  865. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  866. this.getList()
  867. this.getSmallMenuList()
  868. }
  869. })
  870. } else if (this.table.changeList.length == 1) {
  871. if (this.table.isGoing == true) {
  872. console.log(11111)
  873. this.requestParam.common = { 'returnmap': '0' }
  874. this.requestParam.data = []
  875. this.requestParam.data[0] = { 'name': 'checkLLPDetailInsert', 'type': 'e', 'parammaps': {
  876. pastureid: evt.pastureid,
  877. sort: evt.sort,
  878. lppid: evt.id
  879. }}
  880. this.requestParam.data[1] = { 'name': 'deleteLppd', 'type': 'e', 'parammaps': {
  881. pastureid: evt.pastureid,
  882. id: this.table.move1.id
  883. }}
  884. this.requestParam.data[2] = { 'name': 'insertLppd', 'type': 'e', 'parammaps': {
  885. pastureid: evt.pastureid,
  886. lppid: evt.id,
  887. barid: this.table.move1.barid,
  888. barname: this.table.move1.barname,
  889. fpdid: this.table.move1.id,
  890. fttype: this.table.move1.fttype,
  891. lweight: this.table.move1.weight,
  892. sort: evt.sort,
  893. tmrid: evt.tmrid,
  894. tmrname: evt.tmrname,
  895. background: this.table.move1.background
  896. }}
  897. this.requestParam.data[3] = { 'name': 'updateFpdetailUse', 'type': 'e', 'parammaps': {
  898. pastureid: this.table.move1.pastureid,
  899. id: this.table.move1.id,
  900. fttype: this.table.move1.fttype,
  901. statue: 1
  902. }}
  903. console.log('发料位新增', this.requestParam)
  904. ExecDataByConfig(this.requestParam).then(response => {
  905. console.log('发料位新增保存发送参数', this.requestParam)
  906. if (response.msg === 'fail') {
  907. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  908. this.getTimesList()
  909. this.getList()
  910. } else {
  911. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  912. this.getList()
  913. }
  914. })
  915. this.table.isGoing = false
  916. } else {
  917. this.table.isGoing = true
  918. }
  919. }
  920. }
  921. },
  922. // 编辑-发料设备
  923. changeEquipment(item, row, fttype, myid) {
  924. var objList = {}
  925. for (let i = 0; i < row.arrList.length; i++) {
  926. row.arrList[i].tmrname = this.equipmentList.find(obj => obj.id === item).tname
  927. if (row.arrList[i].fttype == fttype && row.arrList[i].id == myid) {
  928. objList = row.arrList[i]
  929. }
  930. }
  931. this.requestParam = {}
  932. this.requestParam.common = { 'returnmap': '0' }
  933. this.requestParam.data = []
  934. this.requestParam.data[0] = { 'name': 'updateLppd', 'type': 'e', 'parammaps': {
  935. pastureid: row.pastureid,
  936. lppid: row.id,
  937. barid: objList.barid,
  938. barname: objList.barname,
  939. fpdid: objList.fpdid,
  940. fttype: objList.fttype,
  941. lweight: objList.weight,
  942. sort: objList.sort,
  943. tmrid: objList.tmrid,
  944. tmrname: objList.tmrname,
  945. background: objList.background,
  946. id: objList.id
  947. }}
  948. ExecDataByConfig(this.requestParam).then(response => {
  949. console.log('编辑保存发送参数', this.requestParam)
  950. if (response.msg === 'fail') {
  951. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  952. } else {
  953. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  954. this.getList()
  955. this.getTimesList()
  956. }
  957. })
  958. },
  959. // 编辑-重量
  960. blurWeight(row, fttype, myid) {
  961. var objList = {}
  962. for (let i = 0; i < row.arrList.length; i++) {
  963. if (row.arrList[i].fttype == fttype && row.arrList[i].id == myid) {
  964. objList = row.arrList[i]
  965. }
  966. }
  967. if (objList.weight == '') { objList.weight = 0 }
  968. this.requestParam = {}
  969. this.requestParam.common = { 'returnmap': '0' }
  970. this.requestParam.data = []
  971. this.requestParam.data[0] = { 'name': 'checkFPdLeftW', 'type': 'v', 'parammaps': {
  972. pastureid: objList.pastureid,
  973. fpdid: objList.fpdid,
  974. fttype: objList.fttype,
  975. lweight: String(parseFloat(objList.weight) - parseFloat(objList.lweight))
  976. }}
  977. this.requestParam.data[1] = { 'name': 'updateLppd', 'type': 'e', 'parammaps': {
  978. pastureid: row.pastureid,
  979. lppid: row.id,
  980. barid: objList.barid,
  981. barname: objList.barname,
  982. fpdid: objList.fpdid,
  983. fttype: objList.fttype,
  984. lweight: objList.weight,
  985. sort: objList.sort,
  986. tmrid: objList.tmrid,
  987. tmrname: objList.tmrname,
  988. background: objList.background,
  989. id: objList.id
  990. }}
  991. this.requestParam.data[2] = { 'name': 'updateFpdetailUse', 'type': 'e', 'parammaps': {
  992. pastureid: objList.pastureid,
  993. id: objList.fpdid,
  994. fttype: objList.fttype,
  995. lweight: String(parseFloat(objList.weight) - parseFloat(objList.lweight))
  996. }}
  997. ExecDataByConfig(this.requestParam).then(response => {
  998. console.log('编辑保存发送参数', this.requestParam)
  999. if (response.msg === 'fail') {
  1000. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1001. this.getList()
  1002. this.getTimesList()
  1003. } else {
  1004. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  1005. this.getList()
  1006. this.getTimesList()
  1007. }
  1008. })
  1009. },
  1010. handleTakeEffectChange() {
  1011. console.log('点击了生效')
  1012. },
  1013. // 发料位删除
  1014. handleFLDelete(ele, row) {
  1015. console.log(ele, row, '点击了发料删除')
  1016. this.selectList = []
  1017. this.requestParam = {}
  1018. this.requestParam.common = { 'returnmap': '0' }
  1019. this.requestParam.data = []
  1020. this.requestParam.data[0] = { 'name': 'deleteLppd', 'type': 'e', 'parammaps': {
  1021. pastureid: ele.pastureid,
  1022. id: ele.id
  1023. }}
  1024. this.requestParam.data[1] = { 'name': 'updateFpdetailUse', 'type': 'e', 'parammaps': {
  1025. pastureid: ele.pastureid,
  1026. id: ele.fpdid,
  1027. fttype: ele.fttype,
  1028. lweight: '-' + parseFloat(ele.weight)
  1029. }}
  1030. ExecDataByConfig(this.requestParam).then(response => {
  1031. console.log('删除保存发送参数', this.requestParam)
  1032. if (response.msg === 'fail') {
  1033. this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
  1034. } else {
  1035. this.$notify({ title: '', message: '删除成功', type: 'success', duration: 2000 })
  1036. this.getList()
  1037. this.getTimesList()
  1038. }
  1039. })
  1040. },
  1041. handleSelect(val) {
  1042. console.log('勾选数据', val)
  1043. this.selectList = val
  1044. },
  1045. // 减少车次
  1046. handleReduceTrains() {
  1047. if (this.selectList.length == 0) {
  1048. this.$message({ type: 'error', message: '请选择车次', duration: 2000 })
  1049. return false
  1050. } else {
  1051. // 减少对应车次
  1052. for (let i = 0; i < this.selectList.length; i++) {
  1053. if (this.selectList[i].arrList.length > 0) {
  1054. this.$message({ type: 'error', message: '本车次已添加栏舍不可删除', duration: 2000 })
  1055. return false
  1056. }
  1057. }
  1058. MessageBox.confirm('是否确认删除此信息?', {
  1059. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  1060. }).then(() => {
  1061. console.log(this.selectList)
  1062. this.requestParam = {}
  1063. this.requestParam.common = { 'returnmap': '0' }
  1064. this.requestParam.data = []
  1065. this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
  1066. this.requestParam.data[0].children = []
  1067. this.requestParam.data[0].children[0] = { 'name': 'deleteLpp', 'type': 'e', 'parammaps': {
  1068. id: '@insertSpotList.id',
  1069. pastureid: '@insertSpotList.pastureid'
  1070. }}
  1071. ExecDataByConfig(this.requestParam).then(response => {
  1072. console.log('删除保存发送参数', this.requestParam)
  1073. if (response.msg === 'fail') {
  1074. this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
  1075. } else {
  1076. this.$notify({ title: '', message: '删除成功', type: 'success', duration: 2000 })
  1077. this.getList()
  1078. }
  1079. })
  1080. })
  1081. }
  1082. },
  1083. // 行内删除
  1084. handleRowDelete(row) {
  1085. console.log(row, '点击了行删除')
  1086. if (row.arrList.length == 0) {
  1087. MessageBox.confirm('是否确认删除此信息?', {
  1088. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  1089. }).then(() => {
  1090. this.selectList = []
  1091. this.requestParam = {}
  1092. this.requestParam.name = 'deleteLpp'
  1093. this.requestParam.parammaps = {}
  1094. this.requestParam.parammaps.pastureid = row.pastureid
  1095. this.requestParam.parammaps.id = row.id
  1096. PostDataByName(this.requestParam).then(response => {
  1097. if (response.msg === 'fail') {
  1098. this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
  1099. } else {
  1100. this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
  1101. this.getList()
  1102. }
  1103. })
  1104. }).catch(() => {
  1105. this.$message({ type: 'info', message: '已取消删除' })
  1106. })
  1107. } else {
  1108. this.$message({ type: 'error', message: '本车次已添加栏舍不可删除', duration: 2000 })
  1109. return false
  1110. }
  1111. },
  1112. handleLeftButton() { // 向左
  1113. this.isLeftButton = false
  1114. this.isRightButton = true
  1115. this.$refs.listRight.style.zIndex = 4
  1116. this.getSmallMenuList()
  1117. },
  1118. handleRightButton() { // 向右
  1119. this.isLeftButton = true
  1120. this.isRightButton = false
  1121. this.$refs.listRight.style.zIndex = 1
  1122. }
  1123. }
  1124. }
  1125. </script>
  1126. <style lang="scss" scoped>
  1127. /deep/ .el-radio-button__orig-radio:checked+.el-radio-button__inner {
  1128. color: #fff;
  1129. background-color: #ccc;
  1130. border-color: #ccc;
  1131. -webkit-box-shadow: -1px 0 0 0 #ccc;
  1132. box-shadow: -1px 0 0 0 #ccc;
  1133. }
  1134. </style>
  1135. <style lang="scss" scoped>
  1136. .list{
  1137. position: fixed; height: 150px;z-index: 3;width: 85%;
  1138. .list-t{position: fixed;z-index: 1;height:39px;}
  1139. .draggableList{ width: 100%; height: 117px; list-style: none;margin-top:32px;padding-left:0;padding-right:0;overflow: auto;
  1140. .draggableTitle{float: left;width: 105px;white-space: nowrap;overflow: hidden; text-overflow: ellipsis;margin:5px 5px;border-radius: 7px;text-align: center;color:#000;height: 35px;line-height: 36px;}
  1141. li{
  1142. margin: 3px 0;text-align: center;color:#fff;
  1143. .draggableName{display:block;font-size: 12px;width: 100%;padding-top: 5px;overflow: hidden; text-overflow:ellipsis; white-space: nowrap;}
  1144. .draggableWeight{display:block;font-size: 10px;background: #fff; color: #000; width: 50%; margin: 0 auto; border-radius: 3px;}
  1145. }
  1146. }
  1147. }
  1148. $width:46%;
  1149. $width2:calc(46% - 50px);
  1150. .list-r{
  1151. position: fixed; height: 150px;z-index: 1;width: $width;right: 0;
  1152. .rightButton{
  1153. height: 150px;position: fixed;
  1154. .left{font:40px/150px '';position: fixed;background: #fff;width: 50px;right: 0;}
  1155. span{width: 20px;font:500 16px/16px '';display: inline-block;position: fixed;right: 0;margin-top: 42px;}
  1156. .right{font:40px/150px '';background: #fff;width: 50px;right: $width;}
  1157. .smallTable{position: fixed; top: 95px; width: $width2; margin-left: 50px;}
  1158. }
  1159. }
  1160. .operation{margin-top: 150px;height: 50px;}
  1161. .table{clear:both;}
  1162. </style>
  1163. <style lang="scss">
  1164. // 下拉框
  1165. .filter-item2 .el-input--suffix .el-input__inner{
  1166. height: 30px !important;
  1167. font-size: 8px;
  1168. padding: 0 2px;
  1169. }
  1170. .filter-item2 .el-input--suffix .el-input__suffix .el-input__suffix-inner .el-input__icon{
  1171. line-height: 30px !important;
  1172. }
  1173. // 输入框
  1174. .filter-item2 .el-input__inner{
  1175. height: 30px !important;
  1176. font-size: 8px;
  1177. padding: 0 2px;
  1178. }
  1179. </style>