index.vue 68 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701
  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="success" 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===>', item.weight)
  966. const url = 'authdata/lpplandtl/add'
  967. const data = {}
  968. data.parammaps = {}
  969. data.parammaps.id = item.id
  970. data.parammaps.pastureid = evt.pastureid
  971. data.parammaps.lppid = evt.id
  972. data.parammaps.barid = item.barid
  973. data.parammaps.barname = item.barname
  974. data.parammaps.fpdid = item.id
  975. data.parammaps.lweight = item.weight
  976. data.parammaps.tmrid = evt.tmrid
  977. data.parammaps.tmrname = evt.tmrname
  978. data.parammaps.fttype = item.fttype
  979. data.parammaps.background = item.background
  980. data.parammaps.cowcount = item.cowcount
  981. data.parammaps.ccountradio = item.ccountradio
  982. postJson(url, data).then(response => {
  983. this.requestParam = {}
  984. this.requestParam.common = { 'returnmap': '0' }
  985. this.requestParam.data = []
  986. // this.requestParam.data[0] = { 'name': 'updateLpplandtlSorts', 'type': 'e',
  987. // 'parammaps': { pastureid: evt.pastureid, sort: evt.sort, lppid: evt.id }
  988. // }
  989. // this.requestParam.data[1] = { 'name': 'insertLppd', 'type': 'e',
  990. // 'parammaps': {
  991. // pastureid: evt.pastureid, lppid: evt.id, barid: item.barid, barname: item.barname, fpdid: item.id, fttype: item.fttype,
  992. // lweight: item.weight, sort: evt.sort, tmrid: evt.tmrid, tmrname: evt.tmrname,
  993. // background: item.background, ccountradio: item.ccountradio, cowcount: item.cowcount
  994. // }
  995. // }
  996. this.requestParam.data[0] = { 'name': 'updateFpdetailUse', 'type': 'e',
  997. 'parammaps': { pastureid: item.pastureid, id: item.id, fttype: item.fttype, lweight: item.weight }
  998. }
  999. const url2 = 'authdata/ExecDataByConfig'
  1000. const data2 = this.requestParam
  1001. postJson(url2, data2).then(response => {
  1002. if (response.msg === 'fail') {
  1003. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1004. } else {
  1005. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  1006. }
  1007. this.getCreateList1()
  1008. })
  1009. })
  1010. },
  1011. handleUpdate(row) {
  1012. console.log(row)
  1013. console.log("equipmentList",this.equipmentList)
  1014. this.getDownList()
  1015. this.dialogFull = false
  1016. this.create.dialogStatus = 'update'
  1017. this.create.dialogFormVisible = true
  1018. row.tmrid2 = row.tmrid
  1019. this.create.temp = Object.assign({}, row)
  1020. this.create.temp.mytmrname = row.tmrname
  1021. this.create.temp.mytmrid = row.tmrid
  1022. this.create.checkBarList = []
  1023. console.log(this.create.temp,'this.create.temp')
  1024. this.getCreateList1()
  1025. },
  1026. updateData() {
  1027. this.$refs['temp'].validate(valid => {
  1028. if (valid) {
  1029. this.isokDisable = true
  1030. setTimeout(() => {
  1031. this.isokDisable = false
  1032. }, 1000)
  1033. const url = 'authdata/lpplan/edit'
  1034. const data = {}
  1035. this.create.temp.pastureid = Cookies.get('pastureid')
  1036. this.create.temp.times = parseInt(this.create.temp.times)
  1037. data.parammaps = this.create.temp
  1038. data.parammaps.tmrid = this.create.temp.mytmrid
  1039. data.parammaps.tmrname = this.create.temp.mytmrname
  1040. postJson(url, data).then(response => {
  1041. console.log('新增保存发送参数', this.requestParam)
  1042. if (response.msg !== 'fail') {
  1043. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  1044. this.isDispaly = false
  1045. this.dialogFull = false
  1046. this.create.dialogFormVisible = false
  1047. this.getList()
  1048. } else {
  1049. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1050. }
  1051. })
  1052. }
  1053. })
  1054. },
  1055. close() {
  1056. if (this.create.dialogStatus == 'create') {
  1057. console.log('新增关闭')
  1058. this.isokDisable = true
  1059. setTimeout(() => {
  1060. this.isokDisable = false
  1061. }, 1000)
  1062. const url = 'authdata/lpplandtl/restore'
  1063. const data = {}
  1064. data.old = []
  1065. data.new = this.create.list2
  1066. postJson(url, data).then(response => {
  1067. console.log('新增保存发送参数', this.requestParam)
  1068. if (response.msg !== 'fail') {
  1069. this.isDispaly = false
  1070. this.dialogFull = false
  1071. this.create.dialogFormVisible = false
  1072. this.getList()
  1073. }
  1074. })
  1075. } else {
  1076. console.log('编辑关闭')
  1077. this.isokDisable = true
  1078. setTimeout(() => {
  1079. this.isokDisable = false
  1080. }, 1000)
  1081. const url = 'authdata/lpplandtl/restore'
  1082. const data = {}
  1083. data.old = this.create.temp.arrList
  1084. data.new = this.create.list2
  1085. postJson(url, data).then(response => {
  1086. console.log('新增保存发送参数', this.requestParam)
  1087. if (response.msg !== 'fail') {
  1088. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  1089. this.isDispaly = false
  1090. this.dialogFull = false
  1091. this.create.dialogFormVisible = false
  1092. this.getList()
  1093. } else {
  1094. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1095. }
  1096. })
  1097. }
  1098. },
  1099. changeEquipment(item, fttype, myid) {
  1100. console.log('item==>',item)
  1101. console.log('fttype==>',fttype)
  1102. console.log('myid==>',myid)
  1103. let tclassname = this.equipmentList.find(obj => obj.id == item).tclassname
  1104. let maxstirfeed = this.equipmentList.find(obj => obj.id == item).maxstirfeed
  1105. if(tclassname == '固定式'){
  1106. this.$message({ type: 'error', message: '固定式设备无法撒料,请选择撒料设备', duration: 2000 })
  1107. this.getCreateList2()
  1108. return
  1109. }
  1110. var objList = {}
  1111. for (let i = 0; i < this.create.list2.length; i++) {
  1112. if (this.create.list2[i].fttype == fttype && this.create.list2[i].id == myid) {
  1113. this.create.list2[i].tmrname = this.equipmentList.find(obj => obj.id === item).tname
  1114. objList = this.create.list2[i]
  1115. if(parseFloat(this.create.list2[i].weight) > parseFloat(maxstirfeed)){
  1116. objList.weight = maxstirfeed
  1117. }
  1118. }
  1119. }
  1120. const url = 'authdata/lpplandtl/add'
  1121. const data = {}
  1122. data.parammaps = {}
  1123. data.parammaps.id = objList.id
  1124. data.parammaps.pastureid = this.create.temp.pastureid
  1125. data.parammaps.lppid = this.create.temp.id
  1126. data.parammaps.tmrid = objList.tmrid
  1127. data.parammaps.tmrname = objList.tmrname
  1128. postJson(url, data).then(response => {
  1129. console.log('新增保存发送参数', this.requestParam)
  1130. if (response.msg === 'fail') {
  1131. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1132. } else {
  1133. this.getCreateList2()
  1134. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  1135. }
  1136. })
  1137. // this.requestParam = {}
  1138. // this.requestParam.common = {
  1139. // 'returnmap': '0'
  1140. // }
  1141. // this.requestParam.data = []
  1142. // this.requestParam.data[0] = {
  1143. // 'name': 'updateLppd',
  1144. // 'type': 'e',
  1145. // 'parammaps': {
  1146. // pastureid: this.create.temp.pastureid,
  1147. // lppid: this.create.temp.id,
  1148. // barid: objList.barid,
  1149. // barname: objList.barname,
  1150. // fpdid: objList.fpdid,
  1151. // fttype: objList.fttype,
  1152. // lweight: objList.weight,
  1153. // sort: objList.sort,
  1154. // tmrid: objList.tmrid,
  1155. // tmrname: objList.tmrname,
  1156. // background: objList.background,
  1157. // id: objList.id
  1158. // }
  1159. // }
  1160. // ExecDataByConfig(this.requestParam).then(response => {
  1161. // console.log('编辑保存发送参数', this.requestParam)
  1162. // if (response.msg === 'fail') {
  1163. // this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1164. // } else {
  1165. // this.getCreateList2()
  1166. // this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  1167. // }
  1168. // })
  1169. },
  1170. move1(evt, originalEvent){
  1171. console.log('move1===>evt', evt)
  1172. console.log('move1===>originalEvent', originalEvent)
  1173. },
  1174. changeLog1(evt){
  1175. const url = 'authdata/lpplandtl/edit/sort'
  1176. const data = {}
  1177. var obj = evt.moved.element
  1178. data.parammaps = {}
  1179. data.parammaps.tmrid = obj.tmrid
  1180. data.parammaps.pastureid = obj.pastureid
  1181. data.parammaps.lppid = obj.lppid
  1182. data.parammaps.sort = evt.moved.newIndex +1
  1183. postJson(url, data).then(response => {
  1184. console.log('拖动保存发送参数', this.requestParam)
  1185. if (response.msg === 'fail') {
  1186. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1187. } else {
  1188. this.getCreateList2()
  1189. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  1190. }
  1191. })
  1192. },
  1193. start1(evt){
  1194. console.log('start1===>', evt)
  1195. // this.$set(this.table.startObj, 'from', evt.from.className)
  1196. // this.$set(this.table.startObj, 'to', evt.from.className)
  1197. },
  1198. end1(evt){
  1199. console.log('end1===>', evt)
  1200. },
  1201. // 减少车次
  1202. handleReduceTrains() {
  1203. if (this.selectList.length == 0) {
  1204. this.$message({ type: 'error', message: '请选择车次', duration: 2000 })
  1205. return false
  1206. } else {
  1207. // 减少对应车次
  1208. for (let i = 0; i < this.selectList.length; i++) {
  1209. if (this.selectList[i].arrList.length > 0) {
  1210. this.$message({ type: 'error', message: '本车次已添加栏舍不可删除', duration: 2000 })
  1211. return false
  1212. }
  1213. }
  1214. MessageBox.confirm('是否确认删除此信息?', {
  1215. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  1216. }).then(() => {
  1217. console.log(this.selectList)
  1218. this.requestParam = {}
  1219. this.requestParam.common = { 'returnmap': '0' }
  1220. this.requestParam.data = []
  1221. this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
  1222. this.requestParam.data[0].children = []
  1223. this.requestParam.data[0].children[0] = {
  1224. 'name': 'deleteLpp', 'type': 'e', 'parammaps': { id: '@insertSpotList.id', pastureid: '@insertSpotList.pastureid' }
  1225. }
  1226. ExecDataByConfig(this.requestParam).then(response => {
  1227. console.log('删除保存发送参数', this.requestParam)
  1228. if (response.msg === 'fail') {
  1229. this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
  1230. } else {
  1231. this.$notify({ title: '', message: '删除成功', type: 'success', duration: 2000 })
  1232. this.table.getdataListParm.parammaps.refresh = 1
  1233. this.getList()
  1234. }
  1235. })
  1236. })
  1237. }
  1238. },
  1239. // 自动生成
  1240. handleAutomaticGeneration() {
  1241. this.dialogFull = false
  1242. this.automaticGeneration.dialogStatus = 'automaticGeneration'
  1243. this.automaticGeneration.dialogFormVisible = true
  1244. },
  1245. continueData(item) {
  1246. if (item == 0) {
  1247. console.log('点击继续生成')
  1248. this.requestParam = {}
  1249. this.requestParam.pastureid = Cookies.get('pastureid')
  1250. this.requestParam.type = 0
  1251. const url = 'authdata/autogeneration'
  1252. const data = this.requestParam
  1253. postJson(url, data).then(response => {
  1254. console.log('新增保存发送参数', this.requestParam)
  1255. if (response.msg !== 'fail') {
  1256. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  1257. this.automaticGeneration.dialogFormVisible = false
  1258. this.getIsDisplay()
  1259. } else {
  1260. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1261. }
  1262. })
  1263. } else {
  1264. console.log('点击重新生成')
  1265. MessageBox.confirm('重新生成计划会将原有计划清空再生成,是否确认重新生成?', {
  1266. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  1267. }).then(() => {
  1268. this.automaticGeneration.dialogFormVisible = false
  1269. this.requestParam = {}
  1270. this.requestParam.pastureid = Cookies.get('pastureid')
  1271. this.requestParam.type = 1
  1272. const url = 'authdata/autogeneration'
  1273. const data = this.requestParam
  1274. postJson(url, data).then(response => {
  1275. console.log('新增保存发送参数', this.requestParam)
  1276. if (response.msg !== 'fail') {
  1277. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  1278. this.automaticGeneration.dialogFormVisible = false
  1279. this.getIsDisplay()
  1280. } else {
  1281. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1282. }
  1283. })
  1284. }).catch(() => {
  1285. this.$message({ type: 'info', message: '已取消重新生成' })
  1286. })
  1287. }
  1288. },
  1289. handleChangeOrder() {
  1290. console.log('更改顺序')
  1291. this.isOrder = false
  1292. this.rowDrop()
  1293. },
  1294. // 行拖拽
  1295. rowDrop() {
  1296. console.log(document.querySelector('#table .el-table__body-wrapper tbody'))
  1297. const tbody = document.querySelector('#table .el-table__body-wrapper tbody')
  1298. const that = this
  1299. var sortable = Sortable.create(tbody, {
  1300. disabled: that.dropState,
  1301. onChoose({ newIndex, oldIndex }) {
  1302. console.log(that.isOrder, 'that.isOrder == false')
  1303. console.log(that.dropState, 'that.dropState')
  1304. if (that.dropState == true || that.isOrder == true) {
  1305. sortable.destroy()
  1306. }
  1307. },
  1308. onEnd({ newIndex, oldIndex }) {
  1309. const currRow = that.table.list.splice(oldIndex, 1)[0]
  1310. that.table.list.splice(newIndex, 0, currRow)
  1311. console.log('索引', newIndex)
  1312. console.log('拖动数据', currRow)
  1313. console.log('上', that.table.list[newIndex - 1])
  1314. console.log('下', that.table.list[newIndex + 1])
  1315. }
  1316. })
  1317. },
  1318. saveChangeOrder() {
  1319. // 保存顺序
  1320. var sortArr = []
  1321. for (let i = 0; i < this.table.list.length; i++) {
  1322. var obj = {}
  1323. obj.sort = i + 1
  1324. obj.id = this.table.list[i].id
  1325. obj.pastureid = this.table.list[i].pastureid
  1326. sortArr.push(obj)
  1327. }
  1328. const url = 'authdata/trains'
  1329. const data = sortArr
  1330. postJson(url, data).then(response => {
  1331. if (response.msg === 'fail') {
  1332. this.$notify({ title: '顺序切换失败', message: response.data, type: 'warning', duration: 2000 })
  1333. } else {
  1334. this.$notify({ title: '', message: '顺序切换成功', type: 'success', duration: 2000 })
  1335. this.table.getdataListParm.parammaps.refresh = 1
  1336. this.getList()
  1337. this.isOrder = true
  1338. }
  1339. })
  1340. },
  1341. cancelChangeOrder() {
  1342. console.log('取消顺序')
  1343. this.table.getdataListParm.parammaps.refresh = 1
  1344. this.getList()
  1345. this.isOrder = true
  1346. },
  1347. handleTakeEffect() {
  1348. if (this.selectList.length == 0) {
  1349. this.$message({ type: 'error', message: '请选择车次信息', duration: 2000 })
  1350. } else {
  1351. MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否生效?', {
  1352. confirmButtonText: '确认',
  1353. cancelButtonText: '取消',
  1354. type: 'warning'
  1355. }).then(() => {
  1356. for (let i = 0; i < this.selectList.length; i++) {
  1357. this.selectList[i].sel = 1
  1358. }
  1359. console.log('生效', this.selectList)
  1360. this.requestParam.common = { 'returnmap': '0' }
  1361. this.requestParam.data = []
  1362. this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
  1363. this.requestParam.data[0].children = []
  1364. this.requestParam.data[0].children[0] = {
  1365. 'name': 'updatelpplanEnable', 'type': 'e', 'parammaps': { sel: '@insertSpotList.sel', id: '@insertSpotList.id', pastureid: '@insertSpotList.pastureid' }
  1366. }
  1367. ExecDataByConfig(this.requestParam).then(response => {
  1368. console.log('生效保存发送参数', this.requestParam)
  1369. if (response.msg === 'fail') {
  1370. this.$notify({ title: '生效失败', message: response.data, type: 'warning', duration: 2000 })
  1371. } else {
  1372. this.$notify({ title: '', message: '生效成功', type: 'success', duration: 2000 })
  1373. this.table.getdataListParm.parammaps.refresh = 1
  1374. this.getList()
  1375. }
  1376. })
  1377. })
  1378. }
  1379. },
  1380. handleDisable() {
  1381. if (this.selectList.length == 0) {
  1382. this.$message({ type: 'error', message: '请选择车次信息', duration: 2000 })
  1383. } else {
  1384. MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否禁用?', {
  1385. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  1386. }).then(() => {
  1387. for (let i = 0; i < this.selectList.length; i++) {
  1388. this.selectList[i].sel = 0
  1389. }
  1390. console.log('禁用', this.selectList)
  1391. this.requestParam.common = { 'returnmap': '0' }
  1392. this.requestParam.data = []
  1393. this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
  1394. this.requestParam.data[0].children = []
  1395. this.requestParam.data[0].children[0] = {
  1396. 'name': 'updatelpplanEnable',
  1397. 'type': 'e',
  1398. 'parammaps': { sel: '@insertSpotList.sel', id: '@insertSpotList.id', pastureid: '@insertSpotList.pastureid' }
  1399. }
  1400. ExecDataByConfig(this.requestParam).then(response => {
  1401. console.log('禁用保存发送参数', this.requestParam)
  1402. if (response.msg === 'fail') {
  1403. this.$notify({ title: '禁用失败', message: response.data, type: 'warning', duration: 2000 })
  1404. } else {
  1405. this.$notify({ title: '禁用成功', message: '禁用成功', type: 'success', duration: 2000 })
  1406. this.table.getdataListParm.parammaps.refresh = 1
  1407. this.getList()
  1408. }
  1409. })
  1410. })
  1411. }
  1412. },
  1413. // 历史记录
  1414. handleHistoryRecord() {
  1415. console.log('点击历史记录')
  1416. this.dialogFull = false
  1417. this.historyRecord.dialogStatus = 'historyRecord'
  1418. this.historyRecord.dialogFormVisible = true
  1419. const vue = this
  1420. var myComponent = () => import('./historyRecord.vue')
  1421. return vue.historyRecord.myComponent = myComponent
  1422. },
  1423. handleCheck() {
  1424. console.log('点击了校验')
  1425. this.check.dialogStatus = 'check'
  1426. this.check.dialogFormVisible = true
  1427. this.getCheckList()
  1428. },
  1429. getCheckList() {
  1430. const url = 'authdata/spillage'
  1431. const data = {
  1432. page: 1,
  1433. offset: 1,
  1434. pagecount: 0,
  1435. returntype: 'Map',
  1436. parammaps: {
  1437. pastureid: Cookies.get('pastureid'),
  1438. times: this.table.getdataListParm.parammaps.times,
  1439. refresh: 2
  1440. }
  1441. }
  1442. postJson(url, data).then(response => {
  1443. if (response.data.ftlist !== undefined && response.data.ftlist !== null) {
  1444. this.$set(this.check.temp,'isDistribution',0)
  1445. this.check.temp.ftlist = response.data.ftlist
  1446. } else {
  1447. this.check.temp = {}
  1448. this.$set(this.check.temp,'isDistribution',1)
  1449. }
  1450. })
  1451. },
  1452. handleEmpty(){
  1453. console.log('点击了清空')
  1454. var list = []
  1455. for(let i=0;i<this.create.list2.length;i++){
  1456. var obj = {}
  1457. obj.pastureid = this.create.list2[i].pastureid
  1458. obj.id = this.create.list2[i].fpdid
  1459. obj.fttype = this.create.list2[i].fttype
  1460. obj.lweight = '-'+this.create.list2[i].weight
  1461. list.push(obj)
  1462. }
  1463. this.requestParam = {}
  1464. this.requestParam.common = { 'returnmap': '0' }
  1465. this.requestParam.data = []
  1466. this.requestParam.data[0] = { 'name': 'deleteLpplandtl1ByLppid', 'type': 'e', 'parammaps': { lppid: this.create.temp.id, pastureid: Cookies.get('pastureid') }},
  1467. this.requestParam.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': list }}
  1468. this.requestParam.data[1].children = []
  1469. this.requestParam.data[1].children[0] = {
  1470. 'name': 'updateFpdetailUse',
  1471. 'type': 'e',
  1472. 'parammaps': { pastureid: '@insertSpotList.pastureid', id: '@insertSpotList.id', fttype: '@insertSpotList.fttype', lweight: '@insertSpotList.lweight' }
  1473. }
  1474. ExecDataByConfig(this.requestParam).then(response => {
  1475. console.log('清空保存发送参数', this.requestParam)
  1476. if (response.msg === 'fail') {
  1477. this.$notify({ title: '清空失败', message: response.data, type: 'warning', duration: 2000 })
  1478. } else {
  1479. this.$notify({ title: '清空成功', message: '清空成功', type: 'success', duration: 2000 })
  1480. this.getCreateList1()
  1481. }
  1482. })
  1483. }
  1484. }
  1485. }
  1486. </script>
  1487. <style lang="scss" scoped>
  1488. .list{width: 60px;display: inline-block;margin: 5px 5px;text-align: center;
  1489. .tmrname{
  1490. width:100%;padding: 5px 5px;overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  1491. }
  1492. }
  1493. .fenceHouse {
  1494. height: 130px;
  1495. background: #fff;
  1496. position: relative;
  1497. ::-webkit-scrollbar {
  1498. width: 7px;
  1499. height: 7px;
  1500. background-color: #F5F5F5;
  1501. }
  1502. ::-webkit-scrollbar-track {
  1503. box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
  1504. -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
  1505. border-radius: 10px;
  1506. background-color: #F5F5F5;
  1507. }
  1508. ::-webkit-scrollbar-thumb {
  1509. border-radius: 10px;
  1510. box-shadow: inset 0 0 6px rgba(0, 0, 0, .1);
  1511. -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .1);
  1512. background-color: #c8c8c8;
  1513. }
  1514. .fenceHouseList {
  1515. position: absolute;
  1516. width: 100%;
  1517. margin: 0 0;
  1518. height: 130px;
  1519. list-style: none;
  1520. padding: 0 0;
  1521. overflow: auto;
  1522. font-size: 12px;
  1523. .fenceHouseTitle {
  1524. float: left;
  1525. width: 105px;
  1526. white-space: nowrap;
  1527. overflow: hidden;
  1528. text-overflow: ellipsis;
  1529. margin: 5px 5px;
  1530. border-radius: 7px;
  1531. text-align: center;
  1532. color: #000;
  1533. height: 36px;
  1534. line-height: 36px;
  1535. }
  1536. li {
  1537. text-align: center;
  1538. color: #fff;
  1539. .barname {
  1540. display: block;
  1541. width: 100%;
  1542. overflow: hidden;
  1543. text-overflow: ellipsis;
  1544. white-space: nowrap;
  1545. }
  1546. .barWeight{
  1547. display: block;
  1548. line-height: 18px;
  1549. height: 18px;
  1550. color: #000;
  1551. width: 100%;
  1552. margin: 0 auto;
  1553. }
  1554. .colorBlock{
  1555. width: 88px;float: left;margin:5px 5px;height: 36px;
  1556. }
  1557. }
  1558. }
  1559. }
  1560. </style>
  1561. <style lang="scss" >
  1562. .spreadingMaterial {
  1563. height: 200px;
  1564. ::-webkit-scrollbar {
  1565. width: 7px;
  1566. height: 7px;
  1567. background-color: #F5F5F5;
  1568. }
  1569. ::-webkit-scrollbar-track {
  1570. box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
  1571. -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
  1572. border-radius: 10px;
  1573. background-color: #F5F5F5;
  1574. }
  1575. ::-webkit-scrollbar-thumb {
  1576. border-radius: 10px;
  1577. box-shadow: inset 0 0 6px rgba(0, 0, 0, .1);
  1578. -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .1);
  1579. background-color: #c8c8c8;
  1580. }
  1581. .spreadingMaterialList{height: 100%;overflow: auto;}
  1582. .list-group-item2 {
  1583. width: 220px;
  1584. height: 50px;
  1585. overflow: hidden;
  1586. float: left;
  1587. margin: 5px 5px;
  1588. position: relative;
  1589. color: #fff;
  1590. .arr-t {
  1591. height: 50px;
  1592. border-radius: 5px 5px;
  1593. }
  1594. .arr-l {
  1595. float: left;
  1596. width: 60px;
  1597. height: 50px;
  1598. overflow: hidden;
  1599. border-radius: 5px 50% 50% 5px;
  1600. .arr-l-t {
  1601. position: relative;
  1602. .arr-l-t-t {
  1603. width: 0;
  1604. height: 0;
  1605. border-top: 26px solid #3479f2;
  1606. border-right: 26px solid transparent;
  1607. }
  1608. .arr-l-t-b {
  1609. position: absolute;
  1610. top: 4px;
  1611. left: 1px;
  1612. color: #fff;
  1613. width: 10px;
  1614. height: 10px;
  1615. .el-input--suffix {
  1616. opacity: 0;
  1617. .el-input__inner {
  1618. height: 10px;
  1619. }
  1620. }
  1621. }
  1622. }
  1623. .arr-l-b {
  1624. width: 45px;
  1625. position: absolute;
  1626. top: 15px;
  1627. left: 10px;
  1628. color: #fff !important;
  1629. font-size: 12px;
  1630. .tmrname {
  1631. width: 100%;
  1632. overflow: hidden;
  1633. text-overflow: ellipsis;
  1634. white-space: nowrap;
  1635. }
  1636. }
  1637. }
  1638. .arr-c {
  1639. position: absolute;
  1640. top: 0px;
  1641. left: 0;
  1642. }
  1643. .arr-r {
  1644. float: right;
  1645. width: 160px;
  1646. height: 50px;
  1647. overflow: hidden;
  1648. line-height: 50px;
  1649. .arr-r-l {
  1650. float: left;
  1651. width: 70px;
  1652. .barname {
  1653. width: 95%;
  1654. overflow: hidden;
  1655. text-overflow: ellipsis;
  1656. white-space: nowrap;
  1657. font-size: 14px;
  1658. text-align: center;
  1659. }
  1660. }
  1661. .arr-r-c {
  1662. float: left;
  1663. width: 10px;
  1664. }
  1665. .arr-r-r {
  1666. float: left;
  1667. width: 65px;
  1668. .weight {
  1669. width: 100%;
  1670. overflow: hidden;
  1671. text-overflow: ellipsis;
  1672. white-space: nowrap;
  1673. font-size: 14px;
  1674. }
  1675. }
  1676. }
  1677. }
  1678. }
  1679. </style>