a0c7f137a63355a55974340e68d2a84a03e63c4e.svn-base 49 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153
  1. <template>
  2. <div class="app-container">
  3. <!-- 配方模板表 -->
  4. <div ref="template" class="template">
  5. <div class="recipeTemplate">
  6. <p>日执行计划</p>
  7. </div>
  8. <div class="operation" style="margin-bottom: 10px;">
  9. <el-button class="success" @click="handleCreate">新生成</el-button>
  10. <el-button class="success" @click="handleRevisePlan">修改计划</el-button>
  11. <el-button v-if="isOrder" class="success" @click="handleChangeOrder">更改顺序</el-button>
  12. <div v-else style="margin-left: 10px;display: inline-block;">
  13. <el-button class="success" @click="saveChangeOrder">保存</el-button>
  14. <el-button class="success" @click="cancelChangeOrder">取消</el-button>
  15. </div>
  16. <!-- <el-button class="export" style="float: right;margin-right: 80px;" @click="handleHistoryRecord">历史记录</el-button> -->
  17. <el-button class="export" style="float: right;margin-right: 80px;" @click="handleMaterialPlan">撒料计划</el-button>
  18. <el-button class="export" style="float: right;margin-right: 10px;" @click="handlePremixedPlan">预混计划</el-button>
  19. <el-button class="export" style="float: right;margin-right: 10px;" @click="handleShedFormula">栏舍配方</el-button>
  20. <el-button class="export" style="float: right;margin-right: 10px;" @click="handleRecipeemplate">配方模板</el-button>
  21. </div>
  22. <div class="search">
  23. <el-date-picker v-model="table.getdataListParm.parammaps.mydate" type="date" placeholder="选择日期" style="width: 150px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" :clearable="false" @change="changeDate" />
  24. <el-button class="el-icon-arrow-left elIconArrowLeft" @click="handleBefore" />
  25. <el-button class="el-icon-arrow-right elIconArrowRight" @click="handleNext" />
  26. <el-select v-model="table.getdataListParm.parammaps.lpplantype" filterable placeholder="计划类型" class="filter-item" clearable style="width: 120px;" @change="changePlanType">
  27. <el-option v-for="item in planTypeList" :key="item.value" :label="item.lable" :value="item.value" />
  28. </el-select>
  29. <el-select v-model="table.getdataListParm.parammaps.times" filterable placeholder="班次" class="filter-item" style="width: 120px;" clearable @change="changeFrequency">
  30. <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
  31. </el-select>
  32. <el-select v-model="table.getdataListParm.parammaps.enable" filterable placeholder="打印类型" class="filter-item" clearable style="width: 120px;">
  33. <el-option v-for="item in printingTypeList" :key="item.value" :label="item.label" :value="item.value" />
  34. </el-select>
  35. <el-select v-model="table.getdataListParm.parammaps.enable" filterable placeholder="计划维度" class="filter-item" style="width: 120px;" clearable>
  36. <el-option v-for="item in planningDimensionList" :key="item.value" :label="item.label" :value="item.value" />
  37. </el-select>
  38. <el-select v-model="table.getdataListParm.parammaps.enable" filterable placeholder="导出类型" class="filter-item" style="width: 120px;" clearable>
  39. <el-option v-for="item in exportTypeList" :key="item.value" :label="item.label" :value="item.value" />
  40. </el-select>
  41. <el-button class="export" @click="handleExport">导出</el-button>
  42. </div>
  43. <!-- 日执行计划 -->
  44. <div class="table">
  45. <el-table
  46. id="table1"
  47. :key="table.tableKey"
  48. v-loading="table.listLoading"
  49. element-loading-text="给我一点时间"
  50. :data="table.list"
  51. border
  52. fit
  53. highlight-current-row
  54. style="width: 98%;"
  55. row-key="id"
  56. :row-style="rowStyle"
  57. :cell-style="cellStyle"
  58. class="elTable table-fixed"
  59. @row-click="tableRowClick"
  60. >
  61. <el-table-column label="序号" align="center" type="index" width="50px" />
  62. <el-table-column label="计划名称" min-width="110px" align="center">
  63. <template slot-scope="scope">
  64. <span>{{ scope.row.projname }}</span>
  65. </template>
  66. </el-table-column>
  67. <el-table-column label="计划类型" prop="weight" min-width="130px" align="center" :formatter="lpplantype" />
  68. <el-table-column label="TMR编号" min-width="110px" align="center">
  69. <template slot-scope="scope">
  70. <span>{{ scope.row.tmrtname }}</span>
  71. </template>
  72. </el-table-column>
  73. <el-table-column label="驾驶员" min-width="90px" align="center">
  74. <template slot-scope="scope">
  75. <span>{{ scope.row.driver }}</span>
  76. </template>
  77. </el-table-column>
  78. <el-table-column label="已执行" min-width="90px" align="center">
  79. <template slot-scope="scope">
  80. <span>{{ scope.row.havebutton }}</span>
  81. </template>
  82. </el-table-column>
  83. <el-table-column label="班次" min-width="110px" align="center">
  84. <template slot-scope="scope">
  85. <span>{{ scope.row.times }}</span>
  86. </template>
  87. </el-table-column>
  88. <el-table-column label="理论量" min-width="110px" align="center">
  89. <template slot-scope="scope">
  90. <span>{{ scope.row.lweight }}</span>
  91. </template>
  92. </el-table-column>
  93. <el-table-column label="时间" min-width="180px" align="center">
  94. <template slot-scope="scope">
  95. <span>{{ scope.row.plantime }}</span>
  96. </template>
  97. </el-table-column>
  98. <el-table-column label="发料位" min-width="180px" align="left">
  99. <template slot-scope="scope">
  100. <span>{{ scope.row.barnames }}</span>
  101. </template>
  102. </el-table-column>
  103. </el-table>
  104. </div>
  105. </div>
  106. <!-- 预混料 -->
  107. <div v-if="table3.getdataListParm.parammaps.lpplantype == 4" class="content">
  108. <div class="table2">
  109. <div class="contentOperation">
  110. <p>计划内容<br>操作详情</p>
  111. </div>
  112. <div class="content-table">
  113. <el-table
  114. :key="table2.tableKey"
  115. v-loading="table2.listLoading"
  116. element-loading-text="给我一点时间"
  117. :data="table2.list"
  118. fit
  119. highlight-current-row
  120. style="width: 100%;"
  121. height="450"
  122. :row-style="rowStyle"
  123. :cell-style="cellStyle"
  124. class="elTable table-fixed"
  125. >
  126. <el-table-column label="操作序号" min-width="130px" align="center">
  127. <template slot-scope="scope">
  128. <span>{{ scope.row.sort }}</span>
  129. </template>
  130. </el-table-column>
  131. <el-table-column label="饲料名称" prop="fname" min-width="130px" align="center">
  132. <template slot-scope="scope">
  133. <span>{{ scope.row.fname }}</span>
  134. </template>
  135. </el-table-column>
  136. <el-table-column label="设计重量(KG)" prop="weight" min-width="130px" align="center">
  137. <template slot-scope="scope">
  138. <span>{{ scope.row.weight }}</span>
  139. </template>
  140. </el-table-column>
  141. </el-table>
  142. </div>
  143. </div>
  144. </div>
  145. <!-- 撒料 -->
  146. <div v-if="table3.getdataListParm.parammaps.lpplantype == 0" class="content">
  147. <div class="table2">
  148. <div class="contentOperation">
  149. <p>计划内容<br>操作详情</p>
  150. </div>
  151. <div class="content-table">
  152. <el-table
  153. :key="table2.tableKey"
  154. v-loading="table2.listLoading"
  155. element-loading-text="给我一点时间"
  156. :data="table2.list"
  157. fit
  158. highlight-current-row
  159. style="width: 100%;"
  160. height="450"
  161. :row-style="rowStyle"
  162. :cell-style="cellStyle"
  163. class="elTable table-fixed"
  164. >
  165. <el-table-column label="操作序号" min-width="130px" align="center">
  166. <template slot-scope="scope">
  167. <span>{{ scope.row.sort }}</span>
  168. </template>
  169. </el-table-column>
  170. <el-table-column label="饲料名称" prop="fname" min-width="130px" align="center">
  171. <template slot-scope="scope">
  172. <span>{{ scope.row.fname }}</span>
  173. </template>
  174. </el-table-column>
  175. <el-table-column label="设计重量(KG)" prop="weight" min-width="130px" align="center">
  176. <template slot-scope="scope">
  177. <span>{{ scope.row.weight }}</span>
  178. </template>
  179. </el-table-column>
  180. </el-table>
  181. </div>
  182. </div>
  183. <div class="table3">
  184. <div class="contentOperation">
  185. <p>计划内容<br>栏舍详情</p>
  186. </div>
  187. <div class="content-table">
  188. <el-table
  189. :key="table3.tableKey"
  190. v-loading="table3.listLoading"
  191. element-loading-text="给我一点时间"
  192. :data="table3.list"
  193. height="450"
  194. fit
  195. highlight-current-row
  196. style="width: 100%;"
  197. :row-style="rowStyle"
  198. :cell-style="cellStyle"
  199. class="elTable table-fixed"
  200. >
  201. <el-table-column label=" 操作序号" min-width="130px" align="center">
  202. <template slot-scope="scope">
  203. <span>{{ scope.row.sort }}</span>
  204. </template>
  205. </el-table-column>
  206. <el-table-column label="栏舍" min-width="130px" align="center">
  207. <template slot-scope="scope">
  208. <span>{{ scope.row.fname }}</span>
  209. </template>
  210. </el-table-column>
  211. <el-table-column label="设计重量(KG)" prop="weight" min-width="130px" align="center">
  212. <template slot-scope="scope">
  213. <span>{{ scope.row.weight }}</span>
  214. </template>
  215. </el-table-column>
  216. </el-table>
  217. </div>
  218. </div>
  219. </div>
  220. <!-- 剩料 -->
  221. <div v-if="table3.getdataListParm.parammaps.lpplantype == 3" class="content">
  222. <div class="table2">
  223. <div class="contentOperation">
  224. <p>计划内容<br>操作详情</p>
  225. </div>
  226. <div class="content-table">
  227. <el-table
  228. :key="table2.tableKey"
  229. v-loading="table2.listLoading"
  230. element-loading-text="给我一点时间"
  231. :data="table2.list"
  232. fit
  233. highlight-current-row
  234. style="width: 100%;"
  235. height="450"
  236. :row-style="rowStyle"
  237. :cell-style="cellStyle"
  238. class="elTable table-fixed"
  239. >
  240. <el-table-column label="操作序号" min-width="130px" align="center">
  241. <template slot-scope="scope">
  242. <span>{{ scope.row.sort }}</span>
  243. </template>
  244. </el-table-column>
  245. <el-table-column label="取料栏舍" prop="fname" min-width="130px" align="center">
  246. <template slot-scope="scope">
  247. <span>{{ scope.row.fname }}</span>
  248. </template>
  249. </el-table-column>
  250. <el-table-column label="处理方式" prop="useinbar" min-width="130px" align="center">
  251. <template slot-scope="scope">
  252. <span>{{ scope.row.useinbar }}</span>
  253. </template>
  254. </el-table-column>
  255. </el-table>
  256. </div>
  257. </div>
  258. <div class="table3">
  259. <div class="contentOperation">
  260. <p>计划内容<br>栏舍详情</p>
  261. </div>
  262. <div class="content-table">
  263. <el-table
  264. :key="table3.tableKey"
  265. v-loading="table3.listLoading"
  266. element-loading-text="给我一点时间"
  267. :data="table3.list"
  268. height="450"
  269. fit
  270. highlight-current-row
  271. style="width: 100%;"
  272. :row-style="rowStyle"
  273. :cell-style="cellStyle"
  274. class="elTable table-fixed"
  275. >
  276. <el-table-column label="操作序号" min-width="130px" align="center">
  277. <template slot-scope="scope">
  278. <span>{{ scope.row.sort }}</span>
  279. </template>
  280. </el-table-column>
  281. <el-table-column label="转投栏舍" min-width="130px" align="center">
  282. <template slot-scope="scope">
  283. <span>{{ scope.row.fname }}</span>
  284. </template>
  285. </el-table-column>
  286. </el-table>
  287. </div>
  288. </div>
  289. </div>
  290. <!-- 撒料计划-混料 -->
  291. <div v-if="table3.getdataListParm.parammaps.lpplantype == 1 || table3.getdataListParm.parammaps.lpplantype == 5" class="content">
  292. <div class="table2">
  293. <div class="contentOperation">
  294. <p>计划内容<br>操作详情</p>
  295. </div>
  296. <div class="content-table">
  297. <el-table
  298. :key="table2.tableKey"
  299. v-loading="table2.listLoading"
  300. element-loading-text="给我一点时间"
  301. :data="table2.list"
  302. fit
  303. highlight-current-row
  304. style="width: 100%;"
  305. height="450"
  306. :row-style="rowStyle"
  307. :cell-style="cellStyle"
  308. class="elTable table-fixed"
  309. >
  310. <el-table-column label="操作序号" min-width="130px" align="center">
  311. <template slot-scope="scope">
  312. <span>{{ scope.row.sort }}</span>
  313. </template>
  314. </el-table-column>
  315. <el-table-column label="饲料名称" prop="fname" min-width="130px" align="center">
  316. <template slot-scope="scope">
  317. <span>{{ scope.row.fname }}</span>
  318. </template>
  319. </el-table-column>
  320. <el-table-column label="设计重量(KG)" prop="weight" min-width="130px" align="center">
  321. <template slot-scope="scope">
  322. <span>{{ scope.row.weight }}</span>
  323. </template>
  324. </el-table-column>
  325. </el-table>
  326. </div>
  327. </div>
  328. <div class="table3">
  329. <div class="contentOperation">
  330. <p>计划内容<br>栏舍详情</p>
  331. </div>
  332. <div class="content-table">
  333. <el-table
  334. :key="table3.tableKey"
  335. v-loading="table3.listLoading"
  336. element-loading-text="给我一点时间"
  337. :data="table3.list"
  338. height="450"
  339. fit
  340. highlight-current-row
  341. style="width: 100%;"
  342. :row-style="rowStyle"
  343. :cell-style="cellStyle"
  344. class="elTable table-fixed"
  345. >
  346. <el-table-column label=" 操作序号" min-width="130px" align="center">
  347. <template slot-scope="scope">
  348. <span>{{ scope.row.sort }}</span>
  349. </template>
  350. </el-table-column>
  351. <el-table-column label="撒料车辆" min-width="130px" align="center">
  352. <template slot-scope="scope">
  353. <span>{{ scope.row.fname }}</span>
  354. </template>
  355. </el-table-column>
  356. <el-table-column label="设计重量(KG)" min-width="130px" align="center">
  357. <template slot-scope="scope">
  358. <span>{{ scope.row.weight }}</span>
  359. </template>
  360. </el-table-column>
  361. </el-table>
  362. </div>
  363. </div>
  364. </div>
  365. <!-- 撒料计划-撒料 -->
  366. <div v-if="table3.getdataListParm.parammaps.lpplantype == 2" class="content">
  367. <div class="table3">
  368. <div class="contentOperation">
  369. <p>计划内容<br>栏舍详情</p>
  370. </div>
  371. <div class="content-table">
  372. <el-table
  373. :key="table3.tableKey"
  374. v-loading="table3.listLoading"
  375. element-loading-text="给我一点时间"
  376. :data="table3.list"
  377. height="450"
  378. fit
  379. highlight-current-row
  380. style="width: 100%;"
  381. :row-style="rowStyle"
  382. :cell-style="cellStyle"
  383. class="elTable table-fixed"
  384. >
  385. <el-table-column label=" 操作序号" min-width="130px" align="center">
  386. <template slot-scope="scope">
  387. <span>{{ scope.row.sort }}</span>
  388. </template>
  389. </el-table-column>
  390. <el-table-column label="撒料车辆" min-width="130px" align="center">
  391. <template slot-scope="scope">
  392. <span>{{ scope.row.fname }}</span>
  393. </template>
  394. </el-table-column>
  395. <el-table-column label="设计重量(KG)" min-width="130px" align="center">
  396. <template slot-scope="scope">
  397. <span>{{ scope.row.weight }}</span>
  398. </template>
  399. </el-table-column>
  400. </el-table>
  401. </div>
  402. </div>
  403. <div class="table2">
  404. <div class="contentOperation">
  405. <p>计划内容<br>操作详情</p>
  406. </div>
  407. <div class="content-table">
  408. <el-table
  409. :key="table2.tableKey"
  410. v-loading="table2.listLoading"
  411. element-loading-text="给我一点时间"
  412. :data="table2.list"
  413. fit
  414. highlight-current-row
  415. style="width: 100%;"
  416. height="450"
  417. :row-style="rowStyle"
  418. :cell-style="cellStyle"
  419. class="elTable table-fixed"
  420. >
  421. <el-table-column label="操作序号" min-width="130px" align="center">
  422. <template slot-scope="scope">
  423. <span>{{ scope.row.sort }}</span>
  424. </template>
  425. </el-table-column>
  426. <el-table-column label="栏舍名称" prop="fname" min-width="130px" align="center">
  427. <template slot-scope="scope">
  428. <span>{{ scope.row.fname }}</span>
  429. </template>
  430. </el-table-column>
  431. <el-table-column label="设计重量(KG)" prop="weight" min-width="130px" align="center">
  432. <template slot-scope="scope">
  433. <span>{{ scope.row.weight }}</span>
  434. </template>
  435. </el-table-column>
  436. </el-table>
  437. </div>
  438. </div>
  439. </div>
  440. <!-- 新生成 -->
  441. <el-dialog :title="textMap[newGeneration.dialogStatus]" :destroy-on-close="true" :visible.sync="newGeneration.dialogFormVisible" :close-on-click-modal="false" width="50%">
  442. <div class="newGeneration">
  443. <el-form ref="temp" :rules="newGeneration.rules" :model="newGeneration.temp" label-position="right" label-width="155px" style="width: 100%;margin:0 auto 50px">
  444. <el-row>
  445. <el-col :span="16">
  446. <el-form-item label="时间范围:" prop="inputDatetime">
  447. <el-date-picker v-model="newGeneration.temp.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 100%;" :clearable="false" />
  448. </el-form-item>
  449. </el-col>
  450. </el-row>
  451. </el-form>
  452. <div slot="footer" class="dialog-footer" style="bottom:10px">
  453. <el-button class="cancelClose" @click="newGeneration.dialogFormVisible = false;getList()">取消</el-button>
  454. <el-button class="success" :disabled="isokDisable" @click="newGenerationData()">确认</el-button>
  455. </div>
  456. </div>
  457. </el-dialog>
  458. <!-- 历史记录 -->
  459. <el-dialog :title="textMap[historyRecord.dialogStatus]" :destroy-on-close="true" :visible.sync="historyRecord.dialogFormVisible" :close-on-click-modal="false" width="90%">
  460. <div class="historyRecord">
  461. <keep-alive>
  462. <component :is="historyRecord.myComponent" ref="historyRecord" />
  463. </keep-alive>
  464. </div>
  465. <div slot="footer" class="dialog-footer" style="bottom: 10px;">
  466. <el-button class="cancelClose" @click="historyRecord.dialogFormVisible = false; ">关闭</el-button>
  467. </div>
  468. </el-dialog>
  469. <!-- 修改计划 -->
  470. <RevisePlan :show.sync="isShowDialog" :parent-active-name="activeName" :parent-date="parentDate" />
  471. </div>
  472. </template>
  473. <script>
  474. import { GetDataByName, GetDataByNames, ExecDataByConfig } from '@/api/common'
  475. import RevisePlan from './revisePlan.vue'
  476. import { parseTime } from '@/utils/index.js'
  477. import Cookies from 'js-cookie'
  478. import Sortable from 'sortablejs'
  479. export default {
  480. name: 'DailyExecutionPlan',
  481. components: {
  482. RevisePlan
  483. },
  484. data() {
  485. return {
  486. requestParams: [
  487. // { name: 'getDictByName', offset: 0, pagecount: 0, params: ['牲畜父类'] }
  488. ],
  489. planTypeList: [{ lable: '预混计划', value: '4' }, { lable: '撒料计划', value: '0' }, { lable: '剩料计划', value: '3' }, { lable: '撒料计划-混料', value: '1' }, { lable: '撒料计划-撒料', value: '2' }], // 计划类型
  490. printingTypeList: [{ lable: '所有', value: '0' }, { lable: '精料', value: '1' }, { lable: '铲车', value: '2' }], // 打印类型
  491. frequencyList: [], // 班次
  492. planningDimensionList: [{ lable: '发料顺序', value: '0' }, { lable: 'TMR', value: '1' }], // 发料顺序
  493. exportTypeList: [{ lable: '投料简打', value: '0' }, { lable: '投料简打', value: '1' }], // 导出类型
  494. // 班次
  495. maxTime: {
  496. getMaxTimesParm: {
  497. name: 'getSysoptEnable',
  498. page: 1,
  499. offset: 1,
  500. pagecount: 1,
  501. returntype: 'Map',
  502. parammaps: {
  503. pastureid: Cookies.get('pastureid'),
  504. inforname: 'times'
  505. }
  506. }
  507. },
  508. isOrder: true,
  509. table: {
  510. getdataListParm: {
  511. name: 'getDownloadedplanList',
  512. page: 1,
  513. offset: 1,
  514. pagecount: '',
  515. returntype: 'Map',
  516. parammaps: {
  517. pastureid: Cookies.get('pastureid'),
  518. barid: '',
  519. mydate: parseTime(new Date(), '{y}-{m}-{d}'),
  520. times: '',
  521. lpplantype: ''
  522. }
  523. },
  524. tableKey: 0,
  525. list: [],
  526. total: 0,
  527. listLoading: false
  528. },
  529. // 计划内容操作详情
  530. table2: {
  531. getdataListParm: {
  532. name: 'getDownloadplandtl1ListV2',
  533. page: 1,
  534. offset: 1,
  535. returntype: 'Map',
  536. parammaps: {
  537. pastureid: Cookies.get('pastureid'),
  538. date: '',
  539. id: ''
  540. }
  541. },
  542. tableKey: 0,
  543. list: [],
  544. total: 0,
  545. listLoading: false
  546. },
  547. // 计划内容 舍栏详情
  548. table3: {
  549. getdataListParm: {
  550. name: 'getDownloadplandt2ListV2',
  551. page: 1,
  552. offset: 1,
  553. returntype: 'Map',
  554. parammaps: {
  555. pastureid: Cookies.get('pastureid'),
  556. date: '',
  557. id: ''
  558. }
  559. },
  560. tableKey: 0,
  561. list: [],
  562. total: 0,
  563. listLoading: false
  564. },
  565. // 新生成
  566. newGeneration: {
  567. dialogFormVisible: false,
  568. dialogStatus: '',
  569. getdataListParm: {
  570. name: 'checkLLPIsDistribution',
  571. page: 1,
  572. offset: 1,
  573. pagecount: 1,
  574. returntype: 'Map',
  575. parammaps: {
  576. pastureid: Cookies.get('pastureid')
  577. }
  578. },
  579. temp: {},
  580. rules: {
  581. inputDatetime: [{ type: 'array', required: true, message: '必填', trigger: 'blur' }]
  582. }
  583. },
  584. historyRecord: {
  585. dialogFormVisible: false,
  586. dialogStatus: '',
  587. myComponent: null
  588. },
  589. textMap: {
  590. newGeneration: '新生成',
  591. historyRecord: '历史记录',
  592. revisePlan: '修改计划'
  593. },
  594. isokDisable: false,
  595. requestParam: {},
  596. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  597. cellStyle: { padding: 0 + 'px' },
  598. isShowDialog: false,
  599. activeName: '栏舍配方',
  600. parentDate: ''
  601. }
  602. },
  603. created() {
  604. this.parentDate = this.table.getdataListParm.parammaps.mydate
  605. console.log(this.parentDate, 'this.parentDate')
  606. this.getList()
  607. this.getDownList()
  608. this.getIsDisplay()
  609. },
  610. mounted() {
  611. this.table.getdataListParm.parammaps.mydate = parseTime(new Date(), '{y}-{m}-{d}')
  612. },
  613. methods: {
  614. getIsDisplay() {
  615. GetDataByName(this.maxTime.getMaxTimesParm).then(response => {
  616. console.log(response.data.list[0].inforvalue)
  617. if (response.data.list[0].inforvalue == 1) {
  618. this.frequencyList = [{ id: '1', name: '第一班' }]
  619. } else if (response.data.list[0].inforvalue == 2) {
  620. this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }]
  621. } else if (response.data.list[0].inforvalue == 3) {
  622. this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }]
  623. } else if (response.data.list[0].inforvalue == 4) {
  624. this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }, { id: '4', name: '第四班' }]
  625. }
  626. })
  627. },
  628. getDownList() {
  629. GetDataByNames(this.requestParams).then(response => {
  630. // this.livestockTypeList = response.data.getDictByName.list
  631. })
  632. },
  633. // -------------------日执行计划-----------------------------
  634. handleBefore() {
  635. if (this.table.getdataListParm.parammaps.mydate !== '' && this.table.getdataListParm.parammaps.mydate !== null) {
  636. this.table.getdataListParm.parammaps.mydate = new Date(this.table.getdataListParm.parammaps.mydate)
  637. var start = new Date(this.table.getdataListParm.parammaps.mydate.setDate(this.table.getdataListParm.parammaps.mydate.getDate() - 1))
  638. // var start = this.table.getdataListParm.parammaps.mydate - 1
  639. this.table.getdataListParm.parammaps.mydate = parseTime(start, '{y}-{m}-{d}')
  640. // this.$forceUpdate()
  641. this.getList()
  642. }
  643. },
  644. handleNext() {
  645. if (this.table.getdataListParm.parammaps.mydate !== '' && this.table.getdataListParm.parammaps.mydate !== null) {
  646. this.table.getdataListParm.parammaps.mydate = new Date(this.table.getdataListParm.parammaps.mydate)
  647. var stop = new Date(this.table.getdataListParm.parammaps.mydate.setDate(this.table.getdataListParm.parammaps.mydate.getDate() + 1))
  648. this.table.getdataListParm.parammaps.mydate = parseTime(stop, '{y}-{m}-{d}')
  649. this.getList()
  650. }
  651. },
  652. getList() {
  653. this.table.listLoading = true
  654. GetDataByName(this.table.getdataListParm).then(response => {
  655. console.log('table数据', response.data.list)
  656. if (response.data.list !== null) {
  657. this.table.list = response.data.list
  658. this.table.pageNum = response.data.pageNum
  659. this.table.pageSize = response.data.pageSize
  660. this.table.total = response.data.total
  661. console.log('计划类型', response.data.list[0].lpplantype)
  662. if (response.data.list[0].lpplantype == 0) {
  663. // 撒料
  664. this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
  665. this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
  666. this.table2.getdataListParm.parammaps.useinbartype = ''
  667. this.table3.getdataListParm.parammaps.useinbartype = ''
  668. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  669. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  670. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  671. this.table3.getdataListParm.parammaps.id = response.data.list[0].id
  672. this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
  673. this.getList2()
  674. this.getList3()
  675. } else if (response.data.list[0].lpplantype == 1) {
  676. // 撒料计划-混料
  677. this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
  678. this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
  679. this.table2.getdataListParm.parammaps.useinbartype = ''
  680. this.table3.getdataListParm.parammaps.useinbartype = ''
  681. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  682. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  683. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  684. this.table3.getdataListParm.parammaps.id = response.data.list[0].id
  685. this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
  686. this.getList2()
  687. this.getList3()
  688. } else if (response.data.list[0].lpplantype == 2) {
  689. // 撒料计划-撒料
  690. this.table2.getdataListParm.name = 'getDownloadplandt2ListV2'
  691. this.table3.getdataListParm.name = 'getDownloadplandtl1ListV2'
  692. this.table2.getdataListParm.parammaps.useinbartype = ''
  693. this.table3.getdataListParm.parammaps.useinbartype = ''
  694. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  695. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  696. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  697. this.table3.getdataListParm.parammaps.id = response.data.list[0].id
  698. this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
  699. this.getList2()
  700. this.getList3()
  701. } else if (response.data.list[0].lpplantype == 3) {
  702. // 剩料
  703. this.table2.getdataListParm.name = 'getDownloadplandt2ListV2'
  704. this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
  705. this.table2.getdataListParm.parammaps.useinbartype = 0
  706. this.table3.getdataListParm.parammaps.useinbartype = 1
  707. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  708. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  709. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  710. this.table3.getdataListParm.parammaps.id = response.data.list[0].id
  711. this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
  712. this.getList2()
  713. this.getList3()
  714. } else if (response.data.list[0].lpplantype == 4) {
  715. // 预混
  716. this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
  717. this.table2.getdataListParm.parammaps.useinbartype = ''
  718. this.table3.getdataListParm.parammaps.useinbartype = ''
  719. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  720. this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
  721. this.getList2()
  722. } else if (response.data.list[0].lpplantype == 5) {
  723. // 预称重计划
  724. this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
  725. this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
  726. this.table2.getdataListParm.parammaps.useinbartype = ''
  727. this.table3.getdataListParm.parammaps.useinbartype = ''
  728. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  729. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  730. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  731. this.table3.getdataListParm.parammaps.id = response.data.list[0].id
  732. this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
  733. this.getList2()
  734. this.getList3()
  735. }
  736. } else {
  737. this.table.list = []
  738. this.table3.getdataListParm.parammaps.lpplantype = ''
  739. this.table2.getdataListParm.parammaps.id = ''
  740. this.table3.getdataListParm.parammaps.id = ''
  741. // this.getList2()
  742. // this.getList3()
  743. this.table2.list = []
  744. this.table3.list = []
  745. }
  746. setTimeout(() => {
  747. this.table.listLoading = false
  748. }, 100)
  749. })
  750. },
  751. lpplantype: function(cellValue) {
  752. if (cellValue.lpplantype == 0) {
  753. return '撒料计划'
  754. } else if (cellValue.lpplantype == 1) {
  755. return '撒料计划-混料'
  756. } else if (cellValue.lpplantype == 2) {
  757. return '撒料计划-撒料'
  758. } else if (cellValue.lpplantype == 3) {
  759. return '剩料计划'
  760. } else if (cellValue.lpplantype == 4) {
  761. return '预混计划'
  762. } else if (cellValue.lpplantype == 5) {
  763. return '预称重计划'
  764. }
  765. },
  766. changeDate(val) {
  767. console.log('选择了日期', val)
  768. this.getList()
  769. this.getList2()
  770. this.getList3()
  771. this.parentDate = this.table.getdataListParm.parammaps.mydate
  772. console.log(this.parentDate, 'this.parentDate')
  773. },
  774. changePlanType(val) {
  775. console.log('选择了计划类型', val)
  776. this.getList()
  777. this.getList2()
  778. this.getList3()
  779. },
  780. changeFrequency(val) {
  781. console.log('选择了班次', val)
  782. this.getList()
  783. this.getList2()
  784. this.getList3()
  785. },
  786. // 日执行计划行点击
  787. tableRowClick(row, column, event) {
  788. console.log(row, column, event)
  789. console.log('点击计划类型', row.lpplantype)
  790. // 撒料计划0/撒料计划-混料1/撒料计划-撒料2/剩料计划3/预混计划4/预称重计划5
  791. if (row.lpplantype == 0) {
  792. // 撒料
  793. this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
  794. this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
  795. this.table2.getdataListParm.parammaps.useinbartype = ''
  796. this.table3.getdataListParm.parammaps.useinbartype = ''
  797. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  798. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  799. this.table2.getdataListParm.parammaps.id = row.id
  800. this.table3.getdataListParm.parammaps.id = row.id
  801. this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
  802. this.getList2()
  803. this.getList3()
  804. } else if (row.lpplantype == 1) {
  805. // 撒料计划-混料
  806. this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
  807. this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
  808. this.table2.getdataListParm.parammaps.useinbartype = ''
  809. this.table3.getdataListParm.parammaps.useinbartype = ''
  810. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  811. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  812. this.table2.getdataListParm.parammaps.id = row.id
  813. this.table3.getdataListParm.parammaps.id = row.id
  814. this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
  815. this.getList2()
  816. this.getList3()
  817. } else if (row.lpplantype == 2) {
  818. // 撒料计划-撒料
  819. this.table2.getdataListParm.name = 'getDownloadplandt2ListV2'
  820. this.table3.getdataListParm.name = 'getDownloadplandtl1ListV2'
  821. this.table2.getdataListParm.parammaps.useinbartype = ''
  822. this.table3.getdataListParm.parammaps.useinbartype = ''
  823. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  824. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  825. this.table2.getdataListParm.parammaps.id = row.id
  826. this.table3.getdataListParm.parammaps.id = row.id
  827. this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
  828. this.getList2()
  829. this.getList3()
  830. console.log(this.table3.getdataListParm.parammaps.lpplantype)
  831. } else if (row.lpplantype == 3) {
  832. // 剩料
  833. this.table2.getdataListParm.name = 'getDownloadplandt2ListV2'
  834. this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
  835. this.table2.getdataListParm.parammaps.useinbartype = 0
  836. this.table3.getdataListParm.parammaps.useinbartype = 1
  837. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  838. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  839. this.table2.getdataListParm.parammaps.id = row.id
  840. this.table3.getdataListParm.parammaps.id = row.id
  841. this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
  842. this.getList2()
  843. this.getList3()
  844. } else if (row.lpplantype == 4) {
  845. // 预混
  846. this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
  847. this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
  848. this.table2.getdataListParm.parammaps.useinbartype = ''
  849. this.table3.getdataListParm.parammaps.useinbartype = ''
  850. this.table2.getdataListParm.parammaps.id = row.id
  851. this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
  852. this.getList2()
  853. } else if (row.lpplantype == 5) {
  854. // 预称重计划
  855. this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
  856. this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
  857. this.table2.getdataListParm.parammaps.useinbartype = ''
  858. this.table3.getdataListParm.parammaps.useinbartype = ''
  859. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  860. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  861. this.table2.getdataListParm.parammaps.id = row.id
  862. this.table3.getdataListParm.parammaps.id = row.id
  863. this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
  864. this.getList2()
  865. this.getList3()
  866. }
  867. this.$forceUpdate()
  868. },
  869. // 计划内容操作详情
  870. getList2() {
  871. this.table2.listLoading = true
  872. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  873. GetDataByName(this.table2.getdataListParm).then(response => {
  874. console.log('table数据', response.data.list)
  875. if (response.data.list !== null) {
  876. this.table2.list = response.data.list
  877. // 撒料计划0/撒料计划-混料1/撒料计划-撒料2/剩料计划3/预混计划4
  878. if (this.table3.getdataListParm.parammaps.lpplantype == 0 || this.table3.getdataListParm.parammaps.lpplantype == 1 || this.table3.getdataListParm.parammaps.lpplantype == 4) {
  879. const arr = []
  880. var a = 0
  881. let b = this.table2.list[0].sort
  882. let c = 0
  883. for (let i = 0; i < this.table2.list.length; i++) {
  884. if (b !== parseInt(this.table2.list[i].sort)) {
  885. b = this.table2.list[i].sort
  886. arr.push({ 'sort': '小计', 'weight': a.toFixed(2) })
  887. a = 0
  888. }
  889. a = a + parseFloat(this.table2.list[i].weight)
  890. c = c + parseFloat(this.table2.list[i].weight)
  891. arr.push(this.table2.list[i])
  892. }
  893. arr.push({ 'sort': '小计', 'weight': a })
  894. arr.push({ 'sort': '总计', 'weight': c.toFixed(2) })
  895. this.table2.list = arr
  896. }
  897. if (this.table3.getdataListParm.parammaps.lpplantype == 2) {
  898. const arr = []
  899. var aa = 0
  900. let bb = this.table2.list[0].sort
  901. let cc = 0
  902. for (let i = 0; i < this.table2.list.length; i++) {
  903. if (bb !== parseInt(this.table2.list[i].sort)) {
  904. bb = this.table2.list[i].sort
  905. aa = 0
  906. }
  907. aa = aa + parseFloat(this.table2.list[i].weight)
  908. cc = cc + parseFloat(this.table2.list[i].weight)
  909. arr.push(this.table2.list[i])
  910. }
  911. arr.push({ 'sort': '总计', 'weight': cc.toFixed(2) })
  912. this.table2.list = arr
  913. console.log('this.table2.list', this.table2.list)
  914. console.log(this.table3.getdataListParm.parammaps.lpplantype)
  915. }
  916. console.log(this.table2.list)
  917. this.table2.pageNum = response.data.pageNum
  918. this.table2.pageSize = response.data.pageSize
  919. this.table2.total = response.data.total
  920. } else {
  921. this.table2.list = []
  922. }
  923. setTimeout(() => {
  924. this.table2.listLoading = false
  925. }, 100)
  926. })
  927. },
  928. // 计划内容栏舍详情
  929. getList3() {
  930. this.table3.listLoading = true
  931. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  932. GetDataByName(this.table3.getdataListParm).then(response => {
  933. console.log('table数据', response.data.list)
  934. if (response.data.list !== null) {
  935. this.table3.list = response.data.list
  936. if (this.table3.getdataListParm.parammaps.lpplantype == 0) {
  937. const arr = []
  938. var a = 0
  939. let b = this.table3.list[0].sort
  940. let c = 0
  941. for (let i = 0; i < this.table3.list.length; i++) {
  942. if (b !== parseInt(this.table3.list[i].sort)) {
  943. b = this.table3.list[i].sort
  944. a = 0
  945. }
  946. a = a + parseFloat(this.table3.list[i].weight)
  947. c = c + parseFloat(this.table3.list[i].weight)
  948. arr.push(this.table3.list[i])
  949. }
  950. arr.push({ 'sort': '总计', 'weight': c.toFixed(2) })
  951. this.table3.list = arr
  952. }
  953. this.table3.pageNum = response.data.pageNum
  954. this.table3.pageSize = response.data.pageSize
  955. this.table3.total = response.data.total
  956. } else {
  957. this.table3.list = []
  958. }
  959. setTimeout(() => {
  960. this.table3.listLoading = false
  961. }, 100)
  962. })
  963. },
  964. // 新生成
  965. handleCreate() {
  966. console.log('点击了新生成')
  967. this.newGeneration.temp = {}
  968. this.newGeneration.dialogStatus = 'newGeneration'
  969. this.newGeneration.dialogFormVisible = true
  970. GetDataByName(this.newGeneration.getdataListParm).then(response => {
  971. console.log('table数据', response.data.list)
  972. if (response.data.list !== null) {
  973. if (response.data.list[0].vmsg == '存在未分配') {
  974. this.$message({ type: 'warning', message: '撒料计划中存在未分配完栏舍,建议及时进行分配', duration: 2000 })
  975. }
  976. }
  977. })
  978. },
  979. DateDiff(sDate1, sDate2) {
  980. console.log(sDate1, sDate2)
  981. var aDate, oDate1, oDate2, iDays
  982. aDate = sDate1.split('-')
  983. oDate1 = new Date(aDate[0], aDate[1], aDate[2]) // 转换为12-18-2006格式
  984. aDate = sDate2.split('-')
  985. oDate2 = new Date(aDate[0], aDate[1], aDate[2])
  986. iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 / 24) // 把相差的毫秒数转换为天数
  987. this.newGeneration.temp.days = parseInt(iDays) + 1
  988. return iDays
  989. },
  990. newGenerationData() {
  991. console.log('点击了新生成保存', this.newGeneration.temp)
  992. this.isokDisable = true
  993. setTimeout(() => {
  994. this.isokDisable = false
  995. }, 5000)
  996. this.$refs['temp'].validate(valid => {
  997. if (valid) {
  998. this.newGeneration.temp.startTime = parseTime(this.newGeneration.temp.inputDatetime[0], '{y}-{m}-{d}')
  999. this.newGeneration.temp.stopTime = parseTime(this.newGeneration.temp.inputDatetime[1], '{y}-{m}-{d}')
  1000. this.DateDiff(this.newGeneration.temp.stopTime, this.newGeneration.temp.startTime)
  1001. this.requestParam = {}
  1002. this.requestParam.common = { 'returnmap': '0' }
  1003. this.requestParam.data = []
  1004. this.requestParam.data[0] = { 'name': 'checkDLPIsStart', 'type': 'v', 'parammaps': {
  1005. pastureid: Cookies.get('pastureid'),
  1006. startTime: this.newGeneration.temp.startTime
  1007. }}
  1008. this.requestParam.data[1] = { 'name': 'checkPreMixStorage', 'type': 'e', 'parammaps': {
  1009. pastureid: Cookies.get('pastureid'),
  1010. days: this.newGeneration.temp.days
  1011. }}
  1012. this.requestParam.data[2] = { 'name': 'createdownloadedplan', 'type': 'e', 'parammaps': {
  1013. pastureid: Cookies.get('pastureid'),
  1014. startTime: this.newGeneration.temp.startTime,
  1015. stopTime: this.newGeneration.temp.stopTime
  1016. }}
  1017. ExecDataByConfig(this.requestParam).then(response => {
  1018. console.log('新生成保存发送参数', this.requestParam)
  1019. if (response.msg === 'fail') {
  1020. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1021. } else {
  1022. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  1023. this.newGeneration.dialogFormVisible = false
  1024. this.getList()
  1025. }
  1026. })
  1027. }
  1028. })
  1029. },
  1030. // 配方模板
  1031. handleRecipeemplate() {
  1032. console.log('点击了配方模板,页面待画')
  1033. },
  1034. handleShedFormula() {
  1035. console.log('点击了栏舍配方,页面待画')
  1036. },
  1037. handlePremixedPlan() {
  1038. console.log('点击了预混计划,页面待画')
  1039. },
  1040. handleMaterialPlan() {
  1041. console.log('点击了撒料计划,页面待画')
  1042. },
  1043. handleRevisePlan(data) {
  1044. console.log('点击了修改计划1', this.activeName)
  1045. this.isShowDialog = true
  1046. this.activeName = '栏舍配方'
  1047. console.log('点击了修改计划2', this.activeName)
  1048. },
  1049. // handleHistoryRecord() {
  1050. // console.log('点击了历史记录,页面待画')
  1051. // this.historyRecord.dialogStatus = 'historyRecord'
  1052. // this.historyRecord.dialogFormVisible = true
  1053. // const vue = this
  1054. // var myComponent = () => import('./historyRecord.vue')
  1055. // return vue.historyRecord.myComponent = myComponent
  1056. // },
  1057. handleExport() {
  1058. console.log('点击了导出')
  1059. },
  1060. rowDrop() {
  1061. console.log(document.querySelector('#table1 .el-table__body-wrapper tbody'))
  1062. const tbody = document.querySelector('#table1 .el-table__body-wrapper tbody')
  1063. // this.sorTable()
  1064. const that = this
  1065. // Sortable.create(tbody, {
  1066. var sortable = Sortable.create(tbody, {
  1067. disabled: that.dropState,
  1068. onChoose({ newIndex, oldIndex }) {
  1069. if (that.dropState == true || that.isOrder == true) {
  1070. sortable.destroy()
  1071. }
  1072. },
  1073. onEnd({ newIndex, oldIndex }) {
  1074. // const currRow = that.table.list.splice(oldIndex, 1)[0]
  1075. // // that.table2.list.splice(newIndex, 0, currRow)
  1076. // console.log(that.table.list.splice(oldIndex, 1)[0])
  1077. console.log('索引newIndex', newIndex)
  1078. console.log('索引oldIndex', oldIndex)
  1079. console.log('拖动数据', that.table.list[oldIndex])
  1080. console.log('拖动上', that.table.list[newIndex])
  1081. if (that.table.list[newIndex].times !== that.table.list[oldIndex].times) {
  1082. sortable.destroy()
  1083. }
  1084. // console.log('拖动数据', currRow)
  1085. // console.log('上', that.table.list[newIndex - 1])
  1086. // console.log('下', that.table.list[newIndex + 1])
  1087. }
  1088. })
  1089. console.log(sortable.option('disabled'))
  1090. },
  1091. handleChangeOrder() {
  1092. // 拖动顺序
  1093. this.isOrder = false
  1094. this.rowDrop()
  1095. },
  1096. saveChangeOrder() {
  1097. // 保存顺序
  1098. },
  1099. cancelChangeOrder() {
  1100. // 取消顺序
  1101. this.getList()
  1102. this.isOrder = true
  1103. }
  1104. }
  1105. }
  1106. </script>
  1107. <style lang="scss" scoped>
  1108. .operation{margin-bottom:10px;}
  1109. .search{margin-top:10px;}
  1110. .table{margin-top:10px;}
  1111. .template{
  1112. background: #fff;
  1113. position: relative;
  1114. }
  1115. .table2{
  1116. float: left;width: 49%;margin-right: 1%;background: red;
  1117. background: #fff;
  1118. position: relative;
  1119. .content-table{margin-top: 70px;}
  1120. }
  1121. .table3{
  1122. float: left;
  1123. width: 49%;
  1124. background: #fff;
  1125. position: relative;
  1126. .content-table{margin-top: 70px;}
  1127. }
  1128. </style>