index.vue 181 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235
  1. <template>
  2. <div class="app-container">
  3. <div class="filter-container">
  4. <el-select v-model="getdataListParm.parammaps.pastureName" placeholder="牧场" class="filter-item" style="width: 120px;">
  5. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
  6. </el-select>
  7. <el-input v-model="getdataListParm.parammaps.repairCode" placeholder="报修单号" clearable style="width: 130px;" class="filter-item" />
  8. <el-input v-model="getdataListParm.parammaps.eqName" placeholder="设备名称" clearable style="width: 130px;" class="filter-item" />
  9. <el-input v-model="getdataListParm.parammaps.eqCode" placeholder="设备内部编号" clearable style="width: 130px;" class="filter-item" />
  10. <el-select v-model="getdataListParm.parammaps.orderStatue" clearable placeholder="处理状态" class="filter-item" style="width: 120px;">
  11. <el-option v-for="item in orderStatues" :key="item.id" :label="item.name" :value="item.id" />
  12. </el-select>
  13. <el-select v-model="getdataListParm.parammaps.SHStatue" clearable placeholder="审核状态" class="filter-item" style="width: 120px;">
  14. <el-option v-for="item in SHStatues" :key="item.id" :label="item.name" :value="item.id" />
  15. </el-select>
  16. <el-date-picker
  17. ref="inputDatetime"
  18. v-model="getdataListParm.parammaps.inputDatetime"
  19. class="inputDatetime"
  20. type="datetimerange"
  21. style="width: 250px;top:-3px;"
  22. format="yyyy-MM-dd"
  23. value-format="yyyy-MM-dd"
  24. range-separator="至"
  25. start-placeholder="开始日期"
  26. end-placeholder="结束日期"
  27. />
  28. <el-button class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
  29. <div>
  30. <el-button v-if="isRepair" class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">报修</el-button>
  31. <!-- 临时注释 -->
  32. <el-button v-if="isRepairExport" class="filter-item" type="success" icon="el-icon-download" style="" @click="handleDownload">导出</el-button>
  33. <!-- 临时注释 -->
  34. <el-radio-group v-model="radioAll" style="margin-top:-9px" @change="changeAll()">
  35. <el-radio-button label="全部" />
  36. <el-badge :value="pending.total" class="item">
  37. <el-radio-button label="待处理" />
  38. </el-badge>
  39. <el-radio-button label="已处理" />
  40. </el-radio-group>
  41. </div>
  42. </div>
  43. <el-table
  44. :key="tableKey"
  45. v-loading="listLoading"
  46. element-loading-text="给我一点时间"
  47. :data="list"
  48. border
  49. fit
  50. highlight-current-row
  51. style="width: 100%;"
  52. :row-style="rowStyle"
  53. :cell-style="cellStyle"
  54. class="elTable table-fixed"
  55. :max-height="myHeight"
  56. >
  57. <el-table-column label="序号" align="center" type="index" width="50px">
  58. <template slot-scope="scope">
  59. <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
  60. </template>
  61. </el-table-column>
  62. <el-table-column label="报修单号" align="center">
  63. <template slot-scope="scope">
  64. <span>{{ scope.row.repairCode }}</span>
  65. </template>
  66. </el-table-column>
  67. <el-table-column label="牧场" width="140px" align="center">
  68. <template slot-scope="scope">
  69. <span>{{ scope.row.pastureName }}</span>
  70. </template>
  71. </el-table-column>
  72. <el-table-column label="设备内部编号" min-width="80px" align="center">
  73. <template slot-scope="scope">
  74. <span>{{ scope.row.eqCode }}</span>
  75. </template>
  76. </el-table-column>
  77. <el-table-column label="设备名称" min-width="100px" align="center">
  78. <template slot-scope="scope">
  79. <span>{{ scope.row.eqName }}</span>
  80. </template>
  81. </el-table-column>
  82. <el-table-column label="规格型号" min-width="80px" align="center">
  83. <template slot-scope="scope">
  84. <span>{{ scope.row.specification }}</span>
  85. </template>
  86. </el-table-column>
  87. <el-table-column label="部门" min-width="80px" align="center">
  88. <template slot-scope="scope">
  89. <span>{{ scope.row.departmentName }}</span>
  90. </template>
  91. </el-table-column>
  92. <el-table-column label="故障情况" min-width="80px" align="center">
  93. <template slot-scope="scope">
  94. <span>{{ scope.row.details }}</span>
  95. </template>
  96. </el-table-column>
  97. <el-table-column label="报修人" min-width="100px" align="center">
  98. <template slot-scope="scope">
  99. <span>{{ scope.row.requesterName }}</span>
  100. </template>
  101. </el-table-column>
  102. <el-table-column label="报修时间" sortable prop="requestTime" min-width="110px" align="center" />
  103. <el-table-column label="维修日期" sortable prop="stopTime" min-width="110px" align="center" />
  104. <el-table-column label="维修部门" min-width="80px" align="center">
  105. <template slot-scope="scope">
  106. <span>{{ scope.row.repairDeptName }}</span>
  107. </template>
  108. </el-table-column>
  109. <el-table-column label="处理状态" min-width="100px" align="center" :formatter="orderStatue" />
  110. <el-table-column label="领用单状态" min-width="80px" align="center">
  111. <template slot-scope="scope">
  112. <span>{{ scope.row.LYStatue }}</span>
  113. </template>
  114. </el-table-column>
  115. <el-table-column label="旧品录入状态" min-width="110px" align="center">
  116. <template slot-scope="scope">
  117. <span>{{ scope.row.LRStatue }}</span>
  118. </template>
  119. </el-table-column>
  120. <el-table-column label="审核状态" min-width="100px" align="center" :formatter="SHStatue" />
  121. <el-table-column label="操作" align="center" min-width="400" class-name="small-padding fixed-width" fixed="right">
  122. <template slot-scope="{row}">
  123. <el-button v-if="isMaintenanceSee" type="primary" size="mini" @click="form_see(row)">查看</el-button>
  124. <!-- 维修审核 -->
  125. <el-button v-if="(row.SHStatue == 2) && isMaintenanceAudit && row.requesterId == getdataListParm.parammaps.loginId" style="display:inline-block" type="success" size="mini" class="successMaintenanceAudit" @click="handleExamine(row)">维修审核</el-button>
  126. <el-button v-else style="display:none" type="success" size="mini" class="successMaintenanceAudit" @click="handleExamine(row)">维修审核</el-button>
  127. <!-- 维修审核2 -->
  128. <el-button v-if="(row.SHStatue == 3) && isMaintenanceAudit2" style="display:inline-block" type="success" size="mini" class="successMaintenanceAudit" @click="handleExamine2(row)">维修审核2</el-button>
  129. <el-button v-else style="display:none" type="success" size="mini" class="successMaintenanceAudit" @click="handleExamine2(row)">主管审核</el-button>
  130. <!-- 派单 -->
  131. <el-button v-if="(row.orderStatue == 0) && isDistributeLeaflets" style="display:inline-block" type="success" size="mini" @click="handleDistributeLeaflets(row)">派单</el-button>
  132. <el-button v-else-if="(row.orderStatue == 1 ||row.orderStatue == 2 )" style="display:none" type="success" size="mini" @click="handleDistributeLeaflets(row)">派单</el-button>
  133. <!-- 接单 -->
  134. <!-- <el-button v-if="(row.orderStatue == 0 && isReceipt && (row.pickId == getdataListParm.parammaps.loginId))" style="display:inline-block" type="success" size="mini" @click="handleReceipt(row)">接单</el-button> -->
  135. <el-button v-if="roleSet1(row)" style="display:inline-block" type="success" size="mini" @click="handleReceipt(row)">接单</el-button>
  136. <!-- <el-button v-else-if="(row.orderStatue == 1)" style="display:none" type="success" size="mini" @click="handleReceipt(row)">接单</el-button> -->
  137. <el-button v-else-if="(row.orderStatue == 1 ||row.orderStatue == 2 )" style="display:none" type="success" size="mini" @click="handleReceipt(row)">接单</el-button>
  138. <!-- 维修及领用 -->
  139. <!-- <el-button v-if="(row.orderStatue == 1 && row.SHStatue== 1 || row.SHStatue== 4 || row.SHStatue== 6) && isMaintenanceRequisition && (row.pickId == getdataListParm.parammaps.loginId)" style="display:inline-block" type="success" size="mini" class="successRequisition" @click="handleMaintenanceRequisition(row)">维修及领用</el-button> -->
  140. <el-button v-if="roleSet2(row)" style="display:inline-block" type="success" size="mini" class="successRequisition" @click="handleMaintenanceRequisition(row)">维修及领用</el-button>
  141. <el-button v-else style="display:none" type="success" size="mini" class="successRequisition" @click="handleMaintenanceRequisition(row)">维修及领用</el-button>
  142. <!-- 完成维修 -->
  143. <!-- <el-button v-if="(row.orderStatue == 1 && (row.SHStatue == 1 || row.SHStatue== 4 || row.SHStatue== 6)) && isRepairComplete && (row.pickId == getdataListParm.parammaps.loginId)" style="display:inline-block" type="success" size="mini" class="successMaintenanceAudit" @click="handleRepairComplete(row)">完成维修</el-button> -->
  144. <el-button v-if="roleSet3(row)" style="display:inline-block" type="success" size="mini" class="successMaintenanceAudit" @click="handleRepairComplete(row)">完成维修</el-button>
  145. <el-button v-else style="display:none" type="success" size="mini" class="successMaintenanceAudit" @click="handleRepairComplete(row)">完成维修</el-button>
  146. <!-- 删除 -->
  147. <el-button v-if="(((row.orderStatue == 0 || row.orderStatue == 1 ) && row.SHStatue !== 5) && isDelete)" style="display:inline-block" type="danger" size="mini" @click="form_delete(row)">删除</el-button>
  148. <el-button v-else style="display:none" type="success" size="danger" @click="form_delete(row)">删除</el-button>
  149. <!-- 驳回报修 -->
  150. <el-button v-if="(row.orderStatue == 0 && isRejectRepair)" style="display:inline-block;" type="success" class="successMaintenanceAudit" size="mini" @click="handleRejectRepair(row)">报修驳回</el-button>
  151. <el-button v-if="isshengweiwaidan && row.outsourcing == 1" style="display:inline-block" type="success" size="mini" class="successRequisition" @click="form_add_cont(row)">生成委外单</el-button>
  152. <el-button v-if="roleSet1(row) && row.outsourcing == 0" style="display:inline-block" type="success" size="mini" class="successRequisition" @click="form_add_cont_sure(row)">委外维修</el-button>
  153. </template>
  154. </el-table-column>
  155. </el-table>
  156. <!-- 分页 -->
  157. <pagination v-show="total>0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="get_table_data" />
  158. <!-- 新增委外维修单 -->
  159. <el-dialog title="新增委外维修单" :visible.sync="dialogFormVisibleCont" :close-on-click-modal="false" width="90%">
  160. <div >
  161. <el-form ref="createTempCont" :rules="rules" :model="createTempCont" label-position="right" label-width="100px" style="width: 100%;">
  162. <el-row :gutter="20">
  163. <el-col :span="8">
  164. <el-form-item label="委外维修单号:" prop="outsourcingCode">
  165. <el-input ref="outsourcingCode" v-model="createTempCont.outsourcingCode" disabled />
  166. </el-form-item>
  167. </el-col>
  168. <el-col :span="8">
  169. <el-form-item label="牧场:" prop="pastureId" >
  170. <el-select v-model="createTempCont.pastureId" placeholder="牧场" class="filter-item" style="width:100%" @change="change_pasture2" >
  171. <el-option v-for="item in pastureNameList" :key="item.id" :label="item.name" :value="item.id" />
  172. </el-select>
  173. </el-form-item>
  174. </el-col>
  175. <el-col :span="8">
  176. <el-form-item label="责任部门:" prop="departmentId">
  177. <el-select v-model="createTempCont.departmentId" placeholder="责任部门" class="filter-item" style="width:100%" @change="change_depart2">
  178. <el-option v-for="item in departNameList2" :key="item.id" :label="item.name" :value="item.id" />
  179. </el-select>
  180. </el-form-item>
  181. </el-col>
  182. </el-row>
  183. <el-row :gutter="20">
  184. <el-col :span="8">
  185. <el-form-item label="合同:" prop="contract">
  186. <el-radio-group v-model="createTempCont.contract" @change="change_contract" >
  187. <el-radio :label="0" >无合同</el-radio>
  188. <el-radio :label="1" checked>有合同</el-radio>
  189. </el-radio-group>
  190. </el-form-item>
  191. </el-col>
  192. <el-col :span="8">
  193. <el-form-item label="申请人:" prop="applicant">
  194. <el-select v-model="createTempCont.applicant" placeholder="申请人" class="filter-item" style="width:100%" :disabled="dialogStatus==='see'" >
  195. <el-option v-for="item in employeNameList" :key="item.id" :label="item.name" :value="item.id" />
  196. </el-select>
  197. </el-form-item>
  198. </el-col>
  199. <el-col :span="8">
  200. <el-form-item label="日期:" prop="date">
  201. <el-date-picker v-model="createTempCont.date" :picker-options="pickerOptions" type="date" placeholder="日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" />
  202. </el-form-item>
  203. </el-col>
  204. </el-row>
  205. <el-row :gutter="20">
  206. <el-col :span="16">
  207. <el-form-item label="故障描述:" prop="description">
  208. <el-input v-model="createTempCont.description" type="textarea" autosize :disabled="dialogStatus==='see'" />
  209. </el-form-item>
  210. </el-col>
  211. <el-col :span="8">
  212. <el-form-item label="报修单号:" prop="RUCode">
  213. <el-input ref="RUCode" v-model="createTempCont.RUCode" disabled />
  214. </el-form-item>
  215. </el-col>
  216. </el-row>
  217. </el-form>
  218. <el-table
  219. :key="tableKey"
  220. v-loading="listLoading"
  221. element-loading-text="给我一点时间"
  222. :data="listAddCont"
  223. border
  224. fit
  225. highlight-current-row
  226. style="width: 100%;margin-bottom:30px"
  227. :row-style="rowStyle"
  228. :cell-style="cellStyle"
  229. class="elTable"
  230. >
  231. <!-- table表格 -->
  232. <el-table-column :key="0" label="序号" align="center" type="index" width="50px" />
  233. <el-table-column :key="1" label="供应商" prop="providerName" align="center" min-width="80px">
  234. <template slot-scope="scope">
  235. <el-select v-model="scope.row.providerName" placeholder="供应商" class="filter-item" style="width: 120px; margin-top:10px" >
  236. <el-option v-for="item in providerNameList" :key="item.name" :label="item.name" :value="item.name" />
  237. </el-select>
  238. </template>
  239. </el-table-column>
  240. <el-table-column :key="2" label="金额" v-if="createTempCont.contract == 0" prop="amount" align="center" min-width="80px">
  241. <template slot-scope="scope">
  242. <span >
  243. <el-input v-model="scope.row.amount" style="margin-top:10px" />
  244. </span>
  245. </template>
  246. </el-table-column>
  247. <el-table-column :key="3" label="设备名称" prop="eqName" align="center" min-width="250">
  248. <template slot-scope="scope">
  249. <el-autocomplete style="margin-top:10px"
  250. v-model="scope.row.eqName"
  251. class="inline-input"
  252. :fetch-suggestions="querySearchEqNameCont"
  253. value-key="eqName"
  254. placeholder="设备名称"
  255. @select="(value)=>
  256. {handleSelectEqNameCont(value, scope.row)}"
  257. @blur="(value)=>
  258. {blurSelectEqNameCont(value, scope.row)}"
  259. >
  260. <template slot-scope="{ item }">
  261. <span class="addr">{{ item.eqName }}</span>
  262. |<span class="addr">{{ item.eqCode }}</span>
  263. </template>
  264. </el-autocomplete>
  265. </template>
  266. </el-table-column>
  267. <el-table-column :key="4" label="设备内部编号" prop="eqCode" align="center" min-width="150">
  268. <template slot-scope="scope">
  269. <el-autocomplete style="margin-top:10px"
  270. v-model="scope.row.eqCode"
  271. class="inline-input"
  272. :fetch-suggestions="querySearchCodeCont"
  273. value-key="eqCode"
  274. placeholder="设备内部编号"
  275. @select="(value)=>
  276. {handleSelectEqCodeCont(value, scope.row)}"
  277. @blur="(value)=>
  278. {blurSelectEqCodeCont(value, scope.row)}"
  279. />
  280. </template>
  281. </el-table-column>
  282. <el-table-column :key="5" label="费用类型" prop="typea" align="center" min-width="80px">
  283. <template slot-scope="scope">
  284. <el-select v-model="scope.row.typea" placeholder="费用类型" class="filter-item" style="width: 120px; margin-top:10px " >
  285. <el-option v-for="item in costTypeList" :key="item.id" :label="item.name" :value="item.name" />
  286. </el-select>
  287. </template>
  288. </el-table-column>
  289. <!-- <el-table-column label="交付日期" prop="date" align="center" min-width="80px">
  290. <template slot-scope="scope">
  291. <span v >
  292. <el-date-picker v-model="scope.row.date" style="margin-top:10px" type="date" placeholder="日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" />
  293. </span>
  294. </template>
  295. </el-table-column> -->
  296. <el-table-column :key="6" v-if="createTempCont.contract == 1" label="合同编号" prop="contractCode" align="center" min-width="80px">
  297. <template slot-scope="scope">
  298. <span >
  299. <el-input v-model="scope.row.contractCode" style="margin-top:10px" />
  300. </span>
  301. </template>
  302. </el-table-column>
  303. <el-table-column :key="7" label="备注" prop="remark" align="center" min-width="80px">
  304. <template slot-scope="scope">
  305. <span >
  306. <el-input v-model="scope.row.remark" style="margin-top:10px" />
  307. </span>
  308. </template>
  309. </el-table-column>
  310. </el-table>
  311. <div slot="footer" class="dialog-footer" style="bottom:10px">
  312. <el-button type="primary" :disabled="isokDisable" @click="add_dialog_save_cont()">保存并关闭</el-button>
  313. <el-button @click="dialogFormVisibleCont = false;get_table_data()">取消</el-button>
  314. </div>
  315. </div>
  316. </el-dialog>
  317. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_Create" :close-on-click-modal="false" width="90%">
  318. <div class="app-create">
  319. <el-form ref="createTemp" :rules="rules" :model="createTemp" label-position="right" label-width="120px" style="width: 90%;margin:0 auto;">
  320. <el-row>
  321. <el-col :span="8">
  322. <el-form-item label="报修单号:" prop="repairCode">
  323. <el-input ref="repairCode" v-model="createTemp.repairCode" disabled />
  324. </el-form-item>
  325. </el-col>
  326. <el-col :span="8">
  327. <el-form-item label="设备名称:" prop="eqName">
  328. <el-autocomplete
  329. v-model="createTemp.eqName"
  330. class="inline-input"
  331. :fetch-suggestions="querySearchEqName"
  332. value-key="eqName"
  333. placeholder="设备名称"
  334. style="width:100%"
  335. @select="handleSelectEqName"
  336. >
  337. <template slot-scope="{ item }">
  338. <b>名称:</b><span>{{ item.eqName }}</span>&nbsp;
  339. |&nbsp;<b>规格:</b><span>{{ item.specification }}</span>
  340. </template>
  341. </el-autocomplete>
  342. </el-form-item>
  343. </el-col>
  344. <el-col :span="8">
  345. <el-form-item label="设备内部编号:" prop="eqCode">
  346. <el-autocomplete
  347. v-model="createTemp.eqCode"
  348. class="inline-input"
  349. :fetch-suggestions="querySearchCode"
  350. style="width:100%"
  351. value-key="eqCode"
  352. placeholder="设备内部编号"
  353. @select="handleSelectEqCode"
  354. />
  355. </el-form-item>
  356. </el-col>
  357. </el-row>
  358. <el-row>
  359. <!-- <el-col :span="8">
  360. <el-form-item label="维修人:" prop="pickId">
  361. <el-select v-model="createTemp.pickId" multiple filterable placeholder="维修人" filterable class="filter-item" style="width:100%" @change="changePickId">
  362. <el-option v-for="item in maintainers" :key="item.id" :label="item.empNameAndmt" :value="item.id" />
  363. </el-select>
  364. </el-form-item>
  365. </el-col> -->
  366. <el-col :span="8">
  367. <el-form-item label="维修人:" prop="pickId">
  368. <el-input v-model="pickNameArr" disabled />
  369. </el-form-item>
  370. </el-col>
  371. <el-col :span="8">
  372. <!-- <el-form-item label="故障情况:" prop="details">
  373. <el-input ref="details" v-model="createTemp.details" />
  374. </el-form-item> -->
  375. <!-- 这里PC和APP都需要等后端接口出来,是选了设备后带出故障内容。T T -->
  376. <el-form-item label="故障情况:" prop="details">
  377. <el-select v-model="createTemp.details" multiple placeholder="故障情况" filterable class="filter-item" style="width:100%" @change="changeDetails">
  378. <el-option v-for="item in  DetailList" :key="item.describe" :label="item.describe" :value="item.describe" />
  379. </el-select>
  380. </el-form-item>
  381. </el-col>
  382. <el-col :span="8">
  383. <el-form-item label="牧场:" prop="pastureName">
  384. <el-select v-model="createTemp.pastureId" style="width: 100%;" placeholder="牧场" class="filter-item">
  385. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.id" />
  386. </el-select>
  387. </el-form-item>
  388. </el-col>
  389. </el-row>
  390. <el-row>
  391. <el-col :span="8">
  392. <el-form-item label="部门:" prop="deptName">
  393. <el-input ref="deptName" v-model="createTemp.deptName" disabled />
  394. </el-form-item>
  395. <!-- <el-form-item label="部门:" prop="departmentId">
  396. <el-select v-model="createTemp.departmentId" placeholder="部门" class="filter-item" style="width:100%">
  397. <el-option
  398. v-for="item in findAllDepart"
  399. :key="item.id"
  400. :label="item.name"
  401. :value="item.id"
  402. />
  403. </el-select>
  404. </el-form-item> -->
  405. </el-col>
  406. <el-col :span="8">
  407. <el-form-item label="报修人:" prop="requesterId">
  408. <el-select ref="requesterId" v-model="createTemp.requesterId" placeholder="报修人" class="filter-item" style="width:100%">
  409. <el-option
  410. v-for="item in findAllEmploye"
  411. :key="item.id"
  412. :label="item.name"
  413. :value="item.id"
  414. />
  415. </el-select>
  416. </el-form-item>
  417. </el-col>
  418. <el-col :span="8">
  419. <el-form-item label="报修日期:" prop="requestTime">
  420. <el-date-picker
  421. v-model="createTemp.requestTime"
  422. :picker-options="pickerOptions1"
  423. type="datetime"
  424. placeholder="报修日期"
  425. format="yyyy-MM-dd HH:mm"
  426. value-format="yyyy-MM-dd HH:mm"
  427. style="width: 100%;"
  428. disabled
  429. />
  430. </el-form-item>
  431. </el-col>
  432. </el-row>
  433. </el-form>
  434. </div>
  435. <div slot="footer" class="dialog-footer">
  436. <el-button type="primary" :disabled="isokDisable" @click="dialogStatus==='create'?add_dialog_save():edit_dialog_save()">保存并关闭</el-button>
  437. <el-button @click="dialogFormVisible_Create = false;get_table_data()">关闭</el-button>
  438. </div>
  439. </el-dialog>
  440. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_See" :close-on-click-modal="false" width="90%">
  441. <div class="app-see">
  442. <div v-if="orderStatue1" class="see">
  443. <el-form ref="seeTemp" :rules="rules" :model="seeTemp" label-position="right" label-width="130px" style="width: 90%;margin:0 auto;">
  444. <el-row>
  445. <el-col :span="8">
  446. <el-form-item label="报修单号:" prop="repairCode">
  447. <el-input ref="repairCode" v-model="seeTemp.repairCode" disabled />
  448. </el-form-item>
  449. </el-col>
  450. <el-col :span="8">
  451. <el-form-item label="设备名称:" prop="eqName">
  452. <el-input ref="eqName" v-model="seeTemp.eqName" disabled />
  453. </el-form-item>
  454. </el-col>
  455. <el-col :span="8">
  456. <el-form-item label="设备内部编号:" prop="eqCode">
  457. <el-input ref="eqCode" v-model="seeTemp.eqCode" disabled />
  458. </el-form-item>
  459. </el-col>
  460. </el-row>
  461. <el-row>
  462. <!-- <el-col :span="8">
  463. <el-form-item label="维修组:" prop="repairDeptName">
  464. <el-input ref="repairDeptName" v-model="seeTemp.repairDeptName" disabled />
  465. </el-form-item>
  466. </el-col> -->
  467. <el-col :span="8">
  468. <el-form-item label="维修人:" prop="pickName">
  469. <el-input ref="pickName" v-model="seeTemp.pickName" disabled />
  470. </el-form-item>
  471. </el-col>
  472. <el-col :span="8">
  473. <el-form-item label="故障情况:" prop="details">
  474. <el-input ref="details" v-model="seeTemp.details" disabled />
  475. </el-form-item>
  476. </el-col>
  477. <el-col :span="8">
  478. <el-form-item label="牧场:" prop="pastureName">
  479. <el-input ref="pastureName" v-model="seeTemp.pastureName" disabled />
  480. </el-form-item>
  481. </el-col>
  482. </el-row>
  483. <el-row>
  484. <el-col :span="8">
  485. <el-form-item label="部门:" prop="departmentName">
  486. <el-input ref="departmentName" v-model="seeTemp.departmentName" disabled />
  487. </el-form-item>
  488. </el-col>
  489. <el-col :span="8">
  490. <el-form-item label="报修人:" prop="requesterName">
  491. <el-input ref="requesterName" v-model="seeTemp.requesterName" disabled />
  492. </el-form-item>
  493. </el-col>
  494. <el-col :span="8">
  495. <el-form-item label="报修日期:" prop="requestTime">
  496. <el-input ref="requestTime" v-model="seeTemp.requestTime" disabled />
  497. </el-form-item>
  498. </el-col>
  499. </el-row>
  500. <el-row>
  501. <el-col v-if="seeTemp.orderStatue == 3" :span="8">
  502. <el-form-item label="驳回日期:" prop="shutdownDate">
  503. <el-input ref="shutdownDate" v-model="seeTemp.shutdownDate" disabled />
  504. </el-form-item>
  505. </el-col>
  506. <el-col v-if="seeTemp.orderStatue == 3" :span="8">
  507. <el-form-item label="驳回原因:" prop="shutdownReason">
  508. <el-input ref="shutdownReason" v-model="seeTemp.shutdownReason" disabled />
  509. </el-form-item>
  510. </el-col>
  511. </el-row>
  512. <el-row>
  513. <el-col>
  514. <h3>流程进度</h3>
  515. <el-steps :active="active" align-center finish-status="success">
  516. <el-step
  517. v-for="(item,index) in activeList"
  518. :key="index"
  519. :title="item.title"
  520. :status="item.status"
  521. >
  522. <template slot="description">
  523. <div class="step-row">
  524. <div>{{ item.name }}&nbsp;&nbsp;{{ item.date }}</div>
  525. <div>{{ item.reason }}</div>
  526. <div>{{ item.scores }}</div>
  527. </div>
  528. </template>
  529. </el-step>
  530. </el-steps>
  531. </el-col>
  532. </el-row>
  533. <el-row>
  534. <el-col>
  535. <el-form-item label="操作:">
  536. <!-- 维修审核 -->
  537. <el-button v-if="(seeTemp.SHStatue == 2) && isMaintenanceAudit && seeTemp.requesterId == getdataListParm.parammaps.loginId" style="display:inline-block" type="success" @click="handleExamine()">维修审核</el-button>
  538. <el-button v-else style="display:none" type="success" @click="handleExamine()">维修审核</el-button>
  539. <!-- 维修审核2 -->
  540. <el-button v-if="(seeTemp.SHStatue == 3) && isMaintenanceAudit2" style="display:inline-block" type="success" @click="handleExamine2(row)">维修审核2</el-button>
  541. <el-button v-else style="display:none" type="success" @click="handleExamine2()">主管审核</el-button>
  542. <!-- 派单 -->
  543. <el-button v-if="(seeTemp.orderStatue == 0) && isDistributeLeaflets" style="display:inline-block" type="success" @click="handleDistributeLeaflets()">派单</el-button>
  544. <el-button v-else-if="(seeTemp.orderStatue == 1 ||seeTemp.orderStatue == 2 )" style="display:none" type="success" @click="handleDistributeLeaflets()">派单</el-button>
  545. <!-- 接单 -->
  546. <el-button v-if="(seeTemp.orderStatue == 0 && isReceipt && (seeTemp.pickId == getdataListParm.parammaps.loginId))" style="display:inline-block" type="success" @click="handleReceipt()">接单</el-button>
  547. <el-button v-else-if="(seeTemp.orderStatue == 1 ||seeTemp.orderStatue == 2 )" style="display:none" type="success" @click="handleReceipt()">接单</el-button>
  548. <!-- 维修及领用 -->
  549. <el-button v-if="(seeTemp.orderStatue == 1 && seeTemp.SHStatue== 1 || seeTemp.SHStatue== 4 || seeTemp.SHStatue== 6) && isMaintenanceRequisition && (seeTemp.pickId == getdataListParm.parammaps.loginId)" style="display:inline-block" type="success" @click="handleMaintenanceRequisition()">维修及领用</el-button>
  550. <el-button v-else style="display:none" @click="handleMaintenanceRequisition()">维修及领用</el-button>
  551. <!-- 完成维修 -->
  552. <el-button v-if="(seeTemp.orderStatue == 1 && (seeTemp.SHStatue == 1 || seeTemp.SHStatue== 4 || seeTemp.SHStatue== 6)) && isRepairComplete && (seeTemp.pickId == getdataListParm.parammaps.loginId)" style="display:inline-block" type="success" @click="handleRepairComplete()">完成维修</el-button>
  553. <el-button v-else style="display:none" @click="handleRepairComplete()">完成维修</el-button>
  554. </el-form-item>
  555. </el-col>
  556. </el-row>
  557. </el-form>
  558. </div>
  559. <div v-if="orderStatue2" class="see">
  560. <el-tabs v-model="activeName">
  561. <el-tab-pane label="基础信息" name="first">
  562. <el-form ref="seeTemp" :rules="rules" :model="seeTemp" label-position="right" label-width="130px" style="width: 90%;margin:0 auto;">
  563. <el-row>
  564. <el-col :span="8">
  565. <h3>报修信息</h3>
  566. </el-col>
  567. </el-row>
  568. <el-row>
  569. <el-col :span="8">
  570. <el-form-item label="报修单号:" prop="repairCode">
  571. <el-input ref="repairCode" v-model="seeTemp.repairCode" disabled />
  572. </el-form-item>
  573. </el-col>
  574. <el-col :span="8">
  575. <el-form-item label="设备名称:" prop="eqName">
  576. <el-input ref="eqName" v-model="seeTemp.eqName" disabled />
  577. </el-form-item>
  578. </el-col>
  579. <el-col :span="8">
  580. <el-form-item label="设备内部编号:" prop="eqCode">
  581. <el-input ref="eqCode" v-model="seeTemp.eqCode" disabled />
  582. </el-form-item>
  583. </el-col>
  584. </el-row>
  585. <el-row>
  586. <!-- <el-col :span="8">
  587. <el-form-item label="维修组:" prop="repairDeptName">
  588. <el-input ref="repairDeptName" v-model="seeTemp.repairDeptName" disabled />
  589. </el-form-item>
  590. </el-col> -->
  591. <el-col :span="8">
  592. <el-form-item label="维修人:" prop="pickName">
  593. <el-input ref="pickName" v-model="seeTemp.pickName" disabled />
  594. </el-form-item>
  595. </el-col>
  596. <el-col :span="8">
  597. <el-form-item label="故障情况:" prop="details">
  598. <el-input ref="details" v-model="seeTemp.details" disabled />
  599. </el-form-item>
  600. </el-col>
  601. <el-col :span="8">
  602. <el-form-item label="牧场:" prop="pastureName">
  603. <el-input ref="pastureName" v-model="seeTemp.pastureName" disabled />
  604. </el-form-item>
  605. </el-col>
  606. </el-row>
  607. <el-row>
  608. <el-col :span="8">
  609. <el-form-item label="部门:" prop="departmentName">
  610. <el-input ref="departmentName" v-model="seeTemp.departmentName" disabled />
  611. </el-form-item>
  612. </el-col>
  613. <el-col :span="8">
  614. <el-form-item label="报修人:" prop="requesterName">
  615. <el-input ref="requesterName" v-model="seeTemp.requesterName" disabled />
  616. </el-form-item>
  617. </el-col>
  618. <el-col :span="8">
  619. <el-form-item label="报修日期:" prop="requestTime">
  620. <el-input ref="requestTime" v-model="seeTemp.requestTime" disabled />
  621. </el-form-item>
  622. </el-col>
  623. </el-row>
  624. <el-row>
  625. <el-col :span="8">
  626. <h3>维修信息</h3>
  627. </el-col>
  628. </el-row>
  629. <el-row>
  630. <el-col :span="8">
  631. <el-form-item label="维修日期:" prop="stopTime">
  632. <el-input ref="stopTime" v-model="seeTemp.stopTime" disabled />
  633. </el-form-item>
  634. </el-col>
  635. </el-row>
  636. <el-row>
  637. <el-col :span="8">
  638. <h3>故障诊断</h3>
  639. </el-col>
  640. </el-row>
  641. </el-form>
  642. <el-table
  643. :key="tableKey"
  644. v-loading="listLoadingFault"
  645. element-loading-text="给我一点时间"
  646. :data="listFault"
  647. border
  648. fit
  649. highlight-current-row
  650. style="width: 90%;margin:0 auto"
  651. :row-style="rowStyle"
  652. :cell-style="cellStyle"
  653. class="elTable"
  654. >
  655. <el-table-column label="序号" align="center" type="index" width="50px">
  656. <template slot-scope="scope">
  657. <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
  658. </template>
  659. </el-table-column>
  660. <el-table-column label="故障部位" min-width="110px" align="center">
  661. <template slot-scope="scope">
  662. <span>{{ scope.row.positionName }}</span>
  663. </template>
  664. </el-table-column>
  665. <el-table-column label="故障详情" prop="appearanceName" align="center">
  666. <template slot-scope="scope">
  667. <span>{{ scope.row.appearanceName }}</span>
  668. </template>
  669. </el-table-column>
  670. <el-table-column label="故障原因" min-width="110px" align="center">
  671. <template slot-scope="scope">
  672. <span>{{ scope.row.failureCause }}</span>
  673. </template>
  674. </el-table-column>
  675. <el-table-column label="处理方式" prop="treatmentMethod" align="center">
  676. <template slot-scope="scope">
  677. <span>{{ scope.row.treatmentMethod }}</span>
  678. </template>
  679. </el-table-column>
  680. </el-table>
  681. <el-form
  682. ref="seeTemp"
  683. :rules="rules"
  684. :model="seeTemp"
  685. label-position="right"
  686. label-width="120px"
  687. style="width: 90%;margin:0 auto;"
  688. >
  689. <el-row>
  690. <el-col>
  691. <h3>流程进度</h3>
  692. <el-steps :active="active" align-center finish-status="success">
  693. <el-step
  694. v-for="(item,index) in activeList"
  695. :key="index"
  696. :title="item.title"
  697. :status="item.status"
  698. >
  699. <template slot="description" style="font-size:18px">
  700. <div class="step-row">
  701. <div>{{ item.name }}</div>
  702. <div>{{ item.date }}</div>
  703. <div>{{ item.reason }}</div>
  704. <div>{{ item.scores }}</div>
  705. </div>
  706. </template>
  707. </el-step>
  708. </el-steps>
  709. </el-col>
  710. </el-row>
  711. <el-row>
  712. <el-col>
  713. <h3 style="display:inline">操作</h3>
  714. <!-- 维修审核 -->
  715. <el-button v-if="(seeTemp.SHStatue == 2) && isMaintenanceAudit && seeTemp.requesterId == getdataListParm.parammaps.loginId" style="display:inline-block" type="success" @click="handleExamine()">维修审核</el-button>
  716. <el-button v-else style="display:none" type="success" @click="handleExamine()">维修审核</el-button>
  717. <!-- 维修审核2 -->
  718. <el-button v-if="(seeTemp.SHStatue == 3) && isMaintenanceAudit2" style="display:inline-block" type="success" @click="handleExamine2(row)">维修审核2</el-button>
  719. <el-button v-else style="display:none" type="success" @click="handleExamine2()">主管审核</el-button>
  720. <!-- 派单 -->
  721. <el-button v-if="(seeTemp.orderStatue == 0) && isDistributeLeaflets" style="display:inline-block" type="success" @click="handleDistributeLeaflets()">派单</el-button>
  722. <el-button v-else-if="(seeTemp.orderStatue == 1 ||seeTemp.orderStatue == 2 )" style="display:none" type="success" @click="handleDistributeLeaflets()">派单</el-button>
  723. <!-- 接单 -->
  724. <el-button v-if="(seeTemp.orderStatue == 0 && isReceipt && (seeTemp.pickId == getdataListParm.parammaps.loginId))" style="display:inline-block" type="success" @click="handleReceipt()">接单</el-button>
  725. <el-button v-else-if="(seeTemp.orderStatue == 1 ||seeTemp.orderStatue == 2 )" style="display:none" type="success" @click="handleReceipt()">接单</el-button>
  726. <!-- 维修及领用 -->
  727. <el-button v-if="(seeTemp.orderStatue == 1 && seeTemp.SHStatue== 1 || seeTemp.SHStatue== 4 || seeTemp.SHStatue== 6) && isMaintenanceRequisition && (seeTemp.pickId == getdataListParm.parammaps.loginId)" style="display:inline-block" type="success" @click="handleMaintenanceRequisition()">维修及领用</el-button>
  728. <el-button v-else style="display:none" type="success" @click="handleMaintenanceRequisition()">维修及领用</el-button>
  729. <!-- 完成维修 -->
  730. <el-button v-if="(seeTemp.orderStatue == 1 && (seeTemp.SHStatue == 1 || seeTemp.SHStatue== 4 || seeTemp.SHStatue== 6)) && isRepairComplete && (seeTemp.pickId == getdataListParm.parammaps.loginId)" style="display:inline-block" type="success" @click="handleRepairComplete()">完成维修</el-button>
  731. <el-button v-else style="display:none" type="success" @click="handleRepairComplete()">完成维修</el-button>
  732. </el-col>
  733. </el-row>
  734. </el-form>
  735. </el-tab-pane>
  736. <el-tab-pane label="领用记录" name="second">
  737. <el-table
  738. :key="tableKey"
  739. v-loading="listLoadingCollarUse"
  740. element-loading-text="给我一点时间"
  741. :data="listCollarUse"
  742. border
  743. fit
  744. highlight-current-row
  745. style="width: 100%;"
  746. :row-style="rowStyle"
  747. :cell-style="cellStyle"
  748. class="elTable"
  749. @cell-click="openDetails"
  750. >
  751. <!-- table表格 -->
  752. <el-table-column label="序号" align="center" type="index" width="50px">
  753. <template slot-scope="scope">
  754. <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
  755. </template>
  756. </el-table-column>
  757. <el-table-column label="领用单号" min-width="110px" align="center">
  758. <template slot-scope="scope">
  759. <span>{{ scope.row.applyCode }}</span>
  760. </template>
  761. </el-table-column>
  762. <el-table-column label="领用部门" min-width="110px" align="center">
  763. <template slot-scope="scope">
  764. <span>{{ scope.row.departmentName }}</span>
  765. </template>
  766. </el-table-column>
  767. <el-table-column label="领用日期" sortable prop="createDate" align="center">
  768. <template slot-scope="scope">
  769. <span>{{ scope.row.createDate }}</span>
  770. </template>
  771. </el-table-column>
  772. <el-table-column label="领用明细" prop="details" align="center">
  773. <template slot-scope="scope">
  774. <span>{{ scope.row.details }}</span>
  775. </template>
  776. </el-table-column>
  777. <el-table-column label="领用状态" min-width="110px" align="center" :formatter="statue" />
  778. <el-table-column label="操作" min-width="110px" align="center">
  779. <template slot-scope="{row}">
  780. <el-button type="primary" size="mini" @click="handleCollarUseSee(row,0)">查看</el-button>
  781. </template>
  782. </el-table-column>
  783. </el-table>
  784. </el-tab-pane>
  785. <el-tab-pane label="旧品录入记录" name="third">
  786. <el-table
  787. :key="tableKey"
  788. v-loading="listLoadingOldProducts"
  789. element-loading-text="给我一点时间"
  790. :data="listOldProducts"
  791. border
  792. fit
  793. highlight-current-row
  794. style="width: 100%;"
  795. :row-style="rowStyle"
  796. :cell-style="cellStyle"
  797. class="elTable"
  798. @sort-change="tableSort1"
  799. >
  800. <el-table-column label="序号" align="center" type="index" width="50px">
  801. <template slot-scope="scope">
  802. <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
  803. </template>
  804. </el-table-column>
  805. <el-table-column label="备件编号" min-width="110px" align="center">
  806. <template slot-scope="scope">
  807. <span>{{ scope.row.partCode }}</span>
  808. </template>
  809. </el-table-column>
  810. <el-table-column label="备件名称" prop="id" align="center">
  811. <template slot-scope="scope">
  812. <span>{{ scope.row.partName }}</span>
  813. </template>
  814. </el-table-column>
  815. <el-table-column label="备件规格" min-width="110px" align="center">
  816. <template slot-scope="scope">
  817. <span>{{ scope.row.specification }}</span>
  818. </template>
  819. </el-table-column>
  820. <el-table-column label="录入数量" sortable prop="acturalAmount" min-width="110px" align="center">
  821. <template slot-scope="scope">
  822. <span>{{ scope.row.acturalAmount }}</span>
  823. </template>
  824. </el-table-column>
  825. </el-table>
  826. </el-tab-pane>
  827. </el-tabs>
  828. </div>
  829. </div>
  830. <div slot="footer" class="dialog-footer" style="bottom:5px;">
  831. <el-button @click="dialogFormVisible_See = false">关闭</el-button>
  832. </div>
  833. </el-dialog>
  834. <!-- 派单 -->
  835. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_DistributeLeaflets" :close-on-click-modal="false" width="50%">
  836. <div class="distributeLeaflets">
  837. <el-form
  838. ref="distributeLeafletsTemp"
  839. :rules="rules"
  840. :model="distributeLeafletsTemp"
  841. label-position="right"
  842. label-width="120px"
  843. style="width: 90%;margin:0 auto;"
  844. >
  845. <el-row>
  846. <el-col :span="20">
  847. <el-form-item label="维修人:" prop="pickId">
  848. <el-select v-model="distributeLeafletsTemp.pickId" filterable placeholder="维修人" class="filter-item" style="width:100%" @change="changePickId">
  849. <el-option v-for="item in maintainers" :key="item.id" :label="item.empNameAndmt" :value="item.id" />
  850. </el-select>
  851. </el-form-item>
  852. </el-col>
  853. </el-row>
  854. <el-row>
  855. <el-col :span="20">
  856. <el-form-item label="派单人:" prop="chargeId">
  857. <el-select v-model="distributeLeafletsTemp.chargeId" placeholder="派单人" class="filter-item" style="width:100%">
  858. <el-option
  859. v-for="item in findAllEmploye"
  860. :key="item.id"
  861. :label="item.name"
  862. :value="item.id"
  863. />
  864. </el-select>
  865. </el-form-item>
  866. </el-col>
  867. </el-row>
  868. <el-row>
  869. <el-col :span="20">
  870. <el-form-item label="派单日期:" prop="chargeDate">
  871. <el-date-picker
  872. v-model="distributeLeafletsTemp.chargeDate"
  873. :picker-options="pickerOptions1"
  874. type="date"
  875. placeholder="派单日期"
  876. style="width:100%;"
  877. format="yyyy-MM-dd"
  878. value-format="yyyy-MM-dd"
  879. />
  880. </el-form-item>
  881. </el-col>
  882. </el-row>
  883. </el-form>
  884. </div>
  885. <div slot="footer" class="dialog-footer">
  886. <el-button type="primary" :disabled="isokDisable" @click="dialogStatus==='distributeLeaflets'?createDistributeLeafletsData():createDistributeLeafletsData()">确认</el-button>
  887. <el-button @click="dialogFormVisible_DistributeLeaflets = false;">关闭</el-button>
  888. </div>
  889. </el-dialog>
  890. <!-- 审核 -->
  891. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_MaintenanceAudit" :close-on-click-modal="false" width="30%">
  892. <div class="maintenanceAudit">
  893. <h3 style="width: 100%;margin:0 0 0 5%;line-height:50px;">请确认维修审核结果:</h3>
  894. <el-form ref="examineTemp" :rules="rules" :model="examineTemp" label-position="right" style="width: 60%;height:150px;margin:0 auto;">
  895. <el-row style="width:90%;margin:0 auto;">
  896. <el-col :span="20">
  897. <el-form-item>
  898. <el-radio-group v-model="examineTemp.statue" @change="changeStatue">
  899. <el-radio :label="3" checked>通过</el-radio>
  900. <el-radio :label="4">不通过</el-radio>
  901. </el-radio-group>
  902. </el-form-item>
  903. </el-col>
  904. <el-col v-if="statueReason" :span="20">
  905. <el-input v-model="examineTemp.workflowNote" type="textarea" :autosize="{ minRows: 2, maxRows: 4}" placeholder="请输入审核不通过原因" />
  906. </el-col>
  907. </el-row>
  908. <el-row v-if="examineTemp.SHStatue == 2 && examineTemp.statue== 3" style="width:90%;margin:0 auto;">
  909. <el-col :span="24">
  910. <el-form-item label="评分:" prop="scores">
  911. <el-rate v-model="examineTemp.scores" show-text :texts="['1分','2分', '3分', '4分', '5分']" style="width:100%;margin-top:10px;" />
  912. </el-form-item>
  913. </el-col>
  914. </el-row>
  915. </el-form>
  916. </div>
  917. <div slot="footer" class="dialog-footer">
  918. <el-button type="primary" :disabled="isokDisable" @click="dialogStatus==='maintenanceAudit'?createExamineData():createExamineData2()">确认</el-button>
  919. <el-button @click="dialogFormVisible_MaintenanceAudit = false;">关闭</el-button>
  920. </div>
  921. </el-dialog>
  922. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_RepairComplete" :close-on-click-modal="false" width="50%">
  923. <div class="repairComplete">
  924. <el-form
  925. ref="repairCompleteTemp"
  926. :rules="rules"
  927. :model="repairCompleteTemp"
  928. label-position="right"
  929. label-width="120px"
  930. style="width: 90%;margin:0 auto;"
  931. >
  932. <el-row>
  933. <el-col :span="20">
  934. <el-form-item label="是否录入旧品:" prop="isOldProducts">
  935. <el-radio-group v-model="repairCompleteTemp.isOldProducts" @change="changeIsOldProducts">
  936. <el-radio :label="0" checked>否</el-radio>
  937. <el-radio :label="1">是</el-radio>
  938. </el-radio-group>
  939. </el-form-item>
  940. </el-col>
  941. </el-row>
  942. <el-row v-if="No2">
  943. <el-col :span="24">
  944. <el-form-item label="旧品录入:" prop="partCode">
  945. <el-autocomplete
  946. v-model="repairCompleteTemp.partCode"
  947. value-key="name"
  948. class="inline-input"
  949. :fetch-suggestions="oldProductsSearch"
  950. placeholder="请输入备件编号或备件名称或备件规格"
  951. style="width:100%"
  952. @select="handleSelectOldProducts"
  953. >
  954. <template slot-scope="{ item }">
  955. <b>备件编号:</b><span class="name">{{ item.partCode }}</span>
  956. |<b>备件名称:</b><span class="addr">{{ item.partName }}</span>
  957. |<b style="padding-left:3em;">备件规格:</b><span class="addr">{{ item.specification }}</span>
  958. </template>
  959. </el-autocomplete>
  960. </el-form-item>
  961. </el-col>
  962. </el-row>
  963. </el-form>
  964. <el-table
  965. v-if="No2"
  966. :key="tableKey"
  967. v-loading="listLoading"
  968. element-loading-text="给我一点时间"
  969. :data="listAdd"
  970. border
  971. fit
  972. highlight-current-row
  973. style="width: 100%;margin-bottom:30px"
  974. :cell-style="cellStyle"
  975. class="elTable"
  976. :row-style="rowStyle"
  977. >
  978. <el-table-column type="index" label="序号" align="center" width="50px" />
  979. <el-table-column label="备件编号" min-width="90px" prop="partCode" align="center">
  980. <template slot-scope="scope">
  981. <span>{{ scope.row.partCode }}</span>
  982. </template>
  983. </el-table-column>
  984. <el-table-column label="备件名称" min-width="60px" align="center">
  985. <template slot-scope="scope">
  986. <span>{{ scope.row.partName }}</span><br>
  987. </template>
  988. </el-table-column>
  989. <el-table-column label="备件规格" prop="specification" align="center" min-width="90">
  990. <template slot-scope="scope">
  991. <span>{{ scope.row.specification }}</span>
  992. </template>
  993. </el-table-column>
  994. <el-table-column label="领用数量" prop="specification" align="center" min-width="90">
  995. <template slot-scope="scope">
  996. <span>{{ scope.row.amount }}</span>
  997. </template>
  998. </el-table-column>
  999. <el-table-column label="录入数量" prop="brand" align="center" min-width="60">
  1000. <template slot-scope="scope">
  1001. <el-form :model="scope.row" :rules="rules">
  1002. <el-form-item prop="acturalAmount">
  1003. <el-input ref="acturalAmount" v-model="scope.row.acturalAmount" style="margin-top:15px" />
  1004. </el-form-item>
  1005. </el-form>
  1006. </template>
  1007. </el-table-column>
  1008. <el-table-column label="用途" prop="note" align="center" min-width="60">
  1009. <template slot-scope="scope">
  1010. <el-form :model="scope.row">
  1011. <el-form-item prop="note">
  1012. <el-input ref="note" v-model="scope.row.note" style="margin-top:15px" />
  1013. </el-form-item>
  1014. </el-form>
  1015. </template>
  1016. </el-table-column>
  1017. <el-table-column label="操作" align="center" width="60" class-name="small-padding fixed-width" fixed="right">
  1018. <template slot-scope="{row}">
  1019. <a class="del" @click="partDelete(row)">删除</a>
  1020. </template>
  1021. </el-table-column>
  1022. </el-table>
  1023. </div>
  1024. <div slot="footer" class="dialog-footer">
  1025. <el-button type="primary" :disabled="isokDisable" @click="dialogStatus==='repairComplete'?createRepairCompleteData():createRepairCompleteData()">确认</el-button>
  1026. <el-button @click="dialogFormVisible_RepairComplete = false;">关闭</el-button>
  1027. </div>
  1028. </el-dialog>
  1029. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_MaintenanceRequisition" :close-on-click-modal="false" width="90%">
  1030. <div style="position: absolute;top:12px;left:120px;font:18px/40px '' ;color:#303133;">
  1031. <span style="margin:0 10px;">设备名称:{{ maintenanceRequisitionTemp.eqName }}</span>
  1032. <span>内部编号:{{ maintenanceRequisitionTemp.eqCode }}</span>
  1033. </div>
  1034. <div class="maintenanceRequisition" style="width:90%;margin:0 auto;">
  1035. <el-tabs v-model="activeName2" @tab-click="tabMaintenance">
  1036. <el-tab-pane label="维修" name="first">
  1037. <el-form
  1038. ref="maintenanceRequisitionTemp"
  1039. :rules="rules"
  1040. :model="maintenanceRequisitionTemp"
  1041. label-position="right"
  1042. label-width="120px"
  1043. style="width: 90%;margin:0 auto;"
  1044. >
  1045. <el-row>
  1046. <el-col :span="8">
  1047. <el-form-item label="维修日期" prop="repirsTime">
  1048. <el-date-picker
  1049. v-model="maintenanceRequisitionTemp.repirsTime"
  1050. :picker-options="pickerOptions1"
  1051. type="date"
  1052. placeholder="维修日期"
  1053. style="width:100%;"
  1054. format="yyyy-MM-dd"
  1055. value-format="yyyy-MM-dd"
  1056. :clearable="false"
  1057. />
  1058. </el-form-item>
  1059. </el-col>
  1060. </el-row>
  1061. </el-form>
  1062. <div class="newFault">
  1063. <el-form
  1064. ref="newFaultTemp"
  1065. :rules="rules"
  1066. :model="newFaultTemp"
  1067. label-position="right"
  1068. label-width="120px"
  1069. style="width: 90%;margin:0 auto"
  1070. >
  1071. <el-row>
  1072. <el-col :span="8">
  1073. <el-form-item label="故障诊断:" prop="positionId">
  1074. <el-select v-model="newFaultTemp.positionId" style="width:100%;" filterable placeholder="故障部位" @change="changePosition">
  1075. <el-option
  1076. v-for="item in positions"
  1077. :key="item.id"
  1078. :label="item.positionName"
  1079. :value="item.id"
  1080. />
  1081. </el-select>
  1082. </el-form-item>
  1083. </el-col>
  1084. <el-col :span="8">
  1085. <el-form-item>
  1086. <el-select v-model="newFaultTemp.appearanceName" style="width:100%;" filterable placeholder="故障详情" @change="changeAppearance">
  1087. <el-option
  1088. v-for="item in appearances"
  1089. :key="item.id"
  1090. :label="item.appearanceName"
  1091. :value="item.appearanceName"
  1092. />
  1093. </el-select>
  1094. </el-form-item>
  1095. </el-col>
  1096. </el-row>
  1097. </el-form>
  1098. <el-table
  1099. :key="tableKey"
  1100. v-loading="listLoading"
  1101. element-loading-text="给我一点时间"
  1102. :data="listNewFault"
  1103. border
  1104. fit
  1105. highlight-current-row
  1106. style="width: 100%;margin-bottom:30px"
  1107. :cell-style="cellStyle"
  1108. class="elTable"
  1109. :row-style="rowStyle"
  1110. >
  1111. <el-table-column type="index" label="序号" align="center" width="50px" />
  1112. <el-table-column label="故障部位" min-width="90px" prop="positionName" align="center">
  1113. <template slot-scope="scope">
  1114. <span>{{ scope.row.positionName }}</span>
  1115. </template>
  1116. </el-table-column>
  1117. <el-table-column label="故障详情" min-width="60px" align="center" prop="appearanceName">
  1118. <template slot-scope="scope">
  1119. <el-input ref="appearanceName" v-model="scope.row.appearanceName" />
  1120. </template>
  1121. </el-table-column>
  1122. <el-table-column label="故障原因" min-width="60px" align="center" prop="failureCause">
  1123. <template slot-scope="scope">
  1124. <el-input ref="failureCause" v-model="scope.row.failureCause" />
  1125. </template>
  1126. </el-table-column>
  1127. <el-table-column label="处理方式" min-width="60px" align="center" prop="treatmentMethod">
  1128. <template slot-scope="scope">
  1129. <el-input ref="treatmentMethod" v-model="scope.row.treatmentMethod" />
  1130. </template>
  1131. </el-table-column>
  1132. <el-table-column label="操作" align="center" width="100" class-name="small-padding fixed-width" fixed="right">
  1133. <template slot-scope="{row}">
  1134. <a class="del" @click="newFaultDelete(row)">删除</a>
  1135. </template>
  1136. </el-table-column>
  1137. </el-table>
  1138. </div>
  1139. </el-tab-pane>
  1140. <el-tab-pane label="备件领用" name="second">
  1141. <el-button class="filter-item" type="primary" size="mini" style="margin-bottom:10px" @click="handleCollectionSparePartsCreate">添加领用单</el-button>
  1142. <h4>有库存领用</h4>
  1143. <el-table
  1144. :key="tableKey"
  1145. v-loading="listLoading"
  1146. element-loading-text="给我一点时间"
  1147. :data="listCollectionSpareParts"
  1148. border
  1149. fit
  1150. highlight-current-row
  1151. style="width: 100%;"
  1152. :row-style="rowStyle"
  1153. :cell-style="cellStyle"
  1154. class="elTable table-fixed"
  1155. >
  1156. <el-table-column label="序号" align="center" type="index" width="50px">
  1157. <template slot-scope="scope">
  1158. <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
  1159. </template>
  1160. </el-table-column>
  1161. <el-table-column label="领用单号" align="center">
  1162. <template slot-scope="scope">
  1163. <span>{{ scope.row.applyCode }}</span>
  1164. </template>
  1165. </el-table-column>
  1166. <el-table-column label="领用部门" width="140px" align="center">
  1167. <template slot-scope="scope">
  1168. <span>{{ scope.row.departmentName }}</span>
  1169. </template>
  1170. </el-table-column>
  1171. <el-table-column label="领用日期" sortable prop="createDate" min-width="80px" align="center" />
  1172. <el-table-column label="领用备件" prop="details" align="center">
  1173. <template slot-scope="scope">
  1174. <span>{{ scope.row.details }}</span>
  1175. </template>
  1176. </el-table-column>
  1177. <el-table-column label="领用状态" min-width="100px" align="center" :formatter="statue" />
  1178. <el-table-column label="操作" min-width="80px" align="center">
  1179. <template slot-scope="{row}">
  1180. <el-button type="primary" size="mini" @click="handleCollarUseSee(row,0)">查看</el-button>
  1181. </template>
  1182. </el-table-column>
  1183. </el-table>
  1184. <h4>无库存领用</h4>
  1185. <el-table
  1186. :key="tableKey2"
  1187. v-loading="listLoading"
  1188. element-loading-text="给我一点时间"
  1189. :data="listCollectionSpareParts2"
  1190. border
  1191. fit
  1192. highlight-current-row
  1193. style="width: 100%;"
  1194. :row-style="rowStyle"
  1195. :cell-style="cellStyle"
  1196. class="elTable table-fixed"
  1197. >
  1198. <el-table-column label="序号" align="center" type="index" width="50px">
  1199. <template slot-scope="scope">
  1200. <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
  1201. </template>
  1202. </el-table-column>
  1203. <el-table-column label="领用部门" width="140px" align="center">
  1204. <template slot-scope="scope">
  1205. <span>{{ scope.row.departmentName }}</span>
  1206. </template>
  1207. </el-table-column>
  1208. <el-table-column label="最新领用日期" sortable prop="createDate" min-width="80px" align="center">
  1209. <template slot-scope="scope">
  1210. <span>{{ scope.row.createDate }}</span>
  1211. </template>
  1212. </el-table-column>
  1213. <el-table-column label="领用备件" prop="details" align="center">
  1214. <template slot-scope="scope">
  1215. <span>{{ scope.row.details }}</span>
  1216. </template>
  1217. </el-table-column>
  1218. <el-table-column label="领用状态" min-width="100px" align="center" :formatter="statue" />
  1219. <el-table-column label="操作" min-width="80px" align="center">
  1220. <template slot-scope="{row}">
  1221. <el-button type="primary" size="mini" @click="handleCollarUseSee(row,1)">查看</el-button>
  1222. </template>
  1223. </el-table-column>
  1224. </el-table>
  1225. </el-tab-pane>
  1226. </el-tabs>
  1227. </div>
  1228. <div slot="footer" class="dialog-footer" style="bottom:5px">
  1229. <el-button v-if="rapairBtn" type="primary" :disabled="isokDisable" @click="dialogStatus==='maintenanceRequisition'?createMaintenanceRequisitionteData():createMaintenanceRequisitionteData()">确认</el-button>
  1230. <el-button @click="dialogFormVisible_MaintenanceRequisition = false;get_table_data();">关闭</el-button>
  1231. </div>
  1232. </el-dialog>
  1233. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_CollectionSparePartsSee" :close-on-click-modal="false" width="90%">
  1234. <div class="collectionSparePartsSee">
  1235. <el-form
  1236. ref="collectionSparePartsSeeTemp"
  1237. :rules="rules"
  1238. :model="collectionSparePartsSeeTemp"
  1239. label-position="right"
  1240. label-width="120px"
  1241. style="width: 90%;margin:0 auto;"
  1242. >
  1243. <el-row>
  1244. <el-col v-if="collectionSparePartsSeeTemp.isStock !== 1" :span="8">
  1245. <el-form-item label="领用单号:" prop="applyCode">
  1246. <el-input ref="applyCode" v-model="collectionSparePartsSeeTemp.applyCode" disabled />
  1247. </el-form-item>
  1248. </el-col>
  1249. <el-col :span="8">
  1250. <el-form-item label="领用部门:" prop="departmentName">
  1251. <el-input ref="departmentName" v-model="collectionSparePartsSeeTemp.departmentName" disabled />
  1252. </el-form-item>
  1253. </el-col>
  1254. <el-col v-if="collectionSparePartsSeeTemp.isStock !== 1" :span="8">
  1255. <el-form-item label="领用日期:" prop="createDate">
  1256. <el-input ref="createDate" v-model="collectionSparePartsSeeTemp.createDate" disabled />
  1257. </el-form-item>
  1258. </el-col>
  1259. </el-row>
  1260. <el-row v-if="isPartCode">
  1261. <el-col :span="16">
  1262. <el-form-item label="所需备件:" prop="partCode">
  1263. <el-autocomplete
  1264. v-model="collectionSparePartsSeeTemp.partCode"
  1265. value-key="name"
  1266. class="inline-input"
  1267. :fetch-suggestions="sparePartSearch"
  1268. placeholder="请输入备件编号或备件名称或备件规格"
  1269. style="width:98%"
  1270. @select="handleSelectSparePart"
  1271. >
  1272. <template slot-scope="{ item }">
  1273. <b>备件编号:</b><div class="name" style="display: inline;">{{ item.partCode }}</div>&nbsp;
  1274. | &nbsp;<b>备件名称:</b><span class="addr">{{ item.partName }}</span>&nbsp;
  1275. | &nbsp;<b>备件规格:</b><span class="addr">{{ item.specification }}</span>
  1276. | &nbsp;<b>库存:</b><span class="addr">{{ item.reportery }}</span>
  1277. | &nbsp;<b>是否零库存:</b><span class="addr" v-if="item.isZeroStock==1">是</span>
  1278. <span class="addr" v-else>否</span>
  1279. </template>
  1280. </el-autocomplete>
  1281. </el-form-item>
  1282. </el-col>
  1283. <el-col :span="2">
  1284. <el-button type="primary" @click="handleAddSparePartsToBeCollected">添加待领用备件</el-button>
  1285. </el-col>
  1286. </el-row>
  1287. </el-form>
  1288. <el-table
  1289. :key="tableKey"
  1290. v-loading="listLoading"
  1291. element-loading-text="给我一点时间"
  1292. :data="listCreateCollectionSpareParts"
  1293. border
  1294. fit
  1295. highlight-current-row
  1296. style="width: 100%;margin-bottom:30px"
  1297. :row-style="rowStyle"
  1298. :cell-style="cellStyle"
  1299. class="elTable table-fixed"
  1300. >
  1301. <!-- table表格 -->
  1302. <el-table-column type="index" label="序号" align="center" width="50px" />
  1303. <el-table-column label="备件编号" min-width="90px" prop="partCode" align="center">
  1304. <template slot-scope="scope">
  1305. <span>{{ scope.row.partCode }}</span>
  1306. </template>
  1307. </el-table-column>
  1308. <el-table-column label="备件名称" min-width="80px" align="center">
  1309. <template slot-scope="scope">
  1310. <span>{{ scope.row.partName }}</span><br>
  1311. </template>
  1312. </el-table-column>
  1313. <el-table-column label="备件规格" prop="specification" align="center" min-width="100">
  1314. <template slot-scope="scope">
  1315. <span>{{ scope.row.specification }}</span>
  1316. </template>
  1317. </el-table-column>
  1318. <el-table-column label="库存数" prop="reportery" align="center" min-width="100">
  1319. <template slot-scope="scope">
  1320. <span>{{ scope.row.reportery }}</span>
  1321. </template>
  1322. </el-table-column>
  1323. <el-table-column label="领用数量" prop="amount" align="center" min-width="80">
  1324. <template slot-scope="scope">
  1325. <el-form :model="scope.row">
  1326. <el-form-item prop="amount">
  1327. <el-input ref="amount" v-model="scope.row.amount" :disabled="dialogStatus==='collectionSparePartsSee'" style="margin-top:15px" />
  1328. </el-form-item>
  1329. </el-form>
  1330. </template>
  1331. </el-table-column>
  1332. <el-table-column v-if="collectionSparePartsSeeTemp.isStock==1" label="领用时间" prop="date" align="center" min-width="100">
  1333. <template slot-scope="scope">
  1334. <span>{{ scope.row.date }}</span>
  1335. </template>
  1336. </el-table-column>
  1337. <el-table-column label="单价" min-width="90px" prop="price" align="center">
  1338. <template slot-scope="scope">
  1339. <span>{{ scope.row.price }}</span>
  1340. </template>
  1341. </el-table-column>
  1342. <el-table-column label="用途" prop="note" align="center" min-width="60">
  1343. <template slot-scope="scope">
  1344. <el-form :model="scope.row">
  1345. <el-form-item prop="note">
  1346. <el-input ref="note" v-model="scope.row.note" :disabled="dialogStatus==='collectionSparePartsSee'" style="margin-top:15px" />
  1347. </el-form-item>
  1348. </el-form>
  1349. </template>
  1350. </el-table-column>
  1351. <el-table-column v-if="collectionSparePartsSeeTemp.isStock==1" label="操作" align="center" width="100" class-name="small-padding fixed-width" fixed="right">
  1352. <template slot-scope="{row}">
  1353. <a class="primary" @click="handleViewProgress(row)">查看进度</a>
  1354. </template>
  1355. </el-table-column>
  1356. <el-table-column v-if="isCreatePartDelete" label="操作" align="center" width="100" class-name="small-padding fixed-width" fixed="right">
  1357. <template slot-scope="{row}">
  1358. <a class="del" @click="createPartDelete(row)">删除</a>
  1359. </template>
  1360. </el-table-column>
  1361. </el-table>
  1362. </div>
  1363. <div slot="footer" class="dialog-footer" style="bottom:5px">
  1364. <el-button v-if="isPartCode" type="primary" :disabled="isokDisable" @click="dialogStatus==='collectionSparePartsCreate'?createCollectionSparePartsData():createCollectionSparePartsData()">确认</el-button>
  1365. <el-button @click="dialogFormVisible_CollectionSparePartsSee = false;">关闭</el-button>
  1366. </div>
  1367. </el-dialog>
  1368. <!-- 查看进度 -->
  1369. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_ViewProgress" :close-on-click-modal="false" width="90%">
  1370. <div class="viewProgress">
  1371. <el-form
  1372. ref="viewProgressTemp"
  1373. :rules="rules"
  1374. :model="viewProgressTemp"
  1375. label-position="right"
  1376. label-width="120px"
  1377. style="width: 90%;margin:0 auto;"
  1378. >
  1379. <el-row>
  1380. <el-col :span="8">
  1381. <el-form-item label="本次领用数量:" prop="amountY">
  1382. <span> {{ numbersList.amountY }} </span>
  1383. </el-form-item>
  1384. </el-col>
  1385. <el-col :span="8">
  1386. <el-form-item label="其他领用数量:" prop="amountQT">
  1387. <span> {{ numbersList.amountQT }} </span>
  1388. </el-form-item>
  1389. </el-col>
  1390. <el-col :span="8">
  1391. <el-form-item label="未出库数量:" prop="amountLY">
  1392. <span> {{ numbersList.amountLY }} </span>
  1393. </el-form-item>
  1394. </el-col>
  1395. </el-row>
  1396. </el-form>
  1397. <h4>申购情况:</h4>
  1398. <el-table
  1399. :key="tableKey"
  1400. v-loading="listLoading"
  1401. element-loading-text="给我一点时间"
  1402. :data="purchaseapplicationList"
  1403. border
  1404. fit
  1405. highlight-current-row
  1406. style="width: 100%;margin-bottom:30px"
  1407. :row-style="rowStyle"
  1408. :cell-style="cellStyle"
  1409. class="elTable table-fixed"
  1410. @sort-change="tableSort2"
  1411. >
  1412. <el-table-column type="index" label="序号" align="center" width="50px" />
  1413. <el-table-column label="申购单号" min-width="90px" prop="orderNumber" align="center">
  1414. <template slot-scope="scope">
  1415. <span>{{ scope.row.orderNumber }}</span>
  1416. </template>
  1417. </el-table-column>
  1418. <el-table-column sortable prop="amount" label="申购数量" min-width="80px" align="center">
  1419. <template slot-scope="scope">
  1420. <span>{{ scope.row.amount }}</span><br>
  1421. </template>
  1422. </el-table-column>
  1423. <el-table-column label="申购时间" sortable prop="createTime" align="center" min-width="100">
  1424. <template slot-scope="scope">
  1425. <span>{{ scope.row.createTime }}</span>
  1426. </template>
  1427. </el-table-column>
  1428. <el-table-column label="申购部门" prop="deptName" align="center" min-width="100">
  1429. <template slot-scope="scope">
  1430. <span>{{ scope.row.deptName }}</span>
  1431. </template>
  1432. </el-table-column>
  1433. <el-table-column label="申购人" prop="amount" align="center" min-width="80">
  1434. <template slot-scope="scope">
  1435. <span>{{ scope.row.empName }}</span>
  1436. </template>
  1437. </el-table-column>
  1438. <el-table-column label="是否配单" prop="buyStatu" align="center" min-width="80">
  1439. <template slot-scope="scope">
  1440. <span>{{ scope.row.buyStatu }}</span>
  1441. </template>
  1442. </el-table-column>
  1443. <el-table-column label="配单号" prop="matchCode" align="center" min-width="80">
  1444. <template slot-scope="scope">
  1445. <span>{{ scope.row.matchCode }}</span>
  1446. </template>
  1447. </el-table-column>
  1448. </el-table>
  1449. <h4>采购情况:</h4>
  1450. <el-table
  1451. :key="tableKey2"
  1452. v-loading="listLoading"
  1453. element-loading-text="给我一点时间"
  1454. :data="procurementList"
  1455. border
  1456. fit
  1457. highlight-current-row
  1458. style="width: 100%;margin-bottom:30px"
  1459. :row-style="rowStyle"
  1460. :cell-style="cellStyle"
  1461. class="elTable table-fixed"
  1462. @sort-change="tableSort3"
  1463. >
  1464. <el-table-column type="index" label="序号" align="center" width="50px" />
  1465. <el-table-column label="采购单号" min-width="90px" prop="buyeCode" align="center">
  1466. <template slot-scope="scope">
  1467. <span>{{ scope.row.buyeCode }}</span>
  1468. </template>
  1469. </el-table-column>
  1470. <el-table-column sortable prop="amount" label="采购数量" min-width="80px" align="center">
  1471. <template slot-scope="scope">
  1472. <span>{{ scope.row.amount }}</span><br>
  1473. </template>
  1474. </el-table-column>
  1475. <el-table-column label="配单号" prop="specification" align="center" min-width="100">
  1476. <template slot-scope="scope">
  1477. <span>{{ scope.row.matchCode }}</span>
  1478. </template>
  1479. </el-table-column>
  1480. <el-table-column label="提交时间" prop="buyerDate" align="center" min-width="100">
  1481. <template slot-scope="scope">
  1482. <span>{{ scope.row.buyerDate }}</span>
  1483. </template>
  1484. </el-table-column>
  1485. <el-table-column sortable prop="receiveAmount" label="入库数量" align="center" min-width="100">
  1486. <template slot-scope="scope">
  1487. <span>{{ scope.row.receiveAmount }}</span>
  1488. </template>
  1489. </el-table-column>
  1490. </el-table>
  1491. </div>
  1492. <div slot="footer" class="dialog-footer" style="bottom:5px">
  1493. <el-button @click="dialogFormVisible_ViewProgress = false;">关闭</el-button>
  1494. </div>
  1495. </el-dialog>
  1496. <!-- 报修驳回 -->
  1497. <el-dialog :title="textMap[dialogStatus]" :visible.sync="rejectRepair.dialogFormVisible" :close-on-click-modal="false" width="30%">
  1498. <div class="maintenanceAudit">
  1499. <h3 style="width: 100%;margin:0 0 0 5%;line-height:50px;">请输入报修驳回原因:</h3>
  1500. <el-form ref="rejectRepair" :rules="rules" :model="rejectRepair.temp" label-position="right" style="width: 60%;height:150px;margin:0 auto;">
  1501. <el-row>
  1502. <el-col :span="20">
  1503. <el-form-item prop="shutdownReason">
  1504. <el-input v-model="rejectRepair.temp.shutdownReason" type="textarea" :autosize="{ minRows: 2, maxRows: 4}" placeholder="请输入报修驳回原因" />
  1505. </el-form-item>
  1506. </el-col>
  1507. </el-row>
  1508. </el-form>
  1509. </div>
  1510. <div slot="footer" class="dialog-footer">
  1511. <el-button type="primary" :disabled="isokDisable" @click="rejectRepairData()">确认</el-button>
  1512. <el-button @click="rejectRepair.dialogFormVisible = false;">关闭</el-button>
  1513. </div>
  1514. </el-dialog>
  1515. </div>
  1516. </template>
  1517. <script>
  1518. // 引入
  1519. import { GetDataByName, GetDataByNames,GetAccount, PostDataByName, failproccess, ExecDataByConfig, checkButtons } from '@/api/common'
  1520. import { mapGetters } from 'vuex'
  1521. import waves from '@/directive/waves' // waves directive
  1522. import { parseTime, sortChange,json2excel } from '@/utils/index.js'
  1523. // eslint-disable-next-line no-unused-vars
  1524. import Pagination from '@/components/Pagination' // secondary package based on el-pagination
  1525. import { MessageBox } from 'element-ui'
  1526. import Cookies from 'js-cookie'
  1527. export default {
  1528. name: 'Repair',
  1529. components: { Pagination },
  1530. directives: { waves },
  1531. data() {
  1532. return {
  1533. myHeight:document.documentElement.clientHeight - 85- 200,
  1534. dialogFormVisibleCont:false,
  1535. createTempCont: {
  1536. RUCode: '',
  1537. pastureId: this.$store.state.user.pastureid,
  1538. departmentId: this.$store.state.user.departmentid,
  1539. employeId: this.$store.state.user.employeid,
  1540. date: parseTime(new Date(), '{y}-{m}-{d}'),
  1541. outsourcingCode: '',
  1542. applicant: '',
  1543. providerId: '',
  1544. departmentName: '',
  1545. description: '',
  1546. contract:1,
  1547. },
  1548. getDepartParam2: {
  1549. name: 'findAllDepart', offset: 0, pagecount: 0,
  1550. parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }
  1551. },
  1552. departNameList2: [],
  1553. isokDisable: false,
  1554. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  1555. cellStyle: { padding: 0 + 'px' },
  1556. findAllPasture: [],
  1557. findAllDepart: [],
  1558. findAllEmploye: [],
  1559. requestParams: [
  1560. { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
  1561. { name: 'findAllDepart1', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }},
  1562. { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
  1563. { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
  1564. { name: 'findAllProviderByCt', offset: 0, pagecount: 0, parammaps: { 'id': Cookies.get('pastureid') }},
  1565. ],
  1566. orderStatues: [{ id: '0', name: '待接单' }, { id: '1', name: '维修中' }, { id: '2', name: '维修完成' }],
  1567. SHStatues: [{ id: '0', name: '审核中' }, { id: '1', name: '已通过' }, { id: '2', name: '未通过' }],
  1568. pickerOptions: {
  1569. disabledDate(time) {
  1570. return time.getTime() > Date.now()// 当天之前的时间可选
  1571. }
  1572. },
  1573. rules: {
  1574. repairDept: [{ required: true, message: '必填', trigger: 'blur' }],
  1575. pickId: [{ required: true, message: '必填', trigger: 'blur' }],
  1576. chargeDate: [{ required: true, message: '必填', trigger: 'blur' }],
  1577. chargeId: [{ required: true, message: '必填', trigger: 'blur' }],
  1578. repirsTime: [{ required: true, message: '必填', trigger: 'blur' }],
  1579. positionId: [{ required: true, message: '必填', trigger: 'blur' }],
  1580. repairCode: [{ required: true, message: '必填', trigger: 'blur' }],
  1581. eqName: [{ required: true, message: '必填', trigger: 'blur' }],
  1582. eqCode: [{ required: true, message: '必填', trigger: 'blur' }],
  1583. deptName: [{ required: true, message: '必填', trigger: 'blur' }],
  1584. details: [{ required: true, message: '必填', trigger: 'blur' }],
  1585. shutdownReason: [{ required: true, message: '必填', trigger: 'blur' }],
  1586. description: [{ required: true, message: '必填', trigger: 'blur' }],
  1587. },
  1588. getdataListParm: {
  1589. name: 'getRepirsList',
  1590. page: 1,
  1591. offset: 1,
  1592. pagecount: 10,
  1593. returntype: 'Map',
  1594. parammaps: {
  1595. pastureName: Cookies.get('pasturename'),
  1596. repairCode: '',
  1597. eqName: '',
  1598. eqCode: '',
  1599. orderStatue: '',
  1600. SHStatue: '',
  1601. inputDatetime: '',
  1602. loginId: Cookies.get('employeid'),
  1603. menu: 'Repair',
  1604. logindeptId: Cookies.get('departmentid'),
  1605. loginpastureId: Cookies.get('pastureid')
  1606. }
  1607. },
  1608. isshengweiwaidan:[],
  1609. isCanSubmit:false,
  1610. total: 0,
  1611. tableKey: 0,
  1612. listLoading: false,
  1613. list: [],
  1614. dialogFormVisible_Create: false,
  1615. createTemp: {
  1616. pastureId: '',
  1617. departmentId: '',
  1618. eqId: '',
  1619. eqCode: '',
  1620. eqName: '',
  1621. repairDept: '',
  1622. details: '',
  1623. requesterId: '',
  1624. requestTime: parseTime(new Date(), '{y}-{m}-{d} {h}:{i}'),
  1625. pickId: '',
  1626. repairCode: '',
  1627. deptName: '',
  1628. eqClassId: '',
  1629. },
  1630. requestEqName: {
  1631. name: 'geteqbyNameCode',
  1632. page: 1,
  1633. offset: 1,
  1634. pagecount: '',
  1635. returntype: 'Map',
  1636. parammaps: {
  1637. pastureId: Cookies.get('pastureid')
  1638. }
  1639. },
  1640. getdataListParmDetail: {
  1641. name: 'getFaultdescription',
  1642. parammaps: { eqClassId: '', }
  1643. },
  1644. DetailList: [],
  1645. EqNameList: [],
  1646. EqCodeList: [],
  1647. getRepairNumberParm: {
  1648. name: 'autoCreatCode',
  1649. parammaps: {
  1650. pastureId: Cookies.get('pastureid'),
  1651. codeType: 'BX'
  1652. }
  1653. },
  1654. radioAll: '全部',
  1655. dialogFormVisible_See: false,
  1656. dialogStatus: '',
  1657. textMap: {
  1658. create: '报修',
  1659. see: '查看详情',
  1660. distributeLeaflets: '派单',
  1661. maintenanceAudit: '维修审核',
  1662. maintenanceAudit2: '维修审核',
  1663. repairComplete: '完成维修',
  1664. maintenanceRequisition: '维修及领用',
  1665. collectionSparePartsSee: '查看领用',
  1666. collectionSparePartsCreate: '添加领用',
  1667. ViewProgress: '查看进度', rejectRepair: '报修驳回', update: '修改报修'
  1668. },
  1669. activeList: [],
  1670. active: 3,
  1671. seeTemp: {},
  1672. activeName: 'first',
  1673. orderStatue1: false,
  1674. orderStatue2: false,
  1675. // Reason: false,
  1676. // MaintenanceAudit: false,
  1677. listLoadingFault: false,
  1678. listFault: [],
  1679. getFaultListParm: {
  1680. name: 'getmaintainappearance',
  1681. page: 1,
  1682. offset: 1,
  1683. pagecount: 10,
  1684. returntype: 'Map',
  1685. parammaps: {}
  1686. },
  1687. listLoadingCollarUse: false,
  1688. listCollarUse: [],
  1689. getCollarUseListParm: {
  1690. name: 'getPartsapplybyMt',
  1691. page: 1,
  1692. offset: 1,
  1693. returntype: 'Map',
  1694. parammaps: {}
  1695. },
  1696. getCollarUseListParm2: {
  1697. name: 'getPartsapplybyMt_m',
  1698. page: 1,
  1699. offset: 1,
  1700. pagecount: 10,
  1701. returntype: 'Map',
  1702. parammaps: {}
  1703. },
  1704. listLoadingOldProducts: false,
  1705. listOldProducts: [],
  1706. getOldProductsListParm: {
  1707. name: 'getMaintainRefuse',
  1708. page: 1,
  1709. offset: 1,
  1710. pagecount: 10,
  1711. returntype: 'Map',
  1712. parammaps: {}
  1713. },
  1714. getDepartParam1: {
  1715. name: 'findAllDepart', offset: 0, pagecount: 0,
  1716. parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }
  1717. },
  1718. pastureNameList: [],
  1719. employeNameList: [],
  1720. departNameList1: [],
  1721. getDepartParam2: {
  1722. name: 'findAllDepart', offset: 0, pagecount: 0,
  1723. parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }
  1724. },
  1725. departNameList2: [],
  1726. listAddCont:[
  1727. {providerName:"",providerId: "0",eqId: "0",contractId: "0",}
  1728. ],
  1729. dialogFormVisible_DistributeLeaflets: false,
  1730. distributeLeafletsTemp: {
  1731. repairDept: '',
  1732. pickId: '',
  1733. chargeId: this.$store.state.user.employeid,
  1734. chargeDate: parseTime(new Date(), '{y}-{m}-{d}')
  1735. },
  1736. pickerOptions1: {
  1737. disabledDate(time) {
  1738. return time.getTime() > Date.now()// 当天之前的时间可选
  1739. }
  1740. },
  1741. receiptTemp: {},
  1742. requestParam: {},
  1743. maintainers: [],
  1744. getRepirsEmpParm: {
  1745. name: 'getRepirsEmp',
  1746. returntype: 'Map',
  1747. parammaps: {
  1748. pastureId: Cookies.get('pastureid'),
  1749. empid: ""
  1750. }
  1751. },
  1752. examineTemp: {
  1753. statue: 3
  1754. },
  1755. statueReason: false,
  1756. dialogFormVisible_MaintenanceAudit: false,
  1757. dialogFormVisible_RepairComplete: false,
  1758. repairCompleteTemp: {
  1759. isOldProducts: 0
  1760. },
  1761. requestOldProducts: {
  1762. name: 'getAllPartsListWB',
  1763. page: 1,
  1764. offset: 1,
  1765. pagecount: 10,
  1766. returntype: 'Map',
  1767. parammaps: {}
  1768. },
  1769. No2: false,
  1770. listAdd: [],
  1771. postDataPramas: {},
  1772. maintenanceRequisitionTemp: {
  1773. repirsTime: ''
  1774. },
  1775. dialogFormVisible_MaintenanceRequisition: false,
  1776. activeName2: 'first',
  1777. rowId: 0,
  1778. listNewFault: [],
  1779. newFaultTemp: {},
  1780. appearances: [],
  1781. positions: [],
  1782. getPositionsParm: {
  1783. name: 'geteqPosition',
  1784. parammaps: {}
  1785. },
  1786. getAppearanceParm: {
  1787. name: 'getAppearancebyPid',
  1788. parammaps: {}
  1789. },
  1790. rapairBtn: true,
  1791. listCollectionSpareParts: [],
  1792. tableKey2: 1,
  1793. listCollectionSpareParts2: [],
  1794. collectionSparePartsSeeTemp: {
  1795. isStock: 0
  1796. },
  1797. depTiDArr:[],
  1798. pickidArr:[],
  1799. pickNameArr:[],
  1800. getParmCreateNumber: {
  1801. name: 'autoCreatCode',
  1802. page: 0,
  1803. offset: 0,
  1804. pagecount: 0,
  1805. returntype: 'Map',
  1806. parammaps: {
  1807. pastureId: Cookies.get('pastureid'),
  1808. codeType: 'WW'
  1809. }
  1810. },
  1811. requestSparePart: {
  1812. name: 'getPartsListLY_m',
  1813. page: 1,
  1814. offset: 1,
  1815. pagecount: 20,
  1816. returntype: 'Map',
  1817. parammaps: {
  1818. pastureId: Cookies.get('pastureid')
  1819. }
  1820. },
  1821. addSparePartsToBeCollectedParam: {
  1822. name: 'getPartapply_mr',
  1823. page: 1,
  1824. offset: 1,
  1825. pagecount: 20,
  1826. returntype: 'Map',
  1827. parammaps: {}
  1828. },
  1829. dialogFormVisible_CollectionSparePartsSee: false,
  1830. listCreateCollectionSpareParts: [],
  1831. isCreatePartDelete: false,
  1832. isPartCode: true,
  1833. getCollarUseSeeParm: {
  1834. name: 'getpartapplyListBybig',
  1835. parammaps: {}
  1836. },
  1837. getCollarUseSeeParm2: {
  1838. name: 'getpartapplyListBybig_m',
  1839. parammaps: {}
  1840. },
  1841. dialogFormVisible_ViewProgress: false,
  1842. viewProgressTemp: {},
  1843. getNumbersParm: {
  1844. name: 'getpartApply_mstatue',
  1845. page: 1,
  1846. offset: 1,
  1847. pagecount: 20,
  1848. returntype: 'Map',
  1849. parammaps: {}
  1850. },
  1851. numbersList: [],
  1852. getPurchaseapplicationParm: {
  1853. name: 'getpartApply_mstatueSG',
  1854. page: 1,
  1855. offset: 1,
  1856. returntype: 'Map',
  1857. parammaps: {}
  1858. },
  1859. purchaseapplicationList: [], // 采购情况
  1860. getProcurementParm: {
  1861. name: 'getpartApply_mstatueCG',
  1862. page: 1,
  1863. offset: 1,
  1864. returntype: 'Map',
  1865. parammaps: {}
  1866. },
  1867. procurementList: [], // 采购情况
  1868. rejectRepair: {
  1869. dialogFormVisible: false,
  1870. temp: {}
  1871. },
  1872. costTypeList:[
  1873. {id:'保养',name:'保养'},
  1874. {id:'维修',name:'维修'},
  1875. {id:'物耗',name:'物耗'},
  1876. {id:'土建',name:'土建'},
  1877. {id:'安全',name:'安全'},
  1878. ],
  1879. providerNameList:[
  1880. ],
  1881. // 权限按钮
  1882. isRepair: [],
  1883. isMaintenanceSee: [],
  1884. isDistributeLeaflets: [],
  1885. isReceipt: [],
  1886. isMaintenanceRequisition: [],
  1887. isRepairComplete: [],
  1888. isDelete: [],
  1889. isMaintenanceAudit: [],
  1890. isMaintenanceAudit2: [], isRejectRepair: [],
  1891. isRepairExport:[],
  1892. buttons: [],
  1893. pending: {
  1894. total: 0,
  1895. getdataListParm: {
  1896. name: 'getRepirsWebListNO', page: 1, offset: 1, getTotal: 'total3', pagecount: 10, returntype: 'Map',
  1897. parammaps: {}
  1898. }
  1899. },
  1900. isPercentage: false,
  1901. percentage: 1,
  1902. downLoadParm:{},
  1903. downLoadList:[],
  1904. resubmit:{}
  1905. }
  1906. },
  1907. // computed: {
  1908. // ...mapGetters([
  1909. // 'buttons'
  1910. // ])
  1911. // },
  1912. created() {
  1913. const that = this
  1914. GetDataByName({ 'name': 'getUserPCButtons', 'parammaps': { 'jwt_username': Cookies.get('name') }}).then(response => {
  1915. that.buttons = response.data.list
  1916. that.get_auto_buttons()
  1917. })
  1918. },
  1919. methods: {
  1920. roleSet1(row){
  1921. var result = true
  1922. if(row.orderStatue == 0 && this.isReceipt ){
  1923. if(row.pickId){
  1924. if(row.pickId.split(',').includes(this.getdataListParm.parammaps.loginId)){
  1925. result = true
  1926. } else{
  1927. result = false
  1928. }
  1929. } else{
  1930. result = false
  1931. }
  1932. } else {
  1933. result = false
  1934. }
  1935. return result
  1936. },
  1937. roleSet2(row){
  1938. console.log("isMaintenanceRequisition",this.isMaintenanceRequisition)
  1939. console.log("roleSet2",((row.orderStatue == 1 && row.SHStatue == 1 || row.SHStatue == 4 || row.SHStatue == 6) && this.isMaintenanceRequisition ))
  1940. var result = true
  1941. if((row.orderStatue == 1 && row.SHStatue == 1 || row.SHStatue == 4 || row.SHStatue == 6) && this.isMaintenanceRequisition ){
  1942. console.log("roleSet2")
  1943. if(row.pickId){
  1944. if(row.pickId.split(',').includes(this.getdataListParm.parammaps.loginId)){
  1945. result = true
  1946. } else{
  1947. result = false
  1948. }
  1949. } else{
  1950. result = false
  1951. }
  1952. } else {
  1953. result = false
  1954. }
  1955. return result
  1956. },
  1957. roleSet3(row){
  1958. console.log("roleSet3",((row.orderStatue == 1 && (row.SHStatue == 1 || row.SHStatue == 4 || row.SHStatue == 6)) && this.isRepairComplete ))
  1959. var result = true
  1960. if((row.orderStatue == 1 && (row.SHStatue == 1 || row.SHStatue == 4 || row.SHStatue == 6)) && this.isRepairComplete ){
  1961. console.log("roleSet3")
  1962. if(row.pickId){
  1963. if(row.pickId.split(',').includes(this.getdataListParm.parammaps.loginId)){
  1964. result = true
  1965. } else{
  1966. result = false
  1967. }
  1968. } else{
  1969. result = false
  1970. }
  1971. } else {
  1972. result = false
  1973. }
  1974. return result
  1975. },
  1976. tableSort1(column) {
  1977. sortChange(column, this.listOldProducts)
  1978. },
  1979. tableSort2(column) {
  1980. sortChange(column, this.purchaseapplicationList)
  1981. },
  1982. tableSort3(column) {
  1983. sortChange(column, this.procurementList)
  1984. },
  1985. get_auto_buttons() {
  1986. const shengweiwaidan = 'shengweiwaidan'
  1987. const isshengweiwaidan = checkButtons(this.buttons, shengweiwaidan)
  1988. this.isshengweiwaidan = isshengweiwaidan
  1989. // 报修
  1990. const Repair = 'maintenance:repair:baoxiu'
  1991. const isRepair = checkButtons(this.buttons, Repair)
  1992. this.isRepair = isRepair
  1993. // 派单
  1994. const DistributeLeaflets = 'maintenance:repair:paidan'
  1995. const isDistributeLeaflets = checkButtons(this.buttons, DistributeLeaflets)
  1996. this.isDistributeLeaflets = isDistributeLeaflets
  1997. // 接单
  1998. const Receipt = 'maintenance:repair:jiedan'
  1999. const isReceipt = checkButtons(this.buttons, Receipt)
  2000. this.isReceipt = isReceipt
  2001. // 维修及领用
  2002. const Repairlingyong = 'maintenance:repair:lingyong'
  2003. const isMaintenanceRequisition = checkButtons(this.buttons, Repairlingyong)
  2004. this.isMaintenanceRequisition = isMaintenanceRequisition
  2005. // 维修完成
  2006. const RepairComplete = 'maintenance:repair:weixiuwancheng'
  2007. const isRepairComplete = checkButtons(this.buttons, RepairComplete)
  2008. this.isRepairComplete = isRepairComplete
  2009. // 删除
  2010. const Delete = 'maintenance:repair:delete'
  2011. const isDelete = checkButtons(this.buttons, Delete)
  2012. this.isDelete = isDelete
  2013. // 维修审核
  2014. const MaintenanceAudit = 'maintenance:repair:seeMaintenanceAudit'
  2015. const isMaintenanceAudit = checkButtons(this.buttons, MaintenanceAudit)
  2016. this.isMaintenanceAudit = isMaintenanceAudit
  2017. // 查看
  2018. const See = 'maintenance:repair:see'
  2019. const isMaintenanceSee = checkButtons(this.buttons, See)
  2020. this.isMaintenanceSee = isMaintenanceSee
  2021. // 主管审核
  2022. const MaintenanceAudit2 = 'maintenance:repair:shenhe2'
  2023. const isMaintenanceAudit2 = checkButtons(this.buttons, MaintenanceAudit2)
  2024. this.isMaintenanceAudit2 = isMaintenanceAudit2
  2025. // 报修驳回
  2026. const RejectRepair = 'maintenance:repair:rejectRepair'
  2027. const isRejectRepair = checkButtons(this.buttons, RejectRepair)
  2028. this.isRejectRepair = isRejectRepair
  2029. // 导出
  2030. const RejectExport = 'maintenance:repair:rejectExport'
  2031. const isRepairExport = checkButtons(this.buttons, RejectExport)
  2032. this.isRepairExport = isRepairExport
  2033. this.get_select_list()
  2034. this.get_table_data()
  2035. this.getPendingList()
  2036. },
  2037. get_select_list() {
  2038. GetDataByNames(this.requestParams).then(response => {
  2039. this.findAllPasture = response.data.findAllPasture.list
  2040. this.findAllDepart = response.data.findAllDepart1.list
  2041. this.findAllEmploye = response.data.findAllEmploye.list
  2042. this.pastureNameList = response.data.findAllPasture.list
  2043. console.log("牧场下拉框", this.pastureNameList)
  2044. this.employeNameList = response.data.findAllEmploye.list
  2045. console.log("申请人下拉框", this.employeNameList)
  2046. this.providerNameList = response.data.findAllProviderByCt.list
  2047. this.get_depart_list1()
  2048. })
  2049. },
  2050. get_depart_list1() {
  2051. GetDataByName(this.getDepartParam1).then(response => {
  2052. this.departNameList1 = response.data.list
  2053. })
  2054. },
  2055. change_pasture2(item) {
  2056. this.getDepartParam2.parammaps.pastureId = item
  2057. this.get_depart_list2()
  2058. },
  2059. get_depart_list2() {
  2060. GetDataByName(this.getDepartParam2).then(response => {
  2061. this.departNameList2 = response.data.list
  2062. })
  2063. },
  2064. change_depart2(item) {
  2065. this.createTemp.departmentName = this.departNameList2.find(obj => obj.id == item).name
  2066. },
  2067. getPendingList() {
  2068. this.pending.getdataListParm.parammaps.pastureName = this.getdataListParm.parammaps.pastureName
  2069. this.pending.getdataListParm.parammaps.repairCode = this.getdataListParm.parammaps.repairCode
  2070. this.pending.getdataListParm.parammaps.eqName = this.getdataListParm.parammaps.eqName
  2071. this.pending.getdataListParm.parammaps.eqCode = this.getdataListParm.parammaps.eqCode
  2072. this.pending.getdataListParm.parammaps.SHStatue = this.getdataListParm.parammaps.SHStatue
  2073. this.pending.getdataListParm.parammaps.inputDatetime = this.getdataListParm.parammaps.inputDatetime
  2074. this.pending.getdataListParm.parammaps.loginId = this.getdataListParm.parammaps.loginId
  2075. this.pending.getdataListParm.parammaps.menu = this.getdataListParm.parammaps.menu
  2076. this.pending.getdataListParm.parammaps.logindeptId = this.getdataListParm.parammaps.logindeptId
  2077. this.pending.getdataListParm.parammaps.loginpastureId = this.getdataListParm.parammaps.loginpastureId
  2078. this.pending.getdataListParm.parammaps.empId = Cookies.get('employeid')
  2079. this.pending.getdataListParm.parammaps.pastureId = Cookies.get('pastureid')
  2080. this.pending.getdataListParm.parammaps.deptId = Cookies.get('departmentid')
  2081. GetDataByName(this.pending.getdataListParm).then(response => {
  2082. this.pending.total = response.data.total3
  2083. })
  2084. },
  2085. get_table_data() {
  2086. if (this.$refs['inputDatetime'] !== undefined && this.$refs['inputDatetime'].value !== null) {
  2087. this.getdataListParm.parammaps.startTime = this.$refs['inputDatetime'].value[0]
  2088. this.getdataListParm.parammaps.stopTime = this.$refs['inputDatetime'].value[1]
  2089. } else {
  2090. this.getdataListParm.parammaps.startTime = ''
  2091. this.getdataListParm.parammaps.stopTime = ''
  2092. }
  2093. this.listLoading = true
  2094. GetDataByName(this.getdataListParm).then(response => {
  2095. if (response.data.list !== null) {
  2096. console.log('table数据', response.data.list)
  2097. this.list = response.data.list
  2098. this.pageNum = response.data.pageNum
  2099. this.pageSize = response.data.pageSize
  2100. } else {
  2101. this.list = []
  2102. }
  2103. this.total = response.data.total
  2104. setTimeout(() => {
  2105. this.listLoading = false
  2106. }, 100)
  2107. })
  2108. },
  2109. changeAll() {
  2110. console.log(this.radioAll)
  2111. if (this.radioAll === '全部') {
  2112. this.getdataListParm.name = 'getRepirsList'
  2113. this.getdataListParm.offset = 1
  2114. this.getdataListParm.parammaps = {
  2115. pastureName: Cookies.get('pasturename'),
  2116. inputDatetime: '',
  2117. loginId: Cookies.get('employeid'),
  2118. menu: 'Repair',
  2119. logindeptId: Cookies.get('departmentid'),
  2120. loginpastureId: Cookies.get('pastureid')
  2121. }
  2122. this.get_table_data()
  2123. } else if (this.radioAll === '待处理') {
  2124. this.getdataListParm.name = 'getRepirsWebListNO'
  2125. this.getdataListParm.offset = 1
  2126. this.getdataListParm.parammaps = {
  2127. pastureName: this.getdataListParm.parammaps.pastureName,
  2128. repairCode: this.getdataListParm.parammaps.repairCode,
  2129. eqName: this.getdataListParm.parammaps.eqName,
  2130. eqCode: this.getdataListParm.parammaps.eqCode,
  2131. orderStatue: this.getdataListParm.parammaps.orderStatue,
  2132. SHStatue: this.getdataListParm.parammaps.SHStatue,
  2133. inputDatetime: this.getdataListParm.parammaps.inputDatetime,
  2134. loginId: Cookies.get('employeid'),
  2135. menu: 'Repair',
  2136. logindeptId: Cookies.get('departmentid'),
  2137. loginpastureId: Cookies.get('pastureid'),
  2138. empId: Cookies.get('employeid'),
  2139. pastureId: Cookies.get('pastureid'),
  2140. deptId: Cookies.get('departmentid')
  2141. }
  2142. this.get_table_data()
  2143. } else if (this.radioAll === '已处理') {
  2144. this.getdataListParm.name = 'getRepirsWebList'
  2145. this.getdataListParm.offset = 1
  2146. this.getdataListParm.parammaps = {
  2147. pastureName: this.getdataListParm.parammaps.pastureName,
  2148. repairCode: this.getdataListParm.parammaps.repairCode,
  2149. eqName: this.getdataListParm.parammaps.eqName,
  2150. eqCode: this.getdataListParm.parammaps.eqCode,
  2151. orderStatue: this.getdataListParm.parammaps.orderStatue,
  2152. SHStatue: this.getdataListParm.parammaps.SHStatue,
  2153. inputDatetime: this.getdataListParm.parammaps.inputDatetime,
  2154. loginId: Cookies.get('employeid'),
  2155. menu: 'Repair',
  2156. logindeptId: Cookies.get('departmentid'),
  2157. loginpastureId: Cookies.get('pastureid'),
  2158. empId: Cookies.get('employeid'),
  2159. pastureId: Cookies.get('pastureid'),
  2160. deptId: Cookies.get('departmentid')
  2161. }
  2162. this.get_table_data()
  2163. }
  2164. },
  2165. orderStatue: function(cellValue) {
  2166. // console.log(cellValue.isZeroStock)
  2167. if (cellValue.orderStatue == 0) {
  2168. return '待接单'
  2169. } else if (cellValue.orderStatue == 1) {
  2170. return '维修中'
  2171. } else if (cellValue.orderStatue == 2) {
  2172. return '维修完成'
  2173. } else if (cellValue.orderStatue == 3) {
  2174. return '已驳回'
  2175. }
  2176. },
  2177. SHStatue: function(cellValue) {
  2178. // console.log(cellValue.isZeroStock)
  2179. if (cellValue.SHStatue == 1) {
  2180. return ''
  2181. } else if (cellValue.SHStatue == 2) {
  2182. return '审核中'
  2183. } else if (cellValue.SHStatue == 3) {
  2184. return '审核中'
  2185. } else if (cellValue.SHStatue == 4) {
  2186. return '未通过'
  2187. } else if (cellValue.SHStatue == 6) {
  2188. return '未通过'
  2189. } else if (cellValue.SHStatue == 5) {
  2190. return '已通过'
  2191. }
  2192. },
  2193. form_search() {
  2194. console.log('点击了table搜索')
  2195. this.listLoading = true
  2196. if (this.getdataListParm.parammaps.inputDatetime === null) {
  2197. this.getdataListParm.parammaps.inputDatetime = ''
  2198. }
  2199. this.getdataListParm.offset = 1
  2200. this.get_table_data()
  2201. this.getPendingList()
  2202. },
  2203. resetCreateTemp() {
  2204. this.createTemp.pastureId = this.$store.state.user.pastureid
  2205. this.createTemp.departmentId = this.$store.state.user.departmentid
  2206. this.createTemp.eqId = ''
  2207. this.createTemp.eqCode = ''
  2208. this.createTemp.eqName = ''
  2209. this.createTemp.repairDept = ''
  2210. this.createTemp.details = ''
  2211. this.createTemp.requesterId = this.$store.state.user.employeid
  2212. this.createTemp.requestTime = parseTime(new Date(), '{y}-{m}-{d} {h}:{i}')
  2213. this.createTemp.pickId = ''
  2214. this.createTemp.repairCode = ''
  2215. this.createTemp.deptName = ''
  2216. this.createTemp.departmentId = ''
  2217. this.createTemp.eqClassId = ''
  2218. this.createTemp.pickNameArr = ''
  2219. },
  2220. changePickId(val) {
  2221. if (this.dialogStatus == 'create') {
  2222. var depTiDArr = []
  2223. this.maintainers.forEach(function(item){
  2224. val.forEach(function(items){
  2225. if(item.id == items){
  2226. depTiDArr.push(item.deptid)
  2227. }
  2228. })
  2229. })
  2230. console.log(depTiDArr)
  2231. this.createTemp.repairDept = depTiDArr[0]
  2232. //this.createTemp.repairDept = this.maintainers.find(obj => obj.id == val).deptid
  2233. console.log(val)
  2234. } else {
  2235. this.distributeLeafletsTemp.repairDept = this.maintainers.find(obj => obj.id == val).deptid
  2236. }
  2237. },
  2238. add_dialog_save_cont() {
  2239. this.isokDisable = true
  2240. setTimeout(() => {
  2241. this.isokDisable = false
  2242. }, 1000)
  2243. this.$refs['createTempCont'].validate(valid => {
  2244. if (valid) {
  2245. console.log(this.listAddCont)
  2246. if (this.createTempCont.outsourcingCode == '' || this.createTempCont.outsourcingCode == null || this.createTempCont.outsourcingCode == undefined) {
  2247. GetDataByName(this.getParmCreateNumber).then(response => {
  2248. this.$nextTick(() => {
  2249. console.log('新增单号', response.data.list[0].orderCode)
  2250. this.createTempCont.outsourcingCode = response.data.list[0].orderCode
  2251. this.$forceUpdate()
  2252. this.add_dialog_cont_saveSave()
  2253. })
  2254. })
  2255. } else {
  2256. this.add_dialog_cont_saveSave()
  2257. }
  2258. }
  2259. })
  2260. },
  2261. add_dialog_cont_saveSave() {
  2262. // for (var j = 0; j < this.listAddCont.length; j++) {
  2263. // console.log(this.listAddCont[j].amount)
  2264. // if (this.createTempCont.contract == 1){
  2265. // if (this.listAddCont[j].contractCode == null || this.listAddCont[j].contractCode === '') {
  2266. // this.$message({ type: 'warning', message: '请检查合同编号是否未填写', duration: 2000 })
  2267. // return false
  2268. // }
  2269. // }
  2270. // }
  2271. // var send_data = {
  2272. // "common": { "returnmap": "0" },
  2273. // "data": [
  2274. // {
  2275. // "name": "addBigoutsourcing", "type": "e",
  2276. // "parammaps": this.createTempCont
  2277. // },
  2278. // {
  2279. // "name": "insertSpotList",
  2280. // "resultmaps": { "list": this.listAddCont },
  2281. // "children": [
  2282. // {
  2283. // "name": "addOutsourcing", "type": "e",
  2284. // "parammaps": {
  2285. // "bigId": "@addBigoutsourcing.LastInsertId",
  2286. // "providerId": "@insertSpotList.providerId",
  2287. // "amount": "@insertSpotList.amount",
  2288. // "eqId": "@insertSpotList.eqId",
  2289. // "eqCode": "@insertSpotList.eqCode",
  2290. // "eqName": "@insertSpotList.eqName",
  2291. // "typea": "@insertSpotList.typea",
  2292. // "date": "@insertSpotList.date",
  2293. // "contractId": "@insertSpotList.contractId",
  2294. // "providerName": "@insertSpotList.providerName",
  2295. // "RUCode": "@insertSpotList.RUCode",
  2296. // "contractCode": "@insertSpotList.contractCode"
  2297. // }
  2298. // }
  2299. // ]
  2300. // },
  2301. // {
  2302. // "name": "takeOutsourcing", "type": "e",
  2303. // "parammaps": {
  2304. // departmentId:this.createTempCont.departmentId,
  2305. // id:this.createTempCont.id,
  2306. // }
  2307. // },
  2308. // ]
  2309. // }
  2310. // ExecDataByConfig(send_data).then(response => {
  2311. // console.log('新增保存发送参数', send_data)
  2312. // if (response.msg === 'fail') {
  2313. // this.$notify({
  2314. // title: '保存失败',
  2315. // message: response.data,
  2316. // type: 'warning',
  2317. // duration: 2000
  2318. // })
  2319. // } else {
  2320. // this.dialogFormVisibleCont = false
  2321. // this.get_table_data()
  2322. // this.$notify({
  2323. // title: '',
  2324. // message: '保存成功',
  2325. // type: 'success',
  2326. // duration: 2000
  2327. // })
  2328. // }
  2329. // })
  2330. // return true
  2331. // ========================
  2332. for (var j = 0; j < this.listAddCont.length; j++) {
  2333. console.log(this.listAddCont[j].amount)
  2334. if (this.listAddCont[j].amount == null || this.listAddCont[j].amount === '') {
  2335. // this.$message({ type: 'warning', message: '请检查金额是否未填写', duration: 2000 })
  2336. // return false
  2337. } else {
  2338. // var rulesAmount = /^[1-9]\d*$/
  2339. // if (!rulesAmount.test(this.listAddCont[j].amount)) {
  2340. // this.$message({ type: 'error', message: '申购数量请输入正整数', duration: 2000 })
  2341. // return false
  2342. // }
  2343. }
  2344. if (this.createTempCont.contract == 1){
  2345. if (this.listAddCont[j].contractCode == null || this.listAddCont[j].contractCode === '') {
  2346. this.$message({ type: 'warning', message: '请检查合同编号是否未填写', duration: 2000 })
  2347. return false
  2348. }
  2349. }
  2350. }
  2351. var amount = 0
  2352. if(this.createTempCont.contract==0){
  2353. amount = "@insertSpotList.amount"
  2354. }else{
  2355. amount = 0
  2356. }
  2357. if(this.createTempCont.contract == 0){
  2358. // 无合同
  2359. this.$set(this.createTempCont,'status',0)
  2360. }else{
  2361. // 有合同
  2362. this.$set(this.createTempCont,'status',1)
  2363. }
  2364. var send_data = {
  2365. "common": { "returnmap": "0" },
  2366. "data": [
  2367. {
  2368. "name": "addBigoutsourcing", "type": "e",
  2369. "parammaps": this.createTempCont
  2370. },
  2371. {
  2372. "name": "insertSpotList",
  2373. "resultmaps": { "list": this.listAddCont },
  2374. "children": [
  2375. {
  2376. "name": "addOutsourcing", "type": "e",
  2377. "parammaps": {
  2378. "bigId": "@addBigoutsourcing.LastInsertId",
  2379. "providerId": "@insertSpotList.providerId",
  2380. "amount": amount,
  2381. "eqId": "@insertSpotList.eqId",
  2382. "eqCode": "@insertSpotList.eqCode",
  2383. "eqName": "@insertSpotList.eqName",
  2384. "typea": "@insertSpotList.typea",
  2385. "date": "@insertSpotList.date",
  2386. "contractId": "@insertSpotList.contractId",
  2387. "providerName": "@insertSpotList.providerName",
  2388. "contractCode": "@insertSpotList.contractCode",
  2389. "status":this.createTempCont.status
  2390. }
  2391. }
  2392. ]
  2393. },
  2394. {
  2395. "name": "takeOutsourcing", "type": "e",
  2396. "parammaps": {
  2397. departmentId:this.createTempCont.departmentId,
  2398. id:this.createTempCont.id,
  2399. outsourcing:2
  2400. }
  2401. },
  2402. ]
  2403. }
  2404. ExecDataByConfig(send_data).then(response => {
  2405. console.log('新增保存发送参数', send_data)
  2406. if (response.msg === 'fail') {
  2407. this.$notify({
  2408. title: '保存失败',
  2409. message: response.data,
  2410. type: 'warning',
  2411. duration: 2000
  2412. })
  2413. } else {
  2414. if(this.createTempCont.contract==1){
  2415. this.add_dialog_saveSave2()
  2416. }
  2417. this.dialogFormVisibleCont = false
  2418. this.get_table_data()
  2419. this.$notify({
  2420. title: '',
  2421. message: '保存成功',
  2422. type: 'success',
  2423. duration: 2000
  2424. })
  2425. }
  2426. })
  2427. return true
  2428. },
  2429. add_dialog_saveSave2() {
  2430. console.log(this.examineTemp,'=======contract')
  2431. // this.examineTemp.iscontract =
  2432. //牧场
  2433. var mydata = {
  2434. // acceptanceCode:this.createTemp.acceptanceCode,
  2435. pastureId: parseInt(Cookies.get('pastureid')),
  2436. departmentId: parseInt(Cookies.get('departmentid')),
  2437. applicant:Cookies.get('employeid'),
  2438. outsourcingCode:this.createTempCont.outsourcingCode,
  2439. applyType:0,
  2440. date:parseTime(new Date(), '{y}-{m}-{d}'),
  2441. status:1
  2442. }
  2443. if(this.examineTemp.contract == 0){
  2444. mydata.iscontract = 1
  2445. }else{
  2446. mydata.iscontract = 0
  2447. }
  2448. var send_data = {
  2449. "common": { "returnmap": "0" },
  2450. "data": [
  2451. {
  2452. "name": "insertBigacceptance",
  2453. "type": "e",
  2454. "parammaps": mydata
  2455. }
  2456. ]
  2457. }
  2458. ExecDataByConfig(send_data).then(response => {
  2459. console.log('新增保存发送参数', send_data)
  2460. if (response.msg === 'fail') {
  2461. this.$notify({
  2462. title: '保存失败',
  2463. message: response.data,
  2464. type: 'warning',
  2465. duration: 2000
  2466. })
  2467. } else {
  2468. }
  2469. })
  2470. },
  2471. change_contract(val) {
  2472. console.log(val)
  2473. // if(val == 1){
  2474. // this.createTempCont.contract = 1
  2475. // } else {
  2476. // this.createTempCont.contract = 0
  2477. // }
  2478. this.$forceUpdate()
  2479. },
  2480. form_add_cont_sure(row) {
  2481. console.log('点击了是否确认委外维修?',row)
  2482. MessageBox.confirm('是否确认委外维修?', {
  2483. confirmButtonText: '确认',
  2484. cancelButtonText: '取消',
  2485. type: 'warning'
  2486. }).then(() => {
  2487. var send_data = {
  2488. "common": { "returnmap": "0" },
  2489. "data": [
  2490. {
  2491. "name": "editMaintainoutsourcing", "type": "e",
  2492. "parammaps": { "outsourcing": 1, "id":row.id }
  2493. },
  2494. {
  2495. "name": "takeOutsourcing", "type": "e",
  2496. "parammaps": {
  2497. departmentId:this.createTempCont.departmentId,
  2498. id:row.id,
  2499. outsourcing:1
  2500. }
  2501. }
  2502. ]
  2503. }
  2504. ExecDataByConfig(send_data).then(response => {
  2505. this.get_table_data()
  2506. this.$notify({
  2507. title: '成功',
  2508. message: '成功',
  2509. type: 'success',
  2510. duration: 2000
  2511. })
  2512. })
  2513. }).catch(() => {
  2514. this.$message({
  2515. type: 'info',
  2516. message: '已取消'
  2517. })
  2518. })
  2519. },
  2520. form_add_cont(row) {
  2521. this.createTempCont = Object.assign({}, row)
  2522. console.log(this.createTempCont.description)
  2523. if(this.createTempCont.description == undefined || this.createTempCont.description == null){
  2524. this.$set(this.createTempCont,'description','')
  2525. }
  2526. console.log(this.createTempCont.description,'====')
  2527. this.reset_create_cont()
  2528. this.getDepartParam2.parammaps.pastureId = this.createTempCont.pastureId
  2529. this.get_depart_list2()
  2530. this.createTempCont.RUCode = row.repairCode
  2531. this.dialogFormVisibleCont = true
  2532. this.listLoading = false
  2533. this.$nextTick(() => {
  2534. this.$refs['createTempCont'].clearValidate()
  2535. })
  2536. //新增生成单号
  2537. this.get_create_num()
  2538. },
  2539. get_create_num() {
  2540. GetDataByName(this.getParmCreateNumber).then(response => {
  2541. this.$nextTick(() => {
  2542. console.log('新增单号', response.data.list[0].orderCode)
  2543. this.createTempCont.outsourcingCode = response.data.list[0].orderCode
  2544. this.$forceUpdate()
  2545. })
  2546. })
  2547. },
  2548. reset_create_cont() {
  2549. this.createTempCont.pastureId = parseInt(Cookies.get('pastureid'))
  2550. this.createTempCont.departmentId = parseInt(Cookies.get('departmentid'))
  2551. if(parseInt(Cookies.get('pastureid')) == 18){
  2552. this.createTempCont.departmentId = ""
  2553. }
  2554. this.createTempCont.departmentName = Cookies.get('departmentname')
  2555. this.createTempCont.employeId = parseInt(Cookies.get('employeid'))
  2556. this.createTempCont.date = parseTime(new Date(), '{y}-{m}-{d}')
  2557. this.createTempCont.outsourcingCode = ''
  2558. this.createTempCont.applicant = parseInt(Cookies.get('employeid'))
  2559. this.createTempCont.providerId = ''
  2560. this.createTempCont.contract = 1
  2561. this.createTempCont.repairCode = ""
  2562. this.createTempCont.description = ''
  2563. this.listAddCont = [{providerName:"",providerId: "0",eqId: "0",contractId: "0",amount:"",contractCode:"",date:"",eqCode:"",eqName:"",remark:"",typea:"",}]
  2564. },
  2565. change_pasture2(item) {
  2566. this.getDepartParam2.parammaps.pastureId = item
  2567. this.get_depart_list2()
  2568. },
  2569. get_depart_list2() {
  2570. GetDataByName(this.getDepartParam2).then(response => {
  2571. this.departNameList2 = response.data.list
  2572. })
  2573. },
  2574. change_depart2(item) {
  2575. this.createTemp.departmentName = this.departNameList2.find(obj => obj.id == item).name
  2576. },
  2577. form_add() {
  2578. this.dialogStatus = 'create'
  2579. this.dialogFormVisible_Create = true
  2580. this.resetCreateTemp()
  2581. this.getRepairNumber()
  2582. //this.getRepirsEmp()
  2583. },
  2584. isToDayrResubmit(){
  2585. //一天同一牧场同一设备同一故障是否重复提交
  2586. this.resubmit.name = 'checkMaintain'
  2587. this.resubmit.parammaps = {
  2588. pastureId : this.createTemp.pastureId,
  2589. eqId : this.createTemp.eqId,
  2590. eqName : this.createTemp.eqName,
  2591. eqCode : this.createTemp.eqCode,
  2592. details : this.createTemp.details,
  2593. requestTime : parseTime(new Date(), '{y}-{m}-{d}')
  2594. }
  2595. },
  2596. getRepairNumber() {
  2597. GetDataByName(this.getRepairNumberParm).then(response => {
  2598. this.$nextTick(() => {
  2599. console.log('新增报修单号', response.data.list[0].orderCode)
  2600. this.createTemp.repairCode = response.data.list[0].orderCode
  2601. this.$forceUpdate()
  2602. })
  2603. })
  2604. },
  2605. add_dialog_save() {
  2606. this.isToDayrResubmit()
  2607. GetDataByName(this.resubmit).then(response => {
  2608. console.log('该设备已报修未完成修复,请勿重复提交', this.requestParam,this.resubmit,response)
  2609. if (response.msg !== 'fail') {
  2610. if(response.data.total > 0){
  2611. this.$notify({ title: '提交失败', message: '该设备已报修未完成修复', type: 'warning', duration: 2000 })
  2612. this.isCanSubmit = false
  2613. return false
  2614. }
  2615. this.isCanSubmit = true
  2616. // 可以提交
  2617. this.isokDisable = true
  2618. setTimeout(() => {
  2619. this.isokDisable = false
  2620. }, 1000)
  2621. this.$refs['createTemp'].validate(valid => {
  2622. if (valid) {
  2623. if (this.createTemp.repairCode == '' || this.createTemp.repairCode == null || this.createTemp.repairCode == undefined) {
  2624. GetDataByName(this.getRepairNumberParm).then(response => {
  2625. this.$nextTick(() => {
  2626. console.log('新增报修单号', response.data.list[0].orderCode)
  2627. this.createTemp.repairCode = response.data.list[0].orderCode
  2628. this.$forceUpdate()
  2629. this.add_dialog_saveSave()
  2630. })
  2631. })
  2632. } else {
  2633. this.add_dialog_saveSave()
  2634. }
  2635. }
  2636. })
  2637. }else{
  2638. this.$notify({ title: '请检查接口', message: "name: checkMaintain", type: 'warning', duration: 2000 })
  2639. }
  2640. })
  2641. },
  2642. add_dialog_saveSave() {
  2643. this.requestParam.name = 'insertmaintain'
  2644. this.requestParam.parammaps = this.createTemp
  2645. var detailString = this.requestParam.parammaps.details.toString()
  2646. this.requestParam.parammaps.details = detailString
  2647. if(this.requestParam.parammaps.pickId.length != 0 && this.requestParam.parammaps.pickId){
  2648. this.requestParam.parammaps.pickId = this.requestParam.parammaps.pickId.toString()
  2649. }
  2650. PostDataByName(this.requestParam).then(response => {
  2651. console.log('新增保存发送参数', this.requestParam)
  2652. if (response.msg !== 'fail') {
  2653. this.get_table_data()
  2654. this.getPendingList()
  2655. this.dialogFormVisible_Create = false
  2656. this.$notify({ title: '成功', message: '新增成功', type: 'success', duration: 2000 })
  2657. } else {
  2658. failproccess(response, this.$notify)
  2659. }
  2660. })
  2661. },
  2662. querySearchEqName(queryString, cb) {
  2663. console.log('备件名称/设备内部编号模糊查询输入值', queryString)
  2664. this.requestEqName.parammaps['eqName'] = queryString
  2665. GetDataByName(this.requestEqName).then(response => {
  2666. if (response.data.list !== null) {
  2667. console.log('备件名称模糊查询搜索data', response.data.list)
  2668. this.EqNameList = response.data.list
  2669. } else {
  2670. this.EqNameList = []
  2671. }
  2672. cb(this.EqNameList)
  2673. })
  2674. },
  2675. handleSelectEqName(item) {
  2676. console.log('备件名称/设备内部编号模糊查询选中值', item)
  2677. this.$set(this.createTemp, 'eqCode', item.eqCode)
  2678. this.$set(this.createTemp, 'eqId', item.eqId)
  2679. this.$set(this.createTemp, 'eqClassId', item.eqClassId)
  2680. this.$set(this.createTemp, 'pickId', '')
  2681. if (item.deptName !== undefined && item.departmentId !== undefined) {
  2682. this.$set(this.createTemp, 'deptName', item.deptName)
  2683. this.$set(this.createTemp, 'departmentId', item.departmentId)
  2684. } else {
  2685. this.$set(this.createTemp, 'deptName', '')
  2686. this.$set(this.createTemp, 'departmentId', '')
  2687. }
  2688. this.getdataListParmDetail.parammaps.eqClassId = item.eqClassId
  2689. this.getDetail()
  2690. this.getRepirsEmpParm.parammaps.empid = item.maintenance
  2691. this.getRepirsEmp()
  2692. this.$forceUpdate()
  2693. },
  2694. querySearchCode(queryString, cb) {
  2695. console.log('备件名称/设备内部编号模糊查询输入值', queryString)
  2696. this.requestEqName.parammaps['eqCode'] = queryString
  2697. GetDataByName(this.requestEqName).then(response => {
  2698. if (response.data.list !== null) {
  2699. console.log('备件名称模糊查询搜索data', response.data.list)
  2700. this.EqNameList = response.data.list
  2701. } else {
  2702. this.EqNameList = []
  2703. }
  2704. cb(this.EqNameList)
  2705. })
  2706. },
  2707. handleSelectEqCode(item, row) {
  2708. console.log('备件名称/设备内部编号模糊查询选中值', item)
  2709. console.log('备件名称/设备内部编号模糊查询选中值所在行', row)
  2710. this.$set(this.createTemp, 'eqName', item.eqName)
  2711. this.$set(this.createTemp, 'eqId', item.eqId)
  2712. this.$set(this.createTemp, 'eqClassId', item.eqClassId)
  2713. this.$set(this.createTemp, 'pickId', '')
  2714. if (item.deptName !== undefined && item.departmentId !== undefined) {
  2715. this.$set(this.createTemp, 'deptName', item.deptName)
  2716. this.$set(this.createTemp, 'departmentId', item.departmentId)
  2717. } else {
  2718. this.$set(this.createTemp, 'deptName', '')
  2719. this.$set(this.createTemp, 'departmentId', '')
  2720. }
  2721. this.getdataListParmDetail.parammaps.eqClassId = item.eqClassId
  2722. this.getDetail()
  2723. this.$forceUpdate()
  2724. this.getRepirsEmpParm.parammaps.empid = item.maintenance
  2725. this.getRepirsEmp()
  2726. },
  2727. getDetail(){
  2728. GetDataByName(this.getdataListParmDetail).then(response => {
  2729. if (response.data.list !== null) {
  2730. console.log('DetailList数据', response.data.list)
  2731. this.DetailList = response.data.list
  2732. } else {
  2733. this.DetailList = []
  2734. }
  2735. })
  2736. },
  2737. changeDetails(e){
  2738. console.log(e)
  2739. },
  2740. form_see(row) {
  2741. console.log(row)
  2742. this.seeTemp = Object.assign({}, row)
  2743. // 流程图
  2744. var reason = '未通过原因:' + this.seeTemp.workflowNote
  2745. var scores = '评分:' + this.seeTemp.scores + '分'
  2746. if (this.seeTemp.orderStatue === 0) {
  2747. this.activeList = [{ title: '报修', date: this.seeTemp.requestTime, name: this.seeTemp.requesterName }, { title: '维修接单' }, { title: '完成维修' }, { title: '使用人审核' }, { title: '设备主管审核' }]
  2748. this.active = 1
  2749. } else if (this.seeTemp.orderStatue == 3) {
  2750. this.activeList = [{ title: '报修', date: this.seeTemp.requestTime, name: this.seeTemp.requesterName }, { title: '报修驳回', date: this.seeTemp.shutdownDate, name: this.seeTemp.shutdownPerson }]
  2751. this.active = 1
  2752. } else if (this.seeTemp.orderStatue === 1 && this.seeTemp.SHStatue === 1) {
  2753. this.activeList = [{ title: '报修', date: this.seeTemp.requestTime, name: this.seeTemp.requesterName }, { title: '维修接单', date: this.seeTemp.orderTime, name: this.seeTemp.pickName }, { title: '完成维修' }, { title: '使用人审核' }, { title: '设备主管审核' }]
  2754. this.active = 2
  2755. } else if (this.seeTemp.SHStatue === 2) {
  2756. this.activeList = [{ title: '报修', date: this.seeTemp.requestTime, name: this.seeTemp.requesterName }, { title: '维修接单', date: this.seeTemp.orderTime, name: this.seeTemp.pickName }, { title: '完成维修', date: this.seeTemp.stopTime, name: this.seeTemp.pickName }, { title: '使用人审核' }, { title: '设备主管审核' }]
  2757. this.active = 3
  2758. } else if (this.seeTemp.SHStatue === 3) {
  2759. this.active = 4
  2760. this.activeList = [{ title: '报修', date: this.seeTemp.requestTime, name: this.seeTemp.requesterName }, { title: '维修接单', date: this.seeTemp.orderTime, name: this.seeTemp.pickName }, { title: '完成维修', date: this.seeTemp.stopTime, name: this.seeTemp.pickName }, { title: '使用人审核', date: this.seeTemp.useChargeDate, name: this.seeTemp.useChargePerson, scores: scores }, { title: '设备主管审核' }]
  2761. } else if (this.seeTemp.SHStatue === 4) {
  2762. this.active = 4
  2763. // var reason = '未通过原因:' + this.seeTemp.workflowNote
  2764. this.activeList = [{ title: '报修', date: this.seeTemp.requestTime, name: this.seeTemp.requesterName }, { title: '维修接单', date: this.seeTemp.orderTime, name: this.seeTemp.pickName }, { title: '完成维修', date: this.seeTemp.stopTime, name: this.seeTemp.pickName }, { title: '使用人审核', date: this.seeTemp.useChargeDate, name: this.seeTemp.useChargePerson, status: 'error', reason: reason }, { title: '设备主管审核' }]
  2765. } else if (this.seeTemp.SHStatue === 5) {
  2766. this.activeList = [{ title: '报修', date: this.seeTemp.requestTime, name: this.seeTemp.requesterName }, { title: '维修接单', date: this.seeTemp.orderTime, name: this.seeTemp.pickName }, { title: '完成维修', date: this.seeTemp.stopTime, name: this.seeTemp.pickName }, { title: '使用人审核', date: this.seeTemp.useChargeDate, name: this.seeTemp.useChargePerson, scores: scores }, { title: '设备主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }]
  2767. this.active = 5
  2768. } else if (this.seeTemp.SHStatue === 6) {
  2769. // var reason = '未通过原因:' + this.seeTemp.workflowNote
  2770. this.activeList = [{ title: '报修', date: this.seeTemp.requestTime, name: this.seeTemp.requesterName }, { title: '维修接单', date: this.seeTemp.orderTime, name: this.seeTemp.pickName }, { title: '完成维修', date: this.seeTemp.stopTime, name: this.seeTemp.pickName }, { title: '使用人审核', date: this.seeTemp.useChargeDate, name: this.seeTemp.useChargePerson, scores: scores }, { title: '设备主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson, status: 'error', reason: reason }]
  2771. this.active = 5
  2772. }
  2773. this.seeTemp.requestTime = parseTime(this.seeTemp.requestTime, '{y}-{m}-{d}')
  2774. this.seeTemp.shutdownDate = parseTime(this.seeTemp.shutdownDate, '{y}-{m}-{d}')
  2775. this.seeTemp.orderTime = parseTime(this.seeTemp.orderTime, '{y}-{m}-{d}')
  2776. this.dialogStatus = 'see'
  2777. this.dialogFormVisible_See = true
  2778. if (row.orderStatue == 0) {
  2779. this.orderStatue1 = true
  2780. this.orderStatue2 = false
  2781. } else if (row.orderStatue == 3) {
  2782. this.orderStatue1 = true
  2783. this.orderStatue2 = false
  2784. } else {
  2785. this.orderStatue1 = false
  2786. this.orderStatue2 = true
  2787. this.getFaultList()
  2788. this.getOldProductsList()
  2789. this.getCollarUseList()
  2790. }
  2791. },
  2792. resetDistributeLeafletsTemp() {
  2793. this.distributeLeafletsTemp.repairDept = ''
  2794. this.distributeLeafletsTemp.pickId = ''
  2795. this.distributeLeafletsTemp.chargeDate = parseTime(new Date(), '{y}-{m}-{d}')
  2796. this.distributeLeafletsTemp.chargeId = this.$store.state.user.employeid
  2797. },
  2798. // 派单
  2799. handleDistributeLeaflets(row) {
  2800. if (row == undefined) {
  2801. this.distributeLeafletsTemp = this.seeTemp
  2802. } else {
  2803. this.distributeLeafletsTemp = Object.assign({}, row)
  2804. }
  2805. console.log('点击了派单')
  2806. this.dialogStatus = 'distributeLeaflets'
  2807. this.dialogFormVisible_DistributeLeaflets = true
  2808. this.resetDistributeLeafletsTemp()
  2809. this.getRepirsEmpParm.parammaps.empid = ""
  2810. this.getRepirsEmp()
  2811. },
  2812. changeMaintenanceTeam(val) {
  2813. console.log(val)
  2814. this.getRepirsEmpParm.parammaps.deptid = val
  2815. this.createTemp.pickId = ''
  2816. this.distributeLeafletsTemp.pickId = ''
  2817. this.getRepirsEmpParm.parammaps.empid = ""
  2818. this.getRepirsEmp()
  2819. },
  2820. getRepirsEmp() {
  2821. var _this = this
  2822. GetDataByName(this.getRepirsEmpParm).then(response => {
  2823. console.log('维修人数据', response.data.list)
  2824. _this.maintainers = response.data.list
  2825. var pickNameArr = []
  2826. var pickidArr = []
  2827. var depTiDArr = []
  2828. _this.maintainers.forEach(function(item){
  2829. pickNameArr.push(item.empNameAndmt)
  2830. pickidArr.push(item.id)
  2831. depTiDArr.push(item.deptid)
  2832. })
  2833. _this.pickNameArr = pickNameArr
  2834. _this.pickidArr = pickidArr
  2835. _this.depTiDArr = depTiDArr
  2836. _this.createTemp.pickId = pickidArr
  2837. _this.createTemp.repairDept = depTiDArr[0]
  2838. console.log(pickNameArr,pickidArr,depTiDArr)
  2839. })
  2840. },
  2841. // 派单-保存
  2842. createDistributeLeafletsData() {
  2843. console.log('点击了派单确认')
  2844. this.isokDisable = true
  2845. setTimeout(() => {
  2846. this.isokDisable = false
  2847. }, 1000)
  2848. this.$refs['distributeLeafletsTemp'].validate(valid => {
  2849. if (valid) {
  2850. this.requestParam.name = 'setRepirsEmp'
  2851. this.requestParam.parammaps = this.distributeLeafletsTemp
  2852. this.requestParam.parammaps.id = this.distributeLeafletsTemp.id
  2853. PostDataByName(this.requestParam).then(response => {
  2854. console.log('派单确认发送参数', this.requestParam)
  2855. if (response.msg !== 'fail') {
  2856. this.listLoading = true
  2857. this.get_table_data()
  2858. this.dialogFormVisible_DistributeLeaflets = false
  2859. this.dialogFormVisible_See = false
  2860. this.getPendingList()
  2861. this.$notify({ title: '成功', message: '派单成功', type: 'success', duration: 2000 })
  2862. } else {
  2863. failproccess(response, this.$notify)
  2864. }
  2865. })
  2866. }
  2867. })
  2868. },
  2869. getFaultList() {
  2870. this.listLoadingFault = true
  2871. if (this.dialogStatus == 'repairComplete') {
  2872. this.getFaultListParm.parammaps.maintainId = this.repairCompleteTemp.id
  2873. } else {
  2874. this.getFaultListParm.parammaps.maintainId = this.seeTemp.id
  2875. }
  2876. GetDataByName(this.getFaultListParm).then(response => {
  2877. if (response.data.list !== null) {
  2878. console.log('故障table数据', response.data.list)
  2879. this.listFault = response.data.list
  2880. } else {
  2881. this.listFault = []
  2882. }
  2883. setTimeout(() => {
  2884. this.listLoadingFault = false
  2885. }, 100)
  2886. })
  2887. },
  2888. getCollarUseList() {
  2889. this.listLoadingCollarUse = true
  2890. this.getCollarUseListParm.parammaps.RUCode = this.seeTemp.repairCode
  2891. GetDataByName(this.getCollarUseListParm).then(response => {
  2892. console.log('领用记录table数据', response.data.list)
  2893. this.listCollarUse = response.data.list
  2894. setTimeout(() => {
  2895. this.listLoadingCollarUse = false
  2896. }, 100)
  2897. })
  2898. },
  2899. statue: function(cellValue) {
  2900. // console.log(cellValue.isZeroStock)
  2901. if (cellValue.statue == 0) {
  2902. return '未领用'
  2903. } else if (cellValue.statue == 1) {
  2904. return '已领用'
  2905. }
  2906. },
  2907. getOldProductsList() {
  2908. this.listLoadingOldProducts = true
  2909. this.getOldProductsListParm.parammaps.repairCode = this.seeTemp.repairCode
  2910. GetDataByName(this.getOldProductsListParm).then(response => {
  2911. console.log('旧品录入记录table数据', response.data.list)
  2912. this.listOldProducts = response.data.list
  2913. setTimeout(() => {
  2914. this.listLoadingOldProducts = false
  2915. }, 100)
  2916. })
  2917. },
  2918. // 维修及审核
  2919. handleExamine(row) {
  2920. if (row == undefined) {
  2921. this.examineTemp = this.seeTemp
  2922. this.$set(this.seeTemp, 'statue', 3)
  2923. this.$set(this.seeTemp, 'workflowNote', '')
  2924. this.$set(this.seeTemp, 'scores', '')
  2925. } else {
  2926. this.examineTemp = Object.assign({}, row)
  2927. this.$set(this.examineTemp, 'statue', 3)
  2928. this.$set(this.examineTemp, 'workflowNote', '')
  2929. this.$set(this.examineTemp, 'scores', '')
  2930. }
  2931. console.log('点击了维修审核')
  2932. this.dialogStatus = 'maintenanceAudit'
  2933. this.dialogFormVisible_MaintenanceAudit = true
  2934. },
  2935. changeStatue(val) {
  2936. if (val == 4) {
  2937. this.statueReason = true
  2938. } else {
  2939. this.statueReason = false
  2940. }
  2941. },
  2942. // 维修审核-保存
  2943. createExamineData() {
  2944. console.log('点击了维修审核确认')
  2945. this.isokDisable = true
  2946. setTimeout(() => {
  2947. this.isokDisable = false
  2948. }, 1000)
  2949. this.$refs['examineTemp'].validate(valid => {
  2950. if (valid) {
  2951. this.requestParam.name = 'maintainCharge'
  2952. this.requestParam.parammaps = {}
  2953. this.requestParam.parammaps.id = this.examineTemp.id
  2954. this.requestParam.parammaps.statue = this.examineTemp.statue
  2955. this.requestParam.parammaps.empId = Cookies.get('employeid')
  2956. this.requestParam.parammaps.workflowNote = this.examineTemp.workflowNote
  2957. if (this.requestParam.parammaps.statue == 4) {
  2958. this.requestParam.parammaps.scores = 5
  2959. } else {
  2960. this.requestParam.parammaps.scores = this.examineTemp.scores
  2961. }
  2962. PostDataByName(this.requestParam).then(response => {
  2963. console.log('维修审核确认发送参数', this.requestParam)
  2964. if (response.msg !== 'fail') {
  2965. if (this.getdataListParm.parammaps.inputDatetime === null) {
  2966. this.getdataListParm.parammaps.inputDatetime = ''
  2967. }
  2968. this.get_table_data()
  2969. this.getPendingList()
  2970. this.dialogFormVisible_MaintenanceAudit = false
  2971. this.dialogFormVisible_See = false
  2972. this.statueReason = false
  2973. this.$notify({ title: '成功', message: '审核成功', type: 'success', duration: 2000 })
  2974. } else {
  2975. failproccess(response, this.$notify)
  2976. }
  2977. })
  2978. }
  2979. })
  2980. },
  2981. // 维修审核2
  2982. handleExamine2(row) {
  2983. if (row == undefined) {
  2984. this.examineTemp = this.seeTemp
  2985. this.$set(this.seeTemp, 'statue', 3)
  2986. this.$set(this.seeTemp, 'workflowNote', '')
  2987. } else {
  2988. this.examineTemp = Object.assign({}, row)
  2989. this.$set(this.examineTemp, 'statue', 3)
  2990. this.$set(this.examineTemp, 'workflowNote', '')
  2991. }
  2992. console.log('点击了维修审核')
  2993. this.dialogStatus = 'maintenanceAudit2'
  2994. this.dialogFormVisible_MaintenanceAudit = true
  2995. },
  2996. // 维修审核2-保养form_add_cont
  2997. createExamineData2() {
  2998. if (this.examineTemp.statue == 3) {
  2999. console.log('点击了维修审核确认-通过')
  3000. this.isokDisable = true
  3001. setTimeout(() => {
  3002. this.isokDisable = false
  3003. }, 1000)
  3004. this.$refs['examineTemp'].validate(valid => {
  3005. if (valid) {
  3006. this.requestParam.name = 'maintainChargDone'
  3007. this.requestParam.parammaps = {}
  3008. this.requestParam.parammaps.id = this.examineTemp.id
  3009. this.requestParam.parammaps.statue = 5
  3010. this.requestParam.parammaps.orderStatue = 2
  3011. this.requestParam.parammaps.empId = Cookies.get('employeid')
  3012. this.requestParam.parammaps.workflowNote = this.examineTemp.workflowNote
  3013. PostDataByName(this.requestParam).then(response => {
  3014. console.log('维修审核确认发送参数', this.requestParam)
  3015. if (response.msg !== 'fail') {
  3016. if (this.getdataListParm.parammaps.inputDatetime === null) {
  3017. this.getdataListParm.parammaps.inputDatetime = ''
  3018. }
  3019. this.get_table_data()
  3020. this.getPendingList()
  3021. this.dialogFormVisible_MaintenanceAudit = false
  3022. this.dialogFormVisible_See = false
  3023. this.statueReason = false
  3024. this.$notify({ title: '成功', message: '审核成功', type: 'success', duration: 2000 })
  3025. } else {
  3026. failproccess(response, this.$notify)
  3027. }
  3028. })
  3029. }
  3030. })
  3031. } else {
  3032. console.log('点击了维修审核确认-未通过')
  3033. this.isokDisable = true
  3034. setTimeout(() => {
  3035. this.isokDisable = false
  3036. }, 1000)
  3037. this.$refs['examineTemp'].validate(valid => {
  3038. if (valid) {
  3039. this.requestParam.name = 'maintainCharge1'
  3040. this.requestParam.parammaps = {}
  3041. this.requestParam.parammaps.id = this.examineTemp.id
  3042. this.requestParam.parammaps.statue = 6
  3043. this.requestParam.parammaps.empId = Cookies.get('employeid')
  3044. this.requestParam.parammaps.workflowNote = this.examineTemp.workflowNote
  3045. PostDataByName(this.requestParam).then(response => {
  3046. console.log('维修审核确认发送参数', this.requestParam)
  3047. if (response.msg !== 'fail') {
  3048. if (this.getdataListParm.parammaps.inputDatetime === null) {
  3049. this.getdataListParm.parammaps.inputDatetime = ''
  3050. }
  3051. this.get_table_data()
  3052. this.getPendingList()
  3053. this.dialogFormVisible_MaintenanceAudit = false
  3054. this.dialogFormVisible_See = false
  3055. this.$notify({ title: '成功', message: '审核成功', type: 'success', duration: 2000 })
  3056. } else {
  3057. failproccess(response, this.$notify)
  3058. }
  3059. })
  3060. }
  3061. })
  3062. }
  3063. },
  3064. // 接单
  3065. handleReceipt(row) {
  3066. if (row == undefined) {
  3067. this.receiptTemp = this.seeTemp
  3068. } else {
  3069. this.receiptTemp = Object.assign({}, row)
  3070. }
  3071. MessageBox.confirm('是否确认接单', {
  3072. title: '接单',
  3073. confirmButtonText: '确认',
  3074. cancelButtonText: '取消',
  3075. type: 'warning'
  3076. }).then(() => {
  3077. this.requestParam.name = 'takeRepirsEmp'
  3078. this.requestParam.parammaps = {}
  3079. this.requestParam.parammaps.id = this.receiptTemp.id
  3080. this.requestParam.parammaps.empid = Cookies.get('employeid')
  3081. PostDataByName(this.requestParam).then((response) => {
  3082. if (response.msg !== 'fail') {
  3083. this.get_table_data()
  3084. this.getPendingList()
  3085. this.dialogFormVisible_See = false
  3086. this.$notify({ title: '成功', message: '接单成功', type: 'success', duration: 2000 })
  3087. } else {
  3088. failproccess(response, this.$notify)
  3089. }
  3090. })
  3091. })
  3092. },
  3093. // 完成维修
  3094. handleRepairComplete(row) {
  3095. console.log('点击了完成维修', row)
  3096. if (row == undefined) {
  3097. this.$set(this.seeTemp, 'isOldProducts', 0)
  3098. this.repairCompleteTemp = this.seeTemp
  3099. } else {
  3100. this.repairCompleteTemp = Object.assign({}, row)
  3101. this.$set(this.repairCompleteTemp, 'isOldProducts', 0)
  3102. }
  3103. this.No2 = false
  3104. this.dialogStatus = 'repairComplete'
  3105. this.dialogFormVisible_RepairComplete = true
  3106. this.getFaultList()
  3107. var send_data2 = {
  3108. "name": "getpartapplyListBybig",
  3109. "parammaps":{ "RUCode": row.repairCode }
  3110. }
  3111. GetDataByName(send_data2).then(response => {
  3112. console.log('自动带出旧品内容数据', response.data.list)
  3113. if (response.data.list !== null) {
  3114. this.listAdd = response.data.list
  3115. } else {
  3116. this.listAdd = []
  3117. }
  3118. setTimeout(() => {
  3119. this.listLoading = false
  3120. }, 100)
  3121. })
  3122. },
  3123. changeIsOldProducts(val) {
  3124. console.log(val)
  3125. if (val == 1) {
  3126. this.No2 = true
  3127. //旧品录入
  3128. } else {
  3129. this.No2 = false
  3130. }
  3131. },
  3132. querySearchEqNameCont(queryString, cb) {
  3133. console.log('备件名称/设备内部编号模糊查询输入值', queryString)
  3134. this.requestEqName.parammaps['eqName'] = queryString
  3135. GetDataByName(this.requestEqName).then(response => {
  3136. console.log('备件名称模糊查询搜索data', response.data.list)
  3137. this.EqNameList = response.data.list
  3138. cb(this.EqNameList)
  3139. })
  3140. },
  3141. handleSelectEqNameCont(item, row) {
  3142. console.log('备件名称/设备内部编号模糊查询选中值', item.eqName)
  3143. console.log('备件名称/设备内部编号模糊查询选中值所在行', row)
  3144. this.$set(row, 'eqCode', item.eqCode)
  3145. this.$forceUpdate()
  3146. },
  3147. querySearchCodeCont(queryString, cb) {
  3148. console.log('备件名称/设备内部编号模糊查询输入值', queryString)
  3149. this.requestEqName.parammaps['eqCode'] = queryString
  3150. GetDataByName(this.requestEqName).then(response => {
  3151. console.log('备件名称模糊查询搜索data', response.data.list)
  3152. this.EqNameList = response.data.list
  3153. cb(this.EqNameList)
  3154. })
  3155. },
  3156. handleSelectEqCodeCont(item, row) {
  3157. console.log('备件名称/设备内部编号模糊查询选中值', item)
  3158. console.log('备件名称/设备内部编号模糊查询选中值所在行', row)
  3159. this.$set(row, 'eqName', item.eqName)
  3160. this.$forceUpdate()
  3161. },
  3162. blurSelectEqNameCont(item, row) {
  3163. this.$set(row, 'eqName', '')
  3164. this.$set(row, 'eqCode', '')
  3165. },
  3166. blurSelectEqCodeCont(item, row) {
  3167. this.$set(row, 'eqName', '')
  3168. this.$set(row, 'eqCode', '')
  3169. },
  3170. // 完成维修保存
  3171. createRepairCompleteData() {
  3172. console.log('点击了完成维修确认')
  3173. if (this.listFault.length > 0) {
  3174. if (this.repairCompleteTemp.laidcou == 0) {
  3175. if (this.repairCompleteTemp.isOldProducts == 0) {
  3176. console.log('否')
  3177. this.requestParam.name = 'completeRepirs'
  3178. this.requestParam.parammaps = {}
  3179. this.requestParam.parammaps.id = this.repairCompleteTemp.id
  3180. PostDataByName(this.requestParam).then((response) => {
  3181. if (response.msg !== 'fail') {
  3182. this.get_table_data()
  3183. this.getPendingList()
  3184. this.dialogFormVisible_RepairComplete = false
  3185. this.dialogFormVisible_See = false
  3186. this.$notify({ title: '成功', message: '成功', type: 'success', duration: 2000 })
  3187. } else {
  3188. failproccess(response, this.$notify)
  3189. }
  3190. })
  3191. } else {
  3192. console.log('是')
  3193. this.isokDisable = true
  3194. setTimeout(() => {
  3195. this.isokDisable = false
  3196. }, 1000)
  3197. this.$refs['repairCompleteTemp'].validate(valid => {
  3198. if (valid) {
  3199. if (this.listAdd.length !== 0) {
  3200. for (var i = 0; i < this.listAdd.length; i++) {
  3201. if (this.listAdd[i].acturalAmount == null || this.listAdd[i].acturalAmount == '') {
  3202. this.$message({
  3203. type: 'warning',
  3204. message: '请录入数量是否未填写',
  3205. duration: 2000
  3206. })
  3207. return false
  3208. } else if(this.listAdd[i].acturalAmount > this.listAdd[i].amount){
  3209. this.$message({
  3210. type: 'warning',
  3211. message: '录入数量不可大于领用数量',
  3212. duration: 2000
  3213. })
  3214. return false
  3215. } else{
  3216. var rulesActuralAmount = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
  3217. if (!rulesActuralAmount.test(parseFloat(this.listAdd[i].acturalAmount))) {
  3218. this.$message({ type: 'error', message: '录入数量请输入正数,最多保留两位小数点', duration: 2000 })
  3219. return false
  3220. }
  3221. }
  3222. }
  3223. this.postDataPramas.common = { 'returnmap': '0' }
  3224. this.postDataPramas.data = []
  3225. this.postDataPramas.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
  3226. this.postDataPramas.data[0].children = []
  3227. this.postDataPramas.data[0].children[0] = { 'name': 'insertRepirsRefuse', 'type': 'e', 'parammaps': {
  3228. pastureId: this.repairCompleteTemp.pastureId,
  3229. deptId: this.repairCompleteTemp.departmentId,
  3230. partCode: '@insertSpotList.partCode',
  3231. partName: '@insertSpotList.partName',
  3232. partId: '@insertSpotList.id',
  3233. specification: '@insertSpotList.specification',
  3234. unit: '@insertSpotList.unit',
  3235. acturalAmount: '@insertSpotList.acturalAmount',
  3236. eqId: this.repairCompleteTemp.eqId,
  3237. eqCode: this.repairCompleteTemp.eqCode,
  3238. eqName: this.repairCompleteTemp.eqName,
  3239. repairCode: this.repairCompleteTemp.repairCode,
  3240. listType: 0
  3241. }}
  3242. this.postDataPramas.data[1] = { 'name': 'completeRepirs', 'type': 'e', 'parammaps': {
  3243. id: this.repairCompleteTemp.id
  3244. }}
  3245. ExecDataByConfig(this.postDataPramas).then(response => {
  3246. console.log('完成维修-是-保存发送参数', this.postDataPramas)
  3247. if (response.msg === 'fail') {
  3248. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  3249. } else {
  3250. this.listAdd = []
  3251. this.dialogFormVisible_RepairComplete = false
  3252. this.dialogFormVisible_See = false
  3253. this.get_table_data()
  3254. this.getPendingList()
  3255. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  3256. }
  3257. })
  3258. return true
  3259. } else {
  3260. this.$notify({ title: '', message: '请完善旧品信息', type: 'warning', duration: 2000 })
  3261. return false
  3262. }
  3263. }
  3264. })
  3265. }
  3266. } else {
  3267. this.$notify({ message: '备件未领用不可完成维修', type: 'warning', duration: 2000 })
  3268. }
  3269. } else {
  3270. this.$message({ type: 'warning', message: '请完善故障信息!' })
  3271. }
  3272. },
  3273. oldProductsSearch(queryString, cb) {
  3274. console.log('旧品录入模糊查询输入值', queryString)
  3275. this.requestOldProducts.parammaps['partCode'] = queryString
  3276. this.requestOldProducts.parammaps['RUCode'] = this.repairCompleteTemp.repairCode
  3277. GetDataByName(this.requestOldProducts).then(response => {
  3278. console.log('旧品录入模糊查询搜索data', response.data.list)
  3279. cb(response.data.list)
  3280. })
  3281. },
  3282. handleSelectOldProducts(item) {
  3283. this.repairCompleteTemp.partCode = ''
  3284. console.log('旧品录入模糊查询选中值', item)
  3285. if (this.listAdd.length > 0) {
  3286. // eslint-disable-next-line no-redeclare
  3287. if (this.listAdd.find(obj => obj.id === item.id)) {
  3288. this.$message({ type: 'warning', message: '此旧品已存在,请重新选择旧品' })
  3289. } else {
  3290. if (item.checkoutNumber == null) {
  3291. this.$set(item, 'checkoutNumber', item.reportery)
  3292. }
  3293. this.listAdd.unshift(item)
  3294. }
  3295. } else {
  3296. if (item.checkoutNumber == null) {
  3297. this.$set(item, 'checkoutNumber', item.reportery)
  3298. }
  3299. this.listAdd.unshift(item)
  3300. }
  3301. },
  3302. partDelete(row) {
  3303. console.log(this.listAdd)
  3304. MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
  3305. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  3306. }).then(() => {
  3307. // console.log(this.list2)
  3308. for (var i = 0; i < this.listAdd.length; i++) {
  3309. console.log(this.listAdd[i])
  3310. if (this.listAdd[i].id === row.id) {
  3311. var listAddIndex = this.listAdd.indexOf(this.listAdd[i])
  3312. }
  3313. if (listAddIndex > -1) {
  3314. this.listAdd.splice(listAddIndex, 1)
  3315. return
  3316. }
  3317. }
  3318. })
  3319. },
  3320. // 维修及领用
  3321. handleMaintenanceRequisition(row) {
  3322. console.log('点击了维修及领用')
  3323. if (row == undefined) {
  3324. this.maintenanceRequisitionTemp = this.seeTemp
  3325. this.$set(this.maintenanceRequisitionTemp, 'repirsTime', parseTime(new Date(), '{y}-{m}-{d}'))
  3326. } else {
  3327. this.maintenanceRequisitionTemp = Object.assign({}, row)
  3328. this.$set(this.maintenanceRequisitionTemp, 'repirsTime', parseTime(new Date(), '{y}-{m}-{d}'))
  3329. }
  3330. this.dialogStatus = 'maintenanceRequisition'
  3331. this.dialogFormVisible_MaintenanceRequisition = true
  3332. this.getNewFaultList()
  3333. this.getPosition()
  3334. this.getCollectionSpareParts()
  3335. this.getCollectionSpareParts2()
  3336. },
  3337. getNewFaultList() {
  3338. this.listLoadingFault = true
  3339. this.getFaultListParm.parammaps.maintainId = this.maintenanceRequisitionTemp.id
  3340. GetDataByName(this.getFaultListParm).then(response => {
  3341. console.log('故障table数据', response.data.list)
  3342. if (response.data.list !== null) {
  3343. this.listNewFault = response.data.list
  3344. } else {
  3345. this.listNewFault = []
  3346. }
  3347. setTimeout(() => {
  3348. this.listLoadingFault = false
  3349. }, 100)
  3350. })
  3351. },
  3352. getNewCollarUseList() {
  3353. this.listLoadingCollarUse = true
  3354. this.getCollarUseListParm.parammaps.RUCode = this.maintenanceRequisitionTemp.repairCode
  3355. GetDataByName(this.getCollarUseListParm).then(response => {
  3356. console.log('领用记录table数据', response.data.list)
  3357. this.listCollarUse = response.data.list
  3358. setTimeout(() => {
  3359. this.listLoadingCollarUse = false
  3360. }, 100)
  3361. })
  3362. },
  3363. tabMaintenance(tab, event) {
  3364. console.log(tab.name)
  3365. if (tab.name == 'first') {
  3366. this.rapairBtn = true
  3367. } else {
  3368. this.rapairBtn = false
  3369. }
  3370. },
  3371. getPosition() {
  3372. this.getPositionsParm.parammaps.eqId = this.maintenanceRequisitionTemp.eqId
  3373. GetDataByName(this.getPositionsParm).then(response => {
  3374. console.log('故障部位数据', response.data.list)
  3375. this.positions = response.data.list
  3376. })
  3377. },
  3378. changePosition(val) {
  3379. console.log('故障部位输入值', val)
  3380. console.log(this.positions.find(obj => obj.id == val).positionName)
  3381. this.newFaultTemp.positionName = this.positions.find(obj => obj.id == val).positionName
  3382. this.getAppearanceParm.parammaps.id = val
  3383. this.getAppearance()
  3384. },
  3385. getAppearance() {
  3386. GetDataByName(this.getAppearanceParm).then(response => {
  3387. console.log('故障详情数据', response.data.list)
  3388. this.appearances = response.data.list
  3389. })
  3390. },
  3391. changeAppearance(val) {
  3392. console.log('故障详情输入值', val)
  3393. if (this.newFaultTemp.positionId == '') {
  3394. this.$message({
  3395. type: 'warning',
  3396. message: '请选择故障部位'
  3397. })
  3398. }
  3399. if (this.listNewFault == null) {
  3400. this.listNewFault = []
  3401. this.listNewFault.push({ 'rowId': this.rowId++, positionId: this.newFaultTemp.positionId, positionName: this.newFaultTemp.positionName, appearanceName: val, failureCause: this.newFaultTemp.failureCause, treatmentMethod: this.newFaultTemp.treatmentMethod })
  3402. this.newFaultTemp = {}
  3403. this.appearances = []
  3404. } else {
  3405. this.listNewFault.push({ 'rowId': this.rowId++, positionId: this.newFaultTemp.positionId, positionName: this.newFaultTemp.positionName, appearanceName: val, failureCause: this.newFaultTemp.failureCause, treatmentMethod: this.newFaultTemp.treatmentMethod })
  3406. this.newFaultTemp = {}
  3407. this.appearances = []
  3408. }
  3409. },
  3410. newFaultDelete(row) {
  3411. console.log(row)
  3412. MessageBox.confirm('确认删除?', {
  3413. confirmButtonText: '确认',
  3414. cancelButtonText: '取消',
  3415. type: 'warning'
  3416. }).then(() => {
  3417. for (var i = 0; i < this.listNewFault.length; i++) {
  3418. console.log(this.listNewFault[i])
  3419. if (this.listNewFault[i].rowId === row.rowId) {
  3420. var listNewFaultIndex = this.listNewFault.indexOf(this.listNewFault[i])
  3421. }
  3422. if (listNewFaultIndex > -1) {
  3423. this.listNewFault.splice(listNewFaultIndex, 1)
  3424. return
  3425. }
  3426. }
  3427. })
  3428. },
  3429. // 维修及领用-维修确认
  3430. createMaintenanceRequisitionteData() {
  3431. this.isokDisable = true
  3432. setTimeout(() => {
  3433. this.isokDisable = false
  3434. }, 1000)
  3435. this.$refs['maintenanceRequisitionTemp'].validate(valid => {
  3436. if (valid) {
  3437. console.log(this.newFaultTemp.positionId)
  3438. if (this.listNewFault.length == 0) {
  3439. this.$notify({ title: '', message: '请输入故障诊断', type: 'warning', duration: 2000 })
  3440. return false
  3441. } else {
  3442. for (let i = 0; i < this.listNewFault.length; i++) {
  3443. if (this.listNewFault[i].failureCause == '' || this.listNewFault[i].failureCause == undefined) {
  3444. this.$notify({ title: '', message: '请输入故障原因', type: 'warning', duration: 2000 })
  3445. return false
  3446. }
  3447. }
  3448. }
  3449. if (this.listNewFault.length !== 0) {
  3450. this.postDataPramas.common = { 'returnmap': '0' }
  3451. this.postDataPramas.data = []
  3452. this.postDataPramas.data[0] = { 'name': 'deleteMaintainAppearance', 'type': 'e', 'parammaps': {
  3453. maintainId: this.maintenanceRequisitionTemp.id
  3454. }}
  3455. this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listNewFault }}
  3456. this.postDataPramas.data[1].children = []
  3457. this.postDataPramas.data[1].children[0] = { 'name': 'insertMaintainAppearance', 'type': 'e', 'parammaps': {
  3458. appearanceName: '@insertSpotList.appearanceName',
  3459. positionId: '@insertSpotList.positionId',
  3460. positionName: '@insertSpotList.positionName',
  3461. repirsTime: this.maintenanceRequisitionTemp.repirsTime,
  3462. maintainId: this.maintenanceRequisitionTemp.id,
  3463. failureCause: '@insertSpotList.failureCause',
  3464. treatmentMethod: '@insertSpotList.treatmentMethod'
  3465. }}
  3466. ExecDataByConfig(this.postDataPramas).then(response => {
  3467. console.log('维修及领用-维修确认保存发送参数', this.postDataPramas)
  3468. if (response.msg === 'fail') {
  3469. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  3470. } else {
  3471. this.get_table_data()
  3472. this.getPendingList()
  3473. this.dialogFormVisible_MaintenanceRequisition = false
  3474. this.dialogFormVisible_See = false
  3475. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  3476. }
  3477. })
  3478. } else {
  3479. this.$notify({ title: '', message: '请选择故障', type: 'warning', duration: 2000 })
  3480. return false
  3481. }
  3482. }
  3483. })
  3484. },
  3485. getCollectionSpareParts() {
  3486. this.getCollarUseListParm.parammaps.RUCode = this.maintenanceRequisitionTemp.repairCode
  3487. GetDataByName(this.getCollarUseListParm).then(response => {
  3488. console.log('备件领用table数据', response.data.list)
  3489. this.listCollectionSpareParts = response.data.list
  3490. })
  3491. },
  3492. getCollectionSpareParts2() {
  3493. this.getCollarUseListParm2.parammaps.RUCode = this.maintenanceRequisitionTemp.repairCode
  3494. GetDataByName(this.getCollarUseListParm2).then(response => {
  3495. console.log('备件领用无库存table数据', response.data.list)
  3496. this.listCollectionSpareParts2 = response.data.list
  3497. })
  3498. },
  3499. openDetails(row, column, cell, event) {
  3500. if (column.label !== '操作') {
  3501. this.$router.push({ path: '/customs/Receive', query: { applyCode: row.applyCode }})
  3502. }
  3503. },
  3504. handleCollarUseSee(row, isStock) {
  3505. this.collectionSparePartsSeeTemp = Object.assign({}, row)
  3506. this.dialogStatus = 'collectionSparePartsSee'
  3507. this.dialogFormVisible_CollectionSparePartsSee = true
  3508. this.isCreatePartDelete = false
  3509. this.isPartCode = false
  3510. if (isStock == 0) {
  3511. this.collectionSparePartsSeeTemp.isStock = 0
  3512. this.getCollarUseSeeList()
  3513. } else if (isStock == 1) {
  3514. this.collectionSparePartsSeeTemp.isStock = 1
  3515. this.getCollarUseSeeList2()
  3516. }
  3517. },
  3518. getCollarUseSeeList() {
  3519. this.getCollarUseSeeParm.parammaps.id = this.collectionSparePartsSeeTemp.id
  3520. GetDataByName(this.getCollarUseSeeParm).then(response => {
  3521. this.listCreateCollectionSpareParts = response.data.list
  3522. })
  3523. },
  3524. getCollarUseSeeList2() {
  3525. // console.log(this.collectionSparePartsSeeTemp)
  3526. this.getCollarUseSeeParm2.parammaps.bigId = this.maintenanceRequisitionTemp.repairCode
  3527. GetDataByName(this.getCollarUseSeeParm2).then(response => {
  3528. this.listCreateCollectionSpareParts = response.data.list
  3529. })
  3530. },
  3531. handleCollectionSparePartsCreate() {
  3532. this.collectionSparePartsSeeTemp = this.maintenanceRequisitionTemp
  3533. this.collectionSparePartsSeeTemp.createDate = parseTime(new Date(), '{y}-{m}-{d}')
  3534. this.dialogStatus = 'collectionSparePartsCreate'
  3535. this.dialogFormVisible_CollectionSparePartsSee = true
  3536. this.isCreatePartDelete = true
  3537. this.listCreateCollectionSpareParts = []
  3538. this.isPartCode = true
  3539. this.getCreateNumber()
  3540. },
  3541. getCreateNumber() {
  3542. GetDataByName(this.getParmCreateNumber).then(response => {
  3543. this.$nextTick(() => {
  3544. console.log('新增领用单号', response.data.list[0].orderCode)
  3545. this.collectionSparePartsSeeTemp.applyCode = response.data.list[0].orderCode
  3546. this.$forceUpdate()
  3547. })
  3548. })
  3549. },
  3550. sparePartSearch(queryString, cb) {
  3551. console.log('备件模糊查询输入值', queryString)
  3552. this.requestSparePart.parammaps['partCode'] = queryString
  3553. GetDataByName(this.requestSparePart).then(response => {
  3554. console.log('备件模糊查询搜索data', response.data.list)
  3555. if (response.data.list == null) {
  3556. cb([])
  3557. } else {
  3558. cb(response.data.list)
  3559. }
  3560. })
  3561. },
  3562. handleSelectSparePart(item) {
  3563. console.log('备件模糊查询选中值', item)
  3564. if (this.listCreateCollectionSpareParts.length > 0) {
  3565. // eslint-disable-next-line no-redeclare
  3566. if (this.listCreateCollectionSpareParts.find(obj => obj.partId === item.partId)) {
  3567. this.$message({ type: 'warning', message: '此备件已存在,请重新选择备件' })
  3568. } else {
  3569. this.listCreateCollectionSpareParts.unshift(item)
  3570. }
  3571. } else {
  3572. this.listCreateCollectionSpareParts.unshift(item)
  3573. }
  3574. },
  3575. handleAddSparePartsToBeCollected() {
  3576. console.log('添加待领用备件')
  3577. this.addSparePartsToBeCollectedParam.parammaps.RUCode = this.maintenanceRequisitionTemp.repairCode
  3578. GetDataByName(this.addSparePartsToBeCollectedParam).then(response => {
  3579. if (response.data.list == null) {
  3580. this.$message({ type: 'warning', message: '无可添加待领用备件' })
  3581. } else {
  3582. if (this.listCreateCollectionSpareParts.length > 0) {
  3583. console.log(this.filtersArr(this.listCreateCollectionSpareParts, response.data.list))
  3584. this.listCreateCollectionSpareParts = this.filtersArr(this.listCreateCollectionSpareParts, response.data.list)
  3585. } else {
  3586. this.listCreateCollectionSpareParts = response.data.list
  3587. }
  3588. }
  3589. })
  3590. },
  3591. filtersArr(list, list2) {
  3592. for (var i = 0; i < list.length; i++) {
  3593. for (var j = 0; j < list2.length; j++) {
  3594. if (list[i].partId == list2[j].partId) {
  3595. list[i] = list2[j]
  3596. list2.splice(j, 1)
  3597. }
  3598. }
  3599. }
  3600. return list.concat(list2)
  3601. },
  3602. createPartDelete(row) {
  3603. console.log(this.listAdd)
  3604. MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
  3605. confirmButtonText: '确认',
  3606. cancelButtonText: '取消',
  3607. type: 'warning'
  3608. }).then(() => {
  3609. // console.log(this.list2)
  3610. for (var i = 0; i < this.listCreateCollectionSpareParts.length; i++) {
  3611. console.log(this.listCreateCollectionSpareParts[i])
  3612. if (this.listCreateCollectionSpareParts[i].id === row.id) {
  3613. var listCreateCollectionSparePartsIndex = this.listCreateCollectionSpareParts.indexOf(this.listCreateCollectionSpareParts[i])
  3614. }
  3615. if (listCreateCollectionSparePartsIndex > -1) {
  3616. this.listCreateCollectionSpareParts.splice(listCreateCollectionSparePartsIndex, 1)
  3617. return
  3618. }
  3619. }
  3620. })
  3621. },
  3622. handleViewProgress(row) {
  3623. console.log('查看进度', row)
  3624. console.log(this.maintenanceRequisitionTemp)
  3625. this.viewProgressTemp = Object.assign({}, row)
  3626. this.dialogStatus = 'ViewProgress'
  3627. this.dialogFormVisible_ViewProgress = true
  3628. this.getNumbers()
  3629. this.getPurchaseapplicationList()
  3630. this.getProcurementList()
  3631. },
  3632. getNumbers() {
  3633. this.getNumbersParm.parammaps.contractId = this.viewProgressTemp.contractId
  3634. this.getNumbersParm.parammaps.RUCode = this.maintenanceRequisitionTemp.repairCode
  3635. GetDataByName(this.getNumbersParm).then(response => {
  3636. this.numbersList = response.data.list[0]
  3637. })
  3638. },
  3639. // 申购情况
  3640. getPurchaseapplicationList() {
  3641. this.getPurchaseapplicationParm.parammaps.createDate = this.viewProgressTemp.date
  3642. this.getPurchaseapplicationParm.parammaps.partCode = this.viewProgressTemp.partCode
  3643. this.getPurchaseapplicationParm.parammaps.pastureId = this.viewProgressTemp.pastureId
  3644. GetDataByName(this.getPurchaseapplicationParm).then(response => {
  3645. if (response.data.list !== null) {
  3646. this.purchaseapplicationList = response.data.list
  3647. } else {
  3648. this.purchaseapplicationList = []
  3649. }
  3650. })
  3651. },
  3652. // 采购情况
  3653. getProcurementList() {
  3654. this.getProcurementParm.parammaps.createDate = this.viewProgressTemp.date
  3655. this.getProcurementParm.parammaps.partCode = this.viewProgressTemp.partCode
  3656. this.getProcurementParm.parammaps.pastureId = this.viewProgressTemp.pastureId
  3657. GetDataByName(this.getProcurementParm).then(response => {
  3658. if (response.data.list !== null) {
  3659. this.procurementList = response.data.list
  3660. } else {
  3661. this.procurementList = []
  3662. }
  3663. })
  3664. },
  3665. // 添加领用保存
  3666. createCollectionSparePartsData() {
  3667. this.isokDisable = true
  3668. setTimeout(() => {
  3669. this.isokDisable = false
  3670. }, 1000)
  3671. this.$refs['collectionSparePartsSeeTemp'].validate(valid => {
  3672. if (valid) {
  3673. if (this.listCreateCollectionSpareParts.length !== 0) {
  3674. for (var i = 0; i < this.listCreateCollectionSpareParts.length; i++) {
  3675. console.log(this.listCreateCollectionSpareParts[i].amount)
  3676. if (this.listCreateCollectionSpareParts[i].amount !== undefined && this.listCreateCollectionSpareParts[i].amount !== '') {
  3677. var rulesAmount = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
  3678. if (!rulesAmount.test(this.listCreateCollectionSpareParts[i].amount)) {
  3679. this.$message({
  3680. type: 'error',
  3681. message: '领用数量请输入正数,最多保留两位小数',
  3682. duration: 2000
  3683. })
  3684. return false
  3685. } else {
  3686. var listCreateCollectionSpareParts1 = [] // >库存
  3687. var listCreateCollectionSpareParts2 = [] // <=库存
  3688. var amountList = []
  3689. var amount2List = []
  3690. for (let i = 0; i < this.listCreateCollectionSpareParts.length; i++) {
  3691. var obj = {}
  3692. var obj2 = {}
  3693. obj.amount = this.listCreateCollectionSpareParts[i].amount
  3694. obj.bigId = this.listCreateCollectionSpareParts[i].bigId
  3695. obj.brand = this.listCreateCollectionSpareParts[i].brand
  3696. obj.brandId = this.listCreateCollectionSpareParts[i].brandId
  3697. obj.contractId = this.listCreateCollectionSpareParts[i].contractId
  3698. obj.enable = this.listCreateCollectionSpareParts[i].enable
  3699. obj.id = this.listCreateCollectionSpareParts[i].id
  3700. obj.inventoryType = this.listCreateCollectionSpareParts[i].inventoryType
  3701. obj.isZeroStock = this.listCreateCollectionSpareParts[i].isZeroStock
  3702. obj.partCode = this.listCreateCollectionSpareParts[i].partCode
  3703. obj.partId = this.listCreateCollectionSpareParts[i].partId
  3704. obj.partName = this.listCreateCollectionSpareParts[i].partName
  3705. obj.partRepId = this.listCreateCollectionSpareParts[i].partRepId
  3706. obj.pastureId = this.listCreateCollectionSpareParts[i].pastureId
  3707. obj.pastureName = this.listCreateCollectionSpareParts[i].pastureName
  3708. obj.planAmount = this.listCreateCollectionSpareParts[i].planAmount
  3709. obj.price = this.listCreateCollectionSpareParts[i].price
  3710. obj.providerId = this.listCreateCollectionSpareParts[i].providerId
  3711. obj.providerName = this.listCreateCollectionSpareParts[i].providerName
  3712. obj.remark = this.listCreateCollectionSpareParts[i].remark
  3713. obj.reportery = this.listCreateCollectionSpareParts[i].reportery
  3714. obj.specification = this.listCreateCollectionSpareParts[i].specification
  3715. obj.unit = this.listCreateCollectionSpareParts[i].unit
  3716. obj.prid = this.listCreateCollectionSpareParts[i].prid
  3717. obj.mr = this.listCreateCollectionSpareParts[i].mr
  3718. obj.locationId = this.listCreateCollectionSpareParts[i].locationId
  3719. amountList.push(obj)
  3720. obj2.amount = this.listCreateCollectionSpareParts[i].amount
  3721. obj2.bigId = this.listCreateCollectionSpareParts[i].bigId
  3722. obj2.brand = this.listCreateCollectionSpareParts[i].brand
  3723. obj2.brandId = this.listCreateCollectionSpareParts[i].brandId
  3724. obj2.contractId = this.listCreateCollectionSpareParts[i].contractId
  3725. obj2.enable = this.listCreateCollectionSpareParts[i].enable
  3726. obj2.id = this.listCreateCollectionSpareParts[i].id
  3727. obj2.inventoryType = this.listCreateCollectionSpareParts[i].inventoryType
  3728. obj2.isZeroStock = this.listCreateCollectionSpareParts[i].isZeroStock
  3729. obj2.partCode = this.listCreateCollectionSpareParts[i].partCode
  3730. obj2.partId = this.listCreateCollectionSpareParts[i].partId
  3731. obj2.partName = this.listCreateCollectionSpareParts[i].partName
  3732. obj2.partRepId = this.listCreateCollectionSpareParts[i].partRepId
  3733. obj2.pastureId = this.listCreateCollectionSpareParts[i].pastureId
  3734. obj2.pastureName = this.listCreateCollectionSpareParts[i].pastureName
  3735. obj2.planAmount = this.listCreateCollectionSpareParts[i].planAmount
  3736. obj2.price = this.listCreateCollectionSpareParts[i].price
  3737. obj2.providerId = this.listCreateCollectionSpareParts[i].providerId
  3738. obj2.providerName = this.listCreateCollectionSpareParts[i].providerName
  3739. obj2.remark = this.listCreateCollectionSpareParts[i].remark
  3740. obj2.reportery = this.listCreateCollectionSpareParts[i].reportery
  3741. obj2.specification = this.listCreateCollectionSpareParts[i].specification
  3742. obj2.unit = this.listCreateCollectionSpareParts[i].unit
  3743. obj2.prid = this.listCreateCollectionSpareParts[i].prid
  3744. obj.mr = this.listCreateCollectionSpareParts[i].mr
  3745. obj2.locationId = this.listCreateCollectionSpareParts[i].locationId
  3746. amount2List.push(obj2)
  3747. }
  3748. for (let i = 0; i < amountList.length; i++) {
  3749. if (parseFloat(amountList[i].amount) > parseFloat(amountList[i].reportery)) {
  3750. var amount = String(parseFloat(amountList[i].amount) - parseFloat(amountList[i].reportery))
  3751. amountList[i].amount = amount
  3752. listCreateCollectionSpareParts1.push(amountList[i])
  3753. if (parseFloat(amountList[i].reportery) > 0) {
  3754. amount2List[i].amount = String(amount2List[i].reportery)
  3755. listCreateCollectionSpareParts2.push(amount2List[i])
  3756. }
  3757. } else {
  3758. listCreateCollectionSpareParts2.push(amountList[i])
  3759. }
  3760. }
  3761. console.log(this.listCreateCollectionSpareParts, 'this.listCreateCollectionSpareParts')
  3762. console.log(listCreateCollectionSpareParts1, '>库存listCreateCollectionSpareParts1')
  3763. console.log(listCreateCollectionSpareParts2, '<=库存listCreateCollectionSpareParts2')
  3764. let mySumPrice = 0
  3765. for (let i = 0; i < listCreateCollectionSpareParts2.length; i++) {
  3766. mySumPrice += parseFloat(listCreateCollectionSpareParts2[i].price) * parseFloat(listCreateCollectionSpareParts2[i].amount)
  3767. }
  3768. if (mySumPrice > 500) {
  3769. this.collectionSparePartsSeeTemp.SHStatus = 2
  3770. } else {
  3771. this.collectionSparePartsSeeTemp.SHStatus = 9
  3772. }
  3773. this.postDataPramas.common = { 'returnmap': '0' }
  3774. this.postDataPramas.data = []
  3775. this.postDataPramas.data[0] = { 'name': 'insertSpotList3', 'resultmaps': { 'list': this.listCreateCollectionSpareParts }}
  3776. this.postDataPramas.data[0].children = []
  3777. this.postDataPramas.data[0].children[0] = { 'name': 'updatePartapplyuseAmount_m', 'type': 'e', 'parammaps': {
  3778. amount: '@insertSpotList3.amount',
  3779. paid: '@insertSpotList3.contractId',
  3780. RUCode: this.collectionSparePartsSeeTemp.repairCode
  3781. }}
  3782. this.postDataPramas.data[1] = { 'name': 'insertBigpartapply_m', 'type': 'e', 'parammaps': {
  3783. pastureId: this.collectionSparePartsSeeTemp.pastureId,
  3784. applyCode: this.collectionSparePartsSeeTemp.applyCode,
  3785. applyType: 1,
  3786. departmentId: this.collectionSparePartsSeeTemp.departmentId,
  3787. empId: this.collectionSparePartsSeeTemp.pickId,
  3788. applyDate: this.collectionSparePartsSeeTemp.createDate,
  3789. RUCode: this.collectionSparePartsSeeTemp.repairCode
  3790. }}
  3791. this.postDataPramas.data[2] = { 'name': 'insertSpotList2', 'resultmaps': { 'list': listCreateCollectionSpareParts1 }}
  3792. this.postDataPramas.data[2].children = []
  3793. this.postDataPramas.data[2].children[0] = { 'name': 'insertpartapply_m', 'type': 'e', 'parammaps': {
  3794. bigId: this.collectionSparePartsSeeTemp.repairCode,
  3795. prid: '@insertSpotList2.prid',
  3796. pastureId: '@insertSpotList2.pastureId',
  3797. partId: '@insertSpotList2.partId',
  3798. partCode: '@insertSpotList2.partCode',
  3799. partName: '@insertSpotList2.partName',
  3800. specification: '@insertSpotList2.specification',
  3801. brandId: '@insertSpotList2.brandId',
  3802. price: '@insertSpotList2.price',
  3803. amount: '@insertSpotList2.amount',
  3804. eqName: this.collectionSparePartsSeeTemp.eqName,
  3805. eqCode: this.collectionSparePartsSeeTemp.eqCode,
  3806. providerId: '@insertSpotList2.providerId',
  3807. note: '@insertSpotList2.note',
  3808. reportery: '@insertSpotList2.reportery',
  3809. contractId: '@insertSpotList2.contractId'
  3810. }}
  3811. if (listCreateCollectionSpareParts2.length > 0) {
  3812. this.postDataPramas.data[3] = { 'name': 'insertBigpartapply', 'type': 'e', 'parammaps': {
  3813. pastureId: this.collectionSparePartsSeeTemp.pastureId,
  3814. applyCode: this.collectionSparePartsSeeTemp.applyCode,
  3815. applyType: 1,
  3816. departmentId: this.collectionSparePartsSeeTemp.departmentId,
  3817. empId: this.collectionSparePartsSeeTemp.pickId,
  3818. applyDate: this.collectionSparePartsSeeTemp.createDate,
  3819. RUCode: this.collectionSparePartsSeeTemp.repairCode,
  3820. SHStatus: this.collectionSparePartsSeeTemp.SHStatus
  3821. }}
  3822. this.postDataPramas.data[4] = { 'name': 'insertSpotList', 'resultmaps': { 'list': listCreateCollectionSpareParts2 }}
  3823. this.postDataPramas.data[4].children = []
  3824. this.postDataPramas.data[4].children[0] = { 'name': 'insertpartapply', 'type': 'e', 'parammaps': {
  3825. bigId: '@insertBigpartapply.LastInsertId',
  3826. pastureId: '@insertSpotList.pastureId',
  3827. partId: '@insertSpotList.partId',
  3828. partCode: '@insertSpotList.partCode',
  3829. partName: '@insertSpotList.partName',
  3830. specification: '@insertSpotList.specification',
  3831. brandId: '@insertSpotList.brandId',
  3832. price: '@insertSpotList.price',
  3833. amount: '@insertSpotList.amount',
  3834. eqName: this.collectionSparePartsSeeTemp.eqName,
  3835. eqCode: this.collectionSparePartsSeeTemp.eqCode,
  3836. providerId: '@insertSpotList.providerId',
  3837. note: '@insertSpotList.note',
  3838. reportery: '@insertSpotList.reportery',
  3839. contractId: '@insertSpotList.contractId',
  3840. locationId: '@insertSpotList.locationId'
  3841. }}
  3842. }
  3843. ExecDataByConfig(this.postDataPramas).then(response => {
  3844. console.log('添加领用保存发送参数', this.postDataPramas)
  3845. if (response.msg === 'fail') {
  3846. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  3847. } else {
  3848. this.dialogFormVisible_CollectionSparePartsSee = false
  3849. this.getCollectionSpareParts()
  3850. this.getCollectionSpareParts()
  3851. this.getCollectionSpareParts2()
  3852. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  3853. }
  3854. })
  3855. return true
  3856. }
  3857. } else {
  3858. this.$message({ type: 'error', message: '请检查领用数量是否未填写', duration: 2000 })
  3859. return false
  3860. }
  3861. }
  3862. } else {
  3863. this.$notify({ title: '', type: 'warning', message: '请选择备件', duration: 2000 })
  3864. return false
  3865. }
  3866. }
  3867. })
  3868. },
  3869. form_delete(row) {
  3870. MessageBox.confirm('确认删除?', {
  3871. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  3872. }).then(() => {
  3873. this.requestParam.name = 'deleteMaintain'
  3874. this.requestParam.parammaps = {}
  3875. this.requestParam.parammaps.id = row.id
  3876. PostDataByName(this.requestParam).then((response) => {
  3877. if (response.msg !== 'fail') {
  3878. this.get_table_data()
  3879. this.getPendingList()
  3880. this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
  3881. } else {
  3882. failproccess(response, this.$notify)
  3883. }
  3884. })
  3885. }).catch(() => {
  3886. this.$message({ type: 'info', message: '已取消删除' })
  3887. })
  3888. },
  3889. handleRejectRepair(row) {
  3890. console.log('报修驳回')
  3891. this.rejectRepair.temp = Object.assign({}, row)
  3892. this.dialogStatus = 'rejectRepair'
  3893. this.rejectRepair.dialogFormVisible = true
  3894. },
  3895. rejectRepairData() {
  3896. console.log('报修驳回确认')
  3897. this.isokDisable = true
  3898. setTimeout(() => {
  3899. this.isokDisable = false
  3900. }, 1000)
  3901. this.$refs['rejectRepair'].validate(valid => {
  3902. if (valid) {
  3903. this.requestParam.name = 'updateMaintain'
  3904. this.requestParam.parammaps = {}
  3905. this.requestParam.parammaps.shutdownPerson = Cookies.get('employeid')
  3906. this.requestParam.parammaps.id = this.rejectRepair.temp.id
  3907. this.requestParam.parammaps.shutdownReason = this.rejectRepair.temp.shutdownReason
  3908. PostDataByName(this.requestParam).then((response) => {
  3909. if (response.msg !== 'fail') {
  3910. this.get_table_data()
  3911. this.getPendingList()
  3912. this.rejectRepair.dialogFormVisible = false
  3913. this.$notify({ title: '成功', message: '驳回成功', type: 'success', duration: 2000 })
  3914. } else {
  3915. failproccess(response, this.$notify)
  3916. }
  3917. })
  3918. }
  3919. })
  3920. },
  3921. handleDownload() {
  3922. this.$alert('设备维修正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
  3923. this.isPercentage = true
  3924. this.percentage = 1
  3925. var timer = setInterval(() => {
  3926. this.percentage += 5
  3927. if (this.percentage > 95) {
  3928. this.percentage = 99
  3929. clearInterval(timer)
  3930. }
  3931. this.percentage = this.percentage
  3932. }, 1000)
  3933. this.downLoadParm = {}
  3934. this.downLoadParm.name = 'loadRepirsList'
  3935. this.downLoadParm.offset = 0
  3936. this.downLoadParm.page = 1
  3937. this.downLoadParm.returntype = 'Map'
  3938. if (this.$refs['inputDatetime'] !== undefined && this.$refs['inputDatetime'].value !== null) {
  3939. this.getdataListParm.parammaps.startTime = this.$refs['inputDatetime'].value[0]
  3940. this.getdataListParm.parammaps.stopTime = this.$refs['inputDatetime'].value[1]
  3941. } else {
  3942. this.getdataListParm.parammaps.startTime = ''
  3943. this.getdataListParm.parammaps.stopTime = ''
  3944. }
  3945. this.downLoadParm.parammaps = this.getdataListParm.parammaps
  3946. GetAccount(this.downLoadParm).then(response => {
  3947. if(response.data.list !== null && response.data.list !== ''){
  3948. for(let i=0;i<response.data.list.length;i++){
  3949. if(response.data.list[i].orderStatue == 0){
  3950. this.$set(response.data.list[i],'orderStatue','待接单')
  3951. }else if(response.data.list[i].orderStatue == 1){
  3952. this.$set(response.data.list[i],'orderStatue','维修中')
  3953. }else if(response.data.list[i].orderStatue == 2){
  3954. this.$set(response.data.list[i],'orderStatue','维修完成')
  3955. }else if(response.data.list[i].orderStatue == 3){
  3956. this.$set(response.data.list[i],'orderStatue','已驳回')
  3957. }
  3958. if (response.data.list[i].SHStatue == 1) {
  3959. this.$set(response.data.list[i],'SHStatue','')
  3960. } else if (response.data.list[i].SHStatue == 2 || response.data.list[i].SHStatue == 3) {
  3961. this.$set(response.data.list[i],'SHStatue','审核中')
  3962. } else if (response.data.list[i].SHStatue == 4 || response.data.list[i].SHStatue == 6) {
  3963. this.$set(response.data.list[i],'SHStatue','未通过')
  3964. } else if (response.data.list[i].SHStatue == 5) {
  3965. this.$set(response.data.list[i],'SHStatue','已通过')
  3966. }
  3967. }
  3968. }else{
  3969. response.data.list = []
  3970. }
  3971. this.downLoadList = response.data.list
  3972. console.log(this.downLoadList)
  3973. if (response.data.list !== '') {
  3974. this.percentage = 99
  3975. setTimeout(() => {
  3976. this.isPercentage = false
  3977. }, 2000)
  3978. }
  3979. const elecExcelDatas = [
  3980. {
  3981. tHeader: ['报修单号', '牧场', '设备内部编号', '设备名称', '规格型号', '部门', '故障情况','报修人','报修时间','维修日期','维修部门','处理状态','领用单状态','旧品录入状态','审核状态','故障部位','故障详情','故障原因','处理方式'],
  3982. filterVal: ['repairCode', 'pastureName', 'eqCode', 'eqName', 'specification', 'departmentName', 'details','requesterName','requestTime','stopTime','repairDeptName','orderStatue','LYStatue','LRStatue','SHStatue','positionName','appearanceName','failureCause','treatmentMethod'],
  3983. tableDatas: this.downLoadList,
  3984. sheetName: '设备维修'
  3985. }
  3986. ]
  3987. json2excel(elecExcelDatas, '设备维修', true, 'xlsx')
  3988. })
  3989. },
  3990. }
  3991. }
  3992. </script>
  3993. <style lang="scss" scoped>
  3994. .successMaintenanceAudit{
  3995. width: 70px;
  3996. color: #fff;
  3997. }
  3998. .successRequisition{
  3999. width: 80px;
  4000. color: #fff;
  4001. }
  4002. /deep/ .el-badge__content.is-fixed{
  4003. z-index: 1;
  4004. }
  4005. </style>
  4006. <style lang="scss">
  4007. .el-step__head.is-success {
  4008. color: #409EFF;
  4009. border-color: #409EFF;
  4010. }
  4011. .el-step__title.is-success{
  4012. color: #409EFF;
  4013. }
  4014. .el-step__head.is-process{
  4015. color: #409EFF;
  4016. border-color: #409EFF;
  4017. .el-step__icon.is-text{
  4018. background: #409EFF;
  4019. color: #fff;
  4020. }
  4021. }
  4022. .step-row{
  4023. color: #000;
  4024. }
  4025. </style>