e4372f2ce0f4e12542317fdd281a1df6fed81c40.svn-base 74 KB

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