3e3006e6e831c3e357cebe5c4fe569f5972f7f60.svn-base 50 KB

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