bb21dc23b34f1be9bad55a045a049ccb0191d00a.svn-base 49 KB

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