index.vue 69 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736
  1. <template>
  2. <div class="app-container">
  3. <div class="operation">
  4. <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" style="float:left;" @click="handleCreate">新增车次
  5. </el-button>
  6. <el-button v-if="isRoleEdit" class="danger" icon="el-icon-delete" style="float:left;" @click="handleReduceTrains">减少车次</el-button>
  7. <el-button v-if="isRoleEdit" class="success" style="float: left;" @click="handleCheck">校验</el-button>
  8. <el-button v-if="isRoleEdit" class="success" icon="el-icon-download" style="float:left;" @click="handleAutomaticGeneration">自动生成</el-button>
  9. <el-button v-if="isOrder && isRoleEdit" icon="el-icon-sort" style="float: left;" class="success" @click="handleChangeOrder">更改顺序</el-button>
  10. <div v-else style="float: left;margin-left: 10px;">
  11. <el-button v-if="isRoleEdit" icon="el-icon-folder-checked" class="success" @click="saveChangeOrder">保存 </el-button>
  12. <el-button v-if="isRoleEdit" icon="el-icon-close" class="sortCancel" @click="cancelChangeOrder">取消</el-button>
  13. </div>
  14. <el-button v-if="isRoleEdit" class="success" icon="el-icon-open" style="float: left;" @click="handleTakeEffect"> 生效</el-button>
  15. <el-button v-if="isRoleEdit" class="danger" icon="el-icon-turn-off" style="float: left;" @click="handleDisable"> 禁用</el-button>
  16. <el-select v-model="table.getdataListParm.parammaps.times" filterable placeholder="班次" class="filter-item" style="width: 120px;float: left;margin-left: 10px;" @change="changeFrequency">
  17. <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
  18. </el-select>
  19. <el-button class="export" icon="el-icon-time" style="float:right;" @click="handleHistoryRecord">历史记录 </el-button>
  20. </div>
  21. <!-- <div class="search">
  22. <el-select v-model="table.getdataListParm.parammaps.times" filterable placeholder="班次" class="filter-item" style="width: 120px;" @change="changeFrequency">
  23. <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
  24. </el-select>
  25. </div> -->
  26. <div class="table">
  27. <el-table
  28. id="table"
  29. :key="table.tableKey"
  30. ref="table"
  31. v-loading="table.listLoading"
  32. element-loading-text="给我一点时间"
  33. :data="table.list"
  34. border
  35. highlight-current-row
  36. style="width: 100%;"
  37. :height="height"
  38. :row-style="rowStyle"
  39. :cell-style="cellStyle"
  40. class="elTable"
  41. row-key="id"
  42. @selection-change="handleSelect"
  43. >
  44. <el-table-column type="selection" width="50" />
  45. <el-table-column label="车次" width="50px" align="center" class-name="small-padding fixed-width" fixed="">
  46. <template slot-scope="scope">
  47. <span>{{ scope.row.sort }}</span>
  48. </template>
  49. </el-table-column>
  50. <el-table-column label="TMR编号" width="110px" align="center" class-name="small-padding fixed-width" fixed="left">
  51. <template slot-scope="scope">
  52. <span>{{ scope.row.tmrname }}</span>
  53. </template>
  54. </el-table-column>
  55. <el-table-column label="描述" width="110px" align="center">
  56. <template slot-scope="scope">
  57. <span>{{ scope.row.display }}</span>
  58. </template>
  59. </el-table-column>
  60. <el-table-column label="生效" width="70px" align="center">
  61. <template slot-scope="scope">
  62. <el-switch v-model="scope.row.sel" disabled active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
  63. </template>
  64. </el-table-column>
  65. <el-table-column label="班次" width="65px" align="center">
  66. <template slot-scope="scope">
  67. <span>{{ scope.row.timesstr }}</span>
  68. </template>
  69. </el-table-column>
  70. <el-table-column label="时间" width="55px" align="center">
  71. <template slot-scope="scope">
  72. <span>{{ scope.row.begintime }}</span>
  73. </template>
  74. </el-table-column>
  75. <el-table-column label="最大重量" width="75px" align="center">
  76. <template slot-scope="scope">
  77. <span>{{ scope.row.maxweight }}</span>
  78. </template>
  79. </el-table-column>
  80. <el-table-column label="合计重量" width="80px" align="center">
  81. <template slot-scope="scope">
  82. <span>{{ scope.row.sumweight }}</span>
  83. </template>
  84. </el-table-column>
  85. <el-table-column label="模板配方" width="90px" align="center">
  86. <template slot-scope="scope">
  87. <span>{{ scope.row.ftname }}</span>
  88. </template>
  89. </el-table-column>
  90. <el-table-column v-show="isInforvalue" label="是否提前小料拆分" width="70px" align="center">
  91. <template slot-scope="scope">
  92. <el-switch v-model="scope.row.issplit" disabled active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
  93. </template>
  94. </el-table-column>
  95. <el-table-column label="撒料" min-width="250px" align="left" header-align="center">
  96. <template slot-scope="scope">
  97. <div v-for="element in scope.row.arrList" :key="element.name" class="list">
  98. <el-tooltip placement="top" :open-delay="1000">
  99. <div slot="content">
  100. <div> 栏舍全称:{{ element.barname }} </div>
  101. <div> 饲料重量:{{ element.weight }} </div>
  102. <div> 撒料车:{{ element.tmrname }} </div>
  103. </div>
  104. <div :style="{'background':element.background}" class="tmrname">{{ element.barname }}</div>
  105. </el-tooltip>
  106. </div>
  107. </template>
  108. </el-table-column>
  109. <el-table-column label="操作" align="center" width="70" class-name="small-padding fixed-width" fixed="right">
  110. <template slot-scope="{row}">
  111. <el-button v-if="isRoleEdit" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
  112. <span v-if="isRoleEdit" class="centerSpan">|</span>
  113. <el-button v-if="isRoleEdit" class="miniDanger" icon="el-icon-delete" @click="handleRowDelete(row)" />
  114. </template>
  115. </el-table-column>
  116. </el-table>
  117. <span v-if="table.listLoading == false" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ table.total }}条</span>
  118. </div>
  119. <!-- 自动生成 -->
  120. <el-dialog :fullscreen="dialogFull" :destroy-on-close="true" :visible.sync="automaticGeneration.dialogFormVisible" :close-on-click-modal="false" width="30%">
  121. <template slot="title">
  122. <div class="avue-crud__dialog__header">
  123. <span class="el-dialog__title">
  124. <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
  125. {{ textMap[automaticGeneration.dialogStatus] }}
  126. </span>
  127. <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
  128. <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
  129. <svg-icon v-else icon-class="fullscreen" />
  130. </div>
  131. </div>
  132. </template>
  133. <div class="app-automaticGeneration" style="margin: 0 auto;">
  134. <div style="width: 210px;margin:60px auto 120px;font-weight: 16px;">
  135. 请选择自动生成方式:<br>
  136. 清空计划并生成新计划;<br>
  137. 当前计划基础上继续生成计划;<br>
  138. </div>
  139. <div slot="footer" class="dialog-footer">
  140. <el-button style="right:240px;" class="cancelClose" @click="automaticGeneration.dialogFormVisible = false;">关闭</el-button>
  141. <el-button style="right:130px;" class="save" :disabled="isokDisable" @click="continueData(0)">继续生成 </el-button>
  142. <el-button style="right:20px;" class="save" :disabled="isokDisable" @click="continueData(1)">重新生成 </el-button>
  143. </div>
  144. </div>
  145. </el-dialog>
  146. <!-- 历史记录 -->
  147. <el-dialog :fullscreen="dialogFull" :destroy-on-close="true" :visible.sync="historyRecord.dialogFormVisible" :close-on-click-modal="false" width="90%">
  148. <template slot="title">
  149. <div class="avue-crud__dialog__header">
  150. <span class="el-dialog__title">
  151. <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
  152. {{ textMap[historyRecord.dialogStatus] }}
  153. </span>
  154. <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
  155. <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
  156. <svg-icon v-else icon-class="fullscreen" />
  157. </div>
  158. </div>
  159. </template>
  160. <div class="historyRecord">
  161. <keep-alive>
  162. <component :is="historyRecord.myComponent" ref="historyRecord" />
  163. </keep-alive>
  164. </div>
  165. <div slot="footer" class="dialog-footer">
  166. <el-button class="cancelClose cancelClose1" @click="historyRecord.dialogFormVisible = false; ">关闭</el-button>
  167. </div>
  168. </el-dialog>
  169. <!-- 新增、编辑 -->
  170. <el-dialog :fullscreen="dialogFull" :destroy-on-close="true" :visible.sync="create.dialogFormVisible" :before-close="close" :close-on-click-modal="false" width="90%">
  171. <template slot="title">
  172. <div class="avue-crud__dialog__header">
  173. <span class="el-dialog__title">
  174. <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
  175. {{ textMap[create.dialogStatus] }}
  176. </span>
  177. <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
  178. <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
  179. <svg-icon v-else icon-class="fullscreen" />
  180. </div>
  181. </div>
  182. </template>
  183. <div class="create">
  184. <el-form ref="temp" :rules="create.rules" :model="create.temp" label-position="right" label-width="135px" style="width: 100%;margin:0 auto 10px;">
  185. <el-row>
  186. <el-col :span="8">
  187. <el-form-item label="生效:" prop="sel">
  188. <el-switch v-model="create.temp.sel" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
  189. </el-form-item>
  190. </el-col>
  191. <el-col :span="8">
  192. <el-form-item label="TMR编号:" prop="tmrid2">
  193. <el-select v-model="create.temp.tmrid2" style="width: 100%;" placeholder="TMR编号" @change="changeTMRNumber">
  194. <!-- <el-option v-for="item in equipmentList" :key="item.id" :label="`${item.tclassname}/${item.eqcode}`" :value="item.id" /> -->
  195. <el-option v-for="item in TMRNumberList" :key="item.id" :label="`${item.tclassname}/${item.eqcode}`" :value="item.id" />
  196. </el-select>
  197. </el-form-item>
  198. </el-col>
  199. <el-col :span="8">
  200. <el-form-item label="班次:" prop="times">
  201. <el-select v-model="create.temp.times" :disabled="create.list2.length>0" placeholder="班次" style="width:100%;" @change="changeTimes">
  202. <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
  203. </el-select>
  204. </el-form-item>
  205. </el-col>
  206. </el-row>
  207. <el-row>
  208. <el-col :span="8">
  209. <el-form-item label="提前小料拆分:" prop="issplit">
  210. <el-switch v-model="create.temp.issplit" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
  211. </el-form-item>
  212. </el-col>
  213. <el-col :span="8">
  214. <el-form-item label="时间:" prop="begintime">
  215. <el-time-picker v-model="create.temp.begintime" style="width: 100%;" :clearable="false" type="datetime" placeholder="时间" format="HH:mm" value-format="HH:mm" />
  216. </el-form-item>
  217. </el-col>
  218. <el-col :span="8">
  219. <el-form-item label="模板配方:" prop="ftid">
  220. <el-select v-model="create.temp.ftid" :disabled="create.list2.length>0" placeholder="模板配方" style="width:100%;" @change="changeTemplateFormulation">
  221. <el-option v-for="item in templateFormulationList" :key="item.id" :label="item.tname" :value="item.id" />
  222. </el-select>
  223. </el-form-item>
  224. </el-col>
  225. </el-row>
  226. <el-row>
  227. <el-col :span="8">
  228. <el-form-item label="描述:" prop="display">
  229. <el-input v-model="create.temp.display" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" placeholder="描述" maxlength="255" style="width: 100%;" />
  230. </el-form-item>
  231. </el-col>
  232. </el-row>
  233. </el-form>
  234. <div v-if="create.dialogStatus !=='update' && !isDispaly" slot="footer" class="dialog-footer">
  235. <el-button class="cancelClose" @click="create.dialogFormVisible = false;getList()">关闭</el-button>
  236. <el-button v-if="create.dialogStatus==='create'" class="save" :disabled="isokDisable" @click="distributionAndSpreading()">分配撒料</el-button>
  237. </div>
  238. <!-- 栏舍 -->
  239. <div v-if="create.dialogStatus =='update' || isDispaly" class="bottom" style="border-top: 1px solid #009C69;">
  240. <el-row>
  241. <el-col :span="20">
  242. <div class="fenceHouse">
  243. <ul v-loading="create.listLoadingTimes" class="fenceHouseList">
  244. <li v-for="element in create.list1" :key="element.arrid">
  245. <span v-if="element.isShowTitle" class="fenceHouseTitle">{{ element.ftname }}:</span>
  246. <div v-for="item in element.arrList" :key="item.id" class="colorBlock">
  247. <div style="position: relative;">
  248. <el-tooltip placement="top" style="height: 18px;line-height: 18px;" :style="{'background':item.background}">
  249. <div slot="content">{{ item.barname }}</div>
  250. <div class="barname">
  251. <span style="float: left;width: 70px;overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">{{ item.barname }}</span>
  252. <button style="background: red;float: right;color: #fff;width: 18px;font-size: 18px;border: none;text-align: center;" :disabled="isokDisable" @click="clickBar(item)">√</button>
  253. </div>
  254. </el-tooltip>
  255. <div class="barWeight" :style="{ background: 'rgba('+item.background2+ ',0.1)' }"> {{ item.weight }} </div>
  256. </div>
  257. </div>
  258. </li>
  259. </ul>
  260. </div>
  261. </el-col>
  262. <el-col :span="4">
  263. <div style="text-align: center;height: 100px;margin-top: 40px;">
  264. <div class="maxweight" style="line-height:20px;"><b>最大重量:</b>{{ create.temp.maxweight }} (KG)</div>
  265. <div class="sumweight" style="line-height:20px;margin-top: 10px;"><b>合计重量:</b>{{ create.temp.sumweight }} (KG) </div>
  266. </div>
  267. </el-col>
  268. </el-row>
  269. <!-- 撒料 -->
  270. <div class="spreadingMaterial">
  271. <div>撒料:<el-button type="danger" @click="handleEmpty">清空</el-button></div>
  272. <div class="spreadingMaterialList">
  273. <draggable
  274. :disabled="isDropState"
  275. id="1"
  276. data-source="juju"
  277. :list="create.list2"
  278. class="list-group1"
  279. draggable=".item"
  280. group="a"
  281. animation="500"
  282. force-fallback="true"
  283. :move="move1"
  284. @change="changeLog1"
  285. @start="start1"
  286. @end="end1(create.temp)"
  287. >
  288. <div v-for="element in create.list2" :key="element.name" class="list-group-item2 item">
  289. <div class="arr-l" :style="{'background':element.tbackground}">
  290. <div class="arr-l-t">
  291. <div class="arr-l-t-t" />
  292. <el-select
  293. v-model="element.tmrid"
  294. placeholder="撒料设备"
  295. class="arr-l-t-b el-icon-arrow-down"
  296. @change="(value)=> {changeEquipment(value, element.fttype,element.id)}"
  297. >
  298. <el-option
  299. v-for="item in equipmentList"
  300. :key="item.id"
  301. :label="item.tname"
  302. :value="item.id"
  303. />
  304. </el-select>
  305. </div>
  306. <div class="arr-l-b">
  307. <el-tooltip placement="top" class="list-group-item1 item" style="height: 18px;line-height: 18px;">
  308. <div slot="content">{{ element.tmrname }}</div>
  309. <div class="tmrname">{{ element.tmrname }}</div>
  310. </el-tooltip>
  311. </div>
  312. <div v-if="element.fttype==0" style="background: #009C69;position:absolute;bottom: 0;left: 0;">补</div>
  313. </div>
  314. <div class="arr-r">
  315. <div class="arr-r-l">
  316. <el-tooltip placement="top">
  317. <div slot="content">{{ element.barname }}</div>
  318. <div class="barname">{{ element.barname }}</div>
  319. </el-tooltip>
  320. </div>
  321. <div class="arr-r-c">-</div>
  322. <div class="arr-r-r">
  323. <el-tooltip placement="top">
  324. <div slot="content">{{ element.weight }}</div>
  325. <input
  326. ref="weight"
  327. v-model="element.weight"
  328. :autofocus="element.focusState"
  329. type="number"
  330. placeholder="重量"
  331. step="0.01"
  332. class="filter-item2"
  333. style="display: inline-block;height:25px;padding:4px 4px 4px 0;text-align:right;font-size:12px;width: 95%;border: 1px solid #e6e6e6;"
  334. @keyup.enter="$event.target.blur"
  335. @focus="focusWeight"
  336. @blur="blurWeight(element)"
  337. >
  338. </el-tooltip>
  339. </div>
  340. </div>
  341. <div class="arr-t" :style="{'background':element.background}">
  342. <i class="el-icon-close" style="position: absolute;right: 0;" @click="handleFLDelete(element)" />
  343. </div>
  344. </div>
  345. </draggable>
  346. </div>
  347. </div>
  348. <div slot="footer" class="dialog-footer" style="height: 55px;">
  349. <el-button class="cancelClose" :disabled="isokDisable" @click="close()" style="top:40px;">关闭</el-button>
  350. <el-button class="save" :disabled="isokDisable" @click="updateData()" style="top:40px;">确认</el-button>
  351. </div>
  352. </div>
  353. </div>
  354. </el-dialog>
  355. <!-- 校验 -->
  356. <el-dialog :title="textMap[check.dialogStatus]" :destroy-on-close="true" :visible.sync="check.dialogFormVisible" :close-on-click-modal="false" width="30%">
  357. <div class="check">
  358. <p v-if="check.temp.isDistribution == 0">当前有未分配栏舍,未分配栏舍如下:</p>
  359. <p v-else>已分配完:当前栏舍已分配完善</p>
  360. <div v-for="(item,index) in check.temp.ftlist" :key="index">
  361. <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
  362. <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
  363. <span v-for="(item2,index2) in item.arrList" :key="index2">
  364. {{item2.barname}}
  365. </span>
  366. </span>
  367. </div>
  368. </div>
  369. <div slot="footer" class="dialog-footer" style="bottom: 10px;">
  370. <el-button class="save" @click="check.dialogFormVisible=false;">确认</el-button>
  371. </div>
  372. </el-dialog>
  373. </div>
  374. </template>
  375. <script>
  376. import Cookies from 'js-cookie'
  377. import draggable from 'vuedraggable'
  378. import Sortable from 'sortablejs'
  379. import { checkButtons, ExecDataByConfig, postJson } from '@/api/common'
  380. import { MessageBox } from 'element-ui'
  381. export default {
  382. components: {
  383. draggable
  384. },
  385. data() {
  386. return {
  387. isRoleEdit: [],
  388. rowStyle: { maxHeight: 25 + 'px', height: 25 + 'px' },
  389. cellStyle: { padding: 0 + 'px' },
  390. height: document.body.clientHeight - 220, // table高度
  391. table: {
  392. getdataListParm: {
  393. page: 1,
  394. offset: 1,
  395. pagecount: 0,
  396. returntype: 'Map',
  397. parammaps: {
  398. pastureid: Cookies.get('pastureid'),
  399. times: 1,
  400. refresh: 1
  401. }
  402. },
  403. tableKey: 0,
  404. list: [],
  405. total: 0,
  406. listLoading: false
  407. },
  408. frequencyList: [], // 班次
  409. maxTime: {
  410. getMaxTimesParm: {
  411. name: 'getSysoptEnable',
  412. page: 1,
  413. offset: 1,
  414. pagecount: 1,
  415. returntype: 'Map',
  416. parammaps: {
  417. pastureid: Cookies.get('pastureid'),
  418. inforname: 'times'
  419. }
  420. }
  421. },
  422. // 是否显示小料拆分
  423. isInforvalue: false,
  424. selectList: [],
  425. historyRecord: {
  426. dialogFormVisible: false,
  427. dialogStatus: '',
  428. myComponent: null
  429. },
  430. // 自动生成
  431. automaticGeneration: {
  432. dialogFormVisible: false,
  433. dialogStatus: ''
  434. },
  435. textMap: {
  436. automaticGeneration: '提示',
  437. historyRecord: '历史记录',
  438. create: '新增',
  439. update: '编辑',
  440. check: '提示'
  441. },
  442. check: {
  443. dialogFormVisible: false,
  444. dialogStatus: '',
  445. temp: {
  446. ftlist:[],
  447. isDistribution: ''
  448. }
  449. },
  450. dialogFull: false,
  451. isOrder: true,
  452. requestParam: {},
  453. isokDisable: false,
  454. create: {
  455. dialogFormVisible: false,
  456. dialogStatus: '',
  457. temp: { sel: 1, tmrid: '', tmrid2: '', maxweight: '', issplit: 1, begintime: '', sumweight: 0, display: '', times: 1, ftid: '', ftname: '', tmrname: '', maxweight: '' },
  458. rules: {
  459. tmrid2: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
  460. times: [{ type: 'number', required: true, message: '必填', trigger: 'blur' }],
  461. ftid: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }]
  462. },
  463. listLoadingTimes: false,
  464. list1: [],
  465. list2: [],
  466. checkBarList: []
  467. },
  468. TMRNumberList: [], // TMR编号
  469. equipmentList: [], // 撒料设备
  470. templateFormulationList: [], // 模板配方
  471. isDispaly: false,
  472. dropState: false,
  473. isDropState:false
  474. }
  475. },
  476. created() {
  477. this.getButtons()
  478. this.getIsDisplay()
  479. this.getList()
  480. },
  481. methods: {
  482. getButtons() {
  483. const Edit = 'MaterialIssuancePlan'
  484. const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
  485. this.isRoleEdit = isRoleEdit
  486. },
  487. // 下拉列表
  488. getDownList() {
  489. const url = 'authdata/GetDataByName'
  490. const data1 = {
  491. name: 'getTMRListEnableType',
  492. offset: 0,
  493. parammaps: {
  494. pastureid: Cookies.get('pastureid'),
  495. eqtype: '1'
  496. }
  497. }
  498. postJson(url, data1).then(response => {
  499. if (response.data !== null) {
  500. this.TMRNumberList = response.data.list
  501. } else {
  502. this.TMRNumberList = []
  503. }
  504. })
  505. const data2 = {
  506. name: 'getTMRListEnableTypeAll',
  507. offset: 0,
  508. parammaps: {
  509. pastureid: Cookies.get('pastureid'),
  510. eqtype: '1'
  511. }
  512. }
  513. postJson(url, data2).then(response => {
  514. if (response.data !== null) {
  515. this.equipmentList = response.data.list
  516. if(this.create.dialogStatus == 'update'){
  517. this.create.temp.tclassname = this.equipmentList.find(obj => obj.id == this.create.temp.tmrid).tclassname
  518. }
  519. } else {
  520. this.equipmentList = []
  521. }
  522. })
  523. const data3 = {
  524. name: 'getFTSWList',
  525. offset: 0,
  526. parammaps: {
  527. pastureid: Cookies.get('pastureid')
  528. }
  529. }
  530. postJson(url, data3).then(response => {
  531. if (response.data !== null) {
  532. this.templateFormulationList = response.data.list
  533. } else {
  534. this.templateFormulationList = []
  535. }
  536. })
  537. const data4 = {
  538. name: 'getSysoptEnable',
  539. offset: 0,
  540. parammaps: {
  541. pastureid: Cookies.get('pastureid'),
  542. inforname: 'isSmallMaterial'
  543. }
  544. }
  545. postJson(url, data4).then(response => {
  546. if (response.data !== null) {
  547. if (response.data.list[0].inforvalue == 0) {
  548. this.isInforvalue = false
  549. } else {
  550. this.isInforvalue = true
  551. }
  552. } else {
  553. this.isInforvalue = false
  554. }
  555. })
  556. },
  557. getIsDisplay() {
  558. const url = 'authdata/GetDataByName'
  559. const data = this.maxTime.getMaxTimesParm
  560. postJson(url, data).then(response => {
  561. console.log(response.data.list[0].inforvalue)
  562. if (response.data.list[0].inforvalue == 1) {
  563. this.frequencyList = [{ id: 1, name: '第一班' }]
  564. } else if (response.data.list[0].inforvalue == 2) {
  565. this.frequencyList = [
  566. { id: 1, name: '第一班' },
  567. { id: 2, name: '第二班' }
  568. ]
  569. } else if (response.data.list[0].inforvalue == 3) {
  570. this.frequencyList = [
  571. { id: 1, name: '第一班' },
  572. { id: 2, name: '第二班' },
  573. { id: 3, name: '第三班' }
  574. ]
  575. } else if (response.data.list[0].inforvalue == 4) {
  576. this.frequencyList = [
  577. { id: 1, name: '第一班' },
  578. { id: 2, name: '第二班' },
  579. { id: 3, name: '第三班' },
  580. { id: 4, name: '第四班' }
  581. ]
  582. }
  583. })
  584. },
  585. getList() {
  586. this.table.listLoading = true
  587. const url = 'authdata/spillage'
  588. const data = this.table.getdataListParm
  589. postJson(url, data).then(response => {
  590. if (response.data.list !== undefined) {
  591. if (response.data.list !== null) {
  592. console.log('table数据', response.data.list)
  593. for (let i = 0; i < response.data.list.length; i++) {
  594. if (response.data.list[i].arrList == null) {
  595. this.$set(response.data.list[i], 'arrList', [])
  596. }
  597. }
  598. this.table.list = response.data.list
  599. this.table.total = response.data.list.length
  600. setTimeout(() => {
  601. this.$refs.table.doLayout()
  602. }, 100)
  603. } else {
  604. this.table.list = []
  605. }
  606. }
  607. this.table.listLoading = false
  608. })
  609. },
  610. changeFrequency(val) {
  611. console.log('选择了班次', val)
  612. this.getList()
  613. },
  614. // 行内删除
  615. handleRowDelete(row) {
  616. console.log(row, '点击了行删除')
  617. if (row.arrList.length == 0) {
  618. MessageBox.confirm('是否确认删除此信息?', {
  619. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  620. }).then(() => {
  621. this.selectList = []
  622. this.requestParam = {}
  623. this.requestParam.name = 'deleteLpp'
  624. this.requestParam.parammaps = {}
  625. this.requestParam.parammaps.pastureid = row.pastureid
  626. this.requestParam.parammaps.id = row.id
  627. const url = 'authdata/PostDataByName'
  628. const data = this.requestParam
  629. postJson(url, data).then(response => {
  630. if (response.msg === 'fail') {
  631. this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
  632. } else {
  633. this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
  634. this.table.getdataListParm.parammaps.refresh = 1
  635. this.getList()
  636. }
  637. })
  638. }).catch(() => {
  639. this.$message({ type: 'info', message: '已取消删除' })
  640. })
  641. } else {
  642. this.$message({ type: 'error', message: '本车次已添加栏舍不可删除', duration: 2000 })
  643. return false
  644. }
  645. },
  646. handleSelect(val) {
  647. console.log('勾选数据', val)
  648. this.selectList = val
  649. },
  650. changeTemplateFormulation(item) {
  651. this.create.temp.ftname = this.templateFormulationList.find(obj => obj.id === item).tname
  652. this.getCreateList1()
  653. },
  654. changeTimes(item) {
  655. this.getCreateList1()
  656. },
  657. // TMR编号
  658. changeTMRNumber(item) {
  659. if (this.create.list2.length > 0) {
  660. MessageBox.confirm('更换TMR撒料设备,会清空撒料车,是否更换?', {
  661. confirmButtonText: '是', cancelButtonText: '否', type: 'warning'
  662. }).then(() => {
  663. this.create.temp.tmrid = this.create.temp.tmrid2
  664. this.create.temp.tmrname = this.TMRNumberList.find(obj => obj.id === item).eqcode
  665. this.create.temp.maxweight = this.TMRNumberList.find(obj => obj.id === item).maxstirfeed
  666. this.create.temp.tclassname = this.TMRNumberList.find(obj => obj.id === item).tclassname
  667. this.create.temp.mytmrid = this.create.temp.tmrid
  668. this.create.temp.mytmrname = this.create.temp.tmrname
  669. console.log('tmrname==>', this.create.temp)
  670. if (this.isDispaly || this.create.dialogStatus == 'update') {
  671. this.getClearList()
  672. }
  673. }).catch(() => {
  674. this.create.temp.tmrid2 = this.create.temp.tmrid
  675. this.create.temp.tmrname = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).eqcode
  676. this.create.temp.maxweight = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).maxstirfeed
  677. this.create.temp.tclassname = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).tclassname
  678. this.create.temp.mytmrid = this.create.temp.tmrid2
  679. this.create.temp.mytmrname = this.create.temp.tmrname
  680. console.log(this.create.temp)
  681. this.$message({ type: 'info', message: '已取消' })
  682. })
  683. } else {
  684. this.create.temp.tmrid = this.create.temp.tmrid2
  685. this.create.temp.tmrname = this.TMRNumberList.find(obj => obj.id === item).eqcode
  686. this.create.temp.maxweight = this.TMRNumberList.find(obj => obj.id === item).maxstirfeed
  687. this.create.temp.tclassname = this.TMRNumberList.find(obj => obj.id === item).tclassname
  688. this.create.temp.mytmrid = this.create.temp.tmrid
  689. this.create.temp.mytmrname = this.create.temp.tmrname
  690. if (this.isDispaly || this.create.dialogStatus == 'update') {
  691. this.getClearList()
  692. }
  693. console.log('TMR编号item==>', item)
  694. }
  695. console.log('tmrname==>', this.create.temp)
  696. },
  697. getClearList() {
  698. const url = 'authdata/lpplandtl/del'
  699. const data = []
  700. this.create.list2.forEach((item, i) => {
  701. const obj = {}
  702. obj.pastureid = item.pastureid
  703. obj.lpplandtlid = item.id
  704. obj.fttype = item.fttype
  705. obj.lweight = item.lweight
  706. obj.fpdid = item.fpdid
  707. data.push(obj)
  708. })
  709. postJson(url, data).then(response => {
  710. if (response.msg === 'fail') {
  711. this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
  712. } else {
  713. this.$notify({ title: '', message: '成功', type: 'success', duration: 2000 })
  714. this.getCreateList1()
  715. }
  716. })
  717. },
  718. colorRgb(sColor) {
  719. sColor = sColor.toLowerCase()
  720. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/
  721. // 如果是16进制颜色
  722. if (sColor && reg.test(sColor)) {
  723. if (sColor.length === 4) {
  724. var sColorNew = '#'
  725. for (var i = 1; i < 4; i += 1) {
  726. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1))
  727. }
  728. sColor = sColorNew
  729. }
  730. // 处理六位的颜色值
  731. var sColorChange = []
  732. for (var i = 1; i < 7; i += 2) {
  733. sColorChange.push(parseInt('0x' + sColor.slice(i, i + 2)))
  734. }
  735. return sColorChange.join(',')
  736. }
  737. return 'rgba(' + sColorChange.join(',') + ')'
  738. },
  739. dbclickWeight(item) {
  740. console.log('item==>', item)
  741. console.log('isRoleEdit==>', this.isRoleEdit)
  742. this.$set(item, 'isWeight', true)
  743. this.$set(item, 'focusState', true)
  744. },
  745. focusWeight(){
  746. this.isDropState = true
  747. },
  748. blurWeight(item) {
  749. this.isDropState = false
  750. if (parseFloat(item.weight) <= 0) {
  751. this.$message({ type: 'error', message: '重量不可输入小于0的数据', duration: 2000 })
  752. return false
  753. }
  754. if (item.weight == '') {
  755. item.weight = 0
  756. }
  757. const lweight = String(parseFloat(item.weight) - parseFloat(item.lweight))
  758. let sum = 0
  759. this.create.list2.forEach((item, i) => {
  760. console.log('item==>', item)
  761. sum += parseFloat(item.weight)
  762. })
  763. if (sum > this.create.temp.maxweight) {
  764. this.$message({ type: 'error', message: '撒料车总重量大于最大重量', duration: 2000 })
  765. return false
  766. }
  767. this.requestParam = {}
  768. this.requestParam.common = { 'returnmap': '0' }
  769. this.requestParam.data = []
  770. this.requestParam.data[0] = {
  771. 'name': 'checkFPdLeftW', 'type': 'v',
  772. 'parammaps': {
  773. pastureid: item.pastureid, fpdid: item.fpdid, fttype: item.fttype,
  774. lweight: lweight
  775. }
  776. }
  777. this.requestParam.data[1] = {
  778. 'name': 'updateLppd', 'type': 'e',
  779. 'parammaps': {
  780. pastureid: this.create.temp.pastureid, lppid: this.create.temp.id, barid: item.barid,
  781. barname: item.barname, fpdid: item.fpdid, fttype: item.fttype,
  782. lweight: item.weight, sort: item.sort, tmrid: item.tmrid,
  783. tmrname: item.tmrname, background: item.background, id: item.id
  784. }
  785. }
  786. this.requestParam.data[2] = {
  787. 'name': 'updateFpdetailUse', 'type': 'e',
  788. 'parammaps': {
  789. pastureid: item.pastureid, id: item.fpdid,
  790. fttype: item.fttype, lweight: lweight
  791. }
  792. }
  793. ExecDataByConfig(this.requestParam).then(response => {
  794. if (response.msg === 'fail') {
  795. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  796. } else {
  797. // this.isDropState = false
  798. // this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  799. }
  800. this.getCreateList1()
  801. })
  802. },
  803. handleFLDelete(ele) {
  804. console.log(ele, '点击了撒料删除')
  805. this.requestParam = {}
  806. this.requestParam.common = { 'returnmap': '0' }
  807. this.requestParam.data = []
  808. this.requestParam.data[0] = {
  809. 'name': 'deleteLppd', 'type': 'e',
  810. 'parammaps': { pastureid: ele.pastureid, id: ele.id }
  811. }
  812. this.requestParam.data[1] = {
  813. 'name': 'updateFpdetailUse', 'type': 'e',
  814. 'parammaps': { pastureid: ele.pastureid, id: ele.fpdid, fttype: ele.fttype, lweight: '-' + parseFloat(ele.weight) }
  815. }
  816. const url = 'authdata/ExecDataByConfig'
  817. const data = this.requestParam
  818. postJson(url, data).then(response => {
  819. if (response.msg === 'fail') {
  820. this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
  821. } else {
  822. this.$notify({ title: '', message: '删除成功', type: 'success', duration: 2000 })
  823. this.getCreateList1()
  824. }
  825. })
  826. },
  827. handleCreate() {
  828. console.log('新增车次')
  829. this.create.temp = { sel: 1, tmrid: '', tmrid2: '', maxweight: '', issplit: 1, begintime: '', sumweight: 0, display: '', times: 1, ftid: '', ftname: '', tmrname: '', maxweight: '' }
  830. this.create.temp.times = this.table.getdataListParm.parammaps.times
  831. this.getDownList()
  832. this.isDispaly = false
  833. this.dialogFull = false
  834. this.create.dialogStatus = 'create'
  835. this.create.dialogFormVisible = true
  836. this.create.list1 = []
  837. this.create.list2 = []
  838. this.create.checkBarList = []
  839. },
  840. distributionAndSpreading() {
  841. console.log('点击了分配撒料')
  842. this.$refs['temp'].validate(valid => {
  843. if (valid) {
  844. this.isokDisable = true
  845. setTimeout(() => {
  846. this.isokDisable = false
  847. }, 1000)
  848. const url = 'authdata/lpplan/add'
  849. const data = {}
  850. this.create.temp.pastureid = Cookies.get('pastureid')
  851. this.create.temp.times = parseInt(this.create.temp.times)
  852. data.parammaps = this.create.temp
  853. postJson(url, data).then(response => {
  854. console.log('新增保存发送参数', this.requestParam)
  855. if (response.msg !== 'fail') {
  856. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  857. this.create.temp.id = response.data.Id
  858. this.isDispaly = true
  859. } else {
  860. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  861. }
  862. })
  863. this.getCreateList1()
  864. }
  865. })
  866. },
  867. getCreateList1() {
  868. this.create.listLoadingTimes = true
  869. const url = 'authdata/spillage'
  870. const data = {
  871. page: 1,
  872. offset: 1,
  873. pagecount: 0,
  874. returntype: 'Map',
  875. parammaps: {
  876. pastureid: Cookies.get('pastureid'),
  877. times: this.create.temp.times,
  878. refresh: 2,
  879. ftid: this.create.temp.ftid
  880. }
  881. }
  882. postJson(url, data).then(response => {
  883. if (response.data.ftlist !== null) {
  884. for (let i = 0; i < response.data.ftlist.length; i++) {
  885. this.$set(response.data.ftlist[i], 'isShowTitle', true)
  886. if (response.data.ftlist[i].arrList == null) {
  887. this.$set(response.data.ftlist[i], 'isShowTitle', false)
  888. } else {
  889. for (let j = 0; j < response.data.ftlist[i].arrList.length; j++) {
  890. this.$set(response.data.ftlist[i].arrList[j], 'background2', this.colorRgb(response.data.ftlist[i].arrList[j].background))
  891. }
  892. }
  893. }
  894. this.create.list1 = response.data.ftlist
  895. } else {
  896. this.create.list1 = []
  897. }
  898. this.create.listLoadingTimes = false
  899. })
  900. this.getCreateList2()
  901. },
  902. getCreateList2() {
  903. const url = 'authdata/lpplandtl'
  904. const data = {}
  905. data.parammaps = {}
  906. data.parammaps.pastureid = Cookies.get('pastureid'),
  907. data.parammaps.id = this.create.temp.id
  908. postJson(url, data).then(response => {
  909. if (response.data !== null) {
  910. this.create.list2 = response.data
  911. this.create.temp.sort = response.data.length + 1
  912. var sumweight = 0
  913. for (let i = 0; i < this.create.list2.length; i++) {
  914. sumweight += parseFloat(this.create.list2[i].weight)
  915. this.$set(this.create.list2[i], 'isWeight', false)
  916. this.$set(this.create.list2[i], 'focusState', false)
  917. }
  918. console.log('sumweight==>', sumweight)
  919. this.create.temp.sumweight = (sumweight).toFixed(2)
  920. } else {
  921. this.create.list2 = []
  922. this.create.temp.sort = 0
  923. this.create.temp.sumweight = 0
  924. }
  925. })
  926. },
  927. clickBar(item) {
  928. this.isokDisable = true
  929. setTimeout(() => {
  930. this.isokDisable = false
  931. }, 1000)
  932. console.log('点击了栏舍item==>', item)
  933. this.create.temp.sumweight = parseFloat(this.create.temp.sumweight)
  934. console.log('temp==>',this.create.temp)
  935. console.log('this.equipmentList==>',this.equipmentList)
  936. // if(this.create.temp.tclassname == '固定式'){
  937. // if(this.equipmentList.find(obj => obj.tclassname == '撒料设备') !== undefined){
  938. // this.create.temp.tmrname = this.equipmentList.find(obj => obj.tclassname == '撒料设备').eqcode
  939. // this.create.temp.tmrid = this.equipmentList.find(obj => obj.tclassname == '撒料设备').id
  940. // }else if(this.equipmentList.find(obj => obj.tclassname == '自走式') !== undefined){
  941. // this.create.temp.tmrname = this.equipmentList.find(obj => obj.tclassname == '自走式').eqcode
  942. // this.create.temp.tmrid = this.equipmentList.find(obj => obj.tclassname == '自走式').id
  943. // }else{
  944. // this.$message({ type: 'error', message: '请先在TMR设备中创建撒料设备', duration: 2000 })
  945. // return
  946. // }
  947. // }
  948. if(this.create.temp.tclassname == '固定式'){
  949. if(this.equipmentList.find(obj => obj.tclassname == '任意车') !== undefined){
  950. this.create.temp.tmrname = this.equipmentList.find(obj => obj.tclassname == '任意车').eqcode
  951. this.create.temp.tmrid = this.equipmentList.find(obj => obj.tclassname == '任意车').id
  952. }
  953. }
  954. var evt = this.create.temp
  955. if (parseFloat(evt.maxweight) - parseFloat(evt.sumweight) < parseFloat(item.weight)) {
  956. if (parseFloat(evt.sumweight) + parseFloat(item.weight) > parseFloat(evt.maxweight)) {
  957. this.$set(item, 'weight', (parseFloat(evt.maxweight) - parseFloat(evt.sumweight)).toFixed(2))
  958. }
  959. }
  960. if (parseFloat(evt.maxweight) == parseFloat(evt.sumweight) || parseFloat(evt.maxweight) < parseFloat(evt.sumweight)) {
  961. this.$message({ type: 'error', message: '计划配方已经是最大容量', duration: 2000 })
  962. this.getCreateList1()
  963. return
  964. }
  965. console.log('item.weight===>', evt.maxweight)
  966. console.log('item.weight===>', evt.sumweight)
  967. // const url = 'authdata/lpplandtl/add'
  968. // const data = {}
  969. // data.parammaps = {}
  970. // data.parammaps.id = item.id
  971. // data.parammaps.pastureid = evt.pastureid
  972. // data.parammaps.lppid = evt.id
  973. // data.parammaps.barid = item.barid
  974. // data.parammaps.barname = item.barname
  975. // data.parammaps.fpdid = item.id
  976. // data.parammaps.lweight = item.weight
  977. // data.parammaps.tmrid = evt.tmrid
  978. // data.parammaps.tmrname = evt.tmrname
  979. // data.parammaps.fttype = item.fttype
  980. // data.parammaps.background = item.background
  981. // data.parammaps.cowcount = item.cowcount
  982. // data.parammaps.ccountradio = item.ccountradio
  983. // postJson(url, data).then(response => {
  984. // this.requestParam = {}
  985. // this.requestParam.common = { 'returnmap': '0' }
  986. // this.requestParam.data = []
  987. // this.requestParam.data[0] = { 'name': 'updateFpdetailUse', 'type': 'e',
  988. // 'parammaps': { pastureid: item.pastureid, id: item.id, fttype: item.fttype, lweight: item.weight }
  989. // }
  990. this.requestParam = {}
  991. this.requestParam.common = {
  992. 'returnmap': '0'
  993. }
  994. this.requestParam.data = []
  995. this.requestParam.data[0] = { 'name': 'insertLppd', 'type': 'e', 'parammaps': {
  996. pastureid:item.pastureid,
  997. lppid:evt.id,
  998. barid:item.barid,
  999. barname:item.barname,
  1000. fpdid:item.id,
  1001. tmrid:evt.tmrid,
  1002. tmrname:evt.tmrname,
  1003. fttype:item.fttype,
  1004. background:item.background,
  1005. cowcount:item.cowcount,
  1006. ccountradio:item.ccountradio,
  1007. lweight:item.weight
  1008. }
  1009. }
  1010. ExecDataByConfig(this.requestParam).then(response => {
  1011. this.requestParam = {}
  1012. this.requestParam.common = { 'returnmap': '0' }
  1013. this.requestParam.data = []
  1014. this.requestParam.data[0] = { 'name': 'updateFpdetailUse', 'type': 'e',
  1015. 'parammaps': { pastureid: item.pastureid, id: item.id, fttype: item.fttype, lweight: item.weight }
  1016. }
  1017. const url2 = 'authdata/ExecDataByConfig'
  1018. const data2 = this.requestParam
  1019. postJson(url2, data2).then(response => {
  1020. if (response.msg === 'fail') {
  1021. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1022. } else {
  1023. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  1024. }
  1025. this.getCreateList1()
  1026. })
  1027. })
  1028. },
  1029. handleUpdate(row) {
  1030. console.log(row)
  1031. console.log("equipmentList",this.equipmentList)
  1032. this.getDownList()
  1033. this.dialogFull = false
  1034. this.create.dialogStatus = 'update'
  1035. this.create.dialogFormVisible = true
  1036. row.tmrid2 = row.tmrid
  1037. this.create.temp = Object.assign({}, row)
  1038. this.create.temp.mytmrname = row.tmrname
  1039. this.create.temp.mytmrid = row.tmrid
  1040. this.create.checkBarList = []
  1041. console.log(this.create.temp,'this.create.temp')
  1042. this.getCreateList1()
  1043. },
  1044. updateData() {
  1045. this.$refs['temp'].validate(valid => {
  1046. if (valid) {
  1047. this.isokDisable = true
  1048. setTimeout(() => {
  1049. this.isokDisable = false
  1050. }, 1000)
  1051. const url = 'authdata/lpplan/edit'
  1052. const data = {}
  1053. this.create.temp.pastureid = Cookies.get('pastureid')
  1054. this.create.temp.times = parseInt(this.create.temp.times)
  1055. data.parammaps = this.create.temp
  1056. data.parammaps.tmrid = this.create.temp.mytmrid
  1057. data.parammaps.tmrname = this.create.temp.mytmrname
  1058. postJson(url, data).then(response => {
  1059. console.log('新增保存发送参数', this.requestParam)
  1060. if (response.msg !== 'fail') {
  1061. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  1062. this.isDispaly = false
  1063. this.dialogFull = false
  1064. this.create.dialogFormVisible = false
  1065. this.getList()
  1066. } else {
  1067. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1068. }
  1069. })
  1070. }
  1071. })
  1072. },
  1073. close() {
  1074. if (this.create.dialogStatus == 'create') {
  1075. console.log('新增关闭')
  1076. this.isokDisable = true
  1077. setTimeout(() => {
  1078. this.isokDisable = false
  1079. }, 1000)
  1080. const url = 'authdata/lpplandtl/restore'
  1081. const data = {}
  1082. data.old = []
  1083. data.new = this.create.list2
  1084. postJson(url, data).then(response => {
  1085. console.log('新增保存发送参数', this.requestParam)
  1086. if (response.msg !== 'fail') {
  1087. this.isDispaly = false
  1088. this.dialogFull = false
  1089. this.create.dialogFormVisible = false
  1090. this.getList()
  1091. }
  1092. })
  1093. } else {
  1094. console.log('编辑关闭')
  1095. this.isokDisable = true
  1096. setTimeout(() => {
  1097. this.isokDisable = false
  1098. }, 1000)
  1099. const url = 'authdata/lpplandtl/restore'
  1100. const data = {}
  1101. data.old = this.create.temp.arrList
  1102. data.new = this.create.list2
  1103. postJson(url, data).then(response => {
  1104. console.log('新增保存发送参数', this.requestParam)
  1105. if (response.msg !== 'fail') {
  1106. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  1107. this.isDispaly = false
  1108. this.dialogFull = false
  1109. this.create.dialogFormVisible = false
  1110. this.getList()
  1111. } else {
  1112. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1113. }
  1114. })
  1115. }
  1116. },
  1117. changeEquipment(item, fttype, myid) {
  1118. console.log('item==>',item)
  1119. console.log('fttype==>',fttype)
  1120. console.log('myid==>',myid)
  1121. let tclassname = this.equipmentList.find(obj => obj.id == item).tclassname
  1122. let maxstirfeed = this.equipmentList.find(obj => obj.id == item).maxstirfeed
  1123. if(tclassname == '固定式'){
  1124. this.$message({ type: 'error', message: '固定式设备无法撒料,请选择撒料设备', duration: 2000 })
  1125. this.getCreateList2()
  1126. return
  1127. }
  1128. var objList = {}
  1129. for (let i = 0; i < this.create.list2.length; i++) {
  1130. if (this.create.list2[i].fttype == fttype && this.create.list2[i].id == myid) {
  1131. this.create.list2[i].tmrname = this.equipmentList.find(obj => obj.id === item).tname
  1132. objList = this.create.list2[i]
  1133. if(parseFloat(this.create.list2[i].weight) > parseFloat(maxstirfeed)){
  1134. objList.weight = maxstirfeed
  1135. }
  1136. }
  1137. }
  1138. // const url = 'authdata/lpplandtl/add'
  1139. // const data = {}
  1140. // data.parammaps = {}
  1141. // data.parammaps.id = objList.id
  1142. // data.parammaps.pastureid = this.create.temp.pastureid
  1143. // data.parammaps.lppid = this.create.temp.id
  1144. // data.parammaps.tmrid = objList.tmrid
  1145. // data.parammaps.tmrname = objList.tmrname
  1146. // postJson(url, data).then(response => {
  1147. // console.log('新增保存发送参数', this.requestParam)
  1148. // if (response.msg === 'fail') {
  1149. // this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1150. // } else {
  1151. // this.getCreateList2()
  1152. // this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  1153. // }
  1154. // })
  1155. this.requestParam = {}
  1156. this.requestParam.common = {
  1157. 'returnmap': '0'
  1158. }
  1159. this.requestParam.data = []
  1160. this.requestParam.data[0] = { 'name': 'updateLpplandtl1Tmr', 'type': 'e', 'parammaps': {
  1161. tmrid: objList.tmrid,
  1162. tmrname: objList.tmrname,
  1163. id: objList.id,
  1164. pastureid: this.create.temp.pastureid,
  1165. }
  1166. }
  1167. ExecDataByConfig(this.requestParam).then(response => {
  1168. console.log('编辑保存发送参数', this.requestParam)
  1169. if (response.msg === 'fail') {
  1170. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1171. } else {
  1172. this.getCreateList2()
  1173. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  1174. }
  1175. })
  1176. },
  1177. move1(evt, originalEvent){
  1178. console.log('move1===>evt', evt)
  1179. console.log('move1===>originalEvent', originalEvent)
  1180. },
  1181. changeLog1(evt){
  1182. // 按组拖拽
  1183. // const url = 'authdata/lpplandtl/edit/sort'
  1184. // const data = {}
  1185. // var obj = evt.moved.element
  1186. // data.parammaps = {}
  1187. // data.parammaps.tmrid = obj.tmrid
  1188. // data.parammaps.pastureid = obj.pastureid
  1189. // data.parammaps.lppid = obj.lppid
  1190. // data.parammaps.sort = evt.moved.newIndex +1
  1191. // postJson(url, data).then(response => {
  1192. // console.log('拖动保存发送参数', this.requestParam)
  1193. // if (response.msg === 'fail') {
  1194. // this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1195. // } else {
  1196. // this.getCreateList2()
  1197. // this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  1198. // }
  1199. // })
  1200. var sortArr = []
  1201. for (let i = 0; i < this.create.list2.length; i++) {
  1202. var obj = {}
  1203. obj.sort = i + 1
  1204. obj.id = this.create.list2[i].id
  1205. obj.pastureid = this.create.list2[i].pastureid
  1206. sortArr.push(obj)
  1207. }
  1208. this.requestParam = {}
  1209. this.requestParam.common = { 'returnmap': '0' }
  1210. this.requestParam.data = []
  1211. this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': sortArr }}
  1212. this.requestParam.data[0].children = []
  1213. this.requestParam.data[0].children[0] = { 'name': 'updateLpplandtlSortone', 'type': 'e', 'parammaps': {
  1214. id: '@insertSpotList.id',
  1215. pastureid: '@insertSpotList.pastureid',
  1216. sort: '@insertSpotList.sort'
  1217. }}
  1218. ExecDataByConfig(this.requestParam).then(response => {
  1219. console.log('顺序切换保存发送参数', this.requestParam)
  1220. if (response.msg === 'fail') {
  1221. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1222. } else {
  1223. this.getCreateList2()
  1224. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  1225. }
  1226. })
  1227. },
  1228. start1(evt){
  1229. console.log('start1===>', evt)
  1230. // this.$set(this.table.startObj, 'from', evt.from.className)
  1231. // this.$set(this.table.startObj, 'to', evt.from.className)
  1232. },
  1233. end1(evt){
  1234. console.log('end1===>', evt)
  1235. },
  1236. // 减少车次
  1237. handleReduceTrains() {
  1238. if (this.selectList.length == 0) {
  1239. this.$message({ type: 'error', message: '请选择车次', duration: 2000 })
  1240. return false
  1241. } else {
  1242. // 减少对应车次
  1243. for (let i = 0; i < this.selectList.length; i++) {
  1244. if (this.selectList[i].arrList.length > 0) {
  1245. this.$message({ type: 'error', message: '本车次已添加栏舍不可删除', duration: 2000 })
  1246. return false
  1247. }
  1248. }
  1249. MessageBox.confirm('是否确认删除此信息?', {
  1250. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  1251. }).then(() => {
  1252. console.log(this.selectList)
  1253. this.requestParam = {}
  1254. this.requestParam.common = { 'returnmap': '0' }
  1255. this.requestParam.data = []
  1256. this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
  1257. this.requestParam.data[0].children = []
  1258. this.requestParam.data[0].children[0] = {
  1259. 'name': 'deleteLpp', 'type': 'e', 'parammaps': { id: '@insertSpotList.id', pastureid: '@insertSpotList.pastureid' }
  1260. }
  1261. ExecDataByConfig(this.requestParam).then(response => {
  1262. console.log('删除保存发送参数', this.requestParam)
  1263. if (response.msg === 'fail') {
  1264. this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
  1265. } else {
  1266. this.$notify({ title: '', message: '删除成功', type: 'success', duration: 2000 })
  1267. this.table.getdataListParm.parammaps.refresh = 1
  1268. this.getList()
  1269. }
  1270. })
  1271. })
  1272. }
  1273. },
  1274. // 自动生成
  1275. handleAutomaticGeneration() {
  1276. this.dialogFull = false
  1277. this.automaticGeneration.dialogStatus = 'automaticGeneration'
  1278. this.automaticGeneration.dialogFormVisible = true
  1279. },
  1280. continueData(item) {
  1281. if (item == 0) {
  1282. console.log('点击继续生成')
  1283. this.requestParam = {}
  1284. this.requestParam.pastureid = Cookies.get('pastureid')
  1285. this.requestParam.type = 0
  1286. const url = 'authdata/autogeneration'
  1287. const data = this.requestParam
  1288. postJson(url, data).then(response => {
  1289. console.log('新增保存发送参数', this.requestParam)
  1290. if (response.msg !== 'fail') {
  1291. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  1292. this.automaticGeneration.dialogFormVisible = false
  1293. this.getIsDisplay()
  1294. } else {
  1295. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1296. }
  1297. })
  1298. } else {
  1299. console.log('点击重新生成')
  1300. MessageBox.confirm('重新生成计划会将原有计划清空再生成,是否确认重新生成?', {
  1301. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  1302. }).then(() => {
  1303. this.automaticGeneration.dialogFormVisible = false
  1304. this.requestParam = {}
  1305. this.requestParam.pastureid = Cookies.get('pastureid')
  1306. this.requestParam.type = 1
  1307. const url = 'authdata/autogeneration'
  1308. const data = this.requestParam
  1309. postJson(url, data).then(response => {
  1310. console.log('新增保存发送参数', this.requestParam)
  1311. if (response.msg !== 'fail') {
  1312. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  1313. this.automaticGeneration.dialogFormVisible = false
  1314. this.getIsDisplay()
  1315. } else {
  1316. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1317. }
  1318. })
  1319. }).catch(() => {
  1320. this.$message({ type: 'info', message: '已取消重新生成' })
  1321. })
  1322. }
  1323. },
  1324. handleChangeOrder() {
  1325. console.log('更改顺序')
  1326. this.isOrder = false
  1327. this.rowDrop()
  1328. },
  1329. // 行拖拽
  1330. rowDrop() {
  1331. console.log(document.querySelector('#table .el-table__body-wrapper tbody'))
  1332. const tbody = document.querySelector('#table .el-table__body-wrapper tbody')
  1333. const that = this
  1334. var sortable = Sortable.create(tbody, {
  1335. disabled: that.dropState,
  1336. onChoose({ newIndex, oldIndex }) {
  1337. console.log(that.isOrder, 'that.isOrder == false')
  1338. console.log(that.dropState, 'that.dropState')
  1339. if (that.dropState == true || that.isOrder == true) {
  1340. sortable.destroy()
  1341. }
  1342. },
  1343. onEnd({ newIndex, oldIndex }) {
  1344. const currRow = that.table.list.splice(oldIndex, 1)[0]
  1345. that.table.list.splice(newIndex, 0, currRow)
  1346. console.log('索引', newIndex)
  1347. console.log('拖动数据', currRow)
  1348. console.log('上', that.table.list[newIndex - 1])
  1349. console.log('下', that.table.list[newIndex + 1])
  1350. }
  1351. })
  1352. },
  1353. saveChangeOrder() {
  1354. // 保存顺序
  1355. var sortArr = []
  1356. for (let i = 0; i < this.table.list.length; i++) {
  1357. var obj = {}
  1358. obj.sort = i + 1
  1359. obj.id = this.table.list[i].id
  1360. obj.pastureid = this.table.list[i].pastureid
  1361. sortArr.push(obj)
  1362. }
  1363. const url = 'authdata/trains'
  1364. const data = sortArr
  1365. postJson(url, data).then(response => {
  1366. if (response.msg === 'fail') {
  1367. this.$notify({ title: '顺序切换失败', message: response.data, type: 'warning', duration: 2000 })
  1368. } else {
  1369. this.$notify({ title: '', message: '顺序切换成功', type: 'success', duration: 2000 })
  1370. this.table.getdataListParm.parammaps.refresh = 1
  1371. this.getList()
  1372. this.isOrder = true
  1373. }
  1374. })
  1375. },
  1376. cancelChangeOrder() {
  1377. console.log('取消顺序')
  1378. this.table.getdataListParm.parammaps.refresh = 1
  1379. this.getList()
  1380. this.isOrder = true
  1381. },
  1382. handleTakeEffect() {
  1383. if (this.selectList.length == 0) {
  1384. this.$message({ type: 'error', message: '请选择车次信息', duration: 2000 })
  1385. } else {
  1386. MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否生效?', {
  1387. confirmButtonText: '确认',
  1388. cancelButtonText: '取消',
  1389. type: 'warning'
  1390. }).then(() => {
  1391. for (let i = 0; i < this.selectList.length; i++) {
  1392. this.selectList[i].sel = 1
  1393. }
  1394. console.log('生效', this.selectList)
  1395. this.requestParam.common = { 'returnmap': '0' }
  1396. this.requestParam.data = []
  1397. this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
  1398. this.requestParam.data[0].children = []
  1399. this.requestParam.data[0].children[0] = {
  1400. 'name': 'updatelpplanEnable', 'type': 'e', 'parammaps': { sel: '@insertSpotList.sel', id: '@insertSpotList.id', pastureid: '@insertSpotList.pastureid' }
  1401. }
  1402. ExecDataByConfig(this.requestParam).then(response => {
  1403. console.log('生效保存发送参数', this.requestParam)
  1404. if (response.msg === 'fail') {
  1405. this.$notify({ title: '生效失败', message: response.data, type: 'warning', duration: 2000 })
  1406. } else {
  1407. this.$notify({ title: '', message: '生效成功', type: 'success', duration: 2000 })
  1408. this.table.getdataListParm.parammaps.refresh = 1
  1409. this.getList()
  1410. }
  1411. })
  1412. })
  1413. }
  1414. },
  1415. handleDisable() {
  1416. if (this.selectList.length == 0) {
  1417. this.$message({ type: 'error', message: '请选择车次信息', duration: 2000 })
  1418. } else {
  1419. MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否禁用?', {
  1420. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  1421. }).then(() => {
  1422. for (let i = 0; i < this.selectList.length; i++) {
  1423. this.selectList[i].sel = 0
  1424. }
  1425. console.log('禁用', this.selectList)
  1426. this.requestParam.common = { 'returnmap': '0' }
  1427. this.requestParam.data = []
  1428. this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
  1429. this.requestParam.data[0].children = []
  1430. this.requestParam.data[0].children[0] = {
  1431. 'name': 'updatelpplanEnable',
  1432. 'type': 'e',
  1433. 'parammaps': { sel: '@insertSpotList.sel', id: '@insertSpotList.id', pastureid: '@insertSpotList.pastureid' }
  1434. }
  1435. ExecDataByConfig(this.requestParam).then(response => {
  1436. console.log('禁用保存发送参数', this.requestParam)
  1437. if (response.msg === 'fail') {
  1438. this.$notify({ title: '禁用失败', message: response.data, type: 'warning', duration: 2000 })
  1439. } else {
  1440. this.$notify({ title: '禁用成功', message: '禁用成功', type: 'success', duration: 2000 })
  1441. this.table.getdataListParm.parammaps.refresh = 1
  1442. this.getList()
  1443. }
  1444. })
  1445. })
  1446. }
  1447. },
  1448. // 历史记录
  1449. handleHistoryRecord() {
  1450. console.log('点击历史记录')
  1451. this.dialogFull = false
  1452. this.historyRecord.dialogStatus = 'historyRecord'
  1453. this.historyRecord.dialogFormVisible = true
  1454. const vue = this
  1455. var myComponent = () => import('./historyRecord.vue')
  1456. return vue.historyRecord.myComponent = myComponent
  1457. },
  1458. handleCheck() {
  1459. console.log('点击了校验')
  1460. this.check.dialogStatus = 'check'
  1461. this.check.dialogFormVisible = true
  1462. this.getCheckList()
  1463. },
  1464. getCheckList() {
  1465. const url = 'authdata/spillage'
  1466. const data = {
  1467. page: 1,
  1468. offset: 1,
  1469. pagecount: 0,
  1470. returntype: 'Map',
  1471. parammaps: {
  1472. pastureid: Cookies.get('pastureid'),
  1473. times: this.table.getdataListParm.parammaps.times,
  1474. refresh: 2
  1475. }
  1476. }
  1477. postJson(url, data).then(response => {
  1478. if (response.data.ftlist !== undefined && response.data.ftlist !== null) {
  1479. this.$set(this.check.temp,'isDistribution',0)
  1480. this.check.temp.ftlist = response.data.ftlist
  1481. } else {
  1482. this.check.temp = {}
  1483. this.$set(this.check.temp,'isDistribution',1)
  1484. }
  1485. })
  1486. },
  1487. handleEmpty(){
  1488. console.log('点击了清空')
  1489. var list = []
  1490. for(let i=0;i<this.create.list2.length;i++){
  1491. var obj = {}
  1492. obj.pastureid = this.create.list2[i].pastureid
  1493. obj.id = this.create.list2[i].fpdid
  1494. obj.fttype = this.create.list2[i].fttype
  1495. obj.lweight = '-'+this.create.list2[i].weight
  1496. list.push(obj)
  1497. }
  1498. this.requestParam = {}
  1499. this.requestParam.common = { 'returnmap': '0' }
  1500. this.requestParam.data = []
  1501. this.requestParam.data[0] = { 'name': 'deleteLpplandtl1ByLppid', 'type': 'e', 'parammaps': { lppid: this.create.temp.id, pastureid: Cookies.get('pastureid') }},
  1502. this.requestParam.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': list }}
  1503. this.requestParam.data[1].children = []
  1504. this.requestParam.data[1].children[0] = {
  1505. 'name': 'updateFpdetailUse',
  1506. 'type': 'e',
  1507. 'parammaps': { pastureid: '@insertSpotList.pastureid', id: '@insertSpotList.id', fttype: '@insertSpotList.fttype', lweight: '@insertSpotList.lweight' }
  1508. }
  1509. ExecDataByConfig(this.requestParam).then(response => {
  1510. console.log('清空保存发送参数', this.requestParam)
  1511. if (response.msg === 'fail') {
  1512. this.$notify({ title: '清空失败', message: response.data, type: 'warning', duration: 2000 })
  1513. } else {
  1514. this.$notify({ title: '清空成功', message: '清空成功', type: 'success', duration: 2000 })
  1515. this.getCreateList1()
  1516. }
  1517. })
  1518. }
  1519. }
  1520. }
  1521. </script>
  1522. <style lang="scss" scoped>
  1523. .list{width: 60px;display: inline-block;margin: 5px 5px;text-align: center;
  1524. .tmrname{
  1525. width:100%;padding: 5px 5px;overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  1526. }
  1527. }
  1528. .fenceHouse {
  1529. height: 130px;
  1530. background: #fff;
  1531. position: relative;
  1532. ::-webkit-scrollbar {
  1533. width: 7px;
  1534. height: 7px;
  1535. background-color: #F5F5F5;
  1536. }
  1537. ::-webkit-scrollbar-track {
  1538. box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
  1539. -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
  1540. border-radius: 10px;
  1541. background-color: #F5F5F5;
  1542. }
  1543. ::-webkit-scrollbar-thumb {
  1544. border-radius: 10px;
  1545. box-shadow: inset 0 0 6px rgba(0, 0, 0, .1);
  1546. -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .1);
  1547. background-color: #c8c8c8;
  1548. }
  1549. .fenceHouseList {
  1550. position: absolute;
  1551. width: 100%;
  1552. margin: 0 0;
  1553. height: 130px;
  1554. list-style: none;
  1555. padding: 0 0;
  1556. overflow: auto;
  1557. font-size: 12px;
  1558. .fenceHouseTitle {
  1559. float: left;
  1560. width: 105px;
  1561. white-space: nowrap;
  1562. overflow: hidden;
  1563. text-overflow: ellipsis;
  1564. margin: 5px 5px;
  1565. border-radius: 7px;
  1566. text-align: center;
  1567. color: #000;
  1568. height: 36px;
  1569. line-height: 36px;
  1570. }
  1571. li {
  1572. text-align: center;
  1573. color: #fff;
  1574. .barname {
  1575. display: block;
  1576. width: 100%;
  1577. overflow: hidden;
  1578. text-overflow: ellipsis;
  1579. white-space: nowrap;
  1580. }
  1581. .barWeight{
  1582. display: block;
  1583. line-height: 18px;
  1584. height: 18px;
  1585. color: #000;
  1586. width: 100%;
  1587. margin: 0 auto;
  1588. }
  1589. .colorBlock{
  1590. width: 88px;float: left;margin:5px 5px;height: 36px;
  1591. }
  1592. }
  1593. }
  1594. }
  1595. </style>
  1596. <style lang="scss" >
  1597. .spreadingMaterial {
  1598. height: 200px;
  1599. ::-webkit-scrollbar {
  1600. width: 7px;
  1601. height: 7px;
  1602. background-color: #F5F5F5;
  1603. }
  1604. ::-webkit-scrollbar-track {
  1605. box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
  1606. -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
  1607. border-radius: 10px;
  1608. background-color: #F5F5F5;
  1609. }
  1610. ::-webkit-scrollbar-thumb {
  1611. border-radius: 10px;
  1612. box-shadow: inset 0 0 6px rgba(0, 0, 0, .1);
  1613. -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .1);
  1614. background-color: #c8c8c8;
  1615. }
  1616. .spreadingMaterialList{height: 100%;overflow: auto;}
  1617. .list-group-item2 {
  1618. width: 220px;
  1619. height: 50px;
  1620. overflow: hidden;
  1621. float: left;
  1622. margin: 5px 5px;
  1623. position: relative;
  1624. color: #fff;
  1625. .arr-t {
  1626. height: 50px;
  1627. border-radius: 5px 5px;
  1628. }
  1629. .arr-l {
  1630. float: left;
  1631. width: 60px;
  1632. height: 50px;
  1633. overflow: hidden;
  1634. border-radius: 5px 50% 50% 5px;
  1635. .arr-l-t {
  1636. position: relative;
  1637. .arr-l-t-t {
  1638. width: 0;
  1639. height: 0;
  1640. border-top: 26px solid #3479f2;
  1641. border-right: 26px solid transparent;
  1642. }
  1643. .arr-l-t-b {
  1644. position: absolute;
  1645. top: 4px;
  1646. left: 1px;
  1647. color: #fff;
  1648. width: 10px;
  1649. height: 10px;
  1650. .el-input--suffix {
  1651. opacity: 0;
  1652. .el-input__inner {
  1653. height: 10px;
  1654. }
  1655. }
  1656. }
  1657. }
  1658. .arr-l-b {
  1659. width: 45px;
  1660. position: absolute;
  1661. top: 15px;
  1662. left: 10px;
  1663. color: #fff !important;
  1664. font-size: 12px;
  1665. .tmrname {
  1666. width: 100%;
  1667. overflow: hidden;
  1668. text-overflow: ellipsis;
  1669. white-space: nowrap;
  1670. }
  1671. }
  1672. }
  1673. .arr-c {
  1674. position: absolute;
  1675. top: 0px;
  1676. left: 0;
  1677. }
  1678. .arr-r {
  1679. float: right;
  1680. width: 160px;
  1681. height: 50px;
  1682. overflow: hidden;
  1683. line-height: 50px;
  1684. .arr-r-l {
  1685. float: left;
  1686. width: 70px;
  1687. .barname {
  1688. width: 95%;
  1689. overflow: hidden;
  1690. text-overflow: ellipsis;
  1691. white-space: nowrap;
  1692. font-size: 14px;
  1693. text-align: center;
  1694. }
  1695. }
  1696. .arr-r-c {
  1697. float: left;
  1698. width: 10px;
  1699. }
  1700. .arr-r-r {
  1701. float: left;
  1702. width: 65px;
  1703. .weight {
  1704. width: 100%;
  1705. overflow: hidden;
  1706. text-overflow: ellipsis;
  1707. white-space: nowrap;
  1708. font-size: 14px;
  1709. }
  1710. }
  1711. }
  1712. }
  1713. }
  1714. </style>