85060546f5129e1c3c01a5bc9feb2f362c802848.svn-base 79 KB

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