c90c86915f34afa082f9474777bf7c58bfa93abe.svn-base 73 KB

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