| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066 |
- <template>
- <div class="app-container">
- <!-- 配方模板表 -->
- <div ref="template" class="template">
- <div class="recipeTemplate">
- <p>{{ $t('dailyExecutionPlan.title') }}</p>
- </div>
- <div class="search">
- <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"
- />
- <el-button
- class="el-icon-arrow-left elIconArrowLeft"
- @click="handleBefore"
- />
- <el-button
- class="el-icon-arrow-right elIconArrowRight"
- @click="handleNext"
- />
- <el-select
- v-model="table.getdataListParm.parammaps.lpplantype"
- filterable
- :placeholder="$t('processAnalysis.planType')"
- class="filter-item"
- clearable
- style="width: 120px"
- @change="changePlanType"
- >
- <el-option
- v-for="item in planTypeList"
- :key="item.value"
- :label="item.lable"
- :value="item.value"
- />
- </el-select>
- <el-select
- v-model="table.getdataListParm.parammaps.times"
- filterable
- :placeholder="$t('premixedPlan.bc')"
- class="filter-item"
- style="width: 120px"
- clearable
- @change="changeFrequency"
- >
- <el-option
- v-for="item in frequencyList"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- />
- </el-select>
- <el-select
- v-model="table.getdataListParm.parammaps.printType"
- filterable
- :placeholder="$t('dailyExecutionPlan.dylx')"
- class="filter-item"
- :clearable="false"
- style="width: 120px"
- >
- <el-option
- v-for="item in printingTypeList"
- :key="item.value"
- :label="item.lable"
- :value="item.value"
- />
- </el-select>
- <el-select
- v-model="table.getdataListParm.parammaps.plandimen"
- filterable
- :placeholder="$t('dailyExecutionPlan.jhwd')"
- class="filter-item"
- style="width: 120px"
- :clearable="false"
- >
- <el-option
- v-for="item in planningDimensionList"
- :key="item.value"
- :label="item.lable"
- :value="item.value"
- />
- </el-select>
- <el-select
- v-model="table.getdataListParm.parammaps.enable3"
- filterable
- :placeholder="$t('dailyExecutionPlan.dclx')"
- class="filter-item"
- style="width: 120px"
- :clearable="false"
- >
- <el-option
- v-for="item in exportTypeList"
- :key="item.value"
- :label="item.lable"
- :value="item.value"
- />
- </el-select>
- <el-select
- v-model="table.getdataListParm.parammaps.tmrname"
- filterable
- :placeholder="$t('processAnalysis.tmrName')"
- class="filter-item"
- style="width: 120px"
- :clearable="false"
- >
- <el-option
- v-for="item in tmrDownList"
- :key="item.tmrname"
- :label="item.tmrname"
- :value="item.tmrtname"
- />
- </el-select>
- <el-select
- v-model="table.getdataListParm.parammaps.iscompleted"
- filterable
- :placeholder="$t('dailyExecutionPlan.zxzt')"
- class="filter-item"
- style="width: 120px"
- :clearable="false"
- >
- <el-option
- v-for="item in iscompletedList"
- :key="item.value"
- :label="item.lable"
- :value="item.value"
- />
- </el-select>
- <el-button class="successBorder" @click="form_search">{{
- $t('common.query')
- }}</el-button>
- <el-button
- class="export"
- icon="el-icon-upload2"
- @click="handleExport"
- >{{ $t('formulationEvaluation.out') }}</el-button
- >
- <el-button class="export" icon="el-icon-upload2" @click="handlePrint">{{
- $t('dailyExecutionPlan.dy')
- }}</el-button>
- <el-button
- class="export"
- style="margin-left: -5px"
- @click="form_deleteRecord"
- >{{ $t('dailyExecutionPlan.scjl') }}</el-button
- >
- </div>
- <div class="operation" style="margin-bottom: 26px">
- <el-button
- v-if="isRoleEdit"
- class="success"
- icon="el-icon-plus"
- @click="handleCreate"
- >{{ $t('dailyExecutionPlan.xsc') }}</el-button
- >
- <el-button
- v-if="isRoleEdit"
- class="success"
- icon="el-icon-edit-outline"
- @click="handleRevisePlan"
- >{{ $t('dailyExecutionPlan.xgjh') }}</el-button
- >
- <el-button
- v-if="isRoleEdit"
- class="copy"
- icon="el-icon-copy-document"
- @click="handleCopy"
- >{{ $t('dailyExecutionPlan.fzjh') }}</el-button
- >
- <el-button
- v-if="isOrder && isRoleEdit"
- icon="el-icon-sort"
- class="success"
- @click="handleChangeOrder"
- >{{ $t('formulationEvaluation.ggsx') }}</el-button
- >
- <div v-else style="margin-left: 10px; display: inline-block">
- <el-button
- v-if="isRoleEdit"
- icon="el-icon-folder-checked"
- class="success"
- @click="saveChangeOrder"
- >{{ $t('formulationEvaluation.save') }}</el-button
- >
- <el-button
- v-if="isRoleEdit"
- icon="el-icon-close"
- class="sortCancel"
- @click="cancelChangeOrder"
- >{{ $t('formulationEvaluation.cancel') }}</el-button
- >
- </div>
- <el-button
- v-if="isRoleEdit"
- class="success"
- icon="el-icon-open"
- @click="handleTakeEffect"
- >{{ $t('premixedPlan.sx') }}</el-button
- >
- <el-button
- v-if="isRoleEdit"
- class="danger"
- icon="el-icon-turn-off"
- @click="handleDisable"
- >{{ $t('premixedPlan.jy') }}</el-button
- >
- <el-button
- v-if="dataSynchronization2.isDataSynchronization"
- class="success"
- icon="el-icon-plus"
- @click="form_updata"
- >{{ $t('dailyExecutionPlan.scjh') }}</el-button
- >
- <el-button
- v-if="dataSynchronization.isDataSynchronization && isRoleEdit"
- class="success"
- @click="handleDataSynchronization"
- >{{ $t('dailyExecutionPlan.sjtb') }}</el-button
- >
- <el-button
- v-if="dataSynchronization3.isDataSynchronization && isRoleEdit"
- class="success"
- @click="handleDataUpload"
- >{{ $t('dailyExecutionPlan.sjsc') }}</el-button
- >
- <el-button
- v-if="isRoleEdit"
- class="danger"
- icon="el-icon-delete"
- @click="handleDelete"
- >{{ $t('formulationEvaluation.del') }}</el-button
- >
- <el-button
- v-if="isRoleEdit && sapUpload.isSap"
- class="success"
- icon="el-icon-upload2"
- @click="handleSAPUpload"
- >{{ $t('dailyExecutionPlan.spasc') }}</el-button
- >
- <el-button
- v-if="isRoleEdit && ispalyUd"
- class="success"
- icon="el-icon-plus"
- @click="handleGetUd1"
- >{{ $t('dailyExecutionPlan.jbsjsc') }}</el-button
- >
- <el-button
- v-if="isRoleEdit && ispalyUd"
- class="success"
- icon="el-icon-plus"
- @click="handleGetUd2"
- >{{ $t('dailyExecutionPlan.slsc') }}</el-button
- >
- <el-button
- v-if="isRoleEdit && ispalyUd"
- class="success"
- icon="el-icon-plus"
- @click="handleGetUd3"
- >{{ $t('dailyExecutionPlan.salsc') }}</el-button
- >
- <el-button
- v-if="isRoleEdit"
- class="success"
- icon="el-icon-circle-check"
- @click="handleQuickcompletion"
- >{{ $t('dailyExecutionPlan.kswc') }}</el-button
- >
- </div>
- <!-- 日执行计划 -->
- <div class="table">
- <el-table
- id="table1"
- ref="parent"
- :key="table.tableKey"
- v-loading="table.listLoading"
- :element-loading-text="$t('common.tableMsg')"
- :data="table.list"
- border
- fit
- highlight-current-row
- style="width: 98%"
- row-key="id"
- :row-style="rowStyle1"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- :row-class-name="tableRowClassName"
- :height="myheight"
- @row-click="tableRowClick"
- @selection-change="handleSelect"
- >
- <el-table-column type="selection" min-width="50" />
- <el-table-column
- :label="$t('formulationEvaluation.xh')"
- align="center"
- prop="sort"
- width="50px"
- />
- <el-table-column
- :label="$t('dailyExecutionPlan.jhmc')"
- min-width="90px"
- align="center"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.projname }}</span>
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('dailyExecutionPlan.jhlx')"
- prop="weight"
- min-width="90px"
- align="center"
- :formatter="lpplantype"
- />
- <el-table-column
- :label="$t('premixedPlan.tmrbh')"
- min-width="90px"
- align="center"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.tmrtname }}</span>
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('errorAnalysis.Driver')"
- min-width="150px"
- align="center"
- >
- <template slot-scope="scope">
- <!-- <span>{{ scope.row.driver }}</span> -->
- <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)
- }
- "
- >
- <el-option
- v-for="item in driverList"
- :key="item.id"
- :label="item.drivername"
- :value="item.id"
- />
- </el-select>
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('dailyExecutionPlan.yzx')"
- min-width="70px"
- align="center"
- >
- <template slot-scope="scope">
- <div
- v-if="scope.row.havebutton == 0"
- style="background: #009a69; color: #fff; line-height: 30px"
- >
- {{ $t('feedChart.no') }}
- </div>
- <div
- v-else
- style="background: #fc2323; color: #000; line-height: 30px"
- >
- {{ $t('feedChart.yes') }}
- </div>
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('errorAnalysis.isTrainNumber')"
- min-width="80px"
- align="center"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.times }}</span>
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('dailyExecutionPlan.lhl')"
- min-width="80px"
- align="center"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.lweight }}</span>
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('dailyExecutionPlan.qy')"
- min-width="70px"
- align="center"
- >
- <template slot-scope="scope">
- <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)"
- />
- <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)"
- />
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('premixedPlan.time')"
- min-width="80px"
- align="center"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.plantime }}</span>
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('errorAnalysis.feedName')"
- min-width="100px"
- align="center"
- >
- <template slot-scope="scope">
- <b style="font-size: 26px; line-height: 30px">{{
- scope.row.ftname
- }}</b>
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('formulationEvaluation.nts')"
- min-width="80px"
- align="center"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.cowcount }}</span>
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('premixedPlan.ms')"
- min-width="80px"
- align="center"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.display }}</span>
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('dailyExecutionPlan.flw')"
- min-width="80px"
- align="left"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.barnames }}</span>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- width="100"
- :label="$t('errorAnalysis.cz')"
- class-name="small-padding fixed-width"
- fixed="right"
- >
- <template slot-scope="{ row }">
- <el-button
- class="miniDanger"
- icon="el-icon-delete"
- @click="handleRowDelete(row)"
- />
- <el-button
- class="miniDanger"
- icon="el-icon-sort"
- @click="handleRowSort(row)"
- />
- </template>
- </el-table-column>
- </el-table>
- <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
- >
- </div>
- </div>
- <!-- maxHeight="enlargeHeight -->
- <div v-if="isDetail" style="position: relative">
- <el-button
- class="hide"
- @click="handleCloseTable2"
- style="position: absolute; right: 0; top: -20px"
- >{{ $t('formulationEvaluation.hide') }}</el-button
- >
- <!-- 预混料 -->
- <div
- v-if="table3.getdataListParm.parammaps.lpplantype == 4"
- class="content"
- >
- <el-row :gutter="20">
- <el-col :span="12">
- <div class="table2">
- <div class="contentOperation">
- <p>{{ $t('dailyExecutionPlan.jhxq') }}</p>
- </div>
- <div class="content-table">
- <el-table
- :key="table2.tableKey"
- v-loading="table2.listLoading"
- :element-loading-text="$t('common.tableMsg')"
- :data="table2.list"
- fit
- border
- highlight-current-row
- style="width: 100%"
- height="450"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- :span-method="objectSpanMethod"
- >
- <el-table-column
- :label="$t('dailyExecutionPlan.czxh')"
- width="90px"
- align="center"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.sort }}</span>
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('InventoryManagement.silc')"
- prop="fname"
- min-width="90px"
- align="center"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.fname }}</span>
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('dailyExecutionPlan.sjzl')"
- prop="weight"
- min-width="130px"
- align="center"
- >
- <template slot-scope="scope">
- <span v-if="scope.row.NoEdit">{{
- scope.row.weight
- }}</span>
- <el-input
- v-if="scope.row.Edit"
- v-model="scope.row.weight"
- type="number"
- maxlength="32"
- style="width: 95%; padding: 10px 0"
- />
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('dailyExecutionPlan.xj')"
- prop="description"
- min-width="90px"
- align="center"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.subtotal }}</span>
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('errorAnalysis.cz')"
- align="left"
- min-width="200"
- class-name="small-padding"
- >
- <template slot-scope="{ row }">
- <el-button
- v-if="row.isUpdate && isRoleEdit"
- :disabled="
- table2.getdataListParm.parammaps.havebutton == 1
- "
- class="miniSuccess"
- icon="el-icon-edit-outline"
- @click="handleUpdate2(row)"
- />
- <span v-if="row.isUpdate && isRoleEdit" class="centerSpan"
- >|</span
- >
- <el-button
- v-if="row.isUpdateSave"
- :disabled="isokDisable"
- icon="el-icon-folder-checked"
- class="miniSuccess"
- @click="updateData2(row, '0')"
- />
- <span v-if="row.isUpdateSave" class="centerSpan">|</span>
- <el-button
- v-if="row.isUpdateSave"
- class="minCancel"
- icon="el-icon-close"
- @click="updateCancel2(row)"
- />
- <span v-if="row.isUpdate && isRoleEdit" class="centerSpan"
- >|</span
- >
- <el-button
- v-if="row.isUpdate && isRoleEdit"
- class="miniSuccess"
- @click="handleRowEmpty(row, 0)"
- >
- <svg-icon icon-class="clear" />
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- </el-col>
- </el-row>
- </div>
- <!-- 撒料 -->
- <div
- v-if="table3.getdataListParm.parammaps.lpplantype == 0"
- class="content"
- >
- <el-row :gutter="20">
- <el-col :span="12">
- <div class="table2">
- <div class="contentOperation">
- <p>{{ $t('dailyExecutionPlan.jhxq') }}</p>
- </div>
- <div class="content-table">
- <el-table
- :key="table2.tableKey"
- v-loading="table2.listLoading"
- :element-loading-text="$t('common.tableMsg')"
- :data="table2.list"
- fit
- border
- highlight-current-row
- style="width: 100%"
- height="450"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- :span-method="objectSpanMethod"
- >
- <el-table-column
- :label="$t('dailyExecutionPlan.czxh')"
- min-width="90px"
- align="center"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.sort }}</span>
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('InventoryManagement.silc')"
- prop="fname"
- min-width="90px"
- align="center"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.fname }}</span>
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('dailyExecutionPlan.sjzl')"
- prop="weight"
- min-width="130px"
- align="center"
- >
- <template slot-scope="scope">
- <span v-if="scope.row.NoEdit">{{
- scope.row.weight
- }}</span>
- <el-input
- v-if="scope.row.Edit"
- v-model="scope.row.weight"
- type="number"
- maxlength="32"
- style="width: 95%; padding: 10px 0"
- />
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('dailyExecutionPlan.xj')"
- prop="description"
- min-width="90px"
- align="center"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.subtotal }}</span>
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('errorAnalysis.cz')"
- align="left"
- min-width="200"
- class-name="small-padding"
- >
- <template slot-scope="{ row }">
- <el-button
- v-if="row.isUpdate && isRoleEdit"
- :disabled="
- table2.getdataListParm.parammaps.havebutton == 1
- "
- class="miniSuccess"
- icon="el-icon-edit-outline"
- @click="handleUpdate2(row)"
- />
- <el-button
- v-if="row.isUpdateSave"
- :disabled="isokDisable"
- icon="el-icon-folder-checked"
- class="miniSuccess"
- @click="updateData2(row, '0')"
- />
- <span v-if="row.isUpdateSave" class="centerSpan">|</span>
- <el-button
- v-if="row.isUpdateSave"
- class="minCancel"
- icon="el-icon-close"
- @click="updateCancel2(row)"
- />
- <span v-if="row.isUpdate && isRoleEdit" class="centerSpan"
- >|</span
- >
- <el-button
- v-if="row.isUpdate && isRoleEdit"
- class="miniSuccess"
- @click="handleRowEmpty(row, 0)"
- >
- <svg-icon icon-class="clear" />
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- </el-col>
- <el-col :span="12">
- <div class="table3">
- <div class="contentOperation">
- <p>{{ $t('dailyExecutionPlan.lsxq') }}</p>
- </div>
- <div class="content-table">
- <el-table
- :key="table3.tableKey"
- v-loading="table3.listLoading"
- :element-loading-text="$t('common.tableMsg')"
- :data="table3.list"
- height="450"
- fit
- border
- highlight-current-row
- style="width: 100%"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- >
- <el-table-column
- :label="$t('dailyExecutionPlan.czxh')"
- min-width="90px"
- align="center"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.sort }}</span>
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('errorAnalysis.pen')"
- min-width="90px"
- align="center"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.fname }}</span>
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('dailyExecutionPlan.sjzl')"
- prop="weight"
- min-width="130px"
- align="center"
- >
- <template slot-scope="scope">
- <span v-if="scope.row.NoEdit">{{
- scope.row.weight
- }}</span>
- <el-input
- v-if="scope.row.Edit"
- v-model="scope.row.weight"
- type="number"
- maxlength="32"
- style="width: 95%; padding: 10px 0"
- />
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('errorAnalysis.cz')"
- align="left"
- min-width="200"
- class-name="small-padding"
- >
- <template slot-scope="{ row }">
- <el-button
- v-if="row.isUpdate && isRoleEdit"
- :disabled="
- table3.getdataListParm.parammaps.havebutton == 1
- "
- class="miniSuccess"
- icon="el-icon-edit-outline"
- @click="handleUpdate3(row)"
- />
- <el-button
- v-if="row.isUpdateSave"
- :disabled="isokDisable"
- icon="el-icon-folder-checked"
- class="miniSuccess"
- @click="updateData3(row, '1')"
- />
- <span v-if="row.isUpdateSave" class="centerSpan">|</span>
- <el-button
- v-if="row.isUpdateSave"
- class="minCancel"
- icon="el-icon-close"
- @click="updateCancel3(row)"
- />
- <span v-if="row.isUpdate && isRoleEdit" class="centerSpan"
- >|</span
- >
- <el-button
- v-if="row.isUpdate && isRoleEdit"
- class="miniSuccess"
- @click="handleRowEmpty(row, 1)"
- >
- <svg-icon icon-class="clear" />
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- </el-col>
- </el-row>
- </div>
- <!-- 剩料 -->
- <div
- v-if="table3.getdataListParm.parammaps.lpplantype == 3"
- class="content"
- >
- <el-row :gutter="20">
- <el-col :span="12"
- ><div class="table2">
- <div class="contentOperation">
- <p>{{ $t('dailyExecutionPlan.jhxq') }}</p>
- </div>
- <div class="content-table">
- <el-table
- :key="table2.tableKey"
- v-loading="table2.listLoading"
- :element-loading-text="$t('common.tableMsg')"
- :data="table2.list"
- fit
- border
- highlight-current-row
- style="width: 100%"
- height="450"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- :span-method="objectSpanMethod"
- >
- <el-table-column
- :label="$t('dailyExecutionPlan.czxh')"
- min-width="130px"
- align="center"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.sort }}</span>
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('dailyExecutionPlan.qlls')"
- prop="fname"
- min-width="130px"
- align="center"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.fname }}</span>
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('message.msg311')"
- prop="useinbar"
- min-width="130px"
- align="center"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.useinbar }}</span>
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('dailyExecutionPlan.xj')"
- prop="description"
- min-width="130px"
- align="center"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.subtotal }}</span>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- </el-col>
- <el-col :span="12">
- <div class="table3">
- <div class="contentOperation">
- <p>{{ $t('dailyExecutionPlan.lsxq') }}</p>
- </div>
- <div class="content-table">
- <el-table
- :key="table3.tableKey"
- v-loading="table3.listLoading"
- :element-loading-text="$t('common.tableMsg')"
- :data="table3.list"
- height="450"
- fit
- border
- highlight-current-row
- style="width: 100%"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- >
- <el-table-column
- :label="$t('dailyExecutionPlan.czxh')"
- min-width="130px"
- align="center"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.sort }}</span>
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('premixedPlan.ztls')"
- min-width="130px"
- align="center"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.fname }}</span>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- </el-col>
- </el-row>
- </div>
- <!-- 撒料计划-混料 -->
- <div
- v-if="
- table3.getdataListParm.parammaps.lpplantype == 1 ||
- table3.getdataListParm.parammaps.lpplantype == 5
- "
- class="content"
- >
- <el-row :gutter="20">
- <el-col :span="12">
- <div class="table2">
- <div class="contentOperation">
- <p>{{ $t('dailyExecutionPlan.jhxq') }}</p>
- </div>
- <div class="content-table">
- <el-table
- :key="table2.tableKey"
- v-loading="table2.listLoading"
- :element-loading-text="$t('common.tableMsg')"
- :data="table2.list"
- fit
- border
- highlight-current-row
- style="width: 100%"
- height="450"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- :span-method="objectSpanMethod"
- >
- <el-table-column
- :label="$t('dailyExecutionPlan.czxh')"
- min-width="90px"
- align="center"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.sort }}</span>
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('InventoryManagement.silc')"
- prop="fname"
- min-width="90px"
- align="center"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.fname }}</span>
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('dailyExecutionPlan.sjzl')"
- prop="weight"
- min-width="130px"
- align="center"
- >
- <template slot-scope="scope">
- <span v-if="scope.row.NoEdit">{{
- scope.row.weight
- }}</span>
- <el-input
- v-if="scope.row.Edit"
- v-model="scope.row.weight"
- type="number"
- maxlength="32"
- style="width: 95%; padding: 10px 0"
- />
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('dailyExecutionPlan.xj')"
- prop="description"
- min-width="90px"
- align="center"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.subtotal }}</span>
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('errorAnalysis.cz')"
- align="left"
- min-width="200"
- class-name="small-padding"
- >
- <template slot-scope="{ row }">
- <el-button
- v-if="row.isUpdate && isRoleEdit"
- :disabled="
- table2.getdataListParm.parammaps.havebutton == 1
- "
- class="miniSuccess"
- icon="el-icon-edit-outline"
- @click="handleUpdate2(row)"
- />
- <el-button
- v-if="row.isUpdateSave"
- :disabled="isokDisable"
- icon="el-icon-folder-checked"
- class="miniSuccess"
- @click="updateData2(row, '0')"
- />
- <span v-if="row.isUpdateSave" class="centerSpan">|</span>
- <el-button
- v-if="row.isUpdateSave"
- class="minCancel"
- icon="el-icon-close"
- @click="updateCancel2(row)"
- />
- <span v-if="row.isUpdate && isRoleEdit" class="centerSpan"
- >|</span
- >
- <el-button
- v-if="row.isUpdate && isRoleEdit"
- class="miniSuccess"
- @click="handleRowEmpty(row, 0)"
- >
- <svg-icon icon-class="clear" />
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- </el-col>
- <el-col :span="12">
- <div class="table3">
- <div class="contentOperation">
- <p>{{ $t('dailyExecutionPlan.lsxq') }}</p>
- </div>
- <div class="content-table">
- <el-table
- :key="table3.tableKey"
- v-loading="table3.listLoading"
- :element-loading-text="$t('common.tableMsg')"
- :data="table3.list"
- height="450"
- fit
- border
- highlight-current-row
- style="width: 100%"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- >
- <el-table-column
- :label="$t('dailyExecutionPlan.czxh')"
- min-width="90px"
- align="center"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.sort }}</span>
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('processAnalysis.slcl')"
- min-width="90px"
- align="center"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.fname }}</span>
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('dailyExecutionPlan.sjzl')"
- min-width="130px"
- align="center"
- >
- <template slot-scope="scope">
- <span v-if="scope.row.NoEdit">{{
- scope.row.weight
- }}</span>
- <el-input
- v-if="scope.row.Edit"
- v-model="scope.row.weight"
- type="number"
- maxlength="32"
- style="width: 95%; padding: 10px 0"
- />
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('errorAnalysis.cz')"
- align="left"
- min-width="200"
- class-name="small-padding"
- >
- <template slot-scope="{ row }">
- <el-button
- v-if="row.isUpdate && isRoleEdit"
- :disabled="
- table3.getdataListParm.parammaps.havebutton == 1
- "
- class="miniSuccess"
- icon="el-icon-edit-outline"
- @click="handleUpdate3(row)"
- />
- <el-button
- v-if="row.isUpdateSave"
- :disabled="isokDisable"
- icon="el-icon-folder-checked"
- class="miniSuccess"
- @click="updateData3(row, '1')"
- />
- <span v-if="row.isUpdateSave" class="centerSpan">|</span>
- <el-button
- v-if="row.isUpdateSave"
- class="minCancel"
- icon="el-icon-close"
- @click="updateCancel3(row)"
- />
- <span v-if="row.isUpdate && isRoleEdit" class="centerSpan"
- >|</span
- >
- <el-button
- v-if="row.isUpdate && isRoleEdit"
- class="miniSuccess"
- @click="handleRowEmpty(row, 1)"
- >
- <svg-icon icon-class="clear" />
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- </el-col>
- </el-row>
- </div>
- <!-- 撒料计划-撒料 -->
- <div
- v-if="table3.getdataListParm.parammaps.lpplantype == 2"
- class="content"
- >
- <el-row :gutter="20">
- <el-col :span="12">
- <div class="table3">
- <div class="contentOperation">
- <p>{{ $t('dailyExecutionPlan.lsxq') }}</p>
- </div>
- <div class="content-table">
- <el-table
- :key="table3.tableKey"
- v-loading="table3.listLoading"
- :element-loading-text="$t('common.tableMsg')"
- :data="table3.list"
- height="450"
- fit
- border
- highlight-current-row
- style="width: 100%"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- >
- <el-table-column
- :label="$t('dailyExecutionPlan.czxh')"
- min-width="90px"
- align="center"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.sort }}</span>
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('processAnalysis.slcl')"
- min-width="90px"
- align="center"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.fname }}</span>
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('dailyExecutionPlan.sjzl')"
- min-width="130px"
- align="center"
- >
- <template slot-scope="scope">
- <span v-if="scope.row.NoEdit">{{
- scope.row.weight
- }}</span>
- <el-input
- v-if="scope.row.Edit"
- v-model="scope.row.weight"
- type="number"
- maxlength="32"
- style="width: 95%; padding: 10px 0"
- />
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('dailyExecutionPlan.xj')"
- prop="description"
- min-width="90px"
- align="center"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.subtotal }}</span>
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('errorAnalysis.cz')"
- align="left"
- min-width="200"
- class-name="small-padding"
- >
- <template slot-scope="{ row }">
- <el-button
- v-if="row.isUpdate && isRoleEdit"
- :disabled="
- table3.getdataListParm.parammaps.havebutton == 1
- "
- class="miniSuccess"
- icon="el-icon-edit-outline"
- @click="handleUpdate3(row)"
- />
- <el-button
- v-if="row.isUpdateSave"
- :disabled="isokDisable"
- icon="el-icon-folder-checked"
- class="miniSuccess"
- @click="updateData3(row, '0')"
- />
- <span v-if="row.isUpdateSave" class="centerSpan">|</span>
- <el-button
- v-if="row.isUpdateSave"
- class="minCancel"
- icon="el-icon-close"
- @click="updateCancel3(row)"
- />
- <span v-if="row.isUpdate && isRoleEdit" class="centerSpan"
- >|</span
- >
- <el-button
- v-if="row.isUpdate && isRoleEdit"
- class="miniSuccess"
- @click="handleRowEmpty(row, 0)"
- >
- <svg-icon icon-class="clear" />
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- </el-col>
- <el-col :span="12">
- <div class="table2">
- <div class="contentOperation">
- <p>{{ $t('dailyExecutionPlan.jhxq') }}</p>
- </div>
- <div class="content-table">
- <el-table
- :key="table2.tableKey"
- v-loading="table2.listLoading"
- :element-loading-text="$t('common.tableMsg')"
- :data="table2.list"
- fit
- border
- highlight-current-row
- style="width: 100%"
- height="450"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- >
- <el-table-column
- :label="$t('dailyExecutionPlan.czxh')"
- min-width="90px"
- align="center"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.sort }}</span>
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('errorAnalysis.isHouseName')"
- prop="fname"
- min-width="90px"
- align="center"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.fname }}</span>
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('dailyExecutionPlan.sjzl')"
- prop="weight"
- width="130px"
- align="center"
- >
- <template slot-scope="scope">
- <span v-if="scope.row.NoEdit">{{
- scope.row.weight
- }}</span>
- <el-input
- v-if="scope.row.Edit"
- v-model="scope.row.weight"
- type="number"
- maxlength="32"
- style="width: 95%; padding: 10px 0"
- />
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('errorAnalysis.cz')"
- align="left"
- min-width="200"
- class-name="small-padding"
- >
- <template slot-scope="{ row }">
- <el-button
- v-if="row.isUpdate && isRoleEdit"
- :disabled="
- table2.getdataListParm.parammaps.havebutton == 1
- "
- class="miniSuccess"
- icon="el-icon-edit-outline"
- @click="handleUpdate2(row)"
- />
- <el-button
- v-if="row.isUpdateSave"
- :disabled="isokDisable"
- icon="el-icon-folder-checked"
- class="miniSuccess"
- @click="updateData2(row, '1')"
- />
- <span v-if="row.isUpdateSave" class="centerSpan">|</span>
- <el-button
- v-if="row.isUpdateSave"
- class="minCancel"
- icon="el-icon-close"
- @click="updateCancel2(row)"
- />
- <span v-if="row.isUpdate && isRoleEdit" class="centerSpan"
- >|</span
- >
- <el-button
- v-if="row.isUpdate && isRoleEdit"
- class="miniSuccess"
- @click="handleRowEmpty(row, 1)"
- >
- <svg-icon icon-class="clear" />
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- </el-col>
- </el-row>
- </div>
- </div>
- <!-- 新生成 -->
- <el-dialog
- :title="textMap[newGeneration.dialogStatus]"
- :destroy-on-close="true"
- :visible.sync="newGeneration.dialogFormVisible"
- :close-on-click-modal="false"
- width="35%"
- >
- <div class="newGeneration" v-loading="newGenerationLoading">
- <el-form
- ref="temp"
- :rules="newGeneration.rules"
- :model="newGeneration.temp"
- label-position="right"
- label-width="120px"
- style="width: 100%; margin: 0 auto 50px"
- >
- <el-row v-if="newGeneration.dialogStatus == 'newGeneration'">
- <el-col :span="24">
- <el-form-item
- :label="$t('dailyExecutionPlan.sjfw')"
- prop="inputDatetime"
- >
- <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"
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row v-else>
- <el-col :span="24">
- <el-form-item
- :label="$t('dailyExecutionPlan.sjfw')"
- prop="copyInputDatetime"
- >
- <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"
- />
- </el-form-item>
- </el-col>
- </el-row>
- <p
- v-if="
- newGeneration.temp.tips == true ||
- newGeneration.dialogStatus == 'copy'
- "
- style="font-weight: 700; color: red; text-align: center"
- >
- {{ $t('dailyExecutionPlan.note') }}
- </p>
- <div style="height: 200px; overflow: auto">
- <div v-if="myMaxTimes == 1">
- <div>{{ $t('dailyExecutionPlan.dyBan1') }}</div>
- <div v-for="(item, index) in tipsList.one" :key="index + 'A'">
- <b
- v-if="
- item.arrList !== null &&
- item.arrList !== undefined &&
- item.arrList.length > 0
- "
- >{{ item.ftname }}:</b
- >
- <span
- v-if="
- item.arrList !== null &&
- item.arrList !== undefined &&
- item.arrList.length > 0
- "
- >
- <span
- v-for="(item2, index2) in item.arrList"
- :key="index2 + 'a'"
- >
- {{ item2.barname }}
- </span>
- </span>
- </div>
- </div>
- <div v-else-if="myMaxTimes == 2">
- <div>{{ $t('dailyExecutionPlan.dyBan1') }}</div>
- <div v-for="(item, index) in tipsList.one" :key="index + 'B'">
- <b
- v-if="
- item.arrList !== null &&
- item.arrList !== undefined &&
- item.arrList.length > 0
- "
- >{{ item.ftname }}:</b
- >
- <span
- v-if="
- item.arrList !== null &&
- item.arrList !== undefined &&
- item.arrList.length > 0
- "
- >
- <span
- v-for="(item2, index2) in item.arrList"
- :key="index2 + 'b'"
- >
- {{ item2.barname }}
- </span>
- </span>
- </div>
- <div>{{ $t('dailyExecutionPlan.dyBan2') }}</div>
- <div v-for="(item, index) in tipsList.two" :key="index + 'C'">
- <b
- v-if="
- item.arrList !== null &&
- item.arrList !== undefined &&
- item.arrList.length > 0
- "
- >{{ item.ftname }}:</b
- >
- <span
- v-if="
- item.arrList !== null &&
- item.arrList !== undefined &&
- item.arrList.length > 0
- "
- >
- <span
- v-for="(item2, index2) in item.arrList"
- :key="index2 + 'c'"
- >
- {{ item2.barname }}
- </span>
- </span>
- </div>
- </div>
- <div v-else-if="myMaxTimes == 3">
- <div>{{ $t('dailyExecutionPlan.dyBan1') }}</div>
- <div v-for="(item, index) in tipsList.one" :key="index + 'D'">
- <b
- v-if="
- item.arrList !== null &&
- item.arrList !== undefined &&
- item.arrList.length > 0
- "
- >{{ item.ftname }}:</b
- >
- <span
- v-if="
- item.arrList !== null &&
- item.arrList !== undefined &&
- item.arrList.length > 0
- "
- >
- <span
- v-for="(item2, index2) in item.arrList"
- :key="index2 + 'd'"
- >
- {{ item2.barname }}
- </span>
- </span>
- </div>
- <div>{{ $t('dailyExecutionPlan.dyBan2') }}</div>
- <div v-for="(item, index) in tipsList.two" :key="index + 'E'">
- <b
- v-if="
- item.arrList !== null &&
- item.arrList !== undefined &&
- item.arrList.length > 0
- "
- >{{ item.ftname }}:</b
- >
- <span
- v-if="
- item.arrList !== null &&
- item.arrList !== undefined &&
- item.arrList.length > 0
- "
- >
- <span
- v-for="(item2, index2) in item.arrList"
- :key="index2 + 'e'"
- >
- {{ item2.barname }}
- </span>
- </span>
- </div>
- <div>{{ $t('dailyExecutionPlan.dyBan3') }}</div>
- <div v-for="(item, index) in tipsList.three" :key="index + 'F'">
- <b
- v-if="
- item.arrList !== null &&
- item.arrList !== undefined &&
- item.arrList.length > 0
- "
- >{{ item.ftname }}:</b
- >
- <span
- v-if="
- item.arrList !== null &&
- item.arrList !== undefined &&
- item.arrList.length > 0
- "
- >
- <span
- v-for="(item2, index2) in item.arrList"
- :key="index2 + 'f'"
- >
- {{ item2.barname }}
- </span>
- </span>
- </div>
- </div>
- <div v-else>
- <div>{{ $t('dailyExecutionPlan.dyBan1') }}</div>
- <div v-for="(item, index) in tipsList.one" :key="index + 'G'">
- <b
- v-if="
- item.arrList !== null &&
- item.arrList !== undefined &&
- item.arrList.length > 0
- "
- >{{ item.ftname }}:</b
- >
- <span
- v-if="
- item.arrList !== null &&
- item.arrList !== undefined &&
- item.arrList.length > 0
- "
- >
- <span
- v-for="(item2, index2) in item.arrList"
- :key="index2 + 'g'"
- >
- {{ item2.barname }}
- </span>
- </span>
- </div>
- <div>{{ $t('dailyExecutionPlan.dyBan2') }}</div>
- <div v-for="(item, index) in tipsList.two" :key="index + 'H'">
- <b
- v-if="
- item.arrList !== null &&
- item.arrList !== undefined &&
- item.arrList.length > 0
- "
- >{{ item.ftname }}:</b
- >
- <span
- v-if="
- item.arrList !== null &&
- item.arrList !== undefined &&
- item.arrList.length > 0
- "
- >
- <span
- v-for="(item2, index2) in item.arrList"
- :key="index2 + 'h'"
- >
- {{ item2.barname }}
- </span>
- </span>
- </div>
- <div>{{ $t('dailyExecutionPlan.dyBan3') }}</div>
- <div v-for="(item, index) in tipsList.three" :key="index + 'I'">
- <b
- v-if="
- item.arrList !== null &&
- item.arrList !== undefined &&
- item.arrList.length > 0
- "
- >{{ item.ftname }}:</b
- >
- <span
- v-if="
- item.arrList !== null &&
- item.arrList !== undefined &&
- item.arrList.length > 0
- "
- >
- <span
- v-for="(item2, index2) in item.arrList"
- :key="index2 + 'i'"
- >
- {{ item2.barname }}
- </span>
- </span>
- </div>
- <div>{{ $t('dailyExecutionPlan.dyBan4') }}</div>
- <div v-for="(item, index) in tipsList.four" :key="index + 'J'">
- <b
- v-if="
- item.arrList !== null &&
- item.arrList !== undefined &&
- item.arrList.length > 0
- "
- >{{ item.ftname }}:</b
- >
- <span
- v-if="
- item.arrList !== null &&
- item.arrList !== undefined &&
- item.arrList.length > 0
- "
- >
- <span
- v-for="(item2, index2) in item.arrList"
- :key="index2 + 'j'"
- >
- {{ item2.barname }}
- </span>
- </span>
- </div>
- </div>
- </div>
- </el-form>
- <div slot="footer" class="dialog-footer" style="bottom: 20px">
- <el-button
- class="cancelClose"
- @click="
- newGeneration.dialogFormVisible = false
- getList()
- "
- >{{ $t('formulationEvaluation.cancel') }}</el-button
- >
- <el-button
- v-if="newGeneration.dialogStatus == 'newGeneration'"
- class="save"
- :disabled="isokDisable"
- @click="newGenerationData()"
- >{{ $t('errorAnalysis.confirm') }}</el-button
- >
- <el-button
- v-else
- class="save"
- :disabled="isokDisable"
- @click="copyData()"
- >{{ $t('errorAnalysis.confirm') }}</el-button
- >
- </div>
- </div>
- </el-dialog>
- <!-- 历史记录 -->
- <el-dialog
- :fullscreen="dialogFull"
- :destroy-on-close="true"
- :visible.sync="historyRecord.dialogFormVisible"
- :close-on-click-modal="false"
- width="90%"
- >
- <template slot="title">
- <div class="avue-crud__dialog__header">
- <span class="el-dialog__title">
- <span
- style="
- display: inline-block;
- width: 3px;
- height: 20px;
- margin-right: 5px;
- float: left;
- margin-top: 2px;
- "
- />
- {{ textMap[historyRecord.dialogStatus] }}
- </span>
- <div
- class="avue-crud__dialog__menu"
- @click="dialogFull ? (dialogFull = false) : (dialogFull = true)"
- >
- <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
- <svg-icon v-else icon-class="fullscreen" />
- </div>
- </div>
- </template>
- <div class="historyRecord">
- <keep-alive>
- <component :is="historyRecord.myComponent" ref="historyRecord" />
- </keep-alive>
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button
- class="cancelClose cancelClose1"
- @click="historyRecord.dialogFormVisible = false"
- >{{ $t('common.closed') }}</el-button
- >
- </div>
- </el-dialog>
- <!-- 正在同步中 -->
- <el-dialog
- :destroy-on-close="true"
- :visible.sync="dataSynchronization.dialogFormVisible"
- :close-on-click-modal="false"
- width="30%"
- >
- <div
- class="dataSynchronization"
- style="text-align: center; font-size: 18px"
- >
- <i class="el-icon-loading" />
- <span>{{ $t('dailyExecutionPlan.zztb') }} </span>
- <div slot="footer" class="dialog-footer" style="bottom: 10px">
- <el-button
- class="miniPrimary"
- @click="dataSynchronization.dialogFormVisible = false"
- >{{ $t('errorAnalysis.confirm') }}</el-button
- >
- </div>
- </div>
- </el-dialog>
- <!-- 修改计划 -->
- <RevisePlan
- :show.sync="isShowDialog"
- :parent-active-name="activeName"
- :parent-date="parentDate"
- />
- <!-- 删除记录 -->
- <el-dialog
- :title="textMap[deleteRecord.dialogStatus]"
- :destroy-on-close="true"
- :visible.sync="deleteRecord.dialogFormVisible"
- :close-on-click-modal="false"
- width="90%"
- >
- <div class="deleteRecord">
- <div class="search">
- <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"
- />
- </div>
- <div class="table">
- <el-table
- :key="deleteRecord.tableKey"
- v-loading="deleteRecord.listLoading"
- :element-loading-text="$t('common.tableMsg')"
- :data="deleteRecord.list"
- border
- fit
- highlight-current-row
- style="width: 98%"
- row-key="id"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- :height="370"
- >
- <el-table-column
- :label="$t('formulationEvaluation.xh')"
- align="center"
- prop="sort"
- width="50px"
- />
- <el-table-column
- :label="$t('dailyExecutionPlan.jhmc')"
- min-width="90px"
- align="center"
- prop="projname"
- />
- <el-table-column
- :label="$t('dailyExecutionPlan.jhlx')"
- prop="weight"
- min-width="90px"
- align="center"
- :formatter="lpplantype"
- />
- <el-table-column
- :label="$t('premixedPlan.tmrbh')"
- min-width="90px"
- align="center"
- prop="tmrtname"
- />
- <el-table-column
- :label="$t('errorAnalysis.Driver')"
- min-width="90px"
- align="center"
- prop="driver"
- />
- <el-table-column
- :label="$t('dailyExecutionPlan.yzx')"
- min-width="70px"
- align="center"
- >
- <template slot-scope="scope">
- <span v-if="scope.row.havebutton == 0">{{
- $t('feedChart.no')
- }}</span>
- <span v-else>{{ $t('feedChart.yes') }}</span>
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('errorAnalysis.isTrainNumber')"
- min-width="80px"
- align="center"
- prop="times"
- />
- <el-table-column
- :label="$t('dailyExecutionPlan.lhl')"
- min-width="80px"
- align="center"
- prop="lweight"
- />
- <el-table-column
- :label="$t('dailyExecutionPlan.qy')"
- min-width="70px"
- align="center"
- >
- <template slot-scope="scope">
- <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)"
- />
- <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)"
- />
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('premixedPlan.time')"
- min-width="80px"
- align="center"
- prop="plantime"
- />
- <el-table-column
- :label="$t('errorAnalysis.feedName')"
- min-width="100px"
- align="center"
- prop="ftname"
- />
- <el-table-column
- :label="$t('formulationEvaluation.nts')"
- min-width="80px"
- align="center"
- prop="cowcount"
- />
- <el-table-column
- :label="$t('premixedPlan.ms')"
- min-width="80px"
- align="center"
- prop="display"
- />
- <el-table-column
- :label="$t('dailyExecutionPlan.flw')"
- min-width="80px"
- align="left"
- prop="barnames"
- />
- </el-table>
- <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
- >
- </div>
- <div slot="footer" class="dialog-footer" style="bottom: 20px">
- <el-button
- class="cancelClose1"
- @click="
- deleteRecord.dialogFormVisible = false
- getList()
- "
- >{{ $t('formulationEvaluation.cancel') }}</el-button
- >
- </div>
- </div>
- </el-dialog>
- <el-dialog
- :title="textMap[sapUpload.dialogStatus]"
- :destroy-on-close="true"
- :visible.sync="sapUpload.dialogFormVisible"
- :close-on-click-modal="false"
- width="30%"
- >
- <div class="sapUpload">
- <el-form
- ref="sapUpload"
- :rules="sapUpload.rules"
- :model="sapUpload.temp"
- label-position="right"
- label-width="100px"
- style="width: 100%; margin: 0 auto 50px"
- >
- <el-row>
- <el-col :span="24">
- <el-form-item :label="$t('premixedPlan.time')" prop="date">
- <el-date-picker
- v-model="sapUpload.temp.date"
- :clearable="false"
- class="filter-item"
- type="date"
- />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div slot="footer" class="dialog-footer" style="bottom: 20px">
- <el-button
- class="cancelClose"
- @click="
- sapUpload.dialogFormVisible = false
- getList()
- "
- >{{ $t('formulationEvaluation.cancel') }}</el-button
- >
- <el-button
- class="save"
- v-if="sapUpload.dialogStatus == 'sapUpload'"
- :disabled="isokDisable"
- @click="sapUploadData()"
- >{{ $t('errorAnalysis.confirm') }}</el-button
- >
- <el-button
- class="save"
- v-else-if="sapUpload.dialogStatus == 'udload1'"
- :disabled="isokDisable"
- @click="udData1()"
- >{{ $t('errorAnalysis.confirm') }}</el-button
- >
- <el-button
- class="save"
- v-else-if="sapUpload.dialogStatus == 'udload2'"
- :disabled="isokDisable"
- @click="udData2()"
- >{{ $t('errorAnalysis.confirm') }}</el-button
- >
- <el-button
- class="save"
- v-else-if="sapUpload.dialogStatus == 'udload3'"
- :disabled="isokDisable"
- @click="udData3()"
- >{{ $t('errorAnalysis.confirm') }}</el-button
- >
- </div>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import {
- GetDataByName,
- GetDataByNames,
- ExecDataByConfig,
- PostDataByName,
- getDorm,
- GetReportform,
- checkButtons,
- postJson,
- postJson2,
- SyncSCJH
- } from '@/api/common'
- import RevisePlan from './revisePlan.vue'
- import printJS from 'print-js'
- import {
- parseTime,
- json2excel,
- handleTableSpan,
- handleObjectSpanMethod
- } from '@/utils/index.js'
- import Cookies from 'js-cookie'
- import Sortable from 'sortablejs'
- import { MessageBox } from 'element-ui'
- export default {
- name: 'DailyExecutionPlan',
- components: {
- RevisePlan
- },
- data() {
- return {
- myheight: document.documentElement.clientHeight - 280,
- // myheight: 500,
- enlargeHeight: document.documentElement.clientHeight - 85 - 165 + 50,
- isDetail: false,
- newGenerationLoading: false,
- dialogFull: false,
- isRoleEdit: [],
- dataDisabled: false,
- requestParams: [
- // { name: 'getDictByName', offset: 0, pagecount: 0, params: ['牲畜父类'] }
- ],
- planTypeList: this.$t('dailyExecutionPlan.planTypeList'), // 计划类型
- printingTypeList: this.$t('dailyExecutionPlan.printingTypeList'), // 打印类型
- frequencyList: [], // 班次
- planningDimensionList: this.$t(
- 'dailyExecutionPlan.planningDimensionList'
- ), // 发料顺序
- exportTypeList: this.$t('dailyExecutionPlan.exportTypeList'), // 导出类型
- iscompletedList: this.$t('dailyExecutionPlan.iscompletedList'),
- // 班次
- maxTime: {
- getMaxTimesParm: {
- name: 'getSysoptEnable',
- page: 1,
- offset: 1,
- pagecount: 1,
- returntype: 'Map',
- parammaps: {
- pastureid: Cookies.get('pastureid'),
- inforname: 'times'
- }
- }
- },
- isOrder: true,
- table: {
- getdataListParm: {
- name: 'getDownloadedplanList',
- page: 1,
- offset: 1,
- pagecount: '',
- returntype: 'Map',
- parammaps: {
- pastureid: Cookies.get('pastureid'),
- barid: '',
- mydate: parseTime(new Date(), '{y}-{m}-{d}'),
- times: '',
- lpplantype: '',
- printType: '',
- plandimen: '0',
- enable3: '0',
- iscompleted: '',
- tmrname: ''
- }
- },
- tableKey: 0,
- list: [],
- total: 0,
- listLoading: false
- },
- // 计划内容操作详情
- table2: {
- getdataListParm: {
- name: 'getDownloadplandtl1ListV2',
- page: 1,
- offset: 1,
- returntype: 'Map',
- parammaps: {
- pastureid: Cookies.get('pastureid'),
- date: '',
- id: ''
- }
- },
- tableKey: 0,
- list: [],
- total: 0,
- listLoading: false
- },
- // 计划内容 舍栏详情
- table3: {
- getdataListParm: {
- name: 'getDownloadplandt2ListV2',
- page: 1,
- offset: 1,
- returntype: 'Map',
- parammaps: {
- pastureid: Cookies.get('pastureid'),
- date: '',
- id: ''
- }
- },
- tableKey: 0,
- list: [],
- total: 0,
- listLoading: false
- },
- // 新生成
- newGeneration: {
- dialogFormVisible: false,
- dialogStatus: '',
- getdataListParm: {
- name: 'checkLLPIsDistribution',
- page: 1,
- offset: 1,
- pagecount: 1,
- returntype: 'Map',
- parammaps: {
- pastureid: Cookies.get('pastureid')
- }
- },
- temp: {
- inputDatetime: [
- parseTime(new Date(), '{y}-{m}-{d}'),
- parseTime(new Date(), '{y}-{m}-{d}')
- ],
- tips: ''
- },
- rules: {
- inputDatetime: [
- {
- type: 'array',
- required: true,
- message: this.$t('hardwareTest.bt'),
- trigger: 'blur'
- }
- ],
- copyInputDatetime: [
- {
- type: 'array',
- required: true,
- message: this.$t('hardwareTest.bt'),
- trigger: 'blur'
- }
- ]
- }
- },
- pickerMinDate: '',
- pickerOptions: {
- onPick: ({ maxDate, minDate }) => {
- this.pickerMinDate = minDate.getTime()
- if (maxDate) {
- this.pickerMinDate = ''
- }
- },
- disabledDate: (time) => {
- if (this.pickerMinDate !== '') {
- const one = 31 * 24 * 3600 * 1000
- const minTime = this.pickerMinDate
- const maxTime = this.pickerMinDate + one
- return time.getTime() < minTime || time.getTime() > maxTime - 8.64e7
- }
- return time.getTime() < Date.now() - 8.64e7
- }
- },
- pickerOptions2: {
- onPick: ({ maxDate, minDate }) => {
- this.pickerMinDate = minDate.getTime()
- if (maxDate) {
- this.pickerMinDate = ''
- }
- },
- disabledDate: (time) => {
- if (this.pickerMinDate !== '') {
- const one = 14 * 24 * 3600 * 1000
- const minTime = this.pickerMinDate
- const maxTime = this.pickerMinDate + one
- return time.getTime() < minTime || time.getTime() > maxTime - 8.64e7
- }
- return time.getTime() < Date.now() - 8.64e7
- }
- },
- historyRecord: {
- dialogFormVisible: false,
- dialogStatus: '',
- myComponent: null
- },
- dataSynchronization: {
- dialogFormVisible: false,
- dialogStatus: '',
- getdataListParm: {
- name: 'getSysoptEnable',
- page: 1,
- offset: 1,
- pagecount: 1,
- returntype: 'Map',
- parammaps: {
- pastureid: Cookies.get('pastureid'),
- inforname: 'isDataSync'
- }
- },
- isDataSynchronization: false
- },
- dataSynchronization2: {
- dialogFormVisible: false,
- dialogStatus: '',
- getdataListParm: {
- name: 'getSysoptEnable',
- page: 1,
- offset: 1,
- pagecount: 1,
- returntype: 'Map',
- parammaps: {
- pastureid: Cookies.get('pastureid'),
- inforname: 'zcSync'
- }
- },
- isDataSynchronization: false
- },
- dataSynchronization3: {
- dialogFormVisible: false,
- dialogStatus: '',
- getdataListParm: {
- name: 'getSysoptEnable',
- page: 1,
- offset: 1,
- pagecount: 1,
- returntype: 'Map',
- parammaps: {
- pastureid: Cookies.get('pastureid'),
- inforname: 'wgSap'
- }
- },
- isDataSynchronization: false
- },
- textMap: {
- newGeneration: this.$t('message.msg298'),
- historyRecord: this.$t('message.msg34'),
- revisePlan: this.$t('message.msg220'),
- copy: this.$t('message.msg303'),
- deleteRecord: this.$t('message.msg297'),
- sapUpload: this.$t('message.msg299'),
- udload1: this.$t('message.msg300'),
- udload2: this.$t('message.msg301'),
- udload3: this.$t('message.msg302')
- },
- isokDisable: false,
- requestParam: {},
- rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
- rowStyle1: { height: 80 + 'px' },
- cellStyle: { padding: 0 + 'px' },
- isShowDialog: false,
- activeName: this.$t('dailyExecutionPlan.lspf'),
- parentDate: '',
- downLoad: {
- getdataListParm: {
- name: '',
- page: 1,
- offset: 1,
- pagecount: '',
- returntype: 'Map',
- parammaps: {
- pastureid: Cookies.get('pastureid'),
- date: ''
- }
- },
- list: [],
- labelList: []
- },
- tmrDownList: [],
- getTmrListParam: {
- name: 'getDownloadedplanTmrNameUnfinished',
- page: 1,
- offset: 1,
- pagecount: 10,
- returntype: 'Map',
- parammaps: {
- pastureid: Cookies.get('pastureid'),
- mydate: parseTime(new Date(), '{y}-{m}-{d}')
- }
- },
- myMaxTimes: '',
- tipsList: [],
- spanObj: {},
- mergekeys: ['sort', 'description'],
- deleteRecord: {
- dialogFormVisible: false,
- dialogStatus: '',
- total: 0,
- tableKey: 0,
- listLoading: false,
- list: [],
- mydate: parseTime(new Date(), '{y}-{m}-{d}')
- },
- selectList: [],
- driverList: [],
- sapUpload: {
- dialogFormVisible: false,
- dialogStatus: '',
- temp: {
- date: parseTime(new Date(), '{y}-{m}-{d}')
- },
- rules: {
- date: [
- {
- required: true,
- message: this.$t('hardwareTest.bt'),
- trigger: 'blur'
- }
- ]
- },
- getdataListParm: {
- name: 'getSysoptEnable',
- page: 1,
- offset: 1,
- pagecount: 1,
- returntype: 'Map',
- parammaps: {
- pastureid: Cookies.get('pastureid'),
- inforname: 'xdmysapupload'
- }
- },
- isSap: false
- },
- ispalyUd: false
- }
- },
- created() {
- this.getIspalyUd()
- this.parentDate = this.table.getdataListParm.parammaps.mydate
- console.log(this.parentDate, 'this.parentDate')
- this.getDataSynchronization()
- this.getDataSynchronization2()
- this.getDataSynchronization3()
- this.getButtons()
- this.getList()
- this.getDownList()
- this.getIsDisplay()
- this.getIsSap()
- this.getTMRList()
- this.getDriverList()
- },
- mounted() {
- this.getTmrListParam.parammaps.mydate = parseTime(new Date(), '{y}-{m}-{d}')
- },
- methods: {
- getDriverList() {
- const url = 'authdata/GetDataByName'
- const data = {
- name: 'getDriverList',
- page: 1,
- offset: 1,
- pagecount: 50,
- returntype: 'Map',
- parammaps: { pastureid: Cookies.get('pastureid') }
- }
- postJson(url, data).then((response) => {
- if (response.data !== null) {
- this.driverList = response.data.list
- } else {
- this.driverList = []
- }
- })
- },
- getTMRList() {
- this.getTmrListParam.parammaps.mydate =
- this.table.getdataListParm.parammaps.mydate
- GetDataByName(this.getTmrListParam).then((response) => {
- if (response.data.list !== null) {
- this.tmrDownList = response.data.list
- }
- })
- },
- getButtons() {
- const Edit = 'DailyExecutionPlan'
- const isRoleEdit = checkButtons(
- JSON.parse(sessionStorage.getItem('buttons')),
- Edit
- )
- this.isRoleEdit = isRoleEdit
- },
- getDataSynchronization() {
- GetDataByName(this.dataSynchronization.getdataListParm).then(
- (response) => {
- // console.log(response.data.list[0])
- if (response.data.list !== null) {
- if (response.data.list[0].inforvalue == 0) {
- this.dataSynchronization.isDataSynchronization = false
- } else {
- this.dataSynchronization.isDataSynchronization = true
- }
- }
- }
- )
- },
- getDataSynchronization2() {
- GetDataByName(this.dataSynchronization2.getdataListParm).then(
- (response) => {
- if (response.data.list !== null) {
- if (response.data.list[0].inforvalue == 0) {
- this.dataSynchronization2.isDataSynchronization = false
- } else {
- this.dataSynchronization2.isDataSynchronization = true
- }
- }
- }
- )
- },
- getDataSynchronization3() {
- GetDataByName(this.dataSynchronization3.getdataListParm).then(
- (response) => {
- // console.log(response.data.list[0])
- if (response.data.list[0].inforvalue == 0) {
- this.dataSynchronization3.isDataSynchronization = false
- } else {
- this.dataSynchronization3.isDataSynchronization = true
- }
- }
- )
- },
- form_updata() {
- var send_data = {
- name: 'syncSCJH',
- page: 1,
- offset: 1,
- pagecount: 1,
- returntype: 'Map',
- parammaps: {
- // pastureid: Cookies.get('pastureid'),
- // inforname: 'isDataSync'
- }
- }
- SyncSCJH(send_data).then((response) => {
- if (response.msg === 'fail') {
- this.$notify({
- title: this.$t('message.msg40'),
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- } else {
- this.$notify({
- title: this.$t('common.succes'),
- message: this.$t('message.msg190'),
- type: 'success',
- duration: 2000
- })
- }
- })
- },
- getIsDisplay() {
- GetDataByName(this.maxTime.getMaxTimesParm).then((response) => {
- console.log(response.data.list[0].inforvalue)
- this.myMaxTimes = response.data.list[0].inforvalue
- if (response.data.list[0].inforvalue == 1) {
- this.frequencyList = [{ id: '1', name: this.$t('errorAnalysis.one') }]
- } else if (response.data.list[0].inforvalue == 2) {
- this.frequencyList = [
- { id: '1', name: this.$t('errorAnalysis.one') },
- { id: '2', name: this.$t('errorAnalysis.two') }
- ]
- } else if (response.data.list[0].inforvalue == 3) {
- this.frequencyList = [
- { id: '1', name: this.$t('errorAnalysis.one') },
- { id: '2', name: this.$t('errorAnalysis.two') },
- { id: '3', name: this.$t('errorAnalysis.three') }
- ]
- } else if (response.data.list[0].inforvalue == 4) {
- 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') }
- ]
- } else if (response.data.list[0].inforvalue == 5) {
- 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') }
- ]
- } else if (response.data.list[0].inforvalue == 6) {
- 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') }
- ]
- }
- })
- },
- getDownList() {
- GetDataByNames(this.requestParams).then((response) => {
- // this.livestockTypeList = response.data.getDictByName.list
- })
- },
- // -------------------日执行计划-----------------------------
- handleBefore() {
- if (
- this.table.getdataListParm.parammaps.mydate !== '' &&
- this.table.getdataListParm.parammaps.mydate !== null
- ) {
- this.table.getdataListParm.parammaps.mydate = new Date(
- this.table.getdataListParm.parammaps.mydate
- )
- var start = new Date(
- this.table.getdataListParm.parammaps.mydate.setDate(
- this.table.getdataListParm.parammaps.mydate.getDate() - 1
- )
- )
- // var start = this.table.getdataListParm.parammaps.mydate - 1
- this.table.getdataListParm.parammaps.mydate = parseTime(
- start,
- '{y}-{m}-{d}'
- )
- // this.$forceUpdate()
- this.parentDate = this.table.getdataListParm.parammaps.mydate
- this.getTMRList()
- this.getList()
- }
- var d = this.table.getdataListParm.parammaps.mydate
- var curDate = parseTime(new Date(), '{y}-{m}-{d}')
- if (d < curDate) {
- this.dataDisabled = true
- } else {
- this.dataDisabled = false
- }
- console.log(this.dataDisabled)
- },
- handleNext() {
- if (
- this.table.getdataListParm.parammaps.mydate !== '' &&
- this.table.getdataListParm.parammaps.mydate !== null
- ) {
- this.table.getdataListParm.parammaps.mydate = new Date(
- this.table.getdataListParm.parammaps.mydate
- )
- var stop = new Date(
- this.table.getdataListParm.parammaps.mydate.setDate(
- this.table.getdataListParm.parammaps.mydate.getDate() + 1
- )
- )
- this.table.getdataListParm.parammaps.mydate = parseTime(
- stop,
- '{y}-{m}-{d}'
- )
- this.parentDate = this.table.getdataListParm.parammaps.mydate
- this.getTMRList()
- this.getList()
- }
- var d = this.table.getdataListParm.parammaps.mydate
- var curDate = parseTime(new Date(), '{y}-{m}-{d}')
- if (d < curDate) {
- this.dataDisabled = true
- } else {
- this.dataDisabled = false
- }
- console.log(this.dataDisabled)
- },
- getList() {
- this.table.listLoading = true
- GetDataByName(this.table.getdataListParm).then((response) => {
- console.log('table数据', response.data.list)
- if (response.data.list !== null) {
- // var obj = { 'id': '580999', 'havebutton': '0', 'lpplantype': 2, 'pid': '3283220207862547456', 'times': '第二班', 'projname': '2.666' }
- // response.data.list[6] = obj
- this.getIsColor(response.data.list)
- this.table.list = response.data.list
- this.table.pageNum = response.data.pageNum
- this.table.pageSize = response.data.pageSize
- this.table.total = response.data.total
- console.log('计划类型', response.data.list[0].lpplantype)
- this.table2.getdataListParm.parammaps.havebutton =
- response.data.list[0].havebutton
- this.table3.getdataListParm.parammaps.havebutton =
- response.data.list[0].havebutton
- if (response.data.list[0].lpplantype == 0) {
- // 撒料
- this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
- this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
- this.table2.getdataListParm.parammaps.useinbartype = ''
- this.table3.getdataListParm.parammaps.useinbartype = ''
- this.table2.getdataListParm.parammaps.date =
- this.table.getdataListParm.parammaps.mydate
- this.table3.getdataListParm.parammaps.date =
- this.table.getdataListParm.parammaps.mydate
- this.table2.getdataListParm.parammaps.id = response.data.list[0].id
- this.table3.getdataListParm.parammaps.id = response.data.list[0].id
- this.table3.getdataListParm.parammaps.lpplantype =
- response.data.list[0].lpplantype
- this.getList2()
- this.getList3()
- } else if (response.data.list[0].lpplantype == 1) {
- // 撒料计划-混料
- this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
- this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
- this.table2.getdataListParm.parammaps.useinbartype = ''
- this.table3.getdataListParm.parammaps.useinbartype = ''
- this.table2.getdataListParm.parammaps.date =
- this.table.getdataListParm.parammaps.mydate
- this.table3.getdataListParm.parammaps.date =
- this.table.getdataListParm.parammaps.mydate
- this.table2.getdataListParm.parammaps.id = response.data.list[0].id
- this.table3.getdataListParm.parammaps.id = response.data.list[0].id
- this.table3.getdataListParm.parammaps.lpplantype =
- response.data.list[0].lpplantype
- this.getList2()
- this.getList3()
- } else if (response.data.list[0].lpplantype == 2) {
- // 撒料计划-撒料
- this.table2.getdataListParm.name = 'getDownloadplandt2ListV2'
- this.table3.getdataListParm.name = 'getDownloadplandtl1ListV2'
- this.table2.getdataListParm.parammaps.useinbartype = ''
- this.table3.getdataListParm.parammaps.useinbartype = ''
- this.table2.getdataListParm.parammaps.date =
- this.table.getdataListParm.parammaps.mydate
- this.table3.getdataListParm.parammaps.date =
- this.table.getdataListParm.parammaps.mydate
- this.table2.getdataListParm.parammaps.id = response.data.list[0].id
- this.table3.getdataListParm.parammaps.id = response.data.list[0].id
- this.table3.getdataListParm.parammaps.lpplantype =
- response.data.list[0].lpplantype
- this.getList2()
- this.getList3()
- } else if (response.data.list[0].lpplantype == 3) {
- // 剩料
- this.table2.getdataListParm.name = 'getDownloadplandt2ListV2'
- this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
- this.table2.getdataListParm.parammaps.useinbartype = 0
- this.table3.getdataListParm.parammaps.useinbartype = 1
- this.table2.getdataListParm.parammaps.date =
- this.table.getdataListParm.parammaps.mydate
- this.table3.getdataListParm.parammaps.date =
- this.table.getdataListParm.parammaps.mydate
- this.table2.getdataListParm.parammaps.id = response.data.list[0].id
- this.table3.getdataListParm.parammaps.id = response.data.list[0].id
- this.table3.getdataListParm.parammaps.lpplantype =
- response.data.list[0].lpplantype
- this.getList2()
- this.getList3()
- } else if (response.data.list[0].lpplantype == 4) {
- // 预混
- this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
- this.table2.getdataListParm.parammaps.useinbartype = ''
- this.table3.getdataListParm.parammaps.useinbartype = ''
- this.table2.getdataListParm.parammaps.id = response.data.list[0].id
- this.table3.getdataListParm.parammaps.lpplantype =
- response.data.list[0].lpplantype
- this.getList2()
- } else if (response.data.list[0].lpplantype == 5) {
- // 预称重计划
- this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
- this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
- this.table2.getdataListParm.parammaps.useinbartype = ''
- this.table3.getdataListParm.parammaps.useinbartype = ''
- this.table2.getdataListParm.parammaps.date =
- this.table.getdataListParm.parammaps.mydate
- this.table3.getdataListParm.parammaps.date =
- this.table.getdataListParm.parammaps.mydate
- this.table2.getdataListParm.parammaps.id = response.data.list[0].id
- this.table3.getdataListParm.parammaps.id = response.data.list[0].id
- this.table3.getdataListParm.parammaps.lpplantype =
- response.data.list[0].lpplantype
- this.getList2()
- this.getList3()
- }
- } else {
- this.table.list = []
- this.table3.getdataListParm.parammaps.lpplantype = ''
- this.table2.getdataListParm.parammaps.id = ''
- this.table3.getdataListParm.parammaps.id = ''
- // this.getList2()
- // this.getList3()
- this.table2.list = []
- this.table3.list = []
- }
- setTimeout(() => {
- this.table.listLoading = false
- }, 100)
- })
- },
- form_search() {
- this.getTMRList()
- this.table.getdataListParm.offset = 1
- this.getList()
- },
- handleEnableChange(row) {
- this.requestParam.name = 'updatedownloadenable'
- this.requestParam.parammaps = {}
- this.requestParam.parammaps.pastureid = row.pastureid
- this.requestParam.parammaps.id = row.id
- this.requestParam.parammaps.enable = row.enable
- PostDataByName(this.requestParam).then((response) => {
- if (response.msg === 'fail') {
- this.$notify({
- title: this.$t('driver.saveFail'),
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- } else {
- this.$notify({
- title: '',
- message: this.$t('driver.saveSuccess'),
- type: 'success',
- duration: 2000
- })
- this.getList()
- }
- })
- },
- getIsColor(arr) {
- var map = {}
- var dest = []
- for (var i = 0; i < arr.length; i++) {
- var ai = arr[i]
- if (!map[ai.pid]) {
- dest.push({
- pid: ai.pid,
- data: [ai]
- })
- map[ai.pid] = ai
- } else {
- for (var j = 0; j < dest.length; j++) {
- var dj = dest[j]
- if (dj.pid == ai.pid) {
- dj.data.push(ai)
- break
- }
- }
- }
- }
- console.log(dest)
- var newArr1 = []
- for (var i = 0; i < dest.length; i++) {
- var newArr = dest[i].data
- for (var j = 0; j < dest[i].data.length; j++) {
- dest[i].data[j].isColor = i
- newArr1.push(dest[i].data[j])
- }
- }
- console.log(newArr1)
- this.table.list = newArr1
- },
- tableRowClassName({ row }) {
- if (row.isColor % 2 == 0) {
- return 'warning-row'
- } else {
- return 'success-row'
- }
- },
- lpplantype: function (cellValue) {
- if (cellValue.lpplantype == 0) {
- return '撒料计划'
- } else if (cellValue.lpplantype == 1) {
- return '撒料计划-混料'
- } else if (cellValue.lpplantype == 2) {
- return '撒料计划-撒料'
- } else if (cellValue.lpplantype == 3) {
- return '剩料计划'
- } else if (cellValue.lpplantype == 4) {
- return '预混计划'
- } else if (cellValue.lpplantype == 5) {
- return '预称重计划'
- }
- },
- changeDate(val) {
- console.log('选择了日期', val)
- this.getList()
- // this.getList2()
- // this.getList3()
- var d = this.table.getdataListParm.parammaps.mydate
- var curDate = parseTime(new Date(), '{y}-{m}-{d}')
- if (d < curDate) {
- this.dataDisabled = true
- } else {
- this.dataDisabled = false
- }
- console.log(this.dataDisabled)
- this.parentDate = this.table.getdataListParm.parammaps.mydate
- console.log(this.parentDate, 'this.parentDate')
- },
- changePlanType(val) {
- console.log('选择了计划类型', val)
- this.getList()
- this.getList2()
- this.getList3()
- },
- changeFrequency(val) {
- console.log('选择了班次', val)
- this.getList()
- this.getList2()
- this.getList3()
- },
- // 日执行计划行点击
- tableRowClick(row, column, event) {
- console.log(row, column, event)
- console.log('点击计划类型', row.lpplantype)
- if (this.isOrder == false) {
- this.$message({
- type: 'error',
- message: this.$t('message.msg42'),
- duration: 2000
- })
- } else {
- if (column.label !== '操作') {
- this.isDetail = true // 点击行显示详情
- this.myheight = 80 * 5 + 50
- }
- }
- this.table2.getdataListParm.parammaps.havebutton = row.havebutton
- this.table3.getdataListParm.parammaps.havebutton = row.havebutton
- // 撒料计划0/撒料计划-混料1/撒料计划-撒料2/剩料计划3/预混计划4/预称重计划5
- if (row.lpplantype == 0) {
- // 撒料
- this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
- this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
- this.table2.getdataListParm.parammaps.useinbartype = ''
- this.table3.getdataListParm.parammaps.useinbartype = ''
- this.table2.getdataListParm.parammaps.date =
- this.table.getdataListParm.parammaps.mydate
- this.table3.getdataListParm.parammaps.date =
- this.table.getdataListParm.parammaps.mydate
- this.table2.getdataListParm.parammaps.id = row.id
- this.table3.getdataListParm.parammaps.id = row.id
- this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
- this.getList2()
- this.getList3()
- } else if (row.lpplantype == 1) {
- // 撒料计划-混料
- this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
- this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
- this.table2.getdataListParm.parammaps.useinbartype = ''
- this.table3.getdataListParm.parammaps.useinbartype = ''
- this.table2.getdataListParm.parammaps.date =
- this.table.getdataListParm.parammaps.mydate
- this.table3.getdataListParm.parammaps.date =
- this.table.getdataListParm.parammaps.mydate
- this.table2.getdataListParm.parammaps.id = row.id
- this.table3.getdataListParm.parammaps.id = row.id
- this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
- this.getList2()
- this.getList3()
- } else if (row.lpplantype == 2) {
- // 撒料计划-撒料
- this.table2.getdataListParm.name = 'getDownloadplandt2ListV2'
- this.table3.getdataListParm.name = 'getDownloadplandtl1ListV2'
- this.table2.getdataListParm.parammaps.useinbartype = ''
- this.table3.getdataListParm.parammaps.useinbartype = ''
- this.table2.getdataListParm.parammaps.date =
- this.table.getdataListParm.parammaps.mydate
- this.table3.getdataListParm.parammaps.date =
- this.table.getdataListParm.parammaps.mydate
- this.table2.getdataListParm.parammaps.id = row.id
- this.table3.getdataListParm.parammaps.id = row.id
- this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
- this.getList2()
- this.getList3()
- console.log(this.table3.getdataListParm.parammaps.lpplantype)
- } else if (row.lpplantype == 3) {
- // 剩料
- this.table2.getdataListParm.name = 'getDownloadplandt2ListV2'
- this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
- this.table2.getdataListParm.parammaps.useinbartype = 0
- this.table3.getdataListParm.parammaps.useinbartype = 1
- this.table2.getdataListParm.parammaps.date =
- this.table.getdataListParm.parammaps.mydate
- this.table3.getdataListParm.parammaps.date =
- this.table.getdataListParm.parammaps.mydate
- this.table2.getdataListParm.parammaps.id = row.id
- this.table3.getdataListParm.parammaps.id = row.id
- this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
- this.getList2()
- this.getList3()
- } else if (row.lpplantype == 4) {
- // 预混
- this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
- this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
- this.table2.getdataListParm.parammaps.useinbartype = ''
- this.table3.getdataListParm.parammaps.useinbartype = ''
- this.table2.getdataListParm.parammaps.id = row.id
- this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
- this.getList2()
- } else if (row.lpplantype == 5) {
- // 预称重计划
- this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
- this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
- this.table2.getdataListParm.parammaps.useinbartype = ''
- this.table3.getdataListParm.parammaps.useinbartype = ''
- this.table2.getdataListParm.parammaps.date =
- this.table.getdataListParm.parammaps.mydate
- this.table3.getdataListParm.parammaps.date =
- this.table.getdataListParm.parammaps.mydate
- this.table2.getdataListParm.parammaps.id = row.id
- this.table3.getdataListParm.parammaps.id = row.id
- this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
- this.getList2()
- this.getList3()
- }
- this.$forceUpdate()
- },
- handleCloseTable2() {
- this.isDetail = false
- this.myheight = document.documentElement.clientHeight - 280 + 140
- },
- // 计划内容操作详情
- getList2() {
- this.table2.listLoading = true
- this.table2.getdataListParm.parammaps.date =
- this.table.getdataListParm.parammaps.mydate
- GetDataByName(this.table2.getdataListParm).then((response) => {
- console.log('table数据', response.data.list)
- if (response.data.list !== null) {
- for (let i = 0; i < response.data.list.length; i++) {
- this.$set(response.data.list[i], 'Edit', false) // 编辑
- this.$set(response.data.list[i], 'NoEdit', true) // 不可编辑/输入
- this.$set(response.data.list[i], 'isCreate', false) // 新增操作
- this.$set(response.data.list[i], 'isUpdate', true) // 编辑操作
- this.$set(response.data.list[i], 'isUpdateSave', false) // 编辑保存
- }
- this.table2.list = response.data.list
- // 撒料计划0/撒料计划-混料1/撒料计划-撒料2/剩料计划3/预混计划4
- if (
- this.table3.getdataListParm.parammaps.lpplantype == 0 ||
- this.table3.getdataListParm.parammaps.lpplantype == 1 ||
- this.table3.getdataListParm.parammaps.lpplantype == 4
- ) {
- const arr = []
- var a = 0
- let b = this.table2.list[0].sort
- let c = 0
- for (let i = 0; i < this.table2.list.length; i++) {
- if (b !== parseInt(this.table2.list[i].sort)) {
- b = this.table2.list[i].sort
- // arr.push({ 'sort': '小计', 'weight': a.toFixed(parseInt(Cookies.get('decimal'))) })
- a = 0
- }
- a = a + parseFloat(this.table2.list[i].weight)
- c = c + parseFloat(this.table2.list[i].weight)
- arr.push(this.table2.list[i])
- }
- // arr.push({ 'sort': '小计', 'weight': a.toFixed(parseInt(Cookies.get('decimal'))) })
- arr.push({
- sort: this.$t('message.msg296'),
- weight: c.toFixed(parseInt(Cookies.get('decimal')))
- })
- this.table2.list = arr
- }
- if (this.table3.getdataListParm.parammaps.lpplantype == 2) {
- const arr = []
- var aa = 0
- let bb = this.table2.list[0].sort
- let cc = 0
- for (let i = 0; i < this.table2.list.length; i++) {
- if (bb !== parseInt(this.table2.list[i].sort)) {
- bb = this.table2.list[i].sort
- aa = 0
- }
- aa = aa + parseFloat(this.table2.list[i].weight)
- cc = cc + parseFloat(this.table2.list[i].weight)
- arr.push(this.table2.list[i])
- }
- arr.push({
- sort: this.$t('message.msg296'),
- weight: cc.toFixed(parseInt(Cookies.get('decimal')))
- })
- this.table2.list = arr
- console.log('this.table2.list', this.table2.list)
- console.log(this.table3.getdataListParm.parammaps.lpplantype)
- }
- console.log(this.table2.list)
- this.table2.pageNum = response.data.pageNum
- this.table2.pageSize = response.data.pageSize
- this.table2.total = response.data.total
- } else {
- this.table2.list = []
- }
- this.handleSpan()
- setTimeout(() => {
- this.table2.listLoading = false
- }, 100)
- })
- },
- // 计划内容栏舍详情
- getList3() {
- this.table3.listLoading = true
- this.table3.getdataListParm.parammaps.date =
- this.table.getdataListParm.parammaps.mydate
- GetDataByName(this.table3.getdataListParm).then((response) => {
- console.log('table数据', response.data.list)
- if (response.data.list !== null) {
- for (let i = 0; i < response.data.list.length; i++) {
- this.$set(response.data.list[i], 'Edit', false) // 编辑
- this.$set(response.data.list[i], 'NoEdit', true) // 不可编辑/输入
- this.$set(response.data.list[i], 'isCreate', false) // 新增操作
- this.$set(response.data.list[i], 'isUpdate', true) // 编辑操作
- this.$set(response.data.list[i], 'isUpdateSave', false) // 编辑保存
- }
- this.table3.list = response.data.list
- if (this.table3.getdataListParm.parammaps.lpplantype == 0) {
- const arr = []
- var a = 0
- let b = this.table3.list[0].sort
- let c = 0
- for (let i = 0; i < this.table3.list.length; i++) {
- if (b !== parseInt(this.table3.list[i].sort)) {
- b = this.table3.list[i].sort
- a = 0
- }
- a = a + parseFloat(this.table3.list[i].weight)
- c = c + parseFloat(this.table3.list[i].weight)
- arr.push(this.table3.list[i])
- }
- arr.push({
- sort: this.$t('message.msg296'),
- weight: c.toFixed(parseInt(Cookies.get('decimal')))
- })
- this.table3.list = arr
- }
- this.table3.pageNum = response.data.pageNum
- this.table3.pageSize = response.data.pageSize
- this.table3.total = response.data.total
- } else {
- this.table3.list = []
- }
- setTimeout(() => {
- this.table3.listLoading = false
- }, 100)
- })
- },
- // 新生成
- handleCreate() {
- console.log('点击了新生成')
- this.newGeneration.temp.inputDatetime = [
- parseTime(new Date(), '{y}-{m}-{d}'),
- parseTime(new Date(), '{y}-{m}-{d}')
- ]
- GetDataByName(this.newGeneration.getdataListParm).then((response) => {
- console.log('table数据', response.data.list)
- if (response.data.list !== null) {
- if (response.data.list[0].vmsg == '存在未分配') {
- this.newGeneration.temp.tips = true
- this.$message({
- type: 'warning',
- message: this.$t('message.msg191'),
- duration: 2000
- })
- this.getTips()
- } else {
- this.newGeneration.temp.tips = false
- this.newGeneration.dialogStatus = 'newGeneration'
- this.newGeneration.dialogFormVisible = true
- }
- }
- })
- },
- getTips() {
- const url = 'authdata/feedp/undistribute'
- const data = {}
- // data.times = 1
- data.times = this.myMaxTimes
- data.pastureid = Cookies.get('pastureid')
- this.tipsList = []
- postJson(url, data).then((response) => {
- if (response.data !== null) {
- this.tipsList = response.data
- // if(this.myMaxTimes == 1){
- // this.tipsList = response.data.one
- // }else if(this.myMaxTimes == 2){
- // this.tipsList.push(response.data.one,response.data.two)
- // }else if(this.myMaxTimes == 3){
- // this.tipsList.push(response.data.one,response.data.two,response.data.three)
- // }else if(this.myMaxTimes == 4){
- // this.tipsList.push(response.data.one,response.data.two,response.data.three,response.data.four)
- // }
- } else {
- this.tipsList = []
- }
- console.log('this.tipsList==>', this.tipsList)
- this.newGeneration.dialogStatus = 'newGeneration'
- this.newGeneration.dialogFormVisible = true
- })
- },
- DateDiff(sDate1, sDate2) {
- console.log(sDate1, sDate2)
- var aDate, oDate1, oDate2, iDays
- aDate = sDate1.split('-')
- oDate1 = new Date(aDate[0], aDate[1], aDate[2]) // 转换为12-18-2006格式
- aDate = sDate2.split('-')
- oDate2 = new Date(aDate[0], aDate[1], aDate[2])
- iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 / 24) // 把相差的毫秒数转换为天数
- this.newGeneration.temp.days = parseInt(iDays) + 1
- return iDays
- },
- newGenerationData() {
- console.log('点击了新生成保存', this.newGeneration.temp)
- this.newGenerationLoading = true
- this.isokDisable = true
- this.$refs['temp'].validate((valid) => {
- if (valid) {
- this.newGeneration.temp.startTime = parseTime(
- this.newGeneration.temp.inputDatetime[0],
- '{y}-{m}-{d}'
- )
- this.newGeneration.temp.stopTime = parseTime(
- this.newGeneration.temp.inputDatetime[1],
- '{y}-{m}-{d}'
- )
- this.DateDiff(
- this.newGeneration.temp.stopTime,
- this.newGeneration.temp.startTime
- )
- this.requestParam = {}
- this.requestParam.common = { returnmap: '0' }
- this.requestParam.data = []
- this.requestParam.data[0] = {
- name: 'checkDLPIsStart',
- type: 'v',
- parammaps: {
- pastureid: Cookies.get('pastureid'),
- startTime: this.newGeneration.temp.startTime
- }
- }
- this.requestParam.data[1] = {
- name: 'checkPreMixStorage',
- type: 'e',
- parammaps: {
- pastureid: Cookies.get('pastureid'),
- days: this.newGeneration.temp.days
- }
- }
- this.requestParam.data[2] = {
- name: 'createdownloadedplan',
- type: 'e',
- parammaps: {
- pastureid: Cookies.get('pastureid'),
- startTime: this.newGeneration.temp.startTime,
- stopTime: this.newGeneration.temp.stopTime
- }
- }
- ExecDataByConfig(this.requestParam).then((response) => {
- console.log('新生成保存发送参数', this.requestParam)
- if (response.msg === 'fail') {
- this.$notify({
- title: this.$t('driver.saveFail'),
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- this.isokDisable = false
- this.newGenerationLoading = false
- } else {
- this.$notify({
- title: '',
- message: this.$t('driver.saveSuccess'),
- type: 'success',
- duration: 2000
- })
- this.newGeneration.dialogFormVisible = false
- this.getList()
- this.isokDisable = false
- this.newGenerationLoading = false
- }
- })
- }
- })
- },
- // 修改计划
- handleRevisePlan(data) {
- this.dialogFull = false
- var arr = []
- if (this.table.list.length > 0) {
- for (let i = 0; i < this.table.list.length; i++) {
- if (this.table.list[i].havebutton == 1) {
- arr.push(this.table.list[i])
- }
- }
- }
- if (arr.length !== this.table.list.length) {
- console.log('点击了修改计划1', this.activeName)
- this.isShowDialog = true
- this.activeName = '栏舍配方'
- console.log('点击了修改计划2', this.activeName)
- } else {
- this.$message({ type: 'error', message: this.$t('message.msg192') })
- }
- },
- handleExport() {
- this.downLoad.getdataListParm.parammaps.date =
- this.table.getdataListParm.parammaps.mydate
- this.downLoad.getdataListParm.parammaps.lpplantype =
- this.table.getdataListParm.parammaps.lpplantype
- this.downLoad.getdataListParm.parammaps.times =
- this.table.getdataListParm.parammaps.times
- this.downLoad.getdataListParm.parammaps.enable =
- this.table.getdataListParm.parammaps.enable
- this.downLoad.getdataListParm.parammaps.enable2 =
- this.table.getdataListParm.parammaps.enable2
- var exportTitle = ''
- if (this.table.getdataListParm.parammaps.plandimen == '1') {
- if (this.table.getdataListParm.parammaps.enable3 == '0') {
- this.downLoad.getdataListParm.name = 'downloadPlanTLJDTMR'
- exportTitle = this.table.getdataListParm.parammaps.mydate + this.$t('message.msg353.a')
- } else if (this.table.getdataListParm.parammaps.enable3 == '1') {
- this.downLoad.getdataListParm.name = 'downloadPlanTLLDTMR'
- exportTitle = this.table.getdataListParm.parammaps.mydate + this.$t('message.msg353.b')
- } else if (this.table.getdataListParm.parammaps.enable3 == '2') {
- this.downLoad.getdataListParm.name = 'downloadPlanSLJDTMR'
- exportTitle = this.table.getdataListParm.parammaps.mydate + this.$t('message.msg353.c')
- } else if (this.table.getdataListParm.parammaps.enable3 == '3') {
- this.downLoad.getdataListParm.name = 'downloadPlanTSLJDTMR'
- exportTitle =
- this.table.getdataListParm.parammaps.mydate + this.$t('message.msg353.d')
- } else if (this.table.getdataListParm.parammaps.enable3 == '4') {
- this.downLoad.getdataListParm.name = 'downloadPlanTSLLDTMR'
- exportTitle =
- this.table.getdataListParm.parammaps.mydate + this.$t('message.msg353.g')
- } else if (this.table.getdataListParm.parammaps.enable3 == '5') {
- this.downLoad.getdataListParm.name = 'downloadPlanBZJDTMR'
- exportTitle = this.table.getdataListParm.parammaps.mydate + this.$t('message.msg353.e')
- } else {
- this.downLoad.getdataListParm.name = 'downloadPlanSFJDTMR'
- exportTitle = this.table.getdataListParm.parammaps.mydate + this.$t('message.msg353.f')
- }
- } else {
- if (this.table.getdataListParm.parammaps.enable3 == '0') {
- this.downLoad.getdataListParm.name = 'downloadPlanTLJD'
- exportTitle = this.table.getdataListParm.parammaps.mydate + this.$t('message.msg353.a')
- } else if (this.table.getdataListParm.parammaps.enable3 == '1') {
- this.downLoad.getdataListParm.name = 'downloadPlanTLLD'
- exportTitle = this.table.getdataListParm.parammaps.mydate + this.$t('message.msg353.b')
- } else if (this.table.getdataListParm.parammaps.enable3 == '2') {
- this.downLoad.getdataListParm.name = 'downloadPlanSLJD'
- exportTitle = this.table.getdataListParm.parammaps.mydate + this.$t('message.msg353.c')
- } else if (this.table.getdataListParm.parammaps.enable3 == '3') {
- this.downLoad.getdataListParm.name = 'downloadPlanTSLJD'
- exportTitle =
- this.table.getdataListParm.parammaps.mydate + this.$t('message.msg353.d')
- } else if (this.table.getdataListParm.parammaps.enable3 == '4') {
- this.downLoad.getdataListParm.name = 'downloadPlanTSLLD'
- exportTitle =
- this.table.getdataListParm.parammaps.mydate + this.$t('message.msg353.g')
- } else if (this.table.getdataListParm.parammaps.enable3 == '5') {
- this.downLoad.getdataListParm.name = 'downloadPlanBZJD'
- exportTitle = this.table.getdataListParm.parammaps.mydate + this.$t('message.msg353.e')
- } else {
- this.downLoad.getdataListParm.name = 'downloadPlanSFJD'
- exportTitle = this.table.getdataListParm.parammaps.mydate + this.$t('message.msg353.f')
- }
- }
- GetReportform(this.downLoad.getdataListParm).then((response) => {
- if (response.data.list !== null) {
- this.downLoad.labelList = []
- var filterValArr = []
- for (let i = 0; i < response.data.list.data1.length; i++) {
- this.downLoad.labelList.push(response.data.list.data1[i].label)
- filterValArr.push(response.data.list.data1[i].prop)
- }
- this.downLoad.list = response.data.list.data2
- } else {
- this.downLoad.list = []
- }
- var multiHeaderArr = []
- for (let i = 0; i < this.downLoad.labelList.length; i++) {
- if (i == 0) {
- multiHeaderArr.push(exportTitle)
- } else {
- multiHeaderArr.push('')
- }
- }
- import('@/vendor/Export5Excel').then((excel) => {
- const multiHeader = [multiHeaderArr]
- const multiHeader2 = [this.downLoad.labelList]
- const filterVal = filterValArr
- const data = this.downLoad.list.map((v) => filterVal.map((j) => v[j]))
- const merges = []
- excel.export_json_to_excel({
- multiHeader,
- multiHeader2,
- data,
- filename: exportTitle,
- merges
- })
- })
- })
- },
- rowDrop() {
- console.log(
- document.querySelector('#table1 .el-table__body-wrapper tbody')
- )
- const tbody = document.querySelector(
- '#table1 .el-table__body-wrapper tbody'
- )
- // this.sorTable()
- const that = this
- var sortable = Sortable.create(tbody, {
- disabled: that.dropState,
- onChoose({ newIndex, oldIndex }) {
- console.log(that.isOrder, 'that.isOrder == false')
- console.log(that.dropState, 'that.dropState')
- if (that.dropState == true || that.isOrder == true) {
- sortable.destroy()
- }
- },
- onEnd(evt) {
- var tableList = [...that.table.list] // 保留拖动前数据
- const targetRow = that.table.list.splice(evt.oldIndex, 1)[0] // 拖动数据
- const targetRow2 = that.table.list[evt.newIndex] // 拖动后下方数据
- const targetRow3 = that.table.list[evt.newIndex - 1] // 拖动后上方数据
- console.log(targetRow, 'targetRow')
- console.log(targetRow2, 'targetRow2')
- console.log(targetRow3, 'targetRow3')
- that.table.list.splice(evt.newIndex, 0, targetRow)
- // ==========
- // 已执行的计划不可拖动
- if (targetRow.havebutton == 1) {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- that.$message({
- type: 'error',
- message: this.$t('message.msg194'),
- duration: 2000
- })
- return false
- }
- // 相同班次之间可以拖动
- // if (targetRow2 !== undefined && targetRow3 !== undefined) {
- // if (targetRow.times !== targetRow2.times && targetRow.times !== targetRow3.times) {
- // that.$nextTick(() => {
- // that.$set(that.table, 'list', tableList)
- // })
- // that.$message({ type: 'error', message: '因班次不同不可调整顺序', duration: 2000 })
- // return false
- // }
- // } else if (targetRow2 !== undefined && targetRow3 == undefined) {
- // if (targetRow.times !== targetRow2.times) {
- // that.$nextTick(() => {
- // that.$set(that.table, 'list', tableList)
- // })
- // that.$message({ type: 'error', message: '因班次不同不可调整顺序', duration: 2000 })
- // return false
- // }
- // } else if (targetRow2 == undefined && targetRow3 !== undefined) {
- // if (targetRow.times !== targetRow3.times) {
- // that.$nextTick(() => {
- // that.$set(that.table, 'list', tableList)
- // })
- // that.$message({ type: 'error', message: '因班次不同不可调整顺序', duration: 2000 })
- // return false
- // }
- // }
- // 撒料计划0,
- // 撒料计划-混料1
- // 撒料计划-撒料2
- // 剩料计划3
- // 预混计划4
- // 预称重计划5
- if (targetRow.lpplantype == 1) {
- // 拖动数据为撒料计划-混料
- if (targetRow2 == undefined) {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- } else if (
- targetRow2 !== undefined &&
- targetRow2.pid == targetRow.pid
- ) {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- } else {
- var pidArr = [] // pid相同的值
- var pidArr1 = [] //
- var index // 索引
- for (let i = 0; i < tableList.length; i++) {
- if (tableList[i].pid == targetRow.pid) {
- pidArr.push(tableList[i])
- } else {
- pidArr1.push(tableList[i])
- }
- }
- // 找到对应上方pid 的ID
- // 比如说id 580243 找到对应的索引
- if (targetRow3 !== undefined) {
- for (let i = 0; i < pidArr1.length; i++) {
- if (pidArr1[i].id == targetRow3.id) {
- index = i
- }
- }
- } else {
- for (let i = 0; i < pidArr1.length; i++) {
- if (pidArr1[i].id == targetRow2.id) {
- index = i - 1
- }
- }
- }
- pidArr1.splice(index + 1, 0, ...pidArr)
- console.log(pidArr1)
- that.$nextTick(() => {
- that.table.list = pidArr1
- })
- }
- if (targetRow2 !== undefined && targetRow3 !== undefined) {
- if (targetRow2.pid == targetRow3.pid) {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- that.$message({
- type: 'error',
- message: this.$t('message.msg195'),
- duration: 2000
- })
- return false
- }
- }
- } else if (targetRow.lpplantype == 5) {
- // 拖动数据为预称重计划
- if (targetRow2 !== undefined) {
- console.log(targetRow3, targetRow2, 'zhidao')
- if (targetRow3 !== undefined) {
- if (
- targetRow3.pid !== targetRow.pid &&
- targetRow2.pid !== targetRow.pid
- ) {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- that.$message({
- type: 'error',
- message: this.$t('message.msg196'),
- duration: 2000
- })
- return false
- } else {
- console.log('wojinlaile', targetRow2, targetRow)
- if (
- targetRow3.lpplantype == 0 &&
- targetRow2.pid !== targetRow.pid
- ) {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- that.$message({
- type: 'error',
- message: this.$t('message.msg197'),
- duration: 2000
- })
- return false
- }
- if (
- targetRow2.lpplantype !== 5 &&
- targetRow3.lpplantype !== 5
- ) {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- that.$message({
- type: 'error',
- message: this.$t('message.msg196'),
- duration: 2000
- })
- return false
- }
- }
- } else {
- if (targetRow2.pid !== targetRow.pid) {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- that.$message({
- type: 'error',
- message: this.$t('message.msg196'),
- duration: 2000
- })
- return false
- } else {
- if (targetRow2.pid !== targetRow.pid) {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- that.$message({
- type: 'error',
- message: this.$t('message.msg197'),
- duration: 2000
- })
- return false
- }
- }
- }
- } else {
- if (targetRow2 == undefined) {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- that.$message({
- type: 'error',
- message: this.$t('message.msg196'),
- duration: 2000
- })
- return false
- } else if (targetRow3.pid !== targetRow.pid) {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- that.$message({
- type: 'error',
- message: this.$t('message.msg196'),
- duration: 2000
- })
- return false
- } else {
- if (targetRow3.lpplantype == 0) {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- that.$message({
- type: 'error',
- message: this.$t('message.msg197'),
- duration: 2000
- })
- return false
- }
- }
- }
- if (targetRow2 !== undefined && targetRow3 !== undefined) {
- if (
- targetRow2.pid !== targetRow.pid &&
- targetRow3.pid !== targetRow.pid
- ) {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- that.$message({
- type: 'error',
- message: this.$t('message.msg195'),
- duration: 2000
- })
- return false
- } else if (
- targetRow3.pid == targetRow.pid &&
- (targetRow3.lpplantype == 1 || targetRow3.lpplantype == 2)
- ) {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- that.$message({
- type: 'error',
- message: this.$t('message.msg196'),
- duration: 2000
- })
- return false
- }
- }
- } else if (targetRow.lpplantype == 2) {
- // 拖动数据为撒料计划-撒料
- if (targetRow2 == undefined) {
- if (targetRow3.pid !== targetRow.pid) {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- that.$message({
- type: 'error',
- message: this.$t('message.msg198'),
- duration: 2000
- })
- return false
- }
- } else {
- if (
- targetRow2.lpplantype == 1 &&
- (targetRow2.pid == targetRow.pid || targetRow2 == undefined)
- ) {
- // 拖动数据下方为撒料计划-混料时且pid相同,不可拖动,提示
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- that.$message({
- type: 'error',
- message: this.$t('message.msg199'),
- duration: 2000
- })
- return false
- } else if (
- targetRow.lpplantype == 2 &&
- (targetRow2.pid == targetRow.pid ||
- targetRow3.pid == targetRow.pid ||
- targetRow2 == undefined ||
- targetRow3 == undefined)
- ) {
- console.log('正常拖动')
- } else {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- that.$message({
- type: 'error',
- message: this.$t('message.msg198'),
- duration: 2000
- })
- return false
- }
- }
- if (targetRow2 !== undefined && targetRow3 !== undefined) {
- if (targetRow2.pid == targetRow3.pid) {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- that.$message({
- type: 'error',
- message: this.$t('message.msg195'),
- duration: 2000
- })
- return false
- }
- }
- } else if (targetRow.lpplantype == 0) {
- // 拖动数据为撒料计划
- console.log('遍历有相同的pid,一起跟着拖动3')
- var pidArr = [] // pid相同的值
- var pidArr1 = [] //
- var index // 索引
- for (let i = 0; i < tableList.length; i++) {
- if (tableList[i].pid == targetRow.pid) {
- pidArr.push(tableList[i])
- } else {
- pidArr1.push(tableList[i])
- }
- }
- if (pidArr.length > 0) {
- // 找到对应上方pid 的ID
- // 比如说id 580243 找到对应的索引
- if (targetRow3 !== undefined) {
- for (let i = 0; i < pidArr1.length; i++) {
- if (pidArr1[i].id == targetRow3.id) {
- index = i
- }
- }
- } else {
- for (let i = 0; i < pidArr1.length; i++) {
- if (pidArr1[i].id == targetRow2.id) {
- index = i - 1
- }
- }
- }
- pidArr1.splice(index + 1, 0, ...pidArr)
- console.log(pidArr1)
- that.$nextTick(() => {
- that.table.list = pidArr1
- })
- }
- if (targetRow2 !== undefined && targetRow3 !== undefined) {
- if (targetRow2.pid == targetRow3.pid) {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- that.$message({
- type: 'error',
- message: this.$t('message.msg200'),
- duration: 2000
- })
- return false
- }
- }
- } else if (targetRow.lpplantype == 3 || targetRow.lpplantype == 4) {
- if (targetRow2 !== undefined && targetRow3 !== undefined) {
- if (targetRow2.pid == targetRow3.pid) {
- if (targetRow2.lpplantype == 5 && targetRow3.lpplantype == 5) {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- that.$message({
- type: 'error',
- message: this.$t('message.msg201'),
- duration: 2000
- })
- return false
- } else if (
- (targetRow.pid == targetRow2.pid &&
- targetRow.lpplantype == 3 &&
- targetRow2.lpplantype == 3) ||
- (targetRow.pid == targetRow3.pid &&
- targetRow.lpplantype == 3 &&
- targetRow3.lpplantype == 3)
- ) {
- console.log('剩料之间可以互相拖动')
- console.log(tableList)
- } else {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- // 撒料计划0,
- // 撒料计划-混料1
- // 撒料计划-撒料2
- // 剩料计划3
- // 预混计划4
- // 预称重计划5
- if (targetRow3.lpplantype == 0) {
- that.$set(targetRow3, 'mylpplantype', '撒料计划')
- } else if (targetRow3.lpplantype == 1) {
- that.$set(targetRow3, 'mylpplantype', '撒料计划-混料')
- } else if (targetRow3.lpplantype == 2) {
- that.$set(targetRow3, 'mylpplantype', '撒料计划-撒料')
- } else if (targetRow3.lpplantype == 3) {
- that.$set(targetRow3, 'mylpplantype', '剩料计划')
- } else if (targetRow3.lpplantype == 4) {
- that.$set(targetRow3, 'mylpplantype', '预混计划')
- } else if (targetRow3.lpplantype == 5) {
- that.$set(targetRow3, 'mylpplantype', '预称重计划')
- }
- if (targetRow2.lpplantype == 0) {
- that.$set(targetRow2, 'mylpplantype', '撒料计划')
- } else if (targetRow2.lpplantype == 1) {
- that.$set(targetRow2, 'mylpplantype', '撒料计划-混料')
- } else if (targetRow2.lpplantype == 2) {
- that.$set(targetRow2, 'mylpplantype', '撒料计划-撒料')
- } else if (targetRow2.lpplantype == 3) {
- that.$set(targetRow2, 'mylpplantype', '剩料计划')
- } else if (targetRow2.lpplantype == 4) {
- that.$set(targetRow2, 'mylpplantype', '预混计划')
- } else if (targetRow2.lpplantype == 5) {
- that.$set(targetRow2, 'mylpplantype', '预称重计划')
- }
- var message =
- '不可拖动至' +
- targetRow3.mylpplantype +
- '跟' +
- targetRow2.mylpplantype +
- '之间'
- that.$message({
- type: 'error',
- message: message,
- duration: 2000
- })
- return false
- }
- }
- }
- // ========
- // var pidArr = [] // pid相同的值
- // var pidArr1 = [] //
- // var index // 索引
- // for (let i = 0; i < tableList.length; i++) {
- // if (tableList[i].pid == targetRow.pid) {
- // pidArr.push(tableList[i])
- // } else {
- // pidArr1.push(tableList[i])
- // }
- // }
- // if (pidArr.length > 0) {
- // // 找到对应上方pid 的ID
- // // 比如说id 580243 找到对应的索引
- // if (targetRow3 !== undefined) {
- // for (let i = 0; i < pidArr1.length; i++) {
- // if (pidArr1[i].id == targetRow3.id) {
- // index = i
- // }
- // }
- // } else {
- // for (let i = 0; i < pidArr1.length; i++) {
- // if (pidArr1[i].id == targetRow2.id) {
- // index = i - 1
- // }
- // }
- // }
- // pidArr1.splice(index + 1, 0, ...pidArr)
- // console.log(pidArr1)
- // that.$nextTick(() => {
- // that.table.list = pidArr1
- // })
- // }
- // if (targetRow2 !== undefined && targetRow3 !== undefined) {
- // if (targetRow2.pid == targetRow3.pid) {
- // that.$nextTick(() => {
- // that.$set(that.table, 'list', tableList)
- // })
- // that.$message({ type: 'error', message: '不可将其他计划拖动至预称重计划之间9999', duration: 2000 })
- // return false
- // }
- // }
- }
- // ===
- }
- })
- },
- // 复制
- handleCopy() {
- if (this.table.list.length > 0) {
- this.newGeneration.temp = {}
- this.newGeneration.dialogStatus = 'copy'
- this.newGeneration.dialogFormVisible = true
- } else {
- this.$message({ type: 'error', message: this.$t('message.msg202') })
- }
- },
- copyData() {
- console.log(this.newGeneration.temp.copyInputDatetime)
- this.isokDisable = true
- setTimeout(() => {
- this.isokDisable = false
- }, 5000)
- this.$refs['temp'].validate((valid) => {
- if (valid) {
- this.requestParam.name = 'copydownloadedplan'
- this.requestParam.parammaps = {}
- this.requestParam.parammaps.pastureid = Cookies.get('pastureid')
- this.requestParam.parammaps.date =
- this.table.getdataListParm.parammaps.mydate
- this.requestParam.parammaps.startTime = parseTime(
- this.newGeneration.temp.copyInputDatetime[0],
- '{y}-{m}-{d}'
- )
- this.requestParam.parammaps.stopTime = parseTime(
- this.newGeneration.temp.copyInputDatetime[1],
- '{y}-{m}-{d}'
- )
- PostDataByName(this.requestParam).then((response) => {
- if (response.msg === 'fail') {
- this.$notify({
- title: this.$t('driver.saveFail'),
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- } else {
- this.$notify({
- title: this.$t('common.succes'),
- message: this.$t('driver.saveSuccess'),
- type: 'success',
- duration: 2000
- })
- this.newGeneration.dialogFormVisible = false
- this.getList()
- }
- })
- }
- })
- },
- handleChangeOrder() {
- // 拖动顺序
- this.isOrder = false
- this.rowDrop()
- },
- saveChangeOrder() {
- // 保存顺序
- var sortList = []
- for (let i = 0; i < this.table.list.length; i++) {
- var obj = {}
- obj.sort = i
- obj.pastureid = this.table.list[i].pastureid
- obj.id = this.table.list[i].id
- sortList.push(obj)
- }
- console.log(sortList)
- this.requestParam = {}
- this.requestParam.common = { returnmap: '0' }
- this.requestParam.data = []
- this.requestParam.data[0] = {
- name: 'insertSpotList',
- resultmaps: { list: sortList }
- }
- this.requestParam.data[0].children = []
- this.requestParam.data[0].children[0] = {
- name: 'updatedownloadesort',
- type: 'e',
- parammaps: {
- id: '@insertSpotList.id',
- pastureid: '@insertSpotList.pastureid',
- sort: '@insertSpotList.sort'
- }
- }
- ExecDataByConfig(this.requestParam).then((response) => {
- console.log('顺序切换保存发送参数', this.requestParam)
- if (response.msg === 'fail') {
- this.$notify({
- title: this.$t('message.msg51'),
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- } else {
- this.$notify({
- title: '',
- message: this.$t('message.msg50'),
- type: 'success',
- duration: 2000
- })
- this.getList()
- this.isOrder = true
- }
- })
- },
- cancelChangeOrder() {
- // 取消顺序
- this.getList()
- this.isOrder = true
- },
- handleDataSynchronization() {
- MessageBox.confirm(this.$t('message.msg345'), {
- confirmButtonText: this.$t('common.confirm'),
- cancelButtonText: this.$t('common.cancel'),
- type: 'warning'
- })
- .then(() => {
- this.requestParam = {}
- this.requestParam.pastureid = Cookies.get('pastureid')
- // this.$alert('正在同步', { confirmButtonText: '确定' })
- this.dataSynchronization.dialogFormVisible = true
- getDorm(this.requestParam).then((response) => {
- console.log(response)
- if (response.msg == 'ok') {
- this.dataSynchronization.dialogFormVisible = false
- this.$notify({
- title: this.$t('message.msg203'),
- message: this.$t('message.msg203'),
- type: 'success',
- duration: 2000
- })
- } else {
- this.$notify({
- title: this.$t('message.msg204'),
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- this.dataSynchronization.dialogFormVisible = false
- }
- })
- })
- .catch(() => {
- this.$message({ type: 'info', message: this.$t('message.msg205') })
- })
- },
- handleRowDelete(row) {
- console.log('删除')
- MessageBox.confirm(this.$t('common.delMsg'), {
- confirmButtonText: this.$t('common.confirm'),
- cancelButtonText: this.$t('common.cancel'),
- type: 'warning'
- })
- .then(() => {
- this.selectList = []
- this.requestParam = {}
- this.requestParam.name = 'delDownloadedplan'
- this.requestParam.parammaps = {}
- this.requestParam.parammaps.pastureid = row.pastureid
- this.requestParam.parammaps.id = row.id
- PostDataByName(this.requestParam).then((response) => {
- if (response.msg === 'fail') {
- this.$notify({
- title: this.$t('common.delfail'),
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- } else {
- this.$notify({
- title: this.$t('common.succes'),
- message: this.$t('common.delSuccess'),
- type: 'success',
- duration: 2000
- })
- this.getList()
- }
- })
- })
- .catch(() => {
- this.$message({ type: 'info', message: this.$t('common.cancelMsg') })
- })
- },
- handleRowSort(row) {
- this.$prompt(this.$t('message.msg206'), this.$t('message.msg207'), {
- inputPlaceholder: this.$t('message.msg208'),
- confirmButtonText: '确定',
- cancelButtonText: this.$t('common.cancel'),
- inputPattern: /^\d+$/,
- inputErrorMessage: this.$t('message.msg209')
- })
- .then(({ value }) => {
- const url = 'authdata/plan/sort/edit'
- const data = {
- planId: row.id,
- mydate: row.mydate,
- sort: value
- }
- postJson(url, data).then((response) => {
- if (response.msg === 'fail') {
- this.$notify({
- title: this.$t('message.msg37'),
- message: response.data,
- type: 'error',
- duration: 2000
- })
- } else {
- this.$notify({
- title: this.$t('common.succes'),
- message: this.$t('message.msg153'),
- type: 'success',
- duration: 2000
- })
- this.getList()
- }
- })
- })
- .catch(() => {
- this.$message({
- type: 'info',
- message: this.$t('message.msg210')
- })
- })
- },
- handleSpan() {
- this.mergekeys.forEach((key) => {
- this.spanObj[key] = []
- let position = 0
- this.table2.list.forEach((item, index) => {
- if (index === 0) {
- this.spanObj[key].push(1)
- position = 0
- } else {
- if (key == 'description') {
- if (
- this.table2.list[index][key] ===
- this.table2.list[index - 1][key] &&
- this.table2.list[index]['sort'] ===
- this.table2.list[index - 1]['sort']
- ) {
- this.spanObj[key][position] += 1
- this.spanObj[key].push(0)
- } else {
- this.spanObj[key].push(1)
- position = index
- }
- } else {
- if (
- this.table2.list[index][key] ===
- this.table2.list[index - 1][key]
- ) {
- this.spanObj[key][position] += 1
- this.spanObj[key].push(0)
- } else {
- this.spanObj[key].push(1)
- position = index
- }
- }
- }
- })
- })
- },
- objectSpanMethod({ row, column, rowIndex, columnIndex }) {
- for (let i = 0; i < this.mergekeys.length; i++) {
- if (column.property === this.mergekeys[i]) {
- const _row = this.spanObj[this.mergekeys[i]][rowIndex]
- const _col = _row > 0 ? 1 : 0
- return {
- rowspan: _row,
- colspan: _col
- }
- }
- }
- },
- form_deleteRecord() {
- this.deleteRecord.dialogStatus = 'deleteRecord'
- this.deleteRecord.dialogFormVisible = true
- this.deleteRecord.mydate = this.table.getdataListParm.parammaps.mydate
- this.getDeleteRecordList()
- },
- changeDeleteRecordDate() {
- this.getDeleteRecordList()
- },
- getDeleteRecordList() {
- const url = 'authdata/GetDataByName'
- const data = {}
- data.name = 'getDownloadedplanDeleteList'
- data.page = 1
- data.offset = 1
- data.pagecount = ''
- data.returntype = 'Map'
- data.parammaps = {}
- data.parammaps.pastureid = Cookies.get('pastureid')
- data.parammaps.mydate = this.deleteRecord.mydate
- postJson(url, data).then((response) => {
- if (response.data !== null) {
- this.deleteRecord.list = response.data.list
- } else {
- this.deleteRecord.list = []
- }
- this.deleteRecord.total = response.data.total
- })
- },
- handleSelect(val) {
- console.log('勾选数据', val)
- this.selectList = val
- },
- handleTakeEffect() {
- if (this.selectList.length == 0) {
- this.$message({
- type: 'error',
- message: this.$t('message.msg12'),
- duration: 2000
- })
- } else {
- MessageBox.confirm(
- this.$t('message.msg29') +
- this.selectList.length +
- this.$t('message.msg141'),
- {
- confirmButtonText: this.$t('common.confirm'),
- cancelButtonText: this.$t('common.cancel'),
- type: 'warning'
- }
- ).then(() => {
- for (let i = 0; i < this.selectList.length; i++) {
- // this.$set(this.selectList[i], 'enable', '1')
- this.selectList[i].enable = 1
- }
- console.log('生效', this.selectList)
- this.requestParam.common = {
- returnmap: '0'
- }
- this.requestParam.data = []
- this.requestParam.data[0] = {
- name: 'insertSpotList',
- resultmaps: {
- list: this.selectList
- }
- }
- this.requestParam.data[0].children = []
- this.requestParam.data[0].children[0] = {
- name: 'updateDownloadedplanEnable',
- type: 'e',
- parammaps: {
- enable: '@insertSpotList.enable',
- id: '@insertSpotList.id',
- pastureid: '@insertSpotList.pastureid'
- }
- }
- ExecDataByConfig(this.requestParam).then((response) => {
- console.log('生效保存发送参数', this.requestParam)
- if (response.msg === 'fail') {
- this.$notify({
- title: this.$t('message.msg11'),
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- } else {
- this.$notify({
- title: this.$t('common.succes'),
- message: this.$t('message.msg10'),
- type: 'success',
- duration: 2000
- })
- this.getList()
- }
- })
- })
- }
- },
- handleDisable() {
- if (this.selectList.length == 0) {
- this.$message({
- type: 'error',
- message: this.$t('message.msg12'),
- duration: 2000
- })
- } else {
- MessageBox.confirm(
- this.$t('message.msg29') +
- this.selectList.length +
- this.$t('message.msg30'),
- {
- confirmButtonText: this.$t('common.confirm'),
- cancelButtonText: this.$t('common.cancel'),
- type: 'warning'
- }
- ).then(() => {
- for (let i = 0; i < this.selectList.length; i++) {
- // this.$set(this.selectList[i], 'enable', '1')
- this.selectList[i].enable = 0
- }
- console.log('禁用', this.selectList)
- this.requestParam.common = {
- returnmap: '0'
- }
- this.requestParam.data = []
- this.requestParam.data[0] = {
- name: 'insertSpotList',
- resultmaps: {
- list: this.selectList
- }
- }
- this.requestParam.data[0].children = []
- this.requestParam.data[0].children[0] = {
- name: 'updateDownloadedplanEnable',
- type: 'e',
- parammaps: {
- enable: '@insertSpotList.enable',
- id: '@insertSpotList.id',
- pastureid: '@insertSpotList.pastureid'
- }
- }
- ExecDataByConfig(this.requestParam).then((response) => {
- console.log('禁用保存发送参数', this.requestParam)
- if (response.msg === 'fail') {
- this.$notify({
- title: this.$t('message.msg13'),
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- } else {
- this.$notify({
- title: this.$t('common.succes'),
- message: this.$t('message.msg15'),
- type: 'success',
- duration: 2000
- })
- this.getList()
- }
- })
- })
- }
- },
- handlePrint() {
- this.downLoad.getdataListParm.parammaps.date =
- this.table.getdataListParm.parammaps.mydate
- this.downLoad.getdataListParm.parammaps.lpplantype =
- this.table.getdataListParm.parammaps.lpplantype
- this.downLoad.getdataListParm.parammaps.times =
- this.table.getdataListParm.parammaps.times
- this.downLoad.getdataListParm.parammaps.enable =
- this.table.getdataListParm.parammaps.enable
- this.downLoad.getdataListParm.parammaps.enable2 =
- this.table.getdataListParm.parammaps.enable2
- var exportTitle = ''
- if (this.table.getdataListParm.parammaps.plandimen == '1') {
- if (this.table.getdataListParm.parammaps.enable3 == '0') {
- this.downLoad.getdataListParm.name = 'downloadPlanTLJDTMR'
- exportTitle = this.table.getdataListParm.parammaps.mydate + this.$t('message.msg353.a')
- } else if (this.table.getdataListParm.parammaps.enable3 == '1') {
- this.downLoad.getdataListParm.name = 'downloadPlanTLLDTMR'
- exportTitle = this.table.getdataListParm.parammaps.mydate + this.$t('message.msg353.b')
- } else if (this.table.getdataListParm.parammaps.enable3 == '2') {
- this.downLoad.getdataListParm.name = 'downloadPlanSLJDTMR'
- exportTitle = this.table.getdataListParm.parammaps.mydate + this.$t('message.msg353.c')
- } else if (this.table.getdataListParm.parammaps.enable3 == '3') {
- this.downLoad.getdataListParm.name = 'downloadPlanTSLJDTMR'
- exportTitle =
- this.table.getdataListParm.parammaps.mydate + this.$t('message.msg353.d')
- } else if (this.table.getdataListParm.parammaps.enable3 == '4') {
- this.downLoad.getdataListParm.name = 'downloadPlanTSLLDTMR'
- exportTitle =
- this.table.getdataListParm.parammaps.mydate + this.$t('message.msg353.g')
- } else if (this.table.getdataListParm.parammaps.enable3 == '5') {
- this.downLoad.getdataListParm.name = 'downloadPlanBZJDTMR'
- exportTitle = this.table.getdataListParm.parammaps.mydate + this.$t('message.msg353.e')
- } else {
- this.downLoad.getdataListParm.name = 'downloadPlanSFJDTMR'
- exportTitle = this.table.getdataListParm.parammaps.mydate + this.$t('message.msg353.f')
- }
- } else {
- if (this.table.getdataListParm.parammaps.enable3 == '0') {
- this.downLoad.getdataListParm.name = 'downloadPlanTLJD'
- exportTitle = this.table.getdataListParm.parammaps.mydate + this.$t('message.msg353.a')
- } else if (this.table.getdataListParm.parammaps.enable3 == '1') {
- this.downLoad.getdataListParm.name = 'downloadPlanTLLD'
- exportTitle = this.table.getdataListParm.parammaps.mydate + this.$t('message.msg353.b')
- } else if (this.table.getdataListParm.parammaps.enable3 == '2') {
- this.downLoad.getdataListParm.name = 'downloadPlanSLJD'
- exportTitle = this.table.getdataListParm.parammaps.mydate + this.$t('message.msg353.c')
- } else if (this.table.getdataListParm.parammaps.enable3 == '3') {
- this.downLoad.getdataListParm.name = 'downloadPlanTSLJD'
- exportTitle =
- this.table.getdataListParm.parammaps.mydate + this.$t('message.msg353.d')
- } else if (this.table.getdataListParm.parammaps.enable3 == '4') {
- this.downLoad.getdataListParm.name = 'downloadPlanTSLLD'
- exportTitle =
- this.table.getdataListParm.parammaps.mydate + this.$t('message.msg353.g')
- } else if (this.table.getdataListParm.parammaps.enable3 == '5') {
- this.downLoad.getdataListParm.name = 'downloadPlanBZJD'
- exportTitle = this.table.getdataListParm.parammaps.mydate + this.$t('message.msg353.e')
- } else {
- this.downLoad.getdataListParm.name = 'downloadPlanSFJD'
- exportTitle = this.table.getdataListParm.parammaps.mydate + this.$t('message.msg353.f')
- }
- }
- GetReportform(this.downLoad.getdataListParm).then((response) => {
- if (response.data.list !== null) {
- this.downLoad.labelList = []
- var filterValArr = []
- for (let i = 0; i < response.data.list.data1.length; i++) {
- this.downLoad.labelList.push(response.data.list.data1[i].label)
- filterValArr.push(response.data.list.data1[i].prop)
- }
- this.downLoad.list = response.data.list.data2
- } else {
- this.downLoad.list = []
- }
- let data = []
- for (let i = 0; i < filterValArr.length; i++) {
- let obj = {}
- obj.field = filterValArr[i]
- obj.columnSize = i
- for (let j = i; j < this.downLoad.labelList.length; j++) {
- obj.displayName = this.downLoad.labelList[i]
- }
- if (obj.field !== undefined && obj.displayName !== undefined) {
- data.push(obj)
- }
- for (let i = 0; i < this.downLoad.list.length; i++) {
- if (
- this.downLoad.list[i][obj.displayName] == null ||
- this.downLoad.list[i][obj.displayName] == undefined
- ) {
- this.downLoad.list[i][obj.displayName] = ''
- }
- }
- }
- console.log(this.downLoad.list)
- printJS({
- printable: this.downLoad.list,
- properties: data,
- type: 'json',
- header: exportTitle,
- //样式设置
- gridStyle: 'border:1px solid #ccc;',
- gridHeaderStyle: 'border:1px solid #ccc;text-align:center'
- })
- })
- },
- handleDelete() {
- if (this.selectList.length == 0) {
- this.$message({
- type: 'error',
- message: this.$t('message.msg211'),
- duration: 2000
- })
- } else {
- MessageBox.confirm(
- this.$t('message.msg29') +
- this.selectList.length +
- this.$t('message.msg31'),
- {
- confirmButtonText: this.$t('common.confirm'),
- cancelButtonText: this.$t('common.cancel'),
- type: 'warning'
- }
- ).then(() => {
- console.log(this.selectList)
- this.requestParam.common = { returnmap: '0' }
- this.requestParam.data = []
- this.requestParam.data[0] = {
- name: 'insertSpotList',
- resultmaps: { list: this.selectList }
- }
- this.requestParam.data[0].children = []
- this.requestParam.data[0].children[0] = {
- name: 'delDownloadedplan',
- type: 'e',
- parammaps: {
- id: '@insertSpotList.id',
- pastureid: '@insertSpotList.pastureid'
- }
- }
- ExecDataByConfig(this.requestParam).then((response) => {
- console.log('删除保存发送参数', this.requestParam)
- if (response.msg === 'fail') {
- this.$notify({
- title: this.$t('common.delfail'),
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- } else {
- this.$notify({
- title: '',
- message: this.$t('common.delSuccess'),
- type: 'success',
- duration: 2000
- })
- this.getList()
- }
- })
- })
- }
- },
- handleDataUpload() {
- let a = Cookies.get('url')
- let b = a.search(8081)
- let c = a.substring(0, a.search(8081)) + '8082'
- let d = a.substring(0, a.lastIndexOf('/'))
- console.log(d)
- let url = ''
- if (b == -1) {
- url = d + ':8082'
- } else {
- url = c
- }
- let _url = url + '/authdata/feeding/push'
- let data = {
- date: parseTime(new Date(), '{y}-{m}-{d}'),
- pastureId: Cookies.get('pastureid')
- }
- console.log(_url, '_url')
- postJson2(_url, data).then((response) => {
- if (response.msg == 'ok') {
- this.$notify({
- title: '',
- message: response.data,
- type: 'success',
- duration: 2000
- })
- } else {
- this.$notify({
- title: this.$t('message.msg40'),
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- }
- })
- },
- handleUpdate2(row) {
- for (let i = 0; i < this.table2.list.length; i++) {
- if (this.table2.list[i].Edit == true) {
- this.$message({
- type: 'error',
- message: this.$t('driver.messageNote'),
- duration: 2000
- })
- return false
- }
- }
- // 编辑true,不可编辑false
- row.Edit = true
- row.NoEdit = false
- // 新增false,编辑false,编辑保存true
- row.isUpdate = false
- row.isUpdateSave = true
- },
- updateData2(row, type) {
- const url = 'authdata/dailydata/edit'
- const data = {}
- data.pid = row.pid
- data.weight = row.weight
- data.sort = row.sort
- // 饲料
- if (type == '0') {
- data.location = 0
- data.fid = row.fid
- } else {
- // 车辆||栏舍
- data.location = 1
- data.fbarid = row.fbarid
- }
- data.date = this.table.getdataListParm.parammaps.mydate
- data.sort = row.sort
- postJson(url, data).then((response) => {
- if (response.msg == 'ok') {
- this.$notify({
- title: '',
- message: this.$t('message.msg212'),
- type: 'success',
- duration: 2000
- })
- this.getList2()
- this.getList3()
- } else {
- this.$notify({
- title: this.$t('message.msg37'),
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- }
- })
- },
- updateCancel2(row) {
- row.Edit = false
- row.NoEdit = true
- // 新增false,编辑true,编辑保存false
- row.isCreate = false
- row.isUpdate = true
- row.isUpdateSave = false
- this.getList2()
- },
- handleUpdate3(row) {
- for (let i = 0; i < this.table3.list.length; i++) {
- if (this.table3.list[i].Edit == true) {
- this.$message({
- type: 'error',
- message: this.$t('driver.messageNote'),
- duration: 2000
- })
- return false
- }
- }
- // 编辑true,不可编辑false
- row.Edit = true
- row.NoEdit = false
- // 新增false,编辑false,编辑保存true
- row.isUpdate = false
- row.isUpdateSave = true
- },
- updateData3(row, type) {
- const url = 'authdata/dailydata/edit'
- const data = {}
- data.pid = row.pid
- data.weight = row.weight
- data.sort = row.sort
- // 饲料
- if (type == '0') {
- data.location = 0
- data.fid = row.fid
- } else {
- // 车辆||栏舍
- data.location = 1
- data.fbarid = row.fbarid
- }
- data.date = this.table.getdataListParm.parammaps.mydate
- data.sort = row.sort
- postJson(url, data).then((response) => {
- if (response.msg == 'ok') {
- this.$notify({
- title: '',
- message: this.$t('message.msg212'),
- type: 'success',
- duration: 2000
- })
- this.getList2()
- this.getList3()
- } else {
- this.$notify({
- title: this.$t('message.msg37'),
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- }
- })
- },
- updateCancel3(row) {
- row.Edit = false
- row.NoEdit = true
- // 新增false,编辑true,编辑保存false
- row.isCreate = false
- row.isUpdate = true
- row.isUpdateSave = false
- this.getList3()
- },
- changeDriver(value, row) {
- const url = 'authdata/PostDataByName'
- const data = {
- name: 'updateDownloadedplanDriver',
- parammaps: {
- driverId: value,
- id: row.id
- }
- }
- postJson(url, data).then((response) => {
- if (response.msg == 'ok') {
- this.$notify({
- title: '',
- message: this.$t('message.msg212'),
- type: 'success',
- duration: 2000
- })
- this.getList()
- } else {
- this.$notify({
- title: this.$t('message.msg37'),
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- }
- })
- },
- getIsSap() {
- GetDataByName(this.sapUpload.getdataListParm).then((response) => {
- // console.log()
- if (response.data.list !== null) {
- if (response.data.list[0].inforvalue == 1) {
- this.sapUpload.isSap = true
- } else {
- this.sapUpload.isSap = false
- }
- console.log(this.sapUpload.isSap)
- }
- })
- },
- handleSAPUpload() {
- this.sapUpload.dialogStatus = 'sapUpload'
- this.sapUpload.dialogFormVisible = true
- },
- sapUploadData() {
- this.$refs['sapUpload'].validate((valid) => {
- if (valid) {
- const url = 'authdata/sap/material'
- const data = {
- // "name":"xdmysapupload",
- pastureid: Cookies.get('pastureid'),
- date: parseTime(this.sapUpload.temp.date, '{y}-{m}-{d}')
- }
- postJson(url, data).then((response) => {
- if (response.msg == 'ok') {
- this.$notify({
- title: '',
- message: this.$t('message.msg153'),
- type: 'success',
- duration: 2000
- })
- this.sapUpload.dialogFormVisible = false
- this.getList()
- } else {
- this.$notify({
- title: this.$t('message.msg37'),
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- }
- })
- }
- })
- },
- getIspalyUd() {
- let url = 'authdata/GetDataByName'
- let data = {
- name: 'getSysoptEnable',
- page: 1,
- offset: 1,
- pagecount: 1,
- returntype: 'Map',
- parammaps: {
- pastureid: Cookies.get('pastureid'),
- inforname: 'gmUdSync'
- }
- }
- postJson(url, data).then((response) => {
- if (response.msg !== 'fail') {
- if (response.data.list[0].inforvalue == 0) {
- this.ispalyUd = false
- } else {
- this.ispalyUd = true
- }
- } else {
- this.$notify({
- title: this.$t('message.msg14'),
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- }
- })
- },
- handleGetUd1() {
- this.sapUpload.dialogStatus = 'udload1'
- this.sapUpload.dialogFormVisible = true
- },
- udData1() {
- this.$refs['sapUpload'].validate((valid) => {
- if (valid) {
- let url = 'authdata/gm/udutir/push'
- let data = {
- pastureId: Cookies.get('pastureid'),
- date: parseTime(this.sapUpload.temp.date, '{y}-{m}-{d}')
- }
- postJson(url, data).then((response) => {
- if (response.msg !== 'fail') {
- this.$notify({
- title: this.$t('common.succes'),
- message: this.$t('driver.saveSuccess'),
- type: 'success',
- duration: 2000
- })
- this.sapUpload.dialogFormVisible = false
- this.getList()
- } else {
- this.$notify({
- title: this.$t('driver.saveFail'),
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- }
- })
- }
- })
- },
- handleGetUd2() {
- this.sapUpload.dialogStatus = 'udload2'
- this.sapUpload.dialogFormVisible = true
- },
- udData2() {
- this.$refs['sapUpload'].validate((valid) => {
- if (valid) {
- let url = 'authdata/gm/udbarfeedremain/push'
- let data = {
- pastureId: Cookies.get('pastureid'),
- date: parseTime(this.sapUpload.temp.date, '{y}-{m}-{d}')
- }
- postJson(url, data).then((response) => {
- if (response.msg !== 'fail') {
- this.$notify({
- title: this.$t('common.succes'),
- message: this.$t('driver.saveSuccess'),
- type: 'success',
- duration: 2000
- })
- this.sapUpload.dialogFormVisible = false
- this.getList()
- } else {
- this.$notify({
- title: this.$t('driver.saveFail'),
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- }
- })
- }
- })
- },
- handleGetUd3() {
- this.sapUpload.dialogStatus = 'udload3'
- this.sapUpload.dialogFormVisible = true
- },
- udData3() {
- this.$refs['sapUpload'].validate((valid) => {
- if (valid) {
- let url = 'authdata/gm/udmaterialIssue/push'
- let data = {
- pastureId: Cookies.get('pastureid'),
- date: parseTime(this.sapUpload.temp.date, '{y}-{m}-{d}')
- }
- postJson(url, data).then((response) => {
- if (response.msg !== 'fail') {
- this.$notify({
- title: this.$t('common.succes'),
- message: this.$t('driver.saveSuccess'),
- type: 'success',
- duration: 2000
- })
- this.sapUpload.dialogFormVisible = false
- this.getList()
- } else {
- this.$notify({
- title: this.$t('driver.saveFail'),
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- }
- })
- }
- })
- },
- handleRowEmpty(row, plan) {
- console.log(row, 'row')
- MessageBox.confirm(this.$t('message.msg310'), {
- confirmButtonText: this.$t('common.confirm'),
- cancelButtonText: this.$t('common.cancel'),
- type: 'warning'
- }).then(() => {
- console.log(this.selectList)
- this.requestParam.common = { returnmap: '0' }
- this.requestParam.data = []
- this.requestParam.data[0] = {
- name: 'insertSpotList',
- resultmaps: { list: this.selectList }
- }
- this.requestParam.data[0].children = []
- this.requestParam.data[0].children[0] = {
- name: 'delDownloadedplan',
- type: 'e',
- parammaps: {
- id: '@insertSpotList.id',
- pastureid: '@insertSpotList.pastureid'
- }
- }
- const url = 'authdata/PostDataByName'
- const data = {
- name: 'clearDeleteDownloadedplan',
- parammaps: {
- pid: row.pid,
- lpplantype: this.table3.getdataListParm.parammaps.lpplantype,
- plan: plan,
- sort: row.sort
- }
- }
- postJson(url, data).then((response) => {
- console.log('清空保存发送参数', this.requestParam)
- if (response.msg === 'fail') {
- this.$notify({
- title: this.$t('message.msg214'),
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- } else {
- this.$notify({
- title: '',
- message: this.$t('message.msg213'),
- type: 'success',
- duration: 2000
- })
- // this.getList()
- this.getList2()
- this.getList3()
- }
- })
- })
- },
- handleQuickcompletion() {
- if (this.selectList.length == 0) {
- this.$message({
- type: 'error',
- message: this.$t('message.msg215'),
- duration: 2000
- })
- } else {
- MessageBox.confirm(this.$t('message.msg216'), {
- confirmButtonText: this.$t('common.confirm'),
- cancelButtonText: this.$t('common.cancel'),
- type: 'warning'
- }).then(() => {
- console.log(this.selectList)
- let arr = []
- for (let i = 0; i < this.selectList.length; i++) {
- arr.push(this.selectList[i].id)
- }
- const url = '/authdata/plan/artificial/edit'
- const data = {
- planId: arr.join()
- }
- postJson(url, data).then((response) => {
- console.log('快速完成保存发送参数', this.requestParam)
- if (response.msg === 'fail') {
- this.$notify({
- title: this.$t('driver.saveFail'),
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- } else {
- this.$notify({
- title: '',
- message: this.$t('driver.saveSuccess'),
- type: 'success',
- duration: 2000
- })
- this.getList()
- }
- })
- })
- }
- }
- }
- }
- </script>
- <style>
- .el-table .warning-row {
- background: oldlace;
- }
- .el-table .success-row {
- background: #f0f9eb;
- }
- @page {
- size: auto A4 landscape;
- margin: 3mm;
- }
- .agreeCon {
- background: #fff;
- box-sizing: border-box;
- padding: 2rem 3rem 4rem;
- }
- </style>
- <style lang="scss" scoped>
- .app-container {
- background: #fff;
- }
- .operation {
- }
- .search {
- margin-top: 10px;
- }
- .table {
- margin-bottom: 20px;
- }
- .template {
- background: #fff;
- position: relative;
- }
- .table2 {
- // float: left;width: 50%;
- background: #fff;
- position: relative;
- .content-table {
- margin-top: 20px;
- }
- .contentOperation {
- right: -50px;
- z-index: 1;
- }
- }
- .table3 {
- // float: left;width: 50%;
- background: #fff;
- position: relative;
- .content-table {
- margin-top: 20px;
- }
- .contentOperation {
- right: -50px;
- z-index: 1;
- }
- }
- /deep/.el-input.is-disabled .el-input__inner {
- color: #000;
- }
- </style>
|