index.vue 147 KB

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