index.vue 68 KB

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