index.vue 113 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527
  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="search">
  9. <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" />
  10. <el-button class="el-icon-arrow-left elIconArrowLeft" @click="handleBefore" />
  11. <el-button class="el-icon-arrow-right elIconArrowRight" @click="handleNext" />
  12. <el-select v-model="table.getdataListParm.parammaps.lpplantype" filterable placeholder="计划类型" class="filter-item" clearable style="width: 120px;" @change="changePlanType">
  13. <el-option v-for="item in planTypeList" :key="item.value" :label="item.lable" :value="item.value" />
  14. </el-select>
  15. <el-select v-model="table.getdataListParm.parammaps.times" filterable placeholder="班次" class="filter-item" style="width: 120px;" clearable @change="changeFrequency">
  16. <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
  17. </el-select>
  18. <el-select v-model="table.getdataListParm.parammaps.printType" filterable placeholder="打印类型" class="filter-item" :clearable="false" style="width: 120px;">
  19. <el-option v-for="item in printingTypeList" :key="item.value" :label="item.lable" :value="item.value" />
  20. </el-select>
  21. <el-select v-model="table.getdataListParm.parammaps.plandimen" filterable placeholder="计划维度" class="filter-item" style="width: 120px;" :clearable="false">
  22. <el-option v-for="item in planningDimensionList" :key="item.value" :label="item.lable" :value="item.value" />
  23. </el-select>
  24. <el-select v-model="table.getdataListParm.parammaps.enable3" filterable placeholder="导出类型" class="filter-item" style="width: 120px;" :clearable="false">
  25. <el-option v-for="item in exportTypeList" :key="item.value" :label="item.lable" :value="item.value" />
  26. </el-select>
  27. <el-select v-model="table.getdataListParm.parammaps.tmrname" filterable placeholder="TMR名称" class="filter-item" style="width: 120px;" :clearable="false">
  28. <el-option v-for="item in tmrDownList" :key="item.tmrname" :label="item.tmrname" :value="item.tmrtname" />
  29. </el-select>
  30. <el-select v-model="table.getdataListParm.parammaps.iscompleted" filterable placeholder="执行状态" class="filter-item" style="width: 120px;" :clearable="false">
  31. <el-option v-for="item in iscompletedList" :key="item.value" :label="item.lable" :value="item.value" />
  32. </el-select>
  33. <el-button class="export" icon="el-icon-upload2" @click="handleExport">导出</el-button>
  34. <el-button class="export" icon="el-icon-upload2" @click="handlePrint">打印</el-button>
  35. <el-button class="export" style="margin-left: -5px;" @click="handleDeleteRecord">删除记录</el-button>
  36. </div>
  37. <div class="operation" style="margin-bottom: 10px;">
  38. <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" @click="handleCreate">新生成</el-button>
  39. <el-button v-if="isRoleEdit" class="success" icon="el-icon-edit-outline" @click="handleRevisePlan">修改计划</el-button>
  40. <el-button v-if="isRoleEdit" class="copy" icon="el-icon-copy-document" @click="handleCopy">复制计划</el-button>
  41. <el-button v-if="isOrder && isRoleEdit" icon="el-icon-sort" class="success" @click="handleChangeOrder">更改顺序</el-button>
  42. <div v-else style="margin-left: 10px;display: inline-block;">
  43. <el-button v-if="isRoleEdit" icon="el-icon-folder-checked" class="success" @click="saveChangeOrder">保存</el-button>
  44. <el-button v-if="isRoleEdit" icon="el-icon-close" class="sortCancel" @click="cancelChangeOrder">取消</el-button>
  45. </div>
  46. <el-button v-if="isRoleEdit" class="success" icon="el-icon-open" @click="handleTakeEffect">生效</el-button>
  47. <el-button v-if="isRoleEdit" class="danger" icon="el-icon-turn-off" @click="handleDisable">禁用</el-button>
  48. <el-button v-if="dataSynchronization.isDataSynchronization && isRoleEdit" class="success" @click="handleDataSynchronization">数据同步</el-button>
  49. </div>
  50. <!-- 日执行计划 -->
  51. <div class="table">
  52. <el-table
  53. id="table1"
  54. ref="parent"
  55. :key="table.tableKey"
  56. v-loading="table.listLoading"
  57. element-loading-text="给我一点时间"
  58. :data="table.list"
  59. border
  60. fit
  61. highlight-current-row
  62. style="width: 98%;"
  63. row-key="sort"
  64. :row-style="rowStyle"
  65. :cell-style="cellStyle"
  66. class="elTable table-fixed"
  67. :row-class-name="tableRowClassName"
  68. :height="370"
  69. @row-click="tableRowClick"
  70. @selection-change="handleSelect"
  71. >
  72. <el-table-column type="selection" min-width="50" />
  73. <el-table-column label="序号" align="center" prop="sort" width="50px" />
  74. <el-table-column label="计划名称" min-width="90px" align="center">
  75. <template slot-scope="scope">
  76. <span>{{ scope.row.projname }}</span>
  77. </template>
  78. </el-table-column>
  79. <el-table-column label="计划类型" prop="weight" min-width="90px" align="center" :formatter="lpplantype" />
  80. <el-table-column label="TMR编号" min-width="90px" align="center">
  81. <template slot-scope="scope">
  82. <span>{{ scope.row.tmrtname }}</span>
  83. </template>
  84. </el-table-column>
  85. <el-table-column label="驾驶员" min-width="80px" align="center">
  86. <template slot-scope="scope">
  87. <span>{{ scope.row.driver }}</span>
  88. </template>
  89. </el-table-column>
  90. <el-table-column label="已执行" min-width="70px" align="center">
  91. <template slot-scope="scope">
  92. <span v-if="scope.row.havebutton == 0">否</span>
  93. <span v-else>是</span>
  94. </template>
  95. </el-table-column>
  96. <el-table-column label="班次" min-width="80px" align="center">
  97. <template slot-scope="scope">
  98. <span>{{ scope.row.times }}</span>
  99. </template>
  100. </el-table-column>
  101. <el-table-column label="理论量" min-width="80px" align="center">
  102. <template slot-scope="scope">
  103. <span>{{ scope.row.lweight }}</span>
  104. </template>
  105. </el-table-column>
  106. <el-table-column label="启用" min-width="70px" align="center">
  107. <template slot-scope="scope">
  108. <el-switch v-if="dataDisabled == false" v-model="scope.row.enable" :disabled="scope.row.havebutton == 1" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleEnableChange(scope.row)" />
  109. <el-switch v-else v-model="scope.row.enable" disabled active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleEnableChange(scope.row)" />
  110. </template>
  111. </el-table-column>
  112. <el-table-column label="时间" min-width="80px" align="center">
  113. <template slot-scope="scope">
  114. <span>{{ scope.row.plantime }}</span>
  115. </template>
  116. </el-table-column>
  117. <el-table-column label="配方名称" min-width="100px" align="center">
  118. <template slot-scope="scope">
  119. <span>{{ scope.row.ftname }}</span>
  120. </template>
  121. </el-table-column>
  122. <el-table-column label="牛头数" min-width="80px" align="center">
  123. <template slot-scope="scope">
  124. <span>{{ scope.row.cowcount }}</span>
  125. </template>
  126. </el-table-column>
  127. <el-table-column label="描述" min-width="80px" align="center">
  128. <template slot-scope="scope">
  129. <span>{{ scope.row.display }}</span>
  130. </template>
  131. </el-table-column>
  132. <el-table-column label="发料位" min-width="80px" align="left">
  133. <template slot-scope="scope">
  134. <span>{{ scope.row.barnames }}</span>
  135. </template>
  136. </el-table-column>
  137. <el-table-column align="center" width="100" label="操作" class-name="small-padding fixed-width" fixed="right">
  138. <template slot-scope="{row}">
  139. <el-button class="miniDanger" icon="el-icon-delete" @click="handleRowDelete(row)" />
  140. </template>
  141. </el-table-column>
  142. </el-table>
  143. <span v-if="table.listLoading == false" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ table.total }}条</span>
  144. </div>
  145. </div>
  146. <!-- 预混料 -->
  147. <div v-if="table3.getdataListParm.parammaps.lpplantype == 4" class="content">
  148. <el-row :gutter="20">
  149. <el-col :span="12">
  150. <div class="table2">
  151. <div class="contentOperation">
  152. <p>计划详情</p>
  153. </div>
  154. <div class="content-table">
  155. <el-table
  156. :key="table2.tableKey"
  157. v-loading="table2.listLoading"
  158. element-loading-text="给我一点时间"
  159. :data="table2.list"
  160. fit
  161. border
  162. highlight-current-row
  163. style="width: 100%;"
  164. height="450"
  165. :row-style="rowStyle"
  166. :cell-style="cellStyle"
  167. class="elTable table-fixed"
  168. :span-method="objectSpanMethod"
  169. >
  170. <el-table-column label="操作序号" min-width="130px" align="center">
  171. <template slot-scope="scope">
  172. <span>{{ scope.row.sort }}</span>
  173. </template>
  174. </el-table-column>
  175. <el-table-column label="饲料名称" prop="fname" min-width="130px" align="center">
  176. <template slot-scope="scope">
  177. <span>{{ scope.row.fname }}</span>
  178. </template>
  179. </el-table-column>
  180. <el-table-column label="设计重量(KG)" prop="weight" min-width="130px" align="center">
  181. <template slot-scope="scope">
  182. <span>{{ scope.row.weight }}</span>
  183. </template>
  184. </el-table-column>
  185. <el-table-column label="小计" prop="description" min-width="130px" align="center">
  186. <template slot-scope="scope">
  187. <span>{{ scope.row.subtotal }}</span>
  188. </template>
  189. </el-table-column>
  190. </el-table>
  191. </div>
  192. </div>
  193. </el-col>
  194. </el-row>
  195. </div>
  196. <!-- 撒料 -->
  197. <div v-if="table3.getdataListParm.parammaps.lpplantype == 0" class="content">
  198. <el-row :gutter="20">
  199. <el-col :span="12">
  200. <div class="table2">
  201. <div class="contentOperation">
  202. <p>计划详情</p>
  203. </div>
  204. <div class="content-table">
  205. <el-table
  206. :key="table2.tableKey"
  207. v-loading="table2.listLoading"
  208. element-loading-text="给我一点时间"
  209. :data="table2.list"
  210. fit
  211. border
  212. highlight-current-row
  213. style="width: 100%;"
  214. height="450"
  215. :row-style="rowStyle"
  216. :cell-style="cellStyle"
  217. class="elTable table-fixed"
  218. :span-method="objectSpanMethod"
  219. >
  220. <el-table-column label="操作序号" min-width="130px" align="center">
  221. <template slot-scope="scope">
  222. <span>{{ scope.row.sort }}</span>
  223. </template>
  224. </el-table-column>
  225. <el-table-column label="饲料名称" prop="fname" min-width="130px" align="center">
  226. <template slot-scope="scope">
  227. <span>{{ scope.row.fname }}</span>
  228. </template>
  229. </el-table-column>
  230. <el-table-column label="设计重量(KG)" prop="weight" min-width="130px" align="center">
  231. <template slot-scope="scope">
  232. <span>{{ scope.row.weight }}</span>
  233. </template>
  234. </el-table-column>
  235. <el-table-column label="小计" prop="description" min-width="130px" align="center">
  236. <template slot-scope="scope">
  237. <span>{{ scope.row.subtotal }}</span>
  238. </template>
  239. </el-table-column>
  240. </el-table>
  241. </div>
  242. </div>
  243. </el-col>
  244. <el-col :span="12">
  245. <div class="table3">
  246. <div class="contentOperation">
  247. <p>栏舍详情</p>
  248. </div>
  249. <div class="content-table">
  250. <el-table
  251. :key="table3.tableKey"
  252. v-loading="table3.listLoading"
  253. element-loading-text="给我一点时间"
  254. :data="table3.list"
  255. height="450"
  256. fit
  257. border
  258. highlight-current-row
  259. style="width: 100%;"
  260. :row-style="rowStyle"
  261. :cell-style="cellStyle"
  262. class="elTable table-fixed"
  263. >
  264. <el-table-column label=" 操作序号" min-width="130px" align="center">
  265. <template slot-scope="scope">
  266. <span>{{ scope.row.sort }}</span>
  267. </template>
  268. </el-table-column>
  269. <el-table-column label="栏舍" min-width="130px" align="center">
  270. <template slot-scope="scope">
  271. <span>{{ scope.row.fname }}</span>
  272. </template>
  273. </el-table-column>
  274. <el-table-column label="设计重量(KG)" prop="weight" min-width="130px" align="center">
  275. <template slot-scope="scope">
  276. <span>{{ scope.row.weight }}</span>
  277. </template>
  278. </el-table-column>
  279. </el-table>
  280. </div>
  281. </div>
  282. </el-col>
  283. </el-row>
  284. </div>
  285. <!-- 剩料 -->
  286. <div v-if="table3.getdataListParm.parammaps.lpplantype == 3" class="content">
  287. <el-row :gutter="20">
  288. <el-col :span="12"><div class="table2">
  289. <div class="contentOperation">
  290. <p>计划详情</p>
  291. </div>
  292. <div class="content-table">
  293. <el-table
  294. :key="table2.tableKey"
  295. v-loading="table2.listLoading"
  296. element-loading-text="给我一点时间"
  297. :data="table2.list"
  298. fit
  299. border
  300. highlight-current-row
  301. style="width: 100%;"
  302. height="450"
  303. :row-style="rowStyle"
  304. :cell-style="cellStyle"
  305. class="elTable table-fixed"
  306. :span-method="objectSpanMethod"
  307. >
  308. <el-table-column label="操作序号" min-width="130px" align="center">
  309. <template slot-scope="scope">
  310. <span>{{ scope.row.sort }}</span>
  311. </template>
  312. </el-table-column>
  313. <el-table-column label="取料栏舍" prop="fname" min-width="130px" align="center">
  314. <template slot-scope="scope">
  315. <span>{{ scope.row.fname }}</span>
  316. </template>
  317. </el-table-column>
  318. <el-table-column label="处理方式" prop="useinbar" min-width="130px" align="center">
  319. <template slot-scope="scope">
  320. <span>{{ scope.row.useinbar }}</span>
  321. </template>
  322. </el-table-column>
  323. <el-table-column label="小计" prop="description" min-width="130px" align="center">
  324. <template slot-scope="scope">
  325. <span>{{ scope.row.subtotal }}</span>
  326. </template>
  327. </el-table-column>
  328. </el-table>
  329. </div>
  330. </div>
  331. </el-col>
  332. <el-col :span="12">
  333. <div class="table3">
  334. <div class="contentOperation">
  335. <p>栏舍详情</p>
  336. </div>
  337. <div class="content-table">
  338. <el-table
  339. :key="table3.tableKey"
  340. v-loading="table3.listLoading"
  341. element-loading-text="给我一点时间"
  342. :data="table3.list"
  343. height="450"
  344. fit
  345. border
  346. highlight-current-row
  347. style="width: 100%;"
  348. :row-style="rowStyle"
  349. :cell-style="cellStyle"
  350. class="elTable table-fixed"
  351. >
  352. <el-table-column label="操作序号" min-width="130px" align="center">
  353. <template slot-scope="scope">
  354. <span>{{ scope.row.sort }}</span>
  355. </template>
  356. </el-table-column>
  357. <el-table-column label="转投栏舍" min-width="130px" align="center">
  358. <template slot-scope="scope">
  359. <span>{{ scope.row.fname }}</span>
  360. </template>
  361. </el-table-column>
  362. </el-table>
  363. </div>
  364. </div>
  365. </el-col>
  366. </el-row>
  367. </div>
  368. <!-- 撒料计划-混料 -->
  369. <div v-if="table3.getdataListParm.parammaps.lpplantype == 1 || table3.getdataListParm.parammaps.lpplantype == 5" class="content">
  370. <el-row :gutter="20">
  371. <el-col :span="12">
  372. <div class="table2">
  373. <div class="contentOperation">
  374. <p>计划详情</p>
  375. </div>
  376. <div class="content-table">
  377. <el-table
  378. :key="table2.tableKey"
  379. v-loading="table2.listLoading"
  380. element-loading-text="给我一点时间"
  381. :data="table2.list"
  382. fit
  383. border
  384. highlight-current-row
  385. style="width: 100%;"
  386. height="450"
  387. :row-style="rowStyle"
  388. :cell-style="cellStyle"
  389. class="elTable table-fixed"
  390. :span-method="objectSpanMethod"
  391. >
  392. <el-table-column label="操作序号" min-width="130px" align="center">
  393. <template slot-scope="scope">
  394. <span>{{ scope.row.sort }}</span>
  395. </template>
  396. </el-table-column>
  397. <el-table-column label="饲料名称" prop="fname" min-width="130px" align="center">
  398. <template slot-scope="scope">
  399. <span>{{ scope.row.fname }}</span>
  400. </template>
  401. </el-table-column>
  402. <el-table-column label="设计重量(KG)" prop="weight" min-width="130px" align="center">
  403. <template slot-scope="scope">
  404. <span>{{ scope.row.weight }}</span>
  405. </template>
  406. </el-table-column>
  407. <el-table-column label="小计" prop="description" min-width="130px" align="center">
  408. <template slot-scope="scope">
  409. <span>{{ scope.row.subtotal }}</span>
  410. </template>
  411. </el-table-column>
  412. </el-table>
  413. </div>
  414. </div>
  415. </el-col>
  416. <el-col :span="12">
  417. <div class="table3">
  418. <div class="contentOperation">
  419. <p>栏舍详情</p>
  420. </div>
  421. <div class="content-table">
  422. <el-table
  423. :key="table3.tableKey"
  424. v-loading="table3.listLoading"
  425. element-loading-text="给我一点时间"
  426. :data="table3.list"
  427. height="450"
  428. fit
  429. border
  430. highlight-current-row
  431. style="width: 100%;"
  432. :row-style="rowStyle"
  433. :cell-style="cellStyle"
  434. class="elTable table-fixed"
  435. >
  436. <el-table-column label=" 操作序号" min-width="130px" align="center">
  437. <template slot-scope="scope">
  438. <span>{{ scope.row.sort }}</span>
  439. </template>
  440. </el-table-column>
  441. <el-table-column label="撒料车辆" min-width="130px" align="center">
  442. <template slot-scope="scope">
  443. <span>{{ scope.row.fname }}</span>
  444. </template>
  445. </el-table-column>
  446. <el-table-column label="设计重量(KG)" min-width="130px" align="center">
  447. <template slot-scope="scope">
  448. <span>{{ scope.row.weight }}</span>
  449. </template>
  450. </el-table-column>
  451. </el-table>
  452. </div>
  453. </div>
  454. </el-col>
  455. </el-row>
  456. </div>
  457. <!-- 撒料计划-撒料 -->
  458. <div v-if="table3.getdataListParm.parammaps.lpplantype == 2" class="content">
  459. <el-row :gutter="20">
  460. <el-col :span="12">
  461. <div class="table3">
  462. <div class="contentOperation">
  463. <p>栏舍详情</p>
  464. </div>
  465. <div class="content-table">
  466. <el-table
  467. :key="table3.tableKey"
  468. v-loading="table3.listLoading"
  469. element-loading-text="给我一点时间"
  470. :data="table3.list"
  471. height="450"
  472. fit
  473. border
  474. highlight-current-row
  475. style="width: 100%;"
  476. :row-style="rowStyle"
  477. :cell-style="cellStyle"
  478. class="elTable table-fixed"
  479. >
  480. <el-table-column label=" 操作序号" min-width="130px" align="center">
  481. <template slot-scope="scope">
  482. <span>{{ scope.row.sort }}</span>
  483. </template>
  484. </el-table-column>
  485. <el-table-column label="撒料车辆" min-width="130px" align="center">
  486. <template slot-scope="scope">
  487. <span>{{ scope.row.fname }}</span>
  488. </template>
  489. </el-table-column>
  490. <el-table-column label="设计重量(KG)" min-width="130px" align="center">
  491. <template slot-scope="scope">
  492. <span>{{ scope.row.weight }}</span>
  493. </template>
  494. </el-table-column>
  495. <el-table-column label="小计" prop="description" min-width="130px" align="center">
  496. <template slot-scope="scope">
  497. <span>{{ scope.row.subtotal }}</span>
  498. </template>
  499. </el-table-column>
  500. </el-table>
  501. </div>
  502. </div>
  503. </el-col>
  504. <el-col :span="12">
  505. <div class="table2">
  506. <div class="contentOperation">
  507. <p>计划详情</p>
  508. </div>
  509. <div class="content-table">
  510. <el-table
  511. :key="table2.tableKey"
  512. v-loading="table2.listLoading"
  513. element-loading-text="给我一点时间"
  514. :data="table2.list"
  515. fit
  516. border
  517. highlight-current-row
  518. style="width: 100%;"
  519. height="450"
  520. :row-style="rowStyle"
  521. :cell-style="cellStyle"
  522. class="elTable table-fixed"
  523. >
  524. <el-table-column label="操作序号" min-width="130px" align="center">
  525. <template slot-scope="scope">
  526. <span>{{ scope.row.sort }}</span>
  527. </template>
  528. </el-table-column>
  529. <el-table-column label="栏舍名称" prop="fname" min-width="130px" align="center">
  530. <template slot-scope="scope">
  531. <span>{{ scope.row.fname }}</span>
  532. </template>
  533. </el-table-column>
  534. <el-table-column label="设计重量(KG)" prop="weight" min-width="130px" align="center">
  535. <template slot-scope="scope">
  536. <span>{{ scope.row.weight }}</span>
  537. </template>
  538. </el-table-column>
  539. </el-table>
  540. </div>
  541. </div>
  542. </el-col>
  543. </el-row>
  544. </div>
  545. <!-- 新生成 -->
  546. <el-dialog :title="textMap[newGeneration.dialogStatus]" :destroy-on-close="true" :visible.sync="newGeneration.dialogFormVisible" :close-on-click-modal="false" width="30%">
  547. <div class="newGeneration" v-loading="newGenerationLoading" >
  548. <el-form ref="temp" :rules="newGeneration.rules" :model="newGeneration.temp" label-position="right" label-width="100px" style="width: 100%;margin:0 auto 50px">
  549. <el-row v-if="newGeneration.dialogStatus== 'newGeneration'">
  550. <el-col :span="24">
  551. <el-form-item label="时间范围:" prop="inputDatetime">
  552. <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" :picker-options="pickerOptions2" />
  553. </el-form-item>
  554. </el-col>
  555. </el-row>
  556. <el-row v-else>
  557. <el-col :span="24">
  558. <el-form-item label="时间范围:" prop="copyInputDatetime">
  559. <el-date-picker v-model="newGeneration.temp.copyInputDatetime" :picker-options="pickerOptions" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 100%;" :clearable="false" />
  560. </el-form-item>
  561. </el-col>
  562. </el-row>
  563. <p v-if="newGeneration.temp.tips == true || newGeneration.dialogStatus == 'copy'" style="font-weight: 700;color: red;text-align: center;">注:撒料计划中存在未分配完栏舍,如下所示;建议及时进行分配</p>
  564. <div style="height: 200px;overflow: auto;">
  565. <div v-if="myMaxTimes == 1">
  566. <div>第一班:</div>
  567. <div v-for="(item,index) in tipsList.one" :key="index+'A'" >
  568. <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
  569. <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
  570. <span v-for="(item2,index2) in item.arrList" :key="index2+'a'">
  571. {{item2.barname}}
  572. </span>
  573. </span>
  574. </div>
  575. </div>
  576. <div v-else-if="myMaxTimes == 2">
  577. <div>第一班:</div>
  578. <div v-for="(item,index) in tipsList.one" :key="index+'B'" >
  579. <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
  580. <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
  581. <span v-for="(item2,index2) in item.arrList" :key="index2+'b'">
  582. {{item2.barname}}
  583. </span>
  584. </span>
  585. </div>
  586. <div>第二班:</div>
  587. <div v-for="(item,index) in tipsList.two" :key="index+'C'" >
  588. <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
  589. <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
  590. <span v-for="(item2,index2) in item.arrList" :key="index2+'c'">
  591. {{item2.barname}}
  592. </span>
  593. </span>
  594. </div>
  595. </div>
  596. <div v-else-if="myMaxTimes == 3">
  597. <div>第一班:</div>
  598. <div v-for="(item,index) in tipsList.one" :key="index+'D'" >
  599. <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
  600. <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
  601. <span v-for="(item2,index2) in item.arrList" :key="index2+'d'">
  602. {{item2.barname}}
  603. </span>
  604. </span>
  605. </div>
  606. <div>第二班:</div>
  607. <div v-for="(item,index) in tipsList.two" :key="index+'E'" >
  608. <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
  609. <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
  610. <span v-for="(item2,index2) in item.arrList" :key="index2+'e'">
  611. {{item2.barname}}
  612. </span>
  613. </span>
  614. </div>
  615. <div>第三班:</div>
  616. <div v-for="(item,index) in tipsList.three" :key="index+'F'" >
  617. <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
  618. <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
  619. <span v-for="(item2,index2) in item.arrList" :key="index2+'f'">
  620. {{item2.barname}}
  621. </span>
  622. </span>
  623. </div>
  624. </div>
  625. <div v-else>
  626. <div>第一班:</div>
  627. <div v-for="(item,index) in tipsList.one" :key="index+'G'" >
  628. <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
  629. <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
  630. <span v-for="(item2,index2) in item.arrList" :key="index2+'g'">
  631. {{item2.barname}}
  632. </span>
  633. </span>
  634. </div>
  635. <div>第二班:</div>
  636. <div v-for="(item,index) in tipsList.two" :key="index+'H'" >
  637. <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
  638. <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
  639. <span v-for="(item2,index2) in item.arrList" :key="index2+'h'">
  640. {{item2.barname}}
  641. </span>
  642. </span>
  643. </div>
  644. <div>第三班:</div>
  645. <div v-for="(item,index) in tipsList.three" :key="index+'I'" >
  646. <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
  647. <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
  648. <span v-for="(item2,index2) in item.arrList" :key="index2+'i'">
  649. {{item2.barname}}
  650. </span>
  651. </span>
  652. </div>
  653. <div>第四班:</div>
  654. <div v-for="(item,index) in tipsList.four" :key="index+'J'" >
  655. <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
  656. <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
  657. <span v-for="(item2,index2) in item.arrList" :key="index2+'j'">
  658. {{item2.barname}}
  659. </span>
  660. </span>
  661. </div>
  662. </div>
  663. </div>
  664. </el-form>
  665. <div slot="footer" class="dialog-footer" style="bottom:20px">
  666. <el-button class="cancelClose" @click="newGeneration.dialogFormVisible = false;getList()">取消</el-button>
  667. <el-button v-if="newGeneration.dialogStatus== 'newGeneration'" class="save" :disabled="isokDisable" @click="newGenerationData()">确认</el-button>
  668. <el-button v-else class="save" :disabled="isokDisable" @click="copyData()">确认</el-button>
  669. </div>
  670. </div>
  671. </el-dialog>
  672. <!-- 历史记录 -->
  673. <el-dialog :fullscreen="dialogFull" :destroy-on-close="true" :visible.sync="historyRecord.dialogFormVisible" :close-on-click-modal="false" width="90%">
  674. <template slot="title">
  675. <div class="avue-crud__dialog__header">
  676. <span class="el-dialog__title">
  677. <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
  678. {{ textMap[historyRecord.dialogStatus] }}
  679. </span>
  680. <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
  681. <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
  682. <svg-icon v-else icon-class="fullscreen" />
  683. </div>
  684. </div>
  685. </template>
  686. <div class="historyRecord">
  687. <keep-alive>
  688. <component :is="historyRecord.myComponent" ref="historyRecord" />
  689. </keep-alive>
  690. </div>
  691. <div slot="footer" class="dialog-footer">
  692. <el-button class="cancelClose cancelClose1" @click="historyRecord.dialogFormVisible = false; ">关闭</el-button>
  693. </div>
  694. </el-dialog>
  695. <!-- 正在同步中 -->
  696. <el-dialog :destroy-on-close="true" :visible.sync="dataSynchronization.dialogFormVisible" :close-on-click-modal="false" width="30%">
  697. <div class="dataSynchronization" style="text-align: center;font-size: 18px;">
  698. <i class="el-icon-loading" />
  699. <span>正在同步</span>
  700. <div slot="footer" class="dialog-footer" style="bottom:10px">
  701. <el-button class="miniPrimary" @click="dataSynchronization.dialogFormVisible = false;">确认</el-button>
  702. </div>
  703. </div>
  704. </el-dialog>
  705. <!-- 修改计划 -->
  706. <RevisePlan :show.sync="isShowDialog" :parent-active-name="activeName" :parent-date="parentDate" />
  707. <!-- 删除记录 -->
  708. <el-dialog :title="textMap[deleteRecord.dialogStatus]" :destroy-on-close="true" :visible.sync="deleteRecord.dialogFormVisible" :close-on-click-modal="false" width="90%">
  709. <div class="deleteRecord">
  710. <div class="search">
  711. <el-date-picker v-model="deleteRecord.mydate" type="date" placeholder="选择日期" style="width: 150px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" :clearable="false" @change="changeDeleteRecordDate" />
  712. </div>
  713. <div class="table">
  714. <el-table
  715. :key="deleteRecord.tableKey"
  716. v-loading="deleteRecord.listLoading"
  717. element-loading-text="给我一点时间"
  718. :data="deleteRecord.list"
  719. border
  720. fit
  721. highlight-current-row
  722. style="width: 98%;"
  723. row-key="sort"
  724. :row-style="rowStyle"
  725. :cell-style="cellStyle"
  726. class="elTable table-fixed"
  727. :height="370"
  728. >
  729. <el-table-column label="序号" align="center" prop="sort" width="50px" />
  730. <el-table-column label="计划名称" min-width="90px" align="center" prop="projname" />
  731. <el-table-column label="计划类型" prop="weight" min-width="90px" align="center" :formatter="lpplantype" />
  732. <el-table-column label="TMR编号" min-width="90px" align="center" prop="tmrtname" />
  733. <el-table-column label="驾驶员" min-width="90px" align="center" prop="driver" />
  734. <el-table-column label="已执行" min-width="70px" align="center">
  735. <template slot-scope="scope">
  736. <span v-if="scope.row.havebutton == 0">否</span>
  737. <span v-else>是</span>
  738. </template>
  739. </el-table-column>
  740. <el-table-column label="班次" min-width="80px" align="center" prop="times" />
  741. <el-table-column label="理论量" min-width="80px" align="center" prop="lweight" />
  742. <el-table-column label="启用" min-width="70px" align="center">
  743. <template slot-scope="scope">
  744. <el-switch v-if="dataDisabled == false" disabled v-model="scope.row.enable" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleEnableChange(scope.row)" />
  745. <el-switch v-else v-model="scope.row.enable" disabled active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleEnableChange(scope.row)" />
  746. </template>
  747. </el-table-column>
  748. <el-table-column label="时间" min-width="80px" align="center" prop="plantime" />
  749. <el-table-column label="配方名称" min-width="100px" align="center" prop="ftname" />
  750. <el-table-column label="牛头数" min-width="80px" align="center" prop="cowcount" />
  751. <el-table-column label="描述" min-width="80px" align="center" prop="display" />
  752. <el-table-column label="发料位" min-width="80px" align="left" prop="barnames" />
  753. </el-table>
  754. <span v-if="deleteRecord.listLoading == false" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ deleteRecord.total }}条</span>
  755. </div>
  756. <div slot="footer" class="dialog-footer" style="bottom:20px">
  757. <el-button class="cancelClose1" @click="deleteRecord.dialogFormVisible = false;getList()">取消</el-button>
  758. </div>
  759. </div>
  760. </el-dialog>
  761. </div>
  762. </template>
  763. <script>
  764. import { GetDataByName, GetDataByNames, ExecDataByConfig, PostDataByName, getDorm, GetReportform, checkButtons,postJson } from '@/api/common'
  765. import RevisePlan from './revisePlan.vue'
  766. import printJS from 'print-js'
  767. import { parseTime, json2excel,handleTableSpan, handleObjectSpanMethod } from '@/utils/index.js'
  768. import Cookies from 'js-cookie'
  769. import Sortable from 'sortablejs'
  770. import { MessageBox } from 'element-ui'
  771. export default {
  772. name: 'DailyExecutionPlan',
  773. components: {
  774. RevisePlan
  775. },
  776. data() {
  777. return {
  778. newGenerationLoading:false,
  779. dialogFull: false,
  780. isRoleEdit: [],
  781. dataDisabled: false,
  782. requestParams: [
  783. // { name: 'getDictByName', offset: 0, pagecount: 0, params: ['牲畜父类'] }
  784. ],
  785. planTypeList: [{ lable: '预混计划', value: '4' }, { lable: '撒料计划', value: '0' }, { lable: '剩料计划', value: '3' }, { lable: '撒料计划-混料', value: '1' }, { lable: '撒料计划-撒料', value: '2' }, { lable: '预称重计划', value: '5' }], // 计划类型
  786. printingTypeList: [{ lable: '精料', value: '1' }, { lable: '铲车', value: '2' }], // 打印类型
  787. frequencyList: [], // 班次
  788. planningDimensionList: [{ lable: '发料顺序', value: '0' }, { lable: 'TMR', value: '1' }], // 发料顺序
  789. exportTypeList: [{ lable: '投料简打', value: '0' }, { lable: '累加投料', value: '1' }, { lable: '撒料简打', value: '2' }, { lable: '投撒料简打', value: '3' }, { lable: '投撒料累加', value: '4' }, { lable: '包装简打', value: '5' }, { lable: '实发简打', value: '6' }], // 导出类型
  790. iscompletedList: [{ lable: '是', value: '1' },{ lable: '否', value: '0' } ],
  791. // 班次
  792. maxTime: {
  793. getMaxTimesParm: {
  794. name: 'getSysoptEnable',
  795. page: 1,
  796. offset: 1,
  797. pagecount: 1,
  798. returntype: 'Map',
  799. parammaps: {
  800. pastureid: Cookies.get('pastureid'),
  801. inforname: 'times'
  802. }
  803. }
  804. },
  805. isOrder: true,
  806. table: {
  807. getdataListParm: {
  808. name: 'getDownloadedplanList',
  809. page: 1,
  810. offset: 1,
  811. pagecount: '',
  812. returntype: 'Map',
  813. parammaps: {
  814. pastureid: Cookies.get('pastureid'),
  815. barid: '',
  816. mydate: parseTime(new Date(), '{y}-{m}-{d}'),
  817. times: '',
  818. lpplantype: '',
  819. printType: '',
  820. plandimen: '0',
  821. enable3: '0',
  822. iscompleted:"",
  823. tmrname:"",
  824. }
  825. },
  826. tableKey: 0,
  827. list: [],
  828. total: 0,
  829. listLoading: false
  830. },
  831. // 计划内容操作详情
  832. table2: {
  833. getdataListParm: {
  834. name: 'getDownloadplandtl1ListV2',
  835. page: 1,
  836. offset: 1,
  837. returntype: 'Map',
  838. parammaps: {
  839. pastureid: Cookies.get('pastureid'),
  840. date: '',
  841. id: ''
  842. }
  843. },
  844. tableKey: 0,
  845. list: [],
  846. total: 0,
  847. listLoading: false
  848. },
  849. // 计划内容 舍栏详情
  850. table3: {
  851. getdataListParm: {
  852. name: 'getDownloadplandt2ListV2',
  853. page: 1,
  854. offset: 1,
  855. returntype: 'Map',
  856. parammaps: {
  857. pastureid: Cookies.get('pastureid'),
  858. date: '',
  859. id: ''
  860. }
  861. },
  862. tableKey: 0,
  863. list: [],
  864. total: 0,
  865. listLoading: false
  866. },
  867. // 新生成
  868. newGeneration: {
  869. dialogFormVisible: false,
  870. dialogStatus: '',
  871. getdataListParm: {
  872. name: 'checkLLPIsDistribution',
  873. page: 1,
  874. offset: 1,
  875. pagecount: 1,
  876. returntype: 'Map',
  877. parammaps: {
  878. pastureid: Cookies.get('pastureid')
  879. }
  880. },
  881. temp: {
  882. inputDatetime: [parseTime(new Date(), '{y}-{m}-{d}'), parseTime(new Date(), '{y}-{m}-{d}')],
  883. tips:''
  884. },
  885. rules: {
  886. inputDatetime: [{ type: 'array', required: true, message: '必填', trigger: 'blur' }],
  887. copyInputDatetime: [{ type: 'array', required: true, message: '必填', trigger: 'blur' }]
  888. }
  889. },
  890. pickerMinDate: '',
  891. pickerOptions: {
  892. onPick: ({ maxDate, minDate }) => {
  893. this.pickerMinDate = minDate.getTime()
  894. if (maxDate) {
  895. this.pickerMinDate = ''
  896. }
  897. },
  898. disabledDate: (time) => {
  899. if (this.pickerMinDate !== '') {
  900. const one = 31 * 24 * 3600 * 1000
  901. const minTime = this.pickerMinDate
  902. const maxTime = this.pickerMinDate + one
  903. return time.getTime() < minTime || time.getTime() > maxTime - 8.64e7
  904. }
  905. return time.getTime() < Date.now() - 8.64e7
  906. }
  907. },
  908. pickerOptions2: {
  909. onPick: ({ maxDate, minDate }) => {
  910. this.pickerMinDate = minDate.getTime()
  911. if (maxDate) {
  912. this.pickerMinDate = ''
  913. }
  914. },
  915. disabledDate: (time) => {
  916. if (this.pickerMinDate !== '') {
  917. const one = 14 * 24 * 3600 * 1000
  918. const minTime = this.pickerMinDate
  919. const maxTime = this.pickerMinDate + one
  920. return time.getTime() < minTime || time.getTime() > maxTime - 8.64e7
  921. }
  922. return time.getTime() < Date.now() - 8.64e7
  923. }
  924. },
  925. historyRecord: {
  926. dialogFormVisible: false,
  927. dialogStatus: '',
  928. myComponent: null
  929. },
  930. dataSynchronization: {
  931. dialogFormVisible: false,
  932. dialogStatus: '',
  933. getdataListParm: {
  934. name: 'getSysoptEnable',
  935. page: 1,
  936. offset: 1,
  937. pagecount: 1,
  938. returntype: 'Map',
  939. parammaps: {
  940. pastureid: Cookies.get('pastureid'),
  941. inforname: 'isDataSync'
  942. }
  943. },
  944. isDataSynchronization: false
  945. },
  946. textMap: {
  947. newGeneration: '新生成',
  948. historyRecord: '历史记录',
  949. revisePlan: '修改计划',
  950. copy: '复制计划',
  951. deleteRecord:'删除记录'
  952. },
  953. isokDisable: false,
  954. requestParam: {},
  955. rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
  956. cellStyle: { padding: 0 + 'px' },
  957. isShowDialog: false,
  958. activeName: '栏舍配方',
  959. parentDate: '',
  960. downLoad: {
  961. getdataListParm: {
  962. name: '',
  963. page: 1,
  964. offset: 1,
  965. pagecount: '',
  966. returntype: 'Map',
  967. parammaps: {
  968. pastureid: Cookies.get('pastureid'),
  969. date: ''
  970. }
  971. },
  972. list: [],
  973. labelList: []
  974. },
  975. tmrDownList:[],
  976. getTmrListParam: {
  977. name: 'getDownloadedplanTmrNameUnfinished',
  978. page: 1,
  979. offset: 1,
  980. pagecount: 10,
  981. returntype: 'Map',
  982. parammaps: {
  983. pastureid: Cookies.get('pastureid'),
  984. mydate: parseTime(new Date(), '{y}-{m}-{d}')
  985. }
  986. },
  987. myMaxTimes:'',
  988. tipsList:[],
  989. spanObj: {},
  990. mergekeys: ['sort', 'description'],
  991. deleteRecord:{
  992. dialogFormVisible: false,
  993. dialogStatus: '',
  994. total:0,
  995. tableKey:0,
  996. listLoading:false,
  997. list:[],
  998. mydate: parseTime(new Date(), '{y}-{m}-{d}')
  999. },
  1000. selectList: [],
  1001. }
  1002. },
  1003. created() {
  1004. this.parentDate = this.table.getdataListParm.parammaps.mydate
  1005. console.log(this.parentDate, 'this.parentDate')
  1006. this.getDataSynchronization()
  1007. this.getButtons()
  1008. this.getList()
  1009. this.getDownList()
  1010. this.getIsDisplay()
  1011. this.getTMRList()
  1012. },
  1013. mounted() {
  1014. this.getTmrListParam.parammaps.mydate = parseTime(new Date(), '{y}-{m}-{d}')
  1015. },
  1016. methods: {
  1017. getTMRList(){
  1018. console.log('11111111')
  1019. this.getTmrListParam.parammaps.mydate = this.table.getdataListParm.parammaps.mydate
  1020. GetDataByName(this.getTmrListParam).then(response => {
  1021. if (response.data.list !== null) {
  1022. console.log('11111111',response)
  1023. this.tmrDownList = response.data.list
  1024. }
  1025. })
  1026. },
  1027. getButtons() {
  1028. const Edit = 'DailyExecutionPlan'
  1029. const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
  1030. this.isRoleEdit = isRoleEdit
  1031. },
  1032. getDataSynchronization() {
  1033. GetDataByName(this.dataSynchronization.getdataListParm).then(response => {
  1034. // console.log(response.data.list[0])
  1035. if (response.data.list[0].inforvalue == 0) {
  1036. this.dataSynchronization.isDataSynchronization = false
  1037. } else {
  1038. this.dataSynchronization.isDataSynchronization = true
  1039. }
  1040. })
  1041. },
  1042. getIsDisplay() {
  1043. GetDataByName(this.maxTime.getMaxTimesParm).then(response => {
  1044. console.log(response.data.list[0].inforvalue)
  1045. this.myMaxTimes = response.data.list[0].inforvalue
  1046. if (response.data.list[0].inforvalue == 1) {
  1047. this.frequencyList = [{ id: '1', name: '第一班' }]
  1048. } else if (response.data.list[0].inforvalue == 2) {
  1049. this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }]
  1050. } else if (response.data.list[0].inforvalue == 3) {
  1051. this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }]
  1052. } else if (response.data.list[0].inforvalue == 4) {
  1053. this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }, { id: '4', name: '第四班' }]
  1054. }
  1055. })
  1056. },
  1057. getDownList() {
  1058. GetDataByNames(this.requestParams).then(response => {
  1059. // this.livestockTypeList = response.data.getDictByName.list
  1060. })
  1061. },
  1062. // -------------------日执行计划-----------------------------
  1063. handleBefore() {
  1064. if (this.table.getdataListParm.parammaps.mydate !== '' && this.table.getdataListParm.parammaps.mydate !== null) {
  1065. this.table.getdataListParm.parammaps.mydate = new Date(this.table.getdataListParm.parammaps.mydate)
  1066. var start = new Date(this.table.getdataListParm.parammaps.mydate.setDate(this.table.getdataListParm.parammaps.mydate.getDate() - 1))
  1067. // var start = this.table.getdataListParm.parammaps.mydate - 1
  1068. this.table.getdataListParm.parammaps.mydate = parseTime(start, '{y}-{m}-{d}')
  1069. // this.$forceUpdate()
  1070. this.parentDate = this.table.getdataListParm.parammaps.mydate
  1071. this.getTMRList()
  1072. this.getList()
  1073. }
  1074. var d = this.table.getdataListParm.parammaps.mydate
  1075. var curDate = parseTime(new Date(), '{y}-{m}-{d}')
  1076. if (d < curDate) {
  1077. this.dataDisabled = true
  1078. } else {
  1079. this.dataDisabled = false
  1080. }
  1081. console.log(this.dataDisabled)
  1082. },
  1083. handleNext() {
  1084. if (this.table.getdataListParm.parammaps.mydate !== '' && this.table.getdataListParm.parammaps.mydate !== null) {
  1085. this.table.getdataListParm.parammaps.mydate = new Date(this.table.getdataListParm.parammaps.mydate)
  1086. var stop = new Date(this.table.getdataListParm.parammaps.mydate.setDate(this.table.getdataListParm.parammaps.mydate.getDate() + 1))
  1087. this.table.getdataListParm.parammaps.mydate = parseTime(stop, '{y}-{m}-{d}')
  1088. this.parentDate = this.table.getdataListParm.parammaps.mydate
  1089. this.getTMRList()
  1090. this.getList()
  1091. }
  1092. var d = this.table.getdataListParm.parammaps.mydate
  1093. var curDate = parseTime(new Date(), '{y}-{m}-{d}')
  1094. if (d < curDate) {
  1095. this.dataDisabled = true
  1096. } else {
  1097. this.dataDisabled = false
  1098. }
  1099. console.log(this.dataDisabled)
  1100. },
  1101. getList() {
  1102. this.table.listLoading = true
  1103. GetDataByName(this.table.getdataListParm).then(response => {
  1104. console.log('table数据', response.data.list)
  1105. if (response.data.list !== null) {
  1106. // var obj = { 'id': '580999', 'havebutton': '0', 'lpplantype': 2, 'pid': '3283220207862547456', 'times': '第二班', 'projname': '2.666' }
  1107. // response.data.list[6] = obj
  1108. this.getIsColor(response.data.list)
  1109. this.table.list = response.data.list
  1110. this.table.pageNum = response.data.pageNum
  1111. this.table.pageSize = response.data.pageSize
  1112. this.table.total = response.data.total
  1113. console.log('计划类型', response.data.list[0].lpplantype)
  1114. if (response.data.list[0].lpplantype == 0) {
  1115. // 撒料
  1116. this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
  1117. this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
  1118. this.table2.getdataListParm.parammaps.useinbartype = ''
  1119. this.table3.getdataListParm.parammaps.useinbartype = ''
  1120. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1121. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1122. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  1123. this.table3.getdataListParm.parammaps.id = response.data.list[0].id
  1124. this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
  1125. this.getList2()
  1126. this.getList3()
  1127. } else if (response.data.list[0].lpplantype == 1) {
  1128. // 撒料计划-混料
  1129. this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
  1130. this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
  1131. this.table2.getdataListParm.parammaps.useinbartype = ''
  1132. this.table3.getdataListParm.parammaps.useinbartype = ''
  1133. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1134. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1135. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  1136. this.table3.getdataListParm.parammaps.id = response.data.list[0].id
  1137. this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
  1138. this.getList2()
  1139. this.getList3()
  1140. } else if (response.data.list[0].lpplantype == 2) {
  1141. // 撒料计划-撒料
  1142. this.table2.getdataListParm.name = 'getDownloadplandt2ListV2'
  1143. this.table3.getdataListParm.name = 'getDownloadplandtl1ListV2'
  1144. this.table2.getdataListParm.parammaps.useinbartype = ''
  1145. this.table3.getdataListParm.parammaps.useinbartype = ''
  1146. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1147. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1148. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  1149. this.table3.getdataListParm.parammaps.id = response.data.list[0].id
  1150. this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
  1151. this.getList2()
  1152. this.getList3()
  1153. } else if (response.data.list[0].lpplantype == 3) {
  1154. // 剩料
  1155. this.table2.getdataListParm.name = 'getDownloadplandt2ListV2'
  1156. this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
  1157. this.table2.getdataListParm.parammaps.useinbartype = 0
  1158. this.table3.getdataListParm.parammaps.useinbartype = 1
  1159. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1160. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1161. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  1162. this.table3.getdataListParm.parammaps.id = response.data.list[0].id
  1163. this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
  1164. this.getList2()
  1165. this.getList3()
  1166. } else if (response.data.list[0].lpplantype == 4) {
  1167. // 预混
  1168. this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
  1169. this.table2.getdataListParm.parammaps.useinbartype = ''
  1170. this.table3.getdataListParm.parammaps.useinbartype = ''
  1171. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  1172. this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
  1173. this.getList2()
  1174. } else if (response.data.list[0].lpplantype == 5) {
  1175. // 预称重计划
  1176. this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
  1177. this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
  1178. this.table2.getdataListParm.parammaps.useinbartype = ''
  1179. this.table3.getdataListParm.parammaps.useinbartype = ''
  1180. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1181. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1182. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  1183. this.table3.getdataListParm.parammaps.id = response.data.list[0].id
  1184. this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
  1185. this.getList2()
  1186. this.getList3()
  1187. }
  1188. } else {
  1189. this.table.list = []
  1190. this.table3.getdataListParm.parammaps.lpplantype = ''
  1191. this.table2.getdataListParm.parammaps.id = ''
  1192. this.table3.getdataListParm.parammaps.id = ''
  1193. // this.getList2()
  1194. // this.getList3()
  1195. this.table2.list = []
  1196. this.table3.list = []
  1197. }
  1198. setTimeout(() => {
  1199. this.table.listLoading = false
  1200. }, 100)
  1201. })
  1202. },
  1203. handleEnableChange(row) {
  1204. this.requestParam.name = 'updatedownloadenable'
  1205. this.requestParam.parammaps = {}
  1206. this.requestParam.parammaps.pastureid = row.pastureid
  1207. this.requestParam.parammaps.id = row.id
  1208. this.requestParam.parammaps.enable = row.enable
  1209. PostDataByName(this.requestParam).then(response => {
  1210. if (response.msg === 'fail') {
  1211. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1212. } else {
  1213. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  1214. this.getList()
  1215. }
  1216. })
  1217. },
  1218. getIsColor(arr) {
  1219. var map = {}
  1220. var dest = []
  1221. for (var i = 0; i < arr.length; i++) {
  1222. var ai = arr[i]
  1223. if (!map[ai.pid]) {
  1224. dest.push({
  1225. pid: ai.pid,
  1226. data: [ai]
  1227. })
  1228. map[ai.pid] = ai
  1229. } else {
  1230. for (var j = 0; j < dest.length; j++) {
  1231. var dj = dest[j]
  1232. if (dj.pid == ai.pid) {
  1233. dj.data.push(ai)
  1234. break
  1235. }
  1236. }
  1237. }
  1238. }
  1239. console.log(dest)
  1240. var newArr1 = []
  1241. for (var i = 0; i < dest.length; i++) {
  1242. var newArr = dest[i].data
  1243. for (var j = 0; j < dest[i].data.length; j++) {
  1244. dest[i].data[j].isColor = i
  1245. newArr1.push(dest[i].data[j])
  1246. }
  1247. }
  1248. console.log(newArr1)
  1249. this.table.list = newArr1
  1250. },
  1251. tableRowClassName({ row }) {
  1252. if (row.isColor % 2 == 0) {
  1253. return 'warning-row'
  1254. } else {
  1255. return 'success-row'
  1256. }
  1257. },
  1258. lpplantype: function(cellValue) {
  1259. if (cellValue.lpplantype == 0) {
  1260. return '撒料计划'
  1261. } else if (cellValue.lpplantype == 1) {
  1262. return '撒料计划-混料'
  1263. } else if (cellValue.lpplantype == 2) {
  1264. return '撒料计划-撒料'
  1265. } else if (cellValue.lpplantype == 3) {
  1266. return '剩料计划'
  1267. } else if (cellValue.lpplantype == 4) {
  1268. return '预混计划'
  1269. } else if (cellValue.lpplantype == 5) {
  1270. return '预称重计划'
  1271. }
  1272. },
  1273. changeDate(val) {
  1274. console.log('选择了日期', val)
  1275. this.getList()
  1276. // this.getList2()
  1277. // this.getList3()
  1278. var d = this.table.getdataListParm.parammaps.mydate
  1279. var curDate = parseTime(new Date(), '{y}-{m}-{d}')
  1280. if (d < curDate) {
  1281. this.dataDisabled = true
  1282. } else {
  1283. this.dataDisabled = false
  1284. }
  1285. console.log(this.dataDisabled)
  1286. this.parentDate = this.table.getdataListParm.parammaps.mydate
  1287. console.log(this.parentDate, 'this.parentDate')
  1288. },
  1289. changePlanType(val) {
  1290. console.log('选择了计划类型', val)
  1291. this.getList()
  1292. this.getList2()
  1293. this.getList3()
  1294. },
  1295. changeFrequency(val) {
  1296. console.log('选择了班次', val)
  1297. this.getList()
  1298. this.getList2()
  1299. this.getList3()
  1300. },
  1301. // 日执行计划行点击
  1302. tableRowClick(row, column, event) {
  1303. console.log(row, column, event)
  1304. console.log('点击计划类型', row.lpplantype)
  1305. // 撒料计划0/撒料计划-混料1/撒料计划-撒料2/剩料计划3/预混计划4/预称重计划5
  1306. if (row.lpplantype == 0) {
  1307. // 撒料
  1308. this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
  1309. this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
  1310. this.table2.getdataListParm.parammaps.useinbartype = ''
  1311. this.table3.getdataListParm.parammaps.useinbartype = ''
  1312. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1313. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1314. this.table2.getdataListParm.parammaps.id = row.id
  1315. this.table3.getdataListParm.parammaps.id = row.id
  1316. this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
  1317. this.getList2()
  1318. this.getList3()
  1319. } else if (row.lpplantype == 1) {
  1320. // 撒料计划-混料
  1321. this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
  1322. this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
  1323. this.table2.getdataListParm.parammaps.useinbartype = ''
  1324. this.table3.getdataListParm.parammaps.useinbartype = ''
  1325. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1326. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1327. this.table2.getdataListParm.parammaps.id = row.id
  1328. this.table3.getdataListParm.parammaps.id = row.id
  1329. this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
  1330. this.getList2()
  1331. this.getList3()
  1332. } else if (row.lpplantype == 2) {
  1333. // 撒料计划-撒料
  1334. this.table2.getdataListParm.name = 'getDownloadplandt2ListV2'
  1335. this.table3.getdataListParm.name = 'getDownloadplandtl1ListV2'
  1336. this.table2.getdataListParm.parammaps.useinbartype = ''
  1337. this.table3.getdataListParm.parammaps.useinbartype = ''
  1338. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1339. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1340. this.table2.getdataListParm.parammaps.id = row.id
  1341. this.table3.getdataListParm.parammaps.id = row.id
  1342. this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
  1343. this.getList2()
  1344. this.getList3()
  1345. console.log(this.table3.getdataListParm.parammaps.lpplantype)
  1346. } else if (row.lpplantype == 3) {
  1347. // 剩料
  1348. this.table2.getdataListParm.name = 'getDownloadplandt2ListV2'
  1349. this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
  1350. this.table2.getdataListParm.parammaps.useinbartype = 0
  1351. this.table3.getdataListParm.parammaps.useinbartype = 1
  1352. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1353. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1354. this.table2.getdataListParm.parammaps.id = row.id
  1355. this.table3.getdataListParm.parammaps.id = row.id
  1356. this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
  1357. this.getList2()
  1358. this.getList3()
  1359. } else if (row.lpplantype == 4) {
  1360. // 预混
  1361. this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
  1362. this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
  1363. this.table2.getdataListParm.parammaps.useinbartype = ''
  1364. this.table3.getdataListParm.parammaps.useinbartype = ''
  1365. this.table2.getdataListParm.parammaps.id = row.id
  1366. this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
  1367. this.getList2()
  1368. } else if (row.lpplantype == 5) {
  1369. // 预称重计划
  1370. this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
  1371. this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
  1372. this.table2.getdataListParm.parammaps.useinbartype = ''
  1373. this.table3.getdataListParm.parammaps.useinbartype = ''
  1374. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1375. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1376. this.table2.getdataListParm.parammaps.id = row.id
  1377. this.table3.getdataListParm.parammaps.id = row.id
  1378. this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
  1379. this.getList2()
  1380. this.getList3()
  1381. }
  1382. this.$forceUpdate()
  1383. },
  1384. // 计划内容操作详情
  1385. getList2() {
  1386. this.table2.listLoading = true
  1387. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1388. GetDataByName(this.table2.getdataListParm).then(response => {
  1389. console.log('table数据', response.data.list)
  1390. if (response.data.list !== null) {
  1391. this.table2.list = response.data.list
  1392. // 撒料计划0/撒料计划-混料1/撒料计划-撒料2/剩料计划3/预混计划4
  1393. if (this.table3.getdataListParm.parammaps.lpplantype == 0 || this.table3.getdataListParm.parammaps.lpplantype == 1 || this.table3.getdataListParm.parammaps.lpplantype == 4) {
  1394. const arr = []
  1395. var a = 0
  1396. let b = this.table2.list[0].sort
  1397. let c = 0
  1398. for (let i = 0; i < this.table2.list.length; i++) {
  1399. if (b !== parseInt(this.table2.list[i].sort)) {
  1400. b = this.table2.list[i].sort
  1401. // arr.push({ 'sort': '小计', 'weight': a.toFixed(parseInt(Cookies.get('decimal'))) })
  1402. a = 0
  1403. }
  1404. a = a + parseFloat(this.table2.list[i].weight)
  1405. c = c + parseFloat(this.table2.list[i].weight)
  1406. arr.push(this.table2.list[i])
  1407. }
  1408. // arr.push({ 'sort': '小计', 'weight': a.toFixed(parseInt(Cookies.get('decimal'))) })
  1409. arr.push({ 'sort': '总计', 'weight': c.toFixed(parseInt(Cookies.get('decimal'))) })
  1410. this.table2.list = arr
  1411. }
  1412. if (this.table3.getdataListParm.parammaps.lpplantype == 2) {
  1413. const arr = []
  1414. var aa = 0
  1415. let bb = this.table2.list[0].sort
  1416. let cc = 0
  1417. for (let i = 0; i < this.table2.list.length; i++) {
  1418. if (bb !== parseInt(this.table2.list[i].sort)) {
  1419. bb = this.table2.list[i].sort
  1420. aa = 0
  1421. }
  1422. aa = aa + parseFloat(this.table2.list[i].weight)
  1423. cc = cc + parseFloat(this.table2.list[i].weight)
  1424. arr.push(this.table2.list[i])
  1425. }
  1426. arr.push({ 'sort': '总计', 'weight': cc.toFixed(parseInt(Cookies.get('decimal'))) })
  1427. this.table2.list = arr
  1428. console.log('this.table2.list', this.table2.list)
  1429. console.log(this.table3.getdataListParm.parammaps.lpplantype)
  1430. }
  1431. console.log(this.table2.list)
  1432. this.table2.pageNum = response.data.pageNum
  1433. this.table2.pageSize = response.data.pageSize
  1434. this.table2.total = response.data.total
  1435. } else {
  1436. this.table2.list = []
  1437. }
  1438. this.handleSpan()
  1439. setTimeout(() => {
  1440. this.table2.listLoading = false
  1441. }, 100)
  1442. })
  1443. },
  1444. // 计划内容栏舍详情
  1445. getList3() {
  1446. this.table3.listLoading = true
  1447. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1448. GetDataByName(this.table3.getdataListParm).then(response => {
  1449. console.log('table数据', response.data.list)
  1450. if (response.data.list !== null) {
  1451. this.table3.list = response.data.list
  1452. if (this.table3.getdataListParm.parammaps.lpplantype == 0) {
  1453. const arr = []
  1454. var a = 0
  1455. let b = this.table3.list[0].sort
  1456. let c = 0
  1457. for (let i = 0; i < this.table3.list.length; i++) {
  1458. if (b !== parseInt(this.table3.list[i].sort)) {
  1459. b = this.table3.list[i].sort
  1460. a = 0
  1461. }
  1462. a = a + parseFloat(this.table3.list[i].weight)
  1463. c = c + parseFloat(this.table3.list[i].weight)
  1464. arr.push(this.table3.list[i])
  1465. }
  1466. arr.push({ 'sort': '总计', 'weight': c.toFixed(parseInt(Cookies.get('decimal'))) })
  1467. this.table3.list = arr
  1468. }
  1469. this.table3.pageNum = response.data.pageNum
  1470. this.table3.pageSize = response.data.pageSize
  1471. this.table3.total = response.data.total
  1472. } else {
  1473. this.table3.list = []
  1474. }
  1475. setTimeout(() => {
  1476. this.table3.listLoading = false
  1477. }, 100)
  1478. })
  1479. },
  1480. // 新生成
  1481. handleCreate() {
  1482. console.log('点击了新生成')
  1483. this.newGeneration.temp.inputDatetime = [parseTime(new Date(), '{y}-{m}-{d}'), parseTime(new Date(), '{y}-{m}-{d}')]
  1484. GetDataByName(this.newGeneration.getdataListParm).then(response => {
  1485. console.log('table数据', response.data.list)
  1486. if (response.data.list !== null) {
  1487. if (response.data.list[0].vmsg == '存在未分配') {
  1488. this.newGeneration.temp.tips = true
  1489. this.$message({ type: 'warning', message: '撒料计划中存在未分配完栏舍,建议及时进行分配', duration: 2000 })
  1490. this.getTips()
  1491. }else{
  1492. this.newGeneration.temp.tips = false
  1493. this.newGeneration.dialogStatus = 'newGeneration'
  1494. this.newGeneration.dialogFormVisible = true
  1495. }
  1496. }
  1497. })
  1498. },
  1499. getTips(){
  1500. const url = 'authdata/feedp/undistribute'
  1501. const data = {}
  1502. // data.times = 1
  1503. data.times = this.myMaxTimes
  1504. data.pastureid = Cookies.get('pastureid')
  1505. this.tipsList = []
  1506. postJson(url, data).then(response => {
  1507. if(response.data !== null){
  1508. this.tipsList = response.data
  1509. // if(this.myMaxTimes == 1){
  1510. // this.tipsList = response.data.one
  1511. // }else if(this.myMaxTimes == 2){
  1512. // this.tipsList.push(response.data.one,response.data.two)
  1513. // }else if(this.myMaxTimes == 3){
  1514. // this.tipsList.push(response.data.one,response.data.two,response.data.three)
  1515. // }else if(this.myMaxTimes == 4){
  1516. // this.tipsList.push(response.data.one,response.data.two,response.data.three,response.data.four)
  1517. // }
  1518. }else{
  1519. this.tipsList = []
  1520. }
  1521. console.log('this.tipsList==>',this.tipsList)
  1522. this.newGeneration.dialogStatus = 'newGeneration'
  1523. this.newGeneration.dialogFormVisible = true
  1524. })
  1525. },
  1526. DateDiff(sDate1, sDate2) {
  1527. console.log(sDate1, sDate2)
  1528. var aDate, oDate1, oDate2, iDays
  1529. aDate = sDate1.split('-')
  1530. oDate1 = new Date(aDate[0], aDate[1], aDate[2]) // 转换为12-18-2006格式
  1531. aDate = sDate2.split('-')
  1532. oDate2 = new Date(aDate[0], aDate[1], aDate[2])
  1533. iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 / 24) // 把相差的毫秒数转换为天数
  1534. this.newGeneration.temp.days = parseInt(iDays) + 1
  1535. return iDays
  1536. },
  1537. newGenerationData() {
  1538. console.log('点击了新生成保存', this.newGeneration.temp)
  1539. this.newGenerationLoading = true
  1540. this.isokDisable = true
  1541. this.$refs['temp'].validate(valid => {
  1542. if (valid) {
  1543. this.newGeneration.temp.startTime = parseTime(this.newGeneration.temp.inputDatetime[0], '{y}-{m}-{d}')
  1544. this.newGeneration.temp.stopTime = parseTime(this.newGeneration.temp.inputDatetime[1], '{y}-{m}-{d}')
  1545. this.DateDiff(this.newGeneration.temp.stopTime, this.newGeneration.temp.startTime)
  1546. this.requestParam = {}
  1547. this.requestParam.common = { 'returnmap': '0' }
  1548. this.requestParam.data = []
  1549. this.requestParam.data[0] = { 'name': 'checkDLPIsStart', 'type': 'v', 'parammaps': {
  1550. pastureid: Cookies.get('pastureid'),
  1551. startTime: this.newGeneration.temp.startTime
  1552. }}
  1553. this.requestParam.data[1] = { 'name': 'checkPreMixStorage', 'type': 'e', 'parammaps': {
  1554. pastureid: Cookies.get('pastureid'),
  1555. days: this.newGeneration.temp.days
  1556. }}
  1557. this.requestParam.data[2] = { 'name': 'createdownloadedplan', 'type': 'e', 'parammaps': {
  1558. pastureid: Cookies.get('pastureid'),
  1559. startTime: this.newGeneration.temp.startTime,
  1560. stopTime: this.newGeneration.temp.stopTime
  1561. }}
  1562. ExecDataByConfig(this.requestParam).then(response => {
  1563. console.log('新生成保存发送参数', this.requestParam)
  1564. if (response.msg === 'fail') {
  1565. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1566. this.isokDisable = false
  1567. this.newGenerationLoading = false
  1568. } else {
  1569. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  1570. this.newGeneration.dialogFormVisible = false
  1571. this.getList()
  1572. this.isokDisable = false
  1573. this.newGenerationLoading = false
  1574. }
  1575. })
  1576. }
  1577. })
  1578. },
  1579. // 修改计划
  1580. handleRevisePlan(data) {
  1581. this.dialogFull = false
  1582. var arr = []
  1583. if (this.table.list.length > 0) {
  1584. for (let i = 0; i < this.table.list.length; i++) {
  1585. if (this.table.list[i].havebutton == 1) {
  1586. arr.push(this.table.list[i])
  1587. }
  1588. }
  1589. }
  1590. if (arr.length !== this.table.list.length) {
  1591. console.log('点击了修改计划1', this.activeName)
  1592. this.isShowDialog = true
  1593. this.activeName = '栏舍配方'
  1594. console.log('点击了修改计划2', this.activeName)
  1595. } else {
  1596. this.$message({ type: 'error', message: '当前日期不可修改计划,请重新选择日期' })
  1597. }
  1598. },
  1599. handleExport() {
  1600. this.downLoad.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1601. this.downLoad.getdataListParm.parammaps.lpplantype = this.table.getdataListParm.parammaps.lpplantype
  1602. this.downLoad.getdataListParm.parammaps.times = this.table.getdataListParm.parammaps.times
  1603. this.downLoad.getdataListParm.parammaps.enable = this.table.getdataListParm.parammaps.enable
  1604. this.downLoad.getdataListParm.parammaps.enable2 = this.table.getdataListParm.parammaps.enable2
  1605. var exportTitle = ''
  1606. if (this.table.getdataListParm.parammaps.plandimen == '1') {
  1607. if (this.table.getdataListParm.parammaps.enable3 == '0') {
  1608. this.downLoad.getdataListParm.name = 'downloadPlanTLJDTMR'
  1609. exportTitle = this.table.getdataListParm.parammaps.mydate + '投料简打'
  1610. } else if (this.table.getdataListParm.parammaps.enable3 == '1') {
  1611. this.downLoad.getdataListParm.name = 'downloadPlanTLLDTMR'
  1612. exportTitle = this.table.getdataListParm.parammaps.mydate + '累加投料'
  1613. } else if (this.table.getdataListParm.parammaps.enable3 == '2') {
  1614. this.downLoad.getdataListParm.name = 'downloadPlanSLJDTMR'
  1615. exportTitle = this.table.getdataListParm.parammaps.mydate + '撒料简打'
  1616. } else if (this.table.getdataListParm.parammaps.enable3 == '3') {
  1617. this.downLoad.getdataListParm.name = 'downloadPlanTSLJDTMR'
  1618. exportTitle = this.table.getdataListParm.parammaps.mydate + '投撒料简打'
  1619. } else if (this.table.getdataListParm.parammaps.enable3 == '4') {
  1620. this.downLoad.getdataListParm.name = 'downloadPlanTSLLDTMR'
  1621. exportTitle = this.table.getdataListParm.parammaps.mydate + '投撒料累加'
  1622. } else if (this.table.getdataListParm.parammaps.enable3 == '5') {
  1623. this.downLoad.getdataListParm.name = 'downloadPlanBZJDTMR'
  1624. exportTitle = this.table.getdataListParm.parammaps.mydate + '包装简打'
  1625. } else {
  1626. this.downLoad.getdataListParm.name = 'downloadPlanSFJDTMR'
  1627. exportTitle = this.table.getdataListParm.parammaps.mydate + '实发简打'
  1628. }
  1629. } else {
  1630. if (this.table.getdataListParm.parammaps.enable3 == '0') {
  1631. this.downLoad.getdataListParm.name = 'downloadPlanTLJD'
  1632. exportTitle = this.table.getdataListParm.parammaps.mydate + '投料简打'
  1633. } else if (this.table.getdataListParm.parammaps.enable3 == '1') {
  1634. this.downLoad.getdataListParm.name = 'downloadPlanTLLD'
  1635. exportTitle = this.table.getdataListParm.parammaps.mydate + '累加投料'
  1636. } else if (this.table.getdataListParm.parammaps.enable3 == '2') {
  1637. this.downLoad.getdataListParm.name = 'downloadPlanSLJD'
  1638. exportTitle = this.table.getdataListParm.parammaps.mydate + '撒料简打'
  1639. } else if (this.table.getdataListParm.parammaps.enable3 == '3') {
  1640. this.downLoad.getdataListParm.name = 'downloadPlanTSLJD'
  1641. exportTitle = this.table.getdataListParm.parammaps.mydate + '投撒料简打'
  1642. } else if (this.table.getdataListParm.parammaps.enable3 == '4') {
  1643. this.downLoad.getdataListParm.name = 'downloadPlanTSLLD'
  1644. exportTitle = this.table.getdataListParm.parammaps.mydate + '投撒料累加'
  1645. } else if (this.table.getdataListParm.parammaps.enable3 == '5') {
  1646. this.downLoad.getdataListParm.name = 'downloadPlanBZJD'
  1647. exportTitle = this.table.getdataListParm.parammaps.mydate + '包装简打'
  1648. } else {
  1649. this.downLoad.getdataListParm.name = 'downloadPlanSFJD'
  1650. exportTitle = this.table.getdataListParm.parammaps.mydate + '实发简打'
  1651. }
  1652. }
  1653. GetReportform(this.downLoad.getdataListParm).then(response => {
  1654. if (response.data.list !== null) {
  1655. this.downLoad.labelList = []
  1656. var filterValArr = []
  1657. for (let i = 0; i < response.data.list.data1.length; i++) {
  1658. this.downLoad.labelList.push(response.data.list.data1[i].label)
  1659. filterValArr.push(response.data.list.data1[i].prop)
  1660. }
  1661. this.downLoad.list = response.data.list.data2
  1662. } else {
  1663. this.downLoad.list = []
  1664. }
  1665. var multiHeaderArr = []
  1666. for (let i = 0; i < this.downLoad.labelList.length; i++) {
  1667. if (i == 0) {
  1668. multiHeaderArr.push(exportTitle)
  1669. } else {
  1670. multiHeaderArr.push('')
  1671. }
  1672. }
  1673. import('@/vendor/Export5Excel').then(excel => {
  1674. const multiHeader = [
  1675. multiHeaderArr
  1676. ]
  1677. const multiHeader2 = [
  1678. this.downLoad.labelList
  1679. ]
  1680. const filterVal = filterValArr
  1681. const data = this.downLoad.list.map((v) => filterVal.map((j) => v[j]))
  1682. const merges = []
  1683. excel.export_json_to_excel({ multiHeader, multiHeader2, data, filename: exportTitle, merges })
  1684. })
  1685. })
  1686. },
  1687. rowDrop() {
  1688. console.log(document.querySelector('#table1 .el-table__body-wrapper tbody'))
  1689. const tbody = document.querySelector('#table1 .el-table__body-wrapper tbody')
  1690. // this.sorTable()
  1691. const that = this
  1692. var sortable = Sortable.create(tbody, {
  1693. disabled: that.dropState,
  1694. onChoose({ newIndex, oldIndex }) {
  1695. console.log(that.isOrder, 'that.isOrder == false')
  1696. console.log(that.dropState, 'that.dropState')
  1697. if (that.dropState == true || that.isOrder == true) {
  1698. sortable.destroy()
  1699. }
  1700. },
  1701. onEnd(evt) {
  1702. var tableList = [...that.table.list] // 保留拖动前数据
  1703. const targetRow = that.table.list.splice(evt.oldIndex, 1)[0] // 拖动数据
  1704. const targetRow2 = that.table.list[evt.newIndex] // 拖动后下方数据
  1705. const targetRow3 = that.table.list[evt.newIndex - 1] // 拖动后上方数据
  1706. console.log(targetRow, 'targetRow')
  1707. console.log(targetRow2, 'targetRow2')
  1708. console.log(targetRow3, 'targetRow3')
  1709. that.table.list.splice(evt.newIndex, 0, targetRow)
  1710. // ==========
  1711. // 已执行的计划不可拖动
  1712. if (targetRow.havebutton == 1) {
  1713. that.$nextTick(() => {
  1714. that.$set(that.table, 'list', tableList)
  1715. })
  1716. that.$message({ type: 'error', message: '因已执行的计划不可调整顺序', duration: 2000 })
  1717. return false
  1718. }
  1719. // 相同班次之间可以拖动
  1720. if (targetRow2 !== undefined && targetRow3 !== undefined) {
  1721. if (targetRow.times !== targetRow2.times && targetRow.times !== targetRow3.times) {
  1722. that.$nextTick(() => {
  1723. that.$set(that.table, 'list', tableList)
  1724. })
  1725. that.$message({ type: 'error', message: '因班次不同不可调整顺序', duration: 2000 })
  1726. return false
  1727. }
  1728. } else if (targetRow2 !== undefined && targetRow3 == undefined) {
  1729. if (targetRow.times !== targetRow2.times) {
  1730. that.$nextTick(() => {
  1731. that.$set(that.table, 'list', tableList)
  1732. })
  1733. that.$message({ type: 'error', message: '因班次不同不可调整顺序', duration: 2000 })
  1734. return false
  1735. }
  1736. } else if (targetRow2 == undefined && targetRow3 !== undefined) {
  1737. if (targetRow.times !== targetRow3.times) {
  1738. that.$nextTick(() => {
  1739. that.$set(that.table, 'list', tableList)
  1740. })
  1741. that.$message({ type: 'error', message: '因班次不同不可调整顺序', duration: 2000 })
  1742. return false
  1743. }
  1744. }
  1745. // 撒料计划0,
  1746. // 撒料计划-混料1
  1747. // 撒料计划-撒料2
  1748. // 剩料计划3
  1749. // 预混计划4
  1750. // 预称重计划5
  1751. if (targetRow.lpplantype == 1) { // 拖动数据为撒料计划-混料
  1752. if (targetRow2 == undefined) {
  1753. that.$nextTick(() => {
  1754. that.$set(that.table, 'list', tableList)
  1755. })
  1756. } else if (targetRow2 !== undefined && targetRow2.pid == targetRow.pid) {
  1757. that.$nextTick(() => {
  1758. that.$set(that.table, 'list', tableList)
  1759. })
  1760. } else {
  1761. var pidArr = [] // pid相同的值
  1762. var pidArr1 = [] //
  1763. var index // 索引
  1764. for (let i = 0; i < tableList.length; i++) {
  1765. if (tableList[i].pid == targetRow.pid) {
  1766. pidArr.push(tableList[i])
  1767. } else {
  1768. pidArr1.push(tableList[i])
  1769. }
  1770. }
  1771. // 找到对应上方pid 的ID
  1772. // 比如说id 580243 找到对应的索引
  1773. if (targetRow3 !== undefined) {
  1774. for (let i = 0; i < pidArr1.length; i++) {
  1775. if (pidArr1[i].id == targetRow3.id) {
  1776. index = i
  1777. }
  1778. }
  1779. } else {
  1780. for (let i = 0; i < pidArr1.length; i++) {
  1781. if (pidArr1[i].id == targetRow2.id) {
  1782. index = i - 1
  1783. }
  1784. }
  1785. }
  1786. pidArr1.splice(index + 1, 0, ...pidArr)
  1787. console.log(pidArr1)
  1788. that.$nextTick(() => {
  1789. that.table.list = pidArr1
  1790. })
  1791. }
  1792. if (targetRow2 !== undefined && targetRow3 !== undefined) {
  1793. if (targetRow2.pid == targetRow3.pid) {
  1794. that.$nextTick(() => {
  1795. that.$set(that.table, 'list', tableList)
  1796. })
  1797. that.$message({ type: 'error', message: '不可将其他计划拖动至预称重计划之间', duration: 2000 })
  1798. return false
  1799. }
  1800. }
  1801. } else if (targetRow.lpplantype == 5) { // 拖动数据为预称重计划
  1802. if (targetRow2 !== undefined) {
  1803. console.log(targetRow3, targetRow2, 'zhidao')
  1804. if (targetRow3 !== undefined) {
  1805. if (targetRow3.pid !== targetRow.pid && targetRow2.pid !== targetRow.pid) {
  1806. that.$nextTick(() => {
  1807. that.$set(that.table, 'list', tableList)
  1808. })
  1809. that.$message({ type: 'error', message: '预称重计划不可拖动至其他位置', duration: 2000 })
  1810. return false
  1811. } else {
  1812. console.log('wojinlaile', targetRow2, targetRow)
  1813. if (targetRow3.lpplantype == 0 && targetRow2.pid !== targetRow.pid) {
  1814. that.$nextTick(() => {
  1815. that.$set(that.table, 'list', tableList)
  1816. })
  1817. that.$message({ type: 'error', message: '预称重计划不可拖动至撒料计划下方', duration: 2000 })
  1818. return false
  1819. }
  1820. if (targetRow2.lpplantype !== 5 && targetRow3.lpplantype !== 5) {
  1821. that.$nextTick(() => {
  1822. that.$set(that.table, 'list', tableList)
  1823. })
  1824. that.$message({ type: 'error', message: '预称重计划不可拖动至其他位置', duration: 2000 })
  1825. return false
  1826. }
  1827. }
  1828. } else {
  1829. if (targetRow2.pid !== targetRow.pid) {
  1830. that.$nextTick(() => {
  1831. that.$set(that.table, 'list', tableList)
  1832. })
  1833. that.$message({ type: 'error', message: '预称重计划不可拖动至其他位置', duration: 2000 })
  1834. return false
  1835. } else {
  1836. if (targetRow2.pid !== targetRow.pid) {
  1837. that.$nextTick(() => {
  1838. that.$set(that.table, 'list', tableList)
  1839. })
  1840. that.$message({ type: 'error', message: '预称重计划不可拖动至撒料计划下方', duration: 2000 })
  1841. return false
  1842. }
  1843. }
  1844. }
  1845. } else {
  1846. if (targetRow2 == undefined) {
  1847. that.$nextTick(() => {
  1848. that.$set(that.table, 'list', tableList)
  1849. })
  1850. that.$message({ type: 'error', message: '预称重计划不可拖动至其他位置', duration: 2000 })
  1851. return false
  1852. } else if (targetRow3.pid !== targetRow.pid) {
  1853. that.$nextTick(() => {
  1854. that.$set(that.table, 'list', tableList)
  1855. })
  1856. that.$message({ type: 'error', message: '预称重计划不可拖动至其他位置', duration: 2000 })
  1857. return false
  1858. } else {
  1859. if (targetRow3.lpplantype == 0) {
  1860. that.$nextTick(() => {
  1861. that.$set(that.table, 'list', tableList)
  1862. })
  1863. that.$message({ type: 'error', message: '预称重计划不可拖动至撒料计划下方', duration: 2000 })
  1864. return false
  1865. }
  1866. }
  1867. }
  1868. if (targetRow2 !== undefined && targetRow3 !== undefined) {
  1869. if (targetRow2.pid !== targetRow.pid && targetRow3.pid !== targetRow.pid) {
  1870. that.$nextTick(() => {
  1871. that.$set(that.table, 'list', tableList)
  1872. })
  1873. that.$message({ type: 'error', message: '不可将其他计划拖动至预称重计划之间', duration: 2000 })
  1874. return false
  1875. } else if (targetRow3.pid == targetRow.pid && (targetRow3.lpplantype == 1 || targetRow3.lpplantype == 2)) {
  1876. that.$nextTick(() => {
  1877. that.$set(that.table, 'list', tableList)
  1878. })
  1879. that.$message({ type: 'error', message: '预称重计划不可拖动至其他位置', duration: 2000 })
  1880. return false
  1881. }
  1882. }
  1883. } else if (targetRow.lpplantype == 2) { // 拖动数据为撒料计划-撒料
  1884. if (targetRow2 == undefined) {
  1885. if (targetRow3.pid !== targetRow.pid) {
  1886. that.$nextTick(() => {
  1887. that.$set(that.table, 'list', tableList)
  1888. })
  1889. that.$message({ type: 'error', message: '撒料计划-撒料不可拖动至其他位置', duration: 2000 })
  1890. return false
  1891. }
  1892. } else {
  1893. if (targetRow2.lpplantype == 1 && (targetRow2.pid == targetRow.pid || targetRow2 == undefined)) {
  1894. // 拖动数据下方为撒料计划-混料时且pid相同,不可拖动,提示
  1895. that.$nextTick(() => {
  1896. that.$set(that.table, 'list', tableList)
  1897. })
  1898. that.$message({ type: 'error', message: '撒料计划-撒料不可拖动至撒料计划-混料上方', duration: 2000 })
  1899. return false
  1900. } else if (targetRow.lpplantype == 2 && (targetRow2.pid == targetRow.pid || targetRow3.pid == targetRow.pid || targetRow2 == undefined || targetRow3 == undefined)) {
  1901. console.log('正常拖动')
  1902. } else {
  1903. that.$nextTick(() => {
  1904. that.$set(that.table, 'list', tableList)
  1905. })
  1906. that.$message({ type: 'error', message: '撒料计划-撒料不可拖动至其他位置', duration: 2000 })
  1907. return false
  1908. }
  1909. }
  1910. if (targetRow2 !== undefined && targetRow3 !== undefined) {
  1911. if (targetRow2.pid == targetRow3.pid) {
  1912. that.$nextTick(() => {
  1913. that.$set(that.table, 'list', tableList)
  1914. })
  1915. that.$message({ type: 'error', message: '不可将其他计划拖动至预称重计划之间', duration: 2000 })
  1916. return false
  1917. }
  1918. }
  1919. } else if (targetRow.lpplantype == 0) { // 拖动数据为撒料计划
  1920. console.log('遍历有相同的pid,一起跟着拖动3')
  1921. var pidArr = [] // pid相同的值
  1922. var pidArr1 = [] //
  1923. var index // 索引
  1924. for (let i = 0; i < tableList.length; i++) {
  1925. if (tableList[i].pid == targetRow.pid) {
  1926. pidArr.push(tableList[i])
  1927. } else {
  1928. pidArr1.push(tableList[i])
  1929. }
  1930. }
  1931. if (pidArr.length > 0) {
  1932. // 找到对应上方pid 的ID
  1933. // 比如说id 580243 找到对应的索引
  1934. if (targetRow3 !== undefined) {
  1935. for (let i = 0; i < pidArr1.length; i++) {
  1936. if (pidArr1[i].id == targetRow3.id) {
  1937. index = i
  1938. }
  1939. }
  1940. } else {
  1941. for (let i = 0; i < pidArr1.length; i++) {
  1942. if (pidArr1[i].id == targetRow2.id) {
  1943. index = i - 1
  1944. }
  1945. }
  1946. }
  1947. pidArr1.splice(index + 1, 0, ...pidArr)
  1948. console.log(pidArr1)
  1949. that.$nextTick(() => {
  1950. that.table.list = pidArr1
  1951. })
  1952. }
  1953. if (targetRow2 !== undefined && targetRow3 !== undefined) {
  1954. if (targetRow2.pid == targetRow3.pid) {
  1955. that.$nextTick(() => {
  1956. that.$set(that.table, 'list', tableList)
  1957. })
  1958. that.$message({ type: 'error', message: '不可拖动至其他计划中间;', duration: 2000 })
  1959. return false
  1960. }
  1961. }
  1962. } else if (targetRow.lpplantype == 3 || targetRow.lpplantype == 4) {
  1963. if (targetRow2 !== undefined && targetRow3 !== undefined) {
  1964. if (targetRow2.pid == targetRow3.pid) {
  1965. if (targetRow2.lpplantype == 5 && targetRow3.lpplantype == 5) {
  1966. that.$nextTick(() => {
  1967. that.$set(that.table, 'list', tableList)
  1968. })
  1969. that.$message({ type: 'error', message: '不可拖动至预称重计划跟预称重计划之间', duration: 2000 })
  1970. return false
  1971. } else if (targetRow.pid == targetRow2.pid && targetRow.lpplantype == 3 && targetRow2.lpplantype == 3 || targetRow.pid == targetRow3.pid && targetRow.lpplantype == 3 && targetRow3.lpplantype == 3) {
  1972. console.log('剩料之间可以互相拖动')
  1973. console.log(tableList)
  1974. } else {
  1975. that.$nextTick(() => {
  1976. that.$set(that.table, 'list', tableList)
  1977. })
  1978. // 撒料计划0,
  1979. // 撒料计划-混料1
  1980. // 撒料计划-撒料2
  1981. // 剩料计划3
  1982. // 预混计划4
  1983. // 预称重计划5
  1984. if (targetRow3.lpplantype == 0) {
  1985. that.$set(targetRow3, 'mylpplantype', '撒料计划')
  1986. } else if (targetRow3.lpplantype == 1) {
  1987. that.$set(targetRow3, 'mylpplantype', '撒料计划-混料')
  1988. } else if (targetRow3.lpplantype == 2) {
  1989. that.$set(targetRow3, 'mylpplantype', '撒料计划-撒料')
  1990. } else if (targetRow3.lpplantype == 3) {
  1991. that.$set(targetRow3, 'mylpplantype', '剩料计划')
  1992. } else if (targetRow3.lpplantype == 4) {
  1993. that.$set(targetRow3, 'mylpplantype', '预混计划')
  1994. } else if (targetRow3.lpplantype == 5) {
  1995. that.$set(targetRow3, 'mylpplantype', '预称重计划')
  1996. }
  1997. if (targetRow2.lpplantype == 0) {
  1998. that.$set(targetRow2, 'mylpplantype', '撒料计划')
  1999. } else if (targetRow2.lpplantype == 1) {
  2000. that.$set(targetRow2, 'mylpplantype', '撒料计划-混料')
  2001. } else if (targetRow2.lpplantype == 2) {
  2002. that.$set(targetRow2, 'mylpplantype', '撒料计划-撒料')
  2003. } else if (targetRow2.lpplantype == 3) {
  2004. that.$set(targetRow2, 'mylpplantype', '剩料计划')
  2005. } else if (targetRow2.lpplantype == 4) {
  2006. that.$set(targetRow2, 'mylpplantype', '预混计划')
  2007. } else if (targetRow2.lpplantype == 5) {
  2008. that.$set(targetRow2, 'mylpplantype', '预称重计划')
  2009. }
  2010. var message = '不可拖动至' + targetRow3.mylpplantype + '跟' + targetRow2.mylpplantype + '之间'
  2011. that.$message({ type: 'error', message: message, duration: 2000 })
  2012. return false
  2013. }
  2014. }
  2015. }
  2016. // ========
  2017. // var pidArr = [] // pid相同的值
  2018. // var pidArr1 = [] //
  2019. // var index // 索引
  2020. // for (let i = 0; i < tableList.length; i++) {
  2021. // if (tableList[i].pid == targetRow.pid) {
  2022. // pidArr.push(tableList[i])
  2023. // } else {
  2024. // pidArr1.push(tableList[i])
  2025. // }
  2026. // }
  2027. // if (pidArr.length > 0) {
  2028. // // 找到对应上方pid 的ID
  2029. // // 比如说id 580243 找到对应的索引
  2030. // if (targetRow3 !== undefined) {
  2031. // for (let i = 0; i < pidArr1.length; i++) {
  2032. // if (pidArr1[i].id == targetRow3.id) {
  2033. // index = i
  2034. // }
  2035. // }
  2036. // } else {
  2037. // for (let i = 0; i < pidArr1.length; i++) {
  2038. // if (pidArr1[i].id == targetRow2.id) {
  2039. // index = i - 1
  2040. // }
  2041. // }
  2042. // }
  2043. // pidArr1.splice(index + 1, 0, ...pidArr)
  2044. // console.log(pidArr1)
  2045. // that.$nextTick(() => {
  2046. // that.table.list = pidArr1
  2047. // })
  2048. // }
  2049. // if (targetRow2 !== undefined && targetRow3 !== undefined) {
  2050. // if (targetRow2.pid == targetRow3.pid) {
  2051. // that.$nextTick(() => {
  2052. // that.$set(that.table, 'list', tableList)
  2053. // })
  2054. // that.$message({ type: 'error', message: '不可将其他计划拖动至预称重计划之间9999', duration: 2000 })
  2055. // return false
  2056. // }
  2057. // }
  2058. }
  2059. // ===
  2060. }
  2061. })
  2062. },
  2063. // 复制
  2064. handleCopy() {
  2065. if (this.table.list.length > 0) {
  2066. this.newGeneration.temp = {}
  2067. this.newGeneration.dialogStatus = 'copy'
  2068. this.newGeneration.dialogFormVisible = true
  2069. } else {
  2070. this.$message({ type: 'error', message: '当前无计划可复制' })
  2071. }
  2072. },
  2073. copyData() {
  2074. console.log(this.newGeneration.temp.copyInputDatetime)
  2075. this.isokDisable = true
  2076. setTimeout(() => {
  2077. this.isokDisable = false
  2078. }, 5000)
  2079. this.$refs['temp'].validate(valid => {
  2080. if (valid) {
  2081. this.requestParam.name = 'copydownloadedplan'
  2082. this.requestParam.parammaps = {}
  2083. this.requestParam.parammaps.pastureid = Cookies.get('pastureid')
  2084. this.requestParam.parammaps.date = this.table.getdataListParm.parammaps.mydate
  2085. this.requestParam.parammaps.startTime = parseTime(this.newGeneration.temp.copyInputDatetime[0], '{y}-{m}-{d}')
  2086. this.requestParam.parammaps.stopTime = parseTime(this.newGeneration.temp.copyInputDatetime[1], '{y}-{m}-{d}')
  2087. PostDataByName(this.requestParam).then(response => {
  2088. if (response.msg === 'fail') {
  2089. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  2090. } else {
  2091. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  2092. this.newGeneration.dialogFormVisible = false
  2093. this.getList()
  2094. }
  2095. })
  2096. }
  2097. })
  2098. },
  2099. handleChangeOrder() {
  2100. // 拖动顺序
  2101. this.isOrder = false
  2102. this.rowDrop()
  2103. },
  2104. saveChangeOrder() {
  2105. // 保存顺序
  2106. var sortList = []
  2107. for (let i = 0; i < this.table.list.length; i++) {
  2108. var obj = {}
  2109. obj.sort = i
  2110. obj.pastureid = this.table.list[i].pastureid
  2111. obj.id = this.table.list[i].id
  2112. sortList.push(obj)
  2113. }
  2114. console.log(sortList)
  2115. this.requestParam = {}
  2116. this.requestParam.common = { 'returnmap': '0' }
  2117. this.requestParam.data = []
  2118. this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': sortList }}
  2119. this.requestParam.data[0].children = []
  2120. this.requestParam.data[0].children[0] = { 'name': 'updatedownloadesort', 'type': 'e', 'parammaps': {
  2121. id: '@insertSpotList.id',
  2122. pastureid: '@insertSpotList.pastureid',
  2123. sort: '@insertSpotList.sort'
  2124. }}
  2125. ExecDataByConfig(this.requestParam).then(response => {
  2126. console.log('顺序切换保存发送参数', this.requestParam)
  2127. if (response.msg === 'fail') {
  2128. this.$notify({ title: '顺序切换失败', message: response.data, type: 'warning', duration: 2000 })
  2129. } else {
  2130. this.$notify({ title: '', message: '顺序切换成功', type: 'success', duration: 2000 })
  2131. this.getList()
  2132. this.isOrder = true
  2133. }
  2134. })
  2135. },
  2136. cancelChangeOrder() {
  2137. // 取消顺序
  2138. this.getList()
  2139. this.isOrder = true
  2140. },
  2141. handleDataSynchronization() {
  2142. MessageBox.confirm('是否确认同步数据?', {
  2143. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  2144. }).then(() => {
  2145. this.requestParam = {}
  2146. this.requestParam.pastureid = Cookies.get('pastureid')
  2147. // this.$alert('正在同步', { confirmButtonText: '确定' })
  2148. this.dataSynchronization.dialogFormVisible = true
  2149. getDorm(this.requestParam).then(response => {
  2150. console.log(response)
  2151. if (response.msg == 'ok') {
  2152. this.dataSynchronization.dialogFormVisible = false
  2153. this.$notify({ title: '同步成功', message: '同步成功', type: 'success', duration: 2000 })
  2154. } else {
  2155. this.$notify({ title: '同步失败', message: response.data, type: 'warning', duration: 2000 })
  2156. this.dataSynchronization.dialogFormVisible = false
  2157. }
  2158. })
  2159. }).catch(() => {
  2160. this.$message({ type: 'info', message: '已取消数据同步' })
  2161. })
  2162. },
  2163. handleRowDelete(row) {
  2164. console.log('删除')
  2165. MessageBox.confirm('是否确认删除此信息?', {
  2166. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  2167. }).then(() => {
  2168. this.selectList = []
  2169. this.requestParam = {}
  2170. this.requestParam.name = 'delDownloadedplan'
  2171. this.requestParam.parammaps = {}
  2172. this.requestParam.parammaps.pastureid = row.pastureid
  2173. this.requestParam.parammaps.id = row.id
  2174. PostDataByName(this.requestParam).then(response => {
  2175. if (response.msg === 'fail') {
  2176. this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
  2177. } else {
  2178. this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
  2179. this.getList()
  2180. }
  2181. })
  2182. }).catch(() => {
  2183. this.$message({ type: 'info', message: '已取消删除' })
  2184. })
  2185. },
  2186. handleSpan() {
  2187. this.mergekeys.forEach(key => {
  2188. this.spanObj[key] = []
  2189. let position = 0
  2190. this.table2.list.forEach((item, index) => {
  2191. if (index === 0) {
  2192. this.spanObj[key].push(1)
  2193. position = 0
  2194. } else {
  2195. if (key == 'description') {
  2196. if (this.table2.list[index][key] === this.table2.list[index - 1][key] && this.table2.list[index]['sort'] === this.table2.list[index - 1]['sort']) {
  2197. this.spanObj[key][position] += 1
  2198. this.spanObj[key].push(0)
  2199. } else {
  2200. this.spanObj[key].push(1)
  2201. position = index
  2202. }
  2203. } else {
  2204. if (this.table2.list[index][key] === this.table2.list[index - 1][key]) {
  2205. this.spanObj[key][position] += 1
  2206. this.spanObj[key].push(0)
  2207. } else {
  2208. this.spanObj[key].push(1)
  2209. position = index
  2210. }
  2211. }
  2212. }
  2213. })
  2214. })
  2215. },
  2216. objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  2217. for (let i = 0; i < this.mergekeys.length; i++) {
  2218. if (column.property === this.mergekeys[i]) {
  2219. const _row = this.spanObj[this.mergekeys[i]][rowIndex]
  2220. const _col = _row > 0 ? 1 : 0
  2221. return {
  2222. rowspan: _row,
  2223. colspan: _col
  2224. }
  2225. }
  2226. }
  2227. },
  2228. handleDeleteRecord(){
  2229. this.deleteRecord.dialogStatus = 'deleteRecord'
  2230. this.deleteRecord.dialogFormVisible = true
  2231. this.deleteRecord.mydate = this.table.getdataListParm.parammaps.mydate
  2232. this.getDeleteRecordList()
  2233. },
  2234. changeDeleteRecordDate(){
  2235. this.getDeleteRecordList()
  2236. },
  2237. getDeleteRecordList(){
  2238. const url = 'authdata/GetDataByName'
  2239. const data = {}
  2240. data.name = 'getDownloadedplanDeleteList'
  2241. data.page = 1
  2242. data.offset = 1
  2243. data.pagecount = ""
  2244. data.returntype = "Map"
  2245. data.parammaps = {}
  2246. data.parammaps.pastureid = Cookies.get('pastureid')
  2247. data.parammaps.mydate = this.deleteRecord.mydate
  2248. postJson(url, data).then(response => {
  2249. if(response.data !== null){
  2250. this.deleteRecord.list = response.data.list
  2251. }else{
  2252. this.deleteRecord.list = []
  2253. }
  2254. this.deleteRecord.total = response.data.total
  2255. })
  2256. },
  2257. handleSelect(val) {
  2258. console.log('勾选数据', val)
  2259. this.selectList = val
  2260. },
  2261. handleTakeEffect() {
  2262. if (this.selectList.length == 0) {
  2263. this.$message({ type: 'error', message: '请选择车次信息', duration: 2000 })
  2264. } else {
  2265. MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否生效?', {
  2266. confirmButtonText: '确认',
  2267. cancelButtonText: '取消',
  2268. type: 'warning'
  2269. }).then(() => {
  2270. for (let i = 0; i < this.selectList.length; i++) {
  2271. // this.$set(this.selectList[i], 'enable', '1')
  2272. this.selectList[i].enable = 1
  2273. }
  2274. console.log('生效', this.selectList)
  2275. this.requestParam.common = {
  2276. 'returnmap': '0'
  2277. }
  2278. this.requestParam.data = []
  2279. this.requestParam.data[0] = {
  2280. 'name': 'insertSpotList',
  2281. 'resultmaps': {
  2282. 'list': this.selectList
  2283. }
  2284. }
  2285. this.requestParam.data[0].children = []
  2286. this.requestParam.data[0].children[0] = {
  2287. 'name': 'updateDownloadedplanEnable',
  2288. 'type': 'e',
  2289. 'parammaps': {
  2290. enable: '@insertSpotList.enable',
  2291. id: '@insertSpotList.id',
  2292. pastureid: '@insertSpotList.pastureid'
  2293. }
  2294. }
  2295. ExecDataByConfig(this.requestParam).then(response => {
  2296. console.log('生效保存发送参数', this.requestParam)
  2297. if (response.msg === 'fail') {
  2298. this.$notify({ title: '生效失败', message: response.data, type: 'warning', duration: 2000 })
  2299. } else {
  2300. this.$notify({ title: '成功', message: '生效成功', type: 'success', duration: 2000 })
  2301. this.getList()
  2302. }
  2303. })
  2304. })
  2305. }
  2306. },
  2307. handleDisable() {
  2308. if (this.selectList.length == 0) {
  2309. this.$message({type: 'error', message: '请选择车次信息', duration: 2000 })
  2310. } else {
  2311. MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否禁用?', {
  2312. confirmButtonText: '确认',
  2313. cancelButtonText: '取消',
  2314. type: 'warning'
  2315. }).then(() => {
  2316. for (let i = 0; i < this.selectList.length; i++) {
  2317. // this.$set(this.selectList[i], 'enable', '1')
  2318. this.selectList[i].enable = 0
  2319. }
  2320. console.log('禁用', this.selectList)
  2321. this.requestParam.common = {
  2322. 'returnmap': '0'
  2323. }
  2324. this.requestParam.data = []
  2325. this.requestParam.data[0] = {
  2326. 'name': 'insertSpotList',
  2327. 'resultmaps': {
  2328. 'list': this.selectList
  2329. }
  2330. }
  2331. this.requestParam.data[0].children = []
  2332. this.requestParam.data[0].children[0] = {
  2333. 'name': 'updateDownloadedplanEnable',
  2334. 'type': 'e',
  2335. 'parammaps': {
  2336. enable: '@insertSpotList.enable',
  2337. id: '@insertSpotList.id',
  2338. pastureid: '@insertSpotList.pastureid'
  2339. }
  2340. }
  2341. ExecDataByConfig(this.requestParam).then(response => {
  2342. console.log('禁用保存发送参数', this.requestParam)
  2343. if (response.msg === 'fail') {
  2344. this.$notify({ title: '禁用失败', message: response.data, type: 'warning', duration: 2000 })
  2345. } else {
  2346. this.$notify({ title: '成功', message: '禁用成功', type: 'success', duration: 2000 })
  2347. this.getList()
  2348. }
  2349. })
  2350. })
  2351. }
  2352. },
  2353. handlePrint() {
  2354. this.downLoad.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  2355. this.downLoad.getdataListParm.parammaps.lpplantype = this.table.getdataListParm.parammaps.lpplantype
  2356. this.downLoad.getdataListParm.parammaps.times = this.table.getdataListParm.parammaps.times
  2357. this.downLoad.getdataListParm.parammaps.enable = this.table.getdataListParm.parammaps.enable
  2358. this.downLoad.getdataListParm.parammaps.enable2 = this.table.getdataListParm.parammaps.enable2
  2359. var exportTitle = ''
  2360. if (this.table.getdataListParm.parammaps.plandimen == '1') {
  2361. if (this.table.getdataListParm.parammaps.enable3 == '0') {
  2362. this.downLoad.getdataListParm.name = 'downloadPlanTLJDTMR'
  2363. exportTitle = this.table.getdataListParm.parammaps.mydate + '投料简打'
  2364. } else if (this.table.getdataListParm.parammaps.enable3 == '1') {
  2365. this.downLoad.getdataListParm.name = 'downloadPlanTLLDTMR'
  2366. exportTitle = this.table.getdataListParm.parammaps.mydate + '累加投料'
  2367. } else if (this.table.getdataListParm.parammaps.enable3 == '2') {
  2368. this.downLoad.getdataListParm.name = 'downloadPlanSLJDTMR'
  2369. exportTitle = this.table.getdataListParm.parammaps.mydate + '撒料简打'
  2370. } else if (this.table.getdataListParm.parammaps.enable3 == '3') {
  2371. this.downLoad.getdataListParm.name = 'downloadPlanTSLJDTMR'
  2372. exportTitle = this.table.getdataListParm.parammaps.mydate + '投撒料简打'
  2373. } else if (this.table.getdataListParm.parammaps.enable3 == '4') {
  2374. this.downLoad.getdataListParm.name = 'downloadPlanTSLLDTMR'
  2375. exportTitle = this.table.getdataListParm.parammaps.mydate + '投撒料累加'
  2376. } else if (this.table.getdataListParm.parammaps.enable3 == '5') {
  2377. this.downLoad.getdataListParm.name = 'downloadPlanBZJDTMR'
  2378. exportTitle = this.table.getdataListParm.parammaps.mydate + '包装简打'
  2379. } else {
  2380. this.downLoad.getdataListParm.name = 'downloadPlanSFJDTMR'
  2381. exportTitle = this.table.getdataListParm.parammaps.mydate + '实发简打'
  2382. }
  2383. } else {
  2384. if (this.table.getdataListParm.parammaps.enable3 == '0') {
  2385. this.downLoad.getdataListParm.name = 'downloadPlanTLJD'
  2386. exportTitle = this.table.getdataListParm.parammaps.mydate + '投料简打'
  2387. } else if (this.table.getdataListParm.parammaps.enable3 == '1') {
  2388. this.downLoad.getdataListParm.name = 'downloadPlanTLLD'
  2389. exportTitle = this.table.getdataListParm.parammaps.mydate + '累加投料'
  2390. } else if (this.table.getdataListParm.parammaps.enable3 == '2') {
  2391. this.downLoad.getdataListParm.name = 'downloadPlanSLJD'
  2392. exportTitle = this.table.getdataListParm.parammaps.mydate + '撒料简打'
  2393. } else if (this.table.getdataListParm.parammaps.enable3 == '3') {
  2394. this.downLoad.getdataListParm.name = 'downloadPlanTSLJD'
  2395. exportTitle = this.table.getdataListParm.parammaps.mydate + '投撒料简打'
  2396. } else if (this.table.getdataListParm.parammaps.enable3 == '4') {
  2397. this.downLoad.getdataListParm.name = 'downloadPlanTSLLD'
  2398. exportTitle = this.table.getdataListParm.parammaps.mydate + '投撒料累加'
  2399. } else if (this.table.getdataListParm.parammaps.enable3 == '5') {
  2400. this.downLoad.getdataListParm.name = 'downloadPlanBZJD'
  2401. exportTitle = this.table.getdataListParm.parammaps.mydate + '包装简打'
  2402. } else {
  2403. this.downLoad.getdataListParm.name = 'downloadPlanSFJD'
  2404. exportTitle = this.table.getdataListParm.parammaps.mydate + '实发简打'
  2405. }
  2406. }
  2407. GetReportform(this.downLoad.getdataListParm).then(response => {
  2408. if (response.data.list !== null) {
  2409. this.downLoad.labelList = []
  2410. var filterValArr = []
  2411. for (let i = 0; i < response.data.list.data1.length; i++) {
  2412. this.downLoad.labelList.push(response.data.list.data1[i].label)
  2413. filterValArr.push(response.data.list.data1[i].prop)
  2414. }
  2415. this.downLoad.list = response.data.list.data2
  2416. } else {
  2417. this.downLoad.list = []
  2418. }
  2419. let data = []
  2420. for(let i=0;i<filterValArr.length;i++){
  2421. let obj = {}
  2422. obj.field = filterValArr[i]
  2423. obj.columnSize = i
  2424. for(let j=i;j<this.downLoad.labelList.length;j++){
  2425. obj.displayName = this.downLoad.labelList[i]
  2426. }
  2427. if(obj.field !== undefined && obj.displayName !== undefined){
  2428. data.push(obj)
  2429. }
  2430. for(let i=0;i<this.downLoad.list.length;i++){
  2431. if(this.downLoad.list[i][obj.displayName] == null || this.downLoad.list[i][obj.displayName] == undefined){
  2432. this.downLoad.list[i][obj.displayName] = ''
  2433. }
  2434. }
  2435. }
  2436. console.log(this.downLoad.list)
  2437. printJS({
  2438. printable:this.downLoad.list,
  2439. properties:data,
  2440. type:'json',
  2441. header:exportTitle,
  2442. //样式设置
  2443. gridStyle:'border:1px solid #ccc;',
  2444. gridHeaderStyle:'border:1px solid #ccc;text-align:center'
  2445. })
  2446. })
  2447. },
  2448. }
  2449. }
  2450. </script>
  2451. <style>
  2452. .el-table .warning-row {
  2453. background: oldlace;
  2454. }
  2455. .el-table .success-row {
  2456. background: #f0f9eb;
  2457. }
  2458. @page{
  2459. size: auto A4 landscape;
  2460. margin: 3mm;
  2461. }
  2462. .agreeCon {
  2463. background: #fff;
  2464. box-sizing: border-box;
  2465. padding: 2rem 3rem 4rem;
  2466. }
  2467. </style>
  2468. <style lang="scss" scoped>
  2469. .app-container{background: #fff;}
  2470. .operation{}
  2471. .search{margin-top:10px;}
  2472. .table{margin-bottom:20px;}
  2473. .template{
  2474. background: #fff;
  2475. position: relative;
  2476. }
  2477. .table2{
  2478. // float: left;width: 50%;
  2479. background: #fff;
  2480. position: relative;
  2481. .content-table{margin-top: 20px;}
  2482. .contentOperation{right: -50px;z-index: 1;}
  2483. }
  2484. .table3{
  2485. // float: left;width: 50%;
  2486. background: #fff;
  2487. position: relative;
  2488. .content-table{margin-top: 20px;}
  2489. .contentOperation{right: -50px;z-index: 1;}
  2490. }
  2491. </style>