index.vue 187 KB

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