index.vue 134 KB

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