index.vue 190 KB

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