index.vue 148 KB

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