53e26136dbdc3035e9d71434852dadd834f3053a.svn-base 53 KB

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