ef5f7107b19c0c29889b363a7effd759d70cfe96.svn-base 49 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198
  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. }}
  780. this.requestParam.data[3] = { 'name': 'updateFpdetailUse', 'type': 'e', 'parammaps': {
  781. pastureid: this.table.move1.pastureid,
  782. id: this.table.move1.id,
  783. fttype: this.table.move1.fttype,
  784. lweight: this.table.move1.weight
  785. }}
  786. console.log('发料位上-下新增', this.requestParam)
  787. ExecDataByConfig(this.requestParam).then(response => {
  788. console.log('发料位新增保存发送参数', this.requestParam)
  789. if (response.msg === 'fail') {
  790. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  791. this.getTimesList()
  792. this.getSmallMenuList()
  793. this.getList()
  794. } else {
  795. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  796. this.getList()
  797. this.getSmallMenuList()
  798. }
  799. })
  800. } else if (this.table.startObj.from == 'list-group2' && this.table.startObj.to == 'list-group2') {
  801. if (this.table.changeList.length == 1) {
  802. this.requestParam = {}
  803. this.requestParam.common = { 'returnmap': '0' }
  804. this.requestParam.data = []
  805. this.requestParam.data[0] = { 'name': 'checkLLPDetailInsert', 'type': 'v', 'parammaps': {
  806. pastureid: this.table.move1.pastureid,
  807. barid: this.table.move1.barid,
  808. lppid: evt.id,
  809. times: evt.times,
  810. ftid: this.table.move1.ftid,
  811. ptsid: this.table.move1.ptsid,
  812. ptid: this.table.move1.ptid,
  813. fttype: this.table.move1.fttype,
  814. timesTem: evt.times
  815. }}
  816. this.requestParam.data[1] = { 'name': 'updateLpplandtlSorts', 'type': 'e', 'parammaps': {
  817. pastureid: evt.pastureid,
  818. sort: evt.sort,
  819. lppid: evt.id
  820. }}
  821. this.requestParam.data[2] = { 'name': 'deleteLppd', 'type': 'e', 'parammaps': {
  822. pastureid: evt.pastureid,
  823. id: this.table.move1.id
  824. }}
  825. this.requestParam.data[3] = { 'name': 'insertLppd', 'type': 'e', 'parammaps': {
  826. pastureid: evt.pastureid,
  827. lppid: evt.id,
  828. barid: this.table.move1.barid,
  829. barname: this.table.move1.barname,
  830. fpdid: this.table.move1.fpdid,
  831. fttype: this.table.move1.fttype,
  832. lweight: this.table.move1.weight,
  833. sort: evt.sort,
  834. tmrid: evt.tmrid,
  835. tmrname: evt.tmrname,
  836. background: this.table.move1.background
  837. }}
  838. console.log('发料位下-下新增', this.requestParam)
  839. ExecDataByConfig(this.requestParam).then(response => {
  840. console.log('发料位新增保存发送参数', this.requestParam)
  841. if (response.msg === 'fail') {
  842. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  843. this.getTimesList()
  844. this.getSmallMenuList()
  845. this.getList()
  846. } else {
  847. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  848. this.getList()
  849. this.getSmallMenuList()
  850. }
  851. })
  852. } else if (this.table.changeList.length == 1) {
  853. if (this.table.isGoing == true) {
  854. console.log(11111)
  855. this.requestParam.common = { 'returnmap': '0' }
  856. this.requestParam.data = []
  857. this.requestParam.data[0] = { 'name': 'checkLLPDetailInsert', 'type': 'e', 'parammaps': {
  858. pastureid: evt.pastureid,
  859. sort: evt.sort,
  860. lppid: evt.id
  861. }}
  862. this.requestParam.data[1] = { 'name': 'deleteLppd', 'type': 'e', 'parammaps': {
  863. pastureid: evt.pastureid,
  864. id: this.table.move1.id
  865. }}
  866. this.requestParam.data[2] = { 'name': 'insertLppd', 'type': 'e', 'parammaps': {
  867. pastureid: evt.pastureid,
  868. lppid: evt.id,
  869. barid: this.table.move1.barid,
  870. barname: this.table.move1.barname,
  871. fpdid: this.table.move1.id,
  872. fttype: this.table.move1.fttype,
  873. lweight: this.table.move1.weight,
  874. sort: evt.sort,
  875. tmrid: evt.tmrid,
  876. tmrname: evt.tmrname,
  877. background: this.table.move1.background
  878. }}
  879. this.requestParam.data[3] = { 'name': 'updateFpdetailUse', 'type': 'e', 'parammaps': {
  880. pastureid: this.table.move1.pastureid,
  881. id: this.table.move1.id,
  882. fttype: this.table.move1.fttype,
  883. statue: 1
  884. }}
  885. console.log('发料位新增', this.requestParam)
  886. ExecDataByConfig(this.requestParam).then(response => {
  887. console.log('发料位新增保存发送参数', this.requestParam)
  888. if (response.msg === 'fail') {
  889. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  890. this.getTimesList()
  891. this.getList()
  892. } else {
  893. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  894. this.getList()
  895. }
  896. })
  897. this.table.isGoing = false
  898. } else {
  899. this.table.isGoing = true
  900. }
  901. }
  902. }
  903. },
  904. // 编辑-发料设备
  905. changeEquipment(item, row, fttype, myid) {
  906. var objList = {}
  907. for (let i = 0; i < row.arrList.length; i++) {
  908. row.arrList[i].tmrname = this.equipmentList.find(obj => obj.id === item).tname
  909. if (row.arrList[i].fttype == fttype && row.arrList[i].id == myid) {
  910. objList = row.arrList[i]
  911. }
  912. }
  913. this.requestParam = {}
  914. this.requestParam.common = { 'returnmap': '0' }
  915. this.requestParam.data = []
  916. this.requestParam.data[0] = { 'name': 'updateLppd', 'type': 'e', 'parammaps': {
  917. pastureid: row.pastureid,
  918. lppid: row.id,
  919. barid: objList.barid,
  920. barname: objList.barname,
  921. fpdid: objList.fpdid,
  922. fttype: objList.fttype,
  923. lweight: objList.weight,
  924. sort: objList.sort,
  925. tmrid: objList.tmrid,
  926. tmrname: objList.tmrname,
  927. background: objList.background,
  928. id: objList.id
  929. }}
  930. ExecDataByConfig(this.requestParam).then(response => {
  931. console.log('编辑保存发送参数', this.requestParam)
  932. if (response.msg === 'fail') {
  933. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  934. } else {
  935. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  936. this.getList()
  937. this.getTimesList()
  938. }
  939. })
  940. },
  941. // 编辑-重量
  942. blurWeight(row, fttype, myid) {
  943. var objList = {}
  944. for (let i = 0; i < row.arrList.length; i++) {
  945. if (row.arrList[i].fttype == fttype && row.arrList[i].id == myid) {
  946. objList = row.arrList[i]
  947. }
  948. }
  949. if (objList.weight == '') { objList.weight = 0 }
  950. this.requestParam = {}
  951. this.requestParam.common = { 'returnmap': '0' }
  952. this.requestParam.data = []
  953. this.requestParam.data[0] = { 'name': 'checkFPdLeftW', 'type': 'v', 'parammaps': {
  954. pastureid: objList.pastureid,
  955. fpdid: objList.fpdid,
  956. fttype: objList.fttype,
  957. lweight: String(parseFloat(objList.weight) - parseFloat(objList.lweight))
  958. }}
  959. this.requestParam.data[1] = { 'name': 'updateLppd', 'type': 'e', 'parammaps': {
  960. pastureid: row.pastureid,
  961. lppid: row.id,
  962. barid: objList.barid,
  963. barname: objList.barname,
  964. fpdid: objList.fpdid,
  965. fttype: objList.fttype,
  966. lweight: objList.weight,
  967. sort: objList.sort,
  968. tmrid: objList.tmrid,
  969. tmrname: objList.tmrname,
  970. background: objList.background,
  971. id: objList.id
  972. }}
  973. this.requestParam.data[2] = { 'name': 'updateFpdetailUse', 'type': 'e', 'parammaps': {
  974. pastureid: objList.pastureid,
  975. id: objList.fpdid,
  976. fttype: objList.fttype,
  977. lweight: String(parseFloat(objList.weight) - parseFloat(objList.lweight))
  978. }}
  979. ExecDataByConfig(this.requestParam).then(response => {
  980. console.log('编辑保存发送参数', this.requestParam)
  981. if (response.msg === 'fail') {
  982. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  983. this.getList()
  984. this.getTimesList()
  985. } else {
  986. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  987. this.getList()
  988. this.getTimesList()
  989. }
  990. })
  991. },
  992. handleTakeEffectChange() {
  993. console.log('点击了生效')
  994. },
  995. // 发料位删除
  996. handleFLDelete(ele, row) {
  997. console.log(ele, row, '点击了发料删除')
  998. this.selectList = []
  999. this.requestParam = {}
  1000. this.requestParam.common = { 'returnmap': '0' }
  1001. this.requestParam.data = []
  1002. this.requestParam.data[0] = { 'name': 'deleteLppd', 'type': 'e', 'parammaps': {
  1003. pastureid: ele.pastureid,
  1004. id: ele.id
  1005. }}
  1006. this.requestParam.data[1] = { 'name': 'updateFpdetailUse', 'type': 'e', 'parammaps': {
  1007. pastureid: ele.pastureid,
  1008. id: ele.fpdid,
  1009. fttype: ele.fttype,
  1010. lweight: '-' + parseFloat(ele.weight)
  1011. }}
  1012. ExecDataByConfig(this.requestParam).then(response => {
  1013. console.log('删除保存发送参数', this.requestParam)
  1014. if (response.msg === 'fail') {
  1015. this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
  1016. } else {
  1017. this.$notify({ title: '', message: '删除成功', type: 'success', duration: 2000 })
  1018. this.getList()
  1019. this.getTimesList()
  1020. }
  1021. })
  1022. },
  1023. handleSelect(val) {
  1024. console.log('勾选数据', val)
  1025. this.selectList = val
  1026. },
  1027. // 减少车次
  1028. handleReduceTrains() {
  1029. if (this.selectList.length == 0) {
  1030. this.$message({ type: 'error', message: '请选择车次', duration: 2000 })
  1031. return false
  1032. } else {
  1033. // 减少对应车次
  1034. for (let i = 0; i < this.selectList.length; i++) {
  1035. if (this.selectList[i].arrList.length > 0) {
  1036. this.$message({ type: 'error', message: '本车次已添加栏舍不可删除', duration: 2000 })
  1037. return false
  1038. }
  1039. }
  1040. MessageBox.confirm('是否确认删除此信息?', {
  1041. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  1042. }).then(() => {
  1043. console.log(this.selectList)
  1044. this.requestParam = {}
  1045. this.requestParam.common = { 'returnmap': '0' }
  1046. this.requestParam.data = []
  1047. this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
  1048. this.requestParam.data[0].children = []
  1049. this.requestParam.data[0].children[0] = { 'name': 'deleteLpp', 'type': 'e', 'parammaps': {
  1050. id: '@insertSpotList.id',
  1051. pastureid: '@insertSpotList.pastureid'
  1052. }}
  1053. ExecDataByConfig(this.requestParam).then(response => {
  1054. console.log('删除保存发送参数', this.requestParam)
  1055. if (response.msg === 'fail') {
  1056. this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
  1057. } else {
  1058. this.$notify({ title: '', message: '删除成功', type: 'success', duration: 2000 })
  1059. this.getList()
  1060. }
  1061. })
  1062. })
  1063. }
  1064. },
  1065. // 行内删除
  1066. handleRowDelete(row) {
  1067. console.log(row, '点击了行删除')
  1068. if (row.arrList.length == 0) {
  1069. MessageBox.confirm('是否确认删除此信息?', {
  1070. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  1071. }).then(() => {
  1072. this.selectList = []
  1073. this.requestParam = {}
  1074. this.requestParam.name = 'deleteLpp'
  1075. this.requestParam.parammaps = {}
  1076. this.requestParam.parammaps.pastureid = row.pastureid
  1077. this.requestParam.parammaps.id = row.id
  1078. PostDataByName(this.requestParam).then(response => {
  1079. if (response.msg === 'fail') {
  1080. this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
  1081. } else {
  1082. this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
  1083. this.getList()
  1084. }
  1085. })
  1086. }).catch(() => {
  1087. this.$message({ type: 'info', message: '已取消删除' })
  1088. })
  1089. } else {
  1090. this.$message({ type: 'error', message: '本车次已添加栏舍不可删除', duration: 2000 })
  1091. return false
  1092. }
  1093. },
  1094. handleLeftButton() { // 向左
  1095. this.isLeftButton = false
  1096. this.isRightButton = true
  1097. this.$refs.listRight.style.zIndex = 4
  1098. this.getSmallMenuList()
  1099. },
  1100. handleRightButton() { // 向右
  1101. this.isLeftButton = true
  1102. this.isRightButton = false
  1103. this.$refs.listRight.style.zIndex = 1
  1104. }
  1105. }
  1106. }
  1107. </script>
  1108. <style lang="scss">
  1109. .el-radio-button__orig-radio:checked+.el-radio-button__inner {
  1110. color: #fff;
  1111. background-color: #ccc;
  1112. border-color: #ccc;
  1113. -webkit-box-shadow: -1px 0 0 0 #ccc;
  1114. box-shadow: -1px 0 0 0 #ccc;
  1115. }
  1116. </style>
  1117. <style lang="scss" scoped>
  1118. .list{
  1119. position: fixed; height: 150px;z-index: 3;width: 60%;
  1120. .list-t{position: fixed;z-index: 1;height:39px;}
  1121. .draggableList{ width: 100%; height: 117px; list-style: none;margin-top:32px;padding-left:0;padding-right:0;overflow: auto;
  1122. .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;}
  1123. li{
  1124. margin: 3px 0;text-align: center;color:#fff;
  1125. .draggableName{display:block;font-size: 12px;width: 100%;padding-top: 5px;overflow: hidden; text-overflow:ellipsis; white-space: nowrap;}
  1126. .draggableWeight{display:block;font-size: 10px;background: #fff; color: #000; width: 50%; margin: 0 auto; border-radius: 3px;}
  1127. }
  1128. }
  1129. }
  1130. $width:46%;
  1131. $width2:calc(46% - 50px);
  1132. .list-r{
  1133. position: fixed; height: 150px;z-index: 1;width: $width;right: 0;
  1134. .rightButton{
  1135. height: 150px;position: fixed;
  1136. .left{font:40px/150px '';position: fixed;background: #fff;width: 50px;right: 0;}
  1137. span{width: 20px;font:500 16px/16px '';display: inline-block;position: fixed;right: 0;margin-top: 42px;}
  1138. .right{font:40px/150px '';background: #fff;width: 50px;right: $width;}
  1139. .smallTable{position: fixed; top: 95px; width: $width2; margin-left: 50px;}
  1140. }
  1141. }
  1142. .operation{margin-top: 150px;height: 50px;}
  1143. .table{clear:both;}
  1144. </style>
  1145. <style lang="scss">
  1146. // 下拉框
  1147. .filter-item2 .el-input--suffix .el-input__inner{
  1148. height: 30px !important;
  1149. font-size: 8px;
  1150. padding: 0 2px;
  1151. }
  1152. .filter-item2 .el-input--suffix .el-input__suffix .el-input__suffix-inner .el-input__icon{
  1153. line-height: 30px !important;
  1154. }
  1155. // 输入框
  1156. .filter-item2 .el-input__inner{
  1157. height: 30px !important;
  1158. font-size: 8px;
  1159. padding: 0 2px;
  1160. }
  1161. </style>